Skip to content

fixed boundary issues in rhs_ph#1336

Merged
weiwangncar merged 1 commit intowrf-model:release-v4.2.2from
matzegoebel:fix_jtf_ph
Jan 13, 2021
Merged

fixed boundary issues in rhs_ph#1336
weiwangncar merged 1 commit intowrf-model:release-v4.2.2from
matzegoebel:fix_jtf_ph

Conversation

@matzegoebel
Copy link
Contributor

@matzegoebel matzegoebel commented Dec 11, 2020

TYPE: bug fix

KEYWORDS: geopotential, index, horizontal advection, open, specified

SOURCE: Matthias Göbel (University of Innsbruck)

DESCRIPTION OF CHANGES:

When using advection order < 5 and open or specified boundary conditions, the upper limits in the horizontal advection loops of geopotential are one too small.

Let's look at the y-advection with advection order = 2, for instance and assume jte=jde. For open and specified BC the
lower limit is increased by 1 from jds to jds+1, but the upper limit is decreased by 2 from jde-1 to jtf=jde-1-2=jde-3. It should be jtf=jde-2, however. Starting at line 2092 the jde-1 point is set, but the jde-2 point is not handled anywhere.

The issue is analogous for x-advection and advection order = 4 (jtf=jde-4 instead of jtf=jde-3).

For advection order >= 5, the limits are set correctly, because a different notation is used: jtf = min(jtf,jde-4)

LIST OF MODIFIED FILES:
dyn_em/module_big_step_utilities_em.F

TESTING CONDUCTED:
I did an LES test case simulation, with periodic y-boundaries and open x-boundaries, mean x-wind of 10 m/s, h_sca_adv_order=3, and north-south oriented cosine ridge in the center of the domain.
Here is the perturbation geopotential after 1 minute integration at k=2:
ph
and here the difference plot:
ph_diff

You can clearly see the higher geopotential in the new formulation at i=ide-3. This is the point where the horizontal advection is not carried out by the current algorithm.

After 10 minutes it looks like this:
ph_600
ph_diff_600

RELEASE NOTES: When using advection order < 5, and either open or specified boundary conditions, the upper limit of the indexing in the horizontal advection loops of geopotential was previously incorrect. For horizontal advection order >= 5, the index limits were not incorrect.

@matzegoebel matzegoebel marked this pull request as ready for review December 11, 2020 18:28
@davegill
Copy link
Contributor

@matzegoebel
Matthias,
This is a very clean PR. We very much appreciate when users contribute mods that assist a large segment of the community.

  1. Would you please provide a method to allow us to verify that this is solving the stated problem. For example, a before vs after plot, or some additional diagnostic prints.

  2. When supporting verification materials are provided, also edit the PR message a bit. Instead of

I think it should be jtf=jde-2, however.

the new statement will be

It should be jtf=jde-2, however.

@matzegoebel
Copy link
Contributor Author

Ok, I did an LES test case simulation, with periodic y-boundaries and open x-boundaries, mean x-wind of 10 m/s, h_sca_adv_order=3, and north-south oriented cosine ridge in the center of the domain.
Here is the perturbation geopotential after 1 minute integration at k=2:
ph
and here the difference plot:
ph_diff

You can clearly see the higher geopotential in the new formulation at i=ide-3. This is the point where the horizontal advection is not carried out by the current algorithm.

After 10 minutes it looks like this:
ph_600
ph_diff_600

@davegill
Copy link
Contributor

@matzegoebel
Matthias,
Would you please fix this line. It is a bit confusing:

but the upper limit is decreased by 2: jtf=jtf-2=jde-1-2=jde-3. 

Are you saying that jtf is originally jde-1, but then we reduce it further? So effectively jtf=jde-3?

@matzegoebel
Copy link
Contributor Author

matzegoebel commented Dec 30, 2020

Are you saying that jtf is originally jde-1, but then we reduce it further? So effectively jtf=jde-3?

Yes correct. I tried to make this a bit more clear in the commit message now.

@weiwangncar weiwangncar merged commit eb90823 into wrf-model:release-v4.2.2 Jan 13, 2021
vlakshmanan-scala pushed a commit to scala-computing/WRF that referenced this pull request Apr 4, 2024
…1336)

TYPE: bug fix

KEYWORDS: geopotential, index, horizontal advection, open, specified

SOURCE: Matthias Göbel (University of Innsbruck)

DESCRIPTION OF CHANGES:

When using advection order < 5 (h_sca_adv_order) and open or specified boundary conditions, the upper limits in the horizontal advection loops of geopotential are one too small.

Let's look at the y-advection with advection order = 2, for instance and assume jte=jde. For open and specified BC the lower limit is increased by 1 from jds to jds+1, but the upper limit is decreased by 2 from jde-1 to jtf=jde-1-2=jde-3. It should be jtf=jde-2, however. Starting at line 2092 the jde-1 point is set, but the jde-2 point is not handled anywhere.

The issue is analogous for x-advection and advection order = 4 (jtf=jde-4 instead of jtf=jde-3).

For advection order >= 5, the limits are set correctly, because a different notation is used: jtf = min(jtf,jde-4)

LIST OF MODIFIED FILES: 
dyn_em/module_big_step_utilities_em.F

TESTING CONDUCTED: 
An LES case is used to test this change, with periodic y-boundaries and open x-boundaries, mean x-wind of 10 m/s, h_sca_adv_order=3, and north-south oriented cosine ridge in the center of the domain. Here is the perturbation geopotential after 1 minute integration at k=2:
![ph](https://user-images.githubusercontent.com/17001470/102336394-67d8c780-3f91-11eb-899d-3b05d28c05ab.png)
and here the difference plot:
![ph_diff](https://user-images.githubusercontent.com/17001470/102336506-876ff000-3f91-11eb-9ccf-7615df8adaff.png)

One can clearly see the higher geopotential in the new formulation at i=ide-3. This is the point where the horizontal advection is not carried out by the current algorithm.

After 10 minutes it looks like this:
![ph_600](https://user-images.githubusercontent.com/17001470/102336745-dd449800-3f91-11eb-9b06-94776b70d9c8.png)
![ph_diff_600](https://user-images.githubusercontent.com/17001470/102336749-df0e5b80-3f91-11eb-83ac-1d15a499aae9.png)

It passes all Jenkins tests too.

RELEASE NOTES: When using advection order < 5 (namelist h_sca_adv_order), and either open or specified boundary conditions, the upper limit of the indexing in the horizontal advection loops of geopotential was previously incorrect. For horizontal advection order >= 5 (which is the default), the index limits are correct.
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.

4 participants