Skip to content

Commit

Permalink
Add observation preparation job for aerosols DA to workflow (NOAA-EMC…
Browse files Browse the repository at this point in the history
…#2624)

Add a prepaeroobs job to prepare aerosol obs files for DA.

This job does quality control of the VIIRS aerosol raw observations and
convert them to ioda format.

Resolves NOAA-EMC#2623 
---------

Co-authored-by: ypwang19 <[email protected]>
Co-authored-by: TerrenceMcGuinness-NOAA <[email protected]>
Co-authored-by: Cory Martin <[email protected]>
Co-authored-by: David Huber <[email protected]>
  • Loading branch information
5 people authored Jun 14, 2024
1 parent 5a5fc2b commit 6c93b45
Show file tree
Hide file tree
Showing 20 changed files with 441 additions and 3 deletions.
7 changes: 7 additions & 0 deletions env/HERA.env
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,13 @@ elif [[ "${step}" = "atmanlfv3inc" ]]; then
[[ ${NTHREADS_ATMANLFV3INC} -gt ${nth_max} ]] && export NTHREADS_ATMANLFV3INC=${nth_max}
export APRUN_ATMANLFV3INC="${launcher} -n ${npe_atmanlfv3inc} --cpus-per-task=${NTHREADS_ATMANLFV3INC}"

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

nth_max=$((npe_node_max / npe_node_prepobsaero))

export NTHREADS_PREPOBSAERO=${nth_prepobsaero:-1}
export APRUN_PREPOBSAERO="${launcher} -n ${npe_prepobsaero} --cpus-per-task=${NTHREADS_PREPOBSAERO}"

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

nth_max=$((npe_node_max / npe_node_snowanl))
Expand Down
6 changes: 6 additions & 0 deletions env/HERCULES.env
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,12 @@ case ${step} in
[[ ${NTHREADS_AEROANL} -gt ${nth_max} ]] && export NTHREADS_AEROANL=${nth_max}
export APRUN_AEROANL="${launcher} -n ${npe_aeroanlrun} --cpus-per-task=${NTHREADS_AEROANL}"
;;
"prepobsaero")
nth_max=$((npe_node_max / npe_node_prepobsaero))

export NTHREADS_PREPOBSAERO=${nth_prepobsaero:-1}
export APRUN_PREPOBSAERO="${launcher} -n ${npe_prepobsaero} --cpus-per-task=${NTHREADS_PREPOBSAERO}"
;;
"snowanl")

nth_max=$((npe_node_max / npe_node_snowanl))
Expand Down
7 changes: 7 additions & 0 deletions env/JET.env
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,13 @@ elif [[ "${step}" = "aeroanlrun" ]]; then
[[ ${NTHREADS_AEROANL} -gt ${nth_max} ]] && export NTHREADS_AEROANL=${nth_max}
export APRUN_AEROANL="${launcher} -n ${npe_aeroanlrun}"

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

nth_max=$((npe_node_max / npe_node_prepobsaero))

export NTHREADS_PREPOBSAERO=${nth_prepobsaero:-1}
export APRUN_PREPOBSAERO="${launcher} -n ${npe_prepobsaero} --cpus-per-task=${NTHREADS_PREPOBSAERO}"

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

nth_max=$((npe_node_max / npe_node_snowanl))
Expand Down
7 changes: 7 additions & 0 deletions env/ORION.env
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,13 @@ elif [[ "${step}" = "aeroanlrun" ]]; then
[[ ${NTHREADS_AEROANL} -gt ${nth_max} ]] && export NTHREADS_AEROANL=${nth_max}
export APRUN_AEROANL="${launcher} -n ${npe_aeroanlrun} --cpus-per-task=${NTHREADS_AEROANL}"

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

nth_max=$((npe_node_max / npe_node_prepobsaero))

export NTHREADS_PREPOBSAERO=${nth_prepobsaero:-1}
export APRUN_PREPOBSAERO="${launcher} -n ${npe_prepobsaero} --cpus-per-task=${NTHREADS_PREPOBSAERO}"

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

nth_max=$((npe_node_max / npe_node_snowanl))
Expand Down
7 changes: 7 additions & 0 deletions env/S4.env
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,13 @@ elif [[ "${step}" = "aeroanlrun" ]]; then
[[ ${NTHREADS_AEROANL} -gt ${nth_max} ]] && export NTHREADS_AEROANL=${nth_max}
export APRUN_AEROANL="${launcher} -n ${npe_aeroanlrun}"

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

nth_max=$((npe_node_max / npe_node_prepobsaero))

export NTHREADS_PREPOBSAERO=${nth_prepobsaero:-1}
export APRUN_PREPOBSAERO="${launcher} -n ${npe_prepobsaero} --cpus-per-task=${NTHREADS_PREPOBSAERO}"

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

