Skip to content

Commit 54b88a9

Browse files
Change indexing src/topography.f90
Co-authored-by: Andrew Kiss <[email protected]>
1 parent 3fcc49d commit 54b88a9

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/topography.f90

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -492,12 +492,12 @@ subroutine topography_cut_off_T_cells(this, hgrid, cutoff)
492492
call handle_error(nf90_close(ncid_hgrid))
493493

494494
! Calculate T cell size based on dy
495-
! For each point, the T cell size is a sum of dy(2*i-1, 2*j) and dy(2*i, 2*j)
495+
! For each point, the T cell size is a sum of dy(2*j-1, 2*i) and dy(2*j, 2*i)
496496
! Apply cutoff to depth based on the provided T-cell cutoff value in kilometers
497-
do i = 1, ny_len / 2
498-
do j = 1, (nxp_len - 1) / 2
499-
if (dy(2 * i - 1, 2 * j) + dy(2 * i, 2 * j) < cutoff*1000.0_real64) then !Input cutoff in Kilometers covert it to meters
500-
this%depth(i, j) = MISSING_VALUE ! Set values below cutoff to zero or another value as needed
497+
do j = 1, ny_len / 2
498+
do i = 1, (nxp_len - 1) / 2
499+
if (dy(2 * j - 1, 2 * i) + dy(2 * j, 2 * i) < cutoff*1000.0_real64) then !Input cutoff in Kilometers convert it to meters
500+
this%depth(j, i) = MISSING_VALUE ! Set values below cutoff to zero or another value as needed
501501
end if
502502
end do
503503
end do

0 commit comments

Comments
 (0)