Skip to content

Commit

Permalink
Merge branch 'wrt_restart_at_end' into wrt_restart_at_end
Browse files Browse the repository at this point in the history
  • Loading branch information
dabail10 authored Oct 24, 2024
2 parents f7552bc + 3a77e79 commit 8710a3a
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 8 deletions.
1 change: 1 addition & 0 deletions cicecore/cicedyn/infrastructure/io/io_pio2/ice_restart.F90
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ subroutine init_restart_read(ice_ic)
integer (kind=int_kind) :: status

logical (kind=log_kind), save :: first_call = .true.

character(len=*), parameter :: subname = '(init_restart_read)'

if (present(ice_ic)) then
Expand Down
18 changes: 10 additions & 8 deletions cicecore/drivers/nuopc/cmeps/ice_comp_nuopc.F90
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -1443,8 +1444,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)"
!-------------------------------------------------------------------------------

Expand Down Expand Up @@ -1526,24 +1528,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. &
Expand Down

0 comments on commit 8710a3a

Please sign in to comment.