Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Better restarts #137

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/2d/amr2.f90
Original file line number Diff line number Diff line change
Expand Up @@ -364,7 +364,7 @@ program amr2

! Read in region and gauge data
call set_regions('regions.data')
call set_gauges('gauges.data')
call set_gauges(rest,'gauges.data')


! Look for capacity function via auxtypes:
Expand Down
13 changes: 10 additions & 3 deletions src/2d/gauges_module.f90
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,15 @@ module gauges_module

contains

subroutine set_gauges(fname)
subroutine set_gauges(restart, fname)

use amr_module

implicit none

! Input
character(len=*), intent(in), optional :: fname
logical, intent(in) :: restart

! Locals
integer :: i
Expand Down Expand Up @@ -79,8 +80,14 @@ subroutine set_gauges(fname)
! open file for output of gauge data
! ascii file with format determined by the write(OUTGAUGEUNIT,100)
! statement in print_gauges
open(unit=OUTGAUGEUNIT, file='fort.gauge', status='unknown', &
form='formatted')
! for restarts, add to end instead of clobbering original file
if (restart) then
open(unit=OUTGAUGEUNIT, file='fort.gauge', status='unknown', &
position='append', form='formatted')
else
open(unit=OUTGAUGEUNIT, file='fort.gauge', status='unknown', &
form='formatted')
endif

end subroutine set_gauges

Expand Down
2 changes: 1 addition & 1 deletion src/2d/outmsh.f
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ subroutine outmsh(mptr,outgrd,nvar,naux)
c
write(outunit,100)
write(outunit,101) mptr
101 format(1x,10h! grid no:,i4,62x,1h!)
101 format(1x,10h! grid no:,i5,61x,1h!)
write(outunit,102) node(nestlevel,mptr),rnode(timemult,mptr),
. node(levelptr,mptr)
102 format(1x,1h!,11h nestlevel=,i3,12h, time mult=,e25.15,
Expand Down
8 changes: 4 additions & 4 deletions src/2d/tick.f
Original file line number Diff line number Diff line change
Expand Up @@ -118,12 +118,12 @@ subroutine tick(nvar,cut,nstart,vtime,time,naux,start_time,
if (.false.) then
write(*,122) diffdt,outtime ! notify of change
122 format(" Adjusting timestep by ",e10.3,
. " to hit output time of ",e12.6)
. " to hit output time of ",e13.6)
c write(*,*)" new possk is ", possk(1)
if (diffdt .lt. 0.) then ! new step is slightly larger
pctIncrease = -100.*diffdt/oldposs ! minus sign to make whole expr. positive
write(*,123) pctIncrease
123 format(" New step is ",e8.2," % larger.",
123 format(" New step is ",e9.2," % larger.",
. " Should still be stable")
endif
endif
Expand Down Expand Up @@ -240,8 +240,8 @@ subroutine tick(nvar,cut,nstart,vtime,time,naux,start_time,
if (method(4).ge.level) then
write(6,100)level,cfl_level,possk(level),timenew
endif
100 format(' AMRCLAW: level ',i2,' CFL = ',e8.3,
& ' dt = ',e10.4, ' final t = ',e12.6)
100 format(' AMRCLAW: level ',i2,' CFL = ',e10.3,
& ' dt = ',e11.4, ' final t = ',e13.6)


c # to debug individual grid updates...
Expand Down