Index: NEMO/branches/2019/dev_r11078_OSMOSIS_IMMERSE_Nurser/src/OCE/TRD/trd_oce.F90
===================================================================
--- NEMO/branches/2019/dev_r11078_OSMOSIS_IMMERSE_Nurser/src/OCE/TRD/trd_oce.F90	(revision 11143)
+++ NEMO/branches/2019/dev_r11078_OSMOSIS_IMMERSE_Nurser/src/OCE/TRD/trd_oce.F90	(revision 12178)
@@ -33,5 +33,5 @@
 # endif
    !                                                  !!!* Active tracers trends indexes
-   INTEGER, PUBLIC, PARAMETER ::   jptot_tra  = 21     !: Total trend nb: change it when adding/removing one indice below
+   INTEGER, PUBLIC, PARAMETER ::   jptot_tra  = 20     !: Total trend nb: change it when adding/removing one indice below
    !                               ===============     !  
    INTEGER, PUBLIC, PARAMETER ::   jptra_xad  =  1     !: x- horizontal advection
@@ -46,5 +46,4 @@
    INTEGER, PUBLIC, PARAMETER ::   jptra_bbc  = 10     !: Bottom Boundary Condition (geoth. heating) 
    INTEGER, PUBLIC, PARAMETER ::   jptra_bbl  = 11     !: Bottom Boundary Layer (diffusive and/or advective)
-   INTEGER, PUBLIC, PARAMETER ::   jptra_osm  = 21     !: Non-local terms from OSMOSIS OBL model
    INTEGER, PUBLIC, PARAMETER ::   jptra_npc  = 12     !: non-penetrative convection treatment
    INTEGER, PUBLIC, PARAMETER ::   jptra_dmp  = 13     !: internal restoring (damping)
Index: NEMO/branches/2019/dev_r11078_OSMOSIS_IMMERSE_Nurser/src/OCE/TRD/trdini.F90
===================================================================
--- NEMO/branches/2019/dev_r11078_OSMOSIS_IMMERSE_Nurser/src/OCE/TRD/trdini.F90	(revision 11143)
+++ NEMO/branches/2019/dev_r11078_OSMOSIS_IMMERSE_Nurser/src/OCE/TRD/trdini.F90	(revision 12178)
@@ -48,9 +48,9 @@
       REWIND( numnam_ref )              ! Namelist namtrd in reference namelist : trends diagnostic
       READ  ( numnam_ref, namtrd, IOSTAT = ios, ERR = 901 )
-901   IF( ios /= 0 )   CALL ctl_nam ( ios , 'namtrd in reference namelist', lwp )
+901   IF( ios /= 0 )   CALL ctl_nam ( ios , 'namtrd in reference namelist' )
       !
       REWIND( numnam_cfg )              ! Namelist namtrd in configuration namelist : trends diagnostic
       READ  ( numnam_cfg, namtrd, IOSTAT = ios, ERR = 902 )
-902   IF( ios >  0 )   CALL ctl_nam ( ios , 'namtrd in configuration namelist', lwp )
+902   IF( ios >  0 )   CALL ctl_nam ( ios , 'namtrd in configuration namelist' )
       IF(lwm) WRITE( numond, namtrd )
       !
Index: NEMO/branches/2019/dev_r11078_OSMOSIS_IMMERSE_Nurser/src/OCE/TRD/trdmxl.F90
===================================================================
--- NEMO/branches/2019/dev_r11078_OSMOSIS_IMMERSE_Nurser/src/OCE/TRD/trdmxl.F90	(revision 11143)
+++ NEMO/branches/2019/dev_r11078_OSMOSIS_IMMERSE_Nurser/src/OCE/TRD/trdmxl.F90	(revision 12178)
@@ -734,9 +734,9 @@
       REWIND( numnam_ref )              ! Namelist namtrd_mxl in reference namelist : mixed layer trends diagnostic
       READ  ( numnam_ref, namtrd_mxl, IOSTAT = ios, ERR = 901 )
-901   IF( ios /= 0 )   CALL ctl_nam ( ios , 'namtrd_mxl in reference namelist', lwp )
+901   IF( ios /= 0 )   CALL ctl_nam ( ios , 'namtrd_mxl in reference namelist' )
 
       REWIND( numnam_cfg )              ! Namelist namtrd_mxl in configuration namelist : mixed layer trends diagnostic
       READ  ( numnam_cfg, namtrd_mxl, IOSTAT = ios, ERR = 902 )
