Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor gempak jobs for new COM and style #2374

Merged
Merged
Show file tree
Hide file tree
Changes from 15 commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
a90f315
Refactor gempak jobs for new COM and style
WalterKolczynski-NOAA Mar 11, 2024
180a978
Disable warnings for functions in test statements
WalterKolczynski-NOAA Mar 5, 2024
bbf8909
Ignore shellcheck warning in config.base
WalterKolczynski-NOAA Mar 5, 2024
dea9e24
Update gempak meta_trop for COM refactor
WalterKolczynski-NOAA Mar 6, 2024
1115ca9
update gempak meta qpf for COM refactor
WalterKolczynski-NOAA Mar 6, 2024
0f857f3
Add missing error check to gempak meta mar ql
WalterKolczynski-NOAA Mar 6, 2024
3fea2b3
Fix lookback date calculation in gempak meta sa2
WalterKolczynski-NOAA Mar 6, 2024
029fcdb
Fix gempak meta sa2
WalterKolczynski-NOAA Mar 6, 2024
f5541f3
Fix cleanup job dependencies
WalterKolczynski-NOAA Mar 6, 2024
f54a341
Cap gempak post frequency to rate produced
WalterKolczynski-NOAA Mar 8, 2024
7f763b1
Update upper-air paths
WalterKolczynski-NOAA Mar 11, 2024
90d5c79
Update table path for GOES gempak
WalterKolczynski-NOAA Mar 11, 2024
f9e2b8c
Only create symlinks for external gempak if they don't exist
WalterKolczynski-NOAA Mar 11, 2024
59b2649
Allow non-matching bufr table
WalterKolczynski-NOAA Mar 11, 2024
77855a3
Fix undefined parm variable for bufr
WalterKolczynski-NOAA Mar 11, 2024
50e2375
Fix typos in ukmet gempak meta
WalterKolczynski-NOAA Mar 12, 2024
afa8ef9
Update gfs-utils for rdbfmsua build
WalterKolczynski-NOAA Mar 12, 2024
c796e95
Merge branch 'develop' into feature/fix_gempak
WalterKolczynski-NOAA Mar 12, 2024
bc00362
Fix typos discovered during code review
WalterKolczynski-NOAA Mar 18, 2024
8480a90
Merge branch develop into feature/fix_gempak
WalterKolczynski-NOAA Mar 18, 2024
0abd933
Turn rdbfmsua off
WalterKolczynski-NOAA Mar 18, 2024
8cefe95
Update gfs_utils hash
WalterKolczynski-NOAA Mar 18, 2024
6a75a55
Merge branch 'develop' into feature/fix_gempak
WalterKolczynski-NOAA Mar 18, 2024
8108834
Fix webtitle executable name for GDAS
WalterKolczynski-NOAA Mar 18, 2024
f5c7a19
Link rdbfmsua executable
WalterKolczynski-NOAA Mar 18, 2024
0872dde
Fix some file paths in gdas meta loop
WalterKolczynski-NOAA Mar 18, 2024
64d9bba
Fix issue with ukmet symlink
WalterKolczynski-NOAA Mar 19, 2024
9b4dcdb
Fix gdas gempak gif
WalterKolczynski-NOAA Mar 20, 2024
6af7193
Turn rdbfmsua back on
WalterKolczynski-NOAA Mar 20, 2024
9568cbc
Only create gif directory when needed
WalterKolczynski-NOAA Mar 26, 2024
b4bbdc6
More symlinks for gempak
WalterKolczynski-NOAA Mar 26, 2024
55f123b
Standardize gempak symlinks
WalterKolczynski-NOAA Mar 26, 2024
ffb2bca
Add needed export and fix bug in gempak
WalterKolczynski-NOAA Mar 27, 2024
ab4bc38
Delay cleanup when gempak is on
WalterKolczynski-NOAA Mar 27, 2024
ad78887
One more gempak fix
WalterKolczynski-NOAA Mar 27, 2024
1d54fae
Fix error in cleanup config
WalterKolczynski-NOAA Mar 27, 2024
2fd4b5b
Merge branch 'develop' into feature/fix_gempak
WalterKolczynski-NOAA Mar 27, 2024
556522c
Use correct variable for SA2
WalterKolczynski-NOAA Mar 27, 2024
d8c8c7e
Merge branch 'develop' into feature/fix_gempak
WalterKolczynski-NOAA Mar 27, 2024
f6d5184
Merge branch 'develop' into feature/fix_gempak
WalterKolczynski-NOAA Mar 27, 2024
e592daf
Merge branch 'develop' into feature/fix_gempak
WalterKolczynski-NOAA Mar 28, 2024
82c387c
Merge branch 'develop' into feature/fix_gempak
WalterKolczynski-NOAA Mar 29, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .shellcheckrc
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,6 @@ disable=SC1091

# Disable -p -m only applies to deepest directory
disable=SC2174

# Disable warning of functions in test statements
disable=SC2310
14 changes: 7 additions & 7 deletions gempak/fix/datatype.tbl
Original file line number Diff line number Diff line change
Expand Up @@ -102,10 +102,10 @@ LTNG $OBS/ltng YYYYMMDDHH.ltng CAT_MSC SCAT_N
!
CLIMO $GEMPAK/climo climate_MM.mos CAT_NIL SCAT_NIL 1 -1 -1
!
GFS $MODEL/gfs gfs_YYYYMMDDHH CAT_GRD SCAT_FCT -1 -1 -1
F-GFS $COMIN gfs_YYYYMMDDHHfFFF CAT_GRD SCAT_FCT -1 -1 -1
F-GFSP $COMIN gfs_YYYYMMDDHHfFFF CAT_GRD SCAT_FCT -1 -1 -1
F-GFSHPC $HPCGFS gfs_YYYYMMDDHHfFFF CAT_GRD SCAT_FCT -1 -1 -1
GFS $MODEL/gfs gfs_1p00_YYYYMMDDHH CAT_GRD SCAT_FCT -1 -1 -1
F-GFS $COMIN gfs_1p00_YYYYMMDDHHfFFF CAT_GRD SCAT_FCT -1 -1 -1
F-GFSP $COMIN gfs_1p00_YYYYMMDDHHfFFF CAT_GRD SCAT_FCT -1 -1 -1
F-GFSHPC $HPCGFS gfs_1p00_YYYYMMDDHHfFFF CAT_GRD SCAT_FCT -1 -1 -1
GFSEXT $MODEL/ens gfs.YYYYMMDDHH CAT_GRD SCAT_FCT -1 -1 -1
GFS1 $MODEL/ens gfs1.YYYYMMDDHH CAT_GRD SCAT_FCT -1 -1 -1
GFS2 $MODEL/ens gfs2.YYYYMMDDHH CAT_GRD SCAT_FCT -1 -1 -1
Expand Down Expand Up @@ -156,9 +156,9 @@ F-NAMP20 $COMIN nam20_YYYYMMDDHHfFFF CAT_GRD SCAT_F
F-NAMP44 $COMIN nam44_YYYYMMDDHHfFFF CAT_GRD SCAT_FCT -1 -1 -1
F-THREATS $COMIN ${NEST}_YYYYMMDDHHfFFF CAT_GRD SCAT_FCT -1 -1 -1
F-NAMHPC $HPCNAM nam_YYYYMMDDHHfFFF CAT_GRD SCAT_FCT -1 -1 -1
GDAS $MODEL/gdas gdas_YYMMDDHH CAT_GRD SCAT_FCT -1 -1 -1
F-GDAS $COMIN gdas_YYYYMMDDHHfFFF CAT_GRD SCAT_FCT -1 -1 -1
F-GFS $COMIN gfs_YYYYMMDDHHfFFF CAT_GRD SCAT_FCT -1 -1 -1
GDAS $MODEL/gdas gdas_1p00_YYMMDDHH CAT_GRD SCAT_FCT -1 -1 -1
F-GDAS $COMIN gdas_1p00_YYYYMMDDHHfFFF CAT_GRD SCAT_FCT -1 -1 -1
F-GFS $COMIN gfs_1p00_YYYYMMDDHHfFFF CAT_GRD SCAT_FCT -1 -1 -1
F-HWRF $COMIN hwrfp_YYYYMMDDHHfFFF_* CAT_GRD SCAT_FCT -1 -1 -1
F-HWRFN $COMIN hwrfn_YYYYMMDDHHfFFF_* CAT_GRD SCAT_FCT -1 -1 -1
F-GHM $COMIN ghmg_YYYYMMDDHHfFFF_* CAT_GRD SCAT_FCT -1 -1 -1
Expand Down
141 changes: 41 additions & 100 deletions gempak/ush/gdas_ecmwf_meta_ver.sh
Original file line number Diff line number Diff line change
@@ -1,75 +1,35 @@
#!/bin/sh
#
# Metafile Script : gdas_ecmwf_meta_ver
#! /usr/bin/env bash
#
# Creates a loop comparing the 6 hr gdas fcst to the pervious 7 days
# of ecmwf fcsts
#
# Log :
# J. Carr/HPC 3/2001 New metafile for verification of ecmwf.
# J. Carr/HPC 5/2001 Added a mn variable for a/b side dbnet root variable.
# M. Klein/HPC 11/2004 Changed verification grid from fnl to gdas
# M. Klein/HPC 2/2005 Changed location of working directory to /ptmp
# M. Klein/HPC 11/2006 Modify to run in production.
#

#cd $DATA

set -xa

if [ $cyc -ne "06" ] ; then
exit
fi
source "${HOMEgfs}/ush/preamble.sh"

export pgm=gdplot2_nc;. prep_step; startmsg
export pgm=gdplot2_nc;. prep_step

cyc=12
cyc2=12
device="nc | ecmwfver.meta"
PDY2=$(echo ${PDY} | cut -c3-)

#
# Copy in datatype table to define gdfile type
#
cp ${HOMEgfs}/gempak/fix/datatype.tbl datatype.tbl

cp "${HOMEgfs}/gempak/fix/datatype.tbl" datatype.tbl
export err=$?
if [[ $err -ne 0 ]] ; then
echo " File datatype.tbl does not exist."
exit $err
if (( err != 0 )) ; then
echo "FATAL ERROR: File datatype.tbl does not exist."
exit "${err}"
fi

#
# DEFINE YESTERDAY
date1=$($NDATE -24 ${PDY}${cyc} | cut -c -8)
sdate1=$(echo ${date1} | cut -c 3-)
# DEFINE 2 DAYS AGO
date2=$($NDATE -48 ${PDY}${cyc} | cut -c -8)
sdate2=$(echo ${date2} | cut -c 3-)
# DEFINE 3 DAYS AGO
date3=$($NDATE -72 ${PDY}${cyc} | cut -c -8)
sdate3=$(echo ${date3} | cut -c 3-)
# DEFINE 4 DAYS AGO
date4=$($NDATE -96 ${PDY}${cyc} | cut -c -8)
sdate4=$(echo ${date4} | cut -c 3-)
# DEFINE 5 DAYS AGO
date5=$($NDATE -120 ${PDY}${cyc} | cut -c -8)
sdate5=$(echo ${date5} | cut -c 3-)
# DEFINE 6 DAYS AGO
date6=$($NDATE -144 ${PDY}${cyc} | cut -c -8)
sdate6=$(echo ${date6} | cut -c 3-)
# DEFINE 7 DAYS AGO
date7=$($NDATE -168 ${PDY}${cyc} | cut -c -8)
sdate7=$(echo ${date7} | cut -c 3-)

vergrid="F-GDAS | ${PDY2}/0600"
vergrid="F-GDAS | ${PDY:2}/0600"
fcsthr="0600f006"

# GENERATING THE METAFILES.
areas="SAM NAM"
verdays="${date1} ${date2} ${date3} ${date4} ${date5} ${date6} ${date7}"

for area in $areas
do
if [ $area == "NAM" ] ; then
for area in ${areas}; do
if [[ "${area}" == "NAM" ]] ; then
garea="5.1;-124.6;49.6;-11.9"
proj="STR/90.0;-95.0;0.0"
latlon="0"
Expand All @@ -80,37 +40,18 @@ for area in $areas
latlon="1/10/1/2/10;10"
run=" "
fi
for verday in $verdays
do
verddate=$(echo ${verday} | cut -c 3-)
if [ ${verday} -eq ${date1} ] ; then
dgdattim=f024
sdatenum=$sdate1
elif [ ${verday} -eq ${date2} ] ; then
dgdattim=f048
sdatenum=$sdate2
elif [ ${verday} -eq ${date3} ] ; then
dgdattim=f072
sdatenum=$sdate3
elif [ ${verday} -eq ${date4} ] ; then
dgdattim=f096
sdatenum=$sdate4
elif [ ${verday} -eq ${date5} ] ; then
dgdattim=f120
sdatenum=$sdate5
elif [ ${verday} -eq ${date6} ] ; then
dgdattim=f144
sdatenum=$sdate6
elif [ ${verday} -eq ${date7} ] ; then
dgdattim=f168
sdatenum=$sdate7
for (( fhr=24; fhr<=168; fhr+=24 )); do
dgdattim=$(printf "f%03d" "${fhr}")
sdatenum=$(date --utc +%y%m%d -d "${PDY} ${cyc2} - ${fhr} hours")

