Skip to content

Conversation

@donaldwj
Copy link
Contributor

No description provided.

Copy link
Contributor Author

@donaldwj donaldwj left a comment

Choose a reason for hiding this comment

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

This is still the code that was inital submitted for 3.1. I think the retroactive 3.0 update erased parts of this somehow. core/forcingInputMod had the 3.0 setup and 3.1 config files were missing

@rcabell rcabell requested review from Copilot and rcabell January 7, 2026 16:56
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR adds support for RRFS (Rapid Refresh Forecast System) forcing data for three regional domains: North America (NA), Puerto Rico (PR), and Hawaii (HI). The changes introduce new input forcing options (keys 24-26), corresponding regridding functions, and configuration templates for each region.

  • Adds three new RRFS regional forcing options with domain-specific configurations
  • Implements time-handling and regridding functions for RRFS NA, PR, and HI domains
  • Updates forcing input module to support new GRIB variables and output mappings
  • Provides configuration templates for operational use on WCOSS systems

Reviewed changes

Copilot reviewed 9 out of 10 changed files in this pull request and generated 36 comments.

Show a summary per file
File Description
core/time_handling.py Adds neighbor-finding functions for RRFS NA, PR, and HI domains to calculate temporal interpolation windows
core/regrid.py Implements regridding functions for each RRFS domain with GRIB2-to-NetCDF conversion and spatial interpolation
core/forcingInputMod.py Updates forcing definitions to add CPOFP variable and extend output mappings for new RRFS products
Template/template_forcing_engine.config Documents new RRFS forcing options (24-26) in configuration template
Config/WCOSS/v3.1/template_forcing_engine_PuertoRico_RRFS_Short.config New configuration for Puerto Rico short-range RRFS forecasts
Config/WCOSS/v3.1/template_forcing_engine_PuertoRico_RRFS_Analysis.config New configuration for Puerto Rico RRFS analysis runs
Config/WCOSS/v3.1/template_forcing_engine_Medium_GFS-NDFD.config Adds RegridWeightsDir configuration option
Config/WCOSS/v3.1/template_forcing_engine_Hawaii_RRFS_Short.config New configuration for Hawaii short-range RRFS forecasts
Config/WCOSS/v3.1/template_forcing_engine_Hawaii_RRFS_Analysis.config New configuration for Hawaii RRFS analysis runs

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.


def find_rrfs_na_neighbors(input_forcings, config_options, d_current, mpi_config):
"""
Function to calculate the previous and after HRRR conus cycles based on the current timestep.
Copy link

Copilot AI Jan 7, 2026

Choose a reason for hiding this comment

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

The docstring incorrectly refers to 'HRRR conus cycles' when this function is for RRFS NA. Update to 'RRFS NA cycles'.

Suggested change
Function to calculate the previous and after HRRR conus cycles based on the current timestep.
Function to calculate the previous and after RRFS NA cycles based on the current timestep.

Copilot uses AI. Check for mistakes.
:return:
"""
if mpi_config.rank == 0:
config_options.statusMsg = "Processing Conus HRRR Data. Calculating neighboring " \
Copy link

Copilot AI Jan 7, 2026

Choose a reason for hiding this comment

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

The status message refers to 'Conus HRRR Data' but this function processes RRFS NA data. Update to 'Processing RRFS NA Data'.

Suggested change
config_options.statusMsg = "Processing Conus HRRR Data. Calculating neighboring " \
config_options.statusMsg = "Processing RRFS NA Data. Calculating neighboring " \

Copilot uses AI. Check for mistakes.
default_horizon = 18 # 18-hour forecasts.
six_hr_horizon = 84 # 84-hour forecasts every six hours.

# First find the current HRRR forecast cycle that we are using.
Copy link

Copilot AI Jan 7, 2026

Choose a reason for hiding this comment

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

Comment references 'HRRR forecast cycle' but should reference 'RRFS forecast cycle' for consistency with the function's purpose.

Copilot uses AI. Check for mistakes.
err_handler.log_critical(config_options, mpi_config)
err_handler.check_program_status(config_options, mpi_config)

