Skip to content

Commit

Permalink
Make procs optional
Browse files Browse the repository at this point in the history
  • Loading branch information
anton-seaice authored and Anton Steketee committed May 2, 2024
1 parent 2c85db3 commit 54b22e7
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 13 deletions.
21 changes: 9 additions & 12 deletions cicecore/cicedyn/infrastructure/ice_domain.F90
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,6 @@ module ice_domain
integer (int_kind) :: &
nprocs ! num of processors


!***********************************************************************

contains
Expand Down Expand Up @@ -224,7 +223,15 @@ subroutine init_domain_blocks
call broadcast_scalar(nx_global, master_task)
call broadcast_scalar(ny_global, master_task)

! Automatically determine max_blocks if not set.
! Set nprocs if not set in namelist
if (nprocs .eq. -1) then
nprocs = get_num_procs()
else if (nprocs .ne. get_num_procs()) then
write(nu_diag,*) subname,' ERROR: nprocs, get_num_procs = ',nprocs,get_num_procs()
call abort_ice(subname//' ERROR: Input nprocs not same as system request', file=__FILE__, line=__LINE__)
endif

! Determine max_blocks if not set
if (my_task == master_task) then
if (max_blocks < 1) then
call proc_decomposition(nprocs, nprocs_x, nprocs_y)
Expand All @@ -247,16 +254,6 @@ subroutine init_domain_blocks
!*** domain size zero or negative
!***
call abort_ice(subname//' ERROR: Invalid domain: size < 1', file=__FILE__, line=__LINE__) ! no domain
else if (nprocs /= get_num_procs()) then
!***
!*** input nprocs does not match system (eg MPI) request
!***
#if (defined CESMCOUPLED)
nprocs = get_num_procs()
#else
write(nu_diag,*) subname,' ERROR: nprocs, get_num_procs = ',nprocs,get_num_procs()
call abort_ice(subname//' ERROR: Input nprocs not same as system request', file=__FILE__, line=__LINE__)
#endif
else if (nghost < 1) then
!***
!*** must have at least 1 layer of ghost cells
Expand Down
2 changes: 1 addition & 1 deletion cicecore/shared/ice_distribution.F90
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ module ice_distribution
ice_distributionGetBlockLoc, &
ice_distributionGetBlockID, &
create_local_block_ids, &
proc_decomposition ! mli: add
proc_decomposition

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

0 comments on commit 54b22e7

Please sign in to comment.