Returns a (multi-line) String representing the queue script, e.g. PBS script.
        Uses the template_file along with internal parameters to create the script.

        Args:
            job_name: Name of the job.
            launch_dir: (str) The directory the job will be launched in.
            executable: String with the name of the executable to be executed or list of commands
            qout_path Path of the Queue manager output file.
            qerr_path: Path of the Queue manager error file.
            exec_args: List of arguments passed to executable (used only if executable is a string, default: empty)

def get_script_str(self, job_name, launch_dir, executable, qout_path, qerr_path,
                       stdin=None, stdout=None, stderr=None, exec_args=None):
        """
        Returns a (multi-line) String representing the queue script, e.g. PBS script.
        Uses the template_file along with internal parameters to create the script.

        Args:
            job_name: Name of the job.
            launch_dir: (str) The directory the job will be launched in.
            executable: String with the name of the executable to be executed or list of commands
            qout_path Path of the Queue manager output file.
            qerr_path: Path of the Queue manager error file.
            exec_args: List of arguments passed to executable (used only if executable is a string, default: empty)
        """
        # PbsPro does not accept job_names longer than 15 chars.
        if len(job_name) > 14 and isinstance(self, PbsProAdapter):
            job_name = job_name[:14]

        # Construct the header for the Queue Manager.
        qheader = self._make_qheader(job_name, qout_path, qerr_path)

        # Add the bash section.
        se = ScriptEditor()

        # Cd to launch_dir immediately.
        se.add_line("cd " + os.path.abspath(launch_dir))

        if self.setup:
            se.add_comment("Setup section")
            se.add_lines(self.setup)
            se.add_emptyline()

        if self.modules:
            # stderr is redirected to mods.err file.
            # module load 2>> mods.err
            se.add_comment("Load Modules")
            se.add_line("module purge")
            se.load_modules(self.modules)
            se.add_emptyline()

        se.add_comment("OpenMp Environment")
        if self.has_omp:
            se.declare_vars(self.omp_env)
            se.add_emptyline()
        else:
            se.declare_vars({"OMP_NUM_THREADS": 1})

        if self.shell_env:
            se.add_comment("Shell Environment")
            se.declare_vars(self.shell_env)
            se.add_emptyline()

        if self.pre_run:
            se.add_comment("Commands before execution")
            se.add_lines(self.pre_run)
            se.add_emptyline()

        # Construct the string to run the executable with MPI and mpi_procs.
        if is_string(executable):
            line = self.mpi_runner.string_to_run(self, executable,
                                                 stdin=stdin, stdout=stdout, stderr=stderr, exec_args=exec_args)
            se.add_line(line)
        else:
            assert isinstance(executable, (list, tuple))
            se.add_lines(executable)

        if self.post_run:
            se.add_emptyline()
            se.add_comment("Commands after execution")
            se.add_lines(self.post_run)

        return qheader + se.get_script_str() + "\n"