From ff0f8afbc8983f0de8f60008c6e5c7b791487639 Mon Sep 17 00:00:00 2001
From: Juan Escobar <escj@aero.obs-mip.fr>
Date: Tue, 15 Nov 2016 18:37:00 +0100
Subject: [PATCH] Juan 15/11/2016: add management of LEN_HREC in MNH & SURFEX

---
 conf/profile_mesonh.ihm                       |  4 +++
 src/MNH/mode_RBK90_Integrator.f90             |  2 +-
 src/MNH/modeln.f90                            |  4 +--
 src/MNH/read_all_data_grib_case.f90           |  4 +--
 src/MNH/write_surf_mnh.f90                    | 28 +++++++--------
 src/Makefile.MESONH.mk                        |  6 ++++
 src/SURFEX/alloc_diag_surf_atmn.F90           |  2 +-
 src/SURFEX/build_pronoslistn.F90              |  2 +-
 src/SURFEX/ch_init_emissionn.F90              |  4 +--
 src/SURFEX/default_assim.F90                  |  2 +-
 src/SURFEX/default_diag_surf_atm.F90          |  2 +-
 src/SURFEX/diag_flake_initn.F90               |  2 +-
 src/SURFEX/diag_ideal_initn.F90               |  2 +-
 src/SURFEX/diag_isba_initn.F90                |  2 +-
 src/SURFEX/diag_misc_teb_initn.F90            |  2 +-
 src/SURFEX/diag_seaflux_initn.F90             |  2 +-
 src/SURFEX/diag_teb_garden_initn.F90          |  2 +-
 src/SURFEX/diag_teb_greenroof_initn.F90       |  2 +-
 src/SURFEX/diag_teb_initn.F90                 |  2 +-
 src/SURFEX/diag_watflux_initn.F90             |  2 +-
 src/SURFEX/get_teb_depths.F90                 |  8 ++---
 src/SURFEX/init_cpl_gcmn.F90                  |  2 +-
 src/SURFEX/init_teb_veg_optionsn.F90          |  2 +-
 src/SURFEX/io_buff.F90                        |  2 +-
 src/SURFEX/modd_assim.F90                     |  2 +-
 src/SURFEX/modd_ch_snapn.F90                  |  2 +-
 src/SURFEX/modd_diag_surf_atmn.F90            |  2 +-
 src/SURFEX/modd_io_buff.F90                   |  2 +-
 src/SURFEX/mode_read_extern.F90               |  6 ++--
 src/SURFEX/mode_write_surf_asc.F90            | 22 ++++++------
 src/SURFEX/mode_write_surf_cov.F90            |  2 +-
 src/SURFEX/mode_write_surf_fa.F90             | 20 +++++------
 src/SURFEX/modn_surf_atmn.F90                 |  2 +-
 src/SURFEX/old_name.F90                       |  4 +--
 src/SURFEX/pgd_chemistry_snap.F90             |  2 +-
 src/SURFEX/prep_flake_extern.F90              |  2 +-
 src/SURFEX/prep_grid_cartesian.F90            |  2 +-
 src/SURFEX/prep_grid_conf_proj.F90            |  2 +-
 src/SURFEX/prep_grid_gauss.F90                |  2 +-
 src/SURFEX/prep_grid_lonlat_reg.F90           |  2 +-
 src/SURFEX/prep_isba_cc_extern.F90            |  2 +-
 src/SURFEX/prep_isba_extern.F90               |  2 +-
 src/SURFEX/prep_seaflux_extern.F90            |  2 +-
 src/SURFEX/prep_snow_extern.F90               |  2 +-
 src/SURFEX/prep_teb_extern.F90                |  8 +++--
 src/SURFEX/prep_teb_garden_extern.F90         |  4 +--
 src/SURFEX/prep_teb_greenroof_extern.F90      |  4 +--
 src/SURFEX/prep_watflux_extern.F90            |  2 +-
 src/SURFEX/read_arrange_cover.F90             |  2 +-
 src/SURFEX/read_cover_garden.F90              |  2 +-
 src/SURFEX/read_covern.F90                    |  2 +-
 .../read_covers_and_av_pgd_on_layers.F90      |  4 +--
 src/SURFEX/read_dummyn.F90                    |  2 +-
 src/SURFEX/read_eco2_irrig.F90                |  2 +-
 src/SURFEX/read_flake_sbln.F90                |  2 +-
 src/SURFEX/read_flaken.F90                    |  2 +-
 src/SURFEX/read_from_surfex_file.F90          |  2 +-
 src/SURFEX/read_gr_snow.F90                   |  4 +--
 src/SURFEX/read_isba_canopyn.F90              |  2 +-
 src/SURFEX/read_isban.F90                     |  4 +--
 src/SURFEX/read_lclim_lai.F90                 |  2 +-
 src/SURFEX/read_lcover.F90                    |  2 +-
 src/SURFEX/read_lecoclimap.F90                |  2 +-
 src/SURFEX/read_oceann.F90                    |  2 +-
 src/SURFEX/read_pgd_flaken.F90                |  2 +-
 src/SURFEX/read_pgd_isba_parn.F90             |  4 +--
 src/SURFEX/read_pgd_isban.F90                 |  2 +-
 src/SURFEX/read_pgd_seaflux_parn.F90          |  2 +-
 src/SURFEX/read_pgd_seafluxn.F90              |  2 +-
 src/SURFEX/read_pgd_teb_garden_parn.F90       |  2 +-
 src/SURFEX/read_pgd_teb_gardenn.F90           |  2 +-
 src/SURFEX/read_pgd_teb_greenroof_parn.F90    |  2 +-
 src/SURFEX/read_pgd_teb_greenroofn.F90        |  2 +-
 src/SURFEX/read_pgd_teb_irrign.F90            |  2 +-
 src/SURFEX/read_pgd_teb_parn.F90              |  2 +-
 src/SURFEX/read_pgd_tebn.F90                  |  2 +-
 src/SURFEX/read_pgd_tsz0_parn.F90             |  2 +-
 src/SURFEX/read_pgd_watfluxn.F90              |  2 +-
 src/SURFEX/read_prep_file_date.F90            |  2 +-
 src/SURFEX/read_seaflux_sbln.F90              |  2 +-
 src/SURFEX/read_seafluxn.F90                  |  4 +--
 src/SURFEX/read_seaicen.F90                   |  8 ++---
 src/SURFEX/read_sso_canopyn.F90               |  2 +-
 src/SURFEX/read_sson.F90                      |  2 +-
 src/SURFEX/read_surf_field2d.F90              |  4 +--
 src/SURFEX/read_surf_field3d.F90              |  4 +--
 src/SURFEX/read_teb_canopyn.F90               |  2 +-
 src/SURFEX/read_teb_gardenn.F90               |  2 +-
 src/SURFEX/read_teb_patch.F90                 |  2 +-
 src/SURFEX/read_tebn.F90                      |  2 +-
 src/SURFEX/read_watflux_sbln.F90              |  2 +-
 src/SURFEX/read_watfluxn.F90                  |  2 +-
 src/SURFEX/test_record_len.F90                | 14 +++++---
 src/SURFEX/write_diag_ch_aggr.F90             |  2 +-
 src/SURFEX/write_diag_misc_flaken.F90         |  2 +-
 src/SURFEX/write_diag_misc_isban.F90          |  2 +-
 src/SURFEX/write_diag_misc_tebn.F90           |  2 +-
 src/SURFEX/write_diag_pgd_grdnn.F90           |  2 +-
 src/SURFEX/write_diag_pgd_isban.F90           |  2 +-
 src/SURFEX/write_diag_pgd_tebn.F90            |  2 +-
 src/SURFEX/write_diag_seb_flaken.F90          |  2 +-
 src/SURFEX/write_diag_seb_isban.F90           |  2 +-
 src/SURFEX/write_diag_seb_oceann.F90          |  2 +-
 src/SURFEX/write_diag_seb_seafluxn.F90        |  2 +-
 src/SURFEX/write_diag_seb_seaicen.F90         |  2 +-
 src/SURFEX/write_diag_seb_surf_atmn.F90       |  2 +-
 src/SURFEX/write_diag_seb_tebn.F90            |  2 +-
 src/SURFEX/write_diag_seb_watfluxn.F90        |  2 +-
 src/SURFEX/write_ecoclimap2_data.F90          |  2 +-
 src/SURFEX/write_lcover.F90                   |  2 +-
 src/SURFEX/write_surf.F90                     | 34 +++++++++----------
 src/SURFEX/write_surf_field2d.F90             |  6 ++--
 src/SURFEX/write_surf_field3d.F90             |  6 ++--
 src/SURFEX/writesurf_ch_emisn.F90             |  2 +-
 src/SURFEX/writesurf_covern.F90               |  2 +-
 src/SURFEX/writesurf_cpl_gcmn.F90             |  2 +-
 src/SURFEX/writesurf_dummyn.F90               |  2 +-
 src/SURFEX/writesurf_flake_sbln.F90           |  2 +-
 src/SURFEX/writesurf_flaken.F90               |  2 +-
 src/SURFEX/writesurf_gr_snow.F90              |  2 +-
 src/SURFEX/writesurf_isba_canopyn.F90         |  2 +-
 src/SURFEX/writesurf_isban.F90                |  2 +-
 src/SURFEX/writesurf_oceann.F90               |  2 +-
 src/SURFEX/writesurf_pgd_flaken.F90           |  2 +-
 src/SURFEX/writesurf_pgd_isba_parn.F90        |  2 +-
 src/SURFEX/writesurf_pgd_isban.F90            |  2 +-
 src/SURFEX/writesurf_pgd_seaf_parn.F90        |  2 +-
 src/SURFEX/writesurf_pgd_seafluxn.F90         |  2 +-
 src/SURFEX/writesurf_pgd_teb_greenroofn.F90   |  2 +-
 src/SURFEX/writesurf_pgd_teb_irrign.F90       |  2 +-
 src/SURFEX/writesurf_pgd_teb_parn.F90         |  2 +-
 src/SURFEX/writesurf_pgd_teb_vegn.F90         |  2 +-
 src/SURFEX/writesurf_pgd_tebn.F90             |  2 +-
 src/SURFEX/writesurf_pgd_tsz0_parn.F90        |  2 +-
 src/SURFEX/writesurf_pgd_watfluxn.F90         |  2 +-
 src/SURFEX/writesurf_seaflux_sbln.F90         |  2 +-
 src/SURFEX/writesurf_seafluxn.F90             |  2 +-
 src/SURFEX/writesurf_seaicen.F90              |  6 ++--
 src/SURFEX/writesurf_sso_canopyn.F90          |  2 +-
 src/SURFEX/writesurf_sson.F90                 |  2 +-
 src/SURFEX/writesurf_teb_canopyn.F90          |  2 +-
 src/SURFEX/writesurf_teb_gardenn.F90          |  2 +-
 src/SURFEX/writesurf_tebn.F90                 |  2 +-
 src/SURFEX/writesurf_watflux_sbln.F90         |  2 +-
 src/SURFEX/writesurf_watfluxn.F90             |  2 +-
 src/SURFEX/zoom_pgd_orography.F90             |  2 +-
 src/SURFEX/zoom_pgd_teb.F90                   |  2 +-
 src/configure                                 |  2 ++
 148 files changed, 244 insertions(+), 226 deletions(-)

diff --git a/conf/profile_mesonh.ihm b/conf/profile_mesonh.ihm
index 8dc9ea7c4..123412edf 100755
--- a/conf/profile_mesonh.ihm
+++ b/conf/profile_mesonh.ihm
@@ -91,6 +91,10 @@ export LFI_INT=${LFI_INT}
 #
 export MNH_REAL=${MNH_REAL}
 #
+#  Len of HREC characters 
+#
+export LEN_HREC=${LEN_HREC}
+#
 #  FOREFIRE
 #
 export MNH_FOREFIRE=${MNH_FOREFIRE}
diff --git a/src/MNH/mode_RBK90_Integrator.f90 b/src/MNH/mode_RBK90_Integrator.f90
index a16d225f9..3746e1712 100644
--- a/src/MNH/mode_RBK90_Integrator.f90
+++ b/src/MNH/mode_RBK90_Integrator.f90
@@ -303,7 +303,7 @@ INTEGER, INTENT(IN) :: KMI      ! model number
    REAL :: ros_A(15), ros_C(15), ros_M(6), ros_E(6), &
                     ros_Alpha(6), ros_Gamma(6), ros_ELO
    LOGICAL :: ros_NewF(6)
-   CHARACTER(LEN=12) :: ros_Name
+   CHARACTER(LEN=LEN_HREC) :: ros_Name
 !~~~>  Local variables
    REAL :: Roundoff, FacMin, FacMax, FacRej, FacSafe
    REAL :: Hmin, Hmax, Hstart
diff --git a/src/MNH/modeln.f90 b/src/MNH/modeln.f90
index b0323f1c0..09408f9ca 100644
--- a/src/MNH/modeln.f90
+++ b/src/MNH/modeln.f90
@@ -445,7 +445,7 @@ REAL*8,DIMENSION(2)         :: ZTIME,ZTIME1,ZTIME2,ZEND,ZTOT,ZALL,ZTOT_PT
 REAL*8,DIMENSION(2)         :: ZTIME_STEP,ZTIME_STEP_PTS
 CHARACTER                 :: YMI
 INTEGER                   :: IPOINTS
-CHARACTER(len=12)         :: YTCOUNT,YPOINTS
+CHARACTER(len=LEN_HREC)         :: YTCOUNT,YPOINTS
 
 REAL         :: ZSTAT_CSTORE,ZSTAT_CBOUND,ZSTAT_CGUESS,ZSTAT_CADV,ZSTAT_CSOURCES
 REAL         :: ZSTAT_CDIFF,ZSTAT_CRELAX,ZSTAT_CPARAM
@@ -519,7 +519,7 @@ LOGICAL :: KHHONI
 REAL :: TEMPS
 INTEGER :: NSV_END
 CHARACTER (LEN=100) :: YCOMMENT   ! Comment string in LFIFM file
-CHARACTER (LEN=16)  :: YRECFM     ! Name of the desired field in LFIFM file
+CHARACTER (LEN=LEN_HREC)  :: YRECFM     ! Name of the desired field in LFIFM file
 !
 INTEGER             :: ILENG      ! Length of comment string in LFIFM file
 INTEGER             :: IGRID      ! C-grid indicator in LFIFM file
diff --git a/src/MNH/read_all_data_grib_case.f90 b/src/MNH/read_all_data_grib_case.f90
index b7c9ac814..68682d9ff 100644
--- a/src/MNH/read_all_data_grib_case.f90
+++ b/src/MNH/read_all_data_grib_case.f90
@@ -277,7 +277,7 @@ INTEGER  :: IDATE
 INTEGER  :: ITIMESTEP
 CHARACTER(LEN=10) :: CSTEPUNIT
 !chemistery field
-CHARACTER(LEN=12)                  :: YPRE_MOC="PRE_MOC1.nam"
+CHARACTER(LEN=LEN_HREC)                  :: YPRE_MOC="PRE_MOC1.nam"
 INTEGER, DIMENSION(:), ALLOCATABLE :: INUMGRIB, INUMLEV  ! grib
 INTEGER, DIMENSION(:), ALLOCATABLE :: INUMLEV1, INUMLEV2 !numbers
 INTEGER                            :: IMOC
@@ -286,7 +286,7 @@ INTEGER                            :: ICHANNEL
 INTEGER                            :: INDX
 INTEGER                            :: INACT
 CHARACTER(LEN=40)                  :: YINPLINE        ! input line
-CHARACTER(LEN=16)                  :: YFIELD
+CHARACTER(LEN=LEN_HREC)                  :: YFIELD
 CHARACTER, PARAMETER               :: YPTAB = CHAR(9) ! TAB character is ASCII : 9
 CHARACTER, PARAMETER               :: YPCOM = CHAR(44)! COMma character is ASCII : 44
 CHARACTER(LEN=40), DIMENSION(:), ALLOCATABLE :: YMNHNAME ! species names
diff --git a/src/MNH/write_surf_mnh.f90 b/src/MNH/write_surf_mnh.f90
index 073515c71..59923d9cc 100644
--- a/src/MNH/write_surf_mnh.f90
+++ b/src/MNH/write_surf_mnh.f90
@@ -65,7 +65,7 @@ IMPLICIT NONE
 !
 !*      0.1   Declarations of arguments
 !
-CHARACTER(LEN=12), INTENT(IN)  :: HREC     ! name of the article to be read
+CHARACTER(LEN=LEN_HREC), INTENT(IN)  :: HREC     ! name of the article to be read
 REAL,              INTENT(IN)  :: PFIELD   ! the real scalar to be read
 INTEGER,           INTENT(OUT) :: KRESP    ! KRESP  : return-code if a problem appears
 CHARACTER(LEN=100),INTENT(IN)  :: HCOMMENT ! Comment string
@@ -171,7 +171,7 @@ IMPLICIT NONE
 !
 !*      0.1   Declarations of arguments
 !
-CHARACTER(LEN=12),   INTENT(IN)  :: HREC     ! name of the article to be read
+CHARACTER(LEN=LEN_HREC),   INTENT(IN)  :: HREC     ! name of the article to be read
 INTEGER,             INTENT(IN)  :: KL       ! number of points
 REAL, DIMENSION(KL), INTENT(IN)  :: PFIELD   ! array containing the data field
 INTEGER,             INTENT(OUT) :: KRESP    ! KRESP  : return-code if a problem appears
@@ -424,7 +424,7 @@ IMPLICIT NONE
 !
 !*      0.1   Declarations of arguments
 !
-CHARACTER(LEN=12),   INTENT(IN)  :: HREC     ! name of the article to be read
+CHARACTER(LEN=LEN_HREC),   INTENT(IN)  :: HREC     ! name of the article to be read
 INTEGER,             INTENT(IN)  :: KL1,KL2       ! number of points
 REAL, DIMENSION(KL1,KL2), INTENT(IN)  :: PFIELD   ! array containing the data field
 LOGICAL,DIMENSION(JPCOVER),   INTENT(IN)  ::OFLAG  ! mask for array filling
@@ -452,7 +452,7 @@ REAL, DIMENSION(:),   ALLOCATABLE :: ZW1D   ! 1D work array
 INTEGER           :: IIU, IJU, IIB, IJB, IIE, IJE ! dimensions of horizontal fields
 INTEGER, DIMENSION(:), ALLOCATABLE :: IMASK       ! mask for unpacking
 !
-CHARACTER(LEN=16) :: YREC
+CHARACTER(LEN=LEN_HREC) :: YREC
 CHARACTER(LEN=100):: YCOMMENT
 !JUANZ
 INTEGER           :: NCOVER,ICOVER,IKL2, JL2
@@ -607,7 +607,7 @@ IMPLICIT NONE
 !
 !*      0.1   Declarations of arguments
 !
-CHARACTER(LEN=12),        INTENT(IN)  :: HREC     ! name of the article to be read
+CHARACTER(LEN=LEN_HREC),        INTENT(IN)  :: HREC     ! name of the article to be read
 INTEGER,                  INTENT(IN)  :: KL1      ! number of points
 INTEGER,                  INTENT(IN)  :: KL2      ! 2nd dimension
 REAL, DIMENSION(KL1,KL2), INTENT(IN)  :: PFIELD   ! array containing the data field
@@ -757,7 +757,7 @@ IMPLICIT NONE
 !
 !*      0.1   Declarations of arguments
 !
-CHARACTER(LEN=12),   INTENT(IN)  :: HREC     ! name of the article to be read
+CHARACTER(LEN=LEN_HREC),   INTENT(IN)  :: HREC     ! name of the article to be read
 INTEGER,             INTENT(IN)  :: KFIELD   ! the integer to be read
 INTEGER,             INTENT(OUT) :: KRESP    ! KRESP  : return-code if a problem appears
 CHARACTER(LEN=100),  INTENT(IN)  :: HCOMMENT ! Comment string
@@ -861,7 +861,7 @@ IMPLICIT NONE
 !
 !*      0.1   Declarations of arguments
 !
-CHARACTER(LEN=12),      INTENT(IN)  :: HREC     ! name of the article to be read
+CHARACTER(LEN=LEN_HREC),      INTENT(IN)  :: HREC     ! name of the article to be read
 INTEGER,                INTENT(IN)  :: KL       ! number of points
 INTEGER, DIMENSION(KL), INTENT(IN)  :: KFIELD   ! the integer to be read
 INTEGER,                INTENT(OUT) :: KRESP    ! KRESP  : return-code if a problem appears
@@ -964,7 +964,7 @@ IMPLICIT NONE
 !
 !*      0.1   Declarations of arguments
 !
-CHARACTER(LEN=12),  INTENT(IN)  :: HREC     ! name of the article to be read
+CHARACTER(LEN=LEN_HREC),  INTENT(IN)  :: HREC     ! name of the article to be read
 CHARACTER(LEN=40),  INTENT(IN)  :: HFIELD   ! the integer to be read
 INTEGER,            INTENT(OUT) :: KRESP    ! KRESP  : return-code if a problem appears
 CHARACTER(LEN=100), INTENT(IN)  :: HCOMMENT ! Comment string
@@ -1056,7 +1056,7 @@ IMPLICIT NONE
 !
 !*      0.1   Declarations of arguments
 !
-CHARACTER(LEN=12),      INTENT(IN)  :: HREC     ! name of the article to be read
+CHARACTER(LEN=LEN_HREC),      INTENT(IN)  :: HREC     ! name of the article to be read
 INTEGER,                INTENT(IN)  :: KL       ! number of points
 LOGICAL, DIMENSION(KL), INTENT(IN)  :: OFIELD   ! array containing the data field
 INTEGER,                INTENT(OUT) :: KRESP    ! KRESP  : return-code if a problem appears
@@ -1186,7 +1186,7 @@ IMPLICIT NONE
 !
 !*      0.1   Declarations of arguments
 !
-CHARACTER(LEN=12),  INTENT(IN)  :: HREC     ! name of the article to be read
+CHARACTER(LEN=LEN_HREC),  INTENT(IN)  :: HREC     ! name of the article to be read
 LOGICAL,            INTENT(IN)  :: OFIELD   ! array containing the data field
 INTEGER,            INTENT(OUT) :: KRESP    ! KRESP  : return-code if a problem appears
 CHARACTER(LEN=100), INTENT(IN)  :: HCOMMENT ! Comment string
@@ -1276,7 +1276,7 @@ IMPLICIT NONE
 !
 !*      0.1   Declarations of arguments
 !
