WRFDA memory usage reduction for thin_conv=true#1604
Merged
jamiebresch merged 1 commit intowrf-model:developfrom Dec 18, 2021
Merged
WRFDA memory usage reduction for thin_conv=true#1604jamiebresch merged 1 commit intowrf-model:developfrom
jamiebresch merged 1 commit intowrf-model:developfrom
Conversation
Contributor
|
This looks good. I see thin_conv (and thin_conv_ascii) is a scaler logic variable. Is it possible to change it as an array so that we can turn on/off thinning for individual obs even they are read in? |
Contributor
Author
I can look into the possibility of potential future improvement. |
liujake
approved these changes
Dec 17, 2021
davegill
approved these changes
Dec 17, 2021
jamiebresch
added a commit
that referenced
this pull request
Dec 23, 2021
TYPE: enhancement KEYWORDS: WRFDA, thin_conv SOURCE: Jamie Bresch (NCAR) DESCRIPTION OF CHANGES: 1. add a new namelist variable thin_conv_opt(num_ob_indexes) to complement thin_conv/thin_conv_ascii switch. When thin_conv/thin_conv_ascii is .true., thin_conv_opt can be set differently for each ob type. thin_conv_opt is further modified inside WRFDA to account for unused ob types (a different implementation to achieve the same memory reduction purpose as previous commit #1604). 2. Some redundant code in several subroutines is moved to a higher-level subroutine. Now the calculation of some lat/lon info (rlat_min,rlat_max,rlon_min,rlon_max,dlat_grid,dlon_grid) to be used for making thinning grids is done only once in da_setup_obs_structures.inc, rather than in each da_setup_obs_structures_ascii.inc, da_setup_obs_structures_bufr.inc, da_setup_obs_structures_rain.inc, and da_setup_radiance_structures.inc. LIST OF MODIFIED FILES: M Registry/registry.var M var/da/da_control/da_control.f90 M var/da/da_obs_io/da_obs_io.f90 M var/da/da_obs_io/da_read_obs_ascii.inc M var/da/da_obs_io/da_read_obs_bufr.inc M var/da/da_obs_io/da_scan_obs_ascii.inc M var/da/da_radiance/da_setup_radiance_structures.inc M var/da/da_setup_structures/da_setup_obs_structures.inc M var/da/da_setup_structures/da_setup_obs_structures_ascii.inc M var/da/da_setup_structures/da_setup_obs_structures_bufr.inc M var/da/da_setup_structures/da_setup_obs_structures_rain.inc M var/da/da_setup_structures/da_setup_structures.f90 TESTS CONDUCTED: 1. tested a few thin_conv and thin_conv_ascii cases and results are the same as V4.3.2. RELEASE NOTE: N/A for now. Will add description for thin_conv_opt in a future PR.
vlakshmanan-scala
pushed a commit
to scala-computing/WRF
that referenced
this pull request
Apr 4, 2024
TYPE: enhancement KEYWORDS: WRFDA, memory, thin_conv SOURCE: Jamie Bresch (NCAR) DESCRIPTION OF CHANGES: Problem: thin_conv is true by default. When ob_format=1 (bufr for conventional ob types), thinning_grid_conv(num_ob_indexes) and its sub data arrays are allocated for all ob types as defined in da_control.f90 (obs_names(num_ob_indexes)) even though not all ob types are used. Solution: Do not call make3grids (which allocates several data arrays based on the setting of thin_mesh_conv) for ob types that are not used in the assimilation and not coded for thinning. Note that gpsref horizontal thinning is not implemented for ob_format=1 (but is implemented for ob_format=2), so its thinning grid does not need to be allocated in da_setup_obs_structures_bufr.inc. That is the reason the specific check for gpsref appears in da_setup_obs_structures_bufr.inc but not da_setup_obs_structures_ascii.inc. Caveat: The same fix logic is done for thin_conv_ascii (default is .false. and only matters when ob_format=2). But I have never tested thin_conv_ascii=.true. LIST OF MODIFIED FILES: M var/da/da_setup_structures/da_setup_obs_structures.inc M var/da/da_setup_structures/da_setup_obs_structures_ascii.inc M var/da/da_setup_structures/da_setup_obs_structures_bufr.inc M var/da/da_setup_structures/da_setup_structures.f90 TESTS CONDUCTED: 1. fixed code has been used extensively by Craig Schwartz. RELEASE NOTE: WRFDA has been fixed to reduce the memory usage for ob_format=1 (i.e. bufr for conventional obs) and thin_conv=true.
vlakshmanan-scala
pushed a commit
to scala-computing/WRF
that referenced
this pull request
Apr 4, 2024
TYPE: enhancement KEYWORDS: WRFDA, thin_conv SOURCE: Jamie Bresch (NCAR) DESCRIPTION OF CHANGES: 1. add a new namelist variable thin_conv_opt(num_ob_indexes) to complement thin_conv/thin_conv_ascii switch. When thin_conv/thin_conv_ascii is .true., thin_conv_opt can be set differently for each ob type. thin_conv_opt is further modified inside WRFDA to account for unused ob types (a different implementation to achieve the same memory reduction purpose as previous commit wrf-model#1604). 2. Some redundant code in several subroutines is moved to a higher-level subroutine. Now the calculation of some lat/lon info (rlat_min,rlat_max,rlon_min,rlon_max,dlat_grid,dlon_grid) to be used for making thinning grids is done only once in da_setup_obs_structures.inc, rather than in each da_setup_obs_structures_ascii.inc, da_setup_obs_structures_bufr.inc, da_setup_obs_structures_rain.inc, and da_setup_radiance_structures.inc. LIST OF MODIFIED FILES: M Registry/registry.var M var/da/da_control/da_control.f90 M var/da/da_obs_io/da_obs_io.f90 M var/da/da_obs_io/da_read_obs_ascii.inc M var/da/da_obs_io/da_read_obs_bufr.inc M var/da/da_obs_io/da_scan_obs_ascii.inc M var/da/da_radiance/da_setup_radiance_structures.inc M var/da/da_setup_structures/da_setup_obs_structures.inc M var/da/da_setup_structures/da_setup_obs_structures_ascii.inc M var/da/da_setup_structures/da_setup_obs_structures_bufr.inc M var/da/da_setup_structures/da_setup_obs_structures_rain.inc M var/da/da_setup_structures/da_setup_structures.f90 TESTS CONDUCTED: 1. tested a few thin_conv and thin_conv_ascii cases and results are the same as V4.3.2. RELEASE NOTE: N/A for now. Will add description for thin_conv_opt in a future PR.
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: enhancement
KEYWORDS: WRFDA, memory, thin_conv
SOURCE: Jamie Bresch (NCAR)
DESCRIPTION OF CHANGES:
Problem:
thin_conv is true by default. When ob_format=1 (bufr for conventional ob types), thinning_grid_conv(num_ob_indexes) and its sub data arrays are allocated for all ob types as defined in da_control.f90 (obs_names(num_ob_indexes)) even though not all ob types are used.
Solution:
Do not call make3grids (which allocates several data arrays based on the setting of thin_mesh_conv) for ob types that are not used in the assimilation and not coded for thinning.
Note that gpsref horizontal thinning is not implemented for ob_format=1 (but is implemented for ob_format=2), so its thinning grid does not need to be allocated in da_setup_obs_structures_bufr.inc. That is the reason the specific check for gpsref appears in da_setup_obs_structures_bufr.inc but not da_setup_obs_structures_ascii.inc.
Caveat: The same fix logic is done for thin_conv_ascii (default is .false. and only matters when ob_format=2). But I have never tested thin_conv_ascii=.true.
LIST OF MODIFIED FILES:
M var/da/da_setup_structures/da_setup_obs_structures.inc
M var/da/da_setup_structures/da_setup_obs_structures_ascii.inc
M var/da/da_setup_structures/da_setup_obs_structures_bufr.inc
M var/da/da_setup_structures/da_setup_structures.f90
TESTS CONDUCTED:
RELEASE NOTE: WRFDA has been fixed to reduce the memory usage for ob_format=1 (i.e. bufr for conventional obs) and thin_conv=true.