Remove hard-coded max number of tasks for obs nudging#698
Remove hard-coded max number of tasks for obs nudging#698smileMchen merged 3 commits intowrf-model:release-v4.0.3from
Conversation
|
It has small memory footprint but it needs DEALLOCATE for the allocated arrays before subroutine exit. |
|
@jonggwan |
|
@jonggwan |
|
@smileMchen
|
… the variables are defined
|
@smileMchen
|
|
@davegill (2) A large case (derived from a user's case) is also tested. In this case, the code is built with ./configure -D option. Without the change, the case crashed immediately. The error message is: With the code change, the case can run successfully for 6 hours. Please let me know if you need more information. |
TYPE: bug fix
KEYWORDS: obs nudging, max number of tasks
SOURCE: internal
DESCRIPTION OF CHANGES:
Problem:
The max number of processors, 1024, is hard coded in module_dm.F for observation nudging.
If a user requests more MPI tasks than this max number, this leads to segmentation fault.
Solution:
In the routine where the dimension of the variables is defined as the maximum number of MPI
tasks, those two variables are now declared as ALLOCATABLE, and then they are allocated based on
the total number of MPI ranks.
LIST OF MODIFIED FILES:
M external/RSL_LITE/module_dm.F
TESTS CONDUCTED:
With the code change, the case can run successfully for 6 hours.
RELEASE NOTE: After removing a hard-coded limit for an assumed maximum number of MPI tasks, the observation nudging code for WRF now supports more than 1024 MPI tasks. If users previously ran the obs nudging code with 1024 or fewer MPI tasks, the original code is OK. However, if users tried to run obs nudging with > 1024 MPI tasks, likely the code died from a segmentation fault, while trying to access an address for an array index that was not available.