-CHARACTER(LEN=12),  INTENT(IN)  :: HREC     ! name of the article to be read
+CHARACTER(LEN=LEN_HREC),  INTENT(IN)  :: HREC     ! name of the article to be read
 INTEGER,            INTENT(IN)  :: KYEAR    ! year
 INTEGER,            INTENT(IN)  :: KMONTH   ! month
 INTEGER,            INTENT(IN)  :: KDAY     ! day
@@ -1287,7 +1287,7 @@ CHARACTER(LEN=100), INTENT(IN)  :: HCOMMENT ! Comment string
 !*      0.2   Declarations of local variables
 !
 !
-CHARACTER(LEN=16)      :: YRECFM    ! Name of the article to be written
+CHARACTER(LEN=LEN_HREC)      :: YRECFM    ! Name of the article to be written
 INTEGER, DIMENSION(3)  :: ITDATE
 !-------------------------------------------------------------------------------
 !
@@ -1395,7 +1395,7 @@ IMPLICIT NONE
 !
 !*      0.1   Declarations of arguments
 !
-CHARACTER(LEN=12),  INTENT(IN) :: HREC     ! name of the article to be read
+CHARACTER(LEN=LEN_HREC),  INTENT(IN) :: HREC     ! name of the article to be read
 INTEGER,            INTENT(IN) :: KL1       ! number of points
 INTEGER, DIMENSION(KL1), INTENT(IN)  :: KYEAR    ! year
 INTEGER, DIMENSION(KL1), INTENT(IN)  :: KMONTH   ! month
@@ -1407,7 +1407,7 @@ CHARACTER(LEN=100), INTENT(IN)  :: HCOMMENT ! Comment string
 !*      0.2   Declarations of local variables
 !
 !
-CHARACTER(LEN=16)      :: YRECFM    ! Name of the article to be written
+CHARACTER(LEN=LEN_HREC)      :: YRECFM    ! Name of the article to be written
 INTEGER, DIMENSION(3,KL1)  :: ITDATE
 !-------------------------------------------------------------------------------
 !
diff --git a/src/Makefile.MESONH.mk b/src/Makefile.MESONH.mk
index b86951ce0..179f53bdd 100644
--- a/src/Makefile.MESONH.mk
+++ b/src/Makefile.MESONH.mk
@@ -53,6 +53,12 @@ ifeq "$(MNH_INT)" "8"
 CPPFLAGS   += -DMNH_INT8
 endif
 
+#
+#  Len of HREC characters 
+#
+CPPFLAGS   += -DLEN_HREC=$(LEN_HREC)
+#
+
 OBJS_NOCB +=  spll_dxf.o spll_dxm.o spll_dyf.o spll_dym.o \
         spll_dzf.o spll_dzm.o spll_mxf.o \
         spll_mxm.o spll_myf.o spll_mym.o spll_mzf.o \
diff --git a/src/SURFEX/alloc_diag_surf_atmn.F90 b/src/SURFEX/alloc_diag_surf_atmn.F90
index 8c0869e13..c90e4c49a 100644
--- a/src/SURFEX/alloc_diag_surf_atmn.F90
+++ b/src/SURFEX/alloc_diag_surf_atmn.F90
@@ -53,7 +53,7 @@ INTEGER,                 INTENT(IN) :: KSW       ! number of short-wave spectral
 !
 INTEGER           :: IVERSION
 INTEGER           :: IRESP          ! IRESP  : return-code if a problem appears
- CHARACTER(LEN=12) :: YREC           ! Name of the article to be read
+CHARACTER(LEN=LEN_HREC) :: YREC           ! Name of the article to be read
 REAL(KIND=JPRB) :: ZHOOK_HANDLE
 !
 !-------------------------------------------------------------------------------
diff --git a/src/SURFEX/build_pronoslistn.F90 b/src/SURFEX/build_pronoslistn.F90
index ceb2a5cac..ab72d6112 100644
--- a/src/SURFEX/build_pronoslistn.F90
+++ b/src/SURFEX/build_pronoslistn.F90
@@ -58,7 +58,7 @@ IMPLICIT NONE
 TYPE(SV_t), INTENT(INOUT) :: SV
 !
 INTEGER,                       INTENT(IN)  :: KEMIS_NBR ! number of emitted species
- CHARACTER(LEN=12), DIMENSION(KEMIS_NBR), INTENT(IN) :: HEMIS_NAME ! name of emitted species
+ CHARACTER(LEN=LEN_HREC), DIMENSION(KEMIS_NBR), INTENT(IN) :: HEMIS_NAME ! name of emitted species
 TYPE(PRONOSVAR_T),             POINTER     :: TPPRONOS
 INTEGER,                       INTENT(IN)  :: KCH     ! logical unit of input chemistry file
 INTEGER,                       INTENT(IN)  :: KLUOUT  ! output listing channel
diff --git a/src/SURFEX/ch_init_emissionn.F90 b/src/SURFEX/ch_init_emissionn.F90
index beed2f766..fe1a1da88 100644
--- a/src/SURFEX/ch_init_emissionn.F90
+++ b/src/SURFEX/ch_init_emissionn.F90
@@ -75,13 +75,13 @@ REAL, DIMENSION(:),INTENT(IN)  :: PRHOA    ! air density
 !
 INTEGER             :: IRESP                 !   File 
 INTEGER             :: ILUOUT                ! output listing logical unit
- CHARACTER (LEN=16)  :: YRECFM                ! management
+ CHARACTER (LEN=LEN_HREC)  :: YRECFM                ! management
  CHARACTER (LEN=100) :: YCOMMENT              ! variables
 INTEGER             :: JSPEC                 ! Loop index for cover data
 INTEGER             :: IIND1,IIND2           ! Indices counter
 !
  CHARACTER(LEN=40)                 :: YSPEC_NAME ! species name
- CHARACTER(LEN=12), DIMENSION(:),ALLOCATABLE :: YEMIS_NAME ! species name
+ CHARACTER(LEN=LEN_HREC), DIMENSION(:),ALLOCATABLE :: YEMIS_NAME ! species name
 INTEGER,DIMENSION(:),ALLOCATABLE  :: INBTIMES! number of emission times array
 INTEGER,DIMENSION(:),ALLOCATABLE  :: ITIMES  ! emission times for a species
 INTEGER,DIMENSION(:),ALLOCATABLE  :: IOFFNDX ! index array of offline emission species
diff --git a/src/SURFEX/default_assim.F90 b/src/SURFEX/default_assim.F90
index c91718000..c523b518e 100644
--- a/src/SURFEX/default_assim.F90
+++ b/src/SURFEX/default_assim.F90
@@ -124,7 +124,7 @@ REAL, DIMENSION(NVARMAX), INTENT(OUT) :: PTPRT_M
 INTEGER, DIMENSION(NVARMAX), INTENT(OUT) :: KNCV
 REAL,                INTENT(OUT) :: PSCALE_Q
 REAL,                INTENT(OUT) :: PSCALE_QLAI
- CHARACTER(LEN=12),   INTENT(OUT) :: HBIO
+ CHARACTER(LEN=LEN_HREC),   INTENT(OUT) :: HBIO
  CHARACTER(LEN=100),  INTENT(OUT) :: HPREFIX_BIO
 REAL, DIMENSION(12), INTENT(OUT) :: PALPH
 !
diff --git a/src/SURFEX/default_diag_surf_atm.F90 b/src/SURFEX/default_diag_surf_atm.F90
index 5a99e0946..bb10c5b22 100644
--- a/src/SURFEX/default_diag_surf_atm.F90
+++ b/src/SURFEX/default_diag_surf_atm.F90
@@ -69,7 +69,7 @@ LOGICAL,  INTENT(OUT) :: OPROVAR_TO_DIAG    ! switch to write (or not) prognosti
 LOGICAL,  INTENT(OUT) :: ODIAG_GRID    ! flag for mean grid diag
 LOGICAL,  INTENT(OUT) :: OFRAC         ! flag for fractions of tiles
 REAL,     INTENT(OUT) :: PDIAG_TSTEP   ! time-step for writing
- CHARACTER(LEN=12), DIMENSION(200), INTENT(OUT), OPTIONAL :: CSELECT  
+ CHARACTER(LEN=LEN_HREC), DIMENSION(200), INTENT(OUT), OPTIONAL :: CSELECT  
 REAL(KIND=JPRB) :: ZHOOK_HANDLE
 !
 !*       0.2   Declarations of local variables
diff --git a/src/SURFEX/diag_flake_initn.F90 b/src/SURFEX/diag_flake_initn.F90
index b56c71717..1c58fd5ec 100644
--- a/src/SURFEX/diag_flake_initn.F90
+++ b/src/SURFEX/diag_flake_initn.F90
@@ -82,7 +82,7 @@ INTEGER, INTENT(IN) :: KSW   ! number of SW spectral bands
 !
 INTEGER           :: IVERSION
 INTEGER           :: IRESP          ! IRESP  : return-code if a problem appears
- CHARACTER(LEN=12) :: YREC           ! Name of the article to be read
+ CHARACTER(LEN=LEN_HREC) :: YREC           ! Name of the article to be read
 REAL(KIND=JPRB)   :: ZHOOK_HANDLE
 !
 !-------------------------------------------------------------------------------
diff --git a/src/SURFEX/diag_ideal_initn.F90 b/src/SURFEX/diag_ideal_initn.F90
index 529536c7b..67412ab49 100644
--- a/src/SURFEX/diag_ideal_initn.F90
+++ b/src/SURFEX/diag_ideal_initn.F90
@@ -68,7 +68,7 @@ INTEGER, INTENT(IN) :: KSW   ! spectral bands
 !
 INTEGER           :: IVERSION
 INTEGER           :: IRESP          ! IRESP  : return-code if a problem appears
- CHARACTER(LEN=12) :: YREC           ! Name of the article to be read
+ CHARACTER(LEN=LEN_HREC) :: YREC           ! Name of the article to be read
 REAL(KIND=JPRB) :: ZHOOK_HANDLE
 !
 !-------------------------------------------------------------------------------
diff --git a/src/SURFEX/diag_isba_initn.F90 b/src/SURFEX/diag_isba_initn.F90
index c114531b9..8116c2667 100644
--- a/src/SURFEX/diag_isba_initn.F90
+++ b/src/SURFEX/diag_isba_initn.F90
@@ -115,7 +115,7 @@ INTEGER, INTENT(IN)         :: KSW       ! spectral bands
 INTEGER           :: IVERSION, IBUG
 INTEGER           :: IRESP          ! IRESP  : return-code if a problem appears
 INTEGER           :: ISIZE_LMEB_PATCH   ! Number of patches where multi-energy balance should be applied
- CHARACTER(LEN=12) :: YREC           ! Name of the article to be read
+ CHARACTER(LEN=LEN_HREC) :: YREC           ! Name of the article to be read
  CHARACTER(LEN=4) :: YREC2
 REAL(KIND=JPRB) :: ZHOOK_HANDLE
 !
diff --git a/src/SURFEX/diag_misc_teb_initn.F90 b/src/SURFEX/diag_misc_teb_initn.F90
index 1f5cacb32..3f897c6bd 100644
--- a/src/SURFEX/diag_misc_teb_initn.F90
+++ b/src/SURFEX/diag_misc_teb_initn.F90
@@ -75,7 +75,7 @@ INTEGER, INTENT(IN) :: KSW   ! spectral bands
 !              -------------------------------
 !
 INTEGER           :: IRESP          ! IRESP  : return-code if a problem appears
- CHARACTER(LEN=12) :: YREC           ! Name of the article to be read
+ CHARACTER(LEN=LEN_HREC) :: YREC           ! Name of the article to be read
 REAL(KIND=JPRB) :: ZHOOK_HANDLE
 !
 !-------------------------------------------------------------------------------
diff --git a/src/SURFEX/diag_seaflux_initn.F90 b/src/SURFEX/diag_seaflux_initn.F90
index 0292b5e0a..80141bc00 100644
--- a/src/SURFEX/diag_seaflux_initn.F90
+++ b/src/SURFEX/diag_seaflux_initn.F90
@@ -92,7 +92,7 @@ INTEGER, INTENT(IN) :: KSW   ! number of SW spectral bands
 !
 INTEGER           :: IVERSION
 INTEGER           :: IRESP          ! IRESP  : return-code if a problem appears
- CHARACTER(LEN=12) :: YREC           ! Name of the article to be read
+ CHARACTER(LEN=LEN_HREC) :: YREC           ! Name of the article to be read
 !
 REAL(KIND=JPRB)   :: ZHOOK_HANDLE
 !
diff --git a/src/SURFEX/diag_teb_garden_initn.F90 b/src/SURFEX/diag_teb_garden_initn.F90
index 485b58454..b903c5184 100644
--- a/src/SURFEX/diag_teb_garden_initn.F90
+++ b/src/SURFEX/diag_teb_garden_initn.F90
@@ -77,7 +77,7 @@ INTEGER, INTENT(IN)         :: KSW       ! spectral bands
 !              -------------------------------
 !
 INTEGER           :: IRESP          ! IRESP  : return-code if a problem appears
- CHARACTER(LEN=12) :: YREC           ! Name of the article to be read
+ CHARACTER(LEN=LEN_HREC) :: YREC           ! Name of the article to be read
 REAL(KIND=JPRB) :: ZHOOK_HANDLE
 !
 !-------------------------------------------------------------------------------
diff --git a/src/SURFEX/diag_teb_greenroof_initn.F90 b/src/SURFEX/diag_teb_greenroof_initn.F90
index af81285c9..9300d54c2 100644
--- a/src/SURFEX/diag_teb_greenroof_initn.F90
+++ b/src/SURFEX/diag_teb_greenroof_initn.F90
@@ -75,7 +75,7 @@ INTEGER, INTENT(IN)         :: KSW       ! spectral bands
 !              -------------------------------
 !
 INTEGER           :: IRESP          ! IRESP  : return-code if a problem appears
- CHARACTER(LEN=12) :: YREC           ! Name of the article to be read
+ CHARACTER(LEN=LEN_HREC) :: YREC           ! Name of the article to be read
 REAL(KIND=JPRB) :: ZHOOK_HANDLE
 !
 !-------------------------------------------------------------------------------
diff --git a/src/SURFEX/diag_teb_initn.F90 b/src/SURFEX/diag_teb_initn.F90
index 8fbd5735c..b80ee8862 100644
--- a/src/SURFEX/diag_teb_initn.F90
+++ b/src/SURFEX/diag_teb_initn.F90
@@ -73,7 +73,7 @@ INTEGER, INTENT(IN) :: KSW   ! spectral bands
 !              -------------------------------
 !
 INTEGER           :: IRESP          ! IRESP  : return-code if a problem appears
- CHARACTER(LEN=12) :: YREC           ! Name of the article to be read
+ CHARACTER(LEN=LEN_HREC) :: YREC           ! Name of the article to be read
 REAL(KIND=JPRB) :: ZHOOK_HANDLE
 !
 !-------------------------------------------------------------------------------
diff --git a/src/SURFEX/diag_watflux_initn.F90 b/src/SURFEX/diag_watflux_initn.F90
index b824277aa..8dd54621e 100644
--- a/src/SURFEX/diag_watflux_initn.F90
+++ b/src/SURFEX/diag_watflux_initn.F90
@@ -81,7 +81,7 @@ INTEGER, INTENT(IN) :: KSW   ! number of SW spectral bands
 !
 INTEGER           :: IVERSION
 INTEGER           :: IRESP          ! IRESP  : return-code if a problem appears
- CHARACTER(LEN=12) :: YREC           ! Name of the article to be read
+ CHARACTER(LEN=LEN_HREC) :: YREC           ! Name of the article to be read
 REAL(KIND=JPRB) :: ZHOOK_HANDLE
 !
 !-------------------------------------------------------------------------------
diff --git a/src/SURFEX/get_teb_depths.F90 b/src/SURFEX/get_teb_depths.F90
index 82b18d389..50f24202a 100644
--- a/src/SURFEX/get_teb_depths.F90
+++ b/src/SURFEX/get_teb_depths.F90
@@ -97,10 +97,10 @@ REAL,    DIMENSION(:,:), ALLOCATABLE :: ZPAR_HC, ZPAR_TC, ZHC, ZTC ! work arrays
 INTEGER           :: IVERSION       ! surface version
 INTEGER           :: IBUGFIX        ! surface bugfix version
  CHARACTER(LEN=5)  :: YSURF          ! Type of surface
- CHARACTER(LEN=12) :: YRECFM         ! Name of the article to be read
- CHARACTER(LEN=12) :: YRECFM0        ! Name of the article to be read
- CHARACTER(LEN=12) :: YRECFM1        ! Name of the article to be read
- CHARACTER(LEN=12) :: YRECFM2        ! Name of the article to be read
+ CHARACTER(LEN=LEN_HREC) :: YRECFM         ! Name of the article to be read
+ CHARACTER(LEN=LEN_HREC) :: YRECFM0        ! Name of the article to be read
+ CHARACTER(LEN=LEN_HREC) :: YRECFM1        ! Name of the article to be read
+ CHARACTER(LEN=LEN_HREC) :: YRECFM2        ! Name of the article to be read
  CHARACTER(LEN=3)  :: YAREA          ! Area where field is to be averaged
 INTEGER           :: IRESP          ! reading return code
 LOGICAL           :: GDATA          ! T if depth is to be read in the file
diff --git a/src/SURFEX/init_cpl_gcmn.F90 b/src/SURFEX/init_cpl_gcmn.F90
index d3c9c31d7..91f4c9636 100644
--- a/src/SURFEX/init_cpl_gcmn.F90
+++ b/src/SURFEX/init_cpl_gcmn.F90
@@ -80,7 +80,7 @@ TYPE(SURF_ATM_t), INTENT(INOUT) :: U
 !
 INTEGER           :: IRESP      ! Error code after redding
 ! 
- CHARACTER(LEN=12) :: YRECFM     ! Name of the article to be read
+ CHARACTER(LEN=LEN_HREC) :: YRECFM     ! Name of the article to be read
 !
 INTEGER           :: IVERSION   ! surface version
 !
diff --git a/src/SURFEX/init_teb_veg_optionsn.F90 b/src/SURFEX/init_teb_veg_optionsn.F90
index f6b449761..22f83d6f5 100644
--- a/src/SURFEX/init_teb_veg_optionsn.F90
+++ b/src/SURFEX/init_teb_veg_optionsn.F90
@@ -99,7 +99,7 @@ TYPE(TEB_VEG_OPTIONS_t), INTENT(INOUT) :: TVG
 INTEGER           :: IVERSION, IBUGFIX  ! surface version
 INTEGER           :: ILUOUT   ! unit of output listing file
 INTEGER           :: IRESP    ! Error code after redding
- CHARACTER(LEN=12) :: YRECFM   ! Name of the article to be read
+ CHARACTER(LEN=LEN_HREC) :: YRECFM   ! Name of the article to be read
  CHARACTER(LEN=4 ) :: YLVL
 !
 INTEGER :: JLAYER ! loop counter on layers
diff --git a/src/SURFEX/io_buff.F90 b/src/SURFEX/io_buff.F90
index 9194ac289..866e5707e 100644
--- a/src/SURFEX/io_buff.F90
+++ b/src/SURFEX/io_buff.F90
@@ -52,7 +52,7 @@ IMPLICIT NONE
 !
 !
 !
- CHARACTER(LEN=12),  INTENT(IN) :: HREC     ! field to read or write
+ CHARACTER(LEN=LEN_HREC),  INTENT(IN) :: HREC     ! field to read or write
  CHARACTER(LEN=1),   INTENT(IN) :: HACTION  ! 'R' : file being read
                                            ! 'W' : file being written
 !
diff --git a/src/SURFEX/modd_assim.F90 b/src/SURFEX/modd_assim.F90
index 9098b3322..5b1b19f25 100644
--- a/src/SURFEX/modd_assim.F90
+++ b/src/SURFEX/modd_assim.F90
@@ -85,7 +85,7 @@ IMPLICIT NONE
  CHARACTER(LEN=100),DIMENSION(NVARMAX) :: CPREFIX_M            ! The prefix of the control variables (in PREP.txt file) (max dim)      
  CHARACTER(LEN=10),DIMENSION(:), ALLOCATABLE  :: COBS          ! Identifier for simulated observations
  CHARACTER(LEN=3),DIMENSION(:), ALLOCATABLE   :: CVAR          ! Identifier for control variable
- CHARACTER(LEN=12)                     :: CBIO                 ! Name of Biomass variable
+ CHARACTER(LEN=LEN_HREC)                     :: CBIO                 ! Name of Biomass variable
  CHARACTER(LEN=100)                    :: CPREFIX_BIO          ! The prefix of the Biomass variable 
  CHARACTER(LEN=5)                      :: CASSIM_ISBA          ! OI/EKF
  CHARACTER(LEN=5)                      :: CASSIM               ! type of correction
diff --git a/src/SURFEX/modd_ch_snapn.F90 b/src/SURFEX/modd_ch_snapn.F90
index e79fc6b38..b6a9c2e0a 100644
--- a/src/SURFEX/modd_ch_snapn.F90
+++ b/src/SURFEX/modd_ch_snapn.F90
@@ -56,7 +56,7 @@ TYPE CH_EMIS_SNAP_t
 !                          !  'LEGAL' : LEGAL time
 !                          !
 
-  CHARACTER(LEN=12), DIMENSION(:), POINTER :: CEMIS_NAME
+  CHARACTER(LEN=LEN_HREC), DIMENSION(:), POINTER :: CEMIS_NAME
 !                          ! name of the chemical fields (emitted species)
   CHARACTER(LEN=40), DIMENSION(:), POINTER :: CEMIS_COMMENT
 !                          ! comment on the chemical fields (emitted species)
diff --git a/src/SURFEX/modd_diag_surf_atmn.F90 b/src/SURFEX/modd_diag_surf_atmn.F90
index e2d1581d0..36826feca 100644
--- a/src/SURFEX/modd_diag_surf_atmn.F90
+++ b/src/SURFEX/modd_diag_surf_atmn.F90
@@ -66,7 +66,7 @@ TYPE DIAG_SURF_ATM_t
 !  
   TYPE(DATE_TIME):: TIME_BUDGETC
 !                                  
-  CHARACTER(LEN=12), POINTER, DIMENSION(:) :: CSELECT  ! Name of ouput fields if LSELECT=true
+  CHARACTER(LEN=LEN_HREC), POINTER, DIMENSION(:) :: CSELECT  ! Name of ouput fields if LSELECT=true
 !
 !* variables for each tile
 !
diff --git a/src/SURFEX/modd_io_buff.F90 b/src/SURFEX/modd_io_buff.F90
index 957061105..41bc6a8e8 100644
--- a/src/SURFEX/modd_io_buff.F90
+++ b/src/SURFEX/modd_io_buff.F90
@@ -32,7 +32,7 @@
 !
 IMPLICIT NONE
 
- CHARACTER(LEN=12), DIMENSION(3000) :: CREC   ! list of records already read/written
+ CHARACTER(LEN=LEN_HREC), DIMENSION(3000) :: CREC   ! list of records already read/written
 INTEGER                            :: NREC   ! number of records read/written
 
 !
diff --git a/src/SURFEX/mode_read_extern.F90 b/src/SURFEX/mode_read_extern.F90
index 8763ce798..9b81e89f5 100644
--- a/src/SURFEX/mode_read_extern.F90
+++ b/src/SURFEX/mode_read_extern.F90
@@ -88,8 +88,8 @@ INTEGER, DIMENSION(:,:), INTENT(OUT):: KWG_LAYER
 !  ---------------
 !
  CHARACTER(LEN=4 ) :: YLVL
- CHARACTER(LEN=12) :: YRECFM         ! Name of the article to be read
- CHARACTER(LEN=16) :: YRECFM2
+ CHARACTER(LEN=LEN_HREC) :: YRECFM         ! Name of the article to be read
+ CHARACTER(LEN=LEN_HREC) :: YRECFM2
  CHARACTER(LEN=100):: YCOMMENT       ! Comment string
 INTEGER           :: IRESP          ! reading return code
 INTEGER           :: JLAYER         ! loop counter
@@ -433,7 +433,7 @@ LOGICAL, OPTIONAL,  INTENT(INOUT) :: OKEY
 !* local variables
 !  ---------------
 !
- CHARACTER(LEN=12) :: YRECFM         ! Name of the article to be read
+ CHARACTER(LEN=LEN_HREC) :: YRECFM         ! Name of the article to be read
  CHARACTER(LEN=4)  :: YLVL
  CHARACTER(LEN=3)  :: YISBA          ! type of ISBA soil scheme
 #ifdef MNH_PARALLEL
diff --git a/src/SURFEX/mode_write_surf_asc.F90 b/src/SURFEX/mode_write_surf_asc.F90
index f2e264225..2b5f60056 100644
--- a/src/SURFEX/mode_write_surf_asc.F90
+++ b/src/SURFEX/mode_write_surf_asc.F90
@@ -50,7 +50,7 @@ IMPLICIT NONE
 !
 !
 !
- CHARACTER(LEN=12),  INTENT(IN) :: HREC     ! name of the article to be read
+ CHARACTER(LEN=LEN_HREC),  INTENT(IN) :: HREC     ! name of the article to be read
 REAL,               INTENT(IN) :: PFIELD   ! the real scalar to be read
 INTEGER,            INTENT(OUT):: KRESP    ! KRESP  : return-code if a problem appears
  CHARACTER(LEN=100), INTENT(IN) :: HCOMMENT ! comment string
@@ -107,7 +107,7 @@ IMPLICIT NONE
 !
 !
 !
- CHARACTER(LEN=12),  INTENT(IN) :: HREC     ! name of the article to be read
+ CHARACTER(LEN=LEN_HREC),  INTENT(IN) :: HREC     ! name of the article to be read
 INTEGER,            INTENT(IN) :: KFIELD   ! the integer to be read
 INTEGER,            INTENT(OUT):: KRESP    ! KRESP  : return-code if a problem appears
  CHARACTER(LEN=100), INTENT(IN) :: HCOMMENT ! comment string
@@ -164,7 +164,7 @@ IMPLICIT NONE
 !
 !
 !
- CHARACTER(LEN=12),  INTENT(IN) :: HREC     ! name of the article to be read
+ CHARACTER(LEN=LEN_HREC),  INTENT(IN) :: HREC     ! name of the article to be read
 LOGICAL,            INTENT(IN) :: OFIELD   ! array containing the data field
 INTEGER,            INTENT(OUT):: KRESP    ! KRESP  : return-code if a problem appears
  CHARACTER(LEN=100), INTENT(IN) :: HCOMMENT ! comment string
@@ -221,7 +221,7 @@ IMPLICIT NONE
 !
 !
 !
- CHARACTER(LEN=12),  INTENT(IN)  :: HREC      ! name of the article to be read
+ CHARACTER(LEN=LEN_HREC),  INTENT(IN)  :: HREC      ! name of the article to be read
  CHARACTER(LEN=40),  INTENT(IN)  :: HFIELD    ! the integer to be read
 INTEGER,            INTENT(OUT) :: KRESP     ! KRESP  : return-code if a problem appears
  CHARACTER(LEN=100), INTENT(IN)  :: HCOMMENT  ! comment string
@@ -285,7 +285,7 @@ INCLUDE "mpif.h"
 !
 !
 !
- CHARACTER(LEN=12),   INTENT(IN) :: HREC     ! name of the article to be read
+ CHARACTER(LEN=LEN_HREC),   INTENT(IN) :: HREC     ! name of the article to be read
 REAL, DIMENSION(:),  INTENT(IN) :: PFIELD   ! array containing the data field
 INTEGER,             INTENT(OUT):: KRESP    ! KRESP  : return-code if a problem appears
  CHARACTER(LEN=100),  INTENT(IN) :: HCOMMENT ! comment string
@@ -385,7 +385,7 @@ INCLUDE "mpif.h"
 !
 !
 !
- CHARACTER(LEN=12),        INTENT(IN) :: HREC     ! name of the article to be read
+ CHARACTER(LEN=LEN_HREC),        INTENT(IN) :: HREC     ! name of the article to be read
 REAL, DIMENSION(:,:),     INTENT(IN) :: PFIELD   ! array containing the data field
 INTEGER,                  INTENT(OUT):: KRESP    ! KRESP  : return-code if a problem appears
  CHARACTER(LEN=100),       INTENT(IN) :: HCOMMENT ! comment string
@@ -485,7 +485,7 @@ INCLUDE "mpif.h"
 !
 !
 !
- CHARACTER(LEN=12),      INTENT(IN) :: HREC     ! name of the article to be read
+ CHARACTER(LEN=LEN_HREC),      INTENT(IN) :: HREC     ! name of the article to be read
 INTEGER, DIMENSION(:),  INTENT(IN) :: KFIELD   ! the integer to be read
 INTEGER,                INTENT(OUT):: KRESP    ! KRESP  : return-code if a problem appears
  CHARACTER(LEN=100),     INTENT(IN) :: HCOMMENT ! comment string
@@ -582,7 +582,7 @@ INCLUDE "mpif.h"
 !
 !
 !
- CHARACTER(LEN=12),      INTENT(IN) :: HREC     ! name of the article to be read
+ CHARACTER(LEN=LEN_HREC),      INTENT(IN) :: HREC     ! name of the article to be read
 LOGICAL, DIMENSION(:),  INTENT(IN) :: OFIELD   ! array containing the data field
 INTEGER,                INTENT(OUT):: KRESP    ! KRESP  : return-code if a problem appears
  CHARACTER(LEN=100),     INTENT(IN) :: HCOMMENT ! comment string
@@ -663,7 +663,7 @@ IMPLICIT NONE
 !
 !
 !
- CHARACTER(LEN=12),  INTENT(IN)  :: HREC     ! name of the article to be read
+ CHARACTER(LEN=LEN_HREC),  INTENT(IN)  :: HREC     ! name of the article to be read
 INTEGER,            INTENT(IN)  :: KYEAR    ! year
 INTEGER,            INTENT(IN)  :: KMONTH   ! month
 INTEGER,            INTENT(IN)  :: KDAY     ! day
@@ -738,7 +738,7 @@ INCLUDE "mpif.h"
 !
 !
 !
- CHARACTER(LEN=12),     INTENT(IN) :: HREC     ! name of the article to be read
+ CHARACTER(LEN=LEN_HREC),     INTENT(IN) :: HREC     ! name of the article to be read
 INTEGER, DIMENSION(:), INTENT(IN) :: KYEAR    ! year
 INTEGER, DIMENSION(:), INTENT(IN) :: KMONTH   ! month
 INTEGER, DIMENSION(:), INTENT(IN) :: KDAY     ! day
@@ -834,7 +834,7 @@ INCLUDE "mpif.h"
 !
 !
 !
- CHARACTER(LEN=12),       INTENT(IN)  :: HREC     ! name of the article to be read
+ CHARACTER(LEN=LEN_HREC),       INTENT(IN)  :: HREC     ! name of the article to be read
 INTEGER, DIMENSION(:,:), INTENT(IN)  :: KYEAR    ! year
 INTEGER, DIMENSION(:,:), INTENT(IN)  :: KMONTH   ! month
 INTEGER, DIMENSION(:,:), INTENT(IN)  :: KDAY     ! day
diff --git a/src/SURFEX/mode_write_surf_cov.F90 b/src/SURFEX/mode_write_surf_cov.F90
index a13901a12..71166fb00 100644
--- a/src/SURFEX/mode_write_surf_cov.F90
+++ b/src/SURFEX/mode_write_surf_cov.F90
@@ -51,7 +51,7 @@ INTEGER,              INTENT(OUT) :: KRESP    ! KRESP  : return-code if a proble
 !                                             ! '-' : no horizontal dim.
 !*      0.2   Declarations of local variables
 !
- CHARACTER(LEN=12)  :: YREC
+ CHARACTER(LEN=LEN_HREC)  :: YREC
  CHARACTER(LEN=100) :: YCOMMENT
 INTEGER            :: IL1
 INTEGER            :: IL2
diff --git a/src/SURFEX/mode_write_surf_fa.F90 b/src/SURFEX/mode_write_surf_fa.F90
index 8c0dae01c..8b1386d58 100644
--- a/src/SURFEX/mode_write_surf_fa.F90
+++ b/src/SURFEX/mode_write_surf_fa.F90
@@ -51,7 +51,7 @@ IMPLICIT NONE
 !
 !
 !
- CHARACTER(LEN=12),  INTENT(IN) :: HREC     ! name of the article to be read
+ CHARACTER(LEN=LEN_HREC),  INTENT(IN) :: HREC     ! name of the article to be read
 REAL,               INTENT(IN) :: PFIELD   ! the real scalar to be read
 INTEGER,            INTENT(OUT):: KRESP    ! KRESP  : return-code if a problem appears
  CHARACTER(LEN=100), INTENT(IN) :: HCOMMENT ! comment string
@@ -120,7 +120,7 @@ IMPLICIT NONE
 !
 !
 !
- CHARACTER(LEN=12),  INTENT(IN) :: HREC     ! name of the article to be read
+ CHARACTER(LEN=LEN_HREC),  INTENT(IN) :: HREC     ! name of the article to be read
 INTEGER,            INTENT(IN) :: KFIELD   ! the integer to be read
 INTEGER,            INTENT(OUT):: KRESP    ! KRESP  : return-code if a problem appears
  CHARACTER(LEN=100), INTENT(IN) :: HCOMMENT ! comment string
@@ -189,7 +189,7 @@ IMPLICIT NONE
 !
 !
 !
- CHARACTER(LEN=12),  INTENT(IN) :: HREC     ! name of the article to be read
+ CHARACTER(LEN=LEN_HREC),  INTENT(IN) :: HREC     ! name of the article to be read
 LOGICAL,            INTENT(IN) :: OFIELD   ! array containing the data field
 INTEGER,            INTENT(OUT):: KRESP    ! KRESP  : return-code if a problem appears
  CHARACTER(LEN=100), INTENT(IN) :: HCOMMENT ! comment string
@@ -258,7 +258,7 @@ IMPLICIT NONE
 !
 !
 !
- CHARACTER(LEN=12),  INTENT(IN)  :: HREC      ! name of the article to be read
+ CHARACTER(LEN=LEN_HREC),  INTENT(IN)  :: HREC      ! name of the article to be read
  CHARACTER(LEN=40),  INTENT(IN)  :: HFIELD    ! the integer to be read
 INTEGER,            INTENT(OUT) :: KRESP     ! KRESP  : return-code if a problem appears
  CHARACTER(LEN=100), INTENT(IN)  :: HCOMMENT  ! comment string
@@ -336,7 +336,7 @@ INCLUDE "mpif.h"
 !
 !
 !
- CHARACTER(LEN=12),   INTENT(IN) :: HREC     ! name of the article to be read
+ CHARACTER(LEN=LEN_HREC),   INTENT(IN) :: HREC     ! name of the article to be read
 INTEGER,             INTENT(IN) :: KL       ! number of points
 REAL, DIMENSION(KL), INTENT(IN) :: PFIELD   ! array containing the data field
 INTEGER,             INTENT(OUT):: KRESP    ! KRESP  : return-code if a problem appears
@@ -454,7 +454,7 @@ INCLUDE "mpif.h"
 !
 !
 !
- CHARACTER(LEN=12),        INTENT(IN) :: HREC     ! name of the article to be read
+ CHARACTER(LEN=LEN_HREC),        INTENT(IN) :: HREC     ! name of the article to be read
 INTEGER,                  INTENT(IN) :: KL1      ! number of points
 INTEGER,                  INTENT(IN) :: KL2      ! 2nd dimension
 REAL, DIMENSION(KL1,KL2), INTENT(IN) :: PFIELD   ! array containing the data field
@@ -581,7 +581,7 @@ INCLUDE "mpif.h"
 !
 !
 !
- CHARACTER(LEN=12),      INTENT(IN) :: HREC     ! name of the article to be read
+ CHARACTER(LEN=LEN_HREC),      INTENT(IN) :: HREC     ! name of the article to be read
 INTEGER,                INTENT(IN) :: KL       ! number of points
 INTEGER, DIMENSION(KL), INTENT(IN) :: KFIELD   ! array containing the data field
 INTEGER,                INTENT(OUT):: KRESP    ! KRESP  : return-code if a problem appears
@@ -689,7 +689,7 @@ INCLUDE "mpif.h"
 !
 !
 !
- CHARACTER(LEN=12),      INTENT(IN) :: HREC     ! name of the article to be read
+ CHARACTER(LEN=LEN_HREC),      INTENT(IN) :: HREC     ! name of the article to be read
 INTEGER,             INTENT(IN) :: KL       ! number of points
 LOGICAL, DIMENSION(KL), INTENT(IN) :: OFIELD   ! array containing the data field
 INTEGER,                INTENT(OUT):: KRESP    ! KRESP  : return-code if a problem appears
@@ -782,7 +782,7 @@ IMPLICIT NONE
 !
 !
 !
- CHARACTER(LEN=12),  INTENT(IN)  :: HREC     ! name of the article to be read
+ CHARACTER(LEN=LEN_HREC),  INTENT(IN)  :: HREC     ! name of the article to be read
 INTEGER,            INTENT(IN)  :: KYEAR    ! year
 INTEGER,            INTENT(IN)  :: KMONTH   ! month
 INTEGER,            INTENT(IN)  :: KDAY     ! day
@@ -885,7 +885,7 @@ INCLUDE "mpif.h"
 !
 !
 !
- CHARACTER(LEN=12),  INTENT(IN)  :: HREC     ! name of the article to be read
+ CHARACTER(LEN=LEN_HREC),  INTENT(IN)  :: HREC     ! name of the article to be read
 INTEGER,                      INTENT(IN) :: KL1      ! number of points
 INTEGER,                      INTENT(IN) :: KL2      ! 2nd dimension
 INTEGER, DIMENSION(KL1,KL2), INTENT(IN)  :: KYEAR    ! year
diff --git a/src/SURFEX/modn_surf_atmn.F90 b/src/SURFEX/modn_surf_atmn.F90
index 5d8cd63a2..39464032b 100644
--- a/src/SURFEX/modn_surf_atmn.F90
+++ b/src/SURFEX/modn_surf_atmn.F90
@@ -59,7 +59,7 @@ LOGICAL  :: LSURF_VARS
 LOGICAL  :: LDIAG_GRID
 LOGICAL  :: LPROVAR_TO_DIAG
 LOGICAL  :: LSELECT
- CHARACTER(LEN=12), DIMENSION(500)    :: CSELECT
+ CHARACTER(LEN=LEN_HREC), DIMENSION(500)    :: CSELECT
 !
 NAMELIST/NAM_CH_CONTROLn/CCHEM_SURF_FILE
 NAMELIST/NAM_CH_SURFn/LCH_SURF_EMIS
diff --git a/src/SURFEX/old_name.F90 b/src/SURFEX/old_name.F90
index ea1d01f0a..d3a92baa5 100644
--- a/src/SURFEX/old_name.F90
+++ b/src/SURFEX/old_name.F90
@@ -56,8 +56,8 @@ IMPLICIT NONE
 !
 !
  CHARACTER(LEN=6),  INTENT(IN)  :: HPROGRAM ! main program
- CHARACTER(LEN=12), INTENT(IN)  :: HRECIN   ! name of field to be read
- CHARACTER(LEN=12), INTENT(OUT) :: HRECOUT  ! name of field to be read is old file
+ CHARACTER(LEN=LEN_HREC), INTENT(IN)  :: HRECIN   ! name of field to be read
+ CHARACTER(LEN=LEN_HREC), INTENT(OUT) :: HRECOUT  ! name of field to be read is old file
 !
 !
 !*       0.2   Declarations of local variables
diff --git a/src/SURFEX/pgd_chemistry_snap.F90 b/src/SURFEX/pgd_chemistry_snap.F90
index 6f2100b61..2fed8c200 100644
--- a/src/SURFEX/pgd_chemistry_snap.F90
+++ b/src/SURFEX/pgd_chemistry_snap.F90
@@ -99,7 +99,7 @@ INTEGER                           :: JSNAP     ! loop counter on SNAP categories
 !            ------------------------
 !
 REAL(KIND=JPRB) :: ZHOOK_HANDLE
- CHARACTER(LEN=12),  DIMENSION(JPEMISMAX_S):: CEMIS_NAME
+ CHARACTER(LEN=LEN_HREC),  DIMENSION(JPEMISMAX_S):: CEMIS_NAME
  CHARACTER(LEN=40), DIMENSION(JPEMISMAX_S):: CEMIS_COMMENT
  CHARACTER(LEN=28), DIMENSION(JPEMISMAX_S):: CSNAP_MONTHLY_FILE
  CHARACTER(LEN=28), DIMENSION(JPEMISMAX_S):: CSNAP_DAILY_FILE
diff --git a/src/SURFEX/prep_flake_extern.F90 b/src/SURFEX/prep_flake_extern.F90
index 5e02db9b4..dae007534 100644
--- a/src/SURFEX/prep_flake_extern.F90
+++ b/src/SURFEX/prep_flake_extern.F90
@@ -47,7 +47,7 @@ REAL,DIMENSION(:,:), POINTER    :: PFIELD    ! field to interpolate horizontally
 !
 REAL, DIMENSION(:), ALLOCATABLE :: ZMASK
 !
- CHARACTER(LEN=12) :: YRECFM         ! Name of the article to be read
+ CHARACTER(LEN=LEN_HREC) :: YRECFM         ! Name of the article to be read
 INTEGER           :: IRESP          ! reading return code
 INTEGER           :: ILUOUT
 !
diff --git a/src/SURFEX/prep_grid_cartesian.F90 b/src/SURFEX/prep_grid_cartesian.F90
index 1bebd5978..edef06fde 100644
--- a/src/SURFEX/prep_grid_cartesian.F90
+++ b/src/SURFEX/prep_grid_cartesian.F90
@@ -64,7 +64,7 @@ INTEGER,           INTENT(OUT)   :: KNI          ! number of points
 !* 0.2 Declaration of local variables
 !      ------------------------------
 !
- CHARACTER(LEN=12) :: YRECFM    ! Name of the article to be read
+ CHARACTER(LEN=LEN_HREC) :: YRECFM    ! Name of the article to be read
 INTEGER           :: IRESP
 !
 INTEGER           :: JL        ! loop counter
diff --git a/src/SURFEX/prep_grid_conf_proj.F90 b/src/SURFEX/prep_grid_conf_proj.F90
index 2376c6bc3..51a9cd44a 100644
--- a/src/SURFEX/prep_grid_conf_proj.F90
+++ b/src/SURFEX/prep_grid_conf_proj.F90
@@ -64,7 +64,7 @@ INTEGER,           INTENT(OUT)   :: KNI          ! number of points
 !* 0.2 Declaration of local variables
 !      ------------------------------
 !
- CHARACTER(LEN=12) :: YRECFM    ! Name of the article to be read
+ CHARACTER(LEN=LEN_HREC) :: YRECFM    ! Name of the article to be read
 INTEGER           :: IRESP
 !
 !
diff --git a/src/SURFEX/prep_grid_gauss.F90 b/src/SURFEX/prep_grid_gauss.F90
index 113ddcd7c..d03279609 100644
--- a/src/SURFEX/prep_grid_gauss.F90
+++ b/src/SURFEX/prep_grid_gauss.F90
@@ -65,7 +65,7 @@ INTEGER,           INTENT(OUT)   :: KNI          ! number of points
 !* 0.2 Declaration of local variables
 !      ------------------------------
 !
- CHARACTER(LEN=12) :: YRECFM    ! Name of the article to be read
+ CHARACTER(LEN=LEN_HREC) :: YRECFM    ! Name of the article to be read
 INTEGER           :: IRESP
 !
 !
diff --git a/src/SURFEX/prep_grid_lonlat_reg.F90 b/src/SURFEX/prep_grid_lonlat_reg.F90
index 544cfe75a..c859f36a2 100644
--- a/src/SURFEX/prep_grid_lonlat_reg.F90
+++ b/src/SURFEX/prep_grid_lonlat_reg.F90
@@ -63,7 +63,7 @@ INTEGER,           INTENT(OUT)   :: KNI          ! number of points
 !* 0.2 Declaration of local variables
 !      ------------------------------
 !
- CHARACTER(LEN=12) :: YRECFM    ! Name of the article to be read
+ CHARACTER(LEN=LEN_HREC) :: YRECFM    ! Name of the article to be read
 INTEGER           :: IRESP
 !
 INTEGER :: JL        ! loop counter
diff --git a/src/SURFEX/prep_isba_cc_extern.F90 b/src/SURFEX/prep_isba_cc_extern.F90
index 8df3e73b0..ce633aa2a 100644
--- a/src/SURFEX/prep_isba_cc_extern.F90
+++ b/src/SURFEX/prep_isba_cc_extern.F90
@@ -67,7 +67,7 @@ LOGICAL,            INTENT(INOUT):: OPREP_AGS
 !
 !*      0.2    declarations of local variables
 !
- CHARACTER(LEN=12) :: YRECFM         ! Name of the article to be read
+ CHARACTER(LEN=LEN_HREC) :: YRECFM         ! Name of the article to be read
 INTEGER           :: IRESP          ! reading return code
 INTEGER           :: INI            ! total 1D dimension
 INTEGER           :: IPATCH         ! number of patch
diff --git a/src/SURFEX/prep_isba_extern.F90 b/src/SURFEX/prep_isba_extern.F90
index de84ce438..b2653569d 100644
--- a/src/SURFEX/prep_isba_extern.F90
+++ b/src/SURFEX/prep_isba_extern.F90
@@ -82,7 +82,7 @@ LOGICAL, OPTIONAL,  INTENT(INOUT):: OKEY
 !
 !*      0.2    declarations of local variables
 !
- CHARACTER(LEN=12) :: YRECFM         ! Name of the article to be read
+ CHARACTER(LEN=LEN_HREC) :: YRECFM         ! Name of the article to be read
 INTEGER           :: IRESP          ! reading return code
 INTEGER           :: INI            ! total 1D dimension
 INTEGER           :: IPATCH         ! number of patch
diff --git a/src/SURFEX/prep_seaflux_extern.F90 b/src/SURFEX/prep_seaflux_extern.F90
index 52b6995d8..6d259d7ab 100644
--- a/src/SURFEX/prep_seaflux_extern.F90
+++ b/src/SURFEX/prep_seaflux_extern.F90
@@ -45,7 +45,7 @@ REAL,DIMENSION(:,:), POINTER    :: PFIELD    ! field to interpolate horizontally
 !
 !
 REAL, DIMENSION(:), ALLOCATABLE :: ZMASK
- CHARACTER(LEN=12) :: YRECFM         ! Name of the article to be read
+ CHARACTER(LEN=LEN_HREC) :: YRECFM         ! Name of the article to be read
 INTEGER           :: IRESP          ! reading return code
 !
 INTEGER           :: INI            ! total 1D dimension
diff --git a/src/SURFEX/prep_snow_extern.F90 b/src/SURFEX/prep_snow_extern.F90
index 2604ed9cf..b5b2e1c41 100644
--- a/src/SURFEX/prep_snow_extern.F90
+++ b/src/SURFEX/prep_snow_extern.F90
@@ -103,7 +103,7 @@ REAL, DIMENSION(:,:,:), ALLOCATABLE :: ZDEPTH       ! thickness of each layer (m
 REAL, DIMENSION(:,:,:), ALLOCATABLE :: ZGRID        ! normalized input grid
 !
 LOGICAL                           :: GTOWN          ! town variables written in the file
- CHARACTER(LEN=12)                 :: YRECFM         ! record name
+ CHARACTER(LEN=LEN_HREC)                 :: YRECFM         ! record name
 INTEGER                           :: IRESP          ! error return code
 INTEGER                           :: IVERSION       ! SURFEX version
 LOGICAL                           :: GOLD_NAME      ! old name flag 
diff --git a/src/SURFEX/prep_teb_extern.F90 b/src/SURFEX/prep_teb_extern.F90
index 1124dea50..0d53d1e6a 100644
--- a/src/SURFEX/prep_teb_extern.F90
+++ b/src/SURFEX/prep_teb_extern.F90
@@ -68,7 +68,7 @@ REAL, DIMENSION(:,:),   ALLOCATABLE :: ZD  ! intermediate array
 !
 REAL, DIMENSION(:), ALLOCATABLE :: ZMASK
 !
- CHARACTER(LEN=12) :: YRECFM         ! Name of the article to be read
+ CHARACTER(LEN=LEN_HREC) :: YRECFM         ! Name of the article to be read
 INTEGER           :: IRESP          ! reading return code
 INTEGER           :: ILAYER         ! number of layers
 INTEGER           :: JLAYER         ! loop counter
@@ -399,11 +399,13 @@ ELSE
       CALL OPEN_AUX_IO_SURF(&
                       HFILE,HFILETYPE,'NATURE')
       IF (YSURF=='T_FLOO' .OR. YSURF=='T_CAN ' .OR. YSURF=='TI_ROA') THEN
+        YRECFM='TG2'
         CALL READ_SURF_FIELD2D(&
-               HFILETYPE,ZFIELD(:,:),'TG2         ',HDIR='A')
+               HFILETYPE,ZFIELD(:,:),YRECFM,HDIR='A')
       ELSE
+        YRECFM='TG1'
         CALL READ_SURF_FIELD2D(&
-               HFILETYPE,ZFIELD(:,:),'TG1         ',HDIR='A')
+               HFILETYPE,ZFIELD(:,:),YRECFM,HDIR='A')
       ENDIF
       CALL CLOSE_AUX_IO_SURF(HFILE,HFILETYPE)
       DO JLAYER=1,SIZE(ZFIELD,2)
diff --git a/src/SURFEX/prep_teb_garden_extern.F90 b/src/SURFEX/prep_teb_garden_extern.F90
index 831e16d44..d80403711 100644
--- a/src/SURFEX/prep_teb_garden_extern.F90
+++ b/src/SURFEX/prep_teb_garden_extern.F90
@@ -85,7 +85,7 @@ REAL,DIMENSION(:,:,:), POINTER  :: PFIELD    ! field to interpolate horizontally
 !
 !*      0.2    declarations of local variables
 !
- CHARACTER(LEN=12) :: YRECFM         ! Name of the article to be read
+ CHARACTER(LEN=LEN_HREC) :: YRECFM         ! Name of the article to be read
 INTEGER           :: IRESP          ! reading return code
 INTEGER           :: INI            ! total 1D dimension
 INTEGER           :: IPATCH         ! number of patch
@@ -100,7 +100,7 @@ INTEGER                             :: ITEB_PATCH     ! number of TEB patches in
 INTEGER                             :: IVERSION       ! SURFEX version
 INTEGER                             :: IBUGFIX        ! SURFEX bug version
 LOGICAL                             :: GOLD_NAME      ! old name flag for temperatures
- CHARACTER(LEN=12)                   :: YSURF     ! type of field
+ CHARACTER(LEN=LEN_HREC)                   :: YSURF     ! type of field
  CHARACTER(LEN=3)                    :: YPATCH    ! indentificator for TEB patch
 LOGICAL                         :: GTEB      ! flag if TEB fields are present
 LOGICAL                         :: GGARDEN   ! T if gardens are present in the file
diff --git a/src/SURFEX/prep_teb_greenroof_extern.F90 b/src/SURFEX/prep_teb_greenroof_extern.F90
index a54f4713e..44e2273bb 100644
--- a/src/SURFEX/prep_teb_greenroof_extern.F90
+++ b/src/SURFEX/prep_teb_greenroof_extern.F90
@@ -81,7 +81,7 @@ REAL,DIMENSION(:,:,:), POINTER  :: PFIELD    ! field to interpolate horizontally
 !
 !*      0.2    declarations of local variables
 !
- CHARACTER(LEN=12) :: YRECFM         ! Name of the article to be read
+ CHARACTER(LEN=LEN_HREC) :: YRECFM         ! Name of the article to be read
 INTEGER           :: IRESP          ! reading return code
 INTEGER           :: INI            ! total 1D dimension
 INTEGER           :: IPATCH         ! number of patch
@@ -93,7 +93,7 @@ REAL, DIMENSION(:,:), POINTER       :: ZD1            ! depth of field in the so
 REAL, DIMENSION(:,:), ALLOCATABLE   :: ZOUT           !
 LOGICAL                             :: GTEB           ! flag if TEB fields are present
 INTEGER                             :: JPATCH         ! loop counter for patch
- CHARACTER(LEN=12)                   :: YSURF          ! type of field
+ CHARACTER(LEN=LEN_HREC)                   :: YSURF          ! type of field
 INTEGER                             :: ITEB_PATCH     ! number of TEB patches in file
 INTEGER                             :: IVERSION       ! SURFEX version
 INTEGER                             :: IBUGFIX        ! SURFEX bug version
diff --git a/src/SURFEX/prep_watflux_extern.F90 b/src/SURFEX/prep_watflux_extern.F90
index 735a8faf2..033c4da70 100644
--- a/src/SURFEX/prep_watflux_extern.F90
+++ b/src/SURFEX/prep_watflux_extern.F90
@@ -46,7 +46,7 @@ REAL,DIMENSION(:,:), POINTER    :: PFIELD    ! field to interpolate horizontally
 !
 !
 REAL, DIMENSION(:), ALLOCATABLE :: ZMASK
- CHARACTER(LEN=12) :: YRECFM         ! Name of the article to be read
+ CHARACTER(LEN=LEN_HREC) :: YRECFM         ! Name of the article to be read
 INTEGER           :: IRESP          ! reading return code
 INTEGER           :: ILUOUT
 INTEGER           :: IDIM_WATER
diff --git a/src/SURFEX/read_arrange_cover.F90 b/src/SURFEX/read_arrange_cover.F90
index 51e31f2bd..11c1304c5 100644
--- a/src/SURFEX/read_arrange_cover.F90
+++ b/src/SURFEX/read_arrange_cover.F90
@@ -32,7 +32,7 @@ LOGICAL,           INTENT(OUT) :: OTOWN_TO_ROCK    ! T: Change Town into Rock
 !  ---------------
 !
  CHARACTER(LEN=1) :: YDIR
- CHARACTER(LEN=12) :: YRECFM     ! Name of the article to be read
+ CHARACTER(LEN=LEN_HREC) :: YRECFM     ! Name of the article to be read
 INTEGER           :: IRESP      ! reading return code
 !
 INTEGER           :: IVERSION   ! surface version
diff --git a/src/SURFEX/read_cover_garden.F90 b/src/SURFEX/read_cover_garden.F90
index bc84d1db9..87955be6f 100644
--- a/src/SURFEX/read_cover_garden.F90
+++ b/src/SURFEX/read_cover_garden.F90
@@ -31,7 +31,7 @@ LOGICAL,           INTENT(OUT) :: OGARDEN   ! T: Definition of urban green areas
 !  ---------------
 !
  CHARACTER(LEN=1) :: YDIR
- CHARACTER(LEN=12) :: YRECFM     ! Name of the article to be read
+ CHARACTER(LEN=LEN_HREC) :: YRECFM     ! Name of the article to be read
 INTEGER           :: IRESP      ! reading return code
 !
 INTEGER           :: IVERSION   ! surface version
diff --git a/src/SURFEX/read_covern.F90 b/src/SURFEX/read_covern.F90
index d942958bf..6bdddeab3 100644
--- a/src/SURFEX/read_covern.F90
+++ b/src/SURFEX/read_covern.F90
@@ -86,7 +86,7 @@ INTEGER           :: IVERSION       ! surface version
 !
 LOGICAL :: GREAD_ALL
 !
- CHARACTER(LEN=12) :: YRECFM         ! Name of the article to be read
+ CHARACTER(LEN=LEN_HREC) :: YRECFM         ! Name of the article to be read
 REAL(KIND=JPRB) :: ZHOOK_HANDLE
 !
 !-------------------------------------------------------------------------------
diff --git a/src/SURFEX/read_covers_and_av_pgd_on_layers.F90 b/src/SURFEX/read_covers_and_av_pgd_on_layers.F90
index e94fbdc3f..91bdb4be3 100644
--- a/src/SURFEX/read_covers_and_av_pgd_on_layers.F90
+++ b/src/SURFEX/read_covers_and_av_pgd_on_layers.F90
@@ -62,7 +62,7 @@ IMPLICIT NONE
 !            ------------------------
 !
 CHARACTER(LEN=6),   INTENT(IN)  :: HFILEPGDTYPE ! type of input file
-CHARACTER(LEN=12),   INTENT(IN) :: HRECFM         ! Name of the article to be read
+CHARACTER(LEN=LEN_HREC),   INTENT(IN) :: HRECFM         ! Name of the article to be read
 TYPE(DATA_COVER_t), INTENT(INOUT) :: DTCO
 INTEGER,   INTENT(IN) :: KLU                      ! number of points
 INTEGER,   INTENT(IN)  :: KDATA_LAYER  ! number of layers
@@ -92,7 +92,7 @@ LOGICAL, DIMENSION(JPCOVER)          :: GCOVER ! flag to read the covers
 REAL,    DIMENSION(KLU)		 :: ZCOVER ! cover fractions
 CHARACTER(LEN=100) :: YCOMMENT
 INTEGER           :: IRESP          ! reading return code
-CHARACTER(LEN=16) :: YRECFM         ! Name of the article to be read
+CHARACTER(LEN=LEN_HREC) :: YRECFM         ! Name of the article to be read
 !-------------------------------------------------------------------------------
 !
 IF (LHOOK) CALL DR_HOOK('READ_COVERS_AND_AV_PGD_1D_ON_LAYERS',0,ZHOOK_HANDLE)
diff --git a/src/SURFEX/read_dummyn.F90 b/src/SURFEX/read_dummyn.F90
index c0064fdbd..0779d4854 100644
--- a/src/SURFEX/read_dummyn.F90
+++ b/src/SURFEX/read_dummyn.F90
@@ -62,7 +62,7 @@ INTEGER           :: JDUMMY         ! loop counter
  CHARACTER(LEN=3  ):: YSTRING03      ! string
 !
 INTEGER           :: IRESP          ! IRESP  : return-code if a problem appears
- CHARACTER(LEN=12) :: YRECFM         ! Name of the article to be read
+ CHARACTER(LEN=LEN_HREC) :: YRECFM         ! Name of the article to be read
  CHARACTER(LEN=100):: YCOMMENT       ! Comment string
 REAL(KIND=JPRB) :: ZHOOK_HANDLE
 !
diff --git a/src/SURFEX/read_eco2_irrig.F90 b/src/SURFEX/read_eco2_irrig.F90
index 0e3a6514f..8a7a1f372 100644
--- a/src/SURFEX/read_eco2_irrig.F90
+++ b/src/SURFEX/read_eco2_irrig.F90
@@ -40,7 +40,7 @@ TYPE(DATA_COVER_t), INTENT(INOUT) :: DTCO
 !* local variables
 !  ---------------
 !
- CHARACTER(LEN=12) :: YRECFM     ! Name of the article to be read
+ CHARACTER(LEN=LEN_HREC) :: YRECFM     ! Name of the article to be read
 INTEGER           :: IRESP      ! reading return code
 !
 INTEGER           :: IVERSION   ! surface version
diff --git a/src/SURFEX/read_flake_sbln.F90 b/src/SURFEX/read_flake_sbln.F90
index 15c70fedc..6d6105504 100644
--- a/src/SURFEX/read_flake_sbln.F90
+++ b/src/SURFEX/read_flake_sbln.F90
@@ -74,7 +74,7 @@ TYPE(SURF_ATM_t), INTENT(INOUT) :: U
 !*       0.2   Declarations of local variables
 !              -------------------------------
 !
- CHARACTER(LEN=12) :: YRECFM         ! Name of the article to be read
+ CHARACTER(LEN=LEN_HREC) :: YRECFM         ! Name of the article to be read
  CHARACTER(LEN=3)  :: YREAD
 INTEGER :: ILU     ! 1D physical dimension
 INTEGER :: IRESP   ! Error code after redding
diff --git a/src/SURFEX/read_flaken.F90 b/src/SURFEX/read_flaken.F90
index 5c94dc6c7..cf07ea4eb 100644
--- a/src/SURFEX/read_flaken.F90
+++ b/src/SURFEX/read_flaken.F90
@@ -76,7 +76,7 @@ INTEGER           :: ILU          ! 1D physical dimension
 !
 INTEGER           :: IRESP          ! Error code after redding
 !
- CHARACTER(LEN=12) :: YRECFM         ! Name of the article to be read
+ CHARACTER(LEN=LEN_HREC) :: YRECFM         ! Name of the article to be read
 REAL(KIND=JPRB) :: ZHOOK_HANDLE
 !
 !-------------------------------------------------------------------------------
diff --git a/src/SURFEX/read_from_surfex_file.F90 b/src/SURFEX/read_from_surfex_file.F90
index 41d8ac325..d80c1800f 100644
--- a/src/SURFEX/read_from_surfex_file.F90
+++ b/src/SURFEX/read_from_surfex_file.F90
@@ -49,7 +49,7 @@ REAL, DIMENSION(:), INTENT(OUT) :: PFIELD
  CHARACTER(LEN=*), OPTIONAL, INTENT(IN) :: HNAM
 !
  CHARACTER(LEN=28)     :: HNAME
- CHARACTER(LEN=12)     :: YRECFM
+ CHARACTER(LEN=LEN_HREC)     :: YRECFM
 INTEGER               :: IRESP, I0
 !
 REAL(KIND=JPRB) :: ZHOOK_HANDLE
diff --git a/src/SURFEX/read_gr_snow.F90 b/src/SURFEX/read_gr_snow.F90
index 943c003b7..21b37f8cd 100644
--- a/src/SURFEX/read_gr_snow.F90
+++ b/src/SURFEX/read_gr_snow.F90
@@ -88,8 +88,8 @@ INTEGER,            INTENT(IN), OPTIONAL :: KBUGFIX
 !*       0.2   declarations of local variables
 !
 INTEGER             :: IRESP               ! Error code after redding
- CHARACTER(LEN=12)   :: YRECFM              ! Name of the article to be read
- CHARACTER(LEN=16)   :: YRECFM2 
+ CHARACTER(LEN=LEN_HREC)   :: YRECFM              ! Name of the article to be read
+ CHARACTER(LEN=LEN_HREC)   :: YRECFM2 
 !
  CHARACTER (LEN=100) :: YFMT                ! format for writing
 INTEGER             :: ISURFTYPE_LEN       ! 
diff --git a/src/SURFEX/read_isba_canopyn.F90 b/src/SURFEX/read_isba_canopyn.F90
index 1ac3fe9b6..91aefd856 100644
--- a/src/SURFEX/read_isba_canopyn.F90
+++ b/src/SURFEX/read_isba_canopyn.F90
@@ -76,7 +76,7 @@ TYPE(SURF_ATM_t), INTENT(INOUT) :: U
 !              -------------------------------
 !
 !
- CHARACTER(LEN=12) :: YRECFM         ! Name of the article to be read
+ CHARACTER(LEN=LEN_HREC) :: YRECFM         ! Name of the article to be read
  CHARACTER(LEN=3)  :: YREAD
 INTEGER :: JLAYER  ! loop counter on layers
 INTEGER :: ILU     ! 1D physical dimension
diff --git a/src/SURFEX/read_isban.F90 b/src/SURFEX/read_isban.F90
index 3201e3069..7bb5aa5d7 100644
--- a/src/SURFEX/read_isban.F90
+++ b/src/SURFEX/read_isban.F90
@@ -102,7 +102,7 @@ INTEGER           :: ILU          ! 1D physical dimension
 !
 INTEGER           :: IRESP          ! Error code after redding
 !
- CHARACTER(LEN=12) :: YRECFM         ! Name of the article to be read
+ CHARACTER(LEN=LEN_HREC) :: YRECFM         ! Name of the article to be read
 !
  CHARACTER(LEN=4)  :: YLVL
 !
@@ -612,7 +612,7 @@ REAL, DIMENSION(:), INTENT(IN) :: PCOFSWI
 REAL, DIMENSION(:,:,:), INTENT(INOUT) :: PVAR
 REAL, DIMENSION(:,:,:), INTENT(INOUT) :: PRED_NOISE
 !
- CHARACTER(LEN=12) :: YRECFM         ! Name of the article to be read
+ CHARACTER(LEN=LEN_HREC) :: YRECFM         ! Name of the article to be read
  CHARACTER(LEN=4) :: YLVL
  CHARACTER(LEN=3) :: YVAR
 REAL :: ZWHITE_NOISE, ZVAR0
diff --git a/src/SURFEX/read_lclim_lai.F90 b/src/SURFEX/read_lclim_lai.F90
index 94f8621b4..80fbf495d 100644
--- a/src/SURFEX/read_lclim_lai.F90
+++ b/src/SURFEX/read_lclim_lai.F90
@@ -30,7 +30,7 @@ LOGICAL,              INTENT(OUT)   :: OCLIM_LAI ! flag for use of climatologic
 !* local variables
 !  ---------------
 !
- CHARACTER(LEN=12) :: YRECFM     ! Name of the article to be read
+ CHARACTER(LEN=LEN_HREC) :: YRECFM     ! Name of the article to be read
 INTEGER           :: IRESP      ! reading return code
 !
 INTEGER           :: IVERSION   ! surface version
diff --git a/src/SURFEX/read_lcover.F90 b/src/SURFEX/read_lcover.F90
index 17da413e6..94ca615ad 100644
--- a/src/SURFEX/read_lcover.F90
+++ b/src/SURFEX/read_lcover.F90
@@ -71,7 +71,7 @@ LOGICAL, DIMENSION(JPCOVER)    :: OCOVER   ! list of covers
 !              -------------------------------
 !
 INTEGER           :: IRESP          ! Error code after redding
- CHARACTER(LEN=12) :: YRECFM         ! Name of the article to be read
+ CHARACTER(LEN=LEN_HREC) :: YRECFM         ! Name of the article to be read
 INTEGER           :: IVERSION       ! version of surfex file being read
 LOGICAL, DIMENSION(:), ALLOCATABLE :: GCOVER ! cover list in the file
 REAL(KIND=JPRB) :: ZHOOK_HANDLE
diff --git a/src/SURFEX/read_lecoclimap.F90 b/src/SURFEX/read_lecoclimap.F90
index 0d848cfa3..8ea72a920 100644
--- a/src/SURFEX/read_lecoclimap.F90
+++ b/src/SURFEX/read_lecoclimap.F90
@@ -30,7 +30,7 @@ LOGICAL,              INTENT(OUT)   :: OECOCLIMAP! flag for ecoclimap
 !* local variables
 !  ---------------
 !
- CHARACTER(LEN=12) :: YRECFM     ! Name of the article to be read
+ CHARACTER(LEN=LEN_HREC) :: YRECFM     ! Name of the article to be read
 INTEGER           :: IRESP      ! reading return code
 !
 INTEGER           :: IVERSION   ! surface version
diff --git a/src/SURFEX/read_oceann.F90 b/src/SURFEX/read_oceann.F90
index 0a3588bc1..a43fef509 100644
--- a/src/SURFEX/read_oceann.F90
+++ b/src/SURFEX/read_oceann.F90
@@ -83,7 +83,7 @@ INTEGER           :: IRESP          ! Error code after redding
 !
  CHARACTER(LEN=4)  :: YLVL
 !
