Index: branches/2014/dev_CNRS1_10_TEOS10_Ediag/NEMOGCM/NEMO/OPA_SRC/TRA/eosbn2.F90
===================================================================
--- branches/2014/dev_CNRS1_10_TEOS10_Ediag/NEMOGCM/NEMO/OPA_SRC/TRA/eosbn2.F90	(revision 4619)
+++ branches/2014/dev_CNRS1_10_TEOS10_Ediag/NEMOGCM/NEMO/OPA_SRC/TRA/eosbn2.F90	(revision 4786)
@@ -21,5 +21,5 @@
    !!             -   ! 2012-05  (F. Roquet)  add Vallis and original JM95 equation of state
    !!             -   ! 2013-04  (F. Roquet, G. Madec)  add eos_rab, change bn2 computation and reorganize the module
-   !!             -   ! 2014-02  (F. Roquet)  add TEOS-10, S-EOS, and modify EOS-80
+   !!             -   ! 2014-09  (F. Roquet)  add TEOS-10, S-EOS, and modify EOS-80
    !!----------------------------------------------------------------------
 
@@ -80,74 +80,85 @@
    REAL(wp) ::   rn_nu      = 2.4341e-3_wp     ! cabbeling coeff. in theta*salt  
    
+   ! TEOS10/EOS80 parameters
+   REAL(wp) ::   r1_S0, r1_T0, r1_Z0, rdeltaS
+   
    ! EOS parameters
-   REAL(wp) ::   EOS111 , EOS211 , EOS311 , EOS411 , EOS511 , EOS611 , EOS711
-   REAL(wp) ::   EOS121 , EOS221 , EOS321 , EOS421 , EOS521 , EOS621
-   REAL(wp) ::   EOS131 , EOS231 , EOS331 , EOS431 , EOS531
-   REAL(wp) ::   EOS141 , EOS241 , EOS341 , EOS441
-   REAL(wp) ::   EOS151 , EOS251 , EOS351
-   REAL(wp) ::   EOS161 , EOS261
-   REAL(wp) ::   EOS171
-   REAL(wp) ::   EOS112 , EOS212 , EOS312 , EOS412 , EOS512
-   REAL(wp) ::   EOS122 , EOS222 , EOS322 , EOS422
-   REAL(wp) ::   EOS132 , EOS232 , EOS332
-   REAL(wp) ::   EOS142 , EOS242
-   REAL(wp) ::   EOS152
-   REAL(wp) ::   EOS113 , EOS213 , EOS313
-   REAL(wp) ::   EOS123 , EOS223
-   REAL(wp) ::   EOS133
+   REAL(wp) ::   EOS000 , EOS100 , EOS200 , EOS300 , EOS400 , EOS500 , EOS600
+   REAL(wp) ::   EOS010 , EOS110 , EOS210 , EOS310 , EOS410 , EOS510
+   REAL(wp) ::   EOS020 , EOS120 , EOS220 , EOS320 , EOS420
+   REAL(wp) ::   EOS030 , EOS130 , EOS230 , EOS330
+   REAL(wp) ::   EOS040 , EOS140 , EOS240
+   REAL(wp) ::   EOS050 , EOS150
+   REAL(wp) ::   EOS060
+   REAL(wp) ::   EOS001 , EOS101 , EOS201 , EOS301 , EOS401
+   REAL(wp) ::   EOS011 , EOS111 , EOS211 , EOS311
+   REAL(wp) ::   EOS021 , EOS121 , EOS221
+   REAL(wp) ::   EOS031 , EOS131
+   REAL(wp) ::   EOS041
+   REAL(wp) ::   EOS002 , EOS102 , EOS202
+   REAL(wp) ::   EOS012 , EOS112
+   REAL(wp) ::   EOS022
+   REAL(wp) ::   EOS003 , EOS103
+   REAL(wp) ::   EOS013 
    
    ! ALPHA parameters
-   REAL(wp) ::   ALP111 , ALP211 , ALP311 , ALP411 , ALP511 , ALP611
-   REAL(wp) ::   ALP121 , ALP221 , ALP321 , ALP421 , ALP521
-   REAL(wp) ::   ALP131 , ALP231 , ALP331 , ALP431
-   REAL(wp) ::   ALP141 , ALP241 , ALP341
-   REAL(wp) ::   ALP151 , ALP251
-   REAL(wp) ::   ALP161
-   REAL(wp) ::   ALP112 , ALP212 , ALP312 , ALP412
-   REAL(wp) ::   ALP122 , ALP222 , ALP322
-   REAL(wp) ::   ALP132 , ALP232
-   REAL(wp) ::   ALP142
-   REAL(wp) ::   ALP113 , ALP213
-   REAL(wp) ::   ALP123
+   REAL(wp) ::   ALP000 , ALP100 , ALP200 , ALP300 , ALP400 , ALP500
+   REAL(wp) ::   ALP010 , ALP110 , ALP210 , ALP310 , ALP410
+   REAL(wp) ::   ALP020 , ALP120 , ALP220 , ALP320
+   REAL(wp) ::   ALP030 , ALP130 , ALP230
+   REAL(wp) ::   ALP040 , ALP140
+   REAL(wp) ::   ALP050
+   REAL(wp) ::   ALP001 , ALP101 , ALP201 , ALP301
+   REAL(wp) ::   ALP011 , ALP111 , ALP211
+   REAL(wp) ::   ALP021 , ALP121
+   REAL(wp) ::   ALP031
+   REAL(wp) ::   ALP002 , ALP102
+   REAL(wp) ::   ALP012
+   REAL(wp) ::   ALP003
    
    ! BETA parameters
-   REAL(wp) ::   BET111 , BET211 , BET311 , BET411 , BET511 , BET611
-   REAL(wp) ::   BET121 , BET221 , BET321 , BET421 , BET521
-   REAL(wp) ::   BET131 , BET231 , BET331 , BET431
-   REAL(wp) ::   BET141 , BET241 , BET341
-   REAL(wp) ::   BET151 , BET251
-   REAL(wp) ::   BET161
-   REAL(wp) ::   BET112 , BET212 , BET312 , BET412
-   REAL(wp) ::   BET122 , BET222 , BET322
-   REAL(wp) ::   BET132 , BET232
-   REAL(wp) ::   BET142
-   REAL(wp) ::   BET113 , BET213
-   REAL(wp) ::   BET123
+   REAL(wp) ::   BET000 , BET100 , BET200 , BET300 , BET400 , BET500
+   REAL(wp) ::   BET010 , BET110 , BET210 , BET310 , BET410
+   REAL(wp) ::   BET020 , BET120 , BET220 , BET320
+   REAL(wp) ::   BET030 , BET130 , BET230
+   REAL(wp) ::   BET040 , BET140
+   REAL(wp) ::   BET050
+   REAL(wp) ::   BET001 , BET101 , BET201 , BET301
+   REAL(wp) ::   BET011 , BET111 , BET211
+   REAL(wp) ::   BET021 , BET121
+   REAL(wp) ::   BET031
+   REAL(wp) ::   BET002 , BET102
+   REAL(wp) ::   BET012
+   REAL(wp) ::   BET003
 
    ! PEN parameters
-   REAL(wp) ::   PEN112 , PEN212 , PEN312 , PEN412 , PEN512
-   REAL(wp) ::   PEN122 , PEN222 , PEN322 , PEN422
-   REAL(wp) ::   PEN132 , PEN232 , PEN332
-   REAL(wp) ::   PEN142 , PEN242
-   REAL(wp) ::   PEN152
-   REAL(wp) ::   PEN113 , PEN213 , PEN313
-   REAL(wp) ::   PEN123 , PEN223
-   REAL(wp) ::   PEN133
+   REAL(wp) ::   PEN000 , PEN100 , PEN200 , PEN300 , PEN400
+   REAL(wp) ::   PEN010 , PEN110 , PEN210 , PEN310
+   REAL(wp) ::   PEN020 , PEN120 , PEN220
+   REAL(wp) ::   PEN030 , PEN130
+   REAL(wp) ::   PEN040
+   REAL(wp) ::   PEN001 , PEN101 , PEN201
+   REAL(wp) ::   PEN011 , PEN111
+   REAL(wp) ::   PEN021
+   REAL(wp) ::   PEN002 , PEN102
+   REAL(wp) ::   PEN012
    
    ! ALPHA_PEN parameters
-   REAL(wp) ::   APE112 , APE212 , APE312 , APE412
-   REAL(wp) ::   APE122 , APE222 , APE322
-   REAL(wp) ::   APE132 , APE232
-   REAL(wp) ::   APE142
-   REAL(wp) ::   APE113 , APE213
-   REAL(wp) ::   APE123
+   REAL(wp) ::   APE000 , APE100 , APE200 , APE300
+   REAL(wp) ::   APE010 , APE110 , APE210
+   REAL(wp) ::   APE020 , APE120
+   REAL(wp) ::   APE030
+   REAL(wp) ::   APE001 , APE101
+   REAL(wp) ::   APE011
+   REAL(wp) ::   APE002
 
    ! BETA_PEN parameters
-   REAL(wp) ::   BPE112 , BPE212 , BPE312 , BPE412
-   REAL(wp) ::   BPE122 , BPE222 , BPE322
-   REAL(wp) ::   BPE132 , BPE232
-   REAL(wp) ::   BPE142
-   REAL(wp) ::   BPE113 , BPE213
-   REAL(wp) ::   BPE123
+   REAL(wp) ::   BPE000 , BPE100 , BPE200 , BPE300
+   REAL(wp) ::   BPE010 , BPE110 , BPE210
+   REAL(wp) ::   BPE020 , BPE120
+   REAL(wp) ::   BPE030
+   REAL(wp) ::   BPE001 , BPE101
+   REAL(wp) ::   BPE011
+   REAL(wp) ::   BPE002
 
    !! * Substitutions
@@ -170,7 +181,7 @@
       !!
       !! ** Method  :   prd(t,s,z) = ( rho(t,s,z) - rau0 ) / rau0
-      !!         with   prd    in situ density anomalie     no units
-      !!                t      potential temperature        Celsius
-      !!                s      salinity                     psu
+      !!         with   prd    in situ density anomaly      no units
+      !!                t      TEOS10: CT or EOS80: PT      Celsius
+      !!                s      TEOS10: SA or EOS80: SP      TEOS10: g/kg or EOS80: psu
       !!                z      depth                        meters
       !!                rho    in situ density              kg/m^3
@@ -178,11 +189,8 @@
       !!
       !!     nn_eos = -1 : polynomial TEOS-10 equation of state is used for rho(t,s,z).
-      !!         Check value: rho = 1028.21583 kg/m^3 for p=3000 dbar, t=3 Celcius, s=35.5 psu
-      !!
-      !!     nn_eos =  0 : Jackett and McDougall (1995) equation of state is used for rho(t,s,z)
-      !!            where the density anomaly of a water parcel at t=4, s=35 moved adiabatically to surface
-      !!            has been removed: rho = rho_JM95 - ( rho_JM95(4,35,z) - rho_JM95(4,35,0) )
-      !!         Check value: rho = 1028.34976 kg/m^3 for p=3000 dbar, t=3 Celcius, s=35.5 psu
-      !!         Check value: rho_JM95 = 1041.83267 kg/m^3 for p=3000 dbar, t=3 Celcius, s=35.5 psu
+      !!         Check value: rho = 1028.21993233072 kg/m^3 for z=3000 dbar, ct=3 Celcius, sa=35.5 g/kg
+      !!
+      !!     nn_eos =  0 : polynomial EOS-80 equation of state is used for rho(t,s,z).
+      !!         Check value: rho = 1028.35011066567 kg/m^3 for z=3000 dbar, pt=3 Celcius, sp=35.5 psu
       !!
       !!     nn_eos =  1 : simplified equation of state
@@ -194,8 +202,7 @@
       !! ** Action  :   compute prd , the in situ density (no units)
       !!
-      !! References :   Jackett and McDougall, J. Atmos. Ocean. Tech., 1995
+      !! References :   Roquet et al, Ocean Modelling, in preparation (2014)
       !!                Vallis, Atmospheric and Oceanic Fluid Dynamics, 2006
       !!                TEOS-10 Manual, 2010
-      !!                Roquet, Ocean Modelling, in preparation (2013)
       !!----------------------------------------------------------------------
       REAL(wp), DIMENSION(jpi,jpj,jpk,jpts), INTENT(in   ) ::   pts   ! 1 : potential temperature  [Celcius]
@@ -205,9 +212,9 @@
       !
       INTEGER  ::   ji, jj, jk                ! dummy loop indices
-      REAL(wp) ::   zt , zh , zs , zsr, ztm   ! local scalars
-      REAL(wp) ::   zn , zn0, zn1, zn2        !   -      -
-      !!----------------------------------------------------------------------
-      !
-      IF( nn_timing == 1 )   CALL timing_start('eos')
+      REAL(wp) ::   zt , zh , zs , ztm        ! local scalars
+      REAL(wp) ::   zn , zn0, zn1, zn2, zn3   !   -      -
+      !!----------------------------------------------------------------------
+      !
+      IF( nn_timing == 1 )   CALL timing_start('eos-insitu')
       !
       SELECT CASE( nn_eos )
@@ -219,28 +226,34 @@
                DO ji = 1, jpi
                   !
-                  zh  = pdep(ji,jj,jk)                                  ! depth
-                  zt  = pts (ji,jj,jk,jp_tem)                           ! temperature
-                  zsr = SQRT( MAX( pts(ji,jj,jk,jp_sal) , 0.1_wp ) )    ! square root salinity
-                  ztm = tmask(ji,jj,jk)                                 ! tmask
-                  !
-                  zn2  = (   EOS133*zsr  + EOS223*zt + EOS123 )*zsr + ( EOS313*zt + EOS213 )*zt + EOS113
-                  !
-                  zn1  = ( ( ( EOS152*zsr   &
-                     &   + EOS242*zt + EOS142 )*zsr   &
-                     &   + ( EOS332*zt + EOS232 )*zt + EOS132 )*zsr   &
-                     &   + ( ( EOS422*zt + EOS322 )*zt + EOS222 )*zt + EOS122 )*zsr   &
-                     &   + ( ( ( EOS512*zt + EOS412 )*zt + EOS312 )*zt + EOS212 )*zt + EOS112
-                  !
-                  zn0  = ( ( ( ( ( EOS171*zsr   &
-                     &   + EOS261*zt + EOS161 )*zsr   &
-                     &   + ( EOS351*zt + EOS251 )*zt + EOS151 )*zsr   &
-                     &   + ( ( EOS441*zt + EOS341 )*zt + EOS241 )*zt + EOS141 )*zsr   &
-                     &   + ( ( ( EOS531*zt + EOS431 )*zt + EOS331 )*zt + EOS231 )*zt + EOS131 )*zsr   &
-                     &   + ( ( ( ( EOS621*zt + EOS521 )*zt + EOS421 )*zt + EOS321 )*zt + EOS221 )*zt + EOS121 )*zsr   &
-                     &   + ( ( ( ( ( EOS711*zt + EOS611 )*zt + EOS511 )*zt + EOS411 )*zt + EOS311 )*zt + EOS211 )*zt + EOS111
-                  !
-                  zn   = ( zn2 * zh + zn1 ) * zh + zn0
-                  !                                               
+                  zh  = pdep(ji,jj,jk) * r1_Z0                                  ! depth
+                  zt  = pts (ji,jj,jk,jp_tem) * r1_T0                           ! temperature
+                  zs  = SQRT( ABS( pts(ji,jj,jk,jp_sal) + rdeltaS ) * r1_S0 )   ! square root salinity
+                  ztm = tmask(ji,jj,jk)                                         ! tmask
+                  !
+                  zn3 = EOS013*zt   &
+                     &   + EOS103*zs+EOS003
+                  !
+                  zn2 = (EOS022*zt   &
+                     &   + EOS112*zs+EOS012)*zt   &
+                     &   + (EOS202*zs+EOS102)*zs+EOS002
+                  !
+                  zn1 = (((EOS041*zt   &
+                     &   + EOS131*zs+EOS031)*zt   &
+                     &   + (EOS221*zs+EOS121)*zs+EOS021)*zt   &
+                     &   + ((EOS311*zs+EOS211)*zs+EOS111)*zs+EOS011)*zt   &
+                     &   + (((EOS401*zs+EOS301)*zs+EOS201)*zs+EOS101)*zs+EOS001
+                  !
+                  zn0 = (((((EOS060*zt   &
+                     &   + EOS150*zs+EOS050)*zt   &
+                     &   + (EOS240*zs+EOS140)*zs+EOS040)*zt   &
+                     &   + ((EOS330*zs+EOS230)*zs+EOS130)*zs+EOS030)*zt   &
+                     &   + (((EOS420*zs+EOS320)*zs+EOS220)*zs+EOS120)*zs+EOS020)*zt   &
+                     &   + ((((EOS510*zs+EOS410)*zs+EOS310)*zs+EOS210)*zs+EOS110)*zs+EOS010)*zt   &
+                     &   + (((((EOS600*zs+EOS500)*zs+EOS400)*zs+EOS300)*zs+EOS200)*zs+EOS100)*zs+EOS000
+                  !
+                  zn   = ( ( zn3 * zh + zn2 ) * zh + zn1 ) * zh + zn0
+                  !
                   prd(ji,jj,jk) = (  zn * r1_rau0 - 1._wp  ) * ztm  ! density anomaly (masked)
+                  !
                END DO
             END DO
@@ -268,7 +281,7 @@
       END SELECT
       !
-      IF(ln_ctl)   CALL prt_ctl( tab3d_1=prd, clinfo1=' eos  : ', ovlap=1, kdim=jpk )
-      !
-      IF( nn_timing == 1 )   CALL timing_stop('eos')
+      IF(ln_ctl)   CALL prt_ctl( tab3d_1=prd, clinfo1=' eos-insitu  : ', ovlap=1, kdim=jpk )
+      !
+      IF( nn_timing == 1 )   CALL timing_stop('eos-insitu')
       !
    END SUBROUTINE eos_insitu
@@ -295,9 +308,9 @@
       !
       INTEGER  ::   ji, jj, jk                ! dummy loop indices
-      REAL(wp) ::   zt , zh , zs , zsr, ztm   ! local scalars
-      REAL(wp) ::   zn , zn0, zn1, zn2        !   -      -
-      !!----------------------------------------------------------------------
-      !
-      IF( nn_timing == 1 )   CALL timing_start('eos-p')
+      REAL(wp) ::   zt , zh , zs , ztm        ! local scalars
+      REAL(wp) ::   zn , zn0, zn1, zn2, zn3   !   -      -
+      !!----------------------------------------------------------------------
+      !
+      IF( nn_timing == 1 )   CALL timing_start('eos-pot')
       !
       SELECT CASE ( nn_eos )
@@ -309,26 +322,31 @@
                DO ji = 1, jpi
                   !
-                  zh  = pdep (ji,jj,jk)                                 ! depth
-                  zt  = pts  (ji,jj,jk,jp_tem)                          ! conservative temperature
-                  zsr = SQRT( MAX( pts(ji,jj,jk,jp_sal) , 0.1_wp ) )    ! square root salinity
-                  ztm = tmask(ji,jj,jk)                                 ! tmask
-                  !
-                  zn2  = (   EOS133*zsr  + EOS223*zt + EOS123 )*zsr + ( EOS313*zt + EOS213 )*zt + EOS113
-                  !
-                  zn1  = ( ( ( EOS152*zsr   &
-                     &   + EOS242*zt + EOS142 )*zsr   &
-                     &   + ( EOS332*zt + EOS232 )*zt + EOS132 )*zsr   &
-                     &   + ( ( EOS422*zt + EOS322 )*zt + EOS222 )*zt + EOS122 )*zsr   &
-                     &   + ( ( ( EOS512*zt + EOS412 )*zt + EOS312 )*zt + EOS212 )*zt + EOS112
-                  !
-                  zn0  = ( ( ( ( ( EOS171*zsr   &
-                     &   + EOS261*zt + EOS161 )*zsr   &
-                     &   + ( EOS351*zt + EOS251 )*zt + EOS151 )*zsr   &
-                     &   + ( ( EOS441*zt + EOS341 )*zt + EOS241 )*zt + EOS141 )*zsr   &
-                     &   + ( ( ( EOS531*zt + EOS431 )*zt + EOS331 )*zt + EOS231 )*zt + EOS131 )*zsr   &
-                     &   + ( ( ( ( EOS621*zt + EOS521 )*zt + EOS421 )*zt + EOS321 )*zt + EOS221 )*zt + EOS121 )*zsr   &
-                     &   + ( ( ( ( ( EOS711*zt + EOS611 )*zt + EOS511 )*zt + EOS411 )*zt + EOS311 )*zt + EOS211 )*zt + EOS111
-                  !
-                  zn   = ( zn2 * zh + zn1 ) * zh + zn0
+                  zh  = pdep(ji,jj,jk) * r1_Z0                                  ! depth
+                  zt  = pts (ji,jj,jk,jp_tem) * r1_T0                           ! temperature
+                  zs  = SQRT( ABS( pts(ji,jj,jk,jp_sal) + rdeltaS ) * r1_S0 )   ! square root salinity
+                  ztm = tmask(ji,jj,jk)                                         ! tmask
+                  !
+                  zn3 = EOS013*zt   &
+                     &   + EOS103*zs+EOS003
+                  !
+                  zn2 = (EOS022*zt   &
+                     &   + EOS112*zs+EOS012)*zt   &
+                     &   + (EOS202*zs+EOS102)*zs+EOS002
+                  !
+                  zn1 = (((EOS041*zt   &
+                     &   + EOS131*zs+EOS031)*zt   &
+                     &   + (EOS221*zs+EOS121)*zs+EOS021)*zt   &
+                     &   + ((EOS311*zs+EOS211)*zs+EOS111)*zs+EOS011)*zt   &
+                     &   + (((EOS401*zs+EOS301)*zs+EOS201)*zs+EOS101)*zs+EOS001
+                  !
+                  zn0 = (((((EOS060*zt   &
+                     &   + EOS150*zs+EOS050)*zt   &
+                     &   + (EOS240*zs+EOS140)*zs+EOS040)*zt   &
+                     &   + ((EOS330*zs+EOS230)*zs+EOS130)*zs+EOS030)*zt   &
+                     &   + (((EOS420*zs+EOS320)*zs+EOS220)*zs+EOS120)*zs+EOS020)*zt   &
+                     &   + ((((EOS510*zs+EOS410)*zs+EOS310)*zs+EOS210)*zs+EOS110)*zs+EOS010)*zt   &
+                     &   + (((((EOS600*zs+EOS500)*zs+EOS400)*zs+EOS300)*zs+EOS200)*zs+EOS100)*zs+EOS000
+                  !
+                  zn   = ( ( zn3 * zh + zn2 ) * zh + zn1 ) * zh + zn0
                   !
                   prhop(ji,jj,jk) = zn0 * ztm                           ! potential density referenced at the surface
@@ -363,7 +381,7 @@
       END SELECT
       !
