diff --git a/env/ORION.env b/env/ORION.env index 04bae19e0e0..c1367914645 100755 --- a/env/ORION.env +++ b/env/ORION.env @@ -52,7 +52,7 @@ elif [ $step = "waveinit" -o $step = "waveprep" -o $step = "wavepostsbs" -o $ste export wavempexec=${launcher} export wave_mpmd=${mpmd} -elif [ $step = "atmanalrun" ]; then +elif [ "${step}" = "atmanalrun" ]; then export CFP_MP=${CFP_MP:-"YES"} export USE_CFP=${USE_CFP:-"YES"} @@ -61,10 +61,10 @@ elif [ $step = "atmanalrun" ]; then nth_max=$(($npe_node_max / $npe_node_atmanalrun)) export NTHREADS_ATMANAL=${nth_atmanalrun:-$nth_max} - [[ $NTHREADS_ATMANAL -gt $nth_max ]] && export NTHREADS_ATMANAL=$nth_max + [[ $NTHREADS_ATMANAL -gt ${nth_max} ]] && export NTHREADS_ATMANAL=${nth_max} export APRUN_ATMANAL="$launcher -n $npe_atmanalrun" -elif [ $step = "atmensanalrun" ]; then +elif [ "${step}" = "atmensanalrun" ]; then export CFP_MP=${CFP_MP:-"YES"} export USE_CFP=${USE_CFP:-"YES"} @@ -73,17 +73,17 @@ elif [ $step = "atmensanalrun" ]; then nth_max=$(($npe_node_max / $npe_node_atmensanalrun)) export NTHREADS_ATMENSANAL=${nth_atmensanalrun:-$nth_max} - [[ $NTHREADS_ATMENSANAL -gt $nth_max ]] && export NTHREADS_ATMENSANAL=$nth_max + [[ $NTHREADS_ATMENSANAL -gt ${nth_max} ]] && export NTHREADS_ATMENSANAL=${nth_max} export APRUN_ATMENSANAL="$launcher -n $npe_atmensanalrun" -elif [ $step = "aeroanlrun" ]; then +elif [ "${step}" = "aeroanlrun" ]; then export APRUNCFP="$launcher -n \$ncmd --multi-prog" nth_max=$(($npe_node_max / $npe_node_aeroanlrun)) export NTHREADS_AEROANL=${nth_aeroanlrun:-$nth_max} - [[ $NTHREADS_AEROANL -gt $nth_max ]] && export NTHREADS_AEROANL=$nth_max + [[ $NTHREADS_AEROANL -gt ${nth_max} ]] && export NTHREADS_AEROANL=${nth_max} export APRUN_AEROANL="$launcher -n $npe_aeroanlrun" elif [ $step = "anal" -o $step = "analcalc" ]; then @@ -98,11 +98,11 @@ elif [ $step = "anal" -o $step = "analcalc" ]; then nth_max=$(($npe_node_max / $npe_node_anal)) export NTHREADS_GSI=${nth_anal:-$nth_max} - [[ $NTHREADS_GSI -gt $nth_max ]] && export NTHREADS_GSI=$nth_max + [[ $NTHREADS_GSI -gt ${nth_max} ]] && export NTHREADS_GSI=${nth_max} export APRUN_GSI="$launcher" export NTHREADS_CALCINC=${nth_calcinc:-1} - [[ $NTHREADS_CALCINC -gt $nth_max ]] && export NTHREADS_CALCINC=$nth_max + [[ $NTHREADS_CALCINC -gt ${nth_max} ]] && export NTHREADS_CALCINC=${nth_max} export APRUN_CALCINC="$launcher" export NTHREADS_CYCLE=${nth_cycle:-12} @@ -114,7 +114,7 @@ elif [ $step = "anal" -o $step = "analcalc" ]; then npe_gausfcanl=${npe_gausfcanl:-1} export APRUN_GAUSFCANL="$launcher -n $npe_gausfcanl" -elif [ $step = "sfcanl" ]; then +elif [ "${step}" = "sfcanl" ]; then nth_max=$(($npe_node_max / $npe_node_sfcanl)) export NTHREADS_CYCLE=${nth_sfcanl:-14} @@ -122,18 +122,18 @@ elif [ $step = "sfcanl" ]; then npe_sfcanl=${ntiles:-6} export APRUN_CYCLE="$launcher -n $npe_sfcanl" -elif [ $step = "gldas" ]; then +elif [ "${step}" = "gldas" ]; then export USE_CFP="NO" nth_max=$(($npe_node_max / $npe_node_gldas)) export NTHREADS_GLDAS=${nth_gldas:-$nth_max} - [[ $NTHREADS_GLDAS -gt $nth_max ]] && export NTHREADS_GLDAS=$nth_max + [[ $NTHREADS_GLDAS -gt ${nth_max} ]] && export NTHREADS_GLDAS=${nth_max} export APRUN_GLDAS="$launcher -n $npe_gldas" export NTHREADS_GAUSSIAN=${nth_gaussian:-1} - [[ $NTHREADS_GAUSSIAN -gt $nth_max ]] && export NTHREADS_GAUSSIAN=$nth_max + [[ $NTHREADS_GAUSSIAN -gt ${nth_max} ]] && export NTHREADS_GAUSSIAN=${nth_max} export APRUN_GAUSSIAN="$launcher -n $npe_gaussian" # Must run data processing with exactly the number of tasks as time @@ -142,7 +142,7 @@ elif [ $step = "gldas" ]; then npe_gldas_data_proc=$(($gldas_spinup_hours + 12)) export APRUN_GLDAS_DATA_PROC="$launcher -n $npe_gldas_data_proc --multi-prog" -elif [ $step = "eobs" ]; then +elif [ "${step}" = "eobs" ]; then export MKL_NUM_THREADS=4 export MKL_CBWR=AUTO @@ -154,10 +154,10 @@ elif [ $step = "eobs" ]; then nth_max=$(($npe_node_max / $npe_node_eobs)) export NTHREADS_GSI=${nth_eobs:-$nth_max} - [[ $NTHREADS_GSI -gt $nth_max ]] && export NTHREADS_GSI=$nth_max + [[ $NTHREADS_GSI -gt ${nth_max} ]] && export NTHREADS_GSI=${nth_max} export APRUN_GSI="$launcher" -elif [ $step = "eupd" ]; then +elif [ "${step}" = "eupd" ]; then export CFP_MP=${CFP_MP:-"YES"} export USE_CFP=${USE_CFP:-"YES"} @@ -166,10 +166,34 @@ elif [ $step = "eupd" ]; then nth_max=$(($npe_node_max / $npe_node_eupd)) export NTHREADS_ENKF=${nth_eupd:-$nth_max} - [[ $NTHREADS_ENKF -gt $nth_max ]] && export NTHREADS_ENKF=$nth_max + [[ $NTHREADS_ENKF -gt ${nth_max} ]] && export NTHREADS_ENKF=${nth_max} export APRUN_ENKF="$launcher" -elif [ $step = "fcst" ]; then +elif [ "${step}" = "eupdfsoi" ]; then + + export CFP_MP=${CFP_MP:-"YES"} + export USE_CFP=${USE_CFP:-"YES"} + export APRUNCFP="$launcher -n \$ncmd --multi-prog" + + nth_max=$((npe_node_max / npe_node_eupdfsoi)) + + export NTHREADS_ENKF=${nth_eupdfsoi:-$nth_max} + [[ $NTHREADS_ENKF -gt ${nth_max} ]] && export NTHREADS_ENKF=${nth_max} + export APRUN_ENKF="$launcher" + +elif [ "${step}" = "efsoi" ]; then + + export CFP_MP=${CFP_MP:-"YES"} + export USE_CFP=${USE_CFP:-"YES"} + export APRUNCFP="$launcher -n \$ncmd --multi-prog" + + nth_max=$((npe_node_max / npe_node_efsoi)) + + export NTHREADS_ENKF=${nth_efsoi:-$nth_max} + [[ $NTHREADS_ENKF -gt ${nth_max} ]] && export NTHREADS_ENKF=${nth_max} + export APRUN_ENKF="$launcher" + +elif [ "${step}" = "fcst" ]; then #PEs and PEs/node can differ for GFS and GDAS forecasts if threading differs if [[ $CDUMP == "gfs" ]]; then @@ -181,50 +205,64 @@ elif [ $step = "fcst" ]; then nth_max=$(($npe_node_max / $npe_node_fcst)) export NTHREADS_FV3=${nth_fv3:-$nth_max} - [[ $NTHREADS_FV3 -gt $nth_max ]] && export NTHREADS_FV3=$nth_max + [[ $NTHREADS_FV3 -gt ${nth_max} ]] && export NTHREADS_FV3=${nth_max} export cores_per_node=$npe_node_max export APRUN_FV3="$launcher -n $npe_fcst" export NTHREADS_REGRID_NEMSIO=${nth_regrid_nemsio:-1} - [[ $NTHREADS_REGRID_NEMSIO -gt $nth_max ]] && export NTHREADS_REGRID_NEMSIO=$nth_max + [[ $NTHREADS_REGRID_NEMSIO -gt ${nth_max} ]] && export NTHREADS_REGRID_NEMSIO=${nth_max} export APRUN_REGRID_NEMSIO="$launcher" export NTHREADS_REMAP=${nth_remap:-2} - [[ $NTHREADS_REMAP -gt $nth_max ]] && export NTHREADS_REMAP=$nth_max + [[ $NTHREADS_REMAP -gt ${nth_max} ]] && export NTHREADS_REMAP=${nth_max} export APRUN_REMAP="$launcher" export I_MPI_DAPL_UD="enable" -elif [ $step = "efcs" ]; then +elif [ "${step}" = "efcs" ]; then nth_max=$(($npe_node_max / $npe_node_efcs)) - export NTHREADS_FV3=${nth_efcs:-$nth_max} - [[ $NTHREADS_FV3 -gt $nth_max ]] && export NTHREADS_FV3=$nth_max + export NTHREADS_FV3=${nth_efcs:-${nth_max}} + [[ $NTHREADS_FV3 -gt ${nth_max} ]] && export NTHREADS_FV3=${nth_max} export cores_per_node=$npe_node_max export APRUN_FV3="$launcher -n $npe_efcs" export NTHREADS_REGRID_NEMSIO=${nth_regrid_nemsio:-1} - [[ $NTHREADS_REGRID_NEMSIO -gt $nth_max ]] && export NTHREADS_REGRID_NEMSIO=$nth_max + [[ $NTHREADS_REGRID_NEMSIO -gt ${nth_max} ]] && export NTHREADS_REGRID_NEMSIO=${nth_max} export APRUN_REGRID_NEMSIO="$launcher $LEVS" -elif [ $step = "post" ]; then +elif [ "${step}" = "efcsfsoi" ]; then + + nth_max=$((npe_node_max / npe_node_efcsfsoi)) + + export NTHREADS_FV3=${nth_efcsfsoi:-$nth_max} + [[ $NTHREADS_FV3 -gt ${nth_max} ]] && export NTHREADS_FV3=${nth_max} + export cores_per_node=$npe_node_max + export APRUN_FV3="$launcher -n $npe_efcsfsoi" + + export NTHREADS_REGRID_NEMSIO=${nth_regrid_nemsio:-1} + [[ $NTHREADS_REGRID_NEMSIO -gt ${nth_max} ]] && export NTHREADS_REGRID_NEMSIO=${nth_max} + export APRUN_REGRID_NEMSIO="$launcher $LEVS" + + +elif [ "${step}" = "post" ]; then nth_max=$(($npe_node_max / $npe_node_post)) export NTHREADS_NP=${nth_np:-1} - [[ $NTHREADS_NP -gt $nth_max ]] && export NTHREADS_NP=$nth_max + [[ $NTHREADS_NP -gt ${nth_max} ]] && export NTHREADS_NP=${nth_max} export APRUN_NP="$launcher" export NTHREADS_DWN=${nth_dwn:-1} - [[ $NTHREADS_DWN -gt $nth_max ]] && export NTHREADS_DWN=$nth_max + [[ $NTHREADS_DWN -gt ${nth_max} ]] && export NTHREADS_DWN=${nth_max} export APRUN_DWN="$launcher" -elif [ $step = "ecen" ]; then +elif [ "${step}" = "ecen" ]; then nth_max=$(($npe_node_max / $npe_node_ecen)) export NTHREADS_ECEN=${nth_ecen:-$nth_max} - [[ $NTHREADS_ECEN -gt $nth_max ]] && export NTHREADS_ECEN=$nth_max + [[ $NTHREADS_ECEN -gt ${nth_max} ]] && export NTHREADS_ECEN=${nth_max} export APRUN_ECEN="$launcher" export NTHREADS_CHGRES=${nth_chgres:-12} @@ -232,58 +270,94 @@ elif [ $step = "ecen" ]; then export APRUN_CHGRES="time" export NTHREADS_CALCINC=${nth_calcinc:-1} - [[ $NTHREADS_CALCINC -gt $nth_max ]] && export NTHREADS_CALCINC=$nth_max + [[ $NTHREADS_CALCINC -gt ${nth_max} ]] && export NTHREADS_CALCINC=${nth_max} export APRUN_CALCINC="$launcher" -elif [ $step = "esfc" ]; then +elif [ "${step}" = "ecenfsoi" ]; then + + nth_max=$((npe_node_max / npe_node_ecenfsoi)) + + export NTHREADS_ECEN=${nth_ecenfsoi:-$nth_max} + [[ $NTHREADS_ECEN -gt ${nth_max} ]] && export NTHREADS_ECEN=${nth_max} + export APRUN_ECEN="$launcher" + + export NTHREADS_CHGRES=${nth_chgres:-12} + [[ $NTHREADS_CHGRES -gt $npe_node_max ]] && export NTHREADS_CHGRES=$npe_node_max + export APRUN_CHGRES="time" + + export NTHREADS_CALCINC=${nth_calcinc:-1} + [[ $NTHREADS_CALCINC -gt ${nth_max} ]] && export NTHREADS_CALCINC=${nth_max} + export APRUN_CALCINC="$launcher" + +elif [ "${step}" = "esfc" ]; then nth_max=$(($npe_node_max / $npe_node_esfc)) export NTHREADS_ESFC=${nth_esfc:-$nth_max} - [[ $NTHREADS_ESFC -gt $nth_max ]] && export NTHREADS_ESFC=$nth_max + [[ $NTHREADS_ESFC -gt ${nth_max} ]] && export NTHREADS_ESFC=${nth_max} export APRUN_ESFC="$launcher -n $npe_esfc" export NTHREADS_CYCLE=${nth_cycle:-14} [[ $NTHREADS_CYCLE -gt $npe_node_max ]] && export NTHREADS_CYCLE=$npe_node_max export APRUN_CYCLE="$launcher -n $npe_esfc" -elif [ $step = "epos" ]; then +elif [ ${step} = "esfcfsoi" ]; then + + nth_max=$((npe_node_max / npe_node_esfcfsoi)) + + export NTHREADS_ESFC=${nth_esfcfsoi:-${nth_max}} + [[ ${NTHREADS_ESFC} -gt ${nth_max} ]] && export NTHREADS_ESFC=${nth_max} + export APRUN_ESFC="${launcher} -n ${npe_esfcfsoi}" + + export NTHREADS_CYCLE=${nth_cycle:-14} + [[ ${NTHREADS_CYCLE} -gt ${npe_node_max} ]] && export NTHREADS_CYCLE=${npe_node_max} + export APRUN_CYCLE="${launcher} -n ${npe_esfcfsoi}" + +elif [ "${step}" = "epos" ]; then nth_max=$(($npe_node_max / $npe_node_epos)) - export NTHREADS_EPOS=${nth_epos:-$nth_max} - [[ $NTHREADS_EPOS -gt $nth_max ]] && export NTHREADS_EPOS=$nth_max + export NTHREADS_EPOS=${nth_epos:-${nth_max}} + [[ $NTHREADS_EPOS -gt ${nth_max} ]] && export NTHREADS_EPOS=${nth_max} export APRUN_EPOS="$launcher" -elif [ $step = "init" ]; then +elif [ "${step}" = "eposfsoi" ]; then + + nth_max=$((npe_node_max / npe_node_eposfsoi)) + + export NTHREADS_EPOS=${nth_eposfsoi:-${nth_max}} + [[ ${NTHREADS_EPOS} -gt ${nth_max} ]] && export NTHREADS_EPOS=${nth_max} + export APRUN_EPOS="${launcher}" + +elif [ "${step}" = "init" ]; then export APRUN="$launcher" -elif [ $step = "postsnd" ]; then +elif [ "${step}" = "postsnd" ]; then nth_max=$(($npe_node_max / $npe_node_postsnd)) export NTHREADS_POSTSND=${nth_postsnd:-1} - [[ $NTHREADS_POSTSND -gt $nth_max ]] && export NTHREADS_POSTSND=$nth_max + [[ $NTHREADS_POSTSND -gt ${nth_max} ]] && export NTHREADS_POSTSND=${nth_max} export APRUN_POSTSND="$launcher" export NTHREADS_POSTSNDCFP=${nth_postsndcfp:-1} - [[ $NTHREADS_POSTSNDCFP -gt $nth_max ]] && export NTHREADS_POSTSNDCFP=$nth_max + [[ ${NTHREADS_POSTSNDCFP} -gt ${nth_max} ]] && export NTHREADS_POSTSNDCFP=${nth_max} export APRUN_POSTSNDCFP="$launcher" -elif [ $step = "awips" ]; then +elif [ "${step}" = "awips" ]; then nth_max=$(($npe_node_max / $npe_node_awips)) export NTHREADS_AWIPS=${nth_awips:-2} - [[ $NTHREADS_AWIPS -gt $nth_max ]] && export NTHREADS_AWIPS=$nth_max + [[ $NTHREADS_AWIPS -gt ${nth_max} ]] && export NTHREADS_AWIPS=${nth_max} export APRUN_AWIPSCFP="$launcher -n $npe_awips --multi-prog" -elif [ $step = "gempak" ]; then +elif [ "${step}" = "gempak" ]; then nth_max=$(($npe_node_max / $npe_node_gempak)) export NTHREADS_GEMPAK=${nth_gempak:-1} - [[ $NTHREADS_GEMPAK -gt $nth_max ]] && export NTHREADS_GEMPAK=$nth_max + [[ $NTHREADS_GEMPAK -gt ${nth_max} ]] && export NTHREADS_GEMPAK=${nth_max} export APRUN="$launcher -n $npe_gempak --multi-prog" fi diff --git a/jobs/JGDAS_EFSOI b/jobs/JGDAS_EFSOI index 0fa38dc3e13..7289e2f943c 100755 --- a/jobs/JGDAS_EFSOI +++ b/jobs/JGDAS_EFSOI @@ -18,6 +18,16 @@ for config in $configs; do done +export EFSOI_FORECAST_LENGTH=24 + +xtime=$((EFSOI_FORECAST_LENGTH+12)) +if [ "${CDATE}" -lt "$(${NDATE} +$xtime ${SDATE})" ]; then + echo "EFSOI needs a 30-hour EFSOI forecast to run with an analysis from ${CDATE}," + echo " so needs to run $xtime hours starting from $SDATE. This efsoi cycle is skipped" + exit 0 +fi + + ########################################## # Source machine runtime environment ########################################## @@ -68,15 +78,21 @@ fi # Begin JOB SPECIFIC work ############################################## -GDATE=$($NDATE -$assim_freq $CDATE) +EFSOIDATE=$($NDATE -24 $CDATE) +export EFSOIDATE +efsoiPDY=$(echo $EFSOIDATE | cut -c1-8) +efsoicyc=$(echo $EFSOIDATE | cut -c9-10) + +GDATE=$($NDATE -$assim_freq $EFSOIDATE) gPDY=$(echo $GDATE | cut -c1-8) -export gcyc=$(echo $GDATE | cut -c9-10) # needed in namelist +gcyc=$(echo $GDATE | cut -c9-10) # needed in namelist +export gcyc -VDATE=$($NDATE 24 $CDATE) +VDATE=${CDATE} vPDY=$(echo $VDATE | cut -c1-8) vcyc=$(echo $VDATE | cut -c9-10) -export APREFIX="${CDUMP}.t${cyc}z." +export APREFIX="${CDUMP}.t${efsoicyc}z." export VPREFIX="${CDUMP}.t${vcyc}z." export GPREFIX="gdas.t${gcyc}z." export ASUFFIX=${ASUFFIX:-$SUFFIX} @@ -86,11 +102,10 @@ export GSUFFIX=${GSUFFIX:-$SUFFIX} # COMIN_GES_ENS and COMOUT_ANL_ENS are used in script export COMIN_GES_ENS="$ROTDIR/efsoigdas.$gPDY/$gcyc/$COMPONENT" -export COMOUT_ANL_ENS="$ROTDIR/enkf$CDUMP.$PDY/$cyc/$COMPONENT" export COMIN_ANL="$ROTDIR/$CDUMP.$vPDY/$vcyc/$COMPONENT" -export COMOUT_ANL_ENSFSOI="$ROTDIR/efsoi$CDUMP.$PDY/$cyc/$COMPONENT" +export COMOUT_ANL_ENSFSOI="$ROTDIR/efsoi$CDUMP.$efsoiPDY/$efsoicyc/$COMPONENT" export OSENSE_SAVE_DIR="$ROTDIR/osense" -mkdir -p $OSENSE_SAVE_DIR +mkdir -p "$OSENSE_SAVE_DIR" # ======================================================== ############################################################### @@ -98,7 +113,7 @@ mkdir -p $OSENSE_SAVE_DIR ${EFSOIUPDSH:-$SCRgfs/exgdas_efsoi.sh} status=$? -[[ $status -ne 0 ]] && exit $status +[[ "$status" -ne 0 ]] && exit "$status" ############################################## # End JOB SPECIFIC work @@ -108,15 +123,15 @@ status=$? # Final processing ############################################## if [ -e "$pgmout" ] ; then - cat $pgmout + cat "$pgmout" fi ########################################## # Remove the Temporary working directory ########################################## -cd $DATAROOT +cd "${DATAROOT}" -[[ $KEEPDATA = "NO" ]] && rm -rf $DATA +[[ "${KEEPDATA}" = "NO" ]] && rm -rf "${DATA}" exit 0 diff --git a/jobs/JGDAS_EFSOI_ECEN b/jobs/JGDAS_EFSOI_ECEN index c4d63bcc709..ab4b3b14a8b 100755 --- a/jobs/JGDAS_EFSOI_ECEN +++ b/jobs/JGDAS_EFSOI_ECEN @@ -8,7 +8,7 @@ export RUN_ENVIR=${RUN_ENVIR:-"nco"} # Source relevant config files ############################# export EXPDIR=${EXPDIR:-$HOMEgfs/parm/config} -configs="base ecenfsoi" +configs="base ecen ecenfsoi" config_path=${EXPDIR:-$PACKAGEROOT/gfs.${gfs_ver}/parm/config} for config in $configs; do . $config_path/config.$config diff --git a/jobs/JGDAS_EFSOI_FCST b/jobs/JGDAS_EFSOI_FCST index a4b67d34285..4f06994699d 100755 --- a/jobs/JGDAS_EFSOI_FCST +++ b/jobs/JGDAS_EFSOI_FCST @@ -8,8 +8,8 @@ export RUN_ENVIR=${RUN_ENVIR:-"nco"} # Source relevant config files ############################# export EXPDIR=${EXPDIR:-$HOMEgfs/parm/config} +configs="base fcst efcs efcsfsoi" config_path=${EXPDIR:-$PACKAGEROOT/gfs.${gfs_ver}/parm/config} -configs="base fcst efcsfsoi" for config in $configs; do . $config_path/config.$config status=$? @@ -85,7 +85,7 @@ export FORECASTSH=$HOMEgfs/scripts/exglobal_forecast.sh # Get ENSBEG/ENSEND from ENSGRP and NMEM_EFCSGRP -export ENSEND=$((NMEM_EFCSGRP * ENSGRP)) +export ENSEND=$((NMEM_EFCSGRP * 10#${ENSGRP})) export ENSBEG=$((ENSEND - NMEM_EFCSGRP + 1)) diff --git a/jobs/JGDAS_EFSOI_POST b/jobs/JGDAS_EFSOI_POST index f096aff28e2..50a6987d192 100755 --- a/jobs/JGDAS_EFSOI_POST +++ b/jobs/JGDAS_EFSOI_POST @@ -8,7 +8,7 @@ export RUN_ENVIR=${RUN_ENVIR:-"nco"} # Source relevant config files ############################# export EXPDIR=${EXPDIR:-$HOMEgfs/parm/config} -configs="base eposfsoi" +configs="base epos eposfsoi" config_path=${EXPDIR:-$PACKAGEROOT/gfs.${gfs_ver}/parm/config} for config in $configs; do . $config_path/config.$config diff --git a/jobs/JGDAS_EFSOI_SFC b/jobs/JGDAS_EFSOI_SFC index 18a9c24c7fb..9a5449d2466 100755 --- a/jobs/JGDAS_EFSOI_SFC +++ b/jobs/JGDAS_EFSOI_SFC @@ -8,7 +8,7 @@ export RUN_ENVIR=${RUN_ENVIR:-"nco"} # Source relevant config files ############################# export EXPDIR=${EXPDIR:-$HOMEgfs/parm/config} -configs="base esfcfsoi" +configs="base esfc esfcfsoi" config_path=${EXPDIR:-$PACKAGEROOT/gfs.${gfs_ver}/parm/config} for config in $configs; do . $config_path/config.$config @@ -108,11 +108,7 @@ export COMOUT_ENS="$ROTDIR/efsoi$CDUMP.$PDY/$cyc/$COMPONENT" # Previous ENKF comrot folder export COMIN_GES_ENS="$ROTDIR/enkf$CDUMP.$gPDY/$gcyc/$COMPONENT" -#export COMIN="$ROTDIR/$CDUMP.$PDY/$cyc/$COMPONENT" -#export COMIN_ENS="$ROTDIR/enkf$CDUMP_ENKF.$PDY/$cyc/$COMPONENT" -#export COMOUT_ENS="$ROTDIR/enkf$CDUMP.$PDY/$cyc/$COMPONENT" -#export COMIN_GES_ENS="$ROTDIR/enkf$CDUMP.$gPDY/$gcyc/$COMPONENT" - +export COMIN_GES="$ROTDIR/$CDUMP.$gPDY/$gcyc/$COMPONENT" ############################################################### # Run relevant script @@ -129,15 +125,15 @@ status=$? ############################################## # Final processing ############################################## -if [ -e "$pgmout" ] ; then - cat $pgmout +if [ -e "${pgmout}" ] ; then + cat "${pgmout}" fi ########################################## # Remove the Temporary working directory ########################################## -cd $DATAROOT -[[ $KEEPDATA = "NO" ]] && rm -rf $DATA +cd ${DATAROOT} +[[ ${KEEPDATA} = "NO" ]] && rm -rf ${DATA} exit 0 diff --git a/jobs/JGDAS_EFSOI_UPDATE b/jobs/JGDAS_EFSOI_UPDATE index c0f491dcd58..addb08610ca 100755 --- a/jobs/JGDAS_EFSOI_UPDATE +++ b/jobs/JGDAS_EFSOI_UPDATE @@ -9,7 +9,7 @@ export RUN_ENVIR=${RUN_ENVIR:-"nco"} ############################# export EXPDIR=${EXPDIR:-$HOMEgfs/parm/config} -configs="base anal eupdfsoi" +configs="base anal eupd eupdfsoi" config_path=${EXPDIR:-$PACKAGEROOT/gfs.${gfs_ver}/parm/config} for config in $configs; do . $config_path/config.$config diff --git a/jobs/rocoto/earc.sh b/jobs/rocoto/earc.sh index 77f517fde79..b6b16e1f7a6 100755 --- a/jobs/rocoto/earc.sh +++ b/jobs/rocoto/earc.sh @@ -19,7 +19,7 @@ source "$HOMEgfs/ush/preamble.sh" # Source FV3GFS workflow modules . $HOMEgfs/ush/load_fv3gfs_modules.sh status=$? -[[ $status -ne 0 ]] && exit $status +[[ "${status}" -ne 0 ]] && exit "${status}" ############################################################### # Source relevant configs @@ -27,7 +27,7 @@ configs="base earc" for config in $configs; do . $EXPDIR/config.${config} status=$? - [[ $status -ne 0 ]] && exit $status + [[ "${status}" -ne 0 ]] && exit "${status}" done export COMPONENT=${COMPONENT:-atmos} @@ -51,9 +51,18 @@ cd $ARCH_LIST $HOMEgfs/ush/hpssarch_gen.sh enkf${CDUMP} status=$? -if [ $status -ne 0 ]; then +if [ "${status}" -ne 0 ]; then echo "$HOMEgfs/ush/hpssarch_gen.sh enkf${CDUMP} failed, ABORT!" - exit $status + exit "${status}" +fi + +if [ "${DO_EFSOI}" = "YES" ]; then + ${HOMEgfs}/ush/hpssarch_gen.sh efsoigdas + status=$? + if [ "${status}" -ne 0 ]; then + echo "${HOMEgfs}/ush/hpssarch_gen_EFSOI.sh enkf${CDUMP} failed, ABORT!" + exit "${status}" + fi fi cd $ROTDIR @@ -96,29 +105,59 @@ if (( 10#${ENSGRP} > 0 )) && [[ ${HPSSARCH} = "YES" || ${LOCALARCH} = "YES" ]]; $TARCMD -P -cvf $ATARDIR/$CDATE/enkf${CDUMP}_grp${ENSGRP}.tar $(cat $ARCH_LIST/enkf${CDUMP}_grp${n}.txt) status=$? - if [ $status -ne 0 -a $CDATE -ge $firstday ]; then + if [ "${status}" -ne 0 -a $CDATE -ge $firstday ]; then echo "$(echo $TARCMD | tr 'a-z' 'A-Z') $CDATE enkf${CDUMP}_grp${ENSGRP}.tar failed" - exit $status + exit "${status}" fi if [ $SAVEWARMICA = "YES" -a $cyc -eq $EARCINC_CYC ]; then $TARCMD -P -cvf $ATARDIR/$CDATE/enkf${CDUMP}_restarta_grp${ENSGRP}.tar $(cat $ARCH_LIST/enkf${CDUMP}_restarta_grp${n}.txt) status=$? - if [ $status -ne 0 ]; then + if [ "${status}" -ne 0 ]; then echo "$(echo $TARCMD | tr 'a-z' 'A-Z') $CDATE enkf${CDUMP}_restarta_grp${ENSGRP}.tar failed" - exit $status + exit "${status}" fi fi if [ $SAVEWARMICB = "YES" -a $cyc -eq $EARCICS_CYC ]; then $TARCMD -P -cvf $ATARDIR/$CDATE/enkf${CDUMP}_restartb_grp${ENSGRP}.tar $(cat $ARCH_LIST/enkf${CDUMP}_restartb_grp${n}.txt) status=$? - if [ $status -ne 0 ]; then + if [ "${status}" -ne 0 ]; then echo "$(echo $TARCMD | tr 'a-z' 'A-Z') $CDATE enkf${CDUMP}_restartb_grp${ENSGRP}.tar failed" - exit $status + exit "${status}" fi fi + if [ $DO_EFSOI = "YES" ]; then + $TARCMD -P -cvf $ATARDIR/$CDATE/efsoi${CDUMP}_grp${ENSGRP}.tar $(cat $ARCH_LIST/efsoi${CDUMP}_grp${n}.txt) + status=$? + if [ "${status}" -ne 0 -a $CDATE -ge $firstday ]; then + echo "HTAR $CDATE efsoi${CDUMP}_grp${ENSGRP}.tar failed" + exit "${status}" + fi + + if [ $SAVEWARMICA = "YES" ] && [ $cyc -eq $EARCINC_CYC ]; then + $TARCMD -P -cvf "$ATARDIR/$CDATE/efsoi${CDUMP}_restarta_grp${ENSGRP}.tar" $(cat $ARCH_LIST/efsoi${CDUMP}_restarta_grp${n}.txt) + status=$? + if [ "${status}" -ne 0 ]; then + echo "HTAR $CDATE efsoi${CDUMP}_restarta_grp${ENSGRP}.tar failed" + exit "${status}" + fi + fi + + if [ $SAVEWARMICB = "YES" ] && [ $cyc -eq $EARCICS_CYC ]; then + $TARCMD -P -cvf "$ATARDIR/$CDATE/efsoi${CDUMP}_restartb_grp${ENSGRP}.tar" $(cat $ARCH_LIST/efsoi${CDUMP}_restartb_grp${n}.txt) + status=$? + if [ "${status}" -ne 0 ]; then + echo "HTAR $CDATE efsoi${CDUMP}_restartb_grp${ENSGRP}.tar failed" + exit "${status}" + fi + fi + + $NCP $ROTDIR/efsoi${CDUMP}.$PDY/$cyc/$COMPONENT/${CDUMP}.t${cyc}z.enkfstat efsoistat.${CDUMP}.$CDATE + + fi # $DO_EFSOI = "YES" + fi # CDATE>SDATE fi @@ -140,10 +179,21 @@ if [ $ENSGRP -eq 0 ]; then set +e $TARCMD -P -cvf $ATARDIR/$CDATE/enkf${CDUMP}.tar $(cat $ARCH_LIST/enkf${CDUMP}.txt) status=$? - if [ $status -ne 0 -a $CDATE -ge $firstday ]; then + if [ "${status}" -ne 0 ] && [ $CDATE -ge $firstday ]; then echo "$(echo $TARCMD | tr 'a-z' 'A-Z') $CDATE enkf${CDUMP}.tar failed" - exit $status + exit "${status}" fi + + if [ $DO_EFSOI = "YES" ]; then + $TARCMD -P -cvf "$ATARDIR/$CDATE/efsoi${CDUMP}.tar" $(cat $ARCH_LIST/efsoi${CDUMP}.txt) + status=$? + if [ "${status}" -ne 0 ] && [ $CDATE -ge $firstday ]; then + echo "HTAR $CDATE efsoi${CDUMP}.tar failed" + exit "${status}" + fi + fi # $DO_EFSOI = "YES" + + ${ERR_EXIT_ON:-set -eu} set_strict fi @@ -158,7 +208,6 @@ if [ $ENSGRP -eq 0 ]; then nb_copy $ROTDIR/enkfgfs.$PDY/$cyc/$COMPONENT/${CDUMP}.t${cyc}z.enkfstat enkfstat.gfs.$CDATE nb_copy $ROTDIR/enkfgfs.$PDY/$cyc/$COMPONENT/${CDUMP}.t${cyc}z.gsistat.ensmean gsistat.gfs.${CDATE}.ensmean fi - fi @@ -178,6 +227,7 @@ if [ $ENSGRP -eq 0 ]; then gPDY=$(echo $GDATE | cut -c1-8) gcyc=$(echo $GDATE | cut -c9-10) + # Loop over GDAS and GFS EnKF directories separately. clist="gdas gfs" for ctype in $clist; do @@ -202,10 +252,49 @@ if [ $ENSGRP -eq 0 ]; then fi done - # Advance to next cycle - GDATE=$($NDATE +$assim_freq $GDATE) - - done + if [ "${DO_EFSOI}" = "YES" ]; then + COMIN_ENS="${ROTDIR}/efsoigdas.${gPDY}/${gcyc}/${COMPONENT}" + if [ -d "${COMIN_ENS}" ] ; then + rm -rf "${COMIN_ENS}/*f012*nc" + rm -rf "${COMIN_ENS}/*f018*nc" + for imem in $(seq 1 "${NMEM_ENKF}"); do + memchar="mem"$(printf %03i "${imem}") + for file in $(ls "${COMIN_ENS}/${memchar}" |grep -v atmf024); do + rm -rf "${COMIN_ENS:?}/${memchar}/${file}" + done + done + fi + fi # $DO_EFSOI = "YES" + + # Advance to next cycle + GDATE=$("${NDATE}" +"${assim_freq}" "${GDATE}") + + done + + if [ "${DO_EFSOI}" = "YES" ]; then + # Now do EFSOI - needs to be kept around longer + # Start start and end dates to remove + GDATEEND=$("${NDATE}" "-${RMOLDEND_EFSOI:-36}" "${CDATE}") + GDATE=$("${NDATE}" -${RMOLDSTD_ENKF:-120} "${CDATE}") + while [ "${GDATE}" -le "${GDATEEND}" ]; do + + gPDY=$(echo "${GDATE}" | cut -c1-8) + gcyc=$(echo "${GDATE}" | cut -c9-10) + + COMIN_ENS="${ROTDIR}/efsoigdas.${gPDY}/${gcyc}/${COMPONENT}" + [[ -d "${COMIN_ENS}" ]] && rm -rf "${COMIN_ENS}" + + # Remove any empty directories + COMIN_ENS="${ROTDIR}/efsoigdas.${gPDY}/${COMPONENT}" + if [ -d "${COMIN_ENS}" ] ; then + [[ ! -n "$(ls -A "${COMIN_ENS}")" ]] && rm -rf "${COMIN_ENS}" + fi + + # Advance to next cycle + GDATE=$("${NDATE}" "+${assim_freq}" "${GDATE}") + + done + fi # $DO_EFSOI = "YES" fi diff --git a/jobs/rocoto/ecenfsoi.sh b/jobs/rocoto/ecenfsoi.sh new file mode 100755 index 00000000000..766f16cce36 --- /dev/null +++ b/jobs/rocoto/ecenfsoi.sh @@ -0,0 +1,29 @@ +#! /usr/bin/env bash + +source "${HOMEgfs}"/ush/preamble.sh + +############################################################### +# Source FV3GFS workflow modules +. "${HOMEgfs}/ush/load_fv3gfs_modules.sh" +status=$? +[[ "${status}" -ne 0 ]] && exit "${status}" + +############################################################### +# Loop over groups to Execute the JJOB +fhrlst=$(echo "${FHRLST}" | sed -e 's/_/ /g; s/f/ /g; s/,/ /g') +for fhr in ${fhrlst}; do + + export FHMIN_ECEN=${fhr} + export FHMAX_ECEN=${fhr} + export FHOUT_ECEN=${fhr} + export job=ecen${fhr} + + "${HOMEgfs}/jobs/JGDAS_EFSOI_ECEN" + status=$? + [[ "${status}" -ne 0 ]] && exit "${status}" + +done + +############################################################### +# Exit out cleanly +exit 0 diff --git a/jobs/rocoto/efcsfsoi.sh b/jobs/rocoto/efcsfsoi.sh new file mode 100755 index 00000000000..d7e8e700865 --- /dev/null +++ b/jobs/rocoto/efcsfsoi.sh @@ -0,0 +1,16 @@ +#! /usr/bin/env bash + +source "${HOMEgfs}/ush/preamble.sh" + +############################################################### +# Source FV3GFS workflow modules +. "${HOMEgfs}/ush/load_fv3gfs_modules.sh" +status=$? +[[ "${status}" -ne 0 ]] && exit "${status}" + +############################################################### +# Execute the JJOB +"${HOMEgfs}/jobs/JGDAS_EFSOI_FCST" + +status=$? +exit "${status}" diff --git a/jobs/rocoto/efsoi.sh b/jobs/rocoto/efsoi.sh new file mode 100755 index 00000000000..076a2a6276e --- /dev/null +++ b/jobs/rocoto/efsoi.sh @@ -0,0 +1,16 @@ +#! /usr/bin/env bash + +source "${HOMEgfs}/ush/preamble.sh" + +############################################################### +# Source FV3GFS workflow modules +. "${HOMEgfs}/ush/load_fv3gfs_modules.sh" +status=$? +[[ "${status}" -ne 0 ]] && exit "${status}" + +############################################################### +# Execute the JJOB +"${HOMEgfs}/jobs/JGDAS_EFSOI" + +status=$? +exit "${status}" diff --git a/jobs/rocoto/eposfsoi.sh b/jobs/rocoto/eposfsoi.sh new file mode 100755 index 00000000000..8e1eb0148dc --- /dev/null +++ b/jobs/rocoto/eposfsoi.sh @@ -0,0 +1,31 @@ +#! /usr/bin/env bash + +source "${HOMEgfs}/ush/preamble.sh" + +############################################################### +# Source FV3GFS workflow modules +. "${HOMEgfs}/ush/load_fv3gfs_modules.sh" +status=$? +[[ "${status}" -ne 0 ]] && exit "${status}" + +############################################################### +# Loop over groups to Execute the JJOB +fhrlst=$(echo "${FHRLST}" | sed -e 's/_/ /g; s/f/ /g; s/,/ /g') + +for fhr in ${fhrlst}; do + + export FHMIN_EPOS=${fhr} + export FHMAX_EPOS=${fhr} + export FHOUT_EPOS=${fhr} + export job=epos${fhr} + + "${HOMEgfs}/jobs/JGDAS_EFSOI_POST" + + status=$? + [[ "${status}" -ne 0 ]] && exit "${status}" + +done + +############################################################### +# Exit out cleanly +exit 0 diff --git a/jobs/rocoto/esfcfsoi.sh b/jobs/rocoto/esfcfsoi.sh new file mode 100755 index 00000000000..0790e87e154 --- /dev/null +++ b/jobs/rocoto/esfcfsoi.sh @@ -0,0 +1,15 @@ +#! /usr/bin/env bash + +source "${HOMEgfs}/ush/preamble.sh" + +############################################################### +# Source FV3GFS workflow modules +. "${HOMEgfs}/ush/load_fv3gfs_modules.sh" +status=$? +[[ "${status}" -ne 0 ]] && exit "${status}" + +############################################################### +# Execute the JJOB +"${HOMEgfs}/jobs/JGDAS_EFSOI_SFC" +status=$? +exit "${status}" diff --git a/jobs/rocoto/eupdfsoi.sh b/jobs/rocoto/eupdfsoi.sh new file mode 100755 index 00000000000..620c1b92996 --- /dev/null +++ b/jobs/rocoto/eupdfsoi.sh @@ -0,0 +1,16 @@ +#! /usr/bin/env bash + +source "${HOMEgfs}/ush/preamble.sh" + +############################################################### +# Source FV3GFS workflow modules +. "${HOMEgfs}/ush/load_fv3gfs_modules.sh" +status=$? +[[ "${status}" -ne 0 ]] && exit "${status}" + +############################################################### +# Execute the JJOB +"${HOMEgfs}/jobs/JGDAS_EFSOI_UPDATE" + +status=$? +exit "${status}" diff --git a/parm/config/config.base.emc.dyn b/parm/config/config.base.emc.dyn index 8e465c908ce..a6dbde73f3b 100755 --- a/parm/config/config.base.emc.dyn +++ b/parm/config/config.base.emc.dyn @@ -348,6 +348,15 @@ if [ $DOHYBVAR = "YES" ]; then fi fi +# Running EFSOI +export DO_EFSOI="NO" + +if [ $DO_EFSOI = "YES" ]; then + export FHMIN_EFSOI=6 + export FHOUT_EFSOI=6 + export FHMAX_EFSOI=30 +fi + # turned on nsst in anal and/or fcst steps, and turn off rtgsst export DONST="YES" if [ $DONST = "YES" ]; then export FNTSFA=" "; fi diff --git a/parm/config/config.earc b/parm/config/config.earc index de73a93731d..c82c68def97 100755 --- a/parm/config/config.earc +++ b/parm/config/config.earc @@ -14,4 +14,6 @@ export NMEM_EARCGRP=10 export RMOLDSTD_ENKF=144 export RMOLDEND_ENKF=24 +export RMOLDEND_EFSOI=48 + echo "END: config.earc" diff --git a/parm/config/config.ecenfsoi b/parm/config/config.ecenfsoi new file mode 100755 index 00000000000..667ea467300 --- /dev/null +++ b/parm/config/config.ecenfsoi @@ -0,0 +1,11 @@ +#! /usr/bin/env bash + +########## config.ecen ########## +# Ensemble recentering specific + +echo "BEGIN: config.ecenfsoi" + +# Get task specific resources +. "${EXPDIR}"/config.resources ecenfsoi + +echo "END: config.ecenfsoi" diff --git a/parm/config/config.efcsfsoi b/parm/config/config.efcsfsoi new file mode 100755 index 00000000000..1580a67162e --- /dev/null +++ b/parm/config/config.efcsfsoi @@ -0,0 +1,19 @@ +#! /usr/bin/env bash + +########## config.efcsfsoi ########## +# Ensemble forecast specific, dependency: config.fcst + +echo "BEGIN: config.efcsfsoi" + +# Get task specific resources +. "${EXPDIR}"/config.resources efcsfsoi + +export npe_fv3=${npe_efcsfsoi} + +if [ "${QUILTING}" = ".true." ]; then + npe_fv3=$(echo " ${npe_fv3} + ${WRITE_GROUP} * ${WRTTASK_PER_GROUP}" | bc) + export npe_fv3 + export npe_efcsfsoi=${npe_fv3} +fi + +echo "END: config.efcsfsoi" diff --git a/parm/config/config.efsoi b/parm/config/config.efsoi new file mode 100755 index 00000000000..a48fc9cc6d6 --- /dev/null +++ b/parm/config/config.efsoi @@ -0,0 +1,31 @@ +#! /usr/bin/env bash + +########## config.efsoi ########## +# Ensemble update specific, dependency config.anal + +echo "BEGIN: config.efsoi" + +# Get task specific resources +. "${EXPDIR}"/config.resources efsoi + +# LETKF specific settings with model space localization +export modelspace_vloc=".true." # model space localization +export letkf_flag=".true." # use LETKF instead of serial filter +export getkf=".true." # Gain form of LETKF (needed for model-space localization) +export denkf=".true." # EnKF approximation (beneficial since less spread removed by analysis) +export nobsl_max=10000 # max number of obs in each LETKF volume (uses closest nobsl_max). can + # be reduced to speed up execution time. +export analpertwt=0.85 # relaxation to prior spread inflation factor +export readin_localization_enkf=".false." # Don’t read in localization scales from file (doesn’t make + # sense for LETKF if model space localization on and nobsl_max>0) +export corrlength=1250 # Horizontal localization scale (max horizontal distance to search for nobsl_max local obs) +export lnsigcutoff=2.75 # ignored if modelspace_vloc=.true. + +export lobsdiag_forenkf=".true." # use jacobian. must be .true. if modelspace_vloc=".true." + # need to specify .true. setting since config.anal sets to .false. + +export ANAVINFO=${HOMEgfs}"/sorc/gsi_utils.fd/src/EFSOI_Utilities/fix/global_anavinfo.l127.txt" + +export NAM_ENKF="smoothparm=35," + +echo "END: config.efsoi" diff --git a/parm/config/config.eposfsoi b/parm/config/config.eposfsoi new file mode 100755 index 00000000000..bc513d4bb7b --- /dev/null +++ b/parm/config/config.eposfsoi @@ -0,0 +1,19 @@ +#! /usr/bin/env bash + +########## config.eposfsoi ########## +# Ensemble post processing specific + +echo "BEGIN: config.eposfsoi" + +# Get task specific resources +. ${EXPDIR}/config.resources eposfsoi + +# No. of concurrent eposfsoi jobs [1 implies sequential] +# These could be the same as regular epos groups, but +# not necessarily +export NEPOSFSOIGRP=7 +if [ $l4densvar = ".false." ]; then + export NEPOSFSOIGRP=3 +fi + +echo "END: config.eposfsoi" diff --git a/parm/config/config.esfcfsoi b/parm/config/config.esfcfsoi new file mode 100755 index 00000000000..de05db81c21 --- /dev/null +++ b/parm/config/config.esfcfsoi @@ -0,0 +1,11 @@ +#! /usr/bin/env bash + +########## config.esfcfsoi ########## +# Ensemble surface specific + +echo "BEGIN: config.esfcfsoi" + +# Get task specific resources +. "${EXPDIR}"/config.resources esfcfsoi + +echo "END: config.esfcfsoi" diff --git a/parm/config/config.eupdfsoi b/parm/config/config.eupdfsoi new file mode 100755 index 00000000000..042f794cc98 --- /dev/null +++ b/parm/config/config.eupdfsoi @@ -0,0 +1,20 @@ +#! /usr/bin/env bash + +########## config.eupdfsoi ########## +# Ensemble update specific, dependency config.anal + +echo "BEGIN: config.eupdfsoi" + +# Get task specific resources +. "${EXPDIR}"/config.resources eupdfsoi + +export npe_enkf="${npe_eupd}" + + +# Use NAM_ENKF below for serial EnKF +export NAM_ENKF="analpertwtnh=0.9,analpertwtsh=0.9,analpertwttr=0.9" + +# EFSOI works only with the serial filter +export letkf_flag=".false." # use LETKF instead of serial filter + +echo "END: config.eupdfsoi" diff --git a/parm/config/config.resources b/parm/config/config.resources index 21ec6d2b5bd..d86497189c5 100755 --- a/parm/config/config.resources +++ b/parm/config/config.resources @@ -591,16 +591,93 @@ elif [ ${step} = "eupd" ]; then export nth_eupd=40 fi fi - export npe_node_eupd=$(echo "${npe_node_max} / ${nth_eupd}" | bc) + export npe_node_eupd=$(echo "${npe_node_max} / $nth_eupd" | bc) + +elif [ ${step} = "eupdfsoi" ]; then + + export wtime_eupdfsoi="03:00:00" + if [ "${CASE}" = "C768" ]; then + export npe_eupdfsoi=960 + export nth_eupdfsoi=6 + if [[ "$machine" = "WCOSS_DELL_P3" ]]; then + export nth_eupdfsoi=7 + fi + if [[ "$machine" = "HERA" ]]; then + export npe_eupdfsoi=150 + export nth_eupdfsoi=40 + fi + elif [ "${CASE}" = "C384" ]; then + export npe_eupdfsoi=400 + export nth_eupdfsoi=5 + if [[ "$machine" = "WCOSS_DELL_P3" ]]; then + export nth_eupdfsoi=9 + fi + if [[ "$machine" = "HERA" ]]; then + export npe_eupdfsoi=100 + export nth_eupdfsoi=40 + fi + elif [ "${CASE}" = "C192" ] || [ "${CASE}" = "C96" ] || [ "${CASE}" = "C48" ] ; then + export npe_eupdfsoi=42 + export nth_eupdfsoi=2 + if [[ "$machine" = "HERA" ]]; then + export npe_eupdfsoi=40 + export nth_eupdfsoi=40 + fi + fi + export npe_node_eupdfsoi=$(echo "${npe_node_max} / $nth_eupdfsoi" | bc) + +elif [ ${step} = "efsoi" ]; then + + export wtime_efsoi="00:30:00" + if [ "${CASE}" = "C768" ]; then + export npe_efsoi=960 + export nth_efsoi=6 + if [[ "$machine" = "WCOSS_DELL_P3" ]]; then + export nth_efsoi=7 + fi + if [[ "$machine" = "HERA" ]]; then + export npe_efsoi=150 + export nth_efsoi=40 + fi + elif [ "${CASE}" = "C384" ]; then + export npe_efsoi=270 + export nth_efsoi=2 + if [[ "$machine" = "WCOSS_DELL_P3" ]]; then + export nth_efsoi=9 + fi + if [[ "$machine" = "HERA" ]]; then + export npe_efsoi=100 + export nth_efsoi=40 + fi + elif [ "${CASE}" = "C192" ] || [ "${CASE}" = "C96" ] || [ "${CASE}" = "C48" ] ; then + export npe_efsoi=42 + export nth_efsoi=2 + if [[ "$machine" = "HERA" ]]; then + export npe_efsoi=40 + export nth_efsoi=40 + fi + fi + export npe_node_efsoi=$(echo "${npe_node_max} / $nth_efsoi" | bc) + elif [ ${step} = "ecen" ]; then export wtime_ecen="00:10:00" export npe_ecen=80 export nth_ecen=6 - if [[ ${CASE} = "C384" || ${CASE} = "C192" || ${CASE} = "C96" || ${CASE} = "C48" ]]; then export nth_ecen=2; fi - export npe_node_ecen=$(echo "${npe_node_max} / ${nth_ecen}" | bc) - export nth_cycle=${nth_ecen} + if [ "${CASE}" = "C384" -o "${CASE}" = "C192" -o "${CASE}" = "C96" -o "${CASE}" = "C48" ]; then export nth_ecen=2; fi + export npe_node_ecen=$(echo "${npe_node_max} / $nth_ecen" | bc) + export nth_cycle=$nth_ecen + +elif [ ${step} = "ecenfsoi" ]; then + + export wtime_ecenfsoi="00:10:00" + export npe_ecenfsoi=80 + export nth_ecenfsoi=6 + if [[ "$machine" = "WCOSS_DELL_P3" ]]; then export nth_ecenfsoi=7; fi + if [ "${CASE}" = "C384" -o "${CASE}" = "C192" -o "${CASE}" = "C96" -o "${CASE}" = "C48" ]; then export nth_ecenfsoi=2; fi + export npe_node_ecenfsoi=$(echo "${npe_node_max} / $nth_ecenfsoi" | bc) + export nth_cycle=$nth_ecenfsoi elif [ ${step} = "esfc" ]; then @@ -610,23 +687,51 @@ elif [ ${step} = "esfc" ]; then export nth_esfc=1 export nth_cycle=${nth_esfc} +elif [ ${step} = "esfcfsoi" ]; then + + export wtime_esfcfsoi="00:06:00" + export npe_esfcfsoi=80 + export npe_node_esfcfsoi=${npe_node_max} + export nth_esfcfsoi=1 + export nth_cycle=$nth_esfcfsoi + elif [ ${step} = "efcs" ]; then - if [ ${CASE} = "C768" ]; then + if [ "${CASE}" = "C768" ]; then export wtime_efcs="01:00:00" else export wtime_efcs="00:40:00" fi export npe_efcs=$(echo "${layout_x} * ${layout_y} * 6" | bc) export nth_efcs=${nth_fv3:-2} - export npe_node_efcs=$(echo "${npe_node_max} / ${nth_efcs}" | bc) + npe_node_efcs=$(echo "${npe_node_max} / $nth_efcs" | bc) + export npe_node_efcs + +elif [ ${step} = "efcsfsoi" ]; then + + export wtime_efcsfsoi="00:40:00" + npe_efcsfsoi=$(echo "$layout_x * $layout_y * 6" | bc) + export npe_efcsfsoi + export nth_efcsfsoi=${nth_fv3:-2} + npe_node_efcsfsoi=$(echo "${npe_node_max} / $nth_efcsfsoi" | bc) + export npe_node_efcsfsoi elif [ ${step} = "epos" ]; then export wtime_epos="00:15:00" export npe_epos=80 export nth_epos=6 - export npe_node_epos=$(echo "${npe_node_max} / ${nth_epos}" | bc) + npe_node_epos=$(echo "${npe_node_max} / $nth_epos" | bc) + export npe_node_epos + +elif [ ${step} = "eposfsoi" ]; then + + export wtime_eposfsoi="00:15:00" + export npe_eposfsoi=80 + export nth_eposfsoi=6 + if [[ "$machine" = "WCOSS_DELL_P3" ]]; then export nth_eposfsoi=7; fi + npe_node_eposfsoi=$(echo "${npe_node_max} / $nth_eposfsoi" | bc) + export npe_node_eposfsoi elif [ ${step} = "postsnd" ]; then diff --git a/scripts/exgdas_efsoi.sh b/scripts/exgdas_efsoi.sh index 95d20bb46ea..b8b3bddb192 100755 --- a/scripts/exgdas_efsoi.sh +++ b/scripts/exgdas_efsoi.sh @@ -39,7 +39,7 @@ APRUN_ENKF=${APRUN_ENKF:-${APRUN:-""}} NTHREADS_ENKF=${NTHREADS_ENKF:-${NTHREADS:-1}} # Executables -EFSOIEXEC=${EFSOIEXEC:-$HOMEgfs/exec/global_efsoi.x} +EFSOIEXEC=${EFSOIEXEC:-$HOMEgfs/exec/efsoi.x} # Cycling and forecast hour specific parameters CDATE=${CDATE:-"2001010100"} @@ -55,16 +55,16 @@ VSUFFIX=${VSUFFIX:-$SUFFIX} SMOOTH_ENKF=${SMOOTH_ENKF:-"YES"} EFSOISTAT=${EFSOISTAT:-${APREFIX}efsoistat} - +GBIASe=${GBIASe:-${APREFIX}abias_int.ensmean} VERFANL=${VERFANL:-${VPREFIX}atmanl.ensres.nc} INITANL=${INITANL:-${APREFIX}atmanl.ensres.nc} FCSTLONG=${GPREFIX}atmf030.ensmean.nc FCSTSHORT=${APREFIX}atmf024.ensmean.nc -OSENSEIN=osense_${CDATE}_init.dat -OSENSEOUT=osense_${CDATE}_final.dat +OSENSEIN=osense_${EFSOIDATE}_init.dat +OSENSEOUT=osense_${EFSOIDATE}_final.dat # this needs to be set manually because params in enkf will default to fhr03 -fgfileprefixes=sfg_${CDATE}_fhr06_ +fgfileprefixes=sfg_${EFSOIDATE}_fhr06_ #analysise Namelst parameters NMEM_ENKF=${NMEM_ENKF:-80} @@ -133,6 +133,9 @@ $NLN $HYBENSINFO hybens_info $NLN $ANAVINFO anavinfo $NLN $VLOCALEIG vlocal_eig.dat +# Bias correction coefficients based on the ensemble mean +$NLN $COMOUT_ANL_ENSFSOI/$GBIASe satbias_in + ################################################################################ # Ensemble guess, observational data and analyses/increments @@ -143,12 +146,12 @@ for imem in $(seq 1 $NMEM_ENKF); do $NLN $COMOUT_ANL_ENSFSOI/$memchar/${APREFIX}atmf024.nc ${memchar} done -$NLN $COMIN_GES_ENS/${GPREFIX}atmf006.ensmean${GSUFFIX} sfg_${CDATE}_fhr06_ensmean -$NLN $COMIN_GES_ENS/${GPREFIX}atmf006.ensmean${GSUFFIX} sfg_${CDATE}_fhr03_ensmean +$NLN $COMIN_GES_ENS/${GPREFIX}atmf006.ensmean${GSUFFIX} sfg_${EFSOIDATE}_fhr06_ensmean +$NLN $COMIN_GES_ENS/${GPREFIX}atmf006.ensmean${GSUFFIX} sfg_${EFSOIDATE}_fhr03_ensmean # The following deals with different files with the same local name (assuming # a 24hr EFSOI forecast): -# both are hybrid analyses from gdas - one from CDATE saved during the +# both are hybrid analyses from gdas - one from EFSOIDATE saved during the # corresponding GDAS cycle in the efsoigdas tree to be used in # the localization advection in EFSOI, the other from VDATE to be used # for verification. @@ -164,23 +167,7 @@ $NLN $COMOUT_ANL_ENSFSOI/$FCSTSHORT . # inital osense file # efsoi.x will read then clobber this -$NCP $COMOUT_ANL_ENSFSOI/$OSENSEIN osense_${CDATE}.dat - - - - -if [ $USE_CFP = "YES" ]; then - chmod 755 $DATA/mp_untar.sh - ncmd=$(cat $DATA/mp_untar.sh | wc -l) - if [ $ncmd -gt 0 ]; then - ncmd_max=$((ncmd < npe_node_max ? ncmd : npe_node_max)) - APRUNCFP=$(eval echo $APRUNCFP) - $APRUNCFP $DATA/mp_untar.sh - export ERR=$? - export err=$ERR - $ERRSCRIPT || exit 3 - fi -fi +$NCP $COMOUT_ANL_ENSFSOI/$OSENSEIN osense_${EFSOIDATE}.dat ################################################################################ # Create global_enkf namelist @@ -197,7 +184,7 @@ fi cat > enkf.nml << EOFnml &nam_enkf - datestring="$CDATE",datapath="$DATA/", + datestring="$EFSOIDATE",datapath="$DATA/", gdatehr=$gcyc, datehr=$cyc, fgfileprefixes=$fgfileprefixes @@ -245,8 +232,8 @@ $ERRSCRIPT || exit 2 # Cat runtime output files. cat stdout stderr > $COMOUT_ANL_ENSFSOI/$EFSOISTAT -$NCP osense_${CDATE}.dat $COMOUT_ANL_ENSFSOI/$OSENSEOUT -$NCP osense_${CDATE}.dat $OSENSE_SAVE_DIR/$OSENSEOUT +$NCP osense_${EFSOIDATE}.dat $COMOUT_ANL_ENSFSOI/$OSENSEOUT +$NCP osense_${EFSOIDATE}.dat $OSENSE_SAVE_DIR/$OSENSEOUT ################################################################################ # Postprocessing diff --git a/scripts/exgdas_efsoi_update.sh b/scripts/exgdas_efsoi_update.sh index 7e755f4ecf8..80e4f330a0e 100755 --- a/scripts/exgdas_efsoi_update.sh +++ b/scripts/exgdas_efsoi_update.sh @@ -40,7 +40,7 @@ APRUN_ENKF=${APRUN_ENKF:-${APRUN:-""}} NTHREADS_ENKF=${NTHREADS_ENKF:-${NTHREADS:-1}} # Executables -ENKFEXEC=${ENKFEXEC:-$HOMEgfs/exec/global_enkf.x} +ENKFEXEC=${ENKFEXEC:-$HOMEgfs/exec/enkf.x} # Cycling and forecast hour specific parameters CDATE=${CDATE:-"2001010100"} diff --git a/sorc/build_gsi_utils.sh b/sorc/build_gsi_utils.sh index bc579300d1d..f8e81044068 100755 --- a/sorc/build_gsi_utils.sh +++ b/sorc/build_gsi_utils.sh @@ -21,9 +21,17 @@ while getopts ":dov" option; do done shift $((OPTIND-1)) +UTIL_OPTS="-DBUILD_UTIL_ENKF_GFS=ON -DBUILD_UTIL_NCIO=ON" +GSIENKF_INSTALL_PREFIX="${cwd}/gsi_enkf.fd/install" +if [[ -d "${GSIENKF_INSTALL_PREFIX}" ]]; then + CMAKE_OPTS="-Dgsi_ROOT=${GSIENKF_INSTALL_PREFIX} -Denkf_ROOT=${GSIENKF_INSTALL_PREFIX}" + UTIL_OPTS+=" -DBUILD_UTIL_EFSOI=ON" +fi + BUILD_TYPE=${BUILD_TYPE:-"Release"} \ BUILD_VERBOSE=${BUILD_VERBOSE:-"NO"} \ -UTIL_OPTS="-DBUILD_UTIL_ENKF_GFS=ON -DBUILD_UTIL_NCIO=ON" \ +CMAKE_OPTS="${CMAKE_OPTS:-}" \ +UTIL_OPTS="${UTIL_OPTS:-}" \ ${cwd}/gsi_utils.fd/ush/build.sh exit diff --git a/sorc/checkout.sh b/sorc/checkout.sh index 441cd781244..9378e424a3e 100755 --- a/sorc/checkout.sh +++ b/sorc/checkout.sh @@ -166,7 +166,7 @@ if [[ ${checkout_gdas} == "YES" ]]; then fi if [[ ${checkout_gsi} == "YES" || ${checkout_gdas} == "YES" ]]; then - checkout "gsi_utils.fd" "https://github.com/NOAA-EMC/GSI-Utils.git" "322cc7b"; errs=$((errs + $?)) + checkout "gsi_utils.fd" "https://github.com/AndrewEichmann-NOAA/GSI-Utils.git" "f9fd8a5"; errs=$((errs + $?)) checkout "gsi_monitor.fd" "https://github.com/NOAA-EMC/GSI-Monitor.git" "c64cc47"; errs=$((errs + $?)) checkout "gldas.fd" "https://github.com/NOAA-EMC/GLDAS.git" "fd8ba62"; errs=$((errs + $?)) fi diff --git a/sorc/link_workflow.sh b/sorc/link_workflow.sh index 15c09168d94..73f67765802 100755 --- a/sorc/link_workflow.sh +++ b/sorc/link_workflow.sh @@ -263,7 +263,7 @@ fi # GSI Utils if [ -d "${script_dir}/gsi_utils.fd" ]; then for exe in calc_analysis.x calc_increment_ens_ncio.x calc_increment_ens.x \ - getsfcensmeanp.x getsigensmeanp_smooth.x getsigensstatp.x \ + efsoi.x getsfcensmeanp.x getsigensmeanp_smooth.x getsigensstatp.x \ interp_inc.x recentersigp.x;do [[ -s "${exe}" ]] && rm -f ${exe} ${LINK} "${script_dir}/gsi_utils.fd/install/bin/${exe}" . diff --git a/ush/forecast_predet.sh b/ush/forecast_predet.sh index 28e612e9e97..32d5d94cc78 100755 --- a/ush/forecast_predet.sh +++ b/ush/forecast_predet.sh @@ -100,6 +100,7 @@ FV3_GFS_predet(){ MEMBER=${MEMBER:-"-1"} # -1: control, 0: ensemble mean, >0: ensemble member $MEMBER ENS_NUM=${ENS_NUM:-1} # Single executable runs multiple members (e.g. GEFS) PREFIX_ATMINC=${PREFIX_ATMINC:-""} # allow ensemble to use recentered increment + EFSOI_TASK=${EFSOI_TASK:-"NO"} # is instance of EFSOI ensemble forecast # IAU options DOIAU=${DOIAU:-"NO"} @@ -237,7 +238,11 @@ FV3_GFS_predet(){ rprefix=$rCDUMP memchar="" else - prefix=enkf$CDUMP + if [[ "$EFSOI_TASK" = "YES" ]]; then + prefix=efsoi$CDUMP + else + prefix=enkf$CDUMP + fi rprefix=enkf$rCDUMP memchar=mem$(printf %03i $MEMBER) fi diff --git a/ush/hpssarch_gen.sh b/ush/hpssarch_gen.sh index 245a4026925..b3e5bdad357 100755 --- a/ush/hpssarch_gen.sh +++ b/ush/hpssarch_gen.sh @@ -584,5 +584,173 @@ if [ $type = "enkfgdas" -o $type = "enkfgfs" ]; then fi ##end of enkfgdas or enkfgfs #----------------------------------------------------- +#----------------------------------------------------- +if [ "${type}" = "efsoigdas" ]; then +#----------------------------------------------------- + + IAUFHRS_ENKF="6,12,18,24,30" + lobsdiag_forenkf=${lobsdiag_forenkf:-".false."} + #nfhrs=$(echo "${IAUFHRS_ENKF}" | sed 's/,/ /g') + nfhrs=$(echo "${IAUFHRS_ENKF//,/ }") + NMEM_ENKF=${NMEM_ENKF:-80} + NMEM_EARCGRP=${NMEM_EARCGRP:-10} ##number of ens memebers included in each tarball + NTARS=$((NMEM_ENKF/NMEM_EARCGRP)) + [[ "${NTARS}" -eq 0 ]] && NTARS=1 + [[ $((NTARS*NMEM_EARCGRP)) -lt ${NMEM_ENKF} ]] && NTARS=$((NTARS+1)) + NTARS2=${NTARS} + + dirpath="efsoi${CDUMP}.${PDY}/${cyc}/atmos/" + dirname="./${dirpath}" + head="${CDUMP}.t${cyc}z." + + #.................. + rm -f "efsoi${CDUMP}.txt" + touch "efsoi${CDUMP}.txt" + + echo "${dirname}${head}enkfstat " >>"efsoi${CDUMP}.txt" + echo "${dirname}osense_${PDY}${cyc}_init.dat " >>"efsoi${CDUMP}.txt" + echo "${dirname}${head}abias_int.ensmean " >>"efsoi${CDUMP}.txt" + if [ -s "${ROTDIR}/${dirpath}${head}cnvstat.ensmean" ]; then + echo "${dirname}${head}cnvstat.ensmean " >>"efsoi${CDUMP}.txt" + fi + if [ -s "${ROTDIR}/${dirpath}${head}oznstat.ensmean" ]; then + echo "${dirname}${head}oznstat.ensmean " >>"efsoi${CDUMP}.txt" + fi + if [ -s "${ROTDIR}/${dirpath}${head}radstat.ensmean" ]; then + echo "${dirname}${head}radstat.ensmean " >>"efsoi${CDUMP}.txt" + fi + for FHR in ${nfhrs}; do # loop over analysis times in window + if [ "${FHR}" -eq 6 ]; then + if [ -s "${ROTDIR}/${dirpath}${head}atmanl.ensmean${SUFFIX}" ]; then + echo "${dirname}${head}atmanl.ensmean${SUFFIX} " >>"efsoi${CDUMP}.txt" + fi + if [ -s "${ROTDIR}/${dirpath}${head}atminc.ensmean${SUFFIX}" ]; then + echo "${dirname}${head}atminc.ensmean${SUFFIX} " >>"efsoi${CDUMP}.txt" + fi + else + if [ -s "${ROTDIR}/${dirpath}${head}atma${FHR}.ensmean${SUFFIX}" ]; then + echo "${dirname}${head}atma00${FHR}.ensmean${SUFFIX} " >>"efsoi${CDUMP}.txt" + fi + if [ -s "${ROTDIR}/${dirpath}${head}atmi${FHR}.ensmean${SUFFIX}" ]; then + echo "${dirname}${head}atmi00${FHR}.ensmean${SUFFIX} " >>"efsoi${CDUMP}.txt" + fi + fi + done # loop over FHR + for fstep in ecenfsoi esfcfsoi eupdfsoi efcsfsoi eposfsoi ; do + echo "logs/${CDATE}/${CDUMP}${fstep}*.log " >>"efsoi${CDUMP}.txt" + done + + +# Ensemble spread file only available with netcdf output + fh=6 + while [ "${fh}" -le 30 ]; do + fhr=$(printf %03i "${fh}") + echo "${dirname}${head}atmf${fhr}.ensmean${SUFFIX} " >>"efsoi${CDUMP}.txt" + echo "${dirname}${head}sfcf${fhr}.ensmean${SUFFIX} " >>"efsoi${CDUMP}.txt" + if [ "${OUTPUT_FILE}" = "netcdf" ]; then + if [ -s "${ROTDIR}/${dirpath}${head}atmf${fhr}.ensspread${SUFFIX}" ]; then + echo "${dirname}${head}atmf${fhr}.ensspread${SUFFIX} " >>"efsoi${CDUMP}.txt" + fi + fi + fh=$((fh+6)) + done + + #........................... + n=1 + while [ "${n}" -le "${NTARS}" ]; do + #........................... + + rm -f "efsoi${CDUMP}_grp${n}.txt" + rm -f "efsoi${CDUMP}_restarta_grp${n}.txt" + rm -f "efsoi${CDUMP}_restartb_grp${n}.txt" + touch "efsoi${CDUMP}_grp${n}.txt" + touch "efsoi${CDUMP}_restarta_grp${n}.txt" + touch "efsoi${CDUMP}_restartb_grp${n}.txt" + + m=1 + while [ "${m}" -le "${NMEM_EARCGRP}" ]; do + nm=$(((n-1)*NMEM_EARCGRP+m)) + mem=$(printf %03i "${nm}") + dirpath="efsoi${CDUMP}.${PDY}/${cyc}/atmos/mem${mem}/" + dirname="./${dirpath}" + head="${CDUMP}.t${cyc}z." + + #--- + for FHR in "${nfhrs}"; do # loop over analysis times in window + if [ "${FHR}" -eq 6 ]; then + if [ "${n}" -le "${NTARS2}" ]; then + if [ -s "${ROTDIR}/${dirpath}${head}atmanl${SUFFIX}" ] ; then + echo "${dirname}${head}atmanl${SUFFIX} " >>"efsoi${CDUMP}_grp${n}.txt" + fi + if [ -s "${ROTDIR}/${dirpath}${head}ratminc${SUFFIX}" ] ; then + echo "${dirname}${head}ratminc${SUFFIX} " >>"efsoi${CDUMP}_grp${n}.txt" + fi + fi + if [ -s "${ROTDIR}/${dirpath}${head}ratminc${SUFFIX}" ] ; then + echo "${dirname}${head}ratminc${SUFFIX} " >>"efsoi${CDUMP}_restarta_grp${n}.txt" + fi + + else + if [ "${n} -le "${NTARS2} ]; then + if [ -s "${ROTDIR}/${dirpath}${head}atma${FHR}${SUFFIX}" ] ; then + echo "${dirname}${head}atma${FHR}${SUFFIX} " >>"efsoi${CDUMP}_grp${n}.txt" + fi + if [ -s "${ROTDIR}/${dirpath}${head}ratmi${FHR}${SUFFIX}" ] ; then + echo "${dirname}${head}ratmi${FHR}${SUFFIX} " >>"efsoi${CDUMP}_grp${n}.txt" + fi + fi + if [ -s "${ROTDIR}/${dirpath}${head}ratmi${FHR}${SUFFIX}" ] ; then + echo "${dirname}${head}ratmi${FHR}${SUFFIX} " >>"efsoi${CDUMP}_restarta_grp${n}.txt" + fi + + fi + echo "${dirname}${head}atmf${FHR}${SUFFIX} " >>"efsoi${CDUMP}_grp${n}.txt" + if [ "${FHR}" -eq 6 ]; then + echo "${dirname}${head}sfcf${FHR}${SUFFIX} " >>"efsoi${CDUMP}_grp${n}.txt" + fi + done # loop over FHR + + if [[ "${lobsdiag_forenkf}" = ".false." ]] ; then + echo "${dirname}${head}gsistat " >>"efsoi${CDUMP}_grp${n}.txt" + if [ -s "${ROTDIR}/${dirpath}${head}cnvstat" ] ; then + echo "${dirname}${head}cnvstat " >>"efsoi${CDUMP}_grp${n}.txt" + fi + if [ -s "${ROTDIR}/${dirpath}${head}radstat" ]; then + echo "${dirname}${head}radstat " >>"efsoi${CDUMP}_restarta_grp${n}.txt" + fi + if [ -s "${ROTDIR}/${dirpath}${head}cnvstat" ]; then + echo "${dirname}${head}cnvstat " >>"efsoi${CDUMP}_restarta_grp${n}.txt" + fi + echo "${dirname}${head}abias " >>"efsoi${CDUMP}_restarta_grp${n}.txt" + echo "${dirname}${head}abias_air " >>"efsoi${CDUMP}_restarta_grp${n}.txt" + echo "${dirname}${head}abias_int " >>"efsoi${CDUMP}_restarta_grp${n}.txt" + echo "${dirname}${head}abias_pc " >>"efsoi${CDUMP}_restarta_grp${n}.txt" + fi + #--- + echo "${dirname}RESTART/*0000.sfcanl_data.tile1.nc " >>"efsoi${CDUMP}_restarta_grp${n}.txt" + echo "${dirname}RESTART/*0000.sfcanl_data.tile2.nc " >>"efsoi${CDUMP}_restarta_grp${n}.txt" + echo "${dirname}RESTART/*0000.sfcanl_data.tile3.nc " >>"efsoi${CDUMP}_restarta_grp${n}.txt" + echo "${dirname}RESTART/*0000.sfcanl_data.tile4.nc " >>"efsoi${CDUMP}_restarta_grp${n}.txt" + echo "${dirname}RESTART/*0000.sfcanl_data.tile5.nc " >>"efsoi${CDUMP}_restarta_grp${n}.txt" + echo "${dirname}RESTART/*0000.sfcanl_data.tile6.nc " >>"efsoi${CDUMP}_restarta_grp${n}.txt" + + #--- + echo "${dirname}RESTART " >>"efsoi${CDUMP}_restartb_grp${n}.txt" + + m=$((m+1)) + done + + + #........................... + n=$((n+1)) + done + #........................... + + +#----------------------------------------------------- +fi ##end of e:fsoigdas +#----------------------------------------------------- + + exit 0 diff --git a/workflow/applications.py b/workflow/applications.py index 713c68727c7..7941c6b3b88 100644 --- a/workflow/applications.py +++ b/workflow/applications.py @@ -106,6 +106,7 @@ def __init__(self, configuration: Configuration) -> None: self.do_wafs = _base.get('DO_WAFS', False) self.do_vrfy = _base.get('DO_VRFY', True) self.do_metp = _base.get('DO_METP', False) + self.do_efsoi = _base.get('DO_EFSOI', False) self.do_jedivar = _base.get('DO_JEDIVAR', False) self.do_jediens = _base.get('DO_JEDIENS', False) @@ -193,6 +194,9 @@ def _cycled_configs(self): configs += ['eobs', 'eomg', 'ediag', 'eupd'] configs += ['ecen', 'esfc', 'efcs', 'echgres', 'epos', 'earc'] + if self.do_efsoi: + configs += ['eupdfsoi', 'ecenfsoi', 'esfcfsoi', 'efcsfsoi', 'eposfsoi', 'efsoi'] + if self.do_metp: configs += ['metp'] @@ -309,6 +313,8 @@ def _source_configs(self, configuration: Configuration) -> Dict[str, Any]: files += ['config.anal', 'config.eupd'] elif config in ['efcs']: files += ['config.fcst', 'config.efcs'] + elif config in ['efcsfsoi']: + files += ['config.fcst', 'config.efcsfsoi'] elif 'wave' in config: files += ['config.wave', f'config.{config}'] else: @@ -355,6 +361,7 @@ def _get_cycled_task_names(self): gdas_gfs_common_tasks_before_fcst += ['aeroanlinit', 'aeroanlrun', 'aeroanlfinal'] gldas_tasks = ['gldas'] + efsoi_tasks = ['eupdfsoi', 'ecenfsoi', 'esfcfsoi', 'efcsfsoi', 'eposfsoi', 'efsoi'] wave_prep_tasks = ['waveinit', 'waveprep'] wave_bndpnt_tasks = ['wavepostbndpnt', 'wavepostbndpntbll'] wave_post_tasks = ['wavepostsbs', 'wavepostpnt'] @@ -377,6 +384,9 @@ def _get_cycled_task_names(self): if self.do_gldas: gdas_tasks += gldas_tasks + if self.do_efsoi: + gdas_tasks += efsoi_tasks + if self.do_wave and 'gdas' in self.wave_cdumps: gdas_tasks += wave_prep_tasks diff --git a/workflow/rocoto/workflow_tasks.py b/workflow/rocoto/workflow_tasks.py index 5ec1dbb39c0..781ce7cd725 100644 --- a/workflow/rocoto/workflow_tasks.py +++ b/workflow/rocoto/workflow_tasks.py @@ -15,6 +15,7 @@ class Tasks: 'atmanalprep', 'atmanalrun', 'atmanalpost', 'earc', 'ecen', 'echgres', 'ediag', 'efcs', 'eobs', 'eomg', 'epos', 'esfc', 'eupd', + 'eupdfsoi', 'ecenfsoi', 'esfcfsoi', 'efcsfsoi', 'eposfsoi', 'efsoi' 'atmensanalprep', 'atmensanalrun', 'atmensanalpost', 'aeroanlinit', 'aeroanlrun', 'aeroanlfinal', 'fcst', 'post', 'ocnpost', 'vrfy', 'metp', @@ -1022,6 +1023,32 @@ def eupd(self): return task + def eupdfsoi(self): + deps = [] + if self.app_config.lobsdiag_forenkf: + dep_dict = {'type': 'task', 'name': f'{self.cdump}ediag'} + else: + dep_dict = {'type': 'metatask', 'name': f'{self.cdump}eomn'} + deps.append(rocoto.add_dependency(dep_dict)) + dependencies = rocoto.create_dependency(dep=deps) + + resources = self.get_resource('eupdfsoi') + task = create_wf_task('eupdfsoi', resources, cdump=self.cdump, envar=self.envars, dependency=dependencies) + + return task + + def efsoi(self): + deps = [] + data = '&ROTDIR;/gdas.@Y@m@d/@H/atmos/gdas.t@Hz.atmanl.ensres.nc' + dep_dict = {'type': 'data', 'data': data} + deps.append(rocoto.add_dependency(dep_dict)) + dependencies = rocoto.create_dependency(dep=deps) + + resources = self.get_resource('efsoi') + task = create_wf_task('efsoi', resources, cdump=self.cdump, envar=self.envars, dependency=dependencies) + + return task + def atmensanalprep(self): suffix = self._base["SUFFIX"] @@ -1131,6 +1158,57 @@ def _get_ecengroups(): metatask='ecmn', varname=varname1, varval=varval1, vardict=vardict) return task + def ecenfsoi(self): + + self._is_this_a_gdas_task(self.cdump, 'ecenfsoi') + + def _get_ecenfsoigroups(): + + if self._base.get('DOIAU_ENKF', False): + fhrs = list(self._base.get('IAUFHRS', '6').split(',')) + + necenfsoigrp = self._configs['ecen']['NECENGRP'] + ngrps = necenfsoigrp if len(fhrs) > necenfsoigrp else len(fhrs) + + fhrs = [f'{int(fhr):03d}' for fhr in fhrs] + fhrs = np.array_split(fhrs, ngrps) + fhrs = [fhr.tolist() for fhr in fhrs] + + grp = ' '.join([f'{x:03d}' for x in range(0, ngrps)]) + dep = ' '.join([f[-1] for f in fhrs]) + lst = ' '.join(['_'.join(f) for f in fhrs]) + + else: + grp = '000' + dep = 'f006' + lst = 'f006' + + return grp, dep, lst + + eupdfsoi_cdump = 'gdas' if 'gdas' in self.app_config.eupd_cdumps else 'gfs' + + deps = [] + dep_dict = {'type': 'task', 'name': f'{self.cdump}analcalc'} + deps.append(rocoto.add_dependency(dep_dict)) + dep_dict = {'type': 'task', 'name': f'{eupdfsoi_cdump}eupdfsoi'} + deps.append(rocoto.add_dependency(dep_dict)) + dependencies = rocoto.create_dependency(dep_condition='and', dep=deps) + + ecenfsoienvars = self.envars.copy() + ecenfsoienvar_dict = {'FHRGRP': '#grp#', + 'FHRLST': '#lst#'} + for key, value in ecenfsoienvar_dict.items(): + ecenfsoienvars.append(rocoto.create_envar(name=key, value=str(value))) + + varname1, varname2, varname3 = 'grp', 'dep', 'lst' + varval1, varval2, varval3 = _get_ecenfsoigroups() + vardict = {varname2: varval2, varname3: varval3} + + resources = self.get_resource('ecenfsoi') + task = create_wf_task('ecenfsoi', resources, cdump=self.cdump, envar=ecenfsoienvars, dependency=dependencies, + metatask='ecmnfsoi', varname=varname1, varval=varval1, vardict=vardict) + return task + def esfc(self): self._is_this_a_gdas_task(self.cdump, 'esfc') @@ -1152,6 +1230,25 @@ def esfc(self): return task + def esfcfsoi(self): + + self._is_this_a_gdas_task(self.cdump, 'esfcfsoi') + + eupd_cdump = 'gdas' if 'gdas' in self.app_config.eupd_cdumps else 'gfs' + + deps = [] + dep_dict = {'type': 'task', 'name': f'{self.cdump}analcalc'} + deps.append(rocoto.add_dependency(dep_dict)) + dep_dict = {'type': 'task', 'name': f'{eupd_cdump}eupdfsoi'} + deps.append(rocoto.add_dependency(dep_dict)) + dependencies = rocoto.create_dependency(dep_condition='and', dep=deps) + + resources = self.get_resource('esfcfsoi') + task = create_wf_task('esfcfsoi', resources, cdump='gdas', envar=self.envars, dependency=dependencies) + + return task + + def efcs(self): self._is_this_a_gdas_task(self.cdump, 'efcs') @@ -1177,6 +1274,29 @@ def efcs(self): return task + def efcsfsoi(self): + + self._is_this_a_gdas_task(self.cdump, 'efcsfsoi') + + deps = [] + dep_dict = {'type': 'metatask', 'name': f'{self.cdump}ecmnfsoi'} + deps.append(rocoto.add_dependency(dep_dict)) + dep_dict = {'type': 'task', 'name': f'{self.cdump}esfcfsoi'} + deps.append(rocoto.add_dependency(dep_dict)) + dependencies = rocoto.create_dependency(dep_condition='and', dep=deps) + + efcsfsoienvars = self.envars.copy() + efcsfsoienvars.append(rocoto.create_envar(name='ENSGRP', value='#grp#')) + + groups = self._get_hybgroups(self._base['NMEM_ENKF'], self._configs['efcs']['NMEM_EFCSGRP']) + + resources = self.get_resource('efcsfsoi') + task = create_wf_task('efcsfsoi', resources, cdump=self.cdump, envar=efcsfsoienvars, dependency=dependencies, + metatask='efmnfsoi', varname='grp', varval=groups) + + return task + + def echgres(self): self._is_this_a_gdas_task(self.cdump, 'echgres') @@ -1237,6 +1357,50 @@ def _get_eposgroups(epos): return task + def eposfsoi(self): + + self._is_this_a_gdas_task(self.cdump, 'eposfsoi') + + def _get_eposfsoigroups(eposfsoi): + fhmin = eposfsoi['FHMIN_EFSOI'] + fhmax = eposfsoi['FHMAX_EFSOI'] + fhout = eposfsoi['FHOUT_EFSOI'] + fhrs = range(fhmin, fhmax + fhout, fhout) + + neposfsoigrp = eposfsoi['NEPOSFSOIGRP'] + ngrps = neposfsoigrp if len(fhrs) > neposfsoigrp else len(fhrs) + + fhrs = [f'f{fhr:03d}' for fhr in fhrs] + fhrs = np.array_split(fhrs, ngrps) + fhrs = [f.tolist() for f in fhrs] + + grp = ' '.join([f'{x:03d}' for x in range(0, ngrps)]) + dep = ' '.join([f[-1] for f in fhrs]) + lst = ' '.join(['_'.join(f) for f in fhrs]) + + return grp, dep, lst + + deps = [] + dep_dict = {'type': 'metatask', 'name': f'{self.cdump}efmnfsoi'} + deps.append(rocoto.add_dependency(dep_dict)) + dependencies = rocoto.create_dependency(dep=deps) + + eposfsoienvars = self.envars.copy() + eposfsoienvar_dict = {'FHRGRP': '#grp#', + 'FHRLST': '#lst#'} + for key, value in eposfsoienvar_dict.items(): + eposfsoienvars.append(rocoto.create_envar(name=key, value=str(value))) + + varname1, varname2, varname3 = 'grp', 'dep', 'lst' + varval1, varval2, varval3 = _get_eposfsoigroups(self._configs['eposfsoi']) + vardict = {varname2: varval2, varname3: varval3} + + resources = self.get_resource('eposfsoi') + task = create_wf_task('eposfsoi', resources, cdump=self.cdump, envar=eposfsoienvars, dependency=dependencies, + metatask='epmnfsoi', varname=varname1, varval=varval1, vardict=vardict) + + return task + def earc(self): self._is_this_a_gdas_task(self.cdump, 'earc') @@ -1244,7 +1408,12 @@ def earc(self): deps = [] dep_dict = {'type': 'metatask', 'name': f'{self.cdump}epmn'} deps.append(rocoto.add_dependency(dep_dict)) - dependencies = rocoto.create_dependency(dep=deps) + if self.app_config.do_efsoi: + dep_dict = {'type': 'metatask', 'name': f'{self.cdump}epmnfsoi'} + deps.append(rocoto.add_dependency(dep_dict)) + dependencies = rocoto.create_dependency(dep_condition='and', dep=deps) + else: + dependencies = rocoto.create_dependency(dep=deps) earcenvars = self.envars.copy() earcenvars.append(rocoto.create_envar(name='ENSGRP', value='#grp#'))