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

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

enforce PRIVATE by default in several modules, expose PUBLIC as needed
move eigen.f90 to obsolete/
(lint) aslong the way

File size: 718 bytes
RevLine 
[5074]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!--------------------------------------------------------------------------------
[5101]7USE dimphy, ONLY: klon
[5112]8USE lmdz_geometry, ONLY: latitude_deg, longitude_deg
[5113]9IMPLICIT NONE
[5117]10REAL, INTENT(IN) :: lon_deg,lat_deg
[5116]11INTEGER :: grid_index
[5117]12INTEGER i
[5074]13grid_index=0
[5103]14DO i=1,klon
[5117]15   IF ( abs(lon_deg-longitude_deg(i)) < 0.02 .AND.  abs(lat_deg-latitude_deg(i)) < 0.02 ) THEN
[5074]16        grid_index=i
17        exit
18   endif
[5103]19END DO
[5116]20RETURN
[5119]21END
Note: See TracBrowser for help on using the repository browser.