Skip to content

Shared physics - move i1 to state for cdata constructs in CPF / SPIN / CCPP#2

Open
davegill wants to merge 4 commits intodevelopfrom
SHARED_PHYSICS
Open

Shared physics - move i1 to state for cdata constructs in CPF / SPIN / CCPP#2
davegill wants to merge 4 commits intodevelopfrom
SHARED_PHYSICS

Conversation

@davegill
Copy link
Copy Markdown
Owner

@davegill davegill commented Oct 11, 2018

add ?w=1 to the url under Files changed to remove diffs due to white space.

Each commit has a full commit message.

In anticipation of adding in additional columns of information
for a few i1 arrays, remove the unnecessary spaces at the end of
each line in the main ARW Registry file.
TYPE: no impact

KEYWORDS: i1, state, shared physics

SOURCE: internal

DESCRIPTION OF CHANGES:
For the shared physics utility, a list of pointers to input and output
variables is required. The i1 variables from the WRF registry are
stack variables inside the solve routine. Those i1 met variables passed
to the rk step part 1 routine are identified, removed from the argument
list, and referred to in the first step part 1 routine with the grid%
DDT.

LIST OF MODIFIED FILES:
modified:   Registry/Registry.EM_COMMON
modified:   dyn_em/module_first_rk_step_part1.F
modified:   dyn_em/module_first_rk_step_part2.F
modified:   dyn_em/solve_em.F

TESTS CONDUCTED:
1. Code compiles
2. Bit for bit results
TYPE: no impact

KEYWORDS: i1, state, shared physics

SOURCE: internal

DESCRIPTION OF CHANGES:
Additional multi-dimension arrays moved from i1 to state in the Registry,
for eventual use by the shared physics driver. Need to have a list of
pointers to these arrays, so we cannot have stack-allocated fields.

Arrays: psim, psih, gz10z0, chklowq, cu_act_flag, hol

LIST OF MODIFIED FILES:
modified:   Registry/Registry.EM_COMMON
modified:   dyn_em/module_first_rk_step_part1.F
modified:   dyn_em/module_first_rk_step_part2.F
modified:   dyn_em/solve_em.F

TESTS CONDUCTED:
1. Code compiles
2. Passes bit-for-bit tests
state real t8w ikj misc 1 Z - "T8W" "Temperature, full levels" "K"
i1 real rho_phy ikj misc 1 -
i1 logical CU_ACT_FLAG ij misc 1 -
state logical CU_ACT_FLAG ij misc 1 - - "CU_ACT_FLAG" "Some great mystery" "unknown"
Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dudhia @weiwangncar
Folks,
Any suggestions for the description and units fot the cu_act_flag?

@dudhia
Copy link
Copy Markdown

dudhia commented Oct 11, 2018 via email

davegill added a commit that referenced this pull request May 30, 2019
… data (wrf-model#875)

TYPE: bug fix

KEYWORDS: LBC, valid time

SOURCE: identified by Michael Duda (NCAR/MMM), fixed internally

DESCRIPTION OF CHANGES:
Problem:
1. If a user tried to start a simulation _after_ the last LBC valid period, the
WRF model would get into a nearly infinite loop and print out repeated statements:
```
 THIS TIME 2000-01-24_18:00:00, NEXT TIME 2000-01-25_00:00:00
d01 2000-01-25_06:00:00  Input data is acceptable to use: wrfbdy_d01
           2  input_wrf: wrf_get_next_time current_date: 2000-01-24_18:00:00 Status =           -4
d01 2000-01-25_06:00:00  ---- ERROR: Ran out of valid boundary conditions in file wrfbdy_d01
```
2. If a user tries to extend the model simulation beyond that valid times of the LBC, the code
behavior is not controlled (nearly infinite loops on some machines, or runtime errors with a backtrace
on other machines).

Solution:
In another routine, the lateral boundary condition is read to get to the
correct time. Once inside of share/input_wrf.F, we should be at the
correct time. There is no need to try to get to the next time. In this
particular case, the effort to get to the next time fails, but we try
again (and again and again). This solution fixes both problems identified
above.

ISSUE:
Fixes wrf-model#769 "WRF doesn't halt when beginning LBC time is not in wrfbdy_d01 file"

LIST OF MODIFIED FILES:
M share/input_wrf.F

TESTS CONDUCTED:
1. Without fix, start the model after the last valid time of the LBC file => lots of repeated messages
```
 THIS TIME 2000-01-24_18:00:00, NEXT TIME 2000-01-25_00:00:00
d01 2000-01-25_06:00:00  Input data is acceptable to use: wrfbdy_d01
           2  input_wrf: wrf_get_next_time current_date: 2000-01-24_18:00:00 Status =           -4
d01 2000-01-25_06:00:00  ---- ERROR: Ran out of valid boundary conditions in file wrfbdy_d01
```
2. With this fix, when LBC stops at 2000 01 25 00, and WRF starts at 2000 01 25 06
```
d01 2000-01-25_06:00:00  Input data is acceptable to use: wrfbdy_d01
 THIS TIME 2000-01-24_12:00:00, NEXT TIME 2000-01-24_18:00:00
d01 2000-01-25_06:00:00  Input data is acceptable to use: wrfbdy_d01
 THIS TIME 2000-01-24_18:00:00, NEXT TIME 2000-01-25_00:00:00
d01 2000-01-25_06:00:00  Input data is acceptable to use: wrfbdy_d01
           2  input_wrf: wrf_get_next_time current_date: 2000-01-24_18:00:00 Status =           -4
-------------- FATAL CALLED ---------------
FATAL CALLED FROM FILE:  <stdin>  LINE:    1134
 ---- ERROR: Ran out of valid boundary conditions in file wrfbdy_d01
-------------------------------------------
```
3. Without this fix, if we try to extend the module simulation beyond the valid lateral boundary times
```
Timing for main: time 2000-01-24_23:54:00 on domain   1:    0.53782 elapsed seconds
Timing for main: time 2000-01-24_23:57:00 on domain   1:    0.51111 elapsed seconds
Timing for main: time 2000-01-25_00:00:00 on domain   1:    0.54507 elapsed seconds
Timing for Writing wrfout_d01_2000-01-25_00:00:00 for domain        1:    0.03793 elapsed seconds
d01 2000-01-25_00:00:00  Input data is acceptable to use: wrfbdy_d01
           2  input_wrf: wrf_get_next_time current_date: 2000-01-25_00:00:00 Status =           -4
d01 2000-01-25_00:00:00  ---- ERROR: Ran out of valid boundary conditions in file wrfbdy_d01
At line 777 of file module_date_time.f90
Fortran runtime error: Bad value during integer read

Error termination. Backtrace:
#0  0x10e67c36c
#1  0x10e67d075
#2  0x10e67d7e9
```
4. With this fix, if we try to extend the module simulation beyond the valid lateral boundary times
```
Timing for main: time 2000-01-24_23:54:00 on domain   1:    0.60755 elapsed seconds
Timing for main: time 2000-01-24_23:57:00 on domain   1:    0.57641 elapsed seconds
Timing for main: time 2000-01-25_00:00:00 on domain   1:    0.60817 elapsed seconds
Timing for Writing wrfout_d01_2000-01-25_00:00:00 for domain        1:    0.04499 elapsed seconds
d01 2000-01-25_00:00:00  Input data is acceptable to use: wrfbdy_d01
           2  input_wrf: wrf_get_next_time current_date: 2000-01-25_00:00:00 Status =           -4
-------------- FATAL CALLED ---------------
FATAL CALLED FROM FILE:  <stdin>  LINE:    1134
 ---- ERROR: Ran out of valid boundary conditions in file wrfbdy_d01
-------------------------------------------
```

MMM Classroom regtest; em_real, nmm, em_chem; GNU only
davegill added a commit that referenced this pull request Feb 20, 2020
davegill added a commit that referenced this pull request May 3, 2021
davegill added a commit that referenced this pull request May 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants