Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove leftover ifdef statements to fix stirring bug #449

Merged
merged 1 commit into from
Jul 6, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Remove leftover ifdef statements to fix stirring bug
ttricco committed Jul 6, 2023
commit 72c62809c8c96452954c5b11908add3e32c47dd7
28 changes: 13 additions & 15 deletions src/main/forcing.F90
Original file line number Diff line number Diff line change
@@ -963,9 +963,7 @@ subroutine forceit(t,npart,xyzh,vxyzu,fxyzu)
real, intent(out) :: fxyzu(:,:)

logical :: update_accel = .true.
#ifdef STIR_FROM_FILE
real :: tinfile
#endif
! real :: tinfile

logical, parameter :: Debug = .false.
!!===================================================================
@@ -977,25 +975,25 @@ subroutine forceit(t,npart,xyzh,vxyzu,fxyzu)
if (t > (tprev + st_dtfreq)) then
tprev = st_dtfreq*int(t/st_dtfreq) ! round to last full dtfreq
update_accel = .true.
#ifdef STIR_FROM_FILE
call read_stirring_data_from_file(forcingfile,t,tinfile)
!if (id==master .and. iverbose >= 2) print*,' got new accel, tinfile = ',tinfile
#endif
if (stir_from_file) then
call read_stirring_data_from_file(forcingfile,t,tinfile)
!if (id==master .and. iverbose >= 2) print*,' got new accel, tinfile = ',tinfile
endif
endif

if (Debug) print *, 'stir: stirring start'

call st_calcAccel(npart,xyzh,fxyzu)

#ifndef STIR_FROM_FILE
if (update_accel) then
if (Debug) print*,'updating accelerations...'
call st_ounoiseupdate(6*st_nmodes, st_OUphases, st_OUvar, st_dtfreq, st_decay)
call st_calcPhases()
!! Store random seed in memory for later checkpoint.
call random_seed (get = st_randseed)
if (.not. stir_from_file) then
if (update_accel) then
if (Debug) print*,'updating accelerations...'
call st_ounoiseupdate(6*st_nmodes, st_OUphases, st_OUvar, st_dtfreq, st_decay)
call st_calcPhases()
!! Store random seed in memory for later checkpoint.
call random_seed (get = st_randseed)
endif
endif
#endif

if (Debug) print *, 'stir: stirring end'