Skip to content

Check if STEPWTD==0 in NoahMP before mod(timestep,STEPWTD)#1101

Merged
davegill merged 6 commits intowrf-model:developfrom
davegill:noahmp_stepwtd=0
Feb 27, 2020
Merged

Check if STEPWTD==0 in NoahMP before mod(timestep,STEPWTD)#1101
davegill merged 6 commits intowrf-model:developfrom
davegill:noahmp_stepwtd=0

Conversation

@davegill
Copy link
Contributor

@davegill davegill commented Feb 24, 2020

TYPE: bug fix

KEYWORDS: NoahMP, STEPWTD, mod

SOURCE: internal

DESCRIPTION OF CHANGES:
Problem:
There were two places in the WRF code that tested for mod(itimestep,STEPWTD).
If STEPWTD==0, then this is an error.

Solution:
The correct test order is defined as

  1. Is this opt_run == 5? If true, then the STEPWTD has been previously defined, and can be used.
  2. Is this the correct time step?

LIST OF MODIFIED FILES:
modified: Registry/Registry.EM_COMMON
modified: Registry/Registry.NMM
modified: dyn_em/module_first_rk_step_part1.F
modified: phys/module_surface_driver.F

TESTS CONDUCTED:

  1. All tests with NoahMP fail immediately with STEPWTD==0 due to a divide by 0.
  2. All tests pass with this fix in place.
  3. Regression test underway.

TYPE: bug fix

KEYWORDS: NoahMP, STEPWTD, mod

SOURCE: internal

DESCRIPTION OF CHANGES:
Problem:
There were two places in the WRF code that tested for mod(itimestep,STEPWTD).
If STEPWTD==0, then this is an error.

Solution:
Around each if test, just verify that STEPWTD is not zero before proceeding.

LIST OF MODIFIED FILES:
modified:   dyn_em/module_first_rk_step_part1.F
modified:   phys/module_surface_driver.F

TESTS CONDUCTED:
1. All tests with NoahMP fail with STEPWTD==0 (the default) without fix.
2. All tests pass with this fix.
@davegill davegill requested a review from a team as a code owner February 24, 2020 19:33
@davegill davegill changed the title Check if STEPWTD==0 in NoahMP before mod(thing,STEPWTD) Check if STEPWTD==0 in NoahMP before mod(timestep,STEPWTD) Feb 24, 2020
@davegill
Copy link
Contributor Author

@barlage @dudhia @weiwangncar
Mike,
Do these safety "IF" tests seem OK?

@barlage
Copy link
Contributor

barlage commented Feb 25, 2020

Looks good, @davegill

modified:   Registry/Registry.EM_COMMON
modified:   Registry/Registry.NMM
@davegill davegill requested review from a team as code owners February 25, 2020 04:45
@davegill davegill merged commit 12ebc3e into wrf-model:develop Feb 27, 2020
smileMchen added a commit that referenced this pull request Mar 10, 2020
TYPE: bug fix

KEYWORDS: NoahMP, opt_run option

SOURCE: internal

DESCRIPTION OF CHANGES:
Problem:
When running the NoahMP scheme with the ground water option (opt_run=5), the STEPWTD
variable is initialized to a non-zero value. However when opt_run!=5, then the STEPWTD
variable remains an uninitialized zero value. In the WRF source code, there are a couple of
places where mod(x,STEPWTD) occurs. This causes an immediate "divide by zero" error in
the first call to the surface driver.

Solution:
The IF test logic is re-arranged so that only when opt_run=5 (which means that STEPWTD
is non-zero) is there a second IF test (using mod(x,STEPWTD)) to compute whether
additional processing takes place.

This modification was made separately to the develop branch after the branch release-v4.1.4
was released. See #1101. The purpose of this modification
is to allow users access to the latest v4.1.* branch that works with NoahMP.

As this will be a single issue release, the README and inc/version_decl are also modified
in preparation for the release of WRF release-v4.1.5 with this PR.

LIST OF MODIFIED FILES:
M dyn_em/module_first_rk_step_part1.F
M phys/module_surface_driver.F
M README
M inc/version_decl

TESTS CONDUCTED:

Jenkins test PASS (positively tests NoahMP)
Regression test in NCAR-MMM classroom machine PASS.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants