Juan 24/05/2017: add MPPDB_CHECK on SURFEX routine for reprod check with MNH_PARALLEL key
authorJuan Escobar <escj@aero.obs-mip.fr>
Wed, 24 May 2017 15:12:29 +0000 (17:12 +0200)
committerJuan Escobar <escj@aero.obs-mip.fr>
Wed, 24 May 2017 15:12:29 +0000 (17:12 +0200)
14 files changed:
src/SURFEX/init_tebn.F90
src/SURFEX/pgd_flake.F90
src/SURFEX/pgd_grid.F90
src/SURFEX/pgd_isba.F90
src/SURFEX/pgd_seaflux.F90
src/SURFEX/pgd_surf_atm.F90
src/SURFEX/pgd_teb.F90
src/SURFEX/read_pgd_isban.F90
src/SURFEX/read_pgd_tebn.F90
src/SURFEX/zoom_pgd_cover.F90
src/SURFEX/zoom_pgd_isba.F90
src/SURFEX/zoom_pgd_orography.F90
src/SURFEX/zoom_pgd_seaflux.F90
src/SURFEX/zoom_pgd_teb.F90

index 88c96c1..bf1f94a 100644 (file)
@@ -44,6 +44,7 @@
 !!      G. Pigeon   09/2012: add ROUGH_WALL/ROUGH_ROOF/CH_BEM for conv. coef.
 !!      B. Decharme  04/2013 new coupling variables
 !!                           delete CTOPREG option (never used)
+!!      M.Moge      02/2015 MPPDB_CHECK
 !-------------------------------------------------------------------------------
 !
 !*       0.    DECLARATIONS
@@ -119,6 +120,11 @@ USE MODI_SET_SURFEX_FILEIN
 USE YOMHOOK   ,ONLY : LHOOK,   DR_HOOK
 USE PARKIND1  ,ONLY : JPRB
 !
+#ifdef MNH_PARALLEL
+USE MODD_DATA_COVER_PAR, ONLY : JPCOVER
+USE MODE_MPPDB
+!
+#endif
 IMPLICIT NONE
 !
 !*       0.1   Declarations of arguments
@@ -304,6 +310,9 @@ END SELECT
 !
  CALL READ_PGD_TEB_n(DTCO, U, TM,GCP, &
                      HPROGRAM)
+#ifdef MNH_PARALLEL
+ CALL MPPDB_CHECK_SURFEX3D(TM%TOP%XCOVER,"INIT_TEB_n after READ_PGD_TEB_n:XCOVER",PRECISION,ILUOUT, 'TOWN  ',JPCOVER)
+#endif
 !
  CALL END_IO_SURF_n(HPROGRAM)
 ! 
@@ -314,6 +323,9 @@ ILU = SIZE(TM%TOP%XCOVER,1)
 ALLOCATE(TM%TOP%XTEB_PATCH(ILU,TM%TOP%NTEB_PATCH))
  CALL CONVERT_TEB(TM%TOP, &
                   TM%TOP%XCOVER,TM%TOP%XTEB_PATCH)
+#ifdef MNH_PARALLEL
+ CALL MPPDB_CHECK_SURFEX3D(TM%TOP%XCOVER,"INIT_TEB_n after CONVERT_TEB:XCOVER",PRECISION,ILUOUT, 'TOWN  ',JPCOVER)
+#endif
 !
  CALL SET_SURFEX_FILEIN(HPROGRAM,'PREP') ! restore input file name
  CALL INIT_IO_SURF_n(DTCO, DGU, U, &
@@ -680,6 +692,9 @@ DO JPATCH=1,TM%TOP%NTEB_PATCH
   CALL DIAG_MISC_TEB_INIT_n(TM%DGCT, TM%DGMT, TM%DGMTO, TM%TOP, &
                             HPROGRAM,ILU,ISWB)
 END DO ! end of loop on patches
+#ifdef MNH_PARALLEL
+ CALL MPPDB_CHECK_SURFEX3D(TM%TOP%XCOVER,"INIT_TEB_n end:XCOVER",PRECISION,ILUOUT, 'TOWN  ',JPCOVER)
+#endif
 !
 !-------------------------------------------------------------------------------
 !
index b46ca13..01cb2fb 100644 (file)
@@ -35,6 +35,7 @@
 !!
 !!    Original    03/2004
 !!    04/2013, P. Le Moigne : allow limitation of lake depth
+!!    M. Moge     02/2015 : MPPDB_CHECK
 !!
 !----------------------------------------------------------------------------
 !
@@ -72,6 +73,9 @@ USE MODI_TREAT_GLOBAL_LAKE_DEPTH
 !
 USE MODE_POS_SURF
 !
+#ifdef MNH_PARALLEL
+USE MODE_MPPDB
+#endif
 !
 USE YOMHOOK   ,ONLY : LHOOK,   DR_HOOK
 USE PARKIND1  ,ONLY : JPRB
@@ -201,6 +205,12 @@ ALLOCATE(FG%XMESH_SIZE (FG%NDIM))
                 FG%CGRID,  FG%XGRID_PAR,                     &
                 F%LCOVER, F%XCOVER, F%XZS,                   &
                 FG%XLAT, FG%XLON, FG%XMESH_SIZE                 )  
+#ifdef MNH_PARALLEL
+ CALL MPPDB_CHECK_SURFEX3D(F%XCOVER,"PGD_FLAKE after PACK_PGD:XCOVER",PRECISION,ILUOUT,'WATER',JPCOVER)
+ CALL MPPDB_CHECK_SURFEX2D(FG%XLAT,"PGD_FLAKE after PACK_PGD:XLAT",PRECISION,ILUOUT,'WATER')
+ CALL MPPDB_CHECK_SURFEX2D(FG%XLON,"PGD_FLAKE after PACK_PGD:XLON",PRECISION,ILUOUT,'WATER')
+ CALL MPPDB_CHECK_SURFEX2D(FG%XMESH_SIZE,"PGD_FLAKE after PACK_PGD:XMESH_SIZE",PRECISION,ILUOUT,'WATER')
+#endif
 !
 !-------------------------------------------------------------------------------
 !
index caa68ad..f4759b1 100644 (file)
@@ -83,6 +83,9 @@ USE MODI_PGD_GRID_IO_INIT
 USE MODE_TOOLS_ll, ONLY : GET_MEAN_OF_COORD_SQRT_ll
 !
 USE MODI_GET_SIZE_FULL_n
+#ifdef MNH_PARALLEL
+USE MODE_MPPDB
+#endif
 USE MODI_SPLIT_GRID
 USE MODD_CONF, ONLY : CPROGRAM
 #endif
@@ -314,6 +317,11 @@ ALLOCATE(UG%XLON       (U%NSIZE_FULL))
 ALLOCATE(UG%XMESH_SIZE (U%NSIZE_FULL))
 ALLOCATE(UG%XJPDIR     (U%NSIZE_FULL))
  CALL LATLON_GRID(CGRID,NGRID_PAR,U%NSIZE_FULL,ILUOUT,XGRID_PAR,UG%XLAT,UG%XLON,UG%XMESH_SIZE,UG%XJPDIR)
+#ifdef MNH_PARALLEL
+ CALL MPPDB_CHECK_SURFEX2D(UG%XLAT,"PGD_GRID after LATLON_GRID:XLAT",PRECISION,ILUOUT)
+ CALL MPPDB_CHECK_SURFEX2D(UG%XLON,"PGD_GRID after LATLON_GRID:XLON",PRECISION,ILUOUT)
+ CALL MPPDB_CHECK_SURFEX2D(UG%XMESH_SIZE,"PGD_GRID after LATLON_GRID:XMESH_SIZE",PRECISION,ILUOUT)
+#endif
 !
 !------------------------------------------------------------------------------
 !
index dfe3769..60ca41e 100644 (file)
@@ -44,6 +44,7 @@
 !!    R. Alkama     05/2012 : npatch must be 12 or 19 if CPHOTO/='NON'
 !!    B. Decharme   11/2013 : groundwater distribution for water table/surface coupling
 !!    P. Samuelsson 02/2012 : MEB
+!!    M. Moge       02/2015 : MPPDB_CHECK
 !!
 !----------------------------------------------------------------------------
 !
@@ -106,6 +107,10 @@ USE PARKIND1  ,ONLY : JPRB
 !
 USE MODI_ABOR1_SFX
 !
+#ifdef MNH_PARALLEL
+USE MODE_MPPDB
+!
+#endif
 IMPLICIT NONE
 !
 !*    0.1    Declaration of arguments
@@ -430,6 +435,11 @@ ALLOCATE(I%XZ0EFFJPDIR(ILU))
                 IG%CGRID,  IG%XGRID_PAR,                     &
                 I%LCOVER, I%XCOVER, I%XZS,                   &
                 IG%XLAT, IG%XLON, IG%XMESH_SIZE, I%XZ0EFFJPDIR    )  
+#ifdef MNH_PARALLEL
+ CALL MPPDB_CHECK_SURFEX2D(IG%XLAT,"PGD_ISBA after PACK_PGD:XLAT",PRECISION,ILUOUT, 'NATURE')
+ CALL MPPDB_CHECK_SURFEX2D(IG%XLON,"PGD_ISBA after PACK_PGD:XLON",PRECISION,ILUOUT, 'NATURE')
+ CALL MPPDB_CHECK_SURFEX2D(IG%XMESH_SIZE,"PGD_ISBA after PACK_PGD:XMESH_SIZE",PRECISION,ILUOUT, 'NATURE')
+#endif
 !
 !-------------------------------------------------------------------------------
 !
index e7bd58a..310f67f 100644 (file)
@@ -35,6 +35,7 @@
 !!
 !!    Original    03/2004
 !!    Lebeaupin-B C. 01/2008 : include bathymetry
+!!    M.Moge      02/2015 check with MPPDB
 !!
 !----------------------------------------------------------------------------
 !
