Skip to content

Commit

Permalink
Revert "update max_blocks in ice_domain.F90, enabling max_blocks set …
Browse files Browse the repository at this point in the history
…on the fly"

This reverts commit 2c85db3.
  • Loading branch information
anton-seaice committed May 3, 2024
1 parent 92c4f4d commit daf234a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 8 deletions.
10 changes: 4 additions & 6 deletions cicecore/cicedyn/infrastructure/ice_domain.F90
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ subroutine init_domain_blocks
! This routine reads in domain information and calls the routine
! to set up the block decomposition.

use ice_distribution, only: processor_shape, proc_decomposition
use ice_distribution, only: processor_shape
use ice_domain_size, only: ncat, nilyr, nslyr, max_blocks, &
nx_global, ny_global, block_size_x, block_size_y
use ice_fileunits, only: goto_nml
Expand All @@ -112,8 +112,7 @@ subroutine init_domain_blocks
!----------------------------------------------------------------------

integer (int_kind) :: &
nml_error, & ! namelist read error flag
nprocs_x, nprocs_y ! procs decomposed into blocks
nml_error ! namelist read error flag

character(len=char_len) :: nml_name ! text namelist name
character(len=char_len_long) :: tmpstr2 ! for namelist check
Expand Down Expand Up @@ -233,9 +232,8 @@ subroutine init_domain_blocks

! Determine max_blocks if not set
if (max_blocks < 1) then
call proc_decomposition(nprocs, nprocs_x, nprocs_y)
max_blocks=((nx_global-1)/block_size_x/nprocs_x+1) * &
((ny_global-1)/block_size_y/nprocs_y+1)
max_blocks=( ((nx_global-1)/block_size_x + 1) * &
((ny_global-1)/block_size_y + 1) - 1) / nprocs + 1
max_blocks=max(1,max_blocks)
if (my_task == master_task) then
write(nu_diag,'(/,a52,i6,/)') &
Expand Down
3 changes: 1 addition & 2 deletions cicecore/shared/ice_distribution.F90
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,7 @@ module ice_distribution
ice_distributionGet, &
ice_distributionGetBlockLoc, &
ice_distributionGetBlockID, &
create_local_block_ids, &
proc_decomposition
create_local_block_ids

character (char_len), public :: &
processor_shape ! 'square-pop' (approx) POP default config
Expand Down

0 comments on commit daf234a

Please sign in to comment.