Skip to content

Commit

Permalink
Add oceanalecn to workflow generator (#2409)
Browse files Browse the repository at this point in the history
Adds task oceanalecn to the workflow generator, plus some necessary env
var work to the jjob. The workflow generator adds oceanalecn only if
~~`nens > 0`~~ `self.do_hybvar`.

Resolves NOAA-EMC/GDASApp#912
  • Loading branch information
AndrewEichmann-NOAA authored Apr 12, 2024
1 parent 8edf94a commit 36f3841
Show file tree
Hide file tree
Showing 6 changed files with 56 additions and 9 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -158,11 +158,12 @@ sorc/ocnicepost.fd
# jobs symlinks
# scripts symlinks
scripts/exemcsfc_global_sfc_prep.sh
scripts/exgdas_global_marine_analysis_ecen.py
scripts/exglobal_prep_ocean_obs.py
# ush symlinks
ush/chgres_cube.sh
ush/emcsfc_ice_blend.sh
ush/emcsfc_snow.sh
ush/exglobal_prep_ocean_obs.py
ush/fix_precip.sh
ush/fv3gfs_driver_grid.sh
ush/fv3gfs_filter_topo.sh
Expand Down
9 changes: 9 additions & 0 deletions jobs/JGDAS_GLOBAL_OCEAN_ANALYSIS_ECEN
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,15 @@ source "${HOMEgfs}/ush/jjob_header.sh" -e "ocnanalecen" -c "base ocnanal ocnanal
##############################################
# Set variables used in the script
##############################################
# Ignore possible spelling error (nothing is misspelled)
# shellcheck disable=SC2153
GDATE=$(date --utc +%Y%m%d%H -d "${PDY} ${cyc} - ${assim_freq} hours")
export gPDY=${GDATE:0:8}
export gcyc=${GDATE:8:2}

YMD=${gPDY} HH=${gcyc} declare_from_tmpl -rx \
COM_OCEAN_HISTORY_PREV:COM_OCEAN_HISTORY_TMPL \
COM_ICE_HISTORY_PREV:COM_ICE_HISTORY_TMPL

##############################################
# Begin JOB SPECIFIC work
Expand Down
9 changes: 8 additions & 1 deletion sorc/link_workflow.sh
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,14 @@ done

cd "${HOMEgfs}/scripts" || exit 8
${LINK_OR_COPY} "${HOMEgfs}/sorc/ufs_utils.fd/scripts/exemcsfc_global_sfc_prep.sh" .
if [[ -d "${HOMEgfs}/sorc/gdas.cd" ]]; then
declare -a gdas_scripts=(exglobal_prep_ocean_obs.py \
exgdas_global_marine_analysis_ecen.py \
)
for gdas_script in "${gdas_scripts[@]}" ; do
${LINK_OR_COPY} "${HOMEgfs}/sorc/gdas.cd/scripts/${gdas_script}" .
done
fi
cd "${HOMEgfs}/ush" || exit 8
for file in emcsfc_ice_blend.sh global_cycle_driver.sh emcsfc_snow.sh global_cycle.sh; do
${LINK_OR_COPY} "${HOMEgfs}/sorc/ufs_utils.fd/ush/${file}" .
Expand Down Expand Up @@ -227,7 +235,6 @@ if [[ -d "${HOMEgfs}/sorc/gdas.cd/build" ]]; then
${LINK_OR_COPY} "${HOMEgfs}/sorc/gdas.cd/ush/jediinc2fv3.py" .
${LINK_OR_COPY} "${HOMEgfs}/sorc/gdas.cd/ush/ioda/bufr2ioda/run_bufr2ioda.py" .
${LINK_OR_COPY} "${HOMEgfs}/sorc/gdas.cd/build/bin/imsfv3_scf2ioda.py" .
${LINK_OR_COPY} "${HOMEgfs}/sorc/gdas.cd/scripts/exglobal_prep_ocean_obs.py" .
fi


Expand Down
13 changes: 8 additions & 5 deletions workflow/applications/gfs_cycled.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,10 @@ def _get_app_configs(self):
configs += ['anal', 'analdiag']

if self.do_jediocnvar:
configs += ['prepoceanobs', 'ocnanalprep', 'ocnanalbmat',
'ocnanalrun', 'ocnanalchkpt', 'ocnanalpost']
configs += ['prepoceanobs', 'ocnanalprep', 'ocnanalbmat', 'ocnanalrun']
if self.do_hybvar:
configs += ['ocnanalecen']
configs += ['ocnanalchkpt', 'ocnanalpost']
if self.do_vrfy_oceanda:
configs += ['ocnanalvrfy']

Expand Down Expand Up @@ -139,9 +141,10 @@ def get_task_names(self):
gdas_gfs_common_tasks_before_fcst += ['anal']

if self.do_jediocnvar:
gdas_gfs_common_tasks_before_fcst += ['prepoceanobs', 'ocnanalprep',
'ocnanalbmat', 'ocnanalrun',
'ocnanalchkpt', 'ocnanalpost']
gdas_gfs_common_tasks_before_fcst += ['prepoceanobs', 'ocnanalprep', 'ocnanalbmat', 'ocnanalrun']
if self.do_hybvar:
gdas_gfs_common_tasks_before_fcst += ['ocnanalecen']
gdas_gfs_common_tasks_before_fcst += ['ocnanalchkpt', 'ocnanalpost']
if self.do_vrfy_oceanda:
gdas_gfs_common_tasks_before_fcst += ['ocnanalvrfy']

Expand Down
29 changes: 28 additions & 1 deletion workflow/rocoto/gfs_tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -677,11 +677,38 @@ def ocnanalrun(self):

return task

def ocnanalchkpt(self):
def ocnanalecen(self):

deps = []
dep_dict = {'type': 'task', 'name': f'{self.cdump}ocnanalrun'}
deps.append(rocoto.add_dependency(dep_dict))
dependencies = rocoto.create_dependency(dep=deps)

resources = self.get_resource('ocnanalecen')
task_name = f'{self.cdump}ocnanalecen'
task_dict = {'task_name': task_name,
'resources': resources,
'dependency': dependencies,
'envars': self.envars,
'cycledef': self.cdump.replace('enkf', ''),
'command': f'{self.HOMEgfs}/jobs/rocoto/ocnanalecen.sh',
'job_name': f'{self.pslot}_{task_name}_@H',
'log': f'{self.rotdir}/logs/@Y@m@d@H/{task_name}.log',
'maxtries': '&MAXTRIES;'
}

task = rocoto.create_task(task_dict)

return task

def ocnanalchkpt(self):

deps = []
if self.app_config.do_hybvar:
dep_dict = {'type': 'task', 'name': f'{self.cdump}ocnanalecen'}
else:
dep_dict = {'type': 'task', 'name': f'{self.cdump}ocnanalrun'}
deps.append(rocoto.add_dependency(dep_dict))
if self.app_config.do_mergensst:
data = f'&ROTDIR;/{self.cdump}.@Y@m@d/@H/atmos/{self.cdump}.t@Hz.sfcanl.nc'
dep_dict = {'type': 'data', 'data': data}
Expand Down
2 changes: 1 addition & 1 deletion workflow/rocoto/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class Tasks:
'prep', 'anal', 'sfcanl', 'analcalc', 'analdiag', 'arch', "cleanup",
'prepatmiodaobs', 'atmanlinit', 'atmanlrun', 'atmanlfinal',
'prepoceanobs',
'ocnanalprep', 'ocnanalbmat', 'ocnanalrun', 'ocnanalchkpt', 'ocnanalpost', 'ocnanalvrfy',
'ocnanalprep', 'ocnanalbmat', 'ocnanalrun', 'ocnanalecen', 'ocnanalchkpt', 'ocnanalpost', 'ocnanalvrfy',
'earc', 'ecen', 'echgres', 'ediag', 'efcs',
'eobs', 'eomg', 'epos', 'esfc', 'eupd',
'atmensanlinit', 'atmensanlrun', 'atmensanlfinal',
Expand Down

0 comments on commit 36f3841

Please sign in to comment.