diff --git a/.gitmodules b/.gitmodules
index 1ee425d..f885443 100644
--- a/.gitmodules
+++ b/.gitmodules
@@ -1,7 +1,7 @@
[submodule "WW3"]
path = WW3
url = https://github.com/ESCOMP/WW3.git
-fxtag = dev/unified_0.0.14
+fxtag = dev/unified_0.0.15
fxrequired = AlwaysRequired
fxDONOTUSEurl = https://github.com/ESCOMP/WW3.git
diff --git a/WW3 b/WW3
index 32b667d..9ea1d89 160000
--- a/WW3
+++ b/WW3
@@ -1 +1 @@
-Subproject commit 32b667de558e7c928f1e6a7baf71e5b5436d178b
+Subproject commit 9ea1d89550db30dd2eb22cb1018f16506941be74
diff --git a/cime_config/buildnml b/cime_config/buildnml
index 680ea17..f24accd 100755
--- a/cime_config/buildnml
+++ b/cime_config/buildnml
@@ -36,6 +36,7 @@ def _create_namelists(case, confdir, namelist_infile, nmlgen, data_list_path):
run_type = case.get_value("RUN_TYPE")
config["runtype"] = run_type
config["wav_grid"] = case.get_value("WAV_GRID")
+ config["ww3_moddef"] = case.get_value("WW3_MODDEF")
rundir = case.get_value("RUNDIR")
start_date = case.get_value("RUN_STARTDATE")
@@ -63,6 +64,15 @@ def _create_namelists(case, confdir, namelist_infile, nmlgen, data_list_path):
filename = "%s.ww3.r.%s-%s" %(run_refcase, run_refdate, run_tod)
nmlgen.add_default("initfile", value=filename, ignore_abs_path=True)
else:
+ user_initfile = nmlgen.get_value("initfile")
+ if (case.get_value("WW3_MODDEF") != 'unset'
+ and not (user_initfile and user_initfile.strip().strip("'\"").strip())):
+ expect(False,
+ "WW3_MODDEF is set to a user-supplied mod_def file, but no "
+ "initfile was provided. When you supply your own WW3_MODDEF, "
+ "you must also supply initfile via user_nl_ww3 (e.g., "
+ "initfile = '/path/to/restart.ww3'). Alternatively, unset "
+ "WW3_MODDEF to use the auto-generated calm_strt.ww3.")
nmlgen.add_default("initfile")
# error check
@@ -190,15 +200,19 @@ def _prestage_inputs(case):
rundir = case.get_value("RUNDIR")
# Create rundir/ww3_moddef_create
- filename = "ww3_grid"
bldroot = os.path.join(case.get_value("EXEROOT"),"wav","obj")
- item = os.path.join(bldroot, filename)
- if os.path.isfile(item):
+ bld_ww3_grid = os.path.join(bldroot, "ww3_grid") # executable to create mod_def.ww3 file
+ if os.path.isfile(bld_ww3_grid):
+ bld_ww3_strt = os.path.join(bldroot, "ww3_strt") # executable to create ww3 i.c. file
+ if not os.path.isfile(bld_ww3_strt):
+ raise RuntimeError("ww3_strt executable not found in {} while ww3_grid is available".format(bldroot))
ww3_moddef_dir = os.path.join(rundir, "ww3_moddef_create")
if not os.path.exists(ww3_moddef_dir):
os.makedirs(ww3_moddef_dir)
- if not os.path.exists(os.path.join(ww3_moddef_dir,filename)):
- safe_copy(item, ww3_moddef_dir)
+ if not os.path.exists(os.path.join(ww3_moddef_dir, "ww3_grid")):
+ safe_copy(bld_ww3_grid, ww3_moddef_dir)
+ if not os.path.exists(os.path.join(ww3_moddef_dir, "ww3_strt")):
+ safe_copy(bld_ww3_strt, ww3_moddef_dir)
if case.get_value("WW3_MODDEF") == 'unset':
# Create output dir ww3_moddef_create if appropriate
@@ -208,20 +222,34 @@ def _prestage_inputs(case):
# Copy ww3_inp and other needed info to ww3_moddef_create directory
input_dir = case.get_value("WW3_GRID_INP_DIR")
- files = os.listdir(input_dir)
- for filename in files:
- if not os.path.isfile(os.path.join(output_dir, filename)):
- safe_copy(os.path.join(input_dir, filename), os.path.join(output_dir, filename))
+ if os.path.isdir(input_dir):
+ files = os.listdir(input_dir)
+ for filename in files:
+ if not os.path.isfile(os.path.join(output_dir, filename)):
+ safe_copy(os.path.join(input_dir, filename), os.path.join(output_dir, filename))
# Create mod_def file using ww3_grid and the grid_input files
- if os.path.isfile(os.path.join(output_dir,"ww3_grid")):
+ if not os.path.isfile(os.path.join(output_dir,"ww3_grid")):
+ logger.warning("ww3_grid file not found. The mod_def.ww3 file will be created after the build phase.")
+ elif not os.path.isfile(os.path.join(output_dir,"ww3_grid.inp")):
+ logger.warning("ww3_grid.inp file not found. The file will automatically be downloaded at the ./case.submit phase.")
+ else:
+ # Generate mod_def.ww3 file using ww3_grid executable and the grid_input files
run_cmd("./ww3_grid > mod_def.ww3.log", from_dir=output_dir)
if not os.path.isfile(os.path.join(output_dir,"mod_def.ww3")):
raise RuntimeError("mod_def.ww3 was not created, check mod_def.ww3.log for errors.")
+ # Generate ww3_strt.ww3 file using ww3_strt executable and the grid_input files
+ if not os.path.isfile(os.path.join(output_dir,"ww3_strt")):
+ raise RuntimeError("ww3_strt file not found.")
+ if not os.path.isfile(os.path.join(output_dir,"ww3_strt.inp")):
+ raise RuntimeError("ww3_strt.inp file not found.")
+ run_cmd("./ww3_strt > ww3_strt.ww3.log", from_dir=output_dir)
+ if not os.path.isfile(os.path.join(output_dir,"restart.ww3")):
+ raise RuntimeError("restart.ww3 was not created, check ww3_strt.ww3.log for errors.")
+ # Copy mod_def.ww3 and ww3_strt.ww3 files to rundir
shutil.move(os.path.join(output_dir,"mod_def.ww3"), os.path.join(rundir, "mod_def.ww3"))
- else:
- logger.warning("ww3_grid file not found. The mod_def.ww3 file will be created after the build phase.")
-
+ shutil.move(os.path.join(output_dir,"restart.ww3"), os.path.join(rundir, "calm_strt.ww3"))
+
else:
# Use mod_def already created
mod_def_in = case.get_value("WW3_MODDEF")
diff --git a/cime_config/config_component.xml b/cime_config/config_component.xml
index ba99e3c..2019866 100644
--- a/cime_config/config_component.xml
+++ b/cime_config/config_component.xml
@@ -55,7 +55,7 @@
$DIN_LOC_ROOT/wav/ww3/grid_inp.${WAV_GRID}
$DIN_LOC_ROOT/wav/ww3/grid_inp.${WAV_GRID}.231018
- $DIN_LOC_ROOT/wav/ww3/grid_inp.${WAV_GRID}.250428
+ $DIN_LOC_ROOT/wav/ww3/grid_inp.${WAV_GRID}.260527
$DIN_LOC_ROOT/wav/ww3/grid_inp.${WAV_GRID}.240722
case_comp
diff --git a/cime_config/namelist_definition_ww3.xml b/cime_config/namelist_definition_ww3.xml
index a4abb5c..3a9cfac 100644
--- a/cime_config/namelist_definition_ww3.xml
+++ b/cime_config/namelist_definition_ww3.xml
@@ -35,16 +35,12 @@
""
""
- $DIN_LOC_ROOT/wav/ww3/ww3a.restart.ww3.calm.wwver7.14.220119
- $DIN_LOC_ROOT/wav/ww3/ww3a.restart.ww3.calm.wwver7.14.220119
- $DIN_LOC_ROOT/wav/ww3/wgx3v7.restart.ww3.calm.240722
- $DIN_LOC_ROOT/wav/ww3/wgx3v7.restart.ww3.calm.240722
- $DIN_LOC_ROOT/wav/ww3/wt232.restart.ww3.calm.240722
- $DIN_LOC_ROOT/wav/ww3/wt232.restart.ww3.calm.240722
- ' '
- ' '
- $DIN_LOC_ROOT/wav/ww3/wtnx1v4.restart.ww3.230308
- $DIN_LOC_ROOT/wav/ww3/wtnx1v4.restart.ww3.230308
+ "calm_strt.ww3"
+ "calm_strt.ww3"
+ ' '
+ ' '
+ $DIN_LOC_ROOT/wav/ww3/wtnx1v4.restart.ww3.230308
+ $DIN_LOC_ROOT/wav/ww3/wtnx1v4.restart.ww3.230308
Initial condition file.
@@ -80,6 +76,88 @@
+
+ char
+ prestage_only
+ prestage_only
+ abs
+
+ UNSET
+ $WW3_GRID_INP_DIR/ww3a_mapsta.inp
+ $WW3_GRID_INP_DIR/g37_mapsta.inp
+ $WW3_GRID_INP_DIR/t232_mapsta.inp
+
+ Grid mask file; listed so check_input_data can download it.
+
+
+
+ char
+ prestage_only
+ prestage_only
+ abs
+
+ UNSET
+ $WW3_GRID_INP_DIR/ww3a_bottom.inp
+ $WW3_GRID_INP_DIR/g37_bottom.inp
+ $WW3_GRID_INP_DIR/t232_bottom.inp
+
+ Grid bottom depth file; listed so check_input_data can download it.
+
+
+
+ char
+ prestage_only
+ prestage_only
+ abs
+
+ UNSET
+ $WW3_GRID_INP_DIR/g37_y.inp
+ $WW3_GRID_INP_DIR/t232_y.inp
+
+ Grid y-coordinate file; listed so check_input_data can download it.
+
+
+
+ char
+ prestage_only
+ prestage_only
+ abs
+
+ UNSET
+ $WW3_GRID_INP_DIR/g37_x.inp
+ $WW3_GRID_INP_DIR/t232_x.inp
+
+ Grid x-coordinate file; listed so check_input_data can download it.
+
+
+
+ char
+ prestage_only
+ prestage_only
+ abs
+
+ UNSET
+ $WW3_GRID_INP_DIR/ww3_grid.inp
+ $WW3_GRID_INP_DIR/ww3_grid.inp
+ $WW3_GRID_INP_DIR/ww3_grid.inp
+
+ Grid input file; listed so check_input_data can download it.
+
+
+
+ char
+ prestage_only
+ prestage_only
+ abs
+
+ UNSET
+ $WW3_GRID_INP_DIR/ww3_strt.inp
+ $WW3_GRID_INP_DIR/ww3_strt.inp
+ $WW3_GRID_INP_DIR/ww3_strt.inp
+
+ Grid strt file; listed so check_input_data can download it.
+
+
real
ww3_inparm
@@ -157,6 +235,21 @@
+
+ integer
+ domain_nml
+ setup
+
+ WW3 restart/output I/O type. 0 = no dedicated output process, each process
+ writes its own data (requires a parallel file system); 1 = no dedicated
+ output process, gather to a single writer (any file system); 2 = single
+ dedicated output process; 3 = multiple dedicated output processes.
+
+
+ 1
+
+
+
char
input_nml
diff --git a/cime_config/testdefs/testlist_ww3.xml b/cime_config/testdefs/testlist_ww3.xml
index aa9fdec..95bdbb1 100644
--- a/cime_config/testdefs/testlist_ww3.xml
+++ b/cime_config/testdefs/testlist_ww3.xml
@@ -1,6 +1,6 @@
-
+
@@ -21,10 +21,18 @@
-
+
+
+
+
+
+
+
+
+
-
+