Index: NEMO/trunk/src/OCE/TRA/eosbn2.F90
===================================================================
--- NEMO/trunk/src/OCE/TRA/eosbn2.F90	(revision 11411)
+++ NEMO/trunk/src/OCE/TRA/eosbn2.F90	(revision 11536)
@@ -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
@@ -1235,9 +1237,9 @@
       REWIND( numnam_ref )              ! Namelist nameos in reference namelist : equation of state
       READ  ( numnam_ref, nameos, IOSTAT = ios, ERR = 901 )
-901   IF( ios /= 0 )   CALL ctl_nam ( ios , 'nameos in reference namelist', lwp )
+901   IF( ios /= 0 )   CALL ctl_nam ( ios , 'nameos in reference namelist' )
       !
       REWIND( numnam_cfg )              ! Namelist nameos in configuration namelist : equation of state
       READ  ( numnam_cfg, nameos, IOSTAT = ios, ERR = 902 )
-902   IF( ios >  0 )   CALL ctl_nam ( ios , 'nameos in configuration namelist', lwp )
+902   IF( ios >  0 )   CALL ctl_nam ( ios , 'nameos in configuration namelist' )
       IF(lwm) WRITE( numond, nameos )
       !
@@ -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: NEMO/trunk/src/OCE/TRA/traadv.F90
===================================================================
--- NEMO/trunk/src/OCE/TRA/traadv.F90	(revision 11411)
+++ NEMO/trunk/src/OCE/TRA/traadv.F90	(revision 11536)
@@ -196,9 +196,9 @@
       REWIND( numnam_ref )                   ! Namelist namtra_adv in reference namelist : Tracer advection scheme
       READ  ( numnam_ref, namtra_adv, IOSTAT = ios, ERR = 901)
-901   IF( ios /= 0 )   CALL ctl_nam ( ios , 'namtra_adv in reference namelist', lwp )
+901   IF( ios /= 0 )   CALL ctl_nam ( ios , 'namtra_adv in reference namelist' )
       !
       REWIND( numnam_cfg )                   ! Namelist namtra_adv in configuration namelist : Tracer advection scheme
       READ  ( numnam_cfg, namtra_adv, IOSTAT = ios, ERR = 902 )
-902   IF( ios >  0 )   CALL ctl_nam ( ios , 'namtra_adv in configuration namelist', lwp )
+902   IF( ios >  0 )   CALL ctl_nam ( ios , 'namtra_adv in configuration namelist' )
       IF(lwm) WRITE( numond, namtra_adv )
       !
Index: NEMO/trunk/src/OCE/TRA/trabbc.F90
===================================================================
--- NEMO/trunk/src/OCE/TRA/trabbc.F90	(revision 11411)
+++ NEMO/trunk/src/OCE/TRA/trabbc.F90	(revision 11536)
@@ -135,9 +135,9 @@
       REWIND( numnam_ref )              ! Namelist nambbc in reference namelist : Bottom momentum boundary condition
       READ  ( numnam_ref, nambbc, IOSTAT = ios, ERR = 901)
-901   IF( ios /= 0 )   CALL ctl_nam ( ios , 'nambbc in reference namelist', lwp )
+901   IF( ios /= 0 )   CALL ctl_nam ( ios , 'nambbc in reference namelist' )
       !
       REWIND( numnam_cfg )              ! Namelist nambbc in configuration namelist : Bottom momentum boundary condition
       READ  ( numnam_cfg, nambbc, IOSTAT = ios, ERR = 902 )
-902   IF( ios >  0 )   CALL ctl_nam ( ios , 'nambbc in configuration namelist', lwp )
+902   IF( ios >  0 )   CALL ctl_nam ( ios , 'nambbc in configuration namelist' )
       IF(lwm) WRITE ( numond, nambbc )
       !
Index: NEMO/trunk/src/OCE/TRA/trabbl.F90
===================================================================
--- NEMO/trunk/src/OCE/TRA/trabbl.F90	(revision 11411)
+++ NEMO/trunk/src/OCE/TRA/trabbl.F90	(revision 11536)
@@ -485,9 +485,9 @@
       REWIND( numnam_ref )              ! Namelist nambbl in reference namelist : Bottom boundary layer scheme
       READ  ( numnam_ref, nambbl, IOSTAT = ios, ERR = 901)
-901   IF( ios /= 0 )   CALL ctl_nam ( ios , 'nambbl in reference namelist', lwp )
+901   IF( ios /= 0 )   CALL ctl_nam ( ios , 'nambbl in reference namelist' )
       !
       REWIND( numnam_cfg )              ! Namelist nambbl in configuration namelist : Bottom boundary layer scheme
       READ  ( numnam_cfg, nambbl, IOSTAT = ios, ERR = 902 )
-902   IF( ios >  0 )   CALL ctl_nam ( ios , 'nambbl in configuration namelist', lwp )
+902   IF( ios >  0 )   CALL ctl_nam ( ios , 'nambbl in configuration namelist' )
       IF(lwm) WRITE ( numond, nambbl )
       !
Index: NEMO/trunk/src/OCE/TRA/tradmp.F90
===================================================================
--- NEMO/trunk/src/OCE/TRA/tradmp.F90	(revision 11411)
+++ NEMO/trunk/src/OCE/TRA/tradmp.F90	(revision 11536)
@@ -179,9 +179,9 @@
       REWIND( numnam_ref )   ! Namelist namtra_dmp in reference namelist : T & S relaxation
       READ  ( numnam_ref, namtra_dmp, IOSTAT = ios, ERR = 901)
