Skip to content

Commit

Permalink
BUG: undeclared variables
Browse files Browse the repository at this point in the history
  • Loading branch information
aaronjridley committed Nov 6, 2024
1 parent 40306e6 commit 7daea57
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions ext/IE/EIE_IoLibrary.f90
Original file line number Diff line number Diff line change
Expand Up @@ -281,6 +281,7 @@ subroutine IO_GetPotential(PotentialOut, iError)
real, dimension(IOi_NeednMLTs,IOi_NeednLats) :: ValueOut
real, dimension(IOi_NeednMLTs,IOi_NeednLats), intent(out) :: PotentialOut
real :: Filler = 0.0
integer :: iLat, iMlt

iError = 0

Expand All @@ -302,6 +303,27 @@ subroutine IO_GetPotential(PotentialOut, iError)

call IO_GetNonGridBasedPotential(ValueOut, iError)

! In Weimer, there are sometimes 0 potentials. I don't know why.
if (maxval(abs(IOr2_NeedLats)) > 80.0) then

do iMlt = 2, IOi_NeednMLTs - 1
do iLat = 2, IOi_NeednLats - 1
if (ValueOut(iMlt, iLat) == 0.0) then
if (ValueOut(iMlt, iLat - 1)*ValueOut(iMlt, iLat + 1) > 0) then
! this is a "hole" in the potential, since the potential is
! the same sign both above and below the current point.
ValueOut(iMlt, iLat) = ( &
ValueOut(iMlt - 1, iLat) + &
ValueOut(iMlt, iLat - 1) + &
ValueOut(iMlt + 1, iLat) + &
ValueOut(iMlt, iLat + 1))/4.0
endif
endif
enddo
enddo

endif

if (iError == 0) then
PotentialOut = ValueOut
else
Expand Down

0 comments on commit 7daea57

Please sign in to comment.