Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
76 changes: 76 additions & 0 deletions ci/jobs-dev/run_ifi_standalone_mpas_rrfs_URSA.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
#!/bin/bash

#SBATCH -o out.post.ifi_standalone_mpas_rrfs
#SBATCH -e out.post.ifi_standalone_mpas_rrfs
#SBATCH -J ifi_standalone_mpas_rrfs
#SBATCH -t 00:30:00
#SBATCH -q batch
#SBATCH -A rtrr
#SBATCH --ntasks=1
#SBATCH --cpus-per-task=40
#SBATCH --exclusive

# specify computation resource
export threads=40
export MP_LABELIO=yes
export OMP_NUM_THREADS=$threads
export OMP_STACKSIZE=512M
export APRUN="srun"

############################################
# Loading module
############################################

# EXPORT list here

module purge
module use $svndir/modulefiles
module load ursa_$compiler
module load ursa_${compiler}_ifi_test_prereqs
module load wgrib2/3.6.0
module load prod_util/2.1.1
module load nccmp/1.9.1.0
module list

ulimit -s unlimited
ulimit

msg="Starting ifi_standalone_mpas_rrfs test"
postmsg "$logfile" "$msg"


FIPEXEC=${svndir}/exec/fip_runner

# use the UPP run directory so we get the input files in the expected format
export startdate=2026092806
export DATA=$rundir/mpas_rrfs_ifi_${startdate}
cd $DATA

upp_output=cat_vars_0.nc
ifi_standalone_output=20260928/fip_icing_category.20260928_g_060000_f_00043200.nc
diff_file=cat_vars_0.nc.diff

$APRUN --cpus-per-task=$OMP_NUM_THREADS --nodes=1 --ntasks=1 --exclusive \
"$FIPEXEC" -u hybr_vars_0.nc hybr_vars_0.nc .

nccmp -dfc1 -v ICE_PROB,ICE_SEV_CAT,SLD,WMO_ICE_SEV_CAT "$upp_output" "$ifi_standalone_output" 2>&1 | tee "$diff_file"
export err1=$?

if [ -s "$ifi_standalone_output" ] ; then
if [ $err1 -eq 0 ] && ! [ -s "$diff_file" ] ; then
msg="ifi standalone_fv3r test: Passed. libIFI standalone program and IFI in UPP produce identical results"
rm -f "$diff_file"
echo $msg
else
msg="ifi standalone_fv3r test: Failed. Differences detected between libIFI standalone and UPP IFI output."
echo $msg
fi
else
msg="ifi standalone_fv3r test: Failed. ifi standalone failed using your new executable to generate $ifi_standalone_output"
echo $msg 2>&1 | tee -a TEST_ERROR
fi
postmsg "$logfile" "$msg"

echo "PROGRAM IS COMPLETE!!!!!" 2>&1 | tee SUCCESS
msg="Ending ifi_standalone_mpas_rrfs test"
postmsg "$logfile" "$msg"
116 changes: 116 additions & 0 deletions ci/jobs-dev/run_post_mpas_rrfs_ifi_URSA.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,116 @@
#!/bin/bash

#SBATCH -o out.post.mpas_rrfs_ifi
#SBATCH -e out.post.mpas_rrfs_ifi
#SBATCH -J mpas_rrfs_ifi_test
#SBATCH -t 00:30:00
#SBATCH -q batch
#SBATCH -A ovp
#SBATCH --exclusive
#SBATCH -N 2 --ntasks-per-node=24

# specify computation resources
export MP_LABELIO=yes
export threads=1
export OMP_NUM_THREADS=$threads
export APRUN="srun"

echo "starting time"
date

############################################
# Loading modules
############################################
module purge
module use $svndir/modulefiles
module load ursa_$compiler
module load wgrib2/3.6.0
module load prod_util/2.1.1
module load nccmp/1.9.1.0
module list

msg="Starting mpas_rrfs_ifi test"
postmsg "$logfile" "$msg"

export POSTGPEXEC=${svndir}/exec/upp_with_ifi.x

# specify forecast start time and hour for running your post job
export startdate=2026092806
export fhr=12

# specify your running and output directory
export DATA=$rundir/mpas_rrfs_ifi_${startdate}
rm -rf $DATA; mkdir -p $DATA
cd $DATA

export NEWDATE=`${NDATE} +${fhr} $startdate`
export YY=`echo ${NEWDATE} | cut -c1-4`
export MM=`echo ${NEWDATE} | cut -c5-6`
export DD=`echo ${NEWDATE} | cut -c7-8`
export HH=`echo ${NEWDATE} | cut -c9-10`