- CHARACTER(LEN=12) :: YRECFM         ! Name of the article to be read
+ CHARACTER(LEN=LEN_HREC) :: YRECFM         ! Name of the article to be read
  CHARACTER(LEN=14) :: YFORM          ! Writing format
 REAL, DIMENSION(:),ALLOCATABLE  :: ZWORK      ! 1D array to write data in file
 !
diff --git a/src/SURFEX/read_pgd_flaken.F90 b/src/SURFEX/read_pgd_flaken.F90
index 4dd1e1f6f..f39244be0 100644
--- a/src/SURFEX/read_pgd_flaken.F90
+++ b/src/SURFEX/read_pgd_flaken.F90
@@ -83,7 +83,7 @@ TYPE(SURF_ATM_t), INTENT(INOUT) :: U
 !
 INTEGER           :: IRESP          ! Error code after redding
 ! 
- CHARACTER(LEN=12) :: YRECFM         ! Name of the article to be read
+ CHARACTER(LEN=LEN_HREC) :: YRECFM         ! Name of the article to be read
 !
 REAL(KIND=JPRB) :: ZHOOK_HANDLE
 !-------------------------------------------------------------------------------
diff --git a/src/SURFEX/read_pgd_isba_parn.F90 b/src/SURFEX/read_pgd_isba_parn.F90
index 4c7842a8c..fea453207 100644
--- a/src/SURFEX/read_pgd_isba_parn.F90
+++ b/src/SURFEX/read_pgd_isba_parn.F90
@@ -101,8 +101,8 @@ REAL,    DIMENSION(:,:), ALLOCATABLE :: ZWORK
 INTEGER           :: ILUOUT
 INTEGER           :: ITIME
 INTEGER           :: IRESP          ! IRESP  : return-code if a problem appears
- CHARACTER(LEN=12) :: YRECFM         ! Name of the article to be read
- CHARACTER(LEN=16) :: YRECFM2
+ CHARACTER(LEN=LEN_HREC) :: YRECFM         ! Name of the article to be read
+ CHARACTER(LEN=LEN_HREC) :: YRECFM2
  CHARACTER(LEN=100):: YCOMMENT       ! Comment string
  CHARACTER(LEN=1)  :: YDIR
 INTEGER           :: JTIME          ! loop index
diff --git a/src/SURFEX/read_pgd_isban.F90 b/src/SURFEX/read_pgd_isban.F90
index f9ae70ffa..c8d82407e 100644
--- a/src/SURFEX/read_pgd_isban.F90
+++ b/src/SURFEX/read_pgd_isban.F90
@@ -120,7 +120,7 @@ INTEGER, DIMENSION(:), POINTER :: IMASK  ! mask for packing from complete field
 !
 REAL, DIMENSION(:,:), ALLOCATABLE :: ZWORK
 !
- CHARACTER(LEN=12) :: YRECFM         ! Name of the article to be read
+ CHARACTER(LEN=LEN_HREC) :: YRECFM         ! Name of the article to be read
  CHARACTER(LEN=4 ) :: YLVL
 !
 INTEGER :: ILU    ! expected physical size of full surface array
diff --git a/src/SURFEX/read_pgd_seaflux_parn.F90 b/src/SURFEX/read_pgd_seaflux_parn.F90
index 72638026b..ac8dac9b6 100644
--- a/src/SURFEX/read_pgd_seaflux_parn.F90
+++ b/src/SURFEX/read_pgd_seaflux_parn.F90
@@ -89,7 +89,7 @@ INTEGER, INTENT(IN) :: KSIZE
 !              -------------------------------
 !
 REAL, DIMENSION(:,:), ALLOCATABLE :: ZDATA_SST
- CHARACTER(LEN=12) :: YRECFM         ! Name of the article to be read
+ CHARACTER(LEN=LEN_HREC) :: YRECFM         ! Name of the article to be read
  CHARACTER(LEN=100):: YCOMMENT       ! Comment string
  CHARACTER(LEN=1)  :: YDIR
 INTEGER           :: ILUOUT
diff --git a/src/SURFEX/read_pgd_seafluxn.F90 b/src/SURFEX/read_pgd_seafluxn.F90
index eb811ab2e..8b4d53a55 100644
--- a/src/SURFEX/read_pgd_seafluxn.F90
+++ b/src/SURFEX/read_pgd_seafluxn.F90
@@ -87,7 +87,7 @@ TYPE(GRID_CONF_PROJ_t),INTENT(INOUT) :: GCP
 !
 INTEGER           :: IRESP          ! Error code after redding
 !
- CHARACTER(LEN=12) :: YRECFM         ! Name of the article to be read
+ CHARACTER(LEN=LEN_HREC) :: YRECFM         ! Name of the article to be read
 !
 INTEGER           :: IVERSION   ! surface version
 REAL(KIND=JPRB) :: ZHOOK_HANDLE
diff --git a/src/SURFEX/read_pgd_teb_garden_parn.F90 b/src/SURFEX/read_pgd_teb_garden_parn.F90
index c342dd9fa..c22ae9bd7 100644
--- a/src/SURFEX/read_pgd_teb_garden_parn.F90
+++ b/src/SURFEX/read_pgd_teb_garden_parn.F90
@@ -93,7 +93,7 @@ TYPE(TEB_GRID_t), INTENT(INOUT) :: TG
 !              -------------------------------
 !
 INTEGER                               :: IRESP          ! IRESP  : return-code if a problem appears
- CHARACTER(LEN=12)                     :: YRECFM         ! Name of the article to be read
+ CHARACTER(LEN=LEN_HREC)                     :: YRECFM         ! Name of the article to be read
  CHARACTER(LEN=100)                    :: YCOMMENT       ! Comment string
 INTEGER                               :: JI, JLAYER     ! loop index
 INTEGER                               :: JTIME          ! loop index
diff --git a/src/SURFEX/read_pgd_teb_gardenn.F90 b/src/SURFEX/read_pgd_teb_gardenn.F90
index 509137564..3c0537fbe 100644
--- a/src/SURFEX/read_pgd_teb_gardenn.F90
+++ b/src/SURFEX/read_pgd_teb_gardenn.F90
@@ -90,7 +90,7 @@ INTEGER,           INTENT(IN)  :: KBUGFIX
 !
 INTEGER           :: IRESP          ! Error code after redding
 !
- CHARACTER(LEN=12) :: YRECFM         ! Name of the article to be read
+ CHARACTER(LEN=LEN_HREC) :: YRECFM         ! Name of the article to be read
 !
 INTEGER           :: JLAYER         ! loop counter on layers
 REAL(KIND=JPRB) :: ZHOOK_HANDLE
diff --git a/src/SURFEX/read_pgd_teb_greenroof_parn.F90 b/src/SURFEX/read_pgd_teb_greenroof_parn.F90
index 74b57ea7e..5fd5e0e07 100644
--- a/src/SURFEX/read_pgd_teb_greenroof_parn.F90
+++ b/src/SURFEX/read_pgd_teb_greenroof_parn.F90
@@ -85,7 +85,7 @@ TYPE(TEB_GRID_t), INTENT(INOUT) :: TG
 !              -------------------------------
 !
 INTEGER                               :: IRESP          ! IRESP  : return-code if a problem appears
- CHARACTER(LEN=12)                     :: YRECFM         ! Name of the article to be read
+ CHARACTER(LEN=LEN_HREC)                     :: YRECFM         ! Name of the article to be read
  CHARACTER(LEN=100)                    :: YCOMMENT       ! Comment string
 INTEGER                               :: JI             ! loop index
 INTEGER                               :: JTIME          ! loop index
diff --git a/src/SURFEX/read_pgd_teb_greenroofn.F90 b/src/SURFEX/read_pgd_teb_greenroofn.F90
index 0aee2c9c5..58d61c51a 100644
--- a/src/SURFEX/read_pgd_teb_greenroofn.F90
+++ b/src/SURFEX/read_pgd_teb_greenroofn.F90
@@ -86,7 +86,7 @@ INTEGER,           INTENT(IN)  :: KVERSION ! version of SURFEX of the file being
 !
 INTEGER           :: IRESP          ! Error code after redding
 !
- CHARACTER(LEN=12) :: YRECFM         ! Name of the article to be read
+ CHARACTER(LEN=LEN_HREC) :: YRECFM         ! Name of the article to be read
 !
 !
 INTEGER           :: JLAYER         ! loop counter on layers ! not used
diff --git a/src/SURFEX/read_pgd_teb_irrign.F90 b/src/SURFEX/read_pgd_teb_irrign.F90
index e747f459b..f81dc5f24 100644
--- a/src/SURFEX/read_pgd_teb_irrign.F90
+++ b/src/SURFEX/read_pgd_teb_irrign.F90
@@ -73,7 +73,7 @@ TYPE(TEB_IRRIG_t), INTENT(INOUT) :: TIR
 !
 INTEGER           :: ILUOUT         ! output listing logical unit
 INTEGER           :: IRESP          ! IRESP  : return-code if a problem appears
- CHARACTER(LEN=12) :: YRECFM         ! Name of the article to be read
+ CHARACTER(LEN=LEN_HREC) :: YRECFM         ! Name of the article to be read
  CHARACTER(LEN=80) :: YCOMMENT       ! Comment of the article to be read
 INTEGER           :: JLAYER         ! loop index
 !
diff --git a/src/SURFEX/read_pgd_teb_parn.F90 b/src/SURFEX/read_pgd_teb_parn.F90
index f98437026..f8ff1bd9b 100644
--- a/src/SURFEX/read_pgd_teb_parn.F90
+++ b/src/SURFEX/read_pgd_teb_parn.F90
@@ -93,7 +93,7 @@ INTEGER,           INTENT(IN)  :: KNI      ! size of the new domain
 !
 INTEGER           :: ILUOUT         ! output listing logical unit
 INTEGER           :: IRESP          ! IRESP  : return-code if a problem appears
- CHARACTER(LEN=12) :: YRECFM         ! Name of the article to be read
+ CHARACTER(LEN=LEN_HREC) :: YRECFM         ! Name of the article to be read
 INTEGER           :: JLAYER         ! loop index
 !
 INTEGER           :: IVERSION       ! surface version
diff --git a/src/SURFEX/read_pgd_tebn.F90 b/src/SURFEX/read_pgd_tebn.F90
index ab0ca2971..0d0dcddf5 100644
--- a/src/SURFEX/read_pgd_tebn.F90
+++ b/src/SURFEX/read_pgd_tebn.F90
@@ -84,7 +84,7 @@ TYPE(GRID_CONF_PROJ_t),INTENT(INOUT) :: GCP
 !
 INTEGER           :: IRESP          ! Error code after redding
 !
- CHARACTER(LEN=12) :: YRECFM         ! Name of the article to be read
+ CHARACTER(LEN=LEN_HREC) :: YRECFM         ! Name of the article to be read
 INTEGER           :: IVERSION
 INTEGER           :: IBUGFIX
 !
diff --git a/src/SURFEX/read_pgd_tsz0_parn.F90 b/src/SURFEX/read_pgd_tsz0_parn.F90
index 63395f00c..89dda7bb1 100644
--- a/src/SURFEX/read_pgd_tsz0_parn.F90
+++ b/src/SURFEX/read_pgd_tsz0_parn.F90
@@ -71,7 +71,7 @@ TYPE(DATA_TSZ0_t), INTENT(INOUT) :: DTZ
 INTEGER :: IVERSION  ! surface version
 INTEGER :: IBUGFIX   ! bugfix  of the old file
 INTEGER           :: IRESP          ! IRESP  : return-code if a problem appears
- CHARACTER(LEN=12) :: YRECFM         ! Name of the article to be read
+ CHARACTER(LEN=LEN_HREC) :: YRECFM         ! Name of the article to be read
  CHARACTER(LEN=100):: YCOMMENT       ! Comment string
 REAL(KIND=JPRB) :: ZHOOK_HANDLE
 !
diff --git a/src/SURFEX/read_pgd_watfluxn.F90 b/src/SURFEX/read_pgd_watfluxn.F90
index 2cd8151b8..9218dc32d 100644
--- a/src/SURFEX/read_pgd_watfluxn.F90
+++ b/src/SURFEX/read_pgd_watfluxn.F90
@@ -81,7 +81,7 @@ TYPE(WATFLUX_t), INTENT(INOUT) :: W
 !
 INTEGER           :: IRESP          ! Error code after redding
 ! 
- CHARACTER(LEN=12) :: YRECFM         ! Name of the article to be read
+ CHARACTER(LEN=LEN_HREC) :: YRECFM         ! Name of the article to be read
 !
 REAL(KIND=JPRB) :: ZHOOK_HANDLE
 !-------------------------------------------------------------------------------
diff --git a/src/SURFEX/read_prep_file_date.F90 b/src/SURFEX/read_prep_file_date.F90
index c46e417ca..92dbab07e 100644
--- a/src/SURFEX/read_prep_file_date.F90
+++ b/src/SURFEX/read_prep_file_date.F90
@@ -59,7 +59,7 @@ INTEGER,            INTENT(IN)  :: KLUOUT    ! logical unit of output listing
 !
 !*      0.2    declarations of local variables
 !
- CHARACTER(LEN=12), DIMENSION(3000) :: HREC   ! list of records already read/written
+ CHARACTER(LEN=LEN_HREC), DIMENSION(3000) :: HREC   ! list of records already read/written
 INTEGER                            :: IREC
  CHARACTER(LEN=6)              :: YINMODEL  ! model from which GRIB file originates
  CHARACTER(LEN=10)             :: YGRIDTYPE ! Grid type
diff --git a/src/SURFEX/read_seaflux_sbln.F90 b/src/SURFEX/read_seaflux_sbln.F90
index 571a721a7..d079d8a89 100644
--- a/src/SURFEX/read_seaflux_sbln.F90
+++ b/src/SURFEX/read_seaflux_sbln.F90
@@ -75,7 +75,7 @@ TYPE(SURF_ATM_t), INTENT(INOUT) :: U
 !              -------------------------------
 !
 !
- CHARACTER(LEN=12) :: YRECFM         ! Name of the article to be read
+ CHARACTER(LEN=LEN_HREC) :: YRECFM         ! Name of the article to be read
  CHARACTER(LEN=3)  :: YREAD
 INTEGER :: ILU     ! 1D physical dimension
 INTEGER :: IRESP   ! Error code after redding
diff --git a/src/SURFEX/read_seafluxn.F90 b/src/SURFEX/read_seafluxn.F90
index 6549d541d..875ea8da4 100644
--- a/src/SURFEX/read_seafluxn.F90
+++ b/src/SURFEX/read_seafluxn.F90
@@ -85,7 +85,7 @@ INTEGER           :: ILU          ! 1D physical dimension
 !
 INTEGER           :: IRESP          ! Error code after redding
 !
- CHARACTER(LEN=12) :: YRECFM         ! Name of the article to be read
+ CHARACTER(LEN=LEN_HREC) :: YRECFM         ! Name of the article to be read
 !
 INTEGER           :: IVERSION       ! surface version
 !
@@ -239,7 +239,7 @@ SUBROUTINE CHECK_SEA(HFIELD,PFIELD)
 !
 IMPLICIT NONE
 !
- CHARACTER(LEN=12),  INTENT(IN) :: HFIELD
+ CHARACTER(LEN=LEN_HREC),  INTENT(IN) :: HFIELD
 REAL, DIMENSION(:), INTENT(IN) :: PFIELD
 !
 REAL            :: ZMAX,ZMIN
diff --git a/src/SURFEX/read_seaicen.F90 b/src/SURFEX/read_seaicen.F90
index 50ae04ed8..56b873f54 100644
--- a/src/SURFEX/read_seaicen.F90
+++ b/src/SURFEX/read_seaicen.F90
@@ -99,9 +99,9 @@ INTEGER           :: JMTH, INMTH
  CHARACTER(LEN=2 ) :: YMTH
  CHARACTER(LEN=5)  :: YLVL
 !
- CHARACTER(LEN=12) :: YCATEG         ! category to read
- CHARACTER(LEN=12) :: YLEVEL         ! Level to read
- CHARACTER(LEN=12) :: YRECFM         ! Name of the article to be read
+ CHARACTER(LEN=LEN_HREC) :: YCATEG         ! category to read
+ CHARACTER(LEN=LEN_HREC) :: YLEVEL         ! Level to read
+ CHARACTER(LEN=LEN_HREC) :: YRECFM         ! Name of the article to be read
  CHARACTER(LEN=200) :: YMESS         ! Error Message
 !
 INTEGER :: JX,JK,JL                 ! loop counter on ice categories and layers and grid points
@@ -447,7 +447,7 @@ SUBROUTINE CHECK_SEAICE(HFIELD,PFIELD)
 !
 IMPLICIT NONE
 !
- CHARACTER(LEN=12),  INTENT(IN) :: HFIELD
+ CHARACTER(LEN=LEN_HREC),  INTENT(IN) :: HFIELD
 REAL, DIMENSION(:), INTENT(IN) :: PFIELD
 !
 REAL            :: ZMAX,ZMIN
diff --git a/src/SURFEX/read_sso_canopyn.F90 b/src/SURFEX/read_sso_canopyn.F90
index bd2c02b60..ec8ae439a 100644
--- a/src/SURFEX/read_sso_canopyn.F90
+++ b/src/SURFEX/read_sso_canopyn.F90
@@ -74,7 +74,7 @@ TYPE(SURF_ATM_t), INTENT(INOUT) :: U
 !*       0.2   Declarations of local variables
 !              -------------------------------
 !
- CHARACTER(LEN=12) :: YRECFM       ! Name of the article to be read
+ CHARACTER(LEN=LEN_HREC) :: YRECFM       ! Name of the article to be read
  CHARACTER(LEN=3)  :: YREAD
 INTEGER :: ILU     ! 1D physical dimension
 INTEGER :: IRESP   ! Error code after redding
diff --git a/src/SURFEX/read_sson.F90 b/src/SURFEX/read_sson.F90
index 145adfb2f..d213f80c1 100644
--- a/src/SURFEX/read_sson.F90
+++ b/src/SURFEX/read_sson.F90
@@ -85,7 +85,7 @@ TYPE(SURF_ATM_SSO_t), INTENT(INOUT) :: USS
 !
 INTEGER           :: IRESP          ! Error code after redding
 ! 
- CHARACTER(LEN=12) :: YRECFM         ! Name of the article to be read
+ CHARACTER(LEN=LEN_HREC) :: YRECFM         ! Name of the article to be read
 REAL(KIND=JPRB) :: ZHOOK_HANDLE
 !
 !-------------------------------------------------------------------------------
diff --git a/src/SURFEX/read_surf_field2d.F90 b/src/SURFEX/read_surf_field2d.F90
index d2cbd1441..e85dc6c31 100644
--- a/src/SURFEX/read_surf_field2d.F90
+++ b/src/SURFEX/read_surf_field2d.F90
@@ -67,7 +67,7 @@ IMPLICIT NONE
 !
 CHARACTER(LEN=6),                 INTENT(IN) :: HPROGRAM     ! calling program
 REAL, DIMENSION(:,:),          INTENT(INOUT) :: PFIELD2D     ! 2D field to be read
-CHARACTER(LEN=12),                INTENT(IN) :: HFIELDNAME   ! name of the field PFIELD2D. Example : 'X_Y_TG'
+CHARACTER(LEN=LEN_HREC),                INTENT(IN) :: HFIELDNAME   ! name of the field PFIELD2D. Example : 'X_Y_TG'
 CHARACTER(LEN=*), OPTIONAL,      INTENT(OUT) :: HCOMMENT   !comment string
 CHARACTER(LEN=1),OPTIONAL,        INTENT(IN) :: HDIR ! type of field :
 !                                             ! 'H' : field with
@@ -82,7 +82,7 @@ REAL, DIMENSION(SIZE(PFIELD2D,1)) :: ZWORK
 INTEGER           :: IRESP          ! IRESP  : return-code if a problem appears
 INTEGER           :: IPATCH         ! number of patches in PFIELD2D
 CHARACTER(LEN=100):: YCOMMENT       ! Comment string
-CHARACTER(LEN=16) :: YRECFM         ! Name of the article to be read
+CHARACTER(LEN=LEN_HREC) :: YRECFM         ! Name of the article to be read
 CHARACTER(LEN=4 ) :: YPATCH         ! current patch
 INTEGER           :: INB_PROCIO     ! number of processes used for Z-parallel IO with MESO-NH
 !
diff --git a/src/SURFEX/read_surf_field3d.F90 b/src/SURFEX/read_surf_field3d.F90
index 5dfdf9087..49e005418 100644
--- a/src/SURFEX/read_surf_field3d.F90
+++ b/src/SURFEX/read_surf_field3d.F90
@@ -68,7 +68,7 @@ CHARACTER(LEN=6),                 INTENT(IN) :: HPROGRAM     ! calling program
 REAL, DIMENSION(:,:,:),        INTENT(INOUT) :: PFIELD3D     ! 3D field to be read
 INTEGER,                          INTENT(IN) :: KFIRSTLAYER  ! first layer of PFIELD3D to be read
 INTEGER,                          INTENT(IN) :: KLASTLAYER   ! last layer of PFIELD3D to be read
-CHARACTER(LEN=12),                INTENT(IN) :: HFIELDNAME   ! name of the field PFIELD3D. Example : 'X_Y_TG'
+CHARACTER(LEN=LEN_HREC),                INTENT(IN) :: HFIELDNAME   ! name of the field PFIELD3D. Example : 'X_Y_TG'
  CHARACTER(LEN=*), OPTIONAL,     INTENT(OUT) :: HCOMMENT   !comment string
 CHARACTER(LEN=1),OPTIONAL,        INTENT(IN) :: HDIR ! type of field :
 !                                             ! 'H' : field with
@@ -83,7 +83,7 @@ INTEGER           :: IRESP          ! IRESP  : return-code if a problem appears
 INTEGER           :: ILAYER         ! number of layers in PFIELD3D
 INTEGER           :: IPATCH         ! number of patches in PFIELD3D
 CHARACTER(LEN=100):: YCOMMENT       ! Comment string
-CHARACTER(LEN=16) :: YRECFM         ! Name of the article to be read
+CHARACTER(LEN=LEN_HREC) :: YRECFM         ! Name of the article to be read
 CHARACTER(LEN=4 ) :: YLVL           ! current level/layer
 CHARACTER(LEN=4 ) :: YPATCH         ! current patch
 INTEGER           :: INB_PROCIO     ! number of processes used for Z-parallel IO with MESO-NH
