Skip to content
Open
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
18 changes: 14 additions & 4 deletions src/core_init_atmosphere/mpas_gsl_oro_data_sm_scale.F
Original file line number Diff line number Diff line change
Expand Up @@ -711,16 +711,26 @@ function nearest_j_south(lat_in)
integer :: j

lat = lat_in
if ( abs(lat_in).gt.p5*Pi ) then

if (abs(lat_in).gt.p5*Pi) then
nearest_j_south = -999
elseif ( lat_in.le.lat1d_fine(1) ) then

elseif (lat.le.lat1d_fine(1)) then
nearest_j_south = 1

else
j = 2
do while ( (lat1d_fine(j).le.lat).and.(j.le.topo_y) )

do while (j.le.topo_y)
if (lat1d_fine(j).gt.lat) then
nearest_j_south = j - 1
return
end if
j = j + 1
end do
nearest_j_south = j - 1

! Latitude ao norte do �ltimo ponto da grade fina
nearest_j_south = topo_y
end if

end function nearest_j_south
Expand Down