-      IF(ln_ctl)   CALL prt_ctl( tab3d_1=prd, clinfo1=' eos-p: ', tab3d_2=prhop, clinfo2=' pot : ', ovlap=1, kdim=jpk )
-      !
-      IF( nn_timing == 1 )   CALL timing_stop('eos-p')
+      IF(ln_ctl)   CALL prt_ctl( tab3d_1=prd, clinfo1=' eos-pot: ', tab3d_2=prhop, clinfo2=' pot : ', ovlap=1, kdim=jpk )
+      !
+      IF( nn_timing == 1 )   CALL timing_stop('eos-pot')
       !
    END SUBROUTINE eos_insitu_pot
@@ -387,6 +405,6 @@
       !
       INTEGER  ::   ji, jj, jk                ! dummy loop indices
-      REAL(wp) ::   zt , zh , zs , zsr, ztm   ! local scalars
-      REAL(wp) ::   zn , zn0, zn1, zn2        !   -      -
+      REAL(wp) ::   zt , zh , zs              ! local scalars
+      REAL(wp) ::   zn , zn0, zn1, zn2, zn3   !   -      -
       !!----------------------------------------------------------------------
       !
@@ -402,26 +420,30 @@
             DO ji = 1, fs_jpim1   ! vector opt.
                !
-               zt    = pts  (ji,jj,jp_tem)            ! interpolated T
-               zsr = SQRT( MAX( pts(ji,jj,jp_sal) , 0.1_wp ) )     ! square root salinity
-               zh    = pdep (ji,jj)            ! depth at the partial step level
-               !
-               !
-               zn2  = (   EOS133*zsr  + EOS223*zt + EOS123 )*zsr + ( EOS313*zt + EOS213 )*zt + EOS113
-               !
-               zn1  = ( ( ( EOS152*zsr   &
-                  &   + EOS242*zt + EOS142 )*zsr   &
-                  &   + ( EOS332*zt + EOS232 )*zt + EOS132 )*zsr   &
-                  &   + ( ( EOS422*zt + EOS322 )*zt + EOS222 )*zt + EOS122 )*zsr   &
-                  &   + ( ( ( EOS512*zt + EOS412 )*zt + EOS312 )*zt + EOS212 )*zt + EOS112
-               !
-               zn0  = ( ( ( ( ( EOS171*zsr   &
-                  &   + EOS261*zt + EOS161 )*zsr   &
-                  &   + ( EOS351*zt + EOS251 )*zt + EOS151 )*zsr   &
-                  &   + ( ( EOS441*zt + EOS341 )*zt + EOS241 )*zt + EOS141 )*zsr   &
-                  &   + ( ( ( EOS531*zt + EOS431 )*zt + EOS331 )*zt + EOS231 )*zt + EOS131 )*zsr   &
-                  &   + ( ( ( ( EOS621*zt + EOS521 )*zt + EOS421 )*zt + EOS321 )*zt + EOS221 )*zt + EOS121 )*zsr   &
-                  &   + ( ( ( ( ( EOS711*zt + EOS611 )*zt + EOS511 )*zt + EOS411 )*zt + EOS311 )*zt + EOS211 )*zt + EOS111
-               !
-               zn   = ( zn2 * zh + zn1 ) * zh + zn0
+               zh  = pdep(ji,jj) * r1_Z0                                  ! depth
+               zt  = pts (ji,jj,jp_tem) * r1_T0                           ! temperature
+               zs  = SQRT( ABS( pts(ji,jj,jp_sal) + rdeltaS ) * r1_S0 )   ! square root salinity
+               !
+               zn3 = EOS013*zt   &
+                  &   + EOS103*zs+EOS003
+               !
+               zn2 = (EOS022*zt   &
+                  &   + EOS112*zs+EOS012)*zt   &
+                  &   + (EOS202*zs+EOS102)*zs+EOS002
+               !
+               zn1 = (((EOS041*zt   &
+                  &   + EOS131*zs+EOS031)*zt   &
+                  &   + (EOS221*zs+EOS121)*zs+EOS021)*zt   &
+                  &   + ((EOS311*zs+EOS211)*zs+EOS111)*zs+EOS011)*zt   &
+                  &   + (((EOS401*zs+EOS301)*zs+EOS201)*zs+EOS101)*zs+EOS001
+               !
+               zn0 = (((((EOS060*zt   &
+                  &   + EOS150*zs+EOS050)*zt   &
+                  &   + (EOS240*zs+EOS140)*zs+EOS040)*zt   &
+                  &   + ((EOS330*zs+EOS230)*zs+EOS130)*zs+EOS030)*zt   &
+                  &   + (((EOS420*zs+EOS320)*zs+EOS220)*zs+EOS120)*zs+EOS020)*zt   &
+                  &   + ((((EOS510*zs+EOS410)*zs+EOS310)*zs+EOS210)*zs+EOS110)*zs+EOS010)*zt   &
+                  &   + (((((EOS600*zs+EOS500)*zs+EOS400)*zs+EOS300)*zs+EOS200)*zs+EOS100)*zs+EOS000
+               !
+               zn   = ( ( zn3 * zh + zn2 ) * zh + zn1 ) * zh + zn0
                !
                prd(ji,jj) = zn * r1_rau0 - 1._wp               ! unmasked in situ density anomaly
@@ -464,11 +486,4 @@
       !!
       !! ** Method  :   calculates alpha / beta at T-points
-      !!       * nn_eos = 0  : polynomial approximation of McDougall (1987)
-      !!                       The alpha/beta is returned as 4-D array pab using the exact expression
-      !!                       based on the JM95 equation of state.
-      !!       * nn_eos = 1  : linear equation of state (temperature only)
-      !!                       We return alpha and beta=0
-      !!       * nn_eos = 2  : linear equation of state (temperature & salinity)
-      !!                       We return alpha0 and beta0
       !!
       !! ** Action  : - pab     : thermal/haline expansion ratio at T-points
@@ -478,6 +493,6 @@
       !
       INTEGER  ::   ji, jj, jk                ! dummy loop indices
-      REAL(wp) ::   zt , zh , zs , zsr, ztm   ! local scalars
-      REAL(wp) ::   zn , zn0, zn1, zn2        !   -      -
+      REAL(wp) ::   zt , zh , zs , ztm        ! local scalars
+      REAL(wp) ::   zn , zn0, zn1, zn2, zn3   !   -      -
       !!----------------------------------------------------------------------
       !
@@ -492,45 +507,52 @@
                DO ji = 1, jpi
                   !
-                  zh  = fsdept(ji,jj,jk)                        ! depth
-                  zt  = pts   (ji,jj,jk,jp_tem)                 ! conservative temperature
-                  zsr = SQRT( MAX( pts(ji,jj,jk,jp_sal) , 0.1_wp ) )     ! square root salinity
-                  ztm = tmask(ji,jj,jk)                         ! tmask
-                  !
-                  zn2 = ALP123*zsr + ALP213*zt + ALP113
-                  !
-                  zn1 = ( ( ALP142*zsr   &
-                     &   + ALP232*zt + ALP132 )*zsr   &
-                     &   + ( ALP322*zt + ALP222 )*zt + ALP122 )*zsr   &
-                     &   + ( ( ALP412*zt + ALP312 )*zt + ALP212 )*zt + ALP112
-                  !
-                  zn0 = ( ( ( ( ALP161*zsr   &
-                     &   + ALP251*zt + ALP151 )*zsr   &
-                     &   + ( ALP341*zt + ALP241 )*zt + ALP141 )*zsr   &
-                     &   + ( ( ALP431*zt + ALP331 )*zt + ALP231 )*zt + ALP131 )*zsr   &
-                     &   + ( ( ( ALP521*zt + ALP421 )*zt + ALP321 )*zt + ALP221 )*zt + ALP121 )*zsr   &
-                     &   + ( ( ( ( ALP611*zt + ALP511 )*zt + ALP411 )*zt + ALP311 )*zt + ALP211 )*zt + ALP111
-                     !
-                  zn   = ( zn2 * zh + zn1 ) * zh + zn0
+                  zh  = fsdept(ji,jj,jk) * r1_Z0                                ! depth
+                  zt  = pts (ji,jj,jk,jp_tem) * r1_T0                           ! temperature
+                  zs  = SQRT( ABS( pts(ji,jj,jk,jp_sal) + rdeltaS ) * r1_S0 )   ! square root salinity
+                  ztm = tmask(ji,jj,jk)                                         ! tmask
+                  !
+                  ! alpha
+                  zn3 = ALP003
+                  !
+                  zn2 = (ALP012)*zt   &
+                     &   + ALP102*zs+ALP002
+                  !
+                  zn1 = (((ALP031)*zt   &
+                     &   + ALP121*zs+ALP021)*zt   &
+                     &   + (ALP211*zs+ALP111)*zs+ALP011)*zt   &
+                     &   + ((ALP301*zs+ALP201)*zs+ALP101)*zs+ALP001
+                  !
+                  zn0 = (((((ALP050)*zt   &
+                     &   + ALP140*zs+ALP040)*zt   &
+                     &   + (ALP230*zs+ALP130)*zs+ALP030)*zt   &
+                     &   + ((ALP320*zs+ALP220)*zs+ALP120)*zs+ALP020)*zt   &
+                     &   + (((ALP410*zs+ALP310)*zs+ALP210)*zs+ALP110)*zs+ALP010)*zt   &
+                     &   + ((((ALP500*zs+ALP400)*zs+ALP300)*zs+ALP200)*zs+ALP100)*zs+ALP000
+                  !
+                  zn   = ( ( zn3 * zh + zn2 ) * zh + zn1 ) * zh + zn0
                   !
                   pab(ji,jj,jk,jp_tem) = zn * r1_rau0 * ztm
                   !
-                  !
-                  zn2 = BET123*zsr + BET213*zt + BET113
-                  !
-                  zn1 = ( ( BET142*zsr   &
-                     &   + BET232*zt + BET132 )*zsr   &
-                     &   + ( BET322*zt + BET222 )*zt + BET122 )*zsr   &
-                     &   + ( ( BET412*zt + BET312 )*zt + BET212 )*zt + BET112
-                     !
-                  zn0 = ( ( ( ( BET161*zsr   &
-                     &   + BET251*zt + BET151 )*zsr   &
-                     &   + ( BET341*zt + BET241 )*zt + BET141 )*zsr   &
-                     &   + ( ( BET431*zt + BET331 )*zt + BET231 )*zt + BET131 )*zsr   &
-                     &   + ( ( ( BET521*zt + BET421 )*zt + BET321 )*zt + BET221 )*zt + BET121 )*zsr   &
-                     &   + ( ( ( ( BET611*zt + BET511 )*zt + BET411 )*zt + BET311 )*zt + BET211 )*zt + BET111
-                     !
-                  zn  = ( zn2 * zh + zn1 ) * zh + zn0
-                  !
-                  pab(ji,jj,jk,jp_sal) = zn / zsr * r1_rau0 * ztm
+                  ! beta
+                  zn3 = BET003
+                  !
+                  zn2 = (BET012)*zt   &
+                     &   + BET102*zs+BET002
+                  !
+                  zn1 = (((BET031)*zt   &
+                     &   + BET121*zs+BET021)*zt   &
+                     &   + (BET211*zs+BET111)*zs+BET011)*zt   &
+                     &   + ((BET301*zs+BET201)*zs+BET101)*zs+BET001
+                  !
+                  zn0 = (((((BET050)*zt   &
+                     &   + BET140*zs+BET040)*zt   &
+                     &   + (BET230*zs+BET130)*zs+BET030)*zt   &
+                     &   + ((BET320*zs+BET220)*zs+BET120)*zs+BET020)*zt   &
+                     &   + (((BET410*zs+BET310)*zs+BET210)*zs+BET110)*zs+BET010)*zt   &
+                     &   + ((((BET500*zs+BET400)*zs+BET300)*zs+BET200)*zs+BET100)*zs+BET000
+                  !
+                  zn   = ( ( zn3 * zh + zn2 ) * zh + zn1 ) * zh + zn0
+                  !
+                  pab(ji,jj,jk,jp_sal) = zn / zs * r1_rau0 * ztm
                   !
                END DO
