Index: branches/2013/dev_LOCEAN_2013/NEMOGCM/NEMO/OPA_SRC/LBC/cla.F90
===================================================================
--- branches/2013/dev_LOCEAN_2013/NEMOGCM/NEMO/OPA_SRC/LBC/cla.F90	(revision 4146)
+++ branches/2013/dev_LOCEAN_2013/NEMOGCM/NEMO/OPA_SRC/LBC/cla.F90	(revision 4147)
@@ -11,8 +11,4 @@
    !!            3.2  ! 2009-07 (G. Madec)  merge cla, cla_div, tra_cla, cla_dynspg
    !!                 !                     and correct a mpp bug reported by A.R. Porter
-   !!----------------------------------------------------------------------
-#if defined key_orca_r2
-   !!----------------------------------------------------------------------
-   !!   'key_orca_r2'                                 global ocean model R2
    !!----------------------------------------------------------------------
    !!   cla_div           : update of horizontal divergence at cla straits
@@ -733,24 +729,4 @@
    END SUBROUTINE cla_hormuz
    
-#else
-   !!----------------------------------------------------------------------
-   !!   Default key                                            Dummy module
-   !!----------------------------------------------------------------------
-   USE lib_mpp, ONLY:   ctl_stop
-CONTAINS
-   SUBROUTINE cla_init
-      CALL ctl_stop( 'cla_init: Cross Land Advection hard coded for ORCA_R2 with 31 levels' )
-   END SUBROUTINE cla_init
-   SUBROUTINE cla_div( kt )
-      WRITE(*,*) 'cla_div: You should have not see this print! error?', kt
-   END SUBROUTINE cla_div
-   SUBROUTINE cla_traadv( kt ) 
-      WRITE(*,*) 'cla_traadv: You should have not see this print! error?', kt
-   END SUBROUTINE cla_traadv
-   SUBROUTINE cla_dynspg( kt ) 
-      WRITE(*,*) 'dyn_spg_cla: You should have not see this print! error?', kt
-   END SUBROUTINE cla_dynspg
-#endif
-   
    !!======================================================================
 END MODULE cla
Index: branches/2013/dev_LOCEAN_2013/NEMOGCM/NEMO/OPA_SRC/LBC/lib_mpp.F90
===================================================================
--- branches/2013/dev_LOCEAN_2013/NEMOGCM/NEMO/OPA_SRC/LBC/lib_mpp.F90	(revision 4146)
+++ branches/2013/dev_LOCEAN_2013/NEMOGCM/NEMO/OPA_SRC/LBC/lib_mpp.F90	(revision 4147)
@@ -28,5 +28,6 @@
    !!   ctl_warn   : initialization, namelist read, and parameters control
    !!   ctl_opn    : Open file and check if required file is available.
-   !!   get_unit    : give the index of an unused logical unit
+   !!   ctl_nam    : Prints informations when an error occurs while reading a namelist
+   !!   get_unit   : give the index of an unused logical unit
    !!----------------------------------------------------------------------
 #if   defined key_mpp_mpi
@@ -61,6 +62,6 @@
    IMPLICIT NONE
    PRIVATE
-
-   PUBLIC   ctl_stop, ctl_warn, get_unit, ctl_opn
+   
+   PUBLIC   ctl_stop, ctl_warn, get_unit, ctl_opn, ctl_nam
    PUBLIC   mynode, mppstop, mppsync, mpp_comm_free
    PUBLIC   mpp_ini_north, mpp_lbc_north, mpp_lbc_north_e
@@ -144,7 +145,7 @@
 
    ! Type of send : standard, buffered, immediate
-   CHARACTER(len=1), PUBLIC ::   cn_mpi_send = 'S'    ! type od mpi send/recieve (S=standard, B=bsend, I=isend)
+   CHARACTER(len=1), PUBLIC ::   cn_mpi_send   ! type od mpi send/recieve (S=standard, B=bsend, I=isend)
    LOGICAL, PUBLIC          ::   l_isend = .FALSE.   ! isend use indicator (T if cn_mpi_send='I')
