Skip to content

Commit 7591ec6

Browse files
authored
Merge pull request #43 from kbarnhart/dclaw4to5_misc
Final changes to make dclaw4 and dclaw5 equivalent.
2 parents c4efa60 + 6aad5cc commit 7591ec6

File tree

6 files changed

+27
-30
lines changed

6 files changed

+27
-30
lines changed

geoclaw/2d/lib/stepgrid_geo.f

Lines changed: 4 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ subroutine stepgrid(q,fm,fp,gm,gp,mitot,mjtot,mbc,dt,dtnew,dx,dy,
4646
dimension work(mwork)
4747

4848
logical debug, dump
49-
data debug/.false./, dump/.false./
49+
data debug/.true./, dump/.true./
5050
c
5151
c # set tcom = time. This is in the common block comxyt that could
5252
c # be included in the Riemann solver, for example, if t is explicitly
@@ -60,9 +60,8 @@ subroutine stepgrid(q,fm,fp,gm,gp,mitot,mjtot,mbc,dt,dtnew,dx,dy,
6060
write(outunit,*)" at start of stepgrid: dumping grid ",mptr
6161
do i = 1, mitot
6262
do j = 1, mjtot
63-
write(outunit,545) i,j,(q(i,j,ivar),ivar=1,nvar),
64-
. aux(i,j,1),aux(i,j,8),aux(i,j,9)
65-
545 format(2i4,4e15.7,/,8x,3e15.7,/,8x,3e15.7)
63+
write(outunit,545) i,j,(q(i,j,ivar),ivar=1,nvar)
64+
545 format(2i4,7e15.7)
6665
end do
6766
end do
6867
endif
@@ -375,23 +374,11 @@ subroutine stepgrid(q,fm,fp,gm,gp,mitot,mjtot,mbc,dt,dtnew,dx,dy,
375374
write(outunit,*)" at end of stepgrid: dumping grid ",mptr
376375
do i = 1, mitot
377376
do j = 1, mjtot
378-
write(outunit,545) i,j,(q(i,j,ivar),ivar=1,nvar),
379-
. aux(i,j,1),aux(i,j,8),aux(i,j,9)
377+
write(outunit,545) i,j,(q(i,j,ivar),ivar=1,nvar)
380378
end do
381379
end do
382380
endif
383381

384-
c
385-
!-- if (dump) then
386-
!-- write(*,*)" at end of stepgrid: dumping grid ",mptr
387-
!-- do i = 1, mitot
388-
!-- do j = 1, mjtot
389-
!--c write(outunit,545) i,j,(q(i,j,ivar),ivar=1,nvar)
390-
!-- write(*,545) i,j,(q(i,j,ivar),ivar=1,nvar)
391-
!-- end do
392-
!-- end do
393-
!-- endif
394-
c
395382
return
396383
end
397384

geoclaw/2d/lib/valout_geo.f

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -111,12 +111,16 @@ subroutine valout (lst, lend, time, nvar, naux)
111111
endif
112112
surface = alloc(iadd(i,j,1)) + alloc(iaddaux(i,j,1))
113113
& - alloc(iadd(i,j,7))
114-
write(matunit1,109) i, j, (alloc(iadd(i,j,ivar)), ivar=1,1),
114+
! write(matunit1,110) i, j, (alloc(iadd(i,j,ivar)), ivar=1,1),
115+
! & surface
116+
write(matunit1,109) (alloc(iadd(i,j,ivar)), ivar=1,nvar),
115117
& surface
116118
enddo
117119
write(matunit1,*) ' '
118120
enddo
119-
109 format(2i5, 9e26.16)
121+
109 format(9e26.16)
122+
110 format(2i5, 9e26.16)
123+
120124

121125

122126
mptr = node(levelptr, mptr)
@@ -197,8 +201,11 @@ subroutine valout (lst, lend, time, nvar, naux)
197201
alloc(iaddaux(i,j,ivar)) = 0.d0
198202
endif
199203
enddo
200-
write(matunit3,109) i, j, (alloc(iaddaux(i,j,ivar)),
204+
! write(matunit3,110) i, j, (alloc(iaddaux(i,j,ivar)),
205+
! & ivar=1,naux)
206+
write(matunit3,109) (alloc(iaddaux(i,j,ivar)),
201207
& ivar=1,naux)
208+
202209
enddo
203210
write(matunit3,*) ' '
204211
enddo

geoclaw/2d/lib_dig/digclaw_mod.f90

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -673,6 +673,8 @@ subroutine calc_taudir(maxmx,maxmy,meqn,mbc,mx,my,xlower,ylower,dx,dy,q,maux,aux
673673
endif
674674

675675
pm = 0.5d0 !does not effect tau. only need tau in different cells
676+
! DIG: pm does impact rho, so it should be calculated here, consistently. should it be q(6,i,j)/h
677+
676678
call admissibleq(h,hu,hv,hm,p,u,v,m,theta)
677679
call admissibleq(hL,huL,hvL,hmL,pL,uL,vL,mL,theta)
678680
call admissibleq(hB,huB,hvB,hmL,pB,uB,vB,mB,theta)

geoclaw/2d/lib_dig/riemannsolvers_geo.f

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -67,18 +67,18 @@ subroutine riemann_dig2_aug_sswave_ez(ixy,meqn,mwaves,hL,hR,
6767

6868
pmL = chiL
6969
pmR = chiR
70-
pm = 0.5*(chiL + chiR)
70+
pm = 0.5d0*(chiL + chiR)
7171
pm = min(1.0d0,pm)
7272
pm = max(0.0d0,pm)
73-
if (alpha_seg==1.0d0) then
73+
if (dabs(alpha_seg-1.d0)<1.d-6) then
7474
seg = 0.0d0
7575
else
7676
seg = 1.0d0
7777
endif
7878
!pmtanh01 = seg*(0.5*(tanh(20.0*(pm-0.80))+1.0))
7979
!pmtanh01 = seg*(0.5*(tanh(40.0*(pm-0.90))+1.0))
8080
call calc_pmtanh(pm,seg,pmtanh01)
81-
rho_fp = (1.0-pmtanh01)*rho_f
81+
rho_fp = (1.0d0-pmtanh01)*rho_f
8282

8383

8484
if (hL.ge.drytol.and.hR.ge.drytol) then
@@ -114,9 +114,9 @@ subroutine riemann_dig2_aug_sswave_ez(ixy,meqn,mwaves,hL,hR,
114114
rho = 0.5d0*(rhoL + rhoR)
115115
tau = 0.5d0*(tauL + tauR)
116116
theta = 0.5d0*(thetaL + thetaR)
117-
gamma = 0.25*(rho_fp + 3.0*rho)/rho
118-
gammaL = 0.25*(rho_fp + 3.0*rhoL)/rhoL
119-
gammaR = 0.25*(rho_fp + 3.0*rhoR)/rhoR
117+
gamma = 0.25d0*(rho_fp + 3.0d0*rho)/rho
118+
gammaL = 0.25d0*(rho_fp + 3.0d0*rhoL)/rhoL
119+
gammaR = 0.25d0*(rho_fp + 3.0d0*rhoR)/rhoR
120120

121121
eps = kappa + (1.d0-kappa)*gamma
122122

geoclaw/2d/lib_dig/src2_geo.f90

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ subroutine src2(maxmx,maxmy,meqn,mbc,mx,my,xlower,ylower,dx,dy,q,maux,aux,t,dt)
6060

6161
do i=1-mbc+1,mx+mbc-1
6262
do j=1-mbc+1,my+mbc-1
63+
6364
theta = 0.d0
6465
dtheta = 0.d0
6566
if (bed_normal==1) then
@@ -214,9 +215,9 @@ subroutine src2(maxmx,maxmy,meqn,mbc,mx,my,xlower,ylower,dx,dy,q,maux,aux,t,dt)
214215
!write(*,*) '------------'
215216
!write(*,*) 'vu',t1bot
216217
beta = 1.0d0-m!tanh(10.d0*m) !tan(1.5d0*p/(rho*gmod*h))/14.0d0
217-
gamma= rho*beta2*(vnorm**2)*(beta*gmod*coeff**2)/(tanh(h+1.d0-2.d0)**(1.0d0/3.0d0))
218+
!! DIG not used. segfault.gamma= rho*beta2*(vnorm**2)*(beta*gmod*coeff**2)/(tanh(h+1.d0-2.d0)**(1.0d0/3.0d0))
218219
!write(*,*) 'gamma', gamma
219-
t1bot = t1bot + gamma
220+
!! DIG not used. segfault.t1bot = t1bot + gamma
220221
t1bot = t1bot + tau!+p*tan(phi)
221222
!write(*,*) 'tau',tau
222223
t2top = min(t1bot,(1.d0-beta*entrainment_rate)*(tau))
@@ -323,7 +324,7 @@ subroutine src2(maxmx,maxmy,meqn,mbc,mx,my,xlower,ylower,dx,dy,q,maux,aux,t,dt)
323324
q(i,j,2)=0.d0
324325
q(i,j,3)=0.d0
325326
else
326-
beta = 1.0d0-m
327+
beta = 1.0d0-m
327328
gamma= beta*dsqrt(hu**2 + hv**2)*(gmod*coeff**2)/(h**(7.d0/3.d0))
328329
dgamma=1.d0 + dt*gamma
329330
q(i,j,2)= q(i,j,2)/dgamma

python/pyclaw/data.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1594,7 +1594,7 @@ def __init__(self, ndim):
15941594
self.add_attribute("chi_init_val", 0.0, _DIG_ATTRS["chi_init_val"])
15951595
self.add_attribute("kappita_diff", 1.0, _DIG_ATTRS["kappita_diff"])
15961596
self.add_attribute("outaux", False, _DIG_ATTRS["outaux"])
1597-
self.add_attribute("curvature", 1, _DIG_ATTRS["curvature"])
1597+
self.add_attribute("curvature", 0, _DIG_ATTRS["curvature"])
15981598
self.add_attribute("momlevel", 1, _DIG_ATTRS["momlevel"])
15991599

16001600
# self.add_attribute('m_crit2', 0.62, 'critical state value of m (#) for different size species')

0 commit comments

Comments
 (0)