@@ -547,7 +569,11 @@
                   zh  = fsdept(ji,jj,jk)                 ! depth in meters at t-point
                   ztm = tmask(ji,jj,jk)                  ! land/sea bottom mask = surf. mask
-                  !                                      ! alpha
-                  pab(ji,jj,jk,jp_tem) = ( rn_a0 * ( 1._wp + rn_lambda1*zt + rn_mu1*zh ) + rn_nu*zs ) * r1_rau0 * ztm   ! alpha
-                  pab(ji,jj,jk,jp_sal) = ( rn_b0 * ( 1._wp - rn_lambda2*zs - rn_mu2*zh ) - rn_nu*zt ) * r1_rau0 * ztm   ! beta                            ! beta
+                  !
+                  zn  = rn_a0 * ( 1._wp + rn_lambda1*zt + rn_mu1*zh ) + rn_nu*zs
+                  pab(ji,jj,jk,jp_tem) = zn * r1_rau0 * ztm   ! alpha
+                  !
+                  zn  = rn_b0 * ( 1._wp - rn_lambda2*zs - rn_mu2*zh ) - rn_nu*zt
+                  pab(ji,jj,jk,jp_sal) = zn * r1_rau0 * ztm   ! beta
+                  !
                END DO
             END DO
@@ -579,6 +605,6 @@
       !
       INTEGER  ::   ji, jj, jk                ! dummy loop indices
-      REAL(wp) ::   zt , zh , zs , zsr, ztm   ! local scalars
-      REAL(wp) ::   zn , zn0, zn1, zn2        !   -      -
+      REAL(wp) ::   zt , zh , zs              ! local scalars
+      REAL(wp) ::   zn , zn0, zn1, zn2, zn3   !   -      -
       !!----------------------------------------------------------------------
       !
@@ -594,45 +620,51 @@
             DO ji = 1, fs_jpim1   ! vector opt.
                !
-               zt    = pts  (ji,jj,jp_tem)            ! interpolated T
-               zsr = SQRT( MAX( pts(ji,jj,jp_sal) , 0.1_wp ) )     ! square root salinity
-               zh    = pdep (ji,jj)                   ! depth at the partial step level
-               !
-               !
-               zn2 = ALP123*zsr + ALP213*zt + ALP113
-               !
-               zn1 = ( ( ALP142*zsr   &
-                  &   + ALP232*zt + ALP132 )*zsr   &
-                  &   + ( ALP322*zt + ALP222 )*zt + ALP122 )*zsr   &
-                  &   + ( ( ALP412*zt + ALP312 )*zt + ALP212 )*zt + ALP112
-               !
-               zn0 = ( ( ( ( ALP161*zsr   &
-                  &   + ALP251*zt + ALP151 )*zsr   &
-                  &   + ( ALP341*zt + ALP241 )*zt + ALP141 )*zsr   &
-                  &   + ( ( ALP431*zt + ALP331 )*zt + ALP231 )*zt + ALP131 )*zsr   &
-                  &   + ( ( ( ALP521*zt + ALP421 )*zt + ALP321 )*zt + ALP221 )*zt + ALP121 )*zsr   &
-                  &   + ( ( ( ( ALP611*zt + ALP511 )*zt + ALP411 )*zt + ALP311 )*zt + ALP211 )*zt + ALP111
-               !
-               zn   = ( zn2 * zh + zn1 ) * zh + zn0
+               zh  = pdep(ji,jj) * r1_Z0                                  ! depth
+               zt  = pts (ji,jj,jp_tem) * r1_T0                           ! temperature
+               zs  = SQRT( ABS( pts(ji,jj,jp_sal) + rdeltaS ) * r1_S0 )   ! square root salinity
+               !
+               ! alpha
+               zn3 = ALP003
+               !
+               zn2 = (ALP012)*zt   &
+                  &   + ALP102*zs+ALP002
+               !
+               zn1 = (((ALP031)*zt   &
+                  &   + ALP121*zs+ALP021)*zt   &
+                  &   + (ALP211*zs+ALP111)*zs+ALP011)*zt   &
+                  &   + ((ALP301*zs+ALP201)*zs+ALP101)*zs+ALP001
+               !
+               zn0 = (((((ALP050)*zt   &
+                  &   + ALP140*zs+ALP040)*zt   &
+                  &   + (ALP230*zs+ALP130)*zs+ALP030)*zt   &
+                  &   + ((ALP320*zs+ALP220)*zs+ALP120)*zs+ALP020)*zt   &
+                  &   + (((ALP410*zs+ALP310)*zs+ALP210)*zs+ALP110)*zs+ALP010)*zt   &
+                  &   + ((((ALP500*zs+ALP400)*zs+ALP300)*zs+ALP200)*zs+ALP100)*zs+ALP000
+               !
+               zn   = ( ( zn3 * zh + zn2 ) * zh + zn1 ) * zh + zn0
                !
                pab(ji,jj,jp_tem) = zn * r1_rau0
                !
-               !
-               zn2 = BET123*zsr + BET213*zt + BET113
-               !
-               zn1 = ( ( BET142*zsr   &
-                  &   + BET232*zt + BET132 )*zsr   &
-                  &   + ( BET322*zt + BET222 )*zt + BET122 )*zsr   &
-                  &   + ( ( BET412*zt + BET312 )*zt + BET212 )*zt + BET112
-               !
-               zn0 = ( ( ( ( BET161*zsr   &
-                  &   + BET251*zt + BET151 )*zsr   &
-                  &   + ( BET341*zt + BET241 )*zt + BET141 )*zsr   &
-                  &   + ( ( BET431*zt + BET331 )*zt + BET231 )*zt + BET131 )*zsr   &
-                  &   + ( ( ( BET521*zt + BET421 )*zt + BET321 )*zt + BET221 )*zt + BET121 )*zsr   &
-                  &   + ( ( ( ( BET611*zt + BET511 )*zt + BET411 )*zt + BET311 )*zt + BET211 )*zt + BET111
-               !
-               zn   = ( zn2 * zh + zn1 ) * zh + zn0
-               !
-               pab(ji,jj,jp_sal) = zn / zsr * r1_rau0
+               ! beta
+               zn3 = BET003
+               !
+               zn2 = (BET012)*zt   &
+                  &   + BET102*zs+BET002
+               !
+               zn1 = (((BET031)*zt   &
+                  &   + BET121*zs+BET021)*zt   &
+                  &   + (BET211*zs+BET111)*zs+BET011)*zt   &
+                  &   + ((BET301*zs+BET201)*zs+BET101)*zs+BET001
+               !
+               zn0 = (((((BET050)*zt   &
+                  &   + BET140*zs+BET040)*zt   &
+                  &   + (BET230*zs+BET130)*zs+BET030)*zt   &
+                  &   + ((BET320*zs+BET220)*zs+BET120)*zs+BET020)*zt   &
+                  &   + (((BET410*zs+BET310)*zs+BET210)*zs+BET110)*zs+BET010)*zt   &
+                  &   + ((((BET500*zs+BET400)*zs+BET300)*zs+BET200)*zs+BET100)*zs+BET000
+               !
+               zn   = ( ( zn3 * zh + zn2 ) * zh + zn1 ) * zh + zn0
+               !
+               pab(ji,jj,jp_sal) = zn / zs * r1_rau0
                !
                !
@@ -649,7 +681,9 @@
                zh    = pdep (ji,jj)                   ! depth at the partial step level
                !
-               !                                    ! alpha
-               pab(ji,jj,jp_tem) = ( rn_a0 * ( 1._wp + rn_lambda1*zt + rn_mu1*zh ) + rn_nu*zs ) * r1_rau0   ! alpha
-               pab(ji,jj,jp_sal) = ( rn_b0 * ( 1._wp - rn_lambda2*zs - rn_mu2*zh ) - rn_nu*zt ) * r1_rau0   ! beta                            ! beta
+               zn  = rn_a0 * ( 1._wp + rn_lambda1*zt + rn_mu1*zh ) + rn_nu*zs
+               pab(ji,jj,jp_tem) = zn * r1_rau0   ! alpha
+               !
+               zn  = rn_b0 * ( 1._wp - rn_lambda2*zs - rn_mu2*zh ) - rn_nu*zt
+               pab(ji,jj,jp_sal) = zn * r1_rau0   ! beta
                !
             END DO
@@ -681,7 +715,4 @@
       !! ** Action  :   pn2 : square of the brunt-vaisala frequency at w-point 
       !!
-      !! References :   Vallis, Atmospheric and Oceanic Fluid Dynamics, 2006
-      !!                Jackett and McDougall, J. Atmos. Ocean. Tech., 1995
-      !!                McDougall, J. Phys. Oceano., 1987
       !!----------------------------------------------------------------------
       REAL(wp), DIMENSION(jpi,jpj,jpk,jpts), INTENT(in   ) ::  pts   ! pot. temperature and salinity   [Celcius,psu]
@@ -725,8 +756,8 @@
       !!
       !! ** Method  :   rational approximation (5/3th order) of TEOS-10 algorithm
-      !!       checkvalue: pt=20.0239165517474 Celsius for s=35.7psu, t=20degC
+      !!       checkvalue: pt=20.02391895 Celsius for sa=35.7g/kg, ct=20degC
       !!
       !! Reference  :   TEOS-10, UNESCO
-      !!                Rational fit, see Roquet (2013)
+      !!                Rational approximation to TEOS10 algorithm (rms error on WOA13 values: 4.0e-5 degC)
       !!----------------------------------------------------------------------
       REAL(wp), DIMENSION(jpi,jpj), INTENT(in   ) ::   ctmp   ! Cons. Temp [Celcius]
@@ -736,37 +767,36 @@
       !
       INTEGER  ::   ji, jj               ! dummy loop indices
-      REAL(wp) ::   zt , zsr, ztm        ! local scalars
+      REAL(wp) ::   zt , zs , ztm        ! local scalars
       REAL(wp) ::   zn , zd              ! local scalars
+      REAL(wp) ::   zdeltaS , z1_S0 , z1_T0
       !!----------------------------------------------------------------------
       !
       IF ( nn_timing == 1 )   CALL timing_start('eos_pt_from_ct')
+      !
+      zdeltaS = 5._wp
+      z1_S0   = 35._wp/35.16504_wp/40._wp
+      z1_T0   = 1._wp/40._wp
       !
       DO jj = 1, jpj
           DO ji = 1, jpi
-              zt  = ctmp   (ji,jj)
-              zsr = SQRT( MAX( psal(ji,jj) , 0.1_wp ) )              ! square root salinity
-              ztm = tmask(ji,jj,1)                          ! tmask
               !
