Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
odavidbrito committed Jun 10, 2017
2 parents bc362eb + 83a938b commit d8cc732
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 17 deletions.
16 changes: 12 additions & 4 deletions Software/MOHIDBase1/ModuleFunctions.F90
Original file line number Diff line number Diff line change
Expand Up @@ -5194,7 +5194,7 @@ subroutine FillMatrix3D (ILB, IUB, JLB, JUB, KLB, KUB, ComputePoints3D, OutValue
real, dimension(:,: ), pointer :: Value2D
integer, dimension(:,: ), pointer :: Map2D

integer :: k, kfirst, klast
integer :: k, kfirst, klast, i, j


!Begin-----------------------------------------------------------------
Expand All @@ -5218,10 +5218,14 @@ subroutine FillMatrix3D (ILB, IUB, JLB, JUB, KLB, KUB, ComputePoints3D, OutValue

!Search for the first layer with data
d2: do k = KLB, KUB
if (OutValues3D(ILB, JLB, k) > FillValueReal/1e4) then
do j = JLB, JUB
do i = ILB, IUB
if (OutValues3D(i, j, k) > FillValueReal/1e4) then
kfirst = k
exit
exit d2
endif
enddo
enddo
enddo d2

!Extrapolate for the bottom layers
Expand All @@ -5231,10 +5235,14 @@ subroutine FillMatrix3D (ILB, IUB, JLB, JUB, KLB, KUB, ComputePoints3D, OutValue

!Search for the last layer with data
d4: do k = KUB, KLB,-1
do j = JLB, JUB
do i = ILB, IUB
if (OutValues3D(ILB, JLB, k) > FillValueReal/1e4) then
klast = k
exit
exit d4
endif
enddo
enddo
enddo d4

!Extrapolate for the surface layers
Expand Down
20 changes: 7 additions & 13 deletions Software/MOHIDWater/ModuleSediment.F90
Original file line number Diff line number Diff line change
Expand Up @@ -5335,31 +5335,27 @@ subroutine ComputeBedSlopeEffects
dhdy = 0.

if (SandClass%FluxU(i, j) < 0.) then
!if (Me%ExternalVar%ComputeFacesU2D(i, j) == Covered ) then
if (Me%ExternalVar%WaterPoints2D(i, j-1) == WaterPoint) then
if (Me%ExternalVar%ComputeFacesU2D(i, j) == Covered ) then

dhdx = (Me%ExternalVar%Bathymetry(i, j) - Me%ExternalVar%Bathymetry(i, j-1)) / &
Me%ExternalVar%DZX(i,j-1)
endif
else
!if (Me%ExternalVar%ComputeFacesU2D(i,j+1) == Covered) then
if (Me%ExternalVar%WaterPoints2D(i, j+1) == WaterPoint) then
if (Me%ExternalVar%ComputeFacesU2D(i,j+1) == Covered) then

dhdx = (Me%ExternalVar%Bathymetry(i, j+1) - Me%ExternalVar%Bathymetry(i, j)) / &
Me%ExternalVar%DZX(i,j)
endif
endif

if (SandClass%FluxV(i, j) < 0.) then
!if (Me%ExternalVar%ComputeFacesV2D(i, j) == Covered) then
if (Me%ExternalVar%WaterPoints2D(i-1, j) == WaterPoint) then
if (Me%ExternalVar%ComputeFacesV2D(i, j) == Covered) then

dhdy = (Me%ExternalVar%Bathymetry(i, j) - Me%ExternalVar%Bathymetry(i-1, j)) / &
Me%ExternalVar%DZY(i-1,j)
endif
else
!if (Me%ExternalVar%ComputeFacesV2D(i+1, j) == Covered) then
if (Me%ExternalVar%WaterPoints2D(i+1, j) == WaterPoint) then
if (Me%ExternalVar%ComputeFacesV2D(i+1, j) == Covered) then

dhdy = (Me%ExternalVar%Bathymetry(i+1, j) - Me%ExternalVar%Bathymetry(i, j)) / &
Me%ExternalVar%DZY(i,j)
Expand Down Expand Up @@ -5708,8 +5704,7 @@ subroutine ComputeEvolution
do i=WILB, WIUB

if (SandClass%FluxU(i, j) < 0.) then
!if (Me%ExternalVar%ComputeFacesU2D(i, j) == Covered ) then
if (Me%ExternalVar%WaterPoints2D(i, j-1) == WaterPoint) then
if (Me%ExternalVar%ComputeFacesU2D(i, j) == Covered ) then

SandClass%DM(i, j-1) = SandClass%DM(i, j-1) - Me%Evolution%SedimentDT * SandClass%FluxU(i, j)
SandClass%DM(i, j ) = SandClass%DM(i, j ) + Me%Evolution%SedimentDT * SandClass%FluxU(i, j)
Expand All @@ -5721,8 +5716,7 @@ subroutine ComputeEvolution
endif
elseif (SandClass%FluxU(i, j) > 0.) then

!if (Me%ExternalVar%ComputeFacesU2D(i,j+1) == Covered) then
if (Me%ExternalVar%WaterPoints2D(i, j+1) == WaterPoint) then
if (Me%ExternalVar%ComputeFacesU2D(i,j+1) == Covered) then

SandClass%DM(i, j+1) = SandClass%DM(i, j+1) + Me%Evolution%SedimentDT * SandClass%FluxU(i, j)
SandClass%DM(i, j ) = SandClass%DM(i, j ) - Me%Evolution%SedimentDT * SandClass%FluxU(i, j)
Expand Down Expand Up @@ -8113,7 +8107,7 @@ subroutine ReadLockExternalVar
call GetComputeFaces2D(Me%ObjHorizontalMap, &
ComputeFaces2DU = Me%ExternalVar%ComputeFacesU2D, &
ComputeFaces2DV = Me%ExternalVar%ComputeFacesV2D, &
ActualTime = Me%ExternalVar%Now, &
!ActualTime = Me%ExternalVar%Now, &
STAT = STAT_CALL)
if (STAT_CALL /= SUCCESS_) stop 'ReadLockExternalVar - ModuleSediment - ERR06'

Expand Down

0 comments on commit d8cc732

Please sign in to comment.