Skip to content

Commit f58728c

Browse files
committed
printing the solution switched on for acoustics 1d.
1 parent 451d761 commit f58728c

File tree

1 file changed

+20
-32
lines changed

1 file changed

+20
-32
lines changed

examples/acoustics_1d_example1/claw1ez.jl

Lines changed: 20 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -286,24 +286,11 @@ function claw1ez() # No arguments
286286
# call user's routine setprob to set any specific parameters
287287
# or other initialization required.
288288
#
289-
### call setprob
290289
prob_data = CParam()
291290
read_prob_data(prob_data)
292291

293292

294293
# Allocate aux
295-
### if (maux > 0) then
296-
### allocate(aux(maux, 1-mbc:mx+mbc), stat=allocate_status)
297-
### else
298-
### ! Allocate dummy array to prevent segfaults if it's
299-
### ! dereferenced. May be unnecessary.
300-
### allocate(aux(1,1), stat=allocate_status)
301-
### end if
302-
### if (allocate_status .ne. 0) then
303-
### print *, '*** Error allocating aux array; exiting claw1ez'
304-
### go to 900
305-
### end if
306-
###
307294

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

@@ -395,28 +382,29 @@ function claw1ez() # No arguments
395382

396383
end
397384

398-
### #
399-
### dtv(1) = dtv(5) !# use final dt as starting value on next call
400-
### #
401-
### # # output solution at this time
402-
### # ------------------------------
403-
### #
404-
### # # if outstyle=1 or 2, then nstepout=1 and we output every time
405-
### # # we reach this point, since claw1 was called for the entire time
406-
### # # increment between outputs.
407-
### #
408-
### # # if outstyle=3 then we only output if we have taken nstepout
409-
### # # time steps since the last output.
410-
###
411-
### # # iframe is the frame number used to form file names in out1
412-
### iframe = n/nstepout
413-
### if (iframe*nstepout .eq. n) then
414-
### call out1(meqn,mbc,mx,xlower,dx,q,tend,iframe,
415-
### & aux,maux,outaux_always)
385+
386+
dtv[1] = dtv[5] # use final dt as starting value on next call
387+
388+
# output solution at this time
389+
# ------------------------------
390+
391+
# if outstyle=1 or 2, then nstepout=1 and we output every time
392+
# we reach this point, since claw1 was called for the entire time
393+
# increment between outputs.
394+
395+
# if outstyle=3 then we only output if we have taken nstepout
396+
# time steps since the last output.
397+
398+
# iframe is the frame number used to form file names in out1
399+
iframe::Int = convert(Int, n/nstepout)
400+
if iframe*nstepout == n
401+
out1(meqn,mbc,mx,xlower,dx,q,tend,iframe,
402+
aux,maux,outaux_always)
403+
416404
### write(6,601) iframe,tend
417405
### write(10,1010) tend,info,dtv(3),dtv(4),dtv(5),
418406
### & cflv(3),cflv(4),nv(2)
419-
### endif
407+
end
420408
### #
421409
### # # formats for writing out information about this call to claw:
422410
### #

0 commit comments

Comments
 (0)