@@ -67,7 +67,7 @@ subroutine valout(level_begin, level_end, time, num_eqn, num_aux)
6767 " i6,' ndim'/," // &
6868 " i6,' nghost'/," // &
6969 " a10,' format'/,/)"
70-
70+
7171 character (len=* ), parameter :: console_format = &
7272 " ('AMRCLAW: Frame ',i4,' output files done at time t = ', d13.6,/)"
7373
@@ -84,7 +84,7 @@ subroutine valout(level_begin, level_end, time, num_eqn, num_aux)
8484 ! Note: Currently outputs all aux components if any are requested
8585 out_aux = ((output_aux_num > 0 ) .and. &
8686 ((.not. output_aux_onlyonce) .or. (abs (time - t0) < 1d-90 )))
87-
87+
8888 ! Construct file names
8989 file_name(1 ) = ' fort.qxxxx'
9090 file_name(2 ) = ' fort.txxxx'
@@ -137,10 +137,11 @@ subroutine valout(level_begin, level_end, time, num_eqn, num_aux)
137137 num_cells(1 ) = node(ndihi, grid_ptr) - node(ndilo, grid_ptr) + 1
138138 num_cells(2 ) = node(ndjhi, grid_ptr) - node(ndjlo, grid_ptr) + 1
139139 q_loc = node(store1, grid_ptr)
140+ aux_loc = node(storeaux, grid_ptr)
140141 lower_corner = [rnode(cornxlo, grid_ptr), rnode(cornylo, grid_ptr)]
141142
142- ! Write out header data
143-
143+ ! Write out header data
144+
144145 write (out_unit, header_format_2d) grid_ptr, level, &
145146 num_cells(1 ), &
146147 num_cells(2 ), &
@@ -149,8 +150,8 @@ subroutine valout(level_begin, level_end, time, num_eqn, num_aux)
149150 delta(1 ), delta(2 )
150151
151152 ! Output grids
152-
153- ! Round off if nearly zero
153+
154+ ! Round off if nearly zero
154155 ! (Do this for all output_format's)
155156 forall (m = 1 :num_eqn, &
156157 i= num_ghost + 1 :num_cells(1 ) + num_ghost, &
@@ -162,7 +163,7 @@ subroutine valout(level_begin, level_end, time, num_eqn, num_aux)
162163
163164 if (output_format == 1 ) then
164165 ! ascii output
165-
166+
166167 do j = num_ghost + 1 , num_cells(2 ) + num_ghost
167168 do i = num_ghost + 1 , num_cells(1 ) + num_ghost
168169 write (out_unit, " (50e26.16)" ) &
@@ -173,7 +174,7 @@ subroutine valout(level_begin, level_end, time, num_eqn, num_aux)
173174
174175 else if (output_format== 2 .or. output_format== 3 ) then
175176 ! binary32 or binary64
176-
177+
177178 ! Note: We are writing out ghost cell data also,
178179 ! so need to update this
179180 call bound(time,num_eqn,num_ghost,alloc(q_loc), &
@@ -183,7 +184,7 @@ subroutine valout(level_begin, level_end, time, num_eqn, num_aux)
183184
184185 i = (iadd(num_eqn, num_cells(1 ) + 2 * num_ghost, &
185186 num_cells(2 ) + 2 * num_ghost))
186-
187+
187188 if (output_format == 2 ) then
188189 ! binary32 (shorten to 4-byte)
189190 allocate (q4(num_eqn * (num_cells(1 ) + 2 * num_ghost) &
@@ -196,11 +197,11 @@ subroutine valout(level_begin, level_end, time, num_eqn, num_aux)
196197 ! binary64 (full 8-byte)
197198 write (out_unit + 1 ) alloc(iadd(1 , 1 , 1 ):i)
198199 endif
199-
200-
200+
201+
201202 else if (output_format == 4 ) then
202203#ifdef HDF5
203- ! Create data space - handles dimensions of the corresponding
204+ ! Create data space - handles dimensions of the corresponding
204205 ! data set - annoyingling need to stick grid size into other
205206 ! data type
206207 dims = (/ num_eqn, num_cells(1 ) + 2 * num_ghost, &
@@ -221,15 +222,15 @@ subroutine valout(level_begin, level_end, time, num_eqn, num_aux)
221222#endif
222223 else
223224 print * , " Unsupported output format" , output_format," ."
224- stop
225+ stop
225226 endif
226227
227228 grid_ptr = node(levelptr, grid_ptr)
228229 end do
229230 end do
230231
231232 close (out_unit)
232-
233+
233234 if (output_format== 2 .or. output_format== 3 ) then
234235 close (unit= out_unit + 1 )
235236 end if
@@ -253,7 +254,7 @@ subroutine valout(level_begin, level_end, time, num_eqn, num_aux)
253254#ifdef HDF5
254255 ! Create group for aux
255256 call h5gcreate_f(hdf_file, " /aux" , aux_group, hdf_error)
256- #endif
257+ #endif
257258 end if
258259
259260 do level = level_begin, level_end
@@ -274,7 +275,7 @@ subroutine valout(level_begin, level_end, time, num_eqn, num_aux)
274275 ! ASCII output
275276 case (1 )
276277
277- ! We only output header info for aux data if writing
278+ ! We only output header info for aux data if writing
278279 ! ASCII data
279280 write (out_unit, header_format_2d) grid_ptr, level, &
280281 num_cells(1 ), &
@@ -299,7 +300,7 @@ subroutine valout(level_begin, level_end, time, num_eqn, num_aux)
299300 end do
300301 write (out_unit, * ) ' '
301302 end do
302-
303+
303304 case (2 )
304305 ! binary32
305306 ! Note: We are writing out ghost cell data also
@@ -310,19 +311,19 @@ subroutine valout(level_begin, level_end, time, num_eqn, num_aux)
310311 aux4 = real (alloc(iaddaux(1 , 1 , 1 ):i), kind= 4 )
311312 write (out_unit) aux4
312313 deallocate (aux4)
313-
314+
314315 case (3 )
315316 ! binary64
316317 ! Note: We are writing out ghost cell data also
317318 i = (iaddaux(num_aux, num_cells(1 ) + 2 * num_ghost, &
318319 num_cells(2 ) + 2 * num_ghost))
319320 write (out_unit) alloc(iaddaux(1 , 1 , 1 ):i)
320-
321+
321322
322323 ! HDF5 output
323324 case (4 )
324325#ifdef HDF5
325- ! Create data space - handles dimensions of the corresponding
326+ ! Create data space - handles dimensions of the corresponding
326327 ! data set - annoyingling need to stick grid size into other
327328 ! data type
328329 dims = (/ num_aux, num_cells(1 ) + 2 * num_ghost, &
@@ -346,18 +347,18 @@ subroutine valout(level_begin, level_end, time, num_eqn, num_aux)
346347#endif
347348 case default
348349 print * , " Unsupported output format" , output_format," ."
349- stop
350+ stop
350351
351352 end select
352353 grid_ptr = node(levelptr, grid_ptr)
353354 end do
354355 end do
355-
356+
356357 if ((output_format == 1 ) .or. (output_format == 2 ) .or. &
357358 (output_format == 3 )) then
358359 close (out_unit)
359360 end if
360-
361+
361362 end if
362363
363364#ifdef HDF5
@@ -375,7 +376,7 @@ subroutine valout(level_begin, level_end, time, num_eqn, num_aux)
375376 ! Note: We need to print out num_ghost too in order to strip ghost cells
376377 ! from q array when reading in pyclaw.io.binary
377378
378-
379+
379380 if (output_format == 1 ) then
380381 file_format = ' ascii'
381382 else if (output_format == 2 ) then
@@ -385,7 +386,7 @@ subroutine valout(level_begin, level_end, time, num_eqn, num_aux)
385386 else if (output_format == 4 ) then
386387 file_format = ' hdf'
387388 endif
388-
389+
389390 write (out_unit, t_file_format) time, num_eqn, num_grids, num_aux, 2 , &
390391 num_ghost, file_format
391392 close (out_unit)
@@ -395,7 +396,7 @@ subroutine valout(level_begin, level_end, time, num_eqn, num_aux)
395396 open (unit= out_unit, file= timing_file_name, form= ' formatted' , &
396397 status= ' unknown' , action= ' write' , position= ' append' )
397398 ! status='old', action='write', position='append')
398-
399+
399400 timing_line = " (e16.6, ', ', e16.6, ', ', e16.6"
400401 do level= 1 , mxnest
401402 timing_substr = " , ', ', e16.6, ', ', e16.6, ', ', e16.6"
@@ -419,7 +420,7 @@ subroutine valout(level_begin, level_end, time, num_eqn, num_aux)
419420 write (out_unit, timing_line) time, timeTick_overall, t_CPU_overall, &
420421 (real (tvoll(i), kind= 8 ) / real (clock_rate, kind= 8 ), &
421422 tvollCPU(i), rvoll(i), i= 1 ,mxnest)
422-
423+
423424 close (out_unit)
424425
425426 ! ==========================================================================
@@ -452,5 +453,3 @@ pure integer function iaddaux(m, i, j)
452453 end function iaddaux
453454
454455end subroutine valout
455-
456-
0 commit comments