Skip to content

Commit

Permalink
Move new code to improve readability
Browse files Browse the repository at this point in the history
Moved new code to come after high-level explanatory comments,
for improved readability.
  • Loading branch information
Patrick Worley committed Mar 27, 2017
1 parent 501195f commit 13c4ea3
Showing 1 changed file with 11 additions and 10 deletions.
21 changes: 11 additions & 10 deletions components/cam/src/physics/cam/phys_grid.F90
Original file line number Diff line number Diff line change
Expand Up @@ -678,16 +678,6 @@ subroutine phys_grid_init( )
local_dp_map = .true.
!
else
if (twin_alg .eq. 1) then
! precompute clon_p_idx: index in lonlat ordering for first
! occurrence of longitude corresponding to given latitude index,
! used in twin option in create_chunks; used in create_chunks
allocate( clon_p_idx(1:clon_p_tot) )
clon_p_idx(1) = 1
do i=2,clon_p_tot
clon_p_idx(i) = clon_p_idx(i-1) + clon_p_cnt(i-1)
enddo
endif
!
! Option == 0: split local blocks into chunks,
! while attempting to create load-balanced chunks.
Expand Down Expand Up @@ -716,6 +706,17 @@ subroutine phys_grid_init( )
! Allocate and initialize chunks data structure, then
! assign chunks to processes.
!
if (twin_alg .eq. 1) then
! precompute clon_p_idx: index in lonlat ordering for first
! occurrence of longitude corresponding to given latitude index,
! used in twin option in create_chunks; used in create_chunks
allocate( clon_p_idx(1:clon_p_tot) )
clon_p_idx(1) = 1
do i=2,clon_p_tot
clon_p_idx(i) = clon_p_idx(i-1) + clon_p_cnt(i-1)
enddo
endif

call create_chunks(lbal_opt, chunks_per_thread)

! Early clean-up, to minimize memory high water mark
Expand Down

0 comments on commit 13c4ea3

Please sign in to comment.