Index: /NEMO/branches/2019/dev_r10984_HPC-13_IRRMANN_BDY_optimization/src/OCE/BDY/bdydta.F90
===================================================================
--- /NEMO/branches/2019/dev_r10984_HPC-13_IRRMANN_BDY_optimization/src/OCE/BDY/bdydta.F90	(revision 11324)
+++ /NEMO/branches/2019/dev_r10984_HPC-13_IRRMANN_BDY_optimization/src/OCE/BDY/bdydta.F90	(revision 11325)
@@ -415,4 +415,5 @@
                bf_alias => bf(jp_bdyssh,jbdy:jbdy)                         ! alias for ssh structure of bdy number jbdy
                bn_alias => bn_ssh                                          ! alias for ssh structure of nambdy_dta 
+               iszdim = idx_bdy(jbdy)%nblenrim(igrd)                       ! length of this bdy on this MPI processus : only rim
             ENDIF
             ! =====================
@@ -427,4 +428,5 @@
                bf_alias => bf(jp_bdyu2d,jbdy:jbdy)                         ! alias for u2d structure of bdy number jbdy
                bn_alias => bn_u2d                                          ! alias for u2d structure of nambdy_dta 
+               iszdim = idx_bdy(jbdy)%nblenrim(igrd)                       ! length of this bdy on this MPI processus : only rim
             ENDIF
             IF( jfld == jp_bdyv2d ) THEN
@@ -436,4 +438,5 @@
                bf_alias => bf(jp_bdyv2d,jbdy:jbdy)                         ! alias for v2d structure of bdy number jbdy
                bn_alias => bn_v2d                                          ! alias for v2d structure of nambdy_dta 
+               iszdim = idx_bdy(jbdy)%nblenrim(igrd)                       ! length of this bdy on this MPI processus : only rim
             ENDIF
             ! =====================
@@ -449,5 +452,6 @@
                bf_alias => bf(jp_bdyu3d,jbdy:jbdy)                         ! alias for u3d structure of bdy number jbdy
                bn_alias => bn_u3d                                          ! alias for u3d structure of nambdy_dta 
-            ENDIF
+               iszdim = idx_bdy(jbdy)%nblen(igrd)                          ! length of this bdy on this MPI processus
+           ENDIF
             IF( jfld == jp_bdyv3d ) THEN
                cl3 = 'v3d'
@@ -459,5 +463,6 @@
                bf_alias => bf(jp_bdyv3d,jbdy:jbdy)                         ! alias for v3d structure of bdy number jbdy
                bn_alias => bn_v3d                                          ! alias for v3d structure of nambdy_dta 
-            ENDIF
+               iszdim = idx_bdy(jbdy)%nblen(igrd)                          ! length of this bdy on this MPI processus
+           ENDIF
 
             ! =====================
@@ -472,4 +477,5 @@
                bf_alias => bf(jp_bdytem,jbdy:jbdy)                         ! alias for ssh structure of bdy number jbdy
                bn_alias => bn_tem                                          ! alias for ssh structure of nambdy_dta 
+               iszdim = idx_bdy(jbdy)%nblen(igrd)                          ! length of this bdy on this MPI processus
             ENDIF
             IF( jfld == jp_bdysal ) THEN
@@ -481,4 +487,5 @@
                bf_alias => bf(jp_bdysal,jbdy:jbdy)                         ! alias for ssh structure of bdy number jbdy
                bn_alias => bn_sal                                          ! alias for ssh structure of nambdy_dta 
+               iszdim = idx_bdy(jbdy)%nblen(igrd)                          ! length of this bdy on this MPI processus
             ENDIF
 
@@ -494,5 +501,6 @@
                bf_alias => bf(jp_bdya_i,jbdy:jbdy)                         ! alias for ssh structure of bdy number jbdy
                bn_alias => bn_a_i                                          ! alias for ssh structure of nambdy_dta 
-            ENDIF
+               iszdim = idx_bdy(jbdy)%nblen(igrd)                          ! length of this bdy on this MPI processus
+           ENDIF
             IF( jfld == jp_bdyh_i ) THEN
                cl3 = 'h_i'
@@ -503,4 +511,5 @@
                bf_alias => bf(jp_bdyh_i,jbdy:jbdy)                         ! alias for ssh structure of bdy number jbdy
                bn_alias => bn_h_i                                          ! alias for ssh structure of nambdy_dta 
+               iszdim = idx_bdy(jbdy)%nblen(igrd)                          ! length of this bdy on this MPI processus
             ENDIF
             IF( jfld == jp_bdyh_s ) THEN
@@ -512,10 +521,9 @@
                bf_alias => bf(jp_bdyh_s,jbdy:jbdy)                         ! alias for ssh structure of bdy number jbdy
                bn_alias => bn_h_s                                          ! alias for ssh structure of nambdy_dta 
-            ENDIF
-
+               iszdim = idx_bdy(jbdy)%nblen(igrd)                          ! length of this bdy on this MPI processus
+            ENDIF
 
             IF( llneed ) THEN                                              ! dta_bdy(jbdy)%xxx will be needed
                !                                                           !   -> must be associated with an allocated target
-               iszdim = idx_bdy(jbdy)%nblen(igrd)                          ! length of this bdy on this MPI processus
                ALLOCATE( bf_alias(1)%fnow( iszdim, 1, ipk ) )              ! allocate the target
                !
Index: /NEMO/branches/2019/dev_r10984_HPC-13_IRRMANN_BDY_optimization/src/OCE/DIA/diawri.F90
===================================================================
--- /NEMO/branches/2019/dev_r10984_HPC-13_IRRMANN_BDY_optimization/src/OCE/DIA/diawri.F90	(revision 11324)
+++ /NEMO/branches/2019/dev_r10984_HPC-13_IRRMANN_BDY_optimization/src/OCE/DIA/diawri.F90	(revision 11325)
@@ -657,5 +657,5 @@
          ENDIF
 
-         IF( .NOT. ln_cpl ) THEN
+         IF( ln_ssr ) THEN
             CALL histdef( nid_T, "sohefldp", "Surface Heat Flux: Damping"         , "W/m2"   ,   &  ! qrp
                &          jpi, jpj, nh_T, 1  , 1, 1  , -99 , 32, clop, zsto, zout )
@@ -665,14 +665,5 @@
                &          jpi, jpj, nh_T, 1  , 1, 1  , -99 , 32, clop, zsto, zout )
          ENDIF
