grid_index.f90 Source File


This file depends on

sourcefile~~grid_index.f90~~EfferentGraph sourcefile~grid_index.f90 grid_index.f90 sourcefile~geometry_mod.f90 geometry_mod.f90 sourcefile~grid_index.f90->sourcefile~geometry_mod.f90 sourcefile~dimphy.f90 dimphy.f90 sourcefile~grid_index.f90->sourcefile~dimphy.f90 sourcefile~mod_grid_phy_lmdz.f90 mod_grid_phy_lmdz.f90 sourcefile~geometry_mod.f90->sourcefile~mod_grid_phy_lmdz.f90 sourcefile~nrtype.f90 nrtype.f90 sourcefile~geometry_mod.f90->sourcefile~nrtype.f90

Contents

Source Code


Source Code

function grid_index(lon_deg,lat_deg)
!--------------------------------------------------------------------------------
! Get local index of grid point of longitude,latitude lon_deg,lat_deg
! Author : FH 2024/07/18
! Please do not put this function in a m*odule not to complexify the replay script
!--------------------------------------------------------------------------------
USE dimphy, only : klon
USE geometry_mod, ONLY: latitude_deg, longitude_deg
implicit none
real, intent(in) :: lon_deg,lat_deg
integer :: grid_index
integer i
grid_index=0
do i=1,klon
   if ( abs(lon_deg-longitude_deg(i)) < 0.02 .and.  abs(lat_deg-latitude_deg(i)) < 0.02 ) then
        grid_index=i
        exit
   endif
enddo
return
end function grid_index