-901   IF( ios /= 0 )   CALL ctl_nam ( ios , 'namtra_dmp in reference namelist', lwp )
+901   IF( ios /= 0 )   CALL ctl_nam ( ios , 'namtra_dmp in reference namelist' )
       !
       REWIND( numnam_cfg )   ! Namelist namtra_dmp in configuration namelist : T & S relaxation
       READ  ( numnam_cfg, namtra_dmp, IOSTAT = ios, ERR = 902 )
-902   IF( ios >  0 )   CALL ctl_nam ( ios , 'namtra_dmp in configuration namelist', lwp )
+902   IF( ios >  0 )   CALL ctl_nam ( ios , 'namtra_dmp in configuration namelist' )
       IF(lwm) WRITE ( numond, namtra_dmp )
       !
Index: NEMO/trunk/src/OCE/TRA/traldf_iso.F90
===================================================================
--- NEMO/trunk/src/OCE/TRA/traldf_iso.F90	(revision 11411)
+++ NEMO/trunk/src/OCE/TRA/traldf_iso.F90	(revision 11536)
@@ -289,5 +289,5 @@
          !!----------------------------------------------------------------------
          !
-         ztfw(1,:,:) = 0._wp     ;     ztfw(jpi,:,:) = 0._wp
+         ztfw(fs_2:1,:,:) = 0._wp     ;     ztfw(jpi:fs_jpim1,:,:) = 0._wp   ! avoid to potentially manipulate NaN values
          !
          ! Vertical fluxes
@@ -323,5 +323,5 @@
          IF( ln_traldf_lap ) THEN               ! laplacian case: eddy coef = ah_wslp2 - akz
             DO jk = 2, jpkm1       
-               DO jj = 1, jpjm1
+               DO jj = 2, jpjm1
                   DO ji = fs_2, fs_jpim1
                      ztfw(ji,jj,jk) = ztfw(ji,jj,jk) + e1e2t(ji,jj) / e3w_n(ji,jj,jk) * wmask(ji,jj,jk)   &
@@ -336,5 +336,5 @@
             CASE(  1  )                            ! 1st pass : eddy coef = ah_wslp2
                DO jk = 2, jpkm1 
-                  DO jj = 1, jpjm1
+                  DO jj = 2, jpjm1
                      DO ji = fs_2, fs_jpim1
                         ztfw(ji,jj,jk) = ztfw(ji,jj,jk)    &
@@ -346,5 +346,5 @@
             CASE(  2  )                         ! 2nd pass : eddy flux = ah_wslp2 and akz applied on ptb  and ptbb gradients, resp.
                DO jk = 2, jpkm1 
-                  DO jj = 1, jpjm1
+                  DO jj = 2, jpjm1
                      DO ji = fs_2, fs_jpim1
                         ztfw(ji,jj,jk) = ztfw(ji,jj,jk) + e1e2t(ji,jj) / e3w_n(ji,jj,jk) * wmask(ji,jj,jk)                      &
Index: NEMO/trunk/src/OCE/TRA/tramle.F90
===================================================================
--- NEMO/trunk/src/OCE/TRA/tramle.F90	(revision 11411)
+++ NEMO/trunk/src/OCE/TRA/tramle.F90	(revision 11536)
@@ -268,9 +268,9 @@
       REWIND( numnam_ref )              ! Namelist namtra_mle in reference namelist : Tracer advection scheme
       READ  ( numnam_ref, namtra_mle, IOSTAT = ios, ERR = 901)
-901   IF( ios /= 0 )   CALL ctl_nam ( ios , 'namtra_mle in reference namelist', lwp )
+901   IF( ios /= 0 )   CALL ctl_nam ( ios , 'namtra_mle in reference namelist' )
 
       REWIND( numnam_cfg )              ! Namelist namtra_mle in configuration namelist : Tracer advection scheme
       READ  ( numnam_cfg, namtra_mle, IOSTAT = ios, ERR = 902 )
-902   IF( ios >  0 )   CALL ctl_nam ( ios , 'namtra_mle in configuration namelist', lwp )
+902   IF( ios >  0 )   CALL ctl_nam ( ios , 'namtra_mle in configuration namelist' )
       IF(lwm) WRITE ( numond, namtra_mle )
 
Index: NEMO/trunk/src/OCE/TRA/traqsr.F90
===================================================================
--- NEMO/trunk/src/OCE/TRA/traqsr.F90	(revision 11411)
+++ NEMO/trunk/src/OCE/TRA/traqsr.F90	(revision 11536)
@@ -338,9 +338,9 @@
       REWIND( numnam_ref )              ! Namelist namtra_qsr in reference     namelist
       READ  ( numnam_ref, namtra_qsr, IOSTAT = ios, ERR = 901)
-901   IF( ios /= 0 )   CALL ctl_nam ( ios , 'namtra_qsr in reference namelist', lwp )
+901   IF( ios /= 0 )   CALL ctl_nam ( ios , 'namtra_qsr in reference namelist' )
       !
       REWIND( numnam_cfg )              ! Namelist namtra_qsr in configuration namelist
       READ  ( numnam_cfg, namtra_qsr, IOSTAT = ios, ERR = 902 )
-902   IF( ios >  0 )   CALL ctl_nam ( ios , 'namtra_qsr in configuration namelist', lwp )
+902   IF( ios >  0 )   CALL ctl_nam ( ios , 'namtra_qsr in configuration namelist' )
       IF(lwm) WRITE ( numond, namtra_qsr )
       !