-
-         IF( ln_cpl .AND. nn_ice <= 1 ) THEN
-            CALL histdef( nid_T, "sohefldp", "Surface Heat Flux: Damping"         , "W/m2"   ,   &  ! qrp
-               &          jpi, jpj, nh_T, 1  , 1, 1  , -99 , 32, clop, zsto, zout )
-            CALL histdef( nid_T, "sowafldp", "Surface Water Flux: Damping"        , "Kg/m2/s",   &  ! erp
-               &          jpi, jpj, nh_T, 1  , 1, 1  , -99 , 32, clop, zsto, zout )
-            CALL histdef( nid_T, "sosafldp", "Surface salt flux: Damping"         , "Kg/m2/s",   &  ! erp * sn
-               &          jpi, jpj, nh_T, 1  , 1, 1  , -99 , 32, clop, zsto, zout )
-         ENDIF
-         
+       
          clmx ="l_max(only(x))"    ! max index on a period
 !         CALL histdef( nid_T, "sobowlin", "Bowl Index"                         , "W-point",   &  ! bowl INDEX 
@@ -814,14 +805,8 @@
       ENDIF
 
-      IF( .NOT. ln_cpl ) THEN
+      IF( ln_ssr ) THEN
          CALL histwrite( nid_T, "sohefldp", it, qrp           , ndim_hT, ndex_hT )   ! heat flux damping
          CALL histwrite( nid_T, "sowafldp", it, erp           , ndim_hT, ndex_hT )   ! freshwater flux damping
-         IF( ln_ssr ) zw2d(:,:) = erp(:,:) * tsn(:,:,1,jp_sal) * tmask(:,:,1)
-         CALL histwrite( nid_T, "sosafldp", it, zw2d          , ndim_hT, ndex_hT )   ! salt flux damping
-      ENDIF
-      IF( ln_cpl .AND. nn_ice <= 1 ) THEN
-         CALL histwrite( nid_T, "sohefldp", it, qrp           , ndim_hT, ndex_hT )   ! heat flux damping
-         CALL histwrite( nid_T, "sowafldp", it, erp           , ndim_hT, ndex_hT )   ! freshwater flux damping
-         IF( ln_ssr ) zw2d(:,:) = erp(:,:) * tsn(:,:,1,jp_sal) * tmask(:,:,1)
+         zw2d(:,:) = erp(:,:) * tsn(:,:,1,jp_sal) * tmask(:,:,1)
          CALL histwrite( nid_T, "sosafldp", it, zw2d          , ndim_hT, ndex_hT )   ! salt flux damping
       ENDIF
Index: /NEMO/branches/2019/dev_r10984_HPC-13_IRRMANN_BDY_optimization/src/OCE/TRA/eosbn2.F90
===================================================================
--- /NEMO/branches/2019/dev_r10984_HPC-13_IRRMANN_BDY_optimization/src/OCE/TRA/eosbn2.F90	(revision 11324)
+++ /NEMO/branches/2019/dev_r10984_HPC-13_IRRMANN_BDY_optimization/src/OCE/TRA/eosbn2.F90	(revision 11325)
@@ -30,4 +30,6 @@
    !!   eos_insitu_2d : Compute the in situ density for 2d fields
    !!   bn2           : Compute the Brunt-Vaisala frequency
+   !!   bn2           : compute the Brunt-Vaisala frequency
+   !!   eos_pt_from_ct: compute the potential temperature from the Conservative Temperature
    !!   eos_rab       : generic interface of in situ thermal/haline expansion ratio 
    !!   eos_rab_3d    : compute in situ thermal/haline expansion ratio
@@ -74,7 +76,7 @@
 
    !                               !!** Namelist nameos **
-   LOGICAL , PUBLIC ::   ln_TEOS10   ! determine if eos_pt_from_ct is used to compute sst_m
-   LOGICAL , PUBLIC ::   ln_EOS80   ! determine if eos_pt_from_ct is used to compute sst_m
-   LOGICAL , PUBLIC ::   ln_SEOS   ! determine if eos_pt_from_ct is used to compute sst_m
+   LOGICAL , PUBLIC ::   ln_TEOS10
+   LOGICAL , PUBLIC ::   ln_EOS80
+   LOGICAL , PUBLIC ::   ln_SEOS
 
    ! Parameters
@@ -1647,4 +1649,7 @@
          !
       CASE( np_seos )                        !==  Simplified EOS     ==!
+
+         r1_S0  = 0.875_wp/35.16504_wp   ! Used to convert CT in potential temperature when using bulk formulae (eos_pt_from_ct)
+         
          IF(lwp) THEN
             WRITE(numout,*)
Index: /utils/build/arch/CNRS/arch-X64_IRENE_DEBUG.fcm
===================================================================
--- /utils/build/arch/CNRS/arch-X64_IRENE_DEBUG.fcm	(revision 11324)
+++ /utils/build/arch/CNRS/arch-X64_IRENE_DEBUG.fcm	(revision 11325)
@@ -44,5 +44,5 @@
 %CPP	             cpp
 %FC                  mpif90 -c -cpp
-%FCFLAGS             -i4 -r8 -g -O0 -debug all -traceback -fp-model precise -ftrapuv -fpe0
+%FCFLAGS             -i4 -r8 -g -O0 -debug all -traceback -fp-model precise -ftrapuv -fpe0 -check bounds
 %FFLAGS              %FCFLAGS
 %LD                  mpif90
Index: /utils/build/arch/arch-osx_gfortran_debug.fcm
===================================================================
--- /utils/build/arch/arch-osx_gfortran_debug.fcm	(revision 11324)
+++ /utils/build/arch/arch-osx_gfortran_debug.fcm	(revision 11325)
@@ -42,5 +42,5 @@
 %NCDF_HOME           /opt/local
 %HDF5_HOME           /opt/local
-%XIOS_HOME           /Users/$( whoami )/xios-2.0
+%XIOS_HOME           /Users/$( whoami )/xios-2.5
 %OASIS_HOME          /not/defined
 
@@ -54,6 +54,5 @@
 %CPP	             cpp-mp-4.8 -Dkey_nosignedzero 
 %FC	             mpif90 
-#%FCFLAGS             -fdefault-real-8 -O3 -funroll-all-loops -fcray-pointer -ffree-line-length-none -fbounds-check
-%FCFLAGS             -fdefault-real-8 -O0 -funroll-all-loops -fcray-pointer -ffree-line-length-none -fcheck=bounds -finit-real=nan
+%FCFLAGS             -fdefault-real-8 -O0 -g -fbacktrace -funroll-all-loops -fcray-pointer -ffree-line-length-none -fcheck=bounds -finit-real=nan
 %FFLAGS              %FCFLAGS
 %LD                  %FC
