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
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
17 changes: 5 additions & 12 deletions cicecore/cicedyn/infrastructure/io/io_pio2/ice_restart.F90
Original file line number Diff line number Diff line change
Expand Up @@ -60,22 +60,12 @@ subroutine init_restart_read(ice_ic)

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

#ifdef CESMCOUPLED
logical (kind=log_kind) :: file_exist
#endif

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 @@ -186,6 +176,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 @@ -233,10 +224,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