@@ -67,6 +68,11 @@ USE MODI_PGD_SEAFLUX_PAR
 USE YOMHOOK   ,ONLY : LHOOK,   DR_HOOK
 USE PARKIND1  ,ONLY : JPRB
 !
+#ifdef MNH_PARALLEL
+USE MODE_MPPDB
+USE MODI_GET_LUOUT
+!
+#endif
 IMPLICIT NONE
 !
 !*    0.1    Declaration of arguments
@@ -88,6 +94,9 @@ TYPE(SURF_ATM_SSO_t), INTENT(INOUT) :: USS
 !            ------------------------------
 !
 REAL, DIMENSION(NL)               :: ZSEABATHY ! bathymetry on all surface points
+#ifdef MNH_PARALLEL
+INTEGER :: ILUOUT
+#endif
 !
 !*    0.3    Declaration of namelists
 !            ------------------------
@@ -111,6 +120,9 @@ REAL(KIND=JPRB) :: ZHOOK_HANDLE
 !             -------------------
 !
 IF (LHOOK) CALL DR_HOOK('PGD_SEAFLUX',0,ZHOOK_HANDLE)
+#ifdef MNH_PARALLEL
+ CALL GET_LUOUT(HPROGRAM,ILUOUT)
+#endif
  CALL READ_NAM_PGD_SEABATHY(HPROGRAM,YSEABATHY,YSEABATHYFILETYPE,YNCVARNAME,&
        XUNIF_SEABATHY)  
 !
@@ -145,7 +157,12 @@ ALLOCATE(SG%XMESH_SIZE (SG%NDIM))
                HPROGRAM, 'SEA   ',                    &
                 SG%CGRID,  SG%XGRID_PAR,                     &
                 S%LCOVER, S%XCOVER, S%XZS,                   &
-                SG%XLAT, SG%XLON, SG%XMESH_SIZE                 )  
+                SG%XLAT, SG%XLON, SG%XMESH_SIZE                 ) 
+#ifdef MNH_PARALLEL 
+ CALL MPPDB_CHECK_SURFEX2D(SG%XLAT,"PGD_SEAFLUX after PACK_PGD:XLAT",PRECISION,ILUOUT,'SEA')
+ CALL MPPDB_CHECK_SURFEX2D(SG%XLON,"PGD_SEAFLUX after PACK_PGD:XLON",PRECISION,ILUOUT,'SEA')
+ CALL MPPDB_CHECK_SURFEX2D(SG%XMESH_SIZE,"PGD_SEAFLUX after PACK_PGD:XMESH_SIZE",PRECISION,ILUOUT,'SEA')
+#endif
 !
  CALL PACK_PGD_SEAFLUX(DTCO, SG, S, U, &
                        HPROGRAM, ZSEABATHY)
index b328e22..fcca45b 100644 (file)
@@ -37,6 +37,7 @@
 !!      A. Lemonsu      05/2009         Ajout de la clef LGARDEN pour TEB
 !!      J. Escobar      11/2013         Add USE MODI_READ_NAM_PGD_CHEMISTRY
 !!      B. Decharme     02/2014         Add LRM_RIVER
+!!      M.Moge          02/2015         check with MPPDB
 !----------------------------------------------------------------------------
 !
 !*    0.     DECLARATION
@@ -76,6 +77,11 @@ USE MODI_INIT_READ_DATA_COVER
 USE YOMHOOK   ,ONLY : LHOOK,   DR_HOOK
 USE PARKIND1  ,ONLY : JPRB
 !
+USE MODI_READ_NAM_PGD_CHEMISTRY
+#ifdef MNH_PARALLEL
+!
+USE MODE_MPPDB
+#endif
 !
 IMPLICIT NONE
 !
@@ -138,6 +144,11 @@ ALLOCATE(YSC%UG%XMESH_SIZE(YSC%U%NSIZE_FULL))
 ALLOCATE(YSC%UG%XJPDIR(YSC%U%NSIZE_FULL))
  CALL LATLON_GRID(YSC%UG%CGRID,YSC%UG%NGRID_PAR,YSC%U%NSIZE_FULL,ILUOUT,&
                   YSC%UG%XGRID_PAR,YSC%UG%XLAT,YSC%UG%XLON,YSC%UG%XMESH_SIZE,YSC%UG%XJPDIR)
+#ifdef MNH_PARALLEL
+! CALL MPPDB_CHECK_SURFEX2D(YSC%UG%XLAT,"PGD_SURF_ATM_n after LATLON_GRID:XLAT",PRECISION,ILUOUT)
+! CALL MPPDB_CHECK_SURFEX2D(YSC%UG%XLON,"PGD_SURF_ATM_n after LATLON_GRID:XLON",PRECISION,ILUOUT)
+! CALL MPPDB_CHECK_SURFEX2D(YSC%UG%XMESH_SIZE,"PGD_SURF_ATM_n after LATLON_GRID:XMESH_SIZE",PRECISION,ILUOUT)
+#endif
 !
 !
 !*    2.3     Stores the grid in the module MODD_PGD_GRID
index f0f167d..bcfe371 100644 (file)
@@ -36,6 +36,7 @@
 !!    Original    10/12/97
 !!    A. Lemonsu      05/2009         Key for garden option
 !!    G. Pigeon     /09/12: WALL, ROOF, FLOOR, MASS LAYER default to 5
+!!    M. Moge       02/2015 : MPPDB_CHECK
 !!
 !----------------------------------------------------------------------------
 !
@@ -70,6 +71,10 @@ USE MODI_ABOR1_SFX
 USE YOMHOOK   ,ONLY : LHOOK,   DR_HOOK
 USE PARKIND1  ,ONLY : JPRB
 !
+#ifdef MNH_PARALLEL
+USE MODE_MPPDB
+!
+#endif
 USE MODI_WRITE_COVER_TEX_TEB
 !
 IMPLICIT NONE
@@ -156,7 +161,13 @@ ALLOCATE(TM%TG%XMESH_SIZE (TM%TG%NDIM))
                HPROGRAM, 'TOWN  ',                    &
                 TM%TG%CGRID,  TM%TG%XGRID_PAR,      &
                 TM%TOP%LCOVER, TM%TOP%XCOVER, TM%TOP%XZS,  &
-                TM%TG%XLAT, TM%TG%XLON, TM%TG%XMESH_SIZE      )  
+                TM%TG%XLAT, TM%TG%XLON, TM%TG%XMESH_SIZE      )
+#ifdef MNH_PARALLEL  
+ CALL MPPDB_CHECK_SURFEX3D(TM%TOP%XCOVER,"PGD_TEB after PACK_PGD:XCOVER",PRECISION,ILUOUT, 'TOWN  ',JPCOVER)
+ CALL MPPDB_CHECK_SURFEX2D(TM%TG%XLAT,"PGD_TEB after PACK_PGD:XLAT",PRECISION,ILUOUT, 'TOWN  ')
+ CALL MPPDB_CHECK_SURFEX2D(TM%TG%XLON,"PGD_TEB after PACK_PGD:XLON",PRECISION,ILUOUT, 'TOWN  ')
+ CALL MPPDB_CHECK_SURFEX2D(TM%TG%XMESH_SIZE,"PGD_TEB after PACK_PGD:XMESH_SIZE",PRECISION,ILUOUT, 'TOWN  ')
+#endif
 !
 !-------------------------------------------------------------------------------
 !
index c8d8240..2a0f017 100644 (file)
@@ -42,6 +42,7 @@
 !!                   11/2013  : same for groundwater distribution
 !!                   11/2014  : Read XSOILGRID as a series of real 
 !!      P. Samuelsson 10/2014 : MEB
+!!      M. Moge      02/2015 READ_SURF // + MPPDB_CHECK
 !-------------------------------------------------------------------------------
 !
 !*       0.    DECLARATIONS
@@ -91,6 +92,10 @@ USE MODI_GET_LUOUT
 USE MODI_PACK_SAME_RANK
 USE MODI_GET_SURF_MASK_n
 !
+#ifdef MNH_PARALLEL
+USE MODE_MPPDB
+!
+#endif
 IMPLICIT NONE
 !
 !*       0.1   Declarations of arguments
@@ -301,6 +306,7 @@ ALLOCATE(I%XCOVER(IG%NDIM,COUNT(I%LCOVER)))
 #ifdef MNH_PARALLEL
  CALL READ_SURF_COV(&
                     HPROGRAM,'COVER',I%XCOVER(:,:),I%LCOVER,IRESP,HDIR='H')
+ CALL MPPDB_CHECK_SURFEX3D(I%XCOVER,"READ_PGD_ISBA_n after READ_SURF:XCOVER",PRECISION,ILUOUT,'NATURE',JPCOVER)
 #else
  CALL READ_SURF_COV(&
                     HPROGRAM,'COVER',I%XCOVER(:,:),I%LCOVER,IRESP)
@@ -324,6 +330,11 @@ ALLOCATE(IG%XMESH_SIZE (IG%NDIM))
 ALLOCATE(I%XZ0EFFJPDIR(IG%NDIM))
  CALL READ_GRID(&
                 HPROGRAM,IG%CGRID,IG%XGRID_PAR,IG%XLAT,IG%XLON,IG%XMESH_SIZE,IRESP,I%XZ0EFFJPDIR)
+#ifdef MNH_PARALLEL
+ CALL MPPDB_CHECK_SURFEX2D(IG%XLAT,"READ_PGD_ISBA_n after READ_GRID:XLAT",PRECISION,ILUOUT,'NATURE')
+ CALL MPPDB_CHECK_SURFEX2D(IG%XLON,"READ_PGD_ISBA_n after READ_GRID:XLON",PRECISION,ILUOUT,'NATURE')
+ CALL MPPDB_CHECK_SURFEX2D(IG%XMESH_SIZE,"READ_PGD_ISBA_n after READ_GRID:XMESH_SIZE",PRECISION,ILUOUT,'NATURE')
+#endif
 !
 !* clay fraction : attention, seul un niveau est present dans le fichier
 !* on rempli tout les niveaux de  XCLAY avec les valeurs du fichiers
index 0d0dcdd..665fb41 100644 (file)
@@ -34,7 +34,7 @@
 !!    MODIFICATIONS
 !!    -------------
 !!      Original    01/2003 
-!!      M. Moge     02/2015 READ_SURF
+!!      M. Moge     02/2015 READ_SURF // + MPPDB_CHECK
 !-------------------------------------------------------------------------------
 !
 !*       0.    DECLARATIONS
@@ -66,6 +66,11 @@ USE MODI_GET_TYPE_DIM_n
 !
 USE MODI_READ_LECOCLIMAP
 !
+#ifdef MNH_PARALLEL
+USE MODI_GET_LUOUT
+USE MODE_MPPDB
+!
+#endif
 IMPLICIT NONE
 !
 !*       0.1   Declarations of arguments
@@ -83,6 +88,9 @@ TYPE(GRID_CONF_PROJ_t),INTENT(INOUT) :: GCP
 !              -------------------------------
 !
 INTEGER           :: IRESP          ! Error code after redding
+#ifdef MNH_PARALLEL
+INTEGER :: ILUOUT  ! output listing logical unit
+#endif
 !
  CHARACTER(LEN=LEN_HREC) :: YRECFM         ! Name of the article to be read
 INTEGER           :: IVERSION
@@ -94,6 +102,9 @@ REAL(KIND=JPRB) :: ZHOOK_HANDLE
 !* 1D physical dimension
 !
 IF (LHOOK) CALL DR_HOOK('READ_PGD_TEB_N',0,ZHOOK_HANDLE)
+#ifdef MNH_PARALLEL
+ CALL GET_LUOUT(HPROGRAM,ILUOUT)
+#endif
 YRECFM='SIZE_TOWN'
  CALL GET_TYPE_DIM_n(DTCO, U, &
                      'TOWN  ',TM%TG%NDIM)
@@ -208,6 +219,7 @@ ALLOCATE(TM%TOP%XCOVER(TM%TG%NDIM,COUNT(TM%TOP%LCOVER)))
 #ifdef MNH_PARALLEL
  CALL READ_SURF_COV(&
                     HPROGRAM,'COVER',TM%TOP%XCOVER(:,:),TM%TOP%LCOVER,IRESP,HDIR='H')
+ CALL MPPDB_CHECK_SURFEX3D(TM%TOP%XCOVER,"READ_PGD_TEB_n after READ_SURF:XCOVER",PRECISION,ILUOUT, 'TOWN  ',JPCOVER)
 #else
  CALL READ_SURF_COV(&
                     HPROGRAM,'COVER',TM%TOP%XCOVER(:,:),TM%TOP%LCOVER,IRESP)
index 5c8da7d..bdd156a 100644 (file)
-!SFX_LIC Copyright 1994-2014 CNRS, Meteo-France and Universite Paul Sabatier\r
-!SFX_LIC This is part of the SURFEX software governed by the CeCILL-C licence\r
-!SFX_LIC version 1. See LICENSE, CeCILL-C_V1-en.txt and CeCILL-C_V1-fr.txt  \r
-!SFX_LIC for details. version 1.\r
-!     #########\r
-      SUBROUTINE ZOOM_PGD_COVER (DTCO, UG, U,GCP, &\r
-                                 HPROGRAM,HINIFILE,HINIFILETYPE,OECOCLIMAP)\r
-!     ###########################################################\r
-\r
-!!\r
-!!    PURPOSE\r
-!!    -------\r
-!!   This program prepares the physiographic data fields.\r
-!!\r
-!!    METHOD\r
-!!    ------\r
-!!   \r
-!!    EXTERNAL\r
-!!    --------\r
-!!\r
-!!\r
-!!    IMPLICIT ARGUMENTS\r
-!!    ------------------\r
-!!\r
-!!\r
-!!    REFERENCE\r
-!!    ---------\r
-!!\r
-!!    AUTHOR\r
-!!    ------\r
-!!\r
-!!    V. Masson                   Meteo-France\r
-!!\r
-!!    MODIFICATION\r
-!!    ------------\r
-!!\r
-!!    Original     13/10/03\r
-!     Modification 17/04/12 M.Tomasini All COVER physiographic fields are now \r
-!!                                     interpolated for spawning => \r
-!!                                     ABOR1_SFX if (.NOT.OECOCLIMAP) in comment\r
-!     Modification 05/02/15 M.Moge : use NSIZE_FULL instead of SIZE(XLAT) (for clarity)\r
-!!      J.Escobar 18/12/2015 : missing interface\r
-!----------------------------------------------------------------------------\r
-!\r
-!*    0.     DECLARATION\r
-!            -----------\r
-!\r
-!\r
-!\r
-!\r
-USE MODD_DATA_COVER_n, ONLY : DATA_COVER_t\r
-USE MODD_SURF_ATM_GRID_n, ONLY : SURF_ATM_GRID_t\r
-USE MODD_SURF_ATM_n, ONLY : SURF_ATM_t\r
-USE MODD_GRID_CONF_PROJ, ONLY : GRID_CONF_PROJ_t\r
-!\r
-USE MODD_SURF_PAR, ONLY : XUNDEF\r
-USE MODD_DATA_COVER_PAR,   ONLY : JPCOVER\r
-USE MODD_PREP,             ONLY : CINGRID_TYPE, CINTERP_TYPE\r
-!\r
-USE MODE_READ_SURF_COV, ONLY : READ_SURF_COV\r
-!\r
-USE MODI_CONVERT_COVER_FRAC\r
-USE MODI_OPEN_AUX_IO_SURF\r
-USE MODI_READ_SURF\r
-USE MODI_CLOSE_AUX_IO_SURF\r
-USE MODI_PREP_GRID_EXTERN\r
-USE MODI_HOR_INTERPOL\r
-USE MODI_HOR_INTERPOL_1COV\r
-USE MODI_PREP_OUTPUT_GRID\r
-USE MODI_OLD_NAME\r
-USE MODI_SUM_ON_ALL_PROCS\r
-USE MODI_GET_LUOUT\r
-USE MODI_CLEAN_PREP_OUTPUT_GRID\r
-USE MODI_GET_1D_MASK\r
-USE MODI_READ_LCOVER\r
-#ifdef SFX_MNH\r
-USE MODI_READ_SURFX2COV_1COV_MNH\r
-#endif\r
-!\r
-USE YOMHOOK   ,ONLY : LHOOK,   DR_HOOK\r
-USE PARKIND1  ,ONLY : JPRB\r
-!\r
-IMPLICIT NONE\r
-!\r
-!*    0.1    Declaration of dummy arguments\r
-!            ------------------------------\r
-!\r
-!\r
-TYPE(DATA_COVER_t), INTENT(INOUT) :: DTCO\r
-TYPE(SURF_ATM_GRID_t), INTENT(INOUT) :: UG\r
-TYPE(SURF_ATM_t), INTENT(INOUT) :: U\r
-TYPE(GRID_CONF_PROJ_t),INTENT(INOUT) :: GCP\r
-!\r
- CHARACTER(LEN=6),     INTENT(IN)  :: HPROGRAM    ! program calling\r
- CHARACTER(LEN=28),    INTENT(IN)  :: HINIFILE    ! input atmospheric file name\r
- CHARACTER(LEN=6),     INTENT(IN)  :: HINIFILETYPE! input atmospheric file type\r
-LOGICAL,              INTENT(OUT) :: OECOCLIMAP  ! flag to use ecoclimap\r
-!\r
-!\r
-!*    0.2    Declaration of local variables\r
-!            ------------------------------\r
-!\r
-INTEGER :: ICPT1, ICPT2\r
-INTEGER :: IRESP\r
-INTEGER :: ILUOUT\r
-INTEGER :: INI     ! total 1D dimension (input grid)\r
-INTEGER :: IL      ! total 1D dimension (output grid)\r
-INTEGER :: JCOVER  ! loop counter\r
-INTEGER :: IVERSION       ! surface version\r
-#ifdef MNH_PARALLEL\r
-REAL, DIMENSION(:), POINTER     :: ZCOVER1D\r
-#endif\r
-REAL, DIMENSION(:,:), POINTER     :: ZCOVER\r
-REAL, DIMENSION(:,:), POINTER :: ZSEA1, ZWATER1, ZNATURE1, ZTOWN1\r
-REAL, DIMENSION(:,:), POINTER :: ZSEA2, ZWATER2, ZNATURE2, ZTOWN2\r
-REAL, DIMENSION(:),   ALLOCATABLE :: ZSUM\r
- CHARACTER(LEN=16) :: YRECFM         ! Name of the article to be read\r
- CHARACTER(LEN=100) :: YCOMMENT\r
-REAL(KIND=JPRB) :: ZHOOK_HANDLE\r
-!------------------------------------------------------------------------------\r
-IF (LHOOK) CALL DR_HOOK('ZOOM_PGD_COVER',0,ZHOOK_HANDLE)\r
- CALL GET_LUOUT(HPROGRAM,ILUOUT)\r
-!\r
-!*      1.     Preparation of IO for reading in the file\r
-!              -----------------------------------------\r
-!\r
-!* Note that all points are read, even those without physical meaning.\r
-!  These points will not be used during the horizontal interpolation step.\r
-!  Their value must be defined as XUNDEF.\r
-!\r
- CALL OPEN_AUX_IO_SURF(&\r
-                       HINIFILE,HINIFILETYPE,'FULL  ')\r
-!\r
- CALL READ_SURF(&\r
-                HPROGRAM,'ECOCLIMAP',OECOCLIMAP,IRESP)\r
-!\r
-!------------------------------------------------------------------------------\r
-!\r
-!*      2.     Reading of grid\r
-!              ---------------\r
-!\r
- CALL PREP_GRID_EXTERN(GCP,&\r
-                       HINIFILETYPE,ILUOUT,CINGRID_TYPE,CINTERP_TYPE,INI)\r
-!\r
- CALL PREP_OUTPUT_GRID(UG, U, &\r
-                       ILUOUT,UG%CGRID,UG%XGRID_PAR,UG%XLAT,UG%XLON)\r
-!\r
-!------------------------------------------------------------------------------\r
-!\r
-!*      3.     Reading of cover\r
-!              ----------------\r
-!\r
-YRECFM='VERSION'\r
- CALL READ_SURF(&\r
-                HPROGRAM,YRECFM,IVERSION,IRESP)\r
-!\r
-ALLOCATE(U%LCOVER(JPCOVER))\r
-!\r
-ALLOCATE(ZSEA1   (INI,1))\r
-ALLOCATE(ZNATURE1(INI,1))\r
-ALLOCATE(ZWATER1 (INI,1))\r
-ALLOCATE(ZTOWN1  (INI,1))\r
-!\r
-IF (IVERSION>=7) THEN\r
-  CALL READ_SURF(&\r
-                HPROGRAM,'FRAC_SEA   ',ZSEA1(:,1),   IRESP,HDIR='A')\r
-  CALL READ_SURF(&\r
-                HPROGRAM,'FRAC_NATURE',ZNATURE1(:,1),IRESP,HDIR='A')\r
-  CALL READ_SURF(&\r
-                HPROGRAM,'FRAC_WATER ',ZWATER1(:,1), IRESP,HDIR='A')\r
-  CALL READ_SURF(&\r
-                HPROGRAM,'FRAC_TOWN  ',ZTOWN1(:,1),  IRESP,HDIR='A')\r
-  CALL OLD_NAME(&\r
-                HPROGRAM,'COVER_LIST      ',YRECFM)\r
-  CALL READ_LCOVER(HPROGRAM,U%LCOVER)       \r
-#ifdef MNH_PARALLEL\r
-  ALLOCATE(ZCOVER1D(INI))\r
-#else\r
-  ALLOCATE(ZCOVER(INI,COUNT(U%LCOVER)))\r
- CALL READ_SURF_COV(&\r
-                    HPROGRAM,YRECFM,ZCOVER(:,:),U%LCOVER,IRESP,HDIR='A')\r
-  \r
-#endif\r
-      \r
-  !\r
-ELSE\r
-#ifdef MNH_PARALLEL\r
-  ! we assume that IVERSION>=7\r
-#else\r
- CALL OLD_NAME(&\r
-               HPROGRAM,'COVER_LIST      ',YRECFM)\r
- CALL READ_LCOVER(HPROGRAM,U%LCOVER) \r
- !\r
- ALLOCATE(ZCOVER(INI,COUNT(U%LCOVER)))\r
- CALL READ_SURF_COV(&\r
-                    HPROGRAM,YRECFM,ZCOVER(:,:),U%LCOVER,IRESP,HDIR='A')\r
-\r
-        \r
-  CALL CONVERT_COVER_FRAC(DTCO, &\r
-                          ZCOVER,U%LCOVER,ZSEA1(:,1),ZNATURE1(:,1),ZTOWN1(:,1),ZWATER1(:,1))\r
-#endif                  \r
-ENDIF\r
-!\r
-! CALL CLOSE_AUX_IO_SURF(HINIFILE,HINIFILETYPE)\r
-!------------------------------------------------------------------------------\r
-!\r
-!*      4.     Reading of cover & Interpolations\r
-!              --------------\r
-!\r
-IL = U%NSIZE_FULL\r
-ALLOCATE(U%XCOVER(IL,COUNT(U%LCOVER)))\r
-!\r
-! on lit les cover une apres l'autre, et on appelle hor_interpol sur chaque cover separement\r
-!\r
-#ifdef MNH_PARALLEL\r
-IF ( HPROGRAM == 'MESONH' ) THEN\r
-  ICPT1 = 0\r
-  DO JCOVER=1,JPCOVER\r
-    IF ( U%LCOVER( JCOVER ) ) THEN\r
-      ICPT1 = ICPT1 + 1\r
-      CALL READ_SURFX2COV_1COV_MNH(YRECFM,INI,JCOVER,ZCOVER1D(:),IRESP,YCOMMENT,'A')\r
-      CALL HOR_INTERPOL_1COV(DTCO, U,GCP,ILUOUT,ZCOVER1D,U%XCOVER(:,ICPT1))\r
-    ENDIF\r
-    !\r
-  ENDDO \r
-ENDIF\r
-DEALLOCATE(ZCOVER1D)\r
-#else\r
- CALL HOR_INTERPOL(DTCO, U,GCP, &\r
-                   ILUOUT,ZCOVER,U%XCOVER)\r
- DEALLOCATE(ZCOVER)           \r
-#endif           \r
-!\r
-ALLOCATE(ZCOVER(IL,COUNT(U%LCOVER)))\r
-ICPT1 = 0\r
-ICPT2 = 0\r
-DO JCOVER = 1,JPCOVER\r
-  IF (U%LCOVER(JCOVER)) THEN\r
-    ICPT1 = ICPT1 + 1\r
-    IF (ALL(U%XCOVER(:,ICPT1)==0.)) THEN\r
-      U%LCOVER(JCOVER) = .FALSE.\r
-    ELSE\r
-      ICPT2 = ICPT2 + 1\r
-      ZCOVER(:,ICPT2) = U%XCOVER(:,ICPT1)\r
-    ENDIF\r
-  ENDIF\r
-ENDDO\r
-!\r
-DEALLOCATE(U%XCOVER)\r
-ALLOCATE(U%XCOVER(IL,ICPT2))\r
-U%XCOVER(:,:) = ZCOVER(:,1:ICPT2)\r
-DEALLOCATE(ZCOVER)\r
-!\r
-CALL CLOSE_AUX_IO_SURF(HINIFILE,HINIFILETYPE)\r
-ALLOCATE(ZSEA2  (IL,1))\r
-ALLOCATE(ZNATURE2(IL,1))\r
-ALLOCATE(ZWATER2 (IL,1))\r
-ALLOCATE(ZTOWN2  (IL,1))\r
-!\r
- CALL HOR_INTERPOL(DTCO, U,GCP, &\r
-                   ILUOUT,ZSEA1,ZSEA2)\r
- CALL HOR_INTERPOL(DTCO, U,GCP, &\r
-                   ILUOUT,ZNATURE1,ZNATURE2)\r
- CALL HOR_INTERPOL(DTCO, U,GCP, &\r
-                   ILUOUT,ZWATER1,ZWATER2)\r
- CALL HOR_INTERPOL(DTCO, U,GCP, &\r
-                   ILUOUT,ZTOWN1,ZTOWN2)\r
-!\r
-DEALLOCATE(ZSEA1)\r
-DEALLOCATE(ZNATURE1)\r
-DEALLOCATE(ZWATER1)\r
-DEALLOCATE(ZTOWN1)\r
-!\r
-ALLOCATE(U%XSEA   (IL))\r
-ALLOCATE(U%XNATURE(IL))\r
-ALLOCATE(U%XWATER (IL))\r
-ALLOCATE(U%XTOWN  (IL))\r
-!\r
-U%XSEA(:)   = ZSEA2   (:,1)\r
-U%XNATURE(:)= ZNATURE2(:,1)\r
-U%XWATER(:) = ZWATER2 (:,1)\r
-U%XTOWN(:)  = ZTOWN2  (:,1)\r
-!\r
-DEALLOCATE(ZSEA2)\r
-DEALLOCATE(ZNATURE2)\r
-DEALLOCATE(ZWATER2)\r
-DEALLOCATE(ZTOWN2)\r
-!\r
- CALL CLEAN_PREP_OUTPUT_GRID\r
-!------------------------------------------------------------------------------\r
-!\r
-!*      5.     Coherence check\r
-!              ---------------\r
-! \r
-ALLOCATE(ZSUM(IL))\r
-ZSUM = 0.\r
-DO JCOVER=1,SIZE(U%XCOVER,2)\r
-  ZSUM(:) = ZSUM(:) + U%XCOVER(:,JCOVER)\r
-END DO\r
-!\r
-DO JCOVER=1,SIZE(U%XCOVER,2)\r
-  WHERE(ZSUM(:)/=0.)  U%XCOVER(:,JCOVER) = U%XCOVER(:,JCOVER)/ZSUM(:)\r
-END DO\r
-!\r
-DO JCOVER=1,SIZE(U%XCOVER,2)\r
-  IF (ALL(U%XCOVER(:,JCOVER)==0.)) U%LCOVER(JCOVER) = .FALSE.\r
-END DO\r
-!------------------------------------------------------------------------------\r
-!\r
-!*      6.     Fractions\r
-!              ---------\r
-!\r
-! When the model runs in multiproc, NSIZE* represents the number of points\r
-! on a proc, and NDIM* the total number of points on all procs.\r
-! The following definition of NDIM* won't be correct any more when the PGD\r
-! runs in multiproc.\r
-!\r
-U%NSIZE_NATURE    = COUNT(U%XNATURE(:) > 0.0)\r
-U%NSIZE_WATER     = COUNT(U%XWATER (:) > 0.0)\r
-U%NSIZE_SEA       = COUNT(U%XSEA   (:) > 0.0)\r
-U%NSIZE_TOWN      = COUNT(U%XTOWN  (:) > 0.0)\r
-U%NSIZE_FULL      = IL\r
-!\r
-U%NDIM_NATURE    = SUM_ON_ALL_PROCS(HPROGRAM,UG%CGRID,U%XNATURE(:) > 0., 'DIM')\r
-U%NDIM_WATER     = SUM_ON_ALL_PROCS(HPROGRAM,UG%CGRID,U%XWATER (:) > 0., 'DIM')\r
-U%NDIM_SEA       = SUM_ON_ALL_PROCS(HPROGRAM,UG%CGRID,U%XSEA   (:) > 0., 'DIM')\r
-U%NDIM_TOWN      = SUM_ON_ALL_PROCS(HPROGRAM,UG%CGRID,U%XTOWN  (:) > 0., 'DIM')\r
-ZSUM=1.\r
-U%NDIM_FULL      = SUM_ON_ALL_PROCS(HPROGRAM,UG%CGRID,ZSUM   (:) ==1., 'DIM')\r
-DEALLOCATE(ZSUM)\r
-!\r
-ALLOCATE(U%NR_NATURE (U%NSIZE_NATURE))\r
-ALLOCATE(U%NR_TOWN   (U%NSIZE_TOWN  ))\r
-ALLOCATE(U%NR_WATER  (U%NSIZE_WATER ))\r
-ALLOCATE(U%NR_SEA    (U%NSIZE_SEA   ))\r
-!\r
-IF (U%NSIZE_SEA   >0)CALL GET_1D_MASK( U%NSIZE_SEA,    U%NSIZE_FULL, U%XSEA   , U%NR_SEA   )\r
-IF (U%NSIZE_WATER >0)CALL GET_1D_MASK( U%NSIZE_WATER,  U%NSIZE_FULL, U%XWATER , U%NR_WATER )\r
-IF (U%NSIZE_TOWN  >0)CALL GET_1D_MASK( U%NSIZE_TOWN,   U%NSIZE_FULL, U%XTOWN  , U%NR_TOWN  )\r
-IF (U%NSIZE_NATURE>0)CALL GET_1D_MASK( U%NSIZE_NATURE, U%NSIZE_FULL, U%XNATURE, U%NR_NATURE)\r
-IF (LHOOK) CALL DR_HOOK('ZOOM_PGD_COVER',1,ZHOOK_HANDLE)\r
-\r
-!_______________________________________________________________________________\r
-!\r
-END SUBROUTINE ZOOM_PGD_COVER\r
+!SFX_LIC Copyright 1994-2014 CNRS, Meteo-France and Universite Paul Sabatier
+!SFX_LIC This is part of the SURFEX software governed by the CeCILL-C licence
+!SFX_LIC version 1. See LICENSE, CeCILL-C_V1-en.txt and CeCILL-C_V1-fr.txt  
+!SFX_LIC for details. version 1.
+!     #########
+      SUBROUTINE ZOOM_PGD_COVER (DTCO, UG, U,GCP, &
+                                 HPROGRAM,HINIFILE,HINIFILETYPE,OECOCLIMAP)
+!     ###########################################################
+
+!!
+!!    PURPOSE
+!!    -------
+!!   This program prepares the physiographic data fields.
+!!
+!!    METHOD
+!!    ------
+!!   
+!!    EXTERNAL
+!!    --------
+!!
+!!
+!!    IMPLICIT ARGUMENTS
+!!    ------------------
+!!
+!!
+!!    REFERENCE
+!!    ---------
+!!
+!!    AUTHOR
+!!    ------
+!!
+!!    V. Masson                   Meteo-France
+!!
+!!    MODIFICATION
+!!    ------------
+!!
+!!    Original     13/10/03
+!     Modification 17/04/12 M.Tomasini All COVER physiographic fields are now 
+!!                                     interpolated for spawning => 
+!!                                     ABOR1_SFX if (.NOT.OECOCLIMAP) in comment
+!     Modification 05/02/15 M.Moge : MPPDB_CHECK + use NSIZE_FULL instead of SIZE(XLAT) (for clarity)
+!!      J.Escobar 18/12/2015 : missing interface
+!----------------------------------------------------------------------------
+!
+!*    0.     DECLARATION
+!            -----------
+!
+!
+!
+!
+USE MODD_DATA_COVER_n, ONLY : DATA_COVER_t
+USE MODD_SURF_ATM_GRID_n, ONLY : SURF_ATM_GRID_t
+USE MODD_SURF_ATM_n, ONLY : SURF_ATM_t
+USE MODD_GRID_CONF_PROJ, ONLY : GRID_CONF_PROJ_t
+!
+USE MODD_SURF_PAR, ONLY : XUNDEF
+USE MODD_DATA_COVER_PAR,   ONLY : JPCOVER
+USE MODD_PREP,             ONLY : CINGRID_TYPE, CINTERP_TYPE
+!
+USE MODE_READ_SURF_COV, ONLY : READ_SURF_COV
+!
+USE MODI_CONVERT_COVER_FRAC
+USE MODI_OPEN_AUX_IO_SURF
+USE MODI_READ_SURF
+USE MODI_CLOSE_AUX_IO_SURF
+USE MODI_PREP_GRID_EXTERN
+USE MODI_HOR_INTERPOL
+USE MODI_HOR_INTERPOL_1COV
+USE MODI_PREP_OUTPUT_GRID
+USE MODI_OLD_NAME
+USE MODI_SUM_ON_ALL_PROCS
+USE MODI_GET_LUOUT
+USE MODI_CLEAN_PREP_OUTPUT_GRID
+USE MODI_GET_1D_MASK
+USE MODI_READ_LCOVER
+#ifdef SFX_MNH
+USE MODI_READ_SURFX2COV_1COV_MNH
+#endif
+!
+USE YOMHOOK   ,ONLY : LHOOK,   DR_HOOK
+USE PARKIND1  ,ONLY : JPRB
+!
+USE MODE_MPPDB
+!
+IMPLICIT NONE
+!
+!*    0.1    Declaration of dummy arguments
+!            ------------------------------
+!
+!
+TYPE(DATA_COVER_t), INTENT(INOUT) :: DTCO
+TYPE(SURF_ATM_GRID_t), INTENT(INOUT) :: UG
+TYPE(SURF_ATM_t), INTENT(INOUT) :: U
+TYPE(GRID_CONF_PROJ_t),INTENT(INOUT) :: GCP
+!
+ CHARACTER(LEN=6),     INTENT(IN)  :: HPROGRAM    ! program calling
+ CHARACTER(LEN=28),    INTENT(IN)  :: HINIFILE    ! input atmospheric file name
+ CHARACTER(LEN=6),     INTENT(IN)  :: HINIFILETYPE! input atmospheric file type
+LOGICAL,              INTENT(OUT) :: OECOCLIMAP  ! flag to use ecoclimap
+!
+!
+!*    0.2    Declaration of local variables
+!            ------------------------------
+!
+INTEGER :: ICPT1, ICPT2
+INTEGER :: IRESP
+INTEGER :: ILUOUT
+INTEGER :: INI     ! total 1D dimension (input grid)
+INTEGER :: IL      ! total 1D dimension (output grid)
+INTEGER :: JCOVER  ! loop counter
+INTEGER :: IVERSION       ! surface version
+#ifdef MNH_PARALLEL
+REAL, DIMENSION(:), POINTER     :: ZCOVER1D
+#endif
+REAL, DIMENSION(:,:), POINTER     :: ZCOVER
+REAL, DIMENSION(:,:), POINTER :: ZSEA1, ZWATER1, ZNATURE1, ZTOWN1
+REAL, DIMENSION(:,:), POINTER :: ZSEA2, ZWATER2, ZNATURE2, ZTOWN2
+REAL, DIMENSION(:),   ALLOCATABLE :: ZSUM
+ CHARACTER(LEN=16) :: YRECFM         ! Name of the article to be read
+ CHARACTER(LEN=100) :: YCOMMENT
+REAL(KIND=JPRB) :: ZHOOK_HANDLE
+!------------------------------------------------------------------------------
+IF (LHOOK) CALL DR_HOOK('ZOOM_PGD_COVER',0,ZHOOK_HANDLE)
+ CALL GET_LUOUT(HPROGRAM,ILUOUT)
+!
+!*      1.     Preparation of IO for reading in the file
+!              -----------------------------------------
+!
+!* Note that all points are read, even those without physical meaning.
+!  These points will not be used during the horizontal interpolation step.
+!  Their value must be defined as XUNDEF.
+!
+ CALL OPEN_AUX_IO_SURF(&
+                       HINIFILE,HINIFILETYPE,'FULL  ')
+!
+ CALL READ_SURF(&
+                HPROGRAM,'ECOCLIMAP',OECOCLIMAP,IRESP)
+!
+!------------------------------------------------------------------------------
+!
+!*      2.     Reading of grid
+!              ---------------
+!
+ CALL PREP_GRID_EXTERN(GCP,&
+                       HINIFILETYPE,ILUOUT,CINGRID_TYPE,CINTERP_TYPE,INI)
+!
+ CALL PREP_OUTPUT_GRID(UG, U, &
+                       ILUOUT,UG%CGRID,UG%XGRID_PAR,UG%XLAT,UG%XLON)
+ CALL MPPDB_CHECK_SURFEX2D(UG%XLAT,"ZOOM_PGD_COVER:XLAT",PRECISION,ILUOUT)
+ CALL MPPDB_CHECK_SURFEX2D(UG%XLON,"ZOOM_PGD_COVER:XLON",PRECISION,ILUOUT)
+!
+!------------------------------------------------------------------------------
+!
+!*      3.     Reading of cover
+!              ----------------
+!
+YRECFM='VERSION'
+ CALL READ_SURF(&
+                HPROGRAM,YRECFM,IVERSION,IRESP)
+!
+ALLOCATE(U%LCOVER(JPCOVER))
+!
+ALLOCATE(ZSEA1   (INI,1))
+ALLOCATE(ZNATURE1(INI,1))
+ALLOCATE(ZWATER1 (INI,1))
+ALLOCATE(ZTOWN1  (INI,1))
+!
+IF (IVERSION>=7) THEN
+  CALL READ_SURF(&
+                HPROGRAM,'FRAC_SEA   ',ZSEA1(:,1),   IRESP,HDIR='A')
+  CALL READ_SURF(&
+                HPROGRAM,'FRAC_NATURE',ZNATURE1(:,1),IRESP,HDIR='A')
+  CALL READ_SURF(&
+                HPROGRAM,'FRAC_WATER ',ZWATER1(:,1), IRESP,HDIR='A')
+  CALL READ_SURF(&
+                HPROGRAM,'FRAC_TOWN  ',ZTOWN1(:,1),  IRESP,HDIR='A')
+  CALL OLD_NAME(&
+                HPROGRAM,'COVER_LIST      ',YRECFM)
+  CALL READ_LCOVER(HPROGRAM,U%LCOVER)       
+#ifdef MNH_PARALLEL
+  ALLOCATE(ZCOVER1D(INI))
+#else
+  ALLOCATE(ZCOVER(INI,COUNT(U%LCOVER)))
+ CALL READ_SURF_COV(&
+                    HPROGRAM,YRECFM,ZCOVER(:,:),U%LCOVER,IRESP,HDIR='A')
+  
+#endif
+      
+  !
+ELSE
+#ifdef MNH_PARALLEL
+  ! we assume that IVERSION>=7
+#else
+ CALL OLD_NAME(&
+               HPROGRAM,'COVER_LIST      ',YRECFM)
+ CALL READ_LCOVER(HPROGRAM,U%LCOVER) 
+ !
+ ALLOCATE(ZCOVER(INI,COUNT(U%LCOVER)))
+ CALL READ_SURF_COV(&
+                    HPROGRAM,YRECFM,ZCOVER(:,:),U%LCOVER,IRESP,HDIR='A')
+
+        
+  CALL CONVERT_COVER_FRAC(DTCO, &
+                          ZCOVER,U%LCOVER,ZSEA1(:,1),ZNATURE1(:,1),ZTOWN1(:,1),ZWATER1(:,1))
+#endif                  
+ENDIF
+!
+! CALL CLOSE_AUX_IO_SURF(HINIFILE,HINIFILETYPE)
+!------------------------------------------------------------------------------
+!
+!*      4.     Reading of cover & Interpolations
+!              --------------
+!
+IL = U%NSIZE_FULL
+ALLOCATE(U%XCOVER(IL,COUNT(U%LCOVER)))
+!
+! on lit les cover une apres l'autre, et on appelle hor_interpol sur chaque cover separement
+!
+#ifdef MNH_PARALLEL
+IF ( HPROGRAM == 'MESONH' ) THEN
+  ICPT1 = 0
+  DO JCOVER=1,JPCOVER
+    IF ( U%LCOVER( JCOVER ) ) THEN
+      ICPT1 = ICPT1 + 1
+      CALL READ_SURFX2COV_1COV_MNH(YRECFM,INI,JCOVER,ZCOVER1D(:),IRESP,YCOMMENT,'A')
+      CALL HOR_INTERPOL_1COV(DTCO, U,GCP,ILUOUT,ZCOVER1D,U%XCOVER(:,ICPT1))
+    CALL MPPDB_CHECK_SURFEX3D(U%XCOVER,"ZOOM_PGD_COVER:XCOVER",PRECISION,ILUOUT,'FULL',JPCOVER)
+    ENDIF
+    !
+  ENDDO 
+ENDIF
+DEALLOCATE(ZCOVER1D)
+#else
+ CALL HOR_INTERPOL(DTCO, U,GCP, &
+                   ILUOUT,ZCOVER,U%XCOVER)
+ DEALLOCATE(ZCOVER)           
+#endif           
+!
+ALLOCATE(ZCOVER(IL,COUNT(U%LCOVER)))
+ICPT1 = 0
+ICPT2 = 0
+DO JCOVER = 1,JPCOVER
+  IF (U%LCOVER(JCOVER)) THEN
+    ICPT1 = ICPT1 + 1
+    IF (ALL(U%XCOVER(:,ICPT1)==0.)) THEN
+      U%LCOVER(JCOVER) = .FALSE.
+    ELSE
+      ICPT2 = ICPT2 + 1
+      ZCOVER(:,ICPT2) = U%XCOVER(:,ICPT1)
+    ENDIF
+  ENDIF
+ENDDO
+!
+DEALLOCATE(U%XCOVER)
+ALLOCATE(U%XCOVER(IL,ICPT2))
+U%XCOVER(:,:) = ZCOVER(:,1:ICPT2)
+DEALLOCATE(ZCOVER)
+!
+CALL CLOSE_AUX_IO_SURF(HINIFILE,HINIFILETYPE)
+ALLOCATE(ZSEA2  (IL,1))
+ALLOCATE(ZNATURE2(IL,1))
+ALLOCATE(ZWATER2 (IL,1))
+ALLOCATE(ZTOWN2  (IL,1))
+!
+ CALL HOR_INTERPOL(DTCO, U,GCP, &
+                   ILUOUT,ZSEA1,ZSEA2)
+ CALL HOR_INTERPOL(DTCO, U,GCP, &
+                   ILUOUT,ZNATURE1,ZNATURE2)
+ CALL HOR_INTERPOL(DTCO, U,GCP, &
+                   ILUOUT,ZWATER1,ZWATER2)
+ CALL HOR_INTERPOL(DTCO, U,GCP, &
+                   ILUOUT,ZTOWN1,ZTOWN2)
+!
+DEALLOCATE(ZSEA1)
+DEALLOCATE(ZNATURE1)
+DEALLOCATE(ZWATER1)
+DEALLOCATE(ZTOWN1)
+!
+ALLOCATE(U%XSEA   (IL))
+ALLOCATE(U%XNATURE(IL))
+ALLOCATE(U%XWATER (IL))
+ALLOCATE(U%XTOWN  (IL))
+!
+U%XSEA(:)   = ZSEA2   (:,1)
+U%XNATURE(:)= ZNATURE2(:,1)
+U%XWATER(:) = ZWATER2 (:,1)
+U%XTOWN(:)  = ZTOWN2  (:,1)
+!
+DEALLOCATE(ZSEA2)
+DEALLOCATE(ZNATURE2)
+DEALLOCATE(ZWATER2)
+DEALLOCATE(ZTOWN2)
+!
+ CALL CLEAN_PREP_OUTPUT_GRID
+!------------------------------------------------------------------------------
+!
+!*      5.     Coherence check
+!              ---------------
+! 
+ALLOCATE(ZSUM(IL))
+ZSUM = 0.
+DO JCOVER=1,SIZE(U%XCOVER,2)
+  ZSUM(:) = ZSUM(:) + U%XCOVER(:,JCOVER)
+END DO
+CALL MPPDB_CHECK_SURFEX2D(ZSUM,"ZOOM_PGD_COVER:ZSUM",PRECISION,ILUOUT)
+!
+DO JCOVER=1,SIZE(U%XCOVER,2)
+  WHERE(ZSUM(:)/=0.)  U%XCOVER(:,JCOVER) = U%XCOVER(:,JCOVER)/ZSUM(:)
+END DO
+!
+DO JCOVER=1,SIZE(U%XCOVER,2)
+  IF (ALL(U%XCOVER(:,JCOVER)==0.)) U%LCOVER(JCOVER) = .FALSE.
+END DO
+!------------------------------------------------------------------------------
+!
+!*      6.     Fractions
+!              ---------
+!
+! When the model runs in multiproc, NSIZE* represents the number of points
+! on a proc, and NDIM* the total number of points on all procs.
+! The following definition of NDIM* won't be correct any more when the PGD
+! runs in multiproc.
+!
+U%NSIZE_NATURE    = COUNT(U%XNATURE(:) > 0.0)
+U%NSIZE_WATER     = COUNT(U%XWATER (:) > 0.0)
+U%NSIZE_SEA       = COUNT(U%XSEA   (:) > 0.0)
+U%NSIZE_TOWN      = COUNT(U%XTOWN  (:) > 0.0)
+U%NSIZE_FULL      = IL
+!
+U%NDIM_NATURE    = SUM_ON_ALL_PROCS(HPROGRAM,UG%CGRID,U%XNATURE(:) > 0., 'DIM')
+U%NDIM_WATER     = SUM_ON_ALL_PROCS(HPROGRAM,UG%CGRID,U%XWATER (:) > 0., 'DIM')
+U%NDIM_SEA       = SUM_ON_ALL_PROCS(HPROGRAM,UG%CGRID,U%XSEA   (:) > 0., 'DIM')
+U%NDIM_TOWN      = SUM_ON_ALL_PROCS(HPROGRAM,UG%CGRID,U%XTOWN  (:) > 0., 'DIM')
+ZSUM=1.
+U%NDIM_FULL      = SUM_ON_ALL_PROCS(HPROGRAM,UG%CGRID,ZSUM   (:) ==1., 'DIM')
+DEALLOCATE(ZSUM)
+!
+ALLOCATE(U%NR_NATURE (U%NSIZE_NATURE))
+ALLOCATE(U%NR_TOWN   (U%NSIZE_TOWN  ))
+ALLOCATE(U%NR_WATER  (U%NSIZE_WATER ))
+ALLOCATE(U%NR_SEA    (U%NSIZE_SEA   ))
+!
+IF (U%NSIZE_SEA   >0)CALL GET_1D_MASK( U%NSIZE_SEA,    U%NSIZE_FULL, U%XSEA   , U%NR_SEA   )
+IF (U%NSIZE_WATER >0)CALL GET_1D_MASK( U%NSIZE_WATER,  U%NSIZE_FULL, U%XWATER , U%NR_WATER )
+IF (U%NSIZE_TOWN  >0)CALL GET_1D_MASK( U%NSIZE_TOWN,   U%NSIZE_FULL, U%XTOWN  , U%NR_TOWN  )
+IF (U%NSIZE_NATURE>0)CALL GET_1D_MASK( U%NSIZE_NATURE, U%NSIZE_FULL, U%XNATURE, U%NR_NATURE)
+CALL MPPDB_CHECK_SURFEX2D(U%XSEA,"ZOOM_PGD_COVER:XSEA",PRECISION,ILUOUT)
+CALL MPPDB_CHECK_SURFEX2D(U%XWATER,"ZOOM_PGD_COVER:XWATER",PRECISION,ILUOUT)
+CALL MPPDB_CHECK_SURFEX2D(U%XTOWN,"ZOOM_PGD_COVER:XTOWN",PRECISION,ILUOUT)
+CALL MPPDB_CHECK_SURFEX2D(U%XNATURE,"ZOOM_PGD_COVER:XNATURE",PRECISION,ILUOUT)
+IF (LHOOK) CALL DR_HOOK('ZOOM_PGD_COVER',1,ZHOOK_HANDLE)
+
+!_______________________________________________________________________________
+!
+END SUBROUTINE ZOOM_PGD_COVER
index fa20975..83c6c0a 100644 (file)
@@ -37,6 +37,7 @@
 !!    Original     13/10/03
 !!    B. Decharme      2008  XWDRAIN
 !!    M.Tomasini    17/04/12  Add interpolation for ISBA variables (MODD_DATA_ISBA_n)
