Skip to content

Commit

Permalink
New algorithm to improve memory usage and parallelism in the estimati…
Browse files Browse the repository at this point in the history
…on of GWDO statistics

This commit introduces code changes in order to improve the memory footprint of the
computation of Gravity Wave Drag Orography statistics in the init_atmosphere. The
previous approach involved each MPI rank reading in the entirety of the topography
and land use tiles, and this may prevent fully-subscribing to all cores in a node.
The new approach only reads in one tile at a time, when it encounters a pixel whose
data is not already available in a linked list. The new algorithm is able to fully
subscribe to all ranks in a node, leading to better parallel performance.

The get_box subroutine is modified to call get_tile_from_box_point to check if the
current pixel in the box is present in the linked list, and if not, it appends this
tile (after reading both topo and land use data) to the head of the list. This commit
also changes box, box_landuse, dxm, nx and ny to be local variables, instead of module
variables. This provides better readability, along with advantages of thread safety.

This commit also removes the extraneous conversion of the cell latitude from radians
to degrees and back to radians, prior to the estimation of zonal box size. The result
is a numerically more correct code, but it results in marginal differences with the
previous approach
  • Loading branch information
abishekg7 committed Jan 10, 2025
1 parent 5cb5c63 commit 6784e82
Showing 1 changed file with 395 additions and 166 deletions.
Loading

0 comments on commit 6784e82

Please sign in to comment.