-              zn = ( ( ( ( -1.960202285944569e-04_wp*zsr    &
-                  &    - 6.698743070819174e-05_wp*zt + 4.456449354084589e-03_wp )*zsr    &
-                  &    + ( 1.424140773841990e-05_wp*zt - 1.961306826357777e-04_wp )*zt &
-                  &        - 1.535458707717669e-02_wp )*zsr    &
-                  &    + ( ( 2.814957335530553e-06_wp*zt + 1.534287192323960e-04_wp )*zt &
-                  &        + 2.701363554476190e-02_wp )*zt - 1.869037589289360e-02_wp )*zsr    &
-                  &    + ( ( ( -1.646758381788031e-08_wp*zt + 4.568111226988701e-07_wp )*zt &
-                  &        - 7.853794523448087e-04_wp )*zt - 8.000001510387515e-03_wp )*zt &
-                  &        - 1.132820958753811e-03_wp )*zsr    &
-                  &    + ( ( ( ( -3.885399051933490e-09_wp*zt + 6.608853649947305e-07_wp )*zt &
-                  &        - 1.507746029483144e-04_wp )*zt - 3.457378558412451e-03_wp )*zt &
-                  &        - 7.616362942562558e-01_wp )*zt - 2.067472332529282e-01_wp
+              zt  = ctmp   (ji,jj) * z1_T0
+              zs  = SQRT( ABS( psal(ji,jj) + zdeltaS ) * r1_S0 )
+              ztm = tmask(ji,jj,1)
               !
-              zd = ( ( 8.421053090759674e-04_wp*zsr    &
-                  &    - 8.267668312138185e-04_wp*zt - 6.920238162292441e-02_wp )*zsr    &
-                  &    + ( 5.063023899703211e-05_wp*zt + 1.488626985392304e-02_wp )*zt &
-                  &        + 1.541411683853927e-01_wp )*zsr    &
-                  &    + ( ( 6.537389208598346e-07_wp*zt + 1.856814792031252e-03_wp )*zt &
-                  &        + 1.592477436776734e-01_wp )*zt + 1.406742653394891e+01_wp
+              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
               !
-              ptmp(ji,jj) = ( zt + zn / zd ) * ztm
+              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) = ( zt / z1_T0 + zn / zd ) * ztm
               !
           END DO
@@ -840,5 +870,5 @@
       !! ** Method  :   PE is defined analytically as the vertical 
       !!                   primitive of EOS times -g integrated between 0 and z>0.
-      !!                pen is the nonlinear PE anomaly: ppen = ( PE - rau0 gz ) / rau0 gz - rd
+      !!                pen is the nonlinear bsq-PE anomaly: pen = ( PE - rau0 gz ) / rau0 gz - rd
       !!                                                      = 1/z * /int_0^z rd dz - rd 
       !!                                where rd is the density anomaly (see eos_rhd function)
@@ -847,8 +877,4 @@
       !!                    ab_pe(2) =   1/(rau0 gz) * dPE/dS + drd/dS =   d(pen)/dS
       !!
-      !!       * nn_eos = -1 : polynomial TEOS-10
-      !!       * nn_eos =  0 : Jackett and McDougall (1995) (should not be used, using polynomial TEOS-10 formulation)
-      !!       * nn_eos =  1 : Vallis equation of state (Vallis 2006)
-      !!
       !! ** Action  : - pen         : PE anomaly given at T-points
       !!            : - pab_pe  : given at T-points
@@ -860,57 +886,71 @@
       REAL(wp), DIMENSION(jpi,jpj,jpk)     , INTENT(  out) ::   ppen     ! potential energy anomaly
       !
-      INTEGER  ::   ji, jj, jk               ! dummy loop indices
-      REAL(wp) ::   zt , zh , zsr, ztm , zs  ! local scalars
-      REAL(wp) ::   zn
-      !!----------------------------------------------------------------------
-      !
-      IF ( nn_timing == 1 )   CALL timing_start('eos_pen')
+      INTEGER  ::   ji, jj, jk                ! dummy loop indices
+      REAL(wp) ::   zt , zh , zs , ztm        ! local scalars
+      REAL(wp) ::   zn , zn0, zn1, zn2        !   -      -
+      !!----------------------------------------------------------------------
+      !
+      IF( nn_timing == 1 )   CALL timing_start('eos_pen')
       !
       SELECT CASE ( nn_eos )
       !
-      CASE ( -1 , 0 )               ! polyTEOS10 (used also for JM95 case as an approximation)
+      CASE( -1, 0 )                !==  polynomial TEOS-10 / EOS-80 ==!
          !
          DO jk = 1, jpkm1
             DO jj = 1, jpj
                DO ji = 1, jpi
-                  zt  = pts (ji,jj,jk,jp_tem)
-                  zh  = fsdept(ji,jj,jk)                              ! depth
-                  zsr = SQRT( MAX( pts(ji,jj,jk,jp_sal) , 0.1_wp ) )  ! square root salinity
-                  ztm = tmask(ji,jj,jk)                               ! tmask
-                  !
-                  !
-                  zn  = ( ( ( PEN133*zsr   &
-                     &   + PEN223*zt + PEN123 )*zsr   &
-                     &   + ( PEN313*zt + PEN213 )*zt + PEN113 )*zh   &
-                     &   + ( ( ( PEN152*zsr   &
-                     &   + PEN242*zt + PEN142 )*zsr   &
-                     &   + ( PEN332*zt + PEN232 )*zt + PEN132 )*zsr   &
-                     &   + ( ( PEN422*zt + PEN322 )*zt + PEN222 )*zt + PEN122 )*zsr   &
-                     &   + ( ( ( PEN512*zt + PEN412 )*zt + PEN312 )*zt + PEN212 )*zt + PEN112 )*zh
-                  !
-                  !                              ! potential energy non-linear anomaly
-                  ppen(ji,jj,jk)  = zn * r1_rau0 * ztm
-                  !
-                  !
-                  zn  = ( ( ( APE123 )*zsr   &
-                     &   + APE213*zt + APE113 )*zh   &
-                     &   + ( ( ( APE142 )*zsr   &
-                     &   + APE232*zt + APE132 )*zsr   &
-                     &   + ( APE322*zt + APE222 )*zt + APE122 )*zsr   &
-                     &   + ( ( APE412*zt + APE312 )*zt + APE212 )*zt + APE112 )*zh
-                  !
-                  !                              ! alphaPE non-linear anomaly
-                  pab_pe(ji,jj,jk,jp_tem) = zn * r1_rau0 * ztm
-                  !
-                  !
-                  zn  = ( ( ( BPE123 )*zsr   &
-                     &   + BPE213*zt + BPE113 )*zh   &
-                     &   + ( ( ( BPE142 )*zsr   &
-                     &   + BPE232*zt + BPE132 )*zsr   &
-                     &   + ( BPE322*zt + BPE222 )*zt + BPE122 )*zsr   &
-                     &   + ( ( BPE412*zt + BPE312 )*zt + BPE212 )*zt + BPE112 )*zh
-                  !
-                  !                              ! betaPE non-linear anomaly
-                  pab_pe(ji,jj,jk,jp_sal) = zn / zsr * r1_rau0 * ztm
+                  !
+                  zh  = fsdept(ji,jj,jk) * r1_Z0                                ! depth
+                  zt  = pts (ji,jj,jk,jp_tem) * r1_T0                           ! temperature
+                  zs  = SQRT( ABS( pts(ji,jj,jk,jp_sal) + rdeltaS ) * r1_S0 )   ! square root salinity
+                  ztm = tmask(ji,jj,jk)                                         ! tmask
+                  !
+                  ! potential energy non-linear anomaly
+                  zn2 = (PEN012)*zt   &
+                     &   + PEN102*zs+PEN002
+                  !
+                  zn1 = ((PEN021)*zt   &
+                     &   + PEN111*zs+PEN011)*zt   &
+                     &   + (PEN201*zs+PEN101)*zs+PEN001
+                  !
+                  zn0 = ((((PEN040)*zt   &
+                     &   + PEN130*zs+PEN030)*zt   &
+                     &   + (PEN220*zs+PEN120)*zs+PEN020)*zt   &
+                     &   + ((PEN310*zs+PEN210)*zs+PEN110)*zs+PEN010)*zt   &
+                     &   + (((PEN400*zs+PEN300)*zs+PEN200)*zs+PEN100)*zs+PEN000
+                  !
+                  zn   = ( zn2 * zh + zn1 ) * zh + zn0
+                  !
+                  ppen(ji,jj,jk)  = zn * zh * r1_rau0 * ztm
+                  !
+                  ! alphaPE non-linear anomaly
+                  zn2 = APE002
+                  !
+                  zn1 = (APE011)*zt   &
+                     &   + APE101*zs+APE001
+                  !
+                  zn0 = (((APE030)*zt   &
+                     &   + APE120*zs+APE020)*zt   &
+                     &   + (APE210*zs+APE110)*zs+APE010)*zt   &
+                     &   + ((APE300*zs+APE200)*zs+APE100)*zs+APE000
+                  !
+                  zn   = ( zn2 * zh + zn1 ) * zh + zn0
+                  !                              
+                  pab_pe(ji,jj,jk,jp_tem) = zn * zh * r1_rau0 * ztm
+                  !
+                  ! betaPE non-linear anomaly
+                  zn2 = BPE002
+                  !
+                  zn1 = (BPE011)*zt   &
+                     &   + BPE101*zs+BPE001
+                  !
+                  zn0 = (((BPE030)*zt   &
+                     &   + BPE120*zs+BPE020)*zt   &
+                     &   + (BPE210*zs+BPE110)*zs+BPE010)*zt   &
+                     &   + ((BPE300*zs+BPE200)*zs+BPE100)*zs+BPE000
+                  !
+                  zn   = ( zn2 * zh + zn1 ) * zh + zn0
+                  !                              
+                  pab_pe(ji,jj,jk,jp_sal) = zn / zs * zh * r1_rau0 * ztm
                   !
                END DO
@@ -973,6 +1013,6 @@
       WRITE( numond, nameos )
       !
-      rau0        = 1026._wp      !: volumic mass of reference     [kg/m3]
-      rcp         = 3992._wp      !: heat capacity                 [J/K]
+      rau0        = 1026._wp                  !: volumic mass of reference     [kg/m3]
+      rcp         = 3991.86795711963_wp      !: heat capacity     [J/K]
       !
       IF(lwp) THEN                ! Control print
@@ -994,173 +1034,188 @@
          IF(lwp) WRITE(numout,*) '          use of TEOS-10 equation of state (cons. temp. and abs. salinity)'
          !
