Skip to content

Commit

Permalink
Add in initial 3DVar aerosol DA cycling capability (NOAA-EMC#1106)
Browse files Browse the repository at this point in the history
This PR adds an initial 3DVar aerosol DA cycling capability to support scientific development and testing towards an operationally viable candidate system for aerosol DA for GFSv17/GEFSv13.

This PR includes the following:
- Three new j-jobs and ex-scripts for aeroanlinit, aeroanlrun, and aeroanlfinal
- modifies the rocoto scripts that call the above j-jobs to actually call them
- makes modification to the config.resources and config.aeroanl files
- Introduces an object-oriented python structure to initialize/finalize the aerosol analysis with the intention of eventually using the top-level classes for other analysis jobs (soca, atm, land)

Closes NOAA-EMC#982
  • Loading branch information
CoryMartin-NOAA committed Feb 10, 2023
1 parent cc54b8c commit 1040216
Show file tree
Hide file tree
Showing 24 changed files with 804 additions and 28 deletions.
62 changes: 62 additions & 0 deletions jobs/JGLOBAL_AERO_ANALYSIS_FINALIZE
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
#! /usr/bin/env bash

source "${HOMEgfs}/ush/preamble.sh"
export WIPE_DATA="NO"
export DATA=${DATA:-${DATAROOT}/${RUN}aeroanl_${cyc}}
source "${HOMEgfs}/ush/jjob_header.sh" -e "aeroanlfinal" -c "base aeroanl aeroanlfinal"

##############################################
# Set variables used in the script
##############################################
export CDATE=${CDATE:-${PDY}${cyc}}
export CDUMP=${CDUMP:-${RUN:-"gfs"}}


##############################################
# Begin JOB SPECIFIC work
##############################################

GDATE=$(date +%Y%m%d%H -d "${CDATE:0:8} ${CDATE:8:2} - ${assim_freq} hours")
export GDATE
gPDY=${GDATE:0:8}
export gcyc=${GDATE:8:2}
export GDUMP=${GDUMP:-"gdas"}

export OPREFIX="${CDUMP}.t${cyc}z."
export GPREFIX="${GDUMP}.t${gcyc}z."
export APREFIX="${CDUMP}.t${cyc}z."

export COMOUT=${COMOUT:-${ROTDIR}/${CDUMP}.${PDY}/${cyc}/chem}

mkdir -p "${COMOUT}"

# COMIN_GES and COMIN_GES_ENS are used in script
export COMIN_GES="${ROTDIR}/${GDUMP}.${gPDY}/${gcyc}/chem"
export COMIN_GES_ENS="${ROTDIR}/enkf${GDUMP}.${gPDY}/${gcyc}/chem"

###############################################################
# Run relevant script

EXSCRIPT=${GDASAEROFINALPY:-${HOMEgfs}/scripts/exglobal_aero_analysis_finalize.py}
${EXSCRIPT}
status=$?
[[ ${status} -ne 0 ]] && exit "${status}"

##############################################
# End JOB SPECIFIC work
##############################################

##############################################
# Final processing
##############################################
if [[ -e "${pgmout}" ]] ; then
cat "${pgmout}"
fi

##########################################
# Remove the Temporary working directory
##########################################
cd "${DATAROOT}" || exit 1
[[ ${KEEPDATA} = "NO" ]] && rm -rf "${DATA}"

exit 0
55 changes: 55 additions & 0 deletions jobs/JGLOBAL_AERO_ANALYSIS_INITIALIZE
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
#! /usr/bin/env bash

source "${HOMEgfs}/ush/preamble.sh"
export DATA=${DATA:-${DATAROOT}/${RUN}aeroanl_${cyc}}
source "${HOMEgfs}/ush/jjob_header.sh" -e "aeroanlinit" -c "base aeroanl aeroanlinit"

##############################################
# Set variables used in the script
##############################################
export CDATE=${CDATE:-${PDY}${cyc}}
export CDUMP=${CDUMP:-${RUN:-"gfs"}}


##############################################
# Begin JOB SPECIFIC work
##############################################

GDATE=$(date +%Y%m%d%H -d "${CDATE:0:8} ${CDATE:8:2} - ${assim_freq} hours")
export GDATE
gPDY=${GDATE:0:8}
export gcyc=${GDATE:8:2}
export GDUMP=${GDUMP:-"gdas"}

export OPREFIX="${CDUMP}.t${cyc}z."
export GPREFIX="${GDUMP}.t${gcyc}z."
export APREFIX="${CDUMP}.t${cyc}z."

export COMOUT=${COMOUT:-${ROTDIR}/${CDUMP}.${PDY}/${cyc}/chem}

mkdir -p "${COMOUT}"

# COMIN_GES and COMIN_GES_ENS are used in script
export COMIN_GES="${ROTDIR}/${GDUMP}.${gPDY}/${gcyc}/chem"
export COMIN_GES_ENS="${ROTDIR}/enkf${GDUMP}.${gPDY}/${gcyc}/chem"

###############################################################
# Run relevant script

EXSCRIPT=${GDASAEROINITPY:-${HOMEgfs}/scripts/exglobal_aero_analysis_initialize.py}
${EXSCRIPT}
status=$?
[[ ${status} -ne 0 ]] && exit "${status}"

##############################################
# End JOB SPECIFIC work
##############################################

##############################################
# Final processing
##############################################
if [[ -e "${pgmout}" ]] ; then
cat "${pgmout}"
fi

exit 0
56 changes: 56 additions & 0 deletions jobs/JGLOBAL_AERO_ANALYSIS_RUN
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
#! /usr/bin/env bash

source "${HOMEgfs}/ush/preamble.sh"
export WIPE_DATA="NO"
export DATA=${DATA:-${DATAROOT}/${RUN}aeroanl_${cyc}}
source "${HOMEgfs}/ush/jjob_header.sh" -e "aeroanlrun" -c "base aeroanl aeroanlrun"

##############################################
# Set variables used in the script
##############################################
export CDATE=${CDATE:-${PDY}${cyc}}
export CDUMP=${CDUMP:-${RUN:-"gfs"}}


##############################################
# Begin JOB SPECIFIC work
##############################################

GDATE=$(date +%Y%m%d%H -d "${CDATE:0:8} ${CDATE:8:2} - ${assim_freq} hours")
export GDATE
gPDY=${GDATE:0:8}
export gcyc=${GDATE:8:2}
export GDUMP=${GDUMP:-"gdas"}

export OPREFIX="${CDUMP}.t${cyc}z."
export GPREFIX="${GDUMP}.t${gcyc}z."
export APREFIX="${CDUMP}.t${cyc}z."

export COMOUT=${COMOUT:-${ROTDIR}/${CDUMP}.${PDY}/${cyc}/chem}

mkdir -p "${COMOUT}"

# COMIN_GES and COMIN_GES_ENS are used in script
export COMIN_GES="${ROTDIR}/${GDUMP}.${gPDY}/${gcyc}/chem"
export COMIN_GES_ENS="${ROTDIR}/enkf${GDUMP}.${gPDY}/${gcyc}/chem"

###############################################################
# Run relevant script

EXSCRIPT=${GDASAERORUNSH:-${HOMEgfs}/scripts/exglobal_aero_analysis_run.sh}
${EXSCRIPT}
status=$?
[[ ${status} -ne 0 ]] && exit "${status}"

##############################################
# End JOB SPECIFIC work
##############################################

##############################################
# Final processing
##############################################
if [[ -e "${pgmout}" ]] ; then
cat "${pgmout}"
fi

exit 0
18 changes: 13 additions & 5 deletions jobs/rocoto/aeroanlfinal.sh
Original file line number Diff line number Diff line change
@@ -1,15 +1,23 @@
#! /usr/bin/env bash

source "$HOMEgfs/ush/preamble.sh"
source "${HOMEgfs}/ush/preamble.sh"

###############################################################
# Source FV3GFS workflow modules
. $HOMEgfs/ush/load_fv3gfs_modules.sh
# Source UFSDA workflow modules
. "${HOMEgfs}/ush/load_ufsda_modules.sh"
status=$?
[[ $status -ne 0 ]] && exit $status
[[ ${status} -ne 0 ]] && exit "${status}"

export job="aeroanlfinal"
export jobid="${job}.$$"

###############################################################
echo "Do nothing for now"
# setup python path for workflow utilities and tasks
pygwPATH="${HOMEgfs}/ush/python:${HOMEgfs}/ush/python/pygw/src"
PYTHONPATH="${PYTHONPATH:+${PYTHONPATH}:}${pygwPATH}"
export PYTHONPATH
###############################################################
# Execute the JJOB
"${HOMEgfs}/jobs/JGLOBAL_AERO_ANALYSIS_FINALIZE"
status=$?
exit "${status}"
19 changes: 14 additions & 5 deletions jobs/rocoto/aeroanlinit.sh
Original file line number Diff line number Diff line change
@@ -1,15 +1,24 @@
#! /usr/bin/env bash

source "$HOMEgfs/ush/preamble.sh"
source "${HOMEgfs}/ush/preamble.sh"

###############################################################
# Source FV3GFS workflow modules
. $HOMEgfs/ush/load_fv3gfs_modules.sh
# Source UFSDA workflow modules
. "${HOMEgfs}/ush/load_ufsda_modules.sh"
status=$?
[[ $status -ne 0 ]] && exit $status
[[ ${status} -ne 0 ]] && exit "${status}"

export job="aeroanlinit"
export jobid="${job}.$$"

###############################################################
echo "Do nothing for now"
# setup python path for workflow utilities and tasks
pygwPATH="${HOMEgfs}/ush/python:${HOMEgfs}/ush/python/pygw/src"
PYTHONPATH="${PYTHONPATH:+${PYTHONPATH}:}${pygwPATH}"
export PYTHONPATH

###############################################################
# Execute the JJOB
"${HOMEgfs}/jobs/JGLOBAL_AERO_ANALYSIS_INITIALIZE"
status=$?
exit "${status}"
13 changes: 8 additions & 5 deletions jobs/rocoto/aeroanlrun.sh
Original file line number Diff line number Diff line change
@@ -1,15 +1,18 @@
#! /usr/bin/env bash

source "$HOMEgfs/ush/preamble.sh"
source "${HOMEgfs}/ush/preamble.sh"

###############################################################
# Source FV3GFS workflow modules
. $HOMEgfs/ush/load_fv3gfs_modules.sh
# Source UFSDA workflow modules
. "${HOMEgfs}/ush/load_ufsda_modules.sh"
status=$?
[[ $status -ne 0 ]] && exit $status
[[ ${status} -ne 0 ]] && exit "${status}"

export job="aeroanlrun"
export jobid="${job}.$$"

###############################################################
echo "Do nothing for now"
# Execute the JJOB
"${HOMEgfs}/jobs/JGLOBAL_AERO_ANALYSIS_RUN"
status=$?
exit "${status}"
17 changes: 12 additions & 5 deletions parm/config/config.aeroanl
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,20 @@

echo "BEGIN: config.aeroanl"

export OBS_YAML_DIR=$HOMEgfs/sorc/gdas.cd/parm/aero/obs/config/
export OBS_LIST=$HOMEgfs/sorc/gdas.cd/parm/aero/obs/lists/aero_prototype.yaml
export AEROVARYAML=$HOMEgfs/sorc/gdas.cd/parm/aero/variational/3dvar_dripcg.yaml
export BERROR_YAML=$HOMEgfs/sorc/gdas.cd/parm/aero/berror/static_bump.yaml
export FV3JEDI_FIX=$HOMEgfs/fix/gdas
export CASE_ANL=${CASE}
export OBS_YAML_DIR=${HOMEgfs}/sorc/gdas.cd/parm/aero/obs/config/
export OBS_LIST=${HOMEgfs}/sorc/gdas.cd/parm/aero/obs/lists/gdas_aero_prototype.yaml
export AEROVARYAML=${HOMEgfs}/sorc/gdas.cd/parm/aero/variational/3dvar_gfs_aero.yaml
export STATICB_TYPE='identity'
export BERROR_YAML=${HOMEgfs}/sorc/gdas.cd/parm/aero/berror/staticb_${STATICB_TYPE}.yaml
export FV3JEDI_FIX=${HOMEgfs}/fix/gdas
export BERROR_DATA_DIR=${FV3JEDI_FIX}/bump/aero/${CASE_ANL}/
export BERROR_DATE="20160630.000000"

export io_layout_x=@IO_LAYOUT_X@
export io_layout_y=@IO_LAYOUT_Y@

export JEDIVAREXE=${HOMEgfs}/exec/fv3jedi_var.x
export CRTM_VER="2.3.0"

echo "END: config.aeroanl"
3 changes: 0 additions & 3 deletions parm/config/config.aeroanlrun
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,4 @@ echo "BEGIN: config.aeroanlrun"
# Get task specific resources
. $EXPDIR/config.resources aeroanlrun

# Task specific variables
export JEDIVAREXE=$HOMEgfs/exec/fv3jedi_var.x

echo "END: config.aeroanlrun"
29 changes: 27 additions & 2 deletions parm/config/config.resources
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,28 @@ elif [[ "${step}" = "atmanalpost" ]]; then

elif [[ "${step}" = "aeroanlinit" ]]; then

# below lines are for creating JEDI YAML
case ${CASE} in
C768)
layout_x=6
layout_y=6
;;
C384)
layout_x=5
layout_y=5
;;
C192 | C96 | C48)
layout_x=8
layout_y=8
;;
*)
echo "FATAL ERROR: Resolution not supported for aerosol analysis'"
exit 1
esac

export layout_x
export layout_y

export wtime_aeroanlinit="00:10:00"
export npe_aeroanlinit=1
export nth_aeroanlinit=1
Expand All @@ -212,14 +234,17 @@ elif [[ "${step}" = "aeroanlrun" ]]; then
layout_y=5
;;
C192 | C96 | C48)
layout_x=3
layout_y=3
layout_x=8
layout_y=8
;;
*)
echo "FATAL: Resolution not supported'"
exit 1
esac

export layout_x
export layout_y

export wtime_aeroanlrun="00:30:00"
npe_aeroanlrun=$(echo "${layout_x} * ${layout_y} * 6" | bc)
export npe_aeroanlrun
Expand Down
23 changes: 23 additions & 0 deletions parm/parm_gdas/aero_crtm_coeff.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
mkdir:
- !ENV ${DATA}/crtm/
copy:
- - !ENV ${FV3JEDI_FIX}/crtm/${CRTM_VER}/AerosolCoeff.bin
- !ENV ${DATA}/crtm/AerosolCoeff.bin
- - !ENV ${FV3JEDI_FIX}/crtm/${CRTM_VER}/CloudCoeff.bin
- !ENV ${DATA}/crtm/CloudCoeff.bin
- - !ENV ${FV3JEDI_FIX}/crtm/${CRTM_VER}/v.viirs-m_npp.SpcCoeff.bin
- !ENV ${DATA}/crtm/v.viirs-m_npp.SpcCoeff.bin
- - !ENV ${FV3JEDI_FIX}/crtm/${CRTM_VER}/v.viirs-m_npp.TauCoeff.bin
- !ENV ${DATA}/crtm/v.viirs-m_npp.TauCoeff.bin
- - !ENV ${FV3JEDI_FIX}/crtm/${CRTM_VER}/v.viirs-m_j1.SpcCoeff.bin
- !ENV ${DATA}/crtm/v.viirs-m_j1.SpcCoeff.bin
- - !ENV ${FV3JEDI_FIX}/crtm/${CRTM_VER}/v.viirs-m_j1.TauCoeff.bin
- !ENV ${DATA}/crtm/v.viirs-m_j1.TauCoeff.bin
- - !ENV ${FV3JEDI_FIX}/crtm/${CRTM_VER}/NPOESS.VISice.EmisCoeff.bin
- !ENV ${DATA}/crtm/NPOESS.VISice.EmisCoeff.bin
- - !ENV ${FV3JEDI_FIX}/crtm/${CRTM_VER}/NPOESS.VISland.EmisCoeff.bin
- !ENV ${DATA}/crtm/NPOESS.VISland.EmisCoeff.bin
- - !ENV ${FV3JEDI_FIX}/crtm/${CRTM_VER}/NPOESS.VISsnow.EmisCoeff.bin
- !ENV ${DATA}/crtm/NPOESS.VISsnow.EmisCoeff.bin
- - !ENV ${FV3JEDI_FIX}/crtm/${CRTM_VER}/NPOESS.VISwater.EmisCoeff.bin
- !ENV ${DATA}/crtm/NPOESS.VISwater.EmisCoeff.bin
11 changes: 11 additions & 0 deletions parm/parm_gdas/aero_jedi_fix.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
mkdir:
- !ENV ${DATA}/fv3jedi
copy:
- - !ENV ${FV3JEDI_FIX}/fv3jedi/fv3files/akbk$(npz).nc4
- !ENV ${DATA}/fv3jedi/akbk.nc4
- - !ENV ${FV3JEDI_FIX}/fv3jedi/fv3files/fmsmpp.nml
- !ENV ${DATA}/fv3jedi/fmsmpp.nml
- - !ENV ${FV3JEDI_FIX}/fv3jedi/fv3files/field_table_gfdl
- !ENV ${DATA}/fv3jedi/field_table
- - !ENV ${FV3JEDI_FIX}/fv3jedi/fieldmetadata/gfs-aerosol.yaml
- !ENV ${DATA}/fv3jedi/gfs-restart.yaml
1 change: 1 addition & 0 deletions parm/parm_gdas/aeroanl_inc_vars.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
['dust1', 'dust2', 'dust3', 'dust4', 'dust5', 'seas1', 'seas2', 'seas3', 'seas4', 'so4', 'oc1', 'oc2', 'bc1', 'bc2']
Loading

0 comments on commit 1040216

Please sign in to comment.