diff --git a/ush/JEDI/readme.md b/ush/JEDI/readme.md index 82f0fd896c..cb8f1479cb 100644 --- a/ush/JEDI/readme.md +++ b/ush/JEDI/readme.md @@ -25,6 +25,11 @@ Things to change in submit_run_gsi.sh include: - guessroot: path to $ROTDIR - jcap, jcap_b, levs: hopefully self explanatory, set to match your background files - dump: gdas or gfs + +Things specific to the IODA-converters portion +- iodaconvbuild: path to the build directory of the ioda-converters +- JEDImodule: path to a modulefile to source to get the JEDI environment + Other things one can change - RootWork: defaults to stmp2 but can be anywhere - obsdir: default is glopara global dump diff --git a/ush/JEDI/run_gsi_iodaconv.sh b/ush/JEDI/run_gsi_iodaconv.sh new file mode 100755 index 0000000000..e504f1deb3 --- /dev/null +++ b/ush/JEDI/run_gsi_iodaconv.sh @@ -0,0 +1,43 @@ +#!/bin/bash +# run_gsincdiag_iodaconv.sh +# run python ioda-iodaconverters +# on GSI netCDF diag files to generate +# IODA formatted observations for UFO H(x) +# cory.r.martin@noaa.gov +set -x +## variable definitions +MYDIR=`dirname "$0"` +YAMLFILE=$1 +## source helper functions +source $MYDIR/helpers/parse_yaml.sh + +## read YAML config file +if [[ -e $YAMLFILE ]]; then + eval $(parse_yaml $YAMLFILE "IODA_") +else + echo "ERROR: YAML FILE $YAMLFILE DOES NOT EXIST, ABORT!" + exit 1 +fi + +# source modulefile to get proper python on environment +source $IODA_env_modulefile + +# make working directory +rm -rf $IODA_data_iodaworkdir +mkdir -p $IODA_data_iodaworkdir +cd $IODA_data_iodaworkdir + +# make output directory +rm -rf $IODA_data_iodaoutdir +mkdir -p $IODA_data_iodaoutdir + +# +# run script +$IODA_iodaconv_iodaconvbin -n 20 -o $IODA_data_iodaoutdir $IODA_data_gsiindir + +if [[ "$IODA_iodaconv_cleanup" = "true" ]]; then + cd $IODA_data_iodaoutdir + rm -rf $IODA_data_iodaworkdir +fi +date +echo "GSI ncdiag ioda converter script completed" diff --git a/ush/JEDI/submit_run_gsi.sh b/ush/JEDI/submit_run_gsi.sh index 9623ec6ad7..62768e44e3 100644 --- a/ush/JEDI/submit_run_gsi.sh +++ b/ush/JEDI/submit_run_gsi.sh @@ -16,10 +16,12 @@ jcap=766 jcap_b=1534 levs=64 dump='gdas' +iodaconvbuild=/scratch1/NCEPDEV/da/Cory.R.Martin/JEDI/ioda-converters/build +JEDImodule=/scratch1/NCEPDEV/da/Cory.R.Martin/JEDI/env_jedi_rh ##### things it is not necessary to change but you can RootWork=/scratch1/NCEPDEV/stmp2/$LOGNAME/GSI_forJEDI/ obsdir=/scratch1/NCEPDEV/global/glopara/dump/ -rstprod='false' +rstprod='true' cleanup='true' ##### do not modify below here #### @@ -31,6 +33,7 @@ Ha=`echo $adate | cut -c9-10` mkdir -p $RootWork +# create YAML for GSI observer rm -rf $RootWork/GSI_observer_$adate.yaml cat > $RootWork/GSI_observer_$adate.yaml << EOF background: @@ -50,8 +53,8 @@ observations: observer: cleanup: $cleanup gsidir: $GSIDir - outputdir: $RootWork/${adate}_out - workdir: $RootWork/${adate}_work + outputdir: $RootWork/${adate}/GSI_out + workdir: $RootWork/${adate}/GSI_work time: cycle: '$Ha' day: '$Da' @@ -59,4 +62,28 @@ time: year: '$Ya' EOF -$MyDir/run_gsi_observer.sh $RootWork/GSI_observer_$adate.yaml +# run GSI observer +$MyDir/run_gsi_observer.sh $RootWork/GSI_observer_$adate.yaml || exit 1 + +# create YAML for IODA converters +rm -rf $RootWork/GSI_iodaconv_$adate.yaml +cat > $RootWork/GSI_iodaconv_$adate.yaml << EOF +data: + gsiindir: $RootWork/${adate}/GSI_out + iodaoutdir: $RootWork/${adate}/output + iodaworkdir: $RootWork/${adate}/iodaconv_work +env: + launcher: srun --export=ALL + modulefile: $JEDImodule + nthreads: 1 +iodaconv: + iodaconvbin: $iodaconvbuild/bin/proc_gsi_ncdiag.py +time: + cycle: '$Ha' + day: '$Da' + month: '$Ma' + year: '$Ya' +EOF + +# run IODA converters +$MyDir/run_gsi_iodaconv.sh $RootWork/GSI_iodaconv_$adate.yaml || exit 1