Skip to content
Snippets Groups Projects
Commit 96e3e271 authored by Luis Kornblueh's avatar Luis Kornblueh
Browse files

Started adding read of restart and linking via execute_command_line(F2008). Does not work yet

parent 5a7bcfbf
No related branches found
No related tags found
No related merge requests found
......@@ -449,6 +449,35 @@ contains
print *, 'ERROR: could not open namelist file.'
stop
else
write (unit=iunit, iostat=ierror, iomsg=error_message, fmt='(a,a)') 'restart: ', trim(dstring)
if (ierror /= 0) then
print *, 'ERROR: could not write restart/checkpoint file.'
print *, ' ', trim(error_message)
stop
else
call execute_command_line('ln -s '//trim(filename)//' restart_oce.dat', wait=.true.)
!exitstat int, cmdstat int, cmdmsg
endif
close (unit=iunit)
endif
end subroutine writeRestart
!________________________________________________________________________________________________
!
subroutine readRestart(currentDate)
type(datetime), pointer :: currentDate
character(len=max_datetime_str_len) :: dstring
character(len=max_datetime_str_len+16) :: filename
integer :: iunit, ierror
call datetimeToString(currentDate, dstring)
write (filename,'(a,a,a)') 'restart_oce_', trim(dstring), '.dat'
open (file='test/'//trim(filename), newunit=iunit, iostat=ierror)
if (ierror /= 0) then
print *, 'ERROR: could not open namelist file.'
stop
else
! write (unit=iunit, iostat=ierror, iomsg=error_message, format='(a,a)') 'restart: ', trim(dstring)
write (iunit,'(a,a)') 'restart: ', trim(dstring)
if (ierror /= 0) then
......@@ -459,7 +488,10 @@ contains
close (unit=iunit)
endif
end subroutine writeRestart
call datetimeToString(currentDate, dstring)
print *, 'Read restart/ceckpoint file for ', trim(dstring)
end subroutine readRestart
!________________________________________________________________________________________________
!
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment