Index: /NEMO/branches/2019/dev_r11879_ENHANCE-05_SimonM-Harmonic_Analysis/src/OCE/DIA/diamlr.F90
===================================================================
--- /NEMO/branches/2019/dev_r11879_ENHANCE-05_SimonM-Harmonic_Analysis/src/OCE/DIA/diamlr.F90	(revision 11910)
+++ /NEMO/branches/2019/dev_r11879_ENHANCE-05_SimonM-Harmonic_Analysis/src/OCE/DIA/diamlr.F90	(revision 11910)
@@ -0,0 +1,78 @@
+MODULE diamlr
+   !!======================================================================
+   !!                       ***  MODULE  diamlr  ***
+   !! Management of the IOM context for multiple-linear-regression analysis
+   !!======================================================================
+   !! History :       !  2019  (S. Mueller)
+   !!----------------------------------------------------------------------
+
+   USE in_out_manager , ONLY :   lwp, numout, ln_timing
+   USE timing         , ONLY :   timing_start, timing_stop
+
+   IMPLICIT NONE
+   PRIVATE
+
+   LOGICAL, PUBLIC ::   lk_diamlr = .FALSE.
+
+   PUBLIC ::   dia_mlr_init, dia_mlr_iom_init, dia_mlr
+
+   !!----------------------------------------------------------------------
+   !! NEMO/OCE 4.0 , NEMO Consortium (2019)
+   !! $Id$
+   !! Software governed by the CeCILL license (see ./LICENSE)
+   !!----------------------------------------------------------------------
+CONTAINS
+   
+   SUBROUTINE dia_mlr_init
+      !!----------------------------------------------------------------------
+      !!                 ***  ROUTINE dia_mlr_init  ***
+      !!
+      !! ** Purpose : initialisation of IOM context management for 
+      !!              multiple-linear-regression analysis
+      !!
+      !!----------------------------------------------------------------------
+
+      lk_diamlr = .TRUE.
+
+      IF(lwp) THEN
+         WRITE(numout, *)
+         WRITE(numout, *) 'dia_mlr_init : initialisation of IOM context management for'
+         WRITE(numout, *) '~~~~~~~~~~~~   multiple-linear-regression analysis'
+      END IF
+
+   END SUBROUTINE dia_mlr_init
+
+   SUBROUTINE dia_mlr_iom_init
+      !!----------------------------------------------------------------------
+      !!               ***  ROUTINE dia_mlr_iom_init  ***
+      !!
+      !! ** Purpose : IOM context setup for multiple-linear-regression
+      !!              analysis
+      !!
+      !!----------------------------------------------------------------------
+
+      IF(lwp) THEN
+         WRITE(numout, *)
+         WRITE(numout, *) 'dia_mlr_iom_init : IOM context setup for multiple-linear-regression'
+         WRITE(numout, *) '~~~~~~~~~~~~~~~~
+      END IF
+
+   END SUBROUTINE dia_mlr_iom_init
+
+   SUBROUTINE dia_mlr
+      !!----------------------------------------------------------------------
+      !!                   ***  ROUTINE dia_mlr  ***
+      !!
+      !! ** Purpose : update time used in multiple-linear-regression analysis
+      !!
+      !!----------------------------------------------------------------------
+
+      IF( ln_timing )   CALL timing_start('dia_mlr')
+
+      ! Update time
+      
+      IF( ln_timing )   CALL timing_stop('dia_mlr')
+
+   END SUBROUTINE dia_mlr
+
+END MODULE diamlr
Index: /NEMO/branches/2019/dev_r11879_ENHANCE-05_SimonM-Harmonic_Analysis/src/OCE/nemogcm.F90
===================================================================
--- /NEMO/branches/2019/dev_r11879_ENHANCE-05_SimonM-Harmonic_Analysis/src/OCE/nemogcm.F90	(revision 11909)
+++ /NEMO/branches/2019/dev_r11879_ENHANCE-05_SimonM-Harmonic_Analysis/src/OCE/nemogcm.F90	(revision 11910)
@@ -60,4 +60,5 @@
    USE diacfl         ! CFL diagnostics               (dia_cfl_init routine)
    USE diaharm        ! tidal harmonics diagnostics  (dia_harm_init routine)
+   USE diamlr         ! IOM context management for multiple-linear-regression analysis
    USE step           ! NEMO time-stepping                 (stp     routine)
    USE icbini         ! handle bergs, initialisation
@@ -488,4 +489,5 @@
                            CALL dia_harm_init   ! tidal harmonics outputs
      IF( ln_diaobs    )    CALL dia_obs( nit000-1 )   ! Observation operator for restart
+                           CALL dia_mlr_init    ! Initialisation of IOM context management for multiple-linear-regression analysis
 
       !                                      ! Assimilation increments
Index: /NEMO/branches/2019/dev_r11879_ENHANCE-05_SimonM-Harmonic_Analysis/src/OCE/step.F90
===================================================================
--- /NEMO/branches/2019/dev_r11879_ENHANCE-05_SimonM-Harmonic_Analysis/src/OCE/step.F90	(revision 11909)
+++ /NEMO/branches/2019/dev_r11879_ENHANCE-05_SimonM-Harmonic_Analysis/src/OCE/step.F90	(revision 11910)
@@ -100,5 +100,7 @@
                              
       IF( kstp == nit000 ) THEN                       ! initialize IOM context (must be done after nemo_init for AGRIF+XIOS+OASIS)
-                             CALL iom_init(      cxios_context          )  ! for model grid (including passible AGRIF zoom)
+                             CALL iom_init( cxios_context, ld_closedef=.FALSE. )   ! for model grid (including passible AGRIF zoom)
+         IF( lk_diamlr   )   CALL dia_mlr_iom_init    ! with additional setup for multiple-linear-regression analysis
+                             CALL iom_init_closedef
          IF( ln_crs      )   CALL iom_init( TRIM(cxios_context)//"_crs" )  ! for coarse grid
       ENDIF
@@ -211,4 +213,5 @@
                          CALL dia_wri ( kstp )        ! ocean model: outputs
       !
+      IF( lk_diamlr  )   CALL dia_mlr                 ! Update time used in multiple-linear-regression analysis
       IF( ln_crs     )   CALL crs_fld       ( kstp )  ! ocean model: online field coarsening & output
       
Index: /NEMO/branches/2019/dev_r11879_ENHANCE-05_SimonM-Harmonic_Analysis/src/OCE/step_oce.F90
===================================================================
--- /NEMO/branches/2019/dev_r11879_ENHANCE-05_SimonM-Harmonic_Analysis/src/OCE/step_oce.F90	(revision 11909)
+++ /NEMO/branches/2019/dev_r11879_ENHANCE-05_SimonM-Harmonic_Analysis/src/OCE/step_oce.F90	(revision 11910)
@@ -82,4 +82,5 @@
    USE diacfl
    USE diaobs          ! Observation operator
+   USE diamlr          ! IOM context management for multiple-linear-regression analysis
    USE flo_oce         ! floats variables
    USE floats          ! floats computation               (flo_stp routine)
