Skip to content

Commit

Permalink
restart files: add a fourth digit in the hours field to enable longer…
Browse files Browse the repository at this point in the history
… runs

For RCEMIP. 3 digits is only enough for 41 days, 4 digits is enough for
416 days. Also update the name of the "latest" links to same length, and
remove the leftover m in the latest name.

Sample file names:
initd_latest_x001y000.300
initd0720h00mx001y000.300
  • Loading branch information
fjansson committed Jan 8, 2024
1 parent 08fa32a commit 136a774
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions src/modstartup.f90
Original file line number Diff line number Diff line change
Expand Up @@ -882,7 +882,7 @@ subroutine readrestartfiles
!-----------------------------------------------------------------
name = startfile
name(5:5) = 'd'
name(13:20)=cmyid
name(14:21)=cmyid
if (myid == 0) write(6,*) 'loading ',name
open(unit=ifinput,file=trim(output_prefix)//name,form='unformatted', status='old')

Expand Down Expand Up @@ -1031,11 +1031,11 @@ subroutine do_writerestartfiles

ihour = floor(rtimee/3600)
imin = floor((rtimee-ihour * 3600) /3600. * 60.)
name = 'initdXXXhXXmXXXXXXXX.XXX'
write (name(6:8) ,'(i3.3)') ihour
write (name(10:11),'(i2.2)') imin
name(13:20)= cmyid
name(22:24)= cexpnr
name = 'initdXXXXhXXmXXXXXXXX.XXX'
write (name(6:9) ,'(i4.4)') ihour
write (name(11:12),'(i2.2)') imin
name(14:21)= cmyid
name(23:25)= cexpnr
open (ifoutput,file=trim(output_prefix)//name,form='unformatted',status='replace')

write(ifoutput) (((u0 (i,j,k),i=2-ih,i1+ih),j=2-jh,j1+jh),k=1,k1)
Expand Down Expand Up @@ -1102,7 +1102,7 @@ subroutine do_writerestartfiles
endif
close (ifoutput)
linkname = name
linkname(6:11) = "latest"
linkname(6:13) = "_latest_"
call system("ln -s -f "//name //" "//trim(output_prefix)//linkname)

if (nsv>0) then
Expand All @@ -1115,7 +1115,7 @@ subroutine do_writerestartfiles

close (ifoutput)
linkname = name
linkname(6:11) = "latest"
linkname(6:13) = "_latest_"
call system("ln -s -f "//name //" "//trim(output_prefix)//linkname)

end if
Expand All @@ -1138,7 +1138,7 @@ subroutine do_writerestartfiles

close (ifoutput)
linkname = name
linkname(6:11) = "latest"
linkname(6:13) = "_latest_"
call system("ln -s -f "//name //" "//trim(output_prefix)//linkname)
end if

Expand Down

0 comments on commit 136a774

Please sign in to comment.