# Calculate the current forecast hour within this HRRR cycle.
Copy link

Copilot AI Jan 7, 2026

Choose a reason for hiding this comment

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

Comment incorrectly references 'HRRR cycle' instead of 'RRFS cycle'.

Copilot uses AI. Check for mistakes.
input_forcings.fcst_date2 = next_rrfs_date

# Calculate the output forecast hours needed based on the prev/next dates.
dt_tmp = next_hrrr_date - current_rrfs_cycle
Copy link

Copilot AI Jan 7, 2026

Choose a reason for hiding this comment

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

Variable name 'next_hrrr_date' is inconsistent - should be 'next_rrfs_date' to match the RRFS context and the variable defined at line 764.

Suggested change
dt_tmp = next_hrrr_date - current_rrfs_cycle
dt_tmp = next_rrfs_date - current_rrfs_cycle

Copilot uses AI. Check for mistakes.
return

# Create a path for a temporary NetCDF file
input_forcings.tmpFile = config_options.scratch_dir + "/" + "NAM_NEST_TMP-{}.nc".format(mkfilename())
Copy link

Copilot AI Jan 7, 2026

Choose a reason for hiding this comment

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

Temporary file name uses 'NAM_NEST_TMP' prefix but this function handles RRFS HI data. Update to 'RRFS_HI_TMP' for consistency.

Suggested change
input_forcings.tmpFile = config_options.scratch_dir + "/" + "NAM_NEST_TMP-{}.nc".format(mkfilename())
input_forcings.tmpFile = config_options.scratch_dir + "/" + "RRFS_HI_TMP-{}.nc".format(mkfilename())

Copilot uses AI. Check for mistakes.
'UGRD_10maboveground', 'VGRD_10maboveground',
'APCP_surface', 'DSWRF_surface', 'DLWRF_surface'],
'APCP_surface', 'DSWRF_surface', 'DLWRF_surface',
'PRES_surface'],
Copy link

Copilot AI Jan 7, 2026

Choose a reason for hiding this comment

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

Inconsistent array formatting compared to similar entries (24-26). Line 391 ends with a closing bracket and comma while lines 395, 399, and 403 continue the array definition. This entry (23) should follow the same pattern as 24-26.

Suggested change
'PRES_surface'],
'PRES_surface', 'CPOFP_surface'],

Copilot uses AI. Check for mistakes.
# 19 - HRRR GRIB2 Alaska production files
# 20 - ExtAna HRRR AK FE output
# 24 - RRFS NA
# 25 - RRFA HI
Copy link

Copilot AI Jan 7, 2026

Choose a reason for hiding this comment

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

Corrected spelling of 'RRFA' to 'RRFS'.

Suggested change
# 25 - RRFA HI
# 25 - RRFS HI

Copilot uses AI. Check for mistakes.
Comment on lines +48 to +49
# 25 - RRFA HI
# 26 - RRFS PR
Copy link

Copilot AI Jan 7, 2026

Choose a reason for hiding this comment

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

Comment ordering is inconsistent - line 48 shows '25 - RRFA HI' (should be RRFS HI) and line 49 shows '26 - RRFS PR', but this is a Puerto Rico config file using InputForcings = [26]. The comment at line 47 shows '24 - RRFS NA'. Consider reordering or clarifying the documentation.

Suggested change
# 25 - RRFA HI
# 26 - RRFS PR
# 25 - RRFS HI
# 26 - RRFS PR (Puerto Rico; used by this configuration)

Copilot uses AI. Check for mistakes.
Comment on lines +114 to +115
BDateProc = syyyymmdy0000
EDateProc = eyyyymmdy0000
Copy link

Copilot AI Jan 7, 2026

Choose a reason for hiding this comment

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

Date format appears to be placeholder text ('syyyymmdy0000' and 'eyyyymmdy0000') rather than valid date format. Should be in YYYYMMDDHHMM format as noted in comment at line 107, e.g., 202412230000.

Suggested change
BDateProc = syyyymmdy0000
EDateProc = eyyyymmdy0000
BDateProc = 202412230000
EDateProc = 202412231200

Copilot uses AI. Check for mistakes.
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.

1 participant