diff --git a/src/SURFEX/read_teb_canopyn.F90 b/src/SURFEX/read_teb_canopyn.F90
index 107db89d9..43b8dae95 100644
--- a/src/SURFEX/read_teb_canopyn.F90
+++ b/src/SURFEX/read_teb_canopyn.F90
@@ -75,7 +75,7 @@ TYPE(TEB_OPTIONS_t), INTENT(INOUT) :: TOP
 !              -------------------------------
 !
 !
- CHARACTER(LEN=12) :: YRECFM         ! Name of the article to be read
+ CHARACTER(LEN=LEN_HREC) :: YRECFM         ! Name of the article to be read
  CHARACTER(LEN=3)  :: YREAD
 INTEGER :: JLAYER  ! loop counter on layers
 INTEGER :: ILU     ! 1D physical dimension
diff --git a/src/SURFEX/read_teb_gardenn.F90 b/src/SURFEX/read_teb_gardenn.F90
index 4568cb3f0..61084455f 100644
--- a/src/SURFEX/read_teb_gardenn.F90
+++ b/src/SURFEX/read_teb_gardenn.F90
@@ -90,7 +90,7 @@ LOGICAL           :: GTOWN          ! town variables written in the file
 INTEGER           :: IVERSION, IBUGFIX
 INTEGER           :: ILU            ! 1D physical dimension
 INTEGER           :: IRESP          ! Error code after redding
- CHARACTER(LEN=12) :: YRECFM         ! Name of the article to be read
+ CHARACTER(LEN=LEN_HREC) :: YRECFM         ! Name of the article to be read
  CHARACTER(LEN=4)  :: YLVL
 REAL, DIMENSION(:),ALLOCATABLE  :: ZWORK      ! 2D array to write data in file
 !
diff --git a/src/SURFEX/read_teb_patch.F90 b/src/SURFEX/read_teb_patch.F90
index e5bfa4bcd..c41c136ff 100644
--- a/src/SURFEX/read_teb_patch.F90
+++ b/src/SURFEX/read_teb_patch.F90
@@ -34,7 +34,7 @@ INTEGER,            INTENT(OUT) :: KTEB_PATCH! number of TEB patches
 !* local variables
 !  ---------------
 !
- CHARACTER(LEN=12) :: YRECFM     ! Name of the article to be read
+ CHARACTER(LEN=LEN_HREC) :: YRECFM     ! Name of the article to be read
 INTEGER           :: IRESP      ! reading return code
 !
 INTEGER           :: IVERSION   ! surface version
diff --git a/src/SURFEX/read_tebn.F90 b/src/SURFEX/read_tebn.F90
index 8a0e0398c..6cfdfe3bd 100644
--- a/src/SURFEX/read_tebn.F90
+++ b/src/SURFEX/read_tebn.F90
@@ -98,7 +98,7 @@ INTEGER           :: ILU          ! 1D physical dimension
 !
 INTEGER           :: IRESP          ! Error code after redding
 !
- CHARACTER(LEN=12) :: YRECFM         ! Name of the article to be read
+ CHARACTER(LEN=LEN_HREC) :: YRECFM         ! Name of the article to be read
  CHARACTER(LEN=3)  :: YPATCH         ! suffix if more than 1 patch
 !
 INTEGER           :: IVERSION, IBUGFIX
diff --git a/src/SURFEX/read_watflux_sbln.F90 b/src/SURFEX/read_watflux_sbln.F90
index b205478ce..8798d7a99 100644
--- a/src/SURFEX/read_watflux_sbln.F90
+++ b/src/SURFEX/read_watflux_sbln.F90
@@ -74,7 +74,7 @@ TYPE(WATFLUX_SBL_t), INTENT(INOUT) :: WSB
 !*       0.2   Declarations of local variables
 !              -------------------------------
 !
- CHARACTER(LEN=12) :: YRECFM         ! Name of the article to be read
+ CHARACTER(LEN=LEN_HREC) :: YRECFM         ! Name of the article to be read
  CHARACTER(LEN=3)  :: YREAD
 INTEGER :: JLAYER  ! loop counter on layers
 INTEGER :: ILU     ! 1D physical dimension
diff --git a/src/SURFEX/read_watfluxn.F90 b/src/SURFEX/read_watfluxn.F90
index c8d58fc0c..9ece26cd0 100644
--- a/src/SURFEX/read_watfluxn.F90
+++ b/src/SURFEX/read_watfluxn.F90
@@ -79,7 +79,7 @@ INTEGER           :: ILU          ! 1D physical dimension
 !
 INTEGER           :: IRESP          ! Error code after redding
 !
- CHARACTER(LEN=12) :: YRECFM         ! Name of the article to be read
+ CHARACTER(LEN=LEN_HREC) :: YRECFM         ! Name of the article to be read
 REAL(KIND=JPRB) :: ZHOOK_HANDLE
 !
 !-------------------------------------------------------------------------------
diff --git a/src/SURFEX/test_record_len.F90 b/src/SURFEX/test_record_len.F90
index a80b821ef..4a1c75ea5 100644
--- a/src/SURFEX/test_record_len.F90
+++ b/src/SURFEX/test_record_len.F90
@@ -30,23 +30,27 @@ IMPLICIT NONE
 TYPE(DIAG_SURF_ATM_t), INTENT(INOUT) :: DGU
 !
  CHARACTER(LEN=6),   INTENT(IN)  :: HPROGRAM ! calling program
- CHARACTER(LEN=12),  INTENT(IN)  :: HREC     ! name of the article to be written
+ CHARACTER(LEN=LEN_HREC),  INTENT(IN)  :: HREC     ! name of the article to be written
 LOGICAL,            INTENT(OUT) :: ONOWRITE ! flag for article to be written
 !
- CHARACTER(LEN=12) :: YREC
+ CHARACTER(LEN=LEN_HREC) :: YREC
 INTEGER :: IFIELD,JFIELD
 INTEGER :: ILUOUT  ! listing logical unit
 REAL(KIND=JPRB) :: ZHOOK_HANDLE
+
+CHARACTER(LEN=12) :: YFMT
+
 !-------------------------------------------------------------------------------
 IF (LHOOK) CALL DR_HOOK('MODI_WRITE_SURF:TEST_RECORD_LEN',0,ZHOOK_HANDLE)
-IF (LEN_TRIM(HREC)>12) THEN
+IF (LEN_TRIM(HREC)>LEN_HREC) THEN
   CALL GET_LUOUT(HPROGRAM,ILUOUT)
   WRITE(ILUOUT,*) '----------------------------------------------'
   WRITE(ILUOUT,*) 'Error occured when writing a field            '
   WRITE(ILUOUT,*) 'The name of the field is too long             '
-  WRITE(ILUOUT,*) 'The name must not be longer than 12 characters'
+  WRITE(ILUOUT,*) 'The name must not be longer than',LEN_HREC,' characters'
   WRITE(ILUOUT,*) 'Please shorten the name of your field         '