-   INTEGER, PUBLIC          ::   nn_buffer = 0       ! size of the buffer in case of mpi_bsend
+   INTEGER, PUBLIC          ::   nn_buffer     ! size of the buffer in case of mpi_bsend
 
    REAL(wp), DIMENSION(:), ALLOCATABLE, SAVE :: tampon  ! buffer in case of bsend
@@ -225,5 +226,5 @@
 
 
-   FUNCTION mynode( ldtxt, kumnam, kstop, localComm )
+   FUNCTION mynode( ldtxt, kumnam_ref , kumnam_cfg , kumond , kstop, localComm )
       !!----------------------------------------------------------------------
       !!                  ***  routine mynode  ***
@@ -232,9 +233,11 @@
       !!----------------------------------------------------------------------
       CHARACTER(len=*),DIMENSION(:), INTENT(  out) ::   ldtxt
-      INTEGER                      , INTENT(in   ) ::   kumnam       ! namelist logical unit
-      INTEGER                      , INTENT(inout) ::   kstop        ! stop indicator
+      INTEGER                      , INTENT(in   ) ::   kumnam_ref     ! logical unit for reference namelist
+      INTEGER                      , INTENT(in   ) ::   kumnam_cfg     ! logical unit for configuration namelist
+      INTEGER                      , INTENT(in   ) ::   kumond         ! logical unit for namelist output
+      INTEGER                      , INTENT(inout) ::   kstop          ! stop indicator
       INTEGER, OPTIONAL            , INTENT(in   ) ::   localComm
       !
-      INTEGER ::   mynode, ierr, code, ji, ii
+      INTEGER ::   mynode, ierr, code, ji, ii, ios
       LOGICAL ::   mpi_was_called
       !
@@ -247,7 +250,14 @@
       WRITE(ldtxt(ii),*) '~~~~~~ '                                                                ;   ii = ii + 1
       !
-      jpni = -1; jpnj = -1; jpnij = -1
-      REWIND( kumnam )               ! Namelist namrun : parameters of the run
-      READ  ( kumnam, nammpp )
+
+      REWIND( kumnam_ref )              ! Namelist nammpp in reference namelist: mpi variables
+      READ  ( kumnam_ref, nammpp, IOSTAT = ios, ERR = 901)
+901   IF( ios /= 0 ) CALL ctl_nam ( ios , 'nammpp in reference namelist', lwp )
+
+      REWIND( kumnam_cfg )              ! Namelist nammpp in configuration namelist: mpi variables
+      READ  ( kumnam_cfg, nammpp, IOSTAT = ios, ERR = 902 )
+902   IF( ios /= 0 ) CALL ctl_nam ( ios , 'nammpp in configuration namelist', lwp )
+      WRITE(kumond, nammpp)      
+
       !                              ! control print
       WRITE(ldtxt(ii),*) '   Namelist nammpp'                                                     ;   ii = ii + 1
@@ -3445,5 +3455,5 @@
 
    LOGICAL, PUBLIC, PARAMETER ::   lk_mpp = .FALSE.      !: mpp flag
-   LOGICAL, PUBLIC            ::   ln_nnogather  = .FALSE.  !: namelist control of northfold comms (needed here in case "key_mpp_mpi" is not used)
+   LOGICAL, PUBLIC            ::   ln_nnogather          !: namelist control of northfold comms (needed here in case "key_mpp_mpi" is not used)
    INTEGER :: ncomm_ice
    !!----------------------------------------------------------------------
@@ -3455,8 +3465,8 @@
    END FUNCTION lib_mpp_alloc
 
-   FUNCTION mynode( ldtxt, kumnam, kstop, localComm ) RESULT (function_value)
+   FUNCTION mynode( ldtxt, kumnam_ref, knumnam_cfg, kstop, localComm ) RESULT (function_value)
       INTEGER, OPTIONAL            , INTENT(in   ) ::   localComm
       CHARACTER(len=*),DIMENSION(:) ::   ldtxt
-      INTEGER ::   kumnam, kstop
+      INTEGER ::   kumnam_ref, knumnam_cfg , kstop
       IF( PRESENT( localComm ) .OR. .NOT.PRESENT( localComm ) )   function_value = 0
       IF( .FALSE. )   ldtxt(:) = 'never done'
@@ -3637,5 +3647,5 @@
 
    !!----------------------------------------------------------------------
-   !!   All cases:         ctl_stop, ctl_warn, get_unit, ctl_opn   routines
+   !!   All cases:         ctl_stop, ctl_warn, get_unit, ctl_opn, ctl_nam   routines
    !!----------------------------------------------------------------------
 
@@ -3780,4 +3790,34 @@
    END SUBROUTINE ctl_opn
 
+   SUBROUTINE ctl_nam ( kios, cdnam, ldwp )
+      !!----------------------------------------------------------------------
+      !!                  ***  ROUTINE ctl_nam  ***
+      !!
+      !! ** Purpose :   Informations when error while reading a namelist
+      !!
+      !! ** Method  :   Fortan open
+      !!----------------------------------------------------------------------
+      INTEGER          , INTENT(inout) ::   kios      ! IO status after reading the namelist
+      CHARACTER(len=*) , INTENT(in   ) ::   cdnam     ! group name of namelist for which error occurs
+      CHARACTER(len=4)                 ::   clios     ! string to convert iostat in character for print
+      LOGICAL          , INTENT(in   ) ::   ldwp      ! boolean term for print
+      !!----------------------------------------------------------------------
+
+      ! 
+      ! ----------------
+      WRITE (clios, '(I4.0)') kios
+      IF( kios < 0 ) THEN         
+         CALL ctl_warn( 'W A R N I N G:  end of record or file while reading namelist ' &
+ &           // TRIM(cdnam) // ' iostat = ' // TRIM(clios) )
+      ENDIF
+
+      IF( kios > 0 ) THEN
+         CALL ctl_stop( 'E R R O R :   misspelled variable in namelist ' &
+ &           // TRIM(cdnam) // ' iostat = ' // TRIM(clios) )
+      ENDIF
+      kios = 0
+      RETURN
+      
+   END SUBROUTINE ctl_nam
 
    INTEGER FUNCTION get_unit()
Index: branches/2013/dev_LOCEAN_2013/NEMOGCM/NEMO/OPA_SRC/LBC/mppini_2.h90
===================================================================
--- branches/2013/dev_LOCEAN_2013/NEMOGCM/NEMO/OPA_SRC/LBC/mppini_2.h90	(revision 4146)
+++ branches/2013/dev_LOCEAN_2013/NEMOGCM/NEMO/OPA_SRC/LBC/mppini_2.h90	(revision 4147)
@@ -45,4 +45,5 @@
       INTEGER ::  inum                        ! temporary logical unit
       INTEGER ::  idir                        ! temporary integers
+      INTEGER ::   ios                        ! Local integer output status for namelist read
       INTEGER ::   &
          ii, ij, ifreq, il1, il2,          &  ! temporary integers
@@ -77,7 +78,13 @@
       !! This software is governed by the CeCILL licence see modipsl/doc/NEMO_CeCILL.txt
       !!----------------------------------------------------------------------
-      
-      REWIND ( numnam )              ! Read Namelist namzgr : vertical coordinate'
-      READ   ( numnam, namzgr )
+
+      REWIND( numnam_ref )              ! Namelist namzgr in reference namelist : Vertical coordinate
+      READ  ( numnam_ref, namzgr, IOSTAT = ios, ERR = 901)
+901   IF( ios /= 0 ) CALL ctl_nam ( ios , 'namzgr in reference namelist', lwp )
+
+      REWIND( numnam_cfg )              ! Namelist namzgr in configuration namelist : Vertical coordinate
+      READ  ( numnam_cfg, namzgr, IOSTAT = ios, ERR = 902 )
+902   IF( ios /= 0 ) CALL ctl_nam ( ios , 'namzgr in configuration namelist', lwp )
+      WRITE ( numond, namzgr )
 
       IF(lwp)WRITE(numout,*)
