Skip to content

Add vertical nesting checks: no hybrid vert coord, no feedback#1154

Merged
davegill merged 2 commits intowrf-model:release-v4.2from
davegill:vn_requirements
Apr 2, 2020
Merged

Add vertical nesting checks: no hybrid vert coord, no feedback#1154
davegill merged 2 commits intowrf-model:release-v4.2from
davegill:vn_requirements

Conversation

@davegill
Copy link
Copy Markdown
Contributor

@davegill davegill commented Apr 2, 2020

TYPE: enhancement

KEYWORDS: vertial nest, hybrid_opt, feedback

SOURCE: internal

DESCRIPTION OF CHANGES:
Problem:
If a user requests a vertical refinement for a nest, there are a couple
of capabilities that need to be shut off. Either will cause the model
to eventually die, and they are really hard to otherwise find.

Solution:
If a users asks for a vertical refinement on the nest, make sure that the
terrain following coordinate is used (hybrid_opt=0), and that the
feedback option is turned off (feedback=0).

LIST OF MODIFIED FILES:
modified: share/module_check_a_mundo.F

TESTS CONDUCTED:

  1. Jenkins is OK (hopefully)
  2. Incorrectly turning on hybrid_opt=2 or feedback=1 is now safely trapped.
  Domain # 1: dx = 30000.000 m
  Domain # 2: dx = 10000.000 m
  --- ERROR: vert_refine_method=2 only works with hybrid_opt = 0
  --- ERROR: vert_refine_method=2 only works with feedback = 0
-------------- FATAL CALLED ---------------
FATAL CALLED FROM FILE:  <stdin>  LINE:    2293
NOTE:       2 namelist settings are wrong. Please check and reset these options
-------------------------------------------

TYPE: enhancement

KEYWORDS: vertial nest, hybrid_opt, feedback

SOURCE: internal

DESCRIPTION OF CHANGES:
Problem:
If a user requests a vertical refinement for a nest, there are a couple
of capabilities that need to be shut off. Either will cause the model
to eventually die and it is really hard to find the problem.

Solution:
If a users asks for a vertical refinement on the nest, make sure that the
terrain following coordinate is used (`hybrid_opt=0`), and that the
feedback option is turned off (`feedback=0`).

LIST OF MODIFIED FILES:
modified:   share/module_check_a_mundo.F

TESTS CONDUCTED:
1. Jenkins is OK (hopefully)
2. Incorrectly turning on `hybrid_opt=2` or `feedback=1` is now safely trapped.
```
  Domain # 1: dx = 30000.000 m
  Domain # 2: dx = 10000.000 m
  --- ERROR: vert_refine_method=2 only works with hybrid_opt = 0
  --- ERROR: vert_refine_method=2 only works with feedback = 0
-------------- FATAL CALLED ---------------
FATAL CALLED FROM FILE:  <stdin>  LINE:    2293
NOTE:       2 namelist settings are wrong. Please check and reset these options
-------------------------------------------
```
@davegill davegill requested review from a team as code owners April 2, 2020 04:23
@davegill
Copy link
Copy Markdown
Contributor Author

davegill commented Apr 2, 2020

@kkeene44
Kelly,
Please review this PR. It does not change results, but just protects users from themselves.

@davegill davegill merged commit 7d763b9 into wrf-model:release-v4.2 Apr 2, 2020
davegill pushed a commit that referenced this pull request Mar 22, 2021
)

TYPE: bug fix

KEYWORDS: vertical nesting, hybrid vertical coordinate, vert_refine_method, hybrid_opt

SOURCE: Robert Arthur and Katie Lundquist (LLNL)

DESCRIPTION OF CHANGES:
Problem:
When vertical nesting is used with the hybrid vertical coordinate option (hybrid_opt=2), large errors occur in the 
vertically-refined domain.

Solution:
An incorrect calculation of pb (base pressure) was fixed in subroutine force_domain_em_part2 (module_dm.F). The pb 
calculation was changed to match similar code in start_em. This fix is within a block of code that is only called if 
vert_refine_method .ne. 0, in order to rebalance on the "intermediate" nested grid. The error was likely a result of the 
switch to the new hybrid coordinate definition, which was not updated correctly in this particular subroutine.

