diff --git a/cicecore/drivers/nuopc/cmeps/CICE_InitMod.F90 b/cicecore/drivers/nuopc/cmeps/CICE_InitMod.F90 index 16e4216e6..3dcd8fb2f 100644 --- a/cicecore/drivers/nuopc/cmeps/CICE_InitMod.F90 +++ b/cicecore/drivers/nuopc/cmeps/CICE_InitMod.F90 @@ -57,7 +57,7 @@ end subroutine CICE_Initialize ! ! Initialize CICE model. - subroutine cice_init(mpicom_ice) + subroutine cice_init use ice_arrays_column, only: hin_max, c_hi_range, alloc_arrays_column use ice_arrays_column, only: floe_rad_l, floe_rad_c, & @@ -66,7 +66,7 @@ subroutine cice_init(mpicom_ice) use ice_flux_bgc, only: alloc_flux_bgc use ice_calendar, only: dt, dt_dyn, time, istep, istep1, write_ic, & init_calendar, calendar - use ice_communicate, only: init_communicate, my_task, master_task + use ice_communicate, only: my_task, master_task use ice_diagnostics, only: init_diags use ice_domain, only: init_domain_blocks use ice_domain_size, only: ncat, nfsd @@ -91,14 +91,10 @@ subroutine cice_init(mpicom_ice) use drv_forcing, only: sst_sss #endif - integer (kind=int_kind), optional, intent(in) :: & - mpicom_ice ! communicator for sequential ccsm - logical(kind=log_kind) :: tr_aero, tr_zaero, skl_bgc, z_tracers, & tr_iso, tr_fsd, wave_spec character(len=*), parameter :: subname = '(cice_init)' - call init_communicate(mpicom_ice) ! initial setup for message passing call init_fileunits ! unit numbers call icepack_configure() ! initialize icepack diff --git a/cicecore/drivers/nuopc/cmeps/ice_comp_nuopc.F90 b/cicecore/drivers/nuopc/cmeps/ice_comp_nuopc.F90 index e4c2a3802..81fb1a308 100644 --- a/cicecore/drivers/nuopc/cmeps/ice_comp_nuopc.F90 +++ b/cicecore/drivers/nuopc/cmeps/ice_comp_nuopc.F90 @@ -62,6 +62,7 @@ module ice_comp_nuopc use perf_mod , only : t_startf, t_stopf, t_barrierf #endif use ice_timers + use ice_communicate, only: init_communicate implicit none private @@ -328,6 +329,7 @@ subroutine InitializeRealize(gcomp, importState, exportState, clock, rc) integer(int_kind) :: ktherm character(*), parameter :: F00 = "('(ice_comp_nuopc) ',2a,1x,d21.14)" character(len=*), parameter :: subname=trim(modName)//':(InitializeRealize) ' + logical :: mastertask !-------------------------------- rc = ESMF_SUCCESS @@ -406,7 +408,9 @@ subroutine InitializeRealize(gcomp, importState, exportState, clock, rc) ! Note that these values are obtained in a call to init_orbit in ice_shortwave.F90 ! if CESMCOUPLED is not defined #ifdef CESMCOUPLED - call ice_orbital_init(gcomp, clock, nu_diag, my_task==master_task, rc) + mastertask = .false. + if (my_task == master_task) mastertask = .true. + call ice_orbital_init(gcomp, clock, nu_diag, mastertask, rc) if (ChkErr(rc,__LINE__,u_FILE_u)) return #else ! Start with icepack values then update with values defined in configure file if they exist @@ -593,11 +597,13 @@ subroutine InitializeRealize(gcomp, importState, exportState, clock, rc) ! Note that sets the nu_diag module variable in ice_fileunits ! Set the nu_diag_set flag so it's not reset later -#ifdef CESMCOUPLED - call set_component_logging(gcomp, my_task==master_task, nu_diag, shrlogunit, rc) + call init_communicate(lmpicom) ! initial setup for message passing + + mastertask = .false. + if (my_task == master_task) mastertask = .true. + call set_component_logging(gcomp, mastertask, nu_diag, shrlogunit, rc) if (ChkErr(rc,__LINE__,u_FILE_u)) return nu_diag_set = .true. -#endif #ifdef CESMCOUPLED call shr_file_setLogUnit (shrlogunit) @@ -613,7 +619,7 @@ subroutine InitializeRealize(gcomp, importState, exportState, clock, rc) #ifdef CESMCOUPLED call t_startf ('cice_init') #endif - call cice_init( lmpicom ) + call cice_init #ifdef CESMCOUPLED call t_stopf ('cice_init') #endif