Skip to content

Commit

Permalink
Fix logging issues for NUOPC
Browse files Browse the repository at this point in the history
  • Loading branch information
dabail10 committed Jul 2, 2020
1 parent 73e7774 commit 902e883
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 11 deletions.
8 changes: 2 additions & 6 deletions cicecore/drivers/nuopc/cmeps/CICE_InitMod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -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, &
Expand All @@ -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
Expand All @@ -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
Expand Down
16 changes: 11 additions & 5 deletions cicecore/drivers/nuopc/cmeps/ice_comp_nuopc.F90
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand All @@ -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
Expand Down

0 comments on commit 902e883

Please sign in to comment.