Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make atmos_fcst job work using GFSv17 and new COM structure #120

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
dbd0dda
Move gefs_fcst.part to parm_gefs
XianwuXue-NOAA Apr 18, 2023
a0aca62
Make changes based on previous changes
XianwuXue-NOAA Apr 18, 2023
cfd1e1e
Use preamble.sh and add lines from previous changes
XianwuXue-NOAA Apr 19, 2023
2ba5729
Merge branch 'feature/v13_atm_only' into feature/v13_atmos_fcst
XianwuXue-NOAA Apr 19, 2023
7f16c24
Modify j-job of fcst to use new COM
XianwuXue-NOAA Apr 22, 2023
d2e5212
Optimize and clean ex-script of fcst
XianwuXue-NOAA Apr 22, 2023
8a81a70
Fix some bugs and improve to run fcst job
XianwuXue-NOAA Apr 25, 2023
31877d0
Remove imp_physics in the user_full.conf
XianwuXue-NOAA Apr 25, 2023
28ff82b
Improve and cleanup j-job, ex-script of fcst
XianwuXue-NOAA Apr 25, 2023
3de25db
Improve bin file of forecast
XianwuXue-NOAA Apr 25, 2023
30036f2
Modify to run fcst on Hera
XianwuXue-NOAA Apr 25, 2023
158cb0d
Modify stochastic parameters
XianwuXue-NOAA Apr 26, 2023
b3b49eb
Modify based on Walter's Comments
XianwuXue-NOAA Apr 27, 2023
1ca635c
Rename gefs_fcst_resources.parm to config.resources
XianwuXue-NOAA Apr 27, 2023
c7271ab
Clean up some unused statements
XianwuXue-NOAA Apr 27, 2023
ea048ee
Rename the gefs parm files to config files
XianwuXue-NOAA Apr 27, 2023
a76a74b
Fix a bug in j-job of atmos_prep
XianwuXue-NOAA Apr 27, 2023
7af6724
Make the vertical structure as default value
XianwuXue-NOAA Apr 27, 2023
aeb3f97
Improve the compile_install_all.sh
XianwuXue-NOAA Apr 27, 2023
12f5b14
Reformat config.fcst
XianwuXue-NOAA Apr 27, 2023
5ccc901
Add VEGTYPE fix file back since p02 failed on hera
XianwuXue-NOAA Apr 28, 2023
5da028d
Add SEND=NO back
XianwuXue-NOAA Apr 28, 2023
fa53f4f
Move some vars from ex-script to config.fcst
XianwuXue-NOAA Apr 28, 2023
c772da4
Fix a minor bug
XianwuXue-NOAA Apr 28, 2023
50f39bf
Move vars from ex-script of fcst to config.fcst
XianwuXue-NOAA Apr 28, 2023
d24d281
Update g-w commit
XianwuXue-NOAA May 1, 2023
1379fcd
Modify based on Walter's comments and g-w changes
XianwuXue-NOAA May 2, 2023
5dbb48e
Modify based on reviewer's comments
XianwuXue-NOAA May 2, 2023
eaa59b1
Modify the config files
XianwuXue-NOAA May 2, 2023
0d3371a
Fix a bug to run fcst
XianwuXue-NOAA May 2, 2023
c19fadd
Remove the dead codes
XianwuXue-NOAA May 2, 2023
e5c19d0
Seperate config.fcst to config.fcst & config.efcs
XianwuXue-NOAA May 2, 2023
3af9001
Fix a bug
XianwuXue-NOAA May 3, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions jobs/JGEFS_ATMOS_PREP
Original file line number Diff line number Diff line change
Expand Up @@ -65,13 +65,13 @@ export COMPONENT="atmos"
#############################
# Source relevant config files
#############################
configs="gefs gefs_atmos_prep"
config_path=$PARMgefs/parm_gefs
configs="base prep"
config_path=${PARMgefs}/config
for config in $configs; do
. ${config_path}/${config}.parm
. ${config_path}/config.${config}
export err=$?
if [[ $err != 0 ]]; then
echo "FATAL ERROR in $(basename $BASH_SOURCE): Error while loading parm file ${config_path}/${config}.parm"
echo "FATAL ERROR in $(basename $BASH_SOURCE): Error while loading parm file ${config_path}/config.${config}"
exit ${err}
fi
done
Expand Down
101 changes: 57 additions & 44 deletions jobs/JGEFS_FORECAST
Original file line number Diff line number Diff line change
@@ -1,18 +1,11 @@
#!/bin/ksh
#! /usr/bin/env bash

echo "$(date -u) begin ${.sh.file}"

set -xa
if [[ ${STRICT:-NO} == "YES" ]]; then
# Turn on strict bash error checking
set -eu
fi
export PS4='$SECONDS + $(basename ${.sh.file})[$LINENO] '
source "${HOMEgefs:-${HOMEgfs}}/ush/preamble.sh"

