source: LMDZ6/branches/Amaury_dev/libf/phylmd/grid_index.F90 @ 5112

Last change on this file since 5112 was 5112, checked in by abarral, 4 months ago

Rename modules in phy_common from *_mod > lmdz_*

File size: 718 bytes
Line 
1function grid_index(lon_deg,lat_deg)
2!--------------------------------------------------------------------------------
3! Get local index of grid point of longitude,latitude lon_deg,lat_deg
4! Author : FH 2024/07/18
5! Please do not put this function in a m*odule not to complexify the replay script
6!--------------------------------------------------------------------------------
7USE dimphy, ONLY: klon
8USE lmdz_geometry, ONLY: latitude_deg, longitude_deg
9implicit none
10real, intent(in) :: lon_deg,lat_deg
11integer :: grid_index
12integer i
13grid_index=0
14DO i=1,klon
15   if ( abs(lon_deg-longitude_deg(i)) < 0.02 .and.  abs(lat_deg-latitude_deg(i)) < 0.02 ) then
16        grid_index=i
17        exit
18   endif
19END DO
20return
21end
Note: See TracBrowser for help on using the repository browser.