-         EOS111 =  9.9984112007e+02_wp
-         EOS211 =  6.4904564681e-02_wp
-         EOS311 = -8.1866708294e-03_wp
-         EOS411 =  8.4327846386e-05_wp
-         EOS511 = -9.9853850905e-07_wp
-         EOS611 =  9.5342506671e-09_wp
-         EOS711 = -5.5942725501e-11_wp
-         EOS121 =  4.8745609554e-04_wp
-         EOS221 = -7.9137653036e-04_wp
-         EOS321 =  1.1241300058e-04_wp
-         EOS421 = -4.2658318975e-06_wp
-         EOS521 =  2.7589924936e-08_wp
-         EOS621 =  5.6573234128e-10_wp
-         EOS131 =  8.2409990767e-01_wp
-         EOS231 = -3.6746935996e-03_wp
-         EOS331 =  2.8088034997e-05_wp
-         EOS431 =  3.9432934562e-07_wp
-         EOS531 = -8.6081969467e-09_wp
-         EOS141 = -8.5860758561e-03_wp
-         EOS241 =  1.0048170774e-04_wp
-         EOS341 = -1.1219591564e-06_wp
-         EOS441 = -1.4550322467e-09_wp
-         EOS151 =  1.2633903654e-03_wp
-         EOS251 = -7.2707200365e-06_wp
-         EOS351 =  2.6241351559e-08_wp
-         EOS161 = -7.4242043203e-05_wp
-         EOS261 =  3.8374457797e-07_wp
-         EOS171 =  1.2722088050e-06_wp
-         EOS112 =  4.3845092294e-04_wp
-         EOS212 = -3.5237528758e-05_wp
-         EOS312 =  5.7586626030e-07_wp
-         EOS412 = -6.3139238271e-09_wp
-         EOS512 =  3.9434377793e-11_wp
-         EOS122 = -7.6672754907e-06_wp
-         EOS222 =  9.0194877799e-08_wp
-         EOS322 = -1.6940551903e-09_wp
-         EOS422 =  3.1783762285e-11_wp
-         EOS132 = -5.9870305749e-06_wp
-         EOS232 =  1.0325176608e-07_wp
-         EOS332 = -8.0185331501e-10_wp
-         EOS142 = -5.6324524012e-07_wp
-         EOS242 =  6.6221210305e-10_wp
-         EOS152 =  3.9558159454e-08_wp
-         EOS113 = -1.6847693220e-09_wp
-         EOS213 =  5.3653075114e-10_wp
-         EOS313 = -1.0864160933e-11_wp
-         EOS123 = -1.6883150438e-09_wp
-         EOS223 =  6.5982407189e-12_wp
-         EOS133 =  2.7370939782e-10_wp
-         !
-         ALP111 = -6.4904564681e-02_wp
-         ALP211 =  1.6373341659e-02_wp
-         ALP311 = -2.5298353916e-04_wp
-         ALP411 =  3.9941540362e-06_wp
-         ALP511 = -4.7671253336e-08_wp
-         ALP611 =  3.3565635301e-10_wp
-         ALP121 =  7.9137653036e-04_wp
-         ALP221 = -2.2482600117e-04_wp
-         ALP321 =  1.2797495693e-05_wp
-         ALP421 = -1.1035969974e-07_wp
-         ALP521 = -2.8286617064e-09_wp
-         ALP131 =  3.6746935996e-03_wp
-         ALP231 = -5.6176069994e-05_wp
-         ALP331 = -1.1829880369e-06_wp
-         ALP431 =  3.4432787787e-08_wp
-         ALP141 = -1.0048170774e-04_wp
-         ALP241 =  2.2439183129e-06_wp
-         ALP341 =  4.3650967401e-09_wp
-         ALP151 =  7.2707200365e-06_wp
-         ALP251 = -5.2482703118e-08_wp
-         ALP161 = -3.8374457797e-07_wp
-         ALP112 =  3.5237528758e-05_wp
-         ALP212 = -1.1517325206e-06_wp
-         ALP312 =  1.8941771481e-08_wp
-         ALP412 = -1.5773751117e-10_wp
-         ALP122 = -9.0194877799e-08_wp
-         ALP222 =  3.3881103805e-09_wp
-         ALP322 = -9.5351286854e-11_wp
-         ALP132 = -1.0325176608e-07_wp
-         ALP232 =  1.6037066300e-09_wp
-         ALP142 = -6.6221210305e-10_wp
-         ALP113 = -5.3653075114e-10_wp
-         ALP213 =  2.1728321866e-11_wp
-         ALP123 = -6.5982407189e-12_wp
-         !
-         BET111 =  2.4372804777e-04_wp
-         BET211 = -3.9568826518e-04_wp
-         BET311 =  5.6206500292e-05_wp
-         BET411 = -2.1329159488e-06_wp
-         BET511 =  1.3794962468e-08_wp
-         BET611 =  2.8286617064e-10_wp
-         BET121 =  8.2409990767e-01_wp
-         BET221 = -3.6746935996e-03_wp
-         BET321 =  2.8088034997e-05_wp
-         BET421 =  3.9432934562e-07_wp
-         BET521 = -8.6081969467e-09_wp
-         BET131 = -1.2879113784e-02_wp
-         BET231 =  1.5072256162e-04_wp
-         BET331 = -1.6829387347e-06_wp
-         BET431 = -2.1825483700e-09_wp
-         BET141 =  2.5267807308e-03_wp
-         BET241 = -1.4541440073e-05_wp
-         BET341 =  5.2482703118e-08_wp
-         BET151 = -1.8560510801e-04_wp
-         BET251 =  9.5936144494e-07_wp
-         BET161 =  3.8166264151e-06_wp
-         BET112 = -3.8336377454e-06_wp
-         BET212 =  4.5097438900e-08_wp
-         BET312 = -8.4702759513e-10_wp
-         BET412 =  1.5891881142e-11_wp
-         BET122 = -5.9870305749e-06_wp
-         BET222 =  1.0325176608e-07_wp
-         BET322 = -8.0185331501e-10_wp
-         BET132 = -8.4486786018e-07_wp
-         BET232 =  9.9331815458e-10_wp
-         BET142 =  7.9116318907e-08_wp
-         BET113 = -8.4415752190e-10_wp
-         BET213 =  3.2991203594e-12_wp
-         BET123 =  2.7370939782e-10_wp
-         !
-         PEN112 = -2.1922546147e-04_wp
-         PEN212 =  1.7618764379e-05_wp
-         PEN312 = -2.8793313015e-07_wp
-         PEN412 =  3.1569619136e-09_wp
-         PEN512 = -1.9717188896e-11_wp
-         PEN122 =  3.8336377454e-06_wp
-         PEN222 = -4.5097438900e-08_wp
-         PEN322 =  8.4702759513e-10_wp
-         PEN422 = -1.5891881142e-11_wp
-         PEN132 =  2.9935152875e-06_wp
-         PEN232 = -5.1625883042e-08_wp
-         PEN332 =  4.0092665751e-10_wp
-         PEN142 =  2.8162262006e-07_wp
-         PEN242 = -3.3110605153e-10_wp
-         PEN152 = -1.9779079727e-08_wp
-         PEN113 =  1.1231795480e-09_wp
-         PEN213 = -3.5768716743e-10_wp
-         PEN313 =  7.2427739554e-12_wp
-         PEN123 =  1.1255433625e-09_wp
-         PEN223 = -4.3988271459e-12_wp
-         PEN133 = -1.8247293188e-10_wp
-         !
-         APE112 = -1.7618764379e-05_wp
-         APE212 =  5.7586626030e-07_wp
-         APE312 = -9.4708857407e-09_wp
-         APE412 =  7.8868755586e-11_wp
-         APE122 =  4.5097438900e-08_wp
-         APE222 = -1.6940551903e-09_wp
-         APE322 =  4.7675643427e-11_wp
-         APE132 =  5.1625883042e-08_wp
-         APE232 = -8.0185331501e-10_wp
-         APE142 =  3.3110605153e-10_wp
-         APE113 =  3.5768716743e-10_wp
-         APE213 = -1.4485547911e-11_wp
-         APE123 =  4.3988271459e-12_wp
-         !
-         BPE112 =  1.9168188727e-06_wp
-         BPE212 = -2.2548719450e-08_wp
-         BPE312 =  4.2351379756e-10_wp
-         BPE412 = -7.9459405711e-12_wp
-         BPE122 =  2.9935152875e-06_wp
-         BPE222 = -5.1625883042e-08_wp
-         BPE322 =  4.0092665751e-10_wp
-         BPE132 =  4.2243393009e-07_wp
-         BPE232 = -4.9665907729e-10_wp
-         BPE142 = -3.9558159454e-08_wp
-         BPE113 =  5.6277168127e-10_wp
-         BPE213 = -2.1994135730e-12_wp
-         BPE123 = -1.8247293188e-10_wp
+         rdeltaS = 32._wp
+         r1_S0  = 35._wp/35.16504_wp/40._wp
+         r1_T0  = 1._wp/40._wp
+         r1_Z0  = 1.e-4_wp
+         !
+         EOS000 = 8.0189615746e+02_wp
+         EOS100 = 8.6672408165e+02_wp
+         EOS200 = -1.7864682637e+03_wp
+         EOS300 = 2.0375295546e+03_wp
+         EOS400 = -1.2849161071e+03_wp
+         EOS500 = 4.3227585684e+02_wp
+         EOS600 = -6.0579916612e+01_wp
+         EOS010 = 2.6010145068e+01_wp
+         EOS110 = -6.5281885265e+01_wp
+         EOS210 = 8.1770425108e+01_wp
+         EOS310 = -5.6888046321e+01_wp
+         EOS410 = 1.7681814114e+01_wp
+         EOS510 = -1.9193502195_wp
+         EOS020 = -3.7074170417e+01_wp
+         EOS120 = 6.1548258127e+01_wp
+         EOS220 = -6.0362551501e+01_wp
+         EOS320 = 2.9130021253e+01_wp
+         EOS420 = -5.4723692739_wp
+         EOS030 = 2.1661789529e+01_wp
+         EOS130 = -3.3449108469e+01_wp
+         EOS230 = 1.9717078466e+01_wp
+         EOS330 = -3.1742946532_wp
+         EOS040 = -8.3627885467_wp
+         EOS140 = 1.1311538584e+01_wp
+         EOS240 = -5.3563304045_wp
+         EOS050 = 5.4048723791e-01_wp
+         EOS150 = 4.8169980163e-01_wp
+         EOS060 = -1.9083568888e-01_wp
+         EOS001 = 1.9681925209e+01_wp
+         EOS101 = -4.2549998214e+01_wp
+         EOS201 = 5.0774768218e+01_wp
+         EOS301 = -3.0938076334e+01_wp
+         EOS401 = 6.6051753097_wp
+         EOS011 = -1.3336301113e+01_wp
+         EOS111 = -4.4870114575_wp
+         EOS211 = 5.0042598061_wp
+         EOS311 = -6.5399043664e-01_wp
+         EOS021 = 6.7080479603_wp
+         EOS121 = 3.5063081279_wp
+         EOS221 = -1.8795372996_wp
+         EOS031 = -2.4649669534_wp
+         EOS131 = -5.5077101279e-01_wp
+         EOS041 = 5.5927935970e-01_wp
+         EOS002 = 2.0660924175_wp
+         EOS102 = -4.9527603989_wp
+         EOS202 = 2.5019633244_wp
+         EOS012 = 2.0564311499_wp
+         EOS112 = -2.1311365518e-01_wp
+         EOS022 = -1.2419983026_wp
+         EOS003 = -2.3342758797e-02_wp
+         EOS103 = -1.8507636718e-02_wp
+         EOS013 = 3.7969820455e-01_wp
+         !
+         ALP000 = -6.5025362670e-01_wp
+         ALP100 = 1.6320471316_wp
+         ALP200 = -2.0442606277_wp
+         ALP300 = 1.4222011580_wp
+         ALP400 = -4.4204535284e-01_wp
+         ALP500 = 4.7983755487e-02_wp
+         ALP010 = 1.8537085209_wp
+         ALP110 = -3.0774129064_wp
+         ALP210 = 3.0181275751_wp
+         ALP310 = -1.4565010626_wp
+         ALP410 = 2.7361846370e-01_wp
+         ALP020 = -1.6246342147_wp
+         ALP120 = 2.5086831352_wp
+         ALP220 = -1.4787808849_wp
+         ALP320 = 2.3807209899e-01_wp
+         ALP030 = 8.3627885467e-01_wp
+         ALP130 = -1.1311538584_wp
+         ALP230 = 5.3563304045e-01_wp
+         ALP040 = -6.7560904739e-02_wp
+         ALP140 = -6.0212475204e-02_wp
+         ALP050 = 2.8625353333e-02_wp
+         ALP001 = 3.3340752782e-01_wp
+         ALP101 = 1.1217528644e-01_wp
+         ALP201 = -1.2510649515e-01_wp
+         ALP301 = 1.6349760916e-02_wp
+         ALP011 = -3.3540239802e-01_wp
+         ALP111 = -1.7531540640e-01_wp
+         ALP211 = 9.3976864981e-02_wp
+         ALP021 = 1.8487252150e-01_wp
+         ALP121 = 4.1307825959e-02_wp
+         ALP031 = -5.5927935970e-02_wp
+         ALP002 = -5.1410778748e-02_wp
+         ALP102 = 5.3278413794e-03_wp
+         ALP012 = 6.2099915132e-02_wp
+         ALP003 = -9.4924551138e-03_wp
+         !
+         ALP000 = -6.5025362670e-01_wp
+         ALP100 = 1.6320471316_wp
+         ALP200 = -2.0442606277_wp
+         ALP300 = 1.4222011580_wp
+         ALP400 = -4.4204535284e-01_wp
+         ALP500 = 4.7983755487e-02_wp
+         ALP010 = 1.8537085209_wp
+         ALP110 = -3.0774129064_wp
+         ALP210 = 3.0181275751_wp
+         ALP310 = -1.4565010626_wp
+         ALP410 = 2.7361846370e-01_wp
+         ALP020 = -1.6246342147_wp
+         ALP120 = 2.5086831352_wp
+         ALP220 = -1.4787808849_wp
+         ALP320 = 2.3807209899e-01_wp
+         ALP030 = 8.3627885467e-01_wp
+         ALP130 = -1.1311538584_wp
+         ALP230 = 5.3563304045e-01_wp
+         ALP040 = -6.7560904739e-02_wp
+         ALP140 = -6.0212475204e-02_wp
+         ALP050 = 2.8625353333e-02_wp
+         ALP001 = 3.3340752782e-01_wp
+         ALP101 = 1.1217528644e-01_wp
+         ALP201 = -1.2510649515e-01_wp
+         ALP301 = 1.6349760916e-02_wp
+         ALP011 = -3.3540239802e-01_wp
+         ALP111 = -1.7531540640e-01_wp
+         ALP211 = 9.3976864981e-02_wp
+         ALP021 = 1.8487252150e-01_wp
+         ALP121 = 4.1307825959e-02_wp
+         ALP031 = -5.5927935970e-02_wp
+         ALP002 = -5.1410778748e-02_wp
+         ALP102 = 5.3278413794e-03_wp
+         ALP012 = 6.2099915132e-02_wp
+         ALP003 = -9.4924551138e-03_wp
+         !
+         PEN000 = -9.8409626043_wp
+         PEN100 = 2.1274999107e+01_wp
+         PEN200 = -2.5387384109e+01_wp
+         PEN300 = 1.5469038167e+01_wp
+         PEN400 = -3.3025876549_wp
+         PEN010 = 6.6681505563_wp
+         PEN110 = 2.2435057288_wp
+         PEN210 = -2.5021299030_wp
+         PEN310 = 3.2699521832e-01_wp
+         PEN020 = -3.3540239802_wp
+         PEN120 = -1.7531540640_wp
+         PEN220 = 9.3976864981e-01_wp
+         PEN030 = 1.2324834767_wp
+         PEN130 = 2.7538550639e-01_wp
+         PEN040 = -2.7963967985e-01_wp
+         PEN001 = -1.3773949450_wp
+         PEN101 = 3.3018402659_wp
+         PEN201 = -1.6679755496_wp
+         PEN011 = -1.3709540999_wp
+         PEN111 = 1.4207577012e-01_wp
+         PEN021 = 8.2799886843e-01_wp
+         PEN002 = 1.7507069098e-02_wp
+         PEN102 = 1.3880727538e-02_wp
+         PEN012 = -2.8477365341e-01_wp
+         !
+         APE000 = -1.6670376391e-01_wp
+         APE100 = -5.6087643219e-02_wp
+         APE200 = 6.2553247576e-02_wp
+         APE300 = -8.1748804580e-03_wp
+         APE010 = 1.6770119901e-01_wp
+         APE110 = 8.7657703198e-02_wp
+         APE210 = -4.6988432490e-02_wp
+         APE020 = -9.2436260751e-02_wp
+         APE120 = -2.0653912979e-02_wp
+         APE030 = 2.7963967985e-02_wp
+         APE001 = 3.4273852498e-02_wp
+         APE101 = -3.5518942529e-03_wp
+         APE011 = -4.1399943421e-02_wp
+         APE002 = 7.1193413354e-03_wp
+         !
+         BPE000 = 2.6468936504e-01_wp
+         BPE100 = -6.3170583896e-01_wp
+         BPE200 = 5.7736640125e-01_wp
+         BPE300 = -1.6435438140e-01_wp
+         BPE010 = 2.7912203607e-02_wp
+         BPE110 = -6.2259666565e-02_wp
+         BPE210 = 1.2204769966e-02_wp
+         BPE020 = -2.1811574876e-02_wp
+         BPE120 = 2.3383950895e-02_wp
+         BPE030 = 3.4261630030e-03_wp
+         BPE001 = 4.1079296834e-02_wp
+         BPE101 = -4.1503681096e-02_wp
+         BPE011 = 1.7676120780e-03_wp
+         BPE002 = 1.7269476440e-04_wp
          !
       CASE( 0 )                        !==  polynomial EOS-80 formulation  ==!
