Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add observation preparation job for aerosols DA to workflow #2624

Merged
merged 32 commits into from
Jun 14, 2024
Merged
Show file tree
Hide file tree
Changes from 12 commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
f7ea78c
initial commit to add the prepaeroobs job
May 23, 2024
9d5aeb7
update yaml file name
May 24, 2024
a8faff2
Merge branch 'develop' into feature/aero_prepobs
ypwang19 May 24, 2024
bdc5338
add option to trun on/off prepaeroobs
May 24, 2024
c014ae1
add option to turn on/off prepaeroobs
May 24, 2024
8d64fdd
Update STMP and PTMP settings in host file for Orion and Hercules (#…
TerrenceMcGuinness-NOAA May 24, 2024
5c31d4a
fix commit
May 28, 2024
1b7482a
fix previous commit
May 28, 2024
c224002
fix previous commit
May 28, 2024
8beebee
fix coding norms issues
May 28, 2024
68d3e2c
Merge remote-tracking branch 'origin' into feature/aero_prepobs
May 29, 2024
18f11fb
update env
May 30, 2024
7a631d9
fix shellcheck
May 30, 2024
8f78765
archive obs file
May 30, 2024
25616c4
fix coding norms check
May 30, 2024
8bc479a
revert
May 30, 2024
03324f5
update jobs name to prepobsaero
May 31, 2024
3db2938
fix shellcheck
Jun 3, 2024
8fa0ecd
specify location of sensor in filename
Jun 5, 2024
777437f
update job name in archive step
Jun 5, 2024
bfdfe07
Merge branch 'develop' into feature/aero_prepobs
ypwang19 Jun 5, 2024
43ec97c
archive obs file
Jun 6, 2024
beaed42
update npe
Jun 6, 2024
d0aa0da
add double quote
Jun 6, 2024
f5bd885
Merge branch 'develop' into feature/aero_prepobs
ypwang19 Jun 12, 2024
adbe97c
Merge branch 'develop' into feature/aero_prepobs
CoryMartin-NOAA Jun 14, 2024
a941154
Update ush/python/pygfs/task/aero_prepobs.py
CoryMartin-NOAA Jun 14, 2024
cac1e3d
Update env/WCOSS2.env
CoryMartin-NOAA Jun 14, 2024
75b6d6b
Update ush/python/pygfs/task/aero_prepobs.py
CoryMartin-NOAA Jun 14, 2024
5dd514b
Update ush/python/pygfs/task/aero_prepobs.py
CoryMartin-NOAA Jun 14, 2024
8d0ce42
Update config.base
CoryMartin-NOAA Jun 14, 2024
7f6d171
Merge branch 'develop' into feature/aero_prepobs
DavidHuber-NOAA Jun 14, 2024
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
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}" = "prepaeroobs" ]]; then
ypwang19 marked this conversation as resolved.
Show resolved Hide resolved

nth_max=$((npe_node_max / npe_node_prepaeroobs))

export NTHREADS_PREPAEROOBS=${nth_prepaeroobs:-1}
export APRUN_PREPAEROOBS="${launcher} -n 1 --cpus-per-task=${NTHREADS_PREPAEROOBS}"

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

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

"prepaeroobs")
Fixed Show fixed Hide fixed
nth_max=$((npe_node_max / npe_node_prepaeroobs))

export NTHREADS_PREPAEROOBS=${nth_prepaeroobs:-1}
export APRUN_PREPAEROOBS="${launcher} -n 1 --cpus-per-task=${NTHREADS_PREPAEROOBS}"

"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}" = "prepaeroobs" ]]; then

nth_max=$((npe_node_max / npe_node_prepaeroobs))

export NTHREADS_PREPAEROOBS=${nth_prepaeroobs:-1}
export APRUN_PREPAEROOBS="${launcher} -n 1 --cpus-per-task=${NTHREADS_PREPAEROOBS}"

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}" = "prepaeroobs" ]]; then

nth_max=$((npe_node_max / npe_node_prepaeroobs))

export NTHREADS_PREPAEROOBS=${nth_prepaeroobs:-1}
export APRUN_PREPAEROOBS="${launcher} -n 1 --cpus-per-task=${NTHREADS_PREPAEROOBS}"

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}" = "prepaeroobs" ]]; then

nth_max=$((npe_node_max / npe_node_prepaeroobs))

export NTHREADS_PREPAEROOBS=${nth_prepaeroobs:-1}
export APRUN_PREPAEROOBS="${launcher} -n 1 --cpus-per-task=${NTHREADS_PREPAEROOBS}"

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}" = "prepaeroobs" ]]; then

nth_max=$((npe_node_max / npe_node_prepaeroobs))

