From 8f1ddb108f6d1dc9a1aacae965a833f403022395 Mon Sep 17 00:00:00 2001 From: Jason Fleming Date: Sun, 28 Jul 2024 16:54:57 -0400 Subject: [PATCH 1/3] resolves #1354 --- control_file_gen.pl | 21 +++++++++++++++++++ .../SABv20a/SABv20a.15.ASGS2024.1.template | 6 ++---- .../meshes/hsofs/hsofs-parameters.15.template | 6 ++---- 3 files changed, 25 insertions(+), 8 deletions(-) diff --git a/control_file_gen.pl b/control_file_gen.pl index f6273c72..fddab4b9 100755 --- a/control_file_gen.pl +++ b/control_file_gen.pl @@ -395,6 +395,7 @@ my $outputWindDrag = $p->{metControl}->{outputWindDrag} eq "yes" ? "T" : "F"; my $invertedBarometerOnElevationBoundary = $p->{metControl}->{invertedBarometerOnElevationBoundary} eq "yes" ? "T" : "F"; my $met_control_line ="&metControl WindDragLimit=$p->{metControl}->{WindDragLimit}, DragLawString=\"$p->{metControl}->{DragLawString}\", outputWindDrag=$outputWindDrag, invertedBarometerOnElevationBoundary=$invertedBarometerOnElevationBoundary /"; + # # construct wetDryControl namelist # &wetDryControl outputNodeCode=logicalValue, outputNOFF=logicalValue, noffActive=logicalValue @@ -619,6 +620,26 @@ s/%wetdry_control_namelist%/$wetdry_control_line/; s/%inundation_output_control_namelist%/$inundation_output_control_line/; s/%dynamic_water_level_correction_namelist%/$dynamic_water_level_correction_line/; + # individual namelist parameters + s/%WindDragLimit%/$p->{metControl}->{WindDragLimit}/; # &metControl + s/%DragLawString%/\"$p->{metControl}->{DragLawString}\"/; + s/%outputWindDrag%/$outputWindDrag/; + s/%invertedBarometerOnElevationBoundary%/$invertedBarometerOnElevationBoundary/; + s/%outputNodeCode%/$outputNodeCode/; # &wetDryControl + s/%outputNOFF%/$outputNOFF/; + s/%noffActive%/$noffActive/; + s/%slim%/$p->{wetDryControl}->{slim}/; + s/%windlim%/$windlim/; + s/%directvelWD%/$directvelWD/; + s/%useHF%/$useHF/; + s/%inundationOutput%/$inundationOutput/; # &inundationOutputControl + s/%inunThresh%/$p->{inundationOutputControl}->{inunThresh}/; + s/%SWAN_OutputTPS%/$SWAN_OutputTPS/; # &SWANOutputControl + s/%SWAN_OutputTM01%/$SWAN_OutputTM01/; + s/%SWAN_OutputHS%/$SWAN_OutputHS/; + s/%SWAN_OutputDIR%/$SWAN_OutputDIR/; + s/%SWAN_OutputTMM10%/$SWAN_OutputTMM10/; + s/%SWAN_OutputTM02%/$SWAN_OutputTM02/; # unless (/NO LINE HERE/) { print $_; diff --git a/input/meshes/SABv20a/SABv20a.15.ASGS2024.1.template b/input/meshes/SABv20a/SABv20a.15.ASGS2024.1.template index 64396f59..ae870ae2 100644 --- a/input/meshes/SABv20a/SABv20a.15.ASGS2024.1.template +++ b/input/meshes/SABv20a/SABv20a.15.ASGS2024.1.template @@ -1588,7 +1588,5 @@ K2 %CSYEAR%-%CSMONTH%-%CSDAY% %CSHOUR%:00:00%NCDATE-Line% ! ! namelists: -%met_control_namelist% -%wetdry_control_namelist% -%inundation_output_control_namelist% -%dynamic_water_level_correction_namelist% \ No newline at end of file +&inundationOutputControl inundationOutput=%inundationOutput% / +&metControl WindDragLimit=%WindDragLimit% DragLawString=%DragLawString% / \ No newline at end of file diff --git a/input/meshes/hsofs/hsofs-parameters.15.template b/input/meshes/hsofs/hsofs-parameters.15.template index fbee237f..b2317642 100644 --- a/input/meshes/hsofs/hsofs-parameters.15.template +++ b/input/meshes/hsofs/hsofs-parameters.15.template @@ -1588,7 +1588,5 @@ K2 %CSYEAR%-%CSMONTH%-%CSDAY% %CSHOUR%:00:00%NCDATE-Line% ! ! namelists: -%met_control_namelist% -%wetdry_control_namelist% -%inundation_output_control_namelist% -%dynamic_water_level_correction_namelist% \ No newline at end of file +&inundationOutputControl inundationOutput=%inundationOutput% / +&metControl WindDragLimit=%WindDragLimit% / \ No newline at end of file From ce51d57550260b69056673341962d33e1a66e044 Mon Sep 17 00:00:00 2001 From: Jason Fleming Date: Sun, 2 Feb 2025 09:26:12 -0500 Subject: [PATCH 2/3] Start of adcirc version support --- config/mesh_defaults.sh | 36 +++++++++++++++++++++++++++++++- config/model_defaults.sh | 2 +- control-parameters-template.yaml | 2 ++ control_file_gen.pl | 21 ++++++++++++++----- generateDynamicInput.sh | 4 ++++ 5 files changed, 58 insertions(+), 7 deletions(-) diff --git a/config/mesh_defaults.sh b/config/mesh_defaults.sh index 34f702cf..aef94aba 100755 --- a/config/mesh_defaults.sh +++ b/config/mesh_defaults.sh @@ -176,6 +176,7 @@ case $GRIDNAME in ADCPREPWALLTIME="02:00:00" # adcprep wall clock time, including partmesh NOWCASTWALLTIME="07:00:00" # longest nowcast wall clock time FORECASTWALLTIME="07:00:00" # forecast wall clock time + adcircVersions=( "v56.0.2" ) case $parameterPackage in "hardcoded") CONTROLTEMPLATE=CPRA23v01c_5kcms_fort.15.template @@ -255,6 +256,7 @@ case $GRIDNAME in ADCPREPWALLTIME="01:00:00" # adcprep wall clock time, including partmesh NOWCASTWALLTIME="01:00:00" # longest nowcast wall clock time FORECASTWALLTIME="01:00:00" # forecast wall clock time + adcircVersions=( "v56.0.2" ) ;; "LA_v19k-WithUpperAtch_chk") nodes=1593485 @@ -276,6 +278,7 @@ case $GRIDNAME in FORECASTWALLTIME="07:00:00" # forecast wall clock time # unit offset url https://asgs-static-assets.sfo2.digitaloceanspaces.com/offsets/unit_offset_LA_v19k-WithUpperAtch_chk.dat.xz UNITOFFSETFILE=unit_offset_LA_v19k-WithUpperAtch_chk.dat + adcircVersions=( "v53release" ) ;; # "LA_v20a-WithUpperAtch_chk"|"LAv20a") @@ -293,6 +296,7 @@ case $GRIDNAME in ADCPREPWALLTIME="02:00:00" # adcprep wall clock time, including partmesh NOWCASTWALLTIME="07:00:00" # longest nowcast wall clock time FORECASTWALLTIME="07:00:00" # forecast wall clock time + adcircVersions=( "v53release" ) case $parameterPackage in "hardcoded") CONTROLTEMPLATE=LA_v20a-WithUpperAtch.15.template @@ -356,6 +360,7 @@ case $GRIDNAME in ADCPREPWALLTIME="02:00:00" # adcprep wall clock time, including partmesh NOWCASTWALLTIME="07:00:00" # longest nowcast wall clock time FORECASTWALLTIME="07:00:00" # forecast wall clock time + adcircVersions=( "v53release" ) case $parameterPackage in "hardcoded") CONTROLTEMPLATE=LAERDCv5i_10.194kcms.15.template @@ -425,6 +430,7 @@ case $GRIDNAME in NOWCASTWALLTIME="01:00:00" # longest nowcast wall clock time FORECASTWALLTIME="01:00:00" # forecast wall clock time # FIXME: no unit offset url + adcircVersions=( "v53release" ) ;; # "tx2008_r35h"|"TX2008") @@ -449,6 +455,7 @@ case $GRIDNAME in FORECASTWALLTIME="07:00:00" # forecast wall clock time # unit offset url https://asgs-static-assets.sfo2.digitaloceanspaces.com/offsets/unit_offset_tx2008_r35h.grd.dat.xz UNITOFFSETFILE=unit_offset_tx2008_r35h.grd.dat + adcircVersions=( "v53release" ) ;; # "tx2017"|"CTXCS2017") @@ -474,6 +481,7 @@ case $GRIDNAME in NOWCASTWALLTIME="10:00:00" # longest nowcast wall clock time FORECASTWALLTIME="14:00:00" # forecast wall clock time # FIXME: no unit offset url + adcircVersions=( "v53release" ) ;; # "tx2020a"|"TX2020a") @@ -499,6 +507,7 @@ case $GRIDNAME in NOWCASTWALLTIME="10:00:00" # longest nowcast wall clock time FORECASTWALLTIME="14:00:00" # forecast wall clock time # FIXME: no unit offset url + adcircVersions=( "v53release" ) ;; # "TXLA22a") @@ -516,6 +525,7 @@ case $GRIDNAME in ADCPREPWALLTIME="10:00:00" # adcprep wall clock time,including partmesh NOWCASTWALLTIME="10:00:00" # longest nowcast wall clock time FORECASTWALLTIME="14:00:00" # forecast wall clock time + adcircVersions=( "v53release" ) case $parameterPackage in "hardcoded") CONTROLTEMPLATE=TXLA22a_fort.15.template # fort.15 template @@ -581,6 +591,7 @@ case $GRIDNAME in NOWCASTWALLTIME="07:00:00" # longest nowcast wall clock time FORECASTWALLTIME="07:00:00" # forecast wall clock time # FIXME: no unit offset url + adcircVersions=( "v53release" ) ;; # "NCv6d") @@ -598,6 +609,7 @@ case $GRIDNAME in ADCPREPWALLTIME="02:00:00" # adcprep wall clock time, including partmesh NOWCASTWALLTIME="07:00:00" # longest nowcast wall clock time FORECASTWALLTIME="07:00:00" # forecast wall clock time + adcircVersions=( "v53release" ) case $parameterPackage in "hardcoded"|"default") # we don't have a hardcoded template set up for NCv6d @@ -655,6 +667,7 @@ case $GRIDNAME in FORECASTWALLTIME="07:00:00" # forecast wall clock time # unit offset url https://asgs-static-assets.sfo2.digitaloceanspaces.com/offsets/unit_offset_nc_inundation_v9.99_rivers.dat.xz UNITOFFSETFILE=unit_offset_nc_inundation_v9.99_rivers.dat + adcircVersions=( "v53release" ) case $parameterPackage in "hardcoded") CONTROLTEMPLATE=nc_9.99wrivers_vortex_fort.15.template @@ -727,6 +740,7 @@ case $GRIDNAME in FORECASTWALLTIME="07:00:00" # forecast wall clock time # unit offset url https://asgs-static-assets.sfo2.digitaloceanspaces.com/offsets/unit_offset_hsofs.dat.xz UNITOFFSETFILE=unit_offset_hsofs.dat + adcircVersions=( "v53release" ) ;; "hsofs"|"HSOFS") # @@ -748,6 +762,7 @@ case $GRIDNAME in UNITOFFSETFILE=unit_offset_hsofs.dat case $parameterPackage in "hardcoded") + adcircVersions=( "v53release" "v56.0.2" ) CONTROLTEMPLATE=hsofs_explicit.15.template # wind at 10m fort.15 template CONTROLTEMPLATENOROUGH=hsofs.nowindreduction.15.template @@ -756,6 +771,7 @@ case $GRIDNAME in SWANDT=1800 # swan timestep / coupling interval (seconds) ;; "default") + adcircVersions=( "v56.0.2" ) CONTROLTEMPLATE=hsofs-parameters.15.template # interaction between mesh and models: SWANDT=1800 # swan timestep / coupling interval (seconds) @@ -807,6 +823,7 @@ case $GRIDNAME in FORECASTWALLTIME="24:00:00" # forecast wall clock time case $parameterPackage in "hardcoded") + adcircVersions=( "v53release" "v56.0.2" ) CONTROLTEMPLATE=SABv20a.15.template # wind at 10m fort.15 template CONTROLTEMPLATENOROUGH=SABv20a.nowindreduction.15.template @@ -815,6 +832,7 @@ case $GRIDNAME in TIMESTEPSIZE=0.5 # adcirc time step size (seconds) ;; "default") + adcircVersions=( "v56.0.2" ) CONTROLTEMPLATE=SABv20a.15.ASGS2024.1.template # numerics/physics (fort.15) TIMESTEPSIZE=0.5 # adcirc time step size (seconds) @@ -877,6 +895,7 @@ case $GRIDNAME in FORECASTWALLTIME="07:00:00" # forecast wall clock time # unit offset url UNITOFFSETFILE=null + adcircVersions=( "v53release" ) ;; # "southfl_v11-1_final"|"SFLv111") @@ -903,6 +922,7 @@ case $GRIDNAME in NOWCASTWALLTIME="07:00:00" # longest nowcast wall clock time FORECASTWALLTIME="07:00:00" # forecast wall clock time # FIXME: no unit offset url + adcircVersions=( "v53release" ) ;; # "CenFlv7"|"eccl_v7_geo_z") @@ -926,6 +946,7 @@ case $GRIDNAME in NOWCASTWALLTIME="07:00:00" # longest nowcast wall clock time FORECASTWALLTIME="07:00:00" # forecast wall clock time # FIXME: no unit offset url + adcircVersions=( "v53release" ) ;; # "FEMAR3") @@ -949,6 +970,7 @@ case $GRIDNAME in FORECASTWALLTIME="07:00:00" # forecast wall clock time # https://asgs-static-assets.sfo2.digitaloceanspaces.com/offsets/unit_offset_FEMA_R3_20110303_MSL.dat.xz UNITOFFSETFILE=unit_offset_FEMA_R3_20110303_MSL.dat + adcircVersions=( "v53release" ) ;; # "FEMAR2") @@ -971,6 +993,7 @@ case $GRIDNAME in NOWCASTWALLTIME="07:00:00" # longest nowcast wall clock time FORECASTWALLTIME="07:00:00" # forecast wall clock time # no scalable unit water level correction file + adcircVersions=( "v53release" ) ;; # "NAC2014") @@ -990,6 +1013,7 @@ case $GRIDNAME in FORECASTWALLTIME="07:00:00" # forecast wall clock time case $parameterPackage in "hardcoded") + adcircVersions=( "v53release" ) CONTROLTEMPLATE=NAC2014_R01.15.template # wind at 10m fort.15 template CONTROLTEMPLATENOROUGH=NAC2014_R01.nowindreduction.15.template @@ -997,6 +1021,7 @@ case $GRIDNAME in nodal_attribute_default_values["sea_surface_height_above_geoid"]="0.109" ;; "default") + adcircVersions=( "v53release" ) CONTROLTEMPLATE=NAC2014.15.ASGS2024.1.template # numerics/physics (fort.15) advection="off" # on|off for advection (NOLICA=1|0/NOLICAT=1|0) @@ -1048,6 +1073,7 @@ case $GRIDNAME in FORECASTWALLTIME="07:00:00" # forecast wall clock time case $parameterPackage in "hardcoded") + adcircVersions=( "v53release" "v56.0.2" ) CONTROLTEMPLATE=NGOM_RT_v19b.15.template_18kcms # fort.15 template # wind at 10m fort.15 template CONTROLTEMPLATENOROUGH=NGOM_RT_v19b.nowindreduction.15.template @@ -1055,6 +1081,7 @@ case $GRIDNAME in nodal_attribute_default_values["sea_surface_height_above_geoid"]="0.2" ;; "default") + adcircVersions=( "v56.0.2" ) CONTROLTEMPLATE=NGOMv19.15.ASGS2024.1.template # numerics/physics (fort.15) advection="off" # on|off for advection (NOLICA=1|0/NOLICAT=1|0) @@ -1112,6 +1139,7 @@ case $GRIDNAME in FORECASTWALLTIME="07:00:00" # forecast wall clock time case $parameterPackage in "hardcoded") + adcircVersions=( "v53release" "v56.0.2" ) CONTROLTEMPLATE=EGOM-RT_v20b.15.template # fort.15 template # wind at 10m fort.15 template CONTROLTEMPLATENOROUGH=EGOM-RT_v20b.norough.15.template @@ -1119,6 +1147,7 @@ case $GRIDNAME in nodal_attribute_default_values["sea_surface_height_above_geoid"]="-0.106" ;; "default") + adcircVersions=( "v56.0.2" ) CONTROLTEMPLATE=EGOMv20b.15.ASGS2024.1.template # numerics/physics (fort.15) advection="on" # on|off for advection (NOLICA=1|0/NOLICAT=1|0) @@ -1174,6 +1203,7 @@ case $GRIDNAME in FORECASTWALLTIME="01:00:00" # forecast wall clock time case $parameterPackage in "hardcoded") + adcircVersions=( "v53release" "v56.0.2" ) CONTROLTEMPLATE=shinnecock_asgs.fort.15.template # wind at 10m fort.15 template CONTROLTEMPLATENOROUGH=shinnecock_asgs.fort.15.template @@ -1181,6 +1211,7 @@ case $GRIDNAME in NAFILE="null" ;; "default") + adcircVersions=( "v53release" "v56.0.2" ) CONTROLTEMPLATE=shinnecock-parameters.fort.15.template NAFILE=shinnecock_nodal_attributes.template # default physics parameters (that differ from the settings in config/model_defaults.sh @@ -1220,6 +1251,7 @@ case $GRIDNAME in NOWCASTWALLTIME="01:00:00" # longest nowcast wall clock time FORECASTWALLTIME="01:00:00" # forecast wall clock time UNITOFFSETFILE=null + adcircVersions=( "v53release" ) ;; "OPENWATERv1e") # @@ -1245,6 +1277,7 @@ case $GRIDNAME in NOWCASTWALLTIME="07:00:00" # longest nowcast wall clock time FORECASTWALLTIME="07:00:00" # forecast wall clock time UNITOFFSETFILE=null + adcircVersions=( "v53release" ) ;; "PRVI15") # @@ -1269,6 +1302,7 @@ case $GRIDNAME in NOWCASTWALLTIME="07:00:00" # longest nowcast wall clock time FORECASTWALLTIME="07:00:00" # forecast wall clock time UNITOFFSETFILE=null + adcircVersions=( "v53release" ) ;; *) @@ -1289,4 +1323,4 @@ case $GRIDNAME in exit 1 fi ;; -esac +esac \ No newline at end of file diff --git a/config/model_defaults.sh b/config/model_defaults.sh index 40df3d00..2537796b 100755 --- a/config/model_defaults.sh +++ b/config/model_defaults.sh @@ -27,7 +27,7 @@ # ADCIRC parameters (fort.15) file parameterPackage="hardcoded" # use old (mostly) hardcoded fort.15 template and static nodal attributes controlParametersTemplate=$SCRIPTDIR/control-parameters-template.yaml -adcirc_version="notset" +adcircVersions=( "notset" ) TIMESTEPSIZE="1.0" # ADCIRC time step in seconds WTIMINC=900 # time increment of meteorological data sets in seconds advection="on" # on|off for advection (NOLICA=1|0/NOLICAT=1|0) diff --git a/control-parameters-template.yaml b/control-parameters-template.yaml index f50edb5a..405d6234 100644 --- a/control-parameters-template.yaml +++ b/control-parameters-template.yaml @@ -1,5 +1,7 @@ --- adcirc_version: "%ADCIRCVER%" + adcirc_version_support: + %adcircVersions% solver_time_integration: "%IM_ETC%" initialization_length: %HINDCASTLENGTH% time_weighting_coefficients: "%A00B00C00%" diff --git a/control_file_gen.pl b/control_file_gen.pl index fddab4b9..25e3c55a 100755 --- a/control_file_gen.pl +++ b/control_file_gen.pl @@ -41,7 +41,7 @@ # [--dt timestep] [--nowcast] [--controltemplate templatefile] < storm1_fort.22 # #-------------------------------------------------------------------------- -# Copyright(C) 2006--2024 Jason Fleming +# Copyright(C) 2006--2025 Jason Fleming # Copyright(C) 2006, 2007 Brett Estrade # # This file is part of the ADCIRC Surge Guidance System (ASGS). @@ -59,11 +59,22 @@ # You should have received a copy of the GNU General Public License # along with the ASGS. If not, see . #-------------------------------------------------------------------------- -# -#jgf20120124: standalone usage example for making a fort.15 for the -# ec95d mesh. It was for a tides-only run. -#perl ~/asgs/trunk/control_file_gen.pl --controltemplate ~/asgs/trunk/input/ec_95_fort.15_template --gridname fort.14 --cst 2012010100 --endtime 7 --dt 30.0 --nws 0 --hsformat binary --name hindcast --fort63freq 3600.0 +# Almost all features that are activated in the fort.15 file are +# compatible with all versions of ADCIRC that are supported in ASGS +# (v53release and later). However, certain features are only +# supported in particular later versions of ADCIRC, as shown in the +# following table: +# +#-------------------------------------------------------------------------- +# The following table maps between the name of an adcirc version in ASGS +# and the output from "adcirc -v" +# ASGS Name | adcirc -v +# ---------------+---------------- +# v53release | v53.05-modified +# v55.02 | +# v56.0.0-beta.2 | +#-------------------------------------------------------------------------- use strict; use warnings; use Getopt::Long; diff --git a/generateDynamicInput.sh b/generateDynamicInput.sh index 8d517905..b08d4bd6 100644 --- a/generateDynamicInput.sh +++ b/generateDynamicInput.sh @@ -104,8 +104,12 @@ generateDynamicInput() done layerWaves="off" fi + # record adcirc version support (according to config/mesh_defaults.sh) + avs="" ; for v in ${adcircVersions[*]}; do avs+=' - '$v$'\n' ; done + # fill in the template sed \ -e "s/%ADCIRCVER%/$(adcirc -v)/" \ + -e "s/%adcircVersions%/$(printf "$avs"/ \ -e "s/%IM_ETC%/$solver_time_integration/" \ -e "s/%HINDCASTLENGTH%/$HINDCASTLENGTH/" \ -e "s/%A00B00C00%/$time_weighting_coefficients/" \ From fb5d7bf41af73794c0c163a1d07de2b076a59c59 Mon Sep 17 00:00:00 2001 From: Jason Fleming Date: Sun, 2 Feb 2025 12:38:21 -0500 Subject: [PATCH 3/3] Moved test scripts to test subdirectory t --- test_get_gfs.sh => t/test_get_gfs.sh | 0 test_get_nam.sh => t/test_get_nam.sh | 0 test_qscript.sh => t/test_qscript.sh | 0 3 files changed, 0 insertions(+), 0 deletions(-) rename test_get_gfs.sh => t/test_get_gfs.sh (100%) rename test_get_nam.sh => t/test_get_nam.sh (100%) rename test_qscript.sh => t/test_qscript.sh (100%) diff --git a/test_get_gfs.sh b/t/test_get_gfs.sh similarity index 100% rename from test_get_gfs.sh rename to t/test_get_gfs.sh diff --git a/test_get_nam.sh b/t/test_get_nam.sh similarity index 100% rename from test_get_nam.sh rename to t/test_get_nam.sh diff --git a/test_qscript.sh b/t/test_qscript.sh similarity index 100% rename from test_qscript.sh rename to t/test_qscript.sh