####################################
# Determine Job Output Name on System
####################################
export jobid=${jobid:-"$job.$PBS_JOBID"}
export jobid=${jobid:-"${job}.${PBS_JOBID}"}
export pgmout="OUTPUT.${PBS_JOBID}"
export pgmerr=errfile

Expand All @@ -23,12 +16,6 @@ export DATA=${DATA:-${DATAROOT}/${jobid}}
mkdir -p $DATA
cd $DATA

######################################
# Set up compute resources
######################################
export total_tasks=${total_tasks:-320}
export APRUN=${gefsmpexec:-"mpiexec -n $total_tasks"}

####################################
# Specify NET and RUN Name and model
####################################
Expand All @@ -55,8 +42,8 @@ setpdy.sh
source PDY

if [ ${FORECAST_SEGMENT} = lr ]; then
export cyc=00
export cycle=t${cyc}z
export cyc=00
export cycle=t${cyc}z
fi

####################################
Expand All @@ -71,51 +58,79 @@ export PARMgefs=${PARMgefs:-$HOMEgefs/parm}
##############################################
# Define COM directories
##############################################
ver=${ver:-$(echo ${gefs_ver}|cut -c1-5)}
export COMIN=${COMIN:-$(compath.py $envir/com/$NET/${ver})/${RUN}.${PDY}/$cyc}
export COMOUT=${COMOUT:-$(compath.py -o $NET/${ver})/${RUN}.${PDY}/$cyc}
export GESIN=${GESIN:-$(compath.py $envir/com/$NET/${ver})/${RUN}.${PDY}/$cyc/nwges}
export GESOUT=${GESOUT:-$(compath.py -o $NET/${ver})/${RUN}.${PDY}/$cyc/nwges}
ver=${gefs_ver:0:5}
export ROTDIR=${ROTDIR:-$(compath.py $envir/com/$NET/${ver})}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be defined before the j-job is called, and definitely should not use compath.py. compath.py should only be used for external packages (GFS, tracker, etc.).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it the NCO new requirements? Because all the compath.py are in j-job in the current production.


#############################
# Source relevant config files
#############################
configs="gefs gefs_wave gefs_fcst"
config_path=$PARMgefs
export CDATE=$PDY$cyc
XianwuXue-NOAA marked this conversation as resolved.
Show resolved Hide resolved
configs="base fcst efcs"
config_path=${PARMgefs}/config
for config in $configs; do
. $config_path/$config.parm
export err=$?
if [[ $err != 0 ]]; then
echo "FATAL ERROR in ${.sh.file}: Error while loading parm file $config_path/$config.parm"
exit $err
fi
. ${config_path}/config.${config}
export err=$?
if [[ $err != 0 ]]; then
echo "FATAL ERROR in ${BASH_SOURCE[0]}: Error while loading parm file ${config_path}/config.${config}"
exit $err
fi
done

export APRUN_UFS=${APRUN_UFS:-"${launcher:-'mpiexec -l'} -n ${npe_fcst} -ppn ${npe_node_fcst} --cpu-bind depth --depth ${NTHREADS_FV3}"}

if [[ $cplchm = ".true." ]]; then
COMPONENT="chem"
fi
if [[ $cplwav = ".true." ]]; then
# Set location of wave restart from last cycle
last_date=$($NDATE -$WAVHCYC $CDATE)
last_PDY=$(echo $last_date | cut -c1-8)
last_cyc=$(echo $last_date | cut -c9-10)
export WRDIR=${WRDIR:-$(compath.py $envir/com/$NET/${ver})}/${RUN}.${last_PDY}/$last_cyc/wave/restart
COMPONENT="chem"
fi

export COMPONENT=${COMPONENT:-atmos}

echo "Environment before calling script"
env | sort

# Ignore possible spelling error (nothing is misspelled)
# shellcheck disable=SC2153
GDATE=$(${NDATE} -"${assim_freq}" "${PDY}${cyc}")
# shellcheck disable=
declare -x gPDY="${GDATE:0:8}"
declare -x gcyc="${GDATE:8:2}"

# Construct COM variables from templates (see config.com)
declare -rx memchar=${RUNMEM:2:3}

MEMDIR="${memchar}" YMD=${PDY} HH=${cyc} generate_com -rx COM_ATMOS_RESTART COM_ATMOS_INPUT COM_ATMOS_ANALYSIS \
COM_ATMOS_HISTORY COM_ATMOS_MASTER

RUN=${rCDUMP} MEMDIR="${memchar}" YMD="${gPDY}" HH="${gcyc}" generate_com -rx COM_ATMOS_RESTART_PREV:COM_ATMOS_RESTART_TMPL

