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

Add time_period_freq #816

Merged
merged 10 commits into from
Mar 2, 2023
18 changes: 18 additions & 0 deletions cicecore/cicedyn/infrastructure/io/io_pio2/ice_history_write.F90
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,9 @@ subroutine ice_write_hist (ns)
integer (kind=int_kind), dimension(6) :: dimidex
real (kind= dbl_kind) :: ltime2
character (char_len) :: title
#ifdef CESMCOUPLED
character (char_len) :: time_period_freq
#endif
character (char_len_long) :: ncfile(max_nstrm)
integer (kind=int_kind) :: iotype

Expand Down Expand Up @@ -626,6 +629,21 @@ subroutine ice_write_hist (ns)
!-----------------------------------------------------------------
#ifdef CESMCOUPLED
status = pio_put_att(File,pio_global,'title',runid)

select case (histfreq(ns))
case ("y", "Y")
write(time_period_freq,'(a,i0)') 'year_',histfreq_n(ns)
case ("m", "M")
write(time_period_freq,'(a,i0)') 'month_',histfreq_n(ns)
case ("d", "D")
write(time_period_freq,'(a,i0)') 'day_',histfreq_n(ns)
case ("h", "H")
write(time_period_freq,'(a,i0)') 'hour_',histfreq_n(ns)
case ("1")
write(time_period_freq,'(a,i0)') 'step_',histfreq_n(ns)
end select

status = pio_put_att(File,pio_global,'time_period_freq',trim(time_period_freq))
#else
title = 'sea ice model output for CICE'
status = pio_put_att(File,pio_global,'title',trim(title))
Expand Down