Skip to content

Commit

Permalink
make default gen_mksurfdata generated scripts have a .sh extension
Browse files Browse the repository at this point in the history
  • Loading branch information
ekluzek committed Apr 11, 2024
1 parent 5b1ee03 commit 705d0c7
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,8 @@ ctsm.input_data_list.previous
/tools/mksurfdata_esmf/mksurfdata_in
/tools/mksurfdata_esmf/surfdata_*.nc
/tools/mksurfdata_esmf/landuse.timeseries_*.nc
/tools/mksurfdata_esmf/mksurfdata_jobscript_multi
/tools/mksurfdata_esmf/mksurfdata_jobscript_single
/tools/mksurfdata_esmf/mksurfdata_jobscript_multi.sh
/tools/mksurfdata_esmf/mksurfdata_jobscript_single.sh
/tools/mksurfdata_esmf/pio_iotype.txt
/tools/mksurfdata_esmf/*.sh
/tools/mksurfdata_esmf/tool_bld
Expand Down
4 changes: 2 additions & 2 deletions cime_config/SystemTests/mksurfdataesmf.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def __init__(self, case):
time_stamp = datetime.today().strftime("%y%m%d")
self._res = "10x15" # see important comment in script's docstring
self._model_yr = "1850"
self._jobscript = os.path.join(self._get_caseroot(), "mksurfdata_jobscript_single")
self._jobscript = os.path.join(self._get_caseroot(), "mksurfdata_jobscript_single.sh")
self._fsurdat_namelist = os.path.join(
self._get_caseroot(),
f"surfdata_{self._res}_hist_{self._model_yr}_78pfts_c{time_stamp}.namelist",
Expand All @@ -62,7 +62,7 @@ def build_phase(self, sharedlib_only=False, model_only=False):
# Paths and strings
build_script_path = os.path.join(self._tool_path, "gen_mksurfdata_build.sh")
nml_script_path = os.path.join(self._tool_path, "gen_mksurfdata_namelist")
gen_jobscript_path = os.path.join(self._tool_path, "gen_mksurfdata_jobscript_single")
gen_jobscript_path = os.path.join(self._tool_path, "gen_mksurfdata_jobscript_single.sh")
gen_mksurfdata_namelist = f"{nml_script_path} --res {self._res} --start-year {self._model_yr} --end-year {self._model_yr}"
gen_mksurfdata_jobscript = f"{gen_jobscript_path} --number-of-nodes 1 --tasks-per-node 64 --namelist-file {self._fsurdat_namelist} --bld-path {self._tool_bld}"

Expand Down
2 changes: 1 addition & 1 deletion python/ctsm/toolchain/gen_mksurfdata_jobscript_multi.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ def get_parser():
"""
Get parser object for this script.
"""
parser = base_get_parser(default_js_name="mksurfdata_jobscript_multi")
parser = base_get_parser(default_js_name="mksurfdata_jobscript_multi.sh")

parser.add_argument(
"--scenario",
Expand Down
2 changes: 1 addition & 1 deletion python/ctsm/toolchain/gen_mksurfdata_jobscript_single.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
logger = logging.getLogger(__name__)


def base_get_parser(default_js_name="mksurfdata_jobscript_single"):
def base_get_parser(default_js_name="mksurfdata_jobscript_single.sh"):
"""
Get parser object for the gen_mksurfdata_jobscript scripts
"""
Expand Down
4 changes: 2 additions & 2 deletions tools/README
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ III. Process sequence to create input datasets needed to run CTSM
gridnames.

5.) Create surface datasets with mksurfdata_esmf on Derecho
(See mksurfdata_esmf/README for more help on doing this)
(See mksurfdata_esmf/README.md for more help on doing this)

- gen_mksurfdata_build.sh to build
- gen_mksurfdata_namelist to build the namelist
Expand All @@ -216,7 +216,7 @@ III. Process sequence to create input datasets needed to run CTSM
./gen_mksurfdata_build.sh
./gen_mksurfdata_namelist --res 0.9x1.25 --start-year 1850 --end-year 1850
./gen_mksurfdata_jobscript_single --number-of-nodes 24 --tasks-per-node 12 --namelist-file target.namelist
qsub mksurfdata_jobscript_single
qsub mksurfdata_jobscript_single.sh

NOTE that surface dataset will be used by default for fatmgrid - and it will
contain the lat,lon,edges and area values for the atm grid - ASSUMING that
Expand Down
4 changes: 2 additions & 2 deletions tools/mksurfdata_esmf/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ for example try --res 1.9x2.5 --start-year 1850 --end-year 1850:
``` shell
# Assuming pwd is the tools/mksurfdata_esmf directory
./gen_mksurfdata_jobscript_single --number-of-nodes 2 --tasks-per-node 128 --namelist-file target.namelist
qsub mksurfdata_jobscript_single
qsub mksurfdata_jobscript_single.sh
```

Read note about regional grids at the end.
Expand All @@ -167,7 +167,7 @@ for example try --res 1.9x2.5 --start-year 1850 --end-year 1850:
``` shell
# Assuming pwd is the tools/mksurfdata_esmf directory
./gen_mksurfdata_jobscript_multi --number-of-nodes 2 --scenario global-present
qsub mksurfdata_jobscript_multi
qsub mksurfdata_jobscript_multi.sh
```

If you are looking to generate all (or a large number of) the datasets or the
Expand Down

0 comments on commit 705d0c7

Please sign in to comment.