From 87c7bfada22bfa995b7094e4ebcdc4bb0167ca9b Mon Sep 17 00:00:00 2001 From: "David A. Bailey" Date: Thu, 17 Oct 2024 10:49:42 -0600 Subject: [PATCH 1/2] These reduce some of the prints in shr_orbital. (#981) * reduce orbital parameters output to log * avoid printing in initialization as ice log is not yet ready --------- Co-authored-by: Jim Edwards --- .../drivers/nuopc/cmeps/ice_comp_nuopc.F90 | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/cicecore/drivers/nuopc/cmeps/ice_comp_nuopc.F90 b/cicecore/drivers/nuopc/cmeps/ice_comp_nuopc.F90 index edf5d289a..704180d12 100644 --- a/cicecore/drivers/nuopc/cmeps/ice_comp_nuopc.F90 +++ b/cicecore/drivers/nuopc/cmeps/ice_comp_nuopc.F90 @@ -411,6 +411,7 @@ subroutine InitializeAdvertise(gcomp, importState, exportState, clock, rc) ! Determine attributes - also needed in realize phase to get grid information !---------------------------------------------------------------------------- + ! Get orbital values ! Note that these values are obtained in a call to init_orbit in ice_shortwave.F90 ! if CESMCOUPLED is not defined @@ -1445,8 +1446,9 @@ subroutine ice_orbital_init(gcomp, clock, logunit, mastertask, rc) type(ESMF_Time) :: CurrTime ! current time integer :: year ! model year at current time integer :: orb_year ! orbital year for current orbital computation + integer, save :: prev_orb_year=0 ! orbital year for previous orbital computation logical :: lprint - logical :: first_time = .true. + logical, save :: first_time = .true. character(len=*) , parameter :: subname = "(cice_orbital_init)" !------------------------------------------------------------------------------- @@ -1528,24 +1530,24 @@ subroutine ice_orbital_init(gcomp, clock, logunit, mastertask, rc) return ! bail out endif end if - + lprint = .false. if (trim(orb_mode) == trim(orb_variable_year)) then call ESMF_ClockGet(clock, CurrTime=CurrTime, rc=rc) if (chkerr(rc,__LINE__,u_FILE_u)) return call ESMF_TimeGet(CurrTime, yy=year, rc=rc) if (chkerr(rc,__LINE__,u_FILE_u)) return orb_year = orb_iyear + (year - orb_iyear_align) - lprint = mastertask else orb_year = orb_iyear - if (first_time) then - lprint = mastertask - else - lprint = .false. - end if end if + if (orb_year .ne. prev_orb_year) then + lprint = mastertask + ! this prevents the orbital print happening before the log file is opened. + if (.not. first_time) prev_orb_year = orb_year + endif eccen = orb_eccen + call shr_orb_params(orb_year, eccen, orb_obliq, orb_mvelp, obliqr, lambm0, mvelpp, lprint) if ( eccen == SHR_ORB_UNDEF_REAL .or. obliqr == SHR_ORB_UNDEF_REAL .or. & From 3a77e79f6805f101746ab5710a42db7f8b5135fd Mon Sep 17 00:00:00 2001 From: "David A. Bailey" Date: Wed, 23 Oct 2024 15:44:40 -0600 Subject: [PATCH 2/2] Update cicecore/cicedyn/infrastructure/io/io_pio2/ice_restart.F90 Co-authored-by: Anton Steketee <79179784+anton-seaice@users.noreply.github.com> --- cicecore/cicedyn/infrastructure/io/io_pio2/ice_restart.F90 | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/cicecore/cicedyn/infrastructure/io/io_pio2/ice_restart.F90 b/cicecore/cicedyn/infrastructure/io/io_pio2/ice_restart.F90 index 8ebca4b23..18815ecf8 100644 --- a/cicecore/cicedyn/infrastructure/io/io_pio2/ice_restart.F90 +++ b/cicecore/cicedyn/infrastructure/io/io_pio2/ice_restart.F90 @@ -59,7 +59,11 @@ subroutine init_restart_read(ice_ic) integer (kind=int_kind) :: status logical (kind=log_kind), save :: first_call = .true. - logical :: exist + +#ifdef CESMCOUPLED + logical (kind=log_kind) :: file_exist +#endif + character(len=*), parameter :: subname = '(init_restart_read)' if (present(ice_ic)) then