if [[ ${DO_WAVE} == "YES" ]]; then
MEMDIR="${memchar}" YMD=${PDY} HH=${cyc} generate_com -rx COM_WAVE_RESTART COM_WAVE_PREP COM_WAVE_HISTORY
RUN=${rCDUMP} MEMDIR="${memchar}" YMD="${gPDY}" HH="${gcyc}" generate_com -rx COM_WAVE_RESTART_PREV:COM_WAVE_RESTART_TMPL
fi

if [[ ${DO_OCN} == "YES" ]]; then
MEMDIR="${memchar}" YMD=${PDY} HH=${cyc} generate_com -rx COM_MED_RESTART COM_OCEAN_RESTART \
COM_OCEAN_INPUT COM_OCEAN_HISTORY COM_OCEAN_ANALYSIS
RUN=${rCDUMP} MEMDIR="${memchar}" YMD="${gPDY}" HH="${gcyc}" generate_com -rx COM_OCEAN_RESTART_PREV:COM_OCEAN_RESTART_TMPL
fi

if [[ ${DO_ICE} == "YES" ]]; then
MEMDIR="${memchar}" YMD=${PDY} HH=${cyc} generate_com -rx COM_ICE_HISTORY
RUN=${rCDUMP} MEMDIR="${memchar}" YMD="${gPDY}" HH="${gcyc}" generate_com -rx COM_ICE_RESTART_PREV:COM_ICE_RESTART_TMPL
fi

if [[ ${DO_AERO} == "YES" ]]; then
MEMDIR="${memchar}" YMD=${PDY} HH=${cyc} generate_com -rx COM_CHEM_HISTORY
fi

#############################################################
# Execute the script
$HOMEgefs/scripts/exgefs_forecast.sh
export err=$?
if [[ $err == 0 ]]; then
echo "$job completed normally!"
echo "$job completed normally!"
else
echo "FATAL ERROR in ${.sh.file}: $job failed!"
exit $err
echo "FATAL ERROR in ${BASH_SOURCE[0]}: $job failed!"
exit $err
fi
#############################################################

Expand All @@ -125,6 +140,4 @@ fi
cd $DATAROOT
if [ ${KEEPDATA:-NO} = NO ] ; then rm -rf $DATA ; fi

echo "$(date -u) end ${.sh.file}"

exit $err
4 changes: 3 additions & 1 deletion parm/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,6 @@ post
product
prep_chem_sources.inp.IN

config
config/config.nsst
config/config.com
config/config.defaults.s2sw
128 changes: 106 additions & 22 deletions parm/parm_gefs/gefs.parm → parm/config/config.base
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,9 @@ esac
memberlist="c00"

imem=1
while [[ imem -le $npert ]];
do
while [[ imem -le $npert ]]; do
memberlist="$memberlist p$(printf %02i $imem)"
(( imem++ ))
((imem++))
done
export memberlist

Expand All @@ -62,26 +61,26 @@ if [[ ${RUNMEM:-none} = "geaer" ]]; then cplchm=".true."; fi
export cplchm=${cplchm:-.false.}

if [[ $cplchm = ".true." ]]; then
# Override forecast length
export fhmaxh=$fhmax_aer
export fhmax=$fhmax_aer
# Override forecast length
export fhmaxh=$fhmax_aer
export fhmax=$fhmax_aer

export AEROSOL_INIT_TYPE=${AEROSOL_INIT_TYPE:-"warm"}
export AEROSOL_INIT_TYPE=${AEROSOL_INIT_TYPE:-"warm"}

export cplwav=".false." # Running both chem and waves is not yet supported
export cplwav=".false." # Running both chem and waves is not yet supported
fi

export fhmax
if (( fhmax <= fhmaxh )); then export fhmaxh=$fhmax; fi
if (( FHMAXHF > fhmaxh )); then export FHMAXHF=$fhmaxh; fi
if ((fhmax <= fhmaxh)); then export fhmaxh=$fhmax; fi
if ((FHMAXHF > fhmaxh)); then export FHMAXHF=$fhmaxh; fi

export restart_interval=${fhrestart:-12}
export restart_interval_gfs=${fhrestart:-12}
export restart_interval_aer=${restart_interval_aer:-12}
export other_restart_time=${other_restart_time:-6}

if [[ $cplchm = ".true." ]]; then
export restart_interval=$restart_interval_aer
export other_restart_time=${other_restart_time:-$gefs_cych}
export restart_interval_gfs=$restart_interval_aer
export other_restart_time=${other_restart_time:-$gefs_cych}
fi

