Skip to content

Add cycle-specific forecast lengths for GFS#40

Closed
Copilot wants to merge 5 commits into
developfrom
copilot/run-different-gfs-forecast-lengths
Closed

Add cycle-specific forecast lengths for GFS#40
Copilot wants to merge 5 commits into
developfrom
copilot/run-different-gfs-forecast-lengths

Conversation

Copilot AI commented Oct 27, 2025

Copy link
Copy Markdown

Enables running GFS cycles at different forecast lengths (e.g., 00z/12z to 16 days, 06z/18z to 7.5 days) to reduce compute costs for intermediate cycles.

Changes

Configuration

  • Added FHMAX_GFS_{00,06,12,18} parameters to dev/parm/config/gfs/yaml/defaults.yaml
  • Default: 384h for synoptic cycles (00z/12z), 180h for intermediate cycles (06z/18z)

Cycledef Generation (dev/workflow/rocoto/gfs_cycled_xml.py)

  • Generates cycle-specific cycledefs (gfs_00, gfs_06, gfs_12, gfs_18) when interval_gfs ≤ 6H
  • Maintains backward-compatible gfs cycledef

Task Generation (dev/workflow/rocoto/gfs_tasks.py)

  • _atmosoceaniceprod() and _upptask() detect differing cycle-specific FHMAX values
  • Creates separate metatasks per cycle (e.g., gfs_atmos_prod_00, gfs_atmos_prod_06) with appropriate forecast hour ranges
  • Falls back to standard single-metatask behavior when cycle-specific FHMAX not defined or uniform

Forecast Hour Utilities (dev/workflow/rocoto/tasks.py)

  • _get_cycle_specific_fhmax(config, cyc): Retrieves cycle-specific FHMAX, falling back to FHMAX_GFS
  • _get_forecast_hours_for_cycle(run, config, cyc, component): Calculates forecast hours for a specific cycle

Usage

base:
  FHMAX_GFS_00: 384  # 16 days
  FHMAX_GFS_06: 180  # 7.5 days  
  FHMAX_GFS_12: 384
  FHMAX_GFS_18: 180

With this configuration:

  • 00z/12z: 73 forecast hours (0-384h)
  • 06z/18z: 39 forecast hours (0-180h)
  • ~47% reduction in forecast hours for intermediate cycles

Backward compatible: omitting cycle-specific FHMAX or setting all to same value uses existing single-metatask workflow.

Original prompt

This section details on the original issue you should resolve

<issue_title>Run different GFS forecast cycles to different output lengths.</issue_title>
<issue_description>What new functionality do you need?
To save compute time, we'd like to be able to run 00 and 12z forecasts to 16 days and 06z and 18z GFS forecasts out to 7.5 days. The easy part of this is allowing the forecast length to differ. The harder part is updating all of the product jobs to handle the differing forecast lengths. The ideal solution would be to create different rocoto cycledefs for each cycle (gfs_00, gfs_06, gfs_12, and gfs_18. Then metatasks will need to be written to the XML for each cycledef.

Acceptance Criteria
Cycled forecasts with the new option have different forecast lengths for different 00z, 06z, 12z, 18z.

Suggest a solution (optional)
Note, this is a desired feature to run the GFS retrospective tests. This is something that we can add in after we start running retrospectives when/if a feature is made available.</issue_description>

<agent_instructions>The bulk of this work will be in dev/workflow. Additional changes may be needed in dev/parm.</agent_instructions>

Comments on the Issue (you are @copilot in this section)


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI and others added 4 commits October 27, 2025 18:43
Co-authored-by: DavidHuber-NOAA <69919478+DavidHuber-NOAA@users.noreply.github.com>
Co-authored-by: DavidHuber-NOAA <69919478+DavidHuber-NOAA@users.noreply.github.com>
Co-authored-by: DavidHuber-NOAA <69919478+DavidHuber-NOAA@users.noreply.github.com>
Co-authored-by: DavidHuber-NOAA <69919478+DavidHuber-NOAA@users.noreply.github.com>
Copilot AI changed the title [WIP] Add support for varying GFS forecast lengths by cycle Add cycle-specific forecast lengths for GFS Oct 27, 2025
Copilot AI requested a review from DavidHuber-NOAA October 27, 2025 18:55

@DavidHuber-NOAA DavidHuber-NOAA left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

I need to request several changes to this:

  1. This should be expanded to be expanded to all systems (gfs, gefs, sfs, and gcafs). In all cases, the variable prefix of interest is FHMAX_GFS.
  2. There are jinja-templated, bash configuration files in parm/config/{gfs,gefs,sfs,gcafs}/config.base.j2 that also need to be have their FHMAX_GFS_* variables updated.

@DavidHuber-NOAA DavidHuber-NOAA deleted the copilot/run-different-gfs-forecast-lengths branch November 18, 2025 18:23
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.

Run different GFS forecast cycles to different output lengths.

2 participants