diff --git a/cicecore/cicedyn/infrastructure/ice_domain.F90 b/cicecore/cicedyn/infrastructure/ice_domain.F90 index 41072d3d5..483c4d3bd 100644 --- a/cicecore/cicedyn/infrastructure/ice_domain.F90 +++ b/cicecore/cicedyn/infrastructure/ice_domain.F90 @@ -223,17 +223,21 @@ subroutine init_domain_blocks call broadcast_scalar(ny_global, master_task) ! Set nprocs if not set in namelist +#ifdef CESMCOUPLED + nprocs = get_num_procs() +#else if (nprocs == -1) then nprocs = get_num_procs() else if (nprocs /= 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 +#endif ! Determine max_blocks if not set if (max_blocks < 1) then - max_blocks=( ((nx_global-1)/block_size_x + 1) * & - ((ny_global-1)/block_size_y + 1) - 1) / nprocs + 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,/)') &