diff --git a/share/ecwam/scripts/ecwam_run_model.sh b/share/ecwam/scripts/ecwam_run_model.sh index 3b79981a4..213a85ed8 100755 --- a/share/ecwam/scripts/ecwam_run_model.sh +++ b/share/ecwam/scripts/ecwam_run_model.sh @@ -78,8 +78,21 @@ done nproma=$(read_config nproma --default=24) -idelpro=$(read_config physics.timestep --format=seconds --default=900) -idelt=$(read_config advection.timestep --format=seconds --default=900) +# read timesteps +phys_tstp=$(read_config physics.timestep --format=seconds --default=900) +adv_base_tstp=$(read_config advection.timestep --format=seconds --default=900) +adv_fast_tstp=$(read_config advection.fast_waves.timestep --format=seconds --default=$adv_base_tstp) +ifrelfmax=$(read_config advection.fast_waves.max_frequency --default=0) + +# verify timesteps +if [ $(( $adv_base_tstp%$adv_fast_tstp )) -ne 0 ] ; then + echo "ERROR: Base advection timestep should be a multiple of fast-wave advection timestep" + exit 4 +fi +if [ $(( $phys_tstp%$adv_base_tstp )) -ne 0 ] ; then + echo "ERROR: Physics timestep should be a multiple of base advection timestep" + exit 4 +fi if [[ $(read_config forcings.sea_ice --default=True) == "True" ]] ; then licerun=T @@ -187,10 +200,10 @@ cat > wam_namelist << EOF CBPLTDT = "${begofrn}", CEPLTDT = "${endofrn}", CDATEF = "${begoffo}", - DELPRO_LF = ${idelpro}, - IFRELFMAX = 0, - IDELPRO = ${idelpro}, - IDELT = ${idelt}, + DELPRO_LF = ${adv_fast_tstp}, + IFRELFMAX = ${ifrelfmax}, + IDELPRO = ${adv_base_tstp}, + IDELT = ${phys_tstp}, IDELINT = ${ppfreq}, IREST = 1, LFDBIOOUT = F, diff --git a/tests/etopo1_oper_an_fc_O1280.yml b/tests/etopo1_oper_an_fc_O1280.yml new file mode 100644 index 000000000..99bf8c2bc --- /dev/null +++ b/tests/etopo1_oper_an_fc_O1280.yml @@ -0,0 +1,87 @@ +grid: O1280 +directions: 36 +frequencies: 29 +bathymetry: ETOPO1 + +advection: + timestep: 450 + fast_waves: + timestep: 225 + max_frequency: 5 +physics: + timestep: 900 + +analysis.begin: 2022-12-31 12:00:00 +analysis.end: 2023-01-01 00:00:00 +forecast.begin: 2023-01-01 00:00:00 +forecast.end: 2023-01-01 06:00:00 + +begin: ${analysis.begin} +end: ${forecast.end} + +nproma: 24 + +forcings: + file: data/forcings/oper_an_12h_fc_2023010100_36h_O1280.grib + + at: + - begin: ${analysis.begin} + end: ${analysis.end} + timestep: 06:00 + - begin: ${forecast.begin} + end: ${forecast.end} + timestep: 01:00 + +output: + fields: + name: + - swh # Significant height of combined wind waves and swell + - mwd # Mean wave direction + - mwp # Mean wave period + - pp1d # Peak wave period + - dwi # 10 metre wind direction + - cdww # Coefficient of drag with waves + - wind # 10 metre wind speed + format: grib # (default : grib) or binary + at: + - timestep: 01:00 + + restart: + format: binary # (default : binary) or grib + at: + - time: ${end} + + +validation: + + double_precision: + + # initial analysis time + - name: swh + time: 2022-12-31 12:00:00 + average: 0.1285755868651114E+01 + relative_tolerance: 1.e-14 + hashes: [0x3FF49274BEE7F21B] + + # initial forecast time + - name: swh + time: 2023-01-01 00:00:00 + average: 0.1456589300993350E+01 + hashes: [0x3FF74E30953784E0] + + # 6h into forcast + - name: swh + time: 2023-01-01 06:00:00 + average: 0.1532376268424686E+01 + relative_tolerance: 1.e-14 + hashes: [0x3FF8849CFA60CF05] + - name: swh + time: 2023-01-01 06:00:00 + minimum: 0.1720965670282631E-01 + relative_tolerance: 1.e-14 + hashes: [0x3F919F6882DB29B0] + - name: swh + time: 2023-01-01 06:00:00 + maximum: 0.7669986535925322E+01 + relative_tolerance: 1.e-14 + hashes: [0x401EAE10F3523D04] diff --git a/tests/etopo1_oper_an_fc_O640.yml b/tests/etopo1_oper_an_fc_O640.yml new file mode 100644 index 000000000..8d4338e02 --- /dev/null +++ b/tests/etopo1_oper_an_fc_O640.yml @@ -0,0 +1,85 @@ +grid: O640 +directions: 36 +frequencies: 29 +bathymetry: ETOPO1 + +advection: + timestep: 450 +physics: + timestep: 450 + +analysis.begin: 2022-12-31 12:00:00 +analysis.end: 2023-01-01 00:00:00 +forecast.begin: 2023-01-01 00:00:00 +forecast.end: 2023-01-01 06:00:00 + +begin: ${analysis.begin} +end: ${forecast.end} + +nproma: 24 + +forcings: + file: data/forcings/oper_an_12h_fc_2023010100_36h_O640.grib + + at: + - begin: ${analysis.begin} + end: ${analysis.end} + timestep: 06:00 + - begin: ${forecast.begin} + end: ${forecast.end} + timestep: 01:00 + +output: + fields: + name: + - swh # Significant height of combined wind waves and swell + - mwd # Mean wave direction + - mwp # Mean wave period + - pp1d # Peak wave period + - dwi # 10 metre wind direction + - cdww # Coefficient of drag with waves + - wind # 10 metre wind speed + format: grib # (default : grib) or binary + at: + - timestep: 01:00 + + restart: + format: binary # (default : binary) or grib + at: + - time: ${end} + + +validation: + + double_precision: + + # initial analysis time + - name: swh + time: 2022-12-31 12:00:00 + average: 0.1285046301316225E+01 + relative_tolerance: 1.e-14 + hashes: [0x3FF48F8CB5DFFBB2] + + # initial forecast time + - name: swh + time: 2023-01-01 00:00:00 + average: 0.1450281539835982E+01 + relative_tolerance: 1.e-14 + hashes: [0x3FF7345A6A7968B6] + + # 6h into forcast + - name: swh + time: 2023-01-01 06:00:00 + average: 0.1528345198537696E+01 + relative_tolerance: 1.e-14 + hashes: [0x3FF8741A184B7D10] + - name: swh + time: 2023-01-01 06:00:00 + minimum: 0.1726014660228352E-01 + relative_tolerance: 1.e-14 + hashes: [0x3F91ACA4D4B9510C] + - name: swh + time: 2023-01-01 06:00:00 + maximum: 0.7616349300514687E+01 + relative_tolerance: 1.e-14 + hashes: [0x401E772445627E03]