WRF-Hydro NUOPC Cap
 All Classes Files Functions Variables Macros Pages
NCAR's WRF-Hydro NUOPC Cap

Table of Contents

Author
Daniel Rosen (danie.nosp@m.l.ro.nosp@m.sen@n.nosp@m.oaa..nosp@m.gov)
ESMF Support (esmf_.nosp@m.supp.nosp@m.ort@l.nosp@m.ist..nosp@m.woc.n.nosp@m.oaa..nosp@m.gov)
Date
03/14/2017 WRF-Hydro NUOPC Cap Added to GitHub
03/17/2017 Documentation Added

Overview

The Weather Research and Forecasting Hydrological (WRF-Hydro) model is a hydrometerological forecasting model developed and maintained by the National Center for Atmospheric Research (NCAR). The WRF-Hydro cap wraps the WRF-Hydro model with NUOPC compliant interfaces. The result is a WRF-Hydro model capable of coupling with other models using National Unified Operational Prediction Capability (NUOPC).

This page documents the technical design of the specialized NUOPC model and the WRF-Hydro gluecode. For generic NUOPC model documentation please see the NUOPC reference manual: https://www.earthsystemcog.org/projects/nuopc/refmans.

NUOPC Model Specialized Entry Points

This cap specializes the cap configuration, initialization, advertised fields, realized fields, data initialization, clock, run, and finalize.

Set Services (Register Subroutines)

Table summarizing the NUOPC specialized subroutines registered during SetServices. The "Phase" column says whether the subroutine is called during the initialization, run, or finalize part of the coupled system run.

Phase Cap Subroutine Description
Init InitializeP0 Set the Initialize Phase Definition (IPD). Configure model
Init InitializeP1 Initialize model. Advertize import and export fields
Init InitializeP3 Realize import and export fields
Init DataInitialize Initialize import and export data
Init SetClock Set model clock during initialization
Run CheckImport Check timestamp on import data.
Run ModelAdvance Advances the model by a timestep
Final ModelFinalize Releases memory

Initialize

Description of the initialization phases and internal model calls.

InitializeP0

During initialize phase 0 the runtime configuration is read in from model attributes and the initialization phase definition version is set to IPDv03.

InitializeP1

During initialize phase 1 the model is initialized and the import and export fields are advertised in a state labeled with the domain ID.

InitializeP3

During initialize phase 3 import and export fields are realized if they are connected through NUOPC. Realized fields are created on the WRF-Hydro grid.

DataInitialize

During data initialize this cap checks the timestamp of all import fields dependent on a coupled model. Once all dependent import fields have been initialized this cap is marked initalized.

SetClock

During set clock the cap creates a new clock using the timestep configured in te WRF-Hydro configuration file. The restart write time step is also created and the restart write time accumulation tracker is reset to zero.

Run

Description of the run phase(s) and internal model calls.

CheckImport

During check import the import data is checked to verify that it is at the beginning or end of the timestep.

ModelAdvance

Calls WRF-Hydro advance for the configured domain.

Finalize

Description of the finalize phase and internal model calls.

ModelFinalize

During model finalize WRF-Hydro finalize subroutines are called and memory allocated during cap initialization is released.

Model Configuration

Custom model attributes are used to configure the model.

Attribute Default Description
Verbosity VERBOSITY_LV1 Verbosity levels are defined in WRFHYDRO_NUOPC_Macros.h

DomainID | 1 | RestartInterval | NEVER | Determine when to write NUOPC state restart files in seconds ConfigFile | hydro.namelist | Set the WRF-Hydro configuraion file dasConfigFile | namelist.hrldas | Set the WRF-Hydro DAS configuration file WriteGrid | FALSE | Write a NetCDF file for the WRF-Hydro domain WriteImport | FALSE | Write a NetCDF file for the import state before model advance WriteExport | FALSE | Write a NetCDF file for the export state after model advance LogMemory | FALSE | Write memory statistics. (Not Implemented) TestFillImport | FALSE | Fill the import state with ESMF_FieldFill(sincos) for testing TestFillExport | FALSE | Fill the export state with ESMF_FieldFill(sincos) for testing

Model Fields

The following tables list the import and export fields.

Import Fields

Import fields are listed in the import_list parameter.

Standard Name Units Model Variable Description Notes
dummy_field_1 Pa forcing_1 field description for first import field
dummy_field_2 kg forcing_2 field description for second import field
dummy_field_3 W m-2 forcing_3 field description for third import field field notes

Export Fields

Export fields are listed in the export_list parameter.

Standard Name Units Model Variable Description Notes
dummy_field_1 m output_1 field description for first export field field notes
dummy_field_2 kg output_2 field description for second export field
dummy_field_3 m s-1 output_3 field description for third export field field notes

Memory Management

Model configuration is stored in a custom internal state data type. A pointer to the custom internal state data type is stored in the component.

The cap allocates new memory for each field. This will be updated so that NUOPC fields directly access the WRF-Hydro field memory.

Input and Output

Cap diagnostic output is written to the ESMF PET Logs. Cap diagnostic output can be increased or decreased by setting the Verbosity attribute.

NUOPC state restart write files are written depending on the RestartInterval attribute. If set to 0 then NUOPC state restart write files will never be written.

WRF-Hydro diagnostics output is written to standard out. To increase the diagnostic output compile WRF-Hydro with -DHYDRO_D.

WRF-Hydro writes several output files. Please see the WRF-Hydro documentation.

Dependencies

Dependencies

ESMF

See the ESMF User's Guide.

Building and Installing

Environment Variables

NUOPC Makefile Targets

The build system in Makefile wraps the WRF-Hydro build system and adds the nuopc, nuopcinstall, and nuopcclean targets. Before building make sure to configure the internal model.

To build and install into the current directory run: $ make nuopc

To install into an alternative directory run: $ make nuopcinstall DESTDIR=<INSTALL_DIR> INSTDIR=<SUBDIR>

To build with debugging information run: $ make nuopc DEBUG=on

Repository

The WRF-Hydro NUOPC cap is maintained in a GitHub repository: https://github.com/NESII/wrfhydro_cap

References