From 7d5c5c911747e81345fb35f1189ce2172290d47a Mon Sep 17 00:00:00 2001
From: JorisP <pianezze.joris@gmail.com>
Date: Thu, 11 Jul 2024 15:22:55 +0200
Subject: [PATCH] Bugfix for OASIS coupling and corresponding KTEST

---
 ...lot_check_exchanges_between_mesonh_and_toy.py |  2 +-
 .../B_cpl_mnh_toyoce/run_mesonh_xyz              |  2 +-
 src/MNH/mnh_oasis_send.F90                       | 16 ++++++++--------
 3 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/MY_RUN/KTEST/013_Iroise_OASIS_coupling/A_cpl_mnh_toywav/plot_check_exchanges_between_mesonh_and_toy.py b/MY_RUN/KTEST/013_Iroise_OASIS_coupling/A_cpl_mnh_toywav/plot_check_exchanges_between_mesonh_and_toy.py
index dcca2ee68..5bfb8f084 100755
--- a/MY_RUN/KTEST/013_Iroise_OASIS_coupling/A_cpl_mnh_toywav/plot_check_exchanges_between_mesonh_and_toy.py
+++ b/MY_RUN/KTEST/013_Iroise_OASIS_coupling/A_cpl_mnh_toywav/plot_check_exchanges_between_mesonh_and_toy.py
@@ -87,7 +87,7 @@ fig = plt.figure()
 cmap_wnd   = plt.cm.RdBu_r
 cmap_toy   = plt.cm.RdBu_r
 
-levels_wnd = np.arange(  0.0, 0.26, 0.01)
+levels_wnd = np.arange(  1.9, 2.01, 0.01)
 levels_toy = np.arange(-10.0, 10.1,  0.1)
 
 norm_wnd   = BoundaryNorm(levels_wnd, ncolors=cmap_wnd.N, clip=True)
diff --git a/MY_RUN/KTEST/013_Iroise_OASIS_coupling/B_cpl_mnh_toyoce/run_mesonh_xyz b/MY_RUN/KTEST/013_Iroise_OASIS_coupling/B_cpl_mnh_toyoce/run_mesonh_xyz
index 19252124c..540a35cdf 100755
--- a/MY_RUN/KTEST/013_Iroise_OASIS_coupling/B_cpl_mnh_toyoce/run_mesonh_xyz
+++ b/MY_RUN/KTEST/013_Iroise_OASIS_coupling/B_cpl_mnh_toyoce/run_mesonh_xyz
@@ -20,5 +20,5 @@ cp     ../2_input_toy/rstrt_TOY.nc rst_T.nc
 ln -fs ../3_input_oasis/namcouple_oce namcouple
 
 # ------------------------------------------
-time mpirun -np 1 $PATH_EXETOY/toy_model : -np 1 MESONH${XYZ}  
+time mpirun -np 1 $PATH_EXETOY/toy_model : -np 1 MESONH${XYZ}
 # ------------------------------------------
diff --git a/src/MNH/mnh_oasis_send.F90 b/src/MNH/mnh_oasis_send.F90
index 3278187cb..a3e6ebcc9 100644
--- a/src/MNH/mnh_oasis_send.F90
+++ b/src/MNH/mnh_oasis_send.F90
@@ -199,10 +199,10 @@ IF(GSEND_LAND)THEN
 !
 ! * Get river output fields
 !
-  CALL GET_SFX_LAND(YSURF_CUR%IM%O, YSURF_CUR%IM%S, YSURF_CUR%U,   &
-                    LCPL_GW,LCPL_FLOOD,LCPL_CALVING, LCPL_RIVCARB,    &
-                    ZLAND_RUNOFF (:),ZLAND_DRAIN   (:), &
-                    ZLAND_CALVING(:),ZLAND_SRCFLOOD(:), ZLAND_DOCFLUX(:)   )
+  CALL GET_SFX_LAND(YSURF_CUR%IM%O, YSURF_CUR%IM%S, YSURF_CUR%U,         &
+                    LCPL_GW,LCPL_FLOOD,LCPL_CALVING, LCPL_RIVCARB,       &
+                    ZLAND_RUNOFF (:),ZLAND_DRAIN   (:),                  &
+                    ZLAND_CALVING(:),ZLAND_SRCFLOOD(:), ZLAND_DOCFLUX(:) )
 !
 ENDIF
 !
@@ -210,8 +210,8 @@ IF(GSEND_LAKE)THEN
 !
 ! * Get output fields
 !
-  CALL GET_SFX_LAKE(YSURF_CUR%FM%F,YSURF_CUR%U,  &
-                    ZLAKE_EVAP(:),ZLAKE_RAIN(:), &
+  CALL GET_SFX_LAKE(YSURF_CUR%FM%F,YSURF_CUR%U,   &
+                    ZLAKE_EVAP(:),ZLAKE_RAIN(:),  &
                     ZLAKE_SNOW(:),ZLAKE_WATF(:)   )
 !
 ENDIF
@@ -221,7 +221,7 @@ IF(GSEND_SEA)THEN
 ! * Get sea output fields
 !
   CALL GET_SFX_SEA(YSURF_CUR%SM%S, YSURF_CUR%U, YSURF_CUR%WM%W,     &
-                    LCPL_SEAICE, LWATER, LSEACARB,              &
+                    LCPL_SEAICE, LWATER, LSEACARB,                  &
                     ZSEA_FWSU   (:),ZSEA_FWSV   (:),ZSEA_HEAT   (:),&
                     ZSEA_SNET   (:),ZSEA_WIND   (:),ZSEA_FWSM   (:),&
                     ZSEA_EVAP   (:),ZSEA_RAIN   (:),ZSEA_SNOW   (:),&
@@ -252,7 +252,7 @@ CALL SFX_OASIS_SEND(ILUOUT,KI,KI,IDATE,GSEND_LAND,GSEND_LAKE,GSEND_SEA,GSEND_WAV
                     ZSEA_FWSU,ZSEA_FWSV,ZSEA_HEAT,ZSEA_SNET,ZSEA_WIND,             &
                     ZSEA_FWSM,ZSEA_EVAP,ZSEA_RAIN,ZSEA_SNOW,                       &
                     ZSEA_WATF,                                                     &
-                    ZSEA_PRES,ZSEAICE_HEAT,ZSEAICE_SNET,ZSEAICE_EVAP,              &
+                    ZSEA_PRES,ZSEA_CO2,ZSEAICE_HEAT,ZSEAICE_SNET,ZSEAICE_EVAP,     &
                     ZWAVE_U10, ZWAVE_V10      )
 !
 !-------------------------------------------------------------------------------
-- 
GitLab