WRF-ARW Modeling System

repository·master·Indexed 23 days ago

https://github.com/wrf-model/wrf

An open-source, public domain atmospheric modeling system used for weather and climate research. The documentation covers MAD-WRF execution modes, cloud initialization enhancements, architecture configuration for parallel execution (serial, smpar, dmpar, dm+sm), and the checkout_externals utility for managing external repositories.

Tokens
47.8K
Snippets
95
Records
251
Agent score
83%

What's inside WRF

  1. How RFC Forecasts and Level Pool modules interact

    master

    The RFC Forecasts module is built on the same architecture as the Level Pool module. When a reservoir is configured as an RFC Forecast type, the module instantiates an RFC forecast reservoir object which also instantiates a corresponding level pool reservoir that runs at every timestep.

    Data Flow Logic:

    1. The module attempts to read discharges from the RFC time series discharge array.
    2. If the corresponding RFC time series file is not found, or if the array values are unusable, the module falls back to using the level pool output instead.
  2. How the Persistence-Level Pool Hybrid Module works

    master

    The Persistence-Level Pool Hybrid Module improves discharge prediction accuracy by combining observed reservoir discharges with calculated Level Pool releases.

    Mechanism:

    1. The module instantiates a standard Level Pool object as a member.
    2. It calculates a release using the Level Pool method.
    3. It retrieves an observed discharge from timeslice files (USGS or USACE).
    4. It applies a fractional weight to both the observed discharge and the Level Pool release based on the time elapsed since the observation.
      • Example: If an observation is 12 hours old, the weight might be 1.0 for the observation and 0.0 for the Level Pool release (resulting in the observed value).
      • Example: If an observation is 5 days old, weights might be 0.2 for the observation and 0.8 for the Level Pool release.
    5. If observations are missing or of poor quality, the module defaults to a weight of 1.0 for the Level Pool release.
    6. Mass Balance: Before returning the final release to the model, the module performs checks to ensure the release does not cause reservoir storage to violate minimum or maximum limits, modifying the release if necessary.
  3. Use checkout_externals to manage external repositories

    master

    The checkout_externals utility manages the checkout and synchronization of external repositories based on an externals description file (defaulting to Externals.cfg). It ensures the working copy exactly matches the state defined in the configuration file.

    Important: You MUST run checkout_externals from the root of the source tree being managed (the ${SRC_ROOT}). Do not run it from within a sub-project directory.

    Common Workflows

    • Checkout all required components:

      cd ${SRC_ROOT}
      ./manage_externals/checkout_externals
    • Update required components to match the config file: Re-run the command above. Note: If any files in the working copies are modified, added, removed, or missing (according to git/svn status), checkout_externals will skip updating those repositories to prevent overwriting local changes. To bypass this, comment out the modified external block in the configuration file.

    • Checkout including optional components:

      ./manage_externals/checkout_externals -o
    • Use a custom configuration file:

      ./manage_externals/checkout_externals --externals my-externals.cfg
    cd ${SRC_ROOT}
    ./manage_externals/checkout_externals
  4. Enhance cloud initialization in MAD-WRF

    master

    You can enable or disable cloud initialization enhancement using the madwrf_cldinit namelist variable. Set it to 1 to turn it on or 0 to turn it off.

    By default, the model enhances cloud analysis based on analyzed relative humidity. However, you can provide additional variables to Metgrid via the WPS intermediate format to improve accuracy. For all variables listed below, missing values must be set to -999.9.

    Supported Variables for Cloud Initialization

    VariableDescriptionCapabilities
    CLDMASKCloud maskRemoves clouds if cldmask = 0
    BRTEMPBrightness temperature (e.g., GOES-R channel 13)Used with CLDMASK to: Remove clouds if clear (cldmask = 0), adjust cloud top heights, or add clouds over clear sky (cldmask = 1)
    CLDTOPZCloud top height (use 0 for clear sky)Used with CLDMASK to: Remove clouds if clear (cldmask = 0), adjust cloud top heights, or add clouds over clear sky (cldmask = 1)
    CLDBASEZCloud base heightWhen combined with BRTEMP or CLDTOPZ, allows reducing/extending cloud top and base heights to match observations
  5. Install Cygwin for WRF

    master

    To prepare a Windows environment for WRF, install Cygwin using the following steps:

    1. Download setup-x86_64.exe from cygwin.com.
    2. Run the installer and select Install from Internet.
    3. Choose an installation root (avoid installing directly into C:\) and a download cache directory.
    4. Select a nearby mirror.
    5. Change the package view to Full.
    6. Select the following required packages for installation:
      • gcc-core (required for OpenMP/smpar)
      • gcc-fortran
      • libnetcdf-fortran-devel
      • libnetcdf-devel
      • libhdf5-devel
      • zlib-devel
      • openmpi (required for MPI/dmpar)
      • libopenmpi-devel (required for MPI/dmpar)
      • libhwloc-devel (required for MPI/dmpar)
      • libevent-devel (required for MPI/dmpar)
      • libjasper-devel (required for GRIB)
      • perl and perl_base
      • tcsh
      • m4
      • make
      • libtirpc-devel
      • sed
      • gawk
      • tar
      • gzip
      • coreutils
      • which
      • file
      • grep
    7. Accept all dependencies and wait for the installation to complete (this may take approximately one hour).
  6. Run unit tests for the RFC Forecasts module

    master

    To verify the initialization and components of the RFC forecast reservoir, follow these steps to compile and run the unit tests:

    1. Navigate to the NDHMS directory and compile using the offline NoahMP template:
      ./compile_offline_NoahMP.sh template/setEnvar.sh
    2. Navigate to the Reservoir directory:
      cd path/to/Reservoir
    3. Compile the reservoir components:
      make
    4. Build the tests:
      make test
    5. Execute the test binary:
      ./reservoir_tests

    Success is indicated by the message: All Reservoir Tests Passed.

    ./compile_offline_NoahMP.sh template/setEnvar.sh
    make
    make test
    ./reservoir_tests
  7. Configure MAD-WRF execution modes

    master

    MAD-WRF offers two primary operational modes via the madwrf_opt namelist variable. Choose the mode based on whether you require microphysical process accounting or tracer-based nudging.

    Mode 1: Advection and Diffusion Only

    In this mode, initial hydrometeors are advected and diffused using model dynamics without microphysical processes. Required Configuration:

    • Set mp_physics = 96
    • Set use_mp_re = 0 in the physics block of the WRF namelist.

    Mode 2: Hydrometeor Tracer Nudging

    This mode uses hydrometeor tracers that are advected and diffused. Standard hydrometeors are nudged towards these tracers during the simulation. Required Configuration:

    • madwrf_dt_nudge: Sets the temporal period for hydrometeor nudging (in minutes).
    • madwrf_dt_relax: Sets the relaxation time for hydrometeor nudging (in seconds).
    madwrf_opt = 1
    mp_physics = 96
    use_mp_re = 0
    
    # OR
    
    madwrf_opt = 2
    madwrf_dt_nudge = [min]
    madwrf_dt_relax = [s]
  8. Run unit tests for the Hybrid Reservoir module

    master

    To verify the initialization and components of the hybrid reservoir module, follow these steps in your terminal:

    1. Navigate to the NDHMS directory and compile the offline NoahMP environment:
      ./compile_offline_NoahMP.sh template/setEnvar.sh
    2. Navigate to the Reservoir directory.
    3. Compile the module:
      make
    4. Run the tests:
      make test
      ./reservoir_tests

    Success is indicated by the message: All Reservoir Tests Passed.

  9. Check the status of managed repositories with checkout_externals

    master

    Use the --status flag to see a summary of the repositories managed by checkout_externals.

    Summary Output Format

    The output provides three columns:

    1. Status:
      • s: out-of-sync (different commit than config)
      • e: empty (directory does not exist)
      • ?: unknown (directory exists but .git or .svn is missing)
    2. Modification State:
      • M: Modified (files added, deleted, or missing)
      • : Clean
      • -: No meaningful state (for empty repos)
    3. Requirement Type:
      • o: optional
      • : required

    Commands

    • View summary status:

      ./manage_externals/checkout_externals --status
    • View detailed git/svn status:

      ./manage_externals/checkout_externals --status --verbose
    ./manage_externals/checkout_externals --status
  10. Access WRF documentation and resources

    master

    The WRF Model Users' Web Site is the central hub for the modeling system. It provides an overview of the system, download links, user support, documentation, publications, and other additional resources.

    https://www2.mmm.ucar.edu/wrf/users/
  11. Register as a WRF user

    master

    New users of the WRF modeling system are requested to register via the official form. This registration helps the developers determine support and development needs for the model.

    https://www2.mmm.ucar.edu/wrf/users/download/wrf-regist.php
  12. Install WRF on Cygwin

    master

    After setting up Cygwin, follow these steps to install the WRF source code:

    1. Download and unpack the WRF source code.
    2. Clean the source directory:
      ./clean -a
    3. Export the necessary environment variables so WRF can locate dependencies:
      export NETCDF=/usr/ NETCDF4=1 HDF5=/usr
      Optional (for GRIB support):
      export JASPER=/usr JASPERLIB=/usr/lib JASPERINC=/usr/include
      Optional (for large file/classic NetCDF support):
      export WRFIO_NCD_NO_LARGE_FILE_SUPPORT=0 NETCDF_classic=0
    4. Run the configuration script:
      ./configure
      (Follow the on-screen directions)
    5. Compile the model:
      ./compile
      (Follow the on-screen directions)
    ./clean -a
    export NETCDF=/usr/ NETCDF4=1 HDF5=/usr
    ./configure
    ./compile