Skip to content

Commit

Permalink
moved setting gauges(i)%last_time into an exisiting loop on gauges, a…
Browse files Browse the repository at this point in the history
…nd updated 3d version too
  • Loading branch information
rjleveque committed Feb 16, 2025
1 parent f800c56 commit 3110162
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 7 deletions.
12 changes: 6 additions & 6 deletions src/2d/gauges_module.f90
Original file line number Diff line number Diff line change
Expand Up @@ -145,17 +145,17 @@ subroutine set_gauges(restart, num_eqn, num_aux, fname)
read(UNIT, *)
read(UNIT, *) (gauges(i)%gtype, i=1, num_gauges)

do i=1,num_gauges
! initialize last_time so that first gauge output will be
! at time gauges(i)%t_start regardless of min_time_increment:
gauges(i)%last_time = gauges(i)%t_start - 1.d0 &
- gauges(i)%min_time_increment
enddo

! Read in q fields
read(UNIT, *)
read(UNIT, *)
do i = 1, num_gauges

! initialize last_time so that first gauge output will be
! at time gauges(i)%t_start regardless of min_time_increment:
gauges(i)%last_time = gauges(i)%t_start - 1.d0 &
- gauges(i)%min_time_increment

if (gauges(i)%gtype .ne. 1) then
write(6,*) '*** Lagrangian gauges not yet supported'
write(6,*) '*** All gauges must have gtype==1'
Expand Down
7 changes: 6 additions & 1 deletion src/3d/gauges_module.f90
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,6 @@ subroutine set_gauges(restart, num_eqn, num_aux, fname)
read(UNIT, *) gauges(i)%gauge_num, gauges(i)%x, gauges(i)%y, &
gauges(i)%z, gauges(i)%t_start, gauges(i)%t_end
gauges(i)%buffer_index = 1
gauges(i)%last_time = gauges(i)%t_start
enddo

! Read in output formats
Expand All @@ -144,6 +143,12 @@ subroutine set_gauges(restart, num_eqn, num_aux, fname)
read(UNIT, *)
read(UNIT, *)
do i = 1, num_gauges

! initialize last_time so that first gauge output will be
! at time gauges(i)%t_start regardless of min_time_increment:
gauges(i)%last_time = gauges(i)%t_start - 1.d0 &
- gauges(i)%min_time_increment

if (gauges(i)%gtype .ne. 1) then
write(6,*) '*** Lagrangian gauges not yet supported'
write(6,*) '*** All gauges must have gtype==1'
Expand Down

0 comments on commit 3110162

Please sign in to comment.