Skip to content

Commit

Permalink
Address reviewer's suggestions
Browse files Browse the repository at this point in the history
  • Loading branch information
danielabdi-noaa committed Mar 25, 2023
1 parent 9e9b62f commit 48ce81a
Show file tree
Hide file tree
Showing 4 changed files with 53 additions and 46 deletions.
21 changes: 21 additions & 0 deletions jobs/JREGIONAL_PROCESS_RADARREF
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,27 @@
# This J-JOB script runs the radar reflectivity preprocess
# for the FV3-LAM model
#
# Description:
#
# RRFS runs a pre-processing task on MRMS radar reflectivity files.
# Specifically the process_radarref task executes process_NSSL_mosaic.exe
# from rrfs-utl on files
# like MergedReflectivityQC_00.50_${YYYY}${MM}${DD}-${HH}${min}${ss}.grib2.
#
# Arguments needed for the corresponding ex-script
#
# FIXgsi
# OBSPATH_NSSLMOSIAC
# DO_SPINUP
# CYCLE_TYPE
# CYCL_HRS_SPINSTART
# CYCL_HRS_PRODSTART
# IO_LAYOUT_Y
# RADARREF_TIMELEVEL
# RADARREF_MINS
# RADAR_REF_THINNING
# OBS_APPENDIX
#
#-----------------------------------------------------------------------
#

Expand Down
72 changes: 26 additions & 46 deletions scripts/exregional_process_radarref.sh
Original file line number Diff line number Diff line change
Expand Up @@ -64,16 +64,13 @@ nprocs=$(( NNODES_PROCESS_RADARREF*PPN_PROCESS_RADARREF))
#
#-----------------------------------------------------------------------
#
#START_DATE=$(echo "${CDATE}" | sed 's/\([[:digit:]]\{2\}\)$/ \1/')
START_DATE=$(echo "${PDY} ${cyc}")
YYYYMMDDHH=$(date +%Y%m%d%H -d "${START_DATE}")
#JJJ=$(date +%j -d "${START_DATE}")

YYYY=${YYYYMMDDHH:0:4}
MM=${YYYYMMDDHH:4:2}
DD=${YYYYMMDDHH:6:2}
HH=${YYYYMMDDHH:8:2}
#YYYYMMDD=${YYYYMMDDHH:0:8}

#
#-----------------------------------------------------------------------
Expand All @@ -87,22 +84,17 @@ HH=${YYYYMMDDHH:8:2}
BKTYPE=0
if [ ${DO_SPINUP} == "TRUE" ]; then
if [ ${CYCLE_TYPE} == "spinup" ]; then
for cyc_start in "${CYCL_HRS_SPINSTART[@]}"; do
if [ ${HH} -eq ${cyc_start} ]; then
BKTYPE=1
fi
done
if [[ ${CYCL_HRS_SPINSTART[@]} =~ "$HH" ]] ; then
BKTYPE=1
fi
fi
else
for cyc_start in "${CYCL_HRS_PRODSTART[@]}"; do
if [ ${HH} -eq ${cyc_start} ]; then
BKTYPE=1
fi
done
if [[ ${CYCL_HRS_PRODSTART[@]} =~ "$HH" ]] ; then
BKTYPE=1
fi
fi

n_iolayouty=$(($IO_LAYOUT_Y-1))
list_iolayout=$(seq 0 $n_iolayouty)

#
#-----------------------------------------------------------------------
Expand All @@ -115,10 +107,10 @@ list_iolayout=$(seq 0 $n_iolayouty)
print_info_msg "$VERBOSE" "
Getting into working directory for radar reflectivity process ..."

for bigmin in ${RADARREFL_TIMELEVEL[@]}; do
bigmin=$( printf %2.2i $bigmin )
mkdir_vrfy ${DATA}/${bigmin}
cd ${DATA}/${bigmin}
for timelevel in ${RADARREFL_TIMELEVEL[@]}; do
timelevel=$( printf %2.2i $timelevel )
mkdir_vrfy ${DATA}/${timelevel}
cd ${DATA}/${timelevel}

pregen_grid_dir=$DOMAIN_PREGEN_BASEDIR/${PREDEF_GRID_NAME}

Expand All @@ -132,15 +124,14 @@ for bigmin in ${RADARREFL_TIMELEVEL[@]}; do
#-----------------------------------------------------------------------

if [ ${BKTYPE} -eq 1 ]; then
cp_vrfy ${pregen_grid_dir}/fv3_grid_spec fv3sar_grid_spec.nc
cp_vrfy ${pregen_grid_dir}/fv3_grid_spec fv3sar_grid_spec.nc
else
if [ "${IO_LAYOUT_Y}" == "1" ]; then
cp_vrfy ${pregen_grid_dir}/fv3_grid_spec fv3sar_grid_spec.nc
cp_vrfy ${pregen_grid_dir}/fv3_grid_spec fv3sar_grid_spec.nc
else
for ii in $list_iolayout
for iii in $(seq -w 0 $(printf %4.4i $n_iolayouty))
do
iii=$(printf %4.4i $ii)
cp_vrfy ${pregen_grid_dir}/fv3_grid_spec.${iii} fv3sar_grid_spec.nc.${iii}
cp_vrfy ${pregen_grid_dir}/fv3_grid_spec.${iii} fv3sar_grid_spec.nc.${iii}
done
fi
fi
Expand All @@ -152,38 +143,27 @@ for bigmin in ${RADARREFL_TIMELEVEL[@]}; do
#
#-----------------------------------------------------------------------


