Skip to content

Commit 4181d46

Browse files
committed
configurable option to remove datestamp from rpointer file
1 parent 5aa8073 commit 4181d46

File tree

3 files changed

+23
-4
lines changed

3 files changed

+23
-4
lines changed

cicecore/cicedyn/infrastructure/io/io_pio2/ice_restart.F90

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -223,12 +223,16 @@ subroutine init_restart_write(filename_spec)
223223

224224
! write pointer (path/file)
225225
if (my_task == master_task) then
226-
#ifdef CESMCOUPLED
227-
write(lpointer_file,'(a,i4.4,a,i2.2,a,i2.2,a,i5.5)') &
228-
'rpointer.ice'//trim(inst_suffix)//'.',myear,'-',mmonth,'-',mday,'-',msec
226+
#ifdef CESMCOUPLED
227+
lpointer_file = 'rpointer.ice'//trim(inst_suffix)
229228
#else
230229
lpointer_file = pointer_file
231230
#endif
231+
if (pointer_date) then
232+
! append date to pointer filename
233+
write(lpointer_file,'(a,i4.4,a,i2.2,a,i2.2,a,i5.5)') &
234+
trim(lpointer_file)//'.',myear,'-',mmonth,'-',mday,'-',msec
235+
end if
232236
open(nu_rst_pointer,file=lpointer_file)
233237
write(nu_rst_pointer,'(a)') filename
234238
close(nu_rst_pointer)

cicecore/drivers/nuopc/cmeps/ice_comp_nuopc.F90

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,8 @@ module ice_comp_nuopc
3030
use ice_kinds_mod , only : dbl_kind, int_kind, char_len, char_len_long
3131
use ice_fileunits , only : nu_diag, nu_diag_set, inst_index, inst_name
3232
use ice_fileunits , only : inst_suffix, release_all_fileunits, flush_fileunit
33-
use ice_restart_shared , only : runid, runtype, restart, use_restart_time, restart_dir, restart_file, restart_format, restart_chunksize
33+
use ice_restart_shared , only : runid, runtype, restart, use_restart_time, restart_dir, restart_file, &
34+
restart_format, restart_chunksize , pointer_date
3435
use ice_history , only : accum_hist
3536
use ice_history_shared , only : history_format, history_chunksize
3637
use ice_exit , only : abort_ice
@@ -323,6 +324,17 @@ subroutine InitializeAdvertise(gcomp, importState, exportState, clock, rc)
323324
if (trim(cvalue) .eq. '.true.') restart_eor = .true.
324325
endif
325326

327+
#ifdef CESMCOUPLED
328+
! set CICE internal pointer_date variable based on nuopc settings
329+
! this appends a datestamp to the "rpointer" file (by default this is on)
330+
pointer_date = .true.
331+
call NUOPC_CompAttributeGet(gcomp, name="restart_pointer_append_date", value=cvalue, isPresent=isPresent, isSet=isSet, rc=rc)
332+
if (ChkErr(rc,__LINE__,u_FILE_u)) return
333+
if (isPresent .and. isSet) then
334+
if (trim(cvalue) .eq. '.false.') pointer_date = .false.
335+
endif
336+
#endif
337+
326338
!----------------------------------------------------------------------------
327339
! generate local mpi comm
328340
!----------------------------------------------------------------------------

cicecore/shared/ice_restart_shared.F90

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,9 @@ module ice_restart_shared
2525
character (len=char_len_long), public :: &
2626
pointer_file ! input pointer file for restarts
2727

28+
logical (kind=log_kind), public :: &
29+
pointer_date = .false. ! if true, append datestamp to pointer file
30+
2831
character (len=char_len), public :: &
2932
restart_format , & ! format of restart files 'nc'
3033
restart_rearranger ! restart file rearranger, box or subset for pio

0 commit comments

Comments
 (0)