export NTHREADS_PREPAEROOBS=${nth_prepaeroobs:-1}
export APRUN_PREPAEROOBS="${launcher} -n 1 --cpus-per-task=${NTHREADS_PREPAEROOBS}"

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

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

source "${HOMEgfs}/ush/preamble.sh"
export DATA=${DATA:-${DATAROOT}/${RUN}aeroanl_${cyc}}
WalterKolczynski-NOAA marked this conversation as resolved.
Show resolved Hide resolved
WalterKolczynski-NOAA marked this conversation as resolved.
Show resolved Hide resolved
source "${HOMEgfs}/ush/jjob_header.sh" -e "prepaeroobs" -c "base aeroanl prepaeroobs"

##############################################
# Set variables used in the script
##############################################
# shellcheck disable=SC2153
GDATE=$(date --utc +%Y%m%d%H -d "${PDY} ${cyc} - ${assim_freq} hours")
gPDY=${GDATE:0:8}
gcyc=${GDATE:8:2}
GDUMP="gdas"


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

# Generate COM variables from templates
YMD=${PDY} HH=${cyc} declare_from_tmpl -rx COM_OBS COM_CHEM_ANALYSIS
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

COM_OBS should be considered read-only. In development we copy obs from the dump archive to a location within our directories, but in operations we use them directly from obsproc. We can make new prep COM variables in config.com for any components that need them.

@CoryMartin-NOAA @guillaumevernieres I think there are other jobs recently that have the same issue that we just let through that will need to be updated.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we need to have a bigger discussion on this. There are obs for the non-atmospheric components that are not being processed through the traditional obsproc channels (in particular the aerosol and SOCA datasets). I'll send an email to follow up and schedule a meeting.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My solution would be to create a COM_<component>_PREP_TMPL (or similar; waves already has a prep) to store pre-processed stuff.


RUN=${GDUMP} YMD=${gPDY} HH=${gcyc} declare_from_tmpl -rx \
COM_CHEM_ANALYSIS_PREV:COM_CHEM_ANALYSIS_TMPL \
COM_ATMOS_RESTART_PREV:COM_ATMOS_RESTART_TMPL
WalterKolczynski-NOAA marked this conversation as resolved.
Show resolved Hide resolved

mkdir -m 775 -p "${COM_CHEM_ANALYSIS}"

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

EXSCRIPT=${GDASPREPAEROOBSPY:-${SCRgfs}/exglobal_prep_aero_obs.py}
${EXSCRIPT}
status=$?
[[ ${status} -ne 0 ]] && exit "${status}"

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

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

exit 0
24 changes: 24 additions & 0 deletions jobs/rocoto/prepaeroobs.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="prepaeroobs"
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_AERO_OBS"
status=$?
exit "${status}"
1 change: 1 addition & 0 deletions parm/config/gfs/config.aeroanl
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ export io_layout_y=@IO_LAYOUT_Y@

export JEDIEXE="${EXECgfs}/gdas.x"


if [[ "${DOIAU}" == "YES" ]]; then
export aero_bkg_times="3,6,9"
export JEDIYAML="${PARMgfs}/gdas/aero/variational/3dvar_fgat_gfs_aero.yaml.j2"
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_AERO_OBS="YES"
WalterKolczynski-NOAA marked this conversation as resolved.
Show resolved Hide resolved
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.prepaeroobs
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/bin/bash -x

########## config.prepaeroobs ##########
# Aerosol Variance specific
ypwang19 marked this conversation as resolved.
Show resolved Hide resolved

echo "BEGIN: config.prepaeroobs"

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

export OBSPROCYAML="${PARMgfs}/gdas/aero/obs/list/aero_obsproc.yaml.j2"
export OBSPROCEXE="${EXECgfs}/gdas_obsprovider2ioda.x"
export VIIRS_DATA_DIR="/scratch2/NCEPDEV/stmp3/Yaping.Wang/VIIRS/AWS/"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we'll have to change this to a more "official" location for at least the CI test period before the PR can be successfully merged in.

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 "prepaeroobs 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 ))
;;

"prepaeroobs")
export wtime_prepaeroobs="00:15:00"
export npe_prepaeroobs=1
export nth_prepaeroobs=1
export npe_node_prepaeroobs=1
export memory_prepaeroobs="96GB"
;;

"aeroanlinit")
# below lines are for creating JEDI YAML
case ${CASE} in
Expand Down
24 changes: 24 additions & 0 deletions scripts/exglobal_prep_aero_obs.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#!/usr/bin/env python3
# exglobal_prep_aero_obs.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)

# Instantiate the aerosol prep obs tasks
AeroObs = AerosolObsPrep(config)
AeroObs.initialize()
AeroObs.runConverter()
AeroObs.finalize()
Loading
Loading