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

Wrt restart at end #34

Merged
merged 7 commits into from
Oct 24, 2024
Merged
14 changes: 5 additions & 9 deletions cicecore/cicedyn/infrastructure/io/io_pio2/ice_restart.F90
Original file line number Diff line number Diff line change
Expand Up @@ -59,19 +59,12 @@ subroutine init_restart_read(ice_ic)
integer (kind=int_kind) :: status

logical (kind=log_kind), save :: first_call = .true.
logical :: exist
character(len=*), parameter :: subname = '(init_restart_read)'

if (present(ice_ic)) then
filename = trim(ice_ic)
else
if (my_task == master_task) then
#ifdef CESMCOUPLED
write(pointer_file,'(a,i4.4,a,i2.2,a,i2.2,a,i5.5)') &
'rpointer.ice'//trim(inst_suffix)//'.',myear,'-',mmonth,'-',mday,'-',msec
inquire(file=pointer_file, exist=exist)
if (.not. exist) pointer_file = 'rpointer.ice'//trim(inst_suffix)
#endif
open(nu_rst_pointer,file=pointer_file)
read(nu_rst_pointer,'(a)') filename0
filename = trim(filename0)
Expand Down Expand Up @@ -182,6 +175,7 @@ subroutine init_restart_write(filename_spec)
integer (kind=int_kind) :: nbtrcr

character(len=char_len_long) :: filename
character(len=char_len_long) :: lpointer_file

integer (kind=int_kind) :: &
dimid_ncat, dimid_nilyr, dimid_nslyr, dimid_naero
Expand Down Expand Up @@ -229,10 +223,12 @@ subroutine init_restart_write(filename_spec)
! write pointer (path/file)
if (my_task == master_task) then
#ifdef CESMCOUPLED
write(pointer_file,'(a,i4.4,a,i2.2,a,i2.2,a,i5.5)') &
write(lpointer_file,'(a,i4.4,a,i2.2,a,i2.2,a,i5.5)') &
'rpointer.ice'//trim(inst_suffix)//'.',myear,'-',mmonth,'-',mday,'-',msec
#else
lpointer_file = pointer_file
#endif
open(nu_rst_pointer,file=pointer_file)
open(nu_rst_pointer,file=lpointer_file)
write(nu_rst_pointer,'(a)') filename
close(nu_rst_pointer)
endif
Expand Down
Loading