Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Save work in progress.
  • Loading branch information
EdwardSafford-NOAA committed Mar 3, 2025
1 parent 294ceeb commit a1d0998
Show file tree
Hide file tree
Showing 6 changed files with 63 additions and 50 deletions.
17 changes: 13 additions & 4 deletions src/Conventional_Monitor/data_extract/ush/ConMon_DE_rgn.sh
Original file line number Diff line number Diff line change
Expand Up @@ -220,9 +220,9 @@ fi
export cnvstat=${cnvstat_location}/${CONMON_SUFFIX}.${day}/${CONMON_SUFFIX}.${rgnHH}.cnvstat.${rgnTM}

if [[ -e ${cnvstat} ]]; then
echo "cnvstat exists"
echo "cnvstat exists: $cnvstat"
else
echo "cnvstat is a no-go"
echo "cnvstat is a no-go: $cnvstat"
fi

#------------------------------------------------------------
Expand Down Expand Up @@ -270,8 +270,17 @@ if [[ -e ${cnvstat} ]]; then
${HOMEnam_conmon}/jobs/JNAM_CONMON

elif [[ ${MY_MACHINE} = "wcoss2" ]]; then
${SUB} -V -q ${JOB_QUEUE} -A ${ACCOUNT} -o ${logfile} -e ${logfile} -l walltime=30:00 \
-N ${jobname} -l select=1:mem=5000M ${HOMEnam_conmon}/jobs/JNAM_CONMON
# ${SUB} -V -q ${JOB_QUEUE} -A ${ACCOUNT} -o ${logfile} -e ${logfile} -l walltime=30:00 \
# -N ${jobname} -l select=1:mem=5000M ${HOMEnam_conmon}/jobs/JNAM_CONMON
$SUB -v "C_TANKDIR=${C_TANKDIR}, C_LOGDIR=${C_LOGDIR}, cnvstat=${cnvstat}, \
CNVSTAT_LOCATION=${cnvstat_location}, CONMON_WORK_DIR=${CONMON_WORK_DIR}, \
C_DATDIR=${C_DATDIR}, C_COMIN=${C_COMIN}, \
PDY=${PDY}, CYC=${CYC}, HOMEnam_conmon=${HOMEnam_conmon}, \
WGRIB2=${WGRIB2}, USHconmon=${USHconmon}, CLEAN_TANKDIR=${CLEAN_TANKDIR}, \
EXECconmon=${EXECconmon}" \
-q $JOB_QUEUE -A $ACCOUNT -o ${logfile} -e ${logfile} -l walltime=30:00 -N ${jobname} \
-l select=1:mem=4G ${HOMEnam_conmon}/jobs/JNAM_CONMON

fi

else
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ set -xa
echo "mtype = $mtype (type = $type)"
echo "subtype = $subtype"
echo "hint = $hint"
echo "workdir = $workdir"
echo "INPUT_FILE = ${INPUT_FILE}"


Expand Down
21 changes: 10 additions & 11 deletions src/Conventional_Monitor/nwprod/conmon_shared/ush/horz_hist.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,10 @@
#
#------------------------------------------------------------------

set -ax

echo "--> horz_hist.sh"
date
rc=0

echo "CONMON_SUFFIX = $CONMON_SUFFIX"
export hint=10 ##(mb) the plot pressure interval press+-hint

#----------------------------------------------------------
Expand Down Expand Up @@ -42,20 +39,22 @@

for type in ps q t uv; do

eval stype=\${${type}_TYPE}
eval nreal=\${nreal_${type}}
exec=read_${type}
eval export stype=\${${type}_TYPE}
eval export nreal=\${nreal_${type}}
export type=${type}
export exec=read_${type}

#---------------------------------
# decoding the dignostic file
#---------------------------------

for dtype in ${stype}; do

mtype=`echo ${dtype} | cut -f1 -d_ | xargs`
subtype=`echo ${dtype} | cut -f2 -d_ | xargs`
export mtype=`echo ${dtype} | cut -f1 -d_ | xargs`
export subtype=`echo ${dtype} | cut -f2 -d_ | xargs`

for run in ges anl; do
export run=${run}

#-------------------------------------------------------------
# Because few things in life are convenient or consistent,
Expand Down Expand Up @@ -115,7 +114,7 @@
$UNCOMPRESS ${low_cnt_file}.gz
fi

gdate=`${NDATE} -6 ${PDATE}`
gdate=`${NDATE} -6 ${PDATE}`
prev_low_cnt_file=${TANKDIR_prev_conmon}/horz_hist/${run}/low_cnt.${run}.${gdate}
if [[ -e ${prev_low_cnt_file}.gz ]]; then
$UNCOMPRESS ${prev_low_cnt_file}.gz
Expand All @@ -125,8 +124,8 @@
--lcf ${low_cnt_file} --plcf ${prev_low_cnt_file} \
--cyc0 ${PDATE} --cyc1 ${gdate} \
--errf ${TANKDIR_conmon}/horz_hist/${run}/err_rpt.${run}.${PDATE}
fi
done
fi
done

echo "<-- horz_hist.sh"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,11 @@ echo "--> time_vert.sh"
if [ $CONMON_NETCDF -eq 0 ]; then

for run in ges anl; do

${UNCOMPRESS} ./diag_conv_${run}.${PDATE}.${Z}


if [[ -e ./diag_conv_${run}.${PDATE}.gz ]]; then
${UNCOMPRESS} ./diag_conv_${run}.${PDATE}.gz
fi

