Skip to content

some ideal.exe model_config_rec settings not getting into wrfinput global attributes #2392

Description

@MicroTed

Setting some parameter values module_initialize_ideal.F (using nl_set_) has no effect (specifically for 'isice'). I ran into this issue when trying to set a value for ISICE in module_initialize_ideal:

CALL nl_set_isice(1,24)

but in the wrfinput global attributes, it has ISICE=0, which caused a problem with the ruclsm. (I'm doing some full physics testing in ideal mode.)

The setting of ISWATER does work, however, and the reason is curious, stemming from having multiple copies of these variables (grid, config_flags, and model_config_rec) and how output_wrf.F is coded. output_wrf.F uses both config_rec (through nl_get) for some variables but config_flags for others, which is confusing. In that code, ISWATER is pulled from nl_get, but ISICE from config_flags. A bunch of other values are pulled from nl_get that aren't used because the value written comes from config_flags. It seems like a lot of work to try to make things consistent in output_wrf (e.g., to only use config_rec values). (There is still a commented line in output_wrf.F that sets iswater from config_flags, so apparently this issue has been encountered before.)

module_initialize_ideal.F can set values in "grid" and "model_config_rec" (via the nl_set calls), but not "config_flags". (It has a local config_flags that is a copy from model_config_rec) In real_em.F, model_config_rec is copied into config_flags after the domain init, but that is not done in ideal_em.F. A simple fix is to add the same copy command to the med_initialdata_output subroutine in ideal_em.F so that it acts like real_em.F:

change config_flags from OUT to INOUT
add this line after init_domain
CALL model_to_grid_config_rec ( grid%id , model_config_rec , config_flags )

I could do a PR if there's agreement on this. I suppose the test cases would all need to be checked for consistent results, though.

Relevant files:
module_initialize_ideal.F
output_wrf.F
ideal_em.F

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions