Index: /trunk/NEMOGCM/NEMO/OFF_SRC/domain.F90
===================================================================
--- /trunk/NEMOGCM/NEMO/OFF_SRC/domain.F90	(revision 2573)
+++ /trunk/NEMOGCM/NEMO/OFF_SRC/domain.F90	(revision 2574)
@@ -27,15 +27,4 @@
    PUBLIC dom_init       ! called by opa.F90
 
-   !                                    !!! ** Namelist namzgr_sco **
-   REAL(wp) ::   rn_sbot_min =  300.     ! minimum depth of s-bottom surface (>0) (m)
-   REAL(wp) ::   rn_sbot_max = 5250.     ! maximum depth of s-bottom surface (= ocean depth) (>0) (m)
-   REAL(wp) ::   rn_theta    =    6.0    ! surface control parameter (0<=rn_theta<=20)
-   REAL(wp) ::   rn_thetb    =    0.75   ! bottom control parameter  (0<=rn_thetb<= 1)
-   REAL(wp) ::   rn_rmax     =    0.15   ! maximum cut-off r-value allowed (0<rn_rmax<1)
-   LOGICAL  ::   ln_s_sigma  = .false.   ! use hybrid s-sigma -coordinate & stretching function fssig1 (ln_sco=T)
-   REAL(wp) ::   rn_bb       =    0.8    ! stretching parameter for song and haidvogel stretching
-   !                                     ! ( rn_bb=0; top only, rn_bb =1; top and bottom)
-   REAL(wp) ::   rn_hc       = 150.      ! Critical depth for s-sigma coordinates
-
    !! * Substitutions
 #  include "domzgr_substitute.h90"
@@ -102,8 +91,11 @@
          &             nn_it000, nn_itend  , nn_date0    , nn_leapy     , nn_istate , nn_stock ,   &
          &             nn_write, ln_dimgnnn, ln_mskland  , ln_clobber   , nn_chunksz
-      NAMELIST/namdom/ nn_bathy , rn_e3zps_min, rn_e3zps_rat, nn_msh   ,   &
-         &             nn_acc   , rn_atfp     , rn_rdt      , rn_rdtmin,   &
+      NAMELIST/namdom/ nn_bathy , rn_e3zps_min, rn_e3zps_rat, nn_msh    , rn_hmin,     &
+         &             nn_acc   , rn_atfp     , rn_rdt      , rn_rdtmin ,              &
          &             rn_rdtmax, rn_rdth     , nn_baro     , nn_closea
       NAMELIST/namcla/ nn_cla
+#if defined key_netcdf4
+      NAMELIST/namnc4/ nn_nchunks_i, nn_nchunks_j, nn_nchunks_k, ln_nc4zip
+#endif
       !!----------------------------------------------------------------------
 
@@ -185,4 +177,5 @@
          WRITE(numout,*) '   Namelist namdom : space & time domain'
          WRITE(numout,*) '      flag read/compute bathymetry      nn_bathy     = ', nn_bathy
+         WRITE(numout,*) '      min depth of the ocean    (>0) or    rn_hmin   = ', rn_hmin
          WRITE(numout,*) '      minimum thickness of partial      rn_e3zps_min = ', rn_e3zps_min, ' (m)'
          WRITE(numout,*) '         step level                     rn_e3zps_rat = ', rn_e3zps_rat
@@ -222,5 +215,26 @@
       ENDIF
 
-      IF( lk_mpp_rep .AND. nn_cla /= 0 )   CALL ctl_stop( ' Reproductibility tests (nbit_cmp=1) require n_cla = 0' )
+#if defined key_netcdf4
+      !                             ! NetCDF 4 case   ("key_netcdf4" defined)
+      REWIND( numnam )                    ! Namelist namnc4 : netcdf4 chunking parameters
+      READ  ( numnam, namnc4 )
+      IF(lwp) THEN                        ! control print
+         WRITE(numout,*)
+         WRITE(numout,*) '   Namelist namnc4 - Netcdf4 chunking parameters'
+         WRITE(numout,*) '      number of chunks in i-dimension      nn_nchunks_i   = ', nn_nchunks_i
+         WRITE(numout,*) '      number of chunks in j-dimension      nn_nchunks_j   = ', nn_nchunks_j
+         WRITE(numout,*) '      number of chunks in k-dimension      nn_nchunks_k   = ', nn_nchunks_k
+         WRITE(numout,*) '      apply netcdf4/hdf5 chunking & compression ln_nc4zip = ', ln_nc4zip
+      ENDIF
+
+      ! Put the netcdf4 settings into a simple structure (snc4set, defined in in_out_manager module)
+      ! Note the chunk size in the unlimited (time) dimension will be fixed at 1
+      snc4set%ni   = nn_nchunks_i
+      snc4set%nj   = nn_nchunks_j
+      snc4set%nk   = nn_nchunks_k
+      snc4set%luse = ln_nc4zip
+#else
+      snc4set%luse = .FALSE.        ! No NetCDF 4 case
+#endif
       !
    END SUBROUTINE dom_nam
Index: /trunk/NEMOGCM/NEMO/OFF_SRC/nemogcm.F90
===================================================================
--- /trunk/NEMOGCM/NEMO/OFF_SRC/nemogcm.F90	(revision 2574)
+++ /trunk/NEMOGCM/NEMO/OFF_SRC/nemogcm.F90	(revision 2574)
@@ -0,0 +1,310 @@
+MODULE nemogcm
+   !!======================================================================
+   !!                       ***  MODULE nemogcm   ***
+   !! Off-line Ocean   : passive tracer evolution, dynamics read in files
+   !!======================================================================
+   !! History :  3.3  ! 2010-05  (C. Ethe)  Full reorganization of the off-line: phasing with the on-line
+   !!----------------------------------------------------------------------
+
+   !!----------------------------------------------------------------------
+   !!   nemo_gcm        : off-line: solve ocean tracer only
+   !!   nemo_init       : initialization of the nemo model
+   !!   nemo_ctl        : initialisation of algorithm flag 
+   !!   nemo_closefile  : close remaining files
+   !!----------------------------------------------------------------------
+   USE dom_oce         ! ocean space domain variables
+   USE oce             ! dynamics and tracers variables
+   USE c1d             ! 1D configuration
+   USE domcfg          ! domain configuration               (dom_cfg routine)
+   USE domain          ! domain initialization             (dom_init routine)
+   USE istate          ! initial state setting          (istate_init routine)
+   USE eosbn2          ! equation of state            (eos bn2 routine)
+   !              ! ocean physics
+   USE ldftra          ! lateral diffusivity setting    (ldf_tra_init routine)
+   USE ldfslp          ! slopes of neutral surfaces     (ldf_slp_init routine)
+   USE traqsr          ! solar radiation penetration    (tra_qsr_init routine)
+   USE trabbl          ! bottom boundary layer          (tra_bbl_init routine)
+   USE zdfini          ! vertical physics: initialization
+   USE phycst          ! physical constant                  (par_cst routine)
+   USE dtadyn          ! Lecture and Interpolation of the dynamical fields
+   USE trcini          ! Initilization of the passive tracers
+   USE daymod          ! calendar                         (day     routine)
+   USE trcstp          ! passive tracer time-stepping      (trc_stp routine)
+   USE dtadyn          ! Lecture and interpolation of the dynamical fields
+   USE stpctl          ! time stepping control            (stp_ctl routine)
+   !              ! I/O & MPP
+   USE iom             ! I/O library
+   USE in_out_manager  ! I/O manager
+   USE mppini          ! shared/distributed memory setting (mpp_init routine)
+   USE lib_mpp         ! distributed memory computing
+#if defined key_iomput
+   USE  mod_ioclient
+#endif 
+
+   IMPLICIT NONE
+   PRIVATE
+   
+   PUBLIC   nemo_gcm   ! called by nemo.F90
+
+   CHARACTER (len=64) ::   cform_aaa="( /, 'AAAAAAAA', / ) "   ! flag for output listing
+
+   !!----------------------------------------------------------------------
+   !! NEMO/OFF 3.3 , NEMO Consortium (2010)
+   !! $Id: nemogcm.F90 2528 2010-12-27 17:33:53Z rblod $
+   !! Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt)
+   !!----------------------------------------------------------------------
+CONTAINS
+
+   SUBROUTINE nemo_gcm
+      !!----------------------------------------------------------------------
+      !!                     ***  ROUTINE nemo_gcm  ***
+      !!
+      !! ** Purpose :   nemo solves the primitive equations on an orthogonal
+      !!      curvilinear mesh on the sphere.
+      !!
+      !! ** Method  : - model general initialization
+      !!              - launch the time-stepping (dta_dyn and trc_stp)
+      !!              - finalize the run by closing files and communications
+      !!
+      !! References : Madec, Delecluse,Imbard, and Levy, 1997:  internal report, IPSL.
+      !!              Madec, 2008, internal report, IPSL.
+      !!----------------------------------------------------------------------
+      INTEGER :: istp, indic       ! time step index
+      !!----------------------------------------------------------------------
+
+      CALL nemo_init  ! Initializations
+
+      IF( lk_mpp )   CALL mpp_max( nstop )
+
+      ! check that all process are still there... If some process have an error,
+      ! they will never enter in step and other processes will wait until the end of the cpu time!
+      IF( lk_mpp )   CALL mpp_max( nstop )
+
+      !                            !-----------------------!
+      !                            !==   time stepping   ==!
+      !                            !-----------------------!
+      istp = nit000
+         !
+      DO WHILE ( istp <= nitend .AND. nstop == 0 )    ! time stepping
+         !
+         IF( istp /= nit000 )   CALL day      ( istp )         ! Calendar (day was already called at nit000 in day_init)
+                                CALL iom_setkt( istp )         ! say to iom that we are at time step kstp
+                                CALL dta_dyn  ( istp )         ! Interpolation of the dynamical fields
+                                CALL trc_stp  ( istp )         ! time-stepping
+                                CALL stp_ctl  ( istp, indic )  ! Time loop: control and print
+         istp = istp + 1
+         IF( lk_mpp )   CALL mpp_max( nstop )
+      END DO
+
+      !                            !------------------------!
+      !                            !==  finalize the run  ==!
+      !                            !------------------------!
+      IF(lwp) WRITE(numout,cform_aaa)                 ! Flag AAAAAAA
+
+      IF( nstop /= 0 .AND. lwp ) THEN                 ! error print
+         WRITE(numout,cform_err)
+         WRITE(numout,*) nstop, ' error have been found'
+      ENDIF
+      !
+      CALL nemo_closefile
+      !
+      IF( lk_mpp )   CALL mppstop                          ! Close all files (mpp)
+      !
+   END SUBROUTINE nemo_gcm
+
+
+   SUBROUTINE nemo_init
+      !!----------------------------------------------------------------------
+      !!                     ***  ROUTINE nemo_init ***
+      !!
+      !! ** Purpose :   initialization of the nemo model in off-line mode
+      !!----------------------------------------------------------------------
+      INTEGER ::   ji            ! dummy loop indices
+      INTEGER ::   ilocal_comm   ! local integer
+      CHARACTER(len=80), DIMENSION(10) ::   cltxt = ''
+      !!
+      NAMELIST/namctl/ ln_ctl  , nn_print, nn_ictls, nn_ictle,   &
+         &             nn_isplt, nn_jsplt, nn_jctls, nn_jctle, nn_bench
+      !!----------------------------------------------------------------------
+      !
+      !                             ! open Namelist file     
+      CALL ctl_opn( numnam, 'namelist', 'OLD', 'FORMATTED', 'SEQUENTIAL', -1, 6, .FALSE. )
+      !
+      READ( numnam, namctl )        ! Namelist namctl : Control prints & Benchmark
+      !
+      !                             !--------------------------------------------!
+      !                             !  set communicator & select the local node  !
+      !                             !--------------------------------------------!
+#if defined key_iomput
+      CALL init_ioclient( ilocal_comm )       ! nemo local communicator (used or not) given by the io_server
+      narea = mynode( cltxt, ilocal_comm )    ! Nodes selection
+#else
+      narea = mynode( cltxt )                 ! Nodes selection (control print return in cltxt)
+#endif
+      narea = narea + 1                       ! mynode return the rank of proc (0 --> jpnij -1 )
+
+      lwp = (narea == 1) .OR. ln_ctl          ! control of all listing output print
+
+      IF(lwp) THEN                            ! open listing units
+         !
+         CALL ctl_opn( numout, 'ocean.output', 'REPLACE', 'FORMATTED', 'SEQUENTIAL', -1, 6, .FALSE., narea )
+         !
+         WRITE(numout,*)
+         WRITE(numout,*) '         CNRS - NERC - Met OFFICE - MERCATOR-ocean'
+         WRITE(numout,*) '                       NEMO team'
+         WRITE(numout,*) '            Ocean General Circulation Model'
+         WRITE(numout,*) '                  version 3.3  (2010) '
+         WRITE(numout,*)
+         WRITE(numout,*)
+         DO ji = 1, SIZE(cltxt) 
+            IF( TRIM(cltxt(ji)) /= '' )   WRITE(numout,*) cltxt(ji)      ! control print of mynode
+         END DO
+         WRITE(numout,cform_aaa)                                         ! Flag AAAAAAA
+         !
+      ENDIF
+      !                             !--------------------------------!
+      !                             !  Model general initialization  !
+      !                             !--------------------------------!
+
+      CALL nemo_ctl                           ! Control prints & Benchmark
+
+      !                                      ! Domain decomposition
+      IF( jpni*jpnj == jpnij ) THEN   ;   CALL mpp_init      ! standard cutting out
+      ELSE                            ;   CALL mpp_init2     ! eliminate land processors
+      ENDIF
+      !
+      !                                      ! General initialization
+                            CALL     phy_cst    ! Physical constants
+                            CALL     eos_init   ! Equation of state
+                            CALL     dom_cfg    ! Domain configuration
+                            CALL     dom_init   ! Domain
+                            CALL  istate_init   ! ocean initial state (Dynamics and tracers)
+
+      !                                     ! Ocean physics
+#if ! defined key_degrad
+                            CALL ldf_tra_init   ! Lateral ocean tracer physics
+#endif
+      IF( lk_ldfslp )       CALL ldf_slp_init   ! slope of lateral mixing
+
+      !                                     ! Active tracers
+                            CALL tra_qsr_init   ! penetrative solar radiation qsr
+      IF( lk_trabbl     )   CALL tra_bbl_init   ! advective (and/or diffusive) bottom boundary layer scheme
+
+      !                                     ! Passive tracers
+                            CALL     trc_init   ! Passive tracers initialization
+      !                                     ! Dynamics
+                            CALL dta_dyn_init   ! Initialization for the dynamics
+                            CALL     iom_init       ! iom_put initialization
+
+      IF(lwp) WRITE(numout,cform_aaa)       ! Flag AAAAAAA
+      !
+   END SUBROUTINE nemo_init
+
+
+   SUBROUTINE nemo_ctl
+      !!----------------------------------------------------------------------
+      !!                     ***  ROUTINE nemo_ctl  ***
+      !!
+      !! ** Purpose :   control print setting 
+      !!
+      !! ** Method  : - print namctl information and check some consistencies
+      !!----------------------------------------------------------------------
+      !
+      IF(lwp) THEN                  ! Parameter print
+         WRITE(numout,*)
+         WRITE(numout,*) 'nemo_flg: Control prints & Benchmark'
+         WRITE(numout,*) '~~~~~~~ '
+         WRITE(numout,*) '   Namelist namctl'
+         WRITE(numout,*) '      run control (for debugging)     ln_ctl     = ', ln_ctl
+         WRITE(numout,*) '      level of print                  nn_print   = ', nn_print
+         WRITE(numout,*) '      Start i indice for SUM control  nn_ictls   = ', nn_ictls
+         WRITE(numout,*) '      End i indice for SUM control    nn_ictle   = ', nn_ictle
+         WRITE(numout,*) '      Start j indice for SUM control  nn_jctls   = ', nn_jctls
+         WRITE(numout,*) '      End j indice for SUM control    nn_jctle   = ', nn_jctle
+         WRITE(numout,*) '      number of proc. following i     nn_isplt   = ', nn_isplt
+         WRITE(numout,*) '      number of proc. following j     nn_jsplt   = ', nn_jsplt
+         WRITE(numout,*) '      benchmark parameter (0/1)       nn_bench   = ', nn_bench
+      ENDIF
+      !
+      nprint    = nn_print          ! convert DOCTOR namelist names into OLD names
+      nictls    = nn_ictls
+      nictle    = nn_ictle
+      njctls    = nn_jctls
+      njctle    = nn_jctle
+      isplt     = nn_isplt
+      jsplt     = nn_jsplt
+      nbench    = nn_bench
+      !                             ! Parameter control
+      !
+      IF( ln_ctl ) THEN                 ! sub-domain area indices for the control prints
+         IF( lk_mpp ) THEN
+            isplt = jpni   ;   jsplt = jpnj   ;   ijsplt = jpni*jpnj   ! the domain is forced to the real splitted domain
+         ELSE
+            IF( isplt == 1 .AND. jsplt == 1  ) THEN
+               CALL ctl_warn( ' - isplt & jsplt are equal to 1',   &
+                  &           ' - the print control will be done over the whole domain' )
+            ENDIF
+            ijsplt = isplt * jsplt            ! total number of processors ijsplt
+         ENDIF
+         IF(lwp) WRITE(numout,*)'          - The total number of processors over which the'
+         IF(lwp) WRITE(numout,*)'            print control will be done is ijsplt : ', ijsplt
+         !
+         !                              ! indices used for the SUM control
+         IF( nictls+nictle+njctls+njctle == 0 )   THEN    ! print control done over the default area
+            lsp_area = .FALSE.
+         ELSE                                             ! print control done over a specific  area
+            lsp_area = .TRUE.
+            IF( nictls < 1 .OR. nictls > jpiglo )   THEN
+               CALL ctl_warn( '          - nictls must be 1<=nictls>=jpiglo, it is forced to 1' )
+               nictls = 1
+            ENDIF
+            IF( nictle < 1 .OR. nictle > jpiglo )   THEN
+               CALL ctl_warn( '          - nictle must be 1<=nictle>=jpiglo, it is forced to jpiglo' )
+               nictle = jpiglo
+            ENDIF
+            IF( njctls < 1 .OR. njctls > jpjglo )   THEN
+               CALL ctl_warn( '          - njctls must be 1<=njctls>=jpjglo, it is forced to 1' )
+               njctls = 1
+            ENDIF
+            IF( njctle < 1 .OR. njctle > jpjglo )   THEN
+               CALL ctl_warn( '          - njctle must be 1<=njctle>=jpjglo, it is forced to jpjglo' )
+               njctle = jpjglo
+            ENDIF
+         ENDIF
+      ENDIF
+      !
+      IF( nbench == 1 )   THEN            ! Benchmark 
+         SELECT CASE ( cp_cfg )
+         CASE ( 'gyre' )   ;   CALL ctl_warn( ' The Benchmark is activated ' )
+         CASE DEFAULT      ;   CALL ctl_stop( ' The Benchmark is based on the GYRE configuration:',   &
+            &                                 ' key_gyre must be used or set nbench = 0' )
+         END SELECT
+      ENDIF
+      !
+      IF( lk_c1d .AND. .NOT.lk_iomput )   CALL ctl_stop( 'nemo_ctl: The 1D configuration must be used ',   &
+         &                                               'with the IOM Input/Output manager. '        ,   &
+         &                                               'Compile with key_iomput enabled' )
+      !
+   END SUBROUTINE nemo_ctl
+
+
+   SUBROUTINE nemo_closefile
+      !!----------------------------------------------------------------------
+      !!                     ***  ROUTINE nemo_closefile  ***
+      !!
+      !! ** Purpose :   Close the files
+      !!----------------------------------------------------------------------
+      !
+      IF ( lk_mpp ) CALL mppsync
+      !
+      CALL iom_close                                 ! close all input/output files managed by iom_*
+      !
+      IF( numstp     /= -1 )   CLOSE( numstp     )   ! time-step file
+      IF( numnam     /= -1 )   CLOSE( numnam     )   ! oce namelist
+      IF( numout     /=  6 )   CLOSE( numout     )   ! standard model output file
+      numout = 6                                     ! redefine numout in case it is used after this point...
+      !
+   END SUBROUTINE nemo_closefile
+
+   !!======================================================================
+END MODULE nemogcm
Index: unk/NEMOGCM/NEMO/OFF_SRC/opa.F90
===================================================================
--- /trunk/NEMOGCM/NEMO/OFF_SRC/opa.F90	(revision 2573)
+++ 	(revision )
@@ -1,310 +1,0 @@
-MODULE opa
-   !!======================================================================
-   !!                       ***  MODULE opa   ***
-   !! Off-line Ocean   : passive tracer evolution, dynamics read in files
-   !!======================================================================
-   !! History :  3.3  ! 2010-05  (C. Ethe)  Full reorganization of the off-line: phasing with the on-line
-   !!----------------------------------------------------------------------
-
-   !!----------------------------------------------------------------------
-   !!   opa_model      : off-line: solve ocean tracer only
-   !!   opa_init       : initialization of the opa model
-   !!   opa_ctl        : initialisation of algorithm flag 
-   !!   opa_closefile  : close remaining files
-   !!----------------------------------------------------------------------
-   USE dom_oce         ! ocean space domain variables
-   USE oce             ! dynamics and tracers variables
-   USE c1d             ! 1D configuration
-   USE domcfg          ! domain configuration               (dom_cfg routine)
-   USE domain          ! domain initialization             (dom_init routine)
-   USE istate          ! initial state setting          (istate_init routine)
-   USE eosbn2          ! equation of state            (eos bn2 routine)
-   !              ! ocean physics
-   USE ldftra          ! lateral diffusivity setting    (ldf_tra_init routine)
-   USE ldfslp          ! slopes of neutral surfaces     (ldf_slp_init routine)
-   USE traqsr          ! solar radiation penetration    (tra_qsr_init routine)
-   USE trabbl          ! bottom boundary layer          (tra_bbl_init routine)
-   USE zdfini          ! vertical physics: initialization
-   USE phycst          ! physical constant                  (par_cst routine)
-   USE dtadyn          ! Lecture and Interpolation of the dynamical fields
-   USE trcini          ! Initilization of the passive tracers
-   USE daymod          ! calendar                         (day     routine)
-   USE trcstp          ! passive tracer time-stepping      (trc_stp routine)
-   USE dtadyn          ! Lecture and interpolation of the dynamical fields
-   USE stpctl          ! time stepping control            (stp_ctl routine)
-   !              ! I/O & MPP
-   USE iom             ! I/O library
-   USE in_out_manager  ! I/O manager
-   USE mppini          ! shared/distributed memory setting (mpp_init routine)
-   USE lib_mpp         ! distributed memory computing
-#if defined key_iomput
-   USE  mod_ioclient
-#endif 
-
-   IMPLICIT NONE
-   PRIVATE
-   
-   PUBLIC   opa_model   ! called by model.F90
-
-   CHARACTER (len=64) ::   cform_aaa="( /, 'AAAAAAAA', / ) "   ! flag for output listing
-
-   !!----------------------------------------------------------------------
-   !! NEMO/OFF 3.3 , NEMO Consortium (2010)
-   !! $Id$
-   !! Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt)
-   !!----------------------------------------------------------------------
-CONTAINS
-
-   SUBROUTINE opa_model
-      !!----------------------------------------------------------------------
-      !!                     ***  ROUTINE opa  ***
-      !!
-      !! ** Purpose :   opa solves the primitive equations on an orthogonal
-      !!      curvilinear mesh on the sphere.
-      !!
-      !! ** Method  : - model general initialization
-      !!              - launch the time-stepping (dta_dyn and trc_stp)
-      !!              - finalize the run by closing files and communications
-      !!
-      !! References : Madec, Delecluse,Imbard, and Levy, 1997:  internal report, IPSL.
-      !!              Madec, 2008, internal report, IPSL.
-      !!----------------------------------------------------------------------
-      INTEGER :: istp, indic       ! time step index
-      !!----------------------------------------------------------------------
-
-      CALL opa_init  ! Initializations
-
-      IF( lk_mpp )   CALL mpp_max( nstop )
-
-      ! check that all process are still there... If some process have an error,
-      ! they will never enter in step and other processes will wait until the end of the cpu time!
-      IF( lk_mpp )   CALL mpp_max( nstop )
-
-      !                            !-----------------------!
-      !                            !==   time stepping   ==!
-      !                            !-----------------------!
-      istp = nit000
-         !
-      DO WHILE ( istp <= nitend .AND. nstop == 0 )    ! time stepping
-         !
-         IF( istp /= nit000 )   CALL day      ( istp )         ! Calendar (day was already called at nit000 in day_init)
-                                CALL iom_setkt( istp )         ! say to iom that we are at time step kstp
-                                CALL dta_dyn  ( istp )         ! Interpolation of the dynamical fields
-                                CALL trc_stp  ( istp )         ! time-stepping
-                                CALL stp_ctl  ( istp, indic )  ! Time loop: control and print
-         istp = istp + 1
-         IF( lk_mpp )   CALL mpp_max( nstop )
-      END DO
-
-      !                            !------------------------!
-      !                            !==  finalize the run  ==!
-      !                            !------------------------!
-      IF(lwp) WRITE(numout,cform_aaa)                 ! Flag AAAAAAA
-
-      IF( nstop /= 0 .AND. lwp ) THEN                 ! error print
-         WRITE(numout,cform_err)
-         WRITE(numout,*) nstop, ' error have been found'
-      ENDIF
-      !
-      CALL opa_closefile
-      !
-      IF( lk_mpp )   CALL mppstop                          ! Close all files (mpp)
-      !
-   END SUBROUTINE opa_model
-
-
-   SUBROUTINE opa_init
-      !!----------------------------------------------------------------------
-      !!                     ***  ROUTINE opa_init ***
-      !!
-      !! ** Purpose :   initialization of the opa model in off-line mode
-      !!----------------------------------------------------------------------
-      INTEGER ::   ji            ! dummy loop indices
-      INTEGER ::   ilocal_comm   ! local integer
-      CHARACTER(len=80), DIMENSION(10) ::   cltxt = ''
-      !!
-      NAMELIST/namctl/ ln_ctl  , nn_print, nn_ictls, nn_ictle,   &
-         &             nn_isplt, nn_jsplt, nn_jctls, nn_jctle, nn_bench
-      !!----------------------------------------------------------------------
-      !
-      !                             ! open Namelist file     
-      CALL ctl_opn( numnam, 'namelist', 'OLD', 'FORMATTED', 'SEQUENTIAL', -1, 6, .FALSE. )
-      !
-      READ( numnam, namctl )        ! Namelist namctl : Control prints & Benchmark
-      !
-      !                             !--------------------------------------------!
-      !                             !  set communicator & select the local node  !
-      !                             !--------------------------------------------!
-#if defined key_iomput
-      CALL init_ioclient( ilocal_comm )       ! nemo local communicator (used or not) given by the io_server
-      narea = mynode( cltxt, ilocal_comm )    ! Nodes selection
-#else
-      narea = mynode( cltxt )                 ! Nodes selection (control print return in cltxt)
-#endif
-      narea = narea + 1                       ! mynode return the rank of proc (0 --> jpnij -1 )
-
-      lwp = (narea == 1) .OR. ln_ctl          ! control of all listing output print
-
-      IF(lwp) THEN                            ! open listing units
-         !
-         CALL ctl_opn( numout, 'ocean.output', 'REPLACE', 'FORMATTED', 'SEQUENTIAL', -1, 6, .FALSE., narea )
-         !
-         WRITE(numout,*)
-         WRITE(numout,*) '         CNRS - NERC - Met OFFICE - MERCATOR-ocean'
-         WRITE(numout,*) '                       NEMO team'
-         WRITE(numout,*) '            Ocean General Circulation Model'
-         WRITE(numout,*) '                  version 3.3  (2010) '
-         WRITE(numout,*)
-         WRITE(numout,*)
-         DO ji = 1, SIZE(cltxt) 
-            IF( TRIM(cltxt(ji)) /= '' )   WRITE(numout,*) cltxt(ji)      ! control print of mynode
-         END DO
-         WRITE(numout,cform_aaa)                                         ! Flag AAAAAAA
-         !
-      ENDIF
-      !                             !--------------------------------!
-      !                             !  Model general initialization  !
-      !                             !--------------------------------!
-
-      CALL opa_ctl                           ! Control prints & Benchmark
-
-      !                                      ! Domain decomposition
-      IF( jpni*jpnj == jpnij ) THEN   ;   CALL mpp_init      ! standard cutting out
-      ELSE                            ;   CALL mpp_init2     ! eliminate land processors
-      ENDIF
-      !
-      !                                      ! General initialization
-                            CALL     phy_cst    ! Physical constants
-                            CALL     eos_init   ! Equation of state
-                            CALL     dom_cfg    ! Domain configuration
-                            CALL     dom_init   ! Domain
-                            CALL  istate_init   ! ocean initial state (Dynamics and tracers)
-
-      !                                     ! Ocean physics
-#if ! defined key_degrad
-                            CALL ldf_tra_init   ! Lateral ocean tracer physics
-#endif
-      IF( lk_ldfslp )       CALL ldf_slp_init   ! slope of lateral mixing
-
-      !                                     ! Active tracers
-                            CALL tra_qsr_init   ! penetrative solar radiation qsr
-      IF( lk_trabbl     )   CALL tra_bbl_init   ! advective (and/or diffusive) bottom boundary layer scheme
-
-      !                                     ! Passive tracers
-                            CALL     trc_init   ! Passive tracers initialization
-      !                                     ! Dynamics
-                            CALL dta_dyn_init   ! Initialization for the dynamics
-                            CALL     iom_init       ! iom_put initialization
-
-      IF(lwp) WRITE(numout,cform_aaa)       ! Flag AAAAAAA
-      !
-   END SUBROUTINE opa_init
-
-
-   SUBROUTINE opa_ctl
-      !!----------------------------------------------------------------------
-      !!                     ***  ROUTINE opa_ctl  ***
-      !!
-      !! ** Purpose :   control print setting 
-      !!
-      !! ** Method  : - print namctl information and check some consistencies
-      !!----------------------------------------------------------------------
-      !
-      IF(lwp) THEN                  ! Parameter print
-         WRITE(numout,*)
-         WRITE(numout,*) 'opa_flg: Control prints & Benchmark'
-         WRITE(numout,*) '~~~~~~~ '
-         WRITE(numout,*) '   Namelist namctl'
-         WRITE(numout,*) '      run control (for debugging)     ln_ctl     = ', ln_ctl
-         WRITE(numout,*) '      level of print                  nn_print   = ', nn_print
-         WRITE(numout,*) '      Start i indice for SUM control  nn_ictls   = ', nn_ictls
-         WRITE(numout,*) '      End i indice for SUM control    nn_ictle   = ', nn_ictle
-         WRITE(numout,*) '      Start j indice for SUM control  nn_jctls   = ', nn_jctls
-         WRITE(numout,*) '      End j indice for SUM control    nn_jctle   = ', nn_jctle
-         WRITE(numout,*) '      number of proc. following i     nn_isplt   = ', nn_isplt
-         WRITE(numout,*) '      number of proc. following j     nn_jsplt   = ', nn_jsplt
-         WRITE(numout,*) '      benchmark parameter (0/1)       nn_bench   = ', nn_bench
-      ENDIF
-      !
-      nprint    = nn_print          ! convert DOCTOR namelist names into OLD names
-      nictls    = nn_ictls
-      nictle    = nn_ictle
-      njctls    = nn_jctls
-      njctle    = nn_jctle
-      isplt     = nn_isplt
-      jsplt     = nn_jsplt
-      nbench    = nn_bench
-      !                             ! Parameter control
-      !
-      IF( ln_ctl ) THEN                 ! sub-domain area indices for the control prints
-         IF( lk_mpp ) THEN
-            isplt = jpni   ;   jsplt = jpnj   ;   ijsplt = jpni*jpnj   ! the domain is forced to the real splitted domain
-         ELSE
-            IF( isplt == 1 .AND. jsplt == 1  ) THEN
-               CALL ctl_warn( ' - isplt & jsplt are equal to 1',   &
-                  &           ' - the print control will be done over the whole domain' )
-            ENDIF
-            ijsplt = isplt * jsplt            ! total number of processors ijsplt
-         ENDIF
-         IF(lwp) WRITE(numout,*)'          - The total number of processors over which the'
-         IF(lwp) WRITE(numout,*)'            print control will be done is ijsplt : ', ijsplt
-         !
-         !                              ! indices used for the SUM control
-         IF( nictls+nictle+njctls+njctle == 0 )   THEN    ! print control done over the default area
-            lsp_area = .FALSE.
-         ELSE                                             ! print control done over a specific  area
-            lsp_area = .TRUE.
-            IF( nictls < 1 .OR. nictls > jpiglo )   THEN
-               CALL ctl_warn( '          - nictls must be 1<=nictls>=jpiglo, it is forced to 1' )
-               nictls = 1
-            ENDIF
-            IF( nictle < 1 .OR. nictle > jpiglo )   THEN
-               CALL ctl_warn( '          - nictle must be 1<=nictle>=jpiglo, it is forced to jpiglo' )
-               nictle = jpiglo
-            ENDIF
-            IF( njctls < 1 .OR. njctls > jpjglo )   THEN
-               CALL ctl_warn( '          - njctls must be 1<=njctls>=jpjglo, it is forced to 1' )
-               njctls = 1
-            ENDIF
-            IF( njctle < 1 .OR. njctle > jpjglo )   THEN
-               CALL ctl_warn( '          - njctle must be 1<=njctle>=jpjglo, it is forced to jpjglo' )
-               njctle = jpjglo
-            ENDIF
-         ENDIF
-      ENDIF
-      !
-      IF( nbench == 1 )   THEN            ! Benchmark 
-         SELECT CASE ( cp_cfg )
-         CASE ( 'gyre' )   ;   CALL ctl_warn( ' The Benchmark is activated ' )
-         CASE DEFAULT      ;   CALL ctl_stop( ' The Benchmark is based on the GYRE configuration:',   &
-            &                                 ' key_gyre must be used or set nbench = 0' )
-         END SELECT
-      ENDIF
-      !
-      IF( lk_c1d .AND. .NOT.lk_iomput )   CALL ctl_stop( 'opa_ctl: The 1D configuration must be used ',   &
-         &                                               'with the IOM Input/Output manager. '        ,   &
-         &                                               'Compile with key_iomput enabled' )
-      !
-   END SUBROUTINE opa_ctl
-
-
-   SUBROUTINE opa_closefile
-      !!----------------------------------------------------------------------
-      !!                     ***  ROUTINE opa_closefile  ***
-      !!
-      !! ** Purpose :   Close the files
-      !!----------------------------------------------------------------------
-      !
-      IF ( lk_mpp ) CALL mppsync
-      !
-      CALL iom_close                                 ! close all input/output files managed by iom_*
-      !
-      IF( numstp     /= -1 )   CLOSE( numstp     )   ! time-step file
-      IF( numnam     /= -1 )   CLOSE( numnam     )   ! oce namelist
-      IF( numout     /=  6 )   CLOSE( numout     )   ! standard model output file
-      numout = 6                                     ! redefine numout in case it is used after this point...
-      !
-   END SUBROUTINE opa_closefile
-
-   !!======================================================================
-END MODULE opa