nth_max=$((npe_node_max / npe_node_snowanl))
Expand Down
7 changes: 7 additions & 0 deletions env/WCOSS2.env
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,13 @@ elif [[ "${step}" = "aeroanlrun" ]]; then
[[ ${NTHREADS_AEROANL} -gt ${nth_max} ]] && export NTHREADS_AEROANL=${nth_max}
export APRUN_AEROANL="${launcher} -n ${npe_aeroanlrun}"

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

nth_max=$((npe_node_max / npe_node_prepaeroobs))

export NTHREADS_PREPOBSAERO=${nth_prepobsaero:-1}
export APRUN_PREPOBSAERO="${launcher} -n ${npe_prepobsaero} --ppn ${npe_node_prepobsaero}--cpu-bind depth --depth=${NTHREADS_PREPOBSAERO}"

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

nth_max=$((npe_node_max / npe_node_snowanl))
Expand Down
43 changes: 43 additions & 0 deletions jobs/JGLOBAL_PREP_OBS_AERO
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
#! /usr/bin/env bash

source "${HOMEgfs}/ush/preamble.sh"
source "${HOMEgfs}/ush/jjob_header.sh" -e "prepobsaero" -c "base prepobsaero"

##############################################
# Set variables used in the script
##############################################

export COMIN_OBS="${DATA}"
YMD=${PDY} HH=${cyc} declare_from_tmpl -rx COMOUT_OBS:COM_OBS_TMPL

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

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

