Skip to content

Reconciling ngwpc-3.1.2.3.0 PR Work, NWMv3.1 Updates for Short & Medium Range Configurations#30

Draft
jduckerOWP wants to merge 719 commits into
NOAA-OWP:masterfrom
jduckerOWP:ngwpc-3.1.2.3.0
Draft

Reconciling ngwpc-3.1.2.3.0 PR Work, NWMv3.1 Updates for Short & Medium Range Configurations#30
jduckerOWP wants to merge 719 commits into
NOAA-OWP:masterfrom
jduckerOWP:ngwpc-3.1.2.3.0

Conversation

@jduckerOWP

Copy link
Copy Markdown
Contributor

Summary

This work here attempts to reconcile PR #27 work with the scope of what needs to be harbored in the NOAA-OWP/ngen-forcing repository for the benefit of the National Water Model (NWM) v4 project. This includes the removal of the data assimilation and coastal scripts repository, restructuring of the NextGen Forcing Engine BMI module dependencies, and ensuring standalone execution can be completed on personal laptops or supercomputer environments, and updating documentation across the board to reflect new functionality completed by the NGWPC project. We've also updated the NextGen ESMF Mesh file production workflow to ensure ESMF compatibility is checked across the board and to improve computational performance time. This work also includes the NCAR/WrfHydroForcing enhancements completed for the NWMv3.1 project related to liquid fraction partitioning of NWM short and medium range operational configurations.

Additions

  • Updates to Short range operational configuration liquid fraction partitioning
  • Updates to Medium range operational configuration liquid fraction partitioning
  • Updates to Forcing file extraction for Alaska and Puerto Rico domains
  • Development of a forcing file extraction class and streamline parallel downloading scripts from AWS s3 buckets.
  • Updates to documentation for NextGen Forcings Engine BMI and NextGen Lumped Forcings Driver repositories
  • Upgrade to the NextGen ESMF Mesh file production workflow to include ESMF compatibility checkers and fixes, while improving computational runtime performance
  • Integration of a NextGen Logging configuration for the Error Warning and Trapping System (EWTS). This module defines the centralized logging configuration used by EWTS. It is responsible for creating and configuring a single, named logger within the Python logging framework, based on environment variables provided by the runtime environment (e.g., ngen).

Removals

  • Remove any associations to coastal scripts
  • Remove any associations to streamflow scripts
  • Remove any associations to snow water equivalent scripts

Changes

  • Streamline ESMF mesh production and forcing file extraction workflows as part of the NextGen Forcings Engine BMI implementation.
  • Updates to Short and Medium range operational configuration liquid fraction partitioning
  • Updates to documentation for NextGen Forcings Engine BMI and NextGen Lumped Forcings Driver repositories
  • Upgrade to the NextGen ESMF Mesh file production workflow to include ESMF compatibility checkers and fixes, while improving computational runtime performance
  • Implementing a BMI wrapper Python script to streamline the entire BMI workflow in a single controlled script execution.
  • Integration of a NextGen Logging configuration for the Error Warning and Trapping System (EWTS). This module defines the centralized logging configuration used by EWTS. It is responsible for creating and configuring a single, named logger within the Python logging framework, based on environment variables provided by the runtime environment (e.g., ngen).
  • Updates to Forcing file extraction for Alaska and Puerto Rico domains
  • Development of a forcing file extraction class and streamline parallel downloading scripts from AWS s3 buckets.

Testing

  1. Install Python environment dependencies as prescribed within the ngen-forcing/NextGen_Forcings_Engine_BMI repository.
  2. Modify the sr_config.yml file within the ngen-forcing/NextGen_Forcings_Engine_BMI repository to replace the pathways or forcing file output, the scratch directory to point to where you want your output, the downscaling params directory (to just a empty directory), specify the geopackage file you want to regrid forcings for, and then specify the output ESMF mesh file name based on the geopackage input file you're transforming into an ESMF mesh.
  3. Load up your wgrib2 executable pathway (export WGRIB2=/pathway/to/wgrib2). This can usually be done as well with a module load command if your system has it already preloaded.
  4. Link the NextGen EWTS module with your current Python path to ensure logging method can be implemented properly: export PYTHONPATH=$PYTHONPATH:$(pwd)/nextgen_forcings_ewts/src
  5. Within the ngen-forcing/NextGen_Forcings_Engine_BMI repository, execute the NextGen Forcing Engine BMI workflow to produce a NextGen netcdf forcing file output in your prescribed directory for a short-range operational configuration: mpirun -n 1 python bmi_wrapper.py ./sr_config.yml -output_path ./Pathway/to/Scratch/Directory -np 2

miguelp1986 and others added 30 commits October 14, 2025 16:16
ngwpc 7354 - Fixing unstructured mesh variables node/element locations
fixing logic for supplemental radar forcing_extraction time handling
…-same-time

Reduce unnecessary model runs (NGWPC-8671)
…id_variable values. 2) fixed the tpxo error in the CONUS domain.
Jason Ducker and others added 14 commits April 8, 2026 15:06
… Engine BMI can work in standalone mode and BMI implementation. Also patch configuration bug issue with implementing downscaling and bias correction methods
…CDF I/O module to produce different formats for netcdf4 forcing output supported by the NGWPC and NOAA-OWP NextGen model engine
…wnloading multiple RAP operational output datasets to enable new liquid fraction calculations
…bric and to ensure we can properly handle multi-polygons, self-intersections, and clockwise geometries for ESMF mesh compliance
…n partitioning for HRRR (hourly, 15 minute) and RAP products, masking method for liquid fraction to force temperature partitioning, inclusion of temperature dynamic lapse rate from NCAR for WRF-Hydro domain, change of NDFD precipitation variable, and inclusion of liquid fraction of precipitation for Alaska extended AnA
…ructure

Updated repository overview and directory descriptions for clarity and added details about workflows and capabilities.
Updated README to provide an overview of the NextGen Forcings Engine BMI and detailed installation steps.
Added installation instructions for the NextGen Forcings Engine, including dependencies and steps for setting up the environment.
Updated the README.md to enhance the clarity and detail of the NextGen Forcings Engine BMI workflow. Added information about configuration files, logging, and operational procedures based on NGWPC work and reconciliation of that work.
…and regridding for AWS s3 bucket

Updated example execution code and clarified input descriptions in the README.
Added new sections for Geopackage and project options, and clarified existing configurations.
Update the forcing file extraction method to ensure extraction of the "pgrb" and "bgrb" operational model outputs so we can implement the liquid fraction partitioning scheme for NWMv3.1
…I Initilization phase.

Removed ESMF mesh creation and forcing extraction calls from the BMI model initialization process.
Patch code to ensure ana flag will force the forecast hour to be defaulted to 1 for RAP with the given NWMv3.1 code updates.
NOAA-OWP -> (catchment-id, time)
NGWPC -> (time, catchment-id)
…sistent functionality with BMI execution of Forcing Engine
Removed unnecessary fill value handling for precipitation data and updated conditions for valid indices that reflect instances when data fields do not overlap the target domain and thus, spit out fill values.
If regridded supplementary precipitation data is out of the valid range expected by the Forcing Engine, then raise an error instead of attempting to implement a nearest neighbor gap fill. There is either some wrong with the input precipitation data itself, or the methodology being implemented for the supplementary precipitation regridding and should be further investigated.

@christophertubbs christophertubbs left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

This is not ready for submission and probably needs to be set as a draft.

Comment thread .vscode/settings.json
Comment thread .gitlab-ci.yml
- test
- deploy

image: registry.sh.nextgenwaterprediction.com/infrastructure/docker/docker:latest

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

This is not a valid NOAA OWP image registry

Comment thread .gitlab-ci.yml
- docker push $DOCKER_IMAGE_NAME_BMI_FORCING:$DOCKER_IMAGE_TAG
- docker build --file=Dockerfile.lumped-forcings --build-arg CI_COMMIT_REF_NAME=${CI_COMMIT_REF_NAME} --tag "$DOCKER_IMAGE_NAME_LUMPED_FORCING:$DOCKER_IMAGE_TAG" .
- docker push $DOCKER_IMAGE_NAME_LUMPED_FORCING:$DOCKER_IMAGE_TAG
- docker build --secret id=GITLAB_TOKEN,env=GITLAB_TOKEN --file=Dockerfile.ngencoastal --build-arg CI_COMMIT_REF_NAME=${CI_COMMIT_REF_NAME} --tag "$DOCKER_IMAGE_NAME_COASTAL:$DOCKER_IMAGE_TAG" .

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Where is Dockerfile.ngencoastal? Is this intentional?

Comment thread .github/workflows/cicd.yml

- name: Unit Test BMI
run: |
docker run --rm ${{ needs.setup.outputs.image_bmi }}:${{ needs.setup.outputs.test_image_tag }} \

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

I'm not sure that this actually runs tests - it may just echo "Running BMI Forcing Unit Tests..." due to that trailing \.

Comment thread pecified

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

  1. What is this?
  2. Was this accidental?

@jduckerOWP
jduckerOWP marked this pull request as draft May 18, 2026 20:01
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.