Skip to content

Commit

Permalink
correct rpointer file name for cesm
Browse files Browse the repository at this point in the history
  • Loading branch information
jedwards4b committed Oct 17, 2024
1 parent 11da279 commit b8232d7
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions cicecore/cicedyn/infrastructure/io/io_pio2/ice_restart.F90
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ module ice_restart
use ice_communicate, only: my_task, master_task
use ice_exit, only: abort_ice
use ice_fileunits, only: nu_diag, nu_restart, nu_rst_pointer
#ifdef CESMCOUPLED
use ice_fileunits, only: inst_suffix
#endif
use ice_kinds_mod
use ice_restart_shared
use ice_pio
Expand Down Expand Up @@ -46,7 +49,6 @@ subroutine init_restart_read(ice_ic)
mday, msec, npt
use ice_domain_size, only: ncat
use ice_read_write, only: ice_open

character(len=char_len_long), intent(in), optional :: ice_ic

! local variables
Expand All @@ -57,15 +59,19 @@ 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)') &
trim(pointer_file)//'.',myear,'-',mmonth,'-',mday,'-',msec
'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 @@ -222,8 +228,10 @@ subroutine init_restart_write(filename_spec)

! write pointer (path/file)
if (my_task == master_task) then
write(pointer_file,'(a,i4.4,a,i2.2,a,i2.2,a,i5.5)') &
trim(pointer_file)//'.',myear,'-',mmonth,'-',mday,'-',msec
#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
#endif
open(nu_rst_pointer,file=pointer_file)
write(nu_rst_pointer,'(a)') filename
close(nu_rst_pointer)
Expand Down

0 comments on commit b8232d7

Please sign in to comment.