From cf31430e3761fdb8496e427f1d5f5b31718d9d08 Mon Sep 17 00:00:00 2001
From: Quentin Rodier <quentin.rodier@meteo.fr>
Date: Tue, 21 Apr 2020 17:59:33 +0200
Subject: [PATCH]  Quentin 21/04/2020: major correction for GFS grib use : the
 u and v wind component is now written in the correct vertical order at
 prep_real

---
 src/MNH/read_all_data_grib_case.f90 | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/MNH/read_all_data_grib_case.f90 b/src/MNH/read_all_data_grib_case.f90
index aa2e35174..882dc12bb 100644
--- a/src/MNH/read_all_data_grib_case.f90
+++ b/src/MNH/read_all_data_grib_case.f90
@@ -131,6 +131,7 @@ END MODULE MODI_READ_ALL_DATA_GRIB_CASE
 !!      Bielli S. 02/2019  Sea salt : significant sea wave height influences salt emission; 5 salt modes
 !  P. Wautelet 14/03/2019: correct ZWS when variable not present in file
 !  Q. Rodier   27/01/2020: switch of GRIB number ID for Orograpgy and hydrometeors in ARPEGE/AROME in EPyGrAM v1.3.7
+!  Q. Rodier   21/04/2020: correction GFS u and v wind component written in the right vertical order
 !-------------------------------------------------------------------------------
 !
 !*      0. DECLARATIONS
@@ -1464,7 +1465,7 @@ DO JLOOP1 = ISTARTLEVEL, ISTARTLEVEL+INLEVEL-1
   IF (IMODEL/=10) THEN ! others than NCEP
     ILEV1 = JLOOP1
   ELSE
-    ILEV1 = IP_GFS(JLOOP1)
+    ILEV1 = IP_GFS(INLEVEL+ISTARTLEVEL-JLOOP1)
   END IF
   ! read component u 
   CALL SEARCH_FIELD(IGRIB,INUM,KPARAM=IPAR,KLEV1=ILEV1)
@@ -1497,7 +1498,7 @@ DO JLOOP1 = ISTARTLEVEL, ISTARTLEVEL+INLEVEL-1
   IF (IMODEL/=10) THEN ! others than NCEP
     ILEV1 = JLOOP1
   ELSE
-    ILEV1 = IP_GFS(JLOOP1)
+    ILEV1 = IP_GFS(INLEVEL+ISTARTLEVEL-JLOOP1)
   END IF
   CALL SEARCH_FIELD(IGRIB,INUM,KPARAM=IPAR+1,KLEV1=ILEV1)
   IF (INUM < 0) THEN
-- 
GitLab