Index: /NEMO/branches/2019/dev_r11643_ENHANCE-11_CEthe_Shaconemo_diags/src/OCE/DIA/diaar5.F90
===================================================================
--- /NEMO/branches/2019/dev_r11643_ENHANCE-11_CEthe_Shaconemo_diags/src/OCE/DIA/diaar5.F90	(revision 12008)
+++ /NEMO/branches/2019/dev_r11643_ENHANCE-11_CEthe_Shaconemo_diags/src/OCE/DIA/diaar5.F90	(revision 12009)
@@ -232,5 +232,7 @@
             ALLOCATE( ztpot(jpi,jpj,jpk) )
             ztpot(:,:,jpk) = 0._wp
-            ztpot(:,:,:)   = eos_pt_from_ct( tsn(:,:,:,jp_tem), tsn(:,:,:,jp_sal) )
+            DO jk = 1, jpkm1
+               ztpot(:,:,jk) = eos_pt_from_ct( tsn(:,:,jk,jp_tem), tsn(:,:,jk,jp_sal) )
+            END DO
             !
             CALL iom_put( 'toce_pot', ztpot(:,:,:) )  ! potential temperature (TEOS-10 case)
Index: /NEMO/branches/2019/dev_r11643_ENHANCE-11_CEthe_Shaconemo_diags/src/OCE/TRA/eosbn2.F90
===================================================================
--- /NEMO/branches/2019/dev_r11643_ENHANCE-11_CEthe_Shaconemo_diags/src/OCE/TRA/eosbn2.F90	(revision 12008)
+++ /NEMO/branches/2019/dev_r11643_ENHANCE-11_CEthe_Shaconemo_diags/src/OCE/TRA/eosbn2.F90	(revision 12009)
@@ -30,4 +30,5 @@
    !!   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 
@@ -66,8 +67,4 @@
    END INTERFACE
    !
-   INTERFACE eos_pt_from_ct
-      MODULE PROCEDURE eos_pt_from_ct_2d, eos_pt_from_ct_3d
-   END INTERFACE
-
    PUBLIC   eos            ! called by step, istate, tranpc and zpsgrd modules
    PUBLIC   bn2            ! called by step module
@@ -79,7 +76,7 @@
 
    !                               !!** Namelist nameos **
-   LOGICAL , PUBLIC ::   ln_TEOS10  
-   LOGICAL , PUBLIC ::   ln_EOS80  
-   LOGICAL , PUBLIC ::   ln_SEOS  
+   LOGICAL , PUBLIC ::   ln_TEOS10
+   LOGICAL , PUBLIC ::   ln_EOS80
+   LOGICAL , PUBLIC ::   ln_SEOS
 
    ! Parameters
@@ -939,5 +936,5 @@
 
 
-   FUNCTION eos_pt_from_ct_2d( ctmp, psal ) RESULT( ptmp )
+   FUNCTION eos_pt_from_ct( ctmp, psal ) RESULT( ptmp )
       !!----------------------------------------------------------------------
       !!                 ***  ROUTINE eos_pt_from_ct  ***
@@ -962,5 +959,5 @@
       !!----------------------------------------------------------------------
       !
-      IF( ln_timing )   CALL timing_start('eos_pt_from_ct_2d')
+      IF( ln_timing )   CALL timing_start('eos_pt_from_ct')
       !
       zdeltaS = 5._wp
@@ -993,68 +990,7 @@
       END DO
       !
-      IF( ln_timing )   CALL timing_stop('eos_pt_from_ct_2d')
-      !
-   END FUNCTION eos_pt_from_ct_2d
-
-   
-   FUNCTION eos_pt_from_ct_3d( ctmp, psal ) RESULT( ptmp )
-      !!----------------------------------------------------------------------
-      !!                 ***  ROUTINE eos_pt_from_ct  ***
-      !!
-      !! ** Purpose :   Compute pot.temp. from cons. temp. [Celcius]
-      !!
-      !! ** Method  :   rational approximation (5/3th order) of TEOS-10 algorithm
-      !!       checkvalue: pt=20.02391895 Celsius for sa=35.7g/kg, ct=20degC
-      !!
-      !! Reference  :   TEOS-10, UNESCO
-      !!                Rational approximation to TEOS10 algorithm (rms error on WOA13 values: 4.0e-5 degC)
-      !!----------------------------------------------------------------------
-      REAL(wp), DIMENSION(jpi,jpj,jpk), INTENT(in) ::   ctmp   ! Cons. Temp [Celcius]
-      REAL(wp), DIMENSION(jpi,jpj,jpk), INTENT(in) ::   psal   ! salinity   [psu]
-      ! Leave result array automatic rather than making explicitly allocated
-      REAL(wp), DIMENSION(jpi,jpj,jpk) ::   ptmp   ! potential temperature [Celcius]
-      !
-      INTEGER  ::   ji, jj, jk           ! dummy loop indices
-      REAL(wp) ::   zt , zs , ztm        ! local scalars
-      REAL(wp) ::   zn , zd              ! local scalars
-      REAL(wp) ::   zdeltaS , z1_S0 , z1_T0
-      !!----------------------------------------------------------------------
-      !
-      IF ( ln_timing )   CALL timing_start('eos_pt_from_ct_3d')
-      !
-      zdeltaS = 5._wp
-      z1_S0   = 0.875_wp/35.16504_wp
-      z1_T0   = 1._wp/40._wp
-      !
-      DO jk = 1, jpkm1
-         DO jj = 1, jpj
-            DO ji = 1, jpi
-               !
-               zt  = ctmp   (ji,jj,jk) * z1_T0
-               zs  = SQRT( ABS( psal(ji,jj,jk) + zdeltaS ) * r1_S0 )
-               ztm = tmask(ji,jj,jk)
-               !
-               zn = ((((-2.1385727895e-01_wp*zt   &
-                  &   - 2.7674419971e-01_wp*zs+1.0728094330_wp)*zt   &
-                  &   + (2.6366564313_wp*zs+3.3546960647_wp)*zs-7.8012209473_wp)*zt   &
-                  &   + ((1.8835586562_wp*zs+7.3949191679_wp)*zs-3.3937395875_wp)*zs-5.6414948432_wp)*zt   &
-                  &   + (((3.5737370589_wp*zs-1.5512427389e+01_wp)*zs+2.4625741105e+01_wp)*zs   &
-                  &      +1.9912291000e+01_wp)*zs-3.2191146312e+01_wp)*zt   &
-                  &   + ((((5.7153204649e-01_wp*zs-3.0943149543_wp)*zs+9.3052495181_wp)*zs   &
-                  &      -9.4528934807_wp)*zs+3.1066408996_wp)*zs-4.3504021262e-01_wp
-                  !
-               zd = (2.0035003456_wp*zt   &
-                  &   -3.4570358592e-01_wp*zs+5.6471810638_wp)*zt   &
-                  &   + (1.5393993508_wp*zs-6.9394762624_wp)*zs+1.2750522650e+01_wp
-                  !
-               ptmp(ji,jj,jk) = ( zt / z1_T0 + zn / zd ) * ztm
-                  !
-            END DO
-         END DO
-      END DO
-      !
-      IF( ln_timing )   CALL timing_stop('eos_pt_from_ct_3d')
-      !
-   END FUNCTION eos_pt_from_ct_3d
+      IF( ln_timing )   CALL timing_stop('eos_pt_from_ct')
+      !
+   END FUNCTION eos_pt_from_ct
 
 
@@ -1715,5 +1651,5 @@
 
          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,*)