cat > itag <<EOF
&model_inputs
fileName='$homedir/data_in/mpas_rrfs_ifi/mpassit.${YY}-${MM}-${DD}_${HH}.00.00.nc'
fileNameFlux='$homedir/data_in/mpas_rrfs_ifi/mpassit.${YY}-${MM}-${DD}_${HH}.00.00.nc'
IOFORM='netcdfpara'
grib='grib2'
DateStr='${YY}-${MM}-${DD}_${HH}:00:00'
MODELNAME='RAPR'
SUBMODELNAME='MPAS'
/
&NAMPGB
numx=2
write_ifi_debug_files=.true.
/
EOF

# copy fix data
cp ${svndir}/parm/params_grib2_tbl_new params_grib2_tbl_new
cp ${svndir}/parm/postxconfig-NT-ifi.txt postxconfig-NT.txt
cp ${svndir}/fix/rap_micro_lookup.dat eta_micro_lookup.dat

# Run the UPP
${APRUN} ${POSTGPEXEC} < itag > outpost_mpas_rrfs_ifi_${NEWDATE}

################################################
# Compare with baseline data
################################################
fhr=`expr $fhr + 0`
fhr2=`printf "%02d" $fhr`

# MPAS RRFS_IFI post processing generates 1 file
filelist="IFIFIP.GrbF${fhr2}"

for file in $filelist; do
export filein2=$file
ls -l ${filein2}
export err=$?

if [ $err = "0" ] ; then
# use cmp to see if new pgb files are identical to the control one
cmp ${filein2} $homedir/data_out_$compiler/mpas_rrfs_ifi/${filein2}.${machine}

# if not bit-identical, use cmp_grib2_grib2 to compare each grib record
export err1=$?
if [ $err1 -eq 0 ] ; then
msg="mpas_rrfs_ifi test: your new post executable generates bit-identical ${filein2} as the develop branch"
echo $msg
else
msg="mpas_rrfs_ifi test: your new post executable did not generate bit-identical ${filein2} as the develop branch"
echo $msg
echo " start comparing each grib record and write the comparison result to *diff files"
echo " check these *diff files to make sure your new post only change variables which you intend to change"
$cmp_grib2_grib2 $homedir/data_out_$compiler/mpas_rrfs_ifi/${filein2}.${machine} ${filein2} > ${filein2}.diff
fi
else
msg="mpas_rrfs_ifi test: post failed using your new post executable to generate ${filein2}"
echo $msg 2>&1 | tee -a TEST_ERROR
fi

postmsg "$logfile" "$msg"
done

echo "PROGRAM IS COMPLETE!!!!!" 2>&1 | tee SUCCESS
msg="Ending mpas_rrfs_ifi test"
postmsg "$logfile" "$msg"
119 changes: 119 additions & 0 deletions ci/jobs-dev/run_post_mpas_rrfs_ifi_WCOSS2.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,119 @@
#!/bin/bash

#PBS -o out.post.mpas_rrfs_ifi
#PBS -e out.post.mpas_rrfs_ifi
#PBS -N mpas_rrfs_ifi_test
#PBS -l walltime=00:30:00
#PBS -q dev
#PBS -A GFS-DEV
#PBS -l place=vscatter,select=2:ncpus=48
#PBS -V

set -x

# specify computation resources
export MP_LABELIO=yes
export threads=1
export OMP_NUM_THREADS=$threads
export APRUN="mpiexec -l -n 96 -ppn 48"

echo "starting time"
date

############################################
# Loading modules
############################################
module reset
module use ${svndir}/modulefiles
module load wcoss2_intel
module load cray-pals/1.0.12
module load libjpeg/9c
module load prod_util/2.0.14
module load wgrib2/2.0.8
module list

msg="Starting mpas_rrfs_ifi test"
postmsg "$logfile" "$msg"

export POSTGPEXEC=${svndir}/exec/upp.x

# specify forecast start time and hour for running your post job
export startdate=2026092806
export fhr=12

# specify your running and output directory
export DATA=$rundir/mpas_rrfs_ifi_${startdate}
rm -rf $DATA; mkdir -p $DATA
cd $DATA

export NEWDATE=`${NDATE} +${fhr} $startdate`
export YY=`echo ${NEWDATE} | cut -c1-4`
export MM=`echo ${NEWDATE} | cut -c5-6`
export DD=`echo ${NEWDATE} | cut -c7-8`
export HH=`echo ${NEWDATE} | cut -c9-10`

