-
Notifications
You must be signed in to change notification settings - Fork 133
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
Extend restart output controls, provide multiple frequency options #850
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -111,7 +111,7 @@ subroutine init_restart_read(ice_ic) | |
! endif | ||
|
||
if (my_task == master_task) then | ||
write(nu_diag,*) 'Restart read at istep=',istep0,myear,mmonth,mday,msec | ||
write(nu_diag,'(a,i8,4x,i4.4,a,i2.2,a,i2.2,a,i5.5)') 'Restart read at istep=',istep1,myear,'-',mmonth,'-',mday,'-',msec | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. here we change |
||
endif | ||
|
||
call broadcast_scalar(istep0,master_task) | ||
|
@@ -890,16 +890,17 @@ end subroutine write_restart_field | |
|
||
subroutine final_restart() | ||
|
||
use ice_calendar, only: istep1, idate, msec | ||
use ice_calendar, only: istep1, myear, mmonth, mday, msec | ||
|
||
character(len=*), parameter :: subname = '(final_restart)' | ||
|
||
call PIO_freeDecomp(File,iodesc2d) | ||
call PIO_freeDecomp(File,iodesc3d_ncat) | ||
call pio_closefile(File) | ||
|
||
if (my_task == master_task) & | ||
write(nu_diag,*) 'Restart read/written ',istep1,idate,msec | ||
if (my_task == master_task) then | ||
write(nu_diag,'(a,i8,4x,i4.4,a,i2.2,a,i2.2,a,i5.5)') 'Restart read/written ',istep1,myear,'-',mmonth,'-',mday,'-',msec | ||
endif | ||
|
||
end subroutine final_restart | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -102,9 +102,9 @@ module ice_calendar | |
stop_now , & ! if 1, end program execution | ||
write_restart, & ! if 1, write restart now | ||
diagfreq , & ! diagnostic output frequency (10 = once per 10 dt) | ||
dumpfreq_n , & ! restart output frequency (10 = once per 10 d,m,y) | ||
nstreams , & ! number of history output streams | ||
histfreq_n(max_nstrm) ! history output frequency | ||
dumpfreq_n(max_nstrm), & ! restart output frequency (10 = once per 10 d,m,y) | ||
histfreq_n(max_nstrm) ! history output frequency | ||
|
||
logical (kind=log_kind), public :: & | ||
new_year , & ! new year = .true. | ||
|
@@ -126,16 +126,18 @@ module ice_calendar | |
force_restart_now, & ! force a restart now | ||
write_history(max_nstrm) ! write history now | ||
|
||
character (len=1), public :: & | ||
character (len=2), public :: & | ||
npt_unit, & ! run length unit, 'y', 'm', 'd', 'h', 's', '1' | ||
npt0_unit, & ! original run length unit, 'y', 'm', 'd', 'h', 's', '1' | ||
histfreq(max_nstrm), & ! history output frequency, 'y','m','d','h','1' | ||
dumpfreq ! restart frequency, 'y','m','d' | ||
dumpfreq(max_nstrm) ! restart frequency, 'y','m','d' | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Here we could take the opportunity to adjust the comment to also mention |
||
|
||
character (len=char_len), public :: & | ||
dumpfreq_base = 'zero', & ! restart frequency basetime ('zero', 'init') | ||
histfreq_base = 'init', & ! history frequency basetime ('zero', 'init') | ||
calendar_type ! define calendar type | ||
dumpfreq_base(max_nstrm), & ! restart frequency basetime ('zero', 'init') | ||
histfreq_base(max_nstrm), & ! history frequency basetime ('zero', 'init') | ||
calendar_type ! define calendar type | ||
data dumpfreq_base / 'init', 'init', 'init', 'init', 'init' / | ||
data histfreq_base / 'zero', 'zero', 'zero', 'zero', 'zero' / | ||
|
||
! PRIVATE | ||
|
||
|
@@ -408,10 +410,10 @@ subroutine calendar() | |
|
||
! History writing flags | ||
|
||
call compute_relative_elapsed(histfreq_base, elapsed_years, elapsed_months, elapsed_days, elapsed_hours) | ||
|
||
do ns = 1, nstreams | ||
|
||
call compute_relative_elapsed(histfreq_base(ns), elapsed_years, elapsed_months, elapsed_days, elapsed_hours) | ||
|
||
select case (histfreq(ns)) | ||
case ("y", "Y") | ||
if (new_year .and. histfreq_n(ns)/=0) then | ||
|
@@ -442,27 +444,40 @@ subroutine calendar() | |
|
||
enddo | ||
|
||
! Restart writing flag | ||
|
||
call compute_relative_elapsed(dumpfreq_base, elapsed_years, elapsed_months, elapsed_days, elapsed_hours) | ||
|
||
select case (dumpfreq) | ||
case ("y", "Y") | ||
if (new_year .and. mod(elapsed_years, dumpfreq_n)==0) & | ||
write_restart = 1 | ||
case ("m", "M") | ||
if (new_month .and. mod(elapsed_months,dumpfreq_n)==0) & | ||
write_restart = 1 | ||
case ("d", "D") | ||
if (new_day .and. mod(elapsed_days, dumpfreq_n)==0) & | ||
write_restart = 1 | ||
case ("h", "H") | ||
if (new_hour .and. mod(elapsed_hours, dumpfreq_n)==0) & | ||
write_restart = 1 | ||
case ("1") | ||
if (mod(istep1, dumpfreq_n)==0) & | ||
write_restart = 1 | ||
end select | ||
! Restart writing flag, set dumpfreq to 'x" if stream is written once | ||
|
||
do ns = 1, max_nstrm | ||
|
||
call compute_relative_elapsed(dumpfreq_base(ns), elapsed_years, elapsed_months, elapsed_days, elapsed_hours) | ||
|
||
select case (dumpfreq(ns)(1:1)) | ||
case ("y", "Y") | ||
if (new_year .and. mod(elapsed_years, dumpfreq_n(ns))==0) then | ||
write_restart = 1 | ||
if (dumpfreq(ns)(2:2) == '1') dumpfreq(ns) = 'x' | ||
endif | ||
case ("m", "M") | ||
if (new_month .and. mod(elapsed_months,dumpfreq_n(ns))==0) then | ||
write_restart = 1 | ||
if (dumpfreq(ns)(2:2) == '1') dumpfreq(ns) = 'x' | ||
endif | ||
case ("d", "D") | ||
if (new_day .and. mod(elapsed_days, dumpfreq_n(ns))==0) then | ||
write_restart = 1 | ||
if (dumpfreq(ns)(2:2) == '1') dumpfreq(ns) = 'x' | ||
endif | ||
case ("h", "H") | ||
if (new_hour .and. mod(elapsed_hours, dumpfreq_n(ns))==0) then | ||
write_restart = 1 | ||
if (dumpfreq(ns)(2:2) == '1') dumpfreq(ns) = 'x' | ||
endif | ||
case ("1") | ||
if (mod(istep1, dumpfreq_n(ns))==0) then | ||
write_restart = 1 | ||
if (dumpfreq(ns)(2:2) == '1') dumpfreq(ns) = 'x' | ||
endif | ||
end select | ||
enddo | ||
|
||
if (force_restart_now) write_restart = 1 | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -167,14 +167,19 @@ setup_nml | |
"", "``file``", "write diagnostic output to file", "" | ||
"``diag_file``", "string", "diagnostic output file", "'ice_diag.d'" | ||
"``dt``", "real", "thermodynamics time step length in seconds", "3600." | ||
"``dumpfreq``", "``d``", "write restart every ``dumpfreq_n`` days", "``y``" | ||
"``dumpfreq``", "``d``", "write restart every ``dumpfreq_n`` days", "'y','x','x','x','x'" | ||
"", "``d1``", "write restart every ``dumpfreq_n`` days only once", "" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think this wording might be clearer:
and similarily for the other frequencies |
||
"", "``h``", "write restart every ``dumpfreq_n`` hours", "" | ||
"", "``h1``", "write restart every ``dumpfreq_n`` hours only once", "" | ||
"", "``m``", "write restart every ``dumpfreq_n`` months", "" | ||
"", "``m1``", "write restart every ``dumpfreq_n`` months only once", "" | ||
"", "``y``", "write restart every ``dumpfreq_n`` years", "" | ||
"", "``y1``", "write restart every ``dumpfreq_n`` years only once", "" | ||
"", "``1``", "write restart every ``dumpfreq_n`` time step", "" | ||
"``dumpfreq_base``", "init", "restart output frequency relative to year_init, month_init, day_init", "init" | ||
"", "``11``", "write restart every ``dumpfreq_n`` time step only once", "" | ||
"``dumpfreq_base``", "init", "restart output frequency relative to year_init, month_init, day_init", "'init','init','init','init','init'" | ||
"", "zero", "restart output frequency relative to year-month-day of 0000-01-01", "" | ||
"``dumpfreq_n``", "integer", "write restart frequency with ``dumpfreq``", "1" | ||
"``dumpfreq_n``", "integer array", "write restart frequency with ``dumpfreq``", "1,1,1,1,1" | ||
"``dump_last``", "logical", "write restart on last time step of simulation", "``.false.``" | ||
"``hist_avg``", "logical", "write time-averaged data", "``.true.,.true.,.true.,.true.,.true.``" | ||
"``histfreq``", "``d``", "write history every ``histfreq_n`` days", "'1','h','d','m','y'" | ||
|
@@ -183,7 +188,7 @@ setup_nml | |
"", "``x``", "unused frequency stream (not written)", "" | ||
"", "``y``", "write history every ``histfreq_n`` years", "" | ||
"", "``1``", "write history every ``histfreq_n`` time step", "" | ||
"``histfreq_base``", "init", "history output frequency relative to year_init, month_init, day_init", "zero" | ||
"``histfreq_base``", "init", "history output frequency relative to year_init, month_init, day_init", "'zero','zero','zero','zero','zero'" | ||
"", "zero", "history output frequency relative to year-month-day of 0000-01-01", "" | ||
"``histfreq_n``", "integer array", "frequency history output is written with ``histfreq``", "1,1,1,1,1" | ||
"``history_dir``", "string", "path to history output directory", "'./'" | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
minor, but I think the previous message was more clear by separating each option instead of
ymdhx1
all together