The check-a-mundo preventing vertical nesting from being used with the hybrid coordinate (see #1154) has also 
been removed.

This PR is related to #901, which addressed vertical nesting with the hybrid coordinate (but did not fully fix the issue), 
as well as #1408, which addressed vertical nesting with use_theta_m=1. 

LIST OF MODIFIED FILES:
external/RSL_LITE/module_dm.F
share/module_check_a_mundo.F

TESTS CONDUCTED: 
1. The tests conducted here are similar to those in #1408. A 4-domain nested case was completed with vertical 
refinement on d04. All domains were initialized from a wrfinput file and eta levels were not provided. Pertinent 
namelist options are:
```
input_from_file = .true., .true., .true., .true.,
e_vert = 45, 45, 45, 55,
vert_refine_method = 0, 0, 0, 2,
rebalance = 1,
hybrid_opt = 0 or 2, depending on the case
use_theta_m = 0
```

Results are summarized in the plot below, which shows U at the first grid point above the surface on d04 at various 
output times.

![U](https://user-images.githubusercontent.com/46732079/111347582-958ae680-863c-11eb-9536-1862a1b650fe.png)

With the original code, vertical nesting works with hybrid_opt=0, but not hybrid_opt=2. With the updated code, results 
look reasonable for hybrid_opt=2 and are roughly the same as for hybrid_opt=0. Similar patterns are also seen for other 
variables, such as V and MU, although they are not shown here.

2. Several similar tests were also conducted, as above but with
   * d04 initialized via interpolation from d03 during runtime, rather than from wrfinput_d04
   * eta levels specified for each domain in the namelist
   * use_theta_m=1

These tests provided qualitatively similar results, showing that the fix works for a range of possible setups.

3. Finally, the tests above were completed with hybrid_opt=0, but using the updated code. These showed bit-for-bit 
identical results (using diffwrf) to the same cases using the original code, confirming that previous vertical nesting 
functionality with hybrid_opt=0 is maintained. This was done for both use_theta_m options, 0 and 1.

4. Jenkins testing is OK

RELEASE NOTE: Vertical nesting now works with the hybrid vertical coordinate.
vlakshmanan-scala pushed a commit to scala-computing/WRF that referenced this pull request Apr 4, 2024
…f-model#1435)

TYPE: bug fix

KEYWORDS: vertical nesting, hybrid vertical coordinate, vert_refine_method, hybrid_opt

SOURCE: Robert Arthur and Katie Lundquist (LLNL)

DESCRIPTION OF CHANGES:
Problem:
When vertical nesting is used with the hybrid vertical coordinate option (hybrid_opt=2), large errors occur in the 
vertically-refined domain.

Solution:
An incorrect calculation of pb (base pressure) was fixed in subroutine force_domain_em_part2 (module_dm.F). The pb 
calculation was changed to match similar code in start_em. This fix is within a block of code that is only called if 
vert_refine_method .ne. 0, in order to rebalance on the "intermediate" nested grid. The error was likely a result of the 
switch to the new hybrid coordinate definition, which was not updated correctly in this particular subroutine.

The check-a-mundo preventing vertical nesting from being used with the hybrid coordinate (see wrf-model#1154) has also 
been removed.

This PR is related to wrf-model#901, which addressed vertical nesting with the hybrid coordinate (but did not fully fix the issue), 
as well as wrf-model#1408, which addressed vertical nesting with use_theta_m=1. 

LIST OF MODIFIED FILES:
external/RSL_LITE/module_dm.F
share/module_check_a_mundo.F

TESTS CONDUCTED: 
1. The tests conducted here are similar to those in wrf-model#1408. A 4-domain nested case was completed with vertical 
refinement on d04. All domains were initialized from a wrfinput file and eta levels were not provided. Pertinent 
namelist options are:
```
input_from_file = .true., .true., .true., .true.,
e_vert = 45, 45, 45, 55,
vert_refine_method = 0, 0, 0, 2,
rebalance = 1,
hybrid_opt = 0 or 2, depending on the case
use_theta_m = 0
```

Results are summarized in the plot below, which shows U at the first grid point above the surface on d04 at various 
output times.

![U](https://user-images.githubusercontent.com/46732079/111347582-958ae680-863c-11eb-9536-1862a1b650fe.png)

With the original code, vertical nesting works with hybrid_opt=0, but not hybrid_opt=2. With the updated code, results 
look reasonable for hybrid_opt=2 and are roughly the same as for hybrid_opt=0. Similar patterns are also seen for other 
variables, such as V and MU, although they are not shown here.

2. Several similar tests were also conducted, as above but with
   * d04 initialized via interpolation from d03 during runtime, rather than from wrfinput_d04
   * eta levels specified for each domain in the namelist
   * use_theta_m=1

These tests provided qualitatively similar results, showing that the fix works for a range of possible setups.

3. Finally, the tests above were completed with hybrid_opt=0, but using the updated code. These showed bit-for-bit 
identical results (using diffwrf) to the same cases using the original code, confirming that previous vertical nesting 
functionality with hybrid_opt=0 is maintained. This was done for both use_theta_m options, 0 and 1.

4. Jenkins testing is OK

RELEASE NOTE: Vertical nesting now works with the hybrid vertical coordinate.
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.

2 participants