if [[ ! -L "ecmwf.20${sdatenum}" ]]; then
ln -sf "${COMINecmwf}/ecmwf.20${sdatenum}/gempak" "ecmwf.20${sdatenum}"
fi
# JY grid="$COMROOT/nawips/${envir}/ecmwf.20${sdatenum}/ecmwf_glob_20${sdatenum}12"
grid="${COMINecmwf}.20${sdatenum}/gempak/ecmwf_glob_20${sdatenum}12"
gdfile="ecmwf.20${sdatenum}/ecmwf_glob_20${sdatenum}12"

# 500 MB HEIGHT METAFILE
# 500 MB HEIGHT METAFILE

$GEMEXE/gdplot2_nc << EOFplt
"${GEMEXE}/gdplot2_nc" << EOFplt
\$MAPFIL = mepowo.gsf
PROJ = ${proj}
GAREA = ${garea}
Expand All @@ -134,7 +75,7 @@ line = 6/1/3
title = 6/-2/~ GDAS 500 MB HGT (6-HR FCST)|~${area} 500 HGT DF
r

gdfile = ${grid}
gdfile = ${gdfile}
gdattim = ${dgdattim}
line = 5/1/3
contur = 4
Expand All @@ -157,15 +98,15 @@ clear = yes
latlon = ${latlon}
r

gdfile = ${grid}
gdfile = ${gdfile}
gdattim = ${dgdattim}
line = 5/1/3
contur = 4
title = 5/-1/~ ECMWF PMSL
clear = no
r

PROJ =
PROJ =
GAREA = bwus
gdfile = ${vergrid}
gdattim = ${fcsthr}
Expand All @@ -181,7 +122,7 @@ clear = yes
latlon = ${latlon}
${run}

gdfile = ${grid}
gdfile = ${gdfile}
gdattim = ${dgdattim}
line = 5/1/3
contur = 4
Expand All @@ -195,28 +136,28 @@ EOFplt
done
done

export err=$?;err_chk
export err=$?

#####################################################
# GEMPAK DOES NOT ALWAYS HAVE A NON ZERO RETURN CODE
# WHEN IT CAN NOT PRODUCE THE DESIRED GRID. CHECK
# FOR THIS CASE HERE.
#####################################################
ls -l ecmwfver.meta
export err=$?;export pgm="GEMPAK CHECK FILE";err_chk

if [ $SENDCOM = "YES" ] ; then
mkdir -p -m 775 ${COMOUTecmwf}.${PDY}/meta
mv ecmwfver.meta ${COMOUTecmwf}.${PDY}/meta/ecmwfver_${PDY}_${cyc}
export err=$?
if [[ $err -ne 0 ]] ; then
echo " File ecmwfver.meta does not exist."
exit $err
fi
if (( err != 0 )) || [[ ! -s ecmwfver.meta ]]; then
echo "FATAL ERROR: Failed to create ecmwf meta file"
exit "${err}"
fi

if [ $SENDDBN = "YES" ] ; then
${DBNROOT}/bin/dbn_alert MODEL ECMWFVER_HPCMETAFILE $job \
${COMOUTecmwf}.${PDY}/meta/ecmwfver_${PDY}_${cyc}
fi
mv ecmwfver.meta "${COM_ATMOS_GEMPAK_META}/ecmwfver_${PDY}_${cyc2}"
export err=$?
if (( err != 0 )) ; then
echo "FATAL ERROR: Failed to move meta file to ${COM_ATMOS_GEMPAK_META}/ecmwfver_${PDY}_${cyc2}"
exit "${err}"
fi

if [[ "${SENDDBN}" == "YES" ]] ; then
"${DBNROOT}/bin/dbn_alert" MODEL ECMWFVER_HPCMETAFILE "${job}" \
"${COM_ATMOS_GEMPAK_META}/ecmwfver_${PDY}_${cyc2}"
fi

exit
Loading
Loading