From 1b5827c78e3238e4061b16a0a34eb387243dfe18 Mon Sep 17 00:00:00 2001 From: "Xianwu.Xue" Date: Fri, 10 Jun 2022 18:56:01 -0400 Subject: [PATCH] Improve to run fcst (atm only) On branch feature/gefs_v13_822_add_atm_fcst modified: jobs/rocoto/fcst.sh modified: ush/forecast_det.sh modified: ush/forecast_postdet.sh modified: ush/forecast_predet.sh Refs: #822 --- jobs/rocoto/fcst.sh | 4 +++- ush/forecast_det.sh | 1 + ush/forecast_postdet.sh | 19 +++++++++++++++++++ ush/forecast_predet.sh | 36 +++++++++++++++++++++++++++++++----- 4 files changed, 54 insertions(+), 6 deletions(-) diff --git a/jobs/rocoto/fcst.sh b/jobs/rocoto/fcst.sh index 199c89724a..e142fcce79 100755 --- a/jobs/rocoto/fcst.sh +++ b/jobs/rocoto/fcst.sh @@ -5,7 +5,9 @@ . $HOMEgfs/ush/load_fv3gfs_modules.sh status=$? [[ $status -ne 0 ]] && exit $status - +if [[ $CDUMP == "gefs" ]]; then + export MEMBER=`echo ${RUNMEM:-"c00"}|cut -c2-3` +fi ############################################################### # Execute the JJOB $HOMEgfs/jobs/JGLOBAL_FORECAST diff --git a/ush/forecast_det.sh b/ush/forecast_det.sh index 5529ce8a83..30ec79015d 100755 --- a/ush/forecast_det.sh +++ b/ush/forecast_det.sh @@ -66,6 +66,7 @@ FV3_GFS_det(){ FV3_GEFS_det(){ echo "SUB ${FUNCNAME[0]}: Defining variables for FV3GEFS" + FV3_GFS_det } WW3_det(){ diff --git a/ush/forecast_postdet.sh b/ush/forecast_postdet.sh index 5f2f152670..1a333a13a5 100755 --- a/ush/forecast_postdet.sh +++ b/ush/forecast_postdet.sh @@ -14,6 +14,7 @@ FV3_GEFS_postdet(){ echo SUB ${FUNCNAME[0]}: Linking input data for FV3 $RUN # soft link commands insert here + FV3_GFS_postdet } DATM_postdet(){ @@ -558,6 +559,20 @@ FV3_GFS_nml(){ echo SUB ${FUNCNAME[0]}: FV3 name lists and model configure file created } +FV3_GEFS_nml(){ + # namelist output for a certain component + echo SUB ${FUNCNAME[0]}: Creating name lists and model configure file for FV3 + if [ $machine = 'sandbox' ]; then + cd $SCRIPTDIR + echo "MAIN: !!!Sandbox mode, writing to current directory!!!" + fi + # Call child scripts in current script directory + source $SCRIPTDIR/parsing_namelists_FV3.sh + FV3_namelists + echo SUB ${FUNCNAME[0]}: FV3 name lists and model configure file created +} + + DATM_nml(){ source $SCRIPTDIR/parsing_namelists_DATM.sh DATM_namelists @@ -609,6 +624,10 @@ data_out_GFS() { echo "SUB ${FUNCNAME[0]}: Output data for FV3 copied" } +data_out_GEFS() { + data_out_GFS +} + WW3_postdet() { echo "SUB ${FUNCNAME[0]}: Linking input data for WW3" COMPONENTwave=${COMPONENTwave:-${RUN}wave} diff --git a/ush/forecast_predet.sh b/ush/forecast_predet.sh index 2f9ed863ca..5704bda6d8 100755 --- a/ush/forecast_predet.sh +++ b/ush/forecast_predet.sh @@ -252,17 +252,35 @@ FV3_GFS_predet(){ rprefix=$rCDUMP memchar="" else - prefix=enkf$CDUMP - rprefix=enkf$rCDUMP - memchar=mem$(printf %03i $MEMBER) + if [[ $CDUMP == "gefs" ]]; then + prefix=$CDUMP + rprefix=$rCDUMP + if [ $MEMBER -eq 0 ]; then + memchar=c$(printf %02i $MEMBER) + else + memchar=p$(printf %02i $MEMBER) + fi + else + prefix=enkf$CDUMP + rprefix=enkf$rCDUMP + memchar=mem$(printf %03i $MEMBER) + fi + fi + if [[ $CDUMP == "gefs" ]]; then + memdir=$ROTDIR/${prefix}.$PDY/$cyc/$memchar/atmos + else + memdir=$ROTDIR/${prefix}.$PDY/$cyc/atmos/$memchar fi - memdir=$ROTDIR/${prefix}.$PDY/$cyc/atmos/$memchar if [ ! -d $memdir ]; then mkdir -p $memdir; fi GDATE=$($NDATE -$assim_freq $CDATE) gPDY=$(echo $GDATE | cut -c1-8) gcyc=$(echo $GDATE | cut -c9-10) - gmemdir=$ROTDIR/${rprefix}.$gPDY/$gcyc/atmos/$memchar + if [[ $CDUMP == "gefs" ]]; then + gmemdir=$ROTDIR/${rprefix}.$gPDY/$gcyc/$memchar/atmos + else + gmemdir=$ROTDIR/${rprefix}.$gPDY/$gcyc/atmos/$memchar + fi sCDATE=$($NDATE -3 $CDATE) if [[ "$DOIAU" = "YES" ]]; then @@ -282,6 +300,14 @@ FV3_GFS_predet(){ echo "SUB ${FUNCNAME[0]}: pre-determination variables set" } +FV3_GEFS_predet(){ + echo "SUB ${FUNCNAME[0]}: Defining variables for FV3GFS" + + FV3_GFS_predet + + echo "SUB ${FUNCNAME[0]}: pre-determination variables set" +} + WW3_predet(){ echo "SUB ${FUNCNAME[0]}: Defining variables for WW3" if [ $CDUMP = "gdas" ]; then