+!     M.Moge        05/02/15  MPPDB_CHECK
 !----------------------------------------------------------------------------
 !
 !*    0.     DECLARATION
@@ -76,6 +77,10 @@ USE MODI_PACK_PGD_ISBA
 USE YOMHOOK   ,ONLY : LHOOK,   DR_HOOK
 USE PARKIND1  ,ONLY : JPRB
 !
+#ifdef MNH_PARALLEL
+USE MODE_MPPDB
+!
+#endif
 IMPLICIT NONE
 !
 !*    0.1    Declaration of dummy arguments
@@ -238,7 +243,14 @@ ALLOCATE(I%XZ0EFFJPDIR(ILU))
                HPROGRAM, 'NATURE',                    &
                 IG%CGRID,  IG%XGRID_PAR,                     &
                 I%LCOVER, I%XCOVER, I%XZS,                   &
-                IG%XLAT, IG%XLON, IG%XMESH_SIZE, I%XZ0EFFJPDIR    )  
+                IG%XLAT, IG%XLON, IG%XMESH_SIZE, I%XZ0EFFJPDIR    ) 
+#ifdef MNH_PARALLEL
+ CALL MPPDB_CHECK_SURFEX3D(I%XCOVER,"ZOOM_PGD_ISBA:XCOVER",PRECISION,ILUOUT,'NATURE',JPCOVER)
+ CALL MPPDB_CHECK_SURFEX2D(IG%XLAT,"ZOOM_PGD_ISBA:XLAT",PRECISION,ILUOUT,'NATURE')
+ CALL MPPDB_CHECK_SURFEX2D(IG%XLON,"ZOOM_PGD_ISBA:XLON",PRECISION,ILUOUT,'NATURE')
+ CALL MPPDB_CHECK_SURFEX2D(IG%XMESH_SIZE,"ZOOM_PGD_ISBA:XMESH_SIZE",PRECISION,ILUOUT,'NATURE')
+ CALL MPPDB_CHECK_SURFEX2D(I%XZ0EFFJPDIR,"ZOOM_PGD_ISBA:XZ0EFFJPDIR",PRECISION,ILUOUT,'NATURE') 
+#endif
 !
 !------------------------------------------------------------------------------
 !