-  WRITE(ILUOUT,FMT='(A32,A12,A1)') ' The field name currently is : "',HREC,'"'
+  WRITE(YFMT,FMT='("(A32,A",I2.2,",A1)")') LEN_HREC
+  WRITE(ILUOUT,FMT=YFMT) ' The field name currently is : "',HREC,'"'
   WRITE(ILUOUT,*) '----------------------------------------------'
   CALL ABOR1_SFX('TEST_RECORD_LEN: FIELD NAME TOO LONG --> '//HREC)
 END IF
diff --git a/src/SURFEX/write_diag_ch_aggr.F90 b/src/SURFEX/write_diag_ch_aggr.F90
index e43850775..837532b2f 100644
--- a/src/SURFEX/write_diag_ch_aggr.F90
+++ b/src/SURFEX/write_diag_ch_aggr.F90
@@ -66,7 +66,7 @@ TYPE(CH_EMIS_FIELD_t), INTENT(INOUT) :: CHE
 !
 
 INTEGER           :: IRESP          ! IRESP  : return-code if a problem appears
- CHARACTER(LEN=12) :: YRECFM         ! Name of the article to be read
+ CHARACTER(LEN=LEN_HREC) :: YRECFM         ! Name of the article to be read
  CHARACTER(LEN=100):: YCOMMENT       ! Comment string
 !
 INTEGER           :: JSPEC
diff --git a/src/SURFEX/write_diag_misc_flaken.F90 b/src/SURFEX/write_diag_misc_flaken.F90
index 8bf92ba45..af04ee79e 100644
--- a/src/SURFEX/write_diag_misc_flaken.F90
+++ b/src/SURFEX/write_diag_misc_flaken.F90
@@ -62,7 +62,7 @@ TYPE(DIAG_MISC_FLAKE_t), INTENT(INOUT) :: DGMF
 !              -------------------------------
 !
 INTEGER           :: IRESP          ! IRESP  : return-code if a problem appears
- CHARACTER(LEN=12) :: YRECFM         ! Name of the article to be read
+ CHARACTER(LEN=LEN_HREC) :: YRECFM         ! Name of the article to be read
  CHARACTER(LEN=100):: YCOMMENT       ! Comment string
 INTEGER           :: IZ
 REAL(KIND=JPRB) :: ZHOOK_HANDLE
diff --git a/src/SURFEX/write_diag_misc_isban.F90 b/src/SURFEX/write_diag_misc_isban.F90
index 9266f97f6..4e12dd80c 100644
--- a/src/SURFEX/write_diag_misc_isban.F90
+++ b/src/SURFEX/write_diag_misc_isban.F90
@@ -94,7 +94,7 @@ TYPE(ISBA_t), INTENT(INOUT) :: I
 !
 INTEGER           :: IRESP          ! IRESP  : return-code if a problem appears
  CHARACTER(LEN=1) :: YVAR
- CHARACTER(LEN=12) :: YRECFM         ! Name of the article to be read
+ CHARACTER(LEN=LEN_HREC) :: YRECFM         ! Name of the article to be read
  CHARACTER(LEN=100):: YCOMMENT       ! Comment string
  CHARACTER(LEN=100):: YCOMMENTUNIT   ! Comment string : unit of the datas in the field to write
  CHARACTER(LEN=2)  :: YLVL
diff --git a/src/SURFEX/write_diag_misc_tebn.F90 b/src/SURFEX/write_diag_misc_tebn.F90
index 77d4be38b..3b9c9709f 100644
--- a/src/SURFEX/write_diag_misc_tebn.F90
+++ b/src/SURFEX/write_diag_misc_tebn.F90
@@ -74,7 +74,7 @@ INTEGER,           INTENT(IN)  :: KTEB_PATCH ! patch number being written
 !
 INTEGER           :: IRESP          ! IRESP  : return-code if a problem appears
  CHARACTER(LEN=3)  :: YPATCH         ! Prefix for current patch
- CHARACTER(LEN=12) :: YRECFM         ! Name of the article to be read
+ CHARACTER(LEN=LEN_HREC) :: YRECFM         ! Name of the article to be read
  CHARACTER(LEN=100):: YCOMMENT       ! Comment string
 REAL(KIND=JPRB) :: ZHOOK_HANDLE
 !
diff --git a/src/SURFEX/write_diag_pgd_grdnn.F90 b/src/SURFEX/write_diag_pgd_grdnn.F90
index bb3214a69..46525984a 100644
--- a/src/SURFEX/write_diag_pgd_grdnn.F90
+++ b/src/SURFEX/write_diag_pgd_grdnn.F90
@@ -82,7 +82,7 @@ TYPE(TEB_VEG_OPTIONS_t), INTENT(INOUT) :: TVG
 !              -------------------------------
 !
 INTEGER           :: IRESP          ! IRESP  : return-code if a problem appears
- CHARACTER(LEN=12) :: YRECFM         ! Name of the article to be read
+ CHARACTER(LEN=LEN_HREC) :: YRECFM         ! Name of the article to be read
  CHARACTER(LEN=100):: YCOMMENT       ! Comment string
  CHARACTER(LEN=2)  :: YLVLV, YPAS
 !
diff --git a/src/SURFEX/write_diag_pgd_isban.F90 b/src/SURFEX/write_diag_pgd_isban.F90
index b0ff27cd9..e22ce8e79 100644
--- a/src/SURFEX/write_diag_pgd_isban.F90
+++ b/src/SURFEX/write_diag_pgd_isban.F90
@@ -91,7 +91,7 @@ REAL, DIMENSION(SIZE(I%XDG,1)            ) :: ZDG2
 REAL, DIMENSION(SIZE(I%XDG,1)            ) :: ZDTOT
 !
 INTEGER           :: IRESP          ! IRESP  : return-code if a problem appears
- CHARACTER(LEN=12) :: YRECFM         ! Name of the article to be read
+ CHARACTER(LEN=LEN_HREC) :: YRECFM         ! Name of the article to be read
  CHARACTER(LEN=100):: YCOMMENT       ! Comment string
   CHARACTER(LEN=100):: YCOMMENTUNIT   ! Comment string : unit of the datas in the field to write
  CHARACTER(LEN=2)  :: YLVLV, YPAS
diff --git a/src/SURFEX/write_diag_pgd_tebn.F90 b/src/SURFEX/write_diag_pgd_tebn.F90
index a91d201f1..3c9402fee 100644
--- a/src/SURFEX/write_diag_pgd_tebn.F90
+++ b/src/SURFEX/write_diag_pgd_tebn.F90
@@ -84,7 +84,7 @@ TYPE(TEB_PANEL_t), INTENT(INOUT) :: TPN
 !              -------------------------------
 !
 INTEGER           :: IRESP          ! IRESP  : return-code if a problem appears
- CHARACTER(LEN=12) :: YRECFM         ! Name of the article to be read
+ CHARACTER(LEN=LEN_HREC) :: YRECFM         ! Name of the article to be read
  CHARACTER(LEN=100):: YCOMMENT       ! Comment string
 INTEGER           :: JLAYER         ! loop counter on layers
 !
diff --git a/src/SURFEX/write_diag_seb_flaken.F90 b/src/SURFEX/write_diag_seb_flaken.F90
index 638cb8567..0b390bdb1 100644
--- a/src/SURFEX/write_diag_seb_flaken.F90
+++ b/src/SURFEX/write_diag_seb_flaken.F90
@@ -81,7 +81,7 @@ TYPE(DIAG_FLAKE_t), INTENT(INOUT) :: DGF
 !              -------------------------------
 !
 INTEGER           :: IRESP          ! IRESP  : return-code if a problem appears
- CHARACTER(LEN=12) :: YRECFM         ! Name of the article to be read
+ CHARACTER(LEN=LEN_HREC) :: YRECFM         ! Name of the article to be read
  CHARACTER(LEN=100):: YCOMMENT       ! Comment string
  CHARACTER(LEN=2)  :: YNUM
 !
diff --git a/src/SURFEX/write_diag_seb_isban.F90 b/src/SURFEX/write_diag_seb_isban.F90
index b6235af0b..e8ca82fa3 100644
--- a/src/SURFEX/write_diag_seb_isban.F90
+++ b/src/SURFEX/write_diag_seb_isban.F90
@@ -103,7 +103,7 @@ TYPE(ISBA_t), INTENT(INOUT) :: I
 !              -------------------------------
 !
 INTEGER           :: IRESP          ! IRESP  : return-code if a problem appears
- CHARACTER(LEN=12) :: YRECFM         ! Name of the article to be write
+ CHARACTER(LEN=LEN_HREC) :: YRECFM         ! Name of the article to be write
  CHARACTER(LEN=100):: YCOMMENT       ! Comment string
  CHARACTER(LEN=100):: YCOMMENTUNIT   ! Comment string : unit of the datas in the field to write
  CHARACTER(LEN=2)  :: YNUM
diff --git a/src/SURFEX/write_diag_seb_oceann.F90 b/src/SURFEX/write_diag_seb_oceann.F90
index 5f4d2bc44..33e7937ca 100644
--- a/src/SURFEX/write_diag_seb_oceann.F90
+++ b/src/SURFEX/write_diag_seb_oceann.F90
@@ -64,7 +64,7 @@ TYPE(DIAG_OCEAN_t), INTENT(INOUT) :: DGO
 !              -------------------------------
 !
 INTEGER           :: IRESP          ! IRESP  : return-code if a problem appears
- CHARACTER(LEN=12) :: YRECFM         ! Name of the article to be read
+ CHARACTER(LEN=LEN_HREC) :: YRECFM         ! Name of the article to be read
  CHARACTER(LEN=100):: YCOMMENT       ! Comment string
 REAL(KIND=JPRB) :: ZHOOK_HANDLE
 !
diff --git a/src/SURFEX/write_diag_seb_seafluxn.F90 b/src/SURFEX/write_diag_seb_seafluxn.F90
index b267767c7..40eb92b65 100644
--- a/src/SURFEX/write_diag_seb_seafluxn.F90
+++ b/src/SURFEX/write_diag_seb_seafluxn.F90
@@ -86,7 +86,7 @@ TYPE(SEAFLUX_t), INTENT(INOUT) :: S
 !              -------------------------------
 !
 INTEGER           :: IRESP          ! IRESP  : return-code if a problem appears
- CHARACTER(LEN=12) :: YRECFM         ! Name of the article to be read
+ CHARACTER(LEN=LEN_HREC) :: YRECFM         ! Name of the article to be read
  CHARACTER(LEN=100):: YCOMMENT       ! Comment string
  CHARACTER(LEN=2)  :: YNUM
 !
diff --git a/src/SURFEX/write_diag_seb_seaicen.F90 b/src/SURFEX/write_diag_seb_seaicen.F90
index 9d9693946..0f697c3bf 100644
--- a/src/SURFEX/write_diag_seb_seaicen.F90
+++ b/src/SURFEX/write_diag_seb_seaicen.F90
@@ -70,7 +70,7 @@ TYPE(SEAFLUX_t), INTENT(INOUT) :: S
 !              -------------------------------
 !
 INTEGER           :: IRESP          ! IRESP  : return-code if a problem appears
- CHARACTER(LEN=12) :: YRECFM         ! Name of the article to be read
+ CHARACTER(LEN=LEN_HREC) :: YRECFM         ! Name of the article to be read
  CHARACTER(LEN=100):: YCOMMENT       ! Comment string
  CHARACTER(LEN=2)  :: YNUM
 INTEGER           :: JSV, JSW
diff --git a/src/SURFEX/write_diag_seb_surf_atmn.F90 b/src/SURFEX/write_diag_seb_surf_atmn.F90
index 746961547..35a659f0a 100644
--- a/src/SURFEX/write_diag_seb_surf_atmn.F90
+++ b/src/SURFEX/write_diag_seb_surf_atmn.F90
@@ -71,7 +71,7 @@ TYPE(SURF_ATM_GRID_t), INTENT(INOUT) :: UG
 !
 
 INTEGER           :: IRESP          ! IRESP  : return-code if a problem appears
- CHARACTER(LEN=12) :: YRECFM         ! Name of the article to be read
+ CHARACTER(LEN=LEN_HREC) :: YRECFM         ! Name of the article to be read
  CHARACTER(LEN=100):: YCOMMENT       ! Comment string
  CHARACTER(LEN=2)  :: YNUM
 !
diff --git a/src/SURFEX/write_diag_seb_tebn.F90 b/src/SURFEX/write_diag_seb_tebn.F90
index 7b022fbb4..40c1cbc65 100644
--- a/src/SURFEX/write_diag_seb_tebn.F90
+++ b/src/SURFEX/write_diag_seb_tebn.F90
@@ -79,7 +79,7 @@ TYPE(DIAG_UTCI_TEB_t), INTENT(INOUT) :: DGUT
 !              -------------------------------
 !
 INTEGER           :: IRESP          ! IRESP  : return-code if a problem appears
- CHARACTER(LEN=12) :: YRECFM         ! Name of the article to be read
+ CHARACTER(LEN=LEN_HREC) :: YRECFM         ! Name of the article to be read
  CHARACTER(LEN=100):: YCOMMENT       ! Comment string
  CHARACTER(LEN=2)  :: YNUM
 !
diff --git a/src/SURFEX/write_diag_seb_watfluxn.F90 b/src/SURFEX/write_diag_seb_watfluxn.F90
index e04d1bd1f..207dcdbb1 100644
--- a/src/SURFEX/write_diag_seb_watfluxn.F90
+++ b/src/SURFEX/write_diag_seb_watfluxn.F90
@@ -82,7 +82,7 @@ TYPE(DIAG_WATFLUX_t), INTENT(INOUT) :: DGW
 !              -------------------------------
 !
 INTEGER           :: IRESP          ! IRESP  : return-code if a problem appears
- CHARACTER(LEN=12) :: YRECFM         ! Name of the article to be written
+ CHARACTER(LEN=LEN_HREC) :: YRECFM         ! Name of the article to be written
  CHARACTER(LEN=100):: YCOMMENT       ! Comment string
  CHARACTER(LEN=2)  :: YNUM
 !
diff --git a/src/SURFEX/write_ecoclimap2_data.F90 b/src/SURFEX/write_ecoclimap2_data.F90
index f92002d6e..978d4a27a 100644
--- a/src/SURFEX/write_ecoclimap2_data.F90
+++ b/src/SURFEX/write_ecoclimap2_data.F90
@@ -37,7 +37,7 @@ TYPE(SURF_ATM_t), INTENT(INOUT) :: U
 !* local variables
 !  ---------------
 !
- CHARACTER(LEN=12) :: YRECFM     ! Name of the article to be read
+ CHARACTER(LEN=LEN_HREC) :: YRECFM     ! Name of the article to be read
  CHARACTER(LEN=100):: YCOMMENT   ! Comment
 INTEGER           :: IRESP      ! reading return code
 !
diff --git a/src/SURFEX/write_lcover.F90 b/src/SURFEX/write_lcover.F90
index f16aba540..d35909aec 100644
--- a/src/SURFEX/write_lcover.F90
+++ b/src/SURFEX/write_lcover.F90
@@ -68,7 +68,7 @@ LOGICAL, DIMENSION(JPCOVER)    :: OCOVER   ! list of covers
 TYPE(DIAG_SURF_ATM_t), INTENT(INOUT) :: DGU
 TYPE(SURF_ATM_t), INTENT(INOUT) :: U
 INTEGER           :: IRESP          ! Error code after reading
-CHARACTER(LEN=12) :: YRECFM         ! Name of the article to be read
+CHARACTER(LEN=LEN_HREC) :: YRECFM         ! Name of the article to be read
 CHARACTER(LEN=100):: YCOMMENT       ! Comment string
 LOGICAL, DIMENSION(JPCOVER)    :: GCOVER   ! tmp list of covers
 REAL(KIND=JPRB) :: ZHOOK_HANDLE
diff --git a/src/SURFEX/write_surf.F90 b/src/SURFEX/write_surf.F90
index 7355d1ec4..12c51ed98 100644
--- a/src/SURFEX/write_surf.F90
+++ b/src/SURFEX/write_surf.F90
@@ -50,7 +50,7 @@ INTEGER,            INTENT(OUT) :: KRESP    ! KRESP  : return-code if a problem
 !                                             ! 'H' : field with
 !                                             !       horizontal spatial dim.
 !                                             ! '-' : no horizontal dim.
- CHARACTER(LEN=16), OPTIONAL,  INTENT(IN) :: HNAM_DIM
+ CHARACTER(LEN=LEN_HREC), OPTIONAL,  INTENT(IN) :: HNAM_DIM
 END SUBROUTINE WRITE_SURFX1
 !
      SUBROUTINE WRITE_SURFX2 (DGU, U, &
@@ -71,7 +71,7 @@ INTEGER,              INTENT(OUT) :: KRESP    ! KRESP  : return-code if a proble
 !                                             ! 'H' : field with
 !                                             !       horizontal spatial dim.
 !                                             ! '-' : no horizontal dim.
- CHARACTER(LEN=16), OPTIONAL,  INTENT(IN) :: HNAM_DIM
+ CHARACTER(LEN=LEN_HREC), OPTIONAL,  INTENT(IN) :: HNAM_DIM
 END SUBROUTINE WRITE_SURFX2
 !
 !RJ: interface to WRITE_SURFX2COV moved out
@@ -111,7 +111,7 @@ INTEGER,               INTENT(OUT) :: KRESP    ! KRESP  : return-code if a probl
 !                                             ! 'H' : field with
 !                                             !       horizontal spatial dim.
 !                                             ! '-' : no horizontal dim.
- CHARACTER(LEN=16), OPTIONAL,  INTENT(IN) :: HNAM_DIM
+ CHARACTER(LEN=LEN_HREC), OPTIONAL,  INTENT(IN) :: HNAM_DIM
 END SUBROUTINE WRITE_SURFN1
 !
      SUBROUTINE WRITE_SURFC0 (DGU, U, &
@@ -295,7 +295,7 @@ INTEGER,           INTENT(OUT):: KRESP    ! KRESP  : return-code if a problem ap
 !
 !*      0.2   Declarations of local variables
 !
- CHARACTER(LEN=12)  :: YREC
+ CHARACTER(LEN=LEN_HREC)  :: YREC
 LOGICAL :: LNOWRITE
 REAL   :: XTIME0
 REAL(KIND=JPRB) :: ZHOOK_HANDLE
@@ -453,10 +453,10 @@ INTEGER,            INTENT(OUT) :: KRESP    ! KRESP  : return-code if a problem
 !                                             ! 'H' : field with
 !                                             !       horizontal spatial dim.
 !                                             ! '-' : no horizontal dim.
- CHARACTER(LEN=16), OPTIONAL,  INTENT(IN) :: HNAM_DIM
+ CHARACTER(LEN=LEN_HREC), OPTIONAL,  INTENT(IN) :: HNAM_DIM
 !*      0.2   Declarations of local variables
 !
- CHARACTER(LEN=12)  :: YREC
+ CHARACTER(LEN=LEN_HREC)  :: YREC
 INTEGER            :: IL
  CHARACTER(LEN=1)   :: YDIR
 LOGICAL :: LNOWRITE
@@ -606,10 +606,10 @@ INTEGER,              INTENT(OUT) :: KRESP    ! KRESP  : return-code if a proble
 !                                             ! 'H' : field with
 !                                             !       horizontal spatial dim.
 !                                             ! '-' : no horizontal dim.
- CHARACTER(LEN=16), OPTIONAL,  INTENT(IN) :: HNAM_DIM
+ CHARACTER(LEN=LEN_HREC), OPTIONAL,  INTENT(IN) :: HNAM_DIM
 !*      0.2   Declarations of local variables
 !
- CHARACTER(LEN=12)  :: YREC
+ CHARACTER(LEN=LEN_HREC)  :: YREC
 INTEGER            :: IL1
 INTEGER            :: IL2
  CHARACTER(LEN=1)   :: YDIR
@@ -764,7 +764,7 @@ INTEGER,            INTENT(OUT) :: KRESP    ! KRESP  : return-code if a problem
 !
 !*      0.2   Declarations of local variables
 !
- CHARACTER(LEN=12)  :: YREC
+ CHARACTER(LEN=LEN_HREC)  :: YREC
 LOGICAL :: LNOWRITE
 REAL   :: XTIME0
 REAL(KIND=JPRB) :: ZHOOK_HANDLE
@@ -919,10 +919,10 @@ INTEGER,               INTENT(OUT) :: KRESP    ! KRESP  : return-code if a probl
 !                                             ! 'H' : field with
 !                                             !       horizontal spatial dim.
 !                                             ! '-' : no horizontal dim.
- CHARACTER(LEN=16), OPTIONAL,  INTENT(IN) :: HNAM_DIM
+ CHARACTER(LEN=LEN_HREC), OPTIONAL,  INTENT(IN) :: HNAM_DIM
 !*      0.2   Declarations of local variables
 !
- CHARACTER(LEN=12)  :: YREC
+ CHARACTER(LEN=LEN_HREC)  :: YREC
 INTEGER            :: IL
  CHARACTER(LEN=1)   :: YDIR
 LOGICAL :: LNOWRITE
@@ -1074,7 +1074,7 @@ INTEGER,             INTENT(OUT) :: KRESP    ! KRESP  : return-code if a problem
 !
 !*      0.2   Declarations of local variables
 !
- CHARACTER(LEN=12)  :: YREC
+ CHARACTER(LEN=LEN_HREC)  :: YREC
  CHARACTER(LEN=40)  :: YFIELD
 LOGICAL :: LNOWRITE
 REAL   :: XTIME0
@@ -1234,7 +1234,7 @@ INTEGER,            INTENT(OUT) :: KRESP    ! KRESP  : return-code if a problem
 !
 !*      0.2   Declarations of local variables
 !
- CHARACTER(LEN=12)  :: YREC
+ CHARACTER(LEN=LEN_HREC)  :: YREC
 LOGICAL :: LNOWRITE
 REAL   :: XTIME0
 REAL(KIND=JPRB) :: ZHOOK_HANDLE
@@ -1390,7 +1390,7 @@ INTEGER,               INTENT(OUT) :: KRESP    ! KRESP  : return-code if a probl
 !                                             ! '-' : no horizontal dim.
 !*      0.2   Declarations of local variables
 !
- CHARACTER(LEN=12)  :: YREC
+ CHARACTER(LEN=LEN_HREC)  :: YREC
 INTEGER            :: IL
  CHARACTER(LEN=1)   :: YDIR
 LOGICAL :: LNOWRITE
@@ -1538,7 +1538,7 @@ INTEGER,            INTENT(OUT) :: KRESP    ! KRESP  : return-code if a problem
 !
 !*      0.2   Declarations of local variables
 !
- CHARACTER(LEN=12)  :: YREC
+ CHARACTER(LEN=LEN_HREC)  :: YREC
 REAL    :: ZTIME
 REAL   :: XTIME0
 INTEGER :: IDAY
@@ -1691,7 +1691,7 @@ INTEGER,            INTENT(OUT) :: KRESP    ! KRESP  : return-code if a problem
 !
 !*      0.2   Declarations of local variables
 !
- CHARACTER(LEN=12)  :: YREC
+ CHARACTER(LEN=LEN_HREC)  :: YREC
 INTEGER :: IL1
 REAL ,   DIMENSION(SIZE(TFIELD,1)) :: ZTIME
 INTEGER, DIMENSION(SIZE(TFIELD,1)) :: IDAY
@@ -1824,7 +1824,7 @@ INTEGER,            INTENT(OUT) :: KRESP    ! KRESP  : return-code if a problem
 !
 !*      0.2   Declarations of local variables
 !
- CHARACTER(LEN=12)  :: YREC
+ CHARACTER(LEN=LEN_HREC)  :: YREC
 INTEGER :: IL1, IL2
 REAL ,   DIMENSION(SIZE(TFIELD,1),SIZE(TFIELD,2)) :: ZTIME
 INTEGER, DIMENSION(SIZE(TFIELD,1),SIZE(TFIELD,2)) :: IDAY
diff --git a/src/SURFEX/write_surf_field2d.F90 b/src/SURFEX/write_surf_field2d.F90
index 78c4f2713..5cbdcca8a 100644
--- a/src/SURFEX/write_surf_field2d.F90
+++ b/src/SURFEX/write_surf_field2d.F90
@@ -70,21 +70,21 @@ TYPE(DIAG_SURF_ATM_t), INTENT(INOUT) :: DGU
 TYPE(SURF_ATM_t), INTENT(INOUT) :: U
 CHARACTER(LEN=6),                 INTENT(IN) :: HPROGRAM     ! calling program
 REAL, DIMENSION(:,:),             INTENT(IN) :: PFIELD2D     ! 2D field to be written
-CHARACTER(LEN=12),                INTENT(IN) :: HFIELDNAME   ! name of the field PFIELD2D. Example : 'X_Y_TG'
+CHARACTER(LEN=LEN_HREC),                INTENT(IN) :: HFIELDNAME   ! name of the field PFIELD2D. Example : 'X_Y_TG'
 CHARACTER(LEN=100),               INTENT(IN) :: HCOMMENT     ! Comment string
 CHARACTER(LEN=100),               INTENT(IN) :: HCOMMENTUNIT ! unit of the datas in PFIELD2D
  CHARACTER(LEN=1),OPTIONAL,       INTENT(IN) :: HDIR ! type of field :
 !                                             ! 'H' : field with
 !                                             !       horizontal spatial dim.
 !                                             ! '-' : no horizontal dim.
- CHARACTER(LEN=16), OPTIONAL,  INTENT(IN) :: HNAM_DIM
+ CHARACTER(LEN=LEN_HREC), OPTIONAL,  INTENT(IN) :: HNAM_DIM
  !
 !*       0.2   Declarations of local variables
 !              -------------------------------
 !
 INTEGER           :: IRESP          ! IRESP  : return-code if a problem appears
 INTEGER           :: IPATCH         ! number of patches in PFIELD2D
-CHARACTER(LEN=16) :: YRECFM         ! Name of the article to be read
+CHARACTER(LEN=LEN_HREC) :: YRECFM         ! Name of the article to be read
 CHARACTER(LEN=4 ) :: YPATCH         ! current patch
 CHARACTER(LEN=100):: YCOMMENT       ! Comment string
 INTEGER           :: INB_PROCIO     ! number of processes used for Z-parallel IO with MESO-NH
diff --git a/src/SURFEX/write_surf_field3d.F90 b/src/SURFEX/write_surf_field3d.F90
index c52a022a9..05b4d5652 100644
--- a/src/SURFEX/write_surf_field3d.F90
+++ b/src/SURFEX/write_surf_field3d.F90
@@ -72,14 +72,14 @@ CHARACTER(LEN=6),                 INTENT(IN) :: HPROGRAM     ! calling program
 REAL, DIMENSION(:,:,:),           INTENT(IN) :: PFIELD3D     ! 3D field to be written
 INTEGER,                          INTENT(IN) :: KFIRSTLAYER  ! first layer of PFIELD3D to be written
 INTEGER,                          INTENT(IN) :: KLASTLAYER   ! last layer of PFIELD3D to be written
-CHARACTER(LEN=12),                INTENT(IN) :: HFIELDNAME   ! name of the field PFIELD3D. Example : 'X_Y_TG'
+CHARACTER(LEN=LEN_HREC),                INTENT(IN) :: HFIELDNAME   ! name of the field PFIELD3D. Example : 'X_Y_TG'
 CHARACTER(LEN=100),               INTENT(IN) :: HCOMMENT     ! Comment string
 CHARACTER(LEN=100),               INTENT(IN) :: HCOMMENTUNIT ! unit of the datas in PFIELD3D
  CHARACTER(LEN=1),OPTIONAL,       INTENT(IN) :: HDIR ! type of field :
 !                                             ! 'H' : field with
 !                                             !       horizontal spatial dim.
 !                                             ! '-' : no horizontal dim.
- CHARACTER(LEN=16), OPTIONAL,  INTENT(IN) :: HNAM_DIM
+ CHARACTER(LEN=LEN_HREC), OPTIONAL,  INTENT(IN) :: HNAM_DIM
 !
 !*       0.2   Declarations of local variables
 !              -------------------------------
@@ -87,7 +87,7 @@ CHARACTER(LEN=100),               INTENT(IN) :: HCOMMENTUNIT ! unit of the datas
 INTEGER           :: IRESP          ! IRESP  : return-code if a problem appears
 INTEGER           :: ILAYER         ! number of layers in PFIELD3D
 INTEGER           :: IPATCH         ! number of patches in PFIELD3D
-CHARACTER(LEN=16) :: YRECFM         ! Name of the article to be read
+CHARACTER(LEN=LEN_HREC) :: YRECFM         ! Name of the article to be read
 CHARACTER(LEN=4 ) :: YLVL           ! current level/layer
 CHARACTER(LEN=4 ) :: YPATCH         ! current patch
 CHARACTER(LEN=100):: YCOMMENT       ! Comment string
diff --git a/src/SURFEX/writesurf_ch_emisn.F90 b/src/SURFEX/writesurf_ch_emisn.F90
index 70088f4ec..d54242440 100644
--- a/src/SURFEX/writesurf_ch_emisn.F90
+++ b/src/SURFEX/writesurf_ch_emisn.F90
@@ -63,7 +63,7 @@ TYPE(CH_EMIS_FIELD_t), INTENT(INOUT) :: CHE
 INTEGER           :: IRESP          ! IRESP  : return-code if a problem appears 
                                     ! at the open of the file in LFI  routines 
 !
- CHARACTER(LEN=12) :: YRECFM         ! Name of the article to be written
+ CHARACTER(LEN=LEN_HREC) :: YRECFM         ! Name of the article to be written
  CHARACTER(LEN=100):: YCOMMENT       ! Comment string
  CHARACTER(LEN=100):: YCOMMENTUNIT   ! Comment string : unit of the datas in the field to write 
  CHARACTER(LEN=80) :: YNAME          ! emitted species name
diff --git a/src/SURFEX/writesurf_covern.F90 b/src/SURFEX/writesurf_covern.F90
index ecb5d69d7..27901272b 100644
--- a/src/SURFEX/writesurf_covern.F90
+++ b/src/SURFEX/writesurf_covern.F90
@@ -71,7 +71,7 @@ TYPE(SURF_ATM_t), INTENT(INOUT) :: U
 !              -------------------------------
 !
 INTEGER           :: IRESP          ! IRESP  : return-code if a problem appears
- CHARACTER(LEN=12) :: YRECFM         ! Name of the article to be read
+ CHARACTER(LEN=LEN_HREC) :: YRECFM         ! Name of the article to be read
  CHARACTER(LEN=100):: YCOMMENT       ! Comment string
 REAL(KIND=JPRB) :: ZHOOK_HANDLE
 INTEGER :: IINFO
diff --git a/src/SURFEX/writesurf_cpl_gcmn.F90 b/src/SURFEX/writesurf_cpl_gcmn.F90
index aa7156dcf..cccde84f0 100644
--- a/src/SURFEX/writesurf_cpl_gcmn.F90
+++ b/src/SURFEX/writesurf_cpl_gcmn.F90
@@ -78,7 +78,7 @@ TYPE(SURF_ATM_t), INTENT(INOUT) :: U
 !
 !
 INTEGER           :: IRESP          ! Error code after redding
- CHARACTER(LEN=12) :: YRECFM         ! Name of the article to be read
+ CHARACTER(LEN=LEN_HREC) :: YRECFM         ! Name of the article to be read
  CHARACTER(LEN=100):: YCOMMENT       ! Comment string
 REAL(KIND=JPRB) :: ZHOOK_HANDLE
 !
diff --git a/src/SURFEX/writesurf_dummyn.F90 b/src/SURFEX/writesurf_dummyn.F90
index 5889e72d2..608087835 100644
--- a/src/SURFEX/writesurf_dummyn.F90
+++ b/src/SURFEX/writesurf_dummyn.F90
@@ -64,7 +64,7 @@ INTEGER           :: JDUMMY         ! loop counter
  CHARACTER(LEN=3  ):: YSTRING03      ! string
 !
 INTEGER           :: IRESP          ! IRESP  : return-code if a problem appears
- CHARACTER(LEN=12) :: YRECFM         ! Name of the article to be read
+ CHARACTER(LEN=LEN_HREC) :: YRECFM         ! Name of the article to be read
  CHARACTER(LEN=100):: YCOMMENT       ! Comment string
 REAL(KIND=JPRB) :: ZHOOK_HANDLE
 !
diff --git a/src/SURFEX/writesurf_flake_sbln.F90 b/src/SURFEX/writesurf_flake_sbln.F90
index de59c113d..e2b36cfe3 100644
--- a/src/SURFEX/writesurf_flake_sbln.F90
+++ b/src/SURFEX/writesurf_flake_sbln.F90
@@ -78,7 +78,7 @@ TYPE(FLAKE_SBL_t), INTENT(INOUT) :: FSB
 !              -------------------------------
 !
 INTEGER           :: IRESP          ! IRESP  : return-code if a problem appears
- CHARACTER(LEN=12) :: YRECFM         ! Name of the article to be read
+ CHARACTER(LEN=LEN_HREC) :: YRECFM         ! Name of the article to be read
  CHARACTER(LEN=100):: YCOMMENT       ! Comment string
 !
 INTEGER :: JLAYER  ! loop counter on layers
diff --git a/src/SURFEX/writesurf_flaken.F90 b/src/SURFEX/writesurf_flaken.F90
index e55d19c4e..dbaa7e04e 100644
--- a/src/SURFEX/writesurf_flaken.F90
+++ b/src/SURFEX/writesurf_flaken.F90
@@ -73,7 +73,7 @@ TYPE(FLAKE_t), INTENT(INOUT) :: F
 !              -------------------------------
 !
 INTEGER           :: IRESP          ! IRESP  : return-code if a problem appears
- CHARACTER(LEN=12) :: YRECFM         ! Name of the article to be read
+ CHARACTER(LEN=LEN_HREC) :: YRECFM         ! Name of the article to be read
  CHARACTER(LEN=100):: YCOMMENT       ! Comment string
 REAL(KIND=JPRB) :: ZHOOK_HANDLE
 !
diff --git a/src/SURFEX/writesurf_gr_snow.F90 b/src/SURFEX/writesurf_gr_snow.F90
index e4f5a6a7f..ad2e8c69f 100644
--- a/src/SURFEX/writesurf_gr_snow.F90
+++ b/src/SURFEX/writesurf_gr_snow.F90
@@ -81,7 +81,7 @@ TYPE(SURF_SNOW),    INTENT(IN) :: TPSNOW     ! snow characteristics
 INTEGER             :: ISURFTYPE_LEN
 !
  CHARACTER (LEN=100) :: YFMT           ! format for writing
- CHARACTER(LEN=12)   :: YRECFM         ! Name of the article to be read
+ CHARACTER(LEN=LEN_HREC)   :: YRECFM         ! Name of the article to be read
  CHARACTER(LEN=100)  :: YCOMMENT       ! Comment string
  CHARACTER(LEN=100):: YCOMMENTUNIT     ! Comment string : unit of the datas in the field to write 
 INTEGER             :: IRESP          ! IRESP  : return-code if a problem appears
diff --git a/src/SURFEX/writesurf_isba_canopyn.F90 b/src/SURFEX/writesurf_isba_canopyn.F90
index 94ded2338..f005b0985 100644
--- a/src/SURFEX/writesurf_isba_canopyn.F90
+++ b/src/SURFEX/writesurf_isba_canopyn.F90
@@ -78,7 +78,7 @@ TYPE(ISBA_t), INTENT(INOUT) :: I
 !              -------------------------------
 !
 INTEGER           :: IRESP          ! IRESP  : return-code if a problem appears
- CHARACTER(LEN=12) :: YRECFM         ! Name of the article to be read
+ CHARACTER(LEN=LEN_HREC) :: YRECFM         ! Name of the article to be read
  CHARACTER(LEN=100):: YCOMMENT       ! Comment string
 !
 INTEGER :: JLAYER  ! loop counter on layers
diff --git a/src/SURFEX/writesurf_isban.F90 b/src/SURFEX/writesurf_isban.F90
index dd1c27178..ac09a551e 100644
--- a/src/SURFEX/writesurf_isban.F90
+++ b/src/SURFEX/writesurf_isban.F90
@@ -102,7 +102,7 @@ LOGICAL,           INTENT(IN)  :: OLAND_USE !
 !              -------------------------------
 !
 INTEGER           :: IRESP          ! IRESP  : return-code if a problem appears
- CHARACTER(LEN=12) :: YRECFM         ! Name of the article to be read
+ CHARACTER(LEN=LEN_HREC) :: YRECFM         ! Name of the article to be read
  CHARACTER(LEN=4 ) :: YLVL
  CHARACTER(LEN=3 ) :: YVAR
  CHARACTER(LEN=100):: YCOMMENT       ! Comment string
diff --git a/src/SURFEX/writesurf_oceann.F90 b/src/SURFEX/writesurf_oceann.F90
index a3f22737c..ecfc87ccb 100644
--- a/src/SURFEX/writesurf_oceann.F90
+++ b/src/SURFEX/writesurf_oceann.F90
@@ -78,7 +78,7 @@ TYPE(OCEAN_REL_t), INTENT(INOUT) :: OR
 !              -------------------------------
 !
 INTEGER           :: IRESP          ! IRESP  : return-code if a problem appears
- CHARACTER(LEN=12) :: YRECFM         ! Name of the article to be read
+ CHARACTER(LEN=LEN_HREC) :: YRECFM         ! Name of the article to be read
  CHARACTER(LEN=4 ) :: YLVL
  CHARACTER(LEN=100):: YCOMMENT       ! Comment string
  CHARACTER(LEN=14) :: YFORM          ! Writing format
diff --git a/src/SURFEX/writesurf_pgd_flaken.F90 b/src/SURFEX/writesurf_pgd_flaken.F90
index 4eccc1abb..c9a251e11 100644
--- a/src/SURFEX/writesurf_pgd_flaken.F90
+++ b/src/SURFEX/writesurf_pgd_flaken.F90
@@ -81,7 +81,7 @@ TYPE(FLAKE_t), INTENT(INOUT) :: F
 !              -------------------------------
 !
 INTEGER           :: IRESP          ! IRESP  : return-code if a problem appears
- CHARACTER(LEN=12) :: YRECFM         ! Name of the article to be read
+ CHARACTER(LEN=LEN_HREC) :: YRECFM         ! Name of the article to be read
  CHARACTER(LEN=100):: YCOMMENT       ! Comment string
 REAL(KIND=JPRB) :: ZHOOK_HANDLE
 !
diff --git a/src/SURFEX/writesurf_pgd_isba_parn.F90 b/src/SURFEX/writesurf_pgd_isba_parn.F90
index 1ca26a9ed..b7115dab5 100644
--- a/src/SURFEX/writesurf_pgd_isba_parn.F90
+++ b/src/SURFEX/writesurf_pgd_isba_parn.F90
@@ -78,7 +78,7 @@ TYPE(DATA_ISBA_t), INTENT(INOUT) :: DTI
 !              -------------------------------
 !
 INTEGER           :: IRESP          ! IRESP  : return-code if a problem appears
- CHARACTER(LEN=12) :: YRECFM         ! Name of the article to be read
+ CHARACTER(LEN=LEN_HREC) :: YRECFM         ! Name of the article to be read
  CHARACTER(LEN=100):: YCOMMENT       ! Comment string
  CHARACTER(LEN=100):: YCOMMENTUNIT   ! Comment string : unit of the datas in the field to write
 INTEGER           :: JTIME          ! loop index
diff --git a/src/SURFEX/writesurf_pgd_isban.F90 b/src/SURFEX/writesurf_pgd_isban.F90
index 38cc31248..62d3e9566 100644
--- a/src/SURFEX/writesurf_pgd_isban.F90
+++ b/src/SURFEX/writesurf_pgd_isban.F90
@@ -104,7 +104,7 @@ TYPE(SURF_ATM_t), INTENT(INOUT) :: U
 !              -------------------------------
 !
 INTEGER           :: IRESP          ! IRESP  : return-code if a problem appears
- CHARACTER(LEN=12) :: YRECFM         ! Name of the article to be read
+ CHARACTER(LEN=LEN_HREC) :: YRECFM         ! Name of the article to be read
  CHARACTER(LEN=100):: YCOMMENT       ! Comment string
  CHARACTER(LEN=100):: YCOMMENTUNIT   ! Comment string : unit of the datas in the field to write
  CHARACTER(LEN=4 ) :: YLVL
diff --git a/src/SURFEX/writesurf_pgd_seaf_parn.F90 b/src/SURFEX/writesurf_pgd_seaf_parn.F90
index d92c4bfa1..f7b15e420 100644
--- a/src/SURFEX/writesurf_pgd_seaf_parn.F90
+++ b/src/SURFEX/writesurf_pgd_seaf_parn.F90
@@ -74,7 +74,7 @@ TYPE(DATA_SEAFLUX_t), INTENT(INOUT) :: DTS
 !              -------------------------------
 !
 INTEGER           :: IRESP          ! IRESP  : return-code if a problem appears
- CHARACTER(LEN=12) :: YRECFM         ! Name of the article to be read
+ CHARACTER(LEN=LEN_HREC) :: YRECFM         ! Name of the article to be read
  CHARACTER(LEN=100):: YCOMMENT       ! Comment string
 INTEGER           :: JTIME          ! loop index
 REAL(KIND=JPRB) :: ZHOOK_HANDLE
diff --git a/src/SURFEX/writesurf_pgd_seafluxn.F90 b/src/SURFEX/writesurf_pgd_seafluxn.F90
index 70032d7d1..dcbbaf05f 100644
--- a/src/SURFEX/writesurf_pgd_seafluxn.F90
+++ b/src/SURFEX/writesurf_pgd_seafluxn.F90
@@ -85,7 +85,7 @@ TYPE(SEAFLUX_t), INTENT(INOUT) :: S
 !              -------------------------------
 !
 INTEGER           :: IRESP          ! IRESP  : return-code if a problem appears
- CHARACTER(LEN=12) :: YRECFM         ! Name of the article to be read
+ CHARACTER(LEN=LEN_HREC) :: YRECFM         ! Name of the article to be read
  CHARACTER(LEN=100):: YCOMMENT       ! Comment string
 REAL(KIND=JPRB) :: ZHOOK_HANDLE
 !
diff --git a/src/SURFEX/writesurf_pgd_teb_greenroofn.F90 b/src/SURFEX/writesurf_pgd_teb_greenroofn.F90
index 0d402f1bd..d2ca6944f 100644
--- a/src/SURFEX/writesurf_pgd_teb_greenroofn.F90
+++ b/src/SURFEX/writesurf_pgd_teb_greenroofn.F90
@@ -74,7 +74,7 @@ TYPE(TEB_GREENROOF_PGD_t), INTENT(INOUT) :: TGRP
 !              -------------------------------
 !
 INTEGER           :: IRESP          ! IRESP  : return-code if a problem appears
- CHARACTER(LEN=12) :: YRECFM         ! Name of the article to be read
+ CHARACTER(LEN=LEN_HREC) :: YRECFM         ! Name of the article to be read
  CHARACTER(LEN=100):: YCOMMENT       ! Comment string
 !
 REAL(KIND=JPRB) :: ZHOOK_HANDLE
diff --git a/src/SURFEX/writesurf_pgd_teb_irrign.F90 b/src/SURFEX/writesurf_pgd_teb_irrign.F90
index de7f2a738..595d5b48e 100644
--- a/src/SURFEX/writesurf_pgd_teb_irrign.F90
+++ b/src/SURFEX/writesurf_pgd_teb_irrign.F90
@@ -73,7 +73,7 @@ TYPE(TEB_IRRIG_t), INTENT(INOUT) :: TIR
 !              -------------------------------
 !
 INTEGER           :: IRESP          ! IRESP  : return-code if a problem appears
- CHARACTER(LEN=12) :: YRECFM         ! Name of the article to be read
+ CHARACTER(LEN=LEN_HREC) :: YRECFM         ! Name of the article to be read
  CHARACTER(LEN=100):: YCOMMENT       ! Comment string
 INTEGER           :: JLAYER         ! loop index
 INTEGER           :: JTIME          ! loop index
diff --git a/src/SURFEX/writesurf_pgd_teb_parn.F90 b/src/SURFEX/writesurf_pgd_teb_parn.F90
index 60ee430d0..562b72415 100644
--- a/src/SURFEX/writesurf_pgd_teb_parn.F90
+++ b/src/SURFEX/writesurf_pgd_teb_parn.F90
@@ -92,7 +92,7 @@ TYPE(TEB_OPTIONS_t), INTENT(INOUT) :: TOP
 !              -------------------------------
 !
 INTEGER           :: IRESP          ! IRESP  : return-code if a problem appears
- CHARACTER(LEN=12) :: YRECFM         ! Name of the article to be read
+ CHARACTER(LEN=LEN_HREC) :: YRECFM         ! Name of the article to be read
  CHARACTER(LEN=100):: YCOMMENT       ! Comment string
 INTEGER           :: JLAYER         ! loop index
 INTEGER           :: JTIME          ! loop index
diff --git a/src/SURFEX/writesurf_pgd_teb_vegn.F90 b/src/SURFEX/writesurf_pgd_teb_vegn.F90
index 77b839e89..e7c7f4e67 100644
--- a/src/SURFEX/writesurf_pgd_teb_vegn.F90
+++ b/src/SURFEX/writesurf_pgd_teb_vegn.F90
@@ -81,7 +81,7 @@ TYPE(TEB_MODEL_t), INTENT(INOUT) :: TM
 !              -------------------------------
 !
 INTEGER           :: IRESP          ! IRESP  : return-code if a problem appears
- CHARACTER(LEN=12) :: YRECFM         ! Name of the article to be read
+ CHARACTER(LEN=LEN_HREC) :: YRECFM         ! Name of the article to be read
  CHARACTER(LEN=100):: YCOMMENT       ! Comment string
  CHARACTER(LEN=4 ) :: YLVL
 !
diff --git a/src/SURFEX/writesurf_pgd_tebn.F90 b/src/SURFEX/writesurf_pgd_tebn.F90
index 4367b2cda..65e376897 100644
--- a/src/SURFEX/writesurf_pgd_tebn.F90
+++ b/src/SURFEX/writesurf_pgd_tebn.F90
@@ -82,7 +82,7 @@ TYPE(TEB_GREENROOF_MODEL_t), INTENT(INOUT) :: GRM
 !              -------------------------------
 !
 INTEGER           :: IRESP          ! IRESP  : return-code if a problem appears
- CHARACTER(LEN=12) :: YRECFM         ! Name of the article to be read
+ CHARACTER(LEN=LEN_HREC) :: YRECFM         ! Name of the article to be read
  CHARACTER(LEN=100):: YCOMMENT       ! Comment string
 !
 REAL(KIND=JPRB) :: ZHOOK_HANDLE
diff --git a/src/SURFEX/writesurf_pgd_tsz0_parn.F90 b/src/SURFEX/writesurf_pgd_tsz0_parn.F90
index 0b8a9304d..8e0f2bca9 100644
--- a/src/SURFEX/writesurf_pgd_tsz0_parn.F90
+++ b/src/SURFEX/writesurf_pgd_tsz0_parn.F90
@@ -73,7 +73,7 @@ TYPE(DATA_TSZ0_t), INTENT(INOUT) :: DTZ
 !              -------------------------------
 !
 INTEGER           :: IRESP          ! IRESP  : return-code if a problem appears
- CHARACTER(LEN=12) :: YRECFM         ! Name of the article to be read
+ CHARACTER(LEN=LEN_HREC) :: YRECFM         ! Name of the article to be read
  CHARACTER(LEN=100):: YCOMMENT       ! Comment string
 REAL(KIND=JPRB) :: ZHOOK_HANDLE
 !
diff --git a/src/SURFEX/writesurf_pgd_watfluxn.F90 b/src/SURFEX/writesurf_pgd_watfluxn.F90
index 7db06730b..02ab63066 100644
--- a/src/SURFEX/writesurf_pgd_watfluxn.F90
+++ b/src/SURFEX/writesurf_pgd_watfluxn.F90
@@ -82,7 +82,7 @@ TYPE(WATFLUX_t), INTENT(INOUT) :: W
 !              -------------------------------
 !
 INTEGER           :: IRESP          ! IRESP  : return-code if a problem appears
- CHARACTER(LEN=12) :: YRECFM         ! Name of the article to be read
+ CHARACTER(LEN=LEN_HREC) :: YRECFM         ! Name of the article to be read
  CHARACTER(LEN=100):: YCOMMENT       ! Comment string
 INTEGER           :: JCOVER         ! loop index
 REAL(KIND=JPRB) :: ZHOOK_HANDLE
diff --git a/src/SURFEX/writesurf_seaflux_sbln.F90 b/src/SURFEX/writesurf_seaflux_sbln.F90
index 51a44764f..369ca85ad 100644
--- a/src/SURFEX/writesurf_seaflux_sbln.F90
+++ b/src/SURFEX/writesurf_seaflux_sbln.F90
@@ -79,7 +79,7 @@ TYPE(SEAFLUX_SBL_t), INTENT(INOUT) :: SSB
 !              -------------------------------
 !
 INTEGER           :: IRESP          ! IRESP  : return-code if a problem appears
- CHARACTER(LEN=12) :: YRECFM         ! Name of the article to be read
+ CHARACTER(LEN=LEN_HREC) :: YRECFM         ! Name of the article to be read
  CHARACTER(LEN=100):: YCOMMENT       ! Comment string
 !
 INTEGER :: JLAYER  ! loop counter on layers
diff --git a/src/SURFEX/writesurf_seafluxn.F90 b/src/SURFEX/writesurf_seafluxn.F90
index f3900c567..6f42fbfbe 100644
--- a/src/SURFEX/writesurf_seafluxn.F90
+++ b/src/SURFEX/writesurf_seafluxn.F90
@@ -85,7 +85,7 @@ INTEGER           :: JMTH, INMTH
  CHARACTER(LEN=2 ) :: YMTH
 !
 INTEGER           :: IRESP          ! IRESP  : return-code if a problem appears
- CHARACTER(LEN=12) :: YRECFM         ! Name of the article to be read
+ CHARACTER(LEN=LEN_HREC) :: YRECFM         ! Name of the article to be read
  CHARACTER(LEN=100):: YCOMMENT       ! Comment string
 REAL(KIND=JPRB) :: ZHOOK_HANDLE
 !
diff --git a/src/SURFEX/writesurf_seaicen.F90 b/src/SURFEX/writesurf_seaicen.F90
index bf77f09c6..d6326976c 100644
--- a/src/SURFEX/writesurf_seaicen.F90
+++ b/src/SURFEX/writesurf_seaicen.F90
@@ -87,9 +87,9 @@ INTEGER           :: JMTH, INMTH
 !
  CHARACTER(LEN=6)  :: YICECAT
  CHARACTER(LEN=20) :: YFORM
- CHARACTER(LEN=12) :: YRECFM           ! Name of the article to be read
- CHARACTER(LEN=12) :: YCATEG           ! Category to write
- CHARACTER(LEN=12) :: YLEVEL           ! Level to write
+ CHARACTER(LEN=LEN_HREC) :: YRECFM           ! Name of the article to be read
+ CHARACTER(LEN=LEN_HREC) :: YCATEG           ! Category to write
+ CHARACTER(LEN=LEN_HREC) :: YLEVEL           ! Level to write
  CHARACTER(LEN=100):: YCOMMENT         ! Error Message
 !
 INTEGER :: JK,JL                   ! loop counter on ice categories and layes 
diff --git a/src/SURFEX/writesurf_sso_canopyn.F90 b/src/SURFEX/writesurf_sso_canopyn.F90
index bb1ba4dc1..dc57b3477 100644
--- a/src/SURFEX/writesurf_sso_canopyn.F90
+++ b/src/SURFEX/writesurf_sso_canopyn.F90
@@ -75,7 +75,7 @@ LOGICAL,           INTENT(IN)  :: OWRITE   ! flag to write canopy terms
 !              -------------------------------
 !
 INTEGER           :: IRESP          ! IRESP  : return-code if a problem appears
- CHARACTER(LEN=12) :: YRECFM         ! Name of the article to be read
+ CHARACTER(LEN=LEN_HREC) :: YRECFM         ! Name of the article to be read
  CHARACTER(LEN=100):: YCOMMENT       ! Comment string
 !
 INTEGER :: JLAYER  ! loop counter on layers
diff --git a/src/SURFEX/writesurf_sson.F90 b/src/SURFEX/writesurf_sson.F90
index 5e3022fda..69aa23261 100644
--- a/src/SURFEX/writesurf_sson.F90
+++ b/src/SURFEX/writesurf_sson.F90
@@ -68,7 +68,7 @@ TYPE(SURF_ATM_SSO_t), INTENT(INOUT) :: USS
 !              -------------------------------
 !
 INTEGER           :: IRESP          ! IRESP  : return-code if a problem appears
- CHARACTER(LEN=12) :: YRECFM         ! Name of the article to be read
+ CHARACTER(LEN=LEN_HREC) :: YRECFM         ! Name of the article to be read
  CHARACTER(LEN=100):: YCOMMENT       ! Comment string
 REAL(KIND=JPRB) :: ZHOOK_HANDLE
 !
diff --git a/src/SURFEX/writesurf_teb_canopyn.F90 b/src/SURFEX/writesurf_teb_canopyn.F90
index a5b350df5..b15269255 100644
--- a/src/SURFEX/writesurf_teb_canopyn.F90
+++ b/src/SURFEX/writesurf_teb_canopyn.F90
@@ -78,7 +78,7 @@ TYPE(TEB_OPTIONS_t), INTENT(INOUT) :: TOP
 !              -------------------------------
 !
 INTEGER           :: IRESP          ! IRESP  : return-code if a problem appears
- CHARACTER(LEN=12) :: YRECFM         ! Name of the article to be read
+ CHARACTER(LEN=LEN_HREC) :: YRECFM         ! Name of the article to be read
  CHARACTER(LEN=100):: YCOMMENT       ! Comment string
 !
 INTEGER :: JLAYER  ! loop counter on layers
diff --git a/src/SURFEX/writesurf_teb_gardenn.F90 b/src/SURFEX/writesurf_teb_gardenn.F90
index 0699edb36..4f663720a 100644
--- a/src/SURFEX/writesurf_teb_gardenn.F90
+++ b/src/SURFEX/writesurf_teb_gardenn.F90
@@ -79,7 +79,7 @@ TYPE(TEB_GARDEN_MODEL_t), INTENT(INOUT) :: GDM
 !              -------------------------------
 !
 INTEGER           :: IRESP          ! IRESP  : return-code if a problem appears
- CHARACTER(LEN=12) :: YRECFM         ! Name of the article to be read
+ CHARACTER(LEN=LEN_HREC) :: YRECFM         ! Name of the article to be read
  CHARACTER(LEN=100):: YCOMMENT       ! Comment string
  CHARACTER(LEN=14) :: YFORM          ! Writing format
  CHARACTER(LEN=4 ) :: YLVL
diff --git a/src/SURFEX/writesurf_tebn.F90 b/src/SURFEX/writesurf_tebn.F90
index 281a1d0a8..de62ce8b9 100644
--- a/src/SURFEX/writesurf_tebn.F90
+++ b/src/SURFEX/writesurf_tebn.F90
@@ -87,7 +87,7 @@ INTEGER,           INTENT(IN)  :: KPATCH   ! current TEB patch
 !              -------------------------------
 !
 INTEGER           :: IRESP           ! IRESP  : return-code if a problem appears
- CHARACTER(LEN=12) :: YRECFM         ! Name of the article to be read
+ CHARACTER(LEN=LEN_HREC) :: YRECFM         ! Name of the article to be read
  CHARACTER(LEN=100):: YCOMMENT       ! Comment string
  CHARACTER(LEN=3)  :: YPATCH         ! Patch identificator
  CHARACTER(LEN=7)  :: YDIR           ! Direction identificator
diff --git a/src/SURFEX/writesurf_watflux_sbln.F90 b/src/SURFEX/writesurf_watflux_sbln.F90
index 730920380..748243487 100644
--- a/src/SURFEX/writesurf_watflux_sbln.F90
+++ b/src/SURFEX/writesurf_watflux_sbln.F90
@@ -79,7 +79,7 @@ TYPE(WATFLUX_SBL_t), INTENT(INOUT) :: WSB
 !              -------------------------------
 !
 INTEGER           :: IRESP          ! IRESP  : return-code if a problem appears
- CHARACTER(LEN=12) :: YRECFM         ! Name of the article to be read
+ CHARACTER(LEN=LEN_HREC) :: YRECFM         ! Name of the article to be read
  CHARACTER(LEN=100):: YCOMMENT       ! Comment string
 !
 INTEGER :: JLAYER  ! loop counter on layers
diff --git a/src/SURFEX/writesurf_watfluxn.F90 b/src/SURFEX/writesurf_watfluxn.F90
index 47443e674..ee5c6a1a6 100644
--- a/src/SURFEX/writesurf_watfluxn.F90
+++ b/src/SURFEX/writesurf_watfluxn.F90
@@ -76,7 +76,7 @@ INTEGER          :: JMTH,INMTH
  CHARACTER(LEN=2) :: YMTH
 !
 INTEGER           :: IRESP          ! IRESP  : return-code if a problem appears
- CHARACTER(LEN=12) :: YRECFM         ! Name of the article to be read
+ CHARACTER(LEN=LEN_HREC) :: YRECFM         ! Name of the article to be read
  CHARACTER(LEN=100):: YCOMMENT       ! Comment string
 REAL(KIND=JPRB) :: ZHOOK_HANDLE
 !
diff --git a/src/SURFEX/zoom_pgd_orography.F90 b/src/SURFEX/zoom_pgd_orography.F90
index 6c141f0cc..6f21dd21b 100644
--- a/src/SURFEX/zoom_pgd_orography.F90
+++ b/src/SURFEX/zoom_pgd_orography.F90
@@ -115,7 +115,7 @@ REAL, DIMENSION(:), POINTER :: ZHO2IP
 REAL, DIMENSION(:), POINTER :: ZHO2IM
 REAL, DIMENSION(:), POINTER :: ZHO2JP
 REAL, DIMENSION(:), POINTER :: ZHO2JM
- CHARACTER(LEN=12) :: YRECFM         ! Name of the article to be read
+ CHARACTER(LEN=LEN_HREC) :: YRECFM         ! Name of the article to be read
 REAL(KIND=JPRB) :: ZHOOK_HANDLE
 INTEGER :: IINFO_ll
 !------------------------------------------------------------------------------
diff --git a/src/SURFEX/zoom_pgd_teb.F90 b/src/SURFEX/zoom_pgd_teb.F90
index a20b844dc..43271ee57 100644
--- a/src/SURFEX/zoom_pgd_teb.F90
+++ b/src/SURFEX/zoom_pgd_teb.F90
@@ -274,7 +274,7 @@ REAL, DIMENSION(:,:), POINTER     :: ZIN     ! field  on all surface points
 REAL, DIMENSION(INI)              :: ZFIELD  ! field read
 REAL, DIMENSION(ILU,1)            :: ZOUT    ! final field
 REAL(KIND=JPRB) :: ZHOOK_HANDLE
- CHARACTER(LEN=12) :: YRECFM         ! Name of the article to be read
+ CHARACTER(LEN=LEN_HREC) :: YRECFM         ! Name of the article to be read
 !
 IF (LHOOK) CALL DR_HOOK('ZOOM_PGD_TEB:ZOOM_PGD_TEB_GARDEN',0,ZHOOK_HANDLE)
 !
diff --git a/src/configure b/src/configure
index 30a4c4b53..4d26378b4 100755
--- a/src/configure
+++ b/src/configure
@@ -23,6 +23,8 @@ export VERSION_OASIS=${VERSION_OASIS:-"mct_v3"}
 export VERSION_TOY=${VERSION_TOY:-"v1-0"}
 export VERSION_NCL=${VERSION_NCL:-"ncl-6.3.0"}
 
+export LEN_HREC=${LEN_HREC:-16}
+
 #
 export NEED_TOOLS=YES
 #
-- 
GitLab