Skip to content

Commit 4bae9b4

Browse files
authored
ILAMB for Compy (#247)
1 parent 6b386f0 commit 4bae9b4

File tree

5 files changed

+16
-4
lines changed

5 files changed

+16
-4
lines changed

zppy/ilamb_run.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
import pprint
33

44
import jinja2
5+
from mache import MachineInfo
56

67
from zppy.bundle import handle_bundles
78
from zppy.utils import (
@@ -48,6 +49,11 @@ def ilamb_run(config, scriptDir, existing_bundles):
4849
else:
4950
c["sub"] = c["grid"]
5051

52+
if c["ilamb_obs"] == "":
53+
ilamb_obs_prefix = MachineInfo().config.get("diagnostics", "base_path")
54+
ilamb_obs_suffix = "ilamb_data"
55+
c["ilamb_obs"] = os.path.join(ilamb_obs_prefix, ilamb_obs_suffix)
56+
5157
# List of dependencies
5258
dependencies.append(
5359
os.path.join(

zppy/templates/default.ini

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -274,6 +274,7 @@ ts_years = string_list(default=list(""))
274274

275275
[ilamb_run]
276276
cfg = string(default="ilamb_run/cmip.cfg")
277+
ilamb_obs = string(default="")
277278
land_only = boolean(default=False)
278279
ts_atm_subsection = string(default="atm_monthly_180x360_aave")
279280
ts_land_subsection = string(default="land_monthly")

zppy/templates/ilamb_run.bash

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,8 @@ if [[ "${debug,,}" == "true" ]]; then
99
set -x
1010
fi
1111

12-
# Point to obsersvation data
13-
# TODO: need to update these data to other supported machines
14-
export ILAMB_ROOT=/lcrc/group/acme/public_html/diagnostics/ilamb_data
12+
# Point to observation data
13+
export ILAMB_ROOT={{ ilamb_obs }}
1514

1615
# Script dir
1716
cd {{ scriptDir }}
@@ -58,6 +57,7 @@ echo ===== RUN ILAMB =====
5857
echo
5958

6059
# Run diagnostics
60+
# Not required TODO?
6161
# TODO: find the mpi run format for different platforms
6262

6363
# include cfg file

zppy/templates/ts.bash

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ cat > default_metadata.json << EOF
121121
{% include cmip_metadata %}
122122
EOF
123123
{
124-
export cmortables_dir=/lcrc/group/acme/public_html/diagnostics/cmip6-cmor-tables/Tables
124+
export cmortables_dir={{ cmor_tables_prefix }}/cmip6-cmor-tables/Tables
125125
input_dir={{ output }}/post/{{ component }}/{{ grid }}/ts/{{ frequency }}/{{ '%dyr' % (ypf) }}
126126
dest_cmip={{ output }}/post/{{ component }}/{{ grid }}/cmip_ts/{{ frequency }}
127127
mkdir -p ${dest_cmip}

zppy/ts.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import re
44

55
import jinja2
6+
from mache import MachineInfo
67

78
from zppy.bundle import handle_bundles
89
from zppy.utils import (
@@ -57,6 +58,10 @@ def ts(config, scriptDir, existing_bundles):
5758
# Component
5859
c["component"] = getComponent(c["input_files"])
5960

61+
machine_info = MachineInfo()
62+
cmor_tables_prefix = machine_info.config.get("diagnostics", "base_path")
63+
c["cmor_tables_prefix"] = cmor_tables_prefix
64+
6065
# Loop over year sets
6166
year_sets = getYears(c["years"])
6267
for s in year_sets:

0 commit comments

Comments
 (0)