From 0d1dcdbc0aaef83476b86f90970c79b6b1a50eaa Mon Sep 17 00:00:00 2001 From: Matthew Masarik <86749872+MatthewMasarik-NOAA@users.noreply.github.com> Date: Tue, 1 Feb 2022 10:03:02 -0500 Subject: [PATCH 01/44] wmesmdfmd: init tauwx/y (#598) wmesmfmd: initialization of tauwx,tauwy --- model/src/wmesmfmd.F90 | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/model/src/wmesmfmd.F90 b/model/src/wmesmfmd.F90 index fc626e53c..92d7b1067 100644 --- a/model/src/wmesmfmd.F90 +++ b/model/src/wmesmfmd.F90 @@ -6192,6 +6192,8 @@ subroutine CalcCharnk ( chkField, rc ) llws(:) = .true. ustar = zero ustdr = zero + tauwx = zero + tauwy = zero call w3spr3( va(:,jsea), cg(1:nk,isea), wn(1:nk,isea), & emean, fmean, fmean1, wnmean, amax, & u10(isea), u10d(isea), ustar, ustdr, tauwx, & @@ -6201,6 +6203,8 @@ subroutine CalcCharnk ( chkField, rc ) llws(:) = .true. ustar = zero ustdr = zero + tauwx = zero + tauwy = zero call w3spr4( va(:,jsea), cg(1:nk,isea), wn(1:nk,isea), & emean, fmean, fmean1, wnmean, amax, & u10(isea), u10d(isea), ustar, ustdr, tauwx, & @@ -6332,6 +6336,8 @@ subroutine CalcRoughl ( wrlField, rc ) llws(:) = .true. ustar = zero ustdr = zero + tauwx = zero + tauwy = zero call w3spr3( va(:,jsea), cg(1:nk,isea), wn(1:nk,isea), & emean, fmean, fmean1, wnmean, amax, & u10(isea), u10d(isea), ustar, ustdr, tauwx, & @@ -6341,6 +6347,8 @@ subroutine CalcRoughl ( wrlField, rc ) llws(:) = .true. ustar = zero ustdr = zero + tauwx = zero + tauwy = zero call w3spr4( va(:,jsea), cg(1:nk,isea), wn(1:nk,isea), & emean, fmean, fmean1, wnmean, amax, & u10(isea), u10d(isea), ustar, ustdr, tauwx, & From c166e4c151eff6f0d29b4547afe74226502c3c05 Mon Sep 17 00:00:00 2001 From: Matthew Masarik <86749872+MatthewMasarik-NOAA@users.noreply.github.com> Date: Tue, 1 Feb 2022 13:44:08 -0500 Subject: [PATCH 02/44] ww3_doxy_tmpl.md: fix module vars (#599) ww3_doxy_tmpl.md, Doxyfile.in fixes --- docs/Doxyfile.in | 2 +- docs/ww3_doxy_tmpl.md | 13 +++++++++---- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/docs/Doxyfile.in b/docs/Doxyfile.in index 870305944..539d46dc3 100644 --- a/docs/Doxyfile.in +++ b/docs/Doxyfile.in @@ -323,7 +323,7 @@ OPTIMIZE_OUTPUT_SLICE = NO # Note that for custom extensions you also need to set FILE_PATTERNS otherwise # the files are not read by doxygen. -EXTENSION_MAPPING = +EXTENSION_MAPPING = f=FortranFixed f90=FortranFree F90=FortranFree # If the MARKDOWN_SUPPORT tag is enabled then doxygen pre-processes all comments # according to the Markdown format, which allows for more readable diff --git a/docs/ww3_doxy_tmpl.md b/docs/ww3_doxy_tmpl.md index eb47ebfc8..8069634ae 100644 --- a/docs/ww3_doxy_tmpl.md +++ b/docs/ww3_doxy_tmpl.md @@ -1,7 +1,7 @@ # WAVEWATCH III Doxygen Header Reference
-_Doxygen markup headers to be placed directly above the respective Fortran code units._ +_Doxygen markup headers to be placed **directly above** the respective Fortran code units._ ### FILE ``` @@ -17,10 +17,15 @@ _Doxygen markup headers to be placed directly above the respective Fortran code !> !> @details !> -!> @param # ALL module variables documented -!> ... -!> @param !> @author @date + # ALL module variables documented +module_var_1 !< + ... +!> # multiples lines can be used +!> # if needed. +module_var_i + ... +module_var_N !< ``` ### PROGRAM From b1443248070f57017032d55cadefa5cdbf1657e2 Mon Sep 17 00:00:00 2001 From: Mickael Accensi <49198861+mickaelaccensi@users.noreply.github.com> Date: Wed, 9 Feb 2022 15:51:39 +0100 Subject: [PATCH 03/44] non interactive ww3_from_ftp.sh #603 --- model/bin/ww3_from_ftp.sh | 71 +++++++++++++++++++++++++++++++++------ 1 file changed, 61 insertions(+), 10 deletions(-) diff --git a/model/bin/ww3_from_ftp.sh b/model/bin/ww3_from_ftp.sh index 667bf37d1..e1e9f7842 100755 --- a/model/bin/ww3_from_ftp.sh +++ b/model/bin/ww3_from_ftp.sh @@ -1,28 +1,69 @@ -#!/bin/bash +#!/bin/bash -e # --------------------------------------------------------------------------- # # # # Script for downloading data from ftp # # Created 0ct 10, 2017 # # --------------------------------------------------------------------------- # +usage() +{ + echo '' + echo ' Usage : ./ww3_from_ftp.sh [options]' + echo '' + echo ' Options : ' + echo ' -h : print usage' + echo ' -i : interactive mode' + echo ' -k : keep tar files' + echo '' +} + curr_dir=`pwd` # Set WW3 code version ww3ver=v7.12.6 +interactive='n' +keep='n' +if [ $# -eq 1 ] ; then + if [ "$1" = "-h" ] ; then + usage + exit 0 + elif [ "$1" = "-i" ] ; then + interactive='y' + elif [ "$1" = "-k" ] ; then + keep='y' + else + echo '[ERROR] input argument not recognized' + usage + exit 1 + fi +elif [ $# -gt 1 ] ; then + echo '[ERROR] only one input argument accepted' + usage + exit 1 +fi + +dir0=$(cd $(dirname $0) > /dev/null && pwd -P) +ww3dir=$(dirname $(dirname $dir0)) + #Get top level directory of ww3 from user: echo -e "\n\n This script will download data from the ftp for WAVEWATCH III " -echo -e "Enter the relative path to the main/top level directory, this would " -echo -e "be '../../' if in the model/bin directory or '.' if already in the " -echo -e "top/main directory:" -read ww3dir +if [ "$interactive" = "n" ] +then + echo $ww3dir +else +echo -e "Enter the absolute or relative path to the main/top directory, " +echo -e "this would be '../../' if in the model/bin directory " +echo -e "or './' if already in the top/main directory:" + read ww3dir +fi #Move to top level directory of ww3: cd $ww3dir #Download from ftp and uptar: echo -e "Downloading and untaring file from ftp:" -wget https://ftp.emc.ncep.noaa.gov/static_files/public/WW3/ww3_from_ftp.${ww3ver}.tar.gz +wget --no-check-certificate https://ftp.emc.ncep.noaa.gov/static_files/public/WW3/ww3_from_ftp.${ww3ver}.tar.gz tar -xvzf ww3_from_ftp.${ww3ver}.tar.gz #Move regtest info from data_regtests to regtests: @@ -60,8 +101,13 @@ cp -r data_regtests/ww3_ufs1.2/input/* regtests/ww3_ufs1.2/input/ cp -r data_regtests/ww3_ufs1.3/input/*nc regtests/ww3_ufs1.3/input/ #Do you want to clean up (aka delete tar file, delete the data_regtests directory) echo -e "\n\n Do you want to delete the tar file ww3_from_ftp.${ww3ver}.tar.gz [y|n]: " -read wnew -if [ "${wnew}" = "Y" ] || [ "${wnew}" = "y" ] +if [ "$interactive" = "n" ] +then + echo $keep +else + read keep +fi +if [ "${keep}" = "N" ] || [ "${keep}" = "n" ] then echo -e '\n Deleting tar file ww3_from_ftp.${ww3ver}.tar.gz' rm ww3_from_ftp.${ww3ver}.tar.gz @@ -71,8 +117,13 @@ fi echo -e "\n\n Files were copied from the data_regtests to the regtests folder." echo -e "Do you want to delete the data_regtests folder? [y|n]: " -read wnew2 -if [ "${wnew2}" = "Y" ] || [ "${wnew2}" = "y" ] +if [ "$interactive" = "n" ] +then + echo $keep +else + read keep +fi +if [ "${keep}" = "N" ] || [ "${keep}" = "n" ] then echo -e '\n Deleting the data_regtests folder' rm -rf data_regtests From 82e34ba5209e119881e271b022c4ca2f6bb4ff95 Mon Sep 17 00:00:00 2001 From: Mickael Accensi <49198861+mickaelaccensi@users.noreply.github.com> Date: Wed, 9 Feb 2022 23:03:25 +0100 Subject: [PATCH 04/44] uniformize regtests output by setting a global output type in the matrix script (#605) --- regtests/bin/matrix.base | 140 +++++++++--------- regtests/bin/matrix_datarmor | 95 ++++++------ regtests/bin/matrix_milhydro | 4 +- regtests/bin/matrix_ncep | 4 +- regtests/bin/matrix_s4 | 4 +- regtests/bin/matrix_ukmo_cray | 4 +- regtests/bin/run_test | 3 +- regtests/ww3_tic2.2/input/ww3_outp_spec.inp | 11 -- regtests/ww3_tic2.2/input/ww3_outp_tab50.inp | 24 --- regtests/ww3_tic2.2/input/ww3_outp_tab51.inp | 2 - .../ww3_tic2.2/input_IC2/ww3_outp_spec.inp | 11 -- .../ww3_tic2.2/input_IC2/ww3_outp_tab50.inp | 24 --- .../ww3_tic2.2/input_IC2/ww3_outp_tab51.inp | 2 - 13 files changed, 128 insertions(+), 200 deletions(-) diff --git a/regtests/bin/matrix.base b/regtests/bin/matrix.base index e89b4fe71..98566c4ad 100755 --- a/regtests/bin/matrix.base +++ b/regtests/bin/matrix.base @@ -680,8 +680,8 @@ echo "$rtst -w work_PR3_UQ $ww3 ww3_tp1.8" >> matrix.body echo "$rtst -i input_BJ -w work_BJ_PR3_UQ $ww3 ww3_tp1.8" >> matrix.body echo "$rtst -w work_PR3_UQ $ww3 ww3_tp1.9" >> matrix.body - echo "$rtst -o netcdf -N -w work_PR3_UQ $ww3 ww3_tp1.11" >> matrix.body - echo "$rtst -i input2 -o netcdf -N -w work_PR3_UQ $ww3 ww3_tp1.11" >> matrix.body + echo "$rtst -N -w work_PR3_UQ $ww3 ww3_tp1.11" >> matrix.body + echo "$rtst -i input2 -N -w work_PR3_UQ $ww3 ww3_tp1.11" >> matrix.body fi if [ "$unstr" = 'y' ] @@ -713,14 +713,14 @@ echo "$rtst -s PR3_UQ -w work_PR3_UQ $ww3 ww3_tp2.5" >> matrix.body echo "$rtst -s PR3_UQ -w work_PR3_UQ_a -g a $ww3 ww3_tp2.9" >> matrix.body echo "$rtst -s PR3_UQ -w work_PR3_UQ_b -g b $ww3 ww3_tp2.9" >> matrix.body - echo "$rtst -o netcdf -w work_PR3_UQ $ww3 ww3_tp2.8" >> matrix.body + echo "$rtst -w work_PR3_UQ $ww3 ww3_tp2.8" >> matrix.body echo "$rtst -s PR3_UQ -w work_PR3_UQ $ww3 ww3_tp2.13" >> matrix.body - echo "$rtst -o netcdf -w work_PR3_UQ $ww3 ww3_tp2.15" >> matrix.body - echo "$rtst -o netcdf -w work_5km -g 5km $ww3 ww3_tp2.15" >> matrix.body - echo "$rtst -o netcdf -i input_rho -w work_PR3_UQ_RHO $ww3 ww3_tp2.15" >> matrix.body - echo "$rtst -s ST4 -i input_rho -w work_ST4FLX5 -o netcdf $ww3 ww3_tp2.15" >> matrix.body - echo "$rtst -s ST6 -i input_rho -w work_ST6FLX5 -o netcdf $ww3 ww3_tp2.15" >> matrix.body - echo "$rtst -o netcdf -s TIDE -w work_TIDE $ww3 ww3_tp2.18" >> matrix.body + echo "$rtst -w work_PR3_UQ $ww3 ww3_tp2.15" >> matrix.body + echo "$rtst -w work_5km -g 5km $ww3 ww3_tp2.15" >> matrix.body + echo "$rtst -i input_rho -w work_PR3_UQ_RHO $ww3 ww3_tp2.15" >> matrix.body + echo "$rtst -s ST4 -i input_rho -w work_ST4FLX5 $ww3 ww3_tp2.15" >> matrix.body + echo "$rtst -s ST6 -i input_rho -w work_ST6FLX5 $ww3 ww3_tp2.15" >> matrix.body + echo "$rtst -s TIDE -w work_TIDE $ww3 ww3_tp2.18" >> matrix.body fi if [ "$multi01" = 'y' ] @@ -811,7 +811,7 @@ echo "$rtst -s MPI -w work_PR3_UQ_MPI -f -p $mpi -n $np $ww3 ww3_tp2.15" >> matrix.body echo "$rtst -s MPI -w work_MPI_5km -g 5km -f -p $mpi -n $np $ww3 ww3_tp2.15" >> matrix.body echo "$rtst -s MPI -i input_rho -w work_PR3_UQ_RHO_MPI -f -p $mpi -n $np $ww3 ww3_tp2.15" >> matrix.body - echo "$rtst -s TIDE_MPI -w work_TIDE_MPI -o netcdf -f -p $mpi -n $np $ww3 ww3_tp2.18" >> matrix.body + echo "$rtst -s TIDE_MPI -w work_TIDE_MPI -f -p $mpi -n $np $ww3 ww3_tp2.18" >> matrix.body fi if [ "$multi01" = 'y' ] @@ -909,8 +909,8 @@ echo "$rtst -s ST4_WRT -w work_ST4_WRT $ww3 ww3_ts1" >> matrix.body echo "$rtst -s ST4_GMD -w work_ST4_GMD $ww3 ww3_ts1" >> matrix.body echo "$rtst -s ST4_TSA -w work_ST4_TSA $ww3 ww3_ts1" >> matrix.body - echo "$rtst -s ST6 -w work_ST6 -o netcdf $ww3 ww3_ts1" >> matrix.body - echo "$rtst -i input_nl5_matrix -w work_NL5 -o both $ww3 ww3_ts1" >> matrix.body + echo "$rtst -s ST6 -w work_ST6 $ww3 ww3_ts1" >> matrix.body + echo "$rtst -i input_nl5_matrix -w work_NL5 $ww3 ww3_ts1" >> matrix.body fi # fetch limited growth, no switch sharing here @@ -1857,7 +1857,7 @@ if [ "$infgrv" = 'y' ] && [ "$shrd" = 'y' ] then echo ' ' >> matrix.body - echo "$rtst $ww3 -w work_IG1 -o netcdf ww3_tig1.1" >> matrix.body + echo "$rtst $ww3 -w work_IG1 ww3_tig1.1" >> matrix.body fi # SMC grid cases, MPI only if requested @@ -1865,20 +1865,20 @@ if [ "$smcgr" = 'y' ] && [ "$shrd" = 'y' ] && [ "$dist" != 'y' ] then echo ' ' >> matrix.body - echo "$rtst $ww3 -w work_SHRD_SMC -o both ww3_tp2.10" >> matrix.body - echo "$rtst -w work_SHRD $ww3 -o both ww3_tp2.16" >> matrix.body + echo "$rtst $ww3 -w work_SHRD_SMC ww3_tp2.10" >> matrix.body + echo "$rtst -w work_SHRD $ww3 ww3_tp2.16" >> matrix.body fi if [ "$smcgr" = 'y' ] && [ "$dist" = 'y' ] then echo ' ' >> matrix.body - echo "$rtst -s MPI -w work_MPI -f -p $mpi -n $np $ww3 -o both ww3_tp2.10" >> matrix.body - echo "$rtst -s MPI -w work_MPI -f -p $mpi -n $np $ww3 -o both ww3_tp2.16" >> matrix.body + echo "$rtst -s MPI -w work_MPI -f -p $mpi -n $np $ww3 ww3_tp2.10" >> matrix.body + echo "$rtst -s MPI -w work_MPI -f -p $mpi -n $np $ww3 ww3_tp2.16" >> matrix.body fi if [ "$smcgr" = 'y' ] && [ "$hybd" = 'y' ]; then - echo "$rtst -s MPI_OMPH -w work_MPI_OMPH -f -p $mpi -n $nr -t $nth $ww3 -o both ww3_tp2.10" >> matrix.body - echo "$rtst -s MPI_OMPH -w work_MPI_OMPH -f -p $mpi -n $nr -t $nth $ww3 -o both ww3_tp2.16" >> matrix.body + echo "$rtst -s MPI_OMPH -w work_MPI_OMPH -f -p $mpi -n $nr -t $nth $ww3 ww3_tp2.10" >> matrix.body + echo "$rtst -s MPI_OMPH -w work_MPI_OMPH -f -p $mpi -n $nr -t $nth $ww3 ww3_tp2.16" >> matrix.body fi if [ "$multi09" = 'y' ] @@ -1900,13 +1900,13 @@ if [ "$rtd" = 'y' ] && [ "$shrd" = 'y' ] && [ "$dist" != 'y' ] then echo ' ' >> matrix.body - echo "$rtst $ww3 -w work_SHRD_RTD -o both ww3_tp2.11" >> matrix.body + echo "$rtst $ww3 -w work_SHRD_RTD ww3_tp2.11" >> matrix.body fi if [ "$rtd" = 'y' ] && [ "$dist" = 'y' ] then echo ' ' >> matrix.body - echo "$rtst -s MPI -w work_MPI -f -p $mpi -n $np $ww3 -o both ww3_tp2.11" >> matrix.body + echo "$rtst -s MPI -w work_MPI -f -p $mpi -n $np $ww3 ww3_tp2.11" >> matrix.body fi # mud/ice cases @@ -1926,7 +1926,7 @@ echo "$rtst -g 10km -w work_10km_IC1 -i input_IC1 $ww3 ww3_tic1.1" >> matrix.body echo "$rtst -g 20km -w work_20km_IC1 -i input_IC1 $ww3 ww3_tic1.1" >> matrix.body echo "$rtst -w work_IC1 -i input_IC1 $ww3 ww3_tic2.1" >> matrix.body - echo "$rtst -w work_IC2IS2 -o netcdf $ww3 ww3_tic2.2" >> matrix.body + echo "$rtst -w work_IC2IS2 $ww3 ww3_tic2.2" >> matrix.body echo "$rtst -g 1000m -w work_1000m_IC2_nrl -i input_IC2_nrl $ww3 ww3_tic1.1" >> matrix.body echo "$rtst -w work_IC2_nondisp_SMPL -i input_IC2_nondisp $ww3 ww3_tic1.1" >> matrix.body echo "$rtst -g 1000m_nondisp -w work_1000m_nondisp_IC2_ifr -i input_IC2_ifr $ww3 ww3_tic1.1" >> matrix.body @@ -1970,10 +1970,10 @@ echo "$rtst -s PR3_UQ_REFRX -w work_IC3_2.5k_PR3_UQ -i input_IC3_2.5k $ww3 ww3_tic1.3" >> matrix.body echo "$rtst -s PR3_UNO_REFRX -w work_IC3_0.5k_PR3_UNO -i input_IC3_0.5k $ww3 ww3_tic1.3" >> matrix.body echo "$rtst -s PR3_UNO_REFRX -w work_IC3_2.5k_PR3_UNO -i input_IC3_2.5k $ww3 ww3_tic1.3" >> matrix.body - echo "$rtst -s IC0IS2 -w work_IC0IS2_1000 -g 1000m -o netcdf $ww3 ww3_tic1.4" >> matrix.body - echo "$rtst -s IC1IS2 -w work_IC1IS2_1000 -g 1000m -o netcdf $ww3 ww3_tic1.4" >> matrix.body - echo "$rtst -s IC2IS2 -w work_IC2IS2_IC2b -g IC2b_1000m -o netcdf $ww3 ww3_tic1.4" >> matrix.body - echo "$rtst -s IC2IS2 -w work_IC2IS2_IC2d -g IC2d_1000m -o netcdf $ww3 ww3_tic1.4" >> matrix.body + echo "$rtst -s IC0IS2 -w work_IC0IS2_1000 -g 1000m $ww3 ww3_tic1.4" >> matrix.body + echo "$rtst -s IC1IS2 -w work_IC1IS2_1000 -g 1000m $ww3 ww3_tic1.4" >> matrix.body + echo "$rtst -s IC2IS2 -w work_IC2IS2_IC2b -g IC2b_1000m $ww3 ww3_tic1.4" >> matrix.body + echo "$rtst -s IC2IS2 -w work_IC2IS2_IC2d -g IC2d_1000m $ww3 ww3_tic1.4" >> matrix.body echo "$rtst -s IC2IS2 -w work_IC2IS2scat -g scat $ww3 ww3_tic2.3" >> matrix.body echo "$rtst -s IC2IS2 -w work_IC2IS2creep -g creepOnly $ww3 ww3_tic2.3" >> matrix.body echo "$rtst -s IC2IS2 -w work_IC2IS2dissip -g dissipOnly $ww3 ww3_tic2.3" >> matrix.body @@ -2002,22 +2002,22 @@ if [ "$pdlib" = 'y' ] && [ "$dist" = 'y' ] then echo ' ' >> matrix.body - echo "$rtst -s MPI -s NO_PDLIB -w work_a -g a -f -p $mpi -n $np -o all $ww3 ww3_tp2.17" >> matrix.body - echo "$rtst -s MPI -s NO_PDLIB -w work_ma -m grdset_a -f -p $mpi -n $np -o all $ww3 ww3_tp2.17" >> matrix.body - echo "$rtst -s MPI -s PDLIB -w work_b -g b -f -p $mpi -n $np -o all $ww3 ww3_tp2.17" >> matrix.body - echo "$rtst -s MPI -s PDLIB -w work_c -g c -f -p $mpi -n $np -o all $ww3 ww3_tp2.17" >> matrix.body - echo "$rtst -s MPI -s PDLIB -w work_pdlib -g pdlib -f -p $mpi -n $np -o all $ww3 ww3_tp2.6" >> matrix.body - echo "$rtst -s MPI -s PDLIB -w work_mb -m grdset_b -f -p $mpi -n $np -o all $ww3 ww3_tp2.17" >> matrix.body - echo "$rtst -s MPI -s PDLIB -w work_mc -m grdset_c -f -p $mpi -n $np -o all $ww3 ww3_tp2.17" >> matrix.body + echo "$rtst -s MPI -s NO_PDLIB -w work_a -g a -f -p $mpi -n $np $ww3 ww3_tp2.17" >> matrix.body + echo "$rtst -s MPI -s NO_PDLIB -w work_ma -m grdset_a -f -p $mpi -n $np $ww3 ww3_tp2.17" >> matrix.body + echo "$rtst -s MPI -s PDLIB -w work_b -g b -f -p $mpi -n $np $ww3 ww3_tp2.17" >> matrix.body + echo "$rtst -s MPI -s PDLIB -w work_c -g c -f -p $mpi -n $np $ww3 ww3_tp2.17" >> matrix.body + echo "$rtst -s MPI -s PDLIB -w work_pdlib -g pdlib -f -p $mpi -n $np $ww3 ww3_tp2.6" >> matrix.body + echo "$rtst -s MPI -s PDLIB -w work_mb -m grdset_b -f -p $mpi -n $np $ww3 ww3_tp2.17" >> matrix.body + echo "$rtst -s MPI -s PDLIB -w work_mc -m grdset_c -f -p $mpi -n $np $ww3 ww3_tp2.17" >> matrix.body if [ "$rstrt_b4b" = 'y' ] then echo "mkdir -p ww3_tp2.17/work_ma1" >> matrix.body echo "cp ww3_tp2.17/work_ma/restart001.inla ww3_tp2.17/work_ma1/restart.inla" >> matrix.body - echo "$rtst -s MPI -s NO_PDLIB -w work_ma1 -m grdset_a1 -f -p $mpi -n $np -o all $ww3 ww3_tp2.17" >> matrix.body + echo "$rtst -s MPI -s NO_PDLIB -w work_ma1 -m grdset_a1 -f -p $mpi -n $np $ww3 ww3_tp2.17" >> matrix.body echo "./bin/test.comp ww3_tp2.17 work_ma work_ma1" >> matrix.body echo "mkdir -p ww3_tp2.17/work_mc1" >> matrix.body echo "cp ww3_tp2.17/work_mc/restart001.inlc ww3_tp2.17/work_mc1/restart.inlc" >> matrix.body - echo "$rtst -s MPI -s PDLIB -w work_mc1 -m grdset_c1 -f -p $mpi -n $np -o all $ww3 ww3_tp2.17" >> matrix.body + echo "$rtst -s MPI -s PDLIB -w work_mc1 -m grdset_c1 -f -p $mpi -n $np $ww3 ww3_tp2.17" >> matrix.body echo "./bin/test.comp ww3_tp2.17 work_mc work_mc1" >> matrix.body fi fi @@ -2042,12 +2042,12 @@ if [ "$uost" = 'y' ] && [ "$dist" = 'y' ] then echo ' ' >> matrix.body - echo "$rtst -s MPI -s NO_PDLIB -w work_a -g a -f -p $mpi -n $np -o netcdf $ww3 ww3_tp2.21" >> matrix.body - echo "$rtst -s MPI -s NO_PDLIB -w work_ma -m grdset_a -f -p $mpi -n $np -o netcdf $ww3 ww3_tp2.21" >> matrix.body + echo "$rtst -s MPI -s NO_PDLIB -w work_a -g a -f -p $mpi -n $np $ww3 ww3_tp2.21" >> matrix.body + echo "$rtst -s MPI -s NO_PDLIB -w work_ma -m grdset_a -f -p $mpi -n $np $ww3 ww3_tp2.21" >> matrix.body if [ "$pdlib" = 'y' ] then - echo "$rtst -s MPI -s PDLIB -w work_b -g b -f -p $mpi -n $np -o netcdf $ww3 ww3_tp2.21" >> matrix.body - echo "$rtst -s MPI -s PDLIB -w work_mb -m grdset_b -f -p $mpi -n $np -o netcdf $ww3 ww3_tp2.21" >> matrix.body + echo "$rtst -s MPI -s PDLIB -w work_b -g b -f -p $mpi -n $np $ww3 ww3_tp2.21" >> matrix.body + echo "$rtst -s MPI -s PDLIB -w work_mb -m grdset_b -f -p $mpi -n $np $ww3 ww3_tp2.21" >> matrix.body fi fi @@ -2075,28 +2075,28 @@ if [ "$oasis" = 'y' ] && [ "$dist" = 'y' ] then echo ' ' >> matrix.body - echo "$rtst -s OASACM -w work_OASACM -C OASIS -f -p $mpi -n $np -o netcdf $ww3 ww3_tp2.14" >> matrix.body - echo "$rtst -s OASACM2 -w work_OASACM2 -C OASIS -f -p $mpi -n $np -o netcdf $ww3 ww3_tp2.14" >> matrix.body + echo "$rtst -s OASACM -w work_OASACM -C OASIS -f -p $mpi -n $np $ww3 ww3_tp2.14" >> matrix.body + echo "$rtst -s OASACM2 -w work_OASACM2 -C OASIS -f -p $mpi -n $np $ww3 ww3_tp2.14" >> matrix.body echo "mkdir -p ww3_tp2.14/work_OASACM3" >> matrix.body echo "cp ww3_tp2.14/input/ww3_shel_OASACM3.nml ww3_tp2.14/work_OASACM3/ww3_shel.nml" >> matrix.body halfnp=$(($np / 2)) - echo "$rtst -s OASACM3 -w work_OASACM3 -f -p $mpi -n $halfnp -o netcdf $ww3 ww3_tp2.14" >> matrix.body + echo "$rtst -s OASACM3 -w work_OASACM3 -f -p $mpi -n $halfnp $ww3 ww3_tp2.14" >> matrix.body echo "mkdir -p ww3_tp2.14/work_OASACM4" >> matrix.body echo "ln -sf ../work_OASACM3/restart001.ww3 ww3_tp2.14/work_OASACM4/restart.ww3" >> matrix.body - echo "$rtst -r ww3_grid -s OASACM4 -w work_OASACM4 -C OASIS -f -p $mpi -n $np -o netcdf $ww3 ww3_tp2.14" >> matrix.body - echo "$rtst -r ww3_shel -s OASACM4 -w work_OASACM4 -C OASIS -f -p $mpi -n $np -o netcdf $ww3 ww3_tp2.14" >> matrix.body - echo "$rtst -r ww3_ounf -s OASACM4 -w work_OASACM4 -C OASIS -f -p $mpi -n $np -o netcdf $ww3 ww3_tp2.14" >> matrix.body + echo "$rtst -r ww3_grid -s OASACM4 -w work_OASACM4 -C OASIS -f -p $mpi -n $np $ww3 ww3_tp2.14" >> matrix.body + echo "$rtst -r ww3_shel -s OASACM4 -w work_OASACM4 -C OASIS -f -p $mpi -n $np $ww3 ww3_tp2.14" >> matrix.body + echo "$rtst -r ww3_ounf -s OASACM4 -w work_OASACM4 -C OASIS -f -p $mpi -n $np $ww3 ww3_tp2.14" >> matrix.body echo "mkdir -p ww3_tp2.14/work_OASACM5" >> matrix.body echo "ln -sf ../work_OASACM4/restart001.ww3 ww3_tp2.14/work_OASACM5/restart.ww3" >> matrix.body - echo "$rtst -r ww3_grid -s OASACM5 -w work_OASACM5 -C OASIS -f -p $mpi -n $np -o netcdf $ww3 ww3_tp2.14" >> matrix.body - echo "$rtst -r ww3_shel -s OASACM5 -w work_OASACM5 -C OASIS -f -p $mpi -n $np -o netcdf $ww3 ww3_tp2.14" >> matrix.body - echo "$rtst -r ww3_ounf -s OASACM5 -w work_OASACM5 -C OASIS -f -p $mpi -n $np -o netcdf $ww3 ww3_tp2.14" >> matrix.body + echo "$rtst -r ww3_grid -s OASACM5 -w work_OASACM5 -C OASIS -f -p $mpi -n $np $ww3 ww3_tp2.14" >> matrix.body + echo "$rtst -r ww3_shel -s OASACM5 -w work_OASACM5 -C OASIS -f -p $mpi -n $np $ww3 ww3_tp2.14" >> matrix.body + echo "$rtst -r ww3_ounf -s OASACM5 -w work_OASACM5 -C OASIS -f -p $mpi -n $np $ww3 ww3_tp2.14" >> matrix.body echo "mv ww3_tp2.14/input/ww3_ounf.inp ww3_tp2.14/input/ww3_ounf.inp.bak" >> matrix.body echo "cp ww3_tp2.14/input/ww3_ounf.inp-OASACM6 ww3_tp2.14/input/ww3_ounf.inp" >> matrix.body - echo "$rtst -g OASACM6 -s OASACM6 -w work_OASACM6 -C OASIS -f -p $mpi -n $np -o netcdf $ww3 ww3_tp2.14" >> matrix.body + echo "$rtst -g OASACM6 -s OASACM6 -w work_OASACM6 -C OASIS -f -p $mpi -n $np $ww3 ww3_tp2.14" >> matrix.body echo "mv ww3_tp2.14/input/ww3_ounf.inp.bak ww3_tp2.14/input/ww3_ounf.inp" >> matrix.body - echo "$rtst -s OASOCM -w work_OASOCM -C OASIS -f -p $mpi -n $np -o netcdf $ww3 ww3_tp2.14" >> matrix.body - echo "$rtst -s OASICM -w work_OASICM -C OASIS -f -p $mpi -n $np -o netcdf $ww3 ww3_tp2.14" >> matrix.body + echo "$rtst -s OASOCM -w work_OASOCM -C OASIS -f -p $mpi -n $np $ww3 ww3_tp2.14" >> matrix.body + echo "$rtst -s OASICM -w work_OASICM -C OASIS -f -p $mpi -n $np $ww3 ww3_tp2.14" >> matrix.body fi #Test of UFS applications with ww3_multi and grib2 output @@ -2106,43 +2106,43 @@ if [ "$ufscoarse" = 'y' ] then echo ' ' >> matrix.body - echo "$rtst -s MPI -w work_c -m grdset_c -f -p $mpi -n $np -o all $ww3 ww3_ufs1.1" >> matrix.body + echo "$rtst -s MPI -w work_c -m grdset_c -f -p $mpi -n $np $ww3 ww3_ufs1.1" >> matrix.body if [ "$npl_b4b" = 'y' ] then halfnp=$(($np / 2)) - echo "$rtst -s MPI -w work_c_npl -m grdset_c -f -p $mpi -n $halfnp -o all $ww3 ww3_ufs1.1" >> matrix.body + echo "$rtst -s MPI -w work_c_npl -m grdset_c -f -p $mpi -n $halfnp $ww3 ww3_ufs1.1" >> matrix.body echo "./bin/test.comp ww3_ufs1.1 work_c work_c_npl" >> matrix.body fi if [ "$nth_b4b" = 'y' ] then - echo "$rtst -s MPI_OMPH -w work_c_nth -m grdset_c -f -p $mpi -n $nr -t $nth -o all $ww3 ww3_ufs1.1" >> matrix.body + echo "$rtst -s MPI_OMPH -w work_c_nth -m grdset_c -f -p $mpi -n $nr -t $nth $ww3 ww3_ufs1.1" >> matrix.body echo "./bin/test.comp ww3_ufs1.1 work_c work_c_nth" >> matrix.body fi if [ "$rstrt_b4b" = 'y' ] then echo "mkdir -p ww3_ufs1.1/work_d" >> matrix.body echo "cp ww3_ufs1.1/work_c/20210401.030000.restart.glo_5deg ww3_ufs1.1/work_d/restart.glo_5deg" >> matrix.body - echo "$rtst -s MPI -w work_d -m grdset_d -f -p $mpi -n $np -o all $ww3 ww3_ufs1.1" >> matrix.body + echo "$rtst -s MPI -w work_d -m grdset_d -f -p $mpi -n $np $ww3 ww3_ufs1.1" >> matrix.body echo "./bin/test.comp ww3_ufs1.1 work_c work_d" >> matrix.body fi else echo ' ' >> matrix.body - echo "$rtst -s MPI_OMPH -w work_a -m grdset_a -f -p $mpi -n $npl -t $nth1 -o all $ww3 ww3_ufs1.1" >> matrix.body + echo "$rtst -s MPI_OMPH -w work_a -m grdset_a -f -p $mpi -n $npl -t $nth1 $ww3 ww3_ufs1.1" >> matrix.body if [ "$npl_b4b" = 'y' ] then - echo "$rtst -s MPI_OMPH -w work_a_npl -m grdset_a -f -p $mpi -n $npl1 -t $nth1 -o all $ww3 ww3_ufs1.1" >> matrix.body + echo "$rtst -s MPI_OMPH -w work_a_npl -m grdset_a -f -p $mpi -n $npl1 -t $nth1 $ww3 ww3_ufs1.1" >> matrix.body echo "./bin/test.comp ww3_ufs1.1 work_a work_a_npl" >> matrix.body fi if [ "$nth_b4b" = 'y' ] then - echo "$rtst -s MPI_OMPH -w work_a_nth -m grdset_a -f -p $mpi -n $npl -t $nth -o all $ww3 ww3_ufs1.1" >> matrix.body + echo "$rtst -s MPI_OMPH -w work_a_nth -m grdset_a -f -p $mpi -n $npl -t $nth $ww3 ww3_ufs1.1" >> matrix.body echo "./bin/test.comp ww3_ufs1.1 work_a work_a_nth" >> matrix.body fi if [ "$rstrt_b4b" = 'y' ] then echo "mkdir -p ww3_ufs1.1/work_b" >> matrix.body echo "cp ww3_ufs1.1/work_a/20210401.030000.restart.glo_1deg ww3_ufs1.1/work_b/restart.glo_1deg" >> matrix.body - echo "$rtst -s MPI_OMPH -w work_b -m grdset_b -f -p $mpi -n $npl -t $nth1 -o all $ww3 ww3_ufs1.1" >> matrix.body + echo "$rtst -s MPI_OMPH -w work_b -m grdset_b -f -p $mpi -n $npl -t $nth1 $ww3 ww3_ufs1.1" >> matrix.body echo "./bin/test.comp ww3_ufs1.1 work_a work_b" >> matrix.body fi fi @@ -2152,12 +2152,12 @@ if [ "$ufs" = 'y' ] && [ "$esmf" = 'y' ] && [ "$grib" = 'y' ] then echo ' ' >> matrix.body - echo "$rtst -s MPI -w work_a_esmf -m grdset_a -C ESMF -f -p $mpi -n $npl -o all $ww3 ww3_ufs1.1" >> matrix.body + echo "$rtst -s MPI -w work_a_esmf -m grdset_a -C ESMF -f -p $mpi -n $npl $ww3 ww3_ufs1.1" >> matrix.body if [ "$rstrt_b4b" = 'y' ] then echo "mkdir -p ww3_ufs1.1/work_b_esmf" >> matrix.body echo "cp ww3_ufs1.1/work_a_esmf/20210401.030000.restart.glo_1deg ww3_ufs1.1/work_b_esmf/restart.glo_1deg" >> matrix.body - echo "$rtst -s MPI -w work_b_esmf -m grdset_b -C ESMF -f -p $mpi -n $npl -o all $ww3 ww3_ufs1.1" >> matrix.body + echo "$rtst -s MPI -w work_b_esmf -m grdset_b -C ESMF -f -p $mpi -n $npl $ww3 ww3_ufs1.1" >> matrix.body echo "./bin/test.comp ww3_ufs1.1 work_a_esmf work_b_esmf" >> matrix.body fi fi @@ -2166,14 +2166,14 @@ if [ "$ufs" = 'y' ] && [ "$grib" = 'y' ] then echo ' ' >> matrix.body - echo "$rtst -s MPI_OMPH -w work_a -m grdset_a -f -p $mpi -n $npl -t $nth1 -o all $ww3 ww3_ufs1.2" >> matrix.body + echo "$rtst -s MPI_OMPH -w work_a -m grdset_a -f -p $mpi -n $npl -t $nth1 $ww3 ww3_ufs1.2" >> matrix.body if [ "$rstrt_b4b" = 'y' ] then echo "mkdir -p ww3_ufs1.2/work_b" >> matrix.body echo "cp ww3_ufs1.2/work_a/20210401.030000.restart.gnh_10m ww3_ufs1.2/work_b/restart.gnh_10m" >> matrix.body echo "cp ww3_ufs1.2/work_a/20210401.030000.restart.gsh_15m ww3_ufs1.2/work_b/restart.gsh_15m" >> matrix.body echo "cp ww3_ufs1.2/work_a/20210401.030000.restart.aoc_9km ww3_ufs1.2/work_b/restart.aoc_9km" >> matrix.body - echo "$rtst -s MPI_OMPH -w work_b -m grdset_b -f -p $mpi -n $npl -t $nth1 -o all $ww3 ww3_ufs1.2" >> matrix.body + echo "$rtst -s MPI_OMPH -w work_b -m grdset_b -f -p $mpi -n $npl -t $nth1 $ww3 ww3_ufs1.2" >> matrix.body echo "./bin/test.comp ww3_ufs1.2 work_a work_b" >> matrix.body fi fi @@ -2182,14 +2182,14 @@ if [ "$ufs" = 'y' ] && [ "$esmf" = 'y' ] && [ "$grib" = 'y' ] then echo ' ' >> matrix.body - echo "$rtst -s MPI_OMPH -w work_a_esmf -m grdset_a -C ESMF -f -p $mpi -n $npl -t $nth1 -o all $ww3 ww3_ufs1.2" >> matrix.body + echo "$rtst -s MPI_OMPH -w work_a_esmf -m grdset_a -C ESMF -f -p $mpi -n $npl -t $nth1 $ww3 ww3_ufs1.2" >> matrix.body if [ "$rstrt_b4b" = 'y' ] then echo "mkdir -p ww3_ufs1.2/work_b_esmf" >> matrix.body echo "cp ww3_ufs1.2/work_a_esmf/20210401.030000.restart.gnh_10m ww3_ufs1.2/work_b_esmf/restart.gnh_10m" >> matrix.body echo "cp ww3_ufs1.2/work_a_esmf/20210401.030000.restart.gsh_15m ww3_ufs1.2/work_b_esmf/restart.gsh_15m" >> matrix.body echo "cp ww3_ufs1.2/work_a_esmf/20210401.030000.restart.aoc_9km ww3_ufs1.2/work_b_esmf/restart.aoc_9km" >> matrix.body - echo "$rtst -s MPI_OMPH -w work_b_esmf -m grdset_b -C ESMF -f -p $mpi -n $npl -t $nth1 -o all $ww3 ww3_ufs1.2" >> matrix.body + echo "$rtst -s MPI_OMPH -w work_b_esmf -m grdset_b -C ESMF -f -p $mpi -n $npl -t $nth1 $ww3 ww3_ufs1.2" >> matrix.body echo "./bin/test.comp ww3_ufs1.2 work_a_esmf work_b_esmf" >> matrix.body fi fi @@ -2199,7 +2199,7 @@ if [ "$ufs" = 'y' ] && [ "$grib" = 'y' ] then echo ' ' >> matrix.body - echo "$rtst -s MPI_OMPH -w work_a -m grdset_a -f -p $mpi -n $npl -t $nth1 -o all $ww3 ww3_ufs1.3" >> matrix.body + echo "$rtst -s MPI_OMPH -w work_a -m grdset_a -f -p $mpi -n $npl -t $nth1 $ww3 ww3_ufs1.3" >> matrix.body fi @@ -2207,16 +2207,16 @@ if [ "$calendar" = 'y' ] then echo ' ' >> matrix.body - echo "$rtst -g STD -w work_STD -o netcdf $ww3 ww3_tc1" >> matrix.body - echo "$rtst -g C360 -w work_C360 -o netcdf $ww3 ww3_tc1" >> matrix.body - echo "$rtst -g C365 -w work_C365 -o netcdf $ww3 ww3_tc1" >> matrix.body + echo "$rtst -g STD -w work_STD $ww3 ww3_tc1" >> matrix.body + echo "$rtst -g C360 -w work_C360 $ww3 ww3_tc1" >> matrix.body + echo "$rtst -g C365 -w work_C365 $ww3 ww3_tc1" >> matrix.body fi # Configurable netCDF metadata in ww3_ounf if [ "$confignc" = 'y' ] && [ "$shrd" = 'y' ] then echo ' ' >> matrix.body - echo "$rtst -o netcdf -N $ww3 ww3_tnc1" >> matrix.body + echo "$rtst -N $ww3 ww3_tnc1" >> matrix.body fi # --------------------------------------------------------------------------- # diff --git a/regtests/bin/matrix_datarmor b/regtests/bin/matrix_datarmor index 9f449bdcf..915cd5876 100755 --- a/regtests/bin/matrix_datarmor +++ b/regtests/bin/matrix_datarmor @@ -1,6 +1,6 @@ #!/bin/bash # --------------------------------------------------------------------------- # -# matrix.go: Run matrix of regression tests on target machine. # +# matrix_datarmor: Run matrix of regression tests on target machine. # # # # Remarks: # # - This version is set up for automatic w3_setenv script and for the # @@ -8,9 +8,12 @@ # computer, please copy rather than modify. # # # # Hendrik L. Tolman # +# Mickael Accensi # +# # # August 2013 # # December 2013 # # April 2018 # +# October 2021 # # # # Copyright 2013 National Weather Service (NWS), # # National Oceanic and Atmospheric Administration. All rights # @@ -31,16 +34,30 @@ echo "Save source codes : $source" echo "Save listings : $list" +# Compiler option. Choose appropriate compiler and set cmplOption to +# y if using for the first time or using a different compiler + + cmplr=datarmor_intel + export cmplOption='y' # 1. Set up + + export cmplOption='y' + export np='28' #number of mpi tasks + export npl='28' #number of mpi tasks for ufs applications and large setups + export npl1='20' #number of mpi tasks for ufs/large setups (b4b check) + export nr='4' #number of mpi tasks for hybrid + export nth='7' #number of threads + export nth1='6' #number of threads (b4b check) + # 1.a Computer/ user dependent set up echo '#!/bin/bash' > matrix.head echo ' ' >> matrix.head echo '#PBS -q mpi_1' >> matrix.head - echo '#PBS -l mem=20G' >> matrix.head - echo '#PBS -l walltime=48:00:00' >> matrix.head - echo '#PBS -N ww3_regtest' >> matrix.head + echo "#PBS -l select=1:ncpus=28:mpiprocs=$nr:ompthreads=$nth:mem=20G" >> matrix.head + echo '#PBS -l walltime=08:00:00' >> matrix.head + echo "#PBS -N $(basename $(dirname $(dirname $PWD)))" >> matrix.head echo '#PBS -j oe' >> matrix.head echo '#PBS -o matrix.out' >> matrix.head echo ' ' >> matrix.head @@ -48,72 +65,57 @@ echo " cd $(dirname $main_dir)/regtests" >> matrix.head echo ' ' >> matrix.head -# Netcdf modules - - cmplr=datarmor_intel +# Netcdf, grib and Parmetis modules echo ' source /usr/share/Modules/3.2.10/init/bash' >> matrix.head echo ' module purge' >> matrix.head - echo " export WW3_PARCOMPN=4" >> matrix.head if [ $cmplr = "datarmor_intel_debug" ] || [ $cmplr = "datarmor_intel" ] then + COMP='INTEL' echo ' module load intel-comp/18' >> matrix.head echo ' module load impi/2018.1.163' >> matrix.head - echo ' export PATH=${PATH}:/home/datawork-wave/NETCDF2019/INTEL/bin' >> matrix.head - echo ' export CPATH=${CPATH}:/home/datawork-wave/NETCDF2019/INTEL/include' >> matrix.head - echo ' export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/home/datawork-wave/NETCDF2019/INTEL/lib' >> matrix.head - echo ' export NETCDF_CONFIG=/home/datawork-wave/NETCDF2019/INTEL/bin/nc-config' >> matrix.head - echo ' export METIS_PATH=/home/datawork-wave/PARMETIS2019/INTEL' >> matrix.head - elif [ $cmplr = "datarmor_mpt_debug" ] || [ $cmplr = "datarmor_mpt" ] then + COMP='MPT' echo ' module load intel-comp/18' >> matrix.head echo ' module load mpt/2.18' >> matrix.head - echo ' export PATH=${PATH}:/home/datawork-wave/NETCDF2019/MPT/bin' >> matrix.head - echo ' export CPATH=${CPATH}:/home/datawork-wave/NETCDF2019/MPT/include' >> matrix.head - echo ' export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/home/datawork-wave/NETCDF2019/MPT/lib' >> matrix.head - echo ' export NETCDF_CONFIG=/home/datawork-wave/NETCDF2019/MPT/bin/nc-config' >> matrix.head - echo ' export METIS_PATH=/home/datawork-wave/PARMETIS2019/MPT' >> matrix.head - elif [ $cmplr = "datarmor_gnu_debug" ] || [ $cmplr = "datarmor_gnu" ] then + COMP='GNU' echo ' module load impi/2018.1.163' >> matrix.head - echo ' export PATH=${PATH}:/home/datawork-wave/NETCDF2019/GNU/bin' >> matrix.head - echo ' export CPATH=${CPATH}:/home/datawork-wave/NETCDF2019/GNU/include' >> matrix.head - echo ' export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/home/datawork-wave/NETCDF2019/GNU/lib' >> matrix.head - echo ' export NETCDF_CONFIG=/home/datawork-wave/NETCDF2019/GNU/bin/nc-config' >> matrix.head - echo ' export METIS_PATH=/home/datawork-wave/PARMETIS2019/GNU' >> matrix.head - elif [ $cmplr = "datarmor_pgi_debug" ] || [ $cmplr = "datarmor_pgi" ] then + COMP='PGI' echo ' module load pgi/17.10' >> matrix.head - echo ' export PATH=${PATH}:/home/datawork-wave/NETCDF2019/PGI/bin' >> matrix.head - echo ' export CPATH=${CPATH}:/home/datawork-wave/NETCDF2019/PGI/include' >> matrix.head - echo ' export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/home/datawork-wave/NETCDF2019/PGI/lib' >> matrix.head - echo ' export NETCDF_CONFIG=/home/datawork-wave/NETCDF2019/PGI/bin/nc-config' >> matrix.head - echo ' export METIS_PATH=/home/datawork-wave/PARMETIS2019/PGI' >> matrix.head fi + echo " export PATH=\${PATH}:/home/datawork-wave/NETCDF2019/${COMP}/bin" >> matrix.head + echo " export CPATH=\${CPATH}:/home/datawork-wave/NETCDF2019/${COMP}/include" >> matrix.head + echo " export LD_LIBRARY_PATH=\${LD_LIBRARY_PATH}:/home/datawork-wave/NETCDF2019/${COMP}/lib" >> matrix.head + echo " export NETCDF_CONFIG=/home/datawork-wave/NETCDF2019/${COMP}/bin/nc-config" >> matrix.head + echo " export METIS_PATH=/home/datawork-wave/PARMETIS2019/${COMP}" >> matrix.head + echo " export WW3_PARCOMPN=4" >> matrix.head + echo " export G2_LIB4=/home/datawork-wave/GRIB2021/${COMP}/lib/libg2.a" >> matrix.head + echo " export BACIO_LIB4=/home/datawork-wave/GRIB2021/${COMP}/lib/libbacio.a" >> matrix.head + echo " export JASPER_LIB=/home/datawork-wave/NETCDF2019/${COMP}/lib/libjasper.so" >> matrix.head + echo " export PNG_LIB=/home/datawork-wave/NETCDF2019/${COMP}/lib/libpng.so" >> matrix.head + echo " export Z_LIB=/lib64/libz.so.1" >> matrix.head echo ' ' -# Compiler option. Choose appropriate compiler and set cmplOption to -# y if using for the first time or using a different compiler - - export cmplOption='y' - - export mpi='$MPI_LAUNCH' - export np='28' - export nr='14' - export nth='2' + export mpi='$MPI_LAUNCH' +# Compile option if [ "$cmplOption" = 'y' ] then - export rtst="./bin/run_test -o both -N -f -S -T -c $cmplr" + export opt="-o all -f -c $cmplr -S -T" else - export rtst="./bin/run_test -o both -N -f -S -T" + export opt="-o all -f -S -T" fi +# Base run_test command line + export rtst="./bin/run_test $opt" + export ww3='../model' # 1.b Flags to do course selection - - - - - - - - - - - - - - - - - - - - - - @@ -122,7 +124,7 @@ export shrd='y' # Do shared architecture tests export dist='y' # Do distributed architecture (MPI) tests export omp='y' # Threaded (OpenMP) tests - export hybd='n' # Hybrid options + export hybd='y' # Hybrid options export prop1D='y' # 1-D propagation tests (ww3_tp1.X) export prop2D='y' # 2-D propagation tests (ww3_tp2.X) @@ -138,7 +140,7 @@ export infgrv='y' # Second harmonic generation tests export uost='y' # ww3_ts4 Unresolved Obstacles Source Term (UOST) export assim='y' # Restart spectra update - export oasis='y' # Atmosphere, ocean, and ice coupling using oasis + export oasis='y' # Atmosphere, ocean, and ice coupling using OASIS export calendar='y' # Calendar type export confignc='y' # Configurable netCDF meta data (ww3_ounf) @@ -153,13 +155,13 @@ export multi09='y' # mww3_test_09 (SMC multi grid test) export ufs='n' # The Unified Forecast System export ufscoarse='n' # Option for small PCs - export grib='n' # grib file field output + export grib='y' # grib file field output export rstrt_b4b='y' # Restart Reproducibility export npl_b4b='y' # MPI task Reproducibility export nth_b4b='y' # Thread Reproducibility export esmf='n' # ESMF coupling # export filter='PR3 ST2 UQ' - # The filter does a set of consecutinve greps on the + # The filter does a set of consecutive greps on the # command lines generated by filter.base with the above # selected options. @@ -169,6 +171,7 @@ $main_dir/../regtests/bin/matrix.base + $main_dir/../regtests/bin/matrix_divider_p.sh # --------------------------------------------------------------------------- # # End to the matrix # # --------------------------------------------------------------------------- # diff --git a/regtests/bin/matrix_milhydro b/regtests/bin/matrix_milhydro index 6fdb27e35..1819084c4 100755 --- a/regtests/bin/matrix_milhydro +++ b/regtests/bin/matrix_milhydro @@ -65,9 +65,9 @@ # Compile option if [ "$cmplOption" = 'y' ] then - opt="-c $cmplr -S -T" + opt="-o all -c $cmplr -S -T" else - opt="-S" + opt="-o all -S" fi # Batch queue option if [ "$batchq" = 'slurm' ] diff --git a/regtests/bin/matrix_ncep b/regtests/bin/matrix_ncep index fb7e2d258..c2954cd4e 100755 --- a/regtests/bin/matrix_ncep +++ b/regtests/bin/matrix_ncep @@ -164,9 +164,9 @@ # Compile option if [ "$cmplOption" = 'y' ] then - opt="-c $cmplr -S -T" + opt="-o all -c $cmplr -S -T" else - opt="-S" + opt="-o all -S" fi # Batch queue option if [ "$batchq" = 'slurm' ] diff --git a/regtests/bin/matrix_s4 b/regtests/bin/matrix_s4 index 7413c7ffa..ae67c1b7b 100755 --- a/regtests/bin/matrix_s4 +++ b/regtests/bin/matrix_s4 @@ -121,9 +121,9 @@ # Compile option if [ "$cmplOption" = 'y' ] then - opt="-c $cmplr -S -T" + opt="-o all -c $cmplr -S -T" else - opt="-S" + opt="-o all -S" fi # Batch queue option opt="-b $batchq $opt" diff --git a/regtests/bin/matrix_ukmo_cray b/regtests/bin/matrix_ukmo_cray index 2cbbb72f2..e49890ef2 100755 --- a/regtests/bin/matrix_ukmo_cray +++ b/regtests/bin/matrix_ukmo_cray @@ -104,9 +104,9 @@ fi if [ "$cmplOption" = 'y' ] then - export rtst="./bin/run_test -c $cmplr -S" + export rtst="./bin/run_test -o both -c $cmplr -S" else - export rtst="./bin/run_test -S" + export rtst="./bin/run_test -o both -S" fi export ww3='../model' diff --git a/regtests/bin/run_test b/regtests/bin/run_test index 6b22e4120..b14739b46 100755 --- a/regtests/bin/run_test +++ b/regtests/bin/run_test @@ -469,8 +469,7 @@ fi # 3.b2 Preprocess cdl files into nc files ----------------------------------- # -filescdl=$path_i/*.cdl -for f in $filescdl +for f in $(find $path_i/ -type f -name "*.cdl") do echo "Converting $f to NetCDF" # take action on each file. Note that converted file is in $path_w diff --git a/regtests/ww3_tic2.2/input/ww3_outp_spec.inp b/regtests/ww3_tic2.2/input/ww3_outp_spec.inp index 91ccc1b90..095aa5006 100644 --- a/regtests/ww3_tic2.2/input/ww3_outp_spec.inp +++ b/regtests/ww3_tic2.2/input/ww3_outp_spec.inp @@ -2,17 +2,6 @@ $ WAVEWATCH III Point output post-processing $ ------------------------------------------ 19680606 120000 3600. 1 $ - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - 10 - 11 -1 $ 1 diff --git a/regtests/ww3_tic2.2/input/ww3_outp_tab50.inp b/regtests/ww3_tic2.2/input/ww3_outp_tab50.inp index 59b43e4b8..64ff51ab8 100644 --- a/regtests/ww3_tic2.2/input/ww3_outp_tab50.inp +++ b/regtests/ww3_tic2.2/input/ww3_outp_tab50.inp @@ -2,30 +2,6 @@ $ WAVEWATCH III Point output post-processing $ ------------------------------------------ 19680606 000000 600. 9999 $ - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - 10 - 11 - 12 - 13 - 14 - 15 - 16 - 17 - 18 - 19 - 20 - 21 - 22 - 23 - 24 -1 $ 2 diff --git a/regtests/ww3_tic2.2/input/ww3_outp_tab51.inp b/regtests/ww3_tic2.2/input/ww3_outp_tab51.inp index 386a1653d..8bdd659d6 100644 --- a/regtests/ww3_tic2.2/input/ww3_outp_tab51.inp +++ b/regtests/ww3_tic2.2/input/ww3_outp_tab51.inp @@ -2,8 +2,6 @@ $ WAVEWATCH III Point output post-processing $ ------------------------------------------ 19680606 000000 900. 49 $ -$ 1 - 16 -1 $ 2 diff --git a/regtests/ww3_tic2.2/input_IC2/ww3_outp_spec.inp b/regtests/ww3_tic2.2/input_IC2/ww3_outp_spec.inp index 91ccc1b90..095aa5006 100644 --- a/regtests/ww3_tic2.2/input_IC2/ww3_outp_spec.inp +++ b/regtests/ww3_tic2.2/input_IC2/ww3_outp_spec.inp @@ -2,17 +2,6 @@ $ WAVEWATCH III Point output post-processing $ ------------------------------------------ 19680606 120000 3600. 1 $ - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - 10 - 11 -1 $ 1 diff --git a/regtests/ww3_tic2.2/input_IC2/ww3_outp_tab50.inp b/regtests/ww3_tic2.2/input_IC2/ww3_outp_tab50.inp index 59b43e4b8..64ff51ab8 100644 --- a/regtests/ww3_tic2.2/input_IC2/ww3_outp_tab50.inp +++ b/regtests/ww3_tic2.2/input_IC2/ww3_outp_tab50.inp @@ -2,30 +2,6 @@ $ WAVEWATCH III Point output post-processing $ ------------------------------------------ 19680606 000000 600. 9999 $ - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - 10 - 11 - 12 - 13 - 14 - 15 - 16 - 17 - 18 - 19 - 20 - 21 - 22 - 23 - 24 -1 $ 2 diff --git a/regtests/ww3_tic2.2/input_IC2/ww3_outp_tab51.inp b/regtests/ww3_tic2.2/input_IC2/ww3_outp_tab51.inp index 386a1653d..8bdd659d6 100644 --- a/regtests/ww3_tic2.2/input_IC2/ww3_outp_tab51.inp +++ b/regtests/ww3_tic2.2/input_IC2/ww3_outp_tab51.inp @@ -2,8 +2,6 @@ $ WAVEWATCH III Point output post-processing $ ------------------------------------------ 19680606 000000 900. 49 $ -$ 1 - 16 -1 $ 2 From e6d27b901a4759b88be880b134ff673105fa3b43 Mon Sep 17 00:00:00 2001 From: Matthew Masarik <86749872+MatthewMasarik-NOAA@users.noreply.github.com> Date: Wed, 9 Feb 2022 17:06:36 -0500 Subject: [PATCH 05/44] ww3_doxy_tmpl.md: clarify MODULE markup (#606) --- docs/ww3_doxy_tmpl.md | 40 ++++++++++++++++++++-------------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/docs/ww3_doxy_tmpl.md b/docs/ww3_doxy_tmpl.md index 8069634ae..afd7d0cfb 100644 --- a/docs/ww3_doxy_tmpl.md +++ b/docs/ww3_doxy_tmpl.md @@ -12,38 +12,44 @@ _Doxygen markup headers to be placed **directly above** the respective Fortran c ``` ### MODULE +Module has two parts: a **header**, and **inline documentation** for module variables. +###### header ``` -!> @brief # contents of _1. Purpose_ from original header +!> @brief # contents of '1. Purpose' from original header !> !> @details !> !> @author @date - # ALL module variables documented -module_var_1 !< - ... -!> # multiples lines can be used -!> # if needed. -module_var_i - ... -module_var_N !< +``` + +###### inline documentation +*ALL* module variables need to be documented. To accomodate this, put each variable on it own line. +The documentation can go directly above or to the right of the variable declaration. Multiple lines +can be used. +``` +var_1 !< + . + . + !< +var_N !< ``` ### PROGRAM ``` -!> @brief # contents of _1. Purpose_ from original header +!> @brief # contents of '1. Purpose' from original header !> -!> @details # contents of _2. Method_ from original header +!> @details # contents of '2. Method' from original header !> !> @author @date ``` ### SUBROUTINE ``` -!> @brief # contents of _1. Purpose_ from original header +!> @brief # contents of '1. Purpose' from original header !> -!> @details # contents of _2. Method_ from original header +!> @details # contents of '2. Method' from original header !> -!> @param[in/out] # specify: [in], [out], [inout], or just `@param`. +!> @param[inout] # specify: [in], [out], [inout], or just `@param`. !> @author @date ``` @@ -60,12 +66,6 @@ module_var_N !< ``` -### Inline documentation (variables) -``` -!< # '!>' is equally valid here as well -``` - - ### Optional tags * Some of the more relevant tags that might be included: `@remark`, `@attention`, `@warning`, `@example`, `@code`, `@cite`, `@copyright`. From 9dadf0f3e1a293274993e71d6b00d7cb3320f44e Mon Sep 17 00:00:00 2001 From: Mickael Accensi <49198861+mickaelaccensi@users.noreply.github.com> Date: Wed, 16 Feb 2022 14:14:02 +0100 Subject: [PATCH 06/44] namelist feature for program ww3_bound (#610) --- model/bin/build_utils.sh | 2 +- model/bin/make_makefile.sh | 1 + model/nml/ww3_bound.nml | 23 ++ model/src/w3nmlboundmd.F90 | 338 +++++++++++++++++++++ model/src/ww3_bound.F90 | 334 +++++++++++++------- model/tools/bash/ww3_bound_inp2nml.sh | 182 +++++++++++ regtests/ww3_tr1/input_bndin/spec.list | 3 + regtests/ww3_tr1/input_bndin/ww3_bound.nml | 21 ++ 8 files changed, 796 insertions(+), 108 deletions(-) create mode 100644 model/nml/ww3_bound.nml create mode 100644 model/src/w3nmlboundmd.F90 create mode 100755 model/tools/bash/ww3_bound_inp2nml.sh create mode 100644 regtests/ww3_tr1/input_bndin/spec.list create mode 100644 regtests/ww3_tr1/input_bndin/ww3_bound.nml diff --git a/model/bin/build_utils.sh b/model/bin/build_utils.sh index cf0683bab..67cf63367 100755 --- a/model/bin/build_utils.sh +++ b/model/bin/build_utils.sh @@ -795,7 +795,7 @@ create_file_list() prop="$smcm" sourcet="$pdlibcode $pdlibyow $db $bt $setupcode $tr $trx $stx $nlx $btx $is wmmdatmd w3parall w3triamd $uostmd" IO='w3iobcmd w3iogrmd w3dispmd w3gsrumd' - aux="constants w3servmd w3timemd w3arrymd w3cspcmd" ;; + aux="constants w3servmd w3timemd w3arrymd w3cspcmd w3nmlboundmd" ;; ww3_bounc) core= data="w3adatmd $memcode w3gdatmd w3wdatmd w3idatmd w3odatmd" diff --git a/model/bin/make_makefile.sh b/model/bin/make_makefile.sh index 8c4653a0c..c05301220 100755 --- a/model/bin/make_makefile.sh +++ b/model/bin/make_makefile.sh @@ -416,6 +416,7 @@ 'W3NMLOUNPMD' ) modtest=w3nmlounpmd.o ;; 'W3NMLTRNCMD' ) modtest=w3nmltrncmd.o ;; 'W3NMLBOUNCMD' ) modtest=w3nmlbouncmd.o ;; + 'W3NMLBOUNDMD' ) modtest=w3nmlboundmd.o ;; 'W3NMLSHELMD' ) modtest=w3nmlshelmd.o ;; 'W3NMLGRIDMD' ) modtest=w3nmlgridmd.o ;; 'W3NMLUPRSTRMD' ) modtest=w3nmluprstrmd.o ;; diff --git a/model/nml/ww3_bound.nml b/model/nml/ww3_bound.nml new file mode 100644 index 000000000..288953c01 --- /dev/null +++ b/model/nml/ww3_bound.nml @@ -0,0 +1,23 @@ +! -------------------------------------------------------------------- ! +! WAVEWATCH III - ww3_bound.nml - Boundary input post-processing ! +! -------------------------------------------------------------------- ! + + +! -------------------------------------------------------------------- ! +! Define the input boundaries to preprocess via BOUND_NML namelist +! Note: When using a rotated pole WW3 grid, the input spectra are +! always assumed to be formulated on a standard pole. +! +! * namelist must be terminated with / +! * definitions & defaults: +! BOUND%MODE = 'WRITE' ! ['WRITE'|'READ'] +! BOUND%INTERP = 2 ! interpolation [1(nearest),2(linear)] +! BOUND%VERBOSE = 1 ! [0|1|2] +! BOUND%FILE = 'spec.list' ! input _spec.nc listing file +! -------------------------------------------------------------------- ! +&BOUND_NML +/ + +! -------------------------------------------------------------------- ! +! WAVEWATCH III - end of namelist ! +! -------------------------------------------------------------------- ! diff --git a/model/src/w3nmlboundmd.F90 b/model/src/w3nmlboundmd.F90 new file mode 100644 index 000000000..1c4b54644 --- /dev/null +++ b/model/src/w3nmlboundmd.F90 @@ -0,0 +1,338 @@ +#include "w3macros.h" +!/ ------------------------------------------------------------------- / + MODULE W3NMLBOUNDMD +!/ +!/ +-----------------------------------+ +!/ | WAVEWATCH III NOAA/NCEP | +!/ | M. Accensi | +!/ | | +!/ | FORTRAN 90 | +!/ | Last update : 27-May-2021 | +!/ +-----------------------------------+ +!/ +!/ For updates see subroutines. +!/ +! 1. Purpose : +! +! Manages namelists from configuration file ww3_bound.nml for ww3_bound program +! +!/ ------------------------------------------------------------------- / + + ! module defaults + IMPLICIT NONE + + PUBLIC + + ! bound structure + TYPE NML_BOUND_T + CHARACTER(5) :: MODE !< read/write mode + INTEGER :: INTERP !< interpolation mode + INTEGER :: VERBOSE !< verbose flag + CHARACTER(128) :: FILE !< listing spec file unit + END TYPE NML_BOUND_T + + + ! miscellaneous + CHARACTER(256) :: MSG !< report message + INTEGER :: NDSN !< namelist file unit + + + + + CONTAINS +!/ ------------------------------------------------------------------- / + SUBROUTINE W3NMLBOUND (NDSI, INFILE, NML_BOUND, IERR) +!/ +!/ +-----------------------------------+ +!/ | WAVEWATCH III NOAA/NCEP | +!/ | M. Accensi | +!/ | | +!/ | FORTRAN 90 | +!/ | Last update : 27-May-2021 | +!/ +-----------------------------------+ +!/ +! +! 1. Purpose : +! +! Reads all the namelist to define the input boundary +! +! 2. Method : +! +! See source term routines. +! +! 3. Parameters : +! +! Parameter list +! ---------------------------------------------------------------- +! NDSI Int. +! INFILE Char. +! NML_BOUND type. +! IERR Int. +! ---------------------------------------------------------------- +! +! 4. Subroutines used : +! +! Name TYPE Module Description +! ---------------------------------------------------------------- +! STRACE Subr. W3SERVMD SUBROUTINE tracing. +! READ_BOUND_NML +! ---------------------------------------------------------------- +! +! 5. Called by : +! +! Name TYPE Module Description +! ---------------------------------------------------------------- +! WW3_BOUND Prog. N/A Preprocess input boundaries. +! ---------------------------------------------------------------- +! +! 6. Error messages : +! +! None. +! +! 7. Remarks : +! +! 8. Structure : +! +! See source code. +! +! 9. Switches : +! +! 10. Source code : +! +!/ ------------------------------------------------------------------- / + + USE W3ODATMD, ONLY: NDSE +!/S USE W3SERVMD, ONLY: STRACE + + IMPLICIT NONE + + INTEGER, INTENT(IN) :: NDSI !< input file unit + CHARACTER*(*), INTENT(IN) :: INFILE !< input file name + TYPE(NML_BOUND_T), INTENT(INOUT) :: NML_BOUND !< bound structure + INTEGER, INTENT(OUT) :: IERR !< error code +!/S INTEGER, SAVE :: IENT = 0 !< strace error code + + IERR = 0 +!/S CALL STRACE (IENT, 'W3NMLBOUND') + + ! open namelist log file + NDSN = 3 + OPEN (NDSN, file=TRIM(INFILE)//'.log', form='formatted', iostat=IERR) + IF (IERR.NE.0) THEN + WRITE (NDSE,'(A)') 'ERROR: open full nml file '//TRIM(INFILE)//'.log failed' + RETURN + END IF + + ! open input file + OPEN (NDSI, file=TRIM(INFILE), form='formatted', status='old', iostat=IERR) + IF (IERR.NE.0) THEN + WRITE (NDSE,'(A)') 'ERROR: open input file '//TRIM(INFILE)//' failed' + RETURN + END IF + + ! read bound namelist + CALL READ_BOUND_NML (NDSI, NML_BOUND) + CALL REPORT_BOUND_NML (NML_BOUND) + + ! close namelist files + CLOSE (NDSI) + CLOSE (NDSN) + + END SUBROUTINE W3NMLBOUND + + +!/ ------------------------------------------------------------------- / + + + + + + +!/ ------------------------------------------------------------------- / + + SUBROUTINE READ_BOUND_NML (NDSI, NML_BOUND) +!/ +!/ +-----------------------------------+ +!/ | WAVEWATCH III NOAA/NCEP | +!/ | M. Accensi | +!/ | | +!/ | FORTRAN 90 | +!/ | Last update : 27-May-2021 | +!/ +-----------------------------------+ +!/ +! 1. Purpose : +! +! +! 2. Method : +! +! See source term routines. +! +! 3. Parameters : +! +! Parameter list +! ---------------------------------------------------------------- +! NDSI Int. +! NML_BOUND Type. +! ---------------------------------------------------------------- +! +! 4. Subroutines used : +! +! Name TYPE Module Description +! ---------------------------------------------------------------- +! STRACE Subr. W3SERVMD SUBROUTINE tracing. +! ---------------------------------------------------------------- +! +! 5. Called by : +! +! Name TYPE Module Description +! ---------------------------------------------------------------- +! W3NMLBOUND Subr. N/A Namelist configuration routine. +! ---------------------------------------------------------------- +! +! 6. Error messages : +! +! None. +! +! 7. Remarks : +! +! 8. Structure : +! +! See source code. +! +! 9. Switches : +! +! 10. Source code : +! +!/ ------------------------------------------------------------------- / + + USE W3ODATMD, ONLY: NDSE + USE W3SERVMD, ONLY: EXTCDE +!/S USE W3SERVMD, ONLY: STRACE + + IMPLICIT NONE + + INTEGER, INTENT(IN) :: NDSI !< namelist file unit + TYPE(NML_BOUND_T), INTENT(INOUT) :: NML_BOUND !< bound structure + + ! locals + INTEGER :: IERR !< error code + TYPE(NML_BOUND_T) :: BOUND !< bound structure + NAMELIST /BOUND_NML/ BOUND !< boudn namelist +!/S INTEGER, SAVE :: IENT = 0 !< strace error code + + IERR = 0 +!/S CALL STRACE (IENT, 'READ_BOUND_NML') + + ! set default values for track structure + BOUND%MODE = 'WRITE' + BOUND%INTERP = 2 + BOUND%VERBOSE = 1 + BOUND%FILE = 'spec.list' + + ! read bound namelist + REWIND (NDSI) + READ (NDSI, nml=BOUND_NML, iostat=IERR, iomsg=MSG) + IF (IERR.GT.0) THEN + WRITE (NDSE,'(A,/A)') & + 'ERROR: READ_BOUND_NML: namelist read error', & + 'ERROR: '//TRIM(MSG) + CALL EXTCDE (1) + END IF + + ! save namelist + NML_BOUND = BOUND + + END SUBROUTINE READ_BOUND_NML + +!/ ------------------------------------------------------------------- / + + + + + + + + +!/ ------------------------------------------------------------------- / + + SUBROUTINE REPORT_BOUND_NML (NML_BOUND) +!/ +!/ +-----------------------------------+ +!/ | WAVEWATCH III NOAA/NCEP | +!/ | M. Accensi | +!/ | FORTRAN 90 | +!/ | Last update : 27-May-2021 | +!/ +-----------------------------------+ +!/ +!/ +! 1. Purpose : +! +! +! 2. Method : +! +! See source term routines. +! +! 3. Parameters : +! +! Parameter list +! ---------------------------------------------------------------- +! NML_BOUND Type. +! ---------------------------------------------------------------- +! +! 4. Subroutines used : +! +! Name TYPE Module Description +! ---------------------------------------------------------------- +! STRACE Subr. W3SERVMD SUBROUTINE tracing. +! ---------------------------------------------------------------- +! +! 5. Called by : +! +! Name TYPE Module Description +! ---------------------------------------------------------------- +! W3NMLBOUND Subr. N/A Namelist configuration routine. +! ---------------------------------------------------------------- +! +! 6. Error messages : +! +! None. +! +! 7. Remarks : +! +! 8. Structure : +! +! See source code. +! +! 9. Switches : +! +! 10. Source code : +! +!/ ------------------------------------------------------------------- / + +!/S USE W3SERVMD, ONLY: STRACE + + IMPLICIT NONE + + TYPE(NML_BOUND_T), INTENT(IN) :: NML_BOUND !< bound structure +!/S INTEGER, SAVE :: IENT = 0 ! strace error code + +!/S CALL STRACE (IENT, 'REPORT_BOUND_NML') + + WRITE (MSG,'(A)') 'BOUND % ' + WRITE (NDSN,'(A)') + WRITE (NDSN,10) TRIM(MSG),'MODE = ', TRIM(NML_BOUND%MODE) + WRITE (NDSN,11) TRIM(MSG),'INTERP = ', NML_BOUND%INTERP + WRITE (NDSN,11) TRIM(MSG),'VERBOSE = ', NML_BOUND%VERBOSE + WRITE (NDSN,10) TRIM(MSG),'FILE = ', TRIM(NML_BOUND%FILE) + + +10 FORMAT (A,2X,A,A) +11 FORMAT (A,2X,A,I8) + + END SUBROUTINE REPORT_BOUND_NML + +!/ ------------------------------------------------------------------- / + +END MODULE W3NMLBOUNDMD + +!/ ------------------------------------------------------------------- / diff --git a/model/src/ww3_bound.F90 b/model/src/ww3_bound.F90 index b687c73fe..629629636 100644 --- a/model/src/ww3_bound.F90 +++ b/model/src/ww3_bound.F90 @@ -6,7 +6,7 @@ PROGRAM W3BOUND !/ | WAVEWATCH III NOAA/NCEP | !/ | F. Ardhuin | !/ | FORTRAN 90 | -!/ | Last update : 21-Jul-2020 | +!/ | Last update : 27-May-2021 | !/ +-----------------------------------+ !/ !/ 28-Aug-2012 : adaptation from SHOM/Ifremer code ( version 4.08 ) @@ -14,6 +14,7 @@ PROGRAM W3BOUND !/ 20-Oct-2016 : Error statement updates ( version 5.15 ) !/ 21-Jul-2020 : Support rotated pole grid ( version 7.11 ) !/ Chris Bunney, UKMO. +!/ 27-May-2021 : Add namelist feature ( version 7.XX ) !/ !/ Copyright 2012-2012 National Weather Service (NWS), !/ National Oceanic and Atmospheric Administration. All rights @@ -36,7 +37,7 @@ PROGRAM W3BOUND ! ! Local parameters. ! ---------------------------------------------------------------- -! NDSI Int. Input unit number ("ww3_assm.inp"). +! NDSI Int. Input unit number ("ww3_bound.inp"). ! ITYPE Int. Type of data ! ---------------------------------------------------------------- ! @@ -106,10 +107,11 @@ PROGRAM W3BOUND #ifdef W3_RTD USE W3GDATMD, ONLY : POLAT, POLON #endif - USE W3ODATMD, ONLY: NDSO, NDSE + USE W3ODATMD, ONLY: NDSO, NDSE, FNMPRE USE W3IOBCMD, ONLY: VERBPTBC, IDSTRBC USE W3IOGRMD, ONLY: W3IOGR USE W3TIMEMD + USE W3NMLBOUNDMD USE W3SERVMD, ONLY: ITRACE, NEXTLN, EXTCDE #ifdef W3_RTD USE W3SERVMD, ONLY: W3EQTOLL @@ -127,41 +129,95 @@ PROGRAM W3BOUND !/ ------------------------------------------------------------------- / !/ Local parameters !/ - INTEGER :: TIME1(2),TIME2(2) - CHARACTER :: COMSTR*1, LINE*80 - CHARACTER*5 :: INXOUT - CHARACTER*10 :: VERTEST ! = '2018-03-01' - CHARACTER*32 :: IDTST != 'WAVEWATCH III BOUNDARY DATA FILE' - CHARACTER*120, ALLOCATABLE :: SPECFILES(:) - CHARACTER*120 :: FILENAME - - INTEGER IX, IY, ISEA, I,JJ,IP,IP1,J,K,ITIME, & - NDSI,NDSM, NDSI2,NDSS,NDSB, NDSTRC, NTRACE, & - NK1,NTH1,NSPEC1, NBI, NBI2, & - NKI, NTHI, NBO, NBO2, IERR, INTERP, ILOOP, & - IFMIN, IFMIN2, IFMAX, VERBOSE + TYPE(NML_BOUND_T) :: NML_BOUND +! + INTEGER :: TIME1(2) !< initial time + INTEGER :: TIME2(2) !< next time + INTEGER :: IX !< x index + INTEGER :: IY !< y index + INTEGER :: ISEA !< isea index + INTEGER :: I !< i index + INTEGER :: JJ !< jj index + INTEGER :: IP !< boundary index + INTEGER :: IP1 !< boundary index + INTEGER :: J !< j index + INTEGER :: K !< k index + INTEGER :: ITIME !< time index + INTEGER :: NDSI !< input file unit + INTEGER :: NDSM !< mod_def file unit + INTEGER :: NDSI2 !< tmp input file unit + INTEGER :: NDSS !< scratch file unit + INTEGER :: NDSB !< nest file unit + INTEGER :: NDSTRC !< trace file unit + INTEGER :: NTRACE !< trace file unit + INTEGER :: NK1 !< frequency bins number + INTEGER :: NTH1 !< direction bins number + INTEGER :: NSPEC1 !< spectral bins number + INTEGER :: NBI !< number of input boundary points + INTEGER :: NBI2 !< number of input boundary points + INTEGER :: NKI !< frequency bins number from input spec file + INTEGER :: NTHI !< direction bins number from input spec file + INTEGER :: NBO !< number of boundary outputs + INTEGER :: NBO2 !< number of boundary outputs + INTEGER :: IERR !< error code + INTEGER :: INTERP !< interpolation method + INTEGER :: ILOOP !< loop indice + INTEGER :: IFMIN !< min freq value from input spec file + INTEGER :: IFMIN2 !< min freq value for output spectra + INTEGER :: IFMAX !< max freq value from input spec file + INTEGER :: VERBOSE !< verbose flag + INTEGER :: NDSL !< input spec listing file unit #ifdef W3_S - INTEGER, SAVE :: IENT = 0 + INTEGER, SAVE :: IENT = 0 !< strace error code #endif - INTEGER IBO - !REAL , DIMENSION(:), ALLOCATABLE :: SPEC - REAL , DIMENSION(:), ALLOCATABLE :: LATS, LONS - REAL , DIMENSION(:,:), ALLOCATABLE :: SPEC2D - REAL , DIMENSION(:), ALLOCATABLE :: FREQ, THETA - REAL FR1I, TH1I - REAL, ALLOCATABLE :: XBPI(:), YBPI(:), RDBPI(:,:), & - XBPO(:), YBPO(:), RDBPO(:,:), & - ABPIN(:,:) + INTEGER :: IBO !< indice of boundary output + INTEGER, ALLOCATABLE :: IPBPI(:,:) !< interp. data input bound. point + INTEGER, ALLOCATABLE :: IPBPO(:,:) !< interp. data output bound. point +! + REAL :: FR1I !< first freq from mod_def + REAL :: TH1I !< first dir. from mod_def + REAL :: depth !< depth from input spec + REAL :: U10 !< wind speed from input spec + REAL :: Udir !< wind dir. from input spec + REAL :: Curr !< cur. speed from input spec + REAL :: Currdir !< cur. dir. from input spec + REAL :: DMIN !< min. dist from grid point to spec + REAL :: DIST !< dist from grid point to spec + REAL :: DMIN2 !< second min. dist from grid point to spec + REAL :: COS1 !< cosine for linear interpolation +! + REAL, ALLOCATABLE :: LATS(:) !< latitude coordinates of spec + REAL, ALLOCATABLE :: LONS(:) !< longitude coordiantes of spec + REAL, ALLOCATABLE :: SPEC2D(:,:) !< spectrum from input spec + REAL, ALLOCATABLE :: FREQ(:) !< frequency array from input spec + REAL, ALLOCATABLE :: THETA(:) !< direction array from input spec + REAL, ALLOCATABLE :: XBPI(:) !< x position of input boundary + REAL, ALLOCATABLE :: YBPI(:) !< y position of input boundary + REAL, ALLOCATABLE :: RDBPI(:,:) !< interpolation factor input boundray point + REAL, ALLOCATABLE :: XBPO(:) !< x position of output bound. point + REAL, ALLOCATABLE :: YBPO(:) !< y position of output bound. point + REAL, ALLOCATABLE :: RDBPO(:,:) !< interp. factor output bound. point + REAL, ALLOCATABLE :: ABPIN(:,:) !< intepolated spectrum #ifdef W3_RTD - REAL, ALLOCATABLE :: XTMP(:), YTMP(:), ANGTMP(:) - LOGICAL :: ISRTD + REAL, ALLOCATABLE :: XTMP(:) !< temporary x position + REAL, ALLOCATABLE :: YTMP(:) !< temporary y position + REAL, ALLOCATABLE :: ANGTMP(:) !< temporary angle + LOGICAL :: ISRTD !< rotated grid flag #endif - - INTEGER, ALLOCATABLE :: IPBPI(:,:), IPBPO(:,:) - - CHARACTER(120) string1,buoyname - CHARACTER space - REAL depth,U10,Udir,Curr,Currdir,DMIN, DIST, DMIN2, COS1 !, COS2 + CHARACTER :: COMSTR !< comment character + CHARACTER(LEN=80) :: LINE !< input file line + CHARACTER(LEN=128) :: BNDFILE !< input boundary file name + CHARACTER(LEN=5) :: INXOUT !< read/write mode + CHARACTER(LEN=10) :: VERTEST !< date of last nest.ww3 change + CHARACTER(LEN=32) :: IDTST !< 'WAVEWATCH III BOUNDARY DATA FILE' + CHARACTER(LEN=120) :: FILENAME !< input boundary file name + CHARACTER(LEN=120) :: string1 !< temporary string + CHARACTER(LEN=120) :: buoyname !< input boundary point name + CHARACTER :: space !< space character +! + CHARACTER(LEN=120), ALLOCATABLE :: SPECFILES(:) !< list of input boundary points file names +! + LOGICAL :: FLGNML !< flag for namelist use !/ !/ ------------------------------------------------------------------- / @@ -182,6 +238,7 @@ PROGRAM W3BOUND NDSB = 33 NDSM = 20 NDSS = 40 + NDSL = 50 ! NDSTRC = 6 NTRACE = 10 @@ -206,60 +263,98 @@ PROGRAM W3BOUND ! ! 3. Read input file ! - OPEN(NDSI,FILE='ww3_bound.inp',status='old') - READ (NDSI,'(A)',END=2001,ERR=2002) COMSTR - IF (COMSTR.EQ.' ') COMSTR = '$' - CALL NEXTLN ( COMSTR , NDSI , NDSE ) - READ (NDSI,*) INXOUT - CALL NEXTLN ( COMSTR , NDSI , NDSE ) - READ (NDSI,*) INTERP - CALL NEXTLN ( COMSTR , NDSI , NDSE ) - READ (NDSI,*) VERBOSE - CALL NEXTLN ( COMSTR , NDSI , NDSE ) -! - NBO2 = 0 -! -! ILOOP = 1 to count NBO2 -! ILOOP = 2 to read the file names -! - DO ILOOP = 1, 2 - OPEN (NDSS,FILE='ww3_bound.scratch',FORM='FORMATTED', & - status='UNKNOWN') - IF ( ILOOP .EQ. 1 ) THEN - NDSI2 = NDSI - ELSE - NDSI2 = NDSS - ALLOCATE(SPECFILES(NBO2)) - NBO2=0 +! process ww3_bound namelist +! + INQUIRE(FILE=TRIM(FNMPRE)//"ww3_bound.nml", EXIST=FLGNML) + IF (FLGNML) THEN + ! Read namelist + CALL W3NMLBOUND (NDSI, TRIM(FNMPRE)//'ww3_bound.nml', NML_BOUND, IERR) + + INXOUT = NML_BOUND%MODE + INTERP = NML_BOUND%INTERP + VERBOSE = NML_BOUND%VERBOSE + BNDFILE = NML_BOUND%FILE + + NBO2 = 0 + OPEN(NDSL,FILE=TRIM(BNDFILE),STATUS='OLD',ERR=809,IOSTAT=IERR) + REWIND (NDSL) + DO + READ (NDSL,*,END=400,ERR=802) + NBO2 = NBO2 + 1 + END DO + 400 CONTINUE + ALLOCATE(SPECFILES(NBO2)) + REWIND (NDSL) + DO I=1,NBO2 + READ (NDSL,'(A120)',END=801,ERR=802) SPECFILES(I) + END DO + CLOSE(NDSL) + + END IF ! FLGNML + +! +! process old ww3_bound.inp format +! + IF (.NOT. FLGNML) THEN + OPEN (NDSI,FILE=TRIM(FNMPRE)//'ww3_bound.inp',STATUS='OLD',ERR=803,IOSTAT=IERR) + REWIND (NDSI) + + READ (NDSI,'(A)',END=801,ERR=802) COMSTR + IF (COMSTR.EQ.' ') COMSTR = '$' + + + CALL NEXTLN ( COMSTR , NDSI , NDSE ) + READ (NDSI,*) INXOUT + CALL NEXTLN ( COMSTR , NDSI , NDSE ) + READ (NDSI,*) INTERP + CALL NEXTLN ( COMSTR , NDSI , NDSE ) + READ (NDSI,*) VERBOSE + CALL NEXTLN ( COMSTR , NDSI , NDSE ) +! + NBO2 = 0 +! +! ILOOP = 1 to count NBO2 +! ILOOP = 2 to read the file names +! + DO ILOOP = 1, 2 + OPEN (NDSS,FILE='ww3_bound.scratch',FORM='FORMATTED', & + status='UNKNOWN') + IF ( ILOOP .EQ. 1 ) THEN + NDSI2 = NDSI + ELSE + NDSI2 = NDSS + ALLOCATE(SPECFILES(NBO2)) + NBO2=0 ENDIF - NBO2=0 -! Read input file names - DO - CALL NEXTLN ( COMSTR , NDSI2 , NDSE ) - READ (NDSI2,'(A120)') FILENAME - JJ = LEN_TRIM(FILENAME) - IF ( ILOOP .EQ. 1 ) THEN - BACKSPACE (NDSI) - READ (NDSI,'(A)') LINE - WRITE (NDSS,'(A)') LINE - END IF - IF (FILENAME(:JJ).EQ."'STOPSTRING'") EXIT - NBO2=NBO2+1 - IF (ILOOP.EQ.1) CYCLE - SPECFILES(NBO2)=FILENAME + NBO2=0 +! Read input file names + DO + CALL NEXTLN ( COMSTR , NDSI2 , NDSE ) + READ (NDSI2,'(A120)') FILENAME + JJ = LEN_TRIM(FILENAME) + IF ( ILOOP .EQ. 1 ) THEN + BACKSPACE (NDSI) + READ (NDSI,'(A)') LINE + WRITE (NDSS,'(A)') LINE + END IF + IF (FILENAME(:JJ).EQ."'STOPSTRING'") EXIT + NBO2=NBO2+1 + IF (ILOOP.EQ.1) CYCLE + SPECFILES(NBO2)=FILENAME END DO -! -! ... End of ILOOP loop -! - IF ( ILOOP .EQ. 1 ) CLOSE ( NDSS) - IF ( ILOOP .EQ. 2 ) CLOSE ( NDSS, STATUS='DELETE' ) - END DO - CLOSE(NDSI) + IF ( ILOOP .EQ. 1 ) CLOSE ( NDSS) + + IF ( ILOOP .EQ. 2 ) CLOSE ( NDSS, STATUS='DELETE' ) + END DO ! ILOOP = 1, 2 + CLOSE(NDSI) + END IF ! .NOT. FLGNML + ! -! 3. Tests the reading of the file +!--- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +! 4. Tests the reading of the file ! IF ( INXOUT.EQ.'READ') THEN OPEN(NDSB,FILE='nest.ww3',FORM='UNFORMATTED',status='old') @@ -341,7 +436,6 @@ PROGRAM W3BOUND END IF END DO #ifdef W3_RTD -! ! Convert grid boundary cell locations to standard pole IF( ISRTD ) THEN XTMP = XBPO @@ -349,15 +443,15 @@ PROGRAM W3BOUND CALL W3EQTOLL(YTMP, XTMP, YBPO, XBPO, ANGTMP, POLAT, POLON, NBO) DEALLOCATE(XTMP, YTMP, ANGTMP) ENDIF -! #endif OPEN(NDSB,FILE='nest.ww3',FORM='UNFORMATTED',status='unknown') ALLOCATE(LATS(NBO2),LONS(NBO2)) DO IP=1,NBO2 OPEN(200+IP,FILE=SPECFILES(IP),status='old',iostat=IERR) - IF (VERBOSE.EQ.1) WRITE(NDSO,'(A,I5,3A,I5)') 'IP, file, I/O stat:',IP,', ', & - TRIM(SPECFILES(IP)),', ',IERR - IF (IERR.NE.0) WRITE(NDSE,*) 'File do not exist:',SPECFILES(IP) + IF (VERBOSE.EQ.1) WRITE(NDSO,'(A,I5,3A,I5)') & + 'IP, file, I/O stat:',IP,', ', & + TRIM(SPECFILES(IP)), ', ',IERR + IF (IERR.NE.0) GOTO 810 READ(200+IP,'(A1,A22,A1,X,2I6)',iostat=IERR) & space,string1,space,NKI,NTHI IF (VERBOSE.EQ.1) WRITE(NDSO,'(A,3I5)') 'IP and spectral dimensions:',IP, NKI,NTHI @@ -388,7 +482,7 @@ PROGRAM W3BOUND ! ! Checks consistency of NK - IF (NKI.GT.NK) GOTO 2008 + IF (NKI.GT.NK) GOTO 808 ! ! HERE we define IFMIN IFMIN2 IFMAX and IFMAX2 frequency indices ! such that source spec SPEC (read in input) links with output spec @@ -400,14 +494,14 @@ PROGRAM W3BOUND ! IFMAX2=NK ! index of last freq. in output spectrum ! ! Checks consistency of XFR - IF (ABS((FREQ(IFMIN+1)/FREQ(IFMIN))-XFR).GT.0.005) GOTO 2006 + IF (ABS((FREQ(IFMIN+1)/FREQ(IFMIN))-XFR).GT.0.005) GOTO 806 ! ! Checks consistency of NTH ! WARNING: check is only done on number of directions, no check ! is done on the relative offset of first direction in terms of ! the directional increment [-0.5,0.5] (last parameter of the ! spectral definition in ww3_grid.inp, on second active line) - IF (NTHI.NE.NTH) GOTO 2007 + IF (NTHI.NE.NTH) GOTO 807 IF ((FR1-FREQ(1))/FR1.GT. 0.03) THEN DO J=1,MIN(NK1,NK) @@ -454,13 +548,11 @@ PROGRAM W3BOUND READ(200+IP,'(A1,A10,A1,2F7.2,F10.1,F7.2,F6.1,F7.2,F6.1)') & space,buoyname,space,LATS(IP),LONS(IP),depth,U10,Udir,Curr,Currdir #ifdef W3_RTD -! IF (ISRTD) THEN ! Rotated coordinates are scaled in range 0 - 360 IF(LONS(IP) .LT. 0) LONS(IP) = LONS(IP) + 360.0 IF(LONS(IP) .GT. 360) LONS(IP) = LONS(IP) - 360.0 ENDIF -! #endif READ(200+IP,*,IOSTAT=IERR) SPEC2D IF (IFMIN2.GT.1) THEN @@ -506,21 +598,21 @@ PROGRAM W3BOUND IF(DIST.LT.DMIN) THEN IPBPO(IP1,1)=IP DMIN=DIST - END IF + END IF ELSE IF(DIST.LT.DMIN2) THEN IF(DIST.LT.DMIN) THEN - IPBPO(IP1,2)=IPBPO(IP1,1) - DMIN2=DMIN + IPBPO(IP1,2)=IPBPO(IP1,1) + DMIN2=DMIN IPBPO(IP1,1)=IP - DMIN=DIST - ELSE + DMIN=DIST + ELSE IPBPO(IP1,2)=IP - DMIN2=DIST - END IF - ENDIF - END IF - END DO + DMIN2=DIST + END IF + ENDIF + END IF + END DO !IF (VERBOSE.EQ.1) WRITE(NDSO,*) 'DIST:',DMIN,DMIN2,IP1,IPBPO(IP1,1),IPBPO(IP1,2), & ! LONS(IPBPO(IP1,1)),LONS(IPBPO(IP1,2)),XBPO(IP1), & ! LATS(IPBPO(IP1,1)),LATS(IPBPO(IP1,2)),YBPO(IP1) @@ -569,25 +661,40 @@ PROGRAM W3BOUND ! Escape locations read errors : ! - 2001 CONTINUE + 801 CONTINUE WRITE (NDSE,1001) CALL EXTCDE ( 61 ) ! - 2002 CONTINUE + 802 CONTINUE WRITE (NDSE,1002) IERR CALL EXTCDE ( 62 ) ! - 2006 CONTINUE + 803 CONTINUE + WRITE (NDSE,1003) + CALL EXTCDE ( 63 ) +! + 806 CONTINUE WRITE (NDSE,1006) XFR CALL EXTCDE ( 66 ) ! - 2007 CONTINUE + 807 CONTINUE WRITE (NDSE,1007) NTH, NTHI CALL EXTCDE ( 67 ) ! - 2008 CONTINUE + 808 CONTINUE WRITE (NDSE,1008) NK, NKI CALL EXTCDE ( 68 ) +! + 809 CONTINUE + WRITE (NDSE,1009) BNDFILE, IERR + CALL EXTCDE ( 69 ) +! + 810 CONTINUE + WRITE (NDSE,1010) SPECFILES(IP) + CALL EXTCDE ( 70 ) + +! +! Formats ! 901 FORMAT (/' *** WAVEWATCH-III ERROR IN W3IOBC :'/ & ' ILEGAL IDSTR, READ : ',A/ & @@ -601,6 +708,10 @@ PROGRAM W3BOUND 1002 FORMAT (/' *** WAVEWATCH III ERROR IN W3BOUND: '/ & ' ERROR IN READING ',A,' FROM INPUT FILE'/ & ' IOSTAT =',I5/) +! + 1003 FORMAT (/' *** WAVEWATCH III ERROR IN W3BOUNC : '/ & + ' ERROR IN OPENING INPUT FILE: ', A/ & + ' IOSTAT =',I5/) ! 1006 FORMAT (/' *** WAVEWATCH III ERROR IN W3BOUND: '/ & ' ILLEGAL XFR, XFR =',F12.6/) @@ -611,6 +722,15 @@ PROGRAM W3BOUND 1008 FORMAT (/' *** WAVEWATCH III ERROR IN W3BOUND: '/ & ' ILLEGAL NK, NK =',I3,' DIFFERS FROM NKI =',I3/ & ' IT WILL BE MANAGED SOON BY SPCONV') +! + 1009 FORMAT (/' *** WAVEWATCH III ERROR IN W3BOUND : '/ & + ' ERROR IN OPENING SPEC FILE: ', A/ & + ' IOSTAT =',I5/) +! + 1010 FORMAT (/' *** WAVEWATCH III ERROR IN W3BOUND : '/ & + ' SPEC FILE NOT EXISTING: ', A/) + + ! !/ !/ End of W3BOUND ---------------------------------------------------- / diff --git a/model/tools/bash/ww3_bound_inp2nml.sh b/model/tools/bash/ww3_bound_inp2nml.sh new file mode 100755 index 000000000..38c324e36 --- /dev/null +++ b/model/tools/bash/ww3_bound_inp2nml.sh @@ -0,0 +1,182 @@ +#!/bin/bash -e + +prog="ww3_bound" + +if [ $# -ne 1 ] +then + echo " [ERROR] need ${prog} input filename in argument [${prog}.inp]" + exit 1 +fi + +inp="$( cd "$( dirname "$1" )" && pwd )/$(basename $1)" + +# check filename extension +ext=$(echo $inp | awk -F '.' '{print $NF}') +if [ "$(echo $ext)" != 'inp' ] ; then + echo "[ERROR] input file has no .inp extension. Please rename it before conversion" + exit 1 +fi + +# commented because it is not working in all cases +# link to temporary inp with regtest format +#ext=$(echo $inp | awk -F"${prog}.inp." '{print $2}' || awk -F"${prog}.inp_" '{print $2}') +#base=$(echo $inp | awk -F"${prog}\\..inp\\.." '{print $1}' | awk -F".inp.$ext" '{print $1}' || awk -F"${prog}\\..inp_" '{print $1}' | awk -F".inp_$ext" #'{print $1}') +#if [ ! -z $(echo $ext) ] ; then +# new_inp=${base}_${ext}.inp +# echo "link $inp to $new_inp" +# ln -sfn $inp $new_inp +# old_inp=$inp +# inp=$new_inp +#fi + +cd $( dirname $inp) +cur_dir="../$(basename $(dirname $inp))" + + +version=$(bash --version | awk -F' ' '{print $4}') +version4=$(echo $version | cut -d '.' -f1) +echo "bash version : " $version4 +if [ "$version4" != "4" ] +then + echo ' [ERROR] need a version of bash at least 4' + exit 1 +fi + + +#------------------------------ +# clean up inp file from all $ lines + +cleaninp="$cur_dir/${prog}_clean.inp" +rm -f $cleaninp + +cat $inp | while read line +do + + if [ "$(echo $line | cut -c1)" = "$" ] + then + continue + fi + + cleanline="$(echo $line | awk -F' ' '{print $1}' | cut -d \" -f2 | cut -d \' -f2)" + if [ -z "$cleanline" ] + then + continue + fi + + echo "$line" >> $cleaninp + +done + + + +#------------------------------ +# get all values from clean inp file + +readarray -t lines < "$cleaninp" +numlines=${#lines[@]} + +# remove carriage return characters +for il in $(seq 0 $numlines) +do + lines[$il]=$(echo "$(echo ${lines[$il]} | sed 's/\r$//')") +done +il=0 + +mode="$(echo ${lines[$il]} | awk -F' ' '{print $1}' | cut -d \" -f2 | cut -d \' -f2)" +echo $mode + +il=$(($il+1)) +interp="$(echo ${lines[$il]} | awk -F' ' '{print $1}' | cut -d \" -f2 | cut -d \' -f2)" +echo $interp + +il=$(($il+1)) +verbose="$(echo ${lines[$il]} | awk -F' ' '{print $1}' | cut -d \" -f2 | cut -d \' -f2)" +echo $verbose + +il=$(($il+1)) +tmpname="$(echo ${lines[$il]} | awk -F' ' '{print $1}' | cut -d \" -f2 | cut -d \' -f2)" +forispec="$cur_dir/spec.list" +fspec="$cur_dir/spec.list.new" +spec_filename=$forispec +rm -f $fspec +while [ "$tmpname" != "STOPSTRING" ] +do + echo ${lines[$il]} >> $fspec + il=$(($il+1)) + tmpname="$(echo ${lines[$il]} | awk -F' ' '{print $1}' | cut -d \" -f2 | cut -d \' -f2)" +done +if [ -f $forispec ] +then + if [ -z "$(diff $forispec $fspec)" ] + then + echo $forispec ' and ' $fspec 'are same.' + echo 'delete ' $fspec + rm $fspec + else + echo 'diff between :' $forispec ' and new file : ' $fspec + echo 'inp2nml conversion stopped' + exit 1 + fi +else + echo 'mv '$fspec ' to ' $forispec + mv $fspec $forispec +fi + + + + +#------------------------------ +# write value in a new nml file + +nmlfile=$cur_dir/$(basename $inp .inp).nml + +# header +cat > $nmlfile << EOF +! -------------------------------------------------------------------- ! +! WAVEWATCH III ww3_bound.nml - Boundary input post-processing ! +! -------------------------------------------------------------------- ! + +EOF + +# field namelist +cat >> $nmlfile << EOF +! -------------------------------------------------------------------- ! +! Define the input boundaries to preprocess via BOUND_NML namelist +! +! * namelist must be terminated with / +! * definitions & defaults: +! BOUND%MODE = 'WRITE' ! ['WRITE'|'READ'] +! BOUND%INTERP = 2 ! interpolation [1(nearest),2(linear)] +! BOUND%VERBOSE = 1 ! [0|1|2] +! BOUND%FILE = 'spec.list' ! input _spec.nc listing file +! -------------------------------------------------------------------- ! +&BOUND_NML +EOF + +if [ "${mode}" != "WRITE" ]; then echo " BOUND%MODE = '${mode}'" >> $nmlfile; fi +if [ "$interp" != "2" ]; then echo " BOUND%INTERP = $interp" >> $nmlfile; fi +if [ "$verbose" != "1" ]; then echo " BOUND%VERBOSE = $verbose" >> $nmlfile; fi +if [ "$spec_filename" != "spec.list" ]; then echo " BOUND%FILE = '$spec_filename'" >> $nmlfile; fi + +cat >> $nmlfile << EOF +/ + +! -------------------------------------------------------------------- ! +! WAVEWATCH III - end of namelist ! +! -------------------------------------------------------------------- ! +EOF +echo "DONE : $( cd "$( dirname "$nmlfile" )" && pwd )/$(basename $nmlfile)" +rm -f $cleaninp + +# commented because it is not working in all cases +#if [ ! -z $(echo $ext) ] ; then +# unlink $new_inp +# addon="$(echo $(basename $nmlfile) | awk -F"${prog}_" '{print $2}' | awk -F'.nml' '{print $1}' )" +# new_nmlfile="${prog}.nml.$addon" +# mv $( cd "$( dirname "$nmlfile" )" && pwd )/$(basename $nmlfile) $( cd "$( dirname "$nmlfile" )" && pwd )/$(basename $new_nmlfile) +# echo "RENAMED : $( cd "$( dirname "$nmlfile" )" && pwd )/$(basename $new_nmlfile)" +#fi + +#------------------------------ + + diff --git a/regtests/ww3_tr1/input_bndin/spec.list b/regtests/ww3_tr1/input_bndin/spec.list new file mode 100644 index 000000000..0ed3523ed --- /dev/null +++ b/regtests/ww3_tr1/input_bndin/spec.list @@ -0,0 +1,3 @@ +../input_bndin/bnd1.spc +../input_bndin/bnd2.spc +../input_bndin/bnd3.spc diff --git a/regtests/ww3_tr1/input_bndin/ww3_bound.nml b/regtests/ww3_tr1/input_bndin/ww3_bound.nml new file mode 100644 index 000000000..927d53d4e --- /dev/null +++ b/regtests/ww3_tr1/input_bndin/ww3_bound.nml @@ -0,0 +1,21 @@ +! -------------------------------------------------------------------- ! +! WAVEWATCH III ww3_bound.nml - Boundary input post-processing ! +! -------------------------------------------------------------------- ! + +! -------------------------------------------------------------------- ! +! Define the input boundaries to preprocess via BOUND_NML namelist +! +! * namelist must be terminated with / +! * definitions & defaults: +! BOUND%MODE = 'WRITE' ! ['WRITE'|'READ'] +! BOUND%INTERP = 2 ! interpolation [1(nearest),2(linear)] +! BOUND%VERBOSE = 1 ! [0|1|2] +! BOUND%FILE = 'spec.list' ! input _spec.nc listing file +! -------------------------------------------------------------------- ! +&BOUND_NML + BOUND%FILE = '../input_bndin/spec.list' +/ + +! -------------------------------------------------------------------- ! +! WAVEWATCH III - end of namelist ! +! -------------------------------------------------------------------- ! From 013f3421fed20ca0ea5a8d9ab49103197de55885 Mon Sep 17 00:00:00 2001 From: Matthew Masarik <86749872+MatthewMasarik-NOAA@users.noreply.github.com> Date: Wed, 16 Feb 2022 08:15:28 -0500 Subject: [PATCH 07/44] doxygen: remove existing doxygen errors prior to markup (#611) --- docs/Doxyfile.in | 2 +- model/src/w3idatmd.F90 | 70 ++++++++++++++++++++++++++++++------------ 2 files changed, 51 insertions(+), 21 deletions(-) diff --git a/docs/Doxyfile.in b/docs/Doxyfile.in index 539d46dc3..23349c8da 100644 --- a/docs/Doxyfile.in +++ b/docs/Doxyfile.in @@ -2151,7 +2151,7 @@ PERLMOD_MAKEVAR_PREFIX = # C-preprocessor directives found in the sources and include files. # The default value is: YES. -ENABLE_PREPROCESSING = YES +ENABLE_PREPROCESSING = NO # If the MACRO_EXPANSION tag is set to YES, doxygen will expand all macro names # in the source code. If set to NO, only conditional compilation will be diff --git a/model/src/w3idatmd.F90 b/model/src/w3idatmd.F90 index e5d80edb9..64c6b2c69 100644 --- a/model/src/w3idatmd.F90 +++ b/model/src/w3idatmd.F90 @@ -155,34 +155,64 @@ MODULE W3IDATMD !/ !/ Data structure INPUT !/ - TYPE INPUT - INTEGER :: TFN(2,-7:10), TC0(2), TW0(2), & - TU0(2), TR0(2), TDN(2), TG0(2) - REAL :: GA0, GD0, GAN, GDN + TYPE, PUBLIC :: INPUT + INTEGER :: TFN(2,-7:10) + INTEGER :: TC0(2) + INTEGER :: TW0(2) + INTEGER :: TU0(2) + INTEGER :: TR0(2) + INTEGER :: TDN(2) + INTEGER :: TG0(2) + REAL :: GA0 + REAL :: GD0 + REAL :: GAN + REAL :: GDN #ifdef W3_WRST - REAL, POINTER :: WXNwrst(:,:),WYNwrst(:,:) + REAL, POINTER :: WXNwrst(:,:) + REAL, POINTER :: WYNwrst(:,:) #endif - REAL, POINTER :: WX0(:,:), WY0(:,:), DT0(:,:), & - WXN(:,:), WYN(:,:), DTN(:,:), & - CX0(:,:), CY0(:,:), CXN(:,:), & - CYN(:,:), WLEV(:,:), ICEI(:,:), & - UX0(:,:), UY0(:,:), UXN(:,:), & - UYN(:,:), RH0(:,:), RHN(:,:), & - BERGI(:,:), MUDT(:,:), MUDV(:,:), & - MUDD(:,:), ICEP1(:,:), ICEP2(:,:), & - ICEP3(:,:), ICEP4(:,:), ICEP5(:,:) + REAL, POINTER :: WX0(:,:) + REAL, POINTER :: WY0(:,:) + REAL, POINTER :: DT0(:,:) + REAL, POINTER :: WXN(:,:) + REAL, POINTER :: WYN(:,:) + REAL, POINTER :: DTN(:,:) + REAL, POINTER :: CX0(:,:) + REAL, POINTER :: CY0(:,:) + REAL, POINTER :: CXN(:,:) + REAL, POINTER :: CYN(:,:) + REAL, POINTER :: WLEV(:,:) + REAL, POINTER :: ICEI(:,:) + REAL, POINTER :: UX0(:,:) + REAL, POINTER :: UY0(:,:) + REAL, POINTER :: UXN(:,:) + REAL, POINTER :: UYN(:,:) + REAL, POINTER :: RH0(:,:) + REAL, POINTER :: RHN(:,:) + REAL, POINTER :: BERGI(:,:) + REAL, POINTER :: MUDT(:,:) + REAL, POINTER :: MUDV(:,:) + REAL, POINTER :: MUDD(:,:) + REAL, POINTER :: ICEP1(:,:) + REAL, POINTER :: ICEP2(:,:) + REAL, POINTER :: ICEP3(:,:) + REAL, POINTER :: ICEP4(:,:) + REAL, POINTER :: ICEP5(:,:) + #ifdef W3_TIDE - REAL, POINTER :: CXTIDE(:,:,:,:), CYTIDE(:,:,:,:), & - WLTIDE(:,:,:,:) + REAL, POINTER :: CXTIDE(:,:,:,:) + REAL, POINTER :: CYTIDE(:,:,:,:) + REAL, POINTER :: WLTIDE(:,:,:,:) #endif - LOGICAL :: IINIT + LOGICAL :: IINIT #ifdef W3_WRST - LOGICAL :: WRSTIINIT=.FALSE. + LOGICAL :: WRSTIINIT=.FALSE. #endif ! note that if size of INFLAGS1 is changed, then TFLAGS in wminitmd.ftn ! also must be resized. - LOGICAL :: INFLAGS1(-7:14), FLAGSC(-7:14), & - INFLAGS2(-7:14) + LOGICAL :: INFLAGS1(-7:14) + LOGICAL :: FLAGSC(-7:14) + LOGICAL :: INFLAGS2(-7:14) END TYPE INPUT !/ !/ Data storage From 0496d3614b804470759e7a158b60016aa4e3a843 Mon Sep 17 00:00:00 2001 From: Mickael Accensi <49198861+mickaelaccensi@users.noreply.github.com> Date: Thu, 17 Feb 2022 17:27:34 +0100 Subject: [PATCH 08/44] reorganize ww3_tp2.14 by separated input directories (#607) and fix it to use with namelist files minor update in the coupling itself to use the same conditions for each exchanged variable. --- .gitignore | 32 ++ model/bin/ww3_from_ftp.sh | 14 +- model/src/w3ogcmmd.F90 | 26 +- regtests/bin/matrix.base | 25 +- regtests/bin/matrix.comp | 69 +++-- regtests/bin/run_test | 33 ++- regtests/ww3_tp2.14/info | 52 ++-- regtests/ww3_tp2.14/input/namelists_BREST.nml | 2 - .../input/oasis3-mct/lib/mct/.cvsignore | 1 - .../input/oasis3-mct/lib/mct/doc/.cvsignore | 1 - .../oasis3-mct/lib/mct/doc/texsrc/.cvsignore | 1 - .../mct/examples/climate_concur1/.cvsignore | 1 - .../mct/examples/climate_sequen1/.cvsignore | 1 - .../lib/mct/examples/simple/.cvsignore | 1 - .../input/oasis3-mct/lib/mct/mct/.cvsignore | 1 - .../input/oasis3-mct/lib/mct/mpeu/.cvsignore | 1 - .../input/oasis3-mct/util/make_dir/cmplr.tmpl | 4 +- .../util/make_dir/{make.inc => make.inc.tmpl} | 2 +- regtests/ww3_tp2.14/input/prep_env.sh | 102 ------- .../input/toy/{Makefile => Makefile.tmpl} | 2 +- .../TOYNAMELIST.nam} | 0 .../namcouple} | 0 .../namelists_IROISE.nml | 0 regtests/ww3_tp2.14/input_oasacm/prep_env.sh | 101 +++++++ .../{input => input_oasacm}/switch_OASACM | 0 .../{input => input_oasacm}/ww3_grid.inp | 0 .../{input => input_oasacm}/ww3_grid.nml | 2 +- regtests/ww3_tp2.14/input_oasacm/ww3_ounf.inp | 41 +++ regtests/ww3_tp2.14/input_oasacm/ww3_ounf.nml | 60 ++++ .../ww3_shel.inp} | 0 .../ww3_shel.nml} | 21 +- .../{input => input_oasacm}/ww3_strt.inp | 0 .../TOYNAMELIST.nam} | 0 .../namcouple} | 0 .../input_oasacm2/namelists_IROISE.nml | 1 + regtests/ww3_tp2.14/input_oasacm2/prep_env.sh | 101 +++++++ .../{input => input_oasacm2}/switch_OASACM2 | 0 .../ww3_tp2.14/input_oasacm2/ww3_grid.inp | 276 ++++++++++++++++++ .../ww3_tp2.14/input_oasacm2/ww3_grid.nml | 276 ++++++++++++++++++ .../ww3_tp2.14/input_oasacm2/ww3_ounf.inp | 41 +++ .../ww3_tp2.14/input_oasacm2/ww3_ounf.nml | 60 ++++ .../ww3_shel.inp} | 0 .../ww3_shel.nml} | 21 +- .../ww3_tp2.14/input_oasacm2/ww3_strt.inp | 72 +++++ .../input_oasacm3/namelists_IROISE.nml | 1 + .../{input => input_oasacm3}/switch_OASACM3 | 0 .../ww3_tp2.14/input_oasacm3/ww3_grid.inp | 276 ++++++++++++++++++ .../ww3_tp2.14/input_oasacm3/ww3_grid.nml | 276 ++++++++++++++++++ .../ww3_tp2.14/input_oasacm3/ww3_ounf.inp | 41 +++ .../ww3_tp2.14/input_oasacm3/ww3_ounf.nml | 60 ++++ .../ww3_shel.inp} | 0 .../ww3_shel.nml} | 24 +- .../ww3_tp2.14/input_oasacm3/ww3_strt.inp | 72 +++++ .../TOYNAMELIST.nam} | 0 .../namcouple} | 0 .../input_oasacm4/namelists_IROISE.nml | 1 + regtests/ww3_tp2.14/input_oasacm4/prep_env.sh | 101 +++++++ .../{input => input_oasacm4}/switch_OASACM4 | 0 .../ww3_tp2.14/input_oasacm4/ww3_grid.inp | 276 ++++++++++++++++++ .../ww3_tp2.14/input_oasacm4/ww3_grid.nml | 276 ++++++++++++++++++ .../ww3_tp2.14/input_oasacm4/ww3_ounf.inp | 41 +++ .../ww3_tp2.14/input_oasacm4/ww3_ounf.nml | 60 ++++ .../ww3_shel.inp} | 0 .../ww3_shel.nml} | 25 +- .../TOYNAMELIST.nam} | 0 .../namcouple} | 0 .../input_oasacm5/namelists_IROISE.nml | 1 + regtests/ww3_tp2.14/input_oasacm5/prep_env.sh | 101 +++++++ .../{input => input_oasacm5}/switch_OASACM5 | 0 .../ww3_tp2.14/input_oasacm5/ww3_grid.inp | 276 ++++++++++++++++++ .../ww3_tp2.14/input_oasacm5/ww3_grid.nml | 276 ++++++++++++++++++ .../ww3_tp2.14/input_oasacm5/ww3_ounf.inp | 41 +++ .../ww3_tp2.14/input_oasacm5/ww3_ounf.nml | 60 ++++ .../ww3_shel.inp} | 0 .../ww3_shel.nml} | 25 +- .../{input => input_oasacm6}/BrestISides.dat | 0 .../{input => input_oasacm6}/BrestJSides.dat | 0 .../{input => input_oasacm6}/BrestObstrs.dat | 0 .../{input => input_oasacm6}/BrestSMCels.dat | 0 .../TOYNAMELIST.nam} | 0 .../namcouple} | 6 +- .../input_oasacm6/namelists_BREST.nml | 2 + regtests/ww3_tp2.14/input_oasacm6/prep_env.sh | 101 +++++++ .../{input => input_oasacm6}/switch_OASACM6 | 0 .../ww3_grid.inp} | 8 +- .../ww3_grid.nml} | 10 +- .../ww3_ounf.inp} | 2 +- .../ww3_tp2.14/input_oasacm6/ww3_ounf.nml | 87 ++++++ .../ww3_shel.inp} | 0 .../ww3_shel.nml} | 26 +- .../ww3_tp2.14/input_oasacm6/ww3_strt.inp | 72 +++++ .../TOYNAMELIST.nam} | 0 .../namcouple} | 0 .../input_oasicm/namelists_IROISE.nml | 1 + regtests/ww3_tp2.14/input_oasicm/prep_env.sh | 101 +++++++ .../{input => input_oasicm}/switch_OASICM | 0 regtests/ww3_tp2.14/input_oasicm/ww3_grid.inp | 276 ++++++++++++++++++ regtests/ww3_tp2.14/input_oasicm/ww3_grid.nml | 276 ++++++++++++++++++ .../{input => input_oasicm}/ww3_ounf.inp | 0 .../{input => input_oasicm}/ww3_ounf.nml | 0 .../ww3_shel.inp} | 0 .../ww3_shel.nml} | 22 +- regtests/ww3_tp2.14/input_oasicm/ww3_strt.inp | 72 +++++ .../TOYNAMELIST.nam} | 0 .../namcouple} | 0 .../input_oasocm/namelists_IROISE.nml | 1 + regtests/ww3_tp2.14/input_oasocm/prep_env.sh | 101 +++++++ .../{input => input_oasocm}/switch_OASOCM | 0 regtests/ww3_tp2.14/input_oasocm/ww3_grid.inp | 276 ++++++++++++++++++ regtests/ww3_tp2.14/input_oasocm/ww3_grid.nml | 276 ++++++++++++++++++ regtests/ww3_tp2.14/input_oasocm/ww3_ounf.inp | 41 +++ regtests/ww3_tp2.14/input_oasocm/ww3_ounf.nml | 60 ++++ .../ww3_shel.inp} | 0 .../ww3_shel.nml} | 21 +- regtests/ww3_tp2.14/input_oasocm/ww3_strt.inp | 72 +++++ 115 files changed, 5391 insertions(+), 273 deletions(-) delete mode 100644 regtests/ww3_tp2.14/input/namelists_BREST.nml delete mode 100644 regtests/ww3_tp2.14/input/oasis3-mct/lib/mct/.cvsignore delete mode 100644 regtests/ww3_tp2.14/input/oasis3-mct/lib/mct/doc/.cvsignore delete mode 100644 regtests/ww3_tp2.14/input/oasis3-mct/lib/mct/doc/texsrc/.cvsignore delete mode 100644 regtests/ww3_tp2.14/input/oasis3-mct/lib/mct/examples/climate_concur1/.cvsignore delete mode 100644 regtests/ww3_tp2.14/input/oasis3-mct/lib/mct/examples/climate_sequen1/.cvsignore delete mode 100644 regtests/ww3_tp2.14/input/oasis3-mct/lib/mct/examples/simple/.cvsignore delete mode 100644 regtests/ww3_tp2.14/input/oasis3-mct/lib/mct/mct/.cvsignore delete mode 100644 regtests/ww3_tp2.14/input/oasis3-mct/lib/mct/mpeu/.cvsignore rename regtests/ww3_tp2.14/input/oasis3-mct/util/make_dir/{make.inc => make.inc.tmpl} (81%) delete mode 100755 regtests/ww3_tp2.14/input/prep_env.sh rename regtests/ww3_tp2.14/input/toy/{Makefile => Makefile.tmpl} (97%) rename regtests/ww3_tp2.14/{input/TOYNAMELIST.nam.OASACM => input_oasacm/TOYNAMELIST.nam} (100%) rename regtests/ww3_tp2.14/{input/namcouple.OASACM => input_oasacm/namcouple} (100%) rename regtests/ww3_tp2.14/{input => input_oasacm}/namelists_IROISE.nml (100%) create mode 100755 regtests/ww3_tp2.14/input_oasacm/prep_env.sh rename regtests/ww3_tp2.14/{input => input_oasacm}/switch_OASACM (100%) rename regtests/ww3_tp2.14/{input => input_oasacm}/ww3_grid.inp (100%) rename regtests/ww3_tp2.14/{input => input_oasacm}/ww3_grid.nml (99%) create mode 100755 regtests/ww3_tp2.14/input_oasacm/ww3_ounf.inp create mode 100644 regtests/ww3_tp2.14/input_oasacm/ww3_ounf.nml rename regtests/ww3_tp2.14/{input/ww3_shel_OASACM.inp => input_oasacm/ww3_shel.inp} (100%) rename regtests/ww3_tp2.14/{input/ww3_shel_OASACM.nml => input_oasacm/ww3_shel.nml} (95%) rename regtests/ww3_tp2.14/{input => input_oasacm}/ww3_strt.inp (100%) rename regtests/ww3_tp2.14/{input/TOYNAMELIST.nam.OASACM2 => input_oasacm2/TOYNAMELIST.nam} (100%) rename regtests/ww3_tp2.14/{input/namcouple.OASACM2 => input_oasacm2/namcouple} (100%) create mode 100644 regtests/ww3_tp2.14/input_oasacm2/namelists_IROISE.nml create mode 100755 regtests/ww3_tp2.14/input_oasacm2/prep_env.sh rename regtests/ww3_tp2.14/{input => input_oasacm2}/switch_OASACM2 (100%) create mode 100755 regtests/ww3_tp2.14/input_oasacm2/ww3_grid.inp create mode 100644 regtests/ww3_tp2.14/input_oasacm2/ww3_grid.nml create mode 100755 regtests/ww3_tp2.14/input_oasacm2/ww3_ounf.inp create mode 100644 regtests/ww3_tp2.14/input_oasacm2/ww3_ounf.nml rename regtests/ww3_tp2.14/{input/ww3_shel_OASACM2.inp => input_oasacm2/ww3_shel.inp} (100%) rename regtests/ww3_tp2.14/{input/ww3_shel_OASACM2.nml => input_oasacm2/ww3_shel.nml} (95%) create mode 100755 regtests/ww3_tp2.14/input_oasacm2/ww3_strt.inp create mode 100644 regtests/ww3_tp2.14/input_oasacm3/namelists_IROISE.nml rename regtests/ww3_tp2.14/{input => input_oasacm3}/switch_OASACM3 (100%) create mode 100755 regtests/ww3_tp2.14/input_oasacm3/ww3_grid.inp create mode 100644 regtests/ww3_tp2.14/input_oasacm3/ww3_grid.nml create mode 100755 regtests/ww3_tp2.14/input_oasacm3/ww3_ounf.inp create mode 100644 regtests/ww3_tp2.14/input_oasacm3/ww3_ounf.nml rename regtests/ww3_tp2.14/{input/ww3_shel_OASACM3.inp => input_oasacm3/ww3_shel.inp} (100%) rename regtests/ww3_tp2.14/{input/ww3_shel_OASACM3.nml => input_oasacm3/ww3_shel.nml} (94%) create mode 100755 regtests/ww3_tp2.14/input_oasacm3/ww3_strt.inp rename regtests/ww3_tp2.14/{input/TOYNAMELIST.nam.OASACM4 => input_oasacm4/TOYNAMELIST.nam} (100%) rename regtests/ww3_tp2.14/{input/namcouple.OASACM4 => input_oasacm4/namcouple} (100%) create mode 100644 regtests/ww3_tp2.14/input_oasacm4/namelists_IROISE.nml create mode 100755 regtests/ww3_tp2.14/input_oasacm4/prep_env.sh rename regtests/ww3_tp2.14/{input => input_oasacm4}/switch_OASACM4 (100%) create mode 100755 regtests/ww3_tp2.14/input_oasacm4/ww3_grid.inp create mode 100644 regtests/ww3_tp2.14/input_oasacm4/ww3_grid.nml create mode 100755 regtests/ww3_tp2.14/input_oasacm4/ww3_ounf.inp create mode 100644 regtests/ww3_tp2.14/input_oasacm4/ww3_ounf.nml rename regtests/ww3_tp2.14/{input/ww3_shel_OASACM4.inp => input_oasacm4/ww3_shel.inp} (100%) rename regtests/ww3_tp2.14/{input/ww3_shel_OASACM4.nml => input_oasacm4/ww3_shel.nml} (94%) rename regtests/ww3_tp2.14/{input/TOYNAMELIST.nam.OASACM5 => input_oasacm5/TOYNAMELIST.nam} (100%) rename regtests/ww3_tp2.14/{input/namcouple.OASACM5 => input_oasacm5/namcouple} (100%) create mode 100644 regtests/ww3_tp2.14/input_oasacm5/namelists_IROISE.nml create mode 100755 regtests/ww3_tp2.14/input_oasacm5/prep_env.sh rename regtests/ww3_tp2.14/{input => input_oasacm5}/switch_OASACM5 (100%) create mode 100755 regtests/ww3_tp2.14/input_oasacm5/ww3_grid.inp create mode 100644 regtests/ww3_tp2.14/input_oasacm5/ww3_grid.nml create mode 100755 regtests/ww3_tp2.14/input_oasacm5/ww3_ounf.inp create mode 100644 regtests/ww3_tp2.14/input_oasacm5/ww3_ounf.nml rename regtests/ww3_tp2.14/{input/ww3_shel_OASACM5.inp => input_oasacm5/ww3_shel.inp} (100%) rename regtests/ww3_tp2.14/{input/ww3_shel_OASACM5.nml => input_oasacm5/ww3_shel.nml} (94%) rename regtests/ww3_tp2.14/{input => input_oasacm6}/BrestISides.dat (100%) rename regtests/ww3_tp2.14/{input => input_oasacm6}/BrestJSides.dat (100%) rename regtests/ww3_tp2.14/{input => input_oasacm6}/BrestObstrs.dat (100%) rename regtests/ww3_tp2.14/{input => input_oasacm6}/BrestSMCels.dat (100%) rename regtests/ww3_tp2.14/{input/TOYNAMELIST.nam.OASACM6 => input_oasacm6/TOYNAMELIST.nam} (100%) rename regtests/ww3_tp2.14/{input/namcouple.OASACM6 => input_oasacm6/namcouple} (97%) create mode 100644 regtests/ww3_tp2.14/input_oasacm6/namelists_BREST.nml create mode 100755 regtests/ww3_tp2.14/input_oasacm6/prep_env.sh rename regtests/ww3_tp2.14/{input => input_oasacm6}/switch_OASACM6 (100%) rename regtests/ww3_tp2.14/{input/ww3_grid_OASACM6.inp => input_oasacm6/ww3_grid.inp} (98%) rename regtests/ww3_tp2.14/{input/ww3_grid_OASACM6.nml => input_oasacm6/ww3_grid.nml} (97%) rename regtests/ww3_tp2.14/{input/ww3_ounf.inp-OASACM6 => input_oasacm6/ww3_ounf.inp} (96%) create mode 100644 regtests/ww3_tp2.14/input_oasacm6/ww3_ounf.nml rename regtests/ww3_tp2.14/{input/ww3_shel_OASACM6.inp => input_oasacm6/ww3_shel.inp} (100%) rename regtests/ww3_tp2.14/{input/ww3_shel_OASACM6.nml => input_oasacm6/ww3_shel.nml} (94%) create mode 100755 regtests/ww3_tp2.14/input_oasacm6/ww3_strt.inp rename regtests/ww3_tp2.14/{input/TOYNAMELIST.nam.OASICM => input_oasicm/TOYNAMELIST.nam} (100%) rename regtests/ww3_tp2.14/{input/namcouple.OASICM => input_oasicm/namcouple} (100%) create mode 100644 regtests/ww3_tp2.14/input_oasicm/namelists_IROISE.nml create mode 100755 regtests/ww3_tp2.14/input_oasicm/prep_env.sh rename regtests/ww3_tp2.14/{input => input_oasicm}/switch_OASICM (100%) create mode 100755 regtests/ww3_tp2.14/input_oasicm/ww3_grid.inp create mode 100644 regtests/ww3_tp2.14/input_oasicm/ww3_grid.nml rename regtests/ww3_tp2.14/{input => input_oasicm}/ww3_ounf.inp (100%) rename regtests/ww3_tp2.14/{input => input_oasicm}/ww3_ounf.nml (100%) rename regtests/ww3_tp2.14/{input/ww3_shel_OASICM.inp => input_oasicm/ww3_shel.inp} (100%) rename regtests/ww3_tp2.14/{input/ww3_shel_OASICM.nml => input_oasicm/ww3_shel.nml} (95%) create mode 100755 regtests/ww3_tp2.14/input_oasicm/ww3_strt.inp rename regtests/ww3_tp2.14/{input/TOYNAMELIST.nam.OASOCM => input_oasocm/TOYNAMELIST.nam} (100%) rename regtests/ww3_tp2.14/{input/namcouple.OASOCM => input_oasocm/namcouple} (100%) create mode 100644 regtests/ww3_tp2.14/input_oasocm/namelists_IROISE.nml create mode 100755 regtests/ww3_tp2.14/input_oasocm/prep_env.sh rename regtests/ww3_tp2.14/{input => input_oasocm}/switch_OASOCM (100%) create mode 100755 regtests/ww3_tp2.14/input_oasocm/ww3_grid.inp create mode 100644 regtests/ww3_tp2.14/input_oasocm/ww3_grid.nml create mode 100755 regtests/ww3_tp2.14/input_oasocm/ww3_ounf.inp create mode 100644 regtests/ww3_tp2.14/input_oasocm/ww3_ounf.nml rename regtests/ww3_tp2.14/{input/ww3_shel_OASOCM.inp => input_oasocm/ww3_shel.inp} (100%) rename regtests/ww3_tp2.14/{input/ww3_shel_OASOCM.nml => input_oasocm/ww3_shel.nml} (95%) create mode 100755 regtests/ww3_tp2.14/input_oasocm/ww3_strt.inp diff --git a/.gitignore b/.gitignore index e627e4845..aa41f14b2 100644 --- a/.gitignore +++ b/.gitignore @@ -61,6 +61,38 @@ regtests/ww3_tp2.14/input*/*.nc.OAS*CM* regtests/ww3_tp2.14/input*/*/*.nc.OAS*CM* regtests/ww3_tp2.14/input/toy/*.o regtests/ww3_tp2.14/input/oasis3-mct/util/make_dir/cmplr +regtests/ww3_tp2.14/input/oasis3-mct/lib/mct/mct/*.mod +regtests/ww3_tp2.14/input/oasis3-mct/lib/mct/mct/*_scratch.f +regtests/ww3_tp2.14/input/oasis3-mct/lib/mct/mct/Makefile.conf +regtests/ww3_tp2.14/input/oasis3-mct/lib/mct/mct/*.lst +regtests/ww3_tp2.14/input/oasis3-mct/lib/mct/mpeu/*.mod +regtests/ww3_tp2.14/input/oasis3-mct/lib/mct/mpeu/mpeu +regtests/ww3_tp2.14/input/oasis3-mct/lib/mct/mpeu/Makefile.conf +regtests/ww3_tp2.14/input/oasis3-mct/lib/mct/mpeu/*.lst +regtests/ww3_tp2.14/input/oasis3-mct/lib/mct/doc/texsrc/*.F90 +regtests/ww3_tp2.14/input/oasis3-mct/lib/mct/doc/texsrc/*.tex +regtests/ww3_tp2.14/input/oasis3-mct/lib/mct/doc/*.toc +regtests/ww3_tp2.14/input/oasis3-mct/lib/mct/doc/*.log +regtests/ww3_tp2.14/input/oasis3-mct/lib/mct/doc/*.dvi +regtests/ww3_tp2.14/input/oasis3-mct/lib/mct/doc/*.aux +regtests/ww3_tp2.14/input/oasis3-mct/lib/mct/doc/*.blg +regtests/ww3_tp2.14/input/oasis3-mct/lib/mct/doc/*.bbl +regtests/ww3_tp2.14/input/oasis3-mct/lib/mct/doc/*.pdf +regtests/ww3_tp2.14/input/oasis3-mct/lib/mct/examples/climate_concur1/climate +regtests/ww3_tp2.14/input/oasis3-mct/lib/mct/examples/climate_concur1/*.mod +regtests/ww3_tp2.14/input/oasis3-mct/lib/mct/examples/climate_concur1/poe.* +regtests/ww3_tp2.14/input/oasis3-mct/lib/mct/examples/simple/twocon +regtests/ww3_tp2.14/input/oasis3-mct/lib/mct/examples/simple/twoseq +regtests/ww3_tp2.14/input/oasis3-mct/lib/mct/examples/simple/twosequn +regtests/ww3_tp2.14/input/oasis3-mct/lib/mct/examples/simple/twoseqNB +regtests/ww3_tp2.14/input/oasis3-mct/lib/mct/examples/climate_sequen1/MCT.* +regtests/ww3_tp2.14/input/oasis3-mct/lib/mct/examples/climate_sequen1/*.mod +regtests/ww3_tp2.14/input/oasis3-mct/lib/mct/examples/climate_sequen1/climate +regtests/ww3_tp2.14/input/oasis3-mct/lib/mct/Makefile.conf +regtests/ww3_tp2.14/input/oasis3-mct/lib/mct/config.log +regtests/ww3_tp2.14/input/oasis3-mct/lib/mct/config.status +regtests/ww3_tp2.14/input/oasis3-mct/lib/mct/config.h +regtests/ww3_tp2.14/input/oasis3-mct/lib/mct/autom4te.cache regtests/ww3_tp2.14/input/toy/toy_model regtests/ww3_tp2.14/input/ww3_shel.inp regtests/ww3_tp2.14/input/ww3_shel.nml diff --git a/model/bin/ww3_from_ftp.sh b/model/bin/ww3_from_ftp.sh index e1e9f7842..23a9c158d 100755 --- a/model/bin/ww3_from_ftp.sh +++ b/model/bin/ww3_from_ftp.sh @@ -77,9 +77,17 @@ cp -r data_regtests/ww3_tp2.8/input/*.nc regtests/ww3_tp2.8/input/ cp -r data_regtests/ww3_tp2.12/input/* regtests/ww3_tp2.12/input/ cp -r data_regtests/ww3_tp2.12/input_be/* regtests/ww3_tp2.12/input_be/ cp -r data_regtests/ww3_tp2.12/input_le/* regtests/ww3_tp2.12/input_le/ -cp -r data_regtests/ww3_tp2.14/input/r-ww3.nc.OAS*CM regtests/ww3_tp2.14/input/ -cp -r data_regtests/ww3_tp2.14/input/r-ww3.nc.OASACM regtests/ww3_tp2.14/input/r-ww3.nc.OASACM2 -cp -r data_regtests/ww3_tp2.14/input/rmp_* regtests/ww3_tp2.14/input/ +cp -r data_regtests/ww3_tp2.14/input/r-ww3.nc.OASOCM regtests/ww3_tp2.14/input_oasocm/r-ww3.nc +cp -r data_regtests/ww3_tp2.14/input/r-ww3.nc.OASICM regtests/ww3_tp2.14/input_oasicm/r-ww3.nc +cp -r data_regtests/ww3_tp2.14/input/r-ww3.nc.OASACM regtests/ww3_tp2.14/input_oasacm/r-ww3.nc +cp -r data_regtests/ww3_tp2.14/input/r-ww3.nc.OASACM regtests/ww3_tp2.14/input_oasacm2/r-ww3.nc +cp -r data_regtests/ww3_tp2.14/input/rmp_* regtests/ww3_tp2.14/input_oasocm/ +cp -r data_regtests/ww3_tp2.14/input/rmp_* regtests/ww3_tp2.14/input_oasicm/ +cp -r data_regtests/ww3_tp2.14/input/rmp_* regtests/ww3_tp2.14/input_oasacm/ +cp -r data_regtests/ww3_tp2.14/input/rmp_* regtests/ww3_tp2.14/input_oasacm2/ +cp -r data_regtests/ww3_tp2.14/input/rmp_* regtests/ww3_tp2.14/input_oasacm4/ +cp -r data_regtests/ww3_tp2.14/input/rmp_* regtests/ww3_tp2.14/input_oasacm5/ +cp -r data_regtests/ww3_tp2.14/input/rmp_* regtests/ww3_tp2.14/input_oasacm6/ if [ ! -d regtests/ww3_tp2.14/input/oasis3-mct/doc ] then mkdir regtests/ww3_tp2.14/input/oasis3-mct/doc diff --git a/model/src/w3ogcmmd.F90 b/model/src/w3ogcmmd.F90 index da408e5ba..cfe365c43 100644 --- a/model/src/w3ogcmmd.F90 +++ b/model/src/w3ogcmmd.F90 @@ -147,7 +147,9 @@ SUBROUTINE SND_FIELDS_TO_OCEAN() ! Mask - wet-drying ! --------------------------------------------------------------------- IF (SND_FLD(IB_DO)%CL_FIELD_NAME == 'WW3_ODRY') THEN - RLA_OASIS_SND(:,1) = DBLE(MASK(1:NSEAL)) + TMP(1:NSEAL) = 0.0 + WHERE(MASK(1:NSEAL) /= UNDEF) TMP(1:NSEAL)=MASK(1:NSEAL) + RLA_OASIS_SND(:,1) = DBLE(TMP(1:NSEAL)) CALL CPL_OASIS_SND(IB_DO, ID_OASIS_TIME, RLA_OASIS_SND, LL_ACTION) ENDIF ! @@ -181,14 +183,18 @@ SUBROUTINE SND_FIELDS_TO_OCEAN() ! Charnock coefficient (-) ! --------------------------------------------------------------------- IF (SND_FLD(IB_DO)%CL_FIELD_NAME == 'WW3_OCHA') THEN - RLA_OASIS_SND(:,1) = DBLE(CHARN(1:NSEAL)) + TMP(1:NSEAL) = 0.0 + WHERE(CHARN(1:NSEAL) /= UNDEF) TMP(1:NSEAL)=CHARN(1:NSEAL) + RLA_OASIS_SND(:,1) = DBLE(TMP(1:NSEAL)) CALL CPL_OASIS_SND(IB_DO, ID_OASIS_TIME, RLA_OASIS_SND, LL_ACTION) ENDIF ! ! Wave height (hs in m) ! --------------------------------------------------------------------- IF (SND_FLD(IB_DO)%CL_FIELD_NAME == 'WW3__OHS') THEN - RLA_OASIS_SND(:,1) = DBLE(HS(1:NSEAL)) + TMP(1:NSEAL) = 0.0 + WHERE(HS(1:NSEAL) /= UNDEF) TMP(1:NSEAL)=HS(1:NSEAL) + RLA_OASIS_SND(:,1) = DBLE(TMP(1:NSEAL)) CALL CPL_OASIS_SND(IB_DO, ID_OASIS_TIME, RLA_OASIS_SND, LL_ACTION) ENDIF ! @@ -198,7 +204,7 @@ SUBROUTINE SND_FIELDS_TO_OCEAN() IF (SND_FLD(IB_DO)%CL_FIELD_NAME == 'WW3_CDIR') THEN TMP(1:NSEAL) = 0.0 WHERE(THM(1:NSEAL) /= UNDEF) TMP(1:NSEAL)=COS(THM(1:NSEAL)) - RLA_OASIS_SND(:,1) = TMP(1:NSEAL) + RLA_OASIS_SND(:,1) = DBLE(TMP(1:NSEAL)) CALL CPL_OASIS_SND(IB_DO, ID_OASIS_TIME, RLA_OASIS_SND, LL_ACTION) ENDIF ! @@ -208,7 +214,7 @@ SUBROUTINE SND_FIELDS_TO_OCEAN() IF (SND_FLD(IB_DO)%CL_FIELD_NAME == 'WW3_SDIR') THEN TMP(1:NSEAL) = 0.0 WHERE(THM(1:NSEAL) /= UNDEF) TMP(1:NSEAL)=SIN(THM(1:NSEAL)) - RLA_OASIS_SND(:,1) = TMP(1:NSEAL) + RLA_OASIS_SND(:,1) = DBLE(TMP(1:NSEAL)) CALL CPL_OASIS_SND(IB_DO, ID_OASIS_TIME, RLA_OASIS_SND, LL_ACTION) ENDIF ! @@ -217,7 +223,7 @@ SUBROUTINE SND_FIELDS_TO_OCEAN() ! dir : nautical convention (GRIDDED files) - 0 degree from north, 90 from east IF (SND_FLD(IB_DO)%CL_FIELD_NAME == 'WW3__DIR') THEN TMP(1:NSEAL) = 0.0 - WHERE(THM /= UNDEF) TMP=THM + WHERE(THM /= UNDEF) TMP(1:NSEAL)=THM(1:NSEAL) RLA_OASIS_SND(:,1) = DBLE(TMP(1:NSEAL)) CALL CPL_OASIS_SND(IB_DO, ID_OASIS_TIME, RLA_OASIS_SND, LL_ACTION) ENDIF @@ -225,7 +231,9 @@ SUBROUTINE SND_FIELDS_TO_OCEAN() ! Wave-induced Bernoulli head pressure (bhd in N.m-1) (J term, Smith JPO 2006) ! --------------------------------------------------------------------- IF (SND_FLD(IB_DO)%CL_FIELD_NAME == 'WW3__BHD') THEN - RLA_OASIS_SND(:,1) = DBLE(BHD(1:NSEAL)) + TMP(1:NSEAL) = 0.0 + WHERE(BHD(1:NSEAL) /= UNDEF) TMP(1:NSEAL)=BHD(1:NSEAL) + RLA_OASIS_SND(:,1) = DBLE(TMP(1:NSEAL)) CALL CPL_OASIS_SND(IB_DO, ID_OASIS_TIME, RLA_OASIS_SND, LL_ACTION) ENDIF ! @@ -304,7 +312,9 @@ SUBROUTINE SND_FIELDS_TO_OCEAN() ! rms amplitude of orbital velocity of the waves (ubr in m.s-1) ! --------------------------------------------------------------------- IF (SND_FLD(IB_DO)%CL_FIELD_NAME == 'WW3__UBR') THEN - RLA_OASIS_SND(:,1) = DBLE(UBA(1:NSEAL)) + TMP(1:NSEAL) = 0.0 + WHERE(UBA(1:NSEAL) /= UNDEF) TMP(1:NSEAL)=UBA(1:NSEAL) + RLA_OASIS_SND(:,1) = DBLE(TMP(1:NSEAL)) CALL CPL_OASIS_SND(IB_DO, ID_OASIS_TIME, RLA_OASIS_SND, LL_ACTION) ENDIF ! diff --git a/regtests/bin/matrix.base b/regtests/bin/matrix.base index 98566c4ad..798362e81 100755 --- a/regtests/bin/matrix.base +++ b/regtests/bin/matrix.base @@ -2075,28 +2075,19 @@ if [ "$oasis" = 'y' ] && [ "$dist" = 'y' ] then echo ' ' >> matrix.body - echo "$rtst -s OASACM -w work_OASACM -C OASIS -f -p $mpi -n $np $ww3 ww3_tp2.14" >> matrix.body - echo "$rtst -s OASACM2 -w work_OASACM2 -C OASIS -f -p $mpi -n $np $ww3 ww3_tp2.14" >> matrix.body - echo "mkdir -p ww3_tp2.14/work_OASACM3" >> matrix.body - echo "cp ww3_tp2.14/input/ww3_shel_OASACM3.nml ww3_tp2.14/work_OASACM3/ww3_shel.nml" >> matrix.body + echo "$rtst -s OASACM -i input_oasacm -w work_OASACM -C OASIS -f -p $mpi -n $np $ww3 ww3_tp2.14" >> matrix.body + echo "$rtst -s OASACM2 -i input_oasacm2 -w work_OASACM2 -C OASIS -f -p $mpi -n $np $ww3 ww3_tp2.14" >> matrix.body halfnp=$(($np / 2)) - echo "$rtst -s OASACM3 -w work_OASACM3 -f -p $mpi -n $halfnp $ww3 ww3_tp2.14" >> matrix.body + echo "$rtst -s OASACM3 -i input_oasacm3 -w work_OASACM3 -f -p $mpi -n $halfnp $ww3 ww3_tp2.14" >> matrix.body echo "mkdir -p ww3_tp2.14/work_OASACM4" >> matrix.body echo "ln -sf ../work_OASACM3/restart001.ww3 ww3_tp2.14/work_OASACM4/restart.ww3" >> matrix.body - echo "$rtst -r ww3_grid -s OASACM4 -w work_OASACM4 -C OASIS -f -p $mpi -n $np $ww3 ww3_tp2.14" >> matrix.body - echo "$rtst -r ww3_shel -s OASACM4 -w work_OASACM4 -C OASIS -f -p $mpi -n $np $ww3 ww3_tp2.14" >> matrix.body - echo "$rtst -r ww3_ounf -s OASACM4 -w work_OASACM4 -C OASIS -f -p $mpi -n $np $ww3 ww3_tp2.14" >> matrix.body + echo "$rtst -s OASACM4 -i input_oasacm4 -w work_OASACM4 -C OASIS -f -p $mpi -n $np $ww3 ww3_tp2.14" >> matrix.body echo "mkdir -p ww3_tp2.14/work_OASACM5" >> matrix.body echo "ln -sf ../work_OASACM4/restart001.ww3 ww3_tp2.14/work_OASACM5/restart.ww3" >> matrix.body - echo "$rtst -r ww3_grid -s OASACM5 -w work_OASACM5 -C OASIS -f -p $mpi -n $np $ww3 ww3_tp2.14" >> matrix.body - echo "$rtst -r ww3_shel -s OASACM5 -w work_OASACM5 -C OASIS -f -p $mpi -n $np $ww3 ww3_tp2.14" >> matrix.body - echo "$rtst -r ww3_ounf -s OASACM5 -w work_OASACM5 -C OASIS -f -p $mpi -n $np $ww3 ww3_tp2.14" >> matrix.body - echo "mv ww3_tp2.14/input/ww3_ounf.inp ww3_tp2.14/input/ww3_ounf.inp.bak" >> matrix.body - echo "cp ww3_tp2.14/input/ww3_ounf.inp-OASACM6 ww3_tp2.14/input/ww3_ounf.inp" >> matrix.body - echo "$rtst -g OASACM6 -s OASACM6 -w work_OASACM6 -C OASIS -f -p $mpi -n $np $ww3 ww3_tp2.14" >> matrix.body - echo "mv ww3_tp2.14/input/ww3_ounf.inp.bak ww3_tp2.14/input/ww3_ounf.inp" >> matrix.body - echo "$rtst -s OASOCM -w work_OASOCM -C OASIS -f -p $mpi -n $np $ww3 ww3_tp2.14" >> matrix.body - echo "$rtst -s OASICM -w work_OASICM -C OASIS -f -p $mpi -n $np $ww3 ww3_tp2.14" >> matrix.body + echo "$rtst -s OASACM5 -i input_oasacm5 -w work_OASACM5 -C OASIS -f -p $mpi -n $np $ww3 ww3_tp2.14" >> matrix.body + echo "$rtst -s OASACM6 -i input_oasacm6 -w work_OASACM6 -C OASIS -f -p $mpi -n $np $ww3 ww3_tp2.14" >> matrix.body + echo "$rtst -s OASOCM -i input_oasocm -w work_OASOCM -C OASIS -f -p $mpi -n $np $ww3 ww3_tp2.14" >> matrix.body + echo "$rtst -s OASICM -i input_oasicm -w work_OASICM -C OASIS -f -p $mpi -n $np $ww3 ww3_tp2.14" >> matrix.body fi #Test of UFS applications with ww3_multi and grib2 output diff --git a/regtests/bin/matrix.comp b/regtests/bin/matrix.comp index 054a6691f..6a4acc294 100755 --- a/regtests/bin/matrix.comp +++ b/regtests/bin/matrix.comp @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/bash -e # --------------------------------------------------------------------------- # # matrix.comp Compare output of matrix for two model versions. # # # @@ -111,13 +111,7 @@ # 3. Looping over work directories # # --------------------------------------------------------------------------- # - cases=$(find . -maxdepth 1 -type d -name "work*" | grep -v work_oasis) - # skip to next tst if no work directory - echo 'run : ' $cases - if [ -z "$cases" ] ; then - echo "skip" - continue - fi + cases=$(find . -maxdepth 1 -type d -name "work*" ) for run in $cases do @@ -153,20 +147,58 @@ cd $return_base ; cd $run rm -f diff_tempfile - files_1=`find -type f | sed "s#^./##"` - + files_0=`ls` + files_1="" + for file in $files_0 + do + if [[ -d $file ]]; then + if [[ $file == build* ]] || [[ $file == exe* ]] || + [[ $file == *oasis3-mct* ]] || [[ $file == toy* ]]; then + echo "do not compare build or exe directories $file" + else + #add files: + files_dir=`ls $file` + for file1 in $files_dir + do + files_1="$files_1 $file1" + done + fi + else + files_1="$files_1 $file" + fi + done + #Generate list of binary files in the directory binaryfiles=`grep . -r * | grep 'Binary file' | sed -e "s/^Binary file //" -e "s/ matches$//"` #Generate list of files to skip - skipfiles="ww3_shel.out ww3_multi.out prf.*.mww3 finished ww3_systrk.out gmon.out time_count.txt oasis_make.out oasis_clean.out toy_make.out toy_clean.out" + skipfiles="ww3_shel.out ww3_multi.out prf.*.mww3 finished ww3_systrk.out gmon.out time_count.txt oasis_make.out oasis_clean.out toy_model toy_make.out toy_clean.out build.log" nf_1=`echo $files_1 | wc -w | awk '{print $1}'` echo " found $nf_1 files in base directory" >> $home_dir/fulldiff.tmp cd $return_comp ; cd $run rm -f diff_tempfile - files_2=`find -type f | sed "s#^./##"` + files_0=`ls` + files_2="" + for file in $files_0 + do + if [[ -d $file ]]; then + if [[ $file == build* ]] || [[ $file == exe* ]] || + [[ $file == *oasis3-mct* ]] || [[ $file == toy* ]]; then + echo "do not compare build or exe directories $file" + else + #add files: + files_dir=`ls $file` + for file1 in $files_dir + do + files_2="$files_1 $file1" + done + fi + else + files_2="$files_2 $file" + fi + done nf_2=`echo $files_2 | wc -w | awk '{print $1}'` echo " found $nf_2 files in compare directory" >> $home_dir/fulldiff.tmp @@ -402,19 +434,6 @@ rm -f $home_dir/summary.tmp rm -f $home_dir/fulldiff.tmp - -# echo ' ' -# cat $home_dir/fulldiff.tmp -# echo '**********************************************************************' -# -# echo ' ' -# cat $home_dir/isIdenticalList.tmp -# echo '**********************************************************************' -# -# echo ' ' -# cat $home_dir/notIdenticalList.tmp -# echo '**********************************************************************' - echo ' ' echo " Saved summary to $home_dir/matrixCompSummary.txt" echo " Saved full output to $home_dir/matrixCompFull.txt" diff --git a/regtests/bin/run_test b/regtests/bin/run_test index b14739b46..c509b574c 100755 --- a/regtests/bin/run_test +++ b/regtests/bin/run_test @@ -442,7 +442,7 @@ then errmsg "Error occured during WW3 $prog build" exit 1 fi - export OASISDIR=$path_i/../work_oasis3-mct + export OASISDIR=$path_w/work_oasis3-mct fi # 3.b Header @@ -560,7 +560,7 @@ then fi # link conf file - if [ $nml_input ] && [ ! -z "`echo ${ifile} | grep -o nml`" ] + if [ $nml_input ] && [ ! -z "`basename ${ifile} | grep -o nml`" ] then \rm -f $prog.nml \ln -s $ifile $prog.nml @@ -688,7 +688,7 @@ then fi # link conf file - if [ $nml_input ] && [ ! -z "`echo ${ifile} | grep -o nml`" ] + if [ $nml_input ] && [ ! -z "`basename ${ifile} | grep -o nml`" ] then \rm -f $prog.nml \ln -s $ifile $prog.nml @@ -823,7 +823,7 @@ then fi # link conf file - if [ $nml_input ] && [ ! -z "`echo ${ifile} | grep -o nml`" ] + if [ $nml_input ] && [ ! -z "`basename ${ifile} | grep -o nml`" ] then \rm -f $prog.nml \ln -s $ifile $prog.nml @@ -958,7 +958,7 @@ then fi # link conf file - if [ $nml_input ] && [ ! -z "`echo ${ifile} | grep -o nml`" ] + if [ $nml_input ] && [ ! -z "`basename ${ifile} | grep -o nml`" ] then \rm -f $prog.nml \ln -s $ifile $prog.nml @@ -1096,7 +1096,7 @@ then do # link conf file - if [ $nml_input ] && [ ! -z "`echo ${ifile} | grep -o nml`" ] + if [ $nml_input ] && [ ! -z "`basename ${ifile} | grep -o nml`" ] then \rm -f $prog.nml \ln -s $ifile $prog.nml @@ -1268,7 +1268,7 @@ then do # link conf file - if [ $nml_input ] && [ ! -z "`echo ${ifile} | grep -o nml`" ] + if [ $nml_input ] && [ ! -z "`basename ${ifile} | grep -o nml`" ] then \rm -f $prog.nml \ln -s $ifile $prog.nml @@ -1417,7 +1417,7 @@ then do # link conf file - if [ $nml_input ] && [ ! -z "`echo ${ifile} | grep -o nml`" ] + if [ $nml_input ] && [ ! -z "`basename ${ifile} | grep -o nml`" ] then \rm -f $prog.nml \ln -s $ifile $prog.nml @@ -1617,7 +1617,7 @@ then ofile="$path_w/$prog.out" # link conf file - if [ $nml_input ] && [ ! -z "`echo ${ifile} | grep -o nml`" ] + if [ $nml_input ] && [ ! -z "`basename ${ifile} | grep -o nml`" ] then \rm -f $prog.nml \ln -s $ifile $prog.nml @@ -1808,7 +1808,7 @@ then fi # link conf file - if [ $nml_input ] && [ ! -z "`echo ${ifile} | grep -o nml`" ] + if [ $nml_input ] && [ ! -z "`basename ${ifile} | grep -o nml`" ] then \rm -f $prog.nml \ln -s $ifile $prog.nml @@ -1991,7 +1991,7 @@ do ifile=`( ls ${path_i}/${prog}${gu}.??? )` # link conf file - if [ $nml_input ] && [ ! -z "`echo ${ifile} | grep -o nml`" ] + if [ $nml_input ] && [ ! -z "`basename ${ifile} | grep -o nml`" ] then \rm -f $prog.nml \ln -s $path_i/$prog${gu}.nml $prog.nml @@ -2049,7 +2049,7 @@ do do # link conf file - if [ $nml_input ] && [ ! -z "`echo ${ifile} | grep -o nml`" ] + if [ $nml_input ] && [ ! -z "`basename ${ifile} | grep -o nml`" ] then \rm -f $prog.nml \ln -s $ifile $prog.nml @@ -2090,6 +2090,7 @@ do then \rm -f $prog.inp \rm -f $prog.nml + \rm -f ounfmeta.inp if [ $multi -eq 2 ] then \rm -f mod_def.ww3 @@ -2274,7 +2275,7 @@ do do # link conf file - if [ $nml_input ] && [ ! -z "`echo ${ifile} | grep -o nml`" ] + if [ $nml_input ] && [ ! -z "`basename ${ifile} | grep -o nml`" ] then \rm -f $prog.nml \ln -s $ifile $prog.nml @@ -2449,7 +2450,7 @@ do fi # link conf file - if [ $nml_input ] && [ ! -z "`echo ${ifile} | grep -o nml`" ] + if [ $nml_input ] && [ ! -z "`basename ${ifile} | grep -o nml`" ] then \rm -f $prog.nml \ln -s $ifile $prog.nml @@ -2582,7 +2583,7 @@ then # link conf file - if [ $nml_input ] && [ ! -z "`echo ${ifile} | grep -o nml`" ] + if [ $nml_input ] && [ ! -z "`basename ${ifile} | grep -o nml`" ] then \rm -f $prog.nml \ln -s $ifile $prog.nml @@ -2720,7 +2721,7 @@ then fi # link conf file - if [ $nml_input ] && [ ! -z "`echo ${ifile} | grep -o nml`" ] + if [ $nml_input ] && [ ! -z "`basename ${ifile} | grep -o nml`" ] then \rm -f $prog.nml \ln -s $ifile $prog.nml diff --git a/regtests/ww3_tp2.14/info b/regtests/ww3_tp2.14/info index 9e9d412e7..2847e2268 100644 --- a/regtests/ww3_tp2.14/info +++ b/regtests/ww3_tp2.14/info @@ -68,7 +68,7 @@ # - fields are I/O coupling between the two models # # - remark : these fields must also be defined in type 1 # # * prep_env.sh : # -# + compile the toy model, the oasis coupler and coy the inputs # +# + compile the toy model, the oasis coupler and copy the inputs # # * namcouple : # # + defines the configuration for the oasis coupler # # - remark : grid dimensions for ww3 must be -2 to remove the halo # @@ -86,45 +86,31 @@ # Sample run_test commands : # #(Note: Altix and mpirun commands differ by local system) # # # -# ./bin/run_test -C OASIS -c Altix -s OASACM -f -o netcdf -w work_OASACM # -# -p mpirun -n 4 ../model ww3_tp2.14 # -# ./bin/run_test -C OASIS -c Altix -s OASOCM -f -o netcdf -w work_OASOCM # -# -p mpirun -n 4 ../model ww3_tp2.14 # -# ./bin/run_test -C OASIS -c Altix -s OASICM -f -o netcdf -w work_OASICM # -# -p mpirun -n 4 ../model ww3_tp2.14 # -# ./bin/run_rest -s OASACM2 -w work_OASACM2 -C OASIS -f -p mpirun -n 4 # -# -o netcdf ../model ww3_tp2.14 # -# mkdir -p ww3_tp2.14/work_OASACM3 # -# cp ww3_tp2.14/input/ww3_shel_OASACM3.nml # -# ww3_tp2.14/work_OASACM3/ww3_shel.nml # -# ./bin/run_test -s OASACM3 -w work_OASACM3 -f -p mpirun -n 2 -o netcdf # -# ../model ww3_tp2.14 # +# ./bin/run_test -C OASIS -s OASACM -f -o netcdf -w work_OASACM # +# -i input_oasacm -p mpirun -n 4 ../model ww3_tp2.14 # +# ./bin/run_test -C OASIS -s OASOCM -f -o netcdf -w work_OASOCM # +# -i input_oasocm -p mpirun -n 4 ../model ww3_tp2.14 # +# ./bin/run_test -C OASIS -s OASICM -f -o netcdf -w work_OASICM # +# -i input_oasicm -p mpirun -n 4 ../model ww3_tp2.14 # +# ./bin/run_rest -C OASIS -s OASACM2 -f -o netcdf -w work_OASACM2 # +# -i input_oasacm2 -p mpirun -n 4 ../model ww3_tp2.14 # +# ./bin/run_test -s OASACM3 -f -o netcdf -w work_OASACM3 # +# -i input_oasacm3 -p mpirun -n 2 ../model ww3_tp2.14 # # mkdir -p ww3_tp2.14/work_OASACM4 # # ln -sf ../work_OASACM3/restart001.ww3 # # ww3_tp2.14/work_OASACM4/restart.ww3 # -# ./bin/run_test -r ww3_grid -s OASACM4 -w work_OASACM4 -C OASIS -f # -# -p mpirun -n 4 -o netcdf ../model ww3_tp2.14 # -# ./bin/run_test -r ww3_shel -s OASACM4 -w work_OASACM4 -C OASIS -f # -# -p mpirun -n 4 -o netcdf ../model ww3_tp2.14 # -# ./bin/run_test -r ww3_ounf -s OASACM4 -w work_OASACM4 -C OASIS -f # -# -p mpirun -n 4 -o netcdf ../model ww3_tp2.14 # +# ./bin/run_test -C OASIS -s OASACM4 -f -o netcdf -w work_OASACM4 # +# -i input_oasacm4 -p mpirun -n 4 ../model ww3_tp2.14 # # mkdir -p ww3_tp2.14/work_OASACM5 # # ln -sf ../work_OASACM4/restart001.ww3 # -# ww3_tp2.14/work_OASACM5/restart.ww3" # -# ./bin/run_test -r ww3_grid -s OASACM5 -w work_OASACM5 -C OASIS -f # -# -p mpirun -n 4 -o netcdf ../model ww3_tp2.14 # -# ./bin/run_test -r ww3_shel -s OASACM5 -w work_OASACM5 -C OASIS -f # -# -p mpirun -n 4 -o netcdf ../model ww3_tp2.14 # -# ./bin/run_test -r ww3_ounf -s OASACM5 -w work_OASACM5 -C OASIS -f # -# -p mpirun -n 4 -o netcdf ../model ww3_tp2.14 # -# mv ww3_tp2.14/input/ww3_ounf.inp ww3_tp2.14/input/ww3_ounf.inp.bak # -# cp ww3_tp2.14/input/ww3_ounf.inp-OASACM6 ww3_tp2.14/input/ww3_ounf.inp # -# ./bin/run_test -g OASACM6 -s OASACM6 -w work_OASACM6 -C OASIS -f # -# -p mpirun -n 4 -o netcdf ../model ww3_tp2.14 # -# mv ww3_tp2.14/input/ww3_ounf.inp.bak ww3_tp2.14/input/ww3_ounf.inp # +# ww3_tp2.14/work_OASACM5/restart.ww3 # +# ./bin/run_test -C OASIS -s OASACM5 -f -o netcdf -w work_OASACM5 # +# -i input_oasacm5 -p mpirun -n 4 ../model ww3_tp2.14 # +# ./bin/run_test -C OASIS -s OASACM6 -f -o netcdf -w work_OASACM6 # +# -i input_oasacm6 -p mpirun -n 4 ../model ww3_tp2.14 # # # # M. Accensi, Feb 2015 # # Ifremer Institute # -# Last Mod : Oct 2020 # +# Last Mod : Oct 2021 # # # ############################################################################# diff --git a/regtests/ww3_tp2.14/input/namelists_BREST.nml b/regtests/ww3_tp2.14/input/namelists_BREST.nml deleted file mode 100644 index 9216a3692..000000000 --- a/regtests/ww3_tp2.14/input/namelists_BREST.nml +++ /dev/null @@ -1,2 +0,0 @@ -&PSMC DTIME=10800., RFMAXD=36., LvSMC=2, NBISMC=0, CFLTM=0.1 / -END OF NAMELISTS diff --git a/regtests/ww3_tp2.14/input/oasis3-mct/lib/mct/.cvsignore b/regtests/ww3_tp2.14/input/oasis3-mct/lib/mct/.cvsignore deleted file mode 100644 index 49afb9b8d..000000000 --- a/regtests/ww3_tp2.14/input/oasis3-mct/lib/mct/.cvsignore +++ /dev/null @@ -1 +0,0 @@ -Makefile.conf config.log config.status config.h autom4te.cache diff --git a/regtests/ww3_tp2.14/input/oasis3-mct/lib/mct/doc/.cvsignore b/regtests/ww3_tp2.14/input/oasis3-mct/lib/mct/doc/.cvsignore deleted file mode 100644 index d6ff6a7a3..000000000 --- a/regtests/ww3_tp2.14/input/oasis3-mct/lib/mct/doc/.cvsignore +++ /dev/null @@ -1 +0,0 @@ -*.toc *.log *.dvi *.aux *.blg *.bbl *.pdf diff --git a/regtests/ww3_tp2.14/input/oasis3-mct/lib/mct/doc/texsrc/.cvsignore b/regtests/ww3_tp2.14/input/oasis3-mct/lib/mct/doc/texsrc/.cvsignore deleted file mode 100644 index 9d81d8f20..000000000 --- a/regtests/ww3_tp2.14/input/oasis3-mct/lib/mct/doc/texsrc/.cvsignore +++ /dev/null @@ -1 +0,0 @@ -*.F90 *.tex diff --git a/regtests/ww3_tp2.14/input/oasis3-mct/lib/mct/examples/climate_concur1/.cvsignore b/regtests/ww3_tp2.14/input/oasis3-mct/lib/mct/examples/climate_concur1/.cvsignore deleted file mode 100644 index 901ef75c8..000000000 --- a/regtests/ww3_tp2.14/input/oasis3-mct/lib/mct/examples/climate_concur1/.cvsignore +++ /dev/null @@ -1 +0,0 @@ -climate *.mod poe.* diff --git a/regtests/ww3_tp2.14/input/oasis3-mct/lib/mct/examples/climate_sequen1/.cvsignore b/regtests/ww3_tp2.14/input/oasis3-mct/lib/mct/examples/climate_sequen1/.cvsignore deleted file mode 100644 index 90747e204..000000000 --- a/regtests/ww3_tp2.14/input/oasis3-mct/lib/mct/examples/climate_sequen1/.cvsignore +++ /dev/null @@ -1 +0,0 @@ -MCT.* *.mod climate diff --git a/regtests/ww3_tp2.14/input/oasis3-mct/lib/mct/examples/simple/.cvsignore b/regtests/ww3_tp2.14/input/oasis3-mct/lib/mct/examples/simple/.cvsignore deleted file mode 100644 index 96170cb25..000000000 --- a/regtests/ww3_tp2.14/input/oasis3-mct/lib/mct/examples/simple/.cvsignore +++ /dev/null @@ -1 +0,0 @@ -twocon twoseq twosequn twoseqNB diff --git a/regtests/ww3_tp2.14/input/oasis3-mct/lib/mct/mct/.cvsignore b/regtests/ww3_tp2.14/input/oasis3-mct/lib/mct/mct/.cvsignore deleted file mode 100644 index edf6a4e0c..000000000 --- a/regtests/ww3_tp2.14/input/oasis3-mct/lib/mct/mct/.cvsignore +++ /dev/null @@ -1 +0,0 @@ -*.mod *_scratch.f Makefile.conf *.lst diff --git a/regtests/ww3_tp2.14/input/oasis3-mct/lib/mct/mpeu/.cvsignore b/regtests/ww3_tp2.14/input/oasis3-mct/lib/mct/mpeu/.cvsignore deleted file mode 100644 index 6594adcb7..000000000 --- a/regtests/ww3_tp2.14/input/oasis3-mct/lib/mct/mpeu/.cvsignore +++ /dev/null @@ -1 +0,0 @@ -*.mod mpeu Makefile.conf *.lst diff --git a/regtests/ww3_tp2.14/input/oasis3-mct/util/make_dir/cmplr.tmpl b/regtests/ww3_tp2.14/input/oasis3-mct/util/make_dir/cmplr.tmpl index b40fc4ad7..bfd08de42 100644 --- a/regtests/ww3_tp2.14/input/oasis3-mct/util/make_dir/cmplr.tmpl +++ b/regtests/ww3_tp2.14/input/oasis3-mct/util/make_dir/cmplr.tmpl @@ -24,10 +24,10 @@ CHAN = MPI1 # Paths for libraries, object files and binaries # # COUPLE : path for oasis3-mct main directory -COUPLE = $(WWATCH3_DIR)/../regtests/ww3_tp2.14/input/oasis3-mct +COUPLE = # # ARCHDIR : directory created when compiling -ARCHDIR = $(WWATCH3_DIR)/../regtests/ww3_tp2.14/work_oasis3-mct +ARCHDIR = # # NetCDF library NETCDF_INCLUDE = $(shell $(NETCDF_CONFIG) --cflags) diff --git a/regtests/ww3_tp2.14/input/oasis3-mct/util/make_dir/make.inc b/regtests/ww3_tp2.14/input/oasis3-mct/util/make_dir/make.inc.tmpl similarity index 81% rename from regtests/ww3_tp2.14/input/oasis3-mct/util/make_dir/make.inc rename to regtests/ww3_tp2.14/input/oasis3-mct/util/make_dir/make.inc.tmpl index d98a83253..9aaa891d9 100644 --- a/regtests/ww3_tp2.14/input/oasis3-mct/util/make_dir/make.inc +++ b/regtests/ww3_tp2.14/input/oasis3-mct/util/make_dir/make.inc.tmpl @@ -10,6 +10,6 @@ # Note: Choose one of these includes files and modify it according to your # local settings. Replace the currently active file with your own. # -include $(WWATCH3_DIR)/../regtests/ww3_tp2.14/input/oasis3-mct/util/make_dir/cmplr +include /util/make_dir/cmplr # ### End User configurable options ### diff --git a/regtests/ww3_tp2.14/input/prep_env.sh b/regtests/ww3_tp2.14/input/prep_env.sh deleted file mode 100755 index d4f51a1b6..000000000 --- a/regtests/ww3_tp2.14/input/prep_env.sh +++ /dev/null @@ -1,102 +0,0 @@ -#!/bin/bash -e - -if [ $# -ne 4 ] -then - echo "need four arguments:" - echo '$1 : path_i' - echo '$2 : path_w' - echo '$3 : complr' - echo '$4 : switch' - exit 1 -fi - -path_i=$1 -path_w=$2 -cmplr=$3 -swtstr=$4 - -echo '' -echo ' setup coupling environment' -export WWATCH3_DIR=`grep WWATCH3_DIR $WWATCH3_ENV | awk -F' ' '{print $2}' ` -export WWATCH3_CC=`grep WWATCH3_CC $WWATCH3_ENV | awk -F' ' '{print $2}' ` - -echo ' compile oasis coupler' -cd $path_i/oasis3-mct/util/make_dir -if [ $cmplr ] -then - echo ' ' - echo ' Setup cmplr file' - if [ "$cmplr" == "mpt" ] || [ "$cmplr" == "mpt_debug" ] || \ - [ "$cmplr" == "datarmor_mpt" ] || [ "$cmplr" == "datarmor_mpt_debug" ] || \ - [ "$cmplr" == "intel" ] || [ "$cmplr" == "intel_debug" ] || \ - [ "$cmplr" == "so_intel" ] || [ "$cmplr" == "so_intel_debug" ] || \ - [ "$cmplr" == "datarmor_intel" ] || [ "$cmplr" == "datarmor_intel_debug" ] || \ - [ "$cmplr" == "gnu" ] || [ "$cmplr" == "gnu_debug" ] || \ - [ "$cmplr" == "hera.intel" ] || [ "$cmplr" == "orion.intel" ] || \ - [ "$cmplr" == "hera.gnu" ] || [ "$cmplr" == "jet.intel" ] || \ - [ "$cmplr" == "stampede.intel" ] || [ "$cmplr" == "gaea.intel" ] || \ - [ "$cmplr" == "cheyenne.intel" ] || [ "$cmplr" == "cheyenne.gnu" ] || \ - [ "$cmplr" == "s4.intel" ] || \ - [ "$cmplr" == "wcoss_cray" ] || [ "$cmplr" == "wcoss_dell_p3" ] || \ - [ "$cmplr" == "datarmor_gnu" ] || [ "$cmplr" == "datarmor_gnu_debug" ] || \ - [ "$cmplr" == "pgi" ] || [ "$cmplr" == "pgi_debug" ] || \ - [ "$cmplr" == "datarmor_pgi" ] || [ "$cmplr" == "datarmor_pgi_debug" ] || \ - [ "$cmplr" == "ukmo_cray" ] || [ "$cmplr" == "ukmo_cray_debug" ] || \ - [ "$cmplr" == "ukmo_cray_gnu" ] || [ "$cmplr" == "ukmo_cray_gnu_debug" ]; then - source $WWATCH3_DIR/bin/cmplr.env - # shortlist optl - alloptl=( $optl ) - for ioptl in $(seq 2 ${#alloptl[@]}); do - optls="${optls}${alloptl[$ioptl]} " - done - # shortlist optc - alloptc=( $optc ) - for ioptc in $(seq 3 ${#alloptc[@]}); do - optcs="${optcs}${alloptc[$ioptc]} " - done - # shorten comp_mpi - comp_mpi_exe="$(echo $comp_mpi | awk -F' ' '{print $1}')" - # sed cmplr.tmpl - sed -e "s//$optcs/" -e "s//$optls/" -e "s//$comp_mpi/" -e "s//$WWATCH3_CC/" -e "s//$comp_mpi_exe/" cmplr.tmpl > cmplr - echo " sed cmplr.tmpl => cmplr" - else - echo "ERROR: cmplr.$cmplr not found" 2>&1 - exit 1 - fi - chmod 775 cmplr -fi - -make realclean -f TopMakefileOasis3 > $path_w/oasis_clean.out -make -f TopMakefileOasis3 > $path_w/oasis_make.out - -echo ' compile toy model' -cd $path_i/toy -make clean > $path_w/toy_clean.out -make > $path_w/toy_make.out - -echo ' copy oasis coupler inputs' -cd $path_w -ln -sf ../input/namcouple.$swtstr namcouple - -echo ' copy toy model inputs' -cd $path_w -if [ -f ../input/toy/r-toy.nc.$swtstr ]; then - cp ../input/toy/r-toy.nc.$swtstr r-toy.nc -else - echo "WARNING: model input ../input/toy/r-toy.nc.$swtstr does not exist" -fi -ln -sf ../input/toy/grid_toy_model.nc . -ln -sf ../input/toy/toy_coupled_field.nc.$swtstr toy_coupled_field.nc -ln -sf ../input/TOYNAMELIST.nam.$swtstr TOYNAMELIST.nam -ln -sf ../input/toy/toy_model . - -echo ' copy ww3 model inputs' -cd $path_w -if [ -f ../input/r-ww3.nc.$swtstr ]; then - cp ../input/r-ww3.nc.$swtstr r-ww3.nc -else - echo "WARNING: model input ../input/toy/r-ww3.nc.$swtstr does not exist" -fi -cp ../input/ww3_shel_${swtstr}.inp ../input/ww3_shel.inp -cp ../input/ww3_shel_${swtstr}.nml ../input/ww3_shel.nml -echo '' diff --git a/regtests/ww3_tp2.14/input/toy/Makefile b/regtests/ww3_tp2.14/input/toy/Makefile.tmpl similarity index 97% rename from regtests/ww3_tp2.14/input/toy/Makefile rename to regtests/ww3_tp2.14/input/toy/Makefile.tmpl index 03409fe25..c080f1cdf 100755 --- a/regtests/ww3_tp2.14/input/toy/Makefile +++ b/regtests/ww3_tp2.14/input/toy/Makefile.tmpl @@ -1,5 +1,5 @@ # -include $(WWATCH3_DIR)/../regtests/ww3_tp2.14/input/oasis3-mct/util/make_dir/make.inc +include /util/make_dir/make.inc # LIBPSMILE = $(ARCHDIR)/lib/libpsmile.${CHAN}.a $(ARCHDIR)/lib/libmct.a $(ARCHDIR)/lib/libmpeu.a $(ARCHDIR)/lib/libscrip.a # diff --git a/regtests/ww3_tp2.14/input/TOYNAMELIST.nam.OASACM b/regtests/ww3_tp2.14/input_oasacm/TOYNAMELIST.nam similarity index 100% rename from regtests/ww3_tp2.14/input/TOYNAMELIST.nam.OASACM rename to regtests/ww3_tp2.14/input_oasacm/TOYNAMELIST.nam diff --git a/regtests/ww3_tp2.14/input/namcouple.OASACM b/regtests/ww3_tp2.14/input_oasacm/namcouple similarity index 100% rename from regtests/ww3_tp2.14/input/namcouple.OASACM rename to regtests/ww3_tp2.14/input_oasacm/namcouple diff --git a/regtests/ww3_tp2.14/input/namelists_IROISE.nml b/regtests/ww3_tp2.14/input_oasacm/namelists_IROISE.nml similarity index 100% rename from regtests/ww3_tp2.14/input/namelists_IROISE.nml rename to regtests/ww3_tp2.14/input_oasacm/namelists_IROISE.nml diff --git a/regtests/ww3_tp2.14/input_oasacm/prep_env.sh b/regtests/ww3_tp2.14/input_oasacm/prep_env.sh new file mode 100755 index 000000000..ee03d4033 --- /dev/null +++ b/regtests/ww3_tp2.14/input_oasacm/prep_env.sh @@ -0,0 +1,101 @@ +#!/bin/bash -e + +if [ $# -ne 4 ] +then + echo "need four arguments:" + echo '$1 : path_i' + echo '$2 : path_w' + echo '$3 : complr' + echo '$4 : switch' + exit 1 +fi + +path_i=$1 +path_w=$2 +cmplr=$3 +swtstr=$4 + +echo '' +echo ' setup coupling environment' +export WWATCH3_DIR=`grep WWATCH3_DIR $WWATCH3_ENV | awk -F' ' '{print $2}' ` +export WWATCH3_CC=`grep WWATCH3_CC $WWATCH3_ENV | awk -F' ' '{print $2}' ` + + +echo ' copy oasis and toy in $path_w' +cp -r $path_i/../input/toy $path_w/ +cp -r $path_i/../input/oasis3-mct $path_w/ + + +echo ' Setup oasis cmplr file' +cd $path_w/oasis3-mct/util/make_dir +source $WWATCH3_DIR/bin/cmplr.env +# shortlist optl +alloptl=( $optl ) +for ioptl in $(seq 2 ${#alloptl[@]}); do + optls="${optls}${alloptl[$ioptl]} " +done +# shortlist optc +alloptc=( $optc ) +for ioptc in $(seq 3 ${#alloptc[@]}); do + optcs="${optcs}${alloptc[$ioptc]} " +done +# shorten comp_mpi +comp_mpi_exe="$(echo $comp_mpi | awk -F' ' '{print $1}')" +# sed cmplr.tmpl +sed -e "s::$path_w/oasis3-mct:" \ + -e "s::$path_w/work_oasis3-mct:" \ + -e "s//$optcs/" -e "s//$optls/" \ + -e "s//$comp_mpi/" -e "s//$comp_mpi_exe/" \ + -e "s//$WWATCH3_CC/" cmplr.tmpl > cmplr +echo " sed cmplr.tmpl => cmplr" +chmod 775 cmplr + + +echo ' setup oasis make.inc file' +sed -e "s::$path_w/oasis3-mct:" make.inc.tmpl > make.inc + + +echo ' compile oasis coupler' +make realclean -f TopMakefileOasis3 > $path_w/oasis_clean.out +make -f TopMakefileOasis3 > $path_w/oasis_make.out + + +echo ' setup toy Makefile' +cd $path_w/toy +sed -e "s::$path_w/oasis3-mct:" Makefile.tmpl > Makefile + + +echo ' compile toy model' +make clean > $path_w/toy_clean.out +make > $path_w/toy_make.out + + +echo ' copy oasis coupler inputs' +cp $path_i/namcouple $path_w/namcouple + + +echo ' copy toy model inputs' +if [ -f $path_w/toy/r-toy.nc.$swtstr ]; then + cp $path_w/toy/r-toy.nc.$swtstr $path_w/r-toy.nc +else + echo "WARNING: model input $path_w/toy/r-toy.nc.$swtstr does not exist" +fi + +cp $path_w/toy/grid_toy_model.nc $path_w/ +cp $path_w/toy/toy_coupled_field.nc.$swtstr $path_w/toy_coupled_field.nc +cp $path_w/toy/toy_model $path_w/ + +cp $path_i/TOYNAMELIST.nam $path_w/TOYNAMELIST.nam + + +echo ' copy ww3 model inputs' +cd $path_w +if [ -f $path_i/r-ww3.nc ]; then + cp $path_i/r-ww3.nc $path_w/r-ww3.nc +else + echo "WARNING: model input $path_i/toy/r-ww3.nc does not exist" +fi + + + +echo '' diff --git a/regtests/ww3_tp2.14/input/switch_OASACM b/regtests/ww3_tp2.14/input_oasacm/switch_OASACM similarity index 100% rename from regtests/ww3_tp2.14/input/switch_OASACM rename to regtests/ww3_tp2.14/input_oasacm/switch_OASACM diff --git a/regtests/ww3_tp2.14/input/ww3_grid.inp b/regtests/ww3_tp2.14/input_oasacm/ww3_grid.inp similarity index 100% rename from regtests/ww3_tp2.14/input/ww3_grid.inp rename to regtests/ww3_tp2.14/input_oasacm/ww3_grid.inp diff --git a/regtests/ww3_tp2.14/input/ww3_grid.nml b/regtests/ww3_tp2.14/input_oasacm/ww3_grid.nml similarity index 99% rename from regtests/ww3_tp2.14/input/ww3_grid.nml rename to regtests/ww3_tp2.14/input_oasacm/ww3_grid.nml index b426c59b1..9b8394098 100644 --- a/regtests/ww3_tp2.14/input/ww3_grid.nml +++ b/regtests/ww3_tp2.14/input_oasacm/ww3_grid.nml @@ -137,7 +137,7 @@ ! -------------------------------------------------------------------- ! &GRID_NML GRID%NAME = 'IROISE 1.5KM' - GRID%NML = '../input/namelists_IROISE.nml' + GRID%NML = '../input_oasacm/namelists_IROISE.nml' GRID%TYPE = 'RECT' GRID%COORD = 'SPHE' GRID%CLOS = 'NONE' diff --git a/regtests/ww3_tp2.14/input_oasacm/ww3_ounf.inp b/regtests/ww3_tp2.14/input_oasacm/ww3_ounf.inp new file mode 100755 index 000000000..b8bbf80f6 --- /dev/null +++ b/regtests/ww3_tp2.14/input_oasacm/ww3_ounf.inp @@ -0,0 +1,41 @@ +$ -------------------------------------------------------------------- $ +$ WAVEWATCH III Grid output post-processing $ +$--------------------------------------------------------------------- $ +$ First output time (yyyymmdd hhmmss), increment of output (s), +$ and number of output times. +$ + 20080310 000000 180 100 +$ +$ Output request flags identifying fields as in ww3_shel.inp. See that +$ file for a full documentation of field output options. Namelist type +$ selection is used here (for alternative F/T flags, see ww3_shel.inp). +$ + N + HS FP DIR DP CHA UST DPT CUR WND +$ +$--------------------------------------------------------------------- $ +$ netCDF version [3,4] +$ and variable type 4 [2 = SHORT, 3 = it depends , 4 = REAL] +$ swell partitions [0 1 2 3 4 5] +$ variables in same file [T] or not [F] +$ + 3 4 + 0 + T +$ +$ -------------------------------------------------------------------- $ +$ File prefix +$ number of characters in date [0(nodate),4(yearly),6(monthly),8(daily),10(hourly)] +$ IX and IY ranges [regular:IX NX IY NY DX DY, unstructured:IP NP DP DP] +$ +ww3. +6 +1 10000 1 10000 +$ +$ For each field and time a new file is generated with the file name +$ ww3.date_xxx.nc , where date is a conventional time indicator with S3 +$ characters, and xxx is a field identifier. +$ +$ -------------------------------------------------------------------- $ +$ End of input file $ +$ -------------------------------------------------------------------- $ diff --git a/regtests/ww3_tp2.14/input_oasacm/ww3_ounf.nml b/regtests/ww3_tp2.14/input_oasacm/ww3_ounf.nml new file mode 100644 index 000000000..fc0386ff8 --- /dev/null +++ b/regtests/ww3_tp2.14/input_oasacm/ww3_ounf.nml @@ -0,0 +1,60 @@ +! -------------------------------------------------------------------- ! +! WAVEWATCH III ww3_ounf.nml - Grid output post-processing ! +! -------------------------------------------------------------------- ! + +! -------------------------------------------------------------------- ! +! Define the output fields to postprocess via FIELD_NML namelist +! +! * the detailed list of field names FIELD%LIST is given in ww3_shel.nml +! DPT CUR WND AST WLV ICE IBG D50 IC1 IC5 +! HS LM T02 T0M1 T01 FP DIR SPR DP HIG +! EF TH1M STH1M TH2M STH2M WN +! PHS PTP PLP PDIR PSPR PWS PDP PQP PPE PGW PSW PTM10 PT01 PT02 PEP TWS PNR +! UST CHA CGE FAW TAW TWA WCC WCF WCH WCM FWS +! SXY TWO BHD FOC TUS USS P2S USF P2L TWI FIC +! ABR UBR BED FBB TBB +! MSS MSC WL02 AXT AYT AXY +! DTD FC CFX CFD CFK +! U1 U2 +! +! * namelist must be terminated with / +! * definitions & defaults: +! FIELD%TIMESTART = '19000101 000000' ! Stop date for the output field +! FIELD%TIMESTRIDE = '0' ! Time stride for the output field +! FIELD%TIMESTOP = '29001231 000000' ! Stop date for the output field +! FIELD%TIMECOUNT = '1000000000' ! Number of time steps +! FIELD%TIMESPLIT = 6 ! [0(nodate),4(yearly),6(monthly),8(daily),10(hourly)] +! FIELD%LIST = 'unset' ! List of output fields +! FIELD%PARTITION = '0 1 2 3' ! List of wave partitions ['0 1 2 3 4 5'] +! FIELD%SAMEFILE = T ! All the variables in the same file [T|F] +! FIELD%TYPE = 3 ! [2 = SHORT, 3 = it depends , 4 = REAL] +! -------------------------------------------------------------------- ! +&FIELD_NML + FIELD%TIMESTART = '20080310 000000' + FIELD%TIMESTRIDE = '180' + FIELD%TIMECOUNT = '100' + FIELD%LIST = 'HS FP DIR DP CHA UST DPT CUR WND' + FIELD%PARTITION = '0' + FIELD%TYPE = 4 +/ + +! -------------------------------------------------------------------- ! +! Define the content of the output file via FILE_NML namelist +! +! * namelist must be terminated with / +! * definitions & defaults: +! FILE%PREFIX = 'ww3.' ! Prefix for output file name +! FILE%NETCDF = 3 ! Netcdf version [3|4] +! FILE%IX0 = 1 ! First X-axis or node index +! FILE%IXN = 1000000000 ! Last X-axis or node index +! FILE%IY0 = 1 ! First Y-axis index +! FILE%IYN = 1000000000 ! Last Y-axis index +! -------------------------------------------------------------------- ! +&FILE_NML + FILE%IXN = 10000 + FILE%IYN = 10000 +/ + +! -------------------------------------------------------------------- ! +! WAVEWATCH III - end of namelist ! +! -------------------------------------------------------------------- ! diff --git a/regtests/ww3_tp2.14/input/ww3_shel_OASACM.inp b/regtests/ww3_tp2.14/input_oasacm/ww3_shel.inp similarity index 100% rename from regtests/ww3_tp2.14/input/ww3_shel_OASACM.inp rename to regtests/ww3_tp2.14/input_oasacm/ww3_shel.inp diff --git a/regtests/ww3_tp2.14/input/ww3_shel_OASACM.nml b/regtests/ww3_tp2.14/input_oasacm/ww3_shel.nml similarity index 95% rename from regtests/ww3_tp2.14/input/ww3_shel_OASACM.nml rename to regtests/ww3_tp2.14/input_oasacm/ww3_shel.nml index f134548da..65c1784fb 100644 --- a/regtests/ww3_tp2.14/input/ww3_shel_OASACM.nml +++ b/regtests/ww3_tp2.14/input_oasacm/ww3_shel.nml @@ -44,6 +44,8 @@ ! INPUT%FORCING%WATER_LEVELS = 'F' ! INPUT%FORCING%CURRENTS = 'F' ! INPUT%FORCING%WINDS = 'F' +! INPUT%FORCING%ATM_MOMENTUM = 'F' +! INPUT%FORCING%AIR_DENSITY = 'F' ! INPUT%FORCING%ICE_CONC = 'F' ! INPUT%FORCING%ICE_PARAM1 = 'F' ! INPUT%FORCING%ICE_PARAM2 = 'F' @@ -94,9 +96,11 @@ ! T T 1 5 WLV WLV Water levels. ! T T 1 6 ICE ICE Ice concentration. ! T T 1 7 IBG IBG Iceberg-induced damping. -! T T 1 8 D50 D50 Median sediment grain size. -! T T 1 9 IC1 IC1 Ice thickness. -! T T 1 10 IC5 IC5 Ice flow diameter. +! T T 1 8 TAUA TAU Atm. momentum. +! T T 1 9 RHOAIR RHO Air density. +! T T 1 10 D50 D50 Median sediment grain size. +! T T 1 11 IC1 IC1 Ice thickness. +! T T 1 12 IC5 IC5 Ice flow diameter. ! ------------------------------------------------- ! 2 Standard mean wave Parameters ! ------------------------------------------------- @@ -117,6 +121,7 @@ ! T T 2 15 HMAXD SDMH St Dev of MXC (STE) ! T T 2 16 HCMAXD SDMHC St Dev of MXHC (STE) ! F T 2 17 WBT WBT Domiant wave breaking probability bT +! F F 2 18 FP0 TP Peak period (from peak freq) ! ------------------------------------------------- ! 3 Spectral Parameters (first 5) ! ------------------------------------------------- @@ -174,6 +179,7 @@ ! F F 6 9 P2SMS P2L Micro seism source term ! F F 6 10 TAUICE TWI Wave to sea ice stress ! F F 6 11 PHICE FIC Wave to sea ice energy flux +! F F 6 12 USSP USP Partitioned surface Stokes drift ! ------------------------------------------------- ! 7 Wave-bottom layer ! ------------------------------------------------- @@ -219,9 +225,14 @@ ! - Ice model : IC5 TWI ! - Received fields by ww3: ! - Ocean model : SSH CUR -! - Atmospheric model : WND +! - Atmospheric model : WND TAU RHO ! - Ice model : ICE IC1 IC5 ! +! * Coupling flag (T) or (F) at T+0 (extra fields in the restart needed) +! +! * extra fields to be written to the restart: +! - The list includes all fields sent by coupling exchange only +! ! * namelist must be terminated with / ! * definitions & defaults: ! TYPE%FIELD%LIST = 'unset' @@ -236,6 +247,8 @@ ! TYPE%PARTITION%FORMAT = T ! TYPE%COUPLING%SENT = 'unset' ! TYPE%COUPLING%RECEIVED = 'unset' +! TYPE%COUPLING%COUPLET0 = F +! TYPE%RESTART%EXTRA = 'unset' ! ! -------------------------------------------------------------------- ! &OUTPUT_TYPE_NML diff --git a/regtests/ww3_tp2.14/input/ww3_strt.inp b/regtests/ww3_tp2.14/input_oasacm/ww3_strt.inp similarity index 100% rename from regtests/ww3_tp2.14/input/ww3_strt.inp rename to regtests/ww3_tp2.14/input_oasacm/ww3_strt.inp diff --git a/regtests/ww3_tp2.14/input/TOYNAMELIST.nam.OASACM2 b/regtests/ww3_tp2.14/input_oasacm2/TOYNAMELIST.nam similarity index 100% rename from regtests/ww3_tp2.14/input/TOYNAMELIST.nam.OASACM2 rename to regtests/ww3_tp2.14/input_oasacm2/TOYNAMELIST.nam diff --git a/regtests/ww3_tp2.14/input/namcouple.OASACM2 b/regtests/ww3_tp2.14/input_oasacm2/namcouple similarity index 100% rename from regtests/ww3_tp2.14/input/namcouple.OASACM2 rename to regtests/ww3_tp2.14/input_oasacm2/namcouple diff --git a/regtests/ww3_tp2.14/input_oasacm2/namelists_IROISE.nml b/regtests/ww3_tp2.14/input_oasacm2/namelists_IROISE.nml new file mode 100644 index 000000000..8b5707b65 --- /dev/null +++ b/regtests/ww3_tp2.14/input_oasacm2/namelists_IROISE.nml @@ -0,0 +1 @@ +END OF NAMELISTS diff --git a/regtests/ww3_tp2.14/input_oasacm2/prep_env.sh b/regtests/ww3_tp2.14/input_oasacm2/prep_env.sh new file mode 100755 index 000000000..ee03d4033 --- /dev/null +++ b/regtests/ww3_tp2.14/input_oasacm2/prep_env.sh @@ -0,0 +1,101 @@ +#!/bin/bash -e + +if [ $# -ne 4 ] +then + echo "need four arguments:" + echo '$1 : path_i' + echo '$2 : path_w' + echo '$3 : complr' + echo '$4 : switch' + exit 1 +fi + +path_i=$1 +path_w=$2 +cmplr=$3 +swtstr=$4 + +echo '' +echo ' setup coupling environment' +export WWATCH3_DIR=`grep WWATCH3_DIR $WWATCH3_ENV | awk -F' ' '{print $2}' ` +export WWATCH3_CC=`grep WWATCH3_CC $WWATCH3_ENV | awk -F' ' '{print $2}' ` + + +echo ' copy oasis and toy in $path_w' +cp -r $path_i/../input/toy $path_w/ +cp -r $path_i/../input/oasis3-mct $path_w/ + + +echo ' Setup oasis cmplr file' +cd $path_w/oasis3-mct/util/make_dir +source $WWATCH3_DIR/bin/cmplr.env +# shortlist optl +alloptl=( $optl ) +for ioptl in $(seq 2 ${#alloptl[@]}); do + optls="${optls}${alloptl[$ioptl]} " +done +# shortlist optc +alloptc=( $optc ) +for ioptc in $(seq 3 ${#alloptc[@]}); do + optcs="${optcs}${alloptc[$ioptc]} " +done +# shorten comp_mpi +comp_mpi_exe="$(echo $comp_mpi | awk -F' ' '{print $1}')" +# sed cmplr.tmpl +sed -e "s::$path_w/oasis3-mct:" \ + -e "s::$path_w/work_oasis3-mct:" \ + -e "s//$optcs/" -e "s//$optls/" \ + -e "s//$comp_mpi/" -e "s//$comp_mpi_exe/" \ + -e "s//$WWATCH3_CC/" cmplr.tmpl > cmplr +echo " sed cmplr.tmpl => cmplr" +chmod 775 cmplr + + +echo ' setup oasis make.inc file' +sed -e "s::$path_w/oasis3-mct:" make.inc.tmpl > make.inc + + +echo ' compile oasis coupler' +make realclean -f TopMakefileOasis3 > $path_w/oasis_clean.out +make -f TopMakefileOasis3 > $path_w/oasis_make.out + + +echo ' setup toy Makefile' +cd $path_w/toy +sed -e "s::$path_w/oasis3-mct:" Makefile.tmpl > Makefile + + +echo ' compile toy model' +make clean > $path_w/toy_clean.out +make > $path_w/toy_make.out + + +echo ' copy oasis coupler inputs' +cp $path_i/namcouple $path_w/namcouple + + +echo ' copy toy model inputs' +if [ -f $path_w/toy/r-toy.nc.$swtstr ]; then + cp $path_w/toy/r-toy.nc.$swtstr $path_w/r-toy.nc +else + echo "WARNING: model input $path_w/toy/r-toy.nc.$swtstr does not exist" +fi + +cp $path_w/toy/grid_toy_model.nc $path_w/ +cp $path_w/toy/toy_coupled_field.nc.$swtstr $path_w/toy_coupled_field.nc +cp $path_w/toy/toy_model $path_w/ + +cp $path_i/TOYNAMELIST.nam $path_w/TOYNAMELIST.nam + + +echo ' copy ww3 model inputs' +cd $path_w +if [ -f $path_i/r-ww3.nc ]; then + cp $path_i/r-ww3.nc $path_w/r-ww3.nc +else + echo "WARNING: model input $path_i/toy/r-ww3.nc does not exist" +fi + + + +echo '' diff --git a/regtests/ww3_tp2.14/input/switch_OASACM2 b/regtests/ww3_tp2.14/input_oasacm2/switch_OASACM2 similarity index 100% rename from regtests/ww3_tp2.14/input/switch_OASACM2 rename to regtests/ww3_tp2.14/input_oasacm2/switch_OASACM2 diff --git a/regtests/ww3_tp2.14/input_oasacm2/ww3_grid.inp b/regtests/ww3_tp2.14/input_oasacm2/ww3_grid.inp new file mode 100755 index 000000000..e367379b4 --- /dev/null +++ b/regtests/ww3_tp2.14/input_oasacm2/ww3_grid.inp @@ -0,0 +1,276 @@ +$ -------------------------------------------------------------------- $ +$ WAVEWATCH III Grid preprocessor input file $ +$ -------------------------------------------------------------------- $ +$ Grid name (C*30, in quotes) +$ + 'IROISE 1.5KM' +$ +$ Frequency increment factor and first frequency (Hz) ---------------- $ +$ number of frequencies (wavenumbers) and directions +$ +1.1 0.0373 32 24 0. +$ +$ Set model flags ---------------------------------------------------- $ +$ - FLDRY Dry run (input/output only, no calculation). +$ - FLCX, FLCY Activate X and Y component of propagation. +$ - FLCTH, FLCK Activate direction and wavenumber shifts. +$ - FLSOU Activate source terms. +$ + F T T T T T +$ +$ Set time steps ----------------------------------------------------- $ +$ - Time step information (this information is always read) +$ maximum global time step, maximum CFL time step for x-y and +$ k-theta, minimum source term time step (all in seconds). +$ + 180. 45. 45. 10. +$ +$ Start of namelist input section ------------------------------------ $ +$ Starting with WAVEWATCH III version 2.00, the tunable parameters +$ for source terms, propagation schemes, and numerics are read using +$ namelists. Any namelist found in the folowing sections up to the +$ end-of-section identifier string (see below) is temporarily written +$ to ww3_grid.scratch, and read from there if necessary. Namelists +$ not needed for the given switch settings will be skipped +$ automatically, and the order of the namelists is immaterial. +$ As an example, namelist input to change SWELLF and ZWND in the +$ Tolman and Chalikov input would be +$ +$ &SIN2 SWELLF = 0.1, ZWND = 15. / +$ +$ Define constants in source terms ----------------------------------- $ +$ +$ Input - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +$ WAM-3 : Namelist SIN1 +$ CINP : Proportionality constant. +$ &SIN1 CINP= 0.25 / +$ Tolman and Chalikov : Namelist SIN2 +$ ZWND : Height of wind (m). +$ SWELLF : swell factor in (2.48). +$ STABSH, STABOF, CNEG, CPOS, FNEG : +$ c0, ST0, c1, c2 and f1 in . (2.63) +$ through (2.65) for definition of +$ effective wind speed (!/STAB2). +$ +$ Nonlinear interactions - - - - - - - - - - - - - - - - - - - - - - - +$ Discrete I.A. : Namelist SNL1 +$ LAMBDA : Lambda in source term. +$ NLPROP : C in sourc term. NOTE : default +$ value depends on other source +$ terms selected. +$ KDCONV : Factor before kd in Eq. (2.24). +$ KDMIN, SNLCS1, SNLCS2, SNLCS3 : +$ Minimum kd, and constants c1-3 +$ in depth scaling function. +$ Exact interactions : Namelist SNL2 +$ IQTYPE : Type of depth treatment +$ 1 : Deep water +$ 2 : Deep water / WAM scaling +$ 3 : Shallow water +$ TAILNL : Parametric tail power. +$ NDEPTH : Number of depths in for which +$ integration space is established. +$ Used for IQTYPE = 3 only +$ Namelist ANL2 +$ DEPTHS : Array with depths for NDEPTH = 3 +$ +$ Dissipation - - - - - - - - - - - - - - - - - - - - - - - - - - - - +$ WAM-3 : Namelist SDS1 +$ CDIS, APM : As in source term. +$ +$ Tolman and Chalikov : Namelist SDS2 +$ SDSA0, SDSA1, SDSA2, SDSB0, SDSB1, PHIMIN : +$ Constants a0, a1, a2, b0, b1 and +$ PHImin. +$ +$ Bottom friction - - - - - - - - - - - - - - - - - - - - - - - - - - +$ JONSWAP : Namelist SBT1 +$ GAMMA : As it says. +$ +$ Propagation schemes ------------------------------------------------ $ +$ First order : Namelist PRO1 +$ CFLTM : Maximum CFL number for refraction. +$ +$ UQ with diffusion : Namelist PRO2 +$ CFLTM : Maximum CFL number for refraction. +$ FLSOFT : Flag for 'soft' land boundaries. +$ DTIME : Swell age (s) in garden sprinkler +$ correction. If 0., all diffusion +$ switched off. If small non-zero +$ (DEFAULT !!!) only wave growth +$ diffusion. +$ LATMIN : Maximum latitude used in calc. of +$ strength of diffusion for prop. +$ +$ UQ with averaging : Namelist PRO3 +$ CFLTM : Maximum CFL number for refraction. +$ FLSOFT : Flag for 'soft' land boundaries. +$ WDTHCG : Tuning factor propag. direction. +$ WDTHTH : Tuning factor normal direction. +$ +$ UQ with divergence : Namelist PRO4 +$ CFLTM : Maximum CFL number for refraction. +$ FLSOFT : Flag for 'soft' land boundaries. +$ QTFAC : Tuning factor Eq. (3.41). +$ RSFAC : Tuning factor Eq. (3.42). +$ RNFAC : Tuning factor Eq. (3.43). +$ +$ Miscellaneous ------------------------------------------------------ $ +$ Misc. parameters : Namelist MISC +$ CICE0 : Ice concentration cut-off. +$ CICEN : Ice concentration cut-off. +$ XSEED : Xseed in seeding alg. (!/SEED). +$ FLAGTR : Indicating presence and type of +$ subgrid information : +$ 0 : No subgrid information. +$ 1 : Transparancies at cell boun- +$ daries between grid points. +$ 2 : Transp. at cell centers. +$ 3 : Like 1 with cont. ice. +$ 4 : Like 2 with cont. ice. +$ XP, XR, XFILT +$ Xp, Xr and Xf for the dynamic +$ integration scheme. +$ +$ In the 'Out of the box' test setup we run with sub-grid obstacles +$ and with continuous ice treatment. +$ +$ &MISC CICE0 = 0.25, CICEN = 0.75, FLAGTR = 4 / +$ +$ Mandatory string to identify end of namelist input section. +$ +END OF NAMELISTS +$ +$ Define grid -------------------------------------------------------- $ +$ Four records containing : +$ 1 NX, NY. As the outer grid lines are always defined as land +$ points, the minimum size is 3x3. +$ 2 Grid increments SX, SY (degr.or m) and scaling (division) factor. +$ If NX*SX = 360., latitudinal closure is applied. +$ 3 Coordinates of (1,1) (degr.) and scaling (division) factor. +$ 4 Limiting bottom depth (m) to discriminate between land and sea +$ points, minimum water depth (m) as allowed in model, unit number +$ of file with bottom depths, scale factor for bottom depths (mult.), +$ IDLA, IDFM, format for formatted read, FROM and filename. +$ IDLA : Layout indicator : +$ 1 : Read line-by-line bottom to top. +$ 2 : Like 1, single read statement. +$ 3 : Read line-by-line top to bottom. +$ 4 : Like 3, single read statement. +$ IDFM : format indicator : +$ 1 : Free format. +$ 2 : Fixed format with above format descriptor. +$ 3 : Unformatted. +$ FROM : file type parameter +$ 'UNIT' : open file by unit number only. +$ 'NAME' : open file by name and assign to unit. +$ +$ Example for longitude-latitude grid (switch !/LLG), for Cartesian +$ grid the unit is meters (NOT km). +$ + 'RECT' T 'NONE' + 103 119 + 0.019 0.0125 1. + -6.119 47.6375 1. + 0.0 1.0 20 -1. 1 1 '(20f10.2)' 'NAME' '../input/iro_1p5k.bot' +$ +$ If the above unit number equals 10, the bottom data is read from +$ this file and follows below (no intermediate comment lines allowed). +$ +$ 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 +$ +$ If sub-grid information is avalaible as indicated by FLAGTR above, +$ additional input to define this is needed below. In such cases a +$ field of fractional obstructions at or between grid points needs to +$ be supplied. First the location and format of the data is defined +$ by (as above) : +$ - Unit number of file (can be 10, and/or identical to bottem depth +$ unit), scale factor for fractional obstruction, IDLA, IDFM, +$ format for formatted read, FROM and filename +$ +$ 10 0.2 3 1 '(....)' 'NAME' 'obstr.inp' +$ +$ *** NOTE if this unit number is the same as the previous bottom +$ depth unit number, it is assumed that this is the same file +$ without further checks. *** +$ +$ If the above unit number equals 10, the bottom data is read from +$ this file and follows below (no intermediate comment lines allowed, +$ except between the two fields). +$ +$ 0 0 0 0 0 0 0 0 0 0 0 0 +$ 0 0 0 0 0 0 0 0 0 0 0 0 +$ 0 0 0 0 0 0 0 0 0 0 0 0 +$ 0 0 0 0 0 0 0 0 0 0 0 0 +$ 0 0 0 0 0 0 0 0 0 0 0 0 +$ 0 0 0 0 0 0 5 0 0 0 0 0 +$ 0 0 0 0 0 0 5 0 0 0 0 0 +$ 0 0 0 0 0 0 4 0 0 0 0 0 +$ 0 0 0 0 0 0 4 0 0 0 0 0 +$ 0 0 0 0 0 0 5 0 0 0 0 0 +$ 0 0 0 0 0 0 5 0 0 0 0 0 +$ 0 0 0 0 0 0 0 0 0 0 0 0 +$ +$ 0 0 0 0 0 0 0 0 0 0 0 0 +$ 0 0 0 0 0 0 0 0 0 0 0 0 +$ 0 0 0 0 0 0 0 0 0 0 0 0 +$ 0 0 0 0 0 0 0 0 0 0 0 0 +$ 0 0 0 0 0 0 0 0 5 5 5 0 +$ 0 0 0 0 0 0 0 0 0 0 0 0 +$ 0 0 0 0 0 0 0 0 0 0 0 0 +$ 0 0 0 0 0 0 0 0 0 0 0 0 +$ 0 0 0 0 0 0 0 0 0 0 0 0 +$ 0 0 0 0 0 0 0 0 0 0 0 0 +$ 0 0 0 0 0 0 0 0 0 0 0 0 +$ 0 0 0 0 0 0 0 0 0 0 0 0 +$ +$ *** NOTE size of fields is always NX * NY *** +$ + 10 3 1 '(....)' 'PART' 'mapsta.inp' +$ *** NOTE size of fields is always NX * NY *** +$ +$ Input boundary points ---------------------------------------------- $ +$ An unlimited number of lines identifying points at which input +$ boundary conditions are to be defined. If the actual input data is +$ not defined in the actual wave model run, the initial conditions +$ will be applied as constant boundary conditions. Each line contains: +$ Discrete grid counters (IX,IY) of the active point and a +$ connect flag. If this flag is true, and the present and previous +$ point are on a grid line or diagonal, all intermediate points +$ are also defined as boundary points. +$ + 103 86 F + 103 119 T + 1 119 T + 1 1 T + 103 1 T + 103 11 T +$ +$ Close list by defining point (0,0) (mandatory) +$ + 0 0 F +$ Excluded grid points from segment data ( FROM != PART ) +$ First defined as lines, identical to the definition of the input +$ boundary points, and closed the same way. +$ + 0 0 F +$ +$ Second, define a point in a closed body of sea points to remove +$ the entire body os sea points. Also close by point (0,0) +$ + 0 0 +$ +$ Output boundary points --------------------------------------------- $ +$ Output boundary points are defined as a number of straight lines, +$ defined by its starting point (X0,Y0), increments (DX,DY) and number +$ of points. A negative number of points starts a new output file. +$ Note that this data is only generated if requested by the actual +$ program. Example again for spherical grid in degrees. +$ +$ Close list by defining line with 0 points (mandatory) +$ + 0. 0. 0. 0. 0 +$ +$ -------------------------------------------------------------------- $ +$ End of input file $ +$ -------------------------------------------------------------------- $ diff --git a/regtests/ww3_tp2.14/input_oasacm2/ww3_grid.nml b/regtests/ww3_tp2.14/input_oasacm2/ww3_grid.nml new file mode 100644 index 000000000..db4314d17 --- /dev/null +++ b/regtests/ww3_tp2.14/input_oasacm2/ww3_grid.nml @@ -0,0 +1,276 @@ +! -------------------------------------------------------------------- ! +! WAVEWATCH III - ww3_grid.nml - Grid pre-processing ! +! -------------------------------------------------------------------- ! + +! -------------------------------------------------------------------- ! +! Define the spectrum parameterization via SPECTRUM_NML namelist +! +! * namelist must be terminated with / +! * definitions & defaults: +! SPECTRUM%XFR = 0. ! frequency increment +! SPECTRUM%FREQ1 = 0. ! first frequency (Hz) +! SPECTRUM%NK = 0 ! number of frequencies (wavenumbers) +! SPECTRUM%NTH = 0 ! number of direction bins +! SPECTRUM%THOFF = 0. ! relative offset of first direction [-0.5,0.5] +! -------------------------------------------------------------------- ! +&SPECTRUM_NML + SPECTRUM%XFR = 1.1 + SPECTRUM%FREQ1 = 0.0373 + SPECTRUM%NK = 32 + SPECTRUM%NTH = 24 +/ + +! -------------------------------------------------------------------- ! +! Define the run parameterization via RUN_NML namelist +! +! * namelist must be terminated with / +! * definitions & defaults: +! RUN%FLDRY = F ! dry run (I/O only, no calculation) +! RUN%FLCX = F ! x-component of propagation +! RUN%FLCY = F ! y-component of propagation +! RUN%FLCTH = F ! direction shift +! RUN%FLCK = F ! wavenumber shift +! RUN%FLSOU = F ! source terms +! -------------------------------------------------------------------- ! +&RUN_NML + RUN%FLCX = T + RUN%FLCY = T + RUN%FLCTH = T + RUN%FLCK = T + RUN%FLSOU = T +/ + +! -------------------------------------------------------------------- ! +! Define the timesteps parameterization via TIMESTEPS_NML namelist +! +! * It is highly recommended to set up time steps which are multiple +! between them. +! +! * The first time step to calculate is the maximum CFL time step +! which depend on the lowest frequency FREQ1 previously set up and the +! lowest spatial grid resolution in meters DXY. +! reminder : 1 degree=60minutes // 1minute=1mile // 1mile=1.852km +! The formula for the CFL time is : +! Tcfl = DXY / (G / (FREQ1*4*Pi) ) with the constants Pi=3,14 and G=9.8m/s²; +! DTXY ~= 90% Tcfl +! DTMAX ~= 3 * DTXY (maximum global time step limit) +! +! * The refraction time step depends on how strong can be the current velocities +! on your grid : +! DTKTH ~= DTMAX / 2 ! in case of no or light current velocities +! DTKTH ~= DTMAX / 10 ! in case of strong current velocities +! +! * The source terms time step is usually defined between 5s and 60s. +! A common value is 10s. +! DTMIN ~= 10 +! +! * namelist must be terminated with / +! * definitions & defaults: +! TIMESTEPS%DTMAX = 0. ! maximum global time step (s) +! TIMESTEPS%DTXY = 0. ! maximum CFL time step for x-y (s) +! TIMESTEPS%DTKTH = 0. ! maximum CFL time step for k-th (s) +! TIMESTEPS%DTMIN = 0. ! minimum source term time step (s) +! -------------------------------------------------------------------- ! +&TIMESTEPS_NML + TIMESTEPS%DTMAX = 180. + TIMESTEPS%DTXY = 45. + TIMESTEPS%DTKTH = 45. + TIMESTEPS%DTMIN = 10. +/ + +! -------------------------------------------------------------------- ! +! Define the grid to preprocess via GRID_NML namelist +! +! * the tunable parameters for source terms, propagation schemes, and +! numerics are read using namelists. +! * Any namelist found in the folowing sections is temporarily written +! to param.scratch, and read from there if necessary. +! * The order of the namelists is immaterial. +! * Namelists not needed for the given switch settings will be skipped +! automatically +! +! * grid type can be : +! 'RECT' : rectilinear +! 'CURV' : curvilinear +! 'UNST' : unstructured (triangle-based) +! +! * coordinate system can be : +! 'SPHE' : Spherical (degrees) +! 'CART' : Cartesian (meters) +! +! * grid closure can only be applied in spherical coordinates +! +! * grid closure can be : +! 'NONE' : No closure is applied +! 'SMPL' : Simple grid closure. Grid is periodic in the +! : i-index and wraps at i=NX+1. In other words, +! : (NX+1,J) => (1,J). A grid with simple closure +! : may be rectilinear or curvilinear. +! 'TRPL' : Tripole grid closure : Grid is periodic in the +! : i-index and wraps at i=NX+1 and has closure at +! : j=NY+1. In other words, (NX+1,J<=NY) => (1,J) +! : and (I,NY+1) => (NX-I+1,NY). Tripole +! : grid closure requires that NX be even. A grid +! : with tripole closure must be curvilinear. +! +! * The coastline limit depth is the value which distinguish the sea +! points to the land points. All the points with depth values (ZBIN) +! greater than this limit (ZLIM) will be considered as excluded points +! and will never be wet points, even if the water level grows over. +! It can only overwrite the status of a sea point to a land point. +! The value must have a negative value under the mean sea level +! +! * The minimum water depth allowed to compute the model is the absolute +! depth value (DMIN) used in the model if the input depth is lower to +! avoid the model to blow up. +! +! * namelist must be terminated with / +! * definitions & defaults: +! GRID%NAME = 'unset' ! grid name (30 char) +! GRID%NML = 'namelists.nml' ! namelists filename +! GRID%TYPE = 'unset' ! grid type +! GRID%COORD = 'unset' ! coordinate system +! GRID%CLOS = 'unset' ! grid closure +! +! GRID%ZLIM = 0. ! coastline limit depth (m) +! GRID%DMIN = 0. ! abs. minimum water depth (m) +! -------------------------------------------------------------------- ! +&GRID_NML + GRID%NAME = 'IROISE 1.5KM' + GRID%NML = '../input_oasacm2/namelists_IROISE.nml' + GRID%TYPE = 'RECT' + GRID%COORD = 'SPHE' + GRID%CLOS = 'NONE' + GRID%ZLIM = 0.0 + GRID%DMIN = 1.0 +/ + +! -------------------------------------------------------------------- ! +! Define the rectilinear grid type via RECT_NML namelist +! - only for RECT grids - +! +! * The minimum grid size is 3x3. +! +! * If the grid increments SX and SY are given in minutes of arc, the scaling +! factor SF must be set to 60. to provide an increment factor in degree. +! +! * If CSTRG='SMPL', then SX is forced to 360/NX. +! +! * value <= value_read / scale_fac +! +! * namelist must be terminated with / +! * definitions & defaults: +! RECT%NX = 0 ! number of points along x-axis +! RECT%NY = 0 ! number of points along y-axis +! +! RECT%SX = 0. ! grid increment along x-axis +! RECT%SY = 0. ! grid increment along y-axis +! RECT%SF = 1. ! scaling division factor for x-y axis +! +! RECT%X0 = 0. ! x-coordinate of lower-left corner (deg) +! RECT%Y0 = 0. ! y-coordinate of lower-left corner (deg) +! RECT%SF0 = 1. ! scaling division factor for x0,y0 coord +! -------------------------------------------------------------------- ! +&RECT_NML + RECT%NX = 103 + RECT%NY = 119 + RECT%SX = 0.019 + RECT%SY = 0.0125 + RECT%X0 = -6.119 + RECT%Y0 = 47.6375 +/ + +! -------------------------------------------------------------------- ! +! Define the depth to preprocess via DEPTH_NML namelist +! - for RECT and CURV grids - +! +! * if no obstruction subgrid, need to set &MISC FLAGTR = 0 +! +! * The depth value must have negative values under the mean sea level +! +! * value <= value_read * scale_fac +! +! * IDLA : Layout indicator : +! 1 : Read line-by-line bottom to top. (default) +! 2 : Like 1, single read statement. +! 3 : Read line-by-line top to bottom. +! 4 : Like 3, single read statement. +! * IDFM : format indicator : +! 1 : Free format. (default) +! 2 : Fixed format. +! 3 : Unformatted. +! * FORMAT : element format to read : +! '(....)' : auto detected (default) +! '(f10.6)' : float type +! +! * Example : +! IDF SF IDLA IDFM FORMAT FILENAME +! 50 0.001 1 1 '(....)' 'GLOB-30M.bot' +! +! * namelist must be terminated with / +! * definitions & defaults: +! DEPTH%SF = 1. ! scale factor +! DEPTH%FILENAME = 'unset' ! filename +! DEPTH%IDF = 50 ! file unit number +! DEPTH%IDLA = 1 ! layout indicator +! DEPTH%IDFM = 1 ! format indicator +! DEPTH%FORMAT = '(....)' ! formatted read format +! -------------------------------------------------------------------- ! +&DEPTH_NML + DEPTH%SF = -1. + DEPTH%FILENAME = '../input/iro_1p5k.bot' + DEPTH%FORMAT = '(20f10.2)' +/ + +! -------------------------------------------------------------------- ! +! Define the input boundary points via INBND_COUNT_NML and +! INBND_POINT_NML namelist +! - for RECT, CURV and UNST grids - +! +! * If no mask defined, INBOUND can be used +! +! * If the actual input data is not defined in the actual wave model run +! the initial conditions will be applied as constant boundary conditions. +! +! * The number of points is defined by INBND_COUNT +! +! * The points must start from index 1 to N +! +! * Each line contains: +! Discrete grid counters (IX,IY) of the active point and a +! connect flag. If this flag is true, and the present and previous +! point are on a grid line or diagonal, all intermediate points +! are also defined as boundary points. +! +! * Included point : +! grid points from segment data +! Defines as lines identifying points at which +! input boundary conditions are to be defined. +! +! * namelist must be terminated with / +! * definitions & defaults: +! INBND_COUNT%N_POINT = 0 ! number of segments +! +! INBND_POINT(I)%X_INDEX = 0 ! x index included point +! INBND_POINT(I)%Y_INDEX = 0 ! y index included point +! INBND_POINT(I)%CONNECT = F ! connect flag +! +! OR +! INBND_POINT(I) = 0 0 F ! included point +! -------------------------------------------------------------------- ! +&INBND_COUNT_NML + INBND_COUNT%N_POINT = 6 +/ + +&INBND_POINT_NML + INBND_POINT(1) = 103 86 F + INBND_POINT(2) = 103 119 T + INBND_POINT(3) = 1 119 T + INBND_POINT(4) = 1 1 T + INBND_POINT(5) = 103 1 T + INBND_POINT(6) = 103 11 T +/ + +! -------------------------------------------------------------------- ! +! WAVEWATCH III - end of namelist ! +! -------------------------------------------------------------------- ! diff --git a/regtests/ww3_tp2.14/input_oasacm2/ww3_ounf.inp b/regtests/ww3_tp2.14/input_oasacm2/ww3_ounf.inp new file mode 100755 index 000000000..b8bbf80f6 --- /dev/null +++ b/regtests/ww3_tp2.14/input_oasacm2/ww3_ounf.inp @@ -0,0 +1,41 @@ +$ -------------------------------------------------------------------- $ +$ WAVEWATCH III Grid output post-processing $ +$--------------------------------------------------------------------- $ +$ First output time (yyyymmdd hhmmss), increment of output (s), +$ and number of output times. +$ + 20080310 000000 180 100 +$ +$ Output request flags identifying fields as in ww3_shel.inp. See that +$ file for a full documentation of field output options. Namelist type +$ selection is used here (for alternative F/T flags, see ww3_shel.inp). +$ + N + HS FP DIR DP CHA UST DPT CUR WND +$ +$--------------------------------------------------------------------- $ +$ netCDF version [3,4] +$ and variable type 4 [2 = SHORT, 3 = it depends , 4 = REAL] +$ swell partitions [0 1 2 3 4 5] +$ variables in same file [T] or not [F] +$ + 3 4 + 0 + T +$ +$ -------------------------------------------------------------------- $ +$ File prefix +$ number of characters in date [0(nodate),4(yearly),6(monthly),8(daily),10(hourly)] +$ IX and IY ranges [regular:IX NX IY NY DX DY, unstructured:IP NP DP DP] +$ +ww3. +6 +1 10000 1 10000 +$ +$ For each field and time a new file is generated with the file name +$ ww3.date_xxx.nc , where date is a conventional time indicator with S3 +$ characters, and xxx is a field identifier. +$ +$ -------------------------------------------------------------------- $ +$ End of input file $ +$ -------------------------------------------------------------------- $ diff --git a/regtests/ww3_tp2.14/input_oasacm2/ww3_ounf.nml b/regtests/ww3_tp2.14/input_oasacm2/ww3_ounf.nml new file mode 100644 index 000000000..fc0386ff8 --- /dev/null +++ b/regtests/ww3_tp2.14/input_oasacm2/ww3_ounf.nml @@ -0,0 +1,60 @@ +! -------------------------------------------------------------------- ! +! WAVEWATCH III ww3_ounf.nml - Grid output post-processing ! +! -------------------------------------------------------------------- ! + +! -------------------------------------------------------------------- ! +! Define the output fields to postprocess via FIELD_NML namelist +! +! * the detailed list of field names FIELD%LIST is given in ww3_shel.nml +! DPT CUR WND AST WLV ICE IBG D50 IC1 IC5 +! HS LM T02 T0M1 T01 FP DIR SPR DP HIG +! EF TH1M STH1M TH2M STH2M WN +! PHS PTP PLP PDIR PSPR PWS PDP PQP PPE PGW PSW PTM10 PT01 PT02 PEP TWS PNR +! UST CHA CGE FAW TAW TWA WCC WCF WCH WCM FWS +! SXY TWO BHD FOC TUS USS P2S USF P2L TWI FIC +! ABR UBR BED FBB TBB +! MSS MSC WL02 AXT AYT AXY +! DTD FC CFX CFD CFK +! U1 U2 +! +! * namelist must be terminated with / +! * definitions & defaults: +! FIELD%TIMESTART = '19000101 000000' ! Stop date for the output field +! FIELD%TIMESTRIDE = '0' ! Time stride for the output field +! FIELD%TIMESTOP = '29001231 000000' ! Stop date for the output field +! FIELD%TIMECOUNT = '1000000000' ! Number of time steps +! FIELD%TIMESPLIT = 6 ! [0(nodate),4(yearly),6(monthly),8(daily),10(hourly)] +! FIELD%LIST = 'unset' ! List of output fields +! FIELD%PARTITION = '0 1 2 3' ! List of wave partitions ['0 1 2 3 4 5'] +! FIELD%SAMEFILE = T ! All the variables in the same file [T|F] +! FIELD%TYPE = 3 ! [2 = SHORT, 3 = it depends , 4 = REAL] +! -------------------------------------------------------------------- ! +&FIELD_NML + FIELD%TIMESTART = '20080310 000000' + FIELD%TIMESTRIDE = '180' + FIELD%TIMECOUNT = '100' + FIELD%LIST = 'HS FP DIR DP CHA UST DPT CUR WND' + FIELD%PARTITION = '0' + FIELD%TYPE = 4 +/ + +! -------------------------------------------------------------------- ! +! Define the content of the output file via FILE_NML namelist +! +! * namelist must be terminated with / +! * definitions & defaults: +! FILE%PREFIX = 'ww3.' ! Prefix for output file name +! FILE%NETCDF = 3 ! Netcdf version [3|4] +! FILE%IX0 = 1 ! First X-axis or node index +! FILE%IXN = 1000000000 ! Last X-axis or node index +! FILE%IY0 = 1 ! First Y-axis index +! FILE%IYN = 1000000000 ! Last Y-axis index +! -------------------------------------------------------------------- ! +&FILE_NML + FILE%IXN = 10000 + FILE%IYN = 10000 +/ + +! -------------------------------------------------------------------- ! +! WAVEWATCH III - end of namelist ! +! -------------------------------------------------------------------- ! diff --git a/regtests/ww3_tp2.14/input/ww3_shel_OASACM2.inp b/regtests/ww3_tp2.14/input_oasacm2/ww3_shel.inp similarity index 100% rename from regtests/ww3_tp2.14/input/ww3_shel_OASACM2.inp rename to regtests/ww3_tp2.14/input_oasacm2/ww3_shel.inp diff --git a/regtests/ww3_tp2.14/input/ww3_shel_OASACM2.nml b/regtests/ww3_tp2.14/input_oasacm2/ww3_shel.nml similarity index 95% rename from regtests/ww3_tp2.14/input/ww3_shel_OASACM2.nml rename to regtests/ww3_tp2.14/input_oasacm2/ww3_shel.nml index 0e05a1a9d..3ee373343 100644 --- a/regtests/ww3_tp2.14/input/ww3_shel_OASACM2.nml +++ b/regtests/ww3_tp2.14/input_oasacm2/ww3_shel.nml @@ -44,6 +44,8 @@ ! INPUT%FORCING%WATER_LEVELS = 'F' ! INPUT%FORCING%CURRENTS = 'F' ! INPUT%FORCING%WINDS = 'F' +! INPUT%FORCING%ATM_MOMENTUM = 'F' +! INPUT%FORCING%AIR_DENSITY = 'F' ! INPUT%FORCING%ICE_CONC = 'F' ! INPUT%FORCING%ICE_PARAM1 = 'F' ! INPUT%FORCING%ICE_PARAM2 = 'F' @@ -94,9 +96,11 @@ ! T T 1 5 WLV WLV Water levels. ! T T 1 6 ICE ICE Ice concentration. ! T T 1 7 IBG IBG Iceberg-induced damping. -! T T 1 8 D50 D50 Median sediment grain size. -! T T 1 9 IC1 IC1 Ice thickness. -! T T 1 10 IC5 IC5 Ice flow diameter. +! T T 1 8 TAUA TAU Atm. momentum. +! T T 1 9 RHOAIR RHO Air density. +! T T 1 10 D50 D50 Median sediment grain size. +! T T 1 11 IC1 IC1 Ice thickness. +! T T 1 12 IC5 IC5 Ice flow diameter. ! ------------------------------------------------- ! 2 Standard mean wave Parameters ! ------------------------------------------------- @@ -117,6 +121,7 @@ ! T T 2 15 HMAXD SDMH St Dev of MXC (STE) ! T T 2 16 HCMAXD SDMHC St Dev of MXHC (STE) ! F T 2 17 WBT WBT Domiant wave breaking probability bT +! F F 2 18 FP0 TP Peak period (from peak freq) ! ------------------------------------------------- ! 3 Spectral Parameters (first 5) ! ------------------------------------------------- @@ -174,6 +179,7 @@ ! F F 6 9 P2SMS P2L Micro seism source term ! F F 6 10 TAUICE TWI Wave to sea ice stress ! F F 6 11 PHICE FIC Wave to sea ice energy flux +! F F 6 12 USSP USP Partitioned surface Stokes drift ! ------------------------------------------------- ! 7 Wave-bottom layer ! ------------------------------------------------- @@ -219,9 +225,14 @@ ! - Ice model : IC5 TWI ! - Received fields by ww3: ! - Ocean model : SSH CUR -! - Atmospheric model : WND +! - Atmospheric model : WND TAU RHO ! - Ice model : ICE IC1 IC5 ! +! * Coupling flag (T) or (F) at T+0 (extra fields in the restart needed) +! +! * extra fields to be written to the restart: +! - The list includes all fields sent by coupling exchange only +! ! * namelist must be terminated with / ! * definitions & defaults: ! TYPE%FIELD%LIST = 'unset' @@ -236,6 +247,8 @@ ! TYPE%PARTITION%FORMAT = T ! TYPE%COUPLING%SENT = 'unset' ! TYPE%COUPLING%RECEIVED = 'unset' +! TYPE%COUPLING%COUPLET0 = F +! TYPE%RESTART%EXTRA = 'unset' ! ! -------------------------------------------------------------------- ! &OUTPUT_TYPE_NML diff --git a/regtests/ww3_tp2.14/input_oasacm2/ww3_strt.inp b/regtests/ww3_tp2.14/input_oasacm2/ww3_strt.inp new file mode 100755 index 000000000..948c42911 --- /dev/null +++ b/regtests/ww3_tp2.14/input_oasacm2/ww3_strt.inp @@ -0,0 +1,72 @@ +$ -------------------------------------------------------------------- $ +$ WAVEWATCH III Initial conditions input file $ +$--------------------------------------------------------------------- $ +$ type of initial field ITYPE . +$ + 1 +$ +$ ITYPE = 1 ---------------------------------------------------------- $ +$ Gaussian in frequency and space, cos type in direction. +$ - fp and spread (Hz), mean direction (degr., oceanographic +$ convention) and cosine power, Xm and spread (degr. or m) Ym and +$ spread (degr. or m), Hmax (m) (Example for lon-lat grid in degr.). +$ +$ 0.10 0.01 270. 2 1. 0.5 1. 0.5 2.5 + 0.10 0.01 270. 2 0. 1000. 1. 1000. 2.5 +$ 0.10 0.01 270. 2 0. 1000. 1. 1000. 0.01 +$ 0.10 0.01 270. 2 0. 1000. 1. 1000. 0. +$ +$ ITYPE = 2 ---------------------------------------------------------- $ +$ JONSWAP spectrum with Hasselmann et al. (1980) direct. distribution. +$ - alfa, peak freq. (Hz), mean direction (degr., oceanographical +$ convention), gamma, sigA, sigB, Xm and spread (degr. or m) Ym and +$ spread (degr. or m) (Example for lon-lat grid in degr.). +$ alfa, sigA, sigB give default values if less than or equal to 0. +$ +$ 0.0081 0.1 270. 1.0 0. 0. 1. 100. 1. 100. +$ +$ ITYPE = 3 ---------------------------------------------------------- $ +$ Fetch-limited JONSWAP +$ - No additional data, the local spectrum is calculated using the +$ local wind speed and direction, using the spatial grid size as +$ fetch, and assuring that the spectrum is within the discrete +$ frequency range. +$ +$ ITYPE = 4 ---------------------------------------------------------- $ +$ User-defined spectrum +$ - Scale factor., defaults to 1 if less than or equal 0. +$ - Spectrum F(f,theta) (single read statement) +$ +$ -0.1 +$ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +$ 0 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +$ 0 1 4 2 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +$ 0 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +$ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +$ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +$ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +$ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +$ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +$ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +$ 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 0 0 0 0 0 0 0 0 0 0 +$ 0 0 0 0 0 0 0 0 0 0 1 2 3 2 1 1 0 0 0 0 0 0 0 0 0 +$ 0 0 0 0 0 0 0 0 0 1 3 9 7 5 3 2 1 0 0 0 0 0 0 0 0 +$ 0 0 0 0 0 0 0 0 0 0 1 3 4 3 2 1 0 0 0 0 0 0 0 0 0 +$ 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 0 0 0 0 0 0 0 0 0 0 +$ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +$ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +$ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +$ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +$ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +$ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +$ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +$ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +$ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +$ +$ ITYPE = 5 ---------------------------------------------------------- $ +$ Starting from calm conditions. +$ - No additional data. +$ +$ -------------------------------------------------------------------- $ +$ End of input file $ +$ -------------------------------------------------------------------- $ diff --git a/regtests/ww3_tp2.14/input_oasacm3/namelists_IROISE.nml b/regtests/ww3_tp2.14/input_oasacm3/namelists_IROISE.nml new file mode 100644 index 000000000..8b5707b65 --- /dev/null +++ b/regtests/ww3_tp2.14/input_oasacm3/namelists_IROISE.nml @@ -0,0 +1 @@ +END OF NAMELISTS diff --git a/regtests/ww3_tp2.14/input/switch_OASACM3 b/regtests/ww3_tp2.14/input_oasacm3/switch_OASACM3 similarity index 100% rename from regtests/ww3_tp2.14/input/switch_OASACM3 rename to regtests/ww3_tp2.14/input_oasacm3/switch_OASACM3 diff --git a/regtests/ww3_tp2.14/input_oasacm3/ww3_grid.inp b/regtests/ww3_tp2.14/input_oasacm3/ww3_grid.inp new file mode 100755 index 000000000..e367379b4 --- /dev/null +++ b/regtests/ww3_tp2.14/input_oasacm3/ww3_grid.inp @@ -0,0 +1,276 @@ +$ -------------------------------------------------------------------- $ +$ WAVEWATCH III Grid preprocessor input file $ +$ -------------------------------------------------------------------- $ +$ Grid name (C*30, in quotes) +$ + 'IROISE 1.5KM' +$ +$ Frequency increment factor and first frequency (Hz) ---------------- $ +$ number of frequencies (wavenumbers) and directions +$ +1.1 0.0373 32 24 0. +$ +$ Set model flags ---------------------------------------------------- $ +$ - FLDRY Dry run (input/output only, no calculation). +$ - FLCX, FLCY Activate X and Y component of propagation. +$ - FLCTH, FLCK Activate direction and wavenumber shifts. +$ - FLSOU Activate source terms. +$ + F T T T T T +$ +$ Set time steps ----------------------------------------------------- $ +$ - Time step information (this information is always read) +$ maximum global time step, maximum CFL time step for x-y and +$ k-theta, minimum source term time step (all in seconds). +$ + 180. 45. 45. 10. +$ +$ Start of namelist input section ------------------------------------ $ +$ Starting with WAVEWATCH III version 2.00, the tunable parameters +$ for source terms, propagation schemes, and numerics are read using +$ namelists. Any namelist found in the folowing sections up to the +$ end-of-section identifier string (see below) is temporarily written +$ to ww3_grid.scratch, and read from there if necessary. Namelists +$ not needed for the given switch settings will be skipped +$ automatically, and the order of the namelists is immaterial. +$ As an example, namelist input to change SWELLF and ZWND in the +$ Tolman and Chalikov input would be +$ +$ &SIN2 SWELLF = 0.1, ZWND = 15. / +$ +$ Define constants in source terms ----------------------------------- $ +$ +$ Input - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +$ WAM-3 : Namelist SIN1 +$ CINP : Proportionality constant. +$ &SIN1 CINP= 0.25 / +$ Tolman and Chalikov : Namelist SIN2 +$ ZWND : Height of wind (m). +$ SWELLF : swell factor in (2.48). +$ STABSH, STABOF, CNEG, CPOS, FNEG : +$ c0, ST0, c1, c2 and f1 in . (2.63) +$ through (2.65) for definition of +$ effective wind speed (!/STAB2). +$ +$ Nonlinear interactions - - - - - - - - - - - - - - - - - - - - - - - +$ Discrete I.A. : Namelist SNL1 +$ LAMBDA : Lambda in source term. +$ NLPROP : C in sourc term. NOTE : default +$ value depends on other source +$ terms selected. +$ KDCONV : Factor before kd in Eq. (2.24). +$ KDMIN, SNLCS1, SNLCS2, SNLCS3 : +$ Minimum kd, and constants c1-3 +$ in depth scaling function. +$ Exact interactions : Namelist SNL2 +$ IQTYPE : Type of depth treatment +$ 1 : Deep water +$ 2 : Deep water / WAM scaling +$ 3 : Shallow water +$ TAILNL : Parametric tail power. +$ NDEPTH : Number of depths in for which +$ integration space is established. +$ Used for IQTYPE = 3 only +$ Namelist ANL2 +$ DEPTHS : Array with depths for NDEPTH = 3 +$ +$ Dissipation - - - - - - - - - - - - - - - - - - - - - - - - - - - - +$ WAM-3 : Namelist SDS1 +$ CDIS, APM : As in source term. +$ +$ Tolman and Chalikov : Namelist SDS2 +$ SDSA0, SDSA1, SDSA2, SDSB0, SDSB1, PHIMIN : +$ Constants a0, a1, a2, b0, b1 and +$ PHImin. +$ +$ Bottom friction - - - - - - - - - - - - - - - - - - - - - - - - - - +$ JONSWAP : Namelist SBT1 +$ GAMMA : As it says. +$ +$ Propagation schemes ------------------------------------------------ $ +$ First order : Namelist PRO1 +$ CFLTM : Maximum CFL number for refraction. +$ +$ UQ with diffusion : Namelist PRO2 +$ CFLTM : Maximum CFL number for refraction. +$ FLSOFT : Flag for 'soft' land boundaries. +$ DTIME : Swell age (s) in garden sprinkler +$ correction. If 0., all diffusion +$ switched off. If small non-zero +$ (DEFAULT !!!) only wave growth +$ diffusion. +$ LATMIN : Maximum latitude used in calc. of +$ strength of diffusion for prop. +$ +$ UQ with averaging : Namelist PRO3 +$ CFLTM : Maximum CFL number for refraction. +$ FLSOFT : Flag for 'soft' land boundaries. +$ WDTHCG : Tuning factor propag. direction. +$ WDTHTH : Tuning factor normal direction. +$ +$ UQ with divergence : Namelist PRO4 +$ CFLTM : Maximum CFL number for refraction. +$ FLSOFT : Flag for 'soft' land boundaries. +$ QTFAC : Tuning factor Eq. (3.41). +$ RSFAC : Tuning factor Eq. (3.42). +$ RNFAC : Tuning factor Eq. (3.43). +$ +$ Miscellaneous ------------------------------------------------------ $ +$ Misc. parameters : Namelist MISC +$ CICE0 : Ice concentration cut-off. +$ CICEN : Ice concentration cut-off. +$ XSEED : Xseed in seeding alg. (!/SEED). +$ FLAGTR : Indicating presence and type of +$ subgrid information : +$ 0 : No subgrid information. +$ 1 : Transparancies at cell boun- +$ daries between grid points. +$ 2 : Transp. at cell centers. +$ 3 : Like 1 with cont. ice. +$ 4 : Like 2 with cont. ice. +$ XP, XR, XFILT +$ Xp, Xr and Xf for the dynamic +$ integration scheme. +$ +$ In the 'Out of the box' test setup we run with sub-grid obstacles +$ and with continuous ice treatment. +$ +$ &MISC CICE0 = 0.25, CICEN = 0.75, FLAGTR = 4 / +$ +$ Mandatory string to identify end of namelist input section. +$ +END OF NAMELISTS +$ +$ Define grid -------------------------------------------------------- $ +$ Four records containing : +$ 1 NX, NY. As the outer grid lines are always defined as land +$ points, the minimum size is 3x3. +$ 2 Grid increments SX, SY (degr.or m) and scaling (division) factor. +$ If NX*SX = 360., latitudinal closure is applied. +$ 3 Coordinates of (1,1) (degr.) and scaling (division) factor. +$ 4 Limiting bottom depth (m) to discriminate between land and sea +$ points, minimum water depth (m) as allowed in model, unit number +$ of file with bottom depths, scale factor for bottom depths (mult.), +$ IDLA, IDFM, format for formatted read, FROM and filename. +$ IDLA : Layout indicator : +$ 1 : Read line-by-line bottom to top. +$ 2 : Like 1, single read statement. +$ 3 : Read line-by-line top to bottom. +$ 4 : Like 3, single read statement. +$ IDFM : format indicator : +$ 1 : Free format. +$ 2 : Fixed format with above format descriptor. +$ 3 : Unformatted. +$ FROM : file type parameter +$ 'UNIT' : open file by unit number only. +$ 'NAME' : open file by name and assign to unit. +$ +$ Example for longitude-latitude grid (switch !/LLG), for Cartesian +$ grid the unit is meters (NOT km). +$ + 'RECT' T 'NONE' + 103 119 + 0.019 0.0125 1. + -6.119 47.6375 1. + 0.0 1.0 20 -1. 1 1 '(20f10.2)' 'NAME' '../input/iro_1p5k.bot' +$ +$ If the above unit number equals 10, the bottom data is read from +$ this file and follows below (no intermediate comment lines allowed). +$ +$ 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 +$ +$ If sub-grid information is avalaible as indicated by FLAGTR above, +$ additional input to define this is needed below. In such cases a +$ field of fractional obstructions at or between grid points needs to +$ be supplied. First the location and format of the data is defined +$ by (as above) : +$ - Unit number of file (can be 10, and/or identical to bottem depth +$ unit), scale factor for fractional obstruction, IDLA, IDFM, +$ format for formatted read, FROM and filename +$ +$ 10 0.2 3 1 '(....)' 'NAME' 'obstr.inp' +$ +$ *** NOTE if this unit number is the same as the previous bottom +$ depth unit number, it is assumed that this is the same file +$ without further checks. *** +$ +$ If the above unit number equals 10, the bottom data is read from +$ this file and follows below (no intermediate comment lines allowed, +$ except between the two fields). +$ +$ 0 0 0 0 0 0 0 0 0 0 0 0 +$ 0 0 0 0 0 0 0 0 0 0 0 0 +$ 0 0 0 0 0 0 0 0 0 0 0 0 +$ 0 0 0 0 0 0 0 0 0 0 0 0 +$ 0 0 0 0 0 0 0 0 0 0 0 0 +$ 0 0 0 0 0 0 5 0 0 0 0 0 +$ 0 0 0 0 0 0 5 0 0 0 0 0 +$ 0 0 0 0 0 0 4 0 0 0 0 0 +$ 0 0 0 0 0 0 4 0 0 0 0 0 +$ 0 0 0 0 0 0 5 0 0 0 0 0 +$ 0 0 0 0 0 0 5 0 0 0 0 0 +$ 0 0 0 0 0 0 0 0 0 0 0 0 +$ +$ 0 0 0 0 0 0 0 0 0 0 0 0 +$ 0 0 0 0 0 0 0 0 0 0 0 0 +$ 0 0 0 0 0 0 0 0 0 0 0 0 +$ 0 0 0 0 0 0 0 0 0 0 0 0 +$ 0 0 0 0 0 0 0 0 5 5 5 0 +$ 0 0 0 0 0 0 0 0 0 0 0 0 +$ 0 0 0 0 0 0 0 0 0 0 0 0 +$ 0 0 0 0 0 0 0 0 0 0 0 0 +$ 0 0 0 0 0 0 0 0 0 0 0 0 +$ 0 0 0 0 0 0 0 0 0 0 0 0 +$ 0 0 0 0 0 0 0 0 0 0 0 0 +$ 0 0 0 0 0 0 0 0 0 0 0 0 +$ +$ *** NOTE size of fields is always NX * NY *** +$ + 10 3 1 '(....)' 'PART' 'mapsta.inp' +$ *** NOTE size of fields is always NX * NY *** +$ +$ Input boundary points ---------------------------------------------- $ +$ An unlimited number of lines identifying points at which input +$ boundary conditions are to be defined. If the actual input data is +$ not defined in the actual wave model run, the initial conditions +$ will be applied as constant boundary conditions. Each line contains: +$ Discrete grid counters (IX,IY) of the active point and a +$ connect flag. If this flag is true, and the present and previous +$ point are on a grid line or diagonal, all intermediate points +$ are also defined as boundary points. +$ + 103 86 F + 103 119 T + 1 119 T + 1 1 T + 103 1 T + 103 11 T +$ +$ Close list by defining point (0,0) (mandatory) +$ + 0 0 F +$ Excluded grid points from segment data ( FROM != PART ) +$ First defined as lines, identical to the definition of the input +$ boundary points, and closed the same way. +$ + 0 0 F +$ +$ Second, define a point in a closed body of sea points to remove +$ the entire body os sea points. Also close by point (0,0) +$ + 0 0 +$ +$ Output boundary points --------------------------------------------- $ +$ Output boundary points are defined as a number of straight lines, +$ defined by its starting point (X0,Y0), increments (DX,DY) and number +$ of points. A negative number of points starts a new output file. +$ Note that this data is only generated if requested by the actual +$ program. Example again for spherical grid in degrees. +$ +$ Close list by defining line with 0 points (mandatory) +$ + 0. 0. 0. 0. 0 +$ +$ -------------------------------------------------------------------- $ +$ End of input file $ +$ -------------------------------------------------------------------- $ diff --git a/regtests/ww3_tp2.14/input_oasacm3/ww3_grid.nml b/regtests/ww3_tp2.14/input_oasacm3/ww3_grid.nml new file mode 100644 index 000000000..fcffb0601 --- /dev/null +++ b/regtests/ww3_tp2.14/input_oasacm3/ww3_grid.nml @@ -0,0 +1,276 @@ +! -------------------------------------------------------------------- ! +! WAVEWATCH III - ww3_grid.nml - Grid pre-processing ! +! -------------------------------------------------------------------- ! + +! -------------------------------------------------------------------- ! +! Define the spectrum parameterization via SPECTRUM_NML namelist +! +! * namelist must be terminated with / +! * definitions & defaults: +! SPECTRUM%XFR = 0. ! frequency increment +! SPECTRUM%FREQ1 = 0. ! first frequency (Hz) +! SPECTRUM%NK = 0 ! number of frequencies (wavenumbers) +! SPECTRUM%NTH = 0 ! number of direction bins +! SPECTRUM%THOFF = 0. ! relative offset of first direction [-0.5,0.5] +! -------------------------------------------------------------------- ! +&SPECTRUM_NML + SPECTRUM%XFR = 1.1 + SPECTRUM%FREQ1 = 0.0373 + SPECTRUM%NK = 32 + SPECTRUM%NTH = 24 +/ + +! -------------------------------------------------------------------- ! +! Define the run parameterization via RUN_NML namelist +! +! * namelist must be terminated with / +! * definitions & defaults: +! RUN%FLDRY = F ! dry run (I/O only, no calculation) +! RUN%FLCX = F ! x-component of propagation +! RUN%FLCY = F ! y-component of propagation +! RUN%FLCTH = F ! direction shift +! RUN%FLCK = F ! wavenumber shift +! RUN%FLSOU = F ! source terms +! -------------------------------------------------------------------- ! +&RUN_NML + RUN%FLCX = T + RUN%FLCY = T + RUN%FLCTH = T + RUN%FLCK = T + RUN%FLSOU = T +/ + +! -------------------------------------------------------------------- ! +! Define the timesteps parameterization via TIMESTEPS_NML namelist +! +! * It is highly recommended to set up time steps which are multiple +! between them. +! +! * The first time step to calculate is the maximum CFL time step +! which depend on the lowest frequency FREQ1 previously set up and the +! lowest spatial grid resolution in meters DXY. +! reminder : 1 degree=60minutes // 1minute=1mile // 1mile=1.852km +! The formula for the CFL time is : +! Tcfl = DXY / (G / (FREQ1*4*Pi) ) with the constants Pi=3,14 and G=9.8m/s²; +! DTXY ~= 90% Tcfl +! DTMAX ~= 3 * DTXY (maximum global time step limit) +! +! * The refraction time step depends on how strong can be the current velocities +! on your grid : +! DTKTH ~= DTMAX / 2 ! in case of no or light current velocities +! DTKTH ~= DTMAX / 10 ! in case of strong current velocities +! +! * The source terms time step is usually defined between 5s and 60s. +! A common value is 10s. +! DTMIN ~= 10 +! +! * namelist must be terminated with / +! * definitions & defaults: +! TIMESTEPS%DTMAX = 0. ! maximum global time step (s) +! TIMESTEPS%DTXY = 0. ! maximum CFL time step for x-y (s) +! TIMESTEPS%DTKTH = 0. ! maximum CFL time step for k-th (s) +! TIMESTEPS%DTMIN = 0. ! minimum source term time step (s) +! -------------------------------------------------------------------- ! +&TIMESTEPS_NML + TIMESTEPS%DTMAX = 180. + TIMESTEPS%DTXY = 45. + TIMESTEPS%DTKTH = 45. + TIMESTEPS%DTMIN = 10. +/ + +! -------------------------------------------------------------------- ! +! Define the grid to preprocess via GRID_NML namelist +! +! * the tunable parameters for source terms, propagation schemes, and +! numerics are read using namelists. +! * Any namelist found in the folowing sections is temporarily written +! to param.scratch, and read from there if necessary. +! * The order of the namelists is immaterial. +! * Namelists not needed for the given switch settings will be skipped +! automatically +! +! * grid type can be : +! 'RECT' : rectilinear +! 'CURV' : curvilinear +! 'UNST' : unstructured (triangle-based) +! +! * coordinate system can be : +! 'SPHE' : Spherical (degrees) +! 'CART' : Cartesian (meters) +! +! * grid closure can only be applied in spherical coordinates +! +! * grid closure can be : +! 'NONE' : No closure is applied +! 'SMPL' : Simple grid closure. Grid is periodic in the +! : i-index and wraps at i=NX+1. In other words, +! : (NX+1,J) => (1,J). A grid with simple closure +! : may be rectilinear or curvilinear. +! 'TRPL' : Tripole grid closure : Grid is periodic in the +! : i-index and wraps at i=NX+1 and has closure at +! : j=NY+1. In other words, (NX+1,J<=NY) => (1,J) +! : and (I,NY+1) => (NX-I+1,NY). Tripole +! : grid closure requires that NX be even. A grid +! : with tripole closure must be curvilinear. +! +! * The coastline limit depth is the value which distinguish the sea +! points to the land points. All the points with depth values (ZBIN) +! greater than this limit (ZLIM) will be considered as excluded points +! and will never be wet points, even if the water level grows over. +! It can only overwrite the status of a sea point to a land point. +! The value must have a negative value under the mean sea level +! +! * The minimum water depth allowed to compute the model is the absolute +! depth value (DMIN) used in the model if the input depth is lower to +! avoid the model to blow up. +! +! * namelist must be terminated with / +! * definitions & defaults: +! GRID%NAME = 'unset' ! grid name (30 char) +! GRID%NML = 'namelists.nml' ! namelists filename +! GRID%TYPE = 'unset' ! grid type +! GRID%COORD = 'unset' ! coordinate system +! GRID%CLOS = 'unset' ! grid closure +! +! GRID%ZLIM = 0. ! coastline limit depth (m) +! GRID%DMIN = 0. ! abs. minimum water depth (m) +! -------------------------------------------------------------------- ! +&GRID_NML + GRID%NAME = 'IROISE 1.5KM' + GRID%NML = '../input_oasacm3/namelists_IROISE.nml' + GRID%TYPE = 'RECT' + GRID%COORD = 'SPHE' + GRID%CLOS = 'NONE' + GRID%ZLIM = 0.0 + GRID%DMIN = 1.0 +/ + +! -------------------------------------------------------------------- ! +! Define the rectilinear grid type via RECT_NML namelist +! - only for RECT grids - +! +! * The minimum grid size is 3x3. +! +! * If the grid increments SX and SY are given in minutes of arc, the scaling +! factor SF must be set to 60. to provide an increment factor in degree. +! +! * If CSTRG='SMPL', then SX is forced to 360/NX. +! +! * value <= value_read / scale_fac +! +! * namelist must be terminated with / +! * definitions & defaults: +! RECT%NX = 0 ! number of points along x-axis +! RECT%NY = 0 ! number of points along y-axis +! +! RECT%SX = 0. ! grid increment along x-axis +! RECT%SY = 0. ! grid increment along y-axis +! RECT%SF = 1. ! scaling division factor for x-y axis +! +! RECT%X0 = 0. ! x-coordinate of lower-left corner (deg) +! RECT%Y0 = 0. ! y-coordinate of lower-left corner (deg) +! RECT%SF0 = 1. ! scaling division factor for x0,y0 coord +! -------------------------------------------------------------------- ! +&RECT_NML + RECT%NX = 103 + RECT%NY = 119 + RECT%SX = 0.019 + RECT%SY = 0.0125 + RECT%X0 = -6.119 + RECT%Y0 = 47.6375 +/ + +! -------------------------------------------------------------------- ! +! Define the depth to preprocess via DEPTH_NML namelist +! - for RECT and CURV grids - +! +! * if no obstruction subgrid, need to set &MISC FLAGTR = 0 +! +! * The depth value must have negative values under the mean sea level +! +! * value <= value_read * scale_fac +! +! * IDLA : Layout indicator : +! 1 : Read line-by-line bottom to top. (default) +! 2 : Like 1, single read statement. +! 3 : Read line-by-line top to bottom. +! 4 : Like 3, single read statement. +! * IDFM : format indicator : +! 1 : Free format. (default) +! 2 : Fixed format. +! 3 : Unformatted. +! * FORMAT : element format to read : +! '(....)' : auto detected (default) +! '(f10.6)' : float type +! +! * Example : +! IDF SF IDLA IDFM FORMAT FILENAME +! 50 0.001 1 1 '(....)' 'GLOB-30M.bot' +! +! * namelist must be terminated with / +! * definitions & defaults: +! DEPTH%SF = 1. ! scale factor +! DEPTH%FILENAME = 'unset' ! filename +! DEPTH%IDF = 50 ! file unit number +! DEPTH%IDLA = 1 ! layout indicator +! DEPTH%IDFM = 1 ! format indicator +! DEPTH%FORMAT = '(....)' ! formatted read format +! -------------------------------------------------------------------- ! +&DEPTH_NML + DEPTH%SF = -1. + DEPTH%FILENAME = '../input/iro_1p5k.bot' + DEPTH%FORMAT = '(20f10.2)' +/ + +! -------------------------------------------------------------------- ! +! Define the input boundary points via INBND_COUNT_NML and +! INBND_POINT_NML namelist +! - for RECT, CURV and UNST grids - +! +! * If no mask defined, INBOUND can be used +! +! * If the actual input data is not defined in the actual wave model run +! the initial conditions will be applied as constant boundary conditions. +! +! * The number of points is defined by INBND_COUNT +! +! * The points must start from index 1 to N +! +! * Each line contains: +! Discrete grid counters (IX,IY) of the active point and a +! connect flag. If this flag is true, and the present and previous +! point are on a grid line or diagonal, all intermediate points +! are also defined as boundary points. +! +! * Included point : +! grid points from segment data +! Defines as lines identifying points at which +! input boundary conditions are to be defined. +! +! * namelist must be terminated with / +! * definitions & defaults: +! INBND_COUNT%N_POINT = 0 ! number of segments +! +! INBND_POINT(I)%X_INDEX = 0 ! x index included point +! INBND_POINT(I)%Y_INDEX = 0 ! y index included point +! INBND_POINT(I)%CONNECT = F ! connect flag +! +! OR +! INBND_POINT(I) = 0 0 F ! included point +! -------------------------------------------------------------------- ! +&INBND_COUNT_NML + INBND_COUNT%N_POINT = 6 +/ + +&INBND_POINT_NML + INBND_POINT(1) = 103 86 F + INBND_POINT(2) = 103 119 T + INBND_POINT(3) = 1 119 T + INBND_POINT(4) = 1 1 T + INBND_POINT(5) = 103 1 T + INBND_POINT(6) = 103 11 T +/ + +! -------------------------------------------------------------------- ! +! WAVEWATCH III - end of namelist ! +! -------------------------------------------------------------------- ! diff --git a/regtests/ww3_tp2.14/input_oasacm3/ww3_ounf.inp b/regtests/ww3_tp2.14/input_oasacm3/ww3_ounf.inp new file mode 100755 index 000000000..b8bbf80f6 --- /dev/null +++ b/regtests/ww3_tp2.14/input_oasacm3/ww3_ounf.inp @@ -0,0 +1,41 @@ +$ -------------------------------------------------------------------- $ +$ WAVEWATCH III Grid output post-processing $ +$--------------------------------------------------------------------- $ +$ First output time (yyyymmdd hhmmss), increment of output (s), +$ and number of output times. +$ + 20080310 000000 180 100 +$ +$ Output request flags identifying fields as in ww3_shel.inp. See that +$ file for a full documentation of field output options. Namelist type +$ selection is used here (for alternative F/T flags, see ww3_shel.inp). +$ + N + HS FP DIR DP CHA UST DPT CUR WND +$ +$--------------------------------------------------------------------- $ +$ netCDF version [3,4] +$ and variable type 4 [2 = SHORT, 3 = it depends , 4 = REAL] +$ swell partitions [0 1 2 3 4 5] +$ variables in same file [T] or not [F] +$ + 3 4 + 0 + T +$ +$ -------------------------------------------------------------------- $ +$ File prefix +$ number of characters in date [0(nodate),4(yearly),6(monthly),8(daily),10(hourly)] +$ IX and IY ranges [regular:IX NX IY NY DX DY, unstructured:IP NP DP DP] +$ +ww3. +6 +1 10000 1 10000 +$ +$ For each field and time a new file is generated with the file name +$ ww3.date_xxx.nc , where date is a conventional time indicator with S3 +$ characters, and xxx is a field identifier. +$ +$ -------------------------------------------------------------------- $ +$ End of input file $ +$ -------------------------------------------------------------------- $ diff --git a/regtests/ww3_tp2.14/input_oasacm3/ww3_ounf.nml b/regtests/ww3_tp2.14/input_oasacm3/ww3_ounf.nml new file mode 100644 index 000000000..fc0386ff8 --- /dev/null +++ b/regtests/ww3_tp2.14/input_oasacm3/ww3_ounf.nml @@ -0,0 +1,60 @@ +! -------------------------------------------------------------------- ! +! WAVEWATCH III ww3_ounf.nml - Grid output post-processing ! +! -------------------------------------------------------------------- ! + +! -------------------------------------------------------------------- ! +! Define the output fields to postprocess via FIELD_NML namelist +! +! * the detailed list of field names FIELD%LIST is given in ww3_shel.nml +! DPT CUR WND AST WLV ICE IBG D50 IC1 IC5 +! HS LM T02 T0M1 T01 FP DIR SPR DP HIG +! EF TH1M STH1M TH2M STH2M WN +! PHS PTP PLP PDIR PSPR PWS PDP PQP PPE PGW PSW PTM10 PT01 PT02 PEP TWS PNR +! UST CHA CGE FAW TAW TWA WCC WCF WCH WCM FWS +! SXY TWO BHD FOC TUS USS P2S USF P2L TWI FIC +! ABR UBR BED FBB TBB +! MSS MSC WL02 AXT AYT AXY +! DTD FC CFX CFD CFK +! U1 U2 +! +! * namelist must be terminated with / +! * definitions & defaults: +! FIELD%TIMESTART = '19000101 000000' ! Stop date for the output field +! FIELD%TIMESTRIDE = '0' ! Time stride for the output field +! FIELD%TIMESTOP = '29001231 000000' ! Stop date for the output field +! FIELD%TIMECOUNT = '1000000000' ! Number of time steps +! FIELD%TIMESPLIT = 6 ! [0(nodate),4(yearly),6(monthly),8(daily),10(hourly)] +! FIELD%LIST = 'unset' ! List of output fields +! FIELD%PARTITION = '0 1 2 3' ! List of wave partitions ['0 1 2 3 4 5'] +! FIELD%SAMEFILE = T ! All the variables in the same file [T|F] +! FIELD%TYPE = 3 ! [2 = SHORT, 3 = it depends , 4 = REAL] +! -------------------------------------------------------------------- ! +&FIELD_NML + FIELD%TIMESTART = '20080310 000000' + FIELD%TIMESTRIDE = '180' + FIELD%TIMECOUNT = '100' + FIELD%LIST = 'HS FP DIR DP CHA UST DPT CUR WND' + FIELD%PARTITION = '0' + FIELD%TYPE = 4 +/ + +! -------------------------------------------------------------------- ! +! Define the content of the output file via FILE_NML namelist +! +! * namelist must be terminated with / +! * definitions & defaults: +! FILE%PREFIX = 'ww3.' ! Prefix for output file name +! FILE%NETCDF = 3 ! Netcdf version [3|4] +! FILE%IX0 = 1 ! First X-axis or node index +! FILE%IXN = 1000000000 ! Last X-axis or node index +! FILE%IY0 = 1 ! First Y-axis index +! FILE%IYN = 1000000000 ! Last Y-axis index +! -------------------------------------------------------------------- ! +&FILE_NML + FILE%IXN = 10000 + FILE%IYN = 10000 +/ + +! -------------------------------------------------------------------- ! +! WAVEWATCH III - end of namelist ! +! -------------------------------------------------------------------- ! diff --git a/regtests/ww3_tp2.14/input/ww3_shel_OASACM3.inp b/regtests/ww3_tp2.14/input_oasacm3/ww3_shel.inp similarity index 100% rename from regtests/ww3_tp2.14/input/ww3_shel_OASACM3.inp rename to regtests/ww3_tp2.14/input_oasacm3/ww3_shel.inp diff --git a/regtests/ww3_tp2.14/input/ww3_shel_OASACM3.nml b/regtests/ww3_tp2.14/input_oasacm3/ww3_shel.nml similarity index 94% rename from regtests/ww3_tp2.14/input/ww3_shel_OASACM3.nml rename to regtests/ww3_tp2.14/input_oasacm3/ww3_shel.nml index fbd9fb30e..3f81e8666 100644 --- a/regtests/ww3_tp2.14/input/ww3_shel_OASACM3.nml +++ b/regtests/ww3_tp2.14/input_oasacm3/ww3_shel.nml @@ -44,6 +44,8 @@ ! INPUT%FORCING%WATER_LEVELS = 'F' ! INPUT%FORCING%CURRENTS = 'F' ! INPUT%FORCING%WINDS = 'F' +! INPUT%FORCING%ATM_MOMENTUM = 'F' +! INPUT%FORCING%AIR_DENSITY = 'F' ! INPUT%FORCING%ICE_CONC = 'F' ! INPUT%FORCING%ICE_PARAM1 = 'F' ! INPUT%FORCING%ICE_PARAM2 = 'F' @@ -58,13 +60,12 @@ ! INPUT%ASSIM%SPEC2D = 'F' ! -------------------------------------------------------------------- ! &INPUT_NML - INPUT%FORCING%WINDS = 'F' / ! -------------------------------------------------------------------- ! ! Define the output types point parameters via OUTPUT_TYPE_NML namelist ! -! * the point file is a space separated values per line : lon lat 'name' +! * the point file is a space separated values per line : ! longitude latitude 'name' (C*40) ! ! * the full list of field names is : @@ -94,9 +95,11 @@ ! T T 1 5 WLV WLV Water levels. ! T T 1 6 ICE ICE Ice concentration. ! T T 1 7 IBG IBG Iceberg-induced damping. -! T T 1 8 D50 D50 Median sediment grain size. -! T T 1 9 IC1 IC1 Ice thickness. -! T T 1 10 IC5 IC5 Ice flow diameter. +! T T 1 8 TAUA TAU Atm. momentum. +! T T 1 9 RHOAIR RHO Air density. +! T T 1 10 D50 D50 Median sediment grain size. +! T T 1 11 IC1 IC1 Ice thickness. +! T T 1 12 IC5 IC5 Ice flow diameter. ! ------------------------------------------------- ! 2 Standard mean wave Parameters ! ------------------------------------------------- @@ -117,6 +120,7 @@ ! T T 2 15 HMAXD SDMH St Dev of MXC (STE) ! T T 2 16 HCMAXD SDMHC St Dev of MXHC (STE) ! F T 2 17 WBT WBT Domiant wave breaking probability bT +! F F 2 18 FP0 TP Peak period (from peak freq) ! ------------------------------------------------- ! 3 Spectral Parameters (first 5) ! ------------------------------------------------- @@ -174,6 +178,7 @@ ! F F 6 9 P2SMS P2L Micro seism source term ! F F 6 10 TAUICE TWI Wave to sea ice stress ! F F 6 11 PHICE FIC Wave to sea ice energy flux +! F F 6 12 USSP USP Partitioned surface Stokes drift ! ------------------------------------------------- ! 7 Wave-bottom layer ! ------------------------------------------------- @@ -219,9 +224,14 @@ ! - Ice model : IC5 TWI ! - Received fields by ww3: ! - Ocean model : SSH CUR -! - Atmospheric model : WND +! - Atmospheric model : WND TAU RHO ! - Ice model : ICE IC1 IC5 ! +! * Coupling flag (T) or (F) at T+0 (extra fields in the restart needed) +! +! * extra fields to be written to the restart: +! - The list includes all fields sent by coupling exchange only +! ! * namelist must be terminated with / ! * definitions & defaults: ! TYPE%FIELD%LIST = 'unset' @@ -236,6 +246,8 @@ ! TYPE%PARTITION%FORMAT = T ! TYPE%COUPLING%SENT = 'unset' ! TYPE%COUPLING%RECEIVED = 'unset' +! TYPE%COUPLING%COUPLET0 = F +! TYPE%RESTART%EXTRA = 'unset' ! ! -------------------------------------------------------------------- ! &OUTPUT_TYPE_NML diff --git a/regtests/ww3_tp2.14/input_oasacm3/ww3_strt.inp b/regtests/ww3_tp2.14/input_oasacm3/ww3_strt.inp new file mode 100755 index 000000000..948c42911 --- /dev/null +++ b/regtests/ww3_tp2.14/input_oasacm3/ww3_strt.inp @@ -0,0 +1,72 @@ +$ -------------------------------------------------------------------- $ +$ WAVEWATCH III Initial conditions input file $ +$--------------------------------------------------------------------- $ +$ type of initial field ITYPE . +$ + 1 +$ +$ ITYPE = 1 ---------------------------------------------------------- $ +$ Gaussian in frequency and space, cos type in direction. +$ - fp and spread (Hz), mean direction (degr., oceanographic +$ convention) and cosine power, Xm and spread (degr. or m) Ym and +$ spread (degr. or m), Hmax (m) (Example for lon-lat grid in degr.). +$ +$ 0.10 0.01 270. 2 1. 0.5 1. 0.5 2.5 + 0.10 0.01 270. 2 0. 1000. 1. 1000. 2.5 +$ 0.10 0.01 270. 2 0. 1000. 1. 1000. 0.01 +$ 0.10 0.01 270. 2 0. 1000. 1. 1000. 0. +$ +$ ITYPE = 2 ---------------------------------------------------------- $ +$ JONSWAP spectrum with Hasselmann et al. (1980) direct. distribution. +$ - alfa, peak freq. (Hz), mean direction (degr., oceanographical +$ convention), gamma, sigA, sigB, Xm and spread (degr. or m) Ym and +$ spread (degr. or m) (Example for lon-lat grid in degr.). +$ alfa, sigA, sigB give default values if less than or equal to 0. +$ +$ 0.0081 0.1 270. 1.0 0. 0. 1. 100. 1. 100. +$ +$ ITYPE = 3 ---------------------------------------------------------- $ +$ Fetch-limited JONSWAP +$ - No additional data, the local spectrum is calculated using the +$ local wind speed and direction, using the spatial grid size as +$ fetch, and assuring that the spectrum is within the discrete +$ frequency range. +$ +$ ITYPE = 4 ---------------------------------------------------------- $ +$ User-defined spectrum +$ - Scale factor., defaults to 1 if less than or equal 0. +$ - Spectrum F(f,theta) (single read statement) +$ +$ -0.1 +$ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +$ 0 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +$ 0 1 4 2 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +$ 0 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +$ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +$ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +$ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +$ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +$ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +$ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +$ 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 0 0 0 0 0 0 0 0 0 0 +$ 0 0 0 0 0 0 0 0 0 0 1 2 3 2 1 1 0 0 0 0 0 0 0 0 0 +$ 0 0 0 0 0 0 0 0 0 1 3 9 7 5 3 2 1 0 0 0 0 0 0 0 0 +$ 0 0 0 0 0 0 0 0 0 0 1 3 4 3 2 1 0 0 0 0 0 0 0 0 0 +$ 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 0 0 0 0 0 0 0 0 0 0 +$ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +$ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +$ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +$ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +$ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +$ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +$ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +$ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +$ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +$ +$ ITYPE = 5 ---------------------------------------------------------- $ +$ Starting from calm conditions. +$ - No additional data. +$ +$ -------------------------------------------------------------------- $ +$ End of input file $ +$ -------------------------------------------------------------------- $ diff --git a/regtests/ww3_tp2.14/input/TOYNAMELIST.nam.OASACM4 b/regtests/ww3_tp2.14/input_oasacm4/TOYNAMELIST.nam similarity index 100% rename from regtests/ww3_tp2.14/input/TOYNAMELIST.nam.OASACM4 rename to regtests/ww3_tp2.14/input_oasacm4/TOYNAMELIST.nam diff --git a/regtests/ww3_tp2.14/input/namcouple.OASACM4 b/regtests/ww3_tp2.14/input_oasacm4/namcouple similarity index 100% rename from regtests/ww3_tp2.14/input/namcouple.OASACM4 rename to regtests/ww3_tp2.14/input_oasacm4/namcouple diff --git a/regtests/ww3_tp2.14/input_oasacm4/namelists_IROISE.nml b/regtests/ww3_tp2.14/input_oasacm4/namelists_IROISE.nml new file mode 100644 index 000000000..8b5707b65 --- /dev/null +++ b/regtests/ww3_tp2.14/input_oasacm4/namelists_IROISE.nml @@ -0,0 +1 @@ +END OF NAMELISTS diff --git a/regtests/ww3_tp2.14/input_oasacm4/prep_env.sh b/regtests/ww3_tp2.14/input_oasacm4/prep_env.sh new file mode 100755 index 000000000..ee03d4033 --- /dev/null +++ b/regtests/ww3_tp2.14/input_oasacm4/prep_env.sh @@ -0,0 +1,101 @@ +#!/bin/bash -e + +if [ $# -ne 4 ] +then + echo "need four arguments:" + echo '$1 : path_i' + echo '$2 : path_w' + echo '$3 : complr' + echo '$4 : switch' + exit 1 +fi + +path_i=$1 +path_w=$2 +cmplr=$3 +swtstr=$4 + +echo '' +echo ' setup coupling environment' +export WWATCH3_DIR=`grep WWATCH3_DIR $WWATCH3_ENV | awk -F' ' '{print $2}' ` +export WWATCH3_CC=`grep WWATCH3_CC $WWATCH3_ENV | awk -F' ' '{print $2}' ` + + +echo ' copy oasis and toy in $path_w' +cp -r $path_i/../input/toy $path_w/ +cp -r $path_i/../input/oasis3-mct $path_w/ + + +echo ' Setup oasis cmplr file' +cd $path_w/oasis3-mct/util/make_dir +source $WWATCH3_DIR/bin/cmplr.env +# shortlist optl +alloptl=( $optl ) +for ioptl in $(seq 2 ${#alloptl[@]}); do + optls="${optls}${alloptl[$ioptl]} " +done +# shortlist optc +alloptc=( $optc ) +for ioptc in $(seq 3 ${#alloptc[@]}); do + optcs="${optcs}${alloptc[$ioptc]} " +done +# shorten comp_mpi +comp_mpi_exe="$(echo $comp_mpi | awk -F' ' '{print $1}')" +# sed cmplr.tmpl +sed -e "s::$path_w/oasis3-mct:" \ + -e "s::$path_w/work_oasis3-mct:" \ + -e "s//$optcs/" -e "s//$optls/" \ + -e "s//$comp_mpi/" -e "s//$comp_mpi_exe/" \ + -e "s//$WWATCH3_CC/" cmplr.tmpl > cmplr +echo " sed cmplr.tmpl => cmplr" +chmod 775 cmplr + + +echo ' setup oasis make.inc file' +sed -e "s::$path_w/oasis3-mct:" make.inc.tmpl > make.inc + + +echo ' compile oasis coupler' +make realclean -f TopMakefileOasis3 > $path_w/oasis_clean.out +make -f TopMakefileOasis3 > $path_w/oasis_make.out + + +echo ' setup toy Makefile' +cd $path_w/toy +sed -e "s::$path_w/oasis3-mct:" Makefile.tmpl > Makefile + + +echo ' compile toy model' +make clean > $path_w/toy_clean.out +make > $path_w/toy_make.out + + +echo ' copy oasis coupler inputs' +cp $path_i/namcouple $path_w/namcouple + + +echo ' copy toy model inputs' +if [ -f $path_w/toy/r-toy.nc.$swtstr ]; then + cp $path_w/toy/r-toy.nc.$swtstr $path_w/r-toy.nc +else + echo "WARNING: model input $path_w/toy/r-toy.nc.$swtstr does not exist" +fi + +cp $path_w/toy/grid_toy_model.nc $path_w/ +cp $path_w/toy/toy_coupled_field.nc.$swtstr $path_w/toy_coupled_field.nc +cp $path_w/toy/toy_model $path_w/ + +cp $path_i/TOYNAMELIST.nam $path_w/TOYNAMELIST.nam + + +echo ' copy ww3 model inputs' +cd $path_w +if [ -f $path_i/r-ww3.nc ]; then + cp $path_i/r-ww3.nc $path_w/r-ww3.nc +else + echo "WARNING: model input $path_i/toy/r-ww3.nc does not exist" +fi + + + +echo '' diff --git a/regtests/ww3_tp2.14/input/switch_OASACM4 b/regtests/ww3_tp2.14/input_oasacm4/switch_OASACM4 similarity index 100% rename from regtests/ww3_tp2.14/input/switch_OASACM4 rename to regtests/ww3_tp2.14/input_oasacm4/switch_OASACM4 diff --git a/regtests/ww3_tp2.14/input_oasacm4/ww3_grid.inp b/regtests/ww3_tp2.14/input_oasacm4/ww3_grid.inp new file mode 100755 index 000000000..e367379b4 --- /dev/null +++ b/regtests/ww3_tp2.14/input_oasacm4/ww3_grid.inp @@ -0,0 +1,276 @@ +$ -------------------------------------------------------------------- $ +$ WAVEWATCH III Grid preprocessor input file $ +$ -------------------------------------------------------------------- $ +$ Grid name (C*30, in quotes) +$ + 'IROISE 1.5KM' +$ +$ Frequency increment factor and first frequency (Hz) ---------------- $ +$ number of frequencies (wavenumbers) and directions +$ +1.1 0.0373 32 24 0. +$ +$ Set model flags ---------------------------------------------------- $ +$ - FLDRY Dry run (input/output only, no calculation). +$ - FLCX, FLCY Activate X and Y component of propagation. +$ - FLCTH, FLCK Activate direction and wavenumber shifts. +$ - FLSOU Activate source terms. +$ + F T T T T T +$ +$ Set time steps ----------------------------------------------------- $ +$ - Time step information (this information is always read) +$ maximum global time step, maximum CFL time step for x-y and +$ k-theta, minimum source term time step (all in seconds). +$ + 180. 45. 45. 10. +$ +$ Start of namelist input section ------------------------------------ $ +$ Starting with WAVEWATCH III version 2.00, the tunable parameters +$ for source terms, propagation schemes, and numerics are read using +$ namelists. Any namelist found in the folowing sections up to the +$ end-of-section identifier string (see below) is temporarily written +$ to ww3_grid.scratch, and read from there if necessary. Namelists +$ not needed for the given switch settings will be skipped +$ automatically, and the order of the namelists is immaterial. +$ As an example, namelist input to change SWELLF and ZWND in the +$ Tolman and Chalikov input would be +$ +$ &SIN2 SWELLF = 0.1, ZWND = 15. / +$ +$ Define constants in source terms ----------------------------------- $ +$ +$ Input - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +$ WAM-3 : Namelist SIN1 +$ CINP : Proportionality constant. +$ &SIN1 CINP= 0.25 / +$ Tolman and Chalikov : Namelist SIN2 +$ ZWND : Height of wind (m). +$ SWELLF : swell factor in (2.48). +$ STABSH, STABOF, CNEG, CPOS, FNEG : +$ c0, ST0, c1, c2 and f1 in . (2.63) +$ through (2.65) for definition of +$ effective wind speed (!/STAB2). +$ +$ Nonlinear interactions - - - - - - - - - - - - - - - - - - - - - - - +$ Discrete I.A. : Namelist SNL1 +$ LAMBDA : Lambda in source term. +$ NLPROP : C in sourc term. NOTE : default +$ value depends on other source +$ terms selected. +$ KDCONV : Factor before kd in Eq. (2.24). +$ KDMIN, SNLCS1, SNLCS2, SNLCS3 : +$ Minimum kd, and constants c1-3 +$ in depth scaling function. +$ Exact interactions : Namelist SNL2 +$ IQTYPE : Type of depth treatment +$ 1 : Deep water +$ 2 : Deep water / WAM scaling +$ 3 : Shallow water +$ TAILNL : Parametric tail power. +$ NDEPTH : Number of depths in for which +$ integration space is established. +$ Used for IQTYPE = 3 only +$ Namelist ANL2 +$ DEPTHS : Array with depths for NDEPTH = 3 +$ +$ Dissipation - - - - - - - - - - - - - - - - - - - - - - - - - - - - +$ WAM-3 : Namelist SDS1 +$ CDIS, APM : As in source term. +$ +$ Tolman and Chalikov : Namelist SDS2 +$ SDSA0, SDSA1, SDSA2, SDSB0, SDSB1, PHIMIN : +$ Constants a0, a1, a2, b0, b1 and +$ PHImin. +$ +$ Bottom friction - - - - - - - - - - - - - - - - - - - - - - - - - - +$ JONSWAP : Namelist SBT1 +$ GAMMA : As it says. +$ +$ Propagation schemes ------------------------------------------------ $ +$ First order : Namelist PRO1 +$ CFLTM : Maximum CFL number for refraction. +$ +$ UQ with diffusion : Namelist PRO2 +$ CFLTM : Maximum CFL number for refraction. +$ FLSOFT : Flag for 'soft' land boundaries. +$ DTIME : Swell age (s) in garden sprinkler +$ correction. If 0., all diffusion +$ switched off. If small non-zero +$ (DEFAULT !!!) only wave growth +$ diffusion. +$ LATMIN : Maximum latitude used in calc. of +$ strength of diffusion for prop. +$ +$ UQ with averaging : Namelist PRO3 +$ CFLTM : Maximum CFL number for refraction. +$ FLSOFT : Flag for 'soft' land boundaries. +$ WDTHCG : Tuning factor propag. direction. +$ WDTHTH : Tuning factor normal direction. +$ +$ UQ with divergence : Namelist PRO4 +$ CFLTM : Maximum CFL number for refraction. +$ FLSOFT : Flag for 'soft' land boundaries. +$ QTFAC : Tuning factor Eq. (3.41). +$ RSFAC : Tuning factor Eq. (3.42). +$ RNFAC : Tuning factor Eq. (3.43). +$ +$ Miscellaneous ------------------------------------------------------ $ +$ Misc. parameters : Namelist MISC +$ CICE0 : Ice concentration cut-off. +$ CICEN : Ice concentration cut-off. +$ XSEED : Xseed in seeding alg. (!/SEED). +$ FLAGTR : Indicating presence and type of +$ subgrid information : +$ 0 : No subgrid information. +$ 1 : Transparancies at cell boun- +$ daries between grid points. +$ 2 : Transp. at cell centers. +$ 3 : Like 1 with cont. ice. +$ 4 : Like 2 with cont. ice. +$ XP, XR, XFILT +$ Xp, Xr and Xf for the dynamic +$ integration scheme. +$ +$ In the 'Out of the box' test setup we run with sub-grid obstacles +$ and with continuous ice treatment. +$ +$ &MISC CICE0 = 0.25, CICEN = 0.75, FLAGTR = 4 / +$ +$ Mandatory string to identify end of namelist input section. +$ +END OF NAMELISTS +$ +$ Define grid -------------------------------------------------------- $ +$ Four records containing : +$ 1 NX, NY. As the outer grid lines are always defined as land +$ points, the minimum size is 3x3. +$ 2 Grid increments SX, SY (degr.or m) and scaling (division) factor. +$ If NX*SX = 360., latitudinal closure is applied. +$ 3 Coordinates of (1,1) (degr.) and scaling (division) factor. +$ 4 Limiting bottom depth (m) to discriminate between land and sea +$ points, minimum water depth (m) as allowed in model, unit number +$ of file with bottom depths, scale factor for bottom depths (mult.), +$ IDLA, IDFM, format for formatted read, FROM and filename. +$ IDLA : Layout indicator : +$ 1 : Read line-by-line bottom to top. +$ 2 : Like 1, single read statement. +$ 3 : Read line-by-line top to bottom. +$ 4 : Like 3, single read statement. +$ IDFM : format indicator : +$ 1 : Free format. +$ 2 : Fixed format with above format descriptor. +$ 3 : Unformatted. +$ FROM : file type parameter +$ 'UNIT' : open file by unit number only. +$ 'NAME' : open file by name and assign to unit. +$ +$ Example for longitude-latitude grid (switch !/LLG), for Cartesian +$ grid the unit is meters (NOT km). +$ + 'RECT' T 'NONE' + 103 119 + 0.019 0.0125 1. + -6.119 47.6375 1. + 0.0 1.0 20 -1. 1 1 '(20f10.2)' 'NAME' '../input/iro_1p5k.bot' +$ +$ If the above unit number equals 10, the bottom data is read from +$ this file and follows below (no intermediate comment lines allowed). +$ +$ 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 +$ +$ If sub-grid information is avalaible as indicated by FLAGTR above, +$ additional input to define this is needed below. In such cases a +$ field of fractional obstructions at or between grid points needs to +$ be supplied. First the location and format of the data is defined +$ by (as above) : +$ - Unit number of file (can be 10, and/or identical to bottem depth +$ unit), scale factor for fractional obstruction, IDLA, IDFM, +$ format for formatted read, FROM and filename +$ +$ 10 0.2 3 1 '(....)' 'NAME' 'obstr.inp' +$ +$ *** NOTE if this unit number is the same as the previous bottom +$ depth unit number, it is assumed that this is the same file +$ without further checks. *** +$ +$ If the above unit number equals 10, the bottom data is read from +$ this file and follows below (no intermediate comment lines allowed, +$ except between the two fields). +$ +$ 0 0 0 0 0 0 0 0 0 0 0 0 +$ 0 0 0 0 0 0 0 0 0 0 0 0 +$ 0 0 0 0 0 0 0 0 0 0 0 0 +$ 0 0 0 0 0 0 0 0 0 0 0 0 +$ 0 0 0 0 0 0 0 0 0 0 0 0 +$ 0 0 0 0 0 0 5 0 0 0 0 0 +$ 0 0 0 0 0 0 5 0 0 0 0 0 +$ 0 0 0 0 0 0 4 0 0 0 0 0 +$ 0 0 0 0 0 0 4 0 0 0 0 0 +$ 0 0 0 0 0 0 5 0 0 0 0 0 +$ 0 0 0 0 0 0 5 0 0 0 0 0 +$ 0 0 0 0 0 0 0 0 0 0 0 0 +$ +$ 0 0 0 0 0 0 0 0 0 0 0 0 +$ 0 0 0 0 0 0 0 0 0 0 0 0 +$ 0 0 0 0 0 0 0 0 0 0 0 0 +$ 0 0 0 0 0 0 0 0 0 0 0 0 +$ 0 0 0 0 0 0 0 0 5 5 5 0 +$ 0 0 0 0 0 0 0 0 0 0 0 0 +$ 0 0 0 0 0 0 0 0 0 0 0 0 +$ 0 0 0 0 0 0 0 0 0 0 0 0 +$ 0 0 0 0 0 0 0 0 0 0 0 0 +$ 0 0 0 0 0 0 0 0 0 0 0 0 +$ 0 0 0 0 0 0 0 0 0 0 0 0 +$ 0 0 0 0 0 0 0 0 0 0 0 0 +$ +$ *** NOTE size of fields is always NX * NY *** +$ + 10 3 1 '(....)' 'PART' 'mapsta.inp' +$ *** NOTE size of fields is always NX * NY *** +$ +$ Input boundary points ---------------------------------------------- $ +$ An unlimited number of lines identifying points at which input +$ boundary conditions are to be defined. If the actual input data is +$ not defined in the actual wave model run, the initial conditions +$ will be applied as constant boundary conditions. Each line contains: +$ Discrete grid counters (IX,IY) of the active point and a +$ connect flag. If this flag is true, and the present and previous +$ point are on a grid line or diagonal, all intermediate points +$ are also defined as boundary points. +$ + 103 86 F + 103 119 T + 1 119 T + 1 1 T + 103 1 T + 103 11 T +$ +$ Close list by defining point (0,0) (mandatory) +$ + 0 0 F +$ Excluded grid points from segment data ( FROM != PART ) +$ First defined as lines, identical to the definition of the input +$ boundary points, and closed the same way. +$ + 0 0 F +$ +$ Second, define a point in a closed body of sea points to remove +$ the entire body os sea points. Also close by point (0,0) +$ + 0 0 +$ +$ Output boundary points --------------------------------------------- $ +$ Output boundary points are defined as a number of straight lines, +$ defined by its starting point (X0,Y0), increments (DX,DY) and number +$ of points. A negative number of points starts a new output file. +$ Note that this data is only generated if requested by the actual +$ program. Example again for spherical grid in degrees. +$ +$ Close list by defining line with 0 points (mandatory) +$ + 0. 0. 0. 0. 0 +$ +$ -------------------------------------------------------------------- $ +$ End of input file $ +$ -------------------------------------------------------------------- $ diff --git a/regtests/ww3_tp2.14/input_oasacm4/ww3_grid.nml b/regtests/ww3_tp2.14/input_oasacm4/ww3_grid.nml new file mode 100644 index 000000000..8e5d957f3 --- /dev/null +++ b/regtests/ww3_tp2.14/input_oasacm4/ww3_grid.nml @@ -0,0 +1,276 @@ +! -------------------------------------------------------------------- ! +! WAVEWATCH III - ww3_grid.nml - Grid pre-processing ! +! -------------------------------------------------------------------- ! + +! -------------------------------------------------------------------- ! +! Define the spectrum parameterization via SPECTRUM_NML namelist +! +! * namelist must be terminated with / +! * definitions & defaults: +! SPECTRUM%XFR = 0. ! frequency increment +! SPECTRUM%FREQ1 = 0. ! first frequency (Hz) +! SPECTRUM%NK = 0 ! number of frequencies (wavenumbers) +! SPECTRUM%NTH = 0 ! number of direction bins +! SPECTRUM%THOFF = 0. ! relative offset of first direction [-0.5,0.5] +! -------------------------------------------------------------------- ! +&SPECTRUM_NML + SPECTRUM%XFR = 1.1 + SPECTRUM%FREQ1 = 0.0373 + SPECTRUM%NK = 32 + SPECTRUM%NTH = 24 +/ + +! -------------------------------------------------------------------- ! +! Define the run parameterization via RUN_NML namelist +! +! * namelist must be terminated with / +! * definitions & defaults: +! RUN%FLDRY = F ! dry run (I/O only, no calculation) +! RUN%FLCX = F ! x-component of propagation +! RUN%FLCY = F ! y-component of propagation +! RUN%FLCTH = F ! direction shift +! RUN%FLCK = F ! wavenumber shift +! RUN%FLSOU = F ! source terms +! -------------------------------------------------------------------- ! +&RUN_NML + RUN%FLCX = T + RUN%FLCY = T + RUN%FLCTH = T + RUN%FLCK = T + RUN%FLSOU = T +/ + +! -------------------------------------------------------------------- ! +! Define the timesteps parameterization via TIMESTEPS_NML namelist +! +! * It is highly recommended to set up time steps which are multiple +! between them. +! +! * The first time step to calculate is the maximum CFL time step +! which depend on the lowest frequency FREQ1 previously set up and the +! lowest spatial grid resolution in meters DXY. +! reminder : 1 degree=60minutes // 1minute=1mile // 1mile=1.852km +! The formula for the CFL time is : +! Tcfl = DXY / (G / (FREQ1*4*Pi) ) with the constants Pi=3,14 and G=9.8m/s²; +! DTXY ~= 90% Tcfl +! DTMAX ~= 3 * DTXY (maximum global time step limit) +! +! * The refraction time step depends on how strong can be the current velocities +! on your grid : +! DTKTH ~= DTMAX / 2 ! in case of no or light current velocities +! DTKTH ~= DTMAX / 10 ! in case of strong current velocities +! +! * The source terms time step is usually defined between 5s and 60s. +! A common value is 10s. +! DTMIN ~= 10 +! +! * namelist must be terminated with / +! * definitions & defaults: +! TIMESTEPS%DTMAX = 0. ! maximum global time step (s) +! TIMESTEPS%DTXY = 0. ! maximum CFL time step for x-y (s) +! TIMESTEPS%DTKTH = 0. ! maximum CFL time step for k-th (s) +! TIMESTEPS%DTMIN = 0. ! minimum source term time step (s) +! -------------------------------------------------------------------- ! +&TIMESTEPS_NML + TIMESTEPS%DTMAX = 180. + TIMESTEPS%DTXY = 45. + TIMESTEPS%DTKTH = 45. + TIMESTEPS%DTMIN = 10. +/ + +! -------------------------------------------------------------------- ! +! Define the grid to preprocess via GRID_NML namelist +! +! * the tunable parameters for source terms, propagation schemes, and +! numerics are read using namelists. +! * Any namelist found in the folowing sections is temporarily written +! to param.scratch, and read from there if necessary. +! * The order of the namelists is immaterial. +! * Namelists not needed for the given switch settings will be skipped +! automatically +! +! * grid type can be : +! 'RECT' : rectilinear +! 'CURV' : curvilinear +! 'UNST' : unstructured (triangle-based) +! +! * coordinate system can be : +! 'SPHE' : Spherical (degrees) +! 'CART' : Cartesian (meters) +! +! * grid closure can only be applied in spherical coordinates +! +! * grid closure can be : +! 'NONE' : No closure is applied +! 'SMPL' : Simple grid closure. Grid is periodic in the +! : i-index and wraps at i=NX+1. In other words, +! : (NX+1,J) => (1,J). A grid with simple closure +! : may be rectilinear or curvilinear. +! 'TRPL' : Tripole grid closure : Grid is periodic in the +! : i-index and wraps at i=NX+1 and has closure at +! : j=NY+1. In other words, (NX+1,J<=NY) => (1,J) +! : and (I,NY+1) => (NX-I+1,NY). Tripole +! : grid closure requires that NX be even. A grid +! : with tripole closure must be curvilinear. +! +! * The coastline limit depth is the value which distinguish the sea +! points to the land points. All the points with depth values (ZBIN) +! greater than this limit (ZLIM) will be considered as excluded points +! and will never be wet points, even if the water level grows over. +! It can only overwrite the status of a sea point to a land point. +! The value must have a negative value under the mean sea level +! +! * The minimum water depth allowed to compute the model is the absolute +! depth value (DMIN) used in the model if the input depth is lower to +! avoid the model to blow up. +! +! * namelist must be terminated with / +! * definitions & defaults: +! GRID%NAME = 'unset' ! grid name (30 char) +! GRID%NML = 'namelists.nml' ! namelists filename +! GRID%TYPE = 'unset' ! grid type +! GRID%COORD = 'unset' ! coordinate system +! GRID%CLOS = 'unset' ! grid closure +! +! GRID%ZLIM = 0. ! coastline limit depth (m) +! GRID%DMIN = 0. ! abs. minimum water depth (m) +! -------------------------------------------------------------------- ! +&GRID_NML + GRID%NAME = 'IROISE 1.5KM' + GRID%NML = '../input_oasacm4/namelists_IROISE.nml' + GRID%TYPE = 'RECT' + GRID%COORD = 'SPHE' + GRID%CLOS = 'NONE' + GRID%ZLIM = 0.0 + GRID%DMIN = 1.0 +/ + +! -------------------------------------------------------------------- ! +! Define the rectilinear grid type via RECT_NML namelist +! - only for RECT grids - +! +! * The minimum grid size is 3x3. +! +! * If the grid increments SX and SY are given in minutes of arc, the scaling +! factor SF must be set to 60. to provide an increment factor in degree. +! +! * If CSTRG='SMPL', then SX is forced to 360/NX. +! +! * value <= value_read / scale_fac +! +! * namelist must be terminated with / +! * definitions & defaults: +! RECT%NX = 0 ! number of points along x-axis +! RECT%NY = 0 ! number of points along y-axis +! +! RECT%SX = 0. ! grid increment along x-axis +! RECT%SY = 0. ! grid increment along y-axis +! RECT%SF = 1. ! scaling division factor for x-y axis +! +! RECT%X0 = 0. ! x-coordinate of lower-left corner (deg) +! RECT%Y0 = 0. ! y-coordinate of lower-left corner (deg) +! RECT%SF0 = 1. ! scaling division factor for x0,y0 coord +! -------------------------------------------------------------------- ! +&RECT_NML + RECT%NX = 103 + RECT%NY = 119 + RECT%SX = 0.019 + RECT%SY = 0.0125 + RECT%X0 = -6.119 + RECT%Y0 = 47.6375 +/ + +! -------------------------------------------------------------------- ! +! Define the depth to preprocess via DEPTH_NML namelist +! - for RECT and CURV grids - +! +! * if no obstruction subgrid, need to set &MISC FLAGTR = 0 +! +! * The depth value must have negative values under the mean sea level +! +! * value <= value_read * scale_fac +! +! * IDLA : Layout indicator : +! 1 : Read line-by-line bottom to top. (default) +! 2 : Like 1, single read statement. +! 3 : Read line-by-line top to bottom. +! 4 : Like 3, single read statement. +! * IDFM : format indicator : +! 1 : Free format. (default) +! 2 : Fixed format. +! 3 : Unformatted. +! * FORMAT : element format to read : +! '(....)' : auto detected (default) +! '(f10.6)' : float type +! +! * Example : +! IDF SF IDLA IDFM FORMAT FILENAME +! 50 0.001 1 1 '(....)' 'GLOB-30M.bot' +! +! * namelist must be terminated with / +! * definitions & defaults: +! DEPTH%SF = 1. ! scale factor +! DEPTH%FILENAME = 'unset' ! filename +! DEPTH%IDF = 50 ! file unit number +! DEPTH%IDLA = 1 ! layout indicator +! DEPTH%IDFM = 1 ! format indicator +! DEPTH%FORMAT = '(....)' ! formatted read format +! -------------------------------------------------------------------- ! +&DEPTH_NML + DEPTH%SF = -1. + DEPTH%FILENAME = '../input/iro_1p5k.bot' + DEPTH%FORMAT = '(20f10.2)' +/ + +! -------------------------------------------------------------------- ! +! Define the input boundary points via INBND_COUNT_NML and +! INBND_POINT_NML namelist +! - for RECT, CURV and UNST grids - +! +! * If no mask defined, INBOUND can be used +! +! * If the actual input data is not defined in the actual wave model run +! the initial conditions will be applied as constant boundary conditions. +! +! * The number of points is defined by INBND_COUNT +! +! * The points must start from index 1 to N +! +! * Each line contains: +! Discrete grid counters (IX,IY) of the active point and a +! connect flag. If this flag is true, and the present and previous +! point are on a grid line or diagonal, all intermediate points +! are also defined as boundary points. +! +! * Included point : +! grid points from segment data +! Defines as lines identifying points at which +! input boundary conditions are to be defined. +! +! * namelist must be terminated with / +! * definitions & defaults: +! INBND_COUNT%N_POINT = 0 ! number of segments +! +! INBND_POINT(I)%X_INDEX = 0 ! x index included point +! INBND_POINT(I)%Y_INDEX = 0 ! y index included point +! INBND_POINT(I)%CONNECT = F ! connect flag +! +! OR +! INBND_POINT(I) = 0 0 F ! included point +! -------------------------------------------------------------------- ! +&INBND_COUNT_NML + INBND_COUNT%N_POINT = 6 +/ + +&INBND_POINT_NML + INBND_POINT(1) = 103 86 F + INBND_POINT(2) = 103 119 T + INBND_POINT(3) = 1 119 T + INBND_POINT(4) = 1 1 T + INBND_POINT(5) = 103 1 T + INBND_POINT(6) = 103 11 T +/ + +! -------------------------------------------------------------------- ! +! WAVEWATCH III - end of namelist ! +! -------------------------------------------------------------------- ! diff --git a/regtests/ww3_tp2.14/input_oasacm4/ww3_ounf.inp b/regtests/ww3_tp2.14/input_oasacm4/ww3_ounf.inp new file mode 100755 index 000000000..b8bbf80f6 --- /dev/null +++ b/regtests/ww3_tp2.14/input_oasacm4/ww3_ounf.inp @@ -0,0 +1,41 @@ +$ -------------------------------------------------------------------- $ +$ WAVEWATCH III Grid output post-processing $ +$--------------------------------------------------------------------- $ +$ First output time (yyyymmdd hhmmss), increment of output (s), +$ and number of output times. +$ + 20080310 000000 180 100 +$ +$ Output request flags identifying fields as in ww3_shel.inp. See that +$ file for a full documentation of field output options. Namelist type +$ selection is used here (for alternative F/T flags, see ww3_shel.inp). +$ + N + HS FP DIR DP CHA UST DPT CUR WND +$ +$--------------------------------------------------------------------- $ +$ netCDF version [3,4] +$ and variable type 4 [2 = SHORT, 3 = it depends , 4 = REAL] +$ swell partitions [0 1 2 3 4 5] +$ variables in same file [T] or not [F] +$ + 3 4 + 0 + T +$ +$ -------------------------------------------------------------------- $ +$ File prefix +$ number of characters in date [0(nodate),4(yearly),6(monthly),8(daily),10(hourly)] +$ IX and IY ranges [regular:IX NX IY NY DX DY, unstructured:IP NP DP DP] +$ +ww3. +6 +1 10000 1 10000 +$ +$ For each field and time a new file is generated with the file name +$ ww3.date_xxx.nc , where date is a conventional time indicator with S3 +$ characters, and xxx is a field identifier. +$ +$ -------------------------------------------------------------------- $ +$ End of input file $ +$ -------------------------------------------------------------------- $ diff --git a/regtests/ww3_tp2.14/input_oasacm4/ww3_ounf.nml b/regtests/ww3_tp2.14/input_oasacm4/ww3_ounf.nml new file mode 100644 index 000000000..fc0386ff8 --- /dev/null +++ b/regtests/ww3_tp2.14/input_oasacm4/ww3_ounf.nml @@ -0,0 +1,60 @@ +! -------------------------------------------------------------------- ! +! WAVEWATCH III ww3_ounf.nml - Grid output post-processing ! +! -------------------------------------------------------------------- ! + +! -------------------------------------------------------------------- ! +! Define the output fields to postprocess via FIELD_NML namelist +! +! * the detailed list of field names FIELD%LIST is given in ww3_shel.nml +! DPT CUR WND AST WLV ICE IBG D50 IC1 IC5 +! HS LM T02 T0M1 T01 FP DIR SPR DP HIG +! EF TH1M STH1M TH2M STH2M WN +! PHS PTP PLP PDIR PSPR PWS PDP PQP PPE PGW PSW PTM10 PT01 PT02 PEP TWS PNR +! UST CHA CGE FAW TAW TWA WCC WCF WCH WCM FWS +! SXY TWO BHD FOC TUS USS P2S USF P2L TWI FIC +! ABR UBR BED FBB TBB +! MSS MSC WL02 AXT AYT AXY +! DTD FC CFX CFD CFK +! U1 U2 +! +! * namelist must be terminated with / +! * definitions & defaults: +! FIELD%TIMESTART = '19000101 000000' ! Stop date for the output field +! FIELD%TIMESTRIDE = '0' ! Time stride for the output field +! FIELD%TIMESTOP = '29001231 000000' ! Stop date for the output field +! FIELD%TIMECOUNT = '1000000000' ! Number of time steps +! FIELD%TIMESPLIT = 6 ! [0(nodate),4(yearly),6(monthly),8(daily),10(hourly)] +! FIELD%LIST = 'unset' ! List of output fields +! FIELD%PARTITION = '0 1 2 3' ! List of wave partitions ['0 1 2 3 4 5'] +! FIELD%SAMEFILE = T ! All the variables in the same file [T|F] +! FIELD%TYPE = 3 ! [2 = SHORT, 3 = it depends , 4 = REAL] +! -------------------------------------------------------------------- ! +&FIELD_NML + FIELD%TIMESTART = '20080310 000000' + FIELD%TIMESTRIDE = '180' + FIELD%TIMECOUNT = '100' + FIELD%LIST = 'HS FP DIR DP CHA UST DPT CUR WND' + FIELD%PARTITION = '0' + FIELD%TYPE = 4 +/ + +! -------------------------------------------------------------------- ! +! Define the content of the output file via FILE_NML namelist +! +! * namelist must be terminated with / +! * definitions & defaults: +! FILE%PREFIX = 'ww3.' ! Prefix for output file name +! FILE%NETCDF = 3 ! Netcdf version [3|4] +! FILE%IX0 = 1 ! First X-axis or node index +! FILE%IXN = 1000000000 ! Last X-axis or node index +! FILE%IY0 = 1 ! First Y-axis index +! FILE%IYN = 1000000000 ! Last Y-axis index +! -------------------------------------------------------------------- ! +&FILE_NML + FILE%IXN = 10000 + FILE%IYN = 10000 +/ + +! -------------------------------------------------------------------- ! +! WAVEWATCH III - end of namelist ! +! -------------------------------------------------------------------- ! diff --git a/regtests/ww3_tp2.14/input/ww3_shel_OASACM4.inp b/regtests/ww3_tp2.14/input_oasacm4/ww3_shel.inp similarity index 100% rename from regtests/ww3_tp2.14/input/ww3_shel_OASACM4.inp rename to regtests/ww3_tp2.14/input_oasacm4/ww3_shel.inp diff --git a/regtests/ww3_tp2.14/input/ww3_shel_OASACM4.nml b/regtests/ww3_tp2.14/input_oasacm4/ww3_shel.nml similarity index 94% rename from regtests/ww3_tp2.14/input/ww3_shel_OASACM4.nml rename to regtests/ww3_tp2.14/input_oasacm4/ww3_shel.nml index 74b1348fa..4ee10f9e0 100644 --- a/regtests/ww3_tp2.14/input/ww3_shel_OASACM4.nml +++ b/regtests/ww3_tp2.14/input_oasacm4/ww3_shel.nml @@ -44,6 +44,8 @@ ! INPUT%FORCING%WATER_LEVELS = 'F' ! INPUT%FORCING%CURRENTS = 'F' ! INPUT%FORCING%WINDS = 'F' +! INPUT%FORCING%ATM_MOMENTUM = 'F' +! INPUT%FORCING%AIR_DENSITY = 'F' ! INPUT%FORCING%ICE_CONC = 'F' ! INPUT%FORCING%ICE_PARAM1 = 'F' ! INPUT%FORCING%ICE_PARAM2 = 'F' @@ -64,7 +66,7 @@ ! -------------------------------------------------------------------- ! ! Define the output types point parameters via OUTPUT_TYPE_NML namelist ! -! * the point file is a space separated values per line : lon lat 'name' +! * the point file is a space separated values per line : ! longitude latitude 'name' (C*40) ! ! * the full list of field names is : @@ -94,9 +96,11 @@ ! T T 1 5 WLV WLV Water levels. ! T T 1 6 ICE ICE Ice concentration. ! T T 1 7 IBG IBG Iceberg-induced damping. -! T T 1 8 D50 D50 Median sediment grain size. -! T T 1 9 IC1 IC1 Ice thickness. -! T T 1 10 IC5 IC5 Ice flow diameter. +! T T 1 8 TAUA TAU Atm. momentum. +! T T 1 9 RHOAIR RHO Air density. +! T T 1 10 D50 D50 Median sediment grain size. +! T T 1 11 IC1 IC1 Ice thickness. +! T T 1 12 IC5 IC5 Ice flow diameter. ! ------------------------------------------------- ! 2 Standard mean wave Parameters ! ------------------------------------------------- @@ -117,6 +121,7 @@ ! T T 2 15 HMAXD SDMH St Dev of MXC (STE) ! T T 2 16 HCMAXD SDMHC St Dev of MXHC (STE) ! F T 2 17 WBT WBT Domiant wave breaking probability bT +! F F 2 18 FP0 TP Peak period (from peak freq) ! ------------------------------------------------- ! 3 Spectral Parameters (first 5) ! ------------------------------------------------- @@ -174,6 +179,7 @@ ! F F 6 9 P2SMS P2L Micro seism source term ! F F 6 10 TAUICE TWI Wave to sea ice stress ! F F 6 11 PHICE FIC Wave to sea ice energy flux +! F F 6 12 USSP USP Partitioned surface Stokes drift ! ------------------------------------------------- ! 7 Wave-bottom layer ! ------------------------------------------------- @@ -219,9 +225,14 @@ ! - Ice model : IC5 TWI ! - Received fields by ww3: ! - Ocean model : SSH CUR -! - Atmospheric model : WND +! - Atmospheric model : WND TAU RHO ! - Ice model : ICE IC1 IC5 ! +! * Coupling flag (T) or (F) at T+0 (extra fields in the restart needed) +! +! * extra fields to be written to the restart: +! - The list includes all fields sent by coupling exchange only +! ! * namelist must be terminated with / ! * definitions & defaults: ! TYPE%FIELD%LIST = 'unset' @@ -236,13 +247,15 @@ ! TYPE%PARTITION%FORMAT = T ! TYPE%COUPLING%SENT = 'unset' ! TYPE%COUPLING%RECEIVED = 'unset' +! TYPE%COUPLING%COUPLET0 = F +! TYPE%RESTART%EXTRA = 'unset' ! ! -------------------------------------------------------------------- ! &OUTPUT_TYPE_NML TYPE%FIELD%LIST = 'HS FP DIR DP CHA UST DPT CUR WND' TYPE%COUPLING%SENT = 'ACHA' TYPE%COUPLING%RECEIVED = 'WND' - TYPE%COUPLING%COUPLET0 = .TRUE. + TYPE%COUPLING%COUPLET0 = T TYPE%RESTART%EXTRA = 'CHA RHO' / diff --git a/regtests/ww3_tp2.14/input/TOYNAMELIST.nam.OASACM5 b/regtests/ww3_tp2.14/input_oasacm5/TOYNAMELIST.nam similarity index 100% rename from regtests/ww3_tp2.14/input/TOYNAMELIST.nam.OASACM5 rename to regtests/ww3_tp2.14/input_oasacm5/TOYNAMELIST.nam diff --git a/regtests/ww3_tp2.14/input/namcouple.OASACM5 b/regtests/ww3_tp2.14/input_oasacm5/namcouple similarity index 100% rename from regtests/ww3_tp2.14/input/namcouple.OASACM5 rename to regtests/ww3_tp2.14/input_oasacm5/namcouple diff --git a/regtests/ww3_tp2.14/input_oasacm5/namelists_IROISE.nml b/regtests/ww3_tp2.14/input_oasacm5/namelists_IROISE.nml new file mode 100644 index 000000000..8b5707b65 --- /dev/null +++ b/regtests/ww3_tp2.14/input_oasacm5/namelists_IROISE.nml @@ -0,0 +1 @@ +END OF NAMELISTS diff --git a/regtests/ww3_tp2.14/input_oasacm5/prep_env.sh b/regtests/ww3_tp2.14/input_oasacm5/prep_env.sh new file mode 100755 index 000000000..ee03d4033 --- /dev/null +++ b/regtests/ww3_tp2.14/input_oasacm5/prep_env.sh @@ -0,0 +1,101 @@ +#!/bin/bash -e + +if [ $# -ne 4 ] +then + echo "need four arguments:" + echo '$1 : path_i' + echo '$2 : path_w' + echo '$3 : complr' + echo '$4 : switch' + exit 1 +fi + +path_i=$1 +path_w=$2 +cmplr=$3 +swtstr=$4 + +echo '' +echo ' setup coupling environment' +export WWATCH3_DIR=`grep WWATCH3_DIR $WWATCH3_ENV | awk -F' ' '{print $2}' ` +export WWATCH3_CC=`grep WWATCH3_CC $WWATCH3_ENV | awk -F' ' '{print $2}' ` + + +echo ' copy oasis and toy in $path_w' +cp -r $path_i/../input/toy $path_w/ +cp -r $path_i/../input/oasis3-mct $path_w/ + + +echo ' Setup oasis cmplr file' +cd $path_w/oasis3-mct/util/make_dir +source $WWATCH3_DIR/bin/cmplr.env +# shortlist optl +alloptl=( $optl ) +for ioptl in $(seq 2 ${#alloptl[@]}); do + optls="${optls}${alloptl[$ioptl]} " +done +# shortlist optc +alloptc=( $optc ) +for ioptc in $(seq 3 ${#alloptc[@]}); do + optcs="${optcs}${alloptc[$ioptc]} " +done +# shorten comp_mpi +comp_mpi_exe="$(echo $comp_mpi | awk -F' ' '{print $1}')" +# sed cmplr.tmpl +sed -e "s::$path_w/oasis3-mct:" \ + -e "s::$path_w/work_oasis3-mct:" \ + -e "s//$optcs/" -e "s//$optls/" \ + -e "s//$comp_mpi/" -e "s//$comp_mpi_exe/" \ + -e "s//$WWATCH3_CC/" cmplr.tmpl > cmplr +echo " sed cmplr.tmpl => cmplr" +chmod 775 cmplr + + +echo ' setup oasis make.inc file' +sed -e "s::$path_w/oasis3-mct:" make.inc.tmpl > make.inc + + +echo ' compile oasis coupler' +make realclean -f TopMakefileOasis3 > $path_w/oasis_clean.out +make -f TopMakefileOasis3 > $path_w/oasis_make.out + + +echo ' setup toy Makefile' +cd $path_w/toy +sed -e "s::$path_w/oasis3-mct:" Makefile.tmpl > Makefile + + +echo ' compile toy model' +make clean > $path_w/toy_clean.out +make > $path_w/toy_make.out + + +echo ' copy oasis coupler inputs' +cp $path_i/namcouple $path_w/namcouple + + +echo ' copy toy model inputs' +if [ -f $path_w/toy/r-toy.nc.$swtstr ]; then + cp $path_w/toy/r-toy.nc.$swtstr $path_w/r-toy.nc +else + echo "WARNING: model input $path_w/toy/r-toy.nc.$swtstr does not exist" +fi + +cp $path_w/toy/grid_toy_model.nc $path_w/ +cp $path_w/toy/toy_coupled_field.nc.$swtstr $path_w/toy_coupled_field.nc +cp $path_w/toy/toy_model $path_w/ + +cp $path_i/TOYNAMELIST.nam $path_w/TOYNAMELIST.nam + + +echo ' copy ww3 model inputs' +cd $path_w +if [ -f $path_i/r-ww3.nc ]; then + cp $path_i/r-ww3.nc $path_w/r-ww3.nc +else + echo "WARNING: model input $path_i/toy/r-ww3.nc does not exist" +fi + + + +echo '' diff --git a/regtests/ww3_tp2.14/input/switch_OASACM5 b/regtests/ww3_tp2.14/input_oasacm5/switch_OASACM5 similarity index 100% rename from regtests/ww3_tp2.14/input/switch_OASACM5 rename to regtests/ww3_tp2.14/input_oasacm5/switch_OASACM5 diff --git a/regtests/ww3_tp2.14/input_oasacm5/ww3_grid.inp b/regtests/ww3_tp2.14/input_oasacm5/ww3_grid.inp new file mode 100755 index 000000000..e367379b4 --- /dev/null +++ b/regtests/ww3_tp2.14/input_oasacm5/ww3_grid.inp @@ -0,0 +1,276 @@ +$ -------------------------------------------------------------------- $ +$ WAVEWATCH III Grid preprocessor input file $ +$ -------------------------------------------------------------------- $ +$ Grid name (C*30, in quotes) +$ + 'IROISE 1.5KM' +$ +$ Frequency increment factor and first frequency (Hz) ---------------- $ +$ number of frequencies (wavenumbers) and directions +$ +1.1 0.0373 32 24 0. +$ +$ Set model flags ---------------------------------------------------- $ +$ - FLDRY Dry run (input/output only, no calculation). +$ - FLCX, FLCY Activate X and Y component of propagation. +$ - FLCTH, FLCK Activate direction and wavenumber shifts. +$ - FLSOU Activate source terms. +$ + F T T T T T +$ +$ Set time steps ----------------------------------------------------- $ +$ - Time step information (this information is always read) +$ maximum global time step, maximum CFL time step for x-y and +$ k-theta, minimum source term time step (all in seconds). +$ + 180. 45. 45. 10. +$ +$ Start of namelist input section ------------------------------------ $ +$ Starting with WAVEWATCH III version 2.00, the tunable parameters +$ for source terms, propagation schemes, and numerics are read using +$ namelists. Any namelist found in the folowing sections up to the +$ end-of-section identifier string (see below) is temporarily written +$ to ww3_grid.scratch, and read from there if necessary. Namelists +$ not needed for the given switch settings will be skipped +$ automatically, and the order of the namelists is immaterial. +$ As an example, namelist input to change SWELLF and ZWND in the +$ Tolman and Chalikov input would be +$ +$ &SIN2 SWELLF = 0.1, ZWND = 15. / +$ +$ Define constants in source terms ----------------------------------- $ +$ +$ Input - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +$ WAM-3 : Namelist SIN1 +$ CINP : Proportionality constant. +$ &SIN1 CINP= 0.25 / +$ Tolman and Chalikov : Namelist SIN2 +$ ZWND : Height of wind (m). +$ SWELLF : swell factor in (2.48). +$ STABSH, STABOF, CNEG, CPOS, FNEG : +$ c0, ST0, c1, c2 and f1 in . (2.63) +$ through (2.65) for definition of +$ effective wind speed (!/STAB2). +$ +$ Nonlinear interactions - - - - - - - - - - - - - - - - - - - - - - - +$ Discrete I.A. : Namelist SNL1 +$ LAMBDA : Lambda in source term. +$ NLPROP : C in sourc term. NOTE : default +$ value depends on other source +$ terms selected. +$ KDCONV : Factor before kd in Eq. (2.24). +$ KDMIN, SNLCS1, SNLCS2, SNLCS3 : +$ Minimum kd, and constants c1-3 +$ in depth scaling function. +$ Exact interactions : Namelist SNL2 +$ IQTYPE : Type of depth treatment +$ 1 : Deep water +$ 2 : Deep water / WAM scaling +$ 3 : Shallow water +$ TAILNL : Parametric tail power. +$ NDEPTH : Number of depths in for which +$ integration space is established. +$ Used for IQTYPE = 3 only +$ Namelist ANL2 +$ DEPTHS : Array with depths for NDEPTH = 3 +$ +$ Dissipation - - - - - - - - - - - - - - - - - - - - - - - - - - - - +$ WAM-3 : Namelist SDS1 +$ CDIS, APM : As in source term. +$ +$ Tolman and Chalikov : Namelist SDS2 +$ SDSA0, SDSA1, SDSA2, SDSB0, SDSB1, PHIMIN : +$ Constants a0, a1, a2, b0, b1 and +$ PHImin. +$ +$ Bottom friction - - - - - - - - - - - - - - - - - - - - - - - - - - +$ JONSWAP : Namelist SBT1 +$ GAMMA : As it says. +$ +$ Propagation schemes ------------------------------------------------ $ +$ First order : Namelist PRO1 +$ CFLTM : Maximum CFL number for refraction. +$ +$ UQ with diffusion : Namelist PRO2 +$ CFLTM : Maximum CFL number for refraction. +$ FLSOFT : Flag for 'soft' land boundaries. +$ DTIME : Swell age (s) in garden sprinkler +$ correction. If 0., all diffusion +$ switched off. If small non-zero +$ (DEFAULT !!!) only wave growth +$ diffusion. +$ LATMIN : Maximum latitude used in calc. of +$ strength of diffusion for prop. +$ +$ UQ with averaging : Namelist PRO3 +$ CFLTM : Maximum CFL number for refraction. +$ FLSOFT : Flag for 'soft' land boundaries. +$ WDTHCG : Tuning factor propag. direction. +$ WDTHTH : Tuning factor normal direction. +$ +$ UQ with divergence : Namelist PRO4 +$ CFLTM : Maximum CFL number for refraction. +$ FLSOFT : Flag for 'soft' land boundaries. +$ QTFAC : Tuning factor Eq. (3.41). +$ RSFAC : Tuning factor Eq. (3.42). +$ RNFAC : Tuning factor Eq. (3.43). +$ +$ Miscellaneous ------------------------------------------------------ $ +$ Misc. parameters : Namelist MISC +$ CICE0 : Ice concentration cut-off. +$ CICEN : Ice concentration cut-off. +$ XSEED : Xseed in seeding alg. (!/SEED). +$ FLAGTR : Indicating presence and type of +$ subgrid information : +$ 0 : No subgrid information. +$ 1 : Transparancies at cell boun- +$ daries between grid points. +$ 2 : Transp. at cell centers. +$ 3 : Like 1 with cont. ice. +$ 4 : Like 2 with cont. ice. +$ XP, XR, XFILT +$ Xp, Xr and Xf for the dynamic +$ integration scheme. +$ +$ In the 'Out of the box' test setup we run with sub-grid obstacles +$ and with continuous ice treatment. +$ +$ &MISC CICE0 = 0.25, CICEN = 0.75, FLAGTR = 4 / +$ +$ Mandatory string to identify end of namelist input section. +$ +END OF NAMELISTS +$ +$ Define grid -------------------------------------------------------- $ +$ Four records containing : +$ 1 NX, NY. As the outer grid lines are always defined as land +$ points, the minimum size is 3x3. +$ 2 Grid increments SX, SY (degr.or m) and scaling (division) factor. +$ If NX*SX = 360., latitudinal closure is applied. +$ 3 Coordinates of (1,1) (degr.) and scaling (division) factor. +$ 4 Limiting bottom depth (m) to discriminate between land and sea +$ points, minimum water depth (m) as allowed in model, unit number +$ of file with bottom depths, scale factor for bottom depths (mult.), +$ IDLA, IDFM, format for formatted read, FROM and filename. +$ IDLA : Layout indicator : +$ 1 : Read line-by-line bottom to top. +$ 2 : Like 1, single read statement. +$ 3 : Read line-by-line top to bottom. +$ 4 : Like 3, single read statement. +$ IDFM : format indicator : +$ 1 : Free format. +$ 2 : Fixed format with above format descriptor. +$ 3 : Unformatted. +$ FROM : file type parameter +$ 'UNIT' : open file by unit number only. +$ 'NAME' : open file by name and assign to unit. +$ +$ Example for longitude-latitude grid (switch !/LLG), for Cartesian +$ grid the unit is meters (NOT km). +$ + 'RECT' T 'NONE' + 103 119 + 0.019 0.0125 1. + -6.119 47.6375 1. + 0.0 1.0 20 -1. 1 1 '(20f10.2)' 'NAME' '../input/iro_1p5k.bot' +$ +$ If the above unit number equals 10, the bottom data is read from +$ this file and follows below (no intermediate comment lines allowed). +$ +$ 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 +$ +$ If sub-grid information is avalaible as indicated by FLAGTR above, +$ additional input to define this is needed below. In such cases a +$ field of fractional obstructions at or between grid points needs to +$ be supplied. First the location and format of the data is defined +$ by (as above) : +$ - Unit number of file (can be 10, and/or identical to bottem depth +$ unit), scale factor for fractional obstruction, IDLA, IDFM, +$ format for formatted read, FROM and filename +$ +$ 10 0.2 3 1 '(....)' 'NAME' 'obstr.inp' +$ +$ *** NOTE if this unit number is the same as the previous bottom +$ depth unit number, it is assumed that this is the same file +$ without further checks. *** +$ +$ If the above unit number equals 10, the bottom data is read from +$ this file and follows below (no intermediate comment lines allowed, +$ except between the two fields). +$ +$ 0 0 0 0 0 0 0 0 0 0 0 0 +$ 0 0 0 0 0 0 0 0 0 0 0 0 +$ 0 0 0 0 0 0 0 0 0 0 0 0 +$ 0 0 0 0 0 0 0 0 0 0 0 0 +$ 0 0 0 0 0 0 0 0 0 0 0 0 +$ 0 0 0 0 0 0 5 0 0 0 0 0 +$ 0 0 0 0 0 0 5 0 0 0 0 0 +$ 0 0 0 0 0 0 4 0 0 0 0 0 +$ 0 0 0 0 0 0 4 0 0 0 0 0 +$ 0 0 0 0 0 0 5 0 0 0 0 0 +$ 0 0 0 0 0 0 5 0 0 0 0 0 +$ 0 0 0 0 0 0 0 0 0 0 0 0 +$ +$ 0 0 0 0 0 0 0 0 0 0 0 0 +$ 0 0 0 0 0 0 0 0 0 0 0 0 +$ 0 0 0 0 0 0 0 0 0 0 0 0 +$ 0 0 0 0 0 0 0 0 0 0 0 0 +$ 0 0 0 0 0 0 0 0 5 5 5 0 +$ 0 0 0 0 0 0 0 0 0 0 0 0 +$ 0 0 0 0 0 0 0 0 0 0 0 0 +$ 0 0 0 0 0 0 0 0 0 0 0 0 +$ 0 0 0 0 0 0 0 0 0 0 0 0 +$ 0 0 0 0 0 0 0 0 0 0 0 0 +$ 0 0 0 0 0 0 0 0 0 0 0 0 +$ 0 0 0 0 0 0 0 0 0 0 0 0 +$ +$ *** NOTE size of fields is always NX * NY *** +$ + 10 3 1 '(....)' 'PART' 'mapsta.inp' +$ *** NOTE size of fields is always NX * NY *** +$ +$ Input boundary points ---------------------------------------------- $ +$ An unlimited number of lines identifying points at which input +$ boundary conditions are to be defined. If the actual input data is +$ not defined in the actual wave model run, the initial conditions +$ will be applied as constant boundary conditions. Each line contains: +$ Discrete grid counters (IX,IY) of the active point and a +$ connect flag. If this flag is true, and the present and previous +$ point are on a grid line or diagonal, all intermediate points +$ are also defined as boundary points. +$ + 103 86 F + 103 119 T + 1 119 T + 1 1 T + 103 1 T + 103 11 T +$ +$ Close list by defining point (0,0) (mandatory) +$ + 0 0 F +$ Excluded grid points from segment data ( FROM != PART ) +$ First defined as lines, identical to the definition of the input +$ boundary points, and closed the same way. +$ + 0 0 F +$ +$ Second, define a point in a closed body of sea points to remove +$ the entire body os sea points. Also close by point (0,0) +$ + 0 0 +$ +$ Output boundary points --------------------------------------------- $ +$ Output boundary points are defined as a number of straight lines, +$ defined by its starting point (X0,Y0), increments (DX,DY) and number +$ of points. A negative number of points starts a new output file. +$ Note that this data is only generated if requested by the actual +$ program. Example again for spherical grid in degrees. +$ +$ Close list by defining line with 0 points (mandatory) +$ + 0. 0. 0. 0. 0 +$ +$ -------------------------------------------------------------------- $ +$ End of input file $ +$ -------------------------------------------------------------------- $ diff --git a/regtests/ww3_tp2.14/input_oasacm5/ww3_grid.nml b/regtests/ww3_tp2.14/input_oasacm5/ww3_grid.nml new file mode 100644 index 000000000..234443601 --- /dev/null +++ b/regtests/ww3_tp2.14/input_oasacm5/ww3_grid.nml @@ -0,0 +1,276 @@ +! -------------------------------------------------------------------- ! +! WAVEWATCH III - ww3_grid.nml - Grid pre-processing ! +! -------------------------------------------------------------------- ! + +! -------------------------------------------------------------------- ! +! Define the spectrum parameterization via SPECTRUM_NML namelist +! +! * namelist must be terminated with / +! * definitions & defaults: +! SPECTRUM%XFR = 0. ! frequency increment +! SPECTRUM%FREQ1 = 0. ! first frequency (Hz) +! SPECTRUM%NK = 0 ! number of frequencies (wavenumbers) +! SPECTRUM%NTH = 0 ! number of direction bins +! SPECTRUM%THOFF = 0. ! relative offset of first direction [-0.5,0.5] +! -------------------------------------------------------------------- ! +&SPECTRUM_NML + SPECTRUM%XFR = 1.1 + SPECTRUM%FREQ1 = 0.0373 + SPECTRUM%NK = 32 + SPECTRUM%NTH = 24 +/ + +! -------------------------------------------------------------------- ! +! Define the run parameterization via RUN_NML namelist +! +! * namelist must be terminated with / +! * definitions & defaults: +! RUN%FLDRY = F ! dry run (I/O only, no calculation) +! RUN%FLCX = F ! x-component of propagation +! RUN%FLCY = F ! y-component of propagation +! RUN%FLCTH = F ! direction shift +! RUN%FLCK = F ! wavenumber shift +! RUN%FLSOU = F ! source terms +! -------------------------------------------------------------------- ! +&RUN_NML + RUN%FLCX = T + RUN%FLCY = T + RUN%FLCTH = T + RUN%FLCK = T + RUN%FLSOU = T +/ + +! -------------------------------------------------------------------- ! +! Define the timesteps parameterization via TIMESTEPS_NML namelist +! +! * It is highly recommended to set up time steps which are multiple +! between them. +! +! * The first time step to calculate is the maximum CFL time step +! which depend on the lowest frequency FREQ1 previously set up and the +! lowest spatial grid resolution in meters DXY. +! reminder : 1 degree=60minutes // 1minute=1mile // 1mile=1.852km +! The formula for the CFL time is : +! Tcfl = DXY / (G / (FREQ1*4*Pi) ) with the constants Pi=3,14 and G=9.8m/s²; +! DTXY ~= 90% Tcfl +! DTMAX ~= 3 * DTXY (maximum global time step limit) +! +! * The refraction time step depends on how strong can be the current velocities +! on your grid : +! DTKTH ~= DTMAX / 2 ! in case of no or light current velocities +! DTKTH ~= DTMAX / 10 ! in case of strong current velocities +! +! * The source terms time step is usually defined between 5s and 60s. +! A common value is 10s. +! DTMIN ~= 10 +! +! * namelist must be terminated with / +! * definitions & defaults: +! TIMESTEPS%DTMAX = 0. ! maximum global time step (s) +! TIMESTEPS%DTXY = 0. ! maximum CFL time step for x-y (s) +! TIMESTEPS%DTKTH = 0. ! maximum CFL time step for k-th (s) +! TIMESTEPS%DTMIN = 0. ! minimum source term time step (s) +! -------------------------------------------------------------------- ! +&TIMESTEPS_NML + TIMESTEPS%DTMAX = 180. + TIMESTEPS%DTXY = 45. + TIMESTEPS%DTKTH = 45. + TIMESTEPS%DTMIN = 10. +/ + +! -------------------------------------------------------------------- ! +! Define the grid to preprocess via GRID_NML namelist +! +! * the tunable parameters for source terms, propagation schemes, and +! numerics are read using namelists. +! * Any namelist found in the folowing sections is temporarily written +! to param.scratch, and read from there if necessary. +! * The order of the namelists is immaterial. +! * Namelists not needed for the given switch settings will be skipped +! automatically +! +! * grid type can be : +! 'RECT' : rectilinear +! 'CURV' : curvilinear +! 'UNST' : unstructured (triangle-based) +! +! * coordinate system can be : +! 'SPHE' : Spherical (degrees) +! 'CART' : Cartesian (meters) +! +! * grid closure can only be applied in spherical coordinates +! +! * grid closure can be : +! 'NONE' : No closure is applied +! 'SMPL' : Simple grid closure. Grid is periodic in the +! : i-index and wraps at i=NX+1. In other words, +! : (NX+1,J) => (1,J). A grid with simple closure +! : may be rectilinear or curvilinear. +! 'TRPL' : Tripole grid closure : Grid is periodic in the +! : i-index and wraps at i=NX+1 and has closure at +! : j=NY+1. In other words, (NX+1,J<=NY) => (1,J) +! : and (I,NY+1) => (NX-I+1,NY). Tripole +! : grid closure requires that NX be even. A grid +! : with tripole closure must be curvilinear. +! +! * The coastline limit depth is the value which distinguish the sea +! points to the land points. All the points with depth values (ZBIN) +! greater than this limit (ZLIM) will be considered as excluded points +! and will never be wet points, even if the water level grows over. +! It can only overwrite the status of a sea point to a land point. +! The value must have a negative value under the mean sea level +! +! * The minimum water depth allowed to compute the model is the absolute +! depth value (DMIN) used in the model if the input depth is lower to +! avoid the model to blow up. +! +! * namelist must be terminated with / +! * definitions & defaults: +! GRID%NAME = 'unset' ! grid name (30 char) +! GRID%NML = 'namelists.nml' ! namelists filename +! GRID%TYPE = 'unset' ! grid type +! GRID%COORD = 'unset' ! coordinate system +! GRID%CLOS = 'unset' ! grid closure +! +! GRID%ZLIM = 0. ! coastline limit depth (m) +! GRID%DMIN = 0. ! abs. minimum water depth (m) +! -------------------------------------------------------------------- ! +&GRID_NML + GRID%NAME = 'IROISE 1.5KM' + GRID%NML = '../input_oasacm5/namelists_IROISE.nml' + GRID%TYPE = 'RECT' + GRID%COORD = 'SPHE' + GRID%CLOS = 'NONE' + GRID%ZLIM = 0.0 + GRID%DMIN = 1.0 +/ + +! -------------------------------------------------------------------- ! +! Define the rectilinear grid type via RECT_NML namelist +! - only for RECT grids - +! +! * The minimum grid size is 3x3. +! +! * If the grid increments SX and SY are given in minutes of arc, the scaling +! factor SF must be set to 60. to provide an increment factor in degree. +! +! * If CSTRG='SMPL', then SX is forced to 360/NX. +! +! * value <= value_read / scale_fac +! +! * namelist must be terminated with / +! * definitions & defaults: +! RECT%NX = 0 ! number of points along x-axis +! RECT%NY = 0 ! number of points along y-axis +! +! RECT%SX = 0. ! grid increment along x-axis +! RECT%SY = 0. ! grid increment along y-axis +! RECT%SF = 1. ! scaling division factor for x-y axis +! +! RECT%X0 = 0. ! x-coordinate of lower-left corner (deg) +! RECT%Y0 = 0. ! y-coordinate of lower-left corner (deg) +! RECT%SF0 = 1. ! scaling division factor for x0,y0 coord +! -------------------------------------------------------------------- ! +&RECT_NML + RECT%NX = 103 + RECT%NY = 119 + RECT%SX = 0.019 + RECT%SY = 0.0125 + RECT%X0 = -6.119 + RECT%Y0 = 47.6375 +/ + +! -------------------------------------------------------------------- ! +! Define the depth to preprocess via DEPTH_NML namelist +! - for RECT and CURV grids - +! +! * if no obstruction subgrid, need to set &MISC FLAGTR = 0 +! +! * The depth value must have negative values under the mean sea level +! +! * value <= value_read * scale_fac +! +! * IDLA : Layout indicator : +! 1 : Read line-by-line bottom to top. (default) +! 2 : Like 1, single read statement. +! 3 : Read line-by-line top to bottom. +! 4 : Like 3, single read statement. +! * IDFM : format indicator : +! 1 : Free format. (default) +! 2 : Fixed format. +! 3 : Unformatted. +! * FORMAT : element format to read : +! '(....)' : auto detected (default) +! '(f10.6)' : float type +! +! * Example : +! IDF SF IDLA IDFM FORMAT FILENAME +! 50 0.001 1 1 '(....)' 'GLOB-30M.bot' +! +! * namelist must be terminated with / +! * definitions & defaults: +! DEPTH%SF = 1. ! scale factor +! DEPTH%FILENAME = 'unset' ! filename +! DEPTH%IDF = 50 ! file unit number +! DEPTH%IDLA = 1 ! layout indicator +! DEPTH%IDFM = 1 ! format indicator +! DEPTH%FORMAT = '(....)' ! formatted read format +! -------------------------------------------------------------------- ! +&DEPTH_NML + DEPTH%SF = -1. + DEPTH%FILENAME = '../input/iro_1p5k.bot' + DEPTH%FORMAT = '(20f10.2)' +/ + +! -------------------------------------------------------------------- ! +! Define the input boundary points via INBND_COUNT_NML and +! INBND_POINT_NML namelist +! - for RECT, CURV and UNST grids - +! +! * If no mask defined, INBOUND can be used +! +! * If the actual input data is not defined in the actual wave model run +! the initial conditions will be applied as constant boundary conditions. +! +! * The number of points is defined by INBND_COUNT +! +! * The points must start from index 1 to N +! +! * Each line contains: +! Discrete grid counters (IX,IY) of the active point and a +! connect flag. If this flag is true, and the present and previous +! point are on a grid line or diagonal, all intermediate points +! are also defined as boundary points. +! +! * Included point : +! grid points from segment data +! Defines as lines identifying points at which +! input boundary conditions are to be defined. +! +! * namelist must be terminated with / +! * definitions & defaults: +! INBND_COUNT%N_POINT = 0 ! number of segments +! +! INBND_POINT(I)%X_INDEX = 0 ! x index included point +! INBND_POINT(I)%Y_INDEX = 0 ! y index included point +! INBND_POINT(I)%CONNECT = F ! connect flag +! +! OR +! INBND_POINT(I) = 0 0 F ! included point +! -------------------------------------------------------------------- ! +&INBND_COUNT_NML + INBND_COUNT%N_POINT = 6 +/ + +&INBND_POINT_NML + INBND_POINT(1) = 103 86 F + INBND_POINT(2) = 103 119 T + INBND_POINT(3) = 1 119 T + INBND_POINT(4) = 1 1 T + INBND_POINT(5) = 103 1 T + INBND_POINT(6) = 103 11 T +/ + +! -------------------------------------------------------------------- ! +! WAVEWATCH III - end of namelist ! +! -------------------------------------------------------------------- ! diff --git a/regtests/ww3_tp2.14/input_oasacm5/ww3_ounf.inp b/regtests/ww3_tp2.14/input_oasacm5/ww3_ounf.inp new file mode 100755 index 000000000..b8bbf80f6 --- /dev/null +++ b/regtests/ww3_tp2.14/input_oasacm5/ww3_ounf.inp @@ -0,0 +1,41 @@ +$ -------------------------------------------------------------------- $ +$ WAVEWATCH III Grid output post-processing $ +$--------------------------------------------------------------------- $ +$ First output time (yyyymmdd hhmmss), increment of output (s), +$ and number of output times. +$ + 20080310 000000 180 100 +$ +$ Output request flags identifying fields as in ww3_shel.inp. See that +$ file for a full documentation of field output options. Namelist type +$ selection is used here (for alternative F/T flags, see ww3_shel.inp). +$ + N + HS FP DIR DP CHA UST DPT CUR WND +$ +$--------------------------------------------------------------------- $ +$ netCDF version [3,4] +$ and variable type 4 [2 = SHORT, 3 = it depends , 4 = REAL] +$ swell partitions [0 1 2 3 4 5] +$ variables in same file [T] or not [F] +$ + 3 4 + 0 + T +$ +$ -------------------------------------------------------------------- $ +$ File prefix +$ number of characters in date [0(nodate),4(yearly),6(monthly),8(daily),10(hourly)] +$ IX and IY ranges [regular:IX NX IY NY DX DY, unstructured:IP NP DP DP] +$ +ww3. +6 +1 10000 1 10000 +$ +$ For each field and time a new file is generated with the file name +$ ww3.date_xxx.nc , where date is a conventional time indicator with S3 +$ characters, and xxx is a field identifier. +$ +$ -------------------------------------------------------------------- $ +$ End of input file $ +$ -------------------------------------------------------------------- $ diff --git a/regtests/ww3_tp2.14/input_oasacm5/ww3_ounf.nml b/regtests/ww3_tp2.14/input_oasacm5/ww3_ounf.nml new file mode 100644 index 000000000..fc0386ff8 --- /dev/null +++ b/regtests/ww3_tp2.14/input_oasacm5/ww3_ounf.nml @@ -0,0 +1,60 @@ +! -------------------------------------------------------------------- ! +! WAVEWATCH III ww3_ounf.nml - Grid output post-processing ! +! -------------------------------------------------------------------- ! + +! -------------------------------------------------------------------- ! +! Define the output fields to postprocess via FIELD_NML namelist +! +! * the detailed list of field names FIELD%LIST is given in ww3_shel.nml +! DPT CUR WND AST WLV ICE IBG D50 IC1 IC5 +! HS LM T02 T0M1 T01 FP DIR SPR DP HIG +! EF TH1M STH1M TH2M STH2M WN +! PHS PTP PLP PDIR PSPR PWS PDP PQP PPE PGW PSW PTM10 PT01 PT02 PEP TWS PNR +! UST CHA CGE FAW TAW TWA WCC WCF WCH WCM FWS +! SXY TWO BHD FOC TUS USS P2S USF P2L TWI FIC +! ABR UBR BED FBB TBB +! MSS MSC WL02 AXT AYT AXY +! DTD FC CFX CFD CFK +! U1 U2 +! +! * namelist must be terminated with / +! * definitions & defaults: +! FIELD%TIMESTART = '19000101 000000' ! Stop date for the output field +! FIELD%TIMESTRIDE = '0' ! Time stride for the output field +! FIELD%TIMESTOP = '29001231 000000' ! Stop date for the output field +! FIELD%TIMECOUNT = '1000000000' ! Number of time steps +! FIELD%TIMESPLIT = 6 ! [0(nodate),4(yearly),6(monthly),8(daily),10(hourly)] +! FIELD%LIST = 'unset' ! List of output fields +! FIELD%PARTITION = '0 1 2 3' ! List of wave partitions ['0 1 2 3 4 5'] +! FIELD%SAMEFILE = T ! All the variables in the same file [T|F] +! FIELD%TYPE = 3 ! [2 = SHORT, 3 = it depends , 4 = REAL] +! -------------------------------------------------------------------- ! +&FIELD_NML + FIELD%TIMESTART = '20080310 000000' + FIELD%TIMESTRIDE = '180' + FIELD%TIMECOUNT = '100' + FIELD%LIST = 'HS FP DIR DP CHA UST DPT CUR WND' + FIELD%PARTITION = '0' + FIELD%TYPE = 4 +/ + +! -------------------------------------------------------------------- ! +! Define the content of the output file via FILE_NML namelist +! +! * namelist must be terminated with / +! * definitions & defaults: +! FILE%PREFIX = 'ww3.' ! Prefix for output file name +! FILE%NETCDF = 3 ! Netcdf version [3|4] +! FILE%IX0 = 1 ! First X-axis or node index +! FILE%IXN = 1000000000 ! Last X-axis or node index +! FILE%IY0 = 1 ! First Y-axis index +! FILE%IYN = 1000000000 ! Last Y-axis index +! -------------------------------------------------------------------- ! +&FILE_NML + FILE%IXN = 10000 + FILE%IYN = 10000 +/ + +! -------------------------------------------------------------------- ! +! WAVEWATCH III - end of namelist ! +! -------------------------------------------------------------------- ! diff --git a/regtests/ww3_tp2.14/input/ww3_shel_OASACM5.inp b/regtests/ww3_tp2.14/input_oasacm5/ww3_shel.inp similarity index 100% rename from regtests/ww3_tp2.14/input/ww3_shel_OASACM5.inp rename to regtests/ww3_tp2.14/input_oasacm5/ww3_shel.inp diff --git a/regtests/ww3_tp2.14/input/ww3_shel_OASACM5.nml b/regtests/ww3_tp2.14/input_oasacm5/ww3_shel.nml similarity index 94% rename from regtests/ww3_tp2.14/input/ww3_shel_OASACM5.nml rename to regtests/ww3_tp2.14/input_oasacm5/ww3_shel.nml index ebf38d427..4f56bcf3d 100644 --- a/regtests/ww3_tp2.14/input/ww3_shel_OASACM5.nml +++ b/regtests/ww3_tp2.14/input_oasacm5/ww3_shel.nml @@ -44,6 +44,8 @@ ! INPUT%FORCING%WATER_LEVELS = 'F' ! INPUT%FORCING%CURRENTS = 'F' ! INPUT%FORCING%WINDS = 'F' +! INPUT%FORCING%ATM_MOMENTUM = 'F' +! INPUT%FORCING%AIR_DENSITY = 'F' ! INPUT%FORCING%ICE_CONC = 'F' ! INPUT%FORCING%ICE_PARAM1 = 'F' ! INPUT%FORCING%ICE_PARAM2 = 'F' @@ -64,7 +66,7 @@ ! -------------------------------------------------------------------- ! ! Define the output types point parameters via OUTPUT_TYPE_NML namelist ! -! * the point file is a space separated values per line : lon lat 'name' +! * the point file is a space separated values per line : ! longitude latitude 'name' (C*40) ! ! * the full list of field names is : @@ -94,9 +96,11 @@ ! T T 1 5 WLV WLV Water levels. ! T T 1 6 ICE ICE Ice concentration. ! T T 1 7 IBG IBG Iceberg-induced damping. -! T T 1 8 D50 D50 Median sediment grain size. -! T T 1 9 IC1 IC1 Ice thickness. -! T T 1 10 IC5 IC5 Ice flow diameter. +! T T 1 8 TAUA TAU Atm. momentum. +! T T 1 9 RHOAIR RHO Air density. +! T T 1 10 D50 D50 Median sediment grain size. +! T T 1 11 IC1 IC1 Ice thickness. +! T T 1 12 IC5 IC5 Ice flow diameter. ! ------------------------------------------------- ! 2 Standard mean wave Parameters ! ------------------------------------------------- @@ -117,6 +121,7 @@ ! T T 2 15 HMAXD SDMH St Dev of MXC (STE) ! T T 2 16 HCMAXD SDMHC St Dev of MXHC (STE) ! F T 2 17 WBT WBT Domiant wave breaking probability bT +! F F 2 18 FP0 TP Peak period (from peak freq) ! ------------------------------------------------- ! 3 Spectral Parameters (first 5) ! ------------------------------------------------- @@ -174,6 +179,7 @@ ! F F 6 9 P2SMS P2L Micro seism source term ! F F 6 10 TAUICE TWI Wave to sea ice stress ! F F 6 11 PHICE FIC Wave to sea ice energy flux +! F F 6 12 USSP USP Partitioned surface Stokes drift ! ------------------------------------------------- ! 7 Wave-bottom layer ! ------------------------------------------------- @@ -219,9 +225,14 @@ ! - Ice model : IC5 TWI ! - Received fields by ww3: ! - Ocean model : SSH CUR -! - Atmospheric model : WND +! - Atmospheric model : WND TAU RHO ! - Ice model : ICE IC1 IC5 ! +! * Coupling flag (T) or (F) at T+0 (extra fields in the restart needed) +! +! * extra fields to be written to the restart: +! - The list includes all fields sent by coupling exchange only +! ! * namelist must be terminated with / ! * definitions & defaults: ! TYPE%FIELD%LIST = 'unset' @@ -236,13 +247,15 @@ ! TYPE%PARTITION%FORMAT = T ! TYPE%COUPLING%SENT = 'unset' ! TYPE%COUPLING%RECEIVED = 'unset' +! TYPE%COUPLING%COUPLET0 = F +! TYPE%RESTART%EXTRA = 'unset' ! ! -------------------------------------------------------------------- ! &OUTPUT_TYPE_NML TYPE%FIELD%LIST = 'HS FP DIR DP CHA UST DPT CUR WND' TYPE%COUPLING%SENT = 'ACHA' TYPE%COUPLING%RECEIVED = 'WND' - TYPE%COUPLING%COUPLET0 = .TRUE. + TYPE%COUPLING%COUPLET0 = T / ! -------------------------------------------------------------------- ! diff --git a/regtests/ww3_tp2.14/input/BrestISides.dat b/regtests/ww3_tp2.14/input_oasacm6/BrestISides.dat similarity index 100% rename from regtests/ww3_tp2.14/input/BrestISides.dat rename to regtests/ww3_tp2.14/input_oasacm6/BrestISides.dat diff --git a/regtests/ww3_tp2.14/input/BrestJSides.dat b/regtests/ww3_tp2.14/input_oasacm6/BrestJSides.dat similarity index 100% rename from regtests/ww3_tp2.14/input/BrestJSides.dat rename to regtests/ww3_tp2.14/input_oasacm6/BrestJSides.dat diff --git a/regtests/ww3_tp2.14/input/BrestObstrs.dat b/regtests/ww3_tp2.14/input_oasacm6/BrestObstrs.dat similarity index 100% rename from regtests/ww3_tp2.14/input/BrestObstrs.dat rename to regtests/ww3_tp2.14/input_oasacm6/BrestObstrs.dat diff --git a/regtests/ww3_tp2.14/input/BrestSMCels.dat b/regtests/ww3_tp2.14/input_oasacm6/BrestSMCels.dat similarity index 100% rename from regtests/ww3_tp2.14/input/BrestSMCels.dat rename to regtests/ww3_tp2.14/input_oasacm6/BrestSMCels.dat diff --git a/regtests/ww3_tp2.14/input/TOYNAMELIST.nam.OASACM6 b/regtests/ww3_tp2.14/input_oasacm6/TOYNAMELIST.nam similarity index 100% rename from regtests/ww3_tp2.14/input/TOYNAMELIST.nam.OASACM6 rename to regtests/ww3_tp2.14/input_oasacm6/TOYNAMELIST.nam diff --git a/regtests/ww3_tp2.14/input/namcouple.OASACM6 b/regtests/ww3_tp2.14/input_oasacm6/namcouple similarity index 97% rename from regtests/ww3_tp2.14/input/namcouple.OASACM6 rename to regtests/ww3_tp2.14/input_oasacm6/namcouple index 390a7b3ff..f3bee9dd1 100755 --- a/regtests/ww3_tp2.14/input/namcouple.OASACM6 +++ b/regtests/ww3_tp2.14/input_oasacm6/namcouple @@ -108,7 +108,7 @@ TOY_U10M WW3__U10 1 180 1 r-toy.nc EXPOUT 80 80 2889 1 toyt ww3t R 0 R 0 MAPPING -../input/rmp_toyt_to_ww3t_NEARESTSTOD.nc +../input_oasacm6/rmp_toyt_to_ww3t_NEARESTSTOD.nc # #~~~~~~~~~~~ # Field 2 : @@ -117,7 +117,7 @@ TOY_V10M WW3__V10 1 180 1 r-toy.nc EXPOUT 80 80 2889 1 toyt ww3t R 0 R 0 MAPPING -../input/rmp_toyt_to_ww3t_NEARESTSTOD.nc +../input_oasacm6/rmp_toyt_to_ww3t_NEARESTSTOD.nc # # ----------------------------------------- # WW3 (wwatch) ==> TOY (toyexe) @@ -130,6 +130,6 @@ WW3_ACHA TOY__CHA 1 180 1 r-ww3.nc EXPOUT 2889 1 80 80 ww3t toyt R 0 R 0 MAPPING -../input/rmp_ww3t_to_toyt_NEARESTSTOD.nc +../input_oasacm6/rmp_ww3t_to_toyt_NEARESTSTOD.nc # $END diff --git a/regtests/ww3_tp2.14/input_oasacm6/namelists_BREST.nml b/regtests/ww3_tp2.14/input_oasacm6/namelists_BREST.nml new file mode 100644 index 000000000..6bf9bd247 --- /dev/null +++ b/regtests/ww3_tp2.14/input_oasacm6/namelists_BREST.nml @@ -0,0 +1,2 @@ +&PSMC DTIMS=10800.,LvSMC=2,CFLSM=0.1,AVERG=.FALSE. / +END OF NAMELISTS diff --git a/regtests/ww3_tp2.14/input_oasacm6/prep_env.sh b/regtests/ww3_tp2.14/input_oasacm6/prep_env.sh new file mode 100755 index 000000000..ee03d4033 --- /dev/null +++ b/regtests/ww3_tp2.14/input_oasacm6/prep_env.sh @@ -0,0 +1,101 @@ +#!/bin/bash -e + +if [ $# -ne 4 ] +then + echo "need four arguments:" + echo '$1 : path_i' + echo '$2 : path_w' + echo '$3 : complr' + echo '$4 : switch' + exit 1 +fi + +path_i=$1 +path_w=$2 +cmplr=$3 +swtstr=$4 + +echo '' +echo ' setup coupling environment' +export WWATCH3_DIR=`grep WWATCH3_DIR $WWATCH3_ENV | awk -F' ' '{print $2}' ` +export WWATCH3_CC=`grep WWATCH3_CC $WWATCH3_ENV | awk -F' ' '{print $2}' ` + + +echo ' copy oasis and toy in $path_w' +cp -r $path_i/../input/toy $path_w/ +cp -r $path_i/../input/oasis3-mct $path_w/ + + +echo ' Setup oasis cmplr file' +cd $path_w/oasis3-mct/util/make_dir +source $WWATCH3_DIR/bin/cmplr.env +# shortlist optl +alloptl=( $optl ) +for ioptl in $(seq 2 ${#alloptl[@]}); do + optls="${optls}${alloptl[$ioptl]} " +done +# shortlist optc +alloptc=( $optc ) +for ioptc in $(seq 3 ${#alloptc[@]}); do + optcs="${optcs}${alloptc[$ioptc]} " +done +# shorten comp_mpi +comp_mpi_exe="$(echo $comp_mpi | awk -F' ' '{print $1}')" +# sed cmplr.tmpl +sed -e "s::$path_w/oasis3-mct:" \ + -e "s::$path_w/work_oasis3-mct:" \ + -e "s//$optcs/" -e "s//$optls/" \ + -e "s//$comp_mpi/" -e "s//$comp_mpi_exe/" \ + -e "s//$WWATCH3_CC/" cmplr.tmpl > cmplr +echo " sed cmplr.tmpl => cmplr" +chmod 775 cmplr + + +echo ' setup oasis make.inc file' +sed -e "s::$path_w/oasis3-mct:" make.inc.tmpl > make.inc + + +echo ' compile oasis coupler' +make realclean -f TopMakefileOasis3 > $path_w/oasis_clean.out +make -f TopMakefileOasis3 > $path_w/oasis_make.out + + +echo ' setup toy Makefile' +cd $path_w/toy +sed -e "s::$path_w/oasis3-mct:" Makefile.tmpl > Makefile + + +echo ' compile toy model' +make clean > $path_w/toy_clean.out +make > $path_w/toy_make.out + + +echo ' copy oasis coupler inputs' +cp $path_i/namcouple $path_w/namcouple + + +echo ' copy toy model inputs' +if [ -f $path_w/toy/r-toy.nc.$swtstr ]; then + cp $path_w/toy/r-toy.nc.$swtstr $path_w/r-toy.nc +else + echo "WARNING: model input $path_w/toy/r-toy.nc.$swtstr does not exist" +fi + +cp $path_w/toy/grid_toy_model.nc $path_w/ +cp $path_w/toy/toy_coupled_field.nc.$swtstr $path_w/toy_coupled_field.nc +cp $path_w/toy/toy_model $path_w/ + +cp $path_i/TOYNAMELIST.nam $path_w/TOYNAMELIST.nam + + +echo ' copy ww3 model inputs' +cd $path_w +if [ -f $path_i/r-ww3.nc ]; then + cp $path_i/r-ww3.nc $path_w/r-ww3.nc +else + echo "WARNING: model input $path_i/toy/r-ww3.nc does not exist" +fi + + + +echo '' diff --git a/regtests/ww3_tp2.14/input/switch_OASACM6 b/regtests/ww3_tp2.14/input_oasacm6/switch_OASACM6 similarity index 100% rename from regtests/ww3_tp2.14/input/switch_OASACM6 rename to regtests/ww3_tp2.14/input_oasacm6/switch_OASACM6 diff --git a/regtests/ww3_tp2.14/input/ww3_grid_OASACM6.inp b/regtests/ww3_tp2.14/input_oasacm6/ww3_grid.inp similarity index 98% rename from regtests/ww3_tp2.14/input/ww3_grid_OASACM6.inp rename to regtests/ww3_tp2.14/input_oasacm6/ww3_grid.inp index f0b2827e3..2e9ee949f 100755 --- a/regtests/ww3_tp2.14/input/ww3_grid_OASACM6.inp +++ b/regtests/ww3_tp2.14/input_oasacm6/ww3_grid.inp @@ -237,10 +237,10 @@ $ The first line of each file will have the array dimension parameters. $ So the first line are read first to determine the array sizes for the $ following array read calls. JGLi18Dec2012 $ - 32 1 1 '(....)' '../input/BrestSMCels.dat' - 33 1 1 '(....)' '../input/BrestISides.dat' - 34 1 1 '(....)' '../input/BrestJSides.dat' - 31 1 1 '(....)' '../input/BrestObstrs.dat' + 32 1 1 '(....)' '../input_oasacm6/BrestSMCels.dat' + 33 1 1 '(....)' '../input_oasacm6/BrestISides.dat' + 34 1 1 '(....)' '../input_oasacm6/BrestJSides.dat' + 31 1 1 '(....)' '../input_oasacm6/BrestObstrs.dat' $ $ Input boundary points ---------------------------------------------- $ $ An unlimited number of lines identifying points at which input diff --git a/regtests/ww3_tp2.14/input/ww3_grid_OASACM6.nml b/regtests/ww3_tp2.14/input_oasacm6/ww3_grid.nml similarity index 97% rename from regtests/ww3_tp2.14/input/ww3_grid_OASACM6.nml rename to regtests/ww3_tp2.14/input_oasacm6/ww3_grid.nml index 52aa47525..d18a17e02 100644 --- a/regtests/ww3_tp2.14/input/ww3_grid_OASACM6.nml +++ b/regtests/ww3_tp2.14/input_oasacm6/ww3_grid.nml @@ -138,7 +138,7 @@ ! -------------------------------------------------------------------- ! &GRID_NML GRID%NAME = '***** WW3 Brest3km Grid ***** ' - GRID%NML = '../input/namelists_BREST.nml' + GRID%NML = '../input_oasacm6/namelists_BREST.nml' GRID%TYPE = 'SMCG' GRID%COORD = 'SPHE' GRID%CLOS = 'NONE' @@ -233,25 +233,25 @@ SMC%MCELS%IDLA = 1 SMC%MCELS%IDFM = 1 SMC%MCELS%FORMAT = '(....)' - SMC%MCELS%FILENAME = '../input/BrestSMCels.dat' + SMC%MCELS%FILENAME = '../input_oasacm6/BrestSMCels.dat' SMC%ISIDE%IDF = 33 SMC%ISIDE%IDLA = 1 SMC%ISIDE%IDFM = 1 SMC%ISIDE%FORMAT = '(....)' - SMC%ISIDE%FILENAME = '../input/BrestISides.dat' + SMC%ISIDE%FILENAME = '../input_oasacm6/BrestISides.dat' SMC%JSIDE%IDF = 34 SMC%JSIDE%IDLA = 1 SMC%JSIDE%IDFM = 1 SMC%JSIDE%FORMAT = '(....)' - SMC%JSIDE%FILENAME = '../input/BrestJSides.dat' + SMC%JSIDE%FILENAME = '../input_oasacm6/BrestJSides.dat' SMC%SUBTR%IDF = 31 SMC%SUBTR%IDLA = 1 SMC%SUBTR%IDFM = 1 SMC%SUBTR%FORMAT = '(....)' - SMC%SUBTR%FILENAME = '../input/BrestObstrs.dat' + SMC%SUBTR%FILENAME = '../input_oasacm6/BrestObstrs.dat' / ! -------------------------------------------------------------------- ! diff --git a/regtests/ww3_tp2.14/input/ww3_ounf.inp-OASACM6 b/regtests/ww3_tp2.14/input_oasacm6/ww3_ounf.inp similarity index 96% rename from regtests/ww3_tp2.14/input/ww3_ounf.inp-OASACM6 rename to regtests/ww3_tp2.14/input_oasacm6/ww3_ounf.inp index b192de6cd..1b775c3d9 100755 --- a/regtests/ww3_tp2.14/input/ww3_ounf.inp-OASACM6 +++ b/regtests/ww3_tp2.14/input_oasacm6/ww3_ounf.inp @@ -11,7 +11,7 @@ $ file for a full documentation of field output options. Namelist type $ selection is used here (for alternative F/T flags, see ww3_shel.inp). $ N - HS FP DIR DP CHA UST DPT CUR WND ICE IC1 IC5 TWI + HS FP DIR DP CHA UST DPT CUR WND $ $--------------------------------------------------------------------- $ $ netCDF version [3,4] diff --git a/regtests/ww3_tp2.14/input_oasacm6/ww3_ounf.nml b/regtests/ww3_tp2.14/input_oasacm6/ww3_ounf.nml new file mode 100644 index 000000000..1a011a818 --- /dev/null +++ b/regtests/ww3_tp2.14/input_oasacm6/ww3_ounf.nml @@ -0,0 +1,87 @@ +! -------------------------------------------------------------------- ! +! WAVEWATCH III ww3_ounf.nml - Grid output post-processing ! +! -------------------------------------------------------------------- ! + +! -------------------------------------------------------------------- ! +! Define the output fields to postprocess via FIELD_NML namelist +! +! * the detailed list of field names FIELD%LIST is given in ww3_shel.nml +! DPT CUR WND AST WLV ICE IBG D50 IC1 IC5 +! HS LM T02 T0M1 T01 FP DIR SPR DP HIG +! EF TH1M STH1M TH2M STH2M WN +! PHS PTP PLP PDIR PSPR PWS PDP PQP PPE PGW PSW PTM10 PT01 PT02 PEP TWS PNR +! UST CHA CGE FAW TAW TWA WCC WCF WCH WCM FWS +! SXY TWO BHD FOC TUS USS P2S USF P2L TWI FIC +! ABR UBR BED FBB TBB +! MSS MSC WL02 AXT AYT AXY +! DTD FC CFX CFD CFK +! U1 U2 +! +! * namelist must be terminated with / +! * definitions & defaults: +! FIELD%TIMESTART = '19000101 000000' ! Stop date for the output field +! FIELD%TIMESTRIDE = '0' ! Time stride for the output field +! FIELD%TIMESTOP = '29001231 000000' ! Stop date for the output field +! FIELD%TIMECOUNT = '1000000000' ! Number of time steps +! FIELD%TIMESPLIT = 6 ! [0(nodate),4(yearly),6(monthly),8(daily),10(hourly)] +! FIELD%LIST = 'unset' ! List of output fields +! FIELD%PARTITION = '0 1 2 3' ! List of wave partitions ['0 1 2 3 4 5'] +! FIELD%SAMEFILE = T ! All the variables in the same file [T|F] +! FIELD%TYPE = 3 ! [2 = SHORT, 3 = it depends , 4 = REAL] +! -------------------------------------------------------------------- ! +&FIELD_NML + FIELD%TIMESTART = '20080310 000000' + FIELD%TIMESTRIDE = '180' + FIELD%TIMECOUNT = '100' + FIELD%LIST = 'HS FP DIR DP CHA UST DPT CUR WND' + FIELD%PARTITION = '0' + FIELD%TYPE = 4 +/ + +! -------------------------------------------------------------------- ! +! Define the content of the output file via FILE_NML namelist +! +! * namelist must be terminated with / +! * definitions & defaults: +! FILE%PREFIX = 'ww3.' ! Prefix for output file name +! FILE%NETCDF = 3 ! Netcdf version [3|4] +! FILE%IX0 = 1 ! First X-axis or node index +! FILE%IXN = 1000000000 ! Last X-axis or node index +! FILE%IY0 = 1 ! First Y-axis index +! FILE%IYN = 1000000000 ! Last Y-axis index +! -------------------------------------------------------------------- ! +&FILE_NML +/ + +! -------------------------------------------------------------------- ! +! Define the content of the output file via SMC_NML namelist +! +! * For SMC grids, IX0, IXN, IY0 and IYN from FILE_NML are not used. +! Two types of output are available: +! * TYPE=1: Flat 1D "seapoint" array of grid cells. +! * TYPE=2: Re-gridded regular grid with cell sizes being an integer +! * multiple of the smallest SMC grid cells size. +! +! * Note that the first/last longitudes and latitudes will be adjusted +! to snap to the underlying SMC grid edges. CELFAC is only used for +! type 2 output and defines the output cell sizes as an integer +! multiple of the smallest SMC Grid cell size. CELFAC should be a +! power of 2, e.g: 1,2,4,8,16, etc... +! +! * namelist must be terminated with / +! * definitions & defaults: +! SMC%TYPE = 1 ! SMC Grid type (1 or 2) +! SMC%SXO = -999.9 ! First longitude +! SMC%EXO = -999.9 ! Last longitude +! SMC%SYO = -999.9 ! First latitude +! SMC%EYO = -999.9 ! Last latitude +! SMC%CELFAC = 1 ! Cell size factor (SMCTYPE=2 only) +! SMC%NOVAL = UNDEF ! Fill value for wet cells with no data +! -------------------------------------------------------------------- ! +&SMC_NML + SMC%TYPE = 2 +/ + +! -------------------------------------------------------------------- ! +! WAVEWATCH III - end of namelist ! +! -------------------------------------------------------------------- ! diff --git a/regtests/ww3_tp2.14/input/ww3_shel_OASACM6.inp b/regtests/ww3_tp2.14/input_oasacm6/ww3_shel.inp similarity index 100% rename from regtests/ww3_tp2.14/input/ww3_shel_OASACM6.inp rename to regtests/ww3_tp2.14/input_oasacm6/ww3_shel.inp diff --git a/regtests/ww3_tp2.14/input/ww3_shel_OASACM6.nml b/regtests/ww3_tp2.14/input_oasacm6/ww3_shel.nml similarity index 94% rename from regtests/ww3_tp2.14/input/ww3_shel_OASACM6.nml rename to regtests/ww3_tp2.14/input_oasacm6/ww3_shel.nml index 84d3e15c6..af2daa7bd 100644 --- a/regtests/ww3_tp2.14/input/ww3_shel_OASACM6.nml +++ b/regtests/ww3_tp2.14/input_oasacm6/ww3_shel.nml @@ -44,6 +44,8 @@ ! INPUT%FORCING%WATER_LEVELS = 'F' ! INPUT%FORCING%CURRENTS = 'F' ! INPUT%FORCING%WINDS = 'F' +! INPUT%FORCING%ATM_MOMENTUM = 'F' +! INPUT%FORCING%AIR_DENSITY = 'F' ! INPUT%FORCING%ICE_CONC = 'F' ! INPUT%FORCING%ICE_PARAM1 = 'F' ! INPUT%FORCING%ICE_PARAM2 = 'F' @@ -64,7 +66,7 @@ ! -------------------------------------------------------------------- ! ! Define the output types point parameters via OUTPUT_TYPE_NML namelist ! -! * the point file is a space separated values per line : lon lat 'name' +! * the point file is a space separated values per line : ! longitude latitude 'name' (C*40) ! ! * the full list of field names is : @@ -94,9 +96,11 @@ ! T T 1 5 WLV WLV Water levels. ! T T 1 6 ICE ICE Ice concentration. ! T T 1 7 IBG IBG Iceberg-induced damping. -! T T 1 8 D50 D50 Median sediment grain size. -! T T 1 9 IC1 IC1 Ice thickness. -! T T 1 10 IC5 IC5 Ice flow diameter. +! T T 1 8 TAUA TAU Atm. momentum. +! T T 1 9 RHOAIR RHO Air density. +! T T 1 10 D50 D50 Median sediment grain size. +! T T 1 11 IC1 IC1 Ice thickness. +! T T 1 12 IC5 IC5 Ice flow diameter. ! ------------------------------------------------- ! 2 Standard mean wave Parameters ! ------------------------------------------------- @@ -117,6 +121,7 @@ ! T T 2 15 HMAXD SDMH St Dev of MXC (STE) ! T T 2 16 HCMAXD SDMHC St Dev of MXHC (STE) ! F T 2 17 WBT WBT Domiant wave breaking probability bT +! F F 2 18 FP0 TP Peak period (from peak freq) ! ------------------------------------------------- ! 3 Spectral Parameters (first 5) ! ------------------------------------------------- @@ -174,6 +179,7 @@ ! F F 6 9 P2SMS P2L Micro seism source term ! F F 6 10 TAUICE TWI Wave to sea ice stress ! F F 6 11 PHICE FIC Wave to sea ice energy flux +! F F 6 12 USSP USP Partitioned surface Stokes drift ! ------------------------------------------------- ! 7 Wave-bottom layer ! ------------------------------------------------- @@ -219,9 +225,14 @@ ! - Ice model : IC5 TWI ! - Received fields by ww3: ! - Ocean model : SSH CUR -! - Atmospheric model : WND +! - Atmospheric model : WND TAU RHO ! - Ice model : ICE IC1 IC5 ! +! * Coupling flag (T) or (F) at T+0 (extra fields in the restart needed) +! +! * extra fields to be written to the restart: +! - The list includes all fields sent by coupling exchange only +! ! * namelist must be terminated with / ! * definitions & defaults: ! TYPE%FIELD%LIST = 'unset' @@ -236,14 +247,15 @@ ! TYPE%PARTITION%FORMAT = T ! TYPE%COUPLING%SENT = 'unset' ! TYPE%COUPLING%RECEIVED = 'unset' -! TYPE%COUPLING%COUPLET0 = .FALSE. +! TYPE%COUPLING%COUPLET0 = F +! TYPE%RESTART%EXTRA = 'unset' ! ! -------------------------------------------------------------------- ! &OUTPUT_TYPE_NML TYPE%FIELD%LIST = 'HS FP DIR DP CHA UST DPT CUR WND' TYPE%COUPLING%SENT = 'ACHA' TYPE%COUPLING%RECEIVED = 'WND' - TYPE%COUPLING%COUPLET0 = .TRUE. + TYPE%COUPLING%COUPLET0 = T / ! -------------------------------------------------------------------- ! diff --git a/regtests/ww3_tp2.14/input_oasacm6/ww3_strt.inp b/regtests/ww3_tp2.14/input_oasacm6/ww3_strt.inp new file mode 100755 index 000000000..948c42911 --- /dev/null +++ b/regtests/ww3_tp2.14/input_oasacm6/ww3_strt.inp @@ -0,0 +1,72 @@ +$ -------------------------------------------------------------------- $ +$ WAVEWATCH III Initial conditions input file $ +$--------------------------------------------------------------------- $ +$ type of initial field ITYPE . +$ + 1 +$ +$ ITYPE = 1 ---------------------------------------------------------- $ +$ Gaussian in frequency and space, cos type in direction. +$ - fp and spread (Hz), mean direction (degr., oceanographic +$ convention) and cosine power, Xm and spread (degr. or m) Ym and +$ spread (degr. or m), Hmax (m) (Example for lon-lat grid in degr.). +$ +$ 0.10 0.01 270. 2 1. 0.5 1. 0.5 2.5 + 0.10 0.01 270. 2 0. 1000. 1. 1000. 2.5 +$ 0.10 0.01 270. 2 0. 1000. 1. 1000. 0.01 +$ 0.10 0.01 270. 2 0. 1000. 1. 1000. 0. +$ +$ ITYPE = 2 ---------------------------------------------------------- $ +$ JONSWAP spectrum with Hasselmann et al. (1980) direct. distribution. +$ - alfa, peak freq. (Hz), mean direction (degr., oceanographical +$ convention), gamma, sigA, sigB, Xm and spread (degr. or m) Ym and +$ spread (degr. or m) (Example for lon-lat grid in degr.). +$ alfa, sigA, sigB give default values if less than or equal to 0. +$ +$ 0.0081 0.1 270. 1.0 0. 0. 1. 100. 1. 100. +$ +$ ITYPE = 3 ---------------------------------------------------------- $ +$ Fetch-limited JONSWAP +$ - No additional data, the local spectrum is calculated using the +$ local wind speed and direction, using the spatial grid size as +$ fetch, and assuring that the spectrum is within the discrete +$ frequency range. +$ +$ ITYPE = 4 ---------------------------------------------------------- $ +$ User-defined spectrum +$ - Scale factor., defaults to 1 if less than or equal 0. +$ - Spectrum F(f,theta) (single read statement) +$ +$ -0.1 +$ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +$ 0 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +$ 0 1 4 2 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +$ 0 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +$ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +$ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +$ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +$ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +$ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +$ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +$ 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 0 0 0 0 0 0 0 0 0 0 +$ 0 0 0 0 0 0 0 0 0 0 1 2 3 2 1 1 0 0 0 0 0 0 0 0 0 +$ 0 0 0 0 0 0 0 0 0 1 3 9 7 5 3 2 1 0 0 0 0 0 0 0 0 +$ 0 0 0 0 0 0 0 0 0 0 1 3 4 3 2 1 0 0 0 0 0 0 0 0 0 +$ 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 0 0 0 0 0 0 0 0 0 0 +$ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +$ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +$ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +$ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +$ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +$ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +$ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +$ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +$ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +$ +$ ITYPE = 5 ---------------------------------------------------------- $ +$ Starting from calm conditions. +$ - No additional data. +$ +$ -------------------------------------------------------------------- $ +$ End of input file $ +$ -------------------------------------------------------------------- $ diff --git a/regtests/ww3_tp2.14/input/TOYNAMELIST.nam.OASICM b/regtests/ww3_tp2.14/input_oasicm/TOYNAMELIST.nam similarity index 100% rename from regtests/ww3_tp2.14/input/TOYNAMELIST.nam.OASICM rename to regtests/ww3_tp2.14/input_oasicm/TOYNAMELIST.nam diff --git a/regtests/ww3_tp2.14/input/namcouple.OASICM b/regtests/ww3_tp2.14/input_oasicm/namcouple similarity index 100% rename from regtests/ww3_tp2.14/input/namcouple.OASICM rename to regtests/ww3_tp2.14/input_oasicm/namcouple diff --git a/regtests/ww3_tp2.14/input_oasicm/namelists_IROISE.nml b/regtests/ww3_tp2.14/input_oasicm/namelists_IROISE.nml new file mode 100644 index 000000000..8b5707b65 --- /dev/null +++ b/regtests/ww3_tp2.14/input_oasicm/namelists_IROISE.nml @@ -0,0 +1 @@ +END OF NAMELISTS diff --git a/regtests/ww3_tp2.14/input_oasicm/prep_env.sh b/regtests/ww3_tp2.14/input_oasicm/prep_env.sh new file mode 100755 index 000000000..ee03d4033 --- /dev/null +++ b/regtests/ww3_tp2.14/input_oasicm/prep_env.sh @@ -0,0 +1,101 @@ +#!/bin/bash -e + +if [ $# -ne 4 ] +then + echo "need four arguments:" + echo '$1 : path_i' + echo '$2 : path_w' + echo '$3 : complr' + echo '$4 : switch' + exit 1 +fi + +path_i=$1 +path_w=$2 +cmplr=$3 +swtstr=$4 + +echo '' +echo ' setup coupling environment' +export WWATCH3_DIR=`grep WWATCH3_DIR $WWATCH3_ENV | awk -F' ' '{print $2}' ` +export WWATCH3_CC=`grep WWATCH3_CC $WWATCH3_ENV | awk -F' ' '{print $2}' ` + + +echo ' copy oasis and toy in $path_w' +cp -r $path_i/../input/toy $path_w/ +cp -r $path_i/../input/oasis3-mct $path_w/ + + +echo ' Setup oasis cmplr file' +cd $path_w/oasis3-mct/util/make_dir +source $WWATCH3_DIR/bin/cmplr.env +# shortlist optl +alloptl=( $optl ) +for ioptl in $(seq 2 ${#alloptl[@]}); do + optls="${optls}${alloptl[$ioptl]} " +done +# shortlist optc +alloptc=( $optc ) +for ioptc in $(seq 3 ${#alloptc[@]}); do + optcs="${optcs}${alloptc[$ioptc]} " +done +# shorten comp_mpi +comp_mpi_exe="$(echo $comp_mpi | awk -F' ' '{print $1}')" +# sed cmplr.tmpl +sed -e "s::$path_w/oasis3-mct:" \ + -e "s::$path_w/work_oasis3-mct:" \ + -e "s//$optcs/" -e "s//$optls/" \ + -e "s//$comp_mpi/" -e "s//$comp_mpi_exe/" \ + -e "s//$WWATCH3_CC/" cmplr.tmpl > cmplr +echo " sed cmplr.tmpl => cmplr" +chmod 775 cmplr + + +echo ' setup oasis make.inc file' +sed -e "s::$path_w/oasis3-mct:" make.inc.tmpl > make.inc + + +echo ' compile oasis coupler' +make realclean -f TopMakefileOasis3 > $path_w/oasis_clean.out +make -f TopMakefileOasis3 > $path_w/oasis_make.out + + +echo ' setup toy Makefile' +cd $path_w/toy +sed -e "s::$path_w/oasis3-mct:" Makefile.tmpl > Makefile + + +echo ' compile toy model' +make clean > $path_w/toy_clean.out +make > $path_w/toy_make.out + + +echo ' copy oasis coupler inputs' +cp $path_i/namcouple $path_w/namcouple + + +echo ' copy toy model inputs' +if [ -f $path_w/toy/r-toy.nc.$swtstr ]; then + cp $path_w/toy/r-toy.nc.$swtstr $path_w/r-toy.nc +else + echo "WARNING: model input $path_w/toy/r-toy.nc.$swtstr does not exist" +fi + +cp $path_w/toy/grid_toy_model.nc $path_w/ +cp $path_w/toy/toy_coupled_field.nc.$swtstr $path_w/toy_coupled_field.nc +cp $path_w/toy/toy_model $path_w/ + +cp $path_i/TOYNAMELIST.nam $path_w/TOYNAMELIST.nam + + +echo ' copy ww3 model inputs' +cd $path_w +if [ -f $path_i/r-ww3.nc ]; then + cp $path_i/r-ww3.nc $path_w/r-ww3.nc +else + echo "WARNING: model input $path_i/toy/r-ww3.nc does not exist" +fi + + + +echo '' diff --git a/regtests/ww3_tp2.14/input/switch_OASICM b/regtests/ww3_tp2.14/input_oasicm/switch_OASICM similarity index 100% rename from regtests/ww3_tp2.14/input/switch_OASICM rename to regtests/ww3_tp2.14/input_oasicm/switch_OASICM diff --git a/regtests/ww3_tp2.14/input_oasicm/ww3_grid.inp b/regtests/ww3_tp2.14/input_oasicm/ww3_grid.inp new file mode 100755 index 000000000..e367379b4 --- /dev/null +++ b/regtests/ww3_tp2.14/input_oasicm/ww3_grid.inp @@ -0,0 +1,276 @@ +$ -------------------------------------------------------------------- $ +$ WAVEWATCH III Grid preprocessor input file $ +$ -------------------------------------------------------------------- $ +$ Grid name (C*30, in quotes) +$ + 'IROISE 1.5KM' +$ +$ Frequency increment factor and first frequency (Hz) ---------------- $ +$ number of frequencies (wavenumbers) and directions +$ +1.1 0.0373 32 24 0. +$ +$ Set model flags ---------------------------------------------------- $ +$ - FLDRY Dry run (input/output only, no calculation). +$ - FLCX, FLCY Activate X and Y component of propagation. +$ - FLCTH, FLCK Activate direction and wavenumber shifts. +$ - FLSOU Activate source terms. +$ + F T T T T T +$ +$ Set time steps ----------------------------------------------------- $ +$ - Time step information (this information is always read) +$ maximum global time step, maximum CFL time step for x-y and +$ k-theta, minimum source term time step (all in seconds). +$ + 180. 45. 45. 10. +$ +$ Start of namelist input section ------------------------------------ $ +$ Starting with WAVEWATCH III version 2.00, the tunable parameters +$ for source terms, propagation schemes, and numerics are read using +$ namelists. Any namelist found in the folowing sections up to the +$ end-of-section identifier string (see below) is temporarily written +$ to ww3_grid.scratch, and read from there if necessary. Namelists +$ not needed for the given switch settings will be skipped +$ automatically, and the order of the namelists is immaterial. +$ As an example, namelist input to change SWELLF and ZWND in the +$ Tolman and Chalikov input would be +$ +$ &SIN2 SWELLF = 0.1, ZWND = 15. / +$ +$ Define constants in source terms ----------------------------------- $ +$ +$ Input - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +$ WAM-3 : Namelist SIN1 +$ CINP : Proportionality constant. +$ &SIN1 CINP= 0.25 / +$ Tolman and Chalikov : Namelist SIN2 +$ ZWND : Height of wind (m). +$ SWELLF : swell factor in (2.48). +$ STABSH, STABOF, CNEG, CPOS, FNEG : +$ c0, ST0, c1, c2 and f1 in . (2.63) +$ through (2.65) for definition of +$ effective wind speed (!/STAB2). +$ +$ Nonlinear interactions - - - - - - - - - - - - - - - - - - - - - - - +$ Discrete I.A. : Namelist SNL1 +$ LAMBDA : Lambda in source term. +$ NLPROP : C in sourc term. NOTE : default +$ value depends on other source +$ terms selected. +$ KDCONV : Factor before kd in Eq. (2.24). +$ KDMIN, SNLCS1, SNLCS2, SNLCS3 : +$ Minimum kd, and constants c1-3 +$ in depth scaling function. +$ Exact interactions : Namelist SNL2 +$ IQTYPE : Type of depth treatment +$ 1 : Deep water +$ 2 : Deep water / WAM scaling +$ 3 : Shallow water +$ TAILNL : Parametric tail power. +$ NDEPTH : Number of depths in for which +$ integration space is established. +$ Used for IQTYPE = 3 only +$ Namelist ANL2 +$ DEPTHS : Array with depths for NDEPTH = 3 +$ +$ Dissipation - - - - - - - - - - - - - - - - - - - - - - - - - - - - +$ WAM-3 : Namelist SDS1 +$ CDIS, APM : As in source term. +$ +$ Tolman and Chalikov : Namelist SDS2 +$ SDSA0, SDSA1, SDSA2, SDSB0, SDSB1, PHIMIN : +$ Constants a0, a1, a2, b0, b1 and +$ PHImin. +$ +$ Bottom friction - - - - - - - - - - - - - - - - - - - - - - - - - - +$ JONSWAP : Namelist SBT1 +$ GAMMA : As it says. +$ +$ Propagation schemes ------------------------------------------------ $ +$ First order : Namelist PRO1 +$ CFLTM : Maximum CFL number for refraction. +$ +$ UQ with diffusion : Namelist PRO2 +$ CFLTM : Maximum CFL number for refraction. +$ FLSOFT : Flag for 'soft' land boundaries. +$ DTIME : Swell age (s) in garden sprinkler +$ correction. If 0., all diffusion +$ switched off. If small non-zero +$ (DEFAULT !!!) only wave growth +$ diffusion. +$ LATMIN : Maximum latitude used in calc. of +$ strength of diffusion for prop. +$ +$ UQ with averaging : Namelist PRO3 +$ CFLTM : Maximum CFL number for refraction. +$ FLSOFT : Flag for 'soft' land boundaries. +$ WDTHCG : Tuning factor propag. direction. +$ WDTHTH : Tuning factor normal direction. +$ +$ UQ with divergence : Namelist PRO4 +$ CFLTM : Maximum CFL number for refraction. +$ FLSOFT : Flag for 'soft' land boundaries. +$ QTFAC : Tuning factor Eq. (3.41). +$ RSFAC : Tuning factor Eq. (3.42). +$ RNFAC : Tuning factor Eq. (3.43). +$ +$ Miscellaneous ------------------------------------------------------ $ +$ Misc. parameters : Namelist MISC +$ CICE0 : Ice concentration cut-off. +$ CICEN : Ice concentration cut-off. +$ XSEED : Xseed in seeding alg. (!/SEED). +$ FLAGTR : Indicating presence and type of +$ subgrid information : +$ 0 : No subgrid information. +$ 1 : Transparancies at cell boun- +$ daries between grid points. +$ 2 : Transp. at cell centers. +$ 3 : Like 1 with cont. ice. +$ 4 : Like 2 with cont. ice. +$ XP, XR, XFILT +$ Xp, Xr and Xf for the dynamic +$ integration scheme. +$ +$ In the 'Out of the box' test setup we run with sub-grid obstacles +$ and with continuous ice treatment. +$ +$ &MISC CICE0 = 0.25, CICEN = 0.75, FLAGTR = 4 / +$ +$ Mandatory string to identify end of namelist input section. +$ +END OF NAMELISTS +$ +$ Define grid -------------------------------------------------------- $ +$ Four records containing : +$ 1 NX, NY. As the outer grid lines are always defined as land +$ points, the minimum size is 3x3. +$ 2 Grid increments SX, SY (degr.or m) and scaling (division) factor. +$ If NX*SX = 360., latitudinal closure is applied. +$ 3 Coordinates of (1,1) (degr.) and scaling (division) factor. +$ 4 Limiting bottom depth (m) to discriminate between land and sea +$ points, minimum water depth (m) as allowed in model, unit number +$ of file with bottom depths, scale factor for bottom depths (mult.), +$ IDLA, IDFM, format for formatted read, FROM and filename. +$ IDLA : Layout indicator : +$ 1 : Read line-by-line bottom to top. +$ 2 : Like 1, single read statement. +$ 3 : Read line-by-line top to bottom. +$ 4 : Like 3, single read statement. +$ IDFM : format indicator : +$ 1 : Free format. +$ 2 : Fixed format with above format descriptor. +$ 3 : Unformatted. +$ FROM : file type parameter +$ 'UNIT' : open file by unit number only. +$ 'NAME' : open file by name and assign to unit. +$ +$ Example for longitude-latitude grid (switch !/LLG), for Cartesian +$ grid the unit is meters (NOT km). +$ + 'RECT' T 'NONE' + 103 119 + 0.019 0.0125 1. + -6.119 47.6375 1. + 0.0 1.0 20 -1. 1 1 '(20f10.2)' 'NAME' '../input/iro_1p5k.bot' +$ +$ If the above unit number equals 10, the bottom data is read from +$ this file and follows below (no intermediate comment lines allowed). +$ +$ 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 +$ +$ If sub-grid information is avalaible as indicated by FLAGTR above, +$ additional input to define this is needed below. In such cases a +$ field of fractional obstructions at or between grid points needs to +$ be supplied. First the location and format of the data is defined +$ by (as above) : +$ - Unit number of file (can be 10, and/or identical to bottem depth +$ unit), scale factor for fractional obstruction, IDLA, IDFM, +$ format for formatted read, FROM and filename +$ +$ 10 0.2 3 1 '(....)' 'NAME' 'obstr.inp' +$ +$ *** NOTE if this unit number is the same as the previous bottom +$ depth unit number, it is assumed that this is the same file +$ without further checks. *** +$ +$ If the above unit number equals 10, the bottom data is read from +$ this file and follows below (no intermediate comment lines allowed, +$ except between the two fields). +$ +$ 0 0 0 0 0 0 0 0 0 0 0 0 +$ 0 0 0 0 0 0 0 0 0 0 0 0 +$ 0 0 0 0 0 0 0 0 0 0 0 0 +$ 0 0 0 0 0 0 0 0 0 0 0 0 +$ 0 0 0 0 0 0 0 0 0 0 0 0 +$ 0 0 0 0 0 0 5 0 0 0 0 0 +$ 0 0 0 0 0 0 5 0 0 0 0 0 +$ 0 0 0 0 0 0 4 0 0 0 0 0 +$ 0 0 0 0 0 0 4 0 0 0 0 0 +$ 0 0 0 0 0 0 5 0 0 0 0 0 +$ 0 0 0 0 0 0 5 0 0 0 0 0 +$ 0 0 0 0 0 0 0 0 0 0 0 0 +$ +$ 0 0 0 0 0 0 0 0 0 0 0 0 +$ 0 0 0 0 0 0 0 0 0 0 0 0 +$ 0 0 0 0 0 0 0 0 0 0 0 0 +$ 0 0 0 0 0 0 0 0 0 0 0 0 +$ 0 0 0 0 0 0 0 0 5 5 5 0 +$ 0 0 0 0 0 0 0 0 0 0 0 0 +$ 0 0 0 0 0 0 0 0 0 0 0 0 +$ 0 0 0 0 0 0 0 0 0 0 0 0 +$ 0 0 0 0 0 0 0 0 0 0 0 0 +$ 0 0 0 0 0 0 0 0 0 0 0 0 +$ 0 0 0 0 0 0 0 0 0 0 0 0 +$ 0 0 0 0 0 0 0 0 0 0 0 0 +$ +$ *** NOTE size of fields is always NX * NY *** +$ + 10 3 1 '(....)' 'PART' 'mapsta.inp' +$ *** NOTE size of fields is always NX * NY *** +$ +$ Input boundary points ---------------------------------------------- $ +$ An unlimited number of lines identifying points at which input +$ boundary conditions are to be defined. If the actual input data is +$ not defined in the actual wave model run, the initial conditions +$ will be applied as constant boundary conditions. Each line contains: +$ Discrete grid counters (IX,IY) of the active point and a +$ connect flag. If this flag is true, and the present and previous +$ point are on a grid line or diagonal, all intermediate points +$ are also defined as boundary points. +$ + 103 86 F + 103 119 T + 1 119 T + 1 1 T + 103 1 T + 103 11 T +$ +$ Close list by defining point (0,0) (mandatory) +$ + 0 0 F +$ Excluded grid points from segment data ( FROM != PART ) +$ First defined as lines, identical to the definition of the input +$ boundary points, and closed the same way. +$ + 0 0 F +$ +$ Second, define a point in a closed body of sea points to remove +$ the entire body os sea points. Also close by point (0,0) +$ + 0 0 +$ +$ Output boundary points --------------------------------------------- $ +$ Output boundary points are defined as a number of straight lines, +$ defined by its starting point (X0,Y0), increments (DX,DY) and number +$ of points. A negative number of points starts a new output file. +$ Note that this data is only generated if requested by the actual +$ program. Example again for spherical grid in degrees. +$ +$ Close list by defining line with 0 points (mandatory) +$ + 0. 0. 0. 0. 0 +$ +$ -------------------------------------------------------------------- $ +$ End of input file $ +$ -------------------------------------------------------------------- $ diff --git a/regtests/ww3_tp2.14/input_oasicm/ww3_grid.nml b/regtests/ww3_tp2.14/input_oasicm/ww3_grid.nml new file mode 100644 index 000000000..c62679719 --- /dev/null +++ b/regtests/ww3_tp2.14/input_oasicm/ww3_grid.nml @@ -0,0 +1,276 @@ +! -------------------------------------------------------------------- ! +! WAVEWATCH III - ww3_grid.nml - Grid pre-processing ! +! -------------------------------------------------------------------- ! + +! -------------------------------------------------------------------- ! +! Define the spectrum parameterization via SPECTRUM_NML namelist +! +! * namelist must be terminated with / +! * definitions & defaults: +! SPECTRUM%XFR = 0. ! frequency increment +! SPECTRUM%FREQ1 = 0. ! first frequency (Hz) +! SPECTRUM%NK = 0 ! number of frequencies (wavenumbers) +! SPECTRUM%NTH = 0 ! number of direction bins +! SPECTRUM%THOFF = 0. ! relative offset of first direction [-0.5,0.5] +! -------------------------------------------------------------------- ! +&SPECTRUM_NML + SPECTRUM%XFR = 1.1 + SPECTRUM%FREQ1 = 0.0373 + SPECTRUM%NK = 32 + SPECTRUM%NTH = 24 +/ + +! -------------------------------------------------------------------- ! +! Define the run parameterization via RUN_NML namelist +! +! * namelist must be terminated with / +! * definitions & defaults: +! RUN%FLDRY = F ! dry run (I/O only, no calculation) +! RUN%FLCX = F ! x-component of propagation +! RUN%FLCY = F ! y-component of propagation +! RUN%FLCTH = F ! direction shift +! RUN%FLCK = F ! wavenumber shift +! RUN%FLSOU = F ! source terms +! -------------------------------------------------------------------- ! +&RUN_NML + RUN%FLCX = T + RUN%FLCY = T + RUN%FLCTH = T + RUN%FLCK = T + RUN%FLSOU = T +/ + +! -------------------------------------------------------------------- ! +! Define the timesteps parameterization via TIMESTEPS_NML namelist +! +! * It is highly recommended to set up time steps which are multiple +! between them. +! +! * The first time step to calculate is the maximum CFL time step +! which depend on the lowest frequency FREQ1 previously set up and the +! lowest spatial grid resolution in meters DXY. +! reminder : 1 degree=60minutes // 1minute=1mile // 1mile=1.852km +! The formula for the CFL time is : +! Tcfl = DXY / (G / (FREQ1*4*Pi) ) with the constants Pi=3,14 and G=9.8m/s²; +! DTXY ~= 90% Tcfl +! DTMAX ~= 3 * DTXY (maximum global time step limit) +! +! * The refraction time step depends on how strong can be the current velocities +! on your grid : +! DTKTH ~= DTMAX / 2 ! in case of no or light current velocities +! DTKTH ~= DTMAX / 10 ! in case of strong current velocities +! +! * The source terms time step is usually defined between 5s and 60s. +! A common value is 10s. +! DTMIN ~= 10 +! +! * namelist must be terminated with / +! * definitions & defaults: +! TIMESTEPS%DTMAX = 0. ! maximum global time step (s) +! TIMESTEPS%DTXY = 0. ! maximum CFL time step for x-y (s) +! TIMESTEPS%DTKTH = 0. ! maximum CFL time step for k-th (s) +! TIMESTEPS%DTMIN = 0. ! minimum source term time step (s) +! -------------------------------------------------------------------- ! +&TIMESTEPS_NML + TIMESTEPS%DTMAX = 180. + TIMESTEPS%DTXY = 45. + TIMESTEPS%DTKTH = 45. + TIMESTEPS%DTMIN = 10. +/ + +! -------------------------------------------------------------------- ! +! Define the grid to preprocess via GRID_NML namelist +! +! * the tunable parameters for source terms, propagation schemes, and +! numerics are read using namelists. +! * Any namelist found in the folowing sections is temporarily written +! to param.scratch, and read from there if necessary. +! * The order of the namelists is immaterial. +! * Namelists not needed for the given switch settings will be skipped +! automatically +! +! * grid type can be : +! 'RECT' : rectilinear +! 'CURV' : curvilinear +! 'UNST' : unstructured (triangle-based) +! +! * coordinate system can be : +! 'SPHE' : Spherical (degrees) +! 'CART' : Cartesian (meters) +! +! * grid closure can only be applied in spherical coordinates +! +! * grid closure can be : +! 'NONE' : No closure is applied +! 'SMPL' : Simple grid closure. Grid is periodic in the +! : i-index and wraps at i=NX+1. In other words, +! : (NX+1,J) => (1,J). A grid with simple closure +! : may be rectilinear or curvilinear. +! 'TRPL' : Tripole grid closure : Grid is periodic in the +! : i-index and wraps at i=NX+1 and has closure at +! : j=NY+1. In other words, (NX+1,J<=NY) => (1,J) +! : and (I,NY+1) => (NX-I+1,NY). Tripole +! : grid closure requires that NX be even. A grid +! : with tripole closure must be curvilinear. +! +! * The coastline limit depth is the value which distinguish the sea +! points to the land points. All the points with depth values (ZBIN) +! greater than this limit (ZLIM) will be considered as excluded points +! and will never be wet points, even if the water level grows over. +! It can only overwrite the status of a sea point to a land point. +! The value must have a negative value under the mean sea level +! +! * The minimum water depth allowed to compute the model is the absolute +! depth value (DMIN) used in the model if the input depth is lower to +! avoid the model to blow up. +! +! * namelist must be terminated with / +! * definitions & defaults: +! GRID%NAME = 'unset' ! grid name (30 char) +! GRID%NML = 'namelists.nml' ! namelists filename +! GRID%TYPE = 'unset' ! grid type +! GRID%COORD = 'unset' ! coordinate system +! GRID%CLOS = 'unset' ! grid closure +! +! GRID%ZLIM = 0. ! coastline limit depth (m) +! GRID%DMIN = 0. ! abs. minimum water depth (m) +! -------------------------------------------------------------------- ! +&GRID_NML + GRID%NAME = 'IROISE 1.5KM' + GRID%NML = '../input_oasicm/namelists_IROISE.nml' + GRID%TYPE = 'RECT' + GRID%COORD = 'SPHE' + GRID%CLOS = 'NONE' + GRID%ZLIM = 0.0 + GRID%DMIN = 1.0 +/ + +! -------------------------------------------------------------------- ! +! Define the rectilinear grid type via RECT_NML namelist +! - only for RECT grids - +! +! * The minimum grid size is 3x3. +! +! * If the grid increments SX and SY are given in minutes of arc, the scaling +! factor SF must be set to 60. to provide an increment factor in degree. +! +! * If CSTRG='SMPL', then SX is forced to 360/NX. +! +! * value <= value_read / scale_fac +! +! * namelist must be terminated with / +! * definitions & defaults: +! RECT%NX = 0 ! number of points along x-axis +! RECT%NY = 0 ! number of points along y-axis +! +! RECT%SX = 0. ! grid increment along x-axis +! RECT%SY = 0. ! grid increment along y-axis +! RECT%SF = 1. ! scaling division factor for x-y axis +! +! RECT%X0 = 0. ! x-coordinate of lower-left corner (deg) +! RECT%Y0 = 0. ! y-coordinate of lower-left corner (deg) +! RECT%SF0 = 1. ! scaling division factor for x0,y0 coord +! -------------------------------------------------------------------- ! +&RECT_NML + RECT%NX = 103 + RECT%NY = 119 + RECT%SX = 0.019 + RECT%SY = 0.0125 + RECT%X0 = -6.119 + RECT%Y0 = 47.6375 +/ + +! -------------------------------------------------------------------- ! +! Define the depth to preprocess via DEPTH_NML namelist +! - for RECT and CURV grids - +! +! * if no obstruction subgrid, need to set &MISC FLAGTR = 0 +! +! * The depth value must have negative values under the mean sea level +! +! * value <= value_read * scale_fac +! +! * IDLA : Layout indicator : +! 1 : Read line-by-line bottom to top. (default) +! 2 : Like 1, single read statement. +! 3 : Read line-by-line top to bottom. +! 4 : Like 3, single read statement. +! * IDFM : format indicator : +! 1 : Free format. (default) +! 2 : Fixed format. +! 3 : Unformatted. +! * FORMAT : element format to read : +! '(....)' : auto detected (default) +! '(f10.6)' : float type +! +! * Example : +! IDF SF IDLA IDFM FORMAT FILENAME +! 50 0.001 1 1 '(....)' 'GLOB-30M.bot' +! +! * namelist must be terminated with / +! * definitions & defaults: +! DEPTH%SF = 1. ! scale factor +! DEPTH%FILENAME = 'unset' ! filename +! DEPTH%IDF = 50 ! file unit number +! DEPTH%IDLA = 1 ! layout indicator +! DEPTH%IDFM = 1 ! format indicator +! DEPTH%FORMAT = '(....)' ! formatted read format +! -------------------------------------------------------------------- ! +&DEPTH_NML + DEPTH%SF = -1. + DEPTH%FILENAME = '../input/iro_1p5k.bot' + DEPTH%FORMAT = '(20f10.2)' +/ + +! -------------------------------------------------------------------- ! +! Define the input boundary points via INBND_COUNT_NML and +! INBND_POINT_NML namelist +! - for RECT, CURV and UNST grids - +! +! * If no mask defined, INBOUND can be used +! +! * If the actual input data is not defined in the actual wave model run +! the initial conditions will be applied as constant boundary conditions. +! +! * The number of points is defined by INBND_COUNT +! +! * The points must start from index 1 to N +! +! * Each line contains: +! Discrete grid counters (IX,IY) of the active point and a +! connect flag. If this flag is true, and the present and previous +! point are on a grid line or diagonal, all intermediate points +! are also defined as boundary points. +! +! * Included point : +! grid points from segment data +! Defines as lines identifying points at which +! input boundary conditions are to be defined. +! +! * namelist must be terminated with / +! * definitions & defaults: +! INBND_COUNT%N_POINT = 0 ! number of segments +! +! INBND_POINT(I)%X_INDEX = 0 ! x index included point +! INBND_POINT(I)%Y_INDEX = 0 ! y index included point +! INBND_POINT(I)%CONNECT = F ! connect flag +! +! OR +! INBND_POINT(I) = 0 0 F ! included point +! -------------------------------------------------------------------- ! +&INBND_COUNT_NML + INBND_COUNT%N_POINT = 6 +/ + +&INBND_POINT_NML + INBND_POINT(1) = 103 86 F + INBND_POINT(2) = 103 119 T + INBND_POINT(3) = 1 119 T + INBND_POINT(4) = 1 1 T + INBND_POINT(5) = 103 1 T + INBND_POINT(6) = 103 11 T +/ + +! -------------------------------------------------------------------- ! +! WAVEWATCH III - end of namelist ! +! -------------------------------------------------------------------- ! diff --git a/regtests/ww3_tp2.14/input/ww3_ounf.inp b/regtests/ww3_tp2.14/input_oasicm/ww3_ounf.inp similarity index 100% rename from regtests/ww3_tp2.14/input/ww3_ounf.inp rename to regtests/ww3_tp2.14/input_oasicm/ww3_ounf.inp diff --git a/regtests/ww3_tp2.14/input/ww3_ounf.nml b/regtests/ww3_tp2.14/input_oasicm/ww3_ounf.nml similarity index 100% rename from regtests/ww3_tp2.14/input/ww3_ounf.nml rename to regtests/ww3_tp2.14/input_oasicm/ww3_ounf.nml diff --git a/regtests/ww3_tp2.14/input/ww3_shel_OASICM.inp b/regtests/ww3_tp2.14/input_oasicm/ww3_shel.inp similarity index 100% rename from regtests/ww3_tp2.14/input/ww3_shel_OASICM.inp rename to regtests/ww3_tp2.14/input_oasicm/ww3_shel.inp diff --git a/regtests/ww3_tp2.14/input/ww3_shel_OASICM.nml b/regtests/ww3_tp2.14/input_oasicm/ww3_shel.nml similarity index 95% rename from regtests/ww3_tp2.14/input/ww3_shel_OASICM.nml rename to regtests/ww3_tp2.14/input_oasicm/ww3_shel.nml index 6f6418635..d48edfbd8 100644 --- a/regtests/ww3_tp2.14/input/ww3_shel_OASICM.nml +++ b/regtests/ww3_tp2.14/input_oasicm/ww3_shel.nml @@ -44,6 +44,8 @@ ! INPUT%FORCING%WATER_LEVELS = 'F' ! INPUT%FORCING%CURRENTS = 'F' ! INPUT%FORCING%WINDS = 'F' +! INPUT%FORCING%ATM_MOMENTUM = 'F' +! INPUT%FORCING%AIR_DENSITY = 'F' ! INPUT%FORCING%ICE_CONC = 'F' ! INPUT%FORCING%ICE_PARAM1 = 'F' ! INPUT%FORCING%ICE_PARAM2 = 'F' @@ -58,6 +60,7 @@ ! INPUT%ASSIM%SPEC2D = 'F' ! -------------------------------------------------------------------- ! &INPUT_NML + INPUT%FORCING%ICE_CONC = 'C' INPUT%FORCING%ICE_PARAM1 = 'C' INPUT%FORCING%ICE_PARAM5 = 'C' / @@ -95,9 +98,11 @@ ! T T 1 5 WLV WLV Water levels. ! T T 1 6 ICE ICE Ice concentration. ! T T 1 7 IBG IBG Iceberg-induced damping. -! T T 1 8 D50 D50 Median sediment grain size. -! T T 1 9 IC1 IC1 Ice thickness. -! T T 1 10 IC5 IC5 Ice flow diameter. +! T T 1 8 TAUA TAU Atm. momentum. +! T T 1 9 RHOAIR RHO Air density. +! T T 1 10 D50 D50 Median sediment grain size. +! T T 1 11 IC1 IC1 Ice thickness. +! T T 1 12 IC5 IC5 Ice flow diameter. ! ------------------------------------------------- ! 2 Standard mean wave Parameters ! ------------------------------------------------- @@ -118,6 +123,7 @@ ! T T 2 15 HMAXD SDMH St Dev of MXC (STE) ! T T 2 16 HCMAXD SDMHC St Dev of MXHC (STE) ! F T 2 17 WBT WBT Domiant wave breaking probability bT +! F F 2 18 FP0 TP Peak period (from peak freq) ! ------------------------------------------------- ! 3 Spectral Parameters (first 5) ! ------------------------------------------------- @@ -175,6 +181,7 @@ ! F F 6 9 P2SMS P2L Micro seism source term ! F F 6 10 TAUICE TWI Wave to sea ice stress ! F F 6 11 PHICE FIC Wave to sea ice energy flux +! F F 6 12 USSP USP Partitioned surface Stokes drift ! ------------------------------------------------- ! 7 Wave-bottom layer ! ------------------------------------------------- @@ -220,9 +227,14 @@ ! - Ice model : IC5 TWI ! - Received fields by ww3: ! - Ocean model : SSH CUR -! - Atmospheric model : WND +! - Atmospheric model : WND TAU RHO ! - Ice model : ICE IC1 IC5 ! +! * Coupling flag (T) or (F) at T+0 (extra fields in the restart needed) +! +! * extra fields to be written to the restart: +! - The list includes all fields sent by coupling exchange only +! ! * namelist must be terminated with / ! * definitions & defaults: ! TYPE%FIELD%LIST = 'unset' @@ -237,6 +249,8 @@ ! TYPE%PARTITION%FORMAT = T ! TYPE%COUPLING%SENT = 'unset' ! TYPE%COUPLING%RECEIVED = 'unset' +! TYPE%COUPLING%COUPLET0 = F +! TYPE%RESTART%EXTRA = 'unset' ! ! -------------------------------------------------------------------- ! &OUTPUT_TYPE_NML diff --git a/regtests/ww3_tp2.14/input_oasicm/ww3_strt.inp b/regtests/ww3_tp2.14/input_oasicm/ww3_strt.inp new file mode 100755 index 000000000..948c42911 --- /dev/null +++ b/regtests/ww3_tp2.14/input_oasicm/ww3_strt.inp @@ -0,0 +1,72 @@ +$ -------------------------------------------------------------------- $ +$ WAVEWATCH III Initial conditions input file $ +$--------------------------------------------------------------------- $ +$ type of initial field ITYPE . +$ + 1 +$ +$ ITYPE = 1 ---------------------------------------------------------- $ +$ Gaussian in frequency and space, cos type in direction. +$ - fp and spread (Hz), mean direction (degr., oceanographic +$ convention) and cosine power, Xm and spread (degr. or m) Ym and +$ spread (degr. or m), Hmax (m) (Example for lon-lat grid in degr.). +$ +$ 0.10 0.01 270. 2 1. 0.5 1. 0.5 2.5 + 0.10 0.01 270. 2 0. 1000. 1. 1000. 2.5 +$ 0.10 0.01 270. 2 0. 1000. 1. 1000. 0.01 +$ 0.10 0.01 270. 2 0. 1000. 1. 1000. 0. +$ +$ ITYPE = 2 ---------------------------------------------------------- $ +$ JONSWAP spectrum with Hasselmann et al. (1980) direct. distribution. +$ - alfa, peak freq. (Hz), mean direction (degr., oceanographical +$ convention), gamma, sigA, sigB, Xm and spread (degr. or m) Ym and +$ spread (degr. or m) (Example for lon-lat grid in degr.). +$ alfa, sigA, sigB give default values if less than or equal to 0. +$ +$ 0.0081 0.1 270. 1.0 0. 0. 1. 100. 1. 100. +$ +$ ITYPE = 3 ---------------------------------------------------------- $ +$ Fetch-limited JONSWAP +$ - No additional data, the local spectrum is calculated using the +$ local wind speed and direction, using the spatial grid size as +$ fetch, and assuring that the spectrum is within the discrete +$ frequency range. +$ +$ ITYPE = 4 ---------------------------------------------------------- $ +$ User-defined spectrum +$ - Scale factor., defaults to 1 if less than or equal 0. +$ - Spectrum F(f,theta) (single read statement) +$ +$ -0.1 +$ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +$ 0 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +$ 0 1 4 2 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +$ 0 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +$ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +$ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +$ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +$ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +$ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +$ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +$ 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 0 0 0 0 0 0 0 0 0 0 +$ 0 0 0 0 0 0 0 0 0 0 1 2 3 2 1 1 0 0 0 0 0 0 0 0 0 +$ 0 0 0 0 0 0 0 0 0 1 3 9 7 5 3 2 1 0 0 0 0 0 0 0 0 +$ 0 0 0 0 0 0 0 0 0 0 1 3 4 3 2 1 0 0 0 0 0 0 0 0 0 +$ 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 0 0 0 0 0 0 0 0 0 0 +$ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +$ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +$ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +$ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +$ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +$ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +$ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +$ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +$ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +$ +$ ITYPE = 5 ---------------------------------------------------------- $ +$ Starting from calm conditions. +$ - No additional data. +$ +$ -------------------------------------------------------------------- $ +$ End of input file $ +$ -------------------------------------------------------------------- $ diff --git a/regtests/ww3_tp2.14/input/TOYNAMELIST.nam.OASOCM b/regtests/ww3_tp2.14/input_oasocm/TOYNAMELIST.nam similarity index 100% rename from regtests/ww3_tp2.14/input/TOYNAMELIST.nam.OASOCM rename to regtests/ww3_tp2.14/input_oasocm/TOYNAMELIST.nam diff --git a/regtests/ww3_tp2.14/input/namcouple.OASOCM b/regtests/ww3_tp2.14/input_oasocm/namcouple similarity index 100% rename from regtests/ww3_tp2.14/input/namcouple.OASOCM rename to regtests/ww3_tp2.14/input_oasocm/namcouple diff --git a/regtests/ww3_tp2.14/input_oasocm/namelists_IROISE.nml b/regtests/ww3_tp2.14/input_oasocm/namelists_IROISE.nml new file mode 100644 index 000000000..8b5707b65 --- /dev/null +++ b/regtests/ww3_tp2.14/input_oasocm/namelists_IROISE.nml @@ -0,0 +1 @@ +END OF NAMELISTS diff --git a/regtests/ww3_tp2.14/input_oasocm/prep_env.sh b/regtests/ww3_tp2.14/input_oasocm/prep_env.sh new file mode 100755 index 000000000..ee03d4033 --- /dev/null +++ b/regtests/ww3_tp2.14/input_oasocm/prep_env.sh @@ -0,0 +1,101 @@ +#!/bin/bash -e + +if [ $# -ne 4 ] +then + echo "need four arguments:" + echo '$1 : path_i' + echo '$2 : path_w' + echo '$3 : complr' + echo '$4 : switch' + exit 1 +fi + +path_i=$1 +path_w=$2 +cmplr=$3 +swtstr=$4 + +echo '' +echo ' setup coupling environment' +export WWATCH3_DIR=`grep WWATCH3_DIR $WWATCH3_ENV | awk -F' ' '{print $2}' ` +export WWATCH3_CC=`grep WWATCH3_CC $WWATCH3_ENV | awk -F' ' '{print $2}' ` + + +echo ' copy oasis and toy in $path_w' +cp -r $path_i/../input/toy $path_w/ +cp -r $path_i/../input/oasis3-mct $path_w/ + + +echo ' Setup oasis cmplr file' +cd $path_w/oasis3-mct/util/make_dir +source $WWATCH3_DIR/bin/cmplr.env +# shortlist optl +alloptl=( $optl ) +for ioptl in $(seq 2 ${#alloptl[@]}); do + optls="${optls}${alloptl[$ioptl]} " +done +# shortlist optc +alloptc=( $optc ) +for ioptc in $(seq 3 ${#alloptc[@]}); do + optcs="${optcs}${alloptc[$ioptc]} " +done +# shorten comp_mpi +comp_mpi_exe="$(echo $comp_mpi | awk -F' ' '{print $1}')" +# sed cmplr.tmpl +sed -e "s::$path_w/oasis3-mct:" \ + -e "s::$path_w/work_oasis3-mct:" \ + -e "s//$optcs/" -e "s//$optls/" \ + -e "s//$comp_mpi/" -e "s//$comp_mpi_exe/" \ + -e "s//$WWATCH3_CC/" cmplr.tmpl > cmplr +echo " sed cmplr.tmpl => cmplr" +chmod 775 cmplr + + +echo ' setup oasis make.inc file' +sed -e "s::$path_w/oasis3-mct:" make.inc.tmpl > make.inc + + +echo ' compile oasis coupler' +make realclean -f TopMakefileOasis3 > $path_w/oasis_clean.out +make -f TopMakefileOasis3 > $path_w/oasis_make.out + + +echo ' setup toy Makefile' +cd $path_w/toy +sed -e "s::$path_w/oasis3-mct:" Makefile.tmpl > Makefile + + +echo ' compile toy model' +make clean > $path_w/toy_clean.out +make > $path_w/toy_make.out + + +echo ' copy oasis coupler inputs' +cp $path_i/namcouple $path_w/namcouple + + +echo ' copy toy model inputs' +if [ -f $path_w/toy/r-toy.nc.$swtstr ]; then + cp $path_w/toy/r-toy.nc.$swtstr $path_w/r-toy.nc +else + echo "WARNING: model input $path_w/toy/r-toy.nc.$swtstr does not exist" +fi + +cp $path_w/toy/grid_toy_model.nc $path_w/ +cp $path_w/toy/toy_coupled_field.nc.$swtstr $path_w/toy_coupled_field.nc +cp $path_w/toy/toy_model $path_w/ + +cp $path_i/TOYNAMELIST.nam $path_w/TOYNAMELIST.nam + + +echo ' copy ww3 model inputs' +cd $path_w +if [ -f $path_i/r-ww3.nc ]; then + cp $path_i/r-ww3.nc $path_w/r-ww3.nc +else + echo "WARNING: model input $path_i/toy/r-ww3.nc does not exist" +fi + + + +echo '' diff --git a/regtests/ww3_tp2.14/input/switch_OASOCM b/regtests/ww3_tp2.14/input_oasocm/switch_OASOCM similarity index 100% rename from regtests/ww3_tp2.14/input/switch_OASOCM rename to regtests/ww3_tp2.14/input_oasocm/switch_OASOCM diff --git a/regtests/ww3_tp2.14/input_oasocm/ww3_grid.inp b/regtests/ww3_tp2.14/input_oasocm/ww3_grid.inp new file mode 100755 index 000000000..e367379b4 --- /dev/null +++ b/regtests/ww3_tp2.14/input_oasocm/ww3_grid.inp @@ -0,0 +1,276 @@ +$ -------------------------------------------------------------------- $ +$ WAVEWATCH III Grid preprocessor input file $ +$ -------------------------------------------------------------------- $ +$ Grid name (C*30, in quotes) +$ + 'IROISE 1.5KM' +$ +$ Frequency increment factor and first frequency (Hz) ---------------- $ +$ number of frequencies (wavenumbers) and directions +$ +1.1 0.0373 32 24 0. +$ +$ Set model flags ---------------------------------------------------- $ +$ - FLDRY Dry run (input/output only, no calculation). +$ - FLCX, FLCY Activate X and Y component of propagation. +$ - FLCTH, FLCK Activate direction and wavenumber shifts. +$ - FLSOU Activate source terms. +$ + F T T T T T +$ +$ Set time steps ----------------------------------------------------- $ +$ - Time step information (this information is always read) +$ maximum global time step, maximum CFL time step for x-y and +$ k-theta, minimum source term time step (all in seconds). +$ + 180. 45. 45. 10. +$ +$ Start of namelist input section ------------------------------------ $ +$ Starting with WAVEWATCH III version 2.00, the tunable parameters +$ for source terms, propagation schemes, and numerics are read using +$ namelists. Any namelist found in the folowing sections up to the +$ end-of-section identifier string (see below) is temporarily written +$ to ww3_grid.scratch, and read from there if necessary. Namelists +$ not needed for the given switch settings will be skipped +$ automatically, and the order of the namelists is immaterial. +$ As an example, namelist input to change SWELLF and ZWND in the +$ Tolman and Chalikov input would be +$ +$ &SIN2 SWELLF = 0.1, ZWND = 15. / +$ +$ Define constants in source terms ----------------------------------- $ +$ +$ Input - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +$ WAM-3 : Namelist SIN1 +$ CINP : Proportionality constant. +$ &SIN1 CINP= 0.25 / +$ Tolman and Chalikov : Namelist SIN2 +$ ZWND : Height of wind (m). +$ SWELLF : swell factor in (2.48). +$ STABSH, STABOF, CNEG, CPOS, FNEG : +$ c0, ST0, c1, c2 and f1 in . (2.63) +$ through (2.65) for definition of +$ effective wind speed (!/STAB2). +$ +$ Nonlinear interactions - - - - - - - - - - - - - - - - - - - - - - - +$ Discrete I.A. : Namelist SNL1 +$ LAMBDA : Lambda in source term. +$ NLPROP : C in sourc term. NOTE : default +$ value depends on other source +$ terms selected. +$ KDCONV : Factor before kd in Eq. (2.24). +$ KDMIN, SNLCS1, SNLCS2, SNLCS3 : +$ Minimum kd, and constants c1-3 +$ in depth scaling function. +$ Exact interactions : Namelist SNL2 +$ IQTYPE : Type of depth treatment +$ 1 : Deep water +$ 2 : Deep water / WAM scaling +$ 3 : Shallow water +$ TAILNL : Parametric tail power. +$ NDEPTH : Number of depths in for which +$ integration space is established. +$ Used for IQTYPE = 3 only +$ Namelist ANL2 +$ DEPTHS : Array with depths for NDEPTH = 3 +$ +$ Dissipation - - - - - - - - - - - - - - - - - - - - - - - - - - - - +$ WAM-3 : Namelist SDS1 +$ CDIS, APM : As in source term. +$ +$ Tolman and Chalikov : Namelist SDS2 +$ SDSA0, SDSA1, SDSA2, SDSB0, SDSB1, PHIMIN : +$ Constants a0, a1, a2, b0, b1 and +$ PHImin. +$ +$ Bottom friction - - - - - - - - - - - - - - - - - - - - - - - - - - +$ JONSWAP : Namelist SBT1 +$ GAMMA : As it says. +$ +$ Propagation schemes ------------------------------------------------ $ +$ First order : Namelist PRO1 +$ CFLTM : Maximum CFL number for refraction. +$ +$ UQ with diffusion : Namelist PRO2 +$ CFLTM : Maximum CFL number for refraction. +$ FLSOFT : Flag for 'soft' land boundaries. +$ DTIME : Swell age (s) in garden sprinkler +$ correction. If 0., all diffusion +$ switched off. If small non-zero +$ (DEFAULT !!!) only wave growth +$ diffusion. +$ LATMIN : Maximum latitude used in calc. of +$ strength of diffusion for prop. +$ +$ UQ with averaging : Namelist PRO3 +$ CFLTM : Maximum CFL number for refraction. +$ FLSOFT : Flag for 'soft' land boundaries. +$ WDTHCG : Tuning factor propag. direction. +$ WDTHTH : Tuning factor normal direction. +$ +$ UQ with divergence : Namelist PRO4 +$ CFLTM : Maximum CFL number for refraction. +$ FLSOFT : Flag for 'soft' land boundaries. +$ QTFAC : Tuning factor Eq. (3.41). +$ RSFAC : Tuning factor Eq. (3.42). +$ RNFAC : Tuning factor Eq. (3.43). +$ +$ Miscellaneous ------------------------------------------------------ $ +$ Misc. parameters : Namelist MISC +$ CICE0 : Ice concentration cut-off. +$ CICEN : Ice concentration cut-off. +$ XSEED : Xseed in seeding alg. (!/SEED). +$ FLAGTR : Indicating presence and type of +$ subgrid information : +$ 0 : No subgrid information. +$ 1 : Transparancies at cell boun- +$ daries between grid points. +$ 2 : Transp. at cell centers. +$ 3 : Like 1 with cont. ice. +$ 4 : Like 2 with cont. ice. +$ XP, XR, XFILT +$ Xp, Xr and Xf for the dynamic +$ integration scheme. +$ +$ In the 'Out of the box' test setup we run with sub-grid obstacles +$ and with continuous ice treatment. +$ +$ &MISC CICE0 = 0.25, CICEN = 0.75, FLAGTR = 4 / +$ +$ Mandatory string to identify end of namelist input section. +$ +END OF NAMELISTS +$ +$ Define grid -------------------------------------------------------- $ +$ Four records containing : +$ 1 NX, NY. As the outer grid lines are always defined as land +$ points, the minimum size is 3x3. +$ 2 Grid increments SX, SY (degr.or m) and scaling (division) factor. +$ If NX*SX = 360., latitudinal closure is applied. +$ 3 Coordinates of (1,1) (degr.) and scaling (division) factor. +$ 4 Limiting bottom depth (m) to discriminate between land and sea +$ points, minimum water depth (m) as allowed in model, unit number +$ of file with bottom depths, scale factor for bottom depths (mult.), +$ IDLA, IDFM, format for formatted read, FROM and filename. +$ IDLA : Layout indicator : +$ 1 : Read line-by-line bottom to top. +$ 2 : Like 1, single read statement. +$ 3 : Read line-by-line top to bottom. +$ 4 : Like 3, single read statement. +$ IDFM : format indicator : +$ 1 : Free format. +$ 2 : Fixed format with above format descriptor. +$ 3 : Unformatted. +$ FROM : file type parameter +$ 'UNIT' : open file by unit number only. +$ 'NAME' : open file by name and assign to unit. +$ +$ Example for longitude-latitude grid (switch !/LLG), for Cartesian +$ grid the unit is meters (NOT km). +$ + 'RECT' T 'NONE' + 103 119 + 0.019 0.0125 1. + -6.119 47.6375 1. + 0.0 1.0 20 -1. 1 1 '(20f10.2)' 'NAME' '../input/iro_1p5k.bot' +$ +$ If the above unit number equals 10, the bottom data is read from +$ this file and follows below (no intermediate comment lines allowed). +$ +$ 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 +$ +$ If sub-grid information is avalaible as indicated by FLAGTR above, +$ additional input to define this is needed below. In such cases a +$ field of fractional obstructions at or between grid points needs to +$ be supplied. First the location and format of the data is defined +$ by (as above) : +$ - Unit number of file (can be 10, and/or identical to bottem depth +$ unit), scale factor for fractional obstruction, IDLA, IDFM, +$ format for formatted read, FROM and filename +$ +$ 10 0.2 3 1 '(....)' 'NAME' 'obstr.inp' +$ +$ *** NOTE if this unit number is the same as the previous bottom +$ depth unit number, it is assumed that this is the same file +$ without further checks. *** +$ +$ If the above unit number equals 10, the bottom data is read from +$ this file and follows below (no intermediate comment lines allowed, +$ except between the two fields). +$ +$ 0 0 0 0 0 0 0 0 0 0 0 0 +$ 0 0 0 0 0 0 0 0 0 0 0 0 +$ 0 0 0 0 0 0 0 0 0 0 0 0 +$ 0 0 0 0 0 0 0 0 0 0 0 0 +$ 0 0 0 0 0 0 0 0 0 0 0 0 +$ 0 0 0 0 0 0 5 0 0 0 0 0 +$ 0 0 0 0 0 0 5 0 0 0 0 0 +$ 0 0 0 0 0 0 4 0 0 0 0 0 +$ 0 0 0 0 0 0 4 0 0 0 0 0 +$ 0 0 0 0 0 0 5 0 0 0 0 0 +$ 0 0 0 0 0 0 5 0 0 0 0 0 +$ 0 0 0 0 0 0 0 0 0 0 0 0 +$ +$ 0 0 0 0 0 0 0 0 0 0 0 0 +$ 0 0 0 0 0 0 0 0 0 0 0 0 +$ 0 0 0 0 0 0 0 0 0 0 0 0 +$ 0 0 0 0 0 0 0 0 0 0 0 0 +$ 0 0 0 0 0 0 0 0 5 5 5 0 +$ 0 0 0 0 0 0 0 0 0 0 0 0 +$ 0 0 0 0 0 0 0 0 0 0 0 0 +$ 0 0 0 0 0 0 0 0 0 0 0 0 +$ 0 0 0 0 0 0 0 0 0 0 0 0 +$ 0 0 0 0 0 0 0 0 0 0 0 0 +$ 0 0 0 0 0 0 0 0 0 0 0 0 +$ 0 0 0 0 0 0 0 0 0 0 0 0 +$ +$ *** NOTE size of fields is always NX * NY *** +$ + 10 3 1 '(....)' 'PART' 'mapsta.inp' +$ *** NOTE size of fields is always NX * NY *** +$ +$ Input boundary points ---------------------------------------------- $ +$ An unlimited number of lines identifying points at which input +$ boundary conditions are to be defined. If the actual input data is +$ not defined in the actual wave model run, the initial conditions +$ will be applied as constant boundary conditions. Each line contains: +$ Discrete grid counters (IX,IY) of the active point and a +$ connect flag. If this flag is true, and the present and previous +$ point are on a grid line or diagonal, all intermediate points +$ are also defined as boundary points. +$ + 103 86 F + 103 119 T + 1 119 T + 1 1 T + 103 1 T + 103 11 T +$ +$ Close list by defining point (0,0) (mandatory) +$ + 0 0 F +$ Excluded grid points from segment data ( FROM != PART ) +$ First defined as lines, identical to the definition of the input +$ boundary points, and closed the same way. +$ + 0 0 F +$ +$ Second, define a point in a closed body of sea points to remove +$ the entire body os sea points. Also close by point (0,0) +$ + 0 0 +$ +$ Output boundary points --------------------------------------------- $ +$ Output boundary points are defined as a number of straight lines, +$ defined by its starting point (X0,Y0), increments (DX,DY) and number +$ of points. A negative number of points starts a new output file. +$ Note that this data is only generated if requested by the actual +$ program. Example again for spherical grid in degrees. +$ +$ Close list by defining line with 0 points (mandatory) +$ + 0. 0. 0. 0. 0 +$ +$ -------------------------------------------------------------------- $ +$ End of input file $ +$ -------------------------------------------------------------------- $ diff --git a/regtests/ww3_tp2.14/input_oasocm/ww3_grid.nml b/regtests/ww3_tp2.14/input_oasocm/ww3_grid.nml new file mode 100644 index 000000000..a2f8f0900 --- /dev/null +++ b/regtests/ww3_tp2.14/input_oasocm/ww3_grid.nml @@ -0,0 +1,276 @@ +! -------------------------------------------------------------------- ! +! WAVEWATCH III - ww3_grid.nml - Grid pre-processing ! +! -------------------------------------------------------------------- ! + +! -------------------------------------------------------------------- ! +! Define the spectrum parameterization via SPECTRUM_NML namelist +! +! * namelist must be terminated with / +! * definitions & defaults: +! SPECTRUM%XFR = 0. ! frequency increment +! SPECTRUM%FREQ1 = 0. ! first frequency (Hz) +! SPECTRUM%NK = 0 ! number of frequencies (wavenumbers) +! SPECTRUM%NTH = 0 ! number of direction bins +! SPECTRUM%THOFF = 0. ! relative offset of first direction [-0.5,0.5] +! -------------------------------------------------------------------- ! +&SPECTRUM_NML + SPECTRUM%XFR = 1.1 + SPECTRUM%FREQ1 = 0.0373 + SPECTRUM%NK = 32 + SPECTRUM%NTH = 24 +/ + +! -------------------------------------------------------------------- ! +! Define the run parameterization via RUN_NML namelist +! +! * namelist must be terminated with / +! * definitions & defaults: +! RUN%FLDRY = F ! dry run (I/O only, no calculation) +! RUN%FLCX = F ! x-component of propagation +! RUN%FLCY = F ! y-component of propagation +! RUN%FLCTH = F ! direction shift +! RUN%FLCK = F ! wavenumber shift +! RUN%FLSOU = F ! source terms +! -------------------------------------------------------------------- ! +&RUN_NML + RUN%FLCX = T + RUN%FLCY = T + RUN%FLCTH = T + RUN%FLCK = T + RUN%FLSOU = T +/ + +! -------------------------------------------------------------------- ! +! Define the timesteps parameterization via TIMESTEPS_NML namelist +! +! * It is highly recommended to set up time steps which are multiple +! between them. +! +! * The first time step to calculate is the maximum CFL time step +! which depend on the lowest frequency FREQ1 previously set up and the +! lowest spatial grid resolution in meters DXY. +! reminder : 1 degree=60minutes // 1minute=1mile // 1mile=1.852km +! The formula for the CFL time is : +! Tcfl = DXY / (G / (FREQ1*4*Pi) ) with the constants Pi=3,14 and G=9.8m/s²; +! DTXY ~= 90% Tcfl +! DTMAX ~= 3 * DTXY (maximum global time step limit) +! +! * The refraction time step depends on how strong can be the current velocities +! on your grid : +! DTKTH ~= DTMAX / 2 ! in case of no or light current velocities +! DTKTH ~= DTMAX / 10 ! in case of strong current velocities +! +! * The source terms time step is usually defined between 5s and 60s. +! A common value is 10s. +! DTMIN ~= 10 +! +! * namelist must be terminated with / +! * definitions & defaults: +! TIMESTEPS%DTMAX = 0. ! maximum global time step (s) +! TIMESTEPS%DTXY = 0. ! maximum CFL time step for x-y (s) +! TIMESTEPS%DTKTH = 0. ! maximum CFL time step for k-th (s) +! TIMESTEPS%DTMIN = 0. ! minimum source term time step (s) +! -------------------------------------------------------------------- ! +&TIMESTEPS_NML + TIMESTEPS%DTMAX = 180. + TIMESTEPS%DTXY = 45. + TIMESTEPS%DTKTH = 45. + TIMESTEPS%DTMIN = 10. +/ + +! -------------------------------------------------------------------- ! +! Define the grid to preprocess via GRID_NML namelist +! +! * the tunable parameters for source terms, propagation schemes, and +! numerics are read using namelists. +! * Any namelist found in the folowing sections is temporarily written +! to param.scratch, and read from there if necessary. +! * The order of the namelists is immaterial. +! * Namelists not needed for the given switch settings will be skipped +! automatically +! +! * grid type can be : +! 'RECT' : rectilinear +! 'CURV' : curvilinear +! 'UNST' : unstructured (triangle-based) +! +! * coordinate system can be : +! 'SPHE' : Spherical (degrees) +! 'CART' : Cartesian (meters) +! +! * grid closure can only be applied in spherical coordinates +! +! * grid closure can be : +! 'NONE' : No closure is applied +! 'SMPL' : Simple grid closure. Grid is periodic in the +! : i-index and wraps at i=NX+1. In other words, +! : (NX+1,J) => (1,J). A grid with simple closure +! : may be rectilinear or curvilinear. +! 'TRPL' : Tripole grid closure : Grid is periodic in the +! : i-index and wraps at i=NX+1 and has closure at +! : j=NY+1. In other words, (NX+1,J<=NY) => (1,J) +! : and (I,NY+1) => (NX-I+1,NY). Tripole +! : grid closure requires that NX be even. A grid +! : with tripole closure must be curvilinear. +! +! * The coastline limit depth is the value which distinguish the sea +! points to the land points. All the points with depth values (ZBIN) +! greater than this limit (ZLIM) will be considered as excluded points +! and will never be wet points, even if the water level grows over. +! It can only overwrite the status of a sea point to a land point. +! The value must have a negative value under the mean sea level +! +! * The minimum water depth allowed to compute the model is the absolute +! depth value (DMIN) used in the model if the input depth is lower to +! avoid the model to blow up. +! +! * namelist must be terminated with / +! * definitions & defaults: +! GRID%NAME = 'unset' ! grid name (30 char) +! GRID%NML = 'namelists.nml' ! namelists filename +! GRID%TYPE = 'unset' ! grid type +! GRID%COORD = 'unset' ! coordinate system +! GRID%CLOS = 'unset' ! grid closure +! +! GRID%ZLIM = 0. ! coastline limit depth (m) +! GRID%DMIN = 0. ! abs. minimum water depth (m) +! -------------------------------------------------------------------- ! +&GRID_NML + GRID%NAME = 'IROISE 1.5KM' + GRID%NML = '../input_oasocm/namelists_IROISE.nml' + GRID%TYPE = 'RECT' + GRID%COORD = 'SPHE' + GRID%CLOS = 'NONE' + GRID%ZLIM = 0.0 + GRID%DMIN = 1.0 +/ + +! -------------------------------------------------------------------- ! +! Define the rectilinear grid type via RECT_NML namelist +! - only for RECT grids - +! +! * The minimum grid size is 3x3. +! +! * If the grid increments SX and SY are given in minutes of arc, the scaling +! factor SF must be set to 60. to provide an increment factor in degree. +! +! * If CSTRG='SMPL', then SX is forced to 360/NX. +! +! * value <= value_read / scale_fac +! +! * namelist must be terminated with / +! * definitions & defaults: +! RECT%NX = 0 ! number of points along x-axis +! RECT%NY = 0 ! number of points along y-axis +! +! RECT%SX = 0. ! grid increment along x-axis +! RECT%SY = 0. ! grid increment along y-axis +! RECT%SF = 1. ! scaling division factor for x-y axis +! +! RECT%X0 = 0. ! x-coordinate of lower-left corner (deg) +! RECT%Y0 = 0. ! y-coordinate of lower-left corner (deg) +! RECT%SF0 = 1. ! scaling division factor for x0,y0 coord +! -------------------------------------------------------------------- ! +&RECT_NML + RECT%NX = 103 + RECT%NY = 119 + RECT%SX = 0.019 + RECT%SY = 0.0125 + RECT%X0 = -6.119 + RECT%Y0 = 47.6375 +/ + +! -------------------------------------------------------------------- ! +! Define the depth to preprocess via DEPTH_NML namelist +! - for RECT and CURV grids - +! +! * if no obstruction subgrid, need to set &MISC FLAGTR = 0 +! +! * The depth value must have negative values under the mean sea level +! +! * value <= value_read * scale_fac +! +! * IDLA : Layout indicator : +! 1 : Read line-by-line bottom to top. (default) +! 2 : Like 1, single read statement. +! 3 : Read line-by-line top to bottom. +! 4 : Like 3, single read statement. +! * IDFM : format indicator : +! 1 : Free format. (default) +! 2 : Fixed format. +! 3 : Unformatted. +! * FORMAT : element format to read : +! '(....)' : auto detected (default) +! '(f10.6)' : float type +! +! * Example : +! IDF SF IDLA IDFM FORMAT FILENAME +! 50 0.001 1 1 '(....)' 'GLOB-30M.bot' +! +! * namelist must be terminated with / +! * definitions & defaults: +! DEPTH%SF = 1. ! scale factor +! DEPTH%FILENAME = 'unset' ! filename +! DEPTH%IDF = 50 ! file unit number +! DEPTH%IDLA = 1 ! layout indicator +! DEPTH%IDFM = 1 ! format indicator +! DEPTH%FORMAT = '(....)' ! formatted read format +! -------------------------------------------------------------------- ! +&DEPTH_NML + DEPTH%SF = -1. + DEPTH%FILENAME = '../input/iro_1p5k.bot' + DEPTH%FORMAT = '(20f10.2)' +/ + +! -------------------------------------------------------------------- ! +! Define the input boundary points via INBND_COUNT_NML and +! INBND_POINT_NML namelist +! - for RECT, CURV and UNST grids - +! +! * If no mask defined, INBOUND can be used +! +! * If the actual input data is not defined in the actual wave model run +! the initial conditions will be applied as constant boundary conditions. +! +! * The number of points is defined by INBND_COUNT +! +! * The points must start from index 1 to N +! +! * Each line contains: +! Discrete grid counters (IX,IY) of the active point and a +! connect flag. If this flag is true, and the present and previous +! point are on a grid line or diagonal, all intermediate points +! are also defined as boundary points. +! +! * Included point : +! grid points from segment data +! Defines as lines identifying points at which +! input boundary conditions are to be defined. +! +! * namelist must be terminated with / +! * definitions & defaults: +! INBND_COUNT%N_POINT = 0 ! number of segments +! +! INBND_POINT(I)%X_INDEX = 0 ! x index included point +! INBND_POINT(I)%Y_INDEX = 0 ! y index included point +! INBND_POINT(I)%CONNECT = F ! connect flag +! +! OR +! INBND_POINT(I) = 0 0 F ! included point +! -------------------------------------------------------------------- ! +&INBND_COUNT_NML + INBND_COUNT%N_POINT = 6 +/ + +&INBND_POINT_NML + INBND_POINT(1) = 103 86 F + INBND_POINT(2) = 103 119 T + INBND_POINT(3) = 1 119 T + INBND_POINT(4) = 1 1 T + INBND_POINT(5) = 103 1 T + INBND_POINT(6) = 103 11 T +/ + +! -------------------------------------------------------------------- ! +! WAVEWATCH III - end of namelist ! +! -------------------------------------------------------------------- ! diff --git a/regtests/ww3_tp2.14/input_oasocm/ww3_ounf.inp b/regtests/ww3_tp2.14/input_oasocm/ww3_ounf.inp new file mode 100755 index 000000000..b8bbf80f6 --- /dev/null +++ b/regtests/ww3_tp2.14/input_oasocm/ww3_ounf.inp @@ -0,0 +1,41 @@ +$ -------------------------------------------------------------------- $ +$ WAVEWATCH III Grid output post-processing $ +$--------------------------------------------------------------------- $ +$ First output time (yyyymmdd hhmmss), increment of output (s), +$ and number of output times. +$ + 20080310 000000 180 100 +$ +$ Output request flags identifying fields as in ww3_shel.inp. See that +$ file for a full documentation of field output options. Namelist type +$ selection is used here (for alternative F/T flags, see ww3_shel.inp). +$ + N + HS FP DIR DP CHA UST DPT CUR WND +$ +$--------------------------------------------------------------------- $ +$ netCDF version [3,4] +$ and variable type 4 [2 = SHORT, 3 = it depends , 4 = REAL] +$ swell partitions [0 1 2 3 4 5] +$ variables in same file [T] or not [F] +$ + 3 4 + 0 + T +$ +$ -------------------------------------------------------------------- $ +$ File prefix +$ number of characters in date [0(nodate),4(yearly),6(monthly),8(daily),10(hourly)] +$ IX and IY ranges [regular:IX NX IY NY DX DY, unstructured:IP NP DP DP] +$ +ww3. +6 +1 10000 1 10000 +$ +$ For each field and time a new file is generated with the file name +$ ww3.date_xxx.nc , where date is a conventional time indicator with S3 +$ characters, and xxx is a field identifier. +$ +$ -------------------------------------------------------------------- $ +$ End of input file $ +$ -------------------------------------------------------------------- $ diff --git a/regtests/ww3_tp2.14/input_oasocm/ww3_ounf.nml b/regtests/ww3_tp2.14/input_oasocm/ww3_ounf.nml new file mode 100644 index 000000000..fc0386ff8 --- /dev/null +++ b/regtests/ww3_tp2.14/input_oasocm/ww3_ounf.nml @@ -0,0 +1,60 @@ +! -------------------------------------------------------------------- ! +! WAVEWATCH III ww3_ounf.nml - Grid output post-processing ! +! -------------------------------------------------------------------- ! + +! -------------------------------------------------------------------- ! +! Define the output fields to postprocess via FIELD_NML namelist +! +! * the detailed list of field names FIELD%LIST is given in ww3_shel.nml +! DPT CUR WND AST WLV ICE IBG D50 IC1 IC5 +! HS LM T02 T0M1 T01 FP DIR SPR DP HIG +! EF TH1M STH1M TH2M STH2M WN +! PHS PTP PLP PDIR PSPR PWS PDP PQP PPE PGW PSW PTM10 PT01 PT02 PEP TWS PNR +! UST CHA CGE FAW TAW TWA WCC WCF WCH WCM FWS +! SXY TWO BHD FOC TUS USS P2S USF P2L TWI FIC +! ABR UBR BED FBB TBB +! MSS MSC WL02 AXT AYT AXY +! DTD FC CFX CFD CFK +! U1 U2 +! +! * namelist must be terminated with / +! * definitions & defaults: +! FIELD%TIMESTART = '19000101 000000' ! Stop date for the output field +! FIELD%TIMESTRIDE = '0' ! Time stride for the output field +! FIELD%TIMESTOP = '29001231 000000' ! Stop date for the output field +! FIELD%TIMECOUNT = '1000000000' ! Number of time steps +! FIELD%TIMESPLIT = 6 ! [0(nodate),4(yearly),6(monthly),8(daily),10(hourly)] +! FIELD%LIST = 'unset' ! List of output fields +! FIELD%PARTITION = '0 1 2 3' ! List of wave partitions ['0 1 2 3 4 5'] +! FIELD%SAMEFILE = T ! All the variables in the same file [T|F] +! FIELD%TYPE = 3 ! [2 = SHORT, 3 = it depends , 4 = REAL] +! -------------------------------------------------------------------- ! +&FIELD_NML + FIELD%TIMESTART = '20080310 000000' + FIELD%TIMESTRIDE = '180' + FIELD%TIMECOUNT = '100' + FIELD%LIST = 'HS FP DIR DP CHA UST DPT CUR WND' + FIELD%PARTITION = '0' + FIELD%TYPE = 4 +/ + +! -------------------------------------------------------------------- ! +! Define the content of the output file via FILE_NML namelist +! +! * namelist must be terminated with / +! * definitions & defaults: +! FILE%PREFIX = 'ww3.' ! Prefix for output file name +! FILE%NETCDF = 3 ! Netcdf version [3|4] +! FILE%IX0 = 1 ! First X-axis or node index +! FILE%IXN = 1000000000 ! Last X-axis or node index +! FILE%IY0 = 1 ! First Y-axis index +! FILE%IYN = 1000000000 ! Last Y-axis index +! -------------------------------------------------------------------- ! +&FILE_NML + FILE%IXN = 10000 + FILE%IYN = 10000 +/ + +! -------------------------------------------------------------------- ! +! WAVEWATCH III - end of namelist ! +! -------------------------------------------------------------------- ! diff --git a/regtests/ww3_tp2.14/input/ww3_shel_OASOCM.inp b/regtests/ww3_tp2.14/input_oasocm/ww3_shel.inp similarity index 100% rename from regtests/ww3_tp2.14/input/ww3_shel_OASOCM.inp rename to regtests/ww3_tp2.14/input_oasocm/ww3_shel.inp diff --git a/regtests/ww3_tp2.14/input/ww3_shel_OASOCM.nml b/regtests/ww3_tp2.14/input_oasocm/ww3_shel.nml similarity index 95% rename from regtests/ww3_tp2.14/input/ww3_shel_OASOCM.nml rename to regtests/ww3_tp2.14/input_oasocm/ww3_shel.nml index 7ae1a54c1..d111d193a 100644 --- a/regtests/ww3_tp2.14/input/ww3_shel_OASOCM.nml +++ b/regtests/ww3_tp2.14/input_oasocm/ww3_shel.nml @@ -44,6 +44,8 @@ ! INPUT%FORCING%WATER_LEVELS = 'F' ! INPUT%FORCING%CURRENTS = 'F' ! INPUT%FORCING%WINDS = 'F' +! INPUT%FORCING%ATM_MOMENTUM = 'F' +! INPUT%FORCING%AIR_DENSITY = 'F' ! INPUT%FORCING%ICE_CONC = 'F' ! INPUT%FORCING%ICE_PARAM1 = 'F' ! INPUT%FORCING%ICE_PARAM2 = 'F' @@ -94,9 +96,11 @@ ! T T 1 5 WLV WLV Water levels. ! T T 1 6 ICE ICE Ice concentration. ! T T 1 7 IBG IBG Iceberg-induced damping. -! T T 1 8 D50 D50 Median sediment grain size. -! T T 1 9 IC1 IC1 Ice thickness. -! T T 1 10 IC5 IC5 Ice flow diameter. +! T T 1 8 TAUA TAU Atm. momentum. +! T T 1 9 RHOAIR RHO Air density. +! T T 1 10 D50 D50 Median sediment grain size. +! T T 1 11 IC1 IC1 Ice thickness. +! T T 1 12 IC5 IC5 Ice flow diameter. ! ------------------------------------------------- ! 2 Standard mean wave Parameters ! ------------------------------------------------- @@ -117,6 +121,7 @@ ! T T 2 15 HMAXD SDMH St Dev of MXC (STE) ! T T 2 16 HCMAXD SDMHC St Dev of MXHC (STE) ! F T 2 17 WBT WBT Domiant wave breaking probability bT +! F F 2 18 FP0 TP Peak period (from peak freq) ! ------------------------------------------------- ! 3 Spectral Parameters (first 5) ! ------------------------------------------------- @@ -174,6 +179,7 @@ ! F F 6 9 P2SMS P2L Micro seism source term ! F F 6 10 TAUICE TWI Wave to sea ice stress ! F F 6 11 PHICE FIC Wave to sea ice energy flux +! F F 6 12 USSP USP Partitioned surface Stokes drift ! ------------------------------------------------- ! 7 Wave-bottom layer ! ------------------------------------------------- @@ -219,9 +225,14 @@ ! - Ice model : IC5 TWI ! - Received fields by ww3: ! - Ocean model : SSH CUR -! - Atmospheric model : WND +! - Atmospheric model : WND TAU RHO ! - Ice model : ICE IC1 IC5 ! +! * Coupling flag (T) or (F) at T+0 (extra fields in the restart needed) +! +! * extra fields to be written to the restart: +! - The list includes all fields sent by coupling exchange only +! ! * namelist must be terminated with / ! * definitions & defaults: ! TYPE%FIELD%LIST = 'unset' @@ -236,6 +247,8 @@ ! TYPE%PARTITION%FORMAT = T ! TYPE%COUPLING%SENT = 'unset' ! TYPE%COUPLING%RECEIVED = 'unset' +! TYPE%COUPLING%COUPLET0 = F +! TYPE%RESTART%EXTRA = 'unset' ! ! -------------------------------------------------------------------- ! &OUTPUT_TYPE_NML diff --git a/regtests/ww3_tp2.14/input_oasocm/ww3_strt.inp b/regtests/ww3_tp2.14/input_oasocm/ww3_strt.inp new file mode 100755 index 000000000..948c42911 --- /dev/null +++ b/regtests/ww3_tp2.14/input_oasocm/ww3_strt.inp @@ -0,0 +1,72 @@ +$ -------------------------------------------------------------------- $ +$ WAVEWATCH III Initial conditions input file $ +$--------------------------------------------------------------------- $ +$ type of initial field ITYPE . +$ + 1 +$ +$ ITYPE = 1 ---------------------------------------------------------- $ +$ Gaussian in frequency and space, cos type in direction. +$ - fp and spread (Hz), mean direction (degr., oceanographic +$ convention) and cosine power, Xm and spread (degr. or m) Ym and +$ spread (degr. or m), Hmax (m) (Example for lon-lat grid in degr.). +$ +$ 0.10 0.01 270. 2 1. 0.5 1. 0.5 2.5 + 0.10 0.01 270. 2 0. 1000. 1. 1000. 2.5 +$ 0.10 0.01 270. 2 0. 1000. 1. 1000. 0.01 +$ 0.10 0.01 270. 2 0. 1000. 1. 1000. 0. +$ +$ ITYPE = 2 ---------------------------------------------------------- $ +$ JONSWAP spectrum with Hasselmann et al. (1980) direct. distribution. +$ - alfa, peak freq. (Hz), mean direction (degr., oceanographical +$ convention), gamma, sigA, sigB, Xm and spread (degr. or m) Ym and +$ spread (degr. or m) (Example for lon-lat grid in degr.). +$ alfa, sigA, sigB give default values if less than or equal to 0. +$ +$ 0.0081 0.1 270. 1.0 0. 0. 1. 100. 1. 100. +$ +$ ITYPE = 3 ---------------------------------------------------------- $ +$ Fetch-limited JONSWAP +$ - No additional data, the local spectrum is calculated using the +$ local wind speed and direction, using the spatial grid size as +$ fetch, and assuring that the spectrum is within the discrete +$ frequency range. +$ +$ ITYPE = 4 ---------------------------------------------------------- $ +$ User-defined spectrum +$ - Scale factor., defaults to 1 if less than or equal 0. +$ - Spectrum F(f,theta) (single read statement) +$ +$ -0.1 +$ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +$ 0 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +$ 0 1 4 2 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +$ 0 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +$ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +$ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +$ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +$ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +$ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +$ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +$ 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 0 0 0 0 0 0 0 0 0 0 +$ 0 0 0 0 0 0 0 0 0 0 1 2 3 2 1 1 0 0 0 0 0 0 0 0 0 +$ 0 0 0 0 0 0 0 0 0 1 3 9 7 5 3 2 1 0 0 0 0 0 0 0 0 +$ 0 0 0 0 0 0 0 0 0 0 1 3 4 3 2 1 0 0 0 0 0 0 0 0 0 +$ 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 0 0 0 0 0 0 0 0 0 0 +$ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +$ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +$ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +$ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +$ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +$ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +$ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +$ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +$ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +$ +$ ITYPE = 5 ---------------------------------------------------------- $ +$ Starting from calm conditions. +$ - No additional data. +$ +$ -------------------------------------------------------------------- $ +$ End of input file $ +$ -------------------------------------------------------------------- $ From c6faafa867e0a8c3171f546cf77399711510e56c Mon Sep 17 00:00:00 2001 From: Denise Worthen Date: Sat, 19 Feb 2022 18:01:37 -0500 Subject: [PATCH 09/44] add switch and w3updtmd for uwm changes --- model/esmf/switch | 1 + model/src/w3updtmd.F90 | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/model/esmf/switch b/model/esmf/switch index 97d9d2d4c..be1c412a6 100644 --- a/model/esmf/switch +++ b/model/esmf/switch @@ -1,3 +1,4 @@ +UWM NCO NOGRB DIST diff --git a/model/src/w3updtmd.F90 b/model/src/w3updtmd.F90 index e59041b75..8418bbfab 100644 --- a/model/src/w3updtmd.F90 +++ b/model/src/w3updtmd.F90 @@ -1804,7 +1804,9 @@ SUBROUTINE W3UICE ( VA ) ICEI(IX,IY), 'ICE (NEW)' #endif VA(:,JSEA) = 0. +#if defined(W3_UWM) || defined(CESMCOUPLED) charn(jsea) = aalpha +#endif #ifdef W3_T ELSE WRITE (NDST,9021) ISEA, IX, IY, MAPSTA(IY,IX), & @@ -1836,7 +1838,9 @@ SUBROUTINE W3UICE ( VA ) ICEI(IX,IY), 'SEA (NEW)' #endif VA(:,JSEA) = 0. +#if defined(W3_UWM) || defined(CESMCOUPLED) charn(jsea) = aalpha +#endif ! #ifdef W3_T ELSE From cfcd089f1647d378f20665783bbef70519e78bfa Mon Sep 17 00:00:00 2001 From: Kyle Gerheiser <3209794+kgerheiser@users.noreply.github.com> Date: Thu, 24 Feb 2022 09:51:31 -0500 Subject: [PATCH 10/44] Add CMake build to WW3 (#533) CMake provides a portable and standardized build system and out-of-source builds. This means a faster and simpler build system. See README for more documentation. --- .github/workflows/gnu.yml | 103 + .github/workflows/intel.yml | 128 + .gitignore | 2 + CMakeLists.txt | 46 + VERSION | 1 + {model/esmf/cmake => cmake}/FindESMF.cmake | 84 +- cmake/FindMETIS.cmake | 18 + {model/esmf/cmake => cmake}/FindNetCDF.cmake | 32 +- cmake/FindOASIS.cmake | 73 + cmake/FindParMETIS.cmake | 22 + cmake/WW3-package-config.cmake.in | 22 + model/CMakeLists.txt | 1 + model/README.md | 156 ++ model/bin/README.md | 19 +- model/bin/switch_multi_esmf | 1 + model/ci/README.md | 4 + model/ci/spack.yaml | 16 + model/esmf/CMakeLists.txt | 107 - model/esmf/run_w3adc.sh | 29 - model/src/CMakeLists.txt | 204 ++ model/src/cmake/check_switches.cmake | 105 + model/src/cmake/src_list.cmake | 96 + model/src/cmake/switches.json | 802 ++++++ model/src/w3initmd.F90 | 2 +- regtests/bin/matrix.comp | 6 +- regtests/bin/matrix_cmake_datarmor | 204 ++ regtests/bin/matrix_cmake_ncep | 253 ++ regtests/bin/matrix_divider_cmake.sh | 167 ++ regtests/bin/run_cmake_test | 2383 +++++++++++++++++ .../input/oasis3-mct/util/make_dir/.gitignore | 5 + .../oasis3-mct/util/make_dir/CMakeLists.txt | 40 + .../util/make_dir/TopMakefileOasis3 | 2 +- .../input/oasis3-mct/util/make_dir/cmplr.tmpl | 30 +- regtests/ww3_tp2.14/input/toy/Makefile.tmpl | 16 +- regtests/ww3_tp2.14/input_oasacm/prep_env.sh | 40 +- regtests/ww3_tp2.14/input_oasacm2/prep_env.sh | 40 +- regtests/ww3_tp2.14/input_oasacm4/prep_env.sh | 40 +- regtests/ww3_tp2.14/input_oasacm5/prep_env.sh | 40 +- regtests/ww3_tp2.14/input_oasacm6/prep_env.sh | 40 +- regtests/ww3_tp2.14/input_oasicm/prep_env.sh | 40 +- regtests/ww3_tp2.14/input_oasocm/prep_env.sh | 40 +- 41 files changed, 5053 insertions(+), 406 deletions(-) create mode 100644 .github/workflows/gnu.yml create mode 100644 .github/workflows/intel.yml create mode 100644 CMakeLists.txt create mode 100644 VERSION rename {model/esmf/cmake => cmake}/FindESMF.cmake (56%) create mode 100644 cmake/FindMETIS.cmake rename {model/esmf/cmake => cmake}/FindNetCDF.cmake (98%) create mode 100644 cmake/FindOASIS.cmake create mode 100644 cmake/FindParMETIS.cmake create mode 100644 cmake/WW3-package-config.cmake.in create mode 100644 model/CMakeLists.txt create mode 100644 model/README.md create mode 100644 model/bin/switch_multi_esmf create mode 100644 model/ci/README.md create mode 100644 model/ci/spack.yaml delete mode 100644 model/esmf/CMakeLists.txt delete mode 100755 model/esmf/run_w3adc.sh create mode 100644 model/src/CMakeLists.txt create mode 100644 model/src/cmake/check_switches.cmake create mode 100644 model/src/cmake/src_list.cmake create mode 100644 model/src/cmake/switches.json create mode 100755 regtests/bin/matrix_cmake_datarmor create mode 100755 regtests/bin/matrix_cmake_ncep create mode 100755 regtests/bin/matrix_divider_cmake.sh create mode 100755 regtests/bin/run_cmake_test create mode 100644 regtests/ww3_tp2.14/input/oasis3-mct/util/make_dir/.gitignore create mode 100644 regtests/ww3_tp2.14/input/oasis3-mct/util/make_dir/CMakeLists.txt diff --git a/.github/workflows/gnu.yml b/.github/workflows/gnu.yml new file mode 100644 index 000000000..591b409c8 --- /dev/null +++ b/.github/workflows/gnu.yml @@ -0,0 +1,103 @@ +name: GNU Linux Build +on: [push, pull_request] + +env: + cache_key: gnu3 + CC: gcc-10 + FC: gfortran-10 + CXX: g++-10 + +# Split into a steup step, and a WW3 build step which +# builds multiple switches in a matrix. The setup is run once and +# the environment is cached so each build of WW3 can share the dependencies. + +jobs: + setup: + runs-on: ubuntu-20.04 + + steps: + # Cache spack, OASIS, and compiler + # No way to flush Action cache, so key may have # appended + - name: cache-env + id: cache-env + uses: actions/cache@v2 + with: + path: | + spack + ~/.spack + work_oasis3-mct + key: spack-${{ runner.os }}-${{ env.cache_key }} + + - name: checkout-ww3 + if: steps.cache-env.outputs.cache-hit != 'true' + uses: actions/checkout@v2 + with: + path: ww3 + + # Build WW3 spack environment + - name: install-dependencies-with-spack + if: steps.cache-env.outputs.cache-hit != 'true' + run: | + # Install NetCDF, ESMF, g2, etc using Spack + git clone -c feature.manyFiles=true https://github.com/spack/spack.git + source spack/share/spack/setup-env.sh + spack env create ww3-gnu ww3/model/ci/spack.yaml + spack env activate ww3-gnu + spack compiler find + spack external find m4 cmake pkgconf openssl + spack add mpich@3.4.2 + spack concretize + spack install --dirty -v + + - name: build-oasis + if: steps.cache-env.outputs.cache-hit != 'true' + run: | + source spack/share/spack/setup-env.sh + spack env activate ww3-gnu + export WWATCH3_DIR=${GITHUB_WORKSPACE}/ww3/model + cd ww3/regtests/ww3_tp2.14/input/oasis3-mct/util/make_dir + mkdir build && cd build + cmake .. + make VERBOSE=1 + cp -r ${GITHUB_WORKSPACE}/ww3/regtests/ww3_tp2.14/work_oasis3-mct ${GITHUB_WORKSPACE} + + build: + needs: setup + strategy: + matrix: + switch: [Ifremer1, NCEP_st2, NCEP_st4, ite_pdlib, NCEP_st4sbs, NCEP_glwu, OASACM, UKMO, MULTI_ESMF] + runs-on: ubuntu-20.04 + + steps: + - name: checkout-ww3 + uses: actions/checkout@v2 + with: + path: ww3 + + - name: cache-env + id: cache-env + uses: actions/cache@v2 + with: + path: | + spack + ~/.spack + work_oasis3-mct + key: spack-${{ runner.os }}-${{ env.cache_key }} + + - name: build-ww3 + run: | + source spack/share/spack/setup-env.sh + spack env activate ww3-gnu + cd ww3 + export CC=mpicc + export FC=mpif90 + export OASISDIR=${GITHUB_WORKSPACE}/work_oasis3-mct + mkdir build && cd build + if [[ ${{ matrix.switch }} == "MULTI_ESMF" ]]; then + cmake .. -DMULTI_ESMF=ON -DSWITCH=multi_esmf + else + cmake .. -DSWITCH=${{ matrix.switch }} + fi + make -j2 VERBOSE=1 + + diff --git a/.github/workflows/intel.yml b/.github/workflows/intel.yml new file mode 100644 index 000000000..3ff6f896e --- /dev/null +++ b/.github/workflows/intel.yml @@ -0,0 +1,128 @@ +name: Intel Linux Build +on: [push, pull_request] + +# Use custom shell with -l so .bash_profile is sourced which loads intel/oneapi/setvars.sh +# without having to do it in manually every step +defaults: + run: + shell: bash -leo pipefail {0} + +# Set I_MPI_CC/F90 so Intel MPI wrapper uses icc/ifort instead of gcc/gfortran +env: + cache_key: intel4 + CC: icc + FC: ifort + CXX: icpc + I_MPI_CC: icc + I_MPI_F90: ifort + +# Split into a dependency build step, and a WW3 build step which +# builds multiple switches in a matrix. The setup is run once and +# the environment is cached so each build of WW3 can share the dependencies. + +jobs: + setup: + runs-on: ubuntu-latest + + steps: + # Cache spack, OASIS, and compiler + # No way to flush Action cache, so key may have # appended + - name: cache-env + id: cache-env + uses: actions/cache@v2 + with: + path: | + spack + ~/.spack + work_oasis3-mct + /opt/intel + key: spack-${{ runner.os }}-${{ env.cache_key }} + + - name: install-intel-compilers + if: steps.cache-env.outputs.cache-hit != 'true' + run: | + wget https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB + sudo apt-key add GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB + echo "deb https://apt.repos.intel.com/oneapi all main" | sudo tee /etc/apt/sources.list.d/oneAPI.list + sudo apt-get update + sudo apt-get install intel-oneapi-dev-utilities intel-oneapi-mpi-devel intel-oneapi-openmp intel-oneapi-compiler-fortran intel-oneapi-compiler-dpcpp-cpp-and-cpp-classic + echo "source /opt/intel/oneapi/setvars.sh" >> ~/.bash_profile + + - name: checkout-ww3 + if: steps.cache-env.outputs.cache-hit != 'true' + uses: actions/checkout@v2 + with: + path: ww3 + + # Build WW3 spack environment + - name: install-dependencies-with-spack + if: steps.cache-env.outputs.cache-hit != 'true' + run: | + # Install NetCDF, ESMF, g2, etc using Spack + git clone -c feature.manyFiles=true https://github.com/spack/spack.git + source spack/share/spack/setup-env.sh + spack env create ww3-intel ww3/model/ci/spack.yaml + spack env activate ww3-intel + spack compiler find + spack external find m4 cmake pkgconf openssl + spack add intel-oneapi-mpi + spack concretize + spack install --dirty -v + + - name: build-oasis + if: steps.cache-env.outputs.cache-hit != 'true' + run: | + source spack/share/spack/setup-env.sh + spack env activate ww3-intel + export WWATCH3_DIR=${GITHUB_WORKSPACE}/ww3/model + cd ww3/regtests/ww3_tp2.14/input/oasis3-mct/util/make_dir + mkdir build && cd build + cmake .. + make + cp -r ${GITHUB_WORKSPACE}/ww3/regtests/ww3_tp2.14/work_oasis3-mct ${GITHUB_WORKSPACE} + + build: + needs: setup + strategy: + matrix: + switch: [Ifremer1, NCEP_st2, NCEP_st4, ite_pdlib, NCEP_st4sbs, NCEP_glwu, OASACM, UKMO, MULTI_ESMF] + runs-on: ubuntu-latest + + steps: + - name: checkout-ww3 + uses: actions/checkout@v2 + with: + path: ww3 + + - name: install-intel + run: | + echo "source /opt/intel/oneapi/setvars.sh" >> ~/.bash_profile + + - name: cache-env + id: cache-env + uses: actions/cache@v2 + with: + path: | + spack + ~/.spack + work_oasis3-mct + /opt/intel + key: spack-${{ runner.os }}-${{ env.cache_key }} + + - name: build-ww3 + run: | + source spack/share/spack/setup-env.sh + spack env activate ww3-intel + cd ww3 + export CC=mpicc + export FC=mpif90 + export OASISDIR=${GITHUB_WORKSPACE}/work_oasis3-mct + mkdir build && cd build + if [[ ${{ matrix.switch }} == "MULTI_ESMF" ]]; then + cmake .. -DMULTI_ESMF=ON -DSWITCH=multi_esmf + else + cmake .. -DSWITCH=${{ matrix.switch }} + fi + make -j2 + + diff --git a/.gitignore b/.gitignore index aa41f14b2..bf1f66796 100644 --- a/.gitignore +++ b/.gitignore @@ -169,3 +169,5 @@ model/bin/wwatch3.env */.*.swp */*/.*.swp */*/*/.*.swp +.DS_Store +build diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 000000000..8daccdd8c --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,46 @@ +# CMake build written by Kyle Gerheiser + +# Requires CMake 3.19 for JSON strings +cmake_minimum_required(VERSION 3.19) + +# Get VERSION from VERSION file +file(STRINGS "VERSION" pVersion) + +project( + WW3 + VERSION ${pVersion} + LANGUAGES C Fortran) + +set(MULTI_ESMF OFF CACHE BOOL "Build ww3_multi_esmf library") +set(NETCDF ON CACHE BOOL "Build NetCDF programs (requires NetCDF)") + +# Make Find modules visible to CMake +list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake") + +# Set switch file on command line when running CMake +set(SWITCH "" CACHE STRING "Switch file, either full path, relative path from location of top-level WW3/ dir, or a switch in model/bin") + +# Search for switch file as a full path or in model/bin +if(EXISTS ${SWITCH}) + set(switch_file ${SWITCH}) +else() + set(switch_file ${CMAKE_CURRENT_SOURCE_DIR}/model/bin/switch_${SWITCH}) + if(NOT EXISTS ${switch_file}) + message(FATAL_ERROR "Switch file '${switch_file}' does not exist, set switch with -DSWITCH=") + endif() +endif() + +message(STATUS "Build with switch: ${switch_file}") +# Copy switch file to build dir +configure_file(${switch_file} ${CMAKE_BINARY_DIR}/switch COPYONLY) + +# Re-configure CMake when switch changes +set_property(DIRECTORY APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS ${CMAKE_BINARY_DIR}/switch) + +if(NOT CMAKE_BUILD_TYPE MATCHES "^(Debug|Release|RelWithDebInfo|MinSizeRel)$") + message(STATUS "Setting build type to 'Release' as none was specified.") + set(CMAKE_BUILD_TYPE "Release" CACHE STRING "Build type" FORCE) + set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "Debug" "Release" "MinSizeRel" "RelWithDebInfo") +endif() + +add_subdirectory(model) diff --git a/VERSION b/VERSION new file mode 100644 index 000000000..9ad4d4f29 --- /dev/null +++ b/VERSION @@ -0,0 +1 @@ +7.14 diff --git a/model/esmf/cmake/FindESMF.cmake b/cmake/FindESMF.cmake similarity index 56% rename from model/esmf/cmake/FindESMF.cmake rename to cmake/FindESMF.cmake index 82b648e08..5ba7003bd 100644 --- a/model/esmf/cmake/FindESMF.cmake +++ b/cmake/FindESMF.cmake @@ -11,25 +11,24 @@ # Add the ESMFMKFILE path to the cache if defined as system env variable -if (DEFINED ENV{ESMFMKFILE} AND NOT DEFINED ESMFMKFILE) +if(DEFINED ENV{ESMFMKFILE} AND NOT DEFINED ESMFMKFILE) set(ESMFMKFILE $ENV{ESMFMKFILE} CACHE FILEPATH "Path to ESMF mk file") -endif () +endif() -# Found the mk file and ESMF exists on the system -if (EXISTS ${ESMFMKFILE}) - set(ESMF_FOUND TRUE CACHE BOOL "ESMF mk file found" FORCE) - # Did not find the ESMF mk file -else() - set(ESMF_FOUND FALSE CACHE BOOL "ESMF mk file NOT found" FORCE) - # Best to warn users that without the mk file there is no way to find ESMF - if (NOT DEFINED ESMFMKFILE) - message(FATAL_ERROR "ESMFMKFILE not defined. This is the path to esmf.mk file. \ +# If it's not explicitly set try to find esmf.mk file in default locations (ESMF_ROOT, CMAKE_PREFIX_PATH, etc) +if(NOT DEFINED ESMFMKFILE) + find_path(ESMFMKFILE_PATH esmf.mk PATH_SUFFIXES lib lib64) + if(ESMFMKFILE_PATH) + set(ESMFMKFILE ${ESMFMKFILE_PATH}/esmf.mk) + message(STATUS "Found esmf.mk file ${ESMFMKFILE}") + else() + message(STATUS "ESMFMKFILE not defined. This is the path to esmf.mk file. \ Without this filepath, ESMF_FOUND will always be FALSE.") - endif () + endif() endif() # Only parse the mk file if it is found -if (ESMF_FOUND) +if(EXISTS ${ESMFMKFILE}) # Read the mk file file(STRINGS "${ESMFMKFILE}" esmfmkfile_contents) # Parse each line in the mk file @@ -37,13 +36,13 @@ if (ESMF_FOUND) # Only consider uncommented lines string(REGEX MATCH "^[^#]" def ${str}) # Line is not commented - if (def) + if(def) # Extract the variable name string(REGEX MATCH "^[^=]+" esmf_varname ${str}) # Extract the variable's value string(REGEX MATCH "=.+$" esmf_vardef ${str}) # Only for variables with a defined value - if (esmf_vardef) + if(esmf_vardef) # Get rid of the assignment string string(SUBSTRING ${esmf_vardef} 1 -1 esmf_vardef) # Remove whitespace @@ -62,7 +61,7 @@ if (ESMF_FOUND) # Promote to global scope set(${esmf_varname} ${esmf_vardef}) # Don't display by default in the GUI - mark_as_advanced (esmf_varname) + mark_as_advanced(esmf_varname) # No need to search for the current string filter break() endif() @@ -72,34 +71,65 @@ if (ESMF_FOUND) endif() endforeach() + # Construct ESMF_VERSION from ESMF_VERSION_STRING_GIT + # ESMF_VERSION_MAJOR and ESMF_VERSION_MINOR are defined in ESMFMKFILE + set(ESMF_VERSION 0) + set(ESMF_VERSION_PATCH ${ESMF_VERSION_REVISION}) + set(ESMF_BETA_RELEASE FALSE) + if(ESMF_VERSION_BETASNAPSHOT MATCHES "^('T')$") + set(ESMF_BETA_RELEASE TRUE) + string(REGEX REPLACE ".*beta_snapshot_*\([0-9]*\).*" "\\1" ESMF_BETA_SNAPSHOT "${ESMF_VERSION_STRING_GIT}") + message(STATUS "Detected ESMF Beta snapshot ${ESMF_BETA_SNAPSHOT}") + endif() + set(ESMF_VERSION "${ESMF_VERSION_MAJOR}.${ESMF_VERSION_MINOR}.${ESMF_VERSION_PATCH}") + separate_arguments(ESMF_F90COMPILEPATHS NATIVE_COMMAND ${ESMF_F90COMPILEPATHS}) - foreach (ITEM ${ESMF_F90COMPILEPATHS}) + foreach(ITEM ${ESMF_F90COMPILEPATHS}) string(REGEX REPLACE "^-I" "" ITEM "${ITEM}") list(APPEND tmp ${ITEM}) endforeach() set(ESMF_F90COMPILEPATHS ${tmp}) - add_library(esmf UNKNOWN IMPORTED) # Look for static library, if not found try dynamic library find_library(esmf_lib NAMES libesmf.a PATHS ${ESMF_LIBSDIR}) if(esmf_lib MATCHES "esmf_lib-NOTFOUND") + unset(esmf_lib) message(STATUS "Static ESMF library not found, searching for dynamic library instead") - find_library(esmf_lib NAMES esmf_fullylinked PATHS ${ESMF_LIBSDIR}) + find_library(esmf_lib NAMES esmf_fullylinked libesmf.so PATHS ${ESMF_LIBSDIR}) if(esmf_lib MATCHES "esmf_lib-NOTFOUND") - message(FATAL_ERROR "Neither the dynamic nor the static ESMF library was found") + unset(esmf_lib) + message(STATUS "Neither the dynamic nor the static ESMF library was found") else() - message(STATUS "Found ESMF library: ${esmf_lib}") + set(_library_type SHARED) endif() - set(ESMF_INTERFACE_LINK_LIBRARIES "") else() - # When linking the static library, also need the ESMF linker flags; strip any leading/trailing whitespaces - string(STRIP "${ESMF_F90ESMFLINKRPATHS} ${ESMF_F90ESMFLINKPATHS} ${ESMF_F90LINKLIBS} ${ESMF_F90LINKOPTS}" ESMF_INTERFACE_LINK_LIBRARIES) - message(STATUS "Found ESMF library: ${esmf_lib}") + set(_library_type STATIC) endif() + string(STRIP "${ESMF_F90ESMFLINKRPATHS} ${ESMF_F90ESMFLINKPATHS} ${ESMF_F90LINKPATHS} ${ESMF_F90LINKLIBS} ${ESMF_F90LINKOPTS}" ESMF_INTERFACE_LINK_LIBRARIES) + set(ESMF_LIBRARY_LOCATION ${esmf_lib}) + +else() + + message(WARNING "ESMFMKFILE ${ESMFMKFILE} does not exist") + +endif() + +## Finalize find_package +include(FindPackageHandleStandardArgs) + +find_package_handle_standard_args( + ${CMAKE_FIND_PACKAGE_NAME} + REQUIRED_VARS ESMF_LIBRARY_LOCATION + ESMF_INTERFACE_LINK_LIBRARIES + ESMF_F90COMPILEPATHS + VERSION_VAR ESMF_VERSION) + +## If ESMF is found create imported library target +if(ESMF_FOUND) + add_library(esmf ${_library_type} IMPORTED) set_target_properties(esmf PROPERTIES - IMPORTED_LOCATION ${esmf_lib} + IMPORTED_LOCATION "${ESMF_LIBRARY_LOCATION}" INTERFACE_INCLUDE_DIRECTORIES "${ESMF_F90COMPILEPATHS}" INTERFACE_LINK_LIBRARIES "${ESMF_INTERFACE_LINK_LIBRARIES}") - endif() diff --git a/cmake/FindMETIS.cmake b/cmake/FindMETIS.cmake new file mode 100644 index 000000000..c4f854db7 --- /dev/null +++ b/cmake/FindMETIS.cmake @@ -0,0 +1,18 @@ +find_library(metis_lib NAMES libmetis.a libmetis.so libmetis.dylib HINTS ENV METIS_PATH PATH_SUFFIXES lib) +find_path(metis_inc metis.h HINTS ENV METIS_PATH PATH_SUFFIXES include) + +add_library(METIS::METIS STATIC IMPORTED) + +set_target_properties(METIS::METIS PROPERTIES + IMPORTED_LOCATION "${metis_lib}" + INTERFACE_INCLUDE_DIRECTORIES "${metis_inc}") + +## Finalize find_package +include(FindPackageHandleStandardArgs) + +find_package_handle_standard_args( + ${CMAKE_FIND_PACKAGE_NAME} + REQUIRED_VARS metis_lib + metis_inc) + +message(STATUS "Found METIS: ${metis_lib}") diff --git a/model/esmf/cmake/FindNetCDF.cmake b/cmake/FindNetCDF.cmake similarity index 98% rename from model/esmf/cmake/FindNetCDF.cmake rename to cmake/FindNetCDF.cmake index 1439ae848..23f6a1e09 100644 --- a/model/esmf/cmake/FindNetCDF.cmake +++ b/cmake/FindNetCDF.cmake @@ -171,6 +171,21 @@ function(netcdf_config exec flag output_var) endif() endfunction() +## Detect additional package properties +netcdf_config(${NetCDF_C_CONFIG_EXECUTABLE} --has-parallel4 _val) +if( NOT _val MATCHES "^(yes|no)$" ) + netcdf_config(${NetCDF_C_CONFIG_EXECUTABLE} --has-parallel _val) +endif() +if( _val MATCHES "^(yes)$" ) + set(NetCDF_PARALLEL TRUE CACHE STRING "NetCDF has parallel IO capability via pnetcdf or hdf5." FORCE) +else() + set(NetCDF_PARALLEL FALSE CACHE STRING "NetCDF has no parallel IO capability." FORCE) +endif() + +if(NetCDF_PARALLEL) + find_package(MPI) +endif() + ## Find libraries for each component set( NetCDF_LIBRARIES ) foreach( _comp IN LISTS _search_components ) @@ -228,6 +243,12 @@ foreach( _comp IN LISTS _search_components ) IMPORTED_LOCATION ${NetCDF_${_comp}_LIBRARY} INTERFACE_INCLUDE_DIRECTORIES "${NetCDF_${_comp}_INCLUDE_DIRS}" INTERFACE_LINK_LIBRARIES ${NetCDF_${_comp}_LIBRARIES} ) + if( NOT _comp MATCHES "^(C)$" ) + target_link_libraries(NetCDF::NetCDF_${_comp} INTERFACE NetCDF::NetCDF_C) + endif() + if(MPI_${_comp}_FOUND) + target_link_libraries(NetCDF::NetCDF_${_comp} INTERFACE MPI::MPI_${_comp}) + endif() endif() endif() endforeach() @@ -263,17 +284,6 @@ if (NetCDF_INCLUDE_DIRS) endif() endif () -## Detect additional package properties -netcdf_config(${NetCDF_C_CONFIG_EXECUTABLE} --has-parallel4 _val) -if( NOT _val MATCHES "^(yes|no)$" ) - netcdf_config(${NetCDF_C_CONFIG_EXECUTABLE} --has-parallel _val) -endif() -if( _val MATCHES "^(yes)$" ) - set(NetCDF_PARALLEL TRUE CACHE STRING "NetCDF has parallel IO capability via pnetcdf or hdf5." FORCE) -else() - set(NetCDF_PARALLEL FALSE CACHE STRING "NetCDF has no parallel IO capability." FORCE) -endif() - ## Finalize find_package include(FindPackageHandleStandardArgs) diff --git a/cmake/FindOASIS.cmake b/cmake/FindOASIS.cmake new file mode 100644 index 000000000..8d0b6d165 --- /dev/null +++ b/cmake/FindOASIS.cmake @@ -0,0 +1,73 @@ +message(STATUS "Searching for oasis3-mct") + + +message(STATUS " Searching for libpsmile...") +find_library(psmile_lib NAMES libpsmile.MPI1.a HINTS ENV OASISDIR PATH_SUFFIXES lib) +if(psmile_lib) + message(STATUS " Found PSMILE: ${psmile_lib}") +else() + message(STATUS " psmile not found...") +endif() + + +message(STATUS " Searching for libmct...") +find_library(mct_lib NAMES libmct.a HINTS ENV OASISDIR PATH_SUFFIXES lib) +if(mct_lib) + message(STATUS " Found: ${mct_lib}") +else() + message(STATUS " mct not found...") +endif() + +message(STATUS " Searching for libmpeu...") +find_library(mpeu_lib NAMES libmpeu.a HINTS ENV OASISDIR PATH_SUFFIXES lib) +if(mpeu_lib) + message(STATUS " Found: ${mpeu_lib}") +else() + message(STATUS " mpeu not found...") +endif() + +message(STATUS " Searching for libscrip...") +find_library(scrip_lib NAMES libscrip.a HINTS ENV OASISDIR PATH_SUFFIXES lib) +if(scrip_lib) + message(STATUS " Found: ${scrip_lib}") +else() + message(STATUS " scrip not found...") +endif() + +message(STATUS " Searching for mod_oasis...") +find_path(oasis_inc mod_oasis.mod PATHS $ENV{OASISDIR}/build/lib/psmile.MPI1) +if(oasis_inc) + message(STATUS " Found: ${oasis_inc}") +else() + message(STATUS " mod_oasis not found...") +endif() + +add_library(PSMILE::PSMILE STATIC IMPORTED) +set_target_properties(PSMILE::PSMILE PROPERTIES + IMPORTED_LOCATION "${psmile_lib}" + ) + +add_library(MCT::MCT STATIC IMPORTED) +set_target_properties(MCT::MCT PROPERTIES + IMPORTED_LOCATION "${mct_lib}" + ) +target_include_directories(MCT::MCT INTERFACE ${mct_inc}) + +add_library(MPEU::MPEU STATIC IMPORTED) +set_target_properties(MPEU::MPEU PROPERTIES + IMPORTED_LOCATION "${mpeu_lib}" + ) + +add_library(SCRIP::SCRIP STATIC IMPORTED) +set_target_properties(SCRIP::SCRIP PROPERTIES + IMPORTED_LOCATION "${scrip_lib}" + ) + +add_library(OASIS::OASIS INTERFACE IMPORTED) +target_link_libraries(OASIS::OASIS INTERFACE PSMILE::PSMILE MCT::MCT MPEU::MPEU SCRIP::SCRIP) +target_include_directories(OASIS::OASIS INTERFACE ${oasis_inc}) + +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args( + ${CMAKE_FIND_PACKAGE_NAME} + REQUIRED_VARS psmile_lib mct_lib mpeu_lib scrip_lib oasis_inc) diff --git a/cmake/FindParMETIS.cmake b/cmake/FindParMETIS.cmake new file mode 100644 index 000000000..d1b78b928 --- /dev/null +++ b/cmake/FindParMETIS.cmake @@ -0,0 +1,22 @@ +find_library(parmetis_lib NAMES libparmetis.a libparmetis.so libparmetis.dylib HINTS ENV METIS_PATH PATH_SUFFIXES lib) +find_path(parmetis_inc parmetis.h HINTS ENV METIS_PATH PATH_SUFFIXES include) + +find_package(METIS REQUIRED) + +add_library(ParMETIS::ParMETIS STATIC IMPORTED) + +set_target_properties(ParMETIS::ParMETIS PROPERTIES + IMPORTED_LOCATION "${parmetis_lib}" + INTERFACE_INCLUDE_DIRECTORIES "${parmetis_inc}") + +target_link_libraries(ParMETIS::ParMETIS INTERFACE METIS::METIS) + +## Finalize find_package +include(FindPackageHandleStandardArgs) + +find_package_handle_standard_args( + ${CMAKE_FIND_PACKAGE_NAME} + REQUIRED_VARS parmetis_lib + parmetis_inc) + +message(STATUS "Found ParMETIS: ${parmetis_lib}") diff --git a/cmake/WW3-package-config.cmake.in b/cmake/WW3-package-config.cmake.in new file mode 100644 index 000000000..bcb875c39 --- /dev/null +++ b/cmake/WW3-package-config.cmake.in @@ -0,0 +1,22 @@ +@PACKAGE_INIT@ + +#@PROJECT_NAME@-config.cmake +# +# Imported interface targets provided: +# * @PROJECT_NAME@::@PROJECT_NAME@_4 - real32 library target +# * @PROJECT_NAME@::@PROJECT_NAME@_d - mixed library target + +# Include targets file. This will create IMPORTED target @PROJECT_NAME@ +include("${CMAKE_CURRENT_LIST_DIR}/WW3-targets.cmake") + +include(CMakeFindDependencyMacro) + +#find_dependency(PNG) +#find_dependency(bacio) + +#get_target_property(@PROJECT_NAME@_BUILD_TYPES @PROJECT_NAME@::@PROJECT_NAME@_4 IMPORTED_CONFIGURATIONS) + +#check_required_components("WW3") + +#get_target_property(location @PROJECT_NAME@::@PROJECT_NAME@_4 LOCATION) +#message(STATUS "Found @PROJECT_NAME@: ${location} (found version \"@PROJECT_VERSION@\")") diff --git a/model/CMakeLists.txt b/model/CMakeLists.txt new file mode 100644 index 000000000..febd4f0ab --- /dev/null +++ b/model/CMakeLists.txt @@ -0,0 +1 @@ +add_subdirectory(src) diff --git a/model/README.md b/model/README.md new file mode 100644 index 000000000..2dcdc436e --- /dev/null +++ b/model/README.md @@ -0,0 +1,156 @@ +# CMake Build + +A CMake build is provided with WW3 to standardize and simplify the WW3 build process. CMake uses an out-of-source build which separates the build directory from the source directory. + +WW3 uses `#ifdef` directives to configure model options. These options are specified in a 'switch file' passed to CMake with `-DSWITCH=/switch/file` during the build. CMake parses the switch options and copies it into the build to determine which files to build, and what values to pass to the pre-processor. + +Switch setting configurations are stored in [switches.json](./bin/switches.json). This file is read by CMake to check the validity of input switches. + +The CMake build does not offer incremental builds. If the switch file changes, on the next `make`, CMake will re-trigger and build from scratch. + +Requires CMake 3.19+ + +## Quick Start + +``` +# Optionally set compiler and env vars to locate libraries +export CC=icc +export FC=ifort +export NetCDF_ROOT=/path/to/netcdf + +# Clone and build WW3 +git clone https://github.com/NOAA-EMC/WW3.git +cd WW3 +mkdir build && cd build +cmake .. -DSWITCH=/path/to/switch_NCEP_st2 -DCMAKE_INSTALL_PREFIX=install +make +make install +``` + +Note `cmake ..` is pointing to the directory containing the top-level CMakeLists.txt (just above the build dir in this case). The build directory can be located anywhere, and then the CMake command would be `cmake /path/to/WW3 -DSWITCH=/path/to/switch_NCEP_st2`. + + +## CMake Options + +Options can be passed to CMake with `-D