From 98b61692803b23c94d38de340c0bd3c4291d4f66 Mon Sep 17 00:00:00 2001
From: Quentin Rodier <quentin.rodier@meteo.fr>
Date: Thu, 10 Aug 2023 10:07:54 +0200
Subject: [PATCH] Quentin 10/08/2023: Handle IFS model-level grib obtained by
 python API : these grib files is detected of type IMODEL=11 <=> ln(Pressure)
 missing Pressure is found as KPARAM=134 but the other fields are coded as a
 classic IFS model-level grib (IMODEL=0)

---
 src/MNH/read_all_data_grib_case.f90 | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/src/MNH/read_all_data_grib_case.f90 b/src/MNH/read_all_data_grib_case.f90
index 4e0337837..14925cb2b 100644
--- a/src/MNH/read_all_data_grib_case.f90
+++ b/src/MNH/read_all_data_grib_case.f90
@@ -714,6 +714,10 @@ DEALLOCATE (ZLNPS_G)
 !
 WRITE (ILUOUT0,'(A)') ' | Reading T and Q fields'
 !
+IF (IMODEL==11) THEN
+  CALL SEARCH_FIELD(IGRIB,INUM,KPARAM=130,KLEV1=1000) !look for air temperature at pressure level 1000hPa
+  IF (INUM < 0) IMODEL = 0 ! This change is for handling IFS model level grib file obtained by python API
+END IF
 IF (IMODEL/=10.AND.IMODEL/=11) THEN
   SELECT CASE (IMODEL)
     CASE(0) ! ECMWF
-- 
GitLab