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 lmdz_geometry, 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 END DO RETURN end