5 subroutine restrt(nsteps,time,nvar,naux)
8 implicit double precision (a-h,o-z)
13 dimension intrtx(maxlv),intrty(maxlv),intrtt(maxlv)
30 check_a = .not. (rstfile ==
'fort.chkaaaaa')
32 write(6,*)
'Attempting to restart computation using '
33 write(6,*)
' checkpoint file: ',trim(rstfile)
34 inquire(file=trim(rstfile),exist=foundfile)
35 if (.not. foundfile)
then
36 write(*,*)
" Did not find checkpoint file!"
39 open(rstunit,file=trim(rstfile),status=
'old',form=
'unformatted')
42 read(rstunit) lenmax,lendim,isize
47 read(rstunit) (alloc(i),i=1,lendim)
48 read(rstunit) hxposs,hyposs,possk,icheck
49 read(rstunit) lfree,lenf
50 read(rstunit) rnode,node,lstart,newstl,listsp,tl,
51 1 ibuf,mstart,ndfree,ndfree_bnd,lfine,iorder,mxnold,
52 2 intrtx,intrty,intrtt,iregsz,jregsz,
53 2 iregst,jregst,iregend,jregend,
54 3 numgrids,kcheck1,nsteps,time,
56 read(rstunit) avenumgrids, iregridcount,
57 1 evol,rvol,rvoll,lentot,tmass0,cflmax,
58 2 tvoll,tvollcpu,timetick,timetickcpu,
59 3 timestepgrid,timestepgridcpu,
60 4 timebound,timeboundcpu,
61 5 timeregridding,timeregriddingcpu,
62 6 timevalout,timevaloutcpu
66 write(outunit,100) nsteps,time
67 write(6,100) nsteps,time
68 100
format(/,
' RESTARTING the calculation after ',i5,
' steps',
69 1 /,
' (time = ',e15.7,
')')
79 do i = 1, min(mxnold-1,mxnest-1)
80 if ( (intratx(i) .ne. intrtx(i)) .or.
81 . (intraty(i) .ne. intrty(i)) )
then
84 .
" not allowed to change existing refinement ratios on Restart"
85 write(outunit,*)
" Old ratios:"
86 write(*,*)
" Old ratios:"
87 write(outunit,903)(intrtx(j),j=1,mxnold-1)
88 write(*,903) (intrtx(j),j=1,mxnold-1)
89 write(outunit,903)(intrty(j),j=1,mxnold-1)
90 write(*,903) (intrty(j),j=1,mxnold-1)
101 kratio(i) = intrtt(i)
108 idif = memsize - isize
109 if (idif .gt. 0)
then
110 lfree(lenf,1) = isize + 2
112 else if (idif .lt. 0)
then
113 write(outunit,900) isize, memsize
114 write(*,900) isize, memsize
115 900
format(
' size of alloc not allowed to shrink with ',/,
116 .
' restart old size ',i7,
' current size ',i7)
122 if (mxnest .eq. mxnold) go to 99
124 if (mxnest .lt. mxnold)
then
125 if (lfine .lt. mxnest)
then
128 write(outunit,901) mxnold, mxnest
129 write(*, 901) mxnold, mxnest
130 901
format(
' mxnest reduced on restart: ',/,
131 &
' old mxnest ',i4,
' new mxnest ',i4)
132 write(outunit,*)
" reclaiming finer levels from",
133 . mxnest+1,
" to ",mxnold
134 do 95 lev = mxnest,mxnold
136 if (lev .gt. mxnest) lstart(lev) = 0
137 85
if (mptr .eq. 0) go to 95
138 if (lev .lt. mxnold)
then
139 call
reclam(node(cfluxptr,mptr), 5*listsp(lev))
140 node(cfluxptr,mptr) = 0
142 nx = node(ndihi,mptr) - node(ndilo,mptr) + 1
143 ny = node(ndjhi,mptr) - node(ndjlo,mptr) + 1
144 ikeep = nx/intrtx(lev-1)
145 jkeep = ny/intrty(lev-1)
146 lenbc = 2*(ikeep+jkeep)
147 if (lev .gt. mxnest)
then
149 . (node(ffluxptr,mptr),2*nvar*lenbc+naux*lenbc)
150 node(ffluxptr,mptr) = 0
152 mitot = nx + 2*nghost
153 mjtot = ny + 2*nghost
154 if (lev .gt. mxnest)
then
155 call
reclam(node(store1,mptr),mitot*mjtot*nvar)
156 node(store1,mptr) = 0
157 if (naux .gt. 0)
then
158 call
reclam(node(storeaux,mptr),mitot*mjtot*naux)
159 node(storeaux,mptr) = 0
162 if (lev .ge. mxnest .and. lev .lt. mxnold)
then
163 call
reclam(node(store2, mptr), mitot*mjtot*nvar)
164 node(store2,mptr) = 0
167 mptr = node(levelptr,mptr)
168 if (lev .gt. mxnest) call
putnod(mold)
174 if (lstart(lev) .gt. 0)
then
176 write(*,*)
" resetting finest level to ",lfine
185 do 10 level = 1, mxnold
186 if (icheck(level) .ge. kcheck)
then
191 write(*,*)
" increasing max num levels from ",mxnold,
193 write(outunit,*)
" increasing max num levels from ",mxnold,
196 if (ee .and. flag_richardson)
then
198 write(*,*)
" first Richardson error estimation step"
199 write(*,*)
" will estimate mostly spatial error "
200 write(outunit,*)
" first Richardson error estimation step"
201 write(outunit,*)
" will estimate mostly spatial error "
205 mptr = lstart(mxnold)
206 15
if (mptr .eq. 0) go to 25
207 mitot = node(ndihi,mptr)-node(ndilo,mptr)+1+2*nghost
208 mjtot = node(ndjhi,mptr)-node(ndjlo,mptr)+1+2*nghost
209 node(store2,mptr) =
igetsp(mitot*mjtot*nvar)
210 mptr = node(levelptr,mptr)
216 rrk = dble(kratio(lfine))
217 35
if (level .gt. mxnest) go to 45
218 hxposs(level) = hxposs(level-1) / dble(intratx(level-1))
219 hyposs(level) = hyposs(level-1) / dble(intraty(level-1))
220 possk(level) = possk(level-1) / rrk
221 iregsz(level) = iregsz(level-1) * intratx(level-1)
222 jregsz(level) = jregsz(level-1) * intraty(level-1)
270 timegridfitall = 0.d0
subroutine makebndrylist(level)
subroutine restrt_alloc(isize)
subroutine restrt(nsteps, time, nvar, naux)
subroutine makegridlist(lbase)
subroutine reclam(index, nwords)
subroutine initrestoftimers()
subroutine initbndrylist()