Skip to content

NextGen Forcings Engine BMI

Jason Ducker edited this page May 17, 2024 · 4 revisions

NextGen Forcings Engine BMI Standalone Demo

Overview of NextGen Forcings Engine BMI Repo

This repository contains code base for the original WRF-Hydro (NWMv3.0) Forcings Engine restructured into a workflow that is complaint with the Basic Model Interface Standards. Not only is this code based BMI complaint, but we’ve also expanded its regridding capabilities to be universal and support all expected domain configurations (hydorfabric, gridded, unstructured mesh) requesting meteorological forcings within the NextGen framework. The goal of this Python tool is to support regridding of meteorological forcings for any domain configuration requested by a given user over all NWMv3.0 operational configurations. The regridded forcings will be ingested into the BMI fields and advertised to the NextGen model engine to be redistributed to a given domain configuration that was specified in the BMI configuration input file.

Creating Python environment to execute scripts using Anaconda

  • Inside the NextGen Forcing Engine BMI repo, you should find a environment.yml file that lists out the Python dependencies to execute the Python scripts
  • conda env create --name ngen_forcing_engine --file=environment.yml
  • conda activate ngen_forcing_engine

Overview of NextGen Forcings Engine BMI Configuration File

  • Inside the NextGen Forcings Engine BMI repository, you will see a directory called “BMI_NextGen_Configs”. This directory contains all the NWMv3.0 operational configurations (and new retrospective configurations for coastal models labeled as “AORC_Blend”) for the 4 NWM domains (CONUS, Alaska, Hawaii, Puerto Rico), each which is their own subdirectory. Currently, NextGen development phases have only evaluated the CONUS NWM operational configurations since that is the only current hydrofabric available. Inside the CONUS subdirectory, you will see more sub-directories that are labeled based on the operational configuration that needs to be tested. Within each of the operational configuration sub-directories, you will also see three to four more sub-directories based on the domain configuration (NoahMP_gridded, gridded_test, hydrofabric, unstructured) in which each of them contain a configuration .yml file that has been tested within the NextGen Forcings Engine BMI. These are the sample configuration .yml files to use to execute the NextGen Forcings Engine BMI for a particular domain configuration.

  • Within the “BMI_NextGen_Configs” directory, you will see a README.md file. This file essentially explains the standard NWMv3.0 input variables that are required to execute the NextGen Forcing Engine BMI. Please read the file for more information on all of the user options for the current NWMv3.0 Forcings Engine that is integrated into the NextGen Forcings Engine currently.

New Options and Applications of Configuration File Variables Specific for BMI Implementation in NextGen

  • NextGen Forcing Engine BMI variables to specify the time step of output and start time being at “0” seconds with respect to only the forecast start date image
  • “BDateProc” is only used within the NextGen BMI application to tell the Forcing Engine the start date, end date just has to be greater than start date but is ignored overall. Lookback is for AnA and retrospective configuration where it tells the Forcing Engine how many hours to look back in time from the “BDateProc” start time. image
  • Request a single netcdf output file containing the regridded meteorological forcings for the domain configuration specified

image

  • Netcdf variable names for NextGen hydrofabric mesh netcdf file image
  • Netcdf variable names for NextGen unstructured coastal mesh netcdf file image
  • Netcdf variable names for NWMv3.0 domain netcdf file, including it’s spatial metadata netcdf file image

General Required Configuration Variables Fields Needed to be Modified for NextGen Forcing Engine BMI Execution

  • Output/scratch directory I/O Routines to store temporary files or requested Forcing Engine Field Output image
  • Output/scratch directory I/O Routines to store temporary files or requested Forcing Engine Field Output image
  • Start time and potential Ana/Retro flags to account for pending on the operational configuration

image

  • 1 = yes, 2= no for requesting a netcdf file output of the meteorological forcings regridded for the domain configuration specified

image

  • Domain configuration variable field names that are stated within the mesh/gridded netcdf file stating it’s domain characteristics. image

Standalone Test for Executing NextGen Forcings Engine BMI

  1. Once you’ve completed your modifications to the “config.yml” of interest, go ahead and copy that file over to the root of the NextGen Forcings Engine BMI directory, where the “run_bmi_model.py” Python script is located.
  2. In line 66 of the “run_bmi_model.py” script, go ahead and modify the integer value within the for loop to essentially execute the NextGen Forcings Engine BMI for however many hourly time steps you would like to run the BMI program for.
  3. Run the model “python run_bmi_model.py”
  4. Example Output which shows essentially what the “BMI_get_var” functionality is outputting. This is the regridded meteorological forcings being advertised back the NextGen Model Engine framework. image
  5. To test the BMI functionality itself run the script: “run_bmi_unit_test.py”
  6. Please refer to the “README.md” file in the directory for any more information on the structure of the BMI repository here.

For More Information on it’s Physical BMI Application as a Component under the NextGen Framework, Please defer to the NextGen Model Engine GitHub Documentation on how a Formulation is Integrated as a NextGen Component.