cat > itag <<EOF
&model_inputs
fileName='$homedir/data_in/mpas_rrfs_ifi/mpassit.${YY}-${MM}-${DD}_${HH}.00.00.nc'
fileNameFlux='$homedir/data_in/mpas_rrfs_ifi/mpassit.${YY}-${MM}-${DD}_${HH}.00.00.nc'
IOFORM='netcdfpara'
grib='grib2'
DateStr='${YY}-${MM}-${DD}_${HH}:00:00'
MODELNAME='RAPR'
SUBMODELNAME='MPAS'
/
&NAMPGB
numx=2
write_ifi_debug_files=.true.
/
EOF

# copy fix data
cp ${svndir}/parm/params_grib2_tbl_new params_grib2_tbl_new
cp ${svndir}/parm/postxconfig-NT-ifi.txt postxconfig-NT.txt
cp ${svndir}/fix/rap_micro_lookup.dat eta_micro_lookup.dat

# Run the UPP
${APRUN} ${POSTGPEXEC} < itag > outpost_mpas_rrfs_ifi_${NEWDATE}

################################################
# Compare with baseline data
################################################
fhr=`expr $fhr + 0`
fhr2=`printf "%02d" $fhr`

# MPAS RRFS_IFI post processing generates 1 file
filelist="IFIFIP.GrbF${fhr2}"

for file in $filelist; do
export filein2=$file
ls -l ${filein2}
export err=$?

if [ $err = "0" ] ; then
# use cmp to see if new pgb files are identical to the control one
cmp ${filein2} $homedir/data_out/mpas_rrfs_ifi/${filein2}.${machine}

# if not bit-identical, use cmp_grib2_grib2 to compare each grib record
export err1=$?
if [ $err1 -eq 0 ] ; then
msg="mpas_rrfs_ifi test: your new post executable generates bit-identical ${filein2} as the develop branch"
echo $msg
else
msg="mpas_rrfs_ifi test: your new post executable did not generate bit-identical ${filein2} as the develop branch"
echo $msg
echo " start comparing each grib record and write the comparison result to *diff files"
echo " check these *diff files to make sure your new post only change variables which you intend to change"
$cmp_grib2_grib2 $homedir/data_out/mpas_rrfs_ifi/${filein2}.${machine} ${filein2} > ${filein2}.diff
fi
else
msg="mpas_rrfs_ifi test: post failed using your new post executable to generate ${filein2}"
echo $msg 2>&1 | tee -a TEST_ERROR
fi

postmsg "$logfile" "$msg"
done

echo "PROGRAM IS COMPLETE!!!!!" 2>&1 | tee SUCCESS
msg="Ending mpas_rrfs_ifi test"
postmsg "$logfile" "$msg"
3 changes: 2 additions & 1 deletion ci/submit_jobs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
# This script is used to submit test jobs on R&D machines.
# # Wen Meng 05/2025 First version.
# # Ben Blake 04/2026 Remove RRFS IFI support
# # Sam Trahan 11/2026 Added MPAS RRFS IFI support
# ##########################################################################

export jobid_list=""
Expand All @@ -17,7 +18,7 @@ done

#Run additional ifi tests
if [[ "$have_ifi" == "yes" && "$disable_ifi" == "no" ]] ; then
for model in hrrr; do
for model in hrrr mpas_rrfs; do
cp "$svndir/ci/jobs-dev/run_post_${model}_ifi_${machine}.sh" .
job_id=$(sbatch --parsable -A "$accnr" "run_post_${model}_ifi_${machine}.sh")
jobid_list="${jobid_list} $job_id"
Expand Down
3 changes: 2 additions & 1 deletion ci/submit_jobs_WCOSS2.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
# # Wen Meng 05/2025 First version.
# # Ben Blake 04/2026 Remove RRFS IFI support
# # Ben Blake 05/2026 Add WAFS test
# # Ben Blake 11/2026 Add MPAS RRFS IFI support
# ##########################################################################

jobid_list=""
Expand All @@ -18,7 +19,7 @@ done

# Run additional IFI tests
if [[ "$have_ifi" == "yes" && "$disable_ifi" == "no" ]] ; then
for ifi_test in hrrr_ifi; do
for ifi_test in hrrr_ifi mpas_rrfs_ifi; do
cp $svndir/ci/jobs-dev/run_post_${ifi_test}_${machine}.sh .
job_id=$(qsub -A "${accnr}" run_post_${ifi_test}_${machine}.sh)
jobid_list="${jobid_list} ${job_id}"
Expand Down
Loading