@@ -1169,173 +1224,188 @@
          IF(lwp) WRITE(numout,*) '          use of EOS-80 equation of state (pot. temp. and pract. salinity)'
          !
-         EOS111 =  9.9984240021e+02_wp
-         EOS211 =  6.8051135248e-02_wp
-         EOS311 = -9.0991456041e-03_wp
-         EOS411 =  9.9238754931e-05_wp
-         EOS511 = -1.0602210389e-06_wp
-         EOS611 =  5.1296071368e-09_wp
-         EOS711 =  1.1887242136e-11_wp
-         EOS121 = -1.9799119661e-04_wp
-         EOS221 = -1.6676932531e-05_wp
-         EOS321 =  3.2084304200e-06_wp
-         EOS421 = -4.8983568948e-08_wp
-         EOS521 = -1.5610111448e-09_wp
-         EOS621 =  2.8366680541e-11_wp
-         EOS131 =  8.2448582544e-01_wp
-         EOS231 = -4.0764319966e-03_wp
-         EOS331 =  7.4898579574e-05_wp
-         EOS431 = -7.7884546946e-07_wp
-         EOS531 =  5.0405569756e-09_wp
-         EOS141 = -5.7150204345e-03_wp
-         EOS241 =  1.0157923923e-04_wp
-         EOS341 = -1.6325795501e-06_wp
-         EOS441 = -1.6144820180e-09_wp
-         EOS151 =  4.8005813592e-04_wp
-         EOS251 =  1.6199868493e-07_wp
-         EOS351 =  7.8805435082e-09_wp
-         EOS161 =  1.9978872493e-07_wp
-         EOS261 = -3.1437087783e-08_wp
-         EOS171 =  2.5463113215e-08_wp
-         EOS112 =  4.3756680685e-04_wp
-         EOS212 = -3.7298355935e-05_wp
-         EOS312 =  6.5348660941e-07_wp
-         EOS412 = -7.2558835910e-09_wp
-         EOS512 =  3.8273323221e-11_wp
-         EOS122 =  1.4369434305e-06_wp
-         EOS222 =  5.6521871685e-08_wp
-         EOS322 = -1.2136936896e-08_wp
-         EOS422 =  2.1030996727e-10_wp
-         EOS132 = -1.0262750144e-05_wp
-         EOS232 =  2.0858571138e-07_wp
-         EOS332 = -1.4826357415e-09_wp
-         EOS142 =  8.5860757162e-08_wp
-         EOS242 = -5.2140945761e-09_wp
-         EOS152 =  8.2162682979e-09_wp
-         EOS113 = -5.5011801985e-09_wp
-         EOS213 =  5.7020541017e-10_wp
-         EOS313 = -1.0193603551e-11_wp
-         EOS123 = -1.0893703284e-10_wp
-         EOS223 = -4.1944954508e-12_wp
-         EOS133 =  1.1857534169e-10_wp
-         !
-         ALP111 = -6.8051135248e-02_wp
-         ALP211 =  1.8198291208e-02_wp
-         ALP311 = -2.9771626479e-04_wp
-         ALP411 =  4.2408841556e-06_wp
-         ALP511 = -2.5648035684e-08_wp
-         ALP611 = -7.1323452819e-11_wp
-         ALP121 =  1.6676932531e-05_wp
-         ALP221 = -6.4168608399e-06_wp
-         ALP321 =  1.4695070684e-07_wp
-         ALP421 =  6.2440445791e-09_wp
-         ALP521 = -1.4183340270e-10_wp
-         ALP131 =  4.0764319966e-03_wp
-         ALP231 = -1.4979715915e-04_wp
-         ALP331 =  2.3365364084e-06_wp
-         ALP431 = -2.0162227903e-08_wp
-         ALP141 = -1.0157923923e-04_wp
-         ALP241 =  3.2651591003e-06_wp
-         ALP341 =  4.8434460540e-09_wp
-         ALP151 = -1.6199868493e-07_wp
-         ALP251 = -1.5761087016e-08_wp
-         ALP161 =  3.1437087783e-08_wp
-         ALP112 =  3.7298355935e-05_wp
-         ALP212 = -1.3069732188e-06_wp
-         ALP312 =  2.1767650773e-08_wp
-         ALP412 = -1.5309329288e-10_wp
-         ALP122 = -5.6521871685e-08_wp
-         ALP222 =  2.4273873792e-08_wp
-         ALP322 = -6.3092990180e-10_wp
-         ALP132 = -2.0858571138e-07_wp
-         ALP232 =  2.9652714830e-09_wp
-         ALP142 =  5.2140945761e-09_wp
-         ALP113 = -5.7020541017e-10_wp
-         ALP213 =  2.0387207103e-11_wp
-         ALP123 =  4.1944954508e-12_wp
-         !
-         BET111 = -9.8995598303e-05_wp
-         BET211 = -8.3384662657e-06_wp
-         BET311 =  1.6042152100e-06_wp
-         BET411 = -2.4491784474e-08_wp
-         BET511 = -7.8050557238e-10_wp
-         BET611 =  1.4183340270e-11_wp
-         BET121 =  8.2448582544e-01_wp
-         BET221 = -4.0764319966e-03_wp
-         BET321 =  7.4898579574e-05_wp
-         BET421 = -7.7884546946e-07_wp
-         BET521 =  5.0405569756e-09_wp
-         BET131 = -8.5725306517e-03_wp
-         BET231 =  1.5236885884e-04_wp
-         BET331 = -2.4488693252e-06_wp
-         BET431 = -2.4217230270e-09_wp
-         BET141 =  9.6011627184e-04_wp
-         BET241 =  3.2399736986e-07_wp
-         BET341 =  1.5761087016e-08_wp
-         BET151 =  4.9947181231e-07_wp
-         BET251 = -7.8592719459e-08_wp
-         BET161 =  7.6389339644e-08_wp
-         BET112 =  7.1847171523e-07_wp
-         BET212 =  2.8260935842e-08_wp
-         BET312 = -6.0684684481e-09_wp
-         BET412 =  1.0515498363e-10_wp
-         BET122 = -1.0262750144e-05_wp
-         BET222 =  2.0858571138e-07_wp
-         BET322 = -1.4826357415e-09_wp
-         BET132 =  1.2879113574e-07_wp
-         BET232 = -7.8211418642e-09_wp
-         BET142 =  1.6432536596e-08_wp
-         BET113 = -5.4468516419e-11_wp
-         BET213 = -2.0972477254e-12_wp
-         BET123 =  1.1857534169e-10_wp
-         !
-         PEN112 = -2.1878340343e-04_wp
-         PEN212 =  1.8649177967e-05_wp
-         PEN312 = -3.2674330470e-07_wp
-         PEN412 =  3.6279417955e-09_wp
-         PEN512 = -1.9136661610e-11_wp
-         PEN122 = -7.1847171523e-07_wp
-         PEN222 = -2.8260935842e-08_wp
-         PEN322 =  6.0684684481e-09_wp
-         PEN422 = -1.0515498363e-10_wp
-         PEN132 =  5.1313750720e-06_wp
-         PEN232 = -1.0429285569e-07_wp
-         PEN332 =  7.4131787075e-10_wp
-         PEN142 = -4.2930378581e-08_wp
-         PEN242 =  2.6070472881e-09_wp
-         PEN152 = -4.1081341490e-09_wp
-         PEN113 =  3.6674534657e-09_wp
-         PEN213 = -3.8013694011e-10_wp
-         PEN313 =  6.7957357010e-12_wp
-         PEN123 =  7.2624688558e-11_wp
-         PEN223 =  2.7963303006e-12_wp
-         PEN133 = -7.9050227794e-11_wp
-         !
-         APE112 = -1.8649177967e-05_wp
-         APE212 =  6.5348660941e-07_wp
-         APE312 = -1.0883825386e-08_wp
-         APE412 =  7.6546646441e-11_wp
-         APE122 =  2.8260935842e-08_wp
-         APE222 = -1.2136936896e-08_wp
-         APE322 =  3.1546495090e-10_wp
-         APE132 =  1.0429285569e-07_wp
-         APE232 = -1.4826357415e-09_wp
-         APE142 = -2.6070472881e-09_wp
-         APE113 =  3.8013694011e-10_wp
-         APE213 = -1.3591471402e-11_wp
-         APE123 = -2.7963303006e-12_wp
-         !
-         BPE112 = -3.5923585761e-07_wp
-         BPE212 = -1.4130467921e-08_wp
-         BPE312 =  3.0342342240e-09_wp
-         BPE412 = -5.2577491816e-11_wp
-         BPE122 =  5.1313750720e-06_wp
-         BPE222 = -1.0429285569e-07_wp
-         BPE322 =  7.4131787075e-10_wp
-         BPE132 = -6.4395567871e-08_wp
-         BPE232 =  3.9105709321e-09_wp
-         BPE142 = -8.2162682979e-09_wp
-         BPE113 =  3.6312344279e-11_wp
-         BPE213 =  1.3981651503e-12_wp
-         BPE123 = -7.9050227794e-11_wp
+         rdeltaS = 20._wp
+         r1_S0  = 1._wp/40._wp
+         r1_T0  = 1._wp/40._wp
+         r1_Z0  = 1.e-4_wp
+         !
+         EOS000 = 9.5356891948e+02_wp
+         EOS100 = 1.7136499189e+02_wp
+         EOS200 = -3.7501039454e+02_wp
+         EOS300 = 5.1856810420e+02_wp
+         EOS400 = -3.7264470465e+02_wp
+         EOS500 = 1.4302533998e+02_wp
+         EOS600 = -2.2856621162e+01_wp
+         EOS010 = 1.0087518651e+01_wp
+         EOS110 = -1.3647741861e+01_wp
+         EOS210 = 8.8478359933_wp
+         EOS310 = -7.2329388377_wp
+         EOS410 = 1.4774410611_wp
+         EOS510 = 2.0036720553e-01_wp
+         EOS020 = -2.5579830599e+01_wp
+         EOS120 = 2.4043512327e+01_wp
+         EOS220 = -1.6807503990e+01_wp
+         EOS320 = 8.3811577084_wp
+         EOS420 = -1.9771060192_wp
+         EOS030 = 1.6846451198e+01_wp
+         EOS130 = -2.1482926901e+01_wp
+         EOS230 = 1.0108954054e+01_wp
+         EOS330 = -6.2675951440e-01_wp
+         EOS040 = -8.0812310102_wp
+         EOS140 = 1.0102374985e+01_wp
+         EOS240 = -4.8340368631_wp
+         EOS050 = 1.2079167803_wp
+         EOS150 = 1.1515380987e-01_wp
+         EOS060 = -2.4520288837e-01_wp
+         EOS001 = 1.0748601068e+01_wp
+         EOS101 = -1.7817043500e+01_wp
+         EOS201 = 2.2181366768e+01_wp
+         EOS301 = -1.6750916338e+01_wp
+         EOS401 = 4.1202230403_wp
+         EOS011 = -1.5852644587e+01_wp
+         EOS111 = -7.6639383522e-01_wp
+         EOS211 = 4.1144627302_wp
+         EOS311 = -6.6955877448e-01_wp
+         EOS021 = 9.9994861860_wp
+         EOS121 = -1.9467067787e-01_wp
+         EOS221 = -1.2177554330_wp
+         EOS031 = -3.4866102017_wp
+         EOS131 = 2.2229155620e-01_wp
+         EOS041 = 5.9503008642e-01_wp
+         EOS002 = 1.0375676547_wp
+         EOS102 = -3.4249470629_wp
+         EOS202 = 2.0542026429_wp
+         EOS012 = 2.1836324814_wp
+         EOS112 = -3.4453674320e-01_wp
+         EOS022 = -1.2548163097_wp
+         EOS003 = 1.8729078427e-02_wp
+         EOS103 = -5.7238495240e-02_wp
+         EOS013 = 3.8306136687e-01_wp
+         !
+         ALP000 = -2.5218796628e-01_wp
+         ALP100 = 3.4119354654e-01_wp
+         ALP200 = -2.2119589983e-01_wp
+         ALP300 = 1.8082347094e-01_wp
+         ALP400 = -3.6936026529e-02_wp
+         ALP500 = -5.0091801383e-03_wp
+         ALP010 = 1.2789915300_wp
+         ALP110 = -1.2021756164_wp
+         ALP210 = 8.4037519952e-01_wp
+         ALP310 = -4.1905788542e-01_wp
+         ALP410 = 9.8855300959e-02_wp
+         ALP020 = -1.2634838399_wp
+         ALP120 = 1.6112195176_wp
+         ALP220 = -7.5817155402e-01_wp
+         ALP320 = 4.7006963580e-02_wp
+         ALP030 = 8.0812310102e-01_wp
+         ALP130 = -1.0102374985_wp
+         ALP230 = 4.8340368631e-01_wp
+         ALP040 = -1.5098959754e-01_wp
+         ALP140 = -1.4394226233e-02_wp
+         ALP050 = 3.6780433255e-02_wp
+         ALP001 = 3.9631611467e-01_wp
+         ALP101 = 1.9159845880e-02_wp
+         ALP201 = -1.0286156825e-01_wp
+         ALP301 = 1.6738969362e-02_wp
+         ALP011 = -4.9997430930e-01_wp
+         ALP111 = 9.7335338937e-03_wp
+         ALP211 = 6.0887771651e-02_wp
+         ALP021 = 2.6149576513e-01_wp
+         ALP121 = -1.6671866715e-02_wp
+         ALP031 = -5.9503008642e-02_wp
+         ALP002 = -5.4590812035e-02_wp
+         ALP102 = 8.6134185799e-03_wp
+         ALP012 = 6.2740815484e-02_wp
+         ALP003 = -9.5765341718e-03_wp
+         !
+         BET000 = 2.1420623987_wp
+         BET100 = -9.3752598635_wp
+         BET200 = 1.9446303907e+01_wp
+         BET300 = -1.8632235232e+01_wp
+         BET400 = 8.9390837485_wp
+         BET500 = -1.7142465871_wp
+         BET010 = -1.7059677327e-01_wp
+         BET110 = 2.2119589983e-01_wp
+         BET210 = -2.7123520642e-01_wp
+         BET310 = 7.3872053057e-02_wp
+         BET410 = 1.2522950346e-02_wp
+         BET020 = 3.0054390409e-01_wp
+         BET120 = -4.2018759976e-01_wp
+         BET220 = 3.1429341406e-01_wp
+         BET320 = -9.8855300959e-02_wp
+         BET030 = -2.6853658626e-01_wp
+         BET130 = 2.5272385134e-01_wp
+         BET230 = -2.3503481790e-02_wp
+         BET040 = 1.2627968731e-01_wp
+         BET140 = -1.2085092158e-01_wp
+         BET050 = 1.4394226233e-03_wp
+         BET001 = -2.2271304375e-01_wp
+         BET101 = 5.5453416919e-01_wp
+         BET201 = -6.2815936268e-01_wp
+         BET301 = 2.0601115202e-01_wp
+         BET011 = -9.5799229402e-03_wp
+         BET111 = 1.0286156825e-01_wp
+         BET211 = -2.5108454043e-02_wp
+         BET021 = -2.4333834734e-03_wp
+         BET121 = -3.0443885826e-02_wp
+         BET031 = 2.7786444526e-03_wp
+         BET002 = -4.2811838287e-02_wp
+         BET102 = 5.1355066072e-02_wp
+         BET012 = -4.3067092900e-03_wp
+         BET003 = -7.1548119050e-04_wp
+         !
+         PEN000 = -5.3743005340_wp
+         PEN100 = 8.9085217499_wp
+         PEN200 = -1.1090683384e+01_wp
+         PEN300 = 8.3754581690_wp
+         PEN400 = -2.0601115202_wp
+         PEN010 = 7.9263222935_wp
+         PEN110 = 3.8319691761e-01_wp
+         PEN210 = -2.0572313651_wp
+         PEN310 = 3.3477938724e-01_wp
+         PEN020 = -4.9997430930_wp
+         PEN120 = 9.7335338937e-02_wp
+         PEN220 = 6.0887771651e-01_wp
+         PEN030 = 1.7433051009_wp
+         PEN130 = -1.1114577810e-01_wp
+         PEN040 = -2.9751504321e-01_wp
+         PEN001 = -6.9171176978e-01_wp
+         PEN101 = 2.2832980419_wp
+         PEN201 = -1.3694684286_wp
+         PEN011 = -1.4557549876_wp
+         PEN111 = 2.2969116213e-01_wp
+         PEN021 = 8.3654420645e-01_wp
+         PEN002 = -1.4046808820e-02_wp
+         PEN102 = 4.2928871430e-02_wp
+         PEN012 = -2.8729602515e-01_wp
+         !
+         APE000 = -1.9815805734e-01_wp
+         APE100 = -9.5799229402e-03_wp
+         APE200 = 5.1430784127e-02_wp
+         APE300 = -8.3694846809e-03_wp
+         APE010 = 2.4998715465e-01_wp
+         APE110 = -4.8667669469e-03_wp
+         APE210 = -3.0443885826e-02_wp
+         APE020 = -1.3074788257e-01_wp
+         APE120 = 8.3359333577e-03_wp
+         APE030 = 2.9751504321e-02_wp
+         APE001 = 3.6393874690e-02_wp
+         APE101 = -5.7422790533e-03_wp
+         APE011 = -4.1827210323e-02_wp
+         APE002 = 7.1824006288e-03_wp
+         !
+         BPE000 = 1.1135652187e-01_wp
+         BPE100 = -2.7726708459e-01_wp
+         BPE200 = 3.1407968134e-01_wp
+         BPE300 = -1.0300557601e-01_wp
+         BPE010 = 4.7899614701e-03_wp
+         BPE110 = -5.1430784127e-02_wp
+         BPE210 = 1.2554227021e-02_wp
+         BPE020 = 1.2166917367e-03_wp
+         BPE120 = 1.5221942913e-02_wp
+         BPE030 = -1.3893222263e-03_wp
+         BPE001 = 2.8541225524e-02_wp
+         BPE101 = -3.4236710714e-02_wp
+         BPE011 = 2.8711395266e-03_wp
+         BPE002 = 5.3661089288e-04_wp
          !
       CASE( 1 )                        !==  Simplified EOS     ==!
