Skip to content

Commit cc8ca36

Browse files
Add aqm in the UPP RTs (NOAA-EMC#1356)
* Add aqm in the UPP RTs * Add changes for aqm test * Update aqm test config. on R&D machines * Add aqm and RT log for WCOSS2 * Ursa RT log for intel compiler * Ursa RT log for intelllvm compiler * Minor corrections based Ben's comments * Reload RT log for WCOSS2 * Orion RT log for intel compiler * Hercules RT log for intel compiler * Reloaded Ursa RT log for intel compiler * Reloaded Ursa RT log for intelllvm compiler --------- Co-authored-by: Chad.Lyden <Chad.Lyden@noaa.gov>
1 parent 264a591 commit cc8ca36

17 files changed

+492
-239
lines changed

ci/jobs-dev/run_post_aqm_WCOSS2.sh

Lines changed: 118 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,118 @@
1+
#!/bin/bash
2+
3+
#PBS -o out.post.aqm
4+
#PBS -e out.post.aqm
5+
#PBS -N aqm_test
6+
#PBS -l walltime=00:30:00
7+
#PBS -q debug
8+
#PBS -A GFS-DEV
9+
#PBS -l place=vscatter,select=2:ncpus=48
10+
#PBS -V
11+
12+
set -x
13+
14+
# specify computation resources
15+
export threads=1
16+
export OMP_NUM_THREADS=$threads
17+
export APRUN="mpiexec -l -n 96 -ppn 48"
18+
19+
echo "starting time"
20+
date
21+
22+
############################################
23+
# Loading modules
24+
############################################
25+
module reset
26+
module use ${svndir}/modulefiles
27+
module load wcoss2_intel
28+
module load cray-pals/1.0.12
29+
module load libjpeg/9c
30+
module load prod_util/2.0.14
31+
module load wgrib2/2.0.8
32+
module list
33+
34+
msg="Starting aqm test"
35+
postmsg "$logfile" "$msg"
36+
37+
export POSTGPEXEC=${svndir}/exec/upp.x
38+
39+
# specify forecast start time and hour for running your post job
40+
export startdate=2025103106
41+
export fhr=008
42+
export cyc=`echo $startdate | cut -c9-10`
43+
export tmmark=tm00
44+
45+
# specify your running and output directory
46+
export DATA=$rundir/aqm_${startdate}
47+
rm -rf $DATA; mkdir -p $DATA
48+
cd $DATA
49+
50+
export NEWDATE=`${NDATE} +${fhr} $startdate`
51+
export YY=`echo $NEWDATE | cut -c1-4`
52+
export MM=`echo $NEWDATE | cut -c5-6`
53+
export DD=`echo $NEWDATE | cut -c7-8`
54+
export HH=`echo $NEWDATE | cut -c9-10`
55+
56+
cat > itag <<EOF
57+
&model_inputs
58+
fileName='$homedir/data_in/aqm/aqm.t${cyc}z.dyn.f${fhr}.nc'
59+
IOFORM='netcdf'
60+
grib='grib2'
61+
DateStr='${YY}-${MM}-${DD}_${HH}:00:00'
62+
MODELNAME='FV3R'
63+
fileNameFlux='$homedir/data_in/aqm/aqm.t${cyc}z.phy.f${fhr}.nc'
64+
/
65+
&NAMPGB
66+
KPO=47,PO=1000.,975.,950.,925.,900.,875.,850.,825.,800.,775.,750.,725.,700.,675.,650.,625.,600.,575.,550.,525.,500.,475.,450.,425.,400.,375.,350.,325.,300.,275.,250.,225.,200.,175.,150.,125.,100.,70.,50.,30.,20.,10.,7.,5.,3.,2.,1.,aqf_on=.true.,
67+
/
68+
EOF
69+
70+
# copy fix data
71+
cp ${svndir}/fix/nam_micro_lookup.dat ./eta_micro_lookup.dat
72+
cp ${svndir}/parm/aqm/postxconfig-NT-AQM.txt ./postxconfig-NT.txt
73+
cp ${svndir}/parm/params_grib2_tbl_new ./params_grib2_tbl_new
74+
75+
# Run the UPP
76+
${APRUN} ${POSTGPEXEC} < itag > outpost_aqm_${NEWDATE}
77+
78+
################################################
79+
# Compare with baseline data
80+
################################################
81+
fhr=`expr $fhr + 0`
82+
fhr2=`printf "%02d" $fhr`
83+
84+
# AQM post processing generates 1 file
85+
filelist="CMAQ${fhr2}.${tmmark}"
86+
87+
for file in $filelist; do
88+
export filein2=$file
89+
ls -l ${filein2}
90+
export err=$?
91+
92+
if [ $err = "0" ] ; then
93+
# use cmp to see if new pgb files are identical to the control one
94+
cmp ${filein2} $homedir/data_out/aqm/${filein2}.${machine}
95+
96+
# if not bit-identical, use cmp_grib2_grib2 to compare each grib record
97+
export err1=$?
98+
if [ $err1 -eq 0 ] ; then
99+
msg="aqm test: your new post executable generates bit-identical ${filein2} as the develop branch"
100+
echo $msg
101+
else
102+
msg="aqm test: your new post executable did not generate bit-identical ${filein2} as the develop branch"
103+
echo $msg
104+
echo " start comparing each grib record and write the comparison result to *diff files"
105+
echo " check these *diff files to make sure your new post only change variables which you intend to change"
106+
$cmp_grib2_grib2 $homedir/data_out/aqm/${filein2}.${machine} ${filein2} > ${filein2}.diff
107+
fi
108+
else
109+
msg="aqm test: post failed using your new post executable to generate ${filein2}"
110+
echo $msg 2>&1 | tee -a TEST_ERROR
111+
fi
112+
113+
postmsg "$logfile" "$msg"
114+
done
115+
116+
echo "PROGRAM IS COMPLETE!!!!!" 2>&1 | tee SUCCESS
117+
msg="Ending aqm test"
118+
postmsg "$logfile" "$msg"
Lines changed: 117 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,117 @@
1+
#!/bin/bash
2+
3+
#SBATCH -o out.post.aqm
4+
#SBATCH -e out.post.aqm
5+
#SBATCH -J aqm_test
6+
#SBATCH -t @[WTIME]
7+
#SBATCH -q @[QUEUE]
8+
#SBATCH -A @[accnr]
9+
#SBATCH @[EXCLUSIVE]
10+
#SBATCH -N @[NODES] --ntasks-per-node=@[N_TASKS_PER_NODE]
11+
12+
set -x
13+
14+
# specify computation resources
15+
export threads=1
16+
export MP_LABELIO=yes
17+
export OMP_NUM_THREADS=$threads
18+
export APRUN="srun"
19+
20+
echo "starting time"
21+
date
22+
23+
############################################
24+
# Loading modules
25+
############################################
26+
module purge
27+
module use ${svndir}/modulefiles
28+
module load $(echo "${machine}" | tr '[:upper:]' '[:lower:]')_${compiler}
29+
module load wgrib2/3.6.0
30+
module load prod_util/2.1.1
31+
module list
32+
33+
msg="Starting aqm test"
34+
postmsg "$logfile" "$msg"
35+
36+
export POSTGPEXEC=${svndir}/exec/upp.x
37+
38+
# specify forecast start time and hour for running your post job
39+
export startdate=2025103106
40+
export cyc=`echo $startdate | cut -c9-10`
41+
export fhr=008
42+
export tmmark=tm00
43+
44+
# specify your running and output directory
45+
export DATA=$rundir/aqm_${startdate}
46+
rm -rf $DATA; mkdir -p $DATA
47+
cd $DATA
48+
49+
export NEWDATE=`${NDATE} +${fhr} $startdate`
50+
export YY=`echo $NEWDATE | cut -c1-4`
51+
export MM=`echo $NEWDATE | cut -c5-6`
52+
export DD=`echo $NEWDATE | cut -c7-8`
53+
export HH=`echo $NEWDATE | cut -c9-10`
54+
55+
cat > itag <<EOF
56+
&model_inputs
57+
fileName='$homedir/data_in/aqm/aqm.t${cyc}z.dyn.f${fhr}.nc'
58+
IOFORM='netcdf'
59+
grib='grib2'
60+
DateStr='${YY}-${MM}-${DD}_${HH}:00:00'
61+
MODELNAME='FV3R'
62+
fileNameFlux='$homedir/data_in/aqm/aqm.t${cyc}z.phy.f${fhr}.nc'
63+
/
64+
&NAMPGB
65+
KPO=47,PO=1000.,975.,950.,925.,900.,875.,850.,825.,800.,775.,750.,725.,700.,675.,650.,625.,600.,575.,550.,525.,500.,475.,450.,425.,400.,375.,350.,325.,300.,275.,250.,225.,200.,175.,150.,125.,100.,70.,50.,30.,20.,10.,7.,5.,3.,2.,1.,aqf_on=.true.,
66+
/
67+
EOF
68+
69+
# copy fix data
70+
cp ${svndir}/fix/nam_micro_lookup.dat ./eta_micro_lookup.dat
71+
cp ${svndir}/parm/aqm/postxconfig-NT-AQM.txt ./postxconfig-NT.txt
72+
cp ${svndir}/parm/params_grib2_tbl_new ./params_grib2_tbl_new
73+
74+
# Run the UPP
75+
${APRUN} ${POSTGPEXEC} < itag > outpost_aqm_${NEWDATE}
76+
77+
################################################
78+
# Compare with baseline data
79+
################################################
80+
fhr=`expr $fhr + 0`
81+
fhr2=`printf "%02d" $fhr`
82+
83+
# AQM post processing generates 1 file
84+
filelist="CMAQ${fhr2}.${tmmark}"
85+
86+
for file in $filelist; do
87+
export filein2=$file
88+
ls -l ${filein2}
89+
export err=$?
90+
91+
if [ $err = "0" ] ; then
92+
# use cmp to see if new pgb files are identical to the control one
93+
cmp ${filein2} $homedir/data_out_$compiler/aqm/${filein2}.${machine}
94+
95+
# if not bit-identical, use cmp_grib2_grib2 to compare each grib record
96+
export err1=$?
97+
if [ $err1 -eq 0 ] ; then
98+
msg="aqm test: your new post executable generates bit-identical ${filein2} as the develop branch"
99+
echo $msg
100+
else
101+
msg="aqm test: your new post executable did not generate bit-identical ${filein2} as the develop branch"
102+
echo $msg
103+
echo " start comparing each grib record and write the comparison result to *diff files"
104+
echo " check these *diff files to make sure your new post only change variables which you intend to change"
105+
$cmp_grib2_grib2 $homedir/data_out_$compiler/aqm/${filein2}.${machine} ${filein2} > ${filein2}.diff
106+
fi
107+
else
108+
msg="aqm test: post failed using your new post executable to generate ${filein2}"
109+
echo $msg 2>&1 | tee -a TEST_ERROR
110+
fi
111+
112+
postmsg "$logfile" "$msg"
113+
done
114+
115+
echo "PROGRAM IS COMPLETE!!!!!" 2>&1 | tee SUCCESS
116+
msg="Ending aqm test"
117+
postmsg "$logfile" "$msg"

ci/jobs-dev/test.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -209,3 +209,11 @@ sfs() {
209209
esac
210210

211211
}
212+
213+
aqm() {
214+
215+
export WTIME=00:05:00
216+
export NODES=1
217+
export N_TASKS_PER_NODE=30
218+
219+
}

ci/rt.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ check_for_dash() {
9090
}
9191

9292
# Space required at start and and of string for pattern matching in check_valid_tests
93-
valid_tests=' sfs gefsv12 gefsv13 nmmb rap hrrr hafs 3drtma mpas mpas_hfip rrfs rrfs_ifi_missing gfs '
93+
valid_tests=' sfs aqm gefsv12 gefsv13 nmmb rap hrrr hafs 3drtma mpas mpas_hfip rrfs rrfs_ifi_missing gfs '
9494

9595
check_valid_tests() {
9696
local tests=${@}

ci/runtime.log.HERCULES_intel

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
sfs_test 00:01:20
2+
aqm_test 00:00:30
23
nmmb_test 00:03:00
34
gefsv12_test 00:01:00
45
gefsv13_test 00:02:00

ci/runtime.log.ORION_intel

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
sfs_test 00:01:20
2+
aqm_test 00:00:30
23
nmmb_test 00:03:00
34
gefsv12_test 00:01:00
45
gefsv13_test 00:02:00

ci/runtime.log.URSA_intel

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
sfs_test 00:01:20
2+
aqm_test 00:00:30
23
hrrr_ifi_test 00:05:00
34
rrfs_ifi_test 00:05:00
45
ifi_standalone_fv3r_test 00:05:00

ci/runtime.log.URSA_intelllvm

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
sfs_test 00:01:20
2+
aqm_test 00:00:30
23
hrrr_ifi_test 00:05:00
34
rrfs_ifi_test 00:05:00
45
ifi_standalone_fv3r_test 00:05:00

ci/runtime.log.WCOSS2_intel

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
sfs_test 00:00:50
2+
aqm_test 00:01:00
23
gefsv12_test 00:01:20
34
gefsv13_test 00:02:00
45
nmmb_test 00:02:20
File renamed without changes.

0 commit comments

Comments
 (0)