Skip to content

Commit

Permalink
add in ioda converters step; need to still add geovals part
Browse files Browse the repository at this point in the history
  • Loading branch information
CoryMartin-NOAA committed Oct 23, 2020
1 parent 061c024 commit f461eb2
Show file tree
Hide file tree
Showing 3 changed files with 79 additions and 4 deletions.
5 changes: 5 additions & 0 deletions ush/JEDI/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
43 changes: 43 additions & 0 deletions ush/JEDI/run_gsi_iodaconv.sh
Original file line number Diff line number Diff line change
@@ -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)
# [email protected]
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"
35 changes: 31 additions & 4 deletions ush/JEDI/submit_run_gsi.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 ####
Expand All @@ -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:
Expand All @@ -50,13 +53,37 @@ 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'
month: '$Ma'
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

0 comments on commit f461eb2

Please sign in to comment.