Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Time Manager #566

Merged
merged 17 commits into from
Mar 16, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion cice.setup
Original file line number Diff line number Diff line change
Expand Up @@ -1094,7 +1094,7 @@ cd ${testname_base}
source ./cice.settings
if (\${dobuild} == true) then
if (\${doreuse} == true) then
set ciceexe = "../ciceexe.\${ICE_ENVNAME}.\${ICE_COMMDIR}.\${ICE_BLDDEBUG}.\${ICE_THREADED}.\${ICE_IOTYPE}"
set ciceexe = "../ciceexe.\${ICE_TARGET}.\${ICE_ENVNAME}.\${ICE_COMMDIR}.\${ICE_BLDDEBUG}.\${ICE_THREADED}.\${ICE_IOTYPE}"
./cice.build --exe \${ciceexe}
if !(-e \${ciceexe}) cp -p \${ICE_RUNDIR}/cice \${ciceexe}
else
Expand Down
8 changes: 4 additions & 4 deletions cicecore/cicedynB/analysis/ice_history.F90
Original file line number Diff line number Diff line change
Expand Up @@ -1713,7 +1713,7 @@ subroutine accum_hist (dt)
use ice_domain_size, only: nfsd
use ice_grid, only: tmask, lmask_n, lmask_s, dxu, dyu
use ice_calendar, only: new_year, write_history, &
write_ic, time, histfreq, nstreams, month, &
write_ic, timesecs, histfreq, nstreams, mmonth, &
new_month
use ice_dyn_eap, only: a11, a12, e11, e12, e22, s11, s12, s22, &
yieldstress11, yieldstress12, yieldstress22
Expand Down Expand Up @@ -1864,7 +1864,7 @@ subroutine accum_hist (dt)
avgct(ns) = avgct(ns) + c1
! if (avgct(ns) == c1) time_beg(ns) = (time-dt)/int(secday)
if (avgct(ns) == c1) then
time_beg(ns) = (time-dt)/int(secday)
time_beg(ns) = (timesecs-dt)/int(secday)
time_beg(ns) = real(time_beg(ns),kind=real_kind)
endif
endif
Expand Down Expand Up @@ -3966,7 +3966,7 @@ subroutine accum_hist (dt)
enddo ! iblk
!$OMP END PARALLEL DO

time_end(ns) = time/int(secday)
time_end(ns) = timesecs/int(secday)
time_end(ns) = real(time_end(ns),kind=real_kind)

!---------------------------------------------------------------
Expand Down Expand Up @@ -4057,7 +4057,7 @@ subroutine accum_hist (dt)
enddo
endif ! new_year

if ( (month .eq. 7) .and. new_month ) then
if ( (mmonth .eq. 7) .and. new_month ) then
do j=jlo,jhi
do i=ilo,ihi
! reset SH Jul 1
Expand Down
20 changes: 10 additions & 10 deletions cicecore/cicedynB/analysis/ice_history_shared.F90
Original file line number Diff line number Diff line change
Expand Up @@ -653,9 +653,9 @@ module ice_history_shared

subroutine construct_filename(ncfile,suffix,ns)

use ice_calendar, only: sec, nyr, month, daymo, &
use ice_calendar, only: msec, myear, mmonth, daymo, &
mday, write_ic, histfreq, histfreq_n, &
year_init, new_year, new_month, new_day, &
new_year, new_month, new_day, &
dt
use ice_restart_shared, only: lenstr

Expand All @@ -667,12 +667,12 @@ subroutine construct_filename(ncfile,suffix,ns)
character (len=1) :: cstream
character(len=*), parameter :: subname = '(construct_filename)'

iyear = nyr + year_init - 1 ! set year_init=1 in ice_in to get iyear=nyr
imonth = month
iyear = myear
imonth = mmonth
iday = mday
isec = sec - dt
isec = msec - dt

if (write_ic) isec = sec
if (write_ic) isec = msec
! construct filename
if (write_ic) then
write(ncfile,'(a,a,i4.4,a,i2.2,a,i2.2,a,i5.5,a,a)') &
Expand All @@ -688,7 +688,7 @@ subroutine construct_filename(ncfile,suffix,ns)
imonth = 12
iday = daymo(imonth)
elseif (new_month) then
imonth = month - 1
imonth = mmonth - 1
iday = daymo(imonth)
elseif (new_day) then
iday = iday - 1
Expand All @@ -703,7 +703,7 @@ subroutine construct_filename(ncfile,suffix,ns)
if (histfreq(ns) == '1') then ! instantaneous, write every dt
write(ncfile,'(a,a,i4.4,a,i2.2,a,i2.2,a,i5.5,a,a)') &
history_file(1:lenstr(history_file))//trim(cstream),'_inst.', &
iyear,'-',imonth,'-',iday,'-',sec,'.',suffix
iyear,'-',imonth,'-',iday,'-',msec,'.',suffix

elseif (hist_avg) then ! write averaged data

Expand All @@ -714,7 +714,7 @@ subroutine construct_filename(ncfile,suffix,ns)
elseif (histfreq(ns) == 'h'.or.histfreq(ns) == 'H') then ! hourly
write(ncfile,'(a,a,i2.2,a,i4.4,a,i2.2,a,i2.2,a,i5.5,a,a)') &
history_file(1:lenstr(history_file))//trim(cstream),'_', &
histfreq_n(ns),'h.',iyear,'-',imonth,'-',iday,'-',sec,'.',suffix
histfreq_n(ns),'h.',iyear,'-',imonth,'-',iday,'-',msec,'.',suffix
elseif (histfreq(ns) == 'm'.or.histfreq(ns) == 'M') then ! monthly
write(ncfile,'(a,a,i4.4,a,i2.2,a,a)') &
history_file(1:lenstr(history_file))//trim(cstream),'.', &
Expand All @@ -728,7 +728,7 @@ subroutine construct_filename(ncfile,suffix,ns)
else ! instantaneous with histfreq > dt
write(ncfile,'(a,a,i4.4,a,i2.2,a,i2.2,a,i5.5,a,a)') &
history_file(1:lenstr(history_file)),'_inst.', &
iyear,'-',imonth,'-',iday,'-',sec,'.',suffix
iyear,'-',imonth,'-',iday,'-',msec,'.',suffix
endif
endif

Expand Down
Loading