Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generalized method to handle different PBL options by domain #1581

Closed
wants to merge 2 commits into from

Commits on Nov 10, 2021

  1. Generalized method to handle different PBL options by domain

    TYPE: bug fix
    
    KEYWORDS: PBL, LES, proxy
    
    SOURCE: internal
    
    DESCRIPTION OF CHANGES:
    Problem:
    Only the YSU PBL scheme has no packaged variables. If a user wants to have any other PBL scheme on the CG,
    and an LES PBL on the FG, the model will have memory corruption problems. This error is hard to detect.
    Inside the model, this causes an inconsistent number of variables on the CG and FG, which then causes
    segmentation faults when trying to do feedback or advection of unavailable fields.
    
    Solution:
    Introduce a derived namelist entry (MAX_DOM sized). This proxy namelist value is used for space allocation
    due to packaging. The existing PBL physics definitions, and the associated packaged variables, have been
    replicated. The proxy entries are used to define the space, and the original entries are used for the
    automatically generated names.
    
    1. There is no difference for the user facing namelist interface.
    2. The developers see no differences inside of the WRF dynamics, or the physics schemes or drivers.
    3. The only developer impact would be when adding additional packaged variables to an existing
    PBL scheme, or when introducing a new scheme.
    
    ISSUE:
    Fixes wrf-model#1514 "MYNN in parent, LES in a nest: sometimes the sim does not run"
    
    LIST OF MODIFIED FILES:
    modified:   Registry/Registry.EM_COMMON
    modified:   share/module_check_a_mundo.F
    
    TESTS CONDUCTED:
    1. A few test scenarios of the combinations of PBL options were tested. These results were printed out
    from the real program (same part of check_a_mundo that the WRF model sees). In each of the examples,
    the check_a_mundo logic translates the namelist entries into the required packages.
    
       . bl_pbl_physics = 5, 0,
    The memory allocation on domain 2 is set to the same packaged variables as on domain 1.
    ```
               PBL      PBL
              PROXY   PHYSICS
              (mem)   (scheme)
             ------------------
               5           5
               5           0
             ------------------
    ```
    
       . bl_pbl_physics = 1, 0,
    The memory allocation on domain 2 is set to the same packaged variables as on domain 1.
    ```
               PBL      PBL
              PROXY   PHYSICS
              (mem)   (scheme)
             ------------------
               1           1
               1           0
             ------------------
    ```
    
       . bl_pbl_physics = 1, 1,
    The memory allocation remains the default, package definitions for domains 1 and 2 remain unchanged.
    ```
               PBL      PBL
              PROXY   PHYSICS
              (mem)   (scheme)
             ------------------
               1           1
               1           1
             ------------------
    ```
    
       . bl_pbl_physics = 0, 0,
    The memory allocation remains the default, package definitions for domains 1 and 2 remain unchanged.
    ```
               PBL      PBL
              PROXY   PHYSICS
              (mem)   (scheme)
             ------------------
               0           0
               0           0
             ------------------
    ```
    2. Hopefully, Jenkins tests are all PASS.
    
    RELEASE NOTE: A generalized method to handle domain-wise inconsistent PBL options has been introduced. Previously, this problem caused an inconsistent number of variables on the CG and FG, which caused segmentation faults when trying to do feedback or advection of unavailable fields. For users that tried the LES PBL option and a non-YSU PBL scheme (AND it worked!), it is possible that the results will be somewhat different due to the CG FG interactions during feedback and the generation of lateral boundary conditions for the nest. Scheme developers are pointed to the new packaging for the PBL schemes (look for the string `_proxy`).
    davegill committed Nov 10, 2021
    Configuration menu
    Copy the full SHA
    97132b5 View commit details
    Browse the repository at this point in the history

Commits on Nov 11, 2021

  1. Zap the debug "stop" statement

    modified:   share/module_check_a_mundo.F
    davegill committed Nov 11, 2021
    Configuration menu
    Copy the full SHA
    07ab3cd View commit details
    Browse the repository at this point in the history