-902   IF( ios >  0 )   CALL ctl_nam ( ios , 'namtrd_mxl in configuration namelist', lwp )
+902   IF( ios >  0 )   CALL ctl_nam ( ios , 'namtrd_mxl in configuration namelist' )
       IF(lwm) WRITE( numond, namtrd_mxl )
       !
@@ -764,14 +764,13 @@
 
       IF( MOD( nitend, nn_trd ) /= 0 ) THEN
-         WRITE(numout,cform_err)
-         WRITE(numout,*) '                Your nitend parameter, nitend = ', nitend
-         WRITE(numout,*) '                is no multiple of the trends diagnostics frequency        '
-         WRITE(numout,*) '                          you defined, nn_trd   = ', nn_trd
-         WRITE(numout,*) '                This will not allow you to restart from this simulation.  '
-         WRITE(numout,*) '                You should reconsider this choice.                        ' 
-         WRITE(numout,*) 
-         WRITE(numout,*) '                N.B. the nitend parameter is also constrained to be a     '
-         WRITE(numout,*) '                     multiple of the nn_fsbc parameter '
-         CALL ctl_stop( 'trd_mxl_init: see comment just above' )
+         WRITE(ctmp1,*) '                Your nitend parameter, nitend = ', nitend
+         WRITE(ctmp2,*) '                is no multiple of the trends diagnostics frequency        '
+         WRITE(ctmp3,*) '                          you defined, nn_trd   = ', nn_trd
+         WRITE(ctmp4,*) '                This will not allow you to restart from this simulation.  '
+         WRITE(ctmp5,*) '                You should reconsider this choice.                        ' 
+         WRITE(ctmp6,*) 
+         WRITE(ctmp7,*) '                N.B. the nitend parameter is also constrained to be a     '
+         WRITE(ctmp8,*) '                     multiple of the nn_fsbc parameter '
+         CALL ctl_stop( ctmp1, ctmp2, ctmp3, ctmp4, ctmp5, ctmp6, ctmp7, ctmp8 )
       END IF
 
Index: NEMO/branches/2019/dev_r11078_OSMOSIS_IMMERSE_Nurser/src/OCE/TRD/trdmxl_rst.F90
===================================================================
--- NEMO/branches/2019/dev_r11078_OSMOSIS_IMMERSE_Nurser/src/OCE/TRD/trdmxl_rst.F90	(revision 11143)
+++ NEMO/branches/2019/dev_r11078_OSMOSIS_IMMERSE_Nurser/src/OCE/TRD/trdmxl_rst.F90	(revision 12178)
@@ -47,8 +47,10 @@
       !!--------------------------------------------------------------------------------
 
+      IF( .NOT. ln_rst_list .AND. nn_stock == -1 )   RETURN   ! we will never do any restart
+
       ! to get better performances with NetCDF format:
       ! we open and define the ocean restart_mxl file one time step before writing the data (-> at nitrst - 1)
       ! except if we write ocean restart_mxl files every time step or if an ocean restart_mxl file was writen at nitend - 1
-      IF( kt == nitrst - 1 .OR. nstock == 1 .OR. ( kt == nitend .AND. MOD( nitend - 1, nstock ) == 0 ) ) THEN
+      IF( kt == nitrst - 1 .OR. nn_stock == 1 .OR. ( kt == nitend .AND. MOD( nitend - 1, nn_stock ) == 0 ) ) THEN
          ! beware of the format used to write kt (default is i8.8, that should be large enough...)
          IF( nitrst > 999999999 ) THEN   ;   WRITE(clkt, *       ) nitrst
Index: NEMO/branches/2019/dev_r11078_OSMOSIS_IMMERSE_Nurser/src/OCE/TRD/trdtra.F90
===================================================================
--- NEMO/branches/2019/dev_r11078_OSMOSIS_IMMERSE_Nurser/src/OCE/TRD/trdtra.F90	(revision 11143)
+++ NEMO/branches/2019/dev_r11078_OSMOSIS_IMMERSE_Nurser/src/OCE/TRD/trdtra.F90	(revision 12178)
@@ -346,6 +346,4 @@
          CASE( jptra_bbl  )   ;   CALL iom_put( "ttrd_bbl"  , ptrdx )        ! bottom boundary layer
                                   CALL iom_put( "strd_bbl"  , ptrdy )
