diff --git a/.gitignore b/.gitignore index 717a433ded..7bf237f397 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,6 @@ __pycache__ exec/ -fix/ +fix fix/0readme fix/fix_am fix/fix_chem diff --git a/Externals_coupled.cfg b/Externals_coupled.cfg index ceb5eedb36..00045eb381 100644 --- a/Externals_coupled.cfg +++ b/Externals_coupled.cfg @@ -1,12 +1,12 @@ [ufs-s2s-model] -tag = v3.1 +tag = s2s_prototype4.0 local_path = sorc/fv3_coupled.fd repo_url = https://github.com/ufs-community/ufs-s2s-model protocol = git required = True [EMC_post] -hash = ba7e59b2 +tag = upp_gfsv16_release.v1.0.8 local_path = sorc/gfs_post.fd repo_url = https://github.com/NOAA-EMC/EMC_post.git protocol = git diff --git a/README.md b/README.md index 7d890c46f0..cb7589882b 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,10 @@ sh build_ncep_post.sh #This command will build ncep_post. sh build_fv3_coupled.sh #This command will build ufs-s2s-model To link fixed files and executable programs for the coupled application: +On Hera: sh link_fv3gfs.sh emc hera coupled +On Orion: +sh link_fv3gfs.sh emc orion coupled ``` ## Create CROW user file @@ -56,6 +59,15 @@ mkdir -p $EXPROOT or ./setup_case.sh -p HERA ../cases/coupled_free_forecast.yaml test_3d + + +For Orion: +First make sure you have python loaded: +module load contrib +module load rocoto +module load intelpython3 +and then replace ORION with HERA in the commands above. + ``` This will create a experiment directory ($EXPERIMENT_DIRECTORY). In the current example, $EXPERIMENT_DIRECTORY=$EXPROOT/test_3d. diff --git a/jobs/JWAVE_INIT b/jobs/JWAVE_INIT new file mode 100755 index 0000000000..781c69c33e --- /dev/null +++ b/jobs/JWAVE_INIT @@ -0,0 +1,93 @@ +#!/bin/bash + +date +export PS4=' $SECONDS + ' +set -x -e + +############################# +# Source relevant config files +############################# +configs="base wave waveinit" +export EXPDIR=${EXPDIR:-$HOMEgfs/parm/config} +config_path=${EXPDIR:-$NWROOT/gfs.${gfs_ver}/parm/config} +for config in $configs; do + . $config_path/config.$config + status=$? + [[ $status -ne 0 ]] && exit $status +done + +########################################## +# Source machine runtime environment +########################################## +. $HOMEgfs/env/${machine}.env waveinit +status=$? +[[ $status -ne 0 ]] && exit $status + +# PATH for working directory +export NET=${NET:-gfs} +export RUN=${RUN:-gfs} +export COMPONENTwave=${COMPONENTwave:-${RUN}wave} + +export HOMEgfs=${HOMEgfs:-$NWROOT/${NET}.${gfs_ver}} + +# Add default errchk = err_chk +export errchk=${errchk:-err_chk} + +# Set HOMEwave to HOMEgfs +HOMEwave=${HOMEwave:-${HOMEgfs}} + +# Create and go to DATA directory +export DATA=${DATA:-${DATAROOT:?}/${jobid}} +mkdir -p $DATA +cd $DATA + +cyc=${cyc:-00} +export cycle=${cycle:-t${cyc}z} + +# Set PDY +setpdy.sh +sh ./PDY + +export pgmout=OUTPUT.$$ + +export MP_PULSE=0 + +# Set resources to propagate NTASKS across cfp call +NTASKS=${NTASKS:-${npe_node_waveinit}} +export NTASKS=${NTASKS:?NTASKS required to be set} + +# Path to HOME Directory +export CODEwave=${CODEwave:-${HOMEfv3gfs}/WW3} +export EXECwave=${EXECwave:-$HOMEwave/exec} +export FIXwave=${FIXwave:-$HOMEwave/fix/fix_wave_${NET}} +export PARMwave=${PARMwave:-$HOMEwave/parm/wave} +export USHwave=${USHwave:-$HOMEwave/ush} +export EXECcode=${EXECcode:-$CODEwave/exec} + +# Set COM Paths and GETGES environment +export COMINwave=${COMINwave:-${ROTDIR:?}} +export COMOUTwave=${COMOUTwave:-${ROTDIR:?}} +export COMIN=${COMIN:-${COMINwave}/${COMPONENTwave}.${PDY}/${cyc}} +export COMOUT=${COMOUT:-${COMOUTwave}/${COMPONENTwave}.${PDY}/${cyc}} +[[ ! -d $COMOUT ]] && mkdir -m 775 -p $COMOUT + +if [ $SENDCOM = YES ]; then + mkdir -p $COMOUT/rundata +fi + +export wavelog=${COMOUTwave}/wave.log + +# Set mpi serial command +export wavempexec=${wavempexec:-"mpirun -n"} +export wave_mpmd=${wave_mpmd:-"cfp"} + +# Execute the Script +$HOMEwave/scripts/exwave_init.sh + +# Remove temp directories +if [ "$KEEPDATA" != "YES" ]; then + cd $DATAROOT + rm -rf $DATA +fi +date + diff --git a/jobs/JWAVE_POST_SBS b/jobs/JWAVE_POST_SBS new file mode 100755 index 0000000000..6e60567d3f --- /dev/null +++ b/jobs/JWAVE_POST_SBS @@ -0,0 +1,117 @@ +#!/bin/bash + +date +export PS4=' $SECONDS + ' +set -x -e + +############################# +# Source relevant config files +############################# +configs="base wave wavepostsbs" +export EXPDIR=${EXPDIR:-$HOMEgfs/parm/config} +config_path=${EXPDIR:-$NWROOT/gfs.${gfs_ver}/parm/config} +for config in $configs; do + . $config_path/config.$config + status=$? + [[ $status -ne 0 ]] && exit $status +done + +########################################## +# Source machine runtime environment +########################################## +. $HOMEgfs/env/${machine}.env wavepostsbs +status=$? +[[ $status -ne 0 ]] && exit $status + +# PATH for working directory +export NET=${NET:-gfs} +export RUN=${RUN:-gfs} +export COMPONENTwave=${COMPONENTwave:-${RUN}wave} + +export HOMEgefs=${HOMEgefs:-$NWROOT/$NET.${gefs_ver}} +export HOMEgfs=${HOMEgfs:-$NWROOT/$NET.${gfs_ver}} + +# Add default errchk = err_chk +export errchk=${errchk:-err_chk} + +# Set HOMEwave to HOMEgefs +HOMEwave=${HOMEwave:-${HOMEgfs}} + +# Set resources to propagate NTASKS across cfp call +NTASKS=${NTASKS:-${npe_node_waveprep}} +export NTASKS=${NTASKS:?NTASKS required to be set} + +# Create and go to DATA directory +export DATA=${DATA:-${DATAROOT:?}/${jobid}} +mkdir -p $DATA +cd $DATA + +export cyc=${cyc:-00} +export cycle=${cycle:-t${cyc}z} + +# Set PDY +setpdy.sh +sh ./PDY + +export pgmout=OUTPUT.$$ + +export MP_PULSE=0 + +# Path to HOME Directory +export CODEwave=${CODEwave:-${HOMEfv3gfs}/WW3} +export EXECwave=${EXECwave:-$HOMEwave/exec} +export FIXwave=${FIXwave:-$HOMEwave/fix/fix_wave_${NET}} +export PARMwave=${PARMwave:-$HOMEwave/parm/wave} +export USHwave=${USHwave:-$HOMEwave/ush} +export EXECcode=${EXECcode:-$CODEwave/exec} + +# Set COM Paths and GETGES environment +export COMINwave=${COMINwave:-${ROTDIR:?}} +export COMOUTwave=${COMOUTwave:-${ROTDIR:?}} +export COMIN=${COMIN:-${COMINwave}/${COMPONENTwave}.${PDY}/${cyc}} +export COMOUT=${COMOUT:-${COMOUTwave}/${COMPONENTwave}.${PDY}/${cyc}} + +export COMINice=${COMINice:-${COMROOTp2}/omb/prod} +export COMINwnd=${COMINwnd:-${COMROOT}/gfs/prod} +export COMIN_WAV_CUR=${COMIN_WAV_CUR:-${COMROOTp2}/rtofs/prod} + +mkdir -p $COMOUT/gridded +mkdir -p $COMOUT/station +mkdir -p $COMOUT/stats + +export wavelog=${COMOUTwave}/wave.log + +# Set mpi serial command +export wavempexec=${wavempexec:-"mpirun -n"} +export wave_mpmd=${wave_mpmd:-"cfp"} + +env | sort + +# Set wave model ID tag to include member number +# if ensemble; waveMEMB var empty in deterministic +# Set wave model ID tag to include member number +# if ensemble; waveMEMB var empty in deterministic +membTAG='p' +if [ "${waveMEMB}" == "00" ]; then membTAG='c'; fi +export membTAG +export WAV_MOD_TAG=${COMPONENTwave}${waveMEMB} + +export CFP_VERBOSE=1 + +# Execute the Script +$HOMEwave/scripts/exwave_post_sbs.sh +err=$? +if [ $err -ne 0 ]; then + msg="FATAL ERROR: ex-script of GWES_POST failed!" +else + msg="$job completed normally!" +fi +postmsg "$jlogfile" "$msg" + +# Remove temp directories +if [ "$KEEPDATA" != "YES" ]; then + cd $DATAROOT + rm -rf $DATA +fi +date + diff --git a/jobs/JWAVE_PREP b/jobs/JWAVE_PREP new file mode 100755 index 0000000000..dcb7b0df06 --- /dev/null +++ b/jobs/JWAVE_PREP @@ -0,0 +1,126 @@ +#!/bin/bash + +date +export PS4=' $SECONDS + ' +set -x -e + +############################# +# Source relevant config files +############################# +configs="base wave waveprep" +export EXPDIR=${EXPDIR:-$HOMEgfs/parm/config} +config_path=${EXPDIR:-$NWROOT/gfs.${gfs_ver}/parm/config} +for config in $configs; do + . $config_path/config.$config + status=$? + [[ $status -ne 0 ]] && exit $status +done + +########################################## +# Source machine runtime environment +########################################## +. $HOMEgfs/env/${machine}.env waveprep +status=$? +[[ $status -ne 0 ]] && exit $status + +# PATH for working directory +export NET=${NET:-gfs} +export RUN=${RUN:-gfs} +export COMPONENTwave=${COMPONENTwave:-${RUN}wave} + +export HOMEgfs=${HOMEgfs:-$NWROOT/gfs.${gfs_ver}} + +# Add default errchk = err_chk +export errchk=${errchk:-err_chk} + +# Set HOMEwave to HOMEgfs +HOMEwave=${HOMEwave:-${HOMEgfs}} + +# Set resources to propagate NTASKS across cfp call +NTASKS=${NTASKS:-${npe_node_waveprep}} +export NTASKS=${NTASKS:?NTASKS required to be set} + +# Create and go to DATA directory +export DATA=${DATA:-${DATAROOT:?}/${jobid}} +mkdir -p $DATA +cd $DATA + +cyc=${cyc:-00} +export cycle=${cycle:-t${cyc}z} + +# Set PDY +setpdy.sh +sh ./PDY +# Set rtofs PDY +export RPDY=$PDY + +export pgmout=OUTPUT.$$ + +export MP_PULSE=0 + +# CDO required for processing RTOFS currents +# export CDO=${COMROOTp2}/nwprod/rtofs_glo.v1.2.0/bin/cdo +export CDO=/gpfs/dell2/emc/verification/noscrub/Todd.Spindler/CDO/bin/cdo + +# Path to HOME Directory +export CODEwave=${CODEwave:-${HOMEfv3gfs}/WW3} +export EXECwave=${EXECwave:-$HOMEwave/exec} +export FIXwave=${FIXwave:-$HOMEwave/fix/fix_wave_${NET}} +export PARMwave=${PARMwave:-$HOMEwave/parm/wave} +export USHwave=${USHwave:-$HOMEwave/ush} +export EXECcode=${EXECcode:-$CODEwave/exec} + +################################### +# Set COM Paths and GETGES environment +################################### +# Set COM Paths and GETGES environment +export COMINwave=${COMINwave:-${ROTDIR:?}} +export COMOUTwave=${COMOUTwave:-${ROTDIR:?}} +export COMIN=${COMIN:-${COMINwave}/${COMPONENTwave}.${PDY}/${cyc}} +export COMOUT=${COMOUT:-${COMOUTwave}/${COMPONENTwave}.${PDY}/${cyc}} +[[ ! -d $COMOUT ]] && mkdir -m 775 -p $COMOUT + +if [ $RUN_ENVIR = "nco" ]; then + export COMIN_WAV_ICE=${COMIN_WAV_ICE:-$(compath.py gfs/prod)}/${CDUMP}.${PDY}/${cyc} + export COMIN_WAV_WND=${COMIN_WAV_WND:-$(compath.py gfs/prod)}/${CDUMP}.${PDY}/${cyc} + export COMIN_WAV_CUR=${COMIN_WAV_CUR:-$(compath.py ${WAVECUR_DID}/prod)}/${WAVECUR_DID}.${RPDY} + if [ ! -d $COMIN_WAV_CUR ]; then + export RPDY=`$NDATE -24 ${PDY}00 | cut -c1-8` + export COMIN_WAV_CUR=$(compath.py ${WAVECUR_DID}/prod)/${WAVECUR_DID}.${RPDY} + fi +else + if [ ! -d $DMPDIR/${WAVECUR_DID}.${RPDY} ]; then export RPDY=`$NDATE -24 ${PDY}00 | cut -c1-8`; fi + if [ ! -L $ROTDIR/${WAVECUR_DID}.${RPDY} ]; then # Check if symlink already exists in ROTDIR + $NLN $DMPDIR/${WAVECUR_DID}.${RPDY} $ROTDIR/${WAVECUR_DID}.${RPDY} + fi + $NLN $DMPDIR/$CDUMP.${PDY}/$cyc/${WAVICEFILE} $ROTDIR/$CDUMP.${PDY}/$cyc/${WAVICEFILE} + export COMIN_OBS=${COMIN_OBS:-$ROTDIR/$RUN.$PDY/$cyc} + export COMIN_WAV_ICE=${COMIN_OBS} + export COMIN_WAV_WND=${COMIN_OBS} + export COMIN_WAV_CUR=${ROTDIR}/${WAVECUR_DID}.${RPDY} +fi + +if [ $SENDCOM = YES ]; then + mkdir -p $COMOUT +fi + +export wavelog=${COMOUTwave}/wave.log + +# Set mpi serial command +export wavempexec=${wavempexec:-"mpirun -n"} +export wave_mpmd=${wave_mpmd:-"cfp"} + +# Set wave model ID tag to include member number +# if ensemble; waveMEMB var empty in deterministic +export WAV_MOD_TAG=${COMPONENTwave}${waveMEMB} + +# Execute the Script +$HOMEwave/scripts/exwave_prep.sh + +# Remove temp directories +if [ "$KEEPDATA" != "YES" ]; then + cd $DATAROOT + rm -rf $DATA +fi +date + diff --git a/jobs/rocoto/arch.sh b/jobs/rocoto/arch.sh index beb5eb976d..5570679fa9 100755 --- a/jobs/rocoto/arch.sh +++ b/jobs/rocoto/arch.sh @@ -152,17 +152,36 @@ fi cd $ROTDIR -if [ $cpl = ".true." ]; then +if [ $cplflx = ".true." ]; then # ocn and ice files - for targrp in ocn ocn2 ice SST; do - htar -P -cvf $ATARDIR/$CDATE/${targrp}.tar `cat $ARCH_LIST/${targrp}.txt` - done - for targrp in gfs_flux_1p00 gfs_pgrb2b; do + echo "current location is $ROTDIR" + echo `date` + echo "starting gzip netcdf files, this will take a while ......" + gzip $COMIN/ocn_2D*nc $COMIN/ice*nc $COMIN/ocn_daily*nc + echo `date` + echo "gzip done !" + for targrp in ocn ocn_2D ocn_3D ocn_xsect ice ocn_daily log wavocn wave; do htar -P -cvf $ATARDIR/$CDATE/${targrp}.tar `cat $ARCH_LIST/${targrp}.txt` done fi if [ $CDUMP = "gfs" ]; then + if [ $cplflx = ".true." ]; then + #Reorganize tar files + + htar -P -cvf $ATARDIR/$CDATE/gfs_pgrb2_0p25.tar `cat $ARCH_LIST/gfsa.txt` + htar -P -cvf $ATARDIR/$CDATE/gfs_pgrb2_1p00.tar `cat $ARCH_LIST/gfsb.txt` + + for targrp in gfs_nemsioa gfs_nemsiob gfs_flux gfs_flux_1p00 gfs_pgrb2_1p00 gfs_pgrb2_0p25 gfs_pgrb2b_1p00 gfs_pgrb2b_0p25; do + htar -P -cvf $ATARDIR/$CDATE/${targrp}.tar `cat $ARCH_LIST/${targrp}.txt` + status=$? + if [ $status -ne 0 -a $CDATE -ge $firstday ]; then + echo "HTAR $CDATE ${targrp}.tar failed" + exit $status + fi + done + + else #leave as is #for targrp in gfsa gfsb - NOTE - do not check htar error status for targrp in gfsa gfsb; do @@ -178,7 +197,8 @@ if [ $CDUMP = "gfs" ]; then exit $status fi done - + fi + if [ $SAVEFCSTIC = "YES" ]; then htar -P -cvf $ATARDIR/$CDATE/gfs_restarta.tar `cat $ARCH_LIST/gfs_restarta.txt` status=$? diff --git a/jobs/rocoto/coupled_ic.sh b/jobs/rocoto/coupled_ic.sh index ad7949e06c..045171f807 100755 --- a/jobs/rocoto/coupled_ic.sh +++ b/jobs/rocoto/coupled_ic.sh @@ -33,15 +33,41 @@ done status=$? [[ $status -ne 0 ]] && exit $status + +#TODO: make the following configurable variables instead of hardcoded +CPL_ATMIC=CFSR +CPL_OCNIC=CPC3Dvar +CPL_ICEIC=CPC +OCNRES=025 +ICERES=025 +ICERES=${ICERES:-"025"} + # Create ICSDIR if needed [[ ! -d $ICSDIR/$CDATE ]] && mkdir -p $ICSDIR/$CDATE +[[ ! -d $ICSDIR/$CDATE/ocn ]] && mkdir -p $ICSDIR/$CDATE/ocn +[[ ! -d $ICSDIR/$CDATE/ice ]] && mkdir -p $ICSDIR/$CDATE/ice + +if [ $ICERES = '025' ]; then + ICERESdec="0.25" +fi +if [ $ICERES = '050' ]; then + ICERESdec="0.50" +fi + +# Setup ATM initial condition files +cp -r $ORIGIN_ROOT/$CPL_ATMIC/$CDATE/$CDUMP $ICSDIR/$CDATE/ + +# Setup Ocean IC files +cp -r $ORIGIN_ROOT/$CPL_OCNIC/$CDATE/ocn/$OCNRES/MOM*.nc $ICSDIR/$CDATE/ocn/ + +#Setup Ice IC files +cp $ORIGIN_ROOT/$CPL_ICEIC/$CDATE/ice/$ICERES/cice5_model_${ICERESdec}.res_$CDATE.nc $ICSDIR/$CDATE/ice/ -# Output FV3 initial condition files +#TODO for wave coupling +#if cplwav=true + #Setup Wave IC files +#fi -cp $ORIGIN_ROOT/$CDATE/cice5_* $ICSDIR/$CDATE/ -cp $ORIGIN_ROOT/$CDATE/MOM6_* $ICSDIR/$CDATE/ -cp -r $ORIGIN_ROOT/$CDATE/mom6_da $ICSDIR/$CDATE/ -cp -r $ORIGIN_ROOT/$CDATE/gfs $ICSDIR/$CDATE/ export OUTDIR="$ICSDIR/$CDATE/$CDUMP/$CASE/INPUT" diff --git a/jobs/rocoto/ocnpost.sh b/jobs/rocoto/ocnpost.sh index ce98d4b25b..d4a75e00af 100755 --- a/jobs/rocoto/ocnpost.sh +++ b/jobs/rocoto/ocnpost.sh @@ -107,18 +107,27 @@ for fhr in $fhrlst; do # The regrid scripts use CDATE for the current day, restore it to IDATE afterwards export CDATE=$VDATE cd $DATA -if [ $fhr -gt 0 ]; then - export MOM6REGRID=$UGCSsrc/mom6_regrid_025 - $MOM6REGRID/run_regrid.sh - status=$? - [[ $status -ne 0 ]] && exit $status + if [ $fhr -gt 0 ]; then + export MOM6REGRID=$UGCSsrc/mom6_regrid_025 + $MOM6REGRID/run_regrid.sh + status=$? + [[ $status -ne 0 ]] && exit $status - # Convert the netcdf files to grib2 - export executable=$MOM6REGRID/exec/reg2grb2.x - $MOM6REGRID/run_reg2grb2.sh + # Convert the netcdf files to grib2 + export executable=$MOM6REGRID/exec/reg2grb2.x + $MOM6REGRID/run_reg2grb2.sh + status=$? + [[ $status -ne 0 ]] && exit $status + fi + + #break up ocn netcdf into multiple files: + $ncks -x -v vo,uo,so,temp $COMOUT/ocn_$VDATE.$ENSMEM.$IDATE.nc $COMOUT/ocn_2D_$VDATE.$ENSMEM.$IDATE.nc + $ncks -x -v Heat_PmE,LW,LwLatSens,MLD_003,MLD_0125,SSH,SSS,SST,SSU,SSV,SW,cos_rot,ePBL,evap,fprec,frazil,latent,lprec,lrunoff,sensible,sin_rot,speed,taux,tauy,wet_c,wet_u,wet_v $COMOUT/ocn_$VDATE.$ENSMEM.$IDATE.nc $COMOUT/ocn_3D_$VDATE.$ENSMEM.$IDATE.nc + $ncks -v temp -d yh,503 -d xh,-299.92,60.03 $COMOUT/ocn_3D_$VDATE.$ENSMEM.$IDATE.nc $COMOUT/ocn-temp-EQ_$VDATE.$ENSMEM.$IDATE.nc + $ncks -v uo -d yh,503 -d xh,-299.92,60.03 $COMOUT/ocn_3D_$VDATE.$ENSMEM.$IDATE.nc $COMOUT/ocn-uo-EQ_$VDATE.$ENSMEM.$IDATE.nc status=$? [[ $status -ne 0 ]] && exit $status -fi + done # Restore CDATE to what is expected @@ -129,8 +138,7 @@ done [[ $status -ne 0 ]] && exit $status # clean up working folder -#rm -Rf $DATA -#BL2019 +if [ ${KEEPDATA:-"NO"} = "NO" ] ; then rm -rf $DATA ; fi ############################################################### # Exit out cleanly exit 0 diff --git a/jobs/rocoto/prep.sh b/jobs/rocoto/prep.sh index e506f70d25..61c55a7764 100755 --- a/jobs/rocoto/prep.sh +++ b/jobs/rocoto/prep.sh @@ -30,22 +30,22 @@ export COMOUT="$ROTDIR/$CDUMP.$PDY/$cyc" ############################################################### # If ROTDIR_DUMP=YES, copy dump files to rotdir if [ $ROTDIR_DUMP = "YES" ]; then - $HOMEgfs/ush/getdump.sh $CDATE $CDUMP $DMPDIR/${CDUMP}${DUMP_SUFFIX}.${PDY}/${cyc} $COMOUT - status=$? - [[ $status -ne 0 ]] && exit $status - -# Ensure previous cycle gdas dumps are available (used by cycle & downstream) - GDATE=$($NDATE -$assim_freq $CDATE) - gPDY=$(echo $GDATE | cut -c1-8) - gcyc=$(echo $GDATE | cut -c9-10) - GDUMP=gdas - gCOMOUT="$ROTDIR/$GDUMP.$gPDY/$gcyc" - if [ ! -s $gCOMOUT/$GDUMP.t${gcyc}z.updated.status.tm00.bufr_d ]; then + $HOMEgfs/ush/getdump.sh $CDATE $CDUMP $DMPDIR/${CDUMP}${DUMP_SUFFIX}.${PDY}/${cyc} $COMOUT + status=$? + [[ $status -ne 0 ]] && exit $status + +# Ensure previous cycle gdas dumps are available (used by cycle & downstream) + GDATE=$($NDATE -$assim_freq $CDATE) + gPDY=$(echo $GDATE | cut -c1-8) + gcyc=$(echo $GDATE | cut -c9-10) + GDUMP=gdas + gCOMOUT="$ROTDIR/$GDUMP.$gPDY/$gcyc" + if [ ! -s $gCOMOUT/$GDUMP.t${gcyc}z.updated.status.tm00.bufr_d ]; then $HOMEgfs/ush/getdump.sh $GDATE $GDUMP $DMPDIR/${GDUMP}${DUMP_SUFFIX}.${gPDY}/${gcyc} $gCOMOUT status=$? [[ $status -ne 0 ]] && exit $status - fi - + fi + fi ############################################################### diff --git a/jobs/rocoto/waveinit.sh b/jobs/rocoto/waveinit.sh new file mode 100755 index 0000000000..ce7397c3e7 --- /dev/null +++ b/jobs/rocoto/waveinit.sh @@ -0,0 +1,21 @@ +#!/bin/ksh -x + +############################################################### +echo +echo "=============== START TO SOURCE FV3GFS WORKFLOW MODULES ===============" +. $HOMEgfs/ush/load_fv3gfs_modules.sh +status=$? +[[ $status -ne 0 ]] && exit $status + +############################################################### +echo +echo "=============== START TO RUN WAVE INIT ===============" +# Execute the JJOB +$HOMEgfs/jobs/JWAVE_INIT +status=$? +exit $status + +############################################################### +# Force Exit out cleanly +if [ ${KEEPDATA:-"NO"} = "NO" ] ; then rm -rf $DATAROOT ; fi +exit 0 diff --git a/jobs/rocoto/wavepostsbs.sh b/jobs/rocoto/wavepostsbs.sh new file mode 100755 index 0000000000..751bb9e8c4 --- /dev/null +++ b/jobs/rocoto/wavepostsbs.sh @@ -0,0 +1,21 @@ +#!/bin/ksh -x + +############################################################### +echo +echo "=============== START TO SOURCE FV3GFS WORKFLOW MODULES ===============" +. $HOMEgfs/ush/load_fv3gfs_modules.sh +status=$? +[[ $status -ne 0 ]] && exit $status + +############################################################### +echo +echo "=============== START TO RUN WAVE POST_SBS ===============" +# Execute the JJOB +$HOMEgfs/jobs/JWAVE_POST_SBS +status=$? +exit $status + +############################################################### +# Force Exit out cleanly +if [ ${KEEPDATA:-"NO"} = "NO" ] ; then rm -rf $DATAROOT ; fi +exit 0 diff --git a/jobs/rocoto/waveprep.sh b/jobs/rocoto/waveprep.sh new file mode 100755 index 0000000000..faef5533d9 --- /dev/null +++ b/jobs/rocoto/waveprep.sh @@ -0,0 +1,21 @@ +#!/bin/ksh -x + +############################################################### +echo +echo "=============== START TO SOURCE FV3GFS WORKFLOW MODULES ===============" +. $HOMEgfs/ush/load_fv3gfs_modules.sh +status=$? +[[ $status -ne 0 ]] && exit $status + +############################################################### +echo +echo "=============== START TO RUN WAVE PREP ===============" +# Execute the JJOB +$HOMEgfs/jobs/JWAVE_PREP +status=$? +exit $status + +############################################################### +# Force Exit out cleanly +if [ ${KEEPDATA:-"NO"} = "NO" ] ; then rm -rf $DATAROOT ; fi +exit 0 diff --git a/modulefiles/module_base.hera b/modulefiles/module_base.hera index 84be86e705..32d9c72d5a 100644 --- a/modulefiles/module_base.hera +++ b/modulefiles/module_base.hera @@ -1,26 +1,39 @@ #%Module###################################################################### ## -## FV3GFS prerequisites +## S2S prerequisites ## module load intel/18.0.5.274 module load impi/2018.0.4 module load wgrib2/2.0.8 module load hpss/hpss -module load pnetcdf/1.10.0 +module use -a /scratch2/NCEPDEV/nwprod/NCEPLIBS/modulefiles +module load hdf5_parallel/1.10.6 +module load netcdf_parallel/4.7.4 module load netcdf/4.7.0 module load nco/4.7.0 -module load hdf5/1.10.5 + module load gempak/7.4.2 module load ncl/6.5.0 #Load from official NCEPLIBS -module use -a /scratch2/NCEPDEV/nwprod/NCEPLIBS/modulefiles -module load g2tmpl/1.5.0 +module load g2tmpl/1.6.0 module load grib_util/1.1.1 module load crtm/2.2.6 module load prod_util/1.1.0 +module load bacio/2.0.3 +module load ip/3.0.2 +module load nemsio/2.2.4 +module load sp/2.0.3 +module load w3emc/2.3.1 +module load w3nco/2.0.7 +module load g2/3.1.1 +module load jasper/1.900.1 +module load png/1.2.44 +module load z/1.2.11 + + #Load from emc.nemspara module use -a /scratch1/NCEPDEV/nems/emc.nemspara/soft/modulefiles module load esmf/8.0.0 diff --git a/modulefiles/module_base.orion b/modulefiles/module_base.orion index 2c26ea8931..c053ffa49c 100644 --- a/modulefiles/module_base.orion +++ b/modulefiles/module_base.orion @@ -1,34 +1,57 @@ #%Module###################################################################### ## -## FV3GFS prerequisites -## +## NEMS FV3 Prerequisites: Orion/Intel -module load intel/2018.4 -module load impi/2018.4 -module load wgrib/2.0.8 -#module load hpss/hpss -#module load nco/4.7.0 -module load hdf5/1.10.5-parallel -module load netcdf/4.7.2-parallel +## +## load contrib environment +## load slurm utils (arbitrary.pl layout.pl) +## +module load contrib noaatools -module load gempak/7.5.1 +## +## load programming environment +## this typically includes compiler, MPI and job scheduler +## +module load intel/2018 +module load impi/2018 -#Load from official NCEPLIBS +## +## NCEP libraries (temporary version to match the CCPP requirements) +## module use /apps/contrib/NCEPLIBS/orion/modulefiles -module load grib_util/1.2.0 -module load prod_util/1.2.0 +module load bacio/2.0.3 +module load ip/3.0.2 +module load nemsio/2.2.4 +module load sp/2.0.3 +module load w3emc/2.4.0 +module load w3nco/2.0.7 +module load g2/3.1.1 module load g2tmpl/1.6.0 module load crtm/2.3.0 +module load jasper/1.900.2 +module load png/1.2.44 +module load z/1.2.6 -#Load from GWV NCEPLIBS +module load prod_util/1.2.0 +## +## load ESMF library for above compiler / MPI combination +## use pre-compiled EMSF library for above compiler / MPI combination +## module use /apps/contrib/NCEPLIBS/lib/modulefiles -module load esmflocal/8_0_48b -#module load netcdfp/4.7.4 +module load netcdfp/4.7.4 +module load esmflocal/8.0.0.para +module load post-intel-sandybridge/8.0.5 -module load contrib -module load rocoto/1.3.1 -module load slurm/19.05.3-2 - -# python -module load python/3.7.5 +module load netcdf_parallel/4.7.4 +module load hdf5_parallel/1.10.6 +module load wgrib/2.0.8 +module load grib_util/1.2.0 +## +### load cmake +### +module load cmake/3.15.4 +setenv CMAKE_C_COMPILER mpiicc +setenv CMAKE_CXX_COMPILER mpiicpc +setenv CMAKE_Fortran_COMPILER mpiifort +setenv CMAKE_Platform orion.intel diff --git a/parm/config/config.wave b/parm/config/config.wave new file mode 100755 index 0000000000..0307a73af5 --- /dev/null +++ b/parm/config/config.wave @@ -0,0 +1,131 @@ +#!/bin/ksh -x + +########## config.wave ########## +# Wave steps specific + +# Parameters that are common to all wave model steps + +# System and version +export wave_sys_ver=v1.0.0 + +# General runtime labels +# export WAV_MOD_ID=${WAV_MOD_ID:-wave} # generic modID=wave valid for GFSv16 and beyond +# COMPONENTwave stands for model component, in addition to NET/RUN for coupled systems +export COMPONENTwave=${COMPONENTwave:-${RUN}wave} + +# In GFS/GDAS, restart files are generated/read from gdas runs +# Can I use rCDUMP here???? +export COMPONENTRSTwave=${COMPONENTRSTwave:-gdaswave} + +# Grids for wave model +export waveGRD='glo_10m aoc_9km ant_9km' +export waveGRDN='1 2 3' # gridnumber for ww3_multi +export waveGRDG='10 20 30' # gridgroup for ww3_multi + +# ESMF input grid +export waveesmfGRD='glox_10m' # input grid + +# Grids for input fields +export WAVEICE_DID=sice +export WAVEICE_FID=icean_5m +export WAVECUR_DID=rtofs +export WAVECUR_FID=rtofs_5m +export WAVEWND_DID= +export WAVEWND_FID= + +# Grids for output fields +export waveuoutpGRD=points +export waveinterpGRD='glo_15mxt' # Grids that need to be interpolated from native + # in POST will generate grib unless gribOK not set +export wavesbsGRD='' # side-by-side grids generated as wave model runs, writes to com +export wavepostGRD='glo_10m aoc_9km ant_9km' # Native grids that will be post-processed (grib2) + +# CDATE +export CDATE=${PDY}${cyc} + +# The start time reflects the number of hindcast hours prior to the cycle initial time +if [ "$CDUMP" = "gdas" ] +then + export FHMAX_WAV=${FHMAX_WAV:-9} +fi +export WAVHINDH=${WAVHINDH:-0} +export FHMIN_WAV=${FHMIN_WAV:-0} +export FHOUT_WAV=${FHOUT_WAV:-3} +export FHMAX_WAV=${FHMAX_WAV:-384} +export FHMAX_HF_WAV=${FHMAX_HF_WAV:-120} +export FHOUT_HF_WAV=${FHOUT_HF_WAV:-1} + +# Output stride +export WAV_WND_HOUR_INC=1 # This value should match with the one used in + # the wind update script +# gridded and point output rate +export DTFLD_WAV=`expr $FHOUT_HF_WAV \* 3600` +export DTPNT_WAV=3600 +export FHINCP_WAV=`expr $DTPNT_WAV / 3600` + +# Selected output parameters (gridded) +export OUTPARS_WAV="WND CUR ICE HS T01 T02 DIR FP DP PHS PTP PDIR CHAR" +# GFS # export OUTPARS_WAV='WND CUR ICE HS T01 T02 DIR FP DP PHS PTP PDIR CHAR' + +# Options for point output (switch on/off boundary point output) +export DOIBP_WAV='NO' + +# Intake currents settings +export WAV_CUR_DT=${WAV_CUR_DT:-3} +export WAV_CUR_HF_DT=${WAV_CUR_HF_DT:-1} +export WAV_CUR_HF_FH=${WAV_CUR_HF_FH:-72} +export WAV_CUR_CDO_SMOOTH="NO" + +# Number of cycles to look back for restart files +export nback= + +# Restart file config +if [ "$CDUMP" = "gdas" ] +then + WAVNCYC=4 + WAVHCYC=6 + FHMAX_WAV_CUR=${FHMAX_WAV_CUR:-48} # RTOFS forecasts only out to 8 days +elif [ ${gfs_cyc} -ne 0 ] +then + FHMAX_WAV_CUR=${FHMAX_WAV_CUR:-192} # RTOFS forecasts only out to 8 days + WAVHCYC=`expr 24 / ${gfs_cyc}` +else + WAVHCYC=0 + FHMAX_WAV_CUR=${FHMAX_WAV_CUR:-192} # RTOFS forecasts only out to 8 days +fi +export FHMAX_WAV_CUR WAVHCYC WAVNCYC + +# Restart timing business +export RSTTYPE_WAV='T' # generate second tier of restart files +export DT_1_RST_WAV=10800 # time between restart files, set to DTRST=1 for a single restart file +export DT_2_RST_WAV=43200 # restart stride for checkpointing restart +export RSTIOFF_WAV=0 # first restart file offset relative to model start +# +# Set runmember to default value if not GEFS cpl run +# (for a GFS coupled run, RUNMEN would be unset, this should default to -1) +export RUNMEM=${RUNMEM:--1} +# Set wave model member tags if ensemble run +# -1: no suffix, deterministic; xxxNN: extract two last digits to make ofilename prefix=gwesNN +if [ $RUNMEM = -1 ]; then +# No suffix added to model ID in case of deterministic run + export waveMEMB= +else +# Extract member number only + export waveMEMB=`echo $RUNMEM | grep -o '..$'` +fi + +# Determine if wave component needs input and/or is coupled +export WW3ATMINP='CPL' +export WW3ICEINP='YES' +export WW3CURINP='YES' + +if [ "${WW3ICEINP}" = "YES" ]; then + export WAVICEFILE=${CDUMP}.t${cyc}z.seaice.5min.grib2 +fi + +# Determine if input is from perturbed ensemble (T) or single input file (F) for all members +export WW3ATMIENS='F' +export WW3ICEIENS='F' +export WW3CURIENS='F' + +echo "END: config.waveprep" diff --git a/parm/config/config.waveinit b/parm/config/config.waveinit new file mode 100755 index 0000000000..93960e5e25 --- /dev/null +++ b/parm/config/config.waveinit @@ -0,0 +1,14 @@ +#!/bin/ksh -x + +########## config.waveinit ########## +# Wave steps specific + +echo "BEGIN: config.waveinit" + +# Get task specific resources +. $EXPDIR/config.resources waveinit + +# Step label +export sigMODE=${sigMODE:-init} + +echo "END: config.waveinit" diff --git a/parm/config/config.wavepostsbs b/parm/config/config.wavepostsbs new file mode 100755 index 0000000000..9bfe255f4b --- /dev/null +++ b/parm/config/config.wavepostsbs @@ -0,0 +1,12 @@ +#!/bin/ksh -x + +########## config.wavepostsbs ########## +# Wave steps specific + +echo "BEGIN: config.wavepostsbs" + +# Get task specific resources +. $EXPDIR/config.resources wavepostsbs + + +echo "END: config.wavepostsbs" diff --git a/parm/config/config.waveprep b/parm/config/config.waveprep new file mode 100755 index 0000000000..50a03969a0 --- /dev/null +++ b/parm/config/config.waveprep @@ -0,0 +1,29 @@ +#!/bin/ksh -x + +########## config.waveprep ########## +# Wave steps specific + +echo "BEGIN: config.waveprep" + +# Get task specific resources +. $EXPDIR/config.resources waveprep + +# Step label +export sigMODE=${sigMODE:-prep} + +export HOUR_INC=3 # This value should match with the one used in + # the wind update script +export GOFILETYPE=1 # GOFILETYPE=1 one gridded file per output step +export POFILETYPE=1 # POFILETYPE=1 one point file per output step + +# Parameters for ww3_multi.inp +# Unified output T or F +export FUNIPNT='T' +# Unified output server type (see ww3_multi.inp in WW3 repo) +export PNTSRV='1' +# Flag for dedicated output process for unified points +export FPNTPROC='T' +# Flag for grids sharing dedicated output processes +export FGRDPROC='F' + +echo "END: config.waveprep" diff --git a/parm/mom6/MOM_input_025 b/parm/mom6/MOM_input_025 new file mode 100644 index 0000000000..56ca33fc70 --- /dev/null +++ b/parm/mom6/MOM_input_025 @@ -0,0 +1,889 @@ +/* This input file provides the adjustable run-time parameters for version 6 of + the Modular Ocean Model (MOM6), a numerical ocean model developed at NOAA-GFDL. + Where appropriate, parameters use usually given in MKS units. + + This particular file is for the example in OM4_025. + + This MOM_input file typically contains only the non-default values that are + needed to reproduce this example. A full list of parameters for this example + can be found in the corresponding MOM_parameter_doc.all file which is + generated by the model at run-time. */ + +! === module MOM === +USE_REGRIDDING = True ! [Boolean] default = False + ! If True, use the ALE algorithm (regridding/remapping). + ! If False, use the layered isopycnal algorithm. +THICKNESSDIFFUSE = True ! [Boolean] default = False + ! If true, interface heights are diffused with a + ! coefficient of KHTH. +THICKNESSDIFFUSE_FIRST = True ! [Boolean] default = False + ! If true, do thickness diffusion before dynamics. + ! This is only used if THICKNESSDIFFUSE is true. +DT = 900.0 ! [s] + ! The (baroclinic) dynamics time step. The time-step that + ! is actually used will be an integer fraction of the + ! forcing time-step (DT_FORCING in ocean-only mode or the + ! coupling timestep in coupled mode.) +DT_THERM = 1800.0 ! [s] default = 900.0 + ! The thermodynamic and tracer advection time step. + ! Ideally DT_THERM should be an integer multiple of DT + ! and less than the forcing or coupling time-step, unless + ! THERMO_SPANS_COUPLING is true, in which case DT_THERM + ! can be an integer multiple of the coupling timestep. By + ! default DT_THERM is set to DT. +THERMO_SPANS_COUPLING = True ! [Boolean] default = False + ! If true, the MOM will take thermodynamic and tracer + ! timesteps that can be longer than the coupling timestep. + ! The actual thermodynamic timestep that is used in this + ! case is the largest integer multiple of the coupling + ! timestep that is less than or equal to DT_THERM. +HFREEZE = 20.0 ! [m] default = -1.0 + ! If HFREEZE > 0, melt potential will be computed. The actual depth + ! over which melt potential is computed will be min(HFREEZE, OBLD) + ! where OBLD is the boundary layer depth. If HFREEZE <= 0 (default) + ! melt potential will not be computed. +FRAZIL = True ! [Boolean] default = False + ! If true, water freezes if it gets too cold, and the + ! the accumulated heat deficit is returned in the + ! surface state. FRAZIL is only used if + ! ENABLE_THERMODYNAMICS is true. +DO_GEOTHERMAL = True ! [Boolean] default = False + ! If true, apply geothermal heating. +BOUND_SALINITY = True ! [Boolean] default = False + ! If true, limit salinity to being positive. (The sea-ice + ! model may ask for more salt than is available and + ! drive the salinity negative otherwise.) +C_P = 3992.0 ! [J kg-1 K-1] default = 3991.86795711963 + ! The heat capacity of sea water, approximated as a + ! constant. This is only used if ENABLE_THERMODYNAMICS is + ! true. The default value is from the TEOS-10 definition + ! of conservative temperature. +CHECK_BAD_SURFACE_VALS = True ! [Boolean] default = False + ! If true, check the surface state for ridiculous values. +BAD_VAL_SSH_MAX = 50.0 ! [m] default = 20.0 + ! The value of SSH above which a bad value message is + ! triggered, if CHECK_BAD_SURFACE_VALS is true. +BAD_VAL_SSS_MAX = 75.0 ! [PPT] default = 45.0 + ! The value of SSS above which a bad value message is + ! triggered, if CHECK_BAD_SURFACE_VALS is true. +BAD_VAL_SST_MAX = 65.0 ! [deg C] default = 45.0, PTripp: changed from 55.0 on 12/28/2017 + ! The value of SST above which a bad value message is + ! triggered, if CHECK_BAD_SURFACE_VALS is true. +BAD_VAL_SST_MIN = -3.0 ! [deg C] default = -2.1 + ! The value of SST below which a bad value message is + ! triggered, if CHECK_BAD_SURFACE_VALS is true. +WRITE_GEOM = 2 ! default = 1 + ! If =0, never write the geometry and vertical grid files. + ! If =1, write the geometry and vertical grid files only for + ! a new simulation. If =2, always write the geometry and + ! vertical grid files. Other values are invalid. + +! === module MOM_domains === +TRIPOLAR_N = True ! [Boolean] default = False + ! Use tripolar connectivity at the northern edge of the + ! domain. With TRIPOLAR_N, NIGLOBAL must be even. +NIGLOBAL = 1440 ! + ! The total number of thickness grid points in the + ! x-direction in the physical domain. With STATIC_MEMORY_ + ! this is set in MOM_memory.h at compile time. +NJGLOBAL = 1080 ! + ! The total number of thickness grid points in the + ! y-direction in the physical domain. With STATIC_MEMORY_ + ! this is set in MOM_memory.h at compile time. + +! === module MOM_hor_index === +! Sets the horizontal array index types. + +! === module MOM_verticalGrid === +! Parameters providing information about the vertical grid. +NK = 75 ! [nondim] + ! The number of model layers. + +! === module MOM_fixed_initialization === +INPUTDIR = "INPUT" ! default = "." + ! The directory in which input files are found. + +! === module MOM_grid_init === +GRID_CONFIG = "mosaic" ! + ! A character string that determines the method for + ! defining the horizontal grid. Current options are: + ! mosaic - read the grid from a mosaic (supergrid) + ! file set by GRID_FILE. + ! cartesian - use a (flat) Cartesian grid. + ! spherical - use a simple spherical grid. + ! mercator - use a Mercator spherical grid. +GRID_FILE = "ocean_hgrid.nc" ! + ! Name of the file from which to read horizontal grid data. +TOPO_CONFIG = "file" ! + ! This specifies how bathymetry is specified: + ! file - read bathymetric information from the file + ! specified by (TOPO_FILE). + ! flat - flat bottom set to MAXIMUM_DEPTH. + ! bowl - an analytically specified bowl-shaped basin + ! ranging between MAXIMUM_DEPTH and MINIMUM_DEPTH. + ! spoon - a similar shape to 'bowl', but with an vertical + ! wall at the southern face. + ! halfpipe - a zonally uniform channel with a half-sine + ! profile in the meridional direction. + ! benchmark - use the benchmark test case topography. + ! Neverland - use the Neverland test case topography. + ! DOME - use a slope and channel configuration for the + ! DOME sill-overflow test case. + ! ISOMIP - use a slope and channel configuration for the + ! ISOMIP test case. + ! DOME2D - use a shelf and slope configuration for the + ! DOME2D gravity current/overflow test case. + ! Kelvin - flat but with rotated land mask. + ! seamount - Gaussian bump for spontaneous motion test case. + ! shelfwave - exponential slope for shelfwave test case. + ! supercritical - flat but with 8.95 degree land mask. + ! Phillips - ACC-like idealized topography used in the Phillips config. + ! dense - Denmark Strait-like dense water formation and overflow. + ! USER - call a user modified routine. +TOPO_FILE = "ocean_topog.nc" ! default = "topog.nc" + ! The file from which the bathymetry is read. +TOPO_EDITS_FILE = "All_edits.nc" ! default = "" + ! The file from which to read a list of i,j,z topography overrides. +MAXIMUM_DEPTH = 6500.0 ! [m] + ! The maximum depth of the ocean. +MINIMUM_DEPTH = 9.5 ! [m] default = 0.0 + ! If MASKING_DEPTH is unspecified, then anything shallower than + ! MINIMUM_DEPTH is assumed to be land and all fluxes are masked out. + ! If MASKING_DEPTH is specified, then all depths shallower than + ! MINIMUM_DEPTH but deeper than MASKING_DEPTH are rounded to MINIMUM_DEPTH. +GRID_ROTATION_ANGLE_BUGS = False ! [Boolean] default = True + ! If true, use an older algorithm to calculate the sine and + ! cosines needed rotate between grid-oriented directions and + ! true north and east. Differences arise at the tripolar fold +USE_TRIPOLAR_GEOLONB_BUG = False ! [Boolean] default = True + ! If true, use older code that incorrectly sets the longitude + ! in some points along the tripolar fold to be off by 360 degrees + +! === module MOM_open_boundary === +! Controls where open boundaries are located, what kind of boundary condition to impose, and what data to apply, if any. +MASKING_DEPTH = 0.0 ! [m] default = -9999.0 + ! The depth below which to mask points as land points, for which all + ! fluxes are zeroed out. MASKING_DEPTH is ignored if negative. +CHANNEL_CONFIG = "list" ! default = "none" + ! A parameter that determines which set of channels are + ! restricted to specific widths. Options are: + ! none - All channels have the grid width. + ! global_1deg - Sets 16 specific channels appropriate + ! for a 1-degree model, as used in CM2G. + ! list - Read the channel locations and widths from a + ! text file, like MOM_channel_list in the MOM_SIS + ! test case. + ! file - Read open face widths everywhere from a + ! NetCDF file on the model grid. +CHANNEL_LIST_FILE = "MOM_channels_global_025" ! default = "MOM_channel_list" + ! The file from which the list of narrowed channels is read. + +! === module MOM_tracer_registry === + +! === module MOM_EOS === +DTFREEZE_DP = -7.75E-08 ! [deg C Pa-1] default = 0.0 + ! When TFREEZE_FORM=LINEAR, + ! this is the derivative of the freezing potential + ! temperature with pressure. + +! === module MOM_restart === +PARALLEL_RESTARTFILES = True ! [Boolean] default = False + ! If true, each processor writes its own restart file, + ! otherwise a single restart file is generated + +! === module MOM_tracer_flow_control === +USE_IDEAL_AGE_TRACER = False ! [Boolean] default = False + ! If true, use the ideal_age_example tracer package. + +! === module ideal_age_example === + +! === module MOM_coord_initialization === +COORD_CONFIG = "file" ! + ! This specifies how layers are to be defined: + ! ALE or none - used to avoid defining layers in ALE mode + ! file - read coordinate information from the file + ! specified by (COORD_FILE). + ! BFB - Custom coords for buoyancy-forced basin case + ! based on SST_S, T_BOT and DRHO_DT. + ! linear - linear based on interfaces not layers + ! layer_ref - linear based on layer densities + ! ts_ref - use reference temperature and salinity + ! ts_range - use range of temperature and salinity + ! (T_REF and S_REF) to determine surface density + ! and GINT calculate internal densities. + ! gprime - use reference density (RHO_0) for surface + ! density and GINT calculate internal densities. + ! ts_profile - use temperature and salinity profiles + ! (read from COORD_FILE) to set layer densities. + ! USER - call a user modified routine. +COORD_FILE = "layer_coord.nc" ! + ! The file from which the coordinate densities are read. +REGRIDDING_COORDINATE_MODE = "HYCOM1" ! default = "LAYER" + ! Coordinate mode for vertical regridding. + ! Choose among the following possibilities: + ! LAYER - Isopycnal or stacked shallow water layers + ! ZSTAR, Z* - stetched geopotential z* + ! SIGMA_SHELF_ZSTAR - stetched geopotential z* ignoring shelf + ! SIGMA - terrain following coordinates + ! RHO - continuous isopycnal + ! HYCOM1 - HyCOM-like hybrid coordinate + ! SLIGHT - stretched coordinates above continuous isopycnal + ! ADAPTIVE - optimize for smooth neutral density surfaces +BOUNDARY_EXTRAPOLATION = True ! [Boolean] default = False + ! When defined, a proper high-order reconstruction + ! scheme is used within boundary cells rather + ! than PCM. E.g., if PPM is used for remapping, a + ! PPM reconstruction will also be used within + ! boundary cells. +ALE_COORDINATE_CONFIG = "HYBRID:hycom1_75_800m.nc,sigma2,FNC1:2,4000,4.5,.01" ! default = "UNIFORM" + ! Determines how to specify the coordinate + ! resolution. Valid options are: + ! PARAM - use the vector-parameter ALE_RESOLUTION + ! UNIFORM[:N] - uniformly distributed + ! FILE:string - read from a file. The string specifies + ! the filename and variable name, separated + ! by a comma or space, e.g. FILE:lev.nc,dz + ! or FILE:lev.nc,interfaces=zw + ! WOA09[:N] - the WOA09 vertical grid (approximately) + ! FNC1:string - FNC1:dz_min,H_total,power,precision + ! HYBRID:string - read from a file. The string specifies + ! the filename and two variable names, separated + ! by a comma or space, for sigma-2 and dz. e.g. + ! HYBRID:vgrid.nc,sigma2,dz +!ALE_RESOLUTION = 7*2.0, 2*2.01, 2.02, 2.03, 2.05, 2.08, 2.11, 2.15, 2.21, 2.2800000000000002, 2.37, 2.48, 2.61, 2.77, 2.95, 3.17, 3.4299999999999997, 3.74, 4.09, 4.49, 4.95, 5.48, 6.07, 6.74, 7.5, 8.34, 9.280000000000001, 10.33, 11.49, 12.77, 14.19, 15.74, 17.450000000000003, 19.31, 21.35, 23.56, 25.97, 28.580000000000002, 31.41, 34.47, 37.77, 41.32, 45.14, 49.25, 53.65, 58.370000000000005, 63.42, 68.81, 74.56, 80.68, 87.21000000000001, 94.14, 101.51, 109.33, 117.62, 126.4, 135.68, 145.5, 155.87, 166.81, 178.35, 190.51, 203.31, 216.78, 230.93, 245.8, 261.42, 277.83 ! [m] + ! The distribution of vertical resolution for the target + ! grid used for Eulerian-like coordinates. For example, + ! in z-coordinate mode, the parameter is a list of level + ! thicknesses (in m). In sigma-coordinate mode, the list + ! is of non-dimensional fractions of the water column. +!TARGET_DENSITIES = 1010.0, 1014.3034, 1017.8088, 1020.843, 1023.5566, 1025.813, 1027.0275, 1027.9114, 1028.6422, 1029.2795, 1029.852, 1030.3762, 1030.8626, 1031.3183, 1031.7486, 1032.1572, 1032.5471, 1032.9207, 1033.2798, 1033.6261, 1033.9608, 1034.2519, 1034.4817, 1034.6774, 1034.8508, 1035.0082, 1035.1533, 1035.2886, 1035.4159, 1035.5364, 1035.6511, 1035.7608, 1035.8661, 1035.9675, 1036.0645, 1036.1554, 1036.2411, 1036.3223, 1036.3998, 1036.4739, 1036.5451, 1036.6137, 1036.68, 1036.7441, 1036.8062, 1036.8526, 1036.8874, 1036.9164, 1036.9418, 1036.9647, 1036.9857, 1037.0052, 1037.0236, 1037.0409, 1037.0574, 1037.0738, 1037.0902, 1037.1066, 1037.123, 1037.1394, 1037.1558, 1037.1722, 1037.1887, 1037.206, 1037.2241, 1037.2435, 1037.2642, 1037.2866, 1037.3112, 1037.3389, 1037.3713, 1037.4118, 1037.475, 1037.6332, 1037.8104, 1038.0 ! [m] + ! HYBRID target densities for itnerfaces +REGRID_COMPRESSIBILITY_FRACTION = 0.01 ! [not defined] default = 0.0 + ! When interpolating potential density profiles we can add + ! some artificial compressibility solely to make homogenous + ! regions appear stratified. +MAXIMUM_INT_DEPTH_CONFIG = "FNC1:5,8000.0,1.0,.01" ! default = "NONE" + ! Determines how to specify the maximum interface depths. + ! Valid options are: + ! NONE - there are no maximum interface depths + ! PARAM - use the vector-parameter MAXIMUM_INTERFACE_DEPTHS + ! FILE:string - read from a file. The string specifies + ! the filename and variable name, separated + ! by a comma or space, e.g. FILE:lev.nc,Z + ! FNC1:string - FNC1:dz_min,H_total,power,precision +!MAXIMUM_INT_DEPTHS = 0.0, 5.0, 12.75, 23.25, 36.49, 52.480000000000004, 71.22, 92.71000000000001, 116.94000000000001, 143.92000000000002, 173.65, 206.13, 241.36, 279.33000000000004, 320.05000000000007, 363.5200000000001, 409.7400000000001, 458.7000000000001, 510.4100000000001, 564.8700000000001, 622.0800000000002, 682.0300000000002, 744.7300000000002, 810.1800000000003, 878.3800000000003, 949.3300000000004, 1023.0200000000004, 1099.4600000000005, 1178.6500000000005, 1260.5900000000006, 1345.2700000000007, 1432.7000000000007, 1522.8800000000008, 1615.8100000000009, 1711.490000000001, 1809.910000000001, 1911.080000000001, 2015.0000000000011, 2121.670000000001, 2231.080000000001, 2343.2400000000007, 2458.1500000000005, 2575.8100000000004, 2696.2200000000003, 2819.3700000000003, 2945.2700000000004, 3073.9200000000005, 3205.3200000000006, 3339.4600000000005, 3476.3500000000004, 3615.9900000000002, 3758.38, 3903.52, 4051.4, 4202.03, 4355.41, 4511.54, 4670.41, 4832.03, 4996.4, 5163.5199999999995, 5333.379999999999, 5505.989999999999, 5681.3499999999985, 5859.459999999998, 6040.319999999998, 6223.919999999998, 6410.269999999999, 6599.369999999999, 6791.219999999999, 6985.8099999999995, 7183.15, 7383.24, 7586.08, 7791.67, 8000.0 + ! The list of maximum depths for each interface. +MAX_LAYER_THICKNESS_CONFIG = "FNC1:400,31000.0,0.1,.01" ! default = "NONE" + ! Determines how to specify the maximum layer thicknesses. + ! Valid options are: + ! NONE - there are no maximum layer thicknesses + ! PARAM - use the vector-parameter MAX_LAYER_THICKNESS + ! FILE:string - read from a file. The string specifies + ! the filename and variable name, separated + ! by a comma or space, e.g. FILE:lev.nc,Z + ! FNC1:string - FNC1:dz_min,H_total,power,precision +!MAX_LAYER_THICKNESS = 400.0, 409.63, 410.32, 410.75, 411.07, 411.32, 411.52, 411.7, 411.86, 412.0, 412.13, 412.24, 412.35, 412.45, 412.54, 412.63, 412.71, 412.79, 412.86, 412.93, 413.0, 413.06, 413.12, 413.18, 413.24, 413.29, 413.34, 413.39, 413.44, 413.49, 413.54, 413.58, 413.62, 413.67, 413.71, 413.75, 413.78, 413.82, 413.86, 413.9, 413.93, 413.97, 414.0, 414.03, 414.06, 414.1, 414.13, 414.16, 414.19, 414.22, 414.24, 414.27, 414.3, 414.33, 414.35, 414.38, 414.41, 414.43, 414.46, 414.48, 414.51, 414.53, 414.55, 414.58, 414.6, 414.62, 414.65, 414.67, 414.69, 414.71, 414.73, 414.75, 414.77, 414.79, 414.83 ! [m] + ! The list of maximum thickness for each layer. +REMAPPING_SCHEME = "PPM_H4" ! default = "PLM" + ! This sets the reconstruction scheme used + ! for vertical remapping for all variables. + ! It can be one of the following schemes: + ! PCM (1st-order accurate) + ! PLM (2nd-order accurate) + ! PPM_H4 (3rd-order accurate) + ! PPM_IH4 (3rd-order accurate) + ! PQM_IH4IH3 (4th-order accurate) + ! PQM_IH6IH5 (5th-order accurate) + +! === module MOM_grid === +! Parameters providing information about the lateral grid. + +! === module MOM_state_initialization === +INIT_LAYERS_FROM_Z_FILE = True ! [Boolean] default = False + ! If true, intialize the layer thicknesses, temperatures, + ! and salnities from a Z-space file on a latitude- + ! longitude grid. + +! === module MOM_initialize_layers_from_Z === +!TEMP_SALT_Z_INIT_FILE = "WOA05_pottemp_salt.nc" ! default = "temp_salt_z.nc" +TEMP_SALT_Z_INIT_FILE = "MOM6_IC_TS.nc" + ! The name of the z-space input file used to initialize + ! temperatures (T) and salinities (S). If T and S are not + ! in the same file, TEMP_Z_INIT_FILE and SALT_Z_INIT_FILE + ! must be set. +Z_INIT_FILE_PTEMP_VAR = "temp" ! default = "ptemp" + ! The name of the potential temperature variable in + ! TEMP_Z_INIT_FILE. +Z_INIT_FILE_SALT_VAR = "salt" ! default = "salt" + ! The name of the salinity variable in + ! SALT_Z_INIT_FILE. +Z_INIT_ALE_REMAPPING = True ! [Boolean] default = False + ! If True, then remap straight to model coordinate from file. + +! === module MOM_diag_mediator === +!Jiande NUM_DIAG_COORDS = 2 ! default = 1 +NUM_DIAG_COORDS = 1 + ! The number of diagnostic vertical coordinates to use. + ! For each coordinate, an entry in DIAG_COORDS must be provided. +!Jiande DIAG_COORDS = "z Z ZSTAR", "rho2 RHO2 RHO" ! +DIAG_COORDS = "z Z ZSTAR" + ! A list of string tuples associating diag_table modules to + ! a coordinate definition used for diagnostics. Each string + ! is of the form "MODULE_SUFFIX,PARAMETER_SUFFIX,COORDINATE_NAME". +DIAG_COORD_DEF_Z="FILE:interpolate_zgrid_40L.nc,interfaces=zw" +DIAG_MISVAL = -1e34 +!Jiande DIAG_COORD_DEF_RHO2 = "RFNC1:35,999.5,1028,1028.5,8.,1038.,0.0078125" ! default = "WOA09" + ! Determines how to specify the coordinate + ! resolution. Valid options are: + ! PARAM - use the vector-parameter DIAG_COORD_RES_RHO2 + ! UNIFORM[:N] - uniformly distributed + ! FILE:string - read from a file. The string specifies + ! the filename and variable name, separated + ! by a comma or space, e.g. FILE:lev.nc,dz + ! or FILE:lev.nc,interfaces=zw + ! WOA09[:N] - the WOA09 vertical grid (approximately) + ! FNC1:string - FNC1:dz_min,H_total,power,precision + ! HYBRID:string - read from a file. The string specifies + ! the filename and two variable names, separated + ! by a comma or space, for sigma-2 and dz. e.g. + ! HYBRID:vgrid.nc,sigma2,dz + +! === module MOM_MEKE === +USE_MEKE = True ! [Boolean] default = False + ! If true, turns on the MEKE scheme which calculates + ! a sub-grid mesoscale eddy kinetic energy budget. +MEKE_GMCOEFF = 1.0 ! [nondim] default = -1.0 + ! The efficiency of the conversion of potential energy + ! into MEKE by the thickness mixing parameterization. + ! If MEKE_GMCOEFF is negative, this conversion is not + ! used or calculated. +MEKE_BGSRC = 1.0E-13 ! [W kg-1] default = 0.0 + ! A background energy source for MEKE. +MEKE_KHMEKE_FAC = 1.0 ! [nondim] default = 0.0 + ! A factor that maps MEKE%Kh to Kh for MEKE itself. +MEKE_ALPHA_RHINES = 0.15 ! [nondim] default = 0.05 + ! If positive, is a coefficient weighting the Rhines scale + ! in the expression for mixing length used in MEKE-derived diffusiviity. +MEKE_ALPHA_EADY = 0.15 ! [nondim] default = 0.05 + ! If positive, is a coefficient weighting the Eady length scale + ! in the expression for mixing length used in MEKE-derived diffusiviity. + +! === module MOM_lateral_mixing_coeffs === +USE_VARIABLE_MIXING = True ! [Boolean] default = False + ! If true, the variable mixing code will be called. This + ! allows diagnostics to be created even if the scheme is + ! not used. If KHTR_SLOPE_CFF>0 or KhTh_Slope_Cff>0, + ! this is set to true regardless of what is in the + ! parameter file. +RESOLN_SCALED_KH = True ! [Boolean] default = False + ! If true, the Laplacian lateral viscosity is scaled away + ! when the first baroclinic deformation radius is well + ! resolved. +RESOLN_SCALED_KHTH = True ! [Boolean] default = False + ! If true, the interface depth diffusivity is scaled away + ! when the first baroclinic deformation radius is well + ! resolved. +KHTR_SLOPE_CFF = 0.25 ! [nondim] default = 0.0 + ! The nondimensional coefficient in the Visbeck formula + ! for the epipycnal tracer diffusivity +USE_STORED_SLOPES = True ! [Boolean] default = False + ! If true, the isopycnal slopes are calculated once and + ! stored for re-use. This uses more memory but avoids calling + ! the equation of state more times than should be necessary. +INTERPOLATE_RES_FN = False ! [Boolean] default = True + ! If true, interpolate the resolution function to the + ! velocity points from the thickness points; otherwise + ! interpolate the wave speed and calculate the resolution + ! function independently at each point. +GILL_EQUATORIAL_LD = True ! [Boolean] default = False + ! If true, uses Gill's definition of the baroclinic + ! equatorial deformation radius, otherwise, if false, use + ! Pedlosky's definition. These definitions differ by a factor + ! of 2 infront of the beta term in the denominator. Gill'sis the more appropriate definition. + +! === module MOM_set_visc === +CHANNEL_DRAG = True ! [Boolean] default = False + ! If true, the bottom drag is exerted directly on each + ! layer proportional to the fraction of the bottom it + ! overlies. +PRANDTL_TURB = 1.25 ! [nondim] default = 1.0 + ! The turbulent Prandtl number applied to shear + ! instability. +HBBL = 10.0 ! [m] + ! The thickness of a bottom boundary layer with a + ! viscosity of KVBBL if BOTTOMDRAGLAW is not defined, or + ! the thickness over which near-bottom velocities are + ! averaged for the drag law if BOTTOMDRAGLAW is defined + ! but LINEAR_DRAG is not. +DRAG_BG_VEL = 0.1 ! [m s-1] default = 0.0 + ! DRAG_BG_VEL is either the assumed bottom velocity (with + ! LINEAR_DRAG) or an unresolved velocity that is + ! combined with the resolved velocity to estimate the + ! velocity magnitude. DRAG_BG_VEL is only used when + ! BOTTOMDRAGLAW is defined. +BBL_USE_EOS = True ! [Boolean] default = False + ! If true, use the equation of state in determining the + ! properties of the bottom boundary layer. Otherwise use + ! the layer target potential densities. +BBL_THICK_MIN = 0.1 ! [m] default = 0.0 + ! The minimum bottom boundary layer thickness that can be + ! used with BOTTOMDRAGLAW. This might be + ! Kv / (cdrag * drag_bg_vel) to give Kv as the minimum + ! near-bottom viscosity. +KV = 1.0E-04 ! [m2 s-1] + ! The background kinematic viscosity in the interior. + ! The molecular value, ~1e-6 m2 s-1, may be used. +KV_BBL_MIN = 0.0 ! [m2 s-1] default = 1.0E-04 + ! The minimum viscosities in the bottom boundary layer. +KV_TBL_MIN = 0.0 ! [m2 s-1] default = 1.0E-04 + ! The minimum viscosities in the top boundary layer. + +! === module MOM_continuity === + +! === module MOM_continuity_PPM === +ETA_TOLERANCE = 1.0E-06 ! [m] default = 3.75E-09 + ! The tolerance for the differences between the + ! barotropic and baroclinic estimates of the sea surface + ! height due to the fluxes through each face. The total + ! tolerance for SSH is 4 times this value. The default + ! is 0.5*NK*ANGSTROM, and this should not be set less x + ! than about 10^-15*MAXIMUM_DEPTH. +ETA_TOLERANCE_AUX = 0.001 ! [m] default = 1.0E-06 + ! The tolerance for free-surface height discrepancies + ! between the barotropic solution and the sum of the + ! layer thicknesses when calculating the auxiliary + ! corrected velocities. By default, this is the same as + ! ETA_TOLERANCE, but can be made larger for efficiency. + +! === module MOM_CoriolisAdv === +CORIOLIS_SCHEME = "SADOURNY75_ENSTRO" ! default = "SADOURNY75_ENERGY" + ! CORIOLIS_SCHEME selects the discretization for the + ! Coriolis terms. Valid values are: + ! SADOURNY75_ENERGY - Sadourny, 1975; energy cons. + ! ARAKAWA_HSU90 - Arakawa & Hsu, 1990 + ! SADOURNY75_ENSTRO - Sadourny, 1975; enstrophy cons. + ! ARAKAWA_LAMB81 - Arakawa & Lamb, 1981; En. + Enst. + ! ARAKAWA_LAMB_BLEND - A blend of Arakawa & Lamb with + ! Arakawa & Hsu and Sadourny energy +BOUND_CORIOLIS = True ! [Boolean] default = False + ! If true, the Coriolis terms at u-points are bounded by + ! the four estimates of (f+rv)v from the four neighboring + ! v-points, and similarly at v-points. This option would + ! have no effect on the SADOURNY Coriolis scheme if it + ! were possible to use centered difference thickness fluxes. + +! === module MOM_PressureForce === + +! === module MOM_PressureForce_AFV === +MASS_WEIGHT_IN_PRESSURE_GRADIENT = True ! [Boolean] default = False + ! If true, use mass weighting when interpolation T/S for + ! top/bottom integrals in AFV pressure gradient calculation. + +! === module MOM_hor_visc === +LAPLACIAN = True ! [Boolean] default = False + ! If true, use a Laplacian horizontal viscosity. +AH_VEL_SCALE = 0.01 ! [m s-1] default = 0.0 + ! The velocity scale which is multiplied by the cube of + ! the grid spacing to calculate the biharmonic viscosity. + ! The final viscosity is the largest of this scaled + ! viscosity, the Smagorinsky and Leith viscosities, and AH. +SMAGORINSKY_AH = True ! [Boolean] default = False + ! If true, use a biharmonic Smagorinsky nonlinear eddy + ! viscosity. +SMAG_BI_CONST = 0.06 ! [nondim] default = 0.0 + ! The nondimensional biharmonic Smagorinsky constant, + ! typically 0.015 - 0.06. + +! === module MOM_vert_friction === +U_TRUNC_FILE = "U_velocity_truncations" ! default = "" + ! The absolute path to a file into which the accelerations + ! leading to zonal velocity truncations are written. + ! Undefine this for efficiency if this diagnostic is not + ! needed. +V_TRUNC_FILE = "V_velocity_truncations" ! default = "" + ! The absolute path to a file into which the accelerations + ! leading to meridional velocity truncations are written. + ! Undefine this for efficiency if this diagnostic is not + ! needed. +HMIX_FIXED = 0.5 ! [m] + ! The prescribed depth over which the near-surface + ! viscosity and diffusivity are elevated when the bulk + ! mixed layer is not used. +MAXVEL = 6.0 ! [m s-1] default = 3.0E+08 + ! The maximum velocity allowed before the velocity + ! components are truncated. + +! === module MOM_PointAccel === + +! === module MOM_barotropic === +BOUND_BT_CORRECTION = True ! [Boolean] default = False + ! If true, the corrective pseudo mass-fluxes into the + ! barotropic solver are limited to values that require + ! less than maxCFL_BT_cont to be accommodated. +BT_PROJECT_VELOCITY = True ! [Boolean] default = False + ! If true, step the barotropic velocity first and project + ! out the velocity tendancy by 1+BEBT when calculating the + ! transport. The default (false) is to use a predictor + ! continuity step to find the pressure field, and then + ! to do a corrector continuity step using a weighted + ! average of the old and new velocities, with weights + ! of (1-BEBT) and BEBT. +DYNAMIC_SURFACE_PRESSURE = True ! [Boolean] default = False + ! If true, add a dynamic pressure due to a viscous ice + ! shelf, for instance. +BEBT = 0.2 ! [nondim] default = 0.1 + ! BEBT determines whether the barotropic time stepping + ! uses the forward-backward time-stepping scheme or a + ! backward Euler scheme. BEBT is valid in the range from + ! 0 (for a forward-backward treatment of nonrotating + ! gravity waves) to 1 (for a backward Euler treatment). + ! In practice, BEBT must be greater than about 0.05. +DTBT = -0.9 ! [s or nondim] default = -0.98 + ! The barotropic time step, in s. DTBT is only used with + ! the split explicit time stepping. To set the time step + ! automatically based the maximum stable value use 0, or + ! a negative value gives the fraction of the stable value. + ! Setting DTBT to 0 is the same as setting it to -0.98. + ! The value of DTBT that will actually be used is an + ! integer fraction of DT, rounding down. +BT_USE_OLD_CORIOLIS_BRACKET_BUG = True ! [Boolean] default = False + ! If True, use an order of operations that is not bitwise + ! rotationally symmetric in the meridional Coriolis term of + ! the barotropic solver. + +! === module MOM_thickness_diffuse === +KHTH_MAX_CFL = 0.1 ! [nondimensional] default = 0.8 + ! The maximum value of the local diffusive CFL ratio that + ! is permitted for the thickness diffusivity. 1.0 is the + ! marginally unstable value in a pure layered model, but + ! much smaller numbers (e.g. 0.1) seem to work better for + ! ALE-based models. + +! === module MOM_mixed_layer_restrat === +MIXEDLAYER_RESTRAT = True ! [Boolean] default = False + ! If true, a density-gradient dependent re-stratifying + ! flow is imposed in the mixed layer. Can be used in ALE mode + ! without restriction but in layer mode can only be used if + ! BULKMIXEDLAYER is true. +FOX_KEMPER_ML_RESTRAT_COEF = 1.0 ! [nondim] default = 0.0 + ! A nondimensional coefficient that is proportional to + ! the ratio of the deformation radius to the dominant + ! lengthscale of the submesoscale mixed layer + ! instabilities, times the minimum of the ratio of the + ! mesoscale eddy kinetic energy to the large-scale + ! geostrophic kinetic energy or 1 plus the square of the + ! grid spacing over the deformation radius, as detailed + ! by Fox-Kemper et al. (2010) +MLE_FRONT_LENGTH = 500.0 ! [m] default = 0.0 + ! If non-zero, is the frontal-length scale used to calculate the + ! upscaling of buoyancy gradients that is otherwise represented + ! by the parameter FOX_KEMPER_ML_RESTRAT_COEF. If MLE_FRONT_LENGTH is + ! non-zero, it is recommended to set FOX_KEMPER_ML_RESTRAT_COEF=1.0. +MLE_USE_PBL_MLD = True ! [Boolean] default = False + ! If true, the MLE parameterization will use the mixed-layer + ! depth provided by the active PBL parameterization. If false, + ! MLE will estimate a MLD based on a density difference with the + ! surface using the parameter MLE_DENSITY_DIFF. +MLE_MLD_DECAY_TIME = 2.592E+06 ! [s] default = 0.0 + ! The time-scale for a running-mean filter applied to the mixed-layer + ! depth used in the MLE restratification parameterization. When + ! the MLD deepens below the current running-mean the running-mean + ! is instantaneously set to the current MLD. + +! === module MOM_diag_to_Z === +!Z_OUTPUT_GRID_FILE = "analysis_vgrid_lev35.v1.nc" ! default = "" +!Z_OUTPUT_GRID_FILE = "interpolate_zgrid_40L.nc" + ! The file that specifies the vertical grid for + ! depth-space diagnostics, or blank to disable + ! depth-space output. +!NK_ZSPACE (from file) = 35 ! [nondim] + ! The number of depth-space levels. This is determined + ! from the size of the variable zw in the output grid file. + +! === module MOM_diabatic_driver === +! The following parameters are used for diabatic processes. +ENERGETICS_SFC_PBL = True ! [Boolean] default = False + ! If true, use an implied energetics planetary boundary + ! layer scheme to determine the diffusivity and viscosity + ! in the surface boundary layer. +EPBL_IS_ADDITIVE = False ! [Boolean] default = True + ! If true, the diffusivity from ePBL is added to all + ! other diffusivities. Otherwise, the larger of kappa- + ! shear and ePBL diffusivities are used. + +! === module MOM_KPP === +! This is the MOM wrapper to CVmix:KPP +! See http://code.google.com/p/cvmix/ + +! === module MOM_diffConvection === +! This module implements enhanced diffusivity as a +! function of static stability, N^2. +CONVECTION% +%CONVECTION + +! === module MOM_entrain_diffusive === + +! === module MOM_geothermal === +GEOTHERMAL_SCALE = 1.0 ! [W m-2 or various] default = 0.0 + ! The constant geothermal heat flux, a rescaling + ! factor for the heat flux read from GEOTHERMAL_FILE, or + ! 0 to disable the geothermal heating. +GEOTHERMAL_FILE = "geothermal_davies2013_v1.nc" ! default = "" + ! The file from which the geothermal heating is to be + ! read, or blank to use a constant heating rate. +GEOTHERMAL_VARNAME = "geothermal_hf" ! default = "geo_heat" + ! The name of the geothermal heating variable in + ! GEOTHERMAL_FILE. + +! === module MOM_set_diffusivity === +BBL_MIXING_AS_MAX = False ! [Boolean] default = True + ! If true, take the maximum of the diffusivity from the + ! BBL mixing and the other diffusivities. Otherwise, + ! diffusiviy from the BBL_mixing is simply added. +USE_LOTW_BBL_DIFFUSIVITY = True ! [Boolean] default = False + ! If true, uses a simple, imprecise but non-coordinate dependent, model + ! of BBL mixing diffusivity based on Law of the Wall. Otherwise, uses + ! the original BBL scheme. +SIMPLE_TKE_TO_KD = True ! [Boolean] default = False + ! If true, uses a simple estimate of Kd/TKE that will + ! work for arbitrary vertical coordinates. If false, + ! calculates Kd/TKE and bounds based on exact energetics/nfor an isopycnal layer-formulation. +HENYEY_IGW_BACKGROUND = True ! [Boolean] default = False + ! If true, use a latitude-dependent scaling for the near + ! surface background diffusivity, as described in + ! Harrison & Hallberg, JPO 2008. +N2_FLOOR_IOMEGA2 = 0.0 ! [nondim] default = 1.0 + ! The floor applied to N2(k) scaled by Omega^2: + ! If =0., N2(k) is simply positive definite. + ! If =1., N2(k) > Omega^2 everywhere. +KD = 1.5E-05 ! [m2 s-1] + ! The background diapycnal diffusivity of density in the + ! interior. Zero or the molecular value, ~1e-7 m2 s-1, + ! may be used. +KD_MIN = 2.0E-06 ! [m2 s-1] default = 1.5E-07 + ! The minimum diapycnal diffusivity. +KD_MAX = 0.1 ! [m2 s-1] default = -1.0 + ! The maximum permitted increment for the diapycnal + ! diffusivity from TKE-based parameterizations, or a + ! negative value for no limit. +INT_TIDE_DISSIPATION = True ! [Boolean] default = False + ! If true, use an internal tidal dissipation scheme to + ! drive diapycnal mixing, along the lines of St. Laurent + ! et al. (2002) and Simmons et al. (2004). +INT_TIDE_PROFILE = "POLZIN_09" ! default = "STLAURENT_02" + ! INT_TIDE_PROFILE selects the vertical profile of energy + ! dissipation with INT_TIDE_DISSIPATION. Valid values are: + ! STLAURENT_02 - Use the St. Laurent et al exponential + ! decay profile. + ! POLZIN_09 - Use the Polzin WKB-streched algebraic + ! decay profile. +INT_TIDE_DECAY_SCALE = 300.3003003003003 ! [m] default = 0.0 + ! The decay scale away from the bottom for tidal TKE with + ! the new coding when INT_TIDE_DISSIPATION is used. +KAPPA_ITIDES = 6.28319E-04 ! [m-1] default = 6.283185307179586E-04 + ! A topographic wavenumber used with INT_TIDE_DISSIPATION. + ! The default is 2pi/10 km, as in St.Laurent et al. 2002. +KAPPA_H2_FACTOR = 0.84 ! [nondim] default = 1.0 + ! A scaling factor for the roughness amplitude with nINT_TIDE_DISSIPATION. +TKE_ITIDE_MAX = 0.1 ! [W m-2] default = 1000.0 + ! The maximum internal tide energy source availble to mix + ! above the bottom boundary layer with INT_TIDE_DISSIPATION. +READ_TIDEAMP = True ! [Boolean] default = False + ! If true, read a file (given by TIDEAMP_FILE) containing + ! the tidal amplitude with INT_TIDE_DISSIPATION. +TIDEAMP_FILE = "tidal_amplitude.v20140616.nc" ! default = "tideamp.nc" + ! The path to the file containing the spatially varying + ! tidal amplitudes with INT_TIDE_DISSIPATION. +H2_FILE = "ocean_topog.nc" ! + ! The path to the file containing the sub-grid-scale + ! topographic roughness amplitude with INT_TIDE_DISSIPATION. + +! === module MOM_kappa_shear === +! Parameterization of shear-driven turbulence following Jackson, Hallberg and Legg, JPO 2008 +USE_JACKSON_PARAM = True ! [Boolean] default = False + ! If true, use the Jackson-Hallberg-Legg (JPO 2008) + ! shear mixing parameterization. +MAX_RINO_IT = 25 ! [nondim] default = 50 + ! The maximum number of iterations that may be used to + ! estimate the Richardson number driven mixing. +VERTEX_SHEAR = True ! [Boolean] default = False + ! If true, do the calculations of the shear-driven mixing + ! at the cell vertices (i.e., the vorticity points). +! === module MOM_CVMix_shear === +! Parameterization of shear-driven turbulence via CVMix (various options) + +! === module MOM_diabatic_aux === +! The following parameters are used for auxiliary diabatic processes. +RECLAIM_FRAZIL = True ! [Boolean] default = True + ! If true, try to use any frazil heat deficit to cool any + ! overlying layers down to the freezing point, thereby + ! avoiding the creation of thin ice when the SST is above + ! the freezing point. + +PRESSURE_DEPENDENT_FRAZIL = False ! [Boolean] default = False + ! If true, use a pressure dependent freezing temperature + ! when making frazil. The default is false, which will be + ! faster but is inappropriate with ice-shelf cavities. + +! === module MOM_energetic_PBL === +MSTAR_MODE = 2 ! [units=nondim] default = 0 + ! An integer switch for how to compute MSTAR. + ! 0 for constant MSTAR + ! 1 for MSTAR w/ MLD in stabilizing limit + ! 2 for MSTAR w/ L_E/L_O in stabilizing limit. +MSTAR = 0.0 ! [units=nondim] default = 1.2 + ! The ratio of the friction velocity cubed to the TKE + ! input to the mixed layer. +MIX_LEN_EXPONENT = 1.0 ! [units=nondim] default = 2.0 + ! The exponent applied to the ratio of the distance to the MLD + ! and the MLD depth which determines the shape of the mixing length. +MSTAR_CAP = 10.0 ! [units=nondim] default = -1.0 + ! Maximum value of mstar allowed in model if non-negative + ! (used if MSTAR_MODE>0). +MSTAR_CONV_ADJ = 0.667 ! [units=nondim] default = 0.0 + ! Factor used for reducing mstar during convection + ! due to reduction of stable density gradient. +MSTAR2_COEF1 = 0.29 ! [units=nondim] default = 0.3 + ! Coefficient in computing mstar when rotation and + ! stabilizing effects are both important (used if MSTAR_MODE=2) +MSTAR2_COEF2 = 0.152 ! [units=nondim] default = 0.085 + ! Coefficient in computing mstar when only rotation limits + ! the total mixing. (used only if MSTAR_MODE=2) +NSTAR = 0.06 ! [nondim] default = 0.2 + ! The portion of the buoyant potential energy imparted by + ! surface fluxes that is available to drive entrainment + ! at the base of mixed layer when that energy is positive. +TKE_DECAY = 0.01 ! [nondim] default = 2.5 + ! TKE_DECAY relates the vertical rate of decay of the + ! TKE available for mechanical entrainment to the natural + ! Ekman depth. +ML_OMEGA_FRAC = 0.001 ! [nondim] default = 0.0 + ! When setting the decay scale for turbulence, use this + ! fraction of the absolute rotation rate blended with the + ! local value of f, as sqrt((1-of)*f^2 + of*4*omega^2). +USE_MLD_ITERATION = True ! [Boolean] default = False + ! A logical that specifies whether or not to use the + ! distance to the bottom of the actively turblent boundary + ! layer to help set the EPBL length scale. +ORIG_MLD_ITERATION = False ! [Boolean] default = True + ! A logical that specifies whether or not to use the + ! old method for determining MLD depth in iteration, which + ! is limited to resolution. +EPBL_TRANSITION_SCALE = 0.01 ! [nondim] default = 0.1 + ! A scale for the mixing length in the transition layer + ! at the edge of the boundary layer as a fraction of the + ! boundary layer thickness. The default is 0.1. +USE_LA_LI2016 = True ! [nondim] default = False + ! A logical to use the Li et al. 2016 (submitted) formula to + ! determine the Langmuir number. +LT_ENHANCE = 3 ! [nondim] default = 0 + ! Integer for Langmuir number mode. + ! *Requires USE_LA_LI2016 to be set to True. + ! Options: 0 - No Langmuir + ! 1 - Van Roekel et al. 2014/Li et al., 2016 + ! 2 - Multiplied w/ adjusted La. + ! 3 - Added w/ adjusted La. +LT_ENHANCE_COEF = 0.044 ! [nondim] default = 0.447 + ! Coefficient for Langmuir enhancement if LT_ENHANCE > 1 +LT_ENHANCE_EXP = -1.5 ! [nondim] default = -1.33 + ! Exponent for Langmuir enhancement if LT_ENHANCE > 1 +LT_MOD_LAC1 = 0.0 ! [nondim] default = -0.87 + ! Coefficient for modification of Langmuir number due to + ! MLD approaching Ekman depth if LT_ENHANCE=2. +LT_MOD_LAC4 = 0.0 ! [nondim] default = 0.95 + ! Coefficient for modification of Langmuir number due to + ! ratio of Ekman to stable Obukhov depth if LT_ENHANCE=2. +LT_MOD_LAC5 = 0.22 ! [nondim] default = 0.95 + ! Coefficient for modification of Langmuir number due to + ! ratio of Ekman to unstable Obukhov depth if LT_ENHANCE=2. +EPBL_USTAR_MIN = 1.45842E-18 ! [m s-1] + ! The (tiny) minimum friction velocity used within the + ! ePBL code, derived from OMEGA and ANGSTROM. + +! === module MOM_regularize_layers === + +! === module MOM_opacity === +VAR_PEN_SW = True ! [Boolean] default = False + ! If true, use one of the CHL_A schemes specified by + ! OPACITY_SCHEME to determine the e-folding depth of + ! incoming short wave radiation. +!CHL_FILE = "seawifs_1998-2006_smoothed_2X.v20140616.nc" ! +CHL_FILE = "seawifs-clim-1997-2010.1440x1080.v20180328.nc" + ! CHL_FILE is the file containing chl_a concentrations in + ! the variable CHL_A. It is used when VAR_PEN_SW and + ! CHL_FROM_FILE are true. +CHL_VARNAME = "chlor_a" ! default = "CHL_A" +PEN_SW_NBANDS = 3 ! default = 1 + ! The number of bands of penetrating shortwave radiation. + +! === module MOM_tracer_advect === +TRACER_ADVECTION_SCHEME = "PPM:H3" ! default = "PLM" + ! The horizontal transport scheme for tracers: + ! PLM - Piecewise Linear Method + ! PPM:H3 - Piecewise Parabolic Method (Huyhn 3rd order) + ! PPM - Piecewise Parabolic Method (Colella-Woodward) + +! === module MOM_tracer_hor_diff === +CHECK_DIFFUSIVE_CFL = True ! [Boolean] default = False + ! If true, use enough iterations the diffusion to ensure + ! that the diffusive equivalent of the CFL limit is not + ! violated. If false, always use 1 iteration. + +! === module MOM_neutral_diffusion === +! This module implements neutral diffusion of tracers + +! === module ocean_model_init === +OCEAN_SURFACE_STAGGER = "A" ! default = "C" + ! A case-insensitive character string to indicate the + ! staggering of the surface velocity field that is + ! returned to the coupler. Valid values include + ! 'A', 'B', or 'C'. +ENERGYSAVEDAYS = 1.00 ! [days] default = 1.0 + ! The interval in units of TIMEUNIT between saves of the + ! energies of the run and other globally summed diagnostics. + +! === module ocean_model_init === +ICE_SHELF = False ! [Boolean] default = False + ! If true, enables the ice shelf model. +ICEBERGS_APPLY_RIGID_BOUNDARY = False ! [Boolean] default = False + ! If true, allows icebergs to change boundary condition felt by ocean + +! === module MOM_surface_forcing === +MAX_P_SURF = 0.0 ! [Pa] default = -1.0 + ! The maximum surface pressure that can be exerted by the + ! atmosphere and floating sea-ice or ice shelves. This is + ! needed because the FMS coupling structure does not + ! limit the water that can be frozen out of the ocean and + ! the ice-ocean heat fluxes are treated explicitly. No + ! limit is applied if a negative value is used. +WIND_STAGGER = "A" ! default = "C" + ! A case-insensitive character string to indicate the + ! staggering of the input wind stress field. Valid + ! values are 'A', 'B', or 'C'. +CD_TIDES = 0.0018 ! [nondim] default = 1.0E-04 + ! The drag coefficient that applies to the tides. +GUST_CONST = 0.0 ! [Pa] default = 0.02 + ! The background gustiness in the winds. +USE_RIGID_SEA_ICE = True ! [Boolean] default = False + ! If true, sea-ice is rigid enough to exert a + ! nonhydrostatic pressure that resist vertical motion. +SEA_ICE_RIGID_MASS = 100.0 ! [kg m-2] default = 1000.0 + ! The mass of sea-ice per unit area at which the sea-ice + ! starts to exhibit rigidity +LIQUID_RUNOFF_FROM_DATA = True ! [Boolean] default = False + ! If true, allows liquid river runoff to be specified via + ! the data_table using the component name 'OCN'. +! === module MOM_restart === + +! === module MOM_sum_output === +CALCULATE_APE = False ! [Boolean] default = True + ! If true, calculate the available potential energy of + ! the interfaces. Setting this to false reduces the + ! memory footprint of high-PE-count models dramatically. +MAXTRUNC = 100000 ! [truncations save_interval-1] default = 0 + ! The run will be stopped, and the day set to a very + ! large value if the velocity is truncated more than + ! MAXTRUNC times between energy saves. Set MAXTRUNC to 0 + ! to stop if there is any truncation of velocities. + +! === module MOM_file_parser === diff --git a/parm/mom6/MOM_input_025_wav b/parm/mom6/MOM_input_025_wav new file mode 100644 index 0000000000..71e077bfea --- /dev/null +++ b/parm/mom6/MOM_input_025_wav @@ -0,0 +1,912 @@ +/* This input file provides the adjustable run-time parameters for version 6 of + the Modular Ocean Model (MOM6), a numerical ocean model developed at NOAA-GFDL. + Where appropriate, parameters use usually given in MKS units. + + This particular file is for the example in OM4_025. + + This MOM_input file typically contains only the non-default values that are + needed to reproduce this example. A full list of parameters for this example + can be found in the corresponding MOM_parameter_doc.all file which is + generated by the model at run-time. */ + +! === module MOM === +USE_REGRIDDING = True ! [Boolean] default = False + ! If True, use the ALE algorithm (regridding/remapping). + ! If False, use the layered isopycnal algorithm. +THICKNESSDIFFUSE = True ! [Boolean] default = False + ! If true, interface heights are diffused with a + ! coefficient of KHTH. +THICKNESSDIFFUSE_FIRST = True ! [Boolean] default = False + ! If true, do thickness diffusion before dynamics. + ! This is only used if THICKNESSDIFFUSE is true. +DT = 900.0 ! [s] + ! The (baroclinic) dynamics time step. The time-step that + ! is actually used will be an integer fraction of the + ! forcing time-step (DT_FORCING in ocean-only mode or the + ! coupling timestep in coupled mode.) +DT_THERM = 1800.0 ! [s] default = 900.0 + ! The thermodynamic and tracer advection time step. + ! Ideally DT_THERM should be an integer multiple of DT + ! and less than the forcing or coupling time-step, unless + ! THERMO_SPANS_COUPLING is true, in which case DT_THERM + ! can be an integer multiple of the coupling timestep. By + ! default DT_THERM is set to DT. +THERMO_SPANS_COUPLING = True ! [Boolean] default = False + ! If true, the MOM will take thermodynamic and tracer + ! timesteps that can be longer than the coupling timestep. + ! The actual thermodynamic timestep that is used in this + ! case is the largest integer multiple of the coupling + ! timestep that is less than or equal to DT_THERM. +HFREEZE = 20.0 ! [m] default = -1.0 + ! If HFREEZE > 0, melt potential will be computed. The actual depth + ! over which melt potential is computed will be min(HFREEZE, OBLD) + ! where OBLD is the boundary layer depth. If HFREEZE <= 0 (default) + ! melt potential will not be computed. +FRAZIL = True ! [Boolean] default = False + ! If true, water freezes if it gets too cold, and the + ! the accumulated heat deficit is returned in the + ! surface state. FRAZIL is only used if + ! ENABLE_THERMODYNAMICS is true. +DO_GEOTHERMAL = True ! [Boolean] default = False + ! If true, apply geothermal heating. +BOUND_SALINITY = True ! [Boolean] default = False + ! If true, limit salinity to being positive. (The sea-ice + ! model may ask for more salt than is available and + ! drive the salinity negative otherwise.) +C_P = 3992.0 ! [J kg-1 K-1] default = 3991.86795711963 + ! The heat capacity of sea water, approximated as a + ! constant. This is only used if ENABLE_THERMODYNAMICS is + ! true. The default value is from the TEOS-10 definition + ! of conservative temperature. +CHECK_BAD_SURFACE_VALS = True ! [Boolean] default = False + ! If true, check the surface state for ridiculous values. +BAD_VAL_SSH_MAX = 50.0 ! [m] default = 20.0 + ! The value of SSH above which a bad value message is + ! triggered, if CHECK_BAD_SURFACE_VALS is true. +BAD_VAL_SSS_MAX = 75.0 ! [PPT] default = 45.0 + ! The value of SSS above which a bad value message is + ! triggered, if CHECK_BAD_SURFACE_VALS is true. +BAD_VAL_SST_MAX = 65.0 ! [deg C] default = 45.0, PTripp: changed from 55.0 on 12/28/2017 + ! The value of SST above which a bad value message is + ! triggered, if CHECK_BAD_SURFACE_VALS is true. +BAD_VAL_SST_MIN = -3.0 ! [deg C] default = -2.1 + ! The value of SST below which a bad value message is + ! triggered, if CHECK_BAD_SURFACE_VALS is true. +WRITE_GEOM = 2 ! default = 1 + ! If =0, never write the geometry and vertical grid files. + ! If =1, write the geometry and vertical grid files only for + ! a new simulation. If =2, always write the geometry and + ! vertical grid files. Other values are invalid. + +! === module MOM_domains === +TRIPOLAR_N = True ! [Boolean] default = False + ! Use tripolar connectivity at the northern edge of the + ! domain. With TRIPOLAR_N, NIGLOBAL must be even. +NIGLOBAL = 1440 ! + ! The total number of thickness grid points in the + ! x-direction in the physical domain. With STATIC_MEMORY_ + ! this is set in MOM_memory.h at compile time. +NJGLOBAL = 1080 ! + ! The total number of thickness grid points in the + ! y-direction in the physical domain. With STATIC_MEMORY_ + ! this is set in MOM_memory.h at compile time. + +! === module MOM_hor_index === +! Sets the horizontal array index types. + +! === module MOM_verticalGrid === +! Parameters providing information about the vertical grid. +NK = 75 ! [nondim] + ! The number of model layers. + +! === module MOM_fixed_initialization === +INPUTDIR = "INPUT" ! default = "." + ! The directory in which input files are found. + +! === module MOM_grid_init === +GRID_CONFIG = "mosaic" ! + ! A character string that determines the method for + ! defining the horizontal grid. Current options are: + ! mosaic - read the grid from a mosaic (supergrid) + ! file set by GRID_FILE. + ! cartesian - use a (flat) Cartesian grid. + ! spherical - use a simple spherical grid. + ! mercator - use a Mercator spherical grid. +GRID_FILE = "ocean_hgrid.nc" ! + ! Name of the file from which to read horizontal grid data. +TOPO_CONFIG = "file" ! + ! This specifies how bathymetry is specified: + ! file - read bathymetric information from the file + ! specified by (TOPO_FILE). + ! flat - flat bottom set to MAXIMUM_DEPTH. + ! bowl - an analytically specified bowl-shaped basin + ! ranging between MAXIMUM_DEPTH and MINIMUM_DEPTH. + ! spoon - a similar shape to 'bowl', but with an vertical + ! wall at the southern face. + ! halfpipe - a zonally uniform channel with a half-sine + ! profile in the meridional direction. + ! benchmark - use the benchmark test case topography. + ! Neverland - use the Neverland test case topography. + ! DOME - use a slope and channel configuration for the + ! DOME sill-overflow test case. + ! ISOMIP - use a slope and channel configuration for the + ! ISOMIP test case. + ! DOME2D - use a shelf and slope configuration for the + ! DOME2D gravity current/overflow test case. + ! Kelvin - flat but with rotated land mask. + ! seamount - Gaussian bump for spontaneous motion test case. + ! shelfwave - exponential slope for shelfwave test case. + ! supercritical - flat but with 8.95 degree land mask. + ! Phillips - ACC-like idealized topography used in the Phillips config. + ! dense - Denmark Strait-like dense water formation and overflow. + ! USER - call a user modified routine. +TOPO_FILE = "ocean_topog.nc" ! default = "topog.nc" + ! The file from which the bathymetry is read. +TOPO_EDITS_FILE = "All_edits.nc" ! default = "" + ! The file from which to read a list of i,j,z topography overrides. +MAXIMUM_DEPTH = 6500.0 ! [m] + ! The maximum depth of the ocean. +MINIMUM_DEPTH = 9.5 ! [m] default = 0.0 + ! If MASKING_DEPTH is unspecified, then anything shallower than + ! MINIMUM_DEPTH is assumed to be land and all fluxes are masked out. + ! If MASKING_DEPTH is specified, then all depths shallower than + ! MINIMUM_DEPTH but deeper than MASKING_DEPTH are rounded to MINIMUM_DEPTH. +GRID_ROTATION_ANGLE_BUGS = False ! [Boolean] default = True + ! If true, use an older algorithm to calculate the sine and + ! cosines needed rotate between grid-oriented directions and + ! true north and east. Differences arise at the tripolar fold +USE_TRIPOLAR_GEOLONB_BUG = False ! [Boolean] default = True + ! If true, use older code that incorrectly sets the longitude + ! in some points along the tripolar fold to be off by 360 degrees + +! === module MOM_open_boundary === +! Controls where open boundaries are located, what kind of boundary condition to impose, and what data to apply, if any. +MASKING_DEPTH = 0.0 ! [m] default = -9999.0 + ! The depth below which to mask points as land points, for which all + ! fluxes are zeroed out. MASKING_DEPTH is ignored if negative. +CHANNEL_CONFIG = "list" ! default = "none" + ! A parameter that determines which set of channels are + ! restricted to specific widths. Options are: + ! none - All channels have the grid width. + ! global_1deg - Sets 16 specific channels appropriate + ! for a 1-degree model, as used in CM2G. + ! list - Read the channel locations and widths from a + ! text file, like MOM_channel_list in the MOM_SIS + ! test case. + ! file - Read open face widths everywhere from a + ! NetCDF file on the model grid. +CHANNEL_LIST_FILE = "MOM_channels_global_025" ! default = "MOM_channel_list" + ! The file from which the list of narrowed channels is read. + +! === module MOM_tracer_registry === + +! === module MOM_EOS === +DTFREEZE_DP = -7.75E-08 ! [deg C Pa-1] default = 0.0 + ! When TFREEZE_FORM=LINEAR, + ! this is the derivative of the freezing potential + ! temperature with pressure. + +! === module MOM_restart === +PARALLEL_RESTARTFILES = True ! [Boolean] default = False + ! If true, each processor writes its own restart file, + ! otherwise a single restart file is generated + +! === module MOM_tracer_flow_control === +USE_IDEAL_AGE_TRACER = False ! [Boolean] default = False + ! If true, use the ideal_age_example tracer package. + +! === module ideal_age_example === + +! === module MOM_coord_initialization === +COORD_CONFIG = "file" ! + ! This specifies how layers are to be defined: + ! ALE or none - used to avoid defining layers in ALE mode + ! file - read coordinate information from the file + ! specified by (COORD_FILE). + ! BFB - Custom coords for buoyancy-forced basin case + ! based on SST_S, T_BOT and DRHO_DT. + ! linear - linear based on interfaces not layers + ! layer_ref - linear based on layer densities + ! ts_ref - use reference temperature and salinity + ! ts_range - use range of temperature and salinity + ! (T_REF and S_REF) to determine surface density + ! and GINT calculate internal densities. + ! gprime - use reference density (RHO_0) for surface + ! density and GINT calculate internal densities. + ! ts_profile - use temperature and salinity profiles + ! (read from COORD_FILE) to set layer densities. + ! USER - call a user modified routine. +COORD_FILE = "layer_coord.nc" ! + ! The file from which the coordinate densities are read. +REGRIDDING_COORDINATE_MODE = "HYCOM1" ! default = "LAYER" + ! Coordinate mode for vertical regridding. + ! Choose among the following possibilities: + ! LAYER - Isopycnal or stacked shallow water layers + ! ZSTAR, Z* - stetched geopotential z* + ! SIGMA_SHELF_ZSTAR - stetched geopotential z* ignoring shelf + ! SIGMA - terrain following coordinates + ! RHO - continuous isopycnal + ! HYCOM1 - HyCOM-like hybrid coordinate + ! SLIGHT - stretched coordinates above continuous isopycnal + ! ADAPTIVE - optimize for smooth neutral density surfaces +BOUNDARY_EXTRAPOLATION = True ! [Boolean] default = False + ! When defined, a proper high-order reconstruction + ! scheme is used within boundary cells rather + ! than PCM. E.g., if PPM is used for remapping, a + ! PPM reconstruction will also be used within + ! boundary cells. +ALE_COORDINATE_CONFIG = "HYBRID:hycom1_75_800m.nc,sigma2,FNC1:2,4000,4.5,.01" ! default = "UNIFORM" + ! Determines how to specify the coordinate + ! resolution. Valid options are: + ! PARAM - use the vector-parameter ALE_RESOLUTION + ! UNIFORM[:N] - uniformly distributed + ! FILE:string - read from a file. The string specifies + ! the filename and variable name, separated + ! by a comma or space, e.g. FILE:lev.nc,dz + ! or FILE:lev.nc,interfaces=zw + ! WOA09[:N] - the WOA09 vertical grid (approximately) + ! FNC1:string - FNC1:dz_min,H_total,power,precision + ! HYBRID:string - read from a file. The string specifies + ! the filename and two variable names, separated + ! by a comma or space, for sigma-2 and dz. e.g. + ! HYBRID:vgrid.nc,sigma2,dz +!ALE_RESOLUTION = 7*2.0, 2*2.01, 2.02, 2.03, 2.05, 2.08, 2.11, 2.15, 2.21, 2.2800000000000002, 2.37, 2.48, 2.61, 2.77, 2.95, 3.17, 3.4299999999999997, 3.74, 4.09, 4.49, 4.95, 5.48, 6.07, 6.74, 7.5, 8.34, 9.280000000000001, 10.33, 11.49, 12.77, 14.19, 15.74, 17.450000000000003, 19.31, 21.35, 23.56, 25.97, 28.580000000000002, 31.41, 34.47, 37.77, 41.32, 45.14, 49.25, 53.65, 58.370000000000005, 63.42, 68.81, 74.56, 80.68, 87.21000000000001, 94.14, 101.51, 109.33, 117.62, 126.4, 135.68, 145.5, 155.87, 166.81, 178.35, 190.51, 203.31, 216.78, 230.93, 245.8, 261.42, 277.83 ! [m] + ! The distribution of vertical resolution for the target + ! grid used for Eulerian-like coordinates. For example, + ! in z-coordinate mode, the parameter is a list of level + ! thicknesses (in m). In sigma-coordinate mode, the list + ! is of non-dimensional fractions of the water column. +!TARGET_DENSITIES = 1010.0, 1014.3034, 1017.8088, 1020.843, 1023.5566, 1025.813, 1027.0275, 1027.9114, 1028.6422, 1029.2795, 1029.852, 1030.3762, 1030.8626, 1031.3183, 1031.7486, 1032.1572, 1032.5471, 1032.9207, 1033.2798, 1033.6261, 1033.9608, 1034.2519, 1034.4817, 1034.6774, 1034.8508, 1035.0082, 1035.1533, 1035.2886, 1035.4159, 1035.5364, 1035.6511, 1035.7608, 1035.8661, 1035.9675, 1036.0645, 1036.1554, 1036.2411, 1036.3223, 1036.3998, 1036.4739, 1036.5451, 1036.6137, 1036.68, 1036.7441, 1036.8062, 1036.8526, 1036.8874, 1036.9164, 1036.9418, 1036.9647, 1036.9857, 1037.0052, 1037.0236, 1037.0409, 1037.0574, 1037.0738, 1037.0902, 1037.1066, 1037.123, 1037.1394, 1037.1558, 1037.1722, 1037.1887, 1037.206, 1037.2241, 1037.2435, 1037.2642, 1037.2866, 1037.3112, 1037.3389, 1037.3713, 1037.4118, 1037.475, 1037.6332, 1037.8104, 1038.0 ! [m] + ! HYBRID target densities for itnerfaces +REGRID_COMPRESSIBILITY_FRACTION = 0.01 ! [not defined] default = 0.0 + ! When interpolating potential density profiles we can add + ! some artificial compressibility solely to make homogenous + ! regions appear stratified. +MAXIMUM_INT_DEPTH_CONFIG = "FNC1:5,8000.0,1.0,.01" ! default = "NONE" + ! Determines how to specify the maximum interface depths. + ! Valid options are: + ! NONE - there are no maximum interface depths + ! PARAM - use the vector-parameter MAXIMUM_INTERFACE_DEPTHS + ! FILE:string - read from a file. The string specifies + ! the filename and variable name, separated + ! by a comma or space, e.g. FILE:lev.nc,Z + ! FNC1:string - FNC1:dz_min,H_total,power,precision +!MAXIMUM_INT_DEPTHS = 0.0, 5.0, 12.75, 23.25, 36.49, 52.480000000000004, 71.22, 92.71000000000001, 116.94000000000001, 143.92000000000002, 173.65, 206.13, 241.36, 279.33000000000004, 320.05000000000007, 363.5200000000001, 409.7400000000001, 458.7000000000001, 510.4100000000001, 564.8700000000001, 622.0800000000002, 682.0300000000002, 744.7300000000002, 810.1800000000003, 878.3800000000003, 949.3300000000004, 1023.0200000000004, 1099.4600000000005, 1178.6500000000005, 1260.5900000000006, 1345.2700000000007, 1432.7000000000007, 1522.8800000000008, 1615.8100000000009, 1711.490000000001, 1809.910000000001, 1911.080000000001, 2015.0000000000011, 2121.670000000001, 2231.080000000001, 2343.2400000000007, 2458.1500000000005, 2575.8100000000004, 2696.2200000000003, 2819.3700000000003, 2945.2700000000004, 3073.9200000000005, 3205.3200000000006, 3339.4600000000005, 3476.3500000000004, 3615.9900000000002, 3758.38, 3903.52, 4051.4, 4202.03, 4355.41, 4511.54, 4670.41, 4832.03, 4996.4, 5163.5199999999995, 5333.379999999999, 5505.989999999999, 5681.3499999999985, 5859.459999999998, 6040.319999999998, 6223.919999999998, 6410.269999999999, 6599.369999999999, 6791.219999999999, 6985.8099999999995, 7183.15, 7383.24, 7586.08, 7791.67, 8000.0 + ! The list of maximum depths for each interface. +MAX_LAYER_THICKNESS_CONFIG = "FNC1:400,31000.0,0.1,.01" ! default = "NONE" + ! Determines how to specify the maximum layer thicknesses. + ! Valid options are: + ! NONE - there are no maximum layer thicknesses + ! PARAM - use the vector-parameter MAX_LAYER_THICKNESS + ! FILE:string - read from a file. The string specifies + ! the filename and variable name, separated + ! by a comma or space, e.g. FILE:lev.nc,Z + ! FNC1:string - FNC1:dz_min,H_total,power,precision +!MAX_LAYER_THICKNESS = 400.0, 409.63, 410.32, 410.75, 411.07, 411.32, 411.52, 411.7, 411.86, 412.0, 412.13, 412.24, 412.35, 412.45, 412.54, 412.63, 412.71, 412.79, 412.86, 412.93, 413.0, 413.06, 413.12, 413.18, 413.24, 413.29, 413.34, 413.39, 413.44, 413.49, 413.54, 413.58, 413.62, 413.67, 413.71, 413.75, 413.78, 413.82, 413.86, 413.9, 413.93, 413.97, 414.0, 414.03, 414.06, 414.1, 414.13, 414.16, 414.19, 414.22, 414.24, 414.27, 414.3, 414.33, 414.35, 414.38, 414.41, 414.43, 414.46, 414.48, 414.51, 414.53, 414.55, 414.58, 414.6, 414.62, 414.65, 414.67, 414.69, 414.71, 414.73, 414.75, 414.77, 414.79, 414.83 ! [m] + ! The list of maximum thickness for each layer. +REMAPPING_SCHEME = "PPM_H4" ! default = "PLM" + ! This sets the reconstruction scheme used + ! for vertical remapping for all variables. + ! It can be one of the following schemes: + ! PCM (1st-order accurate) + ! PLM (2nd-order accurate) + ! PPM_H4 (3rd-order accurate) + ! PPM_IH4 (3rd-order accurate) + ! PQM_IH4IH3 (4th-order accurate) + ! PQM_IH6IH5 (5th-order accurate) + +! === module MOM_grid === +! Parameters providing information about the lateral grid. + +! === module MOM_state_initialization === +INIT_LAYERS_FROM_Z_FILE = True ! [Boolean] default = False + ! If true, intialize the layer thicknesses, temperatures, + ! and salnities from a Z-space file on a latitude- + ! longitude grid. + +! === module MOM_initialize_layers_from_Z === +!TEMP_SALT_Z_INIT_FILE = "WOA05_pottemp_salt.nc" ! default = "temp_salt_z.nc" +TEMP_SALT_Z_INIT_FILE = "MOM6_IC_TS.nc" + ! The name of the z-space input file used to initialize + ! temperatures (T) and salinities (S). If T and S are not + ! in the same file, TEMP_Z_INIT_FILE and SALT_Z_INIT_FILE + ! must be set. +Z_INIT_FILE_PTEMP_VAR = "temp" ! default = "ptemp" + ! The name of the potential temperature variable in + ! TEMP_Z_INIT_FILE. +Z_INIT_FILE_SALT_VAR = "salt" ! default = "salt" + ! The name of the salinity variable in + ! SALT_Z_INIT_FILE. +Z_INIT_ALE_REMAPPING = True ! [Boolean] default = False + ! If True, then remap straight to model coordinate from file. + +! === module MOM_diag_mediator === +!Jiande NUM_DIAG_COORDS = 2 ! default = 1 +NUM_DIAG_COORDS = 1 + ! The number of diagnostic vertical coordinates to use. + ! For each coordinate, an entry in DIAG_COORDS must be provided. +!Jiande DIAG_COORDS = "z Z ZSTAR", "rho2 RHO2 RHO" ! +DIAG_COORDS = "z Z ZSTAR" + ! A list of string tuples associating diag_table modules to + ! a coordinate definition used for diagnostics. Each string + ! is of the form "MODULE_SUFFIX,PARAMETER_SUFFIX,COORDINATE_NAME". +DIAG_COORD_DEF_Z="FILE:interpolate_zgrid_40L.nc,interfaces=zw" +DIAG_MISVAL = -1e34 +!Jiande DIAG_COORD_DEF_RHO2 = "RFNC1:35,999.5,1028,1028.5,8.,1038.,0.0078125" ! default = "WOA09" + ! Determines how to specify the coordinate + ! resolution. Valid options are: + ! PARAM - use the vector-parameter DIAG_COORD_RES_RHO2 + ! UNIFORM[:N] - uniformly distributed + ! FILE:string - read from a file. The string specifies + ! the filename and variable name, separated + ! by a comma or space, e.g. FILE:lev.nc,dz + ! or FILE:lev.nc,interfaces=zw + ! WOA09[:N] - the WOA09 vertical grid (approximately) + ! FNC1:string - FNC1:dz_min,H_total,power,precision + ! HYBRID:string - read from a file. The string specifies + ! the filename and two variable names, separated + ! by a comma or space, for sigma-2 and dz. e.g. + ! HYBRID:vgrid.nc,sigma2,dz + +! === module MOM_MEKE === +USE_MEKE = True ! [Boolean] default = False + ! If true, turns on the MEKE scheme which calculates + ! a sub-grid mesoscale eddy kinetic energy budget. +MEKE_GMCOEFF = 1.0 ! [nondim] default = -1.0 + ! The efficiency of the conversion of potential energy + ! into MEKE by the thickness mixing parameterization. + ! If MEKE_GMCOEFF is negative, this conversion is not + ! used or calculated. +MEKE_BGSRC = 1.0E-13 ! [W kg-1] default = 0.0 + ! A background energy source for MEKE. +MEKE_KHMEKE_FAC = 1.0 ! [nondim] default = 0.0 + ! A factor that maps MEKE%Kh to Kh for MEKE itself. +MEKE_ALPHA_RHINES = 0.15 ! [nondim] default = 0.05 + ! If positive, is a coefficient weighting the Rhines scale + ! in the expression for mixing length used in MEKE-derived diffusiviity. +MEKE_ALPHA_EADY = 0.15 ! [nondim] default = 0.05 + ! If positive, is a coefficient weighting the Eady length scale + ! in the expression for mixing length used in MEKE-derived diffusiviity. + +! === module MOM_lateral_mixing_coeffs === +USE_VARIABLE_MIXING = True ! [Boolean] default = False + ! If true, the variable mixing code will be called. This + ! allows diagnostics to be created even if the scheme is + ! not used. If KHTR_SLOPE_CFF>0 or KhTh_Slope_Cff>0, + ! this is set to true regardless of what is in the + ! parameter file. +RESOLN_SCALED_KH = True ! [Boolean] default = False + ! If true, the Laplacian lateral viscosity is scaled away + ! when the first baroclinic deformation radius is well + ! resolved. +RESOLN_SCALED_KHTH = True ! [Boolean] default = False + ! If true, the interface depth diffusivity is scaled away + ! when the first baroclinic deformation radius is well + ! resolved. +KHTR_SLOPE_CFF = 0.25 ! [nondim] default = 0.0 + ! The nondimensional coefficient in the Visbeck formula + ! for the epipycnal tracer diffusivity +USE_STORED_SLOPES = True ! [Boolean] default = False + ! If true, the isopycnal slopes are calculated once and + ! stored for re-use. This uses more memory but avoids calling + ! the equation of state more times than should be necessary. +INTERPOLATE_RES_FN = False ! [Boolean] default = True + ! If true, interpolate the resolution function to the + ! velocity points from the thickness points; otherwise + ! interpolate the wave speed and calculate the resolution + ! function independently at each point. +GILL_EQUATORIAL_LD = True ! [Boolean] default = False + ! If true, uses Gill's definition of the baroclinic + ! equatorial deformation radius, otherwise, if false, use + ! Pedlosky's definition. These definitions differ by a factor + ! of 2 infront of the beta term in the denominator. Gill'sis the more appropriate definition. + +! === module MOM_set_visc === +CHANNEL_DRAG = True ! [Boolean] default = False + ! If true, the bottom drag is exerted directly on each + ! layer proportional to the fraction of the bottom it + ! overlies. +PRANDTL_TURB = 1.25 ! [nondim] default = 1.0 + ! The turbulent Prandtl number applied to shear + ! instability. +HBBL = 10.0 ! [m] + ! The thickness of a bottom boundary layer with a + ! viscosity of KVBBL if BOTTOMDRAGLAW is not defined, or + ! the thickness over which near-bottom velocities are + ! averaged for the drag law if BOTTOMDRAGLAW is defined + ! but LINEAR_DRAG is not. +DRAG_BG_VEL = 0.1 ! [m s-1] default = 0.0 + ! DRAG_BG_VEL is either the assumed bottom velocity (with + ! LINEAR_DRAG) or an unresolved velocity that is + ! combined with the resolved velocity to estimate the + ! velocity magnitude. DRAG_BG_VEL is only used when + ! BOTTOMDRAGLAW is defined. +BBL_USE_EOS = True ! [Boolean] default = False + ! If true, use the equation of state in determining the + ! properties of the bottom boundary layer. Otherwise use + ! the layer target potential densities. +BBL_THICK_MIN = 0.1 ! [m] default = 0.0 + ! The minimum bottom boundary layer thickness that can be + ! used with BOTTOMDRAGLAW. This might be + ! Kv / (cdrag * drag_bg_vel) to give Kv as the minimum + ! near-bottom viscosity. +KV = 1.0E-04 ! [m2 s-1] + ! The background kinematic viscosity in the interior. + ! The molecular value, ~1e-6 m2 s-1, may be used. +KV_BBL_MIN = 0.0 ! [m2 s-1] default = 1.0E-04 + ! The minimum viscosities in the bottom boundary layer. +KV_TBL_MIN = 0.0 ! [m2 s-1] default = 1.0E-04 + ! The minimum viscosities in the top boundary layer. + +! === module MOM_continuity === + +! === module MOM_continuity_PPM === +ETA_TOLERANCE = 1.0E-06 ! [m] default = 3.75E-09 + ! The tolerance for the differences between the + ! barotropic and baroclinic estimates of the sea surface + ! height due to the fluxes through each face. The total + ! tolerance for SSH is 4 times this value. The default + ! is 0.5*NK*ANGSTROM, and this should not be set less x + ! than about 10^-15*MAXIMUM_DEPTH. +ETA_TOLERANCE_AUX = 0.001 ! [m] default = 1.0E-06 + ! The tolerance for free-surface height discrepancies + ! between the barotropic solution and the sum of the + ! layer thicknesses when calculating the auxiliary + ! corrected velocities. By default, this is the same as + ! ETA_TOLERANCE, but can be made larger for efficiency. + +! === module MOM_CoriolisAdv === +CORIOLIS_SCHEME = "SADOURNY75_ENSTRO" ! default = "SADOURNY75_ENERGY" + ! CORIOLIS_SCHEME selects the discretization for the + ! Coriolis terms. Valid values are: + ! SADOURNY75_ENERGY - Sadourny, 1975; energy cons. + ! ARAKAWA_HSU90 - Arakawa & Hsu, 1990 + ! SADOURNY75_ENSTRO - Sadourny, 1975; enstrophy cons. + ! ARAKAWA_LAMB81 - Arakawa & Lamb, 1981; En. + Enst. + ! ARAKAWA_LAMB_BLEND - A blend of Arakawa & Lamb with + ! Arakawa & Hsu and Sadourny energy +BOUND_CORIOLIS = True ! [Boolean] default = False + ! If true, the Coriolis terms at u-points are bounded by + ! the four estimates of (f+rv)v from the four neighboring + ! v-points, and similarly at v-points. This option would + ! have no effect on the SADOURNY Coriolis scheme if it + ! were possible to use centered difference thickness fluxes. + +! === module MOM_PressureForce === + +! === module MOM_PressureForce_AFV === +MASS_WEIGHT_IN_PRESSURE_GRADIENT = True ! [Boolean] default = False + ! If true, use mass weighting when interpolation T/S for + ! top/bottom integrals in AFV pressure gradient calculation. + +! === module MOM_hor_visc === +LAPLACIAN = True ! [Boolean] default = False + ! If true, use a Laplacian horizontal viscosity. +AH_VEL_SCALE = 0.01 ! [m s-1] default = 0.0 + ! The velocity scale which is multiplied by the cube of + ! the grid spacing to calculate the biharmonic viscosity. + ! The final viscosity is the largest of this scaled + ! viscosity, the Smagorinsky and Leith viscosities, and AH. +SMAGORINSKY_AH = True ! [Boolean] default = False + ! If true, use a biharmonic Smagorinsky nonlinear eddy + ! viscosity. +SMAG_BI_CONST = 0.06 ! [nondim] default = 0.0 + ! The nondimensional biharmonic Smagorinsky constant, + ! typically 0.015 - 0.06. + +! === module MOM_vert_friction === +U_TRUNC_FILE = "U_velocity_truncations" ! default = "" + ! The absolute path to a file into which the accelerations + ! leading to zonal velocity truncations are written. + ! Undefine this for efficiency if this diagnostic is not + ! needed. +V_TRUNC_FILE = "V_velocity_truncations" ! default = "" + ! The absolute path to a file into which the accelerations + ! leading to meridional velocity truncations are written. + ! Undefine this for efficiency if this diagnostic is not + ! needed. +HMIX_FIXED = 0.5 ! [m] + ! The prescribed depth over which the near-surface + ! viscosity and diffusivity are elevated when the bulk + ! mixed layer is not used. +MAXVEL = 6.0 ! [m s-1] default = 3.0E+08 + ! The maximum velocity allowed before the velocity + ! components are truncated. + +! === module MOM_PointAccel === + +! === module MOM_barotropic === +BOUND_BT_CORRECTION = True ! [Boolean] default = False + ! If true, the corrective pseudo mass-fluxes into the + ! barotropic solver are limited to values that require + ! less than maxCFL_BT_cont to be accommodated. +BT_PROJECT_VELOCITY = True ! [Boolean] default = False + ! If true, step the barotropic velocity first and project + ! out the velocity tendancy by 1+BEBT when calculating the + ! transport. The default (false) is to use a predictor + ! continuity step to find the pressure field, and then + ! to do a corrector continuity step using a weighted + ! average of the old and new velocities, with weights + ! of (1-BEBT) and BEBT. +DYNAMIC_SURFACE_PRESSURE = True ! [Boolean] default = False + ! If true, add a dynamic pressure due to a viscous ice + ! shelf, for instance. +BEBT = 0.2 ! [nondim] default = 0.1 + ! BEBT determines whether the barotropic time stepping + ! uses the forward-backward time-stepping scheme or a + ! backward Euler scheme. BEBT is valid in the range from + ! 0 (for a forward-backward treatment of nonrotating + ! gravity waves) to 1 (for a backward Euler treatment). + ! In practice, BEBT must be greater than about 0.05. +DTBT = -0.9 ! [s or nondim] default = -0.98 + ! The barotropic time step, in s. DTBT is only used with + ! the split explicit time stepping. To set the time step + ! automatically based the maximum stable value use 0, or + ! a negative value gives the fraction of the stable value. + ! Setting DTBT to 0 is the same as setting it to -0.98. + ! The value of DTBT that will actually be used is an + ! integer fraction of DT, rounding down. +BT_USE_OLD_CORIOLIS_BRACKET_BUG = True ! [Boolean] default = False + ! If True, use an order of operations that is not bitwise + ! rotationally symmetric in the meridional Coriolis term of + ! the barotropic solver. + +! === module MOM_thickness_diffuse === +KHTH_MAX_CFL = 0.1 ! [nondimensional] default = 0.8 + ! The maximum value of the local diffusive CFL ratio that + ! is permitted for the thickness diffusivity. 1.0 is the + ! marginally unstable value in a pure layered model, but + ! much smaller numbers (e.g. 0.1) seem to work better for + ! ALE-based models. + +! === module MOM_mixed_layer_restrat === +MIXEDLAYER_RESTRAT = True ! [Boolean] default = False + ! If true, a density-gradient dependent re-stratifying + ! flow is imposed in the mixed layer. Can be used in ALE mode + ! without restriction but in layer mode can only be used if + ! BULKMIXEDLAYER is true. +FOX_KEMPER_ML_RESTRAT_COEF = 1.0 ! [nondim] default = 0.0 + ! A nondimensional coefficient that is proportional to + ! the ratio of the deformation radius to the dominant + ! lengthscale of the submesoscale mixed layer + ! instabilities, times the minimum of the ratio of the + ! mesoscale eddy kinetic energy to the large-scale + ! geostrophic kinetic energy or 1 plus the square of the + ! grid spacing over the deformation radius, as detailed + ! by Fox-Kemper et al. (2010) +MLE_FRONT_LENGTH = 500.0 ! [m] default = 0.0 + ! If non-zero, is the frontal-length scale used to calculate the + ! upscaling of buoyancy gradients that is otherwise represented + ! by the parameter FOX_KEMPER_ML_RESTRAT_COEF. If MLE_FRONT_LENGTH is + ! non-zero, it is recommended to set FOX_KEMPER_ML_RESTRAT_COEF=1.0. +MLE_USE_PBL_MLD = True ! [Boolean] default = False + ! If true, the MLE parameterization will use the mixed-layer + ! depth provided by the active PBL parameterization. If false, + ! MLE will estimate a MLD based on a density difference with the + ! surface using the parameter MLE_DENSITY_DIFF. +MLE_MLD_DECAY_TIME = 2.592E+06 ! [s] default = 0.0 + ! The time-scale for a running-mean filter applied to the mixed-layer + ! depth used in the MLE restratification parameterization. When + ! the MLD deepens below the current running-mean the running-mean + ! is instantaneously set to the current MLD. + +! === module MOM_diag_to_Z === +!Z_OUTPUT_GRID_FILE = "analysis_vgrid_lev35.v1.nc" ! default = "" +!Z_OUTPUT_GRID_FILE = "interpolate_zgrid_40L.nc" + ! The file that specifies the vertical grid for + ! depth-space diagnostics, or blank to disable + ! depth-space output. +!NK_ZSPACE (from file) = 35 ! [nondim] + ! The number of depth-space levels. This is determined + ! from the size of the variable zw in the output grid file. + +! === module MOM_diabatic_driver === +! The following parameters are used for diabatic processes. +ENERGETICS_SFC_PBL = True ! [Boolean] default = False + ! If true, use an implied energetics planetary boundary + ! layer scheme to determine the diffusivity and viscosity + ! in the surface boundary layer. +EPBL_IS_ADDITIVE = False ! [Boolean] default = True + ! If true, the diffusivity from ePBL is added to all + ! other diffusivities. Otherwise, the larger of kappa- + ! shear and ePBL diffusivities are used. + +! === module MOM_KPP === +! This is the MOM wrapper to CVmix:KPP +! See http://code.google.com/p/cvmix/ + +! === module MOM_diffConvection === +! This module implements enhanced diffusivity as a +! function of static stability, N^2. +CONVECTION% +%CONVECTION + +! === module MOM_entrain_diffusive === + +! === module MOM_geothermal === +GEOTHERMAL_SCALE = 1.0 ! [W m-2 or various] default = 0.0 + ! The constant geothermal heat flux, a rescaling + ! factor for the heat flux read from GEOTHERMAL_FILE, or + ! 0 to disable the geothermal heating. +GEOTHERMAL_FILE = "geothermal_davies2013_v1.nc" ! default = "" + ! The file from which the geothermal heating is to be + ! read, or blank to use a constant heating rate. +GEOTHERMAL_VARNAME = "geothermal_hf" ! default = "geo_heat" + ! The name of the geothermal heating variable in + ! GEOTHERMAL_FILE. + +! === module MOM_set_diffusivity === +BBL_MIXING_AS_MAX = False ! [Boolean] default = True + ! If true, take the maximum of the diffusivity from the + ! BBL mixing and the other diffusivities. Otherwise, + ! diffusiviy from the BBL_mixing is simply added. +USE_LOTW_BBL_DIFFUSIVITY = True ! [Boolean] default = False + ! If true, uses a simple, imprecise but non-coordinate dependent, model + ! of BBL mixing diffusivity based on Law of the Wall. Otherwise, uses + ! the original BBL scheme. +SIMPLE_TKE_TO_KD = True ! [Boolean] default = False + ! If true, uses a simple estimate of Kd/TKE that will + ! work for arbitrary vertical coordinates. If false, + ! calculates Kd/TKE and bounds based on exact energetics/nfor an isopycnal layer-formulation. +HENYEY_IGW_BACKGROUND = True ! [Boolean] default = False + ! If true, use a latitude-dependent scaling for the near + ! surface background diffusivity, as described in + ! Harrison & Hallberg, JPO 2008. +N2_FLOOR_IOMEGA2 = 0.0 ! [nondim] default = 1.0 + ! The floor applied to N2(k) scaled by Omega^2: + ! If =0., N2(k) is simply positive definite. + ! If =1., N2(k) > Omega^2 everywhere. +KD = 1.5E-05 ! [m2 s-1] + ! The background diapycnal diffusivity of density in the + ! interior. Zero or the molecular value, ~1e-7 m2 s-1, + ! may be used. +KD_MIN = 2.0E-06 ! [m2 s-1] default = 1.5E-07 + ! The minimum diapycnal diffusivity. +KD_MAX = 0.1 ! [m2 s-1] default = -1.0 + ! The maximum permitted increment for the diapycnal + ! diffusivity from TKE-based parameterizations, or a + ! negative value for no limit. +INT_TIDE_DISSIPATION = True ! [Boolean] default = False + ! If true, use an internal tidal dissipation scheme to + ! drive diapycnal mixing, along the lines of St. Laurent + ! et al. (2002) and Simmons et al. (2004). +INT_TIDE_PROFILE = "POLZIN_09" ! default = "STLAURENT_02" + ! INT_TIDE_PROFILE selects the vertical profile of energy + ! dissipation with INT_TIDE_DISSIPATION. Valid values are: + ! STLAURENT_02 - Use the St. Laurent et al exponential + ! decay profile. + ! POLZIN_09 - Use the Polzin WKB-streched algebraic + ! decay profile. +INT_TIDE_DECAY_SCALE = 300.3003003003003 ! [m] default = 0.0 + ! The decay scale away from the bottom for tidal TKE with + ! the new coding when INT_TIDE_DISSIPATION is used. +KAPPA_ITIDES = 6.28319E-04 ! [m-1] default = 6.283185307179586E-04 + ! A topographic wavenumber used with INT_TIDE_DISSIPATION. + ! The default is 2pi/10 km, as in St.Laurent et al. 2002. +KAPPA_H2_FACTOR = 0.84 ! [nondim] default = 1.0 + ! A scaling factor for the roughness amplitude with nINT_TIDE_DISSIPATION. +TKE_ITIDE_MAX = 0.1 ! [W m-2] default = 1000.0 + ! The maximum internal tide energy source availble to mix + ! above the bottom boundary layer with INT_TIDE_DISSIPATION. +READ_TIDEAMP = True ! [Boolean] default = False + ! If true, read a file (given by TIDEAMP_FILE) containing + ! the tidal amplitude with INT_TIDE_DISSIPATION. +TIDEAMP_FILE = "tidal_amplitude.v20140616.nc" ! default = "tideamp.nc" + ! The path to the file containing the spatially varying + ! tidal amplitudes with INT_TIDE_DISSIPATION. +H2_FILE = "ocean_topog.nc" ! + ! The path to the file containing the sub-grid-scale + ! topographic roughness amplitude with INT_TIDE_DISSIPATION. + +! === module MOM_kappa_shear === +! Parameterization of shear-driven turbulence following Jackson, Hallberg and Legg, JPO 2008 +USE_JACKSON_PARAM = True ! [Boolean] default = False + ! If true, use the Jackson-Hallberg-Legg (JPO 2008) + ! shear mixing parameterization. +MAX_RINO_IT = 25 ! [nondim] default = 50 + ! The maximum number of iterations that may be used to + ! estimate the Richardson number driven mixing. +VERTEX_SHEAR = True ! [Boolean] default = False + ! If true, do the calculations of the shear-driven mixing + ! at the cell vertices (i.e., the vorticity points). +! === module MOM_CVMix_shear === +! Parameterization of shear-driven turbulence via CVMix (various options) + +! === module MOM_diabatic_aux === +! The following parameters are used for auxiliary diabatic processes. +RECLAIM_FRAZIL = True ! [Boolean] default = True + ! If true, try to use any frazil heat deficit to cool any + ! overlying layers down to the freezing point, thereby + ! avoiding the creation of thin ice when the SST is above + ! the freezing point. + +PRESSURE_DEPENDENT_FRAZIL = False ! [Boolean] default = False + ! If true, use a pressure dependent freezing temperature + ! when making frazil. The default is false, which will be + ! faster but is inappropriate with ice-shelf cavities. + +! === module MOM_energetic_PBL === +MSTAR_MODE = 2 ! [units=nondim] default = 0 + ! An integer switch for how to compute MSTAR. + ! 0 for constant MSTAR + ! 1 for MSTAR w/ MLD in stabilizing limit + ! 2 for MSTAR w/ L_E/L_O in stabilizing limit. +MSTAR = 0.0 ! [units=nondim] default = 1.2 + ! The ratio of the friction velocity cubed to the TKE + ! input to the mixed layer. +MIX_LEN_EXPONENT = 1.0 ! [units=nondim] default = 2.0 + ! The exponent applied to the ratio of the distance to the MLD + ! and the MLD depth which determines the shape of the mixing length. +MSTAR_CAP = 10.0 ! [units=nondim] default = -1.0 + ! Maximum value of mstar allowed in model if non-negative + ! (used if MSTAR_MODE>0). +MSTAR_CONV_ADJ = 0.667 ! [units=nondim] default = 0.0 + ! Factor used for reducing mstar during convection + ! due to reduction of stable density gradient. +MSTAR2_COEF1 = 0.29 ! [units=nondim] default = 0.3 + ! Coefficient in computing mstar when rotation and + ! stabilizing effects are both important (used if MSTAR_MODE=2) +MSTAR2_COEF2 = 0.152 ! [units=nondim] default = 0.085 + ! Coefficient in computing mstar when only rotation limits + ! the total mixing. (used only if MSTAR_MODE=2) +NSTAR = 0.06 ! [nondim] default = 0.2 + ! The portion of the buoyant potential energy imparted by + ! surface fluxes that is available to drive entrainment + ! at the base of mixed layer when that energy is positive. +TKE_DECAY = 0.01 ! [nondim] default = 2.5 + ! TKE_DECAY relates the vertical rate of decay of the + ! TKE available for mechanical entrainment to the natural + ! Ekman depth. +ML_OMEGA_FRAC = 0.001 ! [nondim] default = 0.0 + ! When setting the decay scale for turbulence, use this + ! fraction of the absolute rotation rate blended with the + ! local value of f, as sqrt((1-of)*f^2 + of*4*omega^2). +USE_MLD_ITERATION = True ! [Boolean] default = False + ! A logical that specifies whether or not to use the + ! distance to the bottom of the actively turblent boundary + ! layer to help set the EPBL length scale. +ORIG_MLD_ITERATION = False ! [Boolean] default = True + ! A logical that specifies whether or not to use the + ! old method for determining MLD depth in iteration, which + ! is limited to resolution. +EPBL_TRANSITION_SCALE = 0.01 ! [nondim] default = 0.1 + ! A scale for the mixing length in the transition layer + ! at the edge of the boundary layer as a fraction of the + ! boundary layer thickness. The default is 0.1. +USE_LA_LI2016 = True ! [nondim] default = False + ! A logical to use the Li et al. 2016 (submitted) formula to + ! determine the Langmuir number. +LT_ENHANCE = 3 ! [nondim] default = 0 + ! Integer for Langmuir number mode. + ! *Requires USE_LA_LI2016 to be set to True. + ! Options: 0 - No Langmuir + ! 1 - Van Roekel et al. 2014/Li et al., 2016 + ! 2 - Multiplied w/ adjusted La. + ! 3 - Added w/ adjusted La. +USE_WAVES = True ! [Boolean] default = False + ! If true, enables surface wave modules. +WAVE_METHOD = "SURFACE_BANDS" ! default = "EMPTY" + ! Choice of wave method, valid options include: + ! TEST_PROFILE - Prescribed from surface Stokes drift + ! and a decay wavelength. + ! SURFACE_BANDS - Computed from multiple surface values + ! and decay wavelengths. + ! DHH85 - Uses Donelan et al. 1985 empirical + ! wave spectrum with prescribed values. + ! LF17 - Infers Stokes drift profile from wind + ! speed following Li and Fox-Kemper 2017. +SURFBAND_SOURCE = "COUPLER" ! default = "EMPTY" + ! Choice of SURFACE_BANDS data mode, valid options include: + ! DATAOVERRIDE - Read from NetCDF using FMS DataOverride. + ! COUPLER - Look for variables from coupler pass + ! INPUT - Testing with fixed values. +STK_BAND_COUPLER = 3 ! default = 1 + ! STK_BAND_COUPLER is the number of Stokes drift bands in the coupler. This has + ! to be consistent with the number of Stokes drift bands in WW3, or the model + ! will fail. +SURFBAND_WAVENUMBERS = 0.04, 0.11, 0.3305 ! [rad/m] default = 0.12566 + ! Central wavenumbers for surface Stokes drift bands. +LT_ENHANCE_COEF = 0.044 ! [nondim] default = 0.447 + ! Coefficient for Langmuir enhancement if LT_ENHANCE > 1 +LT_ENHANCE_EXP = -1.5 ! [nondim] default = -1.33 + ! Exponent for Langmuir enhancement if LT_ENHANCE > 1 +LT_MOD_LAC1 = 0.0 ! [nondim] default = -0.87 + ! Coefficient for modification of Langmuir number due to + ! MLD approaching Ekman depth if LT_ENHANCE=2. +LT_MOD_LAC4 = 0.0 ! [nondim] default = 0.95 + ! Coefficient for modification of Langmuir number due to + ! ratio of Ekman to stable Obukhov depth if LT_ENHANCE=2. +LT_MOD_LAC5 = 0.22 ! [nondim] default = 0.95 + ! Coefficient for modification of Langmuir number due to + ! ratio of Ekman to unstable Obukhov depth if LT_ENHANCE=2. +EPBL_USTAR_MIN = 1.45842E-18 ! [m s-1] + ! The (tiny) minimum friction velocity used within the + ! ePBL code, derived from OMEGA and ANGSTROM. + +! === module MOM_regularize_layers === + +! === module MOM_opacity === +VAR_PEN_SW = True ! [Boolean] default = False + ! If true, use one of the CHL_A schemes specified by + ! OPACITY_SCHEME to determine the e-folding depth of + ! incoming short wave radiation. +!CHL_FILE = "seawifs_1998-2006_smoothed_2X.v20140616.nc" ! +CHL_FILE = "seawifs-clim-1997-2010.1440x1080.v20180328.nc" + ! CHL_FILE is the file containing chl_a concentrations in + ! the variable CHL_A. It is used when VAR_PEN_SW and + ! CHL_FROM_FILE are true. +CHL_VARNAME = "chlor_a" ! default = "CHL_A" +PEN_SW_NBANDS = 3 ! default = 1 + ! The number of bands of penetrating shortwave radiation. + +! === module MOM_tracer_advect === +TRACER_ADVECTION_SCHEME = "PPM:H3" ! default = "PLM" + ! The horizontal transport scheme for tracers: + ! PLM - Piecewise Linear Method + ! PPM:H3 - Piecewise Parabolic Method (Huyhn 3rd order) + ! PPM - Piecewise Parabolic Method (Colella-Woodward) + +! === module MOM_tracer_hor_diff === +CHECK_DIFFUSIVE_CFL = True ! [Boolean] default = False + ! If true, use enough iterations the diffusion to ensure + ! that the diffusive equivalent of the CFL limit is not + ! violated. If false, always use 1 iteration. + +! === module MOM_neutral_diffusion === +! This module implements neutral diffusion of tracers + +! === module ocean_model_init === +OCEAN_SURFACE_STAGGER = "A" ! default = "C" + ! A case-insensitive character string to indicate the + ! staggering of the surface velocity field that is + ! returned to the coupler. Valid values include + ! 'A', 'B', or 'C'. +ENERGYSAVEDAYS = 1.00 ! [days] default = 1.0 + ! The interval in units of TIMEUNIT between saves of the + ! energies of the run and other globally summed diagnostics. + +! === module ocean_model_init === +ICE_SHELF = False ! [Boolean] default = False + ! If true, enables the ice shelf model. +ICEBERGS_APPLY_RIGID_BOUNDARY = False ! [Boolean] default = False + ! If true, allows icebergs to change boundary condition felt by ocean + +! === module MOM_surface_forcing === +MAX_P_SURF = 0.0 ! [Pa] default = -1.0 + ! The maximum surface pressure that can be exerted by the + ! atmosphere and floating sea-ice or ice shelves. This is + ! needed because the FMS coupling structure does not + ! limit the water that can be frozen out of the ocean and + ! the ice-ocean heat fluxes are treated explicitly. No + ! limit is applied if a negative value is used. +WIND_STAGGER = "A" ! default = "C" + ! A case-insensitive character string to indicate the + ! staggering of the input wind stress field. Valid + ! values are 'A', 'B', or 'C'. +CD_TIDES = 0.0018 ! [nondim] default = 1.0E-04 + ! The drag coefficient that applies to the tides. +GUST_CONST = 0.0 ! [Pa] default = 0.02 + ! The background gustiness in the winds. +USE_RIGID_SEA_ICE = True ! [Boolean] default = False + ! If true, sea-ice is rigid enough to exert a + ! nonhydrostatic pressure that resist vertical motion. +SEA_ICE_RIGID_MASS = 100.0 ! [kg m-2] default = 1000.0 + ! The mass of sea-ice per unit area at which the sea-ice + ! starts to exhibit rigidity +LIQUID_RUNOFF_FROM_DATA = True ! [Boolean] default = False + ! If true, allows liquid river runoff to be specified via + ! the data_table using the component name 'OCN'. +! === module MOM_restart === + +! === module MOM_sum_output === +CALCULATE_APE = False ! [Boolean] default = True + ! If true, calculate the available potential energy of + ! the interfaces. Setting this to false reduces the + ! memory footprint of high-PE-count models dramatically. +MAXTRUNC = 100000 ! [truncations save_interval-1] default = 0 + ! The run will be stopped, and the day set to a very + ! large value if the velocity is truncated more than + ! MAXTRUNC times between energy saves. Set MAXTRUNC to 0 + ! to stop if there is any truncation of velocities. + +! === module MOM_file_parser === diff --git a/parm/parm_fv3diag/diag_table_cpl b/parm/parm_fv3diag/diag_table_cpl index 1c55bcf9dd..06ad741978 100644 --- a/parm/parm_fv3diag/diag_table_cpl +++ b/parm/parm_fv3diag/diag_table_cpl @@ -8,7 +8,8 @@ "fv3_history2d", 0, "hours", 1, "hours", "time" ###################### "ocn%4yr%2mo%2dy%2hr", 6, "hours", 1, "hours", "time", 6, "hours", "1901 1 1 0 0 0" -"SST%4yr%2mo%2dy", 1, "days", 1, "days", "time", 1, "days", "1901 1 1 0 0 0" +"ocn_daily%4yr%2mo%2dy", 1, "days", 1, "days", "time", 1, "days", "1901 1 1 0 0 0" +"wavocn%4yr%2mo%2dy%2hr", 6, "hours", 1, "hours", "time", 6, "hours", "1901 1 1 0 0 0" ############################################## # static fields "ocean_model", "geolon", "geolon", "ocn%4yr%2mo%2dy%2hr", "all", .false., "none", 2 @@ -40,9 +41,23 @@ "ocean_model", "MLD_0125", "MLD_0125", "ocn%4yr%2mo%2dy%2hr","all",.true.,"none",2 # save daily SST - "ocean_model", "geolon", "geolon", "SST%4yr%2mo%2dy", "all", .false., "none", 2 - "ocean_model", "geolat", "geolat", "SST%4yr%2mo%2dy", "all", .false., "none", 2 - "ocean_model", "SST", "sst", "SST%4yr%2mo%2dy", "all", .true., "none", 2 + "ocean_model", "geolon", "geolon", "ocn_daily%4yr%2mo%2dy", "all", .false., "none", 2 + "ocean_model", "geolat", "geolat", "ocn_daily%4yr%2mo%2dy", "all", .false., "none", 2 + "ocean_model", "geolon_c", "geolon_c", "ocn_daily%4yr%2mo%2dy", "all", .false., "none", 2 + "ocean_model", "geolat_c", "geolat_c", "ocn_daily%4yr%2mo%2dy", "all", .false., "none", 2 + "ocean_model", "geolon_u", "geolon_u", "ocn_daily%4yr%2mo%2dy", "all", .false., "none", 2 + "ocean_model", "geolat_u", "geolat_u", "ocn_daily%4yr%2mo%2dy", "all", .false., "none", 2 + "ocean_model", "geolon_v", "geolon_v", "ocn_daily%4yr%2mo%2dy", "all", .false., "none", 2 + "ocean_model", "geolat_v", "geolat_v", "ocn_daily%4yr%2mo%2dy", "all", .false., "none", 2 + "ocean_model", "SST", "sst", "ocn_daily%4yr%2mo%2dy", "all", .true., "none", 2 + "ocean_model", "latent", "latent", "ocn_daily%4yr%2mo%2dy","all",.true.,"none",2 + "ocean_model", "sensible", "sensible", "ocn_daily%4yr%2mo%2dy","all",.true.,"none",2 + "ocean_model", "SW", "SW", "ocn_daily%4yr%2mo%2dy","all",.true.,"none",2 + "ocean_model", "LW", "LW", "ocn_daily%4yr%2mo%2dy","all",.true.,"none",2 + "ocean_model", "evap", "evap", "ocn_daily%4yr%2mo%2dy","all",.true.,"none",2 + "ocean_model", "lprec", "lprec", "ocn_daily%4yr%2mo%2dy","all",.true.,"none",2 + "ocean_model", "taux", "taux", "ocn_daily%4yr%2mo%2dy","all",.true.,"none",2 + "ocean_model", "tauy", "tauy", "ocn_daily%4yr%2mo%2dy","all",.true.,"none",2 # Z-Space Fields Provided for CMIP6 (CMOR Names): #=============================================== @@ -65,6 +80,24 @@ "ocean_model", "fprec", "fprec", "ocn%4yr%2mo%2dy%2hr","all",.true.,"none",2 "ocean_model", "LwLatSens", "LwLatSens", "ocn%4yr%2mo%2dy%2hr","all",.true.,"none",2 "ocean_model", "Heat_PmE", "Heat_PmE", "ocn%4yr%2mo%2dy%2hr","all",.true.,"none",2 + +#wave_variables + "ocean_model", "geolon", "geolon", "wavocn%4yr%2mo%2dy%2hr","all", .false., "none", 2 + "ocean_model", "geolat", "geolat", "wavocn%4yr%2mo%2dy%2hr","all", .false., "none", 2 + "ocean_model", "MSTAR", "MSTAR", "wavocn%4yr%2mo%2dy%2hr","all", .true., "none", 2 + "ocean_model", "LA", "LA", "wavocn%4yr%2mo%2dy%2hr","all", .true., "none", 2 + "ocean_model", "LA_MOD", "LA_MOD", "wavocn%4yr%2mo%2dy%2hr","all", .true., "none", 2 + "ocean_model", "MSTAR_LT", "MSTAR_LT", "wavocn%4yr%2mo%2dy%2hr","all", .true., "none", 2 + "ocean_model", "ePBL_h_ML", "ePBL", "wavocn%4yr%2mo%2dy%2hr","all", .true., "none", 2 + "ocean_model", "ustar", "ustar", "wavocn%4yr%2mo%2dy%2hr","all", .true., "none", 2 + "ocean_model", "ePBL_TKE_wind", "ePBL_TKE_wind", "wavocn%4yr%2mo%2dy%2hr","all", .true., "none", 2 + "ocean_model", "ePBL_TKE_MKE", "ePBL_TKE_MKE", "wavocn%4yr%2mo%2dy%2hr","all", .true., "none", 2 + "ocean_model", "ePBL_TKE_conv", "ePBL_TKE_conv", "wavocn%4yr%2mo%2dy%2hr","all", .true., "none", 2 + "ocean_model", "ePBL_TKE_forcing", "ePBL_TKE_forcing", "wavocn%4yr%2mo%2dy%2hr","all", .true., "none", 2 + "ocean_model", "ePBL_TKE_mixing", "ePBL_TKE_mixing", "wavocn%4yr%2mo%2dy%2hr","all", .true., "none", 2 + "ocean_model", "ePBL_TKE_mech_decay","ePBL_TKE_mech_decay","wavocn%4yr%2mo%2dy%2hr","all", .true., "none", 2 + "ocean_model", "ePBL_TKE_conv_decay","ePBL_TKE_conv_decay","wavocn%4yr%2mo%2dy%2hr","all", .true., "none", 2 + #============================================================================================= "gfs_dyn", "ucomp", "ugrd", "fv3_history", "all", .false., "none", 2 "gfs_dyn", "vcomp", "vgrd", "fv3_history", "all", .false., "none", 2 diff --git a/scripts/exwave_init.sh b/scripts/exwave_init.sh new file mode 100755 index 0000000000..5a5ed2d669 --- /dev/null +++ b/scripts/exwave_init.sh @@ -0,0 +1,230 @@ +#!/bin/bash +# +################################################################################ +# +# UNIX Script Documentation Block +# Script name: exwave_init.sh +# Script description: Creates model definition files for WW3 +# +# Author: Jose-Henrique Alves Org: NCEP/EMC Date: 2019-04-20 +# Abstract: This script is the init config for the global multi_grid wave model. +# It creates model definition files with all configurations of spatial +# and spectral grids, as well as physics parameters and time steps. +# +# Script history log: +# 2019-05-06 J-Henrique Alves First Version. +# 2019-11-02 J-Henrique Alves Ported to global-workflow. +# +# $Id$ +# +# Attributes: +# Language: Bourne-again (BASH) shell +# Machine: WCOSS-DELL-P3 +# +############################################################################### +# +# --------------------------------------------------------------------------- # +# 0. Preparations +# 0.a Basic modes of operation + + set -x + # Use LOUD variable to turn on/off trace. Defaults to YES (on). + export LOUD=${LOUD:-YES}; [[ $LOUD = yes ]] && export LOUD=YES + [[ "$LOUD" != YES ]] && set +x + + cd $DATA + + msg="HAS BEGUN on `hostname`" + postmsg "$jlogfile" "$msg" + msg="Starting MWW3 INIT CONFIG SCRIPT for $COMPONENTwave" + postmsg "$jlogfile" "$msg" + + set +x + echo ' ' + echo ' ********************************' + echo ' *** MWW3 INIT CONFIG SCRIPT ***' + echo ' ********************************' + echo ' Initial configuration script' + echo " Model identifier : $COMPONENTwave" + echo ' ' + echo "Starting at : `date`" + echo ' ' + [[ "$LOUD" = YES ]] && set -x + +# Script will run only if pre-defined NTASKS +# The actual work is distributed over these tasks. + if [ -z ${NTASKS} ] + then + echo "FATAL ERROR: requires NTASKS to be set " + err=1; export err;${errchk} + fi + + set +x + echo ' ' + echo " Script set to run with $NTASKS tasks " + echo ' ' + [[ "$LOUD" = YES ]] && set -x + + +# --------------------------------------------------------------------------- # +# 1. Get files that are used by most child scripts + + set +x + echo 'Preparing input files :' + echo '-----------------------' + echo ' ' + [[ "$LOUD" = YES ]] && set -x + +# 1.a Model definition files + + nmoddef=0 + + rm -f cmdfile + touch cmdfile + chmod 744 cmdfile + +# Eliminate duplicate grids + array=($WAVECUR_FID $WAVEICE_FID $WAVEWND_FID $waveuoutpGRD $waveGRD $waveesmfGRD $wavesbsGRD $wavepostGRD $waveinterpGRD) + grdALL=`printf "%s\n" "${array[@]}" | sort -u | tr '\n' ' '` + + for grdID in ${grdALL} + do + if [ -f "$COMIN/rundata/${COMPONENTwave}.mod_def.${grdID}" ] + then + set +x + echo " Mod def file for $grdID found in ${COMIN}/rundata. copying ...." + [[ "$LOUD" = YES ]] && set -x + cp $COMIN/rundata/${COMPONENTwave}.mod_def.${grdID} mod_def.$grdID + + else + set +x + echo " Mod def file for $grdID not found in ${COMIN}/rundata. Setting up to generate ..." + echo ' ' + [[ "$LOUD" = YES ]] && set -x + if [ -f $FIXwave/ww3_grid.inp.$grdID ] + then + cp $FIXwave/ww3_grid.inp.$grdID ww3_grid.inp.$grdID + fi + + if [ -f ww3_grid.inp.$grdID ] + then + set +x + echo ' ' + echo " ww3_grid.inp.$grdID copied ($FIXwave/ww3_grid.inp.$grdID)." + echo ' ' + [[ "$LOUD" = YES ]] && set -x + else + msg="ABNORMAL EXIT: NO INP FILE FOR MODEL DEFINITION FILE" + postmsg "$jlogfile" "$msg" + set +x + echo ' ' + echo '*********************************************************** ' + echo '*** FATAL ERROR : NO INP FILE FOR MODEL DEFINITION FILE *** ' + echo '*********************************************************** ' + echo " grdID = $grdID" + echo ' ' + echo $msg + [[ "$LOUD" = YES ]] && set -x + echo "$COMPONENTwave init config $date $cycle : ww3_grid.inp.$grdID missing." >> $wavelog + err=2;export err;${errchk} + fi + + [[ ! -d $COMOUT/rundata ]] && mkdir -m 775 -p $COMOUT/rundata + echo "$USHwave/wave_grid_moddef.sh $grdID > $grdID.out 2>&1" >> cmdfile + + nmoddef=`expr $nmoddef + 1` + + fi + done + +# 1.a.1 Execute parallel or serialpoe + + if [ "$nmoddef" -gt '0' ] + then + + set +x + echo ' ' + echo " Generating $nmoddef mod def files" + echo ' ' + [[ "$LOUD" = YES ]] && set -x + +# Set number of processes for mpmd + wavenproc=`wc -l cmdfile | awk '{print $1}'` + wavenproc=`echo $((${wavenproc}<${NTASKS}?${wavenproc}:${NTASKS}))` + +# 1.a.3 Execute the serial or parallel cmdfile + + set +x + echo ' ' + echo " Executing the mod_def command file at : `date`" + echo ' ------------------------------------' + echo ' ' + [[ "$LOUD" = YES ]] && set -x + + if [ "$NTASKS" -gt '1' ] + then + ${wavempexec} ${wavenproc} ${wave_mpmd} cmdfile + exit=$? + else + ./cmdfile + exit=$? + fi + + if [ "$exit" != '0' ] + then + set +x + echo ' ' + echo '********************************************' + echo '*** POE FAILURE DURING RAW DATA COPYING ***' + echo '********************************************' + echo ' See Details Below ' + echo ' ' + [[ "$LOUD" = YES ]] && set -x + fi + + fi + +# 1.a.3 File check + + for grdID in ${grdALL} + do + if [ -f ${COMOUT}/rundata/${COMPONENTwave}.mod_def.$grdID ] + then + set +x + echo ' ' + echo " mod_def.$grdID succesfully created/copied " + echo ' ' + [[ "$LOUD" = YES ]] && set -x + else + msg="ABNORMAL EXIT: NO MODEL DEFINITION FILE" + postmsg "$jlogfile" "$msg" + set +x + echo ' ' + echo '********************************************** ' + echo '*** FATAL ERROR : NO MODEL DEFINITION FILE *** ' + echo '********************************************** ' + echo " grdID = $grdID" + echo ' ' + echo $msg + sed "s/^/$grdID.out : /g" $grdID.out + [[ "$LOUD" = YES ]] && set -x + echo "$COMPONENTwave prep $date $cycle : mod_def.$grdID missing." >> $wavelog + err=3;export err;${errchk} + fi + done + +# --------------------------------------------------------------------------- # +# 2. Ending + + set +x + echo ' ' + echo "Ending at : `date`" + echo ' ' + echo ' *** End of MWW3 Init Config ***' + echo ' ' + [[ "$LOUD" = YES ]] && set -x + + msg="$job completed normally" + postmsg "$jlogfile" "$msg" + +# End of MWW3 init config script ------------------------------------------- # diff --git a/scripts/exwave_post_sbs.sh b/scripts/exwave_post_sbs.sh new file mode 100755 index 0000000000..6f1a1dec38 --- /dev/null +++ b/scripts/exwave_post_sbs.sh @@ -0,0 +1,771 @@ +#!/bin/bash +# +################################################################################ +# +# UNIX Script Documentation Block +# Script name: exwave_post_sbs.sh +# Script description: Creates output products from binary WW3 data +# +# Author: Jose-Henrique Alves Org: NCEP/EMC Date: 2019-12-06 +# Abstract: This script is the postprocessor for the wave component in GFS. +# This version runs side-by-side with the GFS fcst step. +# It executes several scripts forpreparing and creating output data +# as follows: +# +# wave_grib2_sbs.sh : generates GRIB2 files. +# wave_outp_spec.sh : generates spectral data for output locations. +# wave_outp_bull.sh : generates bulletins for output locations. +# wave_grid_interp_ush.sh : interpolates data from new grids to old grids +# wave_tar.sh : tars the spectral and bulletin multiple files +# +# Script history log: +# 2019-12-06 J-Henrique Alves First Version adapted from HTolman post.sh 2007 +# +# $Id$ +# +# Attributes: +# Language: Bourne-again (Bash) Shell +# Machine: WCOSS-DELL-P3 +# +############################################################################### +# +# --------------------------------------------------------------------------- # +# 0. Preparations +# 0.a Basic modes of operation + + set -x + # Use LOUD variable to turn on/off trace. Defaults to YES (on). + export LOUD=${LOUD:-YES}; [[ $LOUD = yes ]] && export LOUD=YES + [[ "$LOUD" != YES ]] && set +x + + cd $DATA + + postmsg "$jlogfile" "HAS BEGUN on `hostname`" + + msg="Starting WAVE POSTPROCESSOR SCRIPT for $WAV_MOD_TAG" + postmsg "$jlogfile" "$msg" + + set +x + echo ' ' + echo ' *********************************' + echo ' *** WAVE POSTPROCESSOR SCRIPT ***' + echo ' *********************************' + echo ' ' + echo "Starting at : `date`" + echo '-------------' + echo ' ' + [[ "$LOUD" = YES ]] && set -x + +# Script will run only if pre-defined NTASKS +# The actual work is distributed over these tasks. + if [ -z ${NTASKS} ] + then + echo "FATAL ERROR: requires NTASKS to be set " + err=1; export err;${errchk} + exit $err + fi + +# 0.c Defining model grids + + waveuoutpGRD=${waveuoutpGRD:?buoyNotSet} + +# 0.c.1 Grids + + export waveGRD=${waveGRD?Var waveGRD Not Set} + export wavesbsGRD=${wavesbsGRD?Var wavesbsGRD Not Set} + +# 0.c.3 extended global grid and rtma transfer grid + export waveinterpGRD=${waveinterpGRD?Var wavepostGRD Not Set} + export wavepostGRD=${wavepostGRD?Var wavepostGRD Not Set} + +# 0.c.4 Define a temporary directory for storing ascii point output files +# and flush it + + export STA_DIR=$DATA/station_ascii_files + if [ -d $STA_DIR ] + then + rm -rf ${STA_DIR} + fi + mkdir -p ${STA_DIR} + mkdir -p ${STA_DIR}/spec + mkdir -p ${STA_DIR}/ibp + mkdir -p ${STA_DIR}/bull + mkdir -p ${STA_DIR}/cbull + + set +x + echo ' ' + echo 'Grid information :' + echo '-------------------' + echo " Native wave grids : $waveGRD" + echo " Side-by-side grids : $wavesbsGRD" + echo " Interpolated grids : $waveinterpGRD" + echo " Post-process grids : $wavepostGRD" + echo " Output points : $waveuoutpGRD" + echo ' ' + [[ "$LOUD" = YES ]] && set -x + + +# --------------------------------------------------------------------------- # +# 1. Get files that are used by most child scripts + + fieldOK='yes' + pointOK='yes' + gribOK='yes' + grintOK='yes' + specOK='yes' + bullOK='yes' + + exit_code=0 + + set +x + echo ' ' + echo 'Preparing input files :' + echo '-----------------------' + [[ "$LOUD" = YES ]] && set -x + +# 1.a Model definition files and output files (set up using poe) + +# 1.a.1 Set up the parallel command tasks + + rm -f cmdfile + touch cmdfile + chmod 744 cmdfile + + [[ "$LOUD" = YES ]] && set -x + +# Copy model definition files + for grdID in $waveGRD $wavesbsGRD $wavepostGRD $waveinterpGRD $waveuoutpGRD + do + if [ -f "$COMIN/rundata/${COMPONENTwave}.mod_def.${grdID}" ] + then + set +x + echo " Mod def file for $grdID found in ${COMIN}/rundata. copying ...." + [[ "$LOUD" = YES ]] && set -x + + cp -f $COMIN/rundata/${COMPONENTwave}.mod_def.${grdID} mod_def.$grdID + iloop=`expr $iloop + 1` + + fi + + done + + for grdID in $waveGRD $wavesbsGRD $wavepostGRD $waveinterpGRD $waveuoutpGRD + do + if [ ! -f mod_def.$grdID ] + then + set +x + echo ' ' + echo '*************************************************** ' + echo " FATAL ERROR : NO MOD_DEF FILE mod_def.$grdID " + echo '*************************************************** ' + echo ' ' + [[ "$LOUD" = YES ]] && set -x + echo "$WAV_MOD_TAG post $grdID $date $cycle : mod_def file missing." >> $wavelog + postmsg "$jlogfile" "FATAL ERROR : NO MOD_DEF file mod_def.$grdID" + fieldOK='no' + err=2; export err;${errchk} + exit $err + gribOK='no' + else + set +x + echo "File mod_def.$grdID found. Syncing to all nodes ..." + [[ "$LOUD" = YES ]] && set -x + $FSYNC mod_def.$grdID + fi + done + +# 1.c Output locations file + + rm -f buoy.loc + + if [ -f $FIXwave/wave_${NET}.buoys ] + then + cp -f $FIXwave/wave_${NET}.buoys buoy.loc.temp +# Reverse grep to exclude IBP points + sed -n '/^\$.*/!p' buoy.loc.temp | grep -v IBP > buoy.loc +# Grep to include IBP points + sed -n '/^\$.*/!p' buoy.loc.temp | grep IBP > buoy.ibp + rm -f buoy.loc.temp + fi + + if [ -s buoy.loc ] && [ -s buoy.ibp ] + then + set +x + echo " buoy.loc and buoy.ibp copied and processed ($FIXwave/wave_${NET}.buoys)." + [[ "$LOUD" = YES ]] && set -x + else + set +x + echo ' ' + echo '************************************* ' + echo ' FATAL ERROR : NO BUOY LOCATION FILE ' + echo '************************************* ' + echo ' ' + [[ "$LOUD" = YES ]] && set -x + echo "$AV_MOD_ID post $date $cycle : buoy location file missing." >> $wavelog + postmsg "$jlogfile" "FATAL ERROR : NO BUOY LOCATION FILE" + err=3; export err;${errchk} + exit $err + pointOK='no' + specOK='no' + bullOK='no' + fi + +# 1.d Input template files + + if [ "$grintOK" = 'yes' ] + then + for intGRD in $waveinterpGRD + do + if [ -f $FIXwave/${intGRD}_interp.inp.tmpl ] + then + cp -f $FIXwave/${intGRD}_interp.inp.tmpl ${intGRD}_interp.inp.tmpl + fi + + if [ -f ${intGRD}_interp.inp.tmpl ] + then + set +x + echo " ${intGRD}_interp.inp.tmpl copied. Syncing to all nodes ..." + [[ "$LOUD" = YES ]] && set -x + $FSYNC ${intGRD}_interp.inp.tmpl + else + set +x + echo ' ' + echo '*********************************************** ' + echo '*** ERROR : NO TEMPLATE FOR GRINT INPUT FILE *** ' + echo '*********************************************** ' + echo ' ' + [[ "$LOUD" = YES ]] && set -x + echo "$WAV_MOD_TAG post $date $cycle : GRINT template file missing." >> $wavelog + postmsg "$jlogfile" "NON-FATAL ERROR : NO TEMPLATE FOR GRINT INPUT FILE" + exit_code=1 + grintOK='no' + fi + done + fi + + if [ "$gribOK" = 'yes' ] + then + for grbGRD in $waveinterpGRD $wavepostGRD + do + if [ -f $FIXwave/ww3_grib2.${grbGRD}.inp.tmpl ] + then + cp -f $FIXwave/ww3_grib2.${grbGRD}.inp.tmpl ww3_grib2.${grbGRD}.inp.tmpl + fi + + if [ -f ww3_grib2.${grbGRD}.inp.tmpl ] + then + set +x + echo " ww3_grib2.${grbGRD}.inp.tmpl copied. Syncing to all nodes ..." + [[ "$LOUD" = YES ]] && set -x + $FSYNC ww3_grib2.inp.tmpl + else + set +x + echo ' ' + echo '*********************************************** ' + echo "*** ERROR : NO TEMPLATE FOR ${grbGRD} GRIB INPUT FILE *** " + echo '*********************************************** ' + echo ' ' + [[ "$LOUD" = YES ]] && set -x + echo "$WAV_MOD_TAG post $date $cycle : GRIB2 template file missing." >> $wavelog + postmsg "$jlogfile" "NON-FATAL ERROR : NO TEMPLATE FOR GRIB2 INPUT FILE" + exit_code=2 + gribOK='no' + fi + done + fi + + if [ -f $FIXwave/ww3_outp_spec.inp.tmpl ] + then + cp -f $FIXwave/ww3_outp_spec.inp.tmpl ww3_outp_spec.inp.tmpl + fi + + if [ -f ww3_outp_spec.inp.tmpl ] + then + set +x + echo " ww3_outp_spec.inp.tmpl copied. Syncing to all grids ..." + [[ "$LOUD" = YES ]] && set -x + $FSYNC ww3_outp_spec.inp.tmpl + else + set +x + echo ' ' + echo '*********************************************** ' + echo '*** ERROR : NO TEMPLATE FOR SPEC INPUT FILE *** ' + echo '*********************************************** ' + echo ' ' + [[ "$LOUD" = YES ]] && set -x + echo "$WAV_MOD_TAG post $date $cycle : ww3_outp_spec.inp.tmpl file missing." >> $wavelog + postmsg "$jlogfile" "NON-FATAL ERROR : NO TEMPLATE FOR SPEC INPUT FILE" + exit_code=3 + specOK='no' + bullOK='no' + fi + + if [ -f $FIXwave/ww3_outp_bull.inp.tmpl ] + then + cp -f $FIXwave/ww3_outp_bull.inp.tmpl ww3_outp_bull.inp.tmpl + fi + + if [ -f ww3_outp_bull.inp.tmpl ] + then + set +x + echo " ww3_outp_bull.inp.tmpl copied. Syncing to all nodes ..." + [[ "$LOUD" = YES ]] && set -x + $FSYNC ww3_outp_bull.inp.tmpl + else + set +x + echo ' ' + echo '*************************************************** ' + echo '*** ERROR : NO TEMPLATE FOR BULLETIN INPUT FILE *** ' + echo '*************************************************** ' + echo ' ' + [[ "$LOUD" = YES ]] && set -x + echo "$WAV_MOD_TAG post $date $cycle : bulletin template file missing." >> $wavelog + postmsg "$jlogfile" "NON-FATAL ERROR : NO TEMPLATE FOR BULLETIN INPUT FILE" + exit_code=4 + bullOK='no' + fi + +# 1.e Getting buoy information for points + + if [ "$specOK" = 'yes' ] || [ "$bullOK" = 'yes' ] + then + ymdh=`$NDATE -${WAVHINDH} $CDATE` + tstart="`echo $ymdh | cut -c1-8` `echo $ymdh | cut -c9-10`0000" + dtspec=3600. # default time step (not used here) + sed -e "s/TIME/$tstart/g" \ + -e "s/DT/$dtspec/g" \ + -e "s/POINT/1/g" \ + -e "s/ITYPE/0/g" \ + -e "s/FORMAT/F/g" \ + ww3_outp_spec.inp.tmpl > ww3_outp.inp + + ln -s mod_def.$waveuoutpGRD mod_def.ww3 + fhr=$FHMIN_WAV + YMD=$(echo $CDATE | cut -c1-8) + HMS="$(echo $CDATE | cut -c9-10)0000" + tloop=0 + tloopmax=600 + tsleep=10 + while [ ${tloop} -le ${tloopmax} ] + do + if [ -f $COMIN/rundata/${WAV_MOD_TAG}.out_pnt.${waveuoutpGRD}.${YMD}.${HMS} ] + then + ln -s $COMIN/rundata/${WAV_MOD_TAG}.out_pnt.${waveuoutpGRD}.${YMD}.${HMS} ./out_pnt.${waveuoutpGRD} + break + else + sleep ${tsleep} + tloop=$(($tloop + $tsleep)) + fi + done + + rm -f buoy_tmp.loc buoy_log.ww3 ww3_oup.inp + ln -fs ./out_pnt.${waveuoutpGRD} ./out_pnt.ww3 + ln -fs ./mod_def.${waveuoutpGRD} ./mod_def.ww3 + $EXECcode/ww3_outp > buoy_lst.loc 2>&1 + err=$? + + if [ "$err" != '0' ] && [ ! -f buoy_log.ww3 ] + then + pgm=wave_post + msg="ABNORMAL EXIT: ERROR IN ww3_outp" + postmsg "$jlogfile" "$msg" + set +x + echo ' ' + echo '******************************************** ' + echo '*** FATAL ERROR : ERROR IN ww3_outp *** ' + echo '******************************************** ' + echo ' ' + cat buoy_tmp.loc + echo "$WAV_MOD_TAG post $date $cycle : buoy log file failed to be created." >> $wavelog + echo $msg + [[ "$LOUD" = YES ]] && set -x + err=4;export err;${errchk} + specOK='no' + bullOK='no' + exit $err + fi + +# Create new buoy_log.ww3 excluding all IBP files + cat buoy.loc | awk '{print $3}' | sed 's/'\''//g' > ibp_tags + grep -F -f ibp_tags buoy_log.ww3 > buoy_log.tmp + rm -f buoy_log.dat + mv buoy_log.tmp buoy_log.dat + + grep -F -f ibp_tags buoy_lst.loc > buoy_tmp1.loc + sed '$d' buoy_tmp1.loc > buoy_tmp2.loc + buoys=`awk '{ print $1 }' buoy_tmp2.loc` + Nb=`wc buoy_tmp2.loc | awk '{ print $1 }'` + rm -f buoy_tmp1.loc buoy_tmp2.loc + + if [ -s buoy_log.dat ] + then + set +x + echo 'Buoy log file created. Syncing to all nodes ...' + $FSYNC buoy_log.dat + [[ "$LOUD" = YES ]] && set -x + else + set +x + echo ' ' + echo '**************************************** ' + echo '*** ERROR : NO BUOY LOG FILE CREATED *** ' + echo '**************************************** ' + echo ' ' + [[ "$LOUD" = YES ]] && set -x + echo "$WAV_MOD_TAG post $date $cycle : buoy log file missing." >> $wavelog + postmsg "$jlogfile" "FATAL ERROR : NO BUOY LOG FILE GENERATED FOR SPEC AND BULLETIN FILES" + err=5;export err;${errchk} + specOK='no' + bullOK='no' + OspecOK='no' + ObullOK='no' + fi + +# Create new buoy_log.ww3 including all IBP files + ibspecOK='yes' + cat buoy.ibp | awk '{print $3}' | sed 's/'\''//g' > ibp_tags + grep -F -f ibp_tags buoy_log.ww3 > buoy_log.tmp + rm -f buoy_log.ibp + mv buoy_log.tmp buoy_log.ibp + + grep -F -f ibp_tags buoy_lst.loc > buoy_tmp1.loc + sed '$d' buoy_tmp1.loc > buoy_tmp2.loc + ibpoints=`awk '{ print $1 }' buoy_tmp2.loc` + Nibp=`wc buoy_tmp2.loc | awk '{ print $1 }'` + rm -f buoy_tmp1.loc buoy_tmp2.loc + + if [ -s buoy_log.ibp ] + then + set +x + echo 'IBP log file created. Syncing to all nodes ...' + $FSYNC buoy_log.ibp + [[ "$LOUD" = YES ]] && set -x + else + set +x + echo ' ' + echo '**************************************** ' + echo '*** ERROR : NO IBP LOG FILE CREATED *** ' + echo '**************************************** ' + echo ' ' + [[ "$LOUD" = YES ]] && set -x + echo "$WAV_MOD_TAG post $date $cycle : ibp log file missing." >> $wavelog + postmsg "$jlogfile" "FATAL ERROR : NO IBP LOG FILE GENERATED FOR SPEC AND BULLETIN FILES" + err=6;export err;${errchk} + ibspecOK='no' + fi + + fi + +# 1.f Data summary + + set +x + echo ' ' + echo " Input files read and processed at : `date`" + echo ' ' + echo ' Data summary : ' + echo ' ---------------------------------------------' + echo " Sufficient data for GRID interpolation : $grintOK" + echo " Sufficient data for GRIB files : $gribOK" + echo " Sufficient data for spectral files : $specOK ($Nb points)" + echo " Sufficient data for bulletins : $bullOK ($Nb points)" + echo " Sufficient data for Input Boundary Points : $ibspecOK ($Nibp points)" + echo ' ' + [[ "$LOUD" = YES ]] && set -x + +# --------------------------------------------------------------------------- # +# 2. Make consolidated grib2 file for side-by-side grids and interpolate +# onto extended grids +# +# 2.a Command file set-up + + set +x + echo ' Making command file for sbs grib2 and GRID Interpolation ' + [[ "$LOUD" = YES ]] && set -x + + rm -f cmdfile + touch cmdfile + chmod 744 cmdfile + +# 1.a.2 Loop over forecast time to generate post files +# When executed side-by-side, serial mode (cfp when run after the fcst step) + fhr=$FHMIN_WAV + fhrp=$fhr + fhrg=$fhr + iwaitmax=120 # Maximum loop cycles for waiting until wave component output file is ready (fails after max) + while [ $fhr -le $FHMAX_WAV ]; do + + ymdh=`$NDATE $fhr $CDATE` + YMD=$(echo $ymdh | cut -c1-8) + HMS="$(echo $ymdh | cut -c9-10)0000" + YMDHMS=${YMD}${HMS} + FH3=$(printf %03i $fhr) + + fcmdnow=cmdfile.${FH3} + fcmdigrd=icmdfile.${FH3} + fcmdpnt=pcmdfile.${FH3} + fcmdibp=ibpcmdfile.${FH3} + rm -f ${fcmdnow} ${fcmdigrd} ${fcmdpnt} ${fcmdibp} + touch ${fcmdnow} ${fcmdigrd} ${fcmdpnt} ${fcmdibp} +# echo "mkdir output_$YMDHMS" >> ${fcmdnow} + mkdir output_$YMDHMS +# echo "cd output_$YMDHMS" >> ${fcmdnow} + cd output_$YMDHMS +# Create instances of directories for spec and gridded output + export SPECDATA=${DATA}/output_$YMDHMS + export BULLDATA=${DATA}/output_$YMDHMS + export GRIBDATA=${DATA}/output_$YMDHMS + export GRDIDATA=${DATA}/output_$YMDHMS + ln -fs $DATA/mod_def.${waveuoutpGRD} mod_def.ww3 + + if [ $fhr = $fhrp ] + then + iwait=0 + pfile=$COMIN/rundata/${WAV_MOD_TAG}.out_pnt.${waveuoutpGRD}.${YMD}.${HMS} + while [ ! -s ${pfile} ]; do sleep 10; ((iwait++)) && ((iwait==$iwaitmax)) && break ; echo $iwait; done + if [ $iwait -eq $iwaitmax ]; then + echo " FATAL ERROR : NO RAW POINT OUTPUT FILE out_pnt.$waveuoutpGRD + echo ' ' + [[ "$LOUD" = YES ]] && set -x + echo "$WAV_MOD_TAG post $waveuoutpGRD $date $cycle : point output missing." >> $wavelog + postmsg "$jlogfile" "FATAL ERROR : NO RAW POINT OUTPUT FILE out_pnt.$waveuoutpGRD + err=6; export err;${errchk} + exit $err + fi + ln -fs ${pfile} ./out_pnt.${waveuoutpGRD} + + if [ "$specOK" = 'yes' ] + then + export dtspec=3600. + for buoy in $buoys + do + echo "$USHwave/wave_outp_spec.sh $buoy $ymdh spec > spec_$buoy.out 2>&1" >> ${fcmdnow} + done + fi + + if [ "$ibspecOK" = 'yes' ] && [ "$DOIBP_WAV" = "YES" ] + then + export dtspec=3600. + for buoy in $ibpoints + do + echo "$USHwave/wave_outp_spec.sh $buoy $ymdh ibp > ibp_$buoy.out 2>&1" >> ${fcmdnow} + done + fi + + if [ "$bullOK" = 'yes' ] + then + export dtspec=3600. + for buoy in $buoys + do + echo "$USHwave/wave_outp_spec.sh $buoy $ymdh bull > bull_$buoy.out 2>&1" >> ${fcmdnow} + done + fi + + fi + + if [ $fhr = $fhrg ] + then + for wavGRD in ${waveGRD} ; do + gfile=$COMIN/rundata/${WAV_MOD_TAG}.out_grd.${wavGRD}.${YMD}.${HMS} + while [ ! -s ${gfile} ]; do sleep 10; done + if [ $iwait -eq $iwaitmax ]; then + echo '*************************************************** ' + echo " FATAL ERROR : NO RAW FIELD OUTPUT FILE out_grd.$grdID " + echo '*************************************************** ' + echo ' ' + [[ "$LOUD" = YES ]] && set -x + echo "$WAV_MOD_TAG post $grdID $date $cycle : field output missing." >> $wavelog + postmsg "$jlogfile" "NON-FATAL ERROR : NO RAW FIELD OUTPUT FILE out_grd.$grdID" + fieldOK='no' + err=7; export err;${errchk} + exit $err + fi + ln -s ${gfile} ./out_grd.${wavGRD} + done + + if [ "$grintOK" = 'yes' ] + then + nigrd=1 + for grdID in $waveinterpGRD + do + case $grdID in + glo_15mxt) ymdh_int=`$NDATE -${WAVHINDH} $ymdh`; dt_int=3600.; n_int=9999 ;; + glo_30mxt) ymdh_int=`$NDATE -${WAVHINDH} $ymdh`; dt_int=3600.; n_int=9999 ;; + esac + echo "$USHwave/wave_grid_interp_sbs.sh $grdID $ymdh_int $dt_int $n_int > grint_$grdID.out 2>&1" >> ${fcmdigrd}.${nigrd} + if [ "$gribOK" = 'yes' ] + then + gribFL=\'`echo ${OUTPARS_WAV}`\' + case $grdID in + glo_15mxt) GRDNAME='global' ; GRDRES=0p25 ; GRIDNR=255 ; MODNR=11 ;; + glo_30mxt) GRDNAME='global' ; GRDRES=0p50 ; GRIDNR=255 ; MODNR=11 ;; + esac + echo "$USHwave/wave_grib2_sbs.sh $grdID $GRIDNR $MODNR $ymdh $fhr $GRDNAME $GRDRES $gribFL > grib_$grdID.out 2>&1" >> ${fcmdigrd}.${nigrd} + fi + echo "${fcmdigrd}.${nigrd}" >> ${fcmdnow} + chmod 744 ${fcmdigrd}.${nigrd} + nigrd=$((nigrd+1)) + done + fi + + if [ "$gribOK" = 'yes' ] + then + for grdID in ${wavepostGRD} # First concatenate grib files for sbs grids + do + gribFL=\'`echo ${OUTPARS_WAV}`\' + case $grdID in + aoc_9km) GRDNAME='arctic' ; GRDRES=9km ; GRIDNR=255 ; MODNR=11 ;; + ant_9km) GRDNAME='antarc' ; GRDRES=9km ; GRIDNR=255 ; MODNR=11 ;; + glo_10m) GRDNAME='global' ; GRDRES=0p16 ; GRIDNR=255 ; MODNR=11 ;; + glo_15m) GRDNAME='global' ; GRDRES=0p25 ; GRIDNR=255 ; MODNR=11 ;; + ao_20m) GRDNAME='arctic' ; GRDRES=0p33 ; GRIDNR=255 ; MODNR=11 ;; + so_20m) GRDNAME='antarc' ; GRDRES=0p33 ; GRIDNR=255 ; MODNR=11 ;; + glo_15mxt) GRDNAME='global' ; GRDRES=0p25 ; GRIDNR=255 ; MODNR=11 ;; + esac + echo "$USHwave/wave_grib2_sbs.sh $grdID $GRIDNR $MODNR $ymdh $fhr $GRDNAME $GRDRES $gribFL > grib_$grdID.out 2>&1" >> ${fcmdnow} + done + fi + + fi + + wavenproc=`wc -l ${fcmdnow} | awk '{print $1}'` + wavenproc=`echo $((${wavenproc}<${NTASKS}?${wavenproc}:${NTASKS}))` + + set +x + echo ' ' + echo " Executing the copy command file at : `date`" + echo ' ------------------------------------' + echo ' ' + [[ "$LOUD" = YES ]] && set -x + + if [ "$wavenproc" -gt '1' ] + then + ${wavempexec} ${wavenproc} ${wave_mpmd} ${fcmdnow} + exit=$? + else + chmod 744 ${fcmdnow} + ./${fcmdnow} + exit=$? + fi + + if [ "$exit" != '0' ] + then + set +x + echo ' ' + echo '********************************************' + echo '*** CMDFILE FAILED ***' + echo '********************************************' + echo ' See Details Below ' + echo ' ' + [[ "$LOUD" = YES ]] && set -x + err=8; export err;${errchk} + exit $err + fi + + rm -f out_grd.* # Remove large binary grid output files + + cd $DATA + + FHINCP=$(( DTPNT_WAV / 3600 )) + FHINCG=$(( DTFLD_WAV / 3600 )) + if [ $fhr = $fhrg ] + then + if [ $FHMAX_HF_WAV -gt 0 ] && [ $FHOUT_HF_WAV -gt 0 ] && [ $fhr -lt $FHMAX_HF_WAV ]; then + FHINCG=$FHOUT_HF_WAV + else + FHINCG=$FHOUT_WAV + fi + fhrg=$((fhr+FHINCG)) + fi + if [ $fhr = $fhrp ] + then + fhrp=$((fhr+FHINCP)) + fi + echo $fhrg $fhrp + fhr=$([ $fhrg -le $fhrp ] && echo "$fhrg" || echo "$fhrp") # reference fhr is the least between grid and point stride + done + +# --------------------------------------------------------------------------- # +# 3. Compress point output data into tar files + +# 3.a Set up cmdfile + + rm -f cmdtarfile + touch cmdtarfile + chmod 744 cmdtarfile + + set +x + echo ' ' + echo ' Making command file for taring all point output files.' + + [[ "$LOUD" = YES ]] && set -x + +# 6.b Spectral data files + + if [ "$specOK" = 'yes' ] + then + echo "$USHwave/wave_tar.sh $WAV_MOD_TAG ibp $Nibp > ${WAV_MOD_TAG}_ibp_tar.out 2>&1 " >> cmdtarfile + echo "$USHwave/wave_tar.sh $WAV_MOD_TAG spec $Nb > ${WAV_MOD_TAG}_spec_tar.out 2>&1 " >> cmdtarfile + echo "$USHwave/wave_tar.sh $WAV_MOD_TAG bull $Nb > ${WAV_MOD_TAG}_spec_tar.out 2>&1 " >> cmdtarfile + echo "$USHwave/wave_tar.sh $WAV_MOD_TAG cbull $Nb > ${WAV_MOD_TAG}_spec_tar.out 2>&1 " >> cmdtarfile + fi + + wavenproc=`wc -l cmdtarfile | awk '{print $1}'` + wavenproc=`echo $((${wavenproc}<${NTASKS}?${wavenproc}:${NTASKS}))` + + set +x + echo ' ' + echo " Executing the copy command file at : `date`" + echo ' ------------------------------------' + echo ' ' + [[ "$LOUD" = YES ]] && set -x + + if [ "$wavenproc" -gt '1' ] + then + ${wavempexec} ${wavenproc} ${wave_mpmd} cmdtarfile + exit=$? + else + chmod 744 cmdtarfile + ./cmdtarfile + exit=$? + fi + + if [ "$exit" != '0' ] + then + set +x + echo ' ' + echo '********************************************' + echo '*** CMDFILE FAILED ***' + echo '********************************************' + echo ' See Details Below ' + echo ' ' + [[ "$LOUD" = YES ]] && set -x + err=8; export err;${errchk} + exit $err + fi + +# --------------------------------------------------------------------------- # +# 7. Ending output + + set +x + echo ' ' + echo "Ending at : `date`" + echo '-----------' + echo ' ' + echo ' *** End of MWW3 postprocessor ***' + echo ' ' + [[ "$LOUD" = YES ]] && set -x + + if [ "$exit_code" -ne '0' ] + then + msg="ABNORMAL EXIT: Problem in MWW3 POST" + postmsg "$jlogfile" "$msg" + echo $msg + err=16; export err;${errchk} + exit $err + else + echo " Side-by-Side Wave Post Completed Normally " + msg="$job completed normally" + postmsg "$jlogfile" "$msg" + exit 0 + fi + +# End of MWW3 prostprocessor script ---------------------------------------- # diff --git a/scripts/exwave_prep.sh b/scripts/exwave_prep.sh new file mode 100755 index 0000000000..1cd88fd41a --- /dev/null +++ b/scripts/exwave_prep.sh @@ -0,0 +1,1007 @@ +#!/bin/bash +# +################################################################################ +# +# UNIX Script Documentation Block +# Script name: exwave_prep.sh +# Script description: Creates output products from binary WW3 data +# +# Author: Hendrik Tolman Org: NCEP/EMC Date: 2007-03-01 +# Abstract: This is the preprocessor for the wave component in GFS. +# It executes several scripts for preparing and creating input data +# as follows: +# +# wave_prnc_ice.sh : preprocess ice fields. # +# wave_prnc_wnd.sh : preprocess wind fields (uncoupled run, not active) # +# wave_prnc_cur.sh : preprocess current fields. # +# wave_g2ges.sh : find and copy wind grib2 files. # +# # +# Remarks : # +# - For non-fatal errors output is witten to the wave.log file. # +# # +# Update record : # +# # +# - Origination: 01-Mar-2007 # +# # +# Update log # +# Mar2007 HTolman - Added NCO note on resources on mist/dew # +# Apr2007 HTolman - Renaming mod_def files in $FIX_wave. # +# Mar2011 AChawla - Migrating to a vertical structure # +# Nov2012 JHAlves - Transitioning to WCOSS # +# Apr2019 JHAlves - Transitioning to GEFS workflow # +# Nov2019 JHAlves - Merging wave scripts to global workflow # +# # +# WAV_MOD_ID and WAV_MOD_TAG replace modID. WAV_MOD_TAG # +# is used for ensemble-specific I/O. For deterministic # +# WAV_MOD_ID=WAV_MOD_TAG # +# # +############################################################################### +# --------------------------------------------------------------------------- # +# 0. Preparations +# 0.a Basic modes of operation + + set -x + # Use LOUD variable to turn on/off trace. Defaults to YES (on). + export LOUD=${LOUD:-YES}; [[ $LOUD = yes ]] && export LOUD=YES + [[ "$LOUD" != YES ]] && set +x + + cd $DATA + mkdir outtmp + + msg="HAS BEGUN on `hostname`" + postmsg "$jlogfile" "$msg" + msg="Starting MWW3 PREPROCESSOR SCRIPT for $WAV_MOD_TAG" + postmsg "$jlogfile" "$msg" + + set +x + echo ' ' + echo ' ********************************' + echo ' *** MWW3 PREPROCESSOR SCRIPT ***' + echo ' ********************************' + echo ' PREP for wave component of NCEP coupled system' + echo " Wave component identifier : $WAV_MOD_TAG " + echo ' ' + echo "Starting at : `date`" + echo ' ' + [[ "$LOUD" = YES ]] && set -x + +# export MP_PGMMODEL=mpmd +# export MP_CMDFILE=./cmdfile + + if [ "$INDRUN" = 'no' ] + then + FHMAX_WAV=${FHMAX_WAV:-3} + else + FHMAX_WAV=${FHMAX_WAV:-384} + fi + +# 0.b Date and time stuff + +# Beginning time for outpupt may differ from SDATE if DOIAU=YES + export date=$PDY + export YMDH=${PDY}${cyc} +# Roll back $IAU_FHROT hours of DOIAU=YES + IAU_FHROT=3 + if [ "$DOIAU" = "YES" ] + then + WAVHINDH=$(( WAVHINDH + IAU_FHROT )) + fi +# Set time stamps for model start and output +# For special case when IAU is on but this is an initial half cycle + if [ $IAU_OFFSET = 0 ]; then + ymdh_beg=$YMDH + else + ymdh_beg=`$NDATE -$WAVHINDH $YMDH` + fi + time_beg="`echo $ymdh_beg | cut -c1-8` `echo $ymdh_beg | cut -c9-10`0000" + ymdh_end=`$NDATE $FHMAX_WAV $YMDH` + time_end="`echo $ymdh_end | cut -c1-8` `echo $ymdh_end | cut -c9-10`0000" + ymdh_beg_out=$YMDH + time_beg_out="`echo $ymdh_beg_out | cut -c1-8` `echo $ymdh_beg_out | cut -c9-10`0000" + +# Restart file times (already has IAU_FHROT in WAVHINDH) + RSTOFFSET=$(( ${WAVHCYC} - ${WAVHINDH} )) +# Update restart time is added offset relative to model start + RSTOFFSET=$(( ${RSTOFFSET} + ${RSTIOFF_WAV} )) + ymdh_rst_ini=`$NDATE ${RSTOFFSET} $YMDH` + RST2OFFSET=$(( DT_2_RST_WAV / 3600 )) + ymdh_rst2_ini=`$NDATE ${RST2OFFSET} $ymdh_rst_ini` # DT2 relative to first-first-cycle restart file +# First restart file for cycling + time_rst_ini="`echo $ymdh_rst_ini | cut -c1-8` `echo $ymdh_rst_ini | cut -c9-10`0000" + if [ ${DT_1_RST_WAV} = 1 ]; then + time_rst1_end=${time_rst_ini} + else + RST1OFFSET=$(( DT_1_RST_WAV / 3600 )) + ymdh_rst1_end=`$NDATE $RST1OFFSET $ymdh_rst_ini` + time_rst1_end="`echo $ymdh_rst1_end | cut -c1-8` `echo $ymdh_rst1_end | cut -c9-10`0000" + fi +# Second restart file for checkpointing + time_rst2_ini="`echo $ymdh_rst2_ini | cut -c1-8` `echo $ymdh_rst2_ini | cut -c9-10`0000" + time_rst2_end=$time_end +# Condition for gdas run or any other run when checkpoint stamp is > ymdh_end + if [ $ymdh_rst2_ini -ge $ymdh_end ]; then + ymdh_rst2_ini=`$NDATE 3 $ymdh_end` + time_rst2_ini="`echo $ymdh_rst2_ini | cut -c1-8` `echo $ymdh_rst2_ini | cut -c9-10`0000" + time_rst2_end=$time_rst2_ini + fi + + set +x + echo ' ' + echo 'Times in wave model format :' + echo '----------------------------' + echo " date / cycle : $date $cycle" + echo " starting time : $time_beg" + echo " ending time : $time_end" + echo ' ' + [[ "$LOUD" = YES ]] && set -x + +# Script will run only if pre-defined NTASKS +# The actual work is distributed over these tasks. + if [ -z ${NTASKS} ] + then + echo "FATAL ERROR: Requires NTASKS to be set " + err=1; export err;${errchk} + fi + +# --------------------------------------------------------------------------- # +# 1. Get files that are used by most child scripts + + set +x + echo 'Preparing input files :' + echo '-----------------------' + echo ' ' + [[ "$LOUD" = YES ]] && set -x + +# 1.a Model definition files + + rm -f cmdfile + touch cmdfile + + grdINP='' + if [ "${WW3ATMINP}" = 'YES' ]; then grdINP="${grdINP} $WAVEWND_FID" ; fi + if [ "${WW3ICEINP}" = 'YES' ]; then grdINP="${grdINP} $WAVEICE_FID" ; fi + if [ "${WW3CURINP}" = 'YES' ]; then grdINP="${grdINP} $WAVECUR_FID" ; fi + + ifile=1 + + for grdID in $grdINP $waveGRD + do + if [ -f "$COMIN/rundata/${COMPONENTwave}.mod_def.${grdID}" ] + then + set +x + echo " Mod def file for $grdID found in ${COMIN}/rundata. copying ...." + [[ "$LOUD" = YES ]] && set -x + cp $COMIN/rundata/${COMPONENTwave}.mod_def.${grdID} mod_def.$grdID + + else + msg="FATAL ERROR: NO MODEL DEFINITION FILE" + postmsg "$jlogfile" "$msg" + set +x + echo ' ' + echo '*********************************************************** ' + echo '*** FATAL ERROR : NOT FOUND WAVE MODEL DEFINITION FILE *** ' + echo '*********************************************************** ' + echo " grdID = $grdID" + echo ' ' + echo $msg + [[ "$LOUD" = YES ]] && set -x + echo "$WAV_MOD_TAG prep $date $cycle : ${COMPONENTwave}.mod_def.${grdID} missing." >> $wavelog + err=2;export err;${errchk} + fi + done + +# 1.b Netcdf Preprocessor template files + + for grdID in $grdINP + do + + case $grdID in + $WAVECUR_FID ) + type='cur' + ;; + $WAVEWND_FID ) + type='wind' + ;; + $WAVEICE_FID ) + type='ice' + ;; + * ) + echo 'Input type not yet implemented' + err=3; export err;${errchk} + ;; + esac + + if [ -f $FIXwave/ww3_prnc.${type}.$grdID.inp.tmpl ] + then + cp $FIXwave/ww3_prnc.${type}.$grdID.inp.tmpl . + fi + + if [ -f ww3_prnc.${type}.$grdID.inp.tmpl ] + then + set +x + echo ' ' + echo " ww3_prnc.${type}.$grdID.inp.tmpl copied ($FIXwave)." + echo ' ' + [[ "$LOUD" = YES ]] && set -x + else + msg="ABNORMAL EXIT: NO FILE $file" + ./postmsg "$jlogfile" "$msg" + set +x + echo ' ' + echo '************************************** ' + echo '*** FATAL ERROR : NO TEMPLATE FILE *** ' + echo '************************************** ' + echo " ww3_prnc.${type}.$grdID.inp.tmpl" + echo ' ' + echo $msg + echo ' ' + [[ "$LOUD" = YES ]] && set -x + echo "$WAV_MOD_TAG prep $date $cycle : ww3_prnc.${type}.$grdID.tmpl missing." >> $wavelog + err=4;export err;${errchk} + fi + done + +# --------------------------------------------------------------------------- # +# ICEC processing + + if [ "${WW3ICEINP}" = 'YES' ]; then + +# --------------------------------------------------------------------------- # +# 2. Ice pre - processing + +# 2.a Check if ice input is perturbed (number of inputs equal to number of wave +# ensemble members + if [ "${RUNMEM}" = "-1" ] || [ "${WW3ICEIENS}" = "T" ] || [ "$waveMEMB" = "00" ] + then + + $USHwave/wave_prnc_ice.sh > wave_prnc_ice.out + ERR=$? + + if [ -d ice ] + then + postmsg "$jlogfile" "FATAL ERROR ice field not generated." + set +x + echo ' ' + echo ' FATAL ERROR: ice field not generated ' + echo ' ' + sed "s/^/ice.out : /g" ice.out + echo ' ' + [[ "$LOUD" = YES ]] && set -x + err=5;export err;${errchk} + else + mv -f ice.out $DATA/outtmp + rm -f ww3_prep.$WAVEICE_FID.tmpl mod_def.$WAVEICE_FID + set +x + echo ' ' + echo ' Ice field unpacking successful.' + echo ' ' + [[ "$LOUD" = YES ]] && set -x + fi + else + echo ' ' + echo " Ice input is not perturbed, single ice file generated, skipping ${WAV_MOD_TAG}" + echo ' ' + fi + else + echo ' ' + echo ' No input ice file generated, this run did not request pre-processed ice data ' + echo ' ' + fi + +# --------------------------------------------------------------------------- # +# WIND processing (not functional, TBD for uncoupled cases) + + if [ "${WW3ATMINP}" = 'YES' ]; then + +# --------------------------------------------------------------------------- # +# 3. Wind pre-processing + + if [ "${RUNMEM}" = "-1" ] || [ "${WW3ATMIENS}" = "T" ] || [ "$waveMEMB" = "00" ] + then + + rm -f cmdfile + touch cmdfile + chmod 744 cmdfile + +# 3.a Gather and pre-process grib2 files + ymdh=$ymdh_beg + + while [ "$ymdh" -le "$ymdh_end" ] + do + echo "$USHwave/wave_g2ges.sh $ymdh > grb_$ymdh.out 2>&1" >> cmdfile + ymdh=`$NDATE $WAV_WND_HOUR_INC $ymdh` + done + +# 3.b Execute the serial or parallel cmdfile + +# Set number of processes for mpmd + cat cmdfile + + wavenproc=`wc -l cmdfile | awk '{print $1}'` + wavenproc=`echo $((${wavenproc}<${NTASKS}?${wavenproc}:${NTASKS}))` + + set +x + echo ' ' + echo " Executing the copy command file at : `date`" + echo ' ------------------------------------' + echo ' ' + [[ "$LOUD" = YES ]] && set -x + + if [ "$wavenproc" -gt '1' ] + then + ${wavempexec} ${wavenproc} ${wave_mpmd} cmdfile + exit=$? + else + ./cmdfile + exit=$? + fi + + if [ "$exit" != '0' ] + then + set +x + echo ' ' + echo '********************************************' + echo '*** CMDFILE FAILED IN WIND GENERATION ***' + echo '********************************************' + echo ' See Details Below ' + echo ' ' + [[ "$LOUD" = YES ]] && set -x + fi + +# 3.c Check for errors + + set +x + echo ' ' + echo ' Checking for errors.' + echo ' ' + [[ "$LOUD" = YES ]] && set -x + +# We will go on if the number of errors in files is less +# than err_max + + [[ "$LOUD" = YES ]] && set -x + err_max=1 + + + ymdh=$ymdh_beg + nr_err=0 + + set +x + echo ' Sources of grib2 files :' + [[ "$LOUD" = YES ]] && set -x + while [ "$ymdh" -le "$ymdh_end" ] + do + if [ -d grb_${ymdh} ] + then + set +x + echo ' ' + echo " File for $ymdh : error in wave_g2ges.sh" + echo ' ' + [[ "$LOUD" = YES ]] && set -x + postmsg "$jlogfile" " File for $ymdh : error in wave_g2ges.sh" + nr_err=`expr $nr_err + 1` + rm -f gwnd.$ymdh + else + grbfile=`grep 'File for' grb_${ymdh}.out` + if [ -z "$grbfile" ] + then + set +x + echo ' ' + echo " File for $ymdh : cannot identify source" + echo ' ' + [[ "$LOUD" = YES ]] && set -x + nr_err=`expr $nr_err + 1` + rm -f gwnd.$ymdh + else + if [ ! -f gwnd.$ymdh ] + then + set +x + echo ' ' + echo " File for $ymdh : file not found" + echo ' ' + [[ "$LOUD" = YES ]] && set -x + nr_err=`expr $nr_err + 1` + else + set +x + echo ' ' + echo " $grbfile" + echo ' ' + [[ "$LOUD" = YES ]] && set -x + mv -f grb_${ymdh}.out $DATA/outtmp + fi + fi + fi + ymdh=`$NDATE $WAV_WND_HOUR_INC $ymdh` + done + + if [ -f grb_*.out ] + then + set +x + echo ' ' + echo '**********************************' + echo '*** ERROR OUTPUT wave_g2ges.sh ***' + echo '**********************************' + echo ' Possibly in multiple calls' + [[ "$LOUD" = YES ]] && set -x + echo "$WAV_MOD_TAG prep $date $cycle : error in wind grib2 files." >> $wavelog + set +x + for file in grb_*.out + do + echo ' ' + sed "s/^/$file : /g" $file + done + echo ' ' + [[ "$LOUD" = YES ]] && set -x + mv -f grb_*.out $DATA/outtmp + postmsg "$jlogfile" "NON-FATAL ERROR in wave_g2ges.sh, possibly in multiple calls." + fi + + if [ "$nr_err" -gt "$err_max" ] + then + msg="ABNORMAL EXIT: TOO MANY MISSING WIND INPUT GRB2 FILES" + postmsg "$jlogfile" "$msg" + set +x + echo ' ' + echo '********************************************* ' + echo '*** FATAL ERROR : ERROR(S) IN WIND FILES *** ' + echo '********************************************* ' + echo ' ' + echo $msg + [[ "$LOUD" = YES ]] && set -x + echo "$WAV_MOD_TAG prep $date $cycle : fatal error in grib2 wind files." >> $wavelog + err=6;export err;${errchk} + fi + + rm -f cmdfile + +# 3.d Getwind data into single file + + set +x + echo ' ' + echo ' Concatenate extracted wind fields ...' + echo ' ' + [[ "$LOUD" = YES ]] && set -x + + files=`ls gwnd.* 2> /dev/null` + + if [ -z "$files" ] + then + msg="ABNORMAL EXIT: NO gwnd.* FILES FOUND" + postmsg "$jlogfile" "$msg" + set +x + echo ' ' + echo '******************************************** ' + echo '*** FATAL ERROR : CANNOT FIND WIND FILES *** ' + echo '******************************************** ' + echo ' ' + [[ "$LOUD" = YES ]] && set -x + echo "$WAV_MOD_TAG prep $date $cycle : no wind files found." >> $wavelog + err=7;export err;${errchk} + fi + + rm -f gfs.wind + + for file in $files + do + cat $file >> gfs.wind + rm -f $file + done + +# 3.e Run ww3_prnc + +# Convert gfs wind to netcdf + $WGRIB2 gfs.wind -netcdf gfs.nc + + for grdID in $WAVEWND_FID $curvID + do + + set +x + echo ' ' + echo " Running wind fields through preprocessor for grid $grdID" + echo ' ' + [[ "$LOUD" = YES ]] && set -x + + sed -e "s/HDRFL/T/g" ww3_prnc.wind.$grdID.tmpl > ww3_prnc.inp + ln -sf mod_def.$grdID mod_def.ww3 + + set +x + echo "Executing $EXECcode/ww3_prnc" + [[ "$LOUD" = YES ]] && set -x + + $EXECcode/ww3_prnc > prnc.out + err=$? + + if [ "$err" != '0' ] + then + msg="ABNORMAL EXIT: ERROR IN waveprnc" + postmsg "$jlogfile" "$msg" + set +x + echo ' ' + echo '*************************************** ' + echo '*** FATAL ERROR : ERROR IN waveprnc *** ' + echo '*************************************** ' + echo ' ' + [[ "$LOUD" = YES ]] && set -x + echo "$WAV_MOD_TAG prep $grdID $date $cycle : error in waveprnc." >> $wavelog + err=8;export err;${errchk} + fi + + if [ ! -f wind.ww3 ] + then + msg="ABNORMAL EXIT: FILE wind.ww3 MISSING" + postmsg "$jlogfile" "$msg" + set +x + echo ' ' + cat waveprep.out + echo ' ' + echo '****************************************' + echo '*** FATAL ERROR : wind.ww3 NOT FOUND ***' + echo '****************************************' + echo ' ' + [[ "$LOUD" = YES ]] && set -x + echo "$WAV_MOD_TAG prep $grdID $date $cycle : wind.ww3 missing." >> $wavelog + err=9;export err;${errchk} + fi + + rm -f mod_def.ww3 + rm -f ww3_prep.inp + + mv wind.ww3 wind.$grdID + mv times.WND times.$grdID + +# 3.f Check to make sure wind files are properly incremented + + first_pass='yes' + windOK='yes' + while read line + do + date1=`echo $line | cut -d ' ' -f 1` + date2=`echo $line | cut -d ' ' -f 2` + ymdh="$date1`echo $date2 | cut -c1-2`" + if [ "$first_pass" = 'no' ] + then + hr_inc=`$NHOUR $ymdh $ymdh_prev` + if [ "${hr_inc}" -gt "${WAV_WND_HOUR_INC}" ] + then + set +x + echo "Incorrect wind forcing increment at $ymdh" + [[ "$LOUD" = YES ]] && set -x + windOK='no' + fi + fi + ymdh_prev=$ymdh + first_pass='no' + done < times.$grdID + + if [ "$windOK" = 'no' ] + then + set +x + echo ' ' + echo '************************************************' + echo '*** ERROR : WIND DATA INCREMENT INCORRECT !! ***' + echo '************************************************' + echo ' ' + [[ "$LOUD" = YES ]] && set -x + echo "$WAV_MOD_TAG prep $grdID $date $cycle : error in wind increment." >> $wavelog + err=10;export err;${errchk} + fi + + done + + rm -f gfs.wind + rm -f mod_def.ww3 + rm -f ww3_prnc.inp + else + echo ' ' + echo " Wind input is not perturbed, single wnd file generated, skipping ${WAV_MOD_TAG}" + echo ' ' + + fi + + else + + echo ' ' + echo ' Atmospheric inputs not generated, this run did not request pre-processed winds ' + echo ' ' + + fi + +#------------------------------------------------------------------- +# CURR processing (not functional, TBD for uncoupled and GFSv16 cases) + + if [ "${WW3CURINP}" = 'YES' ]; then + +#------------------------------------------------------------------- +# 4. Process current fields +# 4.a Get into single file + if [ "${RUNMEM}" = "-1" ] || [ "${WW3CURIENS}" = "T" ] || [ "$waveMEMB" = "00" ] + then + + set +x + echo ' ' + echo ' Concatenate binary current fields ...' + echo ' ' + [[ "$LOUD" = YES ]] && set -x + +# Prepare files for cfp process + rm -f cmdfile + touch cmdfile + chmod 744 cmfile + + ymdh_rtofs=${PDY}00 # RTOFS runs once daily + ymdh_end=`$NDATE ${FHMAX_WAV_CUR} ${ymdh_rtofs}` + NDATE_DT=${WAV_CUR_HF_DT} + FLGHF='T' + + while [ "$ymdh_rtofs" -le "$ymdh_end" ] + do +# Timing has to be made relative to the single 00z RTOFS cycle for that PDY + fhr_rtofs=`${NHOUR} ${ymdh_rtofs} ${PDY}00` + fext='f' + + if [ ${fhr_rtofs} -lt 0 ] + then +# Data from nowcast phase + fhr_rtofs=`expr 48 + ${fhr_rtofs}` + fext='n' + fi + + fhr_rtofs=`printf "%03d\n" ${fhr_rtofs}` + + curfile1h=${COMIN_WAV_CUR}/rtofs_glo_2ds_${fext}${fhr_rtofs}_1hrly_prog.nc + curfile3h=${COMIN_WAV_CUR}/rtofs_glo_2ds_${fext}${fhr_rtofs}_3hrly_prog.nc + + if [ -s ${curfile1h} ] && [ "${FLGHF}" = "T" ] ; then + curfile=${curfile1h} + elif [ -s ${curfile3h} ]; then + curfile=${curfile3h} + FLGHF='F' + else + echo ' ' + set $setoff + echo ' ' + echo '************************************** ' + echo "*** FATAL ERROR: NO CUR FILE $curfile *** " + echo '************************************** ' + echo ' ' + set $seton + postmsg "$jlogfile" "FATAL ERROR - NO CURRENT FILE (RTOFS)" + err=11;export err;${errchk} + exit 0 + echo ' ' + fi + + echo "$USHwave/wave_prnc_cur.sh $ymdh_rtofs $curfile > cur_$ymdh_rtofs.out 2>&1" >> cmdfile + if [ $fhr_rtofs -ge ${WAV_CUR_HF_FH} ] ; then + NDATE_DT=${WAV_CUR_DT} + fi + ymdh_rtofs=`$NDATE $NDATE_DT $ymdh_rtofs` + done + +# Set number of processes for mpmd + wavenproc=`wc -l cmdfile | awk '{print $1}'` + wavenproc=`echo $((${wavenproc}<${NTASKS}?${wavenproc}:${NTASKS}))` + + set +x + echo ' ' + echo " Executing the copy command file at : `date`" + echo ' ------------------------------------' + echo ' ' + [[ "$LOUD" = YES ]] && set -x + + if [ $wavenproc -gt '1' ] + then + ${wavempexec} ${wavenproc} ${wave_mpmd} cmdfile + exit=$? + else + chmod 744 ./cmdfile + ./cmdfile + exit=$? + fi + + if [ "$exit" != '0' ] + then + set +x + echo ' ' + echo '********************************************' + echo '*** CMDFILE FAILED IN CUR GENERATION ***' + echo '********************************************' + echo ' See Details Below ' + echo ' ' + [[ "$LOUD" = YES ]] && set -x + fi + + files=`ls ${WAVECUR_FID}.* 2> /dev/null` + + if [ -z "$files" ] + then + msg="ABNORMAL EXIT: NO ${WAVECUR_FID}.* FILES FOUND" + postmsg "$jlogfile" "$msg" + set +x + echo ' ' + echo '******************************************** ' + echo '*** FATAL ERROR : CANNOT FIND CURR FILES *** ' + echo '******************************************** ' + echo ' ' + [[ "$LOUD" = YES ]] && set -x + echo "$WAV_MOD_TAG prep $date $cycle : no current files found." >> $wavelog + err=11;export err;${errchk} + fi + + rm -f cur.${WAVECUR_FID} + + for file in $files + do + cat $file >> cur.${WAVECUR_FID} + rm -f $file + done + + cp -f cur.${WAVECUR_FID} ${COMOUT}/rundata/${COMPONENTwave}.${WAVECUR_FID}.$cycle.cur + + else + echo ' ' + echo " Current input is not perturbed, single cur file generated, skipping ${WAV_MOD_TAG}" + echo ' ' + fi + + else + + echo ' ' + echo ' Current inputs not generated, this run did not request pre-processed currents ' + echo ' ' + + fi + +# --------------------------------------------------------------------------- # +# 5. Create ww3_multi.inp + +# 5.a ww3_multi template + + if [ -f $FIXwave/ww3_multi.${NET}.inp.tmpl ] + then + cp $FIXwave/ww3_multi.${NET}.inp.tmpl ww3_multi.inp.tmpl + fi + + if [ ! -f ww3_multi.inp.tmpl ] + then + msg="ABNORMAL EXIT: NO TEMPLATE FOR INPUT FILE" + postmsg "$jlogfile" "$msg" + set +x + echo ' ' + echo '************************************************ ' + echo '*** FATAL ERROR : NO TEMPLATE FOR INPUT FILE *** ' + echo '************************************************ ' + echo ' ' + echo "${WAV_MOD_TAG} fcst $date $cycle : ww3_multi file missing." >> $wavelog + echo $msg + [[ "$LOUD" = YES ]] && set -x + err=12;export err;${errchk} + fi + +# 5.b Buoy location file + + if [ -f $FIXwave/wave_${NET}.buoys ] + then + cp $FIXwave/wave_${NET}.buoys buoy.loc + fi + + if [ -f buoy.loc ] + then + set +x + echo " buoy.loc copied ($FIXwave/wave_${NET}.buoys)." + [[ "$LOUD" = YES ]] && set -x + else + set +x + echo " buoy.loc not found. **** WARNING **** " + [[ "$LOUD" = YES ]] && set -x + postmsg "$jlogfile" " FATAL ERROR : buoy.loc ($FIXwave/wave_${NET}.buoys) NOT FOUND" + touch buoy.loc + echo "$WAV_MOD_TAG fcst $date $cycle : no buoy locations file ($FIXwave/wave_${NET}.buoys)." >> $wavelog + err=13;export err;${errchk} + fi + +# Initialize inp file parameters + NFGRIDS=0 + NMGRIDS=0 + CPLILINE='$' + ICELINE='$' + ICEFLAG='no' + CURRLINE='$' + CURRFLAG='no' + WINDLINE='$' + WINDFLAG='no' + UNIPOINTS='$' + +# Check for required inputs and coupling options + if [ $waveuoutpGRD ] + then + UNIPOINTS="'$waveuoutpGRD'" + fi + +# Check if waveesmfGRD is set + if [ ${waveesmfGRD} ] + then + NFGRIDS=`expr $NFGRIDS + 1` + fi + + case ${WW3ATMINP} in + 'YES' ) + NFGRIDS=`expr $NFGRIDS + 1` + WINDLINE=" '$WAVEWND_FID' F F T F F F F" + WINDFLAG="$WAVEWND_FID" + ;; + 'CPL' ) + WINDFLAG="CPL:${waveesmfGRD}" + WNDIFLAG='T' + CPLILINE=" '${waveesmfGRD}' F F T F F F F" + ;; + esac + + case ${WW3ICEINP} in + 'YES' ) + NFGRIDS=`expr $NFGRIDS + 1` + ICELINE=" '$WAVEICE_FID' F F F T F F F" + ICEFLAG="$WAVEICE_FID" + ;; + 'CPL' ) + ICEFLAG="CPL:${waveesmfGRD}" + ICEIFLAG='T' + CPLILINE=" '${waveesmfGRD}' F F ${WNDIFLAG} T F F F" + ;; + esac + + case ${WW3CURINP} in + 'YES' ) + NFGRIDS=`expr $NFGRIDS + 1` + CURRLINE=" '$WAVECUR_FID' F T F F F F F" + CURRFLAG="$WAVECUR_FID" + ;; + 'CPL' ) + CURRFLAG="CPL:${waveesmfGRD}" + CURIFLAG='T' + CPLILINE=" '${waveesmfGRD}' F T ${WNDIFLAG} ${ICEIFLAG} F F F" + ;; + esac + + unset agrid + agrid= + gline= + GRDN=0 +# grdGRP=1 # Single group for now + for grid in ${waveGRD} + do + GRDN=`expr ${GRDN} + 1` + agrid=( ${agrid[*]} ${grid} ) + NMGRIDS=`expr $NMGRIDS + 1` + gridN=`echo $waveGRDN | awk -v i=$GRDN '{print $i}'` + gridG=`echo $waveGRDG | awk -v i=$GRDN '{print $i}'` + gline="${gline}'${grid}' 'no' 'CURRFLAG' 'WINDFLAG' 'ICEFLAG' 'no' 'no' 'no' ${gridN} ${gridG} 0.00 1.00 F\n" + done + gline="${gline}\$" + echo $gline + + sed -e "s/NFGRIDS/$NFGRIDS/g" \ + -e "s/NMGRIDS/${NMGRIDS}/g" \ + -e "s/FUNIPNT/${FUNIPNT}/g" \ + -e "s/PNTSRV/${PNTSRV}/g" \ + -e "s/FPNTPROC/${FPNTPROC}/g" \ + -e "s/FGRDPROC/${FGRDPROC}/g" \ + -e "s/OUTPARS/${OUTPARS_WAV}/g" \ + -e "s/CPLILINE/${CPLILINE}/g" \ + -e "s/UNIPOINTS/${UNIPOINTS}/g" \ + -e "s/GRIDLINE/${gline}/g" \ + -e "s/ICELINE/$ICELINE/g" \ + -e "s/CURRLINE/$CURRLINE/g" \ + -e "s/WINDLINE/$WINDLINE/g" \ + -e "s/ICEFLAG/$ICEFLAG/g" \ + -e "s/CURRFLAG/$CURRFLAG/g" \ + -e "s/WINDFLAG/$WINDFLAG/g" \ + -e "s/RUN_BEG/$time_beg/g" \ + -e "s/RUN_END/$time_end/g" \ + -e "s/OUT_BEG/$time_beg_out/g" \ + -e "s/OUT_END/$time_end/g" \ + -e "s/DTFLD/ $DTFLD_WAV/g" \ + -e "s/GOFILETYPE/ $GOFILETYPE/g" \ + -e "s/POFILETYPE/ $POFILETYPE/g" \ + -e "s/FIELDS/$FIELDS/g" \ + -e "s/DTPNT/ $DTPNT_WAV/g" \ + -e "/BUOY_FILE/r buoy.loc" \ + -e "s/BUOY_FILE/DUMMY/g" \ + -e "s/RST_BEG/$time_rst_ini/g" \ + -e "s/RSTTYPE/$RSTTYPE_WAV/g" \ + -e "s/RST_2_BEG/$time_rst2_ini/g" \ + -e "s/DTRST/$DT_1_RST_WAV/g" \ + -e "s/DT_2_RST/$DT_2_RST_WAV/g" \ + -e "s/RST_END/$time_rst1_end/g" \ + -e "s/RST_2_END/$time_rst2_end/g" \ + ww3_multi.inp.tmpl | \ + sed -n "/DUMMY/!p" > ww3_multi.inp + + rm -f ww3_multi.inp.tmpl buoy.loc + + if [ -f ww3_multi.inp ] + then + echo " Copying file ww3_multi.${WAV_MOD_TAG}.inp to $COMOUT " + cp ww3_multi.inp ${COMOUT}/rundata/ww3_multi.${WAV_MOD_TAG}.$cycle.inp + else + echo "FATAL ERROR: file ww3_multi.${WAV_MOD_TAG}.$cycle.inp NOT CREATED, ABORTING" + err=13;export err;${errchk} + fi + +# 6. Copy rmp grid remapping pre-processed coefficients + + if ls $FIXwave/rmp_src_to_dst_conserv_* 2> /dev/null + then + for file in $(ls $FIXwave/rmp_src_to_dst_conserv_*) ; do + cp -f $file ${COMOUT}/rundata + done + else + msg="NO rmp precomputed nc files found, is this OK???" + postmsg "$jlogfile" "$msg" + set +x + echo ' ' + echo '************************************************ ' + echo '*** FATAL ERROR : NO PRECOMPUTED RMP FILES FOUND *** ' + echo '************************************************ ' + echo ' ' + echo "${WAV_MOD_TAG} prep $date $cycle : rmp*.nc not found." >> $wavelog + echo $msg + [[ "$LOUD" = YES ]] && set -x + err=13;export err;${errchk} + fi + + +# --------------------------------------------------------------------------- # +# 6. Output to /com + + if [ "$SENDCOM" = 'YES' ] + then + + if [ "${WW3ATMINP}" = 'YES' ]; then + + for grdID in $WAVEWND_FID $curvID + do + set +x + echo ' ' + echo " Saving wind.$grdID as $COMOUT/rundata/${WAV_MOD_TAG}.$grdID.$PDY$cyc.wind" + echo " Saving times.$grdID file as $COMOUT/rundata/${WAV_MOD_TAG}.$grdID.$PDY$cyc.$grdID.wind.times" + echo ' ' + [[ "$LOUD" = YES ]] && set -x + cp wind.$grdID $COMOUT/rundata/${WAV_MOD_TAG}.$grdID.$PDY$cyc.wind + cp times.$grdID $COMOUT/rundata/${WAV_MOD_TAG}.$grdID.$PDY$cyc.$grdID.wind.times + done + fi + +# if [ "${WW3CURINP}" = 'YES' ]; then +# +# for grdID in $WAVECUR_FID +# do +# set +x +# echo ' ' +# echo " Saving cur.$grdID as $COMOUT/rundata/${WAV_MOD_TAG}.$grdID.$PDY$cyc.cur" +# echo ' ' +# [[ "$LOUD" = YES ]] && set -x +# cp cur.$grdID $COMOUT/rundata/${WAV_MOD_TAG}.$grdID.$PDY$cyc.cur +# done +# fi + fi + + rm -f wind.* + rm -f $WAVEICE_FID.* + rm -f times.* + +# --------------------------------------------------------------------------- # +# 7. Ending output + + set +x + echo ' ' + echo "Ending at : `date`" + echo ' ' + echo ' *** End of MWW3 preprocessor ***' + echo ' ' + [[ "$LOUD" = YES ]] && set -x + + msg="$job completed normally" + postmsg "$jlogfile" "$msg" + +# End of MWW3 preprocessor script ------------------------------------------- # diff --git a/sorc/build_fv3_coupled.sh b/sorc/build_fv3_coupled.sh index 9471f45e00..b7ea3cc038 100755 --- a/sorc/build_fv3_coupled.sh +++ b/sorc/build_fv3_coupled.sh @@ -18,6 +18,6 @@ fi if [ $target = theia ]; then target=theia.intel ; fi -cd fv3_coupled.fd/ -./NEMS/NEMSAppBuilder rebuild app=coupledFV3_MOM6_CICE -mv ./NEMS/exe/NEMS.x ./NEMS/exe/nems_fv3_mom6_cice5.x +cd fv3_coupled.fd/NEMS +make -j 8 app=coupledFV3_CCPP_MOM6_CICE_WW3 build +mv ./exe/NEMS.x ./exe/nems_fv3_ccpp_mom6_cice5_ww3.x diff --git a/sorc/checkout.sh b/sorc/checkout.sh index 30f7059702..70ac21bdd7 100755 --- a/sorc/checkout.sh +++ b/sorc/checkout.sh @@ -16,7 +16,7 @@ rm -f ${topdir}/checkout-fv3_coupled.log if [[ ! -d fv3_coupled.fd ]] ; then git clone https://github.com/ufs-community/ufs-s2s-model fv3_coupled.fd >> ${topdir}/checkout-fv3_coupled.log 2>&1 cd fv3_coupled.fd - git checkout v3.1 + git checkout s2s_prototype4.0 git submodule update --init --recursive cd ${topdir} else diff --git a/sorc/link_fv3gfs.sh b/sorc/link_fv3gfs.sh index a2177b5a55..1cf2eb4878 100755 --- a/sorc/link_fv3gfs.sh +++ b/sorc/link_fv3gfs.sh @@ -52,29 +52,18 @@ elif [ $target == "gaea" ]; then elif [ $target == "jet" ]; then FIX_DIR="/lfs3/projects/hfv3gfs/glopara/git/fv3gfs/fix" elif [ $target == "hera" ]; then - FIX_DIR="/scratch1/NCEPDEV/global/glopara/fix" + FIX_DIR="/scratch2/NCEPDEV/climate/climpara/S2S/FIX/fix_UFSp4" elif [ $target == "orion" ]; then - FIX_DIR="/work/noaa/marine/jmeixner/tempFixICdir/fix/fix_prep_benchmark3" + FIX_DIR="/work/noaa/marine/jmeixner/tempFixICdir/fix_UFSp4" else echo 'CRITICAL: links to fix files not set' [[ $machine != orion ]] && exit 1 fi -cd ${pwd}/../fix ||exit 8 -for dir in fix_am fix_fv3 fix_orog fix_fv3_gmted2010 fix_verif ; do - [[ -d $dir ]] && rm -rf $dir -done -$LINK $FIX_DIR/* . - -if [ ! -r $FIX_DIR ]; then - echo "CRITICAL: you do not of read permissions to the location of the fix file $FIX_DIR" - exit -1 -fi - if [ ! -z $FIX_DIR ]; then if [ ! -d ${pwd}/../fix ]; then mkdir ${pwd}/../fix; fi cd ${pwd}/../fix ||exit 8 - for dir in fix_am fix_fv3 fix_orog fix_fv3_gmted2010 ; do + for dir in fix_am fix_fv3 fix_orog fix_fv3_gmted2010 fix_verif ; do [[ -d $dir ]] && rm -rf $dir done $LINK $FIX_DIR/* . @@ -85,15 +74,6 @@ if [ ! -r $FIX_DIR ]; then exit -1 fi -if [ ! -z $FIX_DIR ]; then - if [ ! -d ${pwd}/../fix ]; then mkdir ${pwd}/../fix; fi - cd ${pwd}/../fix ||exit 8 - for dir in fix_am fix_fv3 fix_orog fix_fv3_gmted2010 ; do - [[ -d $dir ]] && rm -rf $dir - done - $LINK $FIX_DIR/* . -fi - #--------------------------------------- #--add files from external repositories #--------------------------------------- @@ -222,8 +202,8 @@ cd ${pwd}/../ush ||exit 8 cd $pwd/../exec if [ $model == "coupled" ]; then -[[ -s nems_fv3_mom6_cice5.x ]] && rm -f nems_fv3_mom6_cice5.x -$LINK ../sorc/fv3_coupled.fd/NEMS/exe/nems_fv3_mom6_cice5.x . +[[ -s nems_fv3_ccpp_mom6_cice5_ww3.x ]] && rm -f nems_fv3_ccpp_mom6_cice5_ww3.x +$LINK ../sorc/fv3_coupled.fd/NEMS/exe/nems_fv3_ccpp_mom6_cice5_ww3.x . else [[ -s global_fv3gfs.x ]] && rm -f global_fv3gfs.x $LINK ../sorc/fv3gfs.fd/NEMS/exe/global_fv3gfs.x . @@ -298,20 +278,6 @@ if [ $target = wcoss_dell_p3 ]; then $LINK ../sorc/gfs_wafs.fd/exec/$wafsexe . done fi - -#cd ${pwd} -#cd gsi.fd -#gsi_branch=`git branch | grep \*` -#cd ../fv3gfs.fd -#fv3gfs_branch=`git branch | grep \*` -#cd ../gfs_post.fd -#gfspost_branch=`git branch | grep \*` - -#set +x -#echo "FV3 Branch: $fv3gfs_branch" -#echo "GSI Branch: $gsi_branch" -#echo "POST Branch: $gfspost_branch" - #------------------------------ #--link source code directories @@ -355,6 +321,17 @@ cd ${pwd}/../sorc || exit 8 fi +#Link CCPP Suite files: +cd $pwd/../fix +[[ -d fix_ccpp_suites ]] && rm -rf fix_ccpp_suites +if [ $model == "coupled" ]; then +$SLINK ../sorc/fv3_coupled.fd/FV3/ccpp/suites fix_ccpp_suites +else +$SLINK ../sorc/fv3gfs.fd/FV3/ccpp/suites fix_ccpp_suites +fi + + + #------------------------------ #--choose dynamic config.base for EMC installation #--choose static config.base for NCO installation @@ -369,19 +346,14 @@ fi if [ $model = "coupled" ] ; then rm -f config.base cp -p config.base.emc.dyn_coupled config.base - if [ $machine = "theia" ] ; then - CPLFIX_DIR="/scratch4/NCEPDEV/nems/save/Bin.Li/fix_prep_benchmark2" - elif [ $machine = "hera" ] ; then - CPLFIX_DIR="/scratch2/NCEPDEV/climate/Bin.Li/S2S/fix/fix_prep_benchmark3" - fi -cd $pwd/../fix -# Add fixed files needed for coupled fv3-mom6-cice5 -#$LINK $CPLFIX_DIR/fix_fv3 . -#$LINK $CPLFIX_DIR/fix_fv3_gmted2010 . -$LINK $CPLFIX_DIR/fix_ocnice . -$LINK $CPLFIX_DIR/fix_cice5 . -$LINK $CPLFIX_DIR/fix_mom6 . -$LINK $CPLFIX_DIR/fix_fv3grid . + cd $pwd/../fix + # Add fixed files needed for coupled ufs-s2s-model + $LINK $FIX_DIR/fix_ocnice . + $LINK $FIX_DIR/fix_cice5 . + $LINK $FIX_DIR/fix_mom6 . + $LINK $FIX_DIR/fix_fv3grid . + $LINK $FIX_DIR/fix_cpl . + $LINK $FIX_DIR/fix_wav . fi exit 0 diff --git a/ush/forecast_det.sh b/ush/forecast_det.sh index 162fa4503d..a61471a867 100755 --- a/ush/forecast_det.sh +++ b/ush/forecast_det.sh @@ -74,30 +74,8 @@ WW3_det(){ CICE_det(){ echo "SUB ${FUNCNAME[0]}: Run type determination for CICE" - export histfreq_n=$FHOUT - - # Create ice_in file - - if [ $inistep = "restart" ] ; then - runtyp=continue - restim=.true. - else - runtyp=initial - restim=.false. - fi } MOM6_det(){ echo "SUB ${FUNCNAME[0]}: Run type determination for MOM6" - export histfreq_n=$FHOUT - - # Create ice_in file - - if [ $inistep = "restart" ] ; then - runtyp=continue - restim=.true. - else - runtyp=initial - restim=.false. - fi } diff --git a/ush/forecast_postdet.sh b/ush/forecast_postdet.sh index 6e2dc8521c..8bf2ff4c24 100755 --- a/ush/forecast_postdet.sh +++ b/ush/forecast_postdet.sh @@ -17,18 +17,19 @@ FV3_GEFS_postdet(){ } DATM_postdet(){ -###################################################################### -# 3.1 Link DATM inputs (ie forcing files) # -###################################################################### - -#TODO: This should be some loop through CDATE-> CDATE+ FORECAST length -#and get input from either CFSR or GEFS or Whatever... -#Currently assumes you only need the month of DATM input for IC date - -# DATM forcing file name convention is ${DATM_FILENAME_BASE}.$YYYYMMDDHH.nc -echo "Link DATM forcing files" -DATMINPUTDIR="/scratch2/NCEPDEV/marineda/DATM_INPUT/CFSR/${SYEAR}${SMONTH}" -ln -sf ${DATMINPUTDIR}/${DATM_FILENAME_BASE}*.nc $DATA/DATM_INPUT/ + ###################################################################### + # Link DATM inputs (ie forcing files) # + ###################################################################### + + #TODO: This should be some loop through CDATE-> CDATE+ FORECAST length + #and get input from either CFSR or GEFS or Whatever... + #Currently assumes you only need the month of DATM input for IC date + #DATMINPUTDIR should be machine specific + + # DATM forcing file name convention is ${DATM_FILENAME_BASE}.$YYYYMMDDHH.nc + echo "Link DATM forcing files" + DATMINPUTDIR="/scratch2/NCEPDEV/marineda/DATM_INPUT/CFSR/${SYEAR}${SMONTH}" + $NLN -sf ${DATMINPUTDIR}/${DATM_FILENAME_BASE}*.nc $DATA/DATM_INPUT/ } FV3_GFS_postdet(){ @@ -177,10 +178,15 @@ EOF $NLN $FIXfv3/$CASE/${CASE}_grid.tile${n}.nc $DATA/INPUT/${CASE}_grid.tile${n}.nc $NLN $FIXfv3/$CASE/${CASE}_oro_data.tile${n}.nc $DATA/INPUT/oro_data.tile${n}.nc done - if [ $cpl = ".false." ] ; then + if [ $cplflx = ".false." ] ; then $NLN $FIXfv3/$CASE/${CASE}_mosaic.nc $DATA/INPUT/grid_spec.nc + else + $NLN $FIXfv3/$CASE/${CASE}_mosaic.nc $DATA/INPUT/${CASE}_mosaic.nc fi + # CCPP Suite file + $NCP -p $FIX_DIR/fix_ccpp_suites/suite_${CCPP_SUITE}.xml $DATA/ + # GFS standard input data IALB=${IALB:-1} @@ -401,6 +407,9 @@ EOF #------------------------------------------------------------------ # make symbolic links to write forecast files directly in memdir cd $DATA + if [ $inistep = 'cold' ]; then + echo "Not making links of output for mediator cold start" + else if [ $QUILTING = ".true." -a $OUTPUT_GRID = "gaussian_grid" ]; then fhr=$FHMIN while [ $fhr -le $FHMAX ]; do @@ -429,6 +438,7 @@ EOF eval $NLN atmos_4xdaily.tile${n}.nc $memdir/atmos_4xdaily.tile${n}.nc done fi + fi } FV3_GFS_nml(){ @@ -459,6 +469,7 @@ data_out_GFS() # make symbolic links to write forecast files directly in memdir echo "SUB ${FUNCNAME[0]}: copying output data for FV3" #------------------------------------------------------------------ + if [ $SEND = "YES" ]; then # Copy model restart files if [ $CDUMP = "gdas" -a $restart_interval -gt 0 ]; then @@ -485,6 +496,9 @@ if [ $SEND = "YES" ]; then done fi fi + +$NCP -p $DATA/input.nml $COMOUT/ + echo "SUB ${FUNCNAME[0]}: Output data for FV3 copied" } @@ -511,22 +525,26 @@ MOM6_postdet() { echo "SUB ${FUNCNAME[0]}: MOM6 after run type determination" - # Copy MOM6 ICs (from CFSv2 file) - cp -pf $ICSDIR/$CDATE/mom6_da/MOM*nc $DATA/INPUT/ + OCNRES=${OCNRES:-"025"} + + # Copy MOM6 ICs + $NCP -pf $ICSDIR/$CDATE/ocn/MOM*nc $DATA/INPUT/ # Copy MOM6 fixed files - cp -pf $FIXmom/INPUT/* $DATA/INPUT/ - cp -pf $FIXmom/INPUT/MOM_input_with_runoff $DATA/INPUT/MOM_input + $NCP -pf $FIXmom/$OCNRES/* $DATA/INPUT/ + + # Copy MOM6 input file + $NCP -pf $HOMEgfs/parm/mom6/MOM_input_$OCNRES $DATA/INPUT/MOM_input + + #TODO: if cplwav, copy MOM_input_$OCNRES_wav + #TODO: update to make MOM_input configurable - # Copy grid_spec and mosaic files - cp -pf $FIXgrid/$CASE/${CASE}_mosaic* $DATA/INPUT/ - cp -pf $FIXgrid/$CASE/grid_spec.nc $DATA/INPUT/ - cp -pf $FIXgrid/$CASE/ocean_mask.nc $DATA/INPUT/ - cp -pf $FIXgrid/$CASE/land_mask* $DATA/INPUT/ + # Copy coupled grid_spec + $NCP -pf $FIX_DIR/fix_cpl/a${CASE}o${OCNRES}/grid_spec.nc $DATA/INPUT/ # Copy mediator restart files to RUNDIR - if [ $runtyp = 'continue' ]; then - cp $ROTDIR/$CDUMP.$PDY/$cyc/mediator_* $DATA/ + if [ $inistep = 'restart' ]; then + $NCP $ROTDIR/$CDUMP.$PDY/$cyc/mediator_* $DATA/ fi echo "SUB ${FUNCNAME[0]}: MOM6 input data linked/copied" @@ -556,61 +574,57 @@ MOM6_out() fi [[ ! -d $COMOUT ]] && mkdir -m 775 -p $COMOUT - if [ $runtyp = 'initial' ]; then + if [ $inistep = 'cold' ]; then cp $DATA/mediator_* $COMOUT/ status=$? exit $status - fi - - if [ $FHRGRP -eq 0 ]; then - fhrlst="anl" else - fhrlst=$(echo $FHRLST | sed -e 's/_/ /g; s/\[/ /g; s/\]/ /g; s/f/ /g; s/,/ /g') - fi - # copy ocn files - for fhr in $fhrlst; do - export fhr=$fhr - if [[ 10#$fhr -ge 6 ]]; then - hh_inc_m=$((10#$FHOUT/2)) - #hh_inc_m=3 - #hh_in_o=6 - hh_inc_o=$((10#$FHOUT )) + if [ $FHRGRP -eq 0 ]; then + fhrlst="anl" + else + fhrlst=$(echo $FHRLST | sed -e 's/_/ /g; s/\[/ /g; s/\]/ /g; s/f/ /g; s/,/ /g') + fi + + # copy ocn files + for fhr in $fhrlst; do + export fhr=$fhr + if [[ 10#$fhr -ge 6 ]]; then + hh_inc_m=$((10#$FHOUT/2)) + hh_inc_o=$((10#$FHOUT )) # ------------------------------------------------------ # adjust the dates on the mom filenames and save # ------------------------------------------------------ - VDATE=$($NDATE $fhr $IDATE) - YYYY=`echo $VDATE | cut -c1-4` - MM=`echo $VDATE | cut -c5-6` - DD=`echo $VDATE | cut -c7-8` - HH=`echo $VDATE | cut -c9-10` - SS=$((10#$HH*3600)) - - # m_date=$($NDATE $hh_inc_m $DDATE) - # p_date=$($NDATE $hh_inc_o $DDATE) - - m_date=$($NDATE -$hh_inc_m $VDATE) - p_date=$VDATE - - # This loop probably isn't needed - year=`echo $m_date | cut -c1-4` - month=`echo $m_date | cut -c5-6` - day=`echo $m_date | cut -c7-8` - hh=`echo $m_date | cut -c9-10` - - export ocnfile=ocn_${year}_${month}_${day}_${hh}.nc - - echo "cp -p $ocnfile $COMOUT/ocn$p_date.$ENSMEM.$IDATE.nc" - $NCP -p $ocnfile $COMOUT/ocn$p_date.$ENSMEM.$IDATE.nc - status=$? - [[ $status -ne 0 ]] && exit $status - fi - done - $NCP -p $DATA/SST*nc $COMOUT/ - $NCP -p $DATA/input.nml $COMOUT/ - $NCP -p $DATA/ice_in $COMOUT/ - $NCP -p $DATA/INPUT/MOM_input $COMOUT/ + VDATE=$($NDATE $fhr $IDATE) + YYYY=`echo $VDATE | cut -c1-4` + MM=`echo $VDATE | cut -c5-6` + DD=`echo $VDATE | cut -c7-8` + HH=`echo $VDATE | cut -c9-10` + SS=$((10#$HH*3600)) + + m_date=$($NDATE -$hh_inc_m $VDATE) + p_date=$VDATE + + year=`echo $m_date | cut -c1-4` + month=`echo $m_date | cut -c5-6` + day=`echo $m_date | cut -c7-8` + hh=`echo $m_date | cut -c9-10` + + export ocnfile=ocn_${year}_${month}_${day}_${hh}.nc + + echo "$NCP -p $ocnfile $COMOUT/ocn$p_date.$ENSMEM.$IDATE.nc" + $NCP -p $ocnfile $COMOUT/ocn$p_date.$ENSMEM.$IDATE.nc + status=$? + [[ $status -ne 0 ]] && exit $status + + fi + + done + $NCP -p $DATA/ocn_daily*nc $COMOUT/ + $NCP -p $DATA/wavocn*nc $COMOUT/ #temporary for p4 + $NCP -p $DATA/INPUT/MOM_input $COMOUT/ + fi } CICE_postdet() @@ -618,57 +632,64 @@ CICE_postdet() echo "SUB ${FUNCNAME[0]}: CICE after run type determination" year=$(echo $CDATE|cut -c 1-4) - #BL2018 stepsperhr=$((3600/$ICETIM)) - #BL2018 - #nhours=$(${NHOUR} ${CDATE} ${SYEAR}010100) nhours=$($NHOUR $CDATE ${year}010100) istep0=$((nhours*stepsperhr)) steps=$((nhours*stepsperhr)) npt=$((FHMAX*$stepsperhr)) # Need this in order for dump_last to work histfreq_n=${histfreq_n:-6} - restart_interval=${restart_interval:-1296000} # restart write interval in seconds, default 15 days - dumpfreq_n=$restart_interval # restart write interval in seconds - - #BL2018 - #dumpfreq='d' - #dumpfreq='s' - if [ -d $ROTDIR/../NEXT_IC ]; then - #continuing run "hot start" - RUNTYPE='continue' - USE_RESTART_TIME='.true.' - restart_pond_lvl=${restart_pond_lvl:-".true."} - else + if [ $inistep = 'cold' ]; then + dumpfreq_n=${dumpfreq_n:-3600} # restart write interval in seconds, default 1 hour + dumpfreq="s" + else + dumpfreq_n=${dumpfreq_n:-3024000} # restart write interval in seconds, default 35 days + dumpfreq=${dumpfreq:-"s"} # "s" or "d" or "m" for restarts at intervals of "seconds", "days" or "months" + fi + cice_hist_avg=${cice_hist_avg:-".true."} + + FRAZIL_FWSALT=${FRAZIL_FWSALT:-".true."} + tr_pond_lvl=${tr_pond_lvl:-".true."} # Use level melt ponds tr_pond_lvl=true + + # restart_pond_lvl (if tr_pond_lvl=true): + # -- if true, initialize the level ponds from restart (if runtype=continue) + # -- if false, re-initialize level ponds to zero (if runtype=initial or continue) + + #TODO: Determine the proper way to determine if it's a 'hot start' or not + #note this is not mediator cold start or not + #if [ hotstart ]; then + # #continuing run "hot start" + # RUNTYPE='continue' + # USE_RESTART_TIME='.true.' + # restart_pond_lvl=${restart_pond_lvl:-".true."} + #else #using cold start IC RUNTYPE='initial' USE_RESTART_TIME='.false.' restart_pond_lvl=${restart_pond_lvl:-".false."} - fi + #fi - dumpfreq_n=${dumpfreq_n:-"${restart_interval}"} - dumpfreq=${dumpfreq:-"s"} # "s" or "d" or "m" for restarts at intervals of "seconds", "days" or "months" + ICERES=${ICERES:-"025"} + if [ $ICERES = '025' ]; then + ICERESmx="mx025" + ICERESdec="0.25" + fi + if [ $ICERES = '050' ]; then + ICERESmx="mx050" + ICERESdec="0.50" + fi - iceres=${iceres:-"mx025"} - ice_grid_file=${ice_grid_file:-"grid_cice_NEMS_${iceres}.nc"} - ice_kmt_file=${ice_kmt_file:-"kmtu_cice_NEMS_${iceres}.nc"} + ice_grid_file=${ice_grid_file:-"grid_cice_NEMS_${ICERESmx}.nc"} + ice_kmt_file=${ice_kmt_file:-"kmtu_cice_NEMS_${ICERESmx}.nc"} - #TODO iceic name... this might need to be update? iceic="cice5_model.res_$CDATE.nc" - # Copy CICE5 IC - pre-generated from CFSv2 - cp -p $ICSDIR/$CDATE/cice5_model_0.25.res_$CDATE.nc $DATA/$iceic - #cp -p $ICSDIR/$CDATE/cpc/cice5_model_0.25.res_$CDATE.nc ./cice5_model.res_$CDATE.nc + # Copy CICE5 IC + $NCP -p $ICSDIR/$CDATE/ice/cice5_model_${ICERESdec}.res_$CDATE.nc $DATA/$iceic echo "Link CICE fixed files" - ln -sf $FIXcice/${ice_grid_file} $DATA/ - ln -sf $FIXcice/${ice_kmt_file} $DATA/ - - # Copy grid_spec and mosaic files - cp -pf $FIXgrid/$CASE/${CASE}_mosaic* $DATA/INPUT/ - cp -pf $FIXgrid/$CASE/grid_spec.nc $DATA/INPUT/ - cp -pf $FIXgrid/$CASE/ocean_mask.nc $DATA/INPUT/ - cp -pf $FIXgrid/$CASE/land_mask* $DATA/INPUT/ + $NLN -sf $FIXcice/${ice_grid_file} $DATA/ + $NLN -sf $FIXcice/${ice_kmt_file} $DATA/ } CICE_nml() @@ -681,8 +702,12 @@ CICE_nml() CICE_out() { echo "SUB ${FUNCNAME[0]}: Copying output data for CICE" + if [ $inistep = 'cold' ]; then + echo "mediator cold start, no copying of data for CICE" + else export ENSMEM=${ENSMEM:-01} export IDATE=$CDATE + $NCP -p $DATA/ice_in $COMOUT/ if [ $FHRGRP -eq 0 ]; then fhrlst="anl" else @@ -707,8 +732,6 @@ CICE_out() HH=`echo $VDATE | cut -c9-10` SS=$((10#$HH*3600)) - # DDATE=$($NDATE -$FHOUT $VDATE) - if [[ 10#$fhr -eq 0 ]]; then $NCP -p $DATA/history/iceh_ic.${YYYY0}-${MM0}-${DD0}-`printf "%5.5d" ${SS0}`.nc $COMOUT/iceic$VDATE.$ENSMEM.$IDATE.nc status=$? @@ -721,6 +744,7 @@ CICE_out() fi done + fi } GSD_in() diff --git a/ush/hpssarch_gen.sh b/ush/hpssarch_gen.sh index 1d5031f181..1355bb03f2 100755 --- a/ush/hpssarch_gen.sh +++ b/ush/hpssarch_gen.sh @@ -42,22 +42,42 @@ if [ $type = "gfs" ]; then head="gfs.t${cyc}z." # for coupled model -if [ $cpl = ".true." ]; then - echo "cpl=",$cpl +if [ $cplflx = ".true." ]; then + echo "cplflx=",$cplflx + rm -f gfs_pgrb2b_1p00.txt + rm -f gfs_pgrb2b_0p25.txt rm -f gfs_flux_1p00.txt - rm -f ocn.txt - rm -f ocn2.txt + rm -f ocn.txt + rm -f ocn_2D.txt + rm -f ocn_3D.txt + rm -f ocn_xsect.txt + rm -f log.txt rm -f ice.txt - rm -f SST.txt + rm -f ocn_daily.txt + rm -f wavocn.txt touch gfs_flux_1p00.txt - touch ocn.txt - touch ocn2.txt - touch ice.txt - touch SST.txt + touch gfs_pgrb2b_1p00.txt + touch gfs_pgrb2b_0p25.txt + touch ocn.txt + touch ocn_2D.txt + touch ocn_3D.txt + touch ocn_xsect.txt + touch ocn_daily.txt + touch log.txt + touch ice.txt + touch wavocn.txt echo "${dirname}ice*nc " >>ice.txt - echo "${dirname}ocn*nc " >>ocn.txt - echo "${dirname}ocn_ice*grb2 " >>ocn2.txt - echo "${dirname}SST*nc " >>SST.txt + echo "${dirname}ocn_2D* " >>ocn_2D.txt + echo "${dirname}ocn_3D* " >>ocn_3D.txt + echo "${dirname}ocn*EQ* " >>ocn_xsect.txt + echo "${dirname}ocn_daily* " >>ocn_daily.txt + echo "${dirname}wavocn* " >>wavocn.txt + echo "${dirname}input.nml " >>log.txt + echo "${dirname}ice_in " >>log.txt + echo "${dirname}MOM_input " >>log.txt + echo "./logs/${CDATE}/gfs*.log " >>log.txt + echo "${dirname}${head}logf*.nemsio " >>log.txt + echo "${dirname}ocn_ice*grb2 " >>ocn.txt echo "${dirname}${head}flux.1p00.f??? " >>gfs_flux_1p00.txt echo "${dirname}${head}flux.1p00.f???.idx " >>gfs_flux_1p00.txt fi @@ -95,11 +115,15 @@ fi fh=0 while [ $fh -le $FHMAX_GFS ]; do fhr=$(printf %03i $fh) - echo "${dirname}${head}pgrb2b.0p25.f${fhr} " >>gfs_pgrb2b.txt - echo "${dirname}${head}pgrb2b.0p25.f${fhr}.idx " >>gfs_pgrb2b.txt - echo "${dirname}${head}pgrb2b.0p50.f${fhr} " >>gfs_pgrb2b.txt - echo "${dirname}${head}pgrb2b.0p50.f${fhr}.idx " >>gfs_pgrb2b.txt + if [ $cplflx = ".true." ]; then + echo "${dirname}${head}pgrb2b.0p25.f${fhr} " >>gfs_pgrb2b_0p25.txt + echo "${dirname}${head}pgrb2b.0p25.f${fhr}.idx " >>gfs_pgrb2b_0p25.txt + echo "${dirname}${head}pgrb2b.1p00.f${fhr} " >>gfs_pgrb2b_1p00.txt + echo "${dirname}${head}pgrb2b.1p00.f${fhr}.idx " >>gfs_pgrb2b_1p00.txt + echo "${dirname}${head}flux.1p00.f${fhr} " >>gfs_flux_1p00.txt + echo "${dirname}${head}flux.1p00.f${fhr}.idx " >>gfs_flux_1p00.txt + fi echo "${dirname}${head}sfluxgrbf${fhr}.grib2 " >>gfs_flux.txt echo "${dirname}${head}sfluxgrbf${fhr}.grib2.idx " >>gfs_flux.txt @@ -146,6 +170,27 @@ fi echo "${dirname}RESTART/${PDY}.${cyc}0000.sfcanl_data.tile5.nc " >>gfs_restarta.txt echo "${dirname}RESTART/${PDY}.${cyc}0000.sfcanl_data.tile6.nc " >>gfs_restarta.txt + #.................. + if [ $DO_WAVE = "YES" ]; then + + rm -rf gfswave.txt + touch gfswave.txt + rm -rf gfswave_restart.txt + touch gfswave_restart.txt + + dirpath="gfswave.${PDY}/${cyc}/" + dirname="./${dirpath}" + + head="gfswave.t${cyc}z." + + #........................... + echo "${dirname}gridded/${head}* " >>gfswave.txt + echo "${dirname}station/${head}* " >>gfswave.txt + + echo "${dirname}restart/* " >>gfswave_restart.txt + + fi + #----------------------------------------------------- fi ##end of gfs #----------------------------------------------------- @@ -224,6 +269,28 @@ if [ $type = "gdas" ]; then #.................. echo "${dirname}RESTART " >>gdas_restartb.txt + #.................. + if [ $DO_WAVE = "YES" ]; then + + rm -rf gdaswave.txt + touch gdaswave.txt + rm -rf gdaswave_restart.txt + touch gdaswave_restart.txt + + dirpath="gdaswave.${PDY}/${cyc}/" + dirname="./${dirpath}" + + head="gdaswave.t${cyc}z." + + #........................... + echo "${dirname}gridded/${head}* " >>gdaswave.txt + echo "${dirname}station/${head}* " >>gdaswave.txt + + echo "${dirname}restart/* " >>gdaswave_restart.txt + + fi + + #----------------------------------------------------- fi ##end of gdas #----------------------------------------------------- @@ -325,6 +392,5 @@ if [ $type = "enkfgdas" -o $type = "enkfgfs" ]; then fi ##end of enkfgdas or enkfgfs #----------------------------------------------------- - exit 0 diff --git a/ush/nems.configure.med_atm_ocn_ice_wav.IN b/ush/nems.configure.med_atm_ocn_ice_wav.IN index 8c6f849b52..5acce5cd73 100755 --- a/ush/nems.configure.med_atm_ocn_ice_wav.IN +++ b/ush/nems.configure.med_atm_ocn_ice_wav.IN @@ -5,51 +5,58 @@ # EARTH # EARTH_component_list: MED ATM OCN ICE WAV EARTH_attributes:: - Verbosity = max + Verbosity = 0 :: # MED # MED_model: @[med_model] MED_petlist_bounds: @[med_petlist_bounds] MED_attributes:: - Verbosity = max - DumpFields = false + Verbosity = 0 + DumpFields = @[DumpFields] DumpRHs = false coldstart = false restart_interval = 0 + ProfileMemory = false :: # ATM # ATM_model: @[atm_model] ATM_petlist_bounds: @[atm_petlist_bounds] ATM_attributes:: - Verbosity = max - DumpFields = false + Verbosity = 0 + DumpFields = @[DumpFields] + ProfileMemory = false + OverwriteSlice = false :: # OCN # OCN_model: @[ocn_model] OCN_petlist_bounds: @[ocn_petlist_bounds] OCN_attributes:: - Verbosity = max - DumpFields = false - restart_interval = 9999999 + Verbosity = 0 + DumpFields = @[DumpFields] + restart_interval = 0 + ProfileMemory = false + OverwriteSlice = false :: # ICE # ICE_model: @[ice_model] ICE_petlist_bounds: @[ice_petlist_bounds] ICE_attributes:: - Verbosity = max - DumpFields = false + Verbosity = 0 + DumpFields = @[DumpFields] + ProfileMemory = false + OverwriteSlice = false :: -# WAV # +# WAV # WAV_model: @[wav_model] WAV_petlist_bounds: @[wav_petlist_bounds] WAV_attributes:: - Verbosity = max - DumpFields = false + Verbosity = 0 + OverwriteSlice = false :: # Run Sequence # @@ -57,18 +64,20 @@ runSeq:: @@[coupling_interval_slow_sec] MED MedPhase_prep_ocn MED -> OCN :remapMethod=redist - ATM -> WAV - OCN -> WAV + OCN -> WAV WAV -> OCN :srcMaskValues=1 OCN - WAV @@[coupling_interval_fast_sec] MED MedPhase_prep_ice MED MedPhase_prep_atm MED -> ATM :remapMethod=redist MED -> ICE :remapMethod=redist + WAV -> ATM :srcMaskValues=1 + ATM -> WAV + ICE -> WAV ATM ICE + WAV ATM -> MED :remapMethod=redist ICE -> MED :remapMethod=redist MED MedPhase_atm_ocn_flux diff --git a/ush/nems.configure.medcold_atm_ocn_ice_wav.IN b/ush/nems.configure.medcold_atm_ocn_ice_wav.IN new file mode 100644 index 0000000000..bd426d6eb5 --- /dev/null +++ b/ush/nems.configure.medcold_atm_ocn_ice_wav.IN @@ -0,0 +1,88 @@ +############################################# +#### NEMS Run-Time Configuration File ##### +############################################# + +# EARTH # +EARTH_component_list: MED ATM OCN ICE WAV +EARTH_attributes:: + Verbosity = 0 +:: + +# MED # +MED_model: @[med_model] +MED_petlist_bounds: @[med_petlist_bounds] +MED_attributes:: + Verbosity = 0 + DumpFields = false + DumpRHs = false + coldstart = true + ProfileMemory = false +:: + +# ATM # +ATM_model: @[atm_model] +ATM_petlist_bounds: @[atm_petlist_bounds] +ATM_attributes:: + Verbosity = 0 + DumpFields = false + ProfileMemory = false + OverwriteSlice = false +:: + +# OCN # +OCN_model: @[ocn_model] +OCN_petlist_bounds: @[ocn_petlist_bounds] +OCN_attributes:: + Verbosity = 0 + DumpFields = false + ProfileMemory = false + restart_n=0 + OverwriteSlice = false +:: + +# ICE # +ICE_model: @[ice_model] +ICE_petlist_bounds: @[ice_petlist_bounds] +ICE_attributes:: + Verbosity = 0 + DumpFields = false + ProfileMemory = false + OverwriteSlice = false +:: + +# WAV # +WAV_model: @[wav_model] +WAV_petlist_bounds: @[wav_petlist_bounds] +WAV_attributes:: + Verbosity = 0 + OverwriteSlice = false +:: + + +# Run Sequence # +runSeq:: + @@[coupling_interval_slow_sec] + OCN -> WAV + WAV -> OCN :srcMaskValues=1 + @@[coupling_interval_fast_sec] + MED MedPhase_prep_atm + MED -> ATM :remapMethod=redist + WAV -> ATM :srcMaskValues=1 + ATM + ATM -> WAV + ATM -> MED :remapMethod=redist + MED MedPhase_prep_ice + MED -> ICE :remapMethod=redist + ICE + ICE -> WAV + WAV + ICE -> MED :remapMethod=redist + MED MedPhase_atm_ocn_flux + MED MedPhase_accum_fast + @ + MED MedPhase_prep_ocn + MED -> OCN :remapMethod=redist + OCN + OCN -> MED :remapMethod=redist + @ +:: diff --git a/ush/nems_configure.sh b/ush/nems_configure.sh index 27d37b51d2..a362d12259 100755 --- a/ush/nems_configure.sh +++ b/ush/nems_configure.sh @@ -22,7 +22,7 @@ if [[ $inistep = "cold" ]]; then restart_interval=0 coldstart=true # this is the correct setting else - restart_interval=${restart_interval:-1296000} # Interval in seconds to write restarts + restart_interval=${restart_interval:-3024000} # Interval in seconds to write restarts coldstart=false fi diff --git a/ush/parsing_namelists_CICE.sh b/ush/parsing_namelists_CICE.sh index df8978cd46..88de147a85 100644 --- a/ush/parsing_namelists_CICE.sh +++ b/ush/parsing_namelists_CICE.sh @@ -11,33 +11,33 @@ cat > ice_in < ice_in < ice_in < ice_in < ice_in < ice_in < ice_in < ice_in <> input.nml <> input.nml << EOF + oz_phys = .false. + oz_phys_2015 = .true. +EOF +fi + if [ $CCPP_SUITE = "FV3_GSD_v0" ]; then cat >> input.nml << EOF ltaerosol = ${ltaerosol:-".F."} ! In config.fcst diff --git a/ush/wave_ens_bull.sh b/ush/wave_ens_bull.sh new file mode 100755 index 0000000000..0aac9d4fa2 --- /dev/null +++ b/ush/wave_ens_bull.sh @@ -0,0 +1,261 @@ +#!/bin/bash +# +################################################################################ +# +# UNIX Script Documentation Block +# Script name: wave_ens_bull.sh +# Script description: Create buoy bulletin for NCEP Global Wave Ensemble +# +# Author: Jose-Henrique Alves Org: NCEP/EMC Date: 2014-01-16 +# Abstract: Creates bulletin for NCEP Global Wave Ensemble using grib2 data. +# Values at buoy locations are extracted using wgrib2 bi-linear +# interpolation (-new_grid) and requires IPOLATES lib. +# +# Script history log: +# 2019-05-06 J-Henrique Alves First Version. +# 2019-11-02 J-Henrique Alves Ported to global-workflow. +# +# $Id$ +# +# Attributes: +# Language: Bourne-again (BASH) shell +# Machine: WCOSS-DELL-P3 +# +# Requirements: +# - wgrib2 with IPOLATES library +# +################################################################################ +# +# 0. Preparations +# 0.a Basic modes of operation +# + seton='-xa' + setoff='+xa' + set $seton + + echo -e '\n ******************************************' + echo ' *** WAVE ENSEMBLE BUOY BULLETIN SCRIPT ***' + echo -e ' ******************************************\n' + echo " Starting at : `date`" +# +# 0.b External dependencies and paths +# + export wgrib2=$utilexec/wgrib2 + scripname=wave_ens_bull.sh +# +# 0.b Date and time stuff +# + export YMD=$PDY + export YMDH=${PDY}${cyc} + export tcycz=t${cyc}z +# +# 0.c Buoy location parameters (from stdin) +# + blon=$1 + blat=$2 + bnom=$3 + bfil=$4 +# +# 0.d Plumbing +# + BULLdir=${bnom}_bull + rm -rf $BULLdir + mkdir -p $BULLdir + err=$? + if [ "$err" != '0' ] + then + set +x + echo ' ' + echo '******************************************************* ' + echo " FATAL ERROR: NOT ABLE TO CREATE TEMP DIR ${BULLdir} " + echo '******************************************************* ' + echo ' ' + [[ "$LOUD" = YES ]] && set -x + ../postmsg "$jlogfile" "FATAL ERROR in ${scripname}: Could not create temp directory" + exit 1 + fi + + cd ${BULLdir} +# +# 0.e Output file names +# + bfil="${COMPONENTwave}.${bnom}.bull" + tfil="${COMPONENTwave}.${bnom}.ts" +# +# 1. Prepare input data +# +# 1.a Interpolate from gribfile at model res to high resolution at buoy location +# (wgrib2 + IPOLATES -> bi-linear) +# + $utilexec/wgrib2 ../gribfile -new_grid_winds earth \ + -new_grid_interpolation bilinear -new_grid latlon \ + ${blon}:2:.01 ${blat}:2:.01 grbint.${bnom} \ + 1> buoy_interp.out 2>&1 +# + if ! [ -f grbint.${bnom} ] + then + set +x + echo ' ' + echo '******************************************************* ' + echo " FATAL ERROR: FAILED TO CREATE FILE grbint.${bnom} " + echo '******************************************************* ' + echo ' ' + [[ "$LOUD" = YES ]] && set -x + ../postmsg "$jlogfile" "FATAL ERROR creating grbint.${bnom} in ${scripname}" + exit 2 + fi +# +# 1.b Extract parameters at buoy locations from higher res interpolated file +# + valpdy=(`$utilexec/wgrib2 grbint.${bnom} -match HTSGW -match mean -vt \ + | sed 's/[,=]/ /g' | awk '{print $NF}' | cut -c1-8`) + vald=(`$utilexec/wgrib2 grbint.${bnom} -match HTSGW -match mean -vt \ + | sed 's/[,=]/ /g' | awk '{print $NF}' | cut -c7-8`) + valt=(`$utilexec/wgrib2 grbint.${bnom} -match HTSGW -match mean -vt \ + | sed 's/[,=]/ /g' | awk '{print $NF}' | cut -c9-10`) + hsb=(`$utilexec/wgrib2 grbint.${bnom} -match HTSGW -match mean -lon \ + ${blon} ${blat} | sed 's/[,=]/ /g' | awk '{print $NF}'`) + hspb=(`$utilexec/wgrib2 grbint.${bnom} -match HTSGW -match spread \ + -lon ${blon} ${blat} | sed 's/[,=]/ /g' | awk '{print $NF}'`) + tpb=(`$utilexec/wgrib2 grbint.${bnom} -match PERPW -match mean -lon \ + ${blon} ${blat} | sed 's/[,=]/ /g' | awk '{print $NF}'`) + tspb=(`$utilexec/wgrib2 grbint.${bnom} -match PERPW -match spread \ + -lon ${blon} ${blat} | sed 's/[,=]/ /g' | awk '{print $NF}'`) + ub=(`$utilexec/wgrib2 grbint.${bnom} -match WIND -match mean -lon \ + ${blon} ${blat} | sed 's/[,=]/ /g' | awk '{print $NF}'`) + usb=(`$utilexec/wgrib2 grbint.${bnom} -match WIND -match spread -lon \ + ${blon} ${blat} | sed 's/[,=]/ /g' | awk '{print $NF}'`) + p1b=(`$utilexec/wgrib2 grbint.${bnom} -match HTSGW -match 'prob >0.6' \ + -lon ${blon} ${blat} | sed 's/[,=]/ /g' | awk '{print $NF}'`) + p2b=(`$utilexec/wgrib2 grbint.${bnom} -match HTSGW -match 'prob >1' \ + -lon ${blon} ${blat} | sed 's/[,=]/ /g' | awk '{print $NF}'`) + p3b=(`$utilexec/wgrib2 grbint.${bnom} -match HTSGW -match 'prob >2' \ + -lon ${blon} ${blat} | sed 's/[,=]/ /g' | awk '{print $NF}'`) + p4b=(`$utilexec/wgrib2 grbint.${bnom} -match HTSGW -match 'prob >5.5' \ + -lon ${blon} ${blat} | sed 's/[,=]/ /g' | awk '{print $NF}'`) + p5b=(`$utilexec/wgrib2 grbint.${bnom} -match HTSGW -match 'prob >7' \ + -lon ${blon} ${blat} | sed 's/[,=]/ /g' | awk '{print $NF}'`) + p6b=(`$utilexec/wgrib2 grbint.${bnom} -match HTSGW -match 'prob >9' \ + -lon ${blon} ${blat} | sed 's/[,=]/ /g' | awk '{print $NF}'`) +# +# Length of parameter vectors +# + tlen=`echo ${hsb[@]} | wc -w` +# +# Check for error in reading parameters from interpolated file +# + if [ ! $vald ] || [ ! valt ] || [ ! hsb ] || [ ! hspb ] || [ ! tpb ] || \ + [ ! tspb ] || [ ! ub ] || [ ! usb ] || [ ! p1b ] || [ ! p2b ] || \ + [ ! p3b ] || [ ! p4b ] || [ ! p5b ] || [ ! p6b ] + then + set +x + echo ' ' + echo '******************************************************* ' + echo " FATAL ERROR: FAILED TO READ PARAMS FROM grbint${bnom} " + echo '******************************************************* ' + echo ' ' + [[ "$LOUD" = YES ]] && set -x + ../postmsg "$jlogfile" "FATAL ERROR reading parameters from grbint.${bnom} in ${scripname}" + exit 3 + fi +# +# Warning if any parameter has UNDEF value +# + UNDF=9.999e+20 + UNDFCHK=`echo ${hsb[@]} ${hspb[@]} ${tpb[@]} ${tspb[@]} ${ub[@]} ${usb[@]} \ + ${p1b[@]} ${p2b[@]} ${p3b[@]} ${p4b[@]} ${p5b[@]} ${p6b[@]}` + if [ `echo $UNDFCHK | grep $UNDF | cut -c1` ] + then + set +x + echo ' ' + echo '******************************************************* ' + echo " WARNING: PARAMETER IS UNDEFINED IN grbint.${bnom} " + echo '******************************************************* ' + echo ' ' + [[ "$LOUD" = YES ]] && set -x + ../postmsg "$jlogfile" "WARNING: parameter is UNDEFINED in grbint.${bnom} in ${scripname}" + fi +# +# 2. Generate bulletin +# + printf "\n Location : "$bnom" ("$blat"N "$blon"W)\n" > $bfil + printf " Model : NCEP Global Wave Ensemble System (${COMPONENTwave})\n" >> $bfil + printf " Cycle : "$PDY" "$cycle" UTC\n" >> $bfil + printf "\n+-------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+\n" >> $bfil + printf "| day | Hs avg | Hs spr | Tp avg | Tp spr | U10avg | U10spr | P(Hs>) | P(Hs>) | P(Hs>) | P(Hs>) | P(Hs>) | P(Hs>) |\n" >> $bfil + printf "| hour | (m) | (m) | (s) | (m) | (m/s) | (m/s) | 1.00m | 2.00m | 3.00m | 5.50m | 7.00m | 9.00m |\n" >> $bfil + printf "+-------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+\n" >> $bfil + + for (( it=1; it<=$tlen; it++ )) + do + tdum=`expr ${valt[$it-1]} / 1` + ddum=`expr ${vald[$it-1]} / 1` + printf '| %2.2i %2.2i' $ddum $tdum >> $bfil + printf ' | %5.2f ' \ + ${hsb[$it-1]:0:4} \ + ${hspb[$it-1]:0:4} \ + ${tpb[$it-1]:0:4} \ + ${tspb[$it-1]:0:4} \ + ${ub[$it-1]:0:4} \ + ${usb[$it-1]:0:4} \ + ${p1b[$it-1]:0:4} \ + ${p2b[$it-1]:0:4} \ + ${p3b[$it-1]:0:4} \ + ${p4b[$it-1]:0:4} \ + ${p5b[$it-1]:0:4} \ + ${p6b[$it-1]:0:4} >> $bfil + printf ' |\n' >> $bfil + done + + printf "+-------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+\n" >> $bfil + printf " Hs : Significant wave height\n" >> $bfil + printf " Tp : Peak period\n" >> $bfil + printf " U10 : Wind speed at a height of 10m above the surface\n" >> $bfil + printf " avg : Average of ensemble members\n" >> $bfil + printf " spr : Spread (standard deviation) of ensemble members\n" >> $bfil + printf " P(Hs >): Probability of Hs exceeding given threshold\n" >> $bfil + printf " NOAA/NWS/NCEP Marine Modeling and Analysis Branch, $PDY" >> $bfil +# +# 2.b Create time series output +# + printf " date hour Hs avg Hs spr Tp avg Tp spr U10avg U10spr \n" >> $tfil + printf " (m) (m) (s) (s) (m/s) (m/s) \n" >> $tfil + printf " ----------------------------------------------------- \n" >> $tfil + for (( it=1; it<=$tlen; it++ )) + do + tdum=`expr ${valt[$it-1]} / 1` + printf ' %8.8i %2.2i' ${valpdy[$it-1]} $tdum >> $tfil + printf ' %5.2f ' \ + ${hsb[$it-1]:0:4} \ + ${hspb[$it-1]:0:4} \ + ${tpb[$it-1]:0:4} \ + ${tspb[$it-1]:0:4} \ + ${ub[$it-1]:0:4} \ + ${usb[$it-1]:0:4} >> $tfil + printf '\n' >> $tfil + done +# +# 2.c Check for errors in creating bulletin file +# + if [ -f ${bfil} ] && [ -f ${tfil} ] + then + echo -e "\n ${COMPONENTwave} bulletin and ts-file created for location ${bnom}.\n" + else + set +x + echo ' ' + echo '******************************************************* ' + echo '*** FATAL ERROR: BULL/TS FILES AT ${bnom} NOT FOUND ***' + echo '******************************************************* ' + echo ' ' + [[ "$LOUD" = YES ]] && set -x + ../postmsg "$jlogfile" "FATAL ERROR : BULL/TS FILES NOT FOUND" + exit 4 + fi +# +# 3. Copy and Cleanup +# + mv -f ${bfil} ../. + mv -f ${tfil} ../. + rm -rf ${bnom}_bull + +# End of buoy bulletin script diff --git a/ush/wave_ens_stats.sh b/ush/wave_ens_stats.sh new file mode 100755 index 0000000000..c167c608a4 --- /dev/null +++ b/ush/wave_ens_stats.sh @@ -0,0 +1,254 @@ +#!/bin/bash +# +################################################################################ +# +# UNIX Script Documentation Block +# Script name: wave_ens_stats.sh +# Script description: Create statists (means etc) from wave ensemble data +# +# Author: Jose-Henrique Alves Org: NCEP/EMC Date: 2014-01-16 +# Abstract: Creates bulletin for NCEP Global Wave Ensemble using grib2 data. +# Values at buoy locations are extracted using wgrib2 bi-linear +# interpolation (-new_grid) and requires IPOLATES lib. +# +# Script history log: +# 2014-01-16 J-Henrique Alves First Version. +# 2019-11-02 J-Henrique Alves Ported to global-workflow. +# +# $Id$ +# +# Attributes: +# Language: Bourne-again (BASH) shell +# Machine: WCOSS-DELL-P3 +# +# Requirements: +# - wgrib2 with IPOLATES library +# +################################################################################ +# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --+ + + ++ +# 0. Preparations +# 0.a Basic modes of operation +# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --+ + + ++ +# + seton='-xa' + setoff='+xa' + set $seton + + para=$1 + prepar=`echo $para | rev | cut -c2- | rev` #Part prefix (assumes 1 digit index) + paridx=`echo $para | rev | cut -c-1` #Part index (assumes 1 digit index) + +# Number of grib records + ngrib=$2 + +# Number of ensemble members + nmembn=`echo ${membn} | wc -w` + +# Forecast range + fhour=$3 + + mkdir -p tmp_${para} + cd tmp_${para} + +# 0.b Set general parameter settings + + scale=' ' + case $prepar in + HTSG) ascale=(0.60 1.00 2.00 3.00 4.00 5.50 7.00 9.00) ; + scale=${ascale[@]} + npart=0 ; + nip='hs' ; + nnip=${nip} ; + parcode='10 0 3' ;; + PERP) ascale=(5.0 7.0 9.0 11.0 13.0 15.0 17.0 19.0) ; + scale=${ascale[@]} + npart=0 ; + nip='tp' ; + nnip=${nip} ; + parcode='10 0 11' ;; + DIRP) ascale='0' ; + scale=${ascale[@]} + npart=0 ; + nip='pdir' ; + nnip=${nip} ; + parcode='10 0 10' ;; + WIN) ascale=(3.60 5.65 8.74 11.31 14.39 17.48 21.07 24.67) ; + scale=${ascale[@]} + npart=0 ; + nip='wnd' ; + nnip=${nip} ; + parcode='0 2 1' ;; + WDI) ascale='0' ; + scale=${ascale[@]} + npart=0 ; + nip='wnddir' ; + nnip=${nip} ; + parcode='0 2 0' ;; + WVHG) ascale=(0.60 1.00 2.00 3.00 4.00 5.50 7.00 9.00) ; + scale=${ascale[@]} + npart=0 ; + nip='wshs' ; + nnip=${nip} ; + parcode='10 0 5' ;; + WVPE) ascale=(5.0 7.0 9.0 11.0 13.0 15.0 17.0 19.0) ; + scale=${ascale[@]} + npart=0 ; + nip='wstp' ; + nnip=${nip} ; + parcode='10 0 6' ;; + WVDI) ascale='0' ; + scale=${ascale[@]} + npart=0 ; + nip='wsdir' ; + nnip=${nip} ; + parcode='10 0 4' ;; + SWELL) ascale=(0.60 1.00 2.00 3.00 4.00 5.50 7.00 9.00) ; + scale=${ascale[@]} + npart=1 ; + nip='hswell' ; + nnip="${nip}"$paridx ; + parcode='10 0 8' ;; + SWPER) ascale=(5.0 7.0 9.0 11.0 13.0 15.0 17.0 19.0) ; + scale=${ascale[@]} + npart=1 ; + nip='tswell' ; + nnip="${nip}"$paridx ; + parcode='10 0 9' ;; + *) ascale=${tsscale[@]} ; scale=${ascale[$plev]} ; parcode=' ' ;; + esac + +# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --+ + + ++ +# 1. Compute mean, spread and probability of exceedence +# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --+ + + ++ +# +# set $seton + + rm -f mean.t${cyc}z.grib2 spread.t${cyc}z.grib2 probab.t${cyc}z.grib2 + + nmemb=${nmembn} + nmembm1=`expr ${nmemb} - 1` +# +# 1.a Create list of combined ensemble member numbers (starting from 00 = NCEP control run) +# + memb=`seq -w 0 ${nmembm1}` +# + valtime=`$NDATE ${fhour} ${YMDH}` + + mkdir -p ${valtime} + cd ${valtime} + + if [ $fhour -eq 0 ] ; then + ihr='anl' + hhh='000' + elif [ $fhour -lt 10 ] ; then + ihr=${fhour}' hour' + hhh='00'$fhour + elif [ $fhour -lt 100 ] ; then + ihr=${fhour}' hour' + hhh='0'$fhour + elif [ $fhour -ge 100 ] ; then + ihr=${fhour}' hour' + hhh=$fhour + fi +# + rm -f gwes_stats.inp data_* +# +# 1.b Loop through members + nme=0 +# while [ ${nme} -lt ${nmemb} ] + for im in $membn + do + + infile=../../${para}_${im}.t${cyc}z.grib2 + if [ "${im}" = "00" ] + then + +# 1.b.1 Generate input file for gwes_stats + echo $YMDH $hhh $nnip $parcode > gwes_stats.inp + #echo $YMDH $ngrib $dtgh $nnip $parcode > gwes_stats.inp + echo ${nmemb} >> gwes_stats.inp + echo $memb >> gwes_stats.inp + echo ${scale[@]} | wc -w >> gwes_stats.inp + echo ${scale[@]} >> gwes_stats.inp + +# 1.b.2 Get grid dimension for input grib file and pass to fortran code + nlola=`$WGRIB2 ${infile} -grid -d 1 | sed 's/(/ /g' | sed 's/)/ /g' | sed '2!d' | awk '{print $3,$5}'` + rdlon=`$WGRIB2 ${infile} -grid -d 1 | sed 's/(/ /g' | sed 's/)/ /g' | sed '4!d' | awk '{print $2,$4,$6}'` + rdlat=`$WGRIB2 ${infile} -grid -d 1 | sed 's/(/ /g' | sed 's/)/ /g' | sed '3!d' | awk '{print $2,$4,$6}'` + echo ${nlola} >> gwes_stats.inp + echo ${rdlon} >> gwes_stats.inp + echo ${rdlat} >> gwes_stats.inp + fi + +# 1.b.3 Create binary file for input to gwes_stats FORTRAN executable + $WGRIB2 $infile -vt -match ${valtime} -bin data_${im} + ok1=$? + +# 1.b.4 Check for errors + if [ $ok1 -ne 0 ] ; then + echo " *** ERROR : para=$para, im=$im, ok1=$ok1" + exit + fi + echo data_$im >> gwes_stats.inp + + nme=`expr ${nme} + 1` + + done + +# +# 1.c Execute gwes_stats and create grib2 files +# + rm -f mean_out spread_out probab_out test_out +# + $EXECwave/gwes_stats < gwes_stats.inp >>$pgmout 2>&1 +# +# 1.d Check for errors and move output files to tagged grib2 parameter-hour files + if [ ! -f mean_out ] + then + msg="ABNORMAL EXIT: ERR mean_out not gerenerated for ${nnip} $hhh." + postmsg "$jlogfile" "$msg" + set +x + echo "--- mean_out not gerenerated for ${nnip} $hhh --- " + [[ "$LOUD" = YES ]] && set -x + echo "mean_out not gerenerated for ${nnip} $hhh" >> $wave_log + err=1;export err;err_chk + else + mv -f mean_out ${nnip}_mean.$hhh.grib2 + fi + if [ ! -f spread_out ] + then + msg="ABNORMAL EXIT: ERR spread_out not gerenerated for ${nnip} $hhh." + postmsg "$jlogfile" "$msg" + set +x + echo "--- spread_out not gerenerated for ${nnip} $hhh --- " + [[ "$LOUD" = YES ]] && set -x + echo "spread_out not gerenerated for ${nnip} $hhh" >> $wave_log + err=1;export err;err_chk + else + mv -f spread_out ${nnip}_spread.$hhh.grib2 + fi + + nscale=`echo ${ascale[@]} | wc -w` + if [ ${nscale} -gt 1 ] + then + if [ ! -f probab_out ] + then + msg="ABNORMAL EXIT: ERR probab_out not gerenerated for ${nnip} $hhh." + postmsg "$jlogfile" "$msg" + set +x + echo "--- probab_out not gerenerated for ${nnip} $hhh --- " + [[ "$LOUD" = YES ]] && set -x + echo "probab_out not gerenerated for ${nnip} $hhh" >> $wave_log + err=1;export err;err_chk + else + mv -f probab_out ${nnip}_probab.$hhh.grib2 + fi + fi + +# +# 2. Cleanup +# Remove binary data files + rm -f data_?? + +# +# End of wave_gwes_stats.sh diff --git a/ush/wave_grib2.sh b/ush/wave_grib2.sh new file mode 100755 index 0000000000..b91f723200 --- /dev/null +++ b/ush/wave_grib2.sh @@ -0,0 +1,225 @@ +#!/bin/bash +# +################################################################################ +# +# UNIX Script Documentation Block +# Script name: wave_grib2_sbs.sh +# Script description: Create grib2 files for the wave component +# +# Author: Hendrik Tolman Org: NCEP/EMC Date: 2007-07-11 +# Abstract: Creates grib2 files from WW3 binary output +# +# Script history log: +# 2019-11-02 J-Henrique Alves Ported to global-workflow. +# +# $Id$ +# +# Attributes: +# Language: Bourne-again (BASH) shell +# Machine: WCOSS-DELL-P3 +# +# Requirements: +# - wgrib2 with IPOLATES library +# +################################################################################ +# --------------------------------------------------------------------------- # +# 0. Preparations +# 0.a Basic modes of operation + + # set execution trace prompt. ${0##*/} adds the script's basename + PS4=" \${SECONDS} ${0##*/} L\${LINENO} + " + set -x + + # Use LOUD variable to turn on/off trace. Defaults to YES (on). + export LOUD=${LOUD:-YES}; [[ $LOUD = yes ]] && export LOUD=YES + [[ "$LOUD" != YES ]] && set +x + + cd $GRIBDATA +# postmsg "$jlogfile" "Making GRIB2 Files." # commented to reduce unnecessary output to jlogfile + + grdID=$1 + gribDIR=${grdID}_grib + rm -rfd ${gribDIR} + mkdir ${gribDIR} + err=$? + if [ $err != 0 ] + then + set +x + echo ' ' + echo '******************************************************************************* ' + echo '*** FATAL ERROR : ERROR IN ww3_grib2 (COULD NOT CREATE TEMP DIRECTORY) *** ' + echo '******************************************************************************* ' + echo ' ' + [[ "$LOUD" = YES ]] && set -x + postmsg "$jlogfile" "FATAL ERROR : ERROR IN ww3_grib2 (Could not create temp directory)" + exit 1 + fi + + cd ${gribDIR} + +# 0.b Define directories and the search path. +# The tested variables should be exported by the postprocessor script. + + dtgrib=$2 + ngrib=$3 + GRIDNR=$4 + MODNR=$5 + gribflags=$6 + + set +x + echo ' ' + echo '+--------------------------------+' + echo '! Make GRIB files |' + echo '+--------------------------------+' + echo " Model ID : $WAV_MOD_TAG" + [[ "$LOUD" = YES ]] && set -x + + if [ -z "$YMDH" ] || [ -z "$cycle" ] || [ -z "$EXECwave" ] || [ -z "$EXECcode" ] || \ + [ -z "$COMOUT" ] || [ -z "$WAV_MOD_TAG" ] || [ -z "$SENDCOM" ] || \ + [ -z "$dtgrib" ] || [ -z "$ngrib" ] || [ -z "$gribflags" ] || \ + [ -z "$GRIDNR" ] || [ -z "$MODNR" ] || [ -z "$SENDDBN" ] + then + set +x + echo ' ' + echo '***************************************************' + echo '*** EXPORTED VARIABLES IN postprocessor NOT SET ***' + echo '***************************************************' + echo ' ' + [[ "$LOUD" = YES ]] && set -x + postmsg "$jlogfile" "EXPORTED VARIABLES IN postprocessor NOT SET" + exit 1 + fi + +# 0.c Starting time for output + + ymdh=$YMDH + tstart="`echo $ymdh | cut -c1-8` `echo $ymdh | cut -c9-10`0000" + + set +x + echo " Starting time : $tstart" + echo " Time step : $dtgrib" + echo " Number of times : $ngrib" + echo " GRIB field flags : $gribflags" + echo ' ' + [[ "$LOUD" = YES ]] && set -x + +# 0.e Links to working directory + + ln -s ../mod_def.$grdID mod_def.ww3 + ln -s ../out_grd.$grdID out_grd.ww3 + +# --------------------------------------------------------------------------- # +# 1. Generate GRIB file with all data +# 1.a Generate input file for ww3_grib2 +# Template copied in mother script ... + + set +x + echo " Generate input file for ww3_grib2" + [[ "$LOUD" = YES ]] && set -x + + sed -e "s/TIME/$tstart/g" \ + -e "s/DT/$dtgrib/g" \ + -e "s/NT/$ngrib/g" \ + -e "s/GRIDNR/$GRIDNR/g" \ + -e "s/MODNR/$MODNR/g" \ + -e "s/FLAGS/$gribflags/g" \ + ../ww3_grib2.inp.tmpl > ww3_grib.inp + +# 1.b Run GRIB packing program + + set +x + echo " Run ww3_grib2" + echo " Executing $EXECcode/ww3_grib" + [[ "$LOUD" = YES ]] && set -x + + ln -sf ../$WAV_MOD_TAG.$grdID.${cycle}.grib2 gribfile + $EXECcode/ww3_grib + err=$? + + if [ $err != 0 ] + then + set +x + echo ' ' + echo '********************************************* ' + echo '*** FATAL ERROR : ERROR IN ww3_grib2 *** ' + echo '********************************************* ' + echo ' ' + [[ "$LOUD" = YES ]] && set -x + postmsg "$jlogfile" "FATAL ERROR : ERROR IN ww3_grib2" + exit 3 + fi + +# 1.c Clean up + + rm -f ww3_grib.inp + rm -f mod_def.ww3 + rm -f out_grd.ww3 + +# 1.e Save in /com + + if [ "$SENDCOM" = 'YES' ] + then + set +x + echo " Saving GRIB file as $COMOUT/gridded/$WAV_MOD_TAG.$grdID.$cycle.grib2" + [[ "$LOUD" = YES ]] && set -x + cp -f ${DATA}/$WAV_MOD_TAG.$grdID.$cycle.grib2 $COMOUT/gridded/ + $WGRIB2 -s $COMOUT/gridded/$WAV_MOD_TAG.$grdID.$cycle.grib2 > $COMOUT/gridded/$WAV_MOD_TAG.$grdID.$cycle.grib2.idx + + if [ ! -f $COMOUT/gridded/$WAV_MOD_TAG.$grdID.$cycle.grib2 ] + then + set +x + echo ' ' + echo '********************************************* ' + echo '*** FATAL ERROR : ERROR IN ww3_grib2 *** ' + echo '********************************************* ' + echo ' ' + echo " Error in moving grib file $WAV_MOD_TAG.$grdID.$cycle.grib2 to com" + echo ' ' + [[ "$LOUD" = YES ]] && set -x + postmsg "$jlogfile" "FATAL ERROR : ERROR IN ww3_grib2" + exit 4 + fi + if [ ! -f $COMOUT/gridded/$WAV_MOD_TAG.$grdID.$cycle.grib2.idx ] + then + set +x + echo ' ' + echo '*************************************************** ' + echo '*** FATAL ERROR : ERROR IN ww3_grib2 INDEX FILE *** ' + echo '*************************************************** ' + echo ' ' + echo " Error in moving grib file $WAV_MOD_TAG.$grdID.$cycle.grib2idx to com" + echo ' ' + [[ "$LOUD" = YES ]] && set -x + postmsg "$jlogfile" "FATAL ERROR : ERROR IN creating ww3_grib2 index" + exit 4 + fi + + if [ "$SENDDBN" = 'YES' ] + then + set +x + echo " Alerting GRIB file as $COMOUT/gridded/$WAV_MOD_TAG.$grdID.$cycle.grib2" + echo " Alerting GRIB index file as $COMOUT/gridded/$WAV_MOD_TAG.$grdID.$cycle.grib2.idx" + [[ "$LOUD" = YES ]] && set -x + $DBNROOT/bin/dbn_alert MODEL WAVE_GRIB_GB2 $job $COMOUT/gridded/$WAV_MOD_TAG.$grdID.$cycle.grib2 + $DBNROOT/bin/dbn_alert MODEL WAVE_GRIB_GB2_WIDX $job $COMOUT/gridded/$WAV_MOD_TAG.$grdID.$cycle.grib2.idx + fi + fi + + +# --------------------------------------------------------------------------- # +# 3. Clean up the directory + + set +x + echo " Removing work directory after success." + [[ "$LOUD" = YES ]] && set -x + + cd .. + mv -f ${gribDIR} done.${gribDIR} + + set +x + echo ' ' + echo "End of ww3_grib2.sh at" + date + [[ "$LOUD" = YES ]] && set -x + +# End of ww3_grib2.sh -------------------------------------------------- # diff --git a/ush/wave_grib2_cat.sh b/ush/wave_grib2_cat.sh new file mode 100755 index 0000000000..ddd3e03ccd --- /dev/null +++ b/ush/wave_grib2_cat.sh @@ -0,0 +1,188 @@ +#!/bin/bash +# +################################################################################ +# +# UNIX Script Documentation Block +# Script name: wave_grib2_cat.sh +# Script description: Concatenates files from wave model component +# +# Author: Jose-Henrique Alves Org: NCEP/EMC Date: 2014-01-16 +# Abstract: Creates bulletin for NCEP Global Wave Ensemble using grib2 data. +# Values at buoy locations are extracted using wgrib2 bi-linear +# interpolation (-new_grid) and requires IPOLATES lib. +# +# Script history log: +# +# $Id$ +# +# Attributes: +# Language: Bourne-again (BASH) shell +# Machine: WCOSS-DELL-P3 +# +# Requirements: +# - wgrib2 with IPOLATES library +# +################################################################################ +# --------------------------------------------------------------------------- # +# 0. Preparations +# 0.a Basic modes of operation + + # set execution trace prompt. ${0##*/} adds the script's basename + PS4=" \${SECONDS} ${0##*/} L\${LINENO} + " + set -x + + # Use LOUD variable to turn on/off trace. Defaults to YES (on). + export LOUD=${LOUD:-YES}; [[ $LOUD = yes ]] && export LOUD=YES + [[ "$LOUD" != YES ]] && set +x + + cd $DATA +# postmsg "$jlogfile" "Catting GRIB2 Files." # commented to reduce unnecessary output to jlogfile + + grdID=$1 + rm -rf grib_$grdID + mkdir grib_$grdID + err=$? + if [ "$err" != '0' ] + then + set +x + echo ' ' + echo '******************************************************************************* ' + echo '*** FATAL ERROR : ERROR IN multiwavegrib2_cat (COULD NOT CREATE TEMP DIRECTORY) *** ' + echo '******************************************************************************* ' + echo ' ' + [[ "$LOUD" = YES ]] && set -x + postmsg "$jlogfile" "FATAL ERROR : ERROR IN multiwavegrib2_cat (Could not create temp directory)" + exit 1 + fi + + cd grib_$grdID + +# 0.b Define directories and the search path. +# The tested variables should be exported by the postprocessor script. + + dtgrib=$2 + ngrib=$3 + GRIDNR=$4 + MODNR=$5 + gribflags=$6 + + set +x + echo ' ' + echo '+--------------------------------+' + echo '! Make GRIB files |' + echo '+--------------------------------+' + echo " Model ID : $WAV_MOD_TAG" + [[ "$LOUD" = YES ]] && set -x + + if [ -z "$YMDH" ] || [ -z "$cycle" ] || [ -z "$EXECwave" ] || [ -z "$EXECcode" ] || \ + [ -z "$COMOUT" ] || [ -z "$WAV_MOD_TAG" ] || [ -z "$SENDCOM" ] || \ + [ -z "$SENDDBN" ] + then + set +x + echo ' ' + echo '***************************************************' + echo '*** EXPORTED VARIABLES IN postprocessor NOT SET ***' + echo '***************************************************' + echo ' ' + [[ "$LOUD" = YES ]] && set -x + postmsg "$jlogfile" "EXPORTED VARIABLES IN postprocessor NOT SET" + exit 1 + fi + +# 0.c Starting time for output + + ymdh=$YMDH + tstart="`echo $ymdh | cut -c1-8` `echo $ymdh | cut -c9-10`0000" + + set +x + echo " Starting time : $tstart" + echo ' ' + [[ "$LOUD" = YES ]] && set -x + +# 0.d sync important files + +# 0.e Links to working directory + +# --------------------------------------------------------------------------- # +# 1. Generate GRIB file with all data + +# 1.b Run GRIB packing program + + + set +x + echo " Catting grib2 files ${COMOUT}/gridded/$WAV_MOD_TAG.$grdID.$cycle.f???.grib2" + [[ "$LOUD" = YES ]] && set -x + + ln -sf ../$WAV_MOD_TAG.$grdID.$cycle.grib2 gribfile + cat ${COMOUT}/gridded/$WAV_MOD_TAG.$grdID.$cycle.f???.grib2 >> gribfile + err=$? + + if [ "$err" != '0' ] + then + set +x + echo ' ' + echo '************************************************* ' + echo '*** FATAL ERROR : ERROR IN multiwavegrib2_cat *** ' + echo '************************************************* ' + echo ' ' + [[ "$LOUD" = YES ]] && set -x + postmsg "$jlogfile" "FATAL ERROR : ERROR IN multiwavegrib2_cat" + exit 3 + fi + +# 1.e Save in /com + + if [ "$SENDCOM" = 'YES' ] + then + set +x + echo " Saving GRIB file as $COMOUT/gridded/$WAV_MOD_TAG.$grdID.$cycle.grib2" + [[ "$LOUD" = YES ]] && set -x + cp gribfile $COMOUT/gridded/$WAV_MOD_TAG.$grdID.$cycle.grib2 + + if [ ! -f $COMOUT/gridded/$WAV_MOD_TAG.$grdID.$cycle.grib2 ] + then + set +x + echo ' ' + echo '********************************************* ' + echo '*** FATAL ERROR : ERROR IN multiwavegrib2 *** ' + echo '********************************************* ' + echo ' ' + echo " Error in moving grib file $WAV_MOD_TAG.$grdID.$cycle.grib2 to com" + echo ' ' + [[ "$LOUD" = YES ]] && set -x + postmsg "$jlogfile" "FATAL ERROR : ERROR IN multiwavegrib2" + exit 4 + fi + + echo " Creating wgrib index of $COMOUT/gridded/$WAV_MOD_TAG.$grdID.$cycle.grib2" + $WGRIB2 -s $COMOUT/gridded/$WAV_MOD_TAG.$grdID.$cycle.grib2 > $COMOUT/gridded/$WAV_MOD_TAG.$grdID.$cycle.grib2.idx + + if [ "$SENDDBN" = 'YES' ] + then + set +x + echo " Alerting GRIB file as $COMOUT/gridded/$WAV_MOD_TAG.$grdID.$cycle.grib2" + echo " Alerting GRIB index file as $COMOUT/gridded/$WAV_MOD_TAG.$grdID.$cycle.grib2.idx" + [[ "$LOUD" = YES ]] && set -x + $DBNROOT/bin/dbn_alert MODEL WAVE_GRIB_GB2 $job $COMOUT/gridded/$WAV_MOD_TAG.$grdID.$cycle.grib2 + $DBNROOT/bin/dbn_alert MODEL WAVE_GRIB_GB2_WIDX $job $COMOUT/gridded/$WAV_MOD_TAG.$grdID.$cycle.grib2.idx + fi + fi + + +# --------------------------------------------------------------------------- # +# 3. Clean up the directory + + set +x + echo " Removing work directory after success." + [[ "$LOUD" = YES ]] && set -x + + cd .. + mv -f grib_$grdID done.grib_$grdID + + set +x + echo ' ' + echo "End of multiwavegrib2_cat.sh at" + date + [[ "$LOUD" = YES ]] && set -x + +# End of multiwavegrib2.sh -------------------------------------------------- # diff --git a/ush/wave_grib2_sbs.sh b/ush/wave_grib2_sbs.sh new file mode 100755 index 0000000000..3e8bef351c --- /dev/null +++ b/ush/wave_grib2_sbs.sh @@ -0,0 +1,222 @@ +#!/bin/bash +# +################################################################################ +# +# UNIX Script Documentation Block +# Script name: wave_grib2_sbs.sh +# Script description: Create grib2 files for the wave component +# +# Author: Hendrik Tolman Org: NCEP/EMC Date: 2007-07-11 +# Abstract: Creates grib2 files from WW3 binary output +# +# Script history log: +# 2019-11-02 J-Henrique Alves Ported to global-workflow. +# +# $Id$ +# +# Attributes: +# Language: Bourne-again (BASH) shell +# Machine: WCOSS-DELL-P3 +# +# Requirements: +# - wgrib2 with IPOLATES library +# +################################################################################ +# --------------------------------------------------------------------------- # +# 0. Preparations +# 0.a Basic modes of operation + + # set execution trace prompt. ${0##*/} adds the script's basename + PS4=" \${SECONDS} ${0##*/} L\${LINENO} + " + set -x + + # Use LOUD variable to turn on/off trace. Defaults to YES (on). + export LOUD=${LOUD:-YES}; [[ $LOUD = yes ]] && export LOUD=YES + [[ "$LOUD" != YES ]] && set +x + + cd $GRIBDATA +# postmsg "$jlogfile" "Making GRIB2 Files." # commented to reduce unnecessary output to jlogfile + + grdID=$1 + gribDIR=${grdID}_grib + rm -rfd ${gribDIR} + mkdir ${gribDIR} + err=$? + if [ $err != 0 ] + then + set +x + echo ' ' + echo '******************************************************************************* ' + echo '*** FATAL ERROR : ERROR IN ww3_grib2 (COULD NOT CREATE TEMP DIRECTORY) *** ' + echo '******************************************************************************* ' + echo ' ' + [[ "$LOUD" = YES ]] && set -x + postmsg "$jlogfile" "FATAL ERROR : ERROR IN ww3_grib2 (Could not create temp directory)" + exit 1 + fi + + cd ${gribDIR} + +# 0.b Define directories and the search path. +# The tested variables should be exported by the postprocessor script. + + GRIDNR=$2 + MODNR=$3 + ymdh=$4 + fhr=$5 + grdnam=$6 + grdres=$7 + gribflags=$8 + ngrib=1 # only one time slice + dtgrib=3600 # only one time slice +# SBS one time slice per file + FH3=$(printf %03i $fhr) + + set +x + echo ' ' + echo '+--------------------------------+' + echo '! Make GRIB files |' + echo '+--------------------------------+' + echo " Model ID : $WAV_MOD_TAG" + [[ "$LOUD" = YES ]] && set -x + + if [ -z "$CDATE" ] || [ -z "$cycle" ] || [ -z "$EXECwave" ] || [ -z "$EXECcode" ] || \ + [ -z "$COMOUT" ] || [ -z "$WAV_MOD_TAG" ] || [ -z "$SENDCOM" ] || \ + [ -z "$gribflags" ] || \ + [ -z "$GRIDNR" ] || [ -z "$MODNR" ] || [ -z "$SENDDBN" ] + then + set +x + echo ' ' + echo '***************************************************' + echo '*** EXPORTED VARIABLES IN postprocessor NOT SET ***' + echo '***************************************************' + echo ' ' + [[ "$LOUD" = YES ]] && set -x + postmsg "$jlogfile" "EXPORTED VARIABLES IN postprocessor NOT SET" + exit 1 + fi + +# 0.c Starting time for output + + tstart="`echo $ymdh | cut -c1-8` `echo $ymdh | cut -c9-10`0000" + + set +x + echo " Starting time : $tstart" + echo " Time step : Single SBS + echo " Number of times : Single SBS + echo " GRIB field flags : $gribflags" + echo ' ' + [[ "$LOUD" = YES ]] && set -x + +# 0.e Links to working directory + + ln -s ${DATA}/mod_def.$grdID mod_def.ww3 + ln -s ${DATA}/output_${ymdh}0000/out_grd.$grdID out_grd.ww3 + +# --------------------------------------------------------------------------- # +# 1. Generate GRIB file with all data +# 1.a Generate input file for ww3_grib2 +# Template copied in mother script ... + + set +x + echo " Generate input file for ww3_grib2" + [[ "$LOUD" = YES ]] && set -x + + sed -e "s/TIME/$tstart/g" \ + -e "s/DT/$dtgrib/g" \ + -e "s/NT/$ngrib/g" \ + -e "s/GRIDNR/$GRIDNR/g" \ + -e "s/MODNR/$MODNR/g" \ + -e "s/FLAGS/$gribflags/g" \ + ${DATA}/ww3_grib2.${grdID}.inp.tmpl > ww3_grib.inp + +# 1.b Run GRIB packing program + + set +x + echo " Run ww3_grib2" + echo " Executing $EXECcode/ww3_grib" + [[ "$LOUD" = YES ]] && set -x + ENSTAG="" + if [ ${waveMEMB} ]; then ENSTAG=".${membTAG}${waveMEMB}" ; fi + outfile=${WAV_MOD_TAG}.${cycle}${ENSTAG}.${grdnam}.${grdres}.f${FH3}.grib2 + $EXECcode/ww3_grib + $WGRIB2 gribfile -set_date $CDATE -set_ftime "$fhr hour fcst" -grib ${COMOUT}/gridded/${outfile} + err=$? + + if [ $err != 0 ] + then + set +x + echo ' ' + echo '********************************************* ' + echo '*** FATAL ERROR : ERROR IN ww3_grib2 *** ' + echo '********************************************* ' + echo ' ' + [[ "$LOUD" = YES ]] && set -x + postmsg "$jlogfile" "FATAL ERROR : ERROR IN ww3_grib2" + exit 3 + fi + +# Create index + $WGRIB2 -s $COMOUT/gridded/${outfile} > $COMOUT/gridded/${outfile}.idx + +# 1.e Save in /com + + if [ ! -s $COMOUT/gridded/${outfile} ] + then + set +x + echo ' ' + echo '********************************************* ' + echo '*** FATAL ERROR : ERROR IN ww3_grib2 *** ' + echo '********************************************* ' + echo ' ' + echo " Error in moving grib file ${outfile} to com" + echo ' ' + [[ "$LOUD" = YES ]] && set -x + postmsg "$jlogfile" "FATAL ERROR : ERROR IN ww3_grib2" + exit 4 + fi + if [ ! -s $COMOUT/gridded/${outfile} ] + then + set +x + echo ' ' + echo '*************************************************** ' + echo '*** FATAL ERROR : ERROR IN ww3_grib2 INDEX FILE *** ' + echo '*************************************************** ' + echo ' ' + echo " Error in moving grib file ${outfile}.idx to com" + echo ' ' + [[ "$LOUD" = YES ]] && set -x + postmsg "$jlogfile" "FATAL ERROR : ERROR IN creating ww3_grib2 index" + exit 4 + fi + + if [ "$SENDDBN" = 'YES' ] + then + set +x + echo " Alerting GRIB file as $COMOUT/gridded/${outfile}" + echo " Alerting GRIB index file as $COMOUT/gridded/${outfile}.idx" + [[ "$LOUD" = YES ]] && set -x + $DBNROOT/bin/dbn_alert MODEL WAVE_GRIB_GB2 $job $COMOUT/gridded/${outfile} + $DBNROOT/bin/dbn_alert MODEL WAVE_GRIB_GB2_WIDX $job $COMOUT/gridded/${outfile}.idx + fi + + +# --------------------------------------------------------------------------- # +# 3. Clean up the directory + + rm -f gribfile + + set +x + echo " Removing work directory after success." + [[ "$LOUD" = YES ]] && set -x + + cd ../ + mv -f ${gribDIR} done.${gribDIR} + + set +x + echo ' ' + echo "End of ww3_grib2.sh at" + date + [[ "$LOUD" = YES ]] && set -x + +# End of ww3_grib2.sh -------------------------------------------------- # diff --git a/ush/wave_grid_interp.sh b/ush/wave_grid_interp.sh new file mode 100755 index 0000000000..bb91840212 --- /dev/null +++ b/ush/wave_grid_interp.sh @@ -0,0 +1,209 @@ +#!/bin/bash +# +################################################################################ +# +# UNIX Script Documentation Block +# Script name: wave_grid_interp.sh +# Script description: Create grib2 files for the wave component +# +# Author: Arun Chawla Org: NCEP/EMC Date: 2009-07-22 +# Abstract: Creates grib2 files from WW3 binary output +# +# Script history log: +# 2019-11-02 J-Henrique Alves Ported to global-workflow. +# +# $Id$ +############################################################################### +# --------------------------------------------------------------------------- # +# 0. Preparations +# 0.a Basic modes of operation + + # set execution trace prompt. ${0##*/} adds the script's basename + PS4=" \${SECONDS} ${0##*/} L\${LINENO} + " + set -x + + # Use LOUD variable to turn on/off trace. Defaults to YES (on). + export LOUD=${LOUD:-YES}; [[ $LOUD = yes ]] && export LOUD=YES + [[ "$LOUD" != YES ]] && set +x + + cd $DATA + + grdID=$1 + ymdh=$2 + dt=$3 + nst=$4 + postmsg "$jlogfile" "Making GRID Interpolation Files for $grdID." + rm -rf grint_${grdID}_${ymdh} + mkdir grint_${grdID}_${ymdh} + err=$? + + if [ "$err" != '0' ] + then + set +x + echo ' ' + echo '************************************************************************************* ' + echo '*** FATAL ERROR : ERROR IN ww3_grid_interp (COULD NOT CREATE TEMP DIRECTORY) *** ' + echo '************************************************************************************* ' + echo ' ' + [[ "$LOUD" = YES ]] && set -x + postmsg "$jlogfile" "FATAL ERROR : ERROR IN ww3_grid_interp (Could not create temp directory)" + exit 1 + fi + + cd grint_${grdID}_${ymdh} + +# 0.b Define directories and the search path. +# The tested variables should be exported by the postprocessor script. + + set +x + echo ' ' + echo '+--------------------------------+' + echo '! Make GRID files |' + echo '+--------------------------------+' + echo " Model ID : $WAV_MOD_TAG" + [[ "$LOUD" = YES ]] && set -x + + if [ -z "$YMDH" ] || [ -z "$cycle" ] || [ -z "$EXECcode" ] || \ + [ -z "$COMOUT" ] || [ -z "$WAV_MOD_TAG" ] || [ -z "$SENDCOM" ] || \ + [ -z "$SENDDBN" ] || [ -z "$waveGRD" ] + then + set +x + echo ' ' + echo '***************************************************' + echo '*** EXPORTED VARIABLES IN postprocessor NOT SET ***' + echo '***************************************************' + echo ' ' + echo "$YMDH $cycle $EXECcode $COMOUT $WAV_MOD_TAG $SENDCOM $SENDDBN $waveGRD" + [[ "$LOUD" = YES ]] && set -x + postmsg "$jlogfile" "EXPORTED VARIABLES IN postprocessor NOT SET" + exit 1 + fi + +# 0.c Links to files + + rm -f ../out_grd.$grdID + + if [ ! -f ../${grdID}_interp.inp.tmpl ]; then + cp $FIXwave/${grdID}_interp.inp.tmpl ../. + fi + ln -sf ../${grdID}_interp.inp.tmpl . + + for ID in $waveGRD + do + ln -sf ../out_grd.$ID . + done + + for ID in $waveGRD $grdID + do + ln -sf ../mod_def.$ID . + done + +# --------------------------------------------------------------------------- # +# 1. Generate GRID file with all data +# 1.a Generate Input file + + time="`echo $ymdh | cut -c1-8` `echo $ymdh | cut -c9-10`0000" + + sed -e "s/TIME/$time/g" \ + -e "s/DT/$dt/g" \ + -e "s/NSTEPS/$nst/g" ${grdID}_interp.inp.tmpl > ww3_gint.inp + +# Check if there is an interpolation weights file available + + wht_OK='no' + if [ ! -f ${DATA}/WHTGRIDINT.bin.${grdID} ]; then + if [ -f $FIXwave/WHTGRIDINT.bin.${grdID} ] + then + set +x + echo ' ' + echo " Copying $FIXwave/WHTGRIDINT.bin.${grdID} " + [[ "$LOUD" = YES ]] && set -x + cp $FIXwave/WHTGRIDINT.bin.${grdID} ${DATA} + wht_OK='yes' + else + set +x + echo ' ' + echo " Not found: $FIXwave/WHTGRIDINT.bin.${grdID} " + fi + fi +# Check and link weights file + if [ -f ${DATA}/WHTGRIDINT.bin.${grdID} ] + then + ln -s ${DATA}/WHTGRIDINT.bin.${grdID} ./WHTGRIDINT.bin + fi + +# 1.b Run interpolation code + + set +x + echo " Run ww3_gint + echo " Executing $EXECcode/ww3_gint + [[ "$LOUD" = YES ]] && set -x + + $EXECcode/ww3_gint + err=$? + +# Write interpolation file to main TEMP dir area if not there yet + if [ "wht_OK" = 'no' ] + then + cp -f ./WHTGRIDINT.bin ${DATA}/WHTGRIDINT.bin.${grdID} + cp -f ./WHTGRIDINT.bin ${FIXwave}/WHTGRIDINT.bin.${grdID} + fi + + + if [ "$err" != '0' ] + then + set +x + echo ' ' + echo '*************************************************** ' + echo '*** FATAL ERROR : ERROR IN ww3_gint interpolation * ' + echo '*************************************************** ' + echo ' ' + [[ "$LOUD" = YES ]] && set -x + postmsg "$jlogfile" "FATAL ERROR : ERROR IN ww3_gint interpolation" + exit 3 + fi + +# 1.b Clean up + + rm -f grid_interp.inp + rm -f mod_def.* + mv out_grd.$grdID ../out_grd.$grdID + +# 1.c Save in /com + + if [ "$SENDCOM" = 'YES' ] + then + set +x + echo " Saving GRID file as $COMOUT/rundata/$WAV_MOD_TAG.out_grd.$grdID.$PDY$cyc" + [[ "$LOUD" = YES ]] && set -x + cp ../out_grd.$grdID $COMOUT/rundata/$WAV_MOD_TAG.out_grd.$grdID.$PDY$cyc + +# if [ "$SENDDBN" = 'YES' ] +# then +# set +x +# echo " Alerting GRID file as $COMOUT/rundata/$WAV_MOD_TAG.out_grd.$grdID.$PDY$cyc +# [[ "$LOUD" = YES ]] && set -x + +# +# PUT DBNET ALERT HERE .... +# + +# fi + fi + +# --------------------------------------------------------------------------- # +# 2. Clean up the directory + + set +x + echo " Removing work directory after success." + [[ "$LOUD" = YES ]] && set -x + + cd .. + mv -f grint_${grdID}_${ymdh} done.grint_${grdID}_${ymdh} + + set +x + echo ' ' + echo "End of ww3_interp.sh at" + date + +# End of ww3_grid_interp.sh -------------------------------------------- # diff --git a/ush/wave_grid_interp_sbs.sh b/ush/wave_grid_interp_sbs.sh new file mode 100755 index 0000000000..0f78d3f557 --- /dev/null +++ b/ush/wave_grid_interp_sbs.sh @@ -0,0 +1,217 @@ +#!/bin/bash +# +################################################################################ +# +# UNIX Script Documentation Block +# Script name: wave_grid_interp_sbs.sh +# Script description: Interpolate from native grids to target grid +# +# Author: J-Henrique Alves Org: NCEP/EMC Date: 2019-11-02 +# Abstract: Creates grib2 files from WW3 binary output +# +# Script history log: +# 2019-11-02 J-Henrique Alves Ported to global-workflow. +# +# $Id$ +# +# Attributes: +# Language: Bourne-again (BASH) shell +# Machine: WCOSS-DELL-P3 +# +# Requirements: +# - wgrib2 with IPOLATES library +# +################################################################################ +# --------------------------------------------------------------------------- # +# 0. Preparations +# 0.a Basic modes of operation + + # set execution trace prompt. ${0##*/} adds the script's basename + PS4=" \${SECONDS} ${0##*/} L\${LINENO} + " + set -x + + # Use LOUD variable to turn on/off trace. Defaults to YES (on). + export LOUD=${LOUD:-YES}; [[ $LOUD = yes ]] && export LOUD=YES + [[ "$LOUD" != YES ]] && set +x + + cd $GRDIDATA + + grdID=$1 + ymdh=$2 + dt=$3 + nst=$4 + postmsg "$jlogfile" "Making GRID Interpolation Files for $grdID." + rm -rf grint_${grdID}_${ymdh} + mkdir grint_${grdID}_${ymdh} + err=$? + + if [ "$err" != '0' ] + then + set +x + echo ' ' + echo '************************************************************************************* ' + echo '*** FATAL ERROR : ERROR IN ww3_grid_interp (COULD NOT CREATE TEMP DIRECTORY) *** ' + echo '************************************************************************************* ' + echo ' ' + [[ "$LOUD" = YES ]] && set -x + postmsg "$jlogfile" "FATAL ERROR : ERROR IN ww3_grid_interp (Could not create temp directory)" + exit 1 + fi + + cd grint_${grdID}_${ymdh} + +# 0.b Define directories and the search path. +# The tested variables should be exported by the postprocessor script. + + set +x + echo ' ' + echo '+--------------------------------+' + echo '! Make GRID files |' + echo '+--------------------------------+' + echo " Model ID : $WAV_MOD_TAG" + [[ "$LOUD" = YES ]] && set -x + + if [ -z "$CDATE" ] || [ -z "$cycle" ] || [ -z "$EXECcode" ] || \ + [ -z "$COMOUT" ] || [ -z "$WAV_MOD_TAG" ] || [ -z "$SENDCOM" ] || \ + [ -z "$SENDDBN" ] || [ -z "$waveGRD" ] + then + set +x + echo ' ' + echo '***************************************************' + echo '*** EXPORTED VARIABLES IN postprocessor NOT SET ***' + echo '***************************************************' + echo ' ' + echo "$CDATE $cycle $EXECcode $COMOUT $WAV_MOD_TAG $SENDCOM $SENDDBN $waveGRD" + [[ "$LOUD" = YES ]] && set -x + postmsg "$jlogfile" "EXPORTED VARIABLES IN postprocessor NOT SET" + exit 1 + fi + +# 0.c Links to files + + rm -f ${DATA}/output_${ymdh}0000/out_grd.$grdID + + if [ ! -f ${DATA}/${grdID}_interp.inp.tmpl ]; then + cp $FIXwave/${grdID}_interp.inp.tmpl ${DATA} + fi + ln -sf ${DATA}/${grdID}_interp.inp.tmpl . + + for ID in $waveGRD + do + ln -sf ${DATA}/output_${ymdh}0000/out_grd.$ID . + done + + for ID in $waveGRD $grdID + do + ln -sf ${DATA}/mod_def.$ID . + done + +# --------------------------------------------------------------------------- # +# 1. Generate GRID file with all data +# 1.a Generate Input file + + time="`echo $ymdh | cut -c1-8` `echo $ymdh | cut -c9-10`0000" + + sed -e "s/TIME/$time/g" \ + -e "s/DT/$dt/g" \ + -e "s/NSTEPS/$nst/g" ${grdID}_interp.inp.tmpl > ww3_gint.inp + +# Check if there is an interpolation weights file available + + wht_OK='no' + if [ ! -f ${DATA}/WHTGRIDINT.bin.${grdID} ]; then + if [ -f $FIXwave/WHTGRIDINT.bin.${grdID} ] + then + set +x + echo ' ' + echo " Copying $FIXwave/WHTGRIDINT.bin.${grdID} " + [[ "$LOUD" = YES ]] && set -x + cp $FIXwave/WHTGRIDINT.bin.${grdID} ${DATA} + wht_OK='yes' + else + set +x + echo ' ' + echo " Not found: $FIXwave/WHTGRIDINT.bin.${grdID} " + fi + fi +# Check and link weights file + if [ -f ${DATA}/WHTGRIDINT.bin.${grdID} ] + then + ln -s ${DATA}/WHTGRIDINT.bin.${grdID} ./WHTGRIDINT.bin + fi + +# 1.b Run interpolation code + + set +x + echo " Run ww3_gint + echo " Executing $EXECcode/ww3_gint + [[ "$LOUD" = YES ]] && set -x + + $EXECcode/ww3_gint + err=$? + +# Write interpolation file to main TEMP dir area if not there yet + if [ "wht_OK" = 'no' ] + then + cp -f ./WHTGRIDINT.bin ${DATA}/WHTGRIDINT.bin.${grdID} + cp -f ./WHTGRIDINT.bin ${FIXwave}/WHTGRIDINT.bin.${grdID} + fi + + + if [ "$err" != '0' ] + then + set +x + echo ' ' + echo '*************************************************** ' + echo '*** FATAL ERROR : ERROR IN ww3_gint interpolation * ' + echo '*************************************************** ' + echo ' ' + [[ "$LOUD" = YES ]] && set -x + postmsg "$jlogfile" "FATAL ERROR : ERROR IN ww3_gint interpolation" + exit 3 + fi + +# 1.b Clean up + + rm -f grid_interp.inp + rm -f mod_def.* + mv out_grd.$grdID ${DATA}/output_${ymdh}0000/out_grd.$grdID + +# 1.c Save in /com + + if [ "$SENDCOM" = 'YES' ] + then + set +x + echo " Saving GRID file as $COMOUT/rundata/$WAV_MOD_TAG.out_grd.$grdID.${CDATE}" + [[ "$LOUD" = YES ]] && set -x + cp ${DATA}/output_${ymdh}0000/out_grd.$grdID $COMOUT/rundata/$WAV_MOD_TAG.out_grd.$grdID.${CDATE} + +# if [ "$SENDDBN" = 'YES' ] +# then +# set +x +# echo " Alerting GRID file as $COMOUT/rundata/$WAV_MOD_TAG.out_grd.$grdID.${CDATE} +# [[ "$LOUD" = YES ]] && set -x + +# +# PUT DBNET ALERT HERE .... +# + +# fi + fi + +# --------------------------------------------------------------------------- # +# 2. Clean up the directory + + set +x + echo " Removing work directory after success." + [[ "$LOUD" = YES ]] && set -x + + cd ../ + mv -f grint_${grdID}_${ymdh} done.grint_${grdID}_${ymdh} + + set +x + echo ' ' + echo "End of ww3_interp.sh at" + date + +# End of ww3_grid_interp.sh -------------------------------------------- # diff --git a/ush/wave_grid_moddef.sh b/ush/wave_grid_moddef.sh new file mode 100755 index 0000000000..42976286aa --- /dev/null +++ b/ush/wave_grid_moddef.sh @@ -0,0 +1,136 @@ +#!/bin/bash +# +################################################################################ +# +# UNIX Script Documentation Block +# Script name: wave_grid_moddef.sh +# Script description: Create grib2 files for the wave component +# +# Author: J-Henrique Alves Org: NCEP/EMC Date: 2011-04-08 +# Abstract: Creates model definition files for the wave model WW3 +# +# Script history log: +# 2019-11-02 J-Henrique Alves Ported to global-workflow. +# +# $Id$ +# # +############################################################################### +# +# --------------------------------------------------------------------------- # +# 0. Preparations +# 0.a Basic modes of operation + + # set execution trace prompt. ${0##*/} adds the script's basename + PS4=" \${SECONDS} ${0##*/} L\${LINENO} + " + set -x + + # Use LOUD variable to turn on/off trace. Defaults to YES (on). + export LOUD=${LOUD:-YES}; [[ $LOUD = yes ]] && export LOUD=YES + [[ "$LOUD" != YES ]] && set +x + + postmsg "$jlogfile" "Generating mod_def file" + + mkdir -p moddef_${1} + cd moddef_${1} + + grdID=$1 + + set +x + echo ' ' + echo '+--------------------------------+' + echo '! Generate moddef file |' + echo '+--------------------------------+' + echo " Grid : $1" + echo ' ' + [[ "$LOUD" = YES ]] && set -x + +# 0.b Check if grid set + + if [ "$#" -lt '1' ] + then + set +x + echo ' ' + echo '**************************************************' + echo '*** Grid not identifife in ww3_mod_def.sh ***' + echo '**************************************************' + echo ' ' + [[ "$LOUD" = YES ]] && set -x + postmsg "$jlogfile" "GRID IN ww3_mod_def.sh NOT SET" + exit 1 + else + grdID=$1 + fi + +# 0.c Define directories and the search path. +# The tested variables should be exported by the postprocessor script. + + if [ -z "$grdID" ] || [ -z "$EXECcode" ] || [ -z "$wave_sys_ver" ] + then + set +x + echo ' ' + echo '*********************************************************' + echo '*** EXPORTED VARIABLES IN ww3_mod_def.sh NOT SET ***' + echo '*********************************************************' + echo ' ' + [[ "$LOUD" = YES ]] && set -x + postmsg "$jlogfile" "EXPORTED VARIABLES IN ww3_mod_def.sh NOT SET" + exit 2 + fi + +# --------------------------------------------------------------------------- # +# 2. Create mod_def file + + set +x + echo ' ' + echo ' Creating mod_def file ...' + echo " Executing $EXECcode/ww3_grid" + echo ' ' + [[ "$LOUD" = YES ]] && set -x + + rm -f ww3_grid.inp + ln -sf ../ww3_grid.inp.$grdID ww3_grid.inp + + $EXECcode/ww3_grid + err=$? + + if [ "$err" != '0' ] + then + set +x + echo ' ' + echo '******************************************** ' + echo '*** FATAL ERROR : ERROR IN ww3_grid *** ' + echo '******************************************** ' + echo ' ' + [[ "$LOUD" = YES ]] && set -x + postmsg "$jlogfile" "FATAL ERROR : ERROR IN ww3_grid" + exit 3 + fi + + if [ -f mod_def.ww3 ] + then + cp mod_def.ww3 $COMOUT/rundata/${COMPONENTwave}.mod_def.${grdID} + mv mod_def.ww3 ../mod_def.$grdID + else + set +x + echo ' ' + echo '******************************************** ' + echo '*** FATAL ERROR : MOD DEF FILE NOT FOUND *** ' + echo '******************************************** ' + echo ' ' + [[ "$LOUD" = YES ]] && set -x + postmsg "$jlogfile" "FATAL ERROR : Mod def File creation FAILED" + exit 4 + fi + +# --------------------------------------------------------------------------- # +# 3. Clean up + + cd .. + #rm -rf moddef_$grdID + + set +x + echo ' ' + echo 'End of ww3_mod_def.sh at' + date + +# End of ww3_mod_def.sh ------------------------------------------------- # diff --git a/ush/wave_outp_spec.sh b/ush/wave_outp_spec.sh new file mode 100755 index 0000000000..9cbcf6e9a6 --- /dev/null +++ b/ush/wave_outp_spec.sh @@ -0,0 +1,260 @@ +#!/bin/bash +# +################################################################################ +# +# UNIX Script Documentation Block +# Script name: wave_outp_spec.sh +# Script description: Generates ASCII data files with the wave spectral data +# +# Author: Hendrik Tolman Org: NCEP/EMC Date: 2007-03-17 +# Abstract: Creates grib2 files from WW3 binary output +# +# Script history log: +# 2019-11-02 J-Henrique Alves Ported to global-workflow. +# +# $Id$ +# +# Attributes: +# Language: Bourne-again (BASH) shell +# Machine: WCOSS-DELL-P3 +# +################################################################################ +# --------------------------------------------------------------------------- # +# 0. Preparations +# 0.a Basic modes of operation + + # set execution trace prompt. ${0##*/} adds the script's basename + PS4=" \${SECONDS} ${0##*/} L\${LINENO} + " + set -x + + # Use LOUD variable to turn on/off trace. Defaults to YES (on). + export LOUD=${LOUD:-YES}; [[ $LOUD = yes ]] && export LOUD=YES + [[ "$LOUD" != YES ]] && set +x + + bloc=$1 + ymdh=$2 + specdir=$3 + + YMDHE=`$NDATE $FHMAX_WAV $CDATE` + + cd $SPECDATA + + rm -rf ${specdir}_${bloc} + mkdir ${specdir}_${bloc} + err=$? + if [ "$err" != '0' ] + then + set +x + echo ' ' + echo '****************************************************************************** ' + echo '*** FATAL ERROR : ERROR IN ww3_outp_spec (COULD NOT CREATE TEMP DIRECTORY) *** ' + echo '****************************************************************************** ' + echo ' ' + [[ "$LOUD" = YES ]] && set -x + postmsg "$jlogfile" "FATAL ERROR : ERROR IN ww3_outp_spec (Could not create temp directory)" + exit 1 + fi + + cd ${specdir}_${bloc} + + set +x + echo ' ' + echo '+--------------------------------+' + echo '! Make spectral file |' + echo '+--------------------------------+' + echo " Model ID : $WAV_MOD_TAG" + [[ "$LOUD" = YES ]] && set -x + +# 0.b Check if buoy location set + + if [ "$#" -lt '1' ] + then + set +x + echo ' ' + echo '***********************************************' + echo '*** LOCATION ID IN ww3_outp_spec.sh NOT SET ***' + echo '***********************************************' + echo ' ' + [[ "$LOUD" = YES ]] && set -x + postmsg "$jlogfile" "LOCATION ID IN ww3_outp_spec.sh NOT SET" + exit 1 + else + buoy=$bloc + grep $buoy ${DATA}/buoy_log.ww3 > tmp_list.loc + while read line + do + buoy_name=`echo $line | awk '{print $2}'` + if [ $buoy = $buoy_name ] + then + point=`echo $line | awk '{ print $1 }'` + set +x + echo " Location ID/# : $buoy (${point})" + echo " Spectral output start time : $ymdh " + echo ' ' + [[ "$LOUD" = YES ]] && set -x + break + fi + done < tmp_list.loc + if [ -z "$point" ] + then + set +x + echo '******************************************************' + echo '*** LOCATION ID IN ww3_outp_spec.sh NOT RECOGNIZED ***' + echo '******************************************************' + echo ' ' + [[ "$LOUD" = YES ]] && set -x + postmsg "$jlogfile" "LOCATION ID IN ww3_outp_spec.sh NOT RECOGNIZED" + exit 2 + fi + fi + + +# 0.c Define directories and the search path. +# The tested variables should be exported by the postprocessor script. + + if [ -z "$CDATE" ] || [ -z "$dtspec" ] || [ -z "$EXECcode" ] || \ + [ -z "$WAV_MOD_TAG" ] || [ -z "${STA_DIR}" ] + then + set +x + echo ' ' + echo '******************************************************' + echo '*** EXPORTED VARIABLES IN ww3_outp_spec.sh NOT SET ***' + echo '******************************************************' + echo ' ' + [[ "$LOUD" = YES ]] && set -x + postmsg "$jlogfile" "EXPORTED VARIABLES IN ww3_outp_spec.sh NOT SET" + exit 3 + fi + +# 0.d Starting time for output + + tstart="`echo $ymdh | cut -c1-8` `echo $ymdh | cut -c9-10`0000" + YMD="`echo $ymdh | cut -c1-8`" + HMS="`echo $ymdh | cut -c9-10`0000" + set +x + echo " Output starts at $tstart." + echo ' ' + [[ "$LOUD" = YES ]] && set -x + +# 0.e sync important files + +# $FSYNC ${DATA}/mod_def.${waveuoutpGRD} +# $FSYNC ${DATA}/out_pnt.${waveuoutpGRD} +# $FSYNC ${DATA}/ww3_outp_spec.inp.tmpl + +# 0.f Links to mother directory + + ln -s ${DATA}/mod_def.${waveuoutpGRD} ./mod_def.ww3 + ln -s ${DATA}/output_${ymdh}0000/out_pnt.${waveuoutpGRD} ./out_pnt.ww3 + +# --------------------------------------------------------------------------- # +# 2. Generate spectral data file +# 2.a Input file for postprocessor + + set +x + echo " Generate input file for ww3_outp." + [[ "$LOUD" = YES ]] && set -x + + if [ "$specdir" = "bull" ] + then + tstart="`echo $ymdh | cut -c1-8` `echo $ymdh | cut -c9-10`0000" + truntime="`echo $CDATE | cut -c1-8` `echo $YMDH | cut -c9-10`0000" + sed -e "s/TIME/$tstart/g" \ + -e "s/DT/$dtspec/g" \ + -e "s/POINT/$point/g" \ + -e "s/REFT/$truntime/g" \ + ${DATA}/ww3_outp_bull.inp.tmpl > ww3_outp.inp + outfile=${buoy}.bull + coutfile=${buoy}.cbull + else + sed -e "s/TIME/$tstart/g" \ + -e "s/DT/$dtspec/g" \ + -e "s/POINT/$point/g" \ + -e "s/ITYPE/1/g" \ + -e "s/FORMAT/F/g" \ + ${DATA}/ww3_outp_spec.inp.tmpl > ww3_outp.inp + outfile=ww3.`echo $tstart | cut -c3-8``echo $tstart | cut -c10-11`.spc + fi + +# 2.b Run the postprocessor + + set +x + echo " Executing $EXECcode/ww3_outp" + [[ "$LOUD" = YES ]] && set -x + + $EXECcode/ww3_outp + err=$? + + if [ "$err" != '0' ] + then + set +x + echo ' ' + echo '******************************************** ' + echo '*** FATAL ERROR : ERROR IN ww3_outp *** ' + echo '******************************************** ' + echo ' ' + [[ "$LOUD" = YES ]] && set -x + postmsg "$jlogfile" "FATAL ERROR : ERROR IN ww3_outp" + exit 4 + fi + +# --------------------------------------------------------------------------- # +# 3. Clean up +# 3.a Move data to directory for station ascii files + + if [ -f $outfile ] + then + if [ "${ymdh}" = "${CDATE}" ] + then + if [ "$specdir" = "bull" ] + then + cat $outfile | sed -e '9,$d' >> ${STA_DIR}/${specdir}/$WAV_MOD_TAG.$buoy.bull + cat $coutfile | sed -e '8,$d' >> ${STA_DIR}/c${specdir}/$WAV_MOD_TAG.$buoy.cbull + else + #cat $outfile | sed -e '15,$d' >> ${STA_DIR}/${specdir}/$WAV_MOD_TAG.$buoy.spec + cat $outfile >> ${STA_DIR}/${specdir}/$WAV_MOD_TAG.$buoy.spec + fi + elif [ "${ymdh}" = "${YMDHE}" ] + then + if [ "$specdir" = "bull" ] + then + cat $outfile | sed -e '1,7d' >> ${STA_DIR}/${specdir}/$WAV_MOD_TAG.$buoy.bull + cat $coutfile | sed -e '1,6d' >> ${STA_DIR}/c${specdir}/$WAV_MOD_TAG.$buoy.cbull + else + cat $outfile | sed -n "/^${YMD} ${HMS}$/,\$p" >> ${STA_DIR}/${specdir}/$WAV_MOD_TAG.$buoy.spec + fi + else + if [ "$specdir" = "bull" ] + then + cat $outfile | sed -e '1,7d' | sed -e '2,$d' >> ${STA_DIR}/${specdir}/$WAV_MOD_TAG.$buoy.bull + cat $coutfile | sed -e '1,6d' | sed -e '2,$d' >> ${STA_DIR}/c${specdir}/$WAV_MOD_TAG.$buoy.cbull + else + cat $outfile | sed -n "/^${YMD} ${HMS}$/,\$p" >> ${STA_DIR}/${specdir}/$WAV_MOD_TAG.$buoy.spec + fi + fi + else + set +x + echo ' ' + echo '***************************************************************** ' + echo '*** FATAL ERROR : OUTPUT DATA FILE FOR BOUY $bouy NOT FOUND *** ' + echo '***************************************************************** ' + echo ' ' + [[ "$LOUD" = YES ]] && set -x + postmsg "$jlogfile" "FATAL ERROR : OUTPUT DATA FILE FOR BOUY $bouy NOT FOUND" + exit 5 + fi + +# 3.b Clean up the rest + +# rm -f ww3_outp.inp +# rm -f mod_def.ww3 out_pnt.ww3 + + cd .. + mv -f $specdir_$buoy done.$specdir_$buoy + + set +x + echo ' ' + echo 'End of ww3_outp_spec.sh at' + date + +# End of ww3_outp_spec.sh ---------------------------------------------------- # diff --git a/ush/wave_prnc_cur.sh b/ush/wave_prnc_cur.sh new file mode 100755 index 0000000000..1a6dd3608f --- /dev/null +++ b/ush/wave_prnc_cur.sh @@ -0,0 +1,75 @@ +#!/bin/sh +# +################################################################################ +# +# UNIX Script Documentation Block +# Script name: wave_prns_cur.sh +# Script description: Acquires current data and generates binary input for WW3 +# +# Author: J.-Henrique Alves Org: NCEP/EMC Date: 2019-11-06 +# Abstract: Creates current binary data for forcing WW3 +# +# Script history log: +# +# $Id$ +# +# Attributes: +# Language: Bourne-again (BASH) shell +# Machine: WCOSS-DELL-P3 +# +################################################################################ +# +set -x + +ymdh_rtofs=$1 +curfile=$2 + +# Timing has to be made relative to the single 00z RTOFS cycle for that PDY + +mkdir -p rtofs_${ymdh_rtofs} +cd rtofs_${ymdh_rtofs} + +ncks -x -v sst,sss,layer_density $curfile cur_uv_${PDY}_${fext}${fhr}.nc +ncks -O -a -h -x -v Layer cur_uv_${PDY}_${fext}${fhr}.nc cur_temp1.nc +ncwa -h -O -a Layer cur_temp1.nc cur_temp2.nc +ncrename -h -O -v MT,time cur_temp2.nc +ncrename -h -O -d MT,time cur_temp2.nc +ncks -v u_velocity,v_velocity cur_temp2.nc cur_temp3.nc +mv -f cur_temp3.nc cur_uv_${PDY}_${fext}${fhr}_flat.nc + +# Convert to regular lat lon file + +cp ${FIXwave}/weights_rtofs_to_r4320x2160.nc ./weights.nc + +# Interpolate to regular 5 min grid +$CDO remap,r4320x2160,weights.nc cur_uv_${PDY}_${fext}${fhr}_flat.nc cur_5min_01.nc + +# Perform 9-point smoothing twice to make RTOFS data less noisy when +# interpolating from 1/12 deg RTOFS grid to 1/6 deg wave grid +if [ "WAV_CUR_CDO_SMOOTH" = "YES" ]; then + $CDO -f nc -smooth9 cur_5min_01.nc cur_5min_02.nc + $CDO -f nc -smooth9 cur_5min_02.nc cur_glo_uv_${PDY}_${fext}${fhr}_5min.nc +else + mv cur_5min_01.nc cur_glo_uv_${PDY}_${fext}${fhr}_5min.nc +fi + +# Cleanup +rm -f cur_temp[123].nc cur_5min_??.nc cur_glo_uv_${PDY}_${fext}${fhr}.nc weights.nc + +if [ ${fhr_wave} -gt ${WAVHINDH} ] +then + sed -e "s/HDRFL/F/g" ${FIXwave}/ww3_prnc.cur.${WAVECUR_FID}.inp.tmpl > ww3_prnc.inp +else + sed -e "s/HDRFL/T/g" ${FIXwave}/ww3_prnc.cur.${WAVECUR_FID}.inp.tmpl > ww3_prnc.inp +fi + +rm -f cur.nc +ln -s cur_glo_uv_${PDY}_${fext}${fhr}_5min.nc cur.nc +ln -s ${DATA}/mod_def.rtofs_5m ./mod_def.ww3 + +$EXECcode/ww3_prnc + +mv -f current.ww3 ${DATA}/${WAVECUR_FID}.${ymdh_rtofs} + +cd ${DATA} + diff --git a/ush/wave_prnc_ice.sh b/ush/wave_prnc_ice.sh new file mode 100755 index 0000000000..328b8c6728 --- /dev/null +++ b/ush/wave_prnc_ice.sh @@ -0,0 +1,198 @@ +#!/bin/sh +############################################################################### +# # +# This script preprocesses ice fields for the ocean wave models. # +# It is run as a child scipt by the corresponding preprocessig script. # +# # +# Remarks : # +# - This script runs in the work directory designated in the mother script in # +# which it generates its own sub-directory 'ice'. # +# - Because this script is not essential for the running for the wave model # +# (as long as it runs every now and then) the error exit codes are set to # +# 0. The main program script will then not find the file ice.ww3 and send # +# a message to the wave.log file. # +# - See section 0.b for variables that need to be set. # +# # +# Update record : # +# # +# - Origination: Hendrik Tolman 01-Mar-2007 # +# # +# Update log # +# Nov2019 JHAlves - Merging wave scripts to global workflow # +# # +############################################################################### +# +# --------------------------------------------------------------------------- # +# 0. Preparations +# 0.a Basic modes of operation + + cd $DATA + seton='-xa' + setoff='+xa' + set $seton + + rm -rf ice + mkdir ice + cd ice + ln -s ${DATA}/postmsg . + +# 0.b Define directories and the search path. +# The tested variables should be exported by the postprocessor script. + + set $setoff + echo ' ' + echo '+--------------------------------+' + echo '! Make ice fields |' + echo '+--------------------------------+' + echo " Model TAG : $WAV_MOD_TAG" + echo " Model ID : $COMPONENTwave" + echo " Ice grid ID : $WAVEICE_FID" + echo " Ice file : $WAVICEFILE" + echo ' ' + set $seton + postmsg "$jlogfile" "Making ice fields." + + if [ -z "$YMDH" ] || [ -z "$cycle" ] || \ + [ -z "$COMOUT" ] || [ -z "$FIXwave" ] || [ -z "$EXECcode" ] || \ + [ -z "$WAV_MOD_TAG" ] || [ -z "$WAVEICE_FID" ] || [ -z "$SENDCOM" ] || \ + [ -z "$COMIN_WAV_ICE" ] || [ -z "$COMPONENTwave" ] + then + set $setoff + echo ' ' + echo '**************************************************' + echo '*** EXPORTED VARIABLES IN preprocessor NOT SET ***' + echo '**************************************************' + echo ' ' + exit 0 + set $seton + postmsg "$jlogfile" "NON-FATAL ERROR - EXPORTED VARIABLES IN preprocessor NOT SET" + fi + +# 0.c Links to working directory + + ln -s ${DATA}/mod_def.$WAVEICE_FID mod_def.ww3 + +# --------------------------------------------------------------------------- # +# 1. Get the necessary files +# 1.a Copy the ice data file + + file=${COMIN_WAV_ICE}/${WAVICEFILE} + + if [ -f $file ] + then + cp $file ice.grib + fi + + if [ -f ice.grib ] + then + set $setoff + echo " ice.grib copied ($file)." + set $seton + else + set $setoff + echo ' ' + echo '************************************** ' + echo "*** FATAL ERROR: NO ICE FILE $file *** " + echo '************************************** ' + echo ' ' + set $seton + postmsg "$jlogfile" "FATAL ERROR - NO ICE FILE (GFS GRIB)" + exit 0 + fi + +# --------------------------------------------------------------------------- # +# 2. Process the GRIB packed ice file +# 2.a Unpack data + + set $setoff + echo ' Extracting data from ice.grib ...' + set $seton + + $WGRIB2 ice.grib -netcdf icean_5m.nc 2>&1 > wgrib.out + + + err=$? + + if [ "$err" != '0' ] + then + cat wgrib.out + set $setoff + echo ' ' + echo '**************************************** ' + echo '*** ERROR IN UNPACKING GRIB ICE FILE *** ' + echo '**************************************** ' + echo ' ' + set $seton + postmsg "$jlogfile" "ERROR IN UNPACKING GRIB ICE FILE." + exit 0 + fi + + rm -f wgrib.out + rm -f ice.grib + rm -f ice.index + + +# 2.d Run through preprocessor wave_prep + + set $setoff + echo ' Run through preprocessor ...' + echo ' ' + set $seton + + cp -f ${DATA}/ww3_prnc.ice.$WAVEICE_FID.inp.tmpl ww3_prnc.inp + + $EXECcode/ww3_prnc > wave_prnc.out + err=$? + + if [ "$err" != '0' ] + then + cat wave_prep.out + set $setoff + echo ' ' + echo '************************* ' + echo '*** ERROR IN waveprep *** ' + echo '************************* ' + echo ' ' + set $seton + postmsg "$jlogfile" "NON-FATAL ERROR IN waveprep." + exit 0 + fi + + rm -f wave_prep.out ww3_prep.inp ice.raw mod_def.ww3 + +# --------------------------------------------------------------------------- # +# 3. Save the ice file +# +# Ice file name will have ensemble member number if WW3ATMIENS=T +# and only WAV_MOD_ID if WW3ATMIENS=F +# + if [ "${WW3ATMIENS}" = "T" ] + then + icefile=${WAV_MOD_TAG}.${WAVEICE_FID}.$cycle.ice + elif [ "${WW3ATMIENS}" = "F" ] + then + icefile=${COMPONENTwave}.${WAVEICE_FID}.$cycle.ice + fi + + set $setoff + echo " Saving ice.ww3 as $COMOUT/rundata/${icefile}" + set $seton + cp ice.ww3 $COMOUT/rundata/${icefile} + rm -f ice.ww3 + +# --------------------------------------------------------------------------- # +# 4. Clean up the directory + + set $setoff + echo " Removing work directory after success." + set $seton + + cd .. + rm -rf ice + + set $setoff + echo ' ' + echo 'End of waveice.sh at' + date + +# End of waveice.sh --------------------------------------------------------- # diff --git a/ush/wave_tar.sh b/ush/wave_tar.sh new file mode 100755 index 0000000000..edeb1994d9 --- /dev/null +++ b/ush/wave_tar.sh @@ -0,0 +1,231 @@ +#!/bin/bash +############################################################################### +# # +# This script tars the sectral or bulletin files into a single file and # +# puts it into /com. This is a separate script to enable it to be run in # +# parallel using poe. It also tars the spectral and bulletin files of the # +# old grids that are generated for backward compatibility # +# # +# Remarks : # +# - Shell script variables controling time, directories etc. are set in the # +# mother script. # +# - This script runs in the work directory designated in the mother script. # +# Under this directory it geneates a work directory TAR_$type_$ID which is # +# removed if this script exits normally. # +# - See section 0.c for variables that need to be set. # +# # +# Origination: Hendrik Tolman March 13, 2007 # +# Update log # +# Nov2019 JHAlves - Merging wave scripts to global workflow # +# # +############################################################################### +# +# --------------------------------------------------------------------------- # +# 0. Preparations +# 0.a Basic modes of operation + + # set execution trace prompt. ${0##*/} adds the script's basename + PS4=" \${SECONDS} ${0##*/} L\${LINENO} + " + set -x + + # Use LOUD variable to turn on/off trace. Defaults to YES (on). + export LOUD=${LOUD:-YES}; [[ $LOUD = yes ]] && export LOUD=YES + [[ "$LOUD" != YES ]] && set +x + + cd $DATA + postmsg "$jlogfile" "Making TAR FILE" + + + set +x + echo ' ' + echo '+--------------------------------+' + echo '! Make tar file |' + echo '+--------------------------------+' + echo " ID : $1" + echo " Type : $2" + echo " Number of files : $3" + [[ "$LOUD" = YES ]] && set -x + + +# 0.b Check if type set + + if [ "$#" -lt '3' ] + then + set +x + echo ' ' + echo '********************************************' + echo '*** VARIABLES IN ww3_tar.sh NOT SET ***' + echo '********************************************' + echo ' ' + [[ "$LOUD" = YES ]] && set -x + postmsg "$jlogfile" "TYPE IN ww3_tar.sh NOT SET" + exit 1 + else + ID=$1 + type=$2 + nb=$3 + fi + + filext=$type + if [ "$type" = "ibp" ]; then filext='spec'; fi + + rm -rf TAR_${filext}_$ID + mkdir TAR_${filext}_$ID +# this directory is used only for error capturing + +# 0.c Define directories and the search path. +# The tested variables should be exported by the postprocessor script. + + if [ -z "$cycle" ] || [ -z "$COMOUT" ] || [ -z "$WAV_MOD_TAG" ] || \ + [ -z "$SENDCOM" ] || [ -z "$SENDDBN" ] || [ -z "${STA_DIR}" ] + then + set +x + echo ' ' + echo '*****************************************************' + echo '*** EXPORTED VARIABLES IN ww3_tar.sh NOT SET ***' + echo '*****************************************************' + echo ' ' + [[ "$LOUD" = YES ]] && set -x + postmsg "$jlogfile" "EXPORTED VARIABLES IN ww3_tar.sh NOT SET" + exit 2 + fi + + cd ${STA_DIR}/${type} + +# --------------------------------------------------------------------------- # +# 2. Generate tar file (spectral files are compressed) + + set +x + echo ' ' + echo ' Making tar file ...' + + count=0 + countMAX=5 + tardone='no' + + while [ "$count" -lt "$countMAX" ] && [ "$tardone" = 'no' ] + do + + [[ "$LOUD" = YES ]] && set -v + # JY nf=`ls $ID.*.$type | wc -l | awk '{ print $1 }'` + nf=`ls | awk '/'$ID.*.$filext'/ {a++} END {print a}'` + if [ "$nf" = "$nb" ] + then + tar -cf $ID.$cycle.${type}_tar ./$ID.*.$filext + exit=$? + set +v; [[ "$LOUD" = YES ]] && set -x + + if [ "$exit" != '0' ] + then + set +x + echo ' ' + echo '***************************************** ' + echo '*** FATAL ERROR : TAR CREATION FAILED *** ' + echo '***************************************** ' + echo ' ' + [[ "$LOUD" = YES ]] && set -x + postmsg "$jlogfile" "FATAL ERROR : TAR CREATION FAILED" + exit 3 + fi + + if [ -f "$ID.$cycle.${type}_tar" ] + then + tardone='yes' + fi + else + set +x + echo ' All files not found for tar. Sleeping 10 seconds and trying again ..' + [[ "$LOUD" = YES ]] && set -x + sleep 10 + count=`expr $count + 1` + fi + + done + + if [ "$tardone" = 'no' ] + then + set +x + echo ' ' + echo '***************************************** ' + echo '*** FATAL ERROR : TAR CREATION FAILED *** ' + echo '***************************************** ' + echo ' ' + [[ "$LOUD" = YES ]] && set -x + postmsg "$jlogfile" "FATAL ERROR : TAR CREATION FAILED" + exit 3 + fi + + if [ "$filext" = 'spec' ] + then + if [ -s $ID.$cycle.${type}_tar ] + then + file_name=$ID.$cycle.${type}_tar.gz + /usr/bin/gzip -c $ID.$cycle.${type}_tar > ${file_name} + exit=$? + + if [ "$exit" != '0' ] + then + set +x + echo ' ' + echo '***************************************************** ' + echo '*** FATAL ERROR : SPECTRAL TAR COMPRESSION FAILED *** ' + echo '***************************************************** ' + echo ' ' + [[ "$LOUD" = YES ]] && set -x + postmsg "$jlogfile" "FATAL ERROR : SPECTRAL TAR COMPRESSION FAILED" + exit 4 + fi + fi + else + file_name=$ID.$cycle.${type}_tar + fi + +# --------------------------------------------------------------------------- # +# 3. Move data to /com + + set +x + echo ' ' + echo " Moving tar file ${file_name} to $COMOUT ..." + [[ "$LOUD" = YES ]] && set -x + + cp ${file_name} $COMOUT/station/. + + exit=$? + + if [ "$exit" != '0' ] + then + set +x + echo ' ' + echo '************************************* ' + echo '*** FATAL ERROR : TAR COPY FAILED *** ' + echo '************************************* ' + echo ' ' + [[ "$LOUD" = YES ]] && set -x + postmsg "$jlogfile" "FATAL ERROR : TAR COPY FAILED" + exit 4 + fi + + if [ "$SENDDBN" = 'YES' ] + then + set +x + echo ' ' + echo " Alerting TAR file as $COMOUT/station/${file_name}" + echo ' ' + [[ "$LOUD" = YES ]] && set -x + $DBNROOT/bin/dbn_alert MODEL OMBWAVE $job $COMOUT/station/${file_name} + fi + +# --------------------------------------------------------------------------- # +# 4. Final clean up + + cd $DATA + + set +x; [[ "$LOUD" = YES ]] && set -v + rm -f ${STA_DIR}/${type} + set +v + + echo ' ' + echo 'End of ww3_tar.sh at' + date + +# End of ww3_tar.sh ----------------------------------------------------- # diff --git a/workflow/cases/coupled_free_forecast.yaml b/workflow/cases/coupled_free_forecast.yaml index ced188823a..fe852cf499 100644 --- a/workflow/cases/coupled_free_forecast.yaml +++ b/workflow/cases/coupled_free_forecast.yaml @@ -1,18 +1,18 @@ case: places: workflow_file: layout/free_forecast_gfs.yaml - MOM6IC: /scratch1/NCEPDEV/nems/Bin.Li/S2S/FROM_HPSS + #BASE_CPLIC: /scratch2/NCEPDEV/climate/climpara/S2S/IC settings: SDATE: 2013-04-01t00:00:00 - EDATE: 2013-04-02t00:00:00 + EDATE: 2013-04-01t00:00:00 cplflx: .true. print_esmf: .true. nems_temp: 'med_atm_ocn_ice' nems_temp_cold: 'medcold_atm_ocn_ice' - mom6ic_prepared: .true. -# cplflx: .false. + mom6ic_prepared: .false. + KEEPDATA: NO nsst: NST_MODEL: 0 @@ -30,7 +30,7 @@ case: LEVS: 65 DELTIM: 450 SEEDLET: 10 - CCPP_SUITE: GFS + CCPP_SUITE: FV3_GFS_v15p2_coupled nst_anl: no DO_SKEB: false DO_SHUM: false diff --git a/workflow/config/fcst.yaml b/workflow/config/fcst.yaml index 8be2a9239f..e1568d5145 100644 --- a/workflow/config/fcst.yaml +++ b/workflow/config/fcst.yaml @@ -6,7 +6,7 @@ config_fcst: filename: config.fcst FCSTEXEC: !FirstTrue - when: !calc doc.settings.cplflx==".true." - do: "nems_fv3_mom6_cice5.x" + do: "nems_fv3_ccpp_mom6_cice5_ww3.x" - otherwise: "global_fv3gfs.x" more_exports_for_microphys: !FirstTrue - when: !calc ( doc.fv3_gfs_settings.imp_physics=="11" ) diff --git a/workflow/config/fv3ic.yaml b/workflow/config/fv3ic.yaml index f1d967e65c..72c8dd6bfd 100644 --- a/workflow/config/fv3ic.yaml +++ b/workflow/config/fv3ic.yaml @@ -20,7 +20,7 @@ config_fv3ic: export npe_fv3ic={doc.partition_common.resources.run_fv3ic[0].mpi_ranks} export npe_node_fv3ic={doc.partition_common.resources.run_fv3ic[0].mpi_ranks} - export ORIGIN_ROOT="{doc.places.MOM6IC}" + export ORIGIN_ROOT="{doc.places.BASE_CPLIC}" echo "END: config.fv3ic" diff --git a/workflow/defaults/places.yaml b/workflow/defaults/places.yaml index 24c40ddb15..36fc127668 100644 --- a/workflow/defaults/places.yaml +++ b/workflow/defaults/places.yaml @@ -14,13 +14,15 @@ default_places: &default_places EXPDIR: !expand "{doc.platform.EXPROOT}/{doc.names.experiment}" ROTDIR: !expand "{doc.platform.COMROOT}/{doc.names.experiment}" ICSDIR: !expand "{ROTDIR}/FV3ICS" - MOM6IC: /scratch4/NCEPDEV/nems/noscrub/Bin.Li/FROM_HPSS + BASE_CPLIC: !calc doc.platform.BASE_CPLIC DATAROOT: !expand "{doc.platform.DATAROOT}/{doc.names.experiment}" # SHORT_TERM_TEMP: !calc doc.platform.short_term_temp # LONG_TERM_TEMP: !calc doc.platform.long_term_temp # SHORT_TERM_TEMP: !error GOT HERE # LONG_TERM_TEMP: !error GOT HERE TOO + ncks: !calc doc.platform.ncks + NOSCRUB: !FirstTrue - when: !calc doc.platform.get('NOSCRUB_DIR','') do: !calc doc.platform.NOSCRUB_DIR diff --git a/workflow/platforms/_sandbox.yaml b/workflow/platforms/_sandbox.yaml index 11a2b43826..b2f1e8ac88 100644 --- a/workflow/platforms/_sandbox.yaml +++ b/workflow/platforms/_sandbox.yaml @@ -57,6 +57,11 @@ platform: !Platform # executables for this workflow. BASE_GIT: "/gpfs/hps3/emc/global/noscrub/emc.glopara/git" + #BASE_CPLIC - is the base directory of ICs for coupled s2s runs + BASE_CPLIC: "/path/to/base/dir/of/IC" + #ncks - NCO netcdf operator used in ocean post + ncks: "/path/to/ncks" + # config_base_extras - Additional configuration data to put in the # config.base file config_base_extras: "sandbox" diff --git a/workflow/platforms/gaea.yaml b/workflow/platforms/gaea.yaml index d3ad81f0b1..6ce65faa93 100644 --- a/workflow/platforms/gaea.yaml +++ b/workflow/platforms/gaea.yaml @@ -51,6 +51,11 @@ platform: !Platform # executables for this workflow. BASE_GIT: "/dev/null/global/save/glopara/git" + #BASE_CPLIC - is the base directory of ICs for coupled s2s runs + BASE_CPLIC: "/path/to/base/dir/of/IC" + #ncks - NCO netcdf operator used in ocean post + ncks: "/path/to/ncks" + # rocoto_platform_vars - additional variables sent to the rocoto xml # file for each job to set platform-specific batch card settings. rocoto_platform_vars: | diff --git a/workflow/platforms/hera.yaml b/workflow/platforms/hera.yaml index b5e8c8c3cf..8f0f2245b0 100644 --- a/workflow/platforms/hera.yaml +++ b/workflow/platforms/hera.yaml @@ -35,6 +35,11 @@ platform: !Platform # executables for this workflow. BASE_GIT: "/scratch1/NCEPDEV/global/glopara/git/" + #BASE_CPLIC - is the base directory of ICs for coupled s2s runs + BASE_CPLIC: "/scratch2/NCEPDEV/climate/climpara/S2S/IC" + #ncks - NCO netcdf operator used in ocean post + ncks: "/apps/nco/4.9.1/intel/18.0.5.274/bin/ncks" + config_base_extras: !expand | echo "place holder for NWPROD and associated utilities, all except POSTGRB2TBL are going through load_gfs_modules.sh" diff --git a/workflow/platforms/jet.yaml b/workflow/platforms/jet.yaml index 04c524ccb7..d65689517d 100644 --- a/workflow/platforms/jet.yaml +++ b/workflow/platforms/jet.yaml @@ -51,6 +51,11 @@ platform: !Platform # executables for this workflow. BASE_GIT: "/mnt/lfs3/projects/hfv3gfs/glopara/git" + #BASE_CPLIC - is the base directory of ICs for coupled s2s runs + BASE_CPLIC: "/path/to/base/dir/of/IC" + #ncks - NCO netcdf operator used in ocean post + ncks: "/path/to/ncks" + # config_base_extras - Additional configuration data to put in the # config.base file config_base_extras: | diff --git a/workflow/platforms/orion.yaml b/workflow/platforms/orion.yaml index 458f165078..7804016012 100644 --- a/workflow/platforms/orion.yaml +++ b/workflow/platforms/orion.yaml @@ -35,6 +35,11 @@ platform: !Platform # executables for this workflow. BASE_GIT: "/work/noaa/marine/place_holder" + #BASE_CPLIC - is the base directory of ICs for coupled s2s runs + BASE_CPLIC: "/work/noaa/marine/jmeixner/tempFixICdir/IC" + #ncks - NCO netcdf operator used in ocean post + ncks: "/apps/intel-2020/nco-4.8.1/bin/ncks" + config_base_extras: !expand | echo "place holder for NWPROD and associated utilities, all except POSTGRB2TBL are going through load_gfs_modules.sh" diff --git a/workflow/platforms/theia.yaml b/workflow/platforms/theia.yaml deleted file mode 100644 index 485bb26d30..0000000000 --- a/workflow/platforms/theia.yaml +++ /dev/null @@ -1,176 +0,0 @@ -# This file configures the workflow to run on Theia - -platform: !Platform - <<: *global_platform_common - - # Evaluate: this must be "false" to ensure disk space availability logic - # is not run unless this file is for the current platform. - Evaluate: false - - # name: the name of this platform; this must match what the underlying - # scripts expect. - name: THEIA - - # detect: this is a function that returns true iff the user is on GAEA - # and false otherwise - detect: !calc tools.isdir("/scratch4") and tools.isdir("/scratch3") - - # public_release_ics: location of input conditions that have been - # prepared for the public release. - public_release_ics: /scratch4/NCEPDEV/global/noscrub/glopara/FV3GFS_V1_RELEASE/ICs - - # CHGRP_RSTPROD_COMMAND - this specifies the command to use to - # restrict access to NOAA "rstprod" data restriction class. - # This only used for observation processing, data assimilation, and - # data assimilation archiving, which are not in the public release. - CHGRP_RSTPROD_COMMAND: "chgrp rstprod" - - # NWPROD - location of the NCEP operational "nwprod" directory, which - # only has meaning on the NCEP WCOSS machines. It is used to get - # the paths to certain programs and scripts. - NWPROD: "/scratch4/NCEPDEV/global/save/glopara/nwpara" - - # DMPDIR - location of the global dump data. This is used by the observation - # processing scripts, which are not included in the public release. - DMPDIR: "/scratch4/NCEPDEV/global/noscrub/dump" - - # RTMFIX - location of the CRTM fixed data files used by the GSI data - # assimilation. The data assimilation is not included in this public release - # so this path is unused. - RTMFIX: "/scratch4/NCEPDEV/da/save/Michael.Lueken/nwprod/lib/crtm/2.2.3/fix_update" - - # BASE_SVN - a directory maintained by emc global model developers - # that contains recent versions of source code and executables for - # various repositories. This is used on some platforms to find - # executables for this workflow. - BASE_SVN: "/scratch4/NCEPDEV/global/save/glopara/svn" - - # BASE_GIT - a directory maintained by emc global model developers - # that contains recent versions of source code and executables for - # various git repositories. This is used on some platforms to find - # executables for this workflow. - BASE_GIT: "/scratch4/NCEPDEV/global/save/glopara/git" - - # config_base_extras - Additional configuration data to put in the - # config.base file. On Theia, we use this to specify the location - # of some programs. - config_base_extras: !expand | - export NDATE="$NWPROD/util/exec/ndate" - export NHOUR="$NWPROD/util/exec/nhour" - export WGRIB="$NWPROD/util/exec/wgrib" - export WGRIB2="/scratch3/NCEPDEV/nwprod/utils/wgrib2.v2.0.6c/wgrib2/wgrib2" - export COPYGB="$NWPROD/util/exec/copygb" - export COPYGB2="$NWPROD/util/exec/copygb2" - export GRBINDEX="$NWPROD/util/exec/grbindex" - export GRB2INDEX="$NWPROD/util/exec/grb2index" - export GRBINDEX2="$NWPROD/util/exec/grb2index" - export CNVGRIB="/apps/cnvgrib/1.4.0/bin/cnvgrib" - export CNVGRIB21_GFS="/apps/cnvgrib/1.4.0/bin/cnvgrib" - export POSTGRB2TBL="/scratch3/NCEPDEV/nwprod/lib/sorc/g2tmpl/params_grib2_tbl_new" - - # Additional variables to send to Rocoto XML entities or ecflow edits. - metasched_more: !expand | - {metasched.defvar(doc.schedvar.exclusive_queue, doc.accounting.exclusive_partition.exclusive_queue)} - {metasched.defvar(doc.schedvar.shared_queue, doc.accounting.shared_partition.shared_queue)} - {metasched.defvar(doc.schedvar.service_queue, doc.accounting.service_partition.service_queue)} - {metasched.defvar(doc.schedvar.cpu_project, doc.accounting.cpu_project)} - - partitions: - Evaluate: false - default_shared: !calc doc.platform.partitions.theia - default_exclusive: !calc doc.platform.partitions.theia - default_service: !calc doc.platform.partitions.theia_service - theia: - <<: *global_partition_common - specification: theia - # Queues to use for each job type - shared_queue: theia - exclusive_queue: theia - - # Details about the scheduler on this cluster. - scheduler_settings: - scheduler_name: Slurm - parallelism_name: HydraIMPI - node_type: generic - physical_cores_per_node: 24 - logical_cpus_per_core: 2 - hyperthreading_allowed: true - indent_text: " " - memory_per_node: !calc (64*1024) - - exclusive_accounting_ref: - queue: batch - project: !calc doc.accounting.cpu_project - partition: theia - - shared_accounting_ref: - queue: batch - project: !calc doc.accounting.cpu_project - partition: theia - - # Generate the actual Python objects for the scheduler, parallelism, - # and nodes: - scheduler: !calc | - tools.get_scheduler(scheduler_settings.scheduler_name, scheduler_settings) - parallelism: !calc | - tools.get_parallelism(scheduler_settings.parallelism_name, scheduler_settings) - nodes: !calc | - tools.node_tool_for(scheduler_settings.node_type, scheduler_settings) - - theia_service: - <<: *global_partition_common - specification: service - service_queue: service - scheduler_settings: - scheduler_name: Slurm - parallelism_name: HydraIMPI - node_type: generic - physical_cores_per_node: 1 - logical_cpus_per_core: 1 - hyperthreading_allowed: false - indent_text: " " - memory_per_node: !calc (64*1024) - - service_accounting_ref: - queue: batch - project: !calc doc.accounting.cpu_project - partition: service - - scheduler: !calc | - tools.get_scheduler(scheduler_settings.scheduler_name, scheduler_settings) - parallelism: !calc | - tools.get_parallelism(scheduler_settings.parallelism_name, scheduler_settings) - nodes: !calc | - tools.node_tool_for(scheduler_settings.node_type, scheduler_settings) - - - # Path to pan_df, the program used to get Panasas disk usage information: - pan_df: pan_df - - # Automatically detect the least used scrub area the user can access: - least_used_temp: !Immediate - - !FirstTrue - - do: !expand "{doc.user_places.DATAROOT}" - when: !calc doc.user_places.FIX_SCRUB - - otherwise: !FirstMax - - do: /scratch3/NCEPDEV/stmp1 - when: !calc ( int(tools.can_write(do)) and tools.panasas_gb(do) ) - - do: /scratch3/NCEPDEV/stmp2 - when: !calc ( int(tools.can_write(do)) and tools.panasas_gb(do) ) - - do: /scratch4/NCEPDEV/stmp3 - when: !calc ( int(tools.can_write(do)) and tools.panasas_gb(do) ) - - do: /scratch4/NCEPDEV/stmp4 - when: !calc ( int(tools.can_write(do)) and tools.panasas_gb(do) ) - - do: !expand "{doc.user_places.EXPROOT}" - when: !calc tools.panasas_gb(do)/4 - message: "{do}: use project directory as scrub space" - - # long_term_temp - area for storage of data that must be passed - # between jobs or shared with programs external to this workflow. - long_term_temp: !expand "{doc.platform.least_used_temp}/{tools.env('USER')}" - - # short_term_temp - area for data that is only needed within one job: - short_term_temp: !expand "{doc.platform.least_used_temp}/{tools.env('USER')}" - - # EXPROOT - Parent directory of the expdir (experiment directory) - EXPROOT: !expand "{doc.user_places.EXPROOT}" diff --git a/workflow/platforms/wcoss_cray.yaml b/workflow/platforms/wcoss_cray.yaml index b68439eecd..ed0cd9644f 100644 --- a/workflow/platforms/wcoss_cray.yaml +++ b/workflow/platforms/wcoss_cray.yaml @@ -57,6 +57,11 @@ platform: !Platform # executables for this workflow. BASE_GIT: "/gpfs/hps3/emc/global/noscrub/emc.glopara/git" + #BASE_CPLIC - is the base directory of ICs for coupled s2s runs + BASE_CPLIC: "/path/to/base/dir/of/IC" + #ncks - NCO netcdf operator used in ocean post + ncks: "/path/to/ncks" + # config_base_extras - Additional configuration data to put in the # config.base file config_base_extras: | diff --git a/workflow/platforms/wcoss_dell_p3.yaml b/workflow/platforms/wcoss_dell_p3.yaml index d1a459a6b5..e37ecd8e5f 100644 --- a/workflow/platforms/wcoss_dell_p3.yaml +++ b/workflow/platforms/wcoss_dell_p3.yaml @@ -57,6 +57,11 @@ platform: !Platform # executables for this workflow. BASE_GIT: "/gpfs/dell2/emc/modeling/noscrub/emc.glopara/git" + #BASE_CPLIC - is the base directory of ICs for coupled s2s runs + BASE_CPLIC: "/path/to/base/dir/of/IC" + #ncks - NCO netcdf operator used in ocean post + ncks: "/path/to/ncks" + # config_base_extras - Additional configuration data to put in the # config.base file config_base_extras: | diff --git a/workflow/schema/places.yaml b/workflow/schema/places.yaml index 23ed39f515..07a5a3567d 100644 --- a/workflow/schema/places.yaml +++ b/workflow/schema/places.yaml @@ -44,6 +44,10 @@ places_schema: &places_schema !Template type: string BASE_GIT: type: string + BASE_CPLIC: + type: string + ncks: + type: string ics_from: type: string