Skip to content

Commit d2f7b3f

Browse files
committed
translate more chunks.
1 parent f58728c commit d2f7b3f

File tree

1 file changed

+5
-70
lines changed

1 file changed

+5
-70
lines changed

examples/acoustics_1d_example1/claw1ez.jl

Lines changed: 5 additions & 70 deletions
Original file line numberDiff line numberDiff line change
@@ -264,14 +264,6 @@ function claw1ez() # No arguments
264264
error("*** ERROR *** periodic boundary conditions require mthbc(1) and mthbc(2) BOTH be set to 2")
265265
end
266266

267-
### ! Figure out size of work array needed
268-
### mwork = (mx + 2*mbc) * (2 + 4*meqn + mwaves + meqn*mwaves)
269-
###
270-
### #
271-
### #
272-
### write(6,*) 'running...'
273-
### write(6,*) ' '
274-
### #
275267
println("running...")
276268
println(" ")
277269

@@ -294,47 +286,15 @@ function claw1ez() # No arguments
294286

295287
aux = (maux > 0) ? OffsetArray(Float64, 1:maux, 1-mbc:mx+mbc) : OffsetArray(Float64, 1:1,1:1)
296288

297-
### #
298-
### # # set aux array:
299-
### #
300-
### if (maux .gt. 0) then
301-
### call setaux(mbc,mx,xlower,dx,maux,aux)
302-
### endif
303-
###
304-
### ! Allocate q
305-
### allocate(q(meqn, 1-mbc:mx+mbc), stat=allocate_status)
306-
### if (allocate_status .ne. 0) then
307-
### print *, '*** Error allocating q array; exiting claw1ez'
308-
### go to 900
309-
### end if
310-
311289
q = OffsetArray(Float64, 1:meqn, 1-mbc:mx+mbc)
312290

313-
### # # set initial conditions:
314-
### #
315-
### call qinit(meqn,mbc,mx,xlower,dx,q,maux,aux)
316-
### #
317-
318-
#println("q before qinit call: $q")
291+
# set initial conditions:
319292

320293
qinit(prob_data, meqn, mbc, mx, xlower, dx, q, maux, aux)
321294

322-
#println("q after qinit call:")
323-
#Base.print(q)
324-
325295
# output initial data
326296
out1(meqn,mbc,mx,xlower,dx,q,t0,0,aux,maux,
327297
(outaux_init_only || outaux_always) )
328-
329-
###
330-
### ! Allocate work array
331-
### allocate(work(mwork), stat=allocate_status)
332-
### if (allocate_status .ne. 0) then
333-
### print *, '*** Error allocating work array; exiting claw1ez'
334-
### go to 900
335-
### end if
336-
337-
338298
#
339299
# ----------
340300
# Main loop:
@@ -355,7 +315,6 @@ function claw1ez() # No arguments
355315
claw1(prob_data,meqn,mwaves,maux,mbc,mx,
356316
q,aux,xlower,dx,tstart,tend,dtv,cflv,nv,method,mthlim,
357317
mthbc,
358-
#work, mwork, # ???
359318
use_fwaves,
360319
bc1,rp1,src1,b4step1)
361320

@@ -382,7 +341,6 @@ function claw1ez() # No arguments
382341

383342
end
384343

385-
386344
dtv[1] = dtv[5] # use final dt as starting value on next call
387345

388346
# output solution at this time
@@ -401,33 +359,10 @@ function claw1ez() # No arguments
401359
out1(meqn,mbc,mx,xlower,dx,q,tend,iframe,
402360
aux,maux,outaux_always)
403361

404-
### write(6,601) iframe,tend
405-
### write(10,1010) tend,info,dtv(3),dtv(4),dtv(5),
406-
### & cflv(3),cflv(4),nv(2)
407-
end
408-
### #
409-
### # # formats for writing out information about this call to claw:
410-
### #
411-
### 601 format('CLAW1EZ: Frame ',i4,
412-
### & ' output files done at time t =',
413-
### & d12.4,/)
414-
### #
415-
### 1010 format('tend =',d15.4,/,
416-
### & 'info =',i5,/,'smallest dt =',d15.4,/,'largest dt =',
417-
### & d15.4,/,'last dt =',d15.4,/,'largest cfl =',
418-
### & d15.4,/,'last cfl =',d15.4,/,'steps taken =',i4,/)
419-
### #
362+
@printf("CLAW1EZ: Frame %4d output files done at time t = %12.4e\n", iframe,tend)
363+
@printf("tend = %15.4e \ninfo =%5d\nsmallest dt =%15.4e\nlargest dt =%15.4e\nlast dt =%15.4e\nlargest cfl =%15.4e\nlast cfl =%15.4e\nsteps taken =%4d\n",
364+
tend,info,dtv[3],dtv[4],dtv[5],cflv[3],cflv[4],nv[2])
420365

366+
end
421367
end
422-
423-
424-
### 900 continue
425-
### if (allocated(q)) deallocate(q)
426-
### if (allocated(aux)) deallocate(aux)
427-
### if (allocated(work)) deallocate(work)
428-
### if (allocated(mthlim)) deallocate(mthlim)
429-
### if (allocated(tout)) deallocate(tout)
430-
### if (allocated(iout_q)) deallocate(iout_q)
431-
### if (allocated(iout_aux)) deallocate(iout_aux)
432-
433368
end # claw1ez

0 commit comments

Comments
 (0)