-         CASE( jptra_osm  )   ;   CALL iom_put( "ttrd_osm"  , ptrdx )        ! OSMOSIS non-local forcing
-                                  CALL iom_put( "strd_osm"  , ptrdy )
          CASE( jptra_npc  )   ;   CALL iom_put( "ttrd_npc"  , ptrdx )        ! static instability mixing
                                   CALL iom_put( "strd_npc"  , ptrdy )
Index: NEMO/branches/2019/dev_r11078_OSMOSIS_IMMERSE_Nurser/src/OCE/TRD/trdvor.F90
===================================================================
--- NEMO/branches/2019/dev_r11078_OSMOSIS_IMMERSE_Nurser/src/OCE/TRD/trdvor.F90	(revision 11143)
+++ NEMO/branches/2019/dev_r11078_OSMOSIS_IMMERSE_Nurser/src/OCE/TRD/trdvor.F90	(revision 12178)
@@ -46,7 +46,7 @@
    REAL(wp), SAVE, ALLOCATABLE, DIMENSION(:,:)   ::   vor_avr      ! average
    REAL(wp), SAVE, ALLOCATABLE, DIMENSION(:,:)   ::   vor_avrb     ! before vorticity (kt-1)
-   REAL(wp), SAVE, ALLOCATABLE, DIMENSION(:,:)   ::   vor_avrbb    ! vorticity at begining of the nwrite-1 timestep averaging period
+   REAL(wp), SAVE, ALLOCATABLE, DIMENSION(:,:)   ::   vor_avrbb    ! vorticity at begining of the nn_write-1 timestep averaging period
    REAL(wp), SAVE, ALLOCATABLE, DIMENSION(:,:)   ::   vor_avrbn    ! after vorticity at time step after the
-   REAL(wp), SAVE, ALLOCATABLE, DIMENSION(:,:)   ::   rotot        ! begining of the NWRITE-1 timesteps
+   REAL(wp), SAVE, ALLOCATABLE, DIMENSION(:,:)   ::   rotot        ! begining of the NN_WRITE-1 timesteps
    REAL(wp), SAVE, ALLOCATABLE, DIMENSION(:,:)   ::   vor_avrtot   !
    REAL(wp), SAVE, ALLOCATABLE, DIMENSION(:,:)   ::   vor_avrres   !
@@ -129,5 +129,5 @@
       !!              from ocean surface down to control surface (NetCDF output)
       !!
-      !! ** Method/usage :   integration done over nwrite-1 time steps
+      !! ** Method/usage :   integration done over nn_write-1 time steps
       !!
       !! ** Action :   trends :
@@ -143,5 +143,5 @@
       !!                  vortrd (,,10) = forcing term
       !!		              vortrd (,,11) = bottom friction term
-      !!                  rotot(,) : total cumulative trends over nwrite-1 time steps
+      !!                  rotot(,) : total cumulative trends over nn_write-1 time steps
       !!                  vor_avrtot(,) : first membre of vrticity equation
       !!                  vor_avrres(,) : residual = dh/dt entrainment
@@ -214,5 +214,5 @@
       !!              from ocean surface down to control surface (NetCDF output)
       !!
-      !! ** Method/usage :   integration done over nwrite-1 time steps
+      !! ** Method/usage :   integration done over nn_write-1 time steps
       !!
       !! ** Action :     trends :
@@ -228,5 +228,5 @@
       !!                  vortrd (,,10) = forcing term
       !!		  vortrd (,,11) = bottom friction term
-      !!                  rotot(,) : total cumulative trends over nwrite-1 time steps
+      !!                  rotot(,) : total cumulative trends over nn_write-1 time steps
       !!                  vor_avrtot(,) : first membre of vrticity equation
       !!                  vor_avrres(,) : residual = dh/dt entrainment
@@ -360,7 +360,7 @@
       ENDIF
 
-      ! II.2 cumulated trends over analysis period (kt=2 to nwrite)
+      ! II.2 cumulated trends over analysis period (kt=2 to nn_write)
       ! ----------------------
-      ! trends cumulated over nwrite-2 time steps
+      ! trends cumulated over nn_write-2 time steps
 
       IF( kt >= nit000+2 ) THEN
@@ -376,5 +376,5 @@
       !   III. Output in netCDF + residual computation
       !  =============================================
-
+      
       ! define time axis
       it    = kt
@@ -504,5 +504,5 @@
       ENDIF
 #if defined key_diainstant
-      zsto = nwrite*rdt
+      zsto = nn_write*rdt
       clop = "inst("//TRIM(clop)//")"
 #else