#pass these variables to gefs_wave.parm
Expand Down Expand Up @@ -135,21 +134,24 @@ export IDVC=${IDVC:-2}
export HOMEgefs=${HOMEgefs:-${PACKAGEROOT}/gefs.${gefs_ver}}
export EXECgefs=${EXECgefs:-${HOMEgefs}/exec}
export USHgefs=${USHgefs:-${HOMEgefs}/ush}
#export FIXgefs=${FIXgefs:-${HOMEgefs}/fix/fix_gefs}
export PARMgefs=${PARMgefs:-${HOMEgefs}/parm}

export HOMEgfs=${HOMEgfs:-${HOMEgefs}}
export PARMgfs=${HOMEgfs}/parm
export EXPDIR=${PARMgfs}/config
#export FIXgfs=${HOMEgfs}/fix
#export USHgfs=${HOMEgfs}/ush
#export UTILgfs=${HOMEgfs}/util
#export EXECgfs=${HOMEgfs}/exec
#export SCRgfs=${HOMEgfs}/scripts
export FIXgfs=${HOMEgfs}/fix
export USHgfs=${HOMEgfs}/ush
export UTILgfs=${HOMEgfs}/util
export EXECgfs=${HOMEgfs}/exec
export SCRgfs=${HOMEgfs}/scripts

#export FIXcice=${HOMEgfs}/fix/cice
#export FIXmom=${HOMEgfs}/fix/mom6
#export FIXreg2grb2=${HOMEgfs}/fix/reg2grb2
export FIXcice=${HOMEgfs}/fix/cice
export FIXmom=${HOMEgfs}/fix/mom6
export FIXreg2grb2=${HOMEgfs}/fix/reg2grb2


export ERRSCRIPT=${ERRSCRIPT:-'eval [[ $err = 0 ]]'}
export LOGSCRIPT=${LOGSCRIPT:-""} #=startmsg

####################################
# CONVENIENT utility scripts and other environment parameters
Expand Down Expand Up @@ -182,6 +184,23 @@ export VERBOSE=${VERBOSE:-YES}
# Get all the COM path templates
source "${PARMgefs:-${PARMgfs}}/config/config.com"

#------
# APP settings
export APP=${APP:-"ATM"} # ATM, S2SW

# Defaults:
export DO_ATM="YES"
export DO_COUPLED="NO"
export DO_WAVE="NO"
export DO_OCN="NO"
export DO_ICE="NO"
export DO_AERO="NO"
export CCPP_SUITE=${CCPP_SUITE:-"FV3_GFS_v17_p8"} #FV3_GFS_v16"}
export WAVE_CDUMP="" # When to include wave suite: gdas, gfs, or both
export DOBNDPNT_WAVE="NO"
export cplwav2atm=".false."
export FRAC_GRID=".true."

# These are the currently available grid-combinations
case "${CASE}" in
"C48") export OCNRES=500;;
Expand All @@ -192,6 +211,71 @@ case "${CASE}" in
*) export OCNRES=025;;
esac
export ICERES=${OCNRES}
export waveGRD='gnh_10m aoc_9km gsh_15m'

case "${APP}" in
ATM)
export confignamevarfornems="atm"
;;
ATMA)
export DO_AERO="YES"
export confignamevarfornems="atm_aero"
;;
ATMW)
export DO_COUPLED="YES"
export DO_WAVE="YES"
export WAVE_CDUMP="both"
export confignamevarfornems="leapfrog_atm_wav"
;;
NG-GODAS)
export DO_ATM="NO"
export DO_OCN="YES"
export DO_ICE="YES"
;;
S2S*)
export DO_COUPLED="YES"
export DO_OCN="YES"
export DO_ICE="YES"
export CCPP_SUITE="FV3_GFS_v17_coupled_p8"
export confignamevarfornems="cpld"

if [[ "${APP}" =~ A$ ]]; then
export DO_AERO="YES"
export confignamevarfornems="${confignamevarfornems}_aero"
fi

if [[ "${APP}" =~ ^S2SW ]]; then
export DO_WAVE="YES"
export WAVE_CDUMP="both"
export cplwav2atm=".true."
export confignamevarfornems="${confignamevarfornems}_outerwave"
fi

source ${EXPDIR}/config.defaults.s2sw

;;
*)
echo "Unrecognized APP: ${APP}"
exit 1
;;
esac

# Surface cycle update frequency
export FHCYC=24

# IAU related parameters
export DOIAU="NO" # Enable 4DIAU for control with 3 increments
export IAU_OFFSET=0
export IAU_DELTHRS=0
export IAU_FHROT=0

# turned on nsst in anal and/or fcst steps, and turn off rtgsst
export DONST="YES"
if [[ ${DONST} = "YES" ]]; then export FNTSFA=" "; fi

# The switch to apply SST elevation correction or not
export nst_anl=.true.
#-----

# Microphysics Options: 99-ZhaoCarr, 8-Thompson; 6-WSM6, 10-MG, 11-GFDL
export imp_physics=${imp_physics:-"8"}
Expand Down
Loading