Skip to content

Commit

Permalink
Set use_leap_years in nuopc cap to ensure calendar is correct in hist…
Browse files Browse the repository at this point in the history
…ory output
  • Loading branch information
anton-seaice committed Feb 28, 2024
1 parent a9eedef commit 9deb0de
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions cicecore/drivers/nuopc/cmeps/ice_comp_nuopc.F90
Original file line number Diff line number Diff line change
Expand Up @@ -675,10 +675,8 @@ subroutine InitializeAdvertise(gcomp, importState, exportState, clock, rc)
else
if(mastertask) write(nu_diag,*) trim(subname)//'WARNING: pio_typename from driver needs to be set for netcdf output to work'
end if
! Set use_leap_years as some CICE calls use this instead of the calendar type
call ESMF_TimeGet( currTime, calkindflag=esmf_caltype, rc=rc )
if (ChkErr(rc,__LINE__,u_FILE_u)) return
if (esmf_caltype == ESMF_CALKIND_GREGORIAN) use_leap_years = .true.



#else

Expand Down Expand Up @@ -793,7 +791,7 @@ subroutine InitializeRealize(gcomp, importState, exportState, clock, rc)
call cice_init2()
call t_stopf ('cice_init2')
!---------------------------------------------------------------------------
! use EClock to reset calendar information on initial start
! use EClock to reset calendar information
!---------------------------------------------------------------------------

! - on initial run
Expand Down Expand Up @@ -847,6 +845,13 @@ subroutine InitializeRealize(gcomp, importState, exportState, clock, rc)
month_init= (idate0-year_init*10000)/100 ! integer month of basedate
day_init = idate0-year_init*10000-month_init*100

! - Set use_leap_years based on calendar (as some CICE calls use this instead of the calendar type)
if (calendar_type == ice_calendar_gregorian) then
use_leap_years = .true.
else
use_leap_years = .false. ! no_leap calendars
endif

call calendar() ! update calendar info

!----------------------------------------------------------------------------
Expand Down

0 comments on commit 9deb0de

Please sign in to comment.