From 108a0636881bc3f0eeb9b40754251a05865d489d Mon Sep 17 00:00:00 2001 From: Marsha Berger Date: Thu, 9 Jul 2015 16:45:11 -0700 Subject: [PATCH 1/2] fixed format statements so max grid number fits, and so that ifort compiler stops complaining about too small field widths --- src/2d/outmsh.f | 2 +- src/2d/tick.f | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/2d/outmsh.f b/src/2d/outmsh.f index cb99f7ccb..61a81e249 100644 --- a/src/2d/outmsh.f +++ b/src/2d/outmsh.f @@ -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, diff --git a/src/2d/tick.f b/src/2d/tick.f index 8d5a6809f..e6349e014 100644 --- a/src/2d/tick.f +++ b/src/2d/tick.f @@ -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 @@ -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... From 0644014a50da1cf43dbddb4cd1f6cee850afc310 Mon Sep 17 00:00:00 2001 From: Marsha Berger Date: Thu, 9 Jul 2015 17:08:37 -0700 Subject: [PATCH 2/2] implemented restart for gauges so previous file not clobbered, but instead add to end --- src/2d/amr2.f90 | 2 +- src/2d/gauges_module.f90 | 13 ++++++++++--- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/src/2d/amr2.f90 b/src/2d/amr2.f90 index 62a154143..cc8944e6c 100644 --- a/src/2d/amr2.f90 +++ b/src/2d/amr2.f90 @@ -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: diff --git a/src/2d/gauges_module.f90 b/src/2d/gauges_module.f90 index a2d7f1d7d..73b09a3a4 100644 --- a/src/2d/gauges_module.f90 +++ b/src/2d/gauges_module.f90 @@ -39,7 +39,7 @@ module gauges_module contains - subroutine set_gauges(fname) + subroutine set_gauges(restart, fname) use amr_module @@ -47,6 +47,7 @@ subroutine set_gauges(fname) ! Input character(len=*), intent(in), optional :: fname + logical, intent(in) :: restart ! Locals integer :: i @@ -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