@@ -251,6 +263,12 @@ ALLOCATE(I%XRUNOFFB(ILU))
 ALLOCATE(I%XWDRAIN (ILU))
  CALL ZOOM_PGD_ISBA_FULL(CHI, DTCO, DTI, IG, I, UG, U, GCP,&
                          HPROGRAM,HINIFILE,HINIFILETYPE)
+#ifdef MNH_PARALLEL
+ CALL MPPDB_CHECK_SURFEX3D(I%XSAND,"ZOOM_PGD_ISBA:XSAND",PRECISION,ILUOUT,'NATURE',I%NGROUND_LAYER)
+ CALL MPPDB_CHECK_SURFEX3D(I%XCLAY,"ZOOM_PGD_ISBA:XCLAY",PRECISION,ILUOUT,'NATURE',I%NGROUND_LAYER)
+ CALL MPPDB_CHECK_SURFEX2D(I%XRUNOFFB,"ZOOM_PGD_ISBA:XRUNOFFB",PRECISION,ILUOUT,'NATURE')
+ CALL MPPDB_CHECK_SURFEX2D(I%XWDRAIN,"ZOOM_PGD_ISBA:XWDRAIN",PRECISION,ILUOUT,'NATURE')
+#endif
 !
 !-------------------------------------------------------------------------------
 !
