Skip to content

Commit

Permalink
Move setting use_leap_years to ice_calendar
Browse files Browse the repository at this point in the history
  • Loading branch information
anton-seaice committed Feb 25, 2024
1 parent ce8fa47 commit 1ea0543
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
5 changes: 4 additions & 1 deletion cicecore/drivers/nuopc/cmeps/ice_comp_nuopc.F90
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ module ice_comp_nuopc
use ice_calendar , only : force_restart_now, write_ic
use ice_calendar , only : idate, idate0, mday, mmonth, myear, year_init, month_init, day_init
use ice_calendar , only : msec, dt, calendar, calendar_type, nextsw_cday, istep
use ice_calendar , only : ice_calendar_noleap, ice_calendar_gregorian, use_leap_years
use ice_calendar , only : ice_calendar_noleap, ice_calendar_gregorian
use ice_kinds_mod , only : dbl_kind, int_kind, char_len, char_len_long
use ice_fileunits , only : nu_diag, nu_diag_set, inst_index, inst_name
use ice_fileunits , only : inst_suffix, release_all_fileunits, flush_fileunit
Expand Down Expand Up @@ -646,6 +646,7 @@ subroutine InitializeAdvertise(gcomp, importState, exportState, clock, rc)
call abort_ice(trim(errmsg))
endif

<<<<<<< HEAD
! Netcdf output created by PIO
call NUOPC_CompAttributeGet(gcomp, name="pio_typename", value=cvalue, &
isPresent=isPresent, isSet=isSet, rc=rc)
Expand Down Expand Up @@ -680,6 +681,8 @@ subroutine InitializeAdvertise(gcomp, importState, exportState, clock, rc)
if (ChkErr(rc,__LINE__,u_FILE_u)) return
if (esmf_caltype == ESMF_CALKIND_GREGORIAN) use_leap_years = .true.

=======
>>>>>>> b64d07c2 (Move setting use_leap_years to ice_calendar)
#else

! Read the cice namelist as part of the call to cice_init1
Expand Down
9 changes: 8 additions & 1 deletion cicecore/shared/ice_calendar.F90
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,14 @@ subroutine init_calendar
nstreams = 0

#ifdef CESMCOUPLED
! calendar_type set by coupling
! calendar_type set by coupling
! set use_leap_years for consistency
if (calendar_type == trim(ice_calendar_gregorian)) then
use_leap_years = .true.
else
use_leap_years = .false.
endif

#else
calendar_type = ''
if (use_leap_years) then
Expand Down

0 comments on commit 1ea0543

Please sign in to comment.