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 the repair job for the reforecast #2838

Draft
wants to merge 32 commits into
base: feature/gefs_reforecast
Choose a base branch
from

Conversation

HongGuan-NOAA
Copy link

@HongGuan-NOAA HongGuan-NOAA commented Aug 15, 2024

Description

This PR adds the repair task for correcting the F03 and F06 ave/acc/min/max variables.

Type of change

  • New feature (adds functionality)

Change characteristics

  • Is this a breaking change (a change in existing functionality)? NO
  • Does this change require a documentation update? NO
  • Does this change require an update to any of the following submodules? YES (If YES, please add a link to any PRs that are pending.)
    • EMC verif-global
    • GDAS
    • GFS-utils
    • GSI
    • GSI-monitor
    • GSI-utils
    • UFS-utils
    • UFS-weather-model
    • wxflow

How has this been tested?

This has been tested in WCOSS2.

Checklist

  • Any dependent changes have been merged and published
  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • My changes generate no new warnings
  • New and existing tests pass with my changes
  • I have made corresponding changes to the documentation if necessary

@HongGuan-NOAA HongGuan-NOAA marked this pull request as draft August 15, 2024 19:33
Copy link

@github-advanced-security github-advanced-security bot left a comment

Choose a reason for hiding this comment

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

ShellCheck found more than 20 potential problems in the proposed changes. Check the Files changed tab for more details.

Comment on lines 151 to 152
$exec_dir/$sorc_name >sorc_name.exe.out
cat sorc_name.exe.out
Copy link
Contributor

Choose a reason for hiding this comment

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

@WalterKolczynski-NOAA, @HongGuan-NOAA has source code for this task that has not been added to this PR. Should her source code be added to gfs-utils in a similar manner as the other GEFS-specific programs (e.g. gfs-utils PR #52)?

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes. I thought I had already talked with Hong about opening a PR.

scripts/gefs_atmos_f0306.sh Fixed Show fixed Hide fixed
scripts/gefs_atmos_f0306.sh Fixed Show fixed Hide fixed
scripts/gefs_atmos_f0306.sh Fixed Show fixed Hide fixed
scripts/gefs_atmos_f0306.sh Fixed Show fixed Hide fixed
scripts/gefs_atmos_f0306.sh Fixed Show fixed Hide fixed
scripts/gefs_atmos_f0306.sh Fixed Show fixed Hide fixed
Copy link
Contributor

@EricSinsky-NOAA EricSinsky-NOAA left a comment

Choose a reason for hiding this comment

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

@HongGuan-NOAA Here are some of my suggestions.

@@ -0,0 +1,192 @@
#!/bin/ksh
Copy link
Contributor

Choose a reason for hiding this comment

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

This script should start like this. A brief description of this script should be added as well.

Suggested change
#!/bin/ksh
#! /usr/bin/env bash
source "${USHgfs}/preamble.sh"

#
#export COMIN_master=${COMIN_master:-$COMROOT/$PSLOT/gefs.$PDY/00/mem001/model_data/atmos/master}
export COMIN_master=${COMIN_master:-${COM_ATMOS_MASTER}}
export COMIN_00and03=${HOMEgefs}/anl
Copy link
Contributor

Choose a reason for hiding this comment

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

COMIN_00and03 should not be in HOMEgefs. Since data in this directory is considered fixed (not generated in any global-workflow task), I think it can be somewhere in a common data directory outside of HOMEgefs.

history_path = self._template_to_rocoto_cycstring(self._base[history_path_tmpl], {'MEMDIR': 'mem#member#'})

data = f'{history_path}/{history_file_tmpl}'
dep_dict = {'type': 'data', 'data': data}
Copy link
Contributor

Choose a reason for hiding this comment

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

Since the repair job depends on f006 master data from the forecast job, I think the dependencies for the f003 and f006 atmos_prod jobs should also be modified (for replay cases). The f003 and f006 atmos_prod jobs should depend on the successful completion of the repair job.

@@ -59,6 +59,8 @@ def get_task_names(self):
if self.nens > 0:
tasks += ['efcs']

tasks += ['repairf0306']
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 this task should be added to the workflow only for replay cases. This task should probably be conditioned. I suggest reviewing the extractvars task to see how a task can be made optional in the workflow.

@HongGuan-NOAA
Copy link
Author

HongGuan-NOAA commented Aug 26, 2024 via email

Copy link
Contributor

@WalterKolczynski-NOAA WalterKolczynski-NOAA left a comment

Choose a reason for hiding this comment

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

Some changes to get started. I will likely have more once things are cleaned up.

Comment on lines 10 to 32
####################################
# obtain unique process id (pid) and make temp directory
####################################

export pid=$$
export date=${CDATE}
#yyyymmdd=`echo $date | cut -c1-8`
#echo `date` $0 `date -u` begin

####################################
# File To Log Msgs
####################################
export jlogfile=${jlogfile:-${COMROOT}/logs/jlogfiles/jlogfile.${job}.${pid}}
#echo $jlogfile

####################################
# Determine Job Output Name on System
####################################
export outid="LL${job}"
export jobid="${outid}.o${pid}"
export pgmout="OUTPUT.${pid}"
export pgmerr=errfile
#echo $outid,$jobid,$pgmout,$pgmerr
Copy link
Contributor

Choose a reason for hiding this comment

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

None of this is necessary. The jjob header takes care of what is needed, and most of the rest we don't use at all.

Suggested change
####################################
# obtain unique process id (pid) and make temp directory
####################################
export pid=$$
export date=${CDATE}
#yyyymmdd=`echo $date | cut -c1-8`
#echo `date` $0 `date -u` begin
####################################
# File To Log Msgs
####################################
export jlogfile=${jlogfile:-${COMROOT}/logs/jlogfiles/jlogfile.${job}.${pid}}
#echo $jlogfile
####################################
# Determine Job Output Name on System
####################################
export outid="LL${job}"
export jobid="${outid}.o${pid}"
export pgmout="OUTPUT.${pid}"
export pgmerr=errfile
#echo $outid,$jobid,$pgmout,$pgmerr

####################################
# Specify Execution Areas
####################################
export HOMEgefs=${HOMEgfs}
Copy link
Contributor

Choose a reason for hiding this comment

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

Please just use HOMEgfs instead of defining HOMEgefs.

# Specify Execution Areas
####################################
export HOMEgefs=${HOMEgfs}
export EXECacc=${EXECacc:-${HOMEgefs}/exec}
Copy link
Contributor

Choose a reason for hiding this comment

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

We already have EXECgfs for this.

####################################
export HOMEgefs=${HOMEgfs}
export EXECacc=${EXECacc:-${HOMEgefs}/exec}
export SORCacc=${SORCacc:-${HOMEgefs}/sorc/gefs_postacc.fd}
Copy link
Contributor

Choose a reason for hiding this comment

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

Why is this necessary

export HOMEgefs=${HOMEgfs}
export EXECacc=${EXECacc:-${HOMEgefs}/exec}
export SORCacc=${SORCacc:-${HOMEgefs}/sorc/gefs_postacc.fd}
export SCRIPTSens_acc=${HOMEgefs}/scripts
Copy link
Contributor

Choose a reason for hiding this comment

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

Use SCRgfs

Copy link
Contributor

Choose a reason for hiding this comment

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

Please fix the indentation in this script.

Also, there is quite a bit of repetition. Consider consolidating it with loops.


rm tmp
else
echo "${infile} does not exist"
Copy link
Contributor

Choose a reason for hiding this comment

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

Shouldn't this exit with an error?

@@ -14,7 +14,7 @@ def _get_app_configs(self):
"""
Returns the config_files that are involved in gefs
"""
configs = ['stage_ic', 'fcst', 'atmos_products', 'arch']
configs = ['stage_ic', 'fcst', 'repairf0306', 'atmos_products', 'arch']
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we call the new job (and associated scripts) repair_replay_acc or something similar?

Comment on lines +172 to +174
def atmos_prod(self):
return self._atmosoceaniceprod('atmos')

Copy link
Contributor

Choose a reason for hiding this comment

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

This method is already defined.

Suggested change
def atmos_prod(self):
return self._atmosoceaniceprod('atmos')

Comment on lines +179 to +186
products_dict = {'atmos': {'config': 'atmos_products',
'history_path_tmpl': 'COM_ATMOS_MASTER_TMPL',
'history_file_tmpl': f'{self.run}[email protected]'}}
component_dict = products_dict['atmos']
config = component_dict['config']
history_path_tmpl = component_dict['history_path_tmpl']
history_file_tmpl = component_dict['history_file_tmpl']
history_path = self._template_to_rocoto_cycstring(self._base[history_path_tmpl], {'MEMDIR': 'mem#member#'})
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
products_dict = {'atmos': {'config': 'atmos_products',
'history_path_tmpl': 'COM_ATMOS_MASTER_TMPL',
'history_file_tmpl': f'{self.run}[email protected]'}}
component_dict = products_dict['atmos']
config = component_dict['config']
history_path_tmpl = component_dict['history_path_tmpl']
history_file_tmpl = component_dict['history_file_tmpl']
history_path = self._template_to_rocoto_cycstring(self._base[history_path_tmpl], {'MEMDIR': 'mem#member#'})
history_path = self._template_to_rocoto_cycstring(self._base["COM_ATMOS_HISTORY_TMPL"], {'MEMDIR': 'mem#member#'})

history_file_tmpl = component_dict['history_file_tmpl']
history_path = self._template_to_rocoto_cycstring(self._base[history_path_tmpl], {'MEMDIR': 'mem#member#'})

data = f'{history_path}/{history_file_tmpl}'
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
data = f'{history_path}/{history_file_tmpl}'
data = f'{history_path}/{self.run}[email protected]'

@EricSinsky-NOAA EricSinsky-NOAA changed the base branch from develop to feature/gefs_reforecast September 4, 2024 19:54
@EricSinsky-NOAA
Copy link
Contributor

The target has been changed from develop to feature/gefs_reforecast.

jobs/JGEFS_ATMOS_ACC Fixed Show fixed Hide fixed
jobs/JGEFS_ATMOS_ACC Fixed Show fixed Hide fixed
jobs/JGEFS_ATMOS_ACC Fixed Show fixed Hide fixed
jobs/JGEFS_ATMOS_ACC Fixed Show fixed Hide fixed
scripts/exgefs_atmos_repair_replay.sh Fixed Show fixed Hide fixed
scripts/exgefs_atmos_repair_replay.sh Fixed Show fixed Hide fixed
scripts/exgefs_atmos_repair_replay.sh Fixed Show fixed Hide fixed
scripts/exgefs_atmos_repair_replay.sh Fixed Show fixed Hide fixed
scripts/exgefs_atmos_repair_replay.sh Fixed Show fixed Hide fixed
scripts/exgefs_atmos_repair_replay.sh Fixed Show fixed Hide fixed
@WalterKolczynski-NOAA
Copy link
Contributor

@HongGuan-NOAA if/when this is ready for review, please take it off of draft and we will review it.

@HongGuan-NOAA
Copy link
Author

HongGuan-NOAA commented Sep 18, 2024 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants