Coarse-grid DX, DY compute all other domain grid distances#1054
Merged
davegill merged 4 commits intowrf-model:developfrom Jan 28, 2020
Merged
Coarse-grid DX, DY compute all other domain grid distances#1054davegill merged 4 commits intowrf-model:developfrom
davegill merged 4 commits intowrf-model:developfrom
Conversation
TYPE: new feature
KEYWORDS: dx, grid distance, MOAD
SOURCE: internal
DESCRIPTION OF CHANGES:
Similar to the WPS namelist, only the most-coarse domain needs to have
the grid distance specified.
LIST OF MODIFIED FILES:
modified: share/module_check_a_mundo.F
TESTS CONDUCTED:
1. Bit-wise identical answers with the following namelist options:
```
max_dom = 3,
e_we = 74, 31, 31,
e_sn = 61, 31, 31,
dx = 30000, 10000, 3333.33,
dy = 30000, 10000, 3333.33,
grid_id = 1, 2, 3,
parent_id = 0, 1, 2,
parent_grid_ratio = 1, 3, 3,
```
```
max_dom = 3,
e_we = 74, 31, 31,
e_sn = 61, 31, 31,
dx = 30000, 11000, 3333.33,
dy = 30000, 11000, 3333.33,
grid_id = 1, 2, 3,
parent_id = 0, 1, 2,
parent_grid_ratio = 1, 3, 3,
```
```
max_dom = 3,
e_we = 74, 31, 31,
e_sn = 61, 31, 31,
dx = 30000,
dy = 30000,
grid_id = 1, 2, 3,
parent_id = 0, 1, 2,
parent_grid_ratio = 1, 3, 3,
```
2. Helpful messages are printed at the top of the ARW real and WRF standard
outputs that describe the computed grid distances that are used within the
programs. For all three of the namelists above, the printout is:
```
Domain # 1: dx = 30000.000 m
Domain # 2: dx = 10000.000 m
Domain # 3: dx = 3333.333 m
```
3. A test program was written around the new recursive subroutine.
```
MODULE inside
CONTAINS
RECURSIVE SUBROUTINE get_moad_factor ( id, parent_id, parent_grid_ratio, max_dom, factor )
IMPLICIT NONE
INTEGER :: max_dom
INTEGER, DIMENSION(max_dom) :: parent_id, parent_grid_ratio
INTEGER :: factor, id
IF ( id .EQ. 1 ) THEN
RETURN
ELSE
factor = factor * parent_grid_ratio(id)
CALL get_moad_factor ( parent_id(id), parent_id, parent_grid_ratio, max_dom, factor )
END IF
END SUBROUTINE get_moad_factor
END MODULE inside
!==============
program tester
use inside
implicit none
integer , parameter :: huge_max_dom = 6
real,dimension(huge_max_dom) :: dx, dy
integer,dimension(huge_max_dom) :: grid_id, parent_id, parent_grid_ratio
integer :: factor, id, loop, max_dom
dx(1) = 30000.
grid_id = (/1, 2, 3, 4, 5, 6/)
parent_id = (/0, 1, 2, 1, 4, 5/)
parent_grid_ratio = (/1, 3, 3, 2, 3, 4/)
do max_dom = 1, huge_max_dom
do loop = 1, max_dom
id = loop
factor = 1
call get_moad_factor ( id, parent_id, parent_grid_ratio, max_dom, factor )
dx(id) = dx(1) / REAL(factor)
print *,'max_dom = ',max_dom,', dom = ',loop,', dx = ',dx(id)
end do
print *,' '
end do
end program tester
```
The output is as expected:
```
> a.out
max_dom = 1 , dom = 1 , dx = 30000.0000
max_dom = 2 , dom = 1 , dx = 30000.0000
max_dom = 2 , dom = 2 , dx = 10000.0000
max_dom = 3 , dom = 1 , dx = 30000.0000
max_dom = 3 , dom = 2 , dx = 10000.0000
max_dom = 3 , dom = 3 , dx = 3333.33325
max_dom = 4 , dom = 1 , dx = 30000.0000
max_dom = 4 , dom = 2 , dx = 10000.0000
max_dom = 4 , dom = 3 , dx = 3333.33325
max_dom = 4 , dom = 4 , dx = 15000.0000
max_dom = 5 , dom = 1 , dx = 30000.0000
max_dom = 5 , dom = 2 , dx = 10000.0000
max_dom = 5 , dom = 3 , dx = 3333.33325
max_dom = 5 , dom = 4 , dx = 15000.0000
max_dom = 5 , dom = 5 , dx = 5000.00000
max_dom = 6 , dom = 1 , dx = 30000.0000
max_dom = 6 , dom = 2 , dx = 10000.0000
max_dom = 6 , dom = 3 , dx = 3333.33325
max_dom = 6 , dom = 4 , dx = 15000.0000
max_dom = 6 , dom = 5 , dx = 5000.00000
max_dom = 6 , dom = 6 , dx = 1250.00000
```
RELEASE NOTE: The ARW real and WRF code now ignore the provided grid distance for any domain other than the most-coarse grid. This provides user-level behavior similar to the WPS geogrid program.
Since the ARW code now handles the computation of the child domain grid distances, there is no need to explicitly include those additional columns of information in any of the ARW namelists. It is not an error to _HAVE_ those values (so as to support backwards capability with older namelists). However, the dx and dy values for the grid distances for columns 2 through max_dom are redundant and internally overwritten. modified: em_b_wave/namelist.input modified: em_b_wave/namelist.input.backwards modified: em_esmf_exp/namelist.input.jan00.ESMFSST modified: em_esmf_exp/namelist.input.jan00.NETCDFSST modified: em_fire/namelist.input_hill_simple modified: em_fire/namelist.input_two_fires modified: em_heldsuarez/namelist.input modified: em_les/namelist.input modified: em_les/namelist.input.SGP modified: em_les/namelist.input_shalconv modified: em_quarter_ss/namelist.input modified: em_quarter_ss/namelist.input_2to1 modified: em_quarter_ss/namelist.input_3to1 modified: em_quarter_ss/namelist.input_4to1 modified: em_quarter_ss/namelist.input_5to1 modified: em_real/namelist.input modified: em_real/namelist.input.4km modified: em_real/namelist.input.chem modified: em_real/namelist.input.diags modified: em_real/namelist.input.global modified: em_real/namelist.input.jan00 modified: em_real/namelist.input.jun01 modified: em_real/namelist.input.ndown_1 modified: em_real/namelist.input.ndown_2 modified: em_real/namelist.input.ndown_3 modified: em_real/namelist.input.pbl-les modified: em_real/namelist.input.volc
Contributor
Author
|
@weiwangncar @smileMchen @kkeene44 |
kkeene44
reviewed
Jan 24, 2020
test/em_real/namelist.input.global
Outdated
| num_metgrid_soil_levels = 4, | ||
| dx = 156343.322,20000, 4000, | ||
| dy = 156343.322,20000, 4000, | ||
| dx = 156343.322,20000, |
kkeene44
approved these changes
Jan 24, 2020
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
TYPE: new feature
KEYWORDS: dx, grid distance, MOAD
SOURCE: internal
DESCRIPTION OF CHANGES:
Similar to the WPS namelist, only the most-coarse domain needs to have the grid distance
specified. For a user, this means that only column 1 in the
namelist.inputfile needs to be specifiedfor the
dxanddynamelist variables. If a user does provide information for additionaldomains, the provided
dxandyare ignored in favor of the values computed from theparent_grid_ratioentries.Since the ARW code now handles the computation of the child domain grid distances, there is
no need to explicitly include those additional columns of information in any of the ARW namelists.
It is not an error to HAVE those values additional columns of information for dx or dy (so as
to support backwards capability with older namelists). However, the dx and dy values for the
grid distances for columns 2 through max_dom are redundant and internally overwritten.
LIST OF MODIFIED FILES:
modified: share/module_check_a_mundo.F
modified: em_b_wave/namelist.input
modified: em_b_wave/namelist.input.backwards
modified: em_esmf_exp/namelist.input.jan00.ESMFSST
modified: em_esmf_exp/namelist.input.jan00.NETCDFSST
modified: em_fire/namelist.input_hill_simple
modified: em_fire/namelist.input_two_fires
modified: em_heldsuarez/namelist.input
modified: em_les/namelist.input
modified: em_les/namelist.input.SGP
modified: em_les/namelist.input_shalconv
modified: em_quarter_ss/namelist.input
modified: em_quarter_ss/namelist.input_2to1
modified: em_quarter_ss/namelist.input_3to1
modified: em_quarter_ss/namelist.input_4to1
modified: em_quarter_ss/namelist.input_5to1
modified: em_real/namelist.input
modified: em_real/namelist.input.4km
modified: em_real/namelist.input.chem
modified: em_real/namelist.input.diags
modified: em_real/namelist.input.global
modified: em_real/namelist.input.jan00
modified: em_real/namelist.input.jun01
modified: em_real/namelist.input.ndown_1
modified: em_real/namelist.input.ndown_2
modified: em_real/namelist.input.ndown_3
modified: em_real/namelist.input.pbl-les
modified: em_real/namelist.input.volc
TESTS CONDUCTED:
identical results are not expected, as the internally computed value of the grid distance will
be different that what is assigned based on the namelist entry. The output from the netcdf
files shows the difference in the grid distance:
Differences on d01 after 3 minutes (1 CG time step, 3 d02 time steps, 9 d03 timesteps):

Differences on d03 after 3 minutes (1 CG time step, 3 d02 time steps, 9 d03 timesteps):

identical answers with the following namelist options:
outputs that describe the computed grid distances that are used within the
programs. For all three of the namelists above, the printout is:
The output is as expected:
RELEASE NOTE: The ARW real and WRF code now ignore the provided grid distance for any domain other than the most-coarse grid. This update to the namelist processing for grid distance provides user-level behavior in the real/WRF namelist.input file similar to the WPS geogrid program's usage of the namelist.wps file.