diff --git a/dev/drivers/scripts/prep/aigefs/jevs_prep_aigefs_atmos.sh b/dev/drivers/scripts/prep/aigefs/jevs_prep_aigefs_atmos.sh new file mode 100755 index 0000000000..d4191e98c0 --- /dev/null +++ b/dev/drivers/scripts/prep/aigefs/jevs_prep_aigefs_atmos.sh @@ -0,0 +1,45 @@ +#PBS -N jevs_prep_aigefs_atmos +#PBS -j oe +#PBS -S /bin/bash +#PBS -q dev +#PBS -A VERF-DEV +#PBS -l walltime=01:30:00 +#PBS -l place=vscatter,select=2:ncpus=48:mem=400GB:prepost=true +#PBS -l debug=true + +set -x +export OMP_NUM_THREADS=1 +export HOMEevs=/lfs/h2/emc/vpppg/noscrub/${USER}/EVS +source $HOMEevs/versions/run.ver + +export envir=prod +export NET=evs +export STEP=prep +export COMPONENT=aigefs +export RUN=atmos +export MODELNAME=aigefs + +module reset +module load prod_envir/${prod_envir_ver} +source $HOMEevs/dev/modulefiles/$COMPONENT/${COMPONENT}_${STEP}.sh + +evs_ver_2d=$(echo $evs_ver | cut -d'.' -f1-2) + +export vhr=00 + +export COMIN=/lfs/h2/emc/vpppg/noscrub/${USER}/$NET/$evs_ver_2d +export COMOUT=/lfs/h2/emc/vpppg/noscrub/${USER}/$NET/$evs_ver_2d +export DATAROOT=/lfs/h2/emc/stmp/${USER}/evs/$envir/tmp + +export job=${PBS_JOBNAME:-jevs_${STEP}_${COMPONENT}_${RUN}} +export jobid=$job.${PBS_JOBID:-$$} + +export KEEPDATA=NO +export SENDMAIL=NO +export MAILTO='alicia.bentley@noaa.gov,lichuan.chen@noaa.gov' + +if [ -z "$MAILTO" ]; then + echo "MAILTO variable is not defined. Exiting without continuing." +else + ${HOMEevs}/jobs/JEVS_PREP_AIGEFS +fi diff --git a/dev/modulefiles/aigefs/aigefs_prep.sh b/dev/modulefiles/aigefs/aigefs_prep.sh new file mode 100644 index 0000000000..b44d365a0f --- /dev/null +++ b/dev/modulefiles/aigefs/aigefs_prep.sh @@ -0,0 +1,28 @@ +#!/bin/bash +# modulefile for EVS aigefs component, prep step + +set -x + +module load PrgEnv-intel/${PrgEnvintel_ver} +module load intel/${intel_ver} +module load ve/evs/${ve_evs_ver} +module load gsl/${gsl_ver} +module load prod_util/${prod_util_ver} +module load libjpeg/${libjpeg_ver} +module load libpng/${libpng_ver} +module load zlib/${zlib_ver} +module load jasper/${jasper_ver} +module load udunits/${udunits_ver} +module load grib_util/${grib_util_ver} +module load wgrib2/${wgrib2_ver} +module load cray-pals/${craypals_ver} +module load cfp/${cfp_ver} +module load cdo/${cdo_ver} +module load met/${met_ver} +module load metplus/${metplus_ver} +module load bufr/${bufr_ver} + +module list + +set -x + diff --git a/ecf/defs/evs-nco.def b/ecf/defs/evs-nco.def index 603d5f2261..16be632020 100644 --- a/ecf/defs/evs-nco.def +++ b/ecf/defs/evs-nco.def @@ -22,6 +22,10 @@ suite evs_nco edit PROJ 'VERF' family prep edit ECF_FILES '%PACKAGEHOME%/ecf/scripts/prep' + family aigefs + task jevs_prep_aigefs_atmos + trigger :TIME >= 0300 and :TIME < 0900 + endfamily family global_ens task jevs_prep_global_ens_atmos trigger :TIME >= 0300 and :TIME < 0900 diff --git a/ecf/scripts/prep/aigefs/jevs_prep_aigefs_atmos.ecf b/ecf/scripts/prep/aigefs/jevs_prep_aigefs_atmos.ecf new file mode 100644 index 0000000000..858011e81c --- /dev/null +++ b/ecf/scripts/prep/aigefs/jevs_prep_aigefs_atmos.ecf @@ -0,0 +1,65 @@ +#PBS -N evs_prep_aigefs_atmos +#PBS -j oe +#PBS -S /bin/bash +#PBS -q %QUEUE% +#PBS -A %PROJ%-%PROJENVIR% +#PBS -l walltime=01:30:00 +#PBS -l place=vscatter,select=2:ncpus=48:mem=400GB:prepost=true +#PBS -l debug=true + +export model=evs +%include +%include + +############################################################ +# Load modules +############################################################ +set -x +export STEP=prep +export COMPONENT=aigefs + +module load PrgEnv-intel/${PrgEnvintel_ver} +module load intel/${intel_ver} +module load ve/evs/${ve_evs_ver} +module load gsl/${gsl_ver} +module load libjpeg/${libjpeg_ver} +module load libpng/${libpng_ver} +module load zlib/${zlib_ver} +module load jasper/${jasper_ver} +module load udunits/${udunits_ver} +module load grib_util/${grib_util_ver} +module load wgrib2/${wgrib2_ver} +module load cray-pals/${craypals_ver} +module load cfp/${cfp_ver} +module load cdo/${cdo_ver} +module load met/${met_ver} +module load metplus/${metplus_ver} +module load bufr/${bufr_ver} +module list + +############################################################ +# Specify environment variables +############################################################ +if [ -n "%VHR:%" ]; then + export vhr=${vhr:-%VHR:%} +else + export vhr=00 +fi +export OMP_NUM_THREADS=1 +export NET=evs +export RUN=atmos +export MODELNAME=aigefs + +############################################################ +# Execute j-job +############################################################ +${HOMEevs}/jobs/JEVS_PREP_AIGEFS +if [ $? -ne 0 ]; then + ecflow_client --msg="***JOB ${ECF_NAME} ERROR RUNNING J-SCRIPT ***" + ecflow_client --abort + exit +fi + +%include +%manual +%end diff --git a/jobs/JEVS_PREP_AIGEFS b/jobs/JEVS_PREP_AIGEFS new file mode 100755 index 0000000000..3e8fb1550b --- /dev/null +++ b/jobs/JEVS_PREP_AIGEFS @@ -0,0 +1,109 @@ +#!/bin/bash +# JOB card created for aigefs prep jobs +# Updated by L. Gwen Chen (lichuan.chen@noaa.gov), 10/03/2025 + +######################################## +# Preliminary data setup step +######################################## +set -x + +#################################### +# SET SHELL PROCESSING VARIABLES +#################################### +export PS4='$SECONDS + ' +date + +########################################################### +# obtain unique LSF id (jobid) and make temp directories +########################################################### +export pid=$$ +export DATA=${DATA:-${DATAROOT:?}/${jobid:?}} +mkdir -p $DATA +cd $DATA + +#################################### +# Define NET/RUN variables +#################################### +export NET=${NET:-evs} +export STEP=${STEP:-prep} +export COMPONENT=${COMPONENT:-aigefs} +export RUN=${RUN:-atmos} +export MODELNAME=${MODELNAME:-aigefs} +export MODNAM=echo $MODELNAME | tr '[a-z]' '[A-Z]' +export OBTYPE=${OBTYPE:-GDAS} + +#################################### +# Set EVS directories +#################################### +export HOMEevs=${HOMEevs:-${PACKAGEROOT}/${NET}.${evs_ver}} +export EXECevs=${EXECevs:-${HOMEevs}/exec} +export PARMevs=${PARMevs:-${HOMEevs}/parm} +export SCRIPTSevs=${SCRIPTSevs:-${HOMEevs}/scripts} +export USHevs=${USHevs:-${HOMEevs}/ush} +export FIXevs=${FIXevs:-${HOMEevs}/fix} + +########################################## +# Run setpdy and initialize PDY variables +########################################## +export vhr=${vhr:-00} +export cycle=${cycle:-t${vhr}z} +setpdy.sh 20 +. ./PDY + +export INITDATE=${INITDATE:-${PDYm2}} + +################################################## +### SENDCOM - Copy Files From TMPDIR to $COMOUT +### SENDDBN - Issue DBNet Client Calls +### SENDECF - Flag Events on ecFLOW +### SENDMAIL - Send email if file is missing +################################################## +export SENDCOM=${SENDCOM:-YES} +export SENDDBN=${SENDDBN:-YES} +export SENDECF=${SENDECF:-YES} +export SENDMAIL=${SENDMAIL:-NO} + +#################################### +# Define COMIN/COMOUT variables +#################################### +export COMIN=${COMIN:-$(compath.py ${envir}/com/${NET}/${evs_ver})} +export COMINgfs=${COMINgfs:-$(compath.py $envir/com/gfs/${gfs_ver})} +export COMINgefs=${COMINgefs:-$(compath.py ${envir}/com/gefs/${gefs_ver})} +export COMINaigefs=${COMINaigefs:-$(compath.py ${envir}/com/aigefs/${aigefs_ver})} +export COMINhgefs=${COMINhgefs:-$(compath.py ${envir}/com/hgefs/${hgefs_ver})} +export DCOMIN=${DCOMIN:-${DCOMROOT}} +export COMINccpa=${COMINccpa:-$(compath.py $envir/com/ccpa/${ccpa_ver})} +export COMINobsproc=${COMINobsproc:-$(compath.py $envir/com/obsproc/${obsproc_ver})} +export DCOMINnohrsc=${DCOMINnohrsc:-$DCOMROOT} +export DCOMINosi_saf=${DCOMINosi_saf:-$DCOMROOT} +export DCOMINghrsst=${DCOMINghrsst:-$DCOMROOT} + +export EVSINgefs=${COMIN}/${STEP}/${COMPONENT}/atmos.${INITDATE}/gefs +export EVSINaigefs=${COMIN}/${STEP}/${COMPONENT}/atmos.${INITDATE}/aigefs +export EVSINhgefs=${COMIN}/${STEP}/${COMPONENT}/atmos.${INITDATE}/hgefs + +export COMOUT=${COMOUT:-$(compath.py -o $NET/${evs_ver})}/$STEP/${COMPONENT} +mkdir -p $COMOUT + +export COMOUTgefs=${COMOUTgefs:-${COMOUT}/${RUN}.${INITDATE}/gefs} +export COMOUTaigefs=${COMOUTaigefs:-${COMOUT}/${RUN}.${INITDATE}/aigefs} +export COMOUThgefs=${COMOUThgefs:-${COMOUT}/${RUN}.${INITDATE}/hgefs} +export COMOUTcompleted=${COMOUTcompleted:-${COMOUT}/${RUN}.${INITDATE}/completed} + +if [ "${RUN}" == "atmos" ]; then + mkdir -p $COMOUTgefs $COMOUTaigefs $COMOUThgefs $COMOUTcompleted +fi + +#################################### +# Execute the script +#################################### +$HOMEevs/scripts/${STEP}/${COMPONENT}/exevs_${STEP}_${COMPONENT}_${RUN}.sh +export err=$?; err_chk + +if [ "${KEEPDATA}" != "YES" ]; then + cd ${DATAROOT} + rm -rf ${DATA} +fi + +date + diff --git a/parm/metplus_config/prep/aigefs/atmos_grid2grid/PcpCombine_fcstAIGEFS_APCP24h.conf b/parm/metplus_config/prep/aigefs/atmos_grid2grid/PcpCombine_fcstAIGEFS_APCP24h.conf new file mode 100644 index 0000000000..b59bcf34a9 --- /dev/null +++ b/parm/metplus_config/prep/aigefs/atmos_grid2grid/PcpCombine_fcstAIGEFS_APCP24h.conf @@ -0,0 +1,37 @@ +[config] + +LOG_METPLUS = + +OUTPUT_BASE = {ENV[output_base]} + +PROCESS_LIST = PCPCombine + +LOOP_BY = INIT +INIT_TIME_FMT = %Y%m%d%H +INIT_BEG = {ENV[vday]}{ENV[ihour]} +INIT_END = {ENV[vday]}{ENV[ihour]} +INIT_INCREMENT = 1H + +LEAD_SEQ = {ENV[lead]} + +STAT_ANALYSIS_RUNTIME_FREQ = RUN_ONCE_PER_INIT_OR_VALID + +FCST_PCP_COMBINE_CONSTANT_INIT = True +FCST_PCP_COMBINE_RUN = True +FCST_PCP_COMBINE_METHOD = ADD + +FCST_PCP_COMBINE_INPUT_DIR = {ENV[modelpath]} +FCST_PCP_COMBINE_INPUT_TEMPLATE = {ENV[model]}.ens{ENV[mb]}.t{init?fmt=%H}z.grid3.f{lead?fmt=%3H}.grib2 + +FCST_PCP_COMBINE_OUTPUT_DIR = {OUTPUT_BASE} +FCST_PCP_COMBINE_OUTPUT_TEMPLATE = {ENV[model]}.ens{ENV[mb]}.t{init?fmt=%H}z.grid3.24h.f{lead?fmt=%3H}.nc + +FCST_IS_PROB = false + +FCST_PCP_COMBINE_INPUT_DATATYPE = GRIB +FCST_PCP_COMBINE_INPUT_ACCUMS = 6H +FCST_PCP_COMBINE_INPUT_NAMES = APCP +FCST_PCP_COMBINE_INPUT_LEVELS = A06 + +FCST_PCP_COMBINE_OUTPUT_ACCUM = 24H +FCST_PCP_COMBINE_OUTPUT_NAME = diff --git a/parm/metplus_config/prep/aigefs/atmos_grid2grid/PcpCombine_fcstGEFS_APCP24h.conf b/parm/metplus_config/prep/aigefs/atmos_grid2grid/PcpCombine_fcstGEFS_APCP24h.conf new file mode 100644 index 0000000000..b59bcf34a9 --- /dev/null +++ b/parm/metplus_config/prep/aigefs/atmos_grid2grid/PcpCombine_fcstGEFS_APCP24h.conf @@ -0,0 +1,37 @@ +[config] + +LOG_METPLUS = + +OUTPUT_BASE = {ENV[output_base]} + +PROCESS_LIST = PCPCombine + +LOOP_BY = INIT +INIT_TIME_FMT = %Y%m%d%H +INIT_BEG = {ENV[vday]}{ENV[ihour]} +INIT_END = {ENV[vday]}{ENV[ihour]} +INIT_INCREMENT = 1H + +LEAD_SEQ = {ENV[lead]} + +STAT_ANALYSIS_RUNTIME_FREQ = RUN_ONCE_PER_INIT_OR_VALID + +FCST_PCP_COMBINE_CONSTANT_INIT = True +FCST_PCP_COMBINE_RUN = True +FCST_PCP_COMBINE_METHOD = ADD + +FCST_PCP_COMBINE_INPUT_DIR = {ENV[modelpath]} +FCST_PCP_COMBINE_INPUT_TEMPLATE = {ENV[model]}.ens{ENV[mb]}.t{init?fmt=%H}z.grid3.f{lead?fmt=%3H}.grib2 + +FCST_PCP_COMBINE_OUTPUT_DIR = {OUTPUT_BASE} +FCST_PCP_COMBINE_OUTPUT_TEMPLATE = {ENV[model]}.ens{ENV[mb]}.t{init?fmt=%H}z.grid3.24h.f{lead?fmt=%3H}.nc + +FCST_IS_PROB = false + +FCST_PCP_COMBINE_INPUT_DATATYPE = GRIB +FCST_PCP_COMBINE_INPUT_ACCUMS = 6H +FCST_PCP_COMBINE_INPUT_NAMES = APCP +FCST_PCP_COMBINE_INPUT_LEVELS = A06 + +FCST_PCP_COMBINE_OUTPUT_ACCUM = 24H +FCST_PCP_COMBINE_OUTPUT_NAME = diff --git a/parm/metplus_config/prep/aigefs/atmos_grid2grid/PcpCombine_fcstHGEFS_APCP24h.conf b/parm/metplus_config/prep/aigefs/atmos_grid2grid/PcpCombine_fcstHGEFS_APCP24h.conf new file mode 100644 index 0000000000..b59bcf34a9 --- /dev/null +++ b/parm/metplus_config/prep/aigefs/atmos_grid2grid/PcpCombine_fcstHGEFS_APCP24h.conf @@ -0,0 +1,37 @@ +[config] + +LOG_METPLUS = + +OUTPUT_BASE = {ENV[output_base]} + +PROCESS_LIST = PCPCombine + +LOOP_BY = INIT +INIT_TIME_FMT = %Y%m%d%H +INIT_BEG = {ENV[vday]}{ENV[ihour]} +INIT_END = {ENV[vday]}{ENV[ihour]} +INIT_INCREMENT = 1H + +LEAD_SEQ = {ENV[lead]} + +STAT_ANALYSIS_RUNTIME_FREQ = RUN_ONCE_PER_INIT_OR_VALID + +FCST_PCP_COMBINE_CONSTANT_INIT = True +FCST_PCP_COMBINE_RUN = True +FCST_PCP_COMBINE_METHOD = ADD + +FCST_PCP_COMBINE_INPUT_DIR = {ENV[modelpath]} +FCST_PCP_COMBINE_INPUT_TEMPLATE = {ENV[model]}.ens{ENV[mb]}.t{init?fmt=%H}z.grid3.f{lead?fmt=%3H}.grib2 + +FCST_PCP_COMBINE_OUTPUT_DIR = {OUTPUT_BASE} +FCST_PCP_COMBINE_OUTPUT_TEMPLATE = {ENV[model]}.ens{ENV[mb]}.t{init?fmt=%H}z.grid3.24h.f{lead?fmt=%3H}.nc + +FCST_IS_PROB = false + +FCST_PCP_COMBINE_INPUT_DATATYPE = GRIB +FCST_PCP_COMBINE_INPUT_ACCUMS = 6H +FCST_PCP_COMBINE_INPUT_NAMES = APCP +FCST_PCP_COMBINE_INPUT_LEVELS = A06 + +FCST_PCP_COMBINE_OUTPUT_ACCUM = 24H +FCST_PCP_COMBINE_OUTPUT_NAME = diff --git a/parm/metplus_config/prep/aigefs/atmos_grid2grid/PcpCombine_obsCCPA24h.conf b/parm/metplus_config/prep/aigefs/atmos_grid2grid/PcpCombine_obsCCPA24h.conf new file mode 100644 index 0000000000..a821de3b2b --- /dev/null +++ b/parm/metplus_config/prep/aigefs/atmos_grid2grid/PcpCombine_obsCCPA24h.conf @@ -0,0 +1,36 @@ +[config] + +LOG_METPLUS = + +OUTPUT_BASE = {ENV[output_base]} + +PROCESS_LIST = PCPCombine + +LOOP_BY = VALID +VALID_TIME_FMT = %Y%m%d%H +VALID_BEG = {ENV[vday]}12 +VALID_END = {ENV[vday]}12 +VALID_INCREMENT = 6H + +LEAD_SEQ = 24H + +STAT_ANALYSIS_RUNTIME_FREQ = RUN_ONCE_PER_INIT_OR_VALID + +OBS_PCP_COMBINE_RUN = True +OBS_PCP_COMBINE_METHOD = SUM + +OBS_PCP_COMBINE_INPUT_DIR = {ENV[ccpa24]} +OBS_PCP_COMBINE_INPUT_TEMPLATE = ccpa + +OBS_PCP_COMBINE_OUTPUT_DIR = {OUTPUT_BASE} +OBS_PCP_COMBINE_OUTPUT_TEMPLATE = ccpa.t12z.grid3.24h.f00.nc + +OBS_IS_PROB = false + +OBS_PCP_COMBINE_INPUT_DATATYPE = GRIB +OBS_PCP_COMBINE_INPUT_ACCUMS = 6H +OBS_PCP_COMBINE_INPUT_NAMES = +OBS_PCP_COMBINE_INPUT_LEVELS = + +OBS_PCP_COMBINE_OUTPUT_ACCUM = 24H +OBS_PCP_COMBINE_OUTPUT_NAME = diff --git a/parm/metplus_config/stats/aigefs/atmos_grid2obs/Pb2nc_obsGFS_Prepbufr.conf b/parm/metplus_config/stats/aigefs/atmos_grid2obs/Pb2nc_obsGFS_Prepbufr.conf new file mode 100644 index 0000000000..82906b5683 --- /dev/null +++ b/parm/metplus_config/stats/aigefs/atmos_grid2obs/Pb2nc_obsGFS_Prepbufr.conf @@ -0,0 +1,74 @@ +[config] + +LOG_METPLUS = + +OUTPUT_BASE = {ENV[output_base]} + +# List of applications to run - only PB2NC for this case +PROCESS_LIST = PB2NC + +# Time looping - options are INIT, VALID, RETRO, and REALTIME +LOOP_BY = VALID + +# Format of VALID_BEG and VALID_END using % items +VALID_TIME_FMT = %Y%m%d%H + +# Start time for METplus run - must match VALID_TIME_FMT +VALID_BEG = {ENV[vday]}{ENV[vbeg]} + +# End time for METplus run - must match VALID_TIME_FMT +VALID_END = {ENV[vday]}{ENV[vbeg]} + +# Increment between METplus runs (in seconds if no units are specified) +# Must be >= 60 seconds +VALID_INCREMENT = 1M + +LEAD_SEQ = 0 + +# Order of loops to process data - Options are times, processes +# Not relevant if only one item is in the PROCESS_LIST +# times = run all wrappers in the PROCESS_LIST for a single run time, then +# increment the run time and run all wrappers again until all times have +# been evaluated. +# processes = run the first wrapper in the PROCESS_LIST for all times +# specified, then repeat for the next item in the PROCESS_LIST until all +# wrappers have been run +LOOP_ORDER = processes + +# Location of MET config file to pass to PB2NC +# References CONFIG_DIR from the [dir] section +PB2NC_CONFIG_FILE = {METPLUS_BASE}/parm/met_config/PB2NCConfig_wrapped + +# If set to True, skip run if the output file determined by the output directory and +# filename template already exists +PB2NC_SKIP_IF_OUTPUT_EXISTS = True + +# Time relative to each input file's valid time (in seconds if no units are specified) +# for data within the file to be considered valid. Values are set in the 'obs_window' +# dictionary in the PB2NC config file +PB2NC_WINDOW_BEGIN = -1800 +PB2NC_WINDOW_END = 1800 + +PB2NC_GRID = G003 +PB2NC_POLY = +PB2NC_STATION_ID = +PB2NC_MESSAGE_TYPE = ADPUPA, ADPSFC, SFCSHP + +PB2NC_LEVEL_RANGE_BEG = -1000 +PB2NC_LEVEL_RANGE_END = 100000 + +PB2NC_QUALITY_MARK_THRESH = 9 + +PB2NC_OBS_BUFR_VAR_LIST = UOB, VOB, TOB, TDO, D_CAPE, D_RH, HOVI, TOCC, CEILING, PMO +PB2NC_OBS_BUFR_MAP = { key = "TOB"; val = "TMP"; }, { key = "UOB"; val = "UGRD"; }, { key = "VOB"; val = "VGRD"; }, { key = "D_RH"; val = "RH"; }, { key = "PMO"; val = "PRMSL"; }, { key = "D_CAPE"; val = "CAPE"; }, { key = "TDO"; val = "DPT"; }, { key = "TOCC"; val = "TCDC"; }, { key = "HOVI"; val = "VIS"; }, { key = "CEILING"; val = "HGT"; }; + +[dir] +CONFIG_DIR = {PARM_BASE}/met_config +PB2NC_INPUT_DIR = {ENV[bufrpath]} +PB2NC_OUTPUT_DIR = {OUTPUT_BASE}/prepbufr_nc +METPLUS_CONF = {OUTPUT_BASE}/final_pb2nc_{ENV[vbeg]}.conf + +[filename_templates] +PB2NC_INPUT_TEMPLATE = prepbufr.{da_init?fmt=%Y%m%d}/gdas.t{da_init?fmt=%H}z.prepbufr +PB2NC_OUTPUT_TEMPLATE = gfs.t{da_init?fmt=%H}z.prepbufr.f00.nc + diff --git a/parm/metplus_config/stats/aigefs/atmos_grid2obs/Pb2nc_obsGFS_Prepbufr_Profile.conf b/parm/metplus_config/stats/aigefs/atmos_grid2obs/Pb2nc_obsGFS_Prepbufr_Profile.conf new file mode 100644 index 0000000000..0c64283aeb --- /dev/null +++ b/parm/metplus_config/stats/aigefs/atmos_grid2obs/Pb2nc_obsGFS_Prepbufr_Profile.conf @@ -0,0 +1,74 @@ +[config] + +LOG_METPLUS = + +OUTPUT_BASE = {ENV[output_base]} + +# List of applications to run - only PB2NC for this case +PROCESS_LIST = PB2NC + +# Time looping - options are INIT, VALID, RETRO, and REALTIME +LOOP_BY = VALID + +# Format of VALID_BEG and VALID_END using % items +VALID_TIME_FMT = %Y%m%d%H + +# Start time for METplus run - must match VALID_TIME_FMT +VALID_BEG = {ENV[vday]}{ENV[vbeg]} + +# End time for METplus run - must match VALID_TIME_FMT +VALID_END = {ENV[vday]}{ENV[vbeg]} + +# Increment between METplus runs (in seconds if no units are specified) +# Must be >= 60 seconds +VALID_INCREMENT = 1M + +LEAD_SEQ = 0 + +# Order of loops to process data - Options are times, processes +# Not relevant if only one item is in the PROCESS_LIST +# times = run all wrappers in the PROCESS_LIST for a single run time, then +# increment the run time and run all wrappers again until all times have +# been evaluated. +# processes = run the first wrapper in the PROCESS_LIST for all times +# specified, then repeat for the next item in the PROCESS_LIST until all +# wrappers have been run +LOOP_ORDER = processes + +# Location of MET config file to pass to PB2NC +# References CONFIG_DIR from the [dir] section +PB2NC_CONFIG_FILE = {METPLUS_BASE}/parm/met_config/PB2NCConfig_wrapped + +# If set to True, skip run if the output file determined by the output directory and +# filename template already exists +PB2NC_SKIP_IF_OUTPUT_EXISTS = True + +# Time relative to each input file's valid time (in seconds if no units are specified) +# for data within the file to be considered valid. Values are set in the 'obs_window' +# dictionary in the PB2NC config file +PB2NC_WINDOW_BEGIN = -1800 +PB2NC_WINDOW_END = 1800 + +PB2NC_GRID = G003 +PB2NC_POLY = +PB2NC_STATION_ID = +PB2NC_MESSAGE_TYPE = ADPUPA + +PB2NC_LEVEL_RANGE_BEG = -1000 +PB2NC_LEVEL_RANGE_END = 100000 + +PB2NC_QUALITY_MARK_THRESH = 9 + +PB2NC_OBS_BUFR_VAR_LIST = ZOB, TOB, UOB, VOB, D_RH +PB2NC_OBS_BUFR_MAP = { key = "ZOB"; val = "HGT"; }, { key = "TOB"; val = "TMP"; }, { key = "UOB"; val = "UGRD"; }, { key = "VOB"; val = "VGRD"; }, { key = "D_RH"; val = "RH"; } ; + +[dir] +CONFIG_DIR = {PARM_BASE}/met_config +PB2NC_INPUT_DIR = {ENV[bufrpath]} +PB2NC_OUTPUT_DIR = {OUTPUT_BASE}/prepbufr_nc +METPLUS_CONF = {OUTPUT_BASE}/final_pb2nc_{ENV[vbeg]}.conf + +[filename_templates] +PB2NC_INPUT_TEMPLATE = prepbufr.{da_init?fmt=%Y%m%d}/gdas.t{da_init?fmt=%H}z.prepbufr +PB2NC_OUTPUT_TEMPLATE = gfs.t{da_init?fmt=%H}z.prepbufr_profile.f00.nc + diff --git a/scripts/prep/aigefs/exevs_prep_aigefs_atmos.sh b/scripts/prep/aigefs/exevs_prep_aigefs_atmos.sh new file mode 100755 index 0000000000..87eba00b4a --- /dev/null +++ b/scripts/prep/aigefs/exevs_prep_aigefs_atmos.sh @@ -0,0 +1,220 @@ +#!/bin/ksh +#************************************************************************************* +# Purposes: 1. Set up required environment parameters +# 2. Run exevs_prep_aigefs_atmos job +# +# Notes: this job will: +# 1. Retrive/regrid analysis/observational data (1x1 degree). +# 2. Retrive required fields from AIGEFS and large operational GEFS +# member files to form smaller member files. +# 3. Regrid the smaller files to required grid (1x1 degree). +# 5. Store the well-formed analysis/observation files and smaller ensemble +# member files in the evs prep sub-directory prep/aigefs/atmos.YYYYMMDD. +# +# Updated: 10/03/2025 by L. Gwen Chen (lichuan.chen@noaa.gov) +#************************************************************************************* + +set -x + +export WORK=$DATA + +cd $WORK + +#*********************************************************************** +# Following parameters are for setting which get_data sub-tasks +# should be run +# Notes: 1. The big aigefs_atmos_prep job can be splitted to +# smaller jobs by re-setting these get_data parameters. +# Current setting is for running one big prep job. +# 2. Specific get_data task(s) can be tested by setting all other +# get_data parameters to "no". +#*********************************************************************** +export get_anl=${get_anl:-'yes'} +export get_prepbufr=${get_prepbufr:-'yes'} +export get_ccpa=${get_ccpa:-'yes'} +export get_gefs=${get_gefs:-'yes'} +export get_aigefs=${get_aigefs:-'yes'} +export get_gefs_apcp06h=${get_gefs_apcp06h:-'no'} +export get_aigefs_apcp06h=${get_aigefs_apcp06h:-'no'} +export get_gefs_apcp24h=${get_gefs_apcp24h:-'yes'} +export get_aigefs_apcp24h=${get_aigefs_apcp24h:-'yes'} +export get_gefs_snow24h=${get_gefs_snow24h:-'no'} +export get_aigefs_snow24h=${get_aigefs_snow24h:-'no'} +export get_nohrsc24h=${get_nohrsc24h:-'no'} +export get_gefs_icec=${get_gefs_icec:-'no'} +export get_gefs_icec24h=${get_gefs_icec24h:-'no'} +export get_gfs=${get_gfs:-'no'} +export get_osi_saf=${get_osi_saf:-'no'} +export get_forecast=${get_forecast:-'yes'} +export get_ghrsst=${get_ghrsst:-'no'} +export get_gefs_sst24h=${get_gefs_sst24h:-'no'} + +export vday=$INITDATE + +#************************************ +# run_mpi=yes is for MPI parallel run +# otherwise run in sequence +#************************************ +export run_mpi=${run_mpi:-'yes'} + +export CLIMO=$FIXevs/climos/atmos +export MASKS=$FIXevs/mask + +export GRID2GRID_CONF=$PARMevs/metplus_config/stats/${COMPONENT}/${RUN}_grid2grid +export GRID2OBS_CONF=$PARMevs/metplus_config/stats/${COMPONENT}/${RUN}_grid2obs +export ENS_LIST=$PARMevs/metplus_config/prep/${COMPONENT}/atmos_grid2grid +export CONF_PREP=$PARMevs/metplus_config/prep/${COMPONENT}/atmos_grid2grid + +# Check if all prep sub-tasks are completed in the previous runs +if [ ! -s $COMOUTcompleted/prep_completed ] ; then +mkdir -p $WORK/completed + +if [ $get_gfs = yes ] ; then + # Check for restart: if this task has been completed in the previous run, then skip it + if [ ! -e $COMOUTcompleted/get_gfs_data.completed ] ; then + $USHevs/${COMPONENT}/evs_get_gens_${RUN}_data.sh gfs + export err=$?; err_chk + + # Indicate this task is completed for restart + >$WORK/completed/get_gfs_data.completed + echo "get_gfs_data task is completed" >> $WORK/completed/get_gfs_data.completed + if [ $SENDCOM="YES" ] ; then + cp -f $WORK/completed/get_gfs_data.completed $COMOUTcompleted + fi + fi +fi + +if [ $get_anl = yes ] ; then + # Check for restart: if this task has been completed in the previous run, then skip it + if [ ! -e $COMOUTcompleted/get_anl_data.completed ] ; then + $USHevs/${COMPONENT}/evs_get_gens_${RUN}_data.sh gfsanl + export err=$?; err_chk + + # Indicate this task is completed for restart + >$WORK/completed/get_anl_data.completed + echo "get_anl_data task is completed" >> $WORK/completed/get_anl_data.completed + if [ $SENDCOM="YES" ] ; then + cp -f $WORK/completed/get_anl_data.completed $COMOUTcompleted + fi + fi +fi + +if [ $get_prepbufr = yes ] ; then + # Check for restart: if this task has been completed in the previous run, then skip it + if [ ! -e $COMOUTcompleted/get_prepbufr_data.completed ] ; then + $USHevs/${COMPONENT}/evs_get_gens_${RUN}_data.sh prepbufr + export err=$?; err_chk + + # Indicate this task is completed for restart + >$WORK/completed/get_prepbufr_data.completed + echo "get_prepbufr_data task is completed" >> $WORK/completed/get_prepbufr_data.completed + if [ $SENDCOM="YES" ] ; then + cp -f $WORK/completed/get_prepbufr_data.completed $COMOUTcompleted + fi + fi +fi + +if [ $get_ccpa = yes ] ; then + # Check for restart: if this task has been completed in the previous run, then skip it + if [ ! -e $COMOUTcompleted/get_ccpa_data.completed ] ; then + $USHevs/${COMPONENT}/evs_get_gens_${RUN}_data.sh ccpa + export err=$?; err_chk + + # Indicate this task is completed for restart + >$WORK/completed/get_ccpa_data.completed + echo "get_ccpa_data task is completed" >> $WORK/completed/get_ccpa_data.completed + if [ $SENDCOM="YES" ] ; then + cp -f $WORK/completed/get_ccpa_data.completed $COMOUTcompleted + fi + fi +fi + +if [ $get_nohrsc24h = yes ] ; then + # Check for restart: if this task has been completed in the previous run, then skip it + if [ ! -e $COMOUTcompleted/get_nohrsc24h_data.completed ] ; then + $USHevs/${COMPONENT}/evs_get_gens_${RUN}_data.sh nohrsc24h + export err=$?; err_chk + + # Indicate this task is completed for restart + >$WORK/completed/get_nohrsc24h_data.completed + echo "get_nohrsc24h_data task is completed" >> $WORK/completed/get_nohrsc24h_data.completed + if [ $SENDCOM="YES" ] ; then + cp -f $WORK/completed/get_nohrsc24h_data.completed $COMOUTcompleted + fi + fi +fi + +if [ $get_ghrsst = yes ] ; then + # Check for restart: if this task has been completed in the previous run, then skip it + if [ ! -e $COMOUTcompleted/get_ghrsst_data.completed ] ; then + export vdaym1=$($NDATE -24 ${INITDATE}00 | cut -c1-8) + mkdir -p $WORK/get_ghrsst + if [ -s $DCOMINghrsst/$vdaym1/validation_data/marine/ghrsst/${vdaym1}_OSPO_L4_GHRSST.nc ] ; then + python $USHevs/${COMPONENT}/global_ens_prep_ghrsst_obs.py + export err=$?; err_chk + else + echo "WARNING: $DCOMINghrsst/$vdaym1/validation_data/marine/ghrsst/${vdaym1}_OSPO_L4_GHRSST.nc is not available" + if [ $SENDMAIL = YES ]; then + export subject="GHRSST OSPO Data Missing for EVS ${COMPONENT}" + export MAILTO=${MAILTO:-'alicia.bentley@noaa.gov,lichuan.chen@noaa.gov'} + echo "Warning: No GHRSST OSPO data was available for valid date ${vday}" > mailmsg + echo Missing file is $DCOMINghrsst/$vdaym1/validation_data/marine/ghrsst/${vdaym1}_OSPO_L4_GHRSST.nc >> mailmsg + echo "Job ID: $jobid" >> mailmsg + cat mailmsg | mail -s "$subject" $MAILTO + fi + fi + + # Indicate this task is completed for restart + >$WORK/completed/get_ghrsst_data.completed + echo "get_ghrsst_data task is completed" >> $WORK/completed/get_ghrsst_data.completed + if [ $SENDCOM="YES" ] ; then + cp -f $WORK/completed/get_ghrsst_data.completed $COMOUTcompleted + fi + fi +fi + +if [ $get_osi_saf = yes ] ; then + # Check for restart: if this task has been completed in the previous run, then skip it + if [ ! -e $COMOUTcompleted/get_osi_saf_data.completed ] ; then + export OBSNAME="osi_saf" + $USHevs/${COMPONENT}/evs_get_gens_${RUN}_data.sh osi_saf + export err=$?; err_chk + + # Indicate this task is completed for restart + >$WORK/completed/get_osi_saf_data.completed + echo "get_osi_saf_data task is completed" >> $WORK/completed/get_osi_saf_data.completed + if [ $SENDCOM="YES" ] ; then + cp -f $WORK/completed/get_osi_saf_data.completed $COMOUTcompleted + fi + fi +fi + +#***************************************************** +# Prep ensemble member data sequentially or run in mpi +# This job will take most of the runtime +#***************************************************** +if [ $get_forecast = yes ] ; then + # Check for restart: if this task has been completed in the previous run, then skip it + if [ ! -e $COMOUTcompleted/get_forecast_data.completed ] ; then + $USHevs/${COMPONENT}/evs_aigefs_${RUN}_prep.sh + export err=$?; err_chk + + # Indicate this task is completed for restart + >$WORK/completed/get_forecast_data.completed + echo "get_forecast_data task is completed" >> $WORK/completed/get_forecast_data.completed + if [ $SENDCOM="YES" ] ; then + cp -f $WORK/completed/get_forecast_data.completed $COMOUTcompleted + fi + fi +fi + +# Indicate all tasks are completed +>$WORK/completed/prep_completed +echo "All prep tasks are completed" >> $WORK/completed/prep_completed + +if [ $SENDCOM = YES ] ; then + cp -f $WORK/completed/prep_completed $COMOUTcompleted +fi + +fi # end of check restart for all tasks + diff --git a/ush/aigefs/evs_aigefs_atmos_prep.sh b/ush/aigefs/evs_aigefs_atmos_prep.sh new file mode 100755 index 0000000000..3ca9b4251a --- /dev/null +++ b/ush/aigefs/evs_aigefs_atmos_prep.sh @@ -0,0 +1,422 @@ +#!/bin/ksh +#************************************************************* +# Purpose: Run aigefs_atmos_prep job +# 1. Build sub-task scripts +# 2. Run the sub-task scripts +# +# Updated: 10/03/2025 by L. Gwen Chen (lichuan.chen@noaa.gov) +#************************************************************* +set -x + +#***************************************************************** +# Check if all prep sub-tasks are completed in the previous runs +if [ ! -s $COMOUTcompleted/prep_subtasks_completed ] ; then +mkdir -p $WORK/completed +#***************************************************************** + +#************************************************************* +# Build 5 poe scripts to collect their sub-tasks, respectively +#************************************************************* +>run_get_all_gens_atmos_poe.sh +>run_get_all_gens_apcp24h_poe.sh +>run_get_all_gens_snow24h_poe.sh +>run_get_all_gens_icec_poe.sh +>run_get_all_gens_sst24h_poe.sh + +for model in gefs aigefs ; do + if [ $model = gefs ] ; then + if [ $get_gefs = yes ] ; then + for ihour in 00 06 12 18 ; do + for fhr_range in range1 range2 range3 range4 range5 range6 range7 range8 range9 range10 range11 range12 range13 range14 range15 range16; do + #******************************************* + # Build sub-task scripts for GEFS atmosphere + #******************************************* + >get_data_${model}_${ihour}_${fhr_range}.sh + if [ $fhr_range = range1 ] ; then + fhr_beg=00 + fhr_end=24 + elif [ $fhr_range = range2 ] ; then + fhr_beg=30 + fhr_end=48 + elif [ $fhr_range = range3 ] ; then + fhr_beg=54 + fhr_end=72 + elif [ $fhr_range = range4 ] ; then + fhr_beg=78 + fhr_end=96 + elif [ $fhr_range = range5 ] ; then + fhr_beg=102 + fhr_end=120 + elif [ $fhr_range = range6 ] ; then + fhr_beg=126 + fhr_end=144 + elif [ $fhr_range = range7 ] ; then + fhr_beg=150 + fhr_end=168 + elif [ $fhr_range = range8 ] ; then + fhr_beg=174 + fhr_end=192 + elif [ $fhr_range = range9 ] ; then + fhr_beg=198 + fhr_end=216 + elif [ $fhr_range = range10 ] ; then + fhr_beg=222 + fhr_end=240 + elif [ $fhr_range = range11 ] ; then + fhr_beg=246 + fhr_end=264 + elif [ $fhr_range = range12 ] ; then + fhr_beg=270 + fhr_end=288 + elif [ $fhr_range = range13 ] ; then + fhr_beg=294 + fhr_end=312 + elif [ $fhr_range = range14 ] ; then + fhr_beg=318 + fhr_end=336 + elif [ $fhr_range = range15 ] ; then + fhr_beg=342 + fhr_end=360 + elif [ $fhr_range = range16 ] ; then + fhr_beg=366 + fhr_end=384 + fi + + # Check for restart: if this task has been completed in the previous run, then skip it + if [ ! -e $COMOUTcompleted/get_data_${model}_${ihour}_${fhr_range}.completed ] ; then + echo "$USHevs/${COMPONENT}/evs_get_gens_${RUN}_data.sh $model $ihour $fhr_beg $fhr_end" >> get_data_${model}_${ihour}_${fhr_range}.sh + + # Indicate this task is completed for restart + echo ">$WORK/completed/get_data_${model}_${ihour}_${fhr_range}.completed" >> get_data_${model}_${ihour}_${fhr_range}.sh + echo "echo "get_data_${model}_${ihour}_${fhr_range} task is completed" >> $WORK/completed/get_data_${model}_${ihour}_${fhr_range}.completed" >> get_data_${model}_${ihour}_${fhr_range}.sh + echo "if [ $SENDCOM = YES ] ; then" >> get_data_${model}_${ihour}_${fhr_range}.sh + echo " cp -f $WORK/completed/get_data_${model}_${ihour}_${fhr_range}.completed $COMOUTcompleted" >> get_data_${model}_${ihour}_${fhr_range}.sh + echo "fi" >> get_data_${model}_${ihour}_${fhr_range}.sh + + chmod +x get_data_${model}_${ihour}_${fhr_range}.sh + echo "${DATA}/get_data_${model}_${ihour}_${fhr_range}.sh" >> run_get_all_gens_atmos_poe.sh + fi + done + done + fi + + if [ $get_gefs_apcp06h = yes ] ; then + for ihour in 00 06 12 18 ; do + #**************************************** + # Build sub-task scripts for GEFS 6h APCP + #**************************************** + >get_data_${model}_${ihour}_apcp06h.sh + # Check for restart: if this task has been completed in the previous run, then skip it + if [ ! -e $COMOUTcompleted/get_data_${model}_${ihour}_apcp06h.completed ] ; then + echo "$USHevs/${COMPONENT}/evs_get_gens_${RUN}_data.sh ${model}_apcp06h $ihour 0 384" >> get_data_${model}_${ihour}_apcp06h.sh + + # Indicate this task is completed for restart + echo ">$WORK/completed/get_data_${model}_${ihour}_apcp06h.completed" >> get_data_${model}_${ihour}_apcp06h.sh + echo "echo "get_data_${model}_${ihour}_apcp06h task is completed" >> $WORK/completed/get_data_${model}_${ihour}_apcp06h.completed" >> get_data_${model}_${ihour}_apcp06h.sh + echo "if [ $SENDCOM = YES ] ; then" >> get_data_${model}_${ihour}_apcp06h.sh + echo " cp -f $WORK/completed/get_data_${model}_${ihour}_apcp06h.completed $COMOUTcompleted" >> get_data_${model}_${ihour}_apcp06h.sh + echo "fi" >> get_data_${model}_${ihour}_apcp06h.sh + + chmod +x get_data_${model}_${ihour}_apcp06h.sh + echo "${DATA}/get_data_${model}_${ihour}_apcp06h.sh" >> run_get_all_gens_atmos_poe.sh + fi + done + fi + + if [ $get_gefs_apcp24h = yes ] ; then + for ihour in 00 12 ; do + #***************************************** + # Build sub-task scripts for GEFS 24h APCP + #***************************************** + >get_data_${model}_${ihour}_apcp24h.sh + # Check for restart: if this task has been completed in the previous run, then skip it + if [ ! -e $COMOUTcompleted/get_data_${model}_${ihour}_apcp24h.completed ] ; then + echo "$USHevs/${COMPONENT}/evs_get_gens_${RUN}_data.sh ${model}_apcp24h $ihour 0 384" >> get_data_${model}_${ihour}_apcp24h.sh + + # Indicate this task is completed for restart + echo ">$WORK/completed/get_data_${model}_${ihour}_apcp24h.completed" >> get_data_${model}_${ihour}_apcp24h.sh + echo "echo "get_data_${model}_${ihour}_apcp24h task is completed" >> $WORK/completed/get_data_${model}_${ihour}_apcp24h.completed" >> get_data_${model}_${ihour}_apcp24h.sh + echo "if [ $SENDCOM = YES ] ; then" >> get_data_${model}_${ihour}_apcp24h.sh + echo " cp -f $WORK/completed/get_data_${model}_${ihour}_apcp24h.completed $COMOUTcompleted" >> get_data_${model}_${ihour}_apcp24h.sh + echo "fi" >> get_data_${model}_${ihour}_apcp24h.sh + + chmod +x get_data_${model}_${ihour}_apcp24h.sh + echo "${DATA}/get_data_${model}_${ihour}_apcp24h.sh" >> run_get_all_gens_apcp24h_poe.sh + fi + done + fi + + if [ $get_gefs_snow24h = yes ] ; then + for ihour in 00 12 ; do + #********************************************* + # Build sub-task scripts for GEFS 24h snowfall + #********************************************* + >get_data_${model}_${ihour}_snow24h.sh + # Check for restart: if this task has been completed in the previous run, then skip it + if [ ! -e $COMOUTcompleted/get_data_${model}_${ihour}_snow24h.completed ] ; then + echo "$USHevs/${COMPONENT}/evs_get_gens_${RUN}_data.sh ${model}_snow24h $ihour 0 384" >> get_data_${model}_${ihour}_snow24h.sh + + # Indicate this task is completed for restart + echo ">$WORK/completed/get_data_${model}_${ihour}_snow24h.completed" >> get_data_${model}_${ihour}_snow24h.sh + echo "echo "get_data_${model}_${ihour}_snow24h task is completed" >> $WORK/completed/get_data_${model}_${ihour}_snow24h.completed" >> get_data_${model}_${ihour}_snow24h.sh + echo "if [ $SENDCOM = YES ] ; then" >> get_data_${model}_${ihour}_snow24h.sh + echo " cp -f $WORK/completed/get_data_${model}_${ihour}_snow24h.completed $COMOUTcompleted" >> get_data_${model}_${ihour}_snow24h.sh + echo "fi" >> get_data_${model}_${ihour}_snow24h.sh + + chmod +x get_data_${model}_${ihour}_snow24h.sh + echo "${DATA}/get_data_${model}_${ihour}_snow24h.sh" >> run_get_all_gens_snow24h_poe.sh + fi + done + fi + + if [ $get_gefs_icec24h = yes ] ; then + #******************************************** + # Build sub-task scripts for GEFS 24h sea ice + #******************************************** + >get_data_${model}_icec.sh + # Check for restart: if this task has been completed in the previous run, then skip it + if [ ! -e $COMOUTcompleted/get_data_${model}_icec.completed ] ; then + echo "$USHevs/${COMPONENT}/evs_get_gens_${RUN}_data.sh gefs_icec24h" >> get_data_${model}_icec.sh + + # Indicate this task is completed for restart + echo ">$WORK/completed/get_data_${model}_icec.completed" >> get_data_${model}_icec.sh + echo "echo "get_data_${model}_icec task is completed" >> $WORK/completed/get_data_${model}_icec.completed" >> get_data_${model}_icec.sh + echo "if [ $SENDCOM = YES ] ; then" >> get_data_${model}_icec.sh + echo " cp -f $WORK/completed/get_data_${model}_icec.completed $COMOUTcompleted" >> get_data_${model}_icec.sh + echo "fi" >> get_data_${model}_icec.sh + + chmod +x get_data_${model}_icec.sh + echo "${DATA}/get_data_${model}_icec.sh" >> run_get_all_gens_icec_poe.sh + fi + fi + + if [ $get_gefs_sst24h = yes ] ; then + #**************************************** + # Build sub-task scripts for GEFS 24h SST + #**************************************** + >get_data_${model}_sst24h.sh + # Check for restart: if this task has been completed in the previous run, then skip it + if [ ! -e $COMOUTcompleted/get_data_${model}_sst24h.completed ] ; then + echo "$USHevs/${COMPONENT}/evs_get_gens_${RUN}_data.sh gefs_sst24h" >> get_data_${model}_sst24h.sh + + # Indicate this task is completed for restart + echo ">$WORK/completed/get_data_${model}_sst24h.completed" >> get_data_${model}_sst24h.sh + echo "echo "get_data_${model}_sst24h task is completed" >> $WORK/completed/get_data_${model}_sst24h.completed" >> get_data_${model}_sst24h.sh + echo "if [ $SENDCOM = YES ] ; then" >> get_data_${model}_sst24h.sh + echo " cp -f $WORK/completed/get_data_${model}_sst24h.completed $COMOUTcompleted" >> get_data_${model}_sst24h.sh + echo "fi" >> get_data_${model}_sst24h.sh + + chmod +x get_data_${model}_sst24h.sh + echo "${DATA}/get_data_${model}_sst24h.sh" >> run_get_all_gens_sst24h_poe.sh + fi + fi + + elif [ $model = aigefs ] ; then + if [ $get_aigefs = yes ] ; then + for ihour in 00 06 12 18 ; do + for fhr_range in range1 range2 range3 range4 range5 range6 range7 range8 ; do + #******************************************* + # Build sub-task scripts for AIGEFS atmosphere + #******************************************* + >get_data_${model}_${ihour}_${fhr_range}.sh + if [ $fhr_range = range1 ] ; then + fhr_beg=00 + fhr_end=48 + elif [ $fhr_range = range2 ] ; then + fhr_beg=54 + fhr_end=96 + elif [ $fhr_range = range3 ] ; then + fhr_beg=102 + fhr_end=144 + elif [ $fhr_range = range4 ] ; then + fhr_beg=150 + fhr_end=192 + elif [ $fhr_range = range5 ] ; then + fhr_beg=198 + fhr_end=240 + elif [ $fhr_range = range6 ] ; then + fhr_beg=246 + fhr_end=288 + elif [ $fhr_range = range7 ] ; then + fhr_beg=294 + fhr_end=336 + elif [ $fhr_range = range8 ] ; then + fhr_beg=342 + fhr_end=384 + fi + + # Check for restart: if this task has been completed in the previous run, then skip it + if [ ! -e $COMOUTcompleted/get_data_${model}_${ihour}_${fhr_range}.completed ] ; then + echo "$USHevs/${COMPONENT}/evs_get_gens_${RUN}_data.sh $model $ihour $fhr_beg $fhr_end" >> get_data_${model}_${ihour}_${fhr_range}.sh + + # Indicate this task is completed for restart + echo ">$WORK/completed/get_data_${model}_${ihour}_${fhr_range}.completed" >> get_data_${model}_${ihour}_${fhr_range}.sh + echo "echo "get_data_${model}_${ihour}_${fhr_range} task is completed" >> $WORK/completed/get_data_${model}_${ihour}_${fhr_range}.completed" >> get_data_${model}_${ihour}_${fhr_range}.sh + echo "if [ $SENDCOM = YES ] ; then" >> get_data_${model}_${ihour}_${fhr_range}.sh + echo " cp -f $WORK/completed/get_data_${model}_${ihour}_${fhr_range}.completed $COMOUTcompleted" >> get_data_${model}_${ihour}_${fhr_range}.sh + echo "fi" >> get_data_${model}_${ihour}_${fhr_range}.sh + + chmod +x get_data_${model}_${ihour}_${fhr_range}.sh + echo "${DATA}/get_data_${model}_${ihour}_${fhr_range}.sh" >> run_get_all_gens_atmos_poe.sh + fi + done + done + fi + + if [ $get_aigefs_apcp06h = yes ] ; then + for ihour in 00 12 ; do + #**************************************** + # Build sub-task scripts for CMCE 6h APCP + #**************************************** + >get_data_${model}_${ihour}_apcp06h.sh + # Check for restart: if this task has been completed in the previous run, then skip it + if [ ! -e $COMOUTcompleted/get_data_${model}_${ihour}_apcp06h.completed ] ; then + echo "$USHevs/${COMPONENT}/evs_get_gens_${RUN}_data.sh ${model}_apcp06h $ihour 0 384" >> get_data_${model}_${ihour}_apcp06h.sh + + # Indicate this task is completed for restart + echo ">$WORK/completed/get_data_${model}_${ihour}_apcp06h.completed" >> get_data_${model}_${ihour}_apcp06h.sh + echo "echo "get_data_${model}_${ihour}_apcp06h task is completed" >> $WORK/completed/get_data_${model}_${ihour}_apcp06h.completed" >> get_data_${model}_${ihour}_apcp06h.sh + echo "if [ $SENDCOM = YES ] ; then" >> get_data_${model}_${ihour}_apcp06h.sh + echo " cp -f $WORK/completed/get_data_${model}_${ihour}_apcp06h.completed $COMOUTcompleted" >> get_data_${model}_${ihour}_apcp06h.sh + echo "fi" >> get_data_${model}_${ihour}_apcp06h.sh + + chmod +x get_data_${model}_${ihour}_apcp06h.sh + echo "${DATA}/get_data_${model}_${ihour}_apcp06h.sh" >> run_get_all_gens_atmos_poe.sh + fi + done + fi + + if [ $get_aigefs_apcp24h = yes ] ; then + for ihour in 00 12 ; do + #**************************************** + # Build sub-task scripts for CMCE 24h APCP + #**************************************** + >get_data_${model}_${ihour}_apcp24h.sh + # Check for restart: if this task has been completed in the previous run, then skip it + if [ ! -e $COMOUTcompleted/get_data_${model}_${ihour}_apcp24h.completed ] ; then + echo "$USHevs/${COMPONENT}/evs_get_gens_${RUN}_data.sh ${model}_apcp24h $ihour 0 384" >> get_data_${model}_${ihour}_apcp24h.sh + + # Indicate this task is completed for restart + echo ">$WORK/completed/get_data_${model}_${ihour}_apcp24h.completed" >> get_data_${model}_${ihour}_apcp24h.sh + echo "echo "get_data_${model}_${ihour}_apcp24h task is completed" >> $WORK/completed/get_data_${model}_${ihour}_apcp24h.completed" >> get_data_${model}_${ihour}_apcp24h.sh + echo "if [ $SENDCOM = YES ] ; then" >> get_data_${model}_${ihour}_apcp24h.sh + echo " cp -f $WORK/completed/get_data_${model}_${ihour}_apcp24h.completed $COMOUTcompleted" >> get_data_${model}_${ihour}_apcp24h.sh + echo "fi" >> get_data_${model}_${ihour}_apcp24h.sh + + chmod +x get_data_${model}_${ihour}_apcp24h.sh + echo "${DATA}/get_data_${model}_${ihour}_apcp24h.sh" >> run_get_all_gens_apcp24h_poe.sh + fi + done + fi + + if [ $get_aigefs_snow24h = yes ] ; then + for ihour in 00 12 ; do + #********************************************* + # Build sub-task scripts for CMCE 24h snowfall + #********************************************* + >get_data_${model}_${ihour}_snow24h.sh + # Check for restart: if this task has been completed in the previous run, then skip it + if [ ! -e $COMOUTcompleted/get_data_${model}_${ihour}_snow24h.completed ] ; then + echo "$USHevs/${COMPONENT}/evs_get_gens_${RUN}_data.sh ${model}_snow24h $ihour 0 384" >> get_data_${model}_${ihour}_snow24h.sh + + # Indicate this task is completed for restart + echo ">$WORK/completed/get_data_${model}_${ihour}_snow24h.completed" >> get_data_${model}_${ihour}_snow24h.sh + echo "echo "get_data_${model}_${ihour}_snow24h task is completed" >> $WORK/completed/get_data_${model}_${ihour}_snow24h.completed" >> get_data_${model}_${ihour}_snow24h.sh + echo "if [ $SENDCOM = YES ] ; then" >> get_data_${model}_${ihour}_snow24h.sh + echo " cp -f $WORK/completed/get_data_${model}_${ihour}_snow24h.completed $COMOUTcompleted" >> get_data_${model}_${ihour}_snow24h.sh + echo "fi" >> get_data_${model}_${ihour}_snow24h.sh + + chmod +x get_data_${model}_${ihour}_snow24h.sh + echo "${DATA}/get_data_${model}_${ihour}_snow24h.sh" >> run_get_all_gens_snow24h_poe.sh + fi + done + fi + + else + echo "WARNING: wrong model: $model" + fi + +done # end of model loop + + +#************************************************* +# Run 5 poe scripts in MPI parallel or in sequence +#************************************************* +if [ $run_mpi = yes ] ; then + + if [ -s run_get_all_gens_atmos_poe.sh ] ; then + chmod +x run_get_all_gens_atmos_poe.sh + mpiexec -n 96 -ppn 48 --cpu-bind verbose,core cfp ${DATA}/run_get_all_gens_atmos_poe.sh + export err=$?; err_chk + fi + + #************************************************************************************* + # After the above poe scripts are finished, following non-mpi parallel jobs can be run + #************************************************************************************* + if [ -s run_get_all_gens_apcp24h_poe.sh ] ; then + chmod +x run_get_all_gens_apcp24h_poe.sh + ${DATA}/run_get_all_gens_apcp24h_poe.sh + export err=$?; err_chk + fi + + if [ -s run_get_all_gens_snow24h_poe.sh ] ; then + chmod +x run_get_all_gens_snow24h_poe.sh + ${DATA}/run_get_all_gens_snow24h_poe.sh + export err=$?; err_chk + fi + + if [ -s run_get_all_gens_icec_poe.sh ] ; then + chmod +x run_get_all_gens_icec_poe.sh + ${DATA}/run_get_all_gens_icec_poe.sh + export err=$?; err_chk + fi + + if [ -s run_get_all_gens_sst24h_poe.sh ] ; then + chmod +x run_get_all_gens_sst24h_poe.sh + ${DATA}/run_get_all_gens_sst24h_poe.sh + export err=$?; err_chk + fi + +else + + if [ -s run_get_all_gens_atmos_poe.sh ] ; then + chmod +x run_get_all_gens_atmos_poe.sh + ${DATA}/run_get_all_gens_atmos_poe.sh + export err=$?; err_chk + fi + + if [ -s run_get_all_gens_apcp24h_poe.sh ] ; then + chmod +x run_get_all_gens_apcp24h_poe.sh + ${DATA}/run_get_all_gens_apcp24h_poe.sh + export err=$?; err_chk + fi + + if [ -s run_get_all_gens_snow24h_poe.sh ] ; then + chmod +x run_get_all_gens_snow24h_poe.sh + ${DATA}/run_get_all_gens_snow24h_poe.sh + export err=$?; err_chk + fi + + if [ -s run_get_all_gens_icec_poe.sh ] ; then + chmod +x run_get_all_gens_icec_poe.sh + ${DATA}/run_get_all_gens_icec_poe.sh + export err=$?; err_chk + fi + + if [ -s run_get_all_gens_sst24h_poe.sh ] ; then + chmod +x run_get_all_gens_sst24h_poe.sh + ${DATA}/run_get_all_gens_sst24h_poe.sh + export err=$?; err_chk + fi + +fi + +# Indicate all sub-tasks are completed +>$WORK/completed/prep_subtasks_completed +echo "All prep sub-tasks are completed" >> $WORK/completed/prep_subtasks_completed + +if [ $SENDCOM = YES ] ; then + cp -f $WORK/completed/prep_subtasks_completed $COMOUTcompleted +fi + +fi # end of check restart for all sub-tasks diff --git a/ush/aigefs/evs_get_gens_atmos_data.sh b/ush/aigefs/evs_get_gens_atmos_data.sh new file mode 100755 index 0000000000..b6a483cc62 --- /dev/null +++ b/ush/aigefs/evs_get_gens_atmos_data.sh @@ -0,0 +1,850 @@ +#!/bin/ksh +####################################################################################### +# Purposes: +# 1. Retrive/regrid analysis/observations (to 1 degree and to 1.5 degree for WMO) +# 2. Retrive required fields from AIGEFS and large operational GEFS member +# files to form smaller member files +# 3. Regrid the smaller files to required grid (1x1 degree). +# 4. Store the well-formed analysis/observations or smaller ensemble member files +# in the evs prep sub-directory /prep/aigefs/atmos.YYYYMMDD +# +# Updated: 10/03/2025 by L. Gwen Chen (lichuan.chen@noaa.gov) +####################################################################################### +set -x + +modnam=$1 +gens_ihour=$2 +fhr_beg=$3 +fhr_end=$4 + +export vday=${INITDATE:-$PDYm2} #for ensemble, use past-2 day as validation day +export vdate=${vdate:-$vday$ihour} + +if [ -z "$gens_ihour" ] ; then + export WORKtask=$WORK/get_${modnam} +else + export WORKtask=$WORK/get_${modnam}_${gens_ihour}z_f${fhr_beg}_to_f${fhr_end} +fi + +mkdir -p $WORKtask +cd $WORKtask + +################################################################################# +# Get GFS analysis grib2 data in GRID#3 (1-degree global) and WMO 1.5 deg for 00Z +# NOTE: There are no U10, V10 in GFS analysis, so use GFS*f000 as an alternative +################################################################################# +if [ $modnam = gfsanl ]; then + for ihour in 00 06 12 18 ; do + if [ ! -s $COMINgfs/gfs.$vday/${ihour}/atmos/gfs.t${ihour}z.pgrb2.1p00.anl ] ; then + echo "WARNING: $COMINgfs/gfs.$vday/${ihour}/atmos/gfs.t${ihour}z.pgrb2.1p00.anl is not available" + if [ $SENDMAIL = YES ]; then + export subject="GFS Analysis Data Missing for EVS ${COMPONENT}" + echo "Warning: No GFS analysis available for ${vday}${ihour}" > mailmsg + echo "Missing file is $COMINgfs/gfs.$vday/${ihour}/atmos/gfs.t${ihour}z.pgrb2.1p00.anl" >> mailmsg + echo "Job ID: $jobid" >> mailmsg + cat mailmsg | mail -s "$subject" $MAILTO + fi + else + cp -v $COMINgfs/gfs.$vday/${ihour}/atmos/gfs.t${ihour}z.pgrb2.1p00.anl $WORKtask/gfsanl.t${ihour}z.grid3.f000.grib2 + fi + if [ ! -s $COMINgfs/gfs.$vday/${ihour}/atmos/gfs.t${ihour}z.pgrb2.1p00.f000 ]; then + echo "WARNING: $COMINgfs/gfs.$vday/${ihour}/atmos/gfs.t${ihour}z.pgrb2.1p00.f000 is not available" + if [ $SENDMAIL = YES ]; then + export subject="GFS F000 Data Missing for EVS ${COMPONENT}" + echo "Warning: No GFS F000 available for ${vday}${ihour}" > mailmsg + echo "Missing file is $COMINgfs/gfs.$vday/${ihour}/atmos/gfs.t${ihour}z.pgrb2.1p00.f000" >> mailmsg + echo "Job ID: $jobid" >> mailmsg + cat mailmsg | mail -s "$subject" $MAILTO + fi + else + GFSf000=$COMINgfs/gfs.$vday/${ihour}/atmos/gfs.t${ihour}z.pgrb2.1p00.f000 + $WGRIB2 $GFSf000 | grep "UGRD:10 m above ground" | $WGRIB2 -i $GFSf000 -grib $WORKtask/U10_f000.${ihour} + cat $WORKtask/U10_f000.${ihour} >> $WORKtask/gfsanl.t${ihour}z.grid3.f000.grib2 + $WGRIB2 $GFSf000 | grep "VGRD:10 m above ground" | $WGRIB2 -i $GFSf000 -grib $WORKtask/V10_f000.${ihour} + cat $WORKtask/V10_f000.${ihour} >> $WORKtask/gfsanl.t${ihour}z.grid3.f000.grib2 + fi + if [ $SENDCOM="YES" ] ; then + if [ -s $WORKtask/gfsanl.t${ihour}z.grid3.f000.grib2 ]; then + cp -v $WORKtask/gfsanl.t${ihour}z.grid3.f000.grib2 $COMOUTgefs/gfsanl.t${ihour}z.grid3.f000.grib2 + fi + fi + done + + if [ -s $COMOUTgefs/gfsanl.t00z.grid3.f000.grib2 ]; then + $WGRIB2 $COMOUTgefs/gfsanl.t00z.grid3.f000.grib2 -set_grib_type same -new_grid_winds earth -new_grid latlon 0:240:1.5 -90:121:1.5 $WORKtask/gfsanl.t00z.deg1.5.f000.grib2 + if [ $SENDCOM="YES" ] ; then + if [ -s $WORKtask/gfsanl.t00z.deg1.5.f000.grib2 ]; then + cp -v $WORKtask/gfsanl.t00z.deg1.5.f000.grib2 $COMOUTgefs/gfsanl.t00z.deg1.5.f000.grib2 + fi + fi + fi +fi + +############################################################ +# Get GEFS member grib2 files in GRID#3 +# Note: for GEFS get data at 4 cycles 00, 06, 12 and 18Z +# specified by $gens_ihour +############################################################ +if [ $modnam = gefs ] ; then + total=30 + + if [ ! -s $WORKtask/gefs.ens30.t${gens_ihour}z.grid3.f${fhr_end}.grib2 ] ; then + tmpDir=$WORKtask/${modnam}.${fhr_beg} + mkdir -p $tmpDir + + # Create a file of patterns to use with grep. This way we only need one grep + pat0=${tmpDir}/pattern0.${modnam}.${gens_ihour}.${fhr_beg} + + # Upper air + if [ -e ${pat0} ]; then rm ${pat0}; fi + >${pat0} + + for level in 10 50 100 200 250 300 400 500 700 850 925 1000 ; do + echo "UGRD:$level mb" >> ${pat0} + echo "VGRD:$level mb" >> ${pat0} + done + echo "HGT:" >> ${pat0} + echo "TMP:" >> ${pat0} + # Surface + echo "UGRD:10 m above ground" >> ${pat0} + echo "VGRD:10 m above ground" >> ${pat0} + echo "APCP:" >> ${pat0} + echo "PRMSL:" >> ${pat0} + + for ihour in $gens_ihour ; do + origin=$COMINgefs/gefs.$vday/$ihour/atmos/pgrb2ap5 + mbr=0 + + while [ $mbr -le $total ] ; do + mb=$mbr + typeset -Z2 mb + nfhrs=$fhr_beg + + while [ $nfhrs -le $fhr_end ] ; do + hhh=$nfhrs + typeset -Z3 hhh + + # Note: control member (gec00) is not used in GEFS verification, + # but used in HGEFS verification. Prep it together to generate + # 24-hr precip file later + if [ $mb = 00 ]; then + gefs=$origin/gec${mb}.t${ihour}z.pgrb2a.0p50.f${hhh} + else + gefs=$origin/gep${mb}.t${ihour}z.pgrb2a.0p50.f${hhh} + fi + + if [ -s $gefs ]; then + grabgefs=${tmpDir}/grabgefs.${ihour}.${mb}.${hhh} + x=${tmpDir}/x.${ihour}.${mb}.${hhh} + $WGRIB2 $gefs | grep --file=${pat0} | $WGRIB2 -i $gefs -grib ${grabgefs} + else + echo "WARNING: $gefs is not available" + if [ $SENDMAIL = YES ]; then + export subject="GEFS Member ${mb} F${hhh} Data Missing for EVS ${COMPONENT}" + echo "Warning: No GEFS Member ${mb} F${hhh} available for ${vday}${ihour}" > mailmsg + echo "Missing file is $gefs" >> mailmsg + echo "Job ID: $jobid" >> mailmsg + cat mailmsg | mail -s "$subject" $MAILTO + fi + fi + + if [ ! -z $grabgefs ]; then + if [ -s $grabgefs ]; then + $WGRIB2 ${grabgefs} -set_grib_type same -new_grid_winds earth -new_grid ncep grid 003 $WORKtask/gefs.ens${mb}.t${ihour}z.grid3.f${hhh}.grib2 + fi + + if [ $SENDCOM="YES" ] ; then + if [ -s $WORKtask/gefs.ens${mb}.t${ihour}z.grid3.f${hhh}.grib2 ]; then + cp -v $WORKtask/gefs.ens${mb}.t${ihour}z.grid3.f${hhh}.grib2 $COMOUTgefs/gefs.ens${mb}.t${ihour}z.grid3.f${hhh}.grib2 + cp -v $WORKtask/gefs.ens${mb}.t${ihour}z.grid3.f${hhh}.grib2 $COMOUThgefs/hgefs.ens${mb}.t${ihour}z.grid3.f${hhh}.grib2 + fi + fi + fi + nfhrs=`expr $nfhrs + 6` + done # forecast hour + + mbr=`expr $mbr + 1` + done # member + done # ihour + +# Clean up temporary directory + rm -r ${tmpDir} + + fi # check if file exists +fi + +############################################################ +# Get AIGEFS member grib2 files in GRID#3 +# Note: for AIGEFS get data at 4 cycles 00, 06, 12 and 18Z +# specified by $gens_ihour +############################################################ +if [ $modnam = aigefs ] ; then + total=30 + + if [ ! -s $WORKtask/aigefs.ens30.t${gens_ihour}z.grid3.f${fhr_end}.grib2 ] ; then + tmpDir=$WORKtask/${modnam}.${fhr_beg} + mkdir -p $tmpDir + + # Create a file of patterns to use with grep. This way we only need one grep + pat0=${tmpDir}/pattern0.${modnam}.${gens_ihour}.${fhr_beg} + pat1=${tmpDir}/pattern1.${modnam}.${gens_ihour}.${fhr_beg} + + # Upper air + if [ -e ${pat0} ]; then rm ${pat0}; fi + >${pat0} + echo "HGT:" >> ${pat0} + echo "TMP:" >> ${pat0} + echo "UGRD:" >> ${pat0} + echo "VGRD:" >> ${pat0} + + # Surface + if [ -e ${pat1} ]; then rm ${pat1}; fi + >${pat1} + echo "PRMSL:" >> ${pat1} + echo "TMP:2 m above ground" >> ${pat1} + echo "UGRD:10 m above ground" >> ${pat1} + echo "VGRD:10 m above ground" >> ${pat1} + echo "APCP:" >> ${pat1} + + for ihour in $gens_ihour ; do + mbr=0 + while [ $mbr -le $total ] ; do + mb2=$mbr + mb3=$mbr + typeset -Z2 mb2 + typeset -Z3 mb3 + origin=$COMINaigefs/aigefs.$vday/$ihour/mem${mb3}/model/atmos/grib2 + nfhrs=$fhr_beg + + while [ $nfhrs -le $fhr_end ] ; do + hhh=$nfhrs + typeset -Z3 hhh + aigefs_pres=$origin/aigefs.t${ihour}z.pres.f${hhh}.grib2 + aigefs_sfc=$origin/aigefs.t${ihour}z.sfc.f${hhh}.grib2 + + if [ -s $aigefs_pres ]; then + grabaigefs=${tmpDir}/grabaigefs.${ihour}.${mb2}.${hhh} + x=${tmpDir}/x.${ihour}.${mb2}.${hhh} + $WGRIB2 $aigefs_pres | grep --file=${pat0} | $WGRIB2 -i $aigefs_pres -grib ${grabaigefs} + else + echo "WARNING: $aigefs_pres is not available" + if [ $SENDMAIL = YES ]; then + export subject="AIGEFS Member ${mb3} F${hhh} Data Missing for EVS ${COMPONENT}" + echo "Warning: No AIGEFS Member ${mb3} F${hhh} available for ${vday}${ihour}" > mailmsg + echo "Missing file is $aigefs_pres" >> mailmsg + echo "Job ID: $jobid" >> mailmsg + cat mailmsg | mail -s "$subject" $MAILTO + fi + fi + + if [ -s $aigefs_sfc ]; then + [[ -z $grabaigefs ]] && grabaigefs=${tmpDir}/grabaigefs.${ihour}.${mb2}.${hhh} + [[ -z $x ]] && x=${tmpDir}/x.${ihour}.${mb2}.${hhh} + $WGRIB2 $aigefs_sfc | grep --file=${pat1} | $WGRIB2 -i $aigefs_sfc -grib ${x} + cat ${x} >> ${grabaigefs} + else + echo "WARNING: $aigefs_sfc is not available" + if [ $SENDMAIL = YES ]; then + export subject="AIGEFS Member ${mb3} F${hhh} Data Missing for EVS ${COMPONENT}" + echo "Warning: No AIGEFS Member ${mb3} F${hhh} available for ${vday}${ihour}" > mailmsg + echo "Missing file is $aigefs_sfc" >> mailmsg + echo "Job ID: $jobid" >> mailmsg + cat mailmsg | mail -s "$subject" $MAILTO + fi + fi + + if [ ! -z $grabaigefs ]; then + if [ -s $grabaigefs ]; then + $WGRIB2 ${grabaigefs} | sed -e 's/:UGRD:/:UGRDa:/' -e 's/:VGRD:/:UGRDb:/' | sort -t: -k3,3 -k5,8 -k4,4 | $WGRIB2 ${grabaigefs} -i -set_grib_type same -new_grid_winds earth -new_grid ncep grid 003 $WORKtask/aigefs.ens${mb2}.t${ihour}z.grid3.f${hhh}.grib2 + fi + if [ $SENDCOM="YES" ] ; then + if [ -s $WORKtask/aigefs.ens${mb2}.t${ihour}z.grid3.f${hhh}.grib2 ]; then + cp -v $WORKtask/aigefs.ens${mb2}.t${ihour}z.grid3.f${hhh}.grib2 $COMOUTaigefs/aigefs.ens${mb2}.t${ihour}z.grid3.f${hhh}.grib2 + + # change member numbers from 00-30 to 31-61 for HGEFS + hmbr=`expr $mbr + 31` + cp -v $WORKtask/aigefs.ens${mb2}.t${ihour}z.grid3.f${hhh}.grib2 $COMOUThgefs/hgefs.ens${hmbr}.t${ihour}z.grid3.f${hhh}.grib2 + fi + fi + fi + nfhrs=`expr $nfhrs + 6` + done # forecast hour + + mbr=`expr $mbr + 1` + done # member + done # ihour + +# Clean up temporary directory + rm -r ${tmpDir} + + fi # check if file exists +fi + +############################################################# +# Run GDAS prepbufr files through PB2NC +############################################################# +if [ $modnam = prepbufr ] ; then + > run_pb2nc.sh + for ihour in 00 06 12 18 ; do + > run_pb2nc.${ihour}.sh + echo "export bufrpath=$WORKtask" >> run_pb2nc.${ihour}.sh + echo "export output_base=$WORKtask/pb2nc" >> run_pb2nc.${ihour}.sh + echo "export vbeg=${ihour}" >> run_pb2nc.${ihour}.sh + echo "export vend=${ihour}" >> run_pb2nc.${ihour}.sh + if [ -s $COMINobsproc/gdas.${vday}/${ihour}/atmos/gdas.t${ihour}z.prepbufr ] ; then + # Split the prepbufr data file by message types to reduce walltime + echo "mkdir -p $WORKtask/prepbufr.${vday}" >> run_pb2nc.${ihour}.sh + echo ">$WORKtask/prepbufr.${vday}/gdas.t${ihour}z.prepbufr" >> run_pb2nc.${ihour}.sh + echo "split_by_subset $COMINobsproc/gdas.${vday}/${ihour}/atmos/gdas.t${ihour}z.prepbufr" >> run_pb2nc.${ihour}.sh + echo "cat $WORKtask/ADPUPA $WORKtask/ADPSFC $WORKtask/SFCSHP >> $WORKtask/prepbufr.${vday}/gdas.t${ihour}z.prepbufr" >> run_pb2nc.${ihour}.sh + echo "${METPLUS_PATH}/ush/run_metplus.py -c ${PARMevs}/metplus_config/machine.conf -c ${GRID2OBS_CONF}/Pb2nc_obsGFS_Prepbufr.conf" >> run_pb2nc.${ihour}.sh + echo "${METPLUS_PATH}/ush/run_metplus.py -c ${PARMevs}/metplus_config/machine.conf -c ${GRID2OBS_CONF}/Pb2nc_obsGFS_Prepbufr_Profile.conf" >> run_pb2nc.${ihour}.sh + else + echo "WARNING: $COMINobsproc/gdas.${vday}/${ihour}/atmos/gdas.t${ihour}z.prepbufr is not available" + if [ $SENDMAIL = YES ]; then + export subject="Prepbufr Data Missing for EVS ${COMPONENT}" + echo "Warning: No prepbufr analysis available for ${vday}${ihour}" > mailmsg + echo "Missing file is $COMINobsproc/gdas.${vday}/${ihour}/atmos/gdas.t${ihour}z.prepbufr" >> mailmsg + echo "Job ID: $jobid" >> mailmsg + cat mailmsg | mail -s "$subject" $MAILTO + fi + fi + chmod +x run_pb2nc.${ihour}.sh + echo "$WORKtask/run_pb2nc.${ihour}.sh" >> run_pb2nc.sh + done + echo "for FILE in $WORKtask/pb2nc/prepbufr_nc/*.nc ; do" >> run_pb2nc.sh + echo " if [ -s \$FILE ]; then" >> run_pb2nc.sh + echo " chmod 640 $WORKtask/pb2nc/prepbufr_nc/*prepbufr*.nc" >> run_pb2nc.sh + echo " chgrp rstprod $WORKtask/pb2nc/prepbufr_nc/*prepbufr*.nc" >> run_pb2nc.sh + echo " cp -v \$FILE $COMOUTgefs" >> run_pb2nc.sh + echo " chmod 640 $COMOUTgefs/*prepbufr*.nc" >> run_pb2nc.sh + echo " chgrp rstprod $COMOUTgefs/*prepbufr*.nc" >> run_pb2nc.sh + echo " fi" >> run_pb2nc.sh + echo "done" >> run_pb2nc.sh + chmod +x run_pb2nc.sh + $WORKtask/run_pb2nc.sh +fi + +############################################################ +# Get CCPA 6 hour accumulation and run PCPCombine to get +# 24 hour accumulation +############################################################ +if [ $modnam = ccpa ] ; then + day1=$($NDATE -24 ${vday}12) + export vday_1=${day1:0:8} + for ihour in 00 06 12 18 ; do + if [ -s $COMINccpa/ccpa.${vday}/$ihour/ccpa.t${ihour}z.06h.1p0.conus.gb2 ] ; then + $WGRIB2 $COMINccpa/ccpa.${vday}/$ihour/ccpa.t${ihour}z.06h.1p0.conus.gb2 -set_grib_type same -new_grid_winds earth -new_grid ncep grid 003 $WORKtask/ccpa.t${ihour}z.grid3.06h.f00.grib2 + if [ $SENDCOM="YES" ] ; then + if [ -s $WORKtask/ccpa.t${ihour}z.grid3.06h.f00.grib2 ]; then + cp -v $WORKtask/ccpa.t${ihour}z.grid3.06h.f00.grib2 ${COMOUTgefs}/ccpa.t${ihour}z.grid3.06h.f00.grib2 + fi + fi + else + echo "WARNING: $COMINccpa/ccpa.${vday}/$ihour/ccpa.t${ihour}z.06h.1p0.conus.gb2 is not available" + if [ $SENDMAIL = YES ]; then + export subject="CCPA Data Missing for EVS ${COMPONENT}" + echo "Warning: No CCPA analysis available for ${vday}${ihour}" > mailmsg + echo "Missing file is $COMINccpa/ccpa.${vday}/$ihour/ccpa.t${ihour}z.06h.1p0.conus.gb2" >> mailmsg + echo "Job ID: $jobid" >> mailmsg + cat mailmsg | mail -s "$subject" $MAILTO + fi + fi + done + export output_base=${WORKtask}/precip + export ccpa24=${WORKtask}/ccpa24 + mkdir -p $ccpa24 + for ihour in 12 ; do + nccpa_file=1 + while [ $nccpa_file -le 4 ]; do + if [ $nccpa_file -eq 1 ]; then + source_ccpa_file=${COMIN}/$STEP/${COMPONENT}/atmos.${vday}/gefs/ccpa.t12z.grid3.06h.f00.grib2 + elif [ $nccpa_file -eq 2 ]; then + source_ccpa_file=${COMIN}/$STEP/${COMPONENT}/atmos.${vday}/gefs/ccpa.t06z.grid3.06h.f00.grib2 + elif [ $nccpa_file -eq 3 ]; then + source_ccpa_file=${COMIN}/$STEP/${COMPONENT}/atmos.${vday}/gefs/ccpa.t00z.grid3.06h.f00.grib2 + elif [ $nccpa_file -eq 4 ]; then + source_ccpa_file=${COMIN}/$STEP/${COMPONENT}/atmos.${vday_1}/gefs/ccpa.t18z.grid3.06h.f00.grib2 + fi + if [ -s $source_ccpa_file ]; then + cp -v $source_ccpa_file ${WORKtask}/ccpa24/ccpa${nccpa_file} + else + echo "WARNING: $source_ccpa_file is not available" + if [ $SENDMAIL = YES ]; then + export subject="06h CCPA Data Missing for 24h CCPA generation" + echo "Warning: A 06h CCPA file is missing for 24h CCPA generation at ${vday}${ihour}" > mailmsg + echo "Missing file is $source_ccpa_file" >> mailmsg + echo "Job ID: $jobid" >> mailmsg + cat mailmsg | mail -s "$subject" $MAILTO + fi + fi + nccpa_file=`expr $nccpa_file + 1` + done + + if [ -s ${WORKtask}/ccpa24/ccpa1 ] && [ -s ${WORKtask}/ccpa24/ccpa2 ] && [ -s ${WORKtask}/ccpa24/ccpa3 ] && [ -s ${WORKtask}/ccpa24/ccpa4 ] ; then + ${METPLUS_PATH}/ush/run_metplus.py -c ${PARMevs}/metplus_config/machine.conf -c ${CONF_PREP}/PcpCombine_obsCCPA24h.conf + if [ $SENDCOM="YES" ] ; then + if [ -s $output_base/ccpa.t12z.grid3.24h.f00.nc ]; then + cp -v $output_base/ccpa.t12z.grid3.24h.f00.nc $COMOUTgefs/. + fi + fi + fi + done +fi + +############################################ +# Get GEFS members APCP 6 hour accumulation +############################################ +if [ $modnam = gefs_apcp06h ] ; then + for ihour in $gens_ihour ; do + for mb in 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 ; do + typeset -Z3 hhh + fhr=06 + while [ $fhr -le 384 ] ; do + hhh=$fhr + if [ -s $COMINgefs/gefs.$vday/$ihour/atmos/pgrb2ap5/gep${mb}.t${ihour}z.pgrb2a.0p50.f${hhh} ] ; then + gefs=$COMINgefs/gefs.$vday/$ihour/atmos/pgrb2ap5/gep${mb}.t${ihour}z.pgrb2a.0p50.f${hhh} + $WGRIB2 -match "APCP" $gefs | $WGRIB2 -i $gefs -grib $WORKtask/gefs.ens${mb}.t${ihour}z.grid4.06h.f${hhh}.grib2 + $WGRIB2 $WORKtask/gefs.ens${mb}.t${ihour}z.grid4.06h.f${hhh}.grib2 -set_grib_type same -new_grid_winds earth -new_grid ncep grid 003 $WORKtask/gefs.ens${mb}.t${ihour}z.grid3.06h.f${hhh}.grib2 + else + echo "WARNING: $COMINgefs/gefs.$vday/$ihour/atmos/pgrb2ap5/gep${mb}.t${ihour}z.pgrb2a.0p50.f${hhh} does not exist. Use $COMOUTgefs/gefs.ens${mb}.t${ihour}z.grid3.f${hhh}.grib2 instead" + gefs=$COMOUTgefs/gefs.ens${mb}.t${ihour}z.grid3.f${hhh}.grib2 + if [ -s $gefs ]; then + $WGRIB2 -match "APCP" $gefs | $WGRIB2 -i $gefs -grib $WORKtask/gefs.ens${mb}.t${ihour}z.grid3.06h.f${hhh}.grib2 + else + echo "WARNING: $gefs does not exist" + fi + fi + if [ $SENDCOM="YES" ] ; then + if [ -s $WORKtask/gefs.ens${mb}.t${ihour}z.grid3.06h.f${hhh}.grib2 ]; then + cp -v $WORKtask/gefs.ens${mb}.t${ihour}z.grid3.06h.f${hhh}.grib2 $COMOUTgefs/gefs.ens${mb}.t${ihour}z.grid3.06h.f${hhh}.grib2 + fi + fi + fhr=$((fhr+6)) + done + done + done +fi + +################################################################ +# Get GEFS members APCP 24 hour accumulation through PcpCombine +################################################################ +if [ $modnam = gefs_apcp24h ] ; then + export output_base=${WORKtask}/precip/gefs_apcp24h + export model=gefs + export modelpath=$COMOUTgefs + export ihour + export mb + export lead + for ihour in $gens_ihour ; do + for mb in 00 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 ; do + typeset -a lead_arr + for lead_chk in 024 036 048 060 072 084 096 108 120 132 144 156 168 180 192 204 216 228 240 252 264 276 288 300 312 324 336 348 360 372 384; do + file1=gefs.ens${mb}.t${ihour}z.grid3.f${lead_chk}.grib2 + if [ $lead_chk -ge 108 ]; then + file2=gefs.ens${mb}.t${ihour}z.grid3.f$(printf '%03d' $((lead_chk-6))).grib2 + file3=gefs.ens${mb}.t${ihour}z.grid3.f$(printf '%03d' $((lead_chk-12))).grib2 + file4=gefs.ens${mb}.t${ihour}z.grid3.f$(printf '%03d' $((lead_chk-18))).grib2 + else + strip_lead_chk=$(echo $lead_chk | sed 's/^0*//') + file2=gefs.ens${mb}.t${ihour}z.grid3.f$(printf '%03d' $((strip_lead_chk-6))).grib2 + file3=gefs.ens${mb}.t${ihour}z.grid3.f$(printf '%03d' $((strip_lead_chk-12))).grib2 + file4=gefs.ens${mb}.t${ihour}z.grid3.f$(printf '%03d' $((strip_lead_chk-18))).grib2 + fi + if [ -s $COMOUTgefs/$file1 -a\ + -s $COMOUTgefs/$file2 -a\ + -s $COMOUTgefs/$file3 -a\ + -s $COMOUTgefs/$file4 ] ; then + lead_arr[${#lead_arr[*]}+1]=${lead_chk} + else + echo "WARNING: $COMOUTgefs/gefs.ens${mb}.t${ihour}z.grid3.f*.grib2 does not exist" + fi + done + lead=$(echo $(echo ${lead_arr[@]}) | tr ' ' ',') + if [ ! -z $lead ]; then + ${METPLUS_PATH}/ush/run_metplus.py -c ${PARMevs}/metplus_config/machine.conf -c ${CONF_PREP}/PcpCombine_fcstGEFS_APCP24h.conf + fi + unset lead_arr + done + done + + if [ $SENDCOM="YES" ] ; then + for FILE in ${output_base}/*.nc ; do + if [ -s $FILE ]; then + cp -v $FILE $COMOUTgefs/. + cp -v $FILE $COMOUThgefs/. + fi + done + fi + + # Rename files in hgefs + for ihour in $gens_ihour ; do + for fhr in 024 036 048 060 072 084 096 108 120 132 144 156 168 180 192 204 216 228 240 252 264 276 288 300 312 324 336 348 360 372 384; do + for mb in 00 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 ; do + mv $COMOUThgefs/gefs.ens${mb}.t${ihour}z.grid3.24h.f${fhr}.nc $COMOUThgefs/hgefs.ens${mb}.t${ihour}z.grid3.24h.f${fhr}.nc + done + + # Remove ens00 from gefs since it is not used for GEFS verification + rm $COMOUTgefs/gefs.ens00.t${ihour}z.grid3.24h.f${fhr}.nc + done + + # Also remove all ens00 grib2 files in gefs + ihour6=`expr $ihour + 6` + typeset -Z2 ihour6 + fhr=0 + while [ $fhr -le 384 ] ; do + hhh=$fhr + typeset -Z3 hhh + rm $COMOUTgefs/gefs.ens00.t${ihour}z.grid3.f${hhh}.grib2 + rm $COMOUTgefs/gefs.ens00.t${ihour6}z.grid3.f${hhh}.grib2 + fhr=`expr $fhr + 6` + done + done + +fi + +################################################################## +# Get AIGEFS members APCP 24 hour accumulation through PcpCombine +################################################################## +if [ $modnam = aigefs_apcp24h ] ; then + export output_base=${WORKtask}/precip/aigefs_apcp24h + export model=aigefs + export modelpath=$COMOUTaigefs + export ihour + export mb + export lead + for ihour in $gens_ihour ; do + for mb in 00 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 ; do + typeset -a lead_arr + for lead_chk in 024 036 048 060 072 084 096 108 120 132 144 156 168 180 192 204 216 228 240 252 264 276 288 300 312 324 336 348 360 372 384; do + file1=aigefs.ens${mb}.t${ihour}z.grid3.f${lead_chk}.grib2 + if [ $lead_chk -ge 108 ]; then + file2=aigefs.ens${mb}.t${ihour}z.grid3.f$(printf '%03d' $((lead_chk-6))).grib2 + file3=aigefs.ens${mb}.t${ihour}z.grid3.f$(printf '%03d' $((lead_chk-12))).grib2 + file4=aigefs.ens${mb}.t${ihour}z.grid3.f$(printf '%03d' $((lead_chk-18))).grib2 + else + strip_lead_chk=$(echo $lead_chk | sed 's/^0*//') + file2=aigefs.ens${mb}.t${ihour}z.grid3.f$(printf '%03d' $((strip_lead_chk-6))).grib2 + file3=aigefs.ens${mb}.t${ihour}z.grid3.f$(printf '%03d' $((strip_lead_chk-12))).grib2 + file4=aigefs.ens${mb}.t${ihour}z.grid3.f$(printf '%03d' $((strip_lead_chk-18))).grib2 + fi + if [ -s $COMOUTaigefs/$file1 -a\ + -s $COMOUTaigefs/$file2 -a\ + -s $COMOUTaigefs/$file3 -a\ + -s $COMOUTaigefs/$file4 ] ; then + lead_arr[${#lead_arr[*]}+1]=${lead_chk} + else + echo "WARNING: $COMOUTaigefs/aigefs.ens${mb}.t${ihour}z.grid3.f*.grib2 does not exist" + fi + done + lead=$(echo $(echo ${lead_arr[@]}) | tr ' ' ',') + if [ ! -z $lead ]; then + ${METPLUS_PATH}/ush/run_metplus.py -c ${PARMevs}/metplus_config/machine.conf -c ${CONF_PREP}/PcpCombine_fcstAIGEFS_APCP24h.conf + fi + unset lead_arr + done + done + + if [ $SENDCOM="YES" ] ; then + for FILE in ${output_base}/*.nc ; do + if [ -s $FILE ]; then + cp -v $FILE $COMOUTaigefs/. + cp -v $FILE $COMOUThgefs/. + fi + done + fi + + # Rename and renumber files in hgefs + for ihour in $gens_ihour ; do + for fhr in 024 036 048 060 072 084 096 108 120 132 144 156 168 180 192 204 216 228 240 252 264 276 288 300 312 324 336 348 360 372 384; do + for mb in 00 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 ; do + hmbr=`expr $mb + 31` + mv $COMOUThgefs/aigefs.ens${mb}.t${ihour}z.grid3.24h.f${fhr}.nc $COMOUThgefs/hgefs.ens${hmbr}.t${ihour}z.grid3.24h.f${fhr}.nc + done + done + done + +fi + +############################################################ +# Get 24 hour NOHRSC snowfall data +############################################################ +if [ $modnam = nohrsc24h ] ; then + for ihour in 00 12 ; do + snowfall=$DCOMINnohrsc/${vday}/wgrbbul/nohrsc_snowfall/sfav2_CONUS_24h_${vday}${ihour}_grid184.grb2 + if [ -s $snowfall ] ; then + cp -v $snowfall $WORKtask/nohrsc.t${ihour}z.grid184.grb2 + if [ $SENDCOM="YES" ] ; then + if [ -s $WORKtask/nohrsc.t${ihour}z.grid184.grb2 ]; then + cp -v $WORKtask/nohrsc.t${ihour}z.grid184.grb2 $COMOUTgefs/nohrsc.t${ihour}z.grid184.grb2 + fi + fi + else + echo "WARNING: $snowfall is not available" + if [ $SENDMAIL = YES ]; then + export subject="NOHRSC Data Missing for EVS ${COMPONENT}" + echo "Warning: No NOHRSC analysis available for ${vday}${ihour}" > mailmsg + echo "Missing file is $snowfall" >> mailmsg + echo "Job ID: $jobid" >> mailmsg + cat mailmsg | mail -s "$subject" $MAILTO + fi + fi + done +fi + +################################################################################ +# Get GEFS members WEASD & SNOD 24 hour snowfall accumulation through PcpCombine +################################################################################ +if [ $modnam = gefs_snow24h ] ; then + export output_base=${WORKtask}/snow/gefs_snow24h.${gens_ihour} + export lead + export ihour + export mb + export model=gefs + export modelpath=$COMOUTgefs + export snow + for ihour in $gens_ihour ; do + for mb in 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 ; do + typeset -a lead_arr + for lead_chk in 024 036 048 060 072 084 096 108 120 132 144 156 168 180 192 204 216 228 240 252 264 276 288 300 312 324 336 348 360 372 384; do + file1=gefs.ens${mb}.t${ihour}z.grid3.f${lead_chk}.grib2 + if [ $lead_chk -ge 108 ]; then + file2=gefs.ens${mb}.t${ihour}z.grid3.f$(printf '%03d' $((lead_chk-24))).grib2 + else + strip_lead_chk=$(echo $lead_chk | sed 's/^0*//') + file2=gefs.ens${mb}.t${ihour}z.grid3.f$(printf '%03d' $((strip_lead_chk-24))).grib2 + fi + if [ -s $COMOUTgefs/$file1 -a -s $COMOUTgefs/$file2 ] ; then + lead_arr[${#lead_arr[*]}+1]=${lead_chk} + else + echo "WARNING: $COMOUTgefs/gefs.ens${mb}.t${ihour}z.grid3.f*.grib2 does not exist" + fi + done + lead=$(echo $(echo ${lead_arr[@]}) | tr ' ' ',') + if [ ! -z $lead ]; then + for snow in WEASD SNOD ; do + ${METPLUS_PATH}/ush/run_metplus.py -c ${PARMevs}/metplus_config/machine.conf -c ${CONF_PREP}/PcpCombine_fcstGEFS_SNOW24h.conf + done + fi + unset lead_arr + done + if [ $SENDCOM="YES" ] ; then + for FILE in $output_base/*.nc ; do + if [ -s $FILE ]; then + cp -v $FILE $COMOUTgefs/. + fi + done + fi + done +fi + +################################################################################# +# Get GFS 00Z forecasts 500mb Geopotential Heights for headline score comparison +################################################################################# +if [ $modnam = gfs ] ; then + for ihour in 00 ; do + for hhh in 024 048 072 096 120 144 168 192 216 240 264 288 312 336 360 384 ; do + gfs=$COMINgfs/gfs.$vday/${ihour}/atmos/gfs.t${ihour}z.pgrb2.1p00.f${hhh} + if [ ! -s $gfs ]; then + echo "WARNING: $gfs is not available" + if [ $SENDMAIL = YES ]; then + export subject="GFS F${hhh} Data Missing for EVS ${COMPONENT}" + echo "Warning: No GFS F${hhh} available for ${vday}${ihour}" > mailmsg + echo "Missing file is $gfs" >> mailmsg + echo "Job ID: $jobid" >> mailmsg + cat mailmsg | mail -s "$subject" $MAILTO + fi + else + $WGRIB2 $gfs | grep "HGT:500 mb" | $WGRIB2 -i $gfs -grib $WORKtask/gfs.t${ihour}z.grid3.f${hhh}.grib2 + if [ $SENDCOM="YES" ] ; then + if [ -s $WORKtask/gfs.t${ihour}z.grid3.f${hhh}.grib2 ]; then + cp -v $WORKtask/gfs.t${ihour}z.grid3.f${hhh}.grib2 $COMOUTgefs/gfs.t${ihour}z.grid3.f${hhh}.grib2 + fi + fi + fi + done + done +fi + +############################################################ +# Process OSI-SAF ice data (using Mallory's python scripts) +############################################################ +if [ $modnam = osi_saf ] ; then + INITDATEm1=$($NDATE -24 ${INITDATE}00 | cut -c1-8) + osisaf_comout_file=${COMOUTosi_saf}/osi_saf.multi.${INITDATEm1}00to${INITDATE}00_G004.nc + if [ -s $osisaf_comout_file ]; then + echo "${osisaf_comout_file} exists" + else + osi_nh=$DCOMINosi_saf/$INITDATEm1/seaice/osisaf/ice_conc_nh_polstere-100_multi_${INITDATEm1}1200.nc + osi_sh=$DCOMINosi_saf/$INITDATEm1/seaice/osisaf/ice_conc_sh_polstere-100_multi_${INITDATEm1}1200.nc + if [ ! -s $osi_nh ]; then + echo "WARNING: $osi_nh is not available" + if [ $SENDMAIL = YES ]; then + export subject="OSI_SAF NH Data Missing for EVS ${COMPONENT}" + echo "Warning: No OSI_SAF NH data available for ${INITDATE}" > mailmsg + echo "Missing file is $osi_nh" >> mailmsg + echo "Job ID: $jobid" >> mailmsg + cat mailmsg | mail -s "$subject" $MAILTO + fi + elif [ ! -s $osi_sh ]; then + echo "WARNING: $osi_sh is not available" + export subject="OSI_SAF SH Data Missing for EVS ${COMPONENT}" + echo "Warning: No OSI_SAF SH data available for ${INITDATE}" > mailmsg + echo "Missing file is $osi_sh" >> mailmsg + echo "Job ID: $jobid" >> mailmsg + cat mailmsg | mail -s "$subject" $MAILTO + else + echo "OSI_SAF NH and SH datasets exist" + python ${USHevs}/global_ens/global_ens_sea_ice_prep.py + if [ $SENDCOM="YES" ] ; then + for FILE in $WORKtask/atmos.${INITDATE}/osi_saf/*.nc ; do + if [ -s $FILE ]; then + cp -v $FILE $COMOUTosi_saf/. + fi + done + fi + fi + fi +fi + +############################################################################ +# Get GEFS members sea-ice concentration daily average through PcpCombine +# NOTE: Ice concentration starts from f000. There is amount of ice at +# beginning. So, for f024 ice concentration, it should be averaged of +# f000, f006, f012, f018, and f024. +############################################################################ +if [ $modnam = gefs_icec24h ] ; then + export output_base=${WORKtask}/gefs_icec24h + export model=gefs + export modelpath=$COMOUTgefs + export ihour + export mb + export accum=24 + export lead + for ihour in 00 ; do + for mb in 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 ; do + typeset -a lead_arr + for lead_chk in 024 048 072 096 120 144 168 192 216 240 264 288 312 336 360 384; do + file1=gefs.ens${mb}.t${ihour}z.grid3.f${lead_chk}.grib2 + if [ $lead_chk -ge 108 ]; then + file2=gefs.ens${mb}.t${ihour}z.grid3.f$(printf '%03d' $((lead_chk-6))).grib2 + file3=gefs.ens${mb}.t${ihour}z.grid3.f$(printf '%03d' $((lead_chk-12))).grib2 + file4=gefs.ens${mb}.t${ihour}z.grid3.f$(printf '%03d' $((lead_chk-18))).grib2 + else + strip_lead_chk=$(echo $lead_chk | sed 's/^0*//') + file2=gefs.ens${mb}.t${ihour}z.grid3.f$(printf '%03d' $((strip_lead_chk-6))).grib2 + file3=gefs.ens${mb}.t${ihour}z.grid3.f$(printf '%03d' $((strip_lead_chk-12))).grib2 + file4=gefs.ens${mb}.t${ihour}z.grid3.f$(printf '%03d' $((strip_lead_chk-18))).grib2 + fi + if [ -s $COMOUTgefs/$file1 -a\ + -s $COMOUTgefs/$file2 -a\ + -s $COMOUTgefs/$file3 -a\ + -s $COMOUTgefs/$file4 ] ; then + lead_arr[${#lead_arr[*]}+1]=${lead_chk} + else + echo "WARNING: $COMOUTgefs/gefs.ens${mb}.t${ihour}z.grid3.f*.grib2 does not exist" + fi + done + lead=$(echo $(echo ${lead_arr[@]}) | tr ' ' ',') + if [ ! -z $lead ]; then + ${METPLUS_PATH}/ush/run_metplus.py -c ${PARMevs}/metplus_config/machine.conf -c ${CONF_PREP}/PcpCombine_fcstGEFS_ICEC.conf + fi + unset lead_arr + done + done + if [ $SENDCOM="YES" ] ; then + for FILE in $output_base/gefs*icec*.nc ; do + if [ -s $FILE ]; then + cp -v $FILE $COMOUTgefs/. + fi + done + fi +fi + +########################################################################### +# Get GEFS members sea-ice concentration weekly average through PcpCombine +########################################################################### +if [ $modnam = gefs_icec7day ] ; then + export output_base=${WORKtask}/gefs_icec7day + export model=gefs + export modelpath=$COMOUTgefs + export lead + export ihour + export mb + export accum=168 + for ihour in 00 ; do + for mb in 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 ; do + if [ $ihour = 00 ] ; then + export leads='168 192 216 240 264 288 312 336 360 384' + elif [ $ihour = 12 ] ; then + export leads='180 204 228 252 276 300 324 348 372' + fi + for lead in $leads; do + ${METPLUS_PATH}/ush/run_metplus.py -c ${PARMevs}/metplus_config/machine.conf -c ${CONF_PREP}/PcpCombine_fcstGEFS_ICEC.conf + done + done + done + if [ $SENDCOM="YES" ] ; then + for FILE in $output_base/gefs*icec*.nc ; do + if [ -s $FILE ]; then + cp -v $FILE $COMOUTgefs/. + fi + done + fi +fi + +######################################################## +# Get GEFS members sst daily average through PcpCombine +######################################################## +if [ $modnam = gefs_sst24h ] ; then + export output_base=${WORKtask}/gefs_sst24h + export model=gefs + export modelpath=$COMOUTgefs + export lead + export ihour + export mb + export accum=24 + for ihour in 00 12 ; do + for mb in 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 ; do + if [ $ihour = 00 ] ; then + export leads='024 048 072 096 120 144 168 192 216 240 264 288 312 336 360 384' + elif [ $ihour = 12 ] ; then + export leads='036 060 084 108 132 156 180 204 228 252 276 300 324 348 372' + fi + typeset -a lead_arr + for lead_chk in $leads; do + file1=gefs.ens${mb}.t${ihour}z.grid3.f${lead_chk}.grib2 + if [ $lead_chk -ge 108 ]; then + file2=gefs.ens${mb}.t${ihour}z.grid3.f$(printf '%03d' $((lead_chk-6))).grib2 + file3=gefs.ens${mb}.t${ihour}z.grid3.f$(printf '%03d' $((lead_chk-12))).grib2 + file4=gefs.ens${mb}.t${ihour}z.grid3.f$(printf '%03d' $((lead_chk-18))).grib2 + else + strip_lead_chk=$(echo $lead_chk | sed 's/^0*//') + file2=gefs.ens${mb}.t${ihour}z.grid3.f$(printf '%03d' $((strip_lead_chk-6))).grib2 + file3=gefs.ens${mb}.t${ihour}z.grid3.f$(printf '%03d' $((strip_lead_chk-12))).grib2 + file4=gefs.ens${mb}.t${ihour}z.grid3.f$(printf '%03d' $((strip_lead_chk-18))).grib2 + fi + if [ -s $COMOUTgefs/$file1 -a\ + -s $COMOUTgefs/$file2 -a\ + -s $COMOUTgefs/$file3 -a\ + -s $COMOUTgefs/$file4 ] ; then + lead_arr[${#lead_arr[*]}+1]=${lead_chk} + else + echo "WARNING: $COMOUTgefs/gefs.ens${mb}.t${ihour}z.grid3.f*.grib2 does not exist" + fi + done + lead=$(echo $(echo ${lead_arr[@]}) | tr ' ' ',') + if [ ! -z $lead ]; then + ${METPLUS_PATH}/ush/run_metplus.py -c ${PARMevs}/metplus_config/machine.conf -c ${CONF_PREP}/PcpCombine_fcstGEFS_SST24h.conf + fi + unset lead_arr + done + done + if [ $SENDCOM="YES" ] ; then + for FILE in $output_base/gefs*sst*.nc ; do + if [ -s $FILE ]; then + cp -v $FILE $COMOUTgefs + fi + done + fi +fi diff --git a/versions/run.ver b/versions/run.ver index 990bd6f605..032d1f4e22 100644 --- a/versions/run.ver +++ b/versions/run.ver @@ -40,6 +40,7 @@ export w3emc_ver=2.12.0 export wgrib2_ver=2.0.8 export zlib_ver=1.2.11 +export aigefs_ver=v1.0 export aqm_ver=v7.0 export ccpa_ver=v4.2 export cfs_ver=v2.3 @@ -48,6 +49,7 @@ export fnmoc_ver=v1.1 export gefs_ver=v12.3 export gfs_ver=v16.3 export glwu_ver=v2.0 +export hgefs_ver=v1.0 export hiresw_ver=v8.1 export hourly_ver=v0.0 export href_ver=v3.1