@@ -280,6 +298,17 @@ ALLOCATE(ZSSO_SLOPE(IL))
                      ZAOSIP, ZAOSIM, ZAOSJP, ZAOSJM,              &
                      ZHO2IP, ZHO2IM, ZHO2JP, ZHO2JM,              &
                      ZSSO_SLOPE                                   )  
+#ifdef MNH_PARALLEL
+ CALL MPPDB_CHECK_SURFEX2D(ZAOSIP,"ZOOM_PGD_ISBA:ZAOSIP",PRECISION,ILUOUT)
+ CALL MPPDB_CHECK_SURFEX2D(ZAOSIM,"ZOOM_PGD_ISBA:ZAOSIM",PRECISION,ILUOUT)
+ CALL MPPDB_CHECK_SURFEX2D(ZAOSJP,"ZOOM_PGD_ISBA:ZAOSJP",PRECISION,ILUOUT)
+ CALL MPPDB_CHECK_SURFEX2D(ZAOSJM,"ZOOM_PGD_ISBA:ZAOSJM",PRECISION,ILUOUT)
+ CALL MPPDB_CHECK_SURFEX2D(ZHO2IP,"ZOOM_PGD_ISBA:ZHO2IP",PRECISION,ILUOUT)
+ CALL MPPDB_CHECK_SURFEX2D(ZHO2IM,"ZOOM_PGD_ISBA:ZHO2IM",PRECISION,ILUOUT)
+ CALL MPPDB_CHECK_SURFEX2D(ZHO2JP,"ZOOM_PGD_ISBA:ZHO2JP",PRECISION,ILUOUT)
+ CALL MPPDB_CHECK_SURFEX2D(ZHO2JM,"ZOOM_PGD_ISBA:ZHO2JM",PRECISION,ILUOUT)
+ CALL MPPDB_CHECK_SURFEX2D(ZSSO_SLOPE,"ZOOM_PGD_ISBA:ZSSO_SLOPE",PRECISION,ILUOUT)
+#endif
 !
 DEALLOCATE(ZAOSIP)
 DEALLOCATE(ZAOSIM)
index 6f21dd2..e24b8aa 100644 (file)
@@ -70,6 +70,11 @@ USE PARKIND1  ,ONLY : JPRB
 USE MODI_CLEAN_PREP_OUTPUT_GRID
 !
 USE MODI_GET_LUOUT
+!
+#ifdef MNH_PARALLEL
+USE MODE_MPPDB
+!
+#endif
 IMPLICIT NONE
 !
 !*    0.1    Declaration of dummy arguments
@@ -144,6 +149,10 @@ IF (LHOOK) CALL DR_HOOK('ZOOM_PGD_OROGRAPHY',0,ZHOOK_HANDLE)
 !
  CALL PREP_OUTPUT_GRID(UG, U, &
                        ILUOUT,UG%CGRID,UG%XGRID_PAR,UG%XLAT,UG%XLON)
+#ifdef MNH_PARALLEL
+ CALL MPPDB_CHECK_SURFEX2D(UG%XLAT,"ZOOM_PGD_OROGRAPHY:XLAT",PRECISION,ILUOUT)
+ CALL MPPDB_CHECK_SURFEX2D(UG%XLON,"ZOOM_PGD_OROGRAPHY:XLON",PRECISION,ILUOUT)
+#endif
 !
 !------------------------------------------------------------------------------
 !
@@ -316,6 +325,26 @@ WHERE (PWATER(:)==1.)
   USS%XAOSJP(:) = 0.
   USS%XAOSJM(:) = 0.
 END WHERE
+#ifdef MNH_PARALLEL
+CALL MPPDB_CHECK_SURFEX2D(U%XZS,"ZOOM_PGD_OROGRAPHY:XZS",PRECISION,ILUOUT)
+CALL MPPDB_CHECK_SURFEX2D(USS%XAVG_ZS,"ZOOM_PGD_OROGRAPHY:XAVG_ZS",PRECISION,ILUOUT)
+CALL MPPDB_CHECK_SURFEX2D(USS%XSIL_ZS,"ZOOM_PGD_OROGRAPHY:XSIL_ZS",PRECISION,ILUOUT)
+CALL MPPDB_CHECK_SURFEX2D(USS%XSSO_STDEV,"ZOOM_PGD_OROGRAPHY:XSSO_STDEV",PRECISION,ILUOUT)
+CALL MPPDB_CHECK_SURFEX2D(USS%XMIN_ZS,"ZOOM_PGD_OROGRAPHY:XMIN_ZS",PRECISION,ILUOUT)
+CALL MPPDB_CHECK_SURFEX2D(USS%XMAX_ZS,"ZOOM_PGD_OROGRAPHY:XMAX_ZS",PRECISION,ILUOUT)
+CALL MPPDB_CHECK_SURFEX2D(USS%XSSO_ANIS,"ZOOM_PGD_OROGRAPHY:XSSO_ANIS",PRECISION,ILUOUT)
+CALL MPPDB_CHECK_SURFEX2D(USS%XSSO_DIR,"ZOOM_PGD_OROGRAPHY:XSSO_DIR",PRECISION,ILUOUT)
+CALL MPPDB_CHECK_SURFEX2D(USS%XSSO_SLOPE,"ZOOM_PGD_OROGRAPHY:XSSO_SLOPE",PRECISION,ILUOUT)
+CALL MPPDB_CHECK_SURFEX2D(USS%XAOSIP,"ZOOM_PGD_OROGRAPHY:XAOSIP",PRECISION,ILUOUT)
+CALL MPPDB_CHECK_SURFEX2D(USS%XAOSIM,"ZOOM_PGD_OROGRAPHY:XAOSIM",PRECISION,ILUOUT)
+CALL MPPDB_CHECK_SURFEX2D(USS%XAOSJP,"ZOOM_PGD_OROGRAPHY:XAOSJP",PRECISION,ILUOUT)
+CALL MPPDB_CHECK_SURFEX2D(USS%XAOSJM,"ZOOM_PGD_OROGRAPHY:XAOSJM",PRECISION,ILUOUT)
+CALL MPPDB_CHECK_SURFEX2D(USS%XHO2IP,"ZOOM_PGD_OROGRAPHY:XHO2IP",PRECISION,ILUOUT)
+CALL MPPDB_CHECK_SURFEX2D(USS%XHO2IM,"ZOOM_PGD_OROGRAPHY:XHO2IM",PRECISION,ILUOUT)
+CALL MPPDB_CHECK_SURFEX2D(USS%XHO2JP,"ZOOM_PGD_OROGRAPHY:XHO2JP",PRECISION,ILUOUT)
+CALL MPPDB_CHECK_SURFEX2D(USS%XHO2JM,"ZOOM_PGD_OROGRAPHY:XHO2JM",PRECISION,ILUOUT)
+!
+#endif
 ! go back to child model
  CALL GOTO_MODEL_MNH(U,HPROGRAM, 2, IINFO_ll)
 !_______________________________________________________________________________
index 05a68fd..11c7219 100644 (file)
@@ -36,6 +36,7 @@
 !!    Original    09/2008
 !!    G. TANGUY   03/2009 : add reading and interpolation of XDATA_SST and 
 !!                          TDATA_SST in the case LDATA_SST=T
+!     Modification 05/02/15 M.Moge : MPPDB_CHECK
 !!
 !----------------------------------------------------------------------------
 !
@@ -73,6 +74,10 @@ USE MODI_CLEAN_PREP_OUTPUT_GRID
 USE YOMHOOK   ,ONLY : LHOOK,   DR_HOOK
 USE PARKIND1  ,ONLY : JPRB
 !
+#ifdef MNH_PARALLEL
+USE MODE_MPPDB
+!
+#endif
 IMPLICIT NONE
 !
 !*    0.1    Declaration of arguments
@@ -142,7 +147,12 @@ ALLOCATE(SG%XMESH_SIZE (SG%NDIM))
                HPROGRAM, 'SEA   ',                      &
                 SG%CGRID,  SG%XGRID_PAR, S%LCOVER,             &
                 S%XCOVER, S%XZS,                           &
-                SG%XLAT, SG%XLON, SG%XMESH_SIZE                 )  
+                SG%XLAT, SG%XLON, SG%XMESH_SIZE                 ) 
+#ifdef MNH_PARALLEL 
+ CALL MPPDB_CHECK_SURFEX3D(S%XCOVER,"ZOOM_PGD_SEAFLUX:XCOVER",PRECISION,ILUOUT, 'SEA',JPCOVER)
+ CALL MPPDB_CHECK_SURFEX2D(SG%XMESH_SIZE,"ZOOM_PGD_SEAFLUX:XMESH_SIZE",PRECISION,ILUOUT, 'SEA')
+ CALL MPPDB_CHECK_SURFEX2D(S%XZS,"ZOOM_PGD_SEAFLUX:XZS",PRECISION,ILUOUT, 'SEA')
+#endif
 !
 !------------------------------------------------------------------------------
 !
@@ -154,6 +164,10 @@ ALLOCATE(SG%XMESH_SIZE (SG%NDIM))
 !
  CALL PREP_OUTPUT_GRID(UG, U, &
                        ILUOUT,SG%CGRID,SG%XGRID_PAR,SG%XLAT,SG%XLON)
+#ifdef MNH_PARALLEL
+ CALL MPPDB_CHECK_SURFEX2D(SG%XLAT,"ZOOM_PGD_SEAFLUX:XLAT",PRECISION,ILUOUT, 'SEA')
+ CALL MPPDB_CHECK_SURFEX2D(SG%XLON,"ZOOM_PGD_SEAFLUX:XLON",PRECISION,ILUOUT, 'SEA')
+#endif
 !
 !* mask where interpolations must be done
 !
index 43271ee..0902485 100644 (file)
@@ -37,6 +37,7 @@
 !!    ------------
 !!
 !!    Original     13/10/03
+!     Modification 05/02/15 M.Moge : MPPDB_CHECK
 !----------------------------------------------------------------------------
 !
 !*    0.     DECLARATION
@@ -87,6 +88,9 @@ USE MODI_GOTO_WRAPPER_TEB_PATCH
 USE YOMHOOK   ,ONLY : LHOOK,   DR_HOOK
 USE PARKIND1  ,ONLY : JPRB
 !
+#ifdef MNH_PARALLEL
+USE MODE_MPPDB
+#endif
 !
 IMPLICIT NONE
 !
@@ -181,7 +185,14 @@ ALLOCATE(TG%XMESH_SIZE (ILU))
                HPROGRAM, 'TOWN  ',                      &
                 TG%CGRID,  TG%XGRID_PAR,                     &
                 TOP%LCOVER, TOP%XCOVER, TOP%XZS,                   &
-                TG%XLAT, TG%XLON, TG%XMESH_SIZE                 )  
+                TG%XLAT, TG%XLON, TG%XMESH_SIZE                 )
+#ifdef MNH_PARALLEL
+ CALL MPPDB_CHECK_SURFEX3D(TOP%XCOVER,"ZOOM_PGD_TEB:XCOVER",PRECISION,ILUOUT, 'TOWN  ',JPCOVER)
+ CALL MPPDB_CHECK_SURFEX2D(TG%XLAT,"ZOOM_PGD_TEB:XLAT",PRECISION,ILUOUT, 'TOWN  ')
+ CALL MPPDB_CHECK_SURFEX2D(TG%XLON,"ZOOM_PGD_TEB:XLON",PRECISION,ILUOUT, 'TOWN  ')
+ CALL MPPDB_CHECK_SURFEX2D(TG%XMESH_SIZE,"ZOOM_PGD_TEB:XMESH_SIZE",PRECISION,ILUOUT, 'TOWN  ')
+ CALL MPPDB_CHECK_SURFEX2D(TOP%XZS,"ZOOM_PGD_TEB:XZS",PRECISION,ILUOUT, 'TOWN  ')  
+#endif
 !
 TG%NDIM = ILU
 !
@@ -200,6 +211,10 @@ TG%NDIM = ILU
 !
  CALL PREP_OUTPUT_GRID(UG, U, &
                        ILUOUT,TG%CGRID,TG%XGRID_PAR,TG%XLAT,TG%XLON)
+#ifdef MNH_PARALLEL
+ CALL MPPDB_CHECK_SURFEX2D(TG%XLAT,"ZOOM_PGD_TEB:XLAT",PRECISION,ILUOUT, 'TOWN  ')
+ CALL MPPDB_CHECK_SURFEX2D(TG%XLON,"ZOOM_PGD_TEB:XLON",PRECISION,ILUOUT, 'TOWN  ')
+#endif
 !
 !
 !------------------------------------------------------------------------------
@@ -317,6 +332,9 @@ END DO
 ALLOCATE(TGDP%XSAND(ILU,TGDO%NGROUND_LAYER))
  CALL HOR_INTERPOL(DTCO, U,GCP, &
                    ILUOUT,ZIN,TGDP%XSAND)
+#ifdef MNH_PARALLEL
+ CALL MPPDB_CHECK_SURFEX3D(TGDP%XSAND,"ZOOM_PGD_TEB_GARDEB:XSAND",PRECISION,ILUOUT, 'TOWN  ',TGDO%NGROUND_LAYER)
+#endif
 DEALLOCATE(ZIN)
 !
 !* clay
@@ -332,6 +350,9 @@ END DO
 ALLOCATE(TGDP%XCLAY(ILU,TGDO%NGROUND_LAYER))
  CALL HOR_INTERPOL(DTCO, U,GCP, &
                    ILUOUT,ZIN,TGDP%XCLAY)
+#ifdef MNH_PARALLEL
+ CALL MPPDB_CHECK_SURFEX3D(TGDP%XCLAY,"ZOOM_PGD_TEB_GARDEB:XCLAY",PRECISION,ILUOUT, 'TOWN  ',TGDO%NGROUND_LAYER)
+#endif
 DEALLOCATE(ZIN)
 !
 !* runoff & drainage
@@ -345,6 +366,9 @@ ZIN(:,1) = ZFIELD(:)
 ALLOCATE(TGDP%XRUNOFFB(ILU))
  CALL HOR_INTERPOL(DTCO, U,GCP, &
                    ILUOUT,ZIN,ZOUT)
+#ifdef MNH_PARALLEL
+ CALL MPPDB_CHECK_SURFEX3D(ZOUT,"ZOOM_PGD_TEB_GARDEB:ZOUT",PRECISION,ILUOUT, 'TOWN  ',1)
+#endif
 TGDP%XRUNOFFB(:) = ZOUT(:,1)
 !
 IF (IVERSION<=3) THEN
@@ -358,6 +382,9 @@ ELSE
  ALLOCATE(TGDP%XWDRAIN(ILU))
  CALL HOR_INTERPOL(DTCO, U,GCP, &
                    ILUOUT,ZIN,ZOUT)
+#ifdef MNH_PARALLEL
+ CALL MPPDB_CHECK_SURFEX3D(ZOUT,"ZOOM_PGD_TEB_GARDEB:ZOUT",PRECISION,ILUOUT, 'TOWN  ',1)
+#endif
  TGDP%XWDRAIN(:) = ZOUT(:,1)
 ENDIF
 !