Skip to content

Commit 0713445

Browse files
committed
Change template again
1 parent 34cd189 commit 0713445

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

src/access_mopper/templates/cmor_job_script.j2

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
#!/bin/bash
2-
#PBS -N cmor_{{ variable }}
2+
#PBS -N cmor_{{ variable | replace('.', '_') }}
33
#PBS -q {{ config.get('queue', 'normal') }}
44
#PBS -l ncpus={{ config.get('cpus_per_node', 4) }}
55
#PBS -l mem={{ config.get('mem', '16GB') }}
66
#PBS -l walltime={{ config.get('walltime', '01:00:00') }}
7-
#PBS -o {{ script_dir }}/cmor_{{ variable }}.out
8-
#PBS -e {{ script_dir }}/cmor_{{ variable }}.err
7+
#PBS -o {{ script_dir }}/cmor_{{ variable | replace('.', '_') }}.out
8+
#PBS -e {{ script_dir }}/cmor_{{ variable | replace('.', '_') }}.err
99
{{ config.get('scheduler_options', '#PBS -P your_project') }}
1010
{% if config.get('storage') %}#PBS -l storage={{ config.get('storage') }}{% endif %}
1111

@@ -23,7 +23,7 @@ sys.path.insert(0, '{{ package_path }}')
2323
from access_mopper import ACCESS_ESM_CMORiser
2424
from access_mopper.tracking import TaskTracker
2525
26-
config = json.loads('{{ config | tojson | replace(\"'\", \"\\'\") }}')
26+
config = json.loads('{{ config | tojson }}')
2727
variable = os.environ['VARIABLE']
2828
db_path = os.environ['CMOR_TRACKER_DB']
2929
@@ -34,7 +34,7 @@ if not pattern:
3434
full_pattern = str(Path(input_folder) / pattern)
3535
input_files = glob.glob(full_pattern)
3636
if not input_files:
37-
raise ValueError(f'No files found for pattern {pattern}')
37+
raise ValueError(f'No files found for pattern {full_pattern}')
3838
3939
print(f'Processing {variable} with {len(input_files)} files')
4040
@@ -59,6 +59,7 @@ try:
5959
drs_root=config.get('drs_root'),
6060
)
6161
cmoriser.run()
62+
cmoriser.write()
6263
tracker.mark_done(variable, exp)
6364
print(f'Completed: {variable}')
6465
except Exception as e:

0 commit comments

Comments
 (0)