EXSCRIPT=${GDASPREPAEROOBSPY:-${SCRgfs}/exglobal_prep_obs_aero.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
[[ "${KEEPDATA}" = "NO" ]] && rm -rf "${DATA}"

exit 0
24 changes: 24 additions & 0 deletions jobs/rocoto/prepobsaero.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#! /usr/bin/env bash

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

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

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

###############################################################
# setup python path for workflow utilities and tasks
wxflowPATH="${HOMEgfs}/ush/python:${HOMEgfs}/ush/python/wxflow/src"
PYTHONPATH="${PYTHONPATH:+${PYTHONPATH}:}${wxflowPATH}"
export PYTHONPATH

###############################################################
# Execute the JJOB
"${HOMEgfs}/jobs/JGLOBAL_PREP_OBS_AERO"
status=$?
exit "${status}"
5 changes: 5 additions & 0 deletions parm/archive/arcdir.yaml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,11 @@ Deterministic: &deterministic
- ["{{ COM_CHEM_ANALYSIS }}/{{ head }}aerostat", "{{ ARCDIR }}/aerostat.{{ RUN }}.{{ cycle_YMDH }}"]
{% endif %}

{% if DO_PREP_OBS_AERO %}
- ["{{ COM_OBS }}/{{ head }}aeroobs", "{{ ARCDIR }}/aeroobs.{{ RUN }}.{{ cycle_YMDH }}"]
- ["{{ COM_OBS }}/{{ head }}aerorawobs", "{{ ARCDIR }}/aerorawobs.{{ RUN }}.{{ cycle_YMDH }}"]
{% endif %}

{% endif %}

{% if RUN == "gfs" %}
Expand Down
4 changes: 4 additions & 0 deletions parm/archive/gdas.yaml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,10 @@ gdas:
{% if AERO_ANL_CDUMP == "gdas" or AERO_ANL_CDUMP == "both" %}
- "{{ COM_CHEM_ANALYSIS | relpath(ROTDIR) }}/{{ head }}aerostat"
{% endif %}
{% if DO_PREP_OBS_AERO %}
- "{{ COM_OBS | relpath(ROTDIR) }}/{{ head }}aeroobs"
- "{{ COM_OBS | relpath(ROTDIR) }}/{{ head }}aerorawobs"
{% endif %}
{% if DO_JEDISNOWDA %}
- "{{ COM_SNOW_ANALYSIS | relpath(ROTDIR) }}/{{ head }}snowstat.tgz"
{% endif %}
Expand Down
4 changes: 4 additions & 0 deletions parm/archive/gfsa.yaml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,10 @@ gfsa:
{% if AERO_ANL_CDUMP == "gfs" or AERO_ANL_CDUMP == "both" %}
- "{{ COM_CHEM_ANALYSIS | relpath(ROTDIR) }}/{{ head }}aerostat"
{% endif %}
{% if DO_PREP_OBS_AERO %}
- "{{ COM_OBS | relpath(ROTDIR) }}/{{ head }}aeroobs"
- "{{ COM_OBS | relpath(ROTDIR) }}/{{ head }}aerorawobs"
{% endif %}

# BUFR inputs
- "{{ COM_OBS | relpath(ROTDIR) }}/{{ head }}nsstbufr"
Expand Down
1 change: 1 addition & 0 deletions parm/config/gfs/config.base
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,7 @@ export DO_WAVE="NO"
export DO_OCN="NO"
export DO_ICE="NO"
export DO_AERO="NO"
export DO_PREP_OBS_AERO="NO"
export AERO_FCST_CDUMP="" # When to run aerosol forecast: gdas, gfs, or both
export AERO_ANL_CDUMP="" # When to run aerosol analysis: gdas, gfs, or both
export WAVE_CDUMP="" # When to include wave suite: gdas, gfs, or both
Expand Down
17 changes: 17 additions & 0 deletions parm/config/gfs/config.prepobsaero
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/bin/bash -x

########## config.prepobsaero ##########
# Prepare and thin/superob aerosol observations

echo "BEGIN: config.prepobsaero"

# Get task specific resources
source "${EXPDIR}/config.resources" prepobsaero

export OBSPROCYAML="${PARMgfs}/gdas/aero/obs/lists/gdas_aero_obsproc.yaml.j2"
export OBSPROCEXE="${EXECgfs}/gdas_obsprovider2ioda.x"
export VIIRS_DATA_DIR="/scratch2/NCEPDEV/stmp3/Yaping.Wang/VIIRS/AWS/"
export SENSORS="npp,n20"


echo "END: config.prepaeroobs"
10 changes: 9 additions & 1 deletion parm/config/gfs/config.resources
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ if (( $# != 1 )); then
echo "atmanlinit atmanlvar atmanlfv3inc atmanlfinal"
echo "atmensanlinit atmensanlletkf atmensanlfv3inc atmensanlfinal"
echo "snowanl"
echo "aeroanlinit aeroanlrun aeroanlfinal"
echo "prepobsaero aeroanlinit aeroanlrun aeroanlfinal"
echo "anal sfcanl analcalc analdiag fcst echgres"
echo "upp atmos_products"
echo "tracker genesis genesis_fsu"
Expand Down Expand Up @@ -289,6 +289,14 @@ case ${step} in
export npe_node_snowanl=$(( npe_node_max / nth_snowanl ))
;;

"prepobsaero")
export wtime_prepobsaero="00:30:00"
export npe_prepobsaero=1
export nth_prepobsaero=1
export npe_node_prepobsaero=1
export memory_prepobsaero="96GB"
;;

"aeroanlinit")
# below lines are for creating JEDI YAML
case ${CASE} in
Expand Down
4 changes: 2 additions & 2 deletions scripts/exglobal_archive.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ def main():

# Pull out all the configuration keys needed to run the rest of archive steps
keys = ['ATARDIR', 'current_cycle', 'FHMIN', 'FHMAX', 'FHOUT', 'RUN', 'PDY',
'DO_VERFRAD', 'DO_VMINMON', 'DO_VERFOZN', 'DO_ICE', 'DO_AERO', 'PARMgfs',
'DO_OCN', 'DO_WAVE', 'WRITE_DOPOST', 'PSLOT', 'HPSSARCH', 'DO_MOS',
'DO_VERFRAD', 'DO_VMINMON', 'DO_VERFOZN', 'DO_ICE', 'DO_AERO', 'DO_PREP_OBS_AERO',
'PARMgfs', 'DO_OCN', 'DO_WAVE', 'WRITE_DOPOST', 'PSLOT', 'HPSSARCH', 'DO_MOS',
'DO_JEDISNOWDA', 'LOCALARCH', 'REALTIME', 'ROTDIR', 'ARCH_WARMICFREQ',
'ARCH_FCSTICFREQ', 'ARCH_CYC', 'assim_freq', 'ARCDIR', 'SDATE',
'FHMIN_GFS', 'FHMAX_GFS', 'FHOUT_GFS', 'ARCH_GAUSSIAN', 'MODE',
Expand Down
23 changes: 23 additions & 0 deletions scripts/exglobal_prep_obs_aero.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#!/usr/bin/env python3
# exglobal_prep_obs_aero.py
# This script collect available viirs
# obs files, combine and preprocess
# them.
import os

from wxflow import Logger, cast_strdict_as_dtypedict
from pygfs.task.aero_prepobs import AerosolObsPrep

# Initialize root logger
logger = Logger(level='DEBUG', colored_log=True)


if __name__ == '__main__':

# Take configuration from environment and cast it as python dictionary
config = cast_strdict_as_dtypedict(os.environ)

AeroObs = AerosolObsPrep(config)
AeroObs.initialize()
AeroObs.runConverter()
AeroObs.finalize()
Loading

0 comments on commit 6c93b45

Please sign in to comment.