case $MACHINE in

"WCOSS2")

obs_appendix=grib2.gz
;;
"JET" | "HERA" | "ORION")

obs_appendix=grib2
esac

NSSL=${OBSPATH_NSSLMOSIAC}

mrms="MergedReflectivityQC"

# Link to the MRMS operational data
echo "bigmin = ${bigmin}"
echo "timelevel = ${timelevel}"
echo "RADARREFL_MINS = ${RADARREFL_MINS[@]}"

# Link to the MRMS operational data
# This loop finds files closest to the given "timelevel"
for min in ${RADARREFL_MINS[@]}
do
min=$( printf %2.2i $((bigmin+min)) )
min=$( printf %2.2i $((timelevel+min)) )
echo "Looking for data valid:"${YYYY}"-"${MM}"-"${DD}" "${HH}":"${min}
s=0
while [[ $s -le 59 ]]; do
ss=$(printf %2.2i ${s})
nsslfile=${NSSL}/*${mrms}_00.50_${YYYY}${MM}${DD}-${HH}${min}${ss}.${obs_appendix}
sec=0
while [[ $sec -le 59 ]]; do
ss=$(printf %2.2i ${sec})
nsslfile=${NSSL}/*${mrms}_00.50_${YYYY}${MM}${DD}-${HH}${min}${ss}.${OBS_APPENDIX}
if [ -s $nsslfile ]; then
echo 'Found '${nsslfile}
nsslfile1=*${mrms}_*_${YYYY}${MM}${DD}-${HH}${min}*.${obs_appendix}
nsslfile1=*${mrms}_*_${YYYY}${MM}${DD}-${HH}${min}*.${OBS_APPENDIX}
numgrib2=$(ls ${NSSL}/${nsslfile1} | wc -l)
echo 'Number of GRIB-2 files: '${numgrib2}
if [ ${numgrib2} -ge 10 ] && [ ! -e filelist_mrms ]; then
Expand All @@ -192,7 +172,7 @@ esac
echo 'Creating links for ${YYYY}${MM}${DD}-${HH}${min}'
fi
fi
((s+=1))
((sec+=1))
done
done

Expand All @@ -203,7 +183,7 @@ esac

if [ -s filelist_mrms ]; then

if [ ${obs_appendix} == "grib2.gz" ]; then
if [ ${OBS_APPENDIX} == "grib2.gz" ]; then
gzip -d *.gz
mv filelist_mrms filelist_mrms_org
ls MergedReflectivityQC_*_${YYYY}${MM}${DD}-${HH}????.grib2 > filelist_mrms
Expand All @@ -213,7 +193,7 @@ esac
print_info_msg "$VERBOSE" "Using radar data from: `head -1 filelist_mrms | cut -c10-15`"
print_info_msg "$VERBOSE" "NSSL grib2 file levels = $numgrib2"
else
echo "WARNING: Not enough radar reflectivity files available for loop ${bigmin}."
echo "WARNING: Not enough radar reflectivity files available for loop ${timelevel}."
continue
fi

Expand Down Expand Up @@ -323,7 +303,7 @@ EOF
Call to executable to run radar refl process returned with nonzero exit code."
POST_STEP

done # done with the bigmin for-loop
done # done with the timelevel for-loop
#
#-----------------------------------------------------------------------
#
Expand Down
4 changes: 4 additions & 0 deletions ush/config_defaults.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2685,10 +2685,14 @@ task_process_radarref:
# RADARREFL_TIMELEVEL:
# time level (minute) from the hour that the NSSL mosaic files will be generated
#
# OBS_APPENDIX
# machine specific grib2 file name extension (grib2 or grib2.gz)
#
#-----------------------------------------------------------------------
#
RADARREFL_MINS: [0, 1, 2, 3]
RADARREFL_TIMELEVEL: [0]
OBS_APPENDIX: grib2

#----------------------------
# global config parameters
Expand Down
2 changes: 2 additions & 0 deletions ush/machine/wcoss2.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ platform:
COMINgfs: /lfs/h1/ops/prod/com/gfs/v16.3
COMINgefs: /lfs/h1/ops/prod/com/gefs/v12.3
COMINairnow: /lfs/h1/ops/prod/dcom
task_process_radarref:
OBS_APPENDIX: grib2.gz
data:
ics_lbcs:
GSMGFS: compath.py ${envir}/gsmgfs/${gsmgfs_ver}/gsmgfs.${PDYext}
Expand Down

0 comments on commit 48ce81a

Please sign in to comment.