cat << EOF > input
&input
input_file=diag_conv_${run}.${PDATE},
Expand Down
31 changes: 18 additions & 13 deletions src/Conventional_Monitor/nwprod/nam_conmon/jobs/JNAM_CONMON
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,28 @@
#########################################################
echo "--> JNAM_CONMON"

set -xa
#set -xa

echo `date` $0 `date -u` begin
export PS4='$SECONDS + '
#export PS4='$SECONDS + '

###########################################################
# set up temp working directory space
###########################################################
export CONMON_WORK_DIR=${CONMON_WORK_DIR:-/tmpnwprd}
export KEEPDATA=${KEEPDATA:-YES}
export C_DATAROOT=${C_DATAROOT:-${CONMON_WORK_DIR}}

job=${job:-nam_conmon}
pid=${pid:-$$}
export C_DATA=${C_DATA:-${C_DATAROOT}/${job}.${pid}}
echo C_DATA = $C_DATA

if [[ -e ${C_DATA} ]]; then
rm -rf ${C_DATA}
fi
mkdir -p ${C_DATA}
cd ${C_DATA}


#####################
Expand All @@ -26,6 +39,8 @@ export CONMON_AREA=rgn

export VERBOSE=${VERBOSE:-YES}
export CLEAN_TANKDIR=${CLEAN_TANKDIR:-YES}
export COMPRESS=${COMPRESS:-gzip}
export UNCOMPRESS=${UNCOMPRESS:-gunzip}


###################################################################
Expand All @@ -39,7 +54,7 @@ export TANKDIR_conmon=${C_TANKDIR}/conmon.${PDY}
export COM_IN=${COM_IN:-${COMROOT}/${NET}/${version}}
export C_COMIN=${C_COMIN:-$COM_IN/${CONMON_SUFFIX}.${PDY}}

case $CYC in
case ${CYC} in
00) export rgnHH=t00z
export rgnTM=tm00;;
01) export rgnHH=t06z
Expand Down Expand Up @@ -92,20 +107,10 @@ esac

export cnvstat=${cnvstat:-${C_COMIN}/${CONMON_SUFFIX}.${rgnHH}.cnvstat.${rgnTM}}


########################################################
# Execute the script.
#
${CONMONSH:-$HOMEnam_conmon/scripts/exnam_conmon.sh}
########################################################

################################
# Remove the Working Directory
################################
KEEPDATA=${KEEPDATA:-YES}
cd ${CONMON_WORK_DIR}
if [ ${KEEPDATA} = NO ] ; then
rm -rf ${CONMON_WORK_DIR}
fi

echo "<-- JNAM_CONMON"
35 changes: 17 additions & 18 deletions src/Conventional_Monitor/nwprod/nam_conmon/scripts/exnam_conmon.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
echo start exnam_conmon.sh

err=0
export NCP=${NCP:-/bin/cp -f}
export Z=gz

#-------------------------
# confirm $cnvstat exists
Expand All @@ -31,35 +33,28 @@

if [[ ${err} -eq 0 ]]; then
export PDATE=${PDY}${CYC}

echo PDATE = $PDATE

if [[ ! -d ${TANKDIR_conmon} ]]; then
mkdir -p ${TANKDIR_conmon}
fi

###############################################
# Expand C_DATA (stmp work space) and cd to it
#
export CONMON_WORK_DIR=$CONMON_WORK_DIR/DE.${PDATE}

#-------------------------------------------------------------
# Ensure necessary work and TANKDIR directories are in place
#-------------------------------------------------------------
if [[ ! -d ${CONMON_WORK_DIR} ]]; then
mkdir -p $CONMON_WORK_DIR
mkdir -p ${TANKDIR_conmon}/horz_hist/anl
mkdir -p ${TANKDIR_conmon}/horz_hist/ges
mkdir -p ${TANKDIR_conmon}/time_vert
fi
cd $CONMON_WORK_DIR
mkdir -p ${TANKDIR_conmon}/horz_hist/anl
mkdir -p ${TANKDIR_conmon}/horz_hist/ges
mkdir -p ${TANKDIR_conmon}/time_vert

#------------------------------------------------------------------
# Copy data files file to local data directory.
# Untar cnvstat file.
#------------------------------------------------------------------
$NCP $cnvstat ./cnvstat.$PDATE
${NCP} ${cnvstat} ./cnvstat.${PDATE}

tar -xvf ./cnvstat.$PDATE
rm cnvstat.$PDATE
tar -xvf ./cnvstat.${PDATE}
rm cnvstat.${PDATE}

netcdf=0
count=`ls diag* | grep ".nc4" | wc -l`
Expand All @@ -71,10 +66,9 @@
done
fi

echo "netcdf: $netcdf"
echo "netcdf: ${netcdf}"
export CONMON_NETCDF=${netcdf}
$UNCOMPRESS ./*.${Z}

${UNCOMPRESS} *.gz

#---------------------------------------
# run the time-vert extraction script
Expand Down Expand Up @@ -108,6 +102,11 @@
err=$rc_time_vert
fi

if [[ ${KEEPDATA} = "NO" ]]; then
cd ${C_DATA}/..
rm -rf ${C_DATA}
fi

echo "end exgdas_conmon.sh, exit value = ${err}"

exit ${err}
Expand Down

0 comments on commit a1d0998

Please sign in to comment.