Index: branches/2013/dev_r3853_CNRS9_ConfSetting/NEMOGCM/NEMO/OPA_SRC/ASM/asminc.F90
===================================================================
--- branches/2013/dev_r3853_CNRS9_ConfSetting/NEMOGCM/NEMO/OPA_SRC/ASM/asminc.F90	(revision 3854)
+++ branches/2013/dev_r3853_CNRS9_ConfSetting/NEMOGCM/NEMO/OPA_SRC/ASM/asminc.F90	(revision 3875)
@@ -120,4 +120,5 @@
       INTEGER :: iitiaustr_date  ! Date YYYYMMDD of IAU interval start time step
       INTEGER :: iitiaufin_date  ! Date YYYYMMDD of IAU interval final time step
+      INTEGER :: ios             ! Local integer output status for namelist read
 
       REAL(wp) :: znorm        ! Normalization factor for IAU weights
@@ -160,6 +161,12 @@
       niaufn    = 0
 
-      REWIND ( numnam )
-      READ   ( numnam, nam_asminc )
+      REWIND( numnam_ref )              ! Namelist nam_asminc in reference namelist : Assimilation increment
+      READ  ( numnam_ref, nam_asminc, IOSTAT = ios, ERR = 901)
+901   IF( ios /= 0 ) CALL ctl_nam ( ios , 'nam_asminc in reference namelist', lwp )
+
+      REWIND( numnam_cfg )              ! Namelist nam_asminc in configuration namelist : Assimilation increment
+      READ  ( numnam_cfg, nam_asminc, IOSTAT = ios, ERR = 902 )
+902   IF( ios /= 0 ) CALL ctl_nam ( ios , 'nam_asminc in configuration namelist', lwp )
+      WRITE ( numond, nam_asminc )
 
       ! Control print
Index: branches/2013/dev_r3853_CNRS9_ConfSetting/NEMOGCM/NEMO/OPA_SRC/BDY/bdydta.F90
===================================================================
--- branches/2013/dev_r3853_CNRS9_ConfSetting/NEMOGCM/NEMO/OPA_SRC/BDY/bdydta.F90	(revision 3854)
+++ branches/2013/dev_r3853_CNRS9_ConfSetting/NEMOGCM/NEMO/OPA_SRC/BDY/bdydta.F90	(revision 3875)
@@ -355,4 +355,5 @@
       !!
       INTEGER     ::  ib_bdy, jfld, jstart, jend, ierror  ! local indices
+      INTEGER      ::   ios                               ! Local integer output status for namelist read
       !!
       CHARACTER(len=100)                     ::   cn_dir        ! Root directory for location of data files
@@ -440,5 +441,5 @@
       ! Read namelists
       ! --------------
-      REWIND(numnam)
+      REWIND(numnam_cfg)
       jfld = 0 
       DO ib_bdy = 1, nb_bdy         
@@ -463,6 +464,14 @@
 #endif
 
+            ! Read configuration namelist only to avoid unsuccessful overwrite
             ! Important NOT to rewind here.
-            READ( numnam, nambdy_dta )
+!!          REWIND( numnam_ref )              ! Namelist nambdy_dta in reference namelist : 
+!!          READ  ( numnam_ref, nambdy_dta, IOSTAT = ios, ERR = 901)
+!!901       IF( ios /= 0 ) CALL ctl_nam ( ios , 'nambdy_dta in reference namelist', lwp )
+
+!!          REWIND( numnam_cfg )              ! Namelist nambdy_dta in configuration namelist : 
+            READ  ( numnam_cfg, nambdy_dta, IOSTAT = ios, ERR = 902 )
+902         IF( ios /= 0 ) CALL ctl_nam ( ios , 'nambdy_dta in configuration namelist', lwp )
+            WRITE ( numond, nambdy_dta )
 
             cn_dir_array(ib_bdy) = cn_dir
Index: branches/2013/dev_r3853_CNRS9_ConfSetting/NEMOGCM/NEMO/OPA_SRC/BDY/bdyini.F90
===================================================================
--- branches/2013/dev_r3853_CNRS9_ConfSetting/NEMOGCM/NEMO/OPA_SRC/BDY/bdyini.F90	(revision 3854)
+++ branches/2013/dev_r3853_CNRS9_ConfSetting/NEMOGCM/NEMO/OPA_SRC/BDY/bdyini.F90	(revision 3875)
@@ -102,5 +102,5 @@
       !!
       NAMELIST/nambdy_index/ ctypebdy, nbdyind, nbdybeg, nbdyend
-
+      INTEGER  ::   ios                 ! Local integer output status for namelist read
       !!----------------------------------------------------------------------
 
@@ -145,6 +145,12 @@
       nn_rimwidth(:)    = -1  ! uninitialised flag
 
-      REWIND( numnam )                    
-      READ  ( numnam, nambdy )
+      REWIND( numnam_ref )              ! Namelist nambdy in reference namelist :Unstructured open boundaries  
+      READ  ( numnam_ref, nambdy, IOSTAT = ios, ERR = 901)
+901   IF( ios /= 0 ) CALL ctl_nam ( ios , 'nambdy in reference namelist', lwp )
+
+      REWIND( numnam_cfg )              ! Namelist nambdy in configuration namelist :Unstructured open boundaries
+      READ  ( numnam_cfg, nambdy, IOSTAT = ios, ERR = 902 )
+902   IF( ios /= 0 ) CALL ctl_nam ( ios , 'nambdy in configuration namelist', lwp )
+      WRITE ( numond, nambdy )
 
       ! -----------------------------------------
@@ -301,5 +307,9 @@
       ! Work out global dimensions of boundary data
       ! ---------------------------------------------
-      REWIND( numnam )                    
+      REWIND( numnam_cfg )     
+
+      !!----------------------------------------------------------------------
+
+              
                
       nblendta(:,:) = 0
@@ -319,5 +329,13 @@
             icount = icount + 1
             ! No REWIND here because may need to read more than one nambdy_index namelist.
-            READ  ( numnam, nambdy_index )
+            ! Read only namelist_cfg to avoid unseccessfull overwrite
+!!          REWIND( numnam_ref )              ! Namelist nambdy_index in reference namelist : Open boundaries indexes
+!!          READ  ( numnam_ref, namrun, IOSTAT = ios, ERR = 903)
+!!903       IF( ios /= 0 ) CALL ctl_nam ( ios , 'nambdy_index in reference namelist', lwp )
+
+!!          REWIND( numnam_cfg )              ! Namelist nambdy_index in configuration namelist : Open boundaries indexes
+            READ  ( numnam_cfg, nambdy_index, IOSTAT = ios, ERR = 904 )
+904         IF( ios /= 0 ) CALL ctl_nam ( ios , 'nambdy_index in configuration namelist', lwp )
+            WRITE ( numond, nambdy_index )
 
             SELECT CASE ( TRIM(ctypebdy) )
Index: branches/2013/dev_r3853_CNRS9_ConfSetting/NEMOGCM/NEMO/OPA_SRC/BDY/bdytides.F90
===================================================================
--- branches/2013/dev_r3853_CNRS9_ConfSetting/NEMOGCM/NEMO/OPA_SRC/BDY/bdytides.F90	(revision 3854)
+++ branches/2013/dev_r3853_CNRS9_ConfSetting/NEMOGCM/NEMO/OPA_SRC/BDY/bdytides.F90	(revision 3875)
@@ -76,4 +76,5 @@
       INTEGER, DIMENSION(3)                     ::   ilen0       !: length of boundary data (from OBC arrays)
       INTEGER, POINTER, DIMENSION(:)            ::   nblen, nblenrim     ! short cuts
+      INTEGER                                   ::   ios                 ! Local integer output status for namelist read
       CHARACTER(len=80)                         ::   clfile              !: full file name for tidal input file 
       REAL(wp),ALLOCATABLE, DIMENSION(:,:,:)    ::   dta_read            !: work space to read in tidal harmonics data
@@ -96,5 +97,6 @@
       ln_bdytide_conj  = .FALSE.
 
-      REWIND(numnam)
+      REWIND(numnam_cfg)
+
       DO ib_bdy = 1, nb_bdy
          IF( nn_dyn2d_dta(ib_bdy) .ge. 2 ) THEN
@@ -108,5 +110,13 @@
 
             ! Don't REWIND here - may need to read more than one of these namelists.
-            READ  ( numnam, nambdy_tide )
+            ! Read only configuration namelist to avoid unsecessful overwrite
+!!          REWIND( numnam_ref )              ! Namelist nambdy_tide in reference namelist : 
+!!          READ  ( numnam_ref, nambdy_tide, IOSTAT = ios, ERR = 901)
+!!    901   IF( ios /= 0 ) CALL ctl_nam ( ios , 'nambdy_tide in reference namelist', lwp )
+
+!!          REWIND( numnam_cfg )              ! Namelist nambdy_tide in configuration namelist : 
+            READ  ( numnam_cfg, nambdy_tide, IOSTAT = ios, ERR = 902 )
+902         IF( ios /= 0 ) CALL ctl_nam ( ios , 'nambdy_tide in configuration namelist', lwp )
+            WRITE ( numond, nambdy_tide )
             !                                               ! Parameter control and print
             IF(lwp) WRITE(numout,*) '  '
Index: branches/2013/dev_r3853_CNRS9_ConfSetting/NEMOGCM/NEMO/OPA_SRC/DIA/diadct.F90
===================================================================
--- branches/2013/dev_r3853_CNRS9_ConfSetting/NEMOGCM/NEMO/OPA_SRC/DIA/diadct.F90	(revision 3854)
+++ branches/2013/dev_r3853_CNRS9_ConfSetting/NEMOGCM/NEMO/OPA_SRC/DIA/diadct.F90	(revision 3875)
@@ -139,10 +139,16 @@
      !!---------------------------------------------------------------------
      NAMELIST/namdct/nn_dct,nn_dctwri,nn_secdebug
+     INTEGER  ::   ios                 ! Local integer output status for namelist read
 
      IF( nn_timing == 1 )   CALL timing_start('dia_dct_init')
 
-     !read namelist
-     REWIND( numnam )
-     READ  ( numnam, namdct )
+     REWIND( numnam_ref )              ! Namelist namdct in reference namelist : Diagnostic: transport through sections
+     READ  ( numnam_ref, namdct, IOSTAT = ios, ERR = 901)
+901  IF( ios /= 0 ) CALL ctl_nam ( ios , 'namdct in reference namelist', lwp )
+
+     REWIND( numnam_cfg )              ! Namelist namdct in configuration namelist : Diagnostic: transport through sections
+     READ  ( numnam_cfg, namdct, IOSTAT = ios, ERR = 902 )
+902  IF( ios /= 0 ) CALL ctl_nam ( ios , 'namdct in configuration namelist', lwp )
+     WRITE ( numond, namdct )
 
      IF( lwp ) THEN
Index: branches/2013/dev_r3853_CNRS9_ConfSetting/NEMOGCM/NEMO/OPA_SRC/DIA/diaharm.F90
===================================================================
--- branches/2013/dev_r3853_CNRS9_ConfSetting/NEMOGCM/NEMO/OPA_SRC/DIA/diaharm.F90	(revision 3854)
+++ branches/2013/dev_r3853_CNRS9_ConfSetting/NEMOGCM/NEMO/OPA_SRC/DIA/diaharm.F90	(revision 3875)
@@ -78,4 +78,5 @@
       !! * Local declarations 
       INTEGER :: jh, nhan, jk, ji
+      INTEGER ::   ios                 ! Local integer output status for namelist read
 
       NAMELIST/nam_diaharm/ nit000_han, nitend_han, nstep_han, tname
@@ -92,7 +93,12 @@
       tname(:)=''
       !
-      ! Read Namelist nam_diaharm
-      REWIND ( numnam )
-      READ   ( numnam, nam_diaharm )
+      REWIND( numnam_ref )              ! Namelist nam_diaharm in reference namelist : Tidal harmonic analysis
+      READ  ( numnam_ref, nam_diaharm, IOSTAT = ios, ERR = 901)
+901   IF( ios /= 0 ) CALL ctl_nam ( ios , 'nam_diaharm in reference namelist', lwp )
+
+      REWIND( numnam_cfg )              ! Namelist nam_diaharm in configuration namelist : Tidal harmonic analysis
+      READ  ( numnam_cfg, nam_diaharm, IOSTAT = ios, ERR = 902 )
+902   IF( ios /= 0 ) CALL ctl_nam ( ios , 'nam_diaharm in configuration namelist', lwp )
+      WRITE ( numond, nam_diaharm )
       !
       IF(lwp) THEN
Index: branches/2013/dev_r3853_CNRS9_ConfSetting/NEMOGCM/NEMO/OPA_SRC/DIA/diahsb.F90
===================================================================
--- branches/2013/dev_r3853_CNRS9_ConfSetting/NEMOGCM/NEMO/OPA_SRC/DIA/diahsb.F90	(revision 3854)
+++ branches/2013/dev_r3853_CNRS9_ConfSetting/NEMOGCM/NEMO/OPA_SRC/DIA/diahsb.F90	(revision 3875)
@@ -163,10 +163,17 @@
       INTEGER            ::   jk       ! dummy loop indice
       INTEGER            ::   ierror   ! local integer
+      INTEGER            ::   ios      ! Local integer output status for namelist read
       !!
       NAMELIST/namhsb/ ln_diahsb
       !!----------------------------------------------------------------------
       !
-      REWIND ( numnam )              ! Read Namelist namhsb 
-      READ   ( numnam, namhsb )
+      REWIND( numnam_ref )              ! Namelist namhsb in reference namelist : Heat & salt budget
+      READ  ( numnam_ref, namhsb, IOSTAT = ios, ERR = 901)
+901   IF( ios /= 0 ) CALL ctl_nam ( ios , 'namhsb in reference namelist', lwp )
+
+      REWIND( numnam_cfg )              ! Namelist namhsb in configuration namelist : Heat & salt budget
+      READ  ( numnam_cfg, namhsb, IOSTAT = ios, ERR = 902 )
+902   IF( ios /= 0 ) CALL ctl_nam ( ios , 'namhsb in configuration namelist', lwp )
+      WRITE ( numond, namhsb )
       !
       IF(lwp) THEN                   ! Control print
Index: branches/2013/dev_r3853_CNRS9_ConfSetting/NEMOGCM/NEMO/OPA_SRC/DIA/diaptr.F90
===================================================================
--- branches/2013/dev_r3853_CNRS9_ConfSetting/NEMOGCM/NEMO/OPA_SRC/DIA/diaptr.F90	(revision 3854)
+++ branches/2013/dev_r3853_CNRS9_ConfSetting/NEMOGCM/NEMO/OPA_SRC/DIA/diaptr.F90	(revision 3875)
@@ -449,4 +449,5 @@
       INTEGER ::   jn           ! dummy loop indices 
       INTEGER ::   inum, ierr   ! local integers
+      INTEGER ::   ios          ! Local integer output status for namelist read
 #if defined key_mpp_mpi
       INTEGER, DIMENSION(1) :: iglo, iloc, iabsf, iabsl, ihals, ihale, idid
@@ -456,6 +457,12 @@
       !!----------------------------------------------------------------------
 
-      REWIND( numnam )                 ! Read Namelist namptr : poleward transport parameters
-      READ  ( numnam, namptr )
+      REWIND( numnam_ref )              ! Namelist namptr in reference namelist : Poleward transport
+      READ  ( numnam_ref, namptr, IOSTAT = ios, ERR = 901)
+901   IF( ios /= 0 ) CALL ctl_nam ( ios , 'namptr in reference namelist', lwp )
+
+      REWIND( numnam_cfg )              ! Namelist namptr in configuration namelist : Poleward transport
+      READ  ( numnam_cfg, namptr, IOSTAT = ios, ERR = 902 )
+902   IF( ios /= 0 ) CALL ctl_nam ( ios , 'namptr in configuration namelist', lwp )
+      WRITE ( numond, namptr )
 
       IF(lwp) THEN                     ! Control print
Index: branches/2013/dev_r3853_CNRS9_ConfSetting/NEMOGCM/NEMO/OPA_SRC/DOM/domain.F90
===================================================================
--- branches/2013/dev_r3853_CNRS9_ConfSetting/NEMOGCM/NEMO/OPA_SRC/DOM/domain.F90	(revision 3854)
+++ branches/2013/dev_r3853_CNRS9_ConfSetting/NEMOGCM/NEMO/OPA_SRC/DOM/domain.F90	(revision 3875)
@@ -131,8 +131,15 @@
       NAMELIST/namnc4/ nn_nchunks_i, nn_nchunks_j, nn_nchunks_k, ln_nc4zip
 #endif
-      !!----------------------------------------------------------------------
-
-      REWIND( numnam )              ! Namelist namrun : parameters of the run
-      READ  ( numnam, namrun )
+      INTEGER  ::   ios                 ! Local integer output status for namelist read
+      !!----------------------------------------------------------------------
+
+      REWIND( numnam_ref )              ! Namelist namrun in reference namelist : Parameters of the run
+      READ  ( numnam_ref, namrun, IOSTAT = ios, ERR = 901)
+901   IF( ios /= 0 ) CALL ctl_nam ( ios , 'namrun in reference namelist', lwp )
+
+      REWIND( numnam_cfg )              ! Namelist namrun in configuration namelist : Parameters of the run
+      READ  ( numnam_cfg, namrun, IOSTAT = ios, ERR = 902 )
+902   IF( ios /= 0 ) CALL ctl_nam ( ios , 'namrun in configuration namelist', lwp )
+      WRITE ( numond, namrun )
       !
       IF(lwp) THEN                  ! control print
@@ -200,6 +207,12 @@
 #endif
 
-      REWIND( numnam )              ! Namelist namdom : space & time domain (bathymetry, mesh, timestep)
-      READ  ( numnam, namdom )
+      REWIND( numnam_ref )              ! Namelist namdom in reference namelist : space & time domain (bathymetry, mesh, timestep)
+      READ  ( numnam_ref, namdom, IOSTAT = ios, ERR = 903)
+903   IF( ios /= 0 ) CALL ctl_nam ( ios , 'namdom in reference namelist', lwp )
+
+      REWIND( numnam_cfg )              ! Namelist namdom in configuration namelist : space & time domain (bathymetry, mesh, timestep)
+      READ  ( numnam_cfg, namdom, IOSTAT = ios, ERR = 904 )
+904   IF( ios /= 0 ) CALL ctl_nam ( ios , 'namdom in configuration namelist', lwp )
+      WRITE ( numond, namdom )
 
       IF(lwp) THEN
@@ -237,6 +250,13 @@
       rdth      = rn_rdth
 
-      REWIND( numnam )              ! Namelist cross land advection
-      READ  ( numnam, namcla )
+      REWIND( numnam_ref )              ! Namelist namcla in reference namelist : Cross land advection
+      READ  ( numnam_ref, namcla, IOSTAT = ios, ERR = 905)
+905   IF( ios /= 0 ) CALL ctl_nam ( ios , 'namcla in reference namelist', lwp )
+
+      REWIND( numnam_cfg )              ! Namelist namcla in configuration namelist : Cross land advection
+      READ  ( numnam_cfg, namcla, IOSTAT = ios, ERR = 906 )
+906   IF( ios /= 0 ) CALL ctl_nam ( ios , 'namcla in configuration namelist', lwp )
+      WRITE( numond, namcla )
+
       IF(lwp) THEN
          WRITE(numout,*)
@@ -247,6 +267,13 @@
 #if defined key_netcdf4
       !                             ! NetCDF 4 case   ("key_netcdf4" defined)
-      REWIND( numnam )                    ! Namelist namnc4 : netcdf4 chunking parameters
-      READ  ( numnam, namnc4 )
+      REWIND( numnam_ref )              ! Namelist namnc4 in reference namelist : NETCDF
+      READ  ( numnam_ref, namnc4, IOSTAT = ios, ERR = 907)
+907   IF( ios /= 0 ) CALL ctl_nam ( ios , 'namnc4 in reference namelist', lwp )
+
+      REWIND( numnam_cfg )              ! Namelist namnc4 in configuration namelist : NETCDF
+      READ  ( numnam_cfg, namnc4, IOSTAT = ios, ERR = 908 )
+908   IF( ios /= 0 ) CALL ctl_nam ( ios , 'namnc4 in configuration namelist', lwp )
+      WRITE( numond, namnc4 )
+
       IF(lwp) THEN                        ! control print
          WRITE(numout,*)
Index: branches/2013/dev_r3853_CNRS9_ConfSetting/NEMOGCM/NEMO/OPA_SRC/DOM/dommsk.F90
===================================================================
--- branches/2013/dev_r3853_CNRS9_ConfSetting/NEMOGCM/NEMO/OPA_SRC/DOM/dommsk.F90	(revision 3854)
+++ branches/2013/dev_r3853_CNRS9_ConfSetting/NEMOGCM/NEMO/OPA_SRC/DOM/dommsk.F90	(revision 3875)
@@ -133,4 +133,5 @@
       INTEGER  ::   iif, iil, ii0, ii1, ii   ! local integers
       INTEGER  ::   ijf, ijl, ij0, ij1       !   -       -
+      INTEGER  ::   ios
       INTEGER , POINTER, DIMENSION(:,:) ::  imsk
       REAL(wp), POINTER, DIMENSION(:,:) ::  zwf
@@ -144,6 +145,12 @@
       CALL wrk_alloc( jpi, jpj, zwf  )
       !
-      REWIND( numnam )              ! Namelist namlbc : lateral momentum boundary condition
-      READ  ( numnam, namlbc )
+      REWIND( numnam_ref )              ! Namelist namlbc in reference namelist : Lateral momentum boundary condition
+      READ  ( numnam_ref, namlbc, IOSTAT = ios, ERR = 901 )
+901   IF( ios /= 0 ) CALL ctl_nam ( ios , 'namlbc in reference namelist', lwp )
+
+      REWIND( numnam_cfg )              ! Namelist namlbc in configuration namelist : Lateral momentum boundary condition
+      READ  ( numnam_cfg, namlbc, IOSTAT = ios, ERR = 902 )
+902   IF( ios /= 0 ) CALL ctl_nam ( ios , 'namlbc in configuration namelist', lwp )
+      WRITE ( numond, namlbc )
       
       IF(lwp) THEN                  ! control print
Index: branches/2013/dev_r3853_CNRS9_ConfSetting/NEMOGCM/NEMO/OPA_SRC/DOM/domzgr.F90
===================================================================
--- branches/2013/dev_r3853_CNRS9_ConfSetting/NEMOGCM/NEMO/OPA_SRC/DOM/domzgr.F90	(revision 3854)
+++ branches/2013/dev_r3853_CNRS9_ConfSetting/NEMOGCM/NEMO/OPA_SRC/DOM/domzgr.F90	(revision 3875)
@@ -99,4 +99,5 @@
       !!----------------------------------------------------------------------
       INTEGER ::   ioptio, ibat   ! local integer
+      INTEGER ::   ios
       !
       NAMELIST/namzgr/ ln_zco, ln_zps, ln_sco
@@ -105,6 +106,12 @@
       IF( nn_timing == 1 )   CALL timing_start('dom_zgr')
       !
-      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) THEN                     ! Control print
@@ -1100,4 +1107,5 @@
       INTEGER  ::   ji, jj, jk, jl           ! dummy loop argument
       INTEGER  ::   iip1, ijp1, iim1, ijm1   ! temporary integers
+      INTEGER  ::   ios                      ! Local integer output status for namelist read
       REAL(wp) ::   zrmax, ztaper   ! temporary scalars
       !
@@ -1112,10 +1120,16 @@
       CALL wrk_alloc( jpi, jpj,      zenv, ztmp, zmsk, zri, zrj, zhbat                           )
       !
-      REWIND( numnam )                       ! Read Namelist namzgr_sco : sigma-stretching parameters
-      READ  ( numnam, namzgr_sco )
+      REWIND( numnam_ref )              ! Namelist namzgr_sco in reference namelist : Sigma-stretching parameters
+      READ  ( numnam_ref, namzgr_sco, IOSTAT = ios, ERR = 901)
+901   IF( ios /= 0 ) CALL ctl_nam ( ios , 'namzgr_sco in reference namelist', lwp )
+
+      REWIND( numnam_cfg )              ! Namelist namzgr_sco in configuration namelist : Sigma-stretching parameters
+      READ  ( numnam_cfg, namzgr_sco, IOSTAT = ios, ERR = 902 )
+902   IF( ios /= 0 ) CALL ctl_nam ( ios , 'namzgr_sco in configuration namelist', lwp )
+      WRITE ( numond, namzgr_sco )
 
       IF(lwp) THEN                           ! control print
          WRITE(numout,*)
-         WRITE(numout,*) 'dom:zgr_sco : s-coordinate or hybrid z-s-coordinate'
+         WRITE(numout,*) 'domzgr_sco : s-coordinate or hybrid z-s-coordinate'
          WRITE(numout,*) '~~~~~~~~~~~'
          WRITE(numout,*) '   Namelist namzgr_sco'
Index: branches/2013/dev_r3853_CNRS9_ConfSetting/NEMOGCM/NEMO/OPA_SRC/DOM/dtatsd.F90
===================================================================
--- branches/2013/dev_r3853_CNRS9_ConfSetting/NEMOGCM/NEMO/OPA_SRC/DOM/dtatsd.F90	(revision 3854)
+++ branches/2013/dev_r3853_CNRS9_ConfSetting/NEMOGCM/NEMO/OPA_SRC/DOM/dtatsd.F90	(revision 3875)
@@ -62,4 +62,5 @@
       !!
       NAMELIST/namtsd/   ln_tsd_init, ln_tsd_tradmp, cn_dir, sn_tem, sn_sal
+      INTEGER  ::   ios
       !!----------------------------------------------------------------------
       !
@@ -76,7 +77,13 @@
       sn_tem = FLD_N( 'temperature',  -1.  , 'votemper',  .false.   , .true.  ,  'monthly'  , ''       , ''       )
       sn_sal = FLD_N( 'salinity'   ,  -1.  , 'vosaline',  .false.   , .true.  ,  'monthly'  , ''       , ''       )
-
-      REWIND( numnam )              ! read in namlist namdta_tsd 
-      READ  ( numnam, namtsd ) 
+ 
+      REWIND( numnam_ref )              ! Namelist namtsd in reference namelist : 
+      READ  ( numnam_ref, namtsd, IOSTAT = ios, ERR = 901)
+901   IF( ios /= 0 ) CALL ctl_nam ( ios , 'namtsd in reference namelist', lwp )
+
+      REWIND( numnam_cfg )              ! Namelist namtsd in configuration namelist : Parameters of the run
+      READ  ( numnam_cfg, namtsd, IOSTAT = ios, ERR = 902 )
+902   IF( ios /= 0 ) CALL ctl_nam ( ios , 'namtsd in configuration namelist', lwp )
+      WRITE ( numond, namtsd )
 
       IF( PRESENT( ld_tradmp ) )   ln_tsd_tradmp = .TRUE.     ! forces the initialization when tradmp is used
Index: branches/2013/dev_r3853_CNRS9_ConfSetting/NEMOGCM/NEMO/OPA_SRC/DYN/dynadv.F90
===================================================================
--- branches/2013/dev_r3853_CNRS9_ConfSetting/NEMOGCM/NEMO/OPA_SRC/DYN/dynadv.F90	(revision 3854)
+++ branches/2013/dev_r3853_CNRS9_ConfSetting/NEMOGCM/NEMO/OPA_SRC/DYN/dynadv.F90	(revision 3875)
@@ -89,10 +89,17 @@
       !!----------------------------------------------------------------------
       INTEGER ::   ioptio
+      INTEGER  ::   ios                 ! Local integer output status for namelist read
       !!
       NAMELIST/namdyn_adv/ ln_dynadv_vec, ln_dynadv_cen2 , ln_dynadv_ubs
       !!----------------------------------------------------------------------
 
-      REWIND ( numnam )               ! Read Namelist namdyn_adv : momentum advection scheme
-      READ   ( numnam, namdyn_adv )
+      REWIND( numnam_ref )              ! Namelist namdyn_adv in reference namelist : Momentum advection scheme
+      READ  ( numnam_ref, namdyn_adv, IOSTAT = ios, ERR = 901)
+901   IF( ios /= 0 ) CALL ctl_nam ( ios , 'namdyn_adv in reference namelist', lwp )
+
+      REWIND( numnam_cfg )              ! Namelist namdyn_adv in configuration namelist : Momentum advection scheme
+      READ  ( numnam_cfg, namdyn_adv, IOSTAT = ios, ERR = 902 )
+902   IF( ios /= 0 ) CALL ctl_nam ( ios , 'namdyn_adv in configuration namelist', lwp )
+      WRITE ( numond, namdyn_adv )
 
       IF(lwp) THEN                    ! Namelist print
Index: branches/2013/dev_r3853_CNRS9_ConfSetting/NEMOGCM/NEMO/OPA_SRC/DYN/dynhpg.F90
===================================================================
--- branches/2013/dev_r3853_CNRS9_ConfSetting/NEMOGCM/NEMO/OPA_SRC/DYN/dynhpg.F90	(revision 3854)
+++ branches/2013/dev_r3853_CNRS9_ConfSetting/NEMOGCM/NEMO/OPA_SRC/DYN/dynhpg.F90	(revision 3875)
@@ -122,4 +122,5 @@
       !!----------------------------------------------------------------------
       INTEGER ::   ioptio = 0      ! temporary integer
+      INTEGER ::   ios             ! Local integer output status for namelist read
       !!
       NAMELIST/namdyn_hpg/ ln_hpg_zco, ln_hpg_zps, ln_hpg_sco,     &
@@ -127,6 +128,12 @@
       !!----------------------------------------------------------------------
       !
-      REWIND( numnam )               ! Read Namelist namdyn_hpg
-      READ  ( numnam, namdyn_hpg )
+      REWIND( numnam_ref )              ! Namelist namdyn_hpg in reference namelist : Hydrostatic pressure gradient
+      READ  ( numnam_ref, namdyn_hpg, IOSTAT = ios, ERR = 901)
+901   IF( ios /= 0 ) CALL ctl_nam ( ios , 'namdyn_hpg in reference namelist', lwp )
+
+      REWIND( numnam_cfg )              ! Namelist namdyn_hpg in configuration namelist : Hydrostatic pressure gradient
+      READ  ( numnam_cfg, namdyn_hpg, IOSTAT = ios, ERR = 902 )
+902   IF( ios /= 0 ) CALL ctl_nam ( ios , 'namdyn_hpg in configuration namelist', lwp )
+      WRITE ( numond, namdyn_hpg )
       !
       IF(lwp) THEN                   ! Control print
Index: branches/2013/dev_r3853_CNRS9_ConfSetting/NEMOGCM/NEMO/OPA_SRC/DYN/dynnept.F90
===================================================================
--- branches/2013/dev_r3853_CNRS9_ConfSetting/NEMOGCM/NEMO/OPA_SRC/DYN/dynnept.F90	(revision 3854)
+++ branches/2013/dev_r3853_CNRS9_ConfSetting/NEMOGCM/NEMO/OPA_SRC/DYN/dynnept.F90	(revision 3875)
@@ -114,10 +114,17 @@
       NAMELIST/namdyn_nept/ ln_neptsimp, ln_smooth_neptvel, rn_tslse, rn_tslsp,      &
                             ln_neptramp, rn_htrmin, rn_htrmax
+      INTEGER  ::   ios
       !!----------------------------------------------------------------------
       ! Define the (simplified) Neptune parameters
       ! ==========================================
 
-      REWIND( numnam )                  ! Read Namelist namdyn_nept:  Simplified Neptune
-      READ  ( numnam, namdyn_nept )
+      REWIND( numnam_ref )              ! Namelist namdyn_nept in reference namelist : Simplified Neptune
+      READ  ( numnam_ref, namdyn_nept, IOSTAT = ios, ERR = 901)
+901   IF( ios /= 0 ) CALL ctl_nam ( ios , 'namdyn_nept in reference namelist', lwp )
+
+      REWIND( numnam_cfg )              ! Namelist namdyn_nept in reference namelist : Simplified Neptune
+      READ  ( numnam_cfg, namdyn_nept, IOSTAT = ios, ERR = 902 )
+902   IF( ios /= 0 ) CALL ctl_nam ( ios , 'namdyn_nept in configuration namelist', lwp )
+      WRITE ( numond, namdyn_nept )
 
       IF(lwp) THEN                      ! Control print
Index: branches/2013/dev_r3853_CNRS9_ConfSetting/NEMOGCM/NEMO/OPA_SRC/DYN/dynvor.F90
===================================================================
--- branches/2013/dev_r3853_CNRS9_ConfSetting/NEMOGCM/NEMO/OPA_SRC/DYN/dynvor.F90	(revision 3854)
+++ branches/2013/dev_r3853_CNRS9_ConfSetting/NEMOGCM/NEMO/OPA_SRC/DYN/dynvor.F90	(revision 3875)
@@ -710,10 +710,17 @@
       INTEGER ::   ioptio          ! local integer
       INTEGER ::   ji, jj, jk      ! dummy loop indices
+      INTEGER ::   ios             ! Local integer output status for namelist read
       !!
       NAMELIST/namdyn_vor/ ln_dynvor_ens, ln_dynvor_ene, ln_dynvor_mix, ln_dynvor_een
       !!----------------------------------------------------------------------
 
-      REWIND ( numnam )               ! Read Namelist namdyn_vor : Vorticity scheme options
-      READ   ( numnam, namdyn_vor )
+      REWIND( numnam_ref )              ! Namelist namdyn_vor in reference namelist : Vorticity scheme options
+      READ  ( numnam_ref, namdyn_vor, IOSTAT = ios, ERR = 901)
+901   IF( ios /= 0 ) CALL ctl_nam ( ios , 'namdyn_vor in reference namelist', lwp )
+
+      REWIND( numnam_cfg )              ! Namelist namdyn_vor in configuration namelist : Vorticity scheme options
+      READ  ( numnam_cfg, namdyn_vor, IOSTAT = ios, ERR = 902 )
+902   IF( ios /= 0 ) CALL ctl_nam ( ios , 'namdyn_vor in configuration namelist', lwp )
+      WRITE ( numond, namdyn_vor )
 
       IF(lwp) THEN                    ! Namelist print
@@ -721,5 +728,5 @@
          WRITE(numout,*) 'dyn_vor_init : vorticity term : read namelist and control the consistency'
          WRITE(numout,*) '~~~~~~~~~~~~'
-         WRITE(numout,*) '        Namelist namdyn_vor : oice of the vorticity term scheme'
+         WRITE(numout,*) '        Namelist namdyn_vor : choice of the vorticity term scheme'
          WRITE(numout,*) '           energy    conserving scheme                ln_dynvor_ene = ', ln_dynvor_ene
          WRITE(numout,*) '           enstrophy conserving scheme                ln_dynvor_ens = ', ln_dynvor_ens
Index: branches/2013/dev_r3853_CNRS9_ConfSetting/NEMOGCM/NEMO/OPA_SRC/FLO/floats.F90
===================================================================
--- branches/2013/dev_r3853_CNRS9_ConfSetting/NEMOGCM/NEMO/OPA_SRC/FLO/floats.F90	(revision 3854)
+++ branches/2013/dev_r3853_CNRS9_ConfSetting/NEMOGCM/NEMO/OPA_SRC/FLO/floats.F90	(revision 3875)
@@ -78,4 +78,5 @@
       !!----------------------------------------------------------------------
       INTEGER :: jfl
+      INTEGER :: ios                 ! Local integer output status for namelist read
       !
       NAMELIST/namflo/ jpnfl, jpnnewflo, ln_rstflo, nn_writefl, nn_stockfl, ln_argo, ln_flork4, ln_ariane, ln_flo_ascii
@@ -88,6 +89,12 @@
       IF(lwp) WRITE(numout,*) '~~~~~~~'
 
-      REWIND( numnam )              ! Namelist namflo : floats
-      READ  ( numnam, namflo )
+      REWIND( numnam_ref )              ! Namelist namflo in reference namelist : Floats
+      READ  ( numnam_ref, namflo, IOSTAT = ios, ERR = 901)
+901   IF( ios /= 0 ) CALL ctl_nam ( ios , 'namflo in reference namelist', lwp )
+
+      REWIND( numnam_cfg )              ! Namelist namflo in configuration namelist : Floats
+      READ  ( numnam_cfg, namflo, IOSTAT = ios, ERR = 902 )
+902   IF( ios /= 0 ) CALL ctl_nam ( ios , 'namflo in configuration namelist', lwp )
+      WRITE ( numond, namflo )
       !
       IF(lwp) THEN                  ! control print
Index: branches/2013/dev_r3853_CNRS9_ConfSetting/NEMOGCM/NEMO/OPA_SRC/ICB/icbini.F90
===================================================================
--- branches/2013/dev_r3853_CNRS9_ConfSetting/NEMOGCM/NEMO/OPA_SRC/ICB/icbini.F90	(revision 3854)
+++ branches/2013/dev_r3853_CNRS9_ConfSetting/NEMOGCM/NEMO/OPA_SRC/ICB/icbini.F90	(revision 3875)
@@ -344,4 +344,5 @@
       !!----------------------------------------------------------------------
       INTEGER  ::   jn      ! dummy loop indices
+      INTEGER  ::   ios     ! Local integer output status for namelist read
       REAL(wp) ::   zfact   ! local scalar
       !
@@ -359,11 +360,17 @@
       sn_icb = FLD_N( 'calving' ,    -1     , 'calving'  ,  .TRUE.    , .TRUE. ,   'yearly'  , ''       , ''         )
 
-      REWIND( numnam )              ! Namelist namrun : iceberg parameters
-      READ  ( numnam, namberg )
+      REWIND( numnam_ref )              ! Namelist namberg in reference namelist : Iceberg parameters
+      READ  ( numnam_ref, namberg, IOSTAT = ios, ERR = 901)
+901   IF( ios /= 0 ) CALL ctl_nam ( ios , 'namberg in reference namelist', lwp )
+
+      REWIND( numnam_cfg )              ! Namelist namberg in configuration namelist : Iceberg parameters
+      READ  ( numnam_cfg, namberg, IOSTAT = ios, ERR = 902 )
+902   IF( ios /= 0 ) CALL ctl_nam ( ios , 'namberg in configuration namelist', lwp )
+      WRITE ( numond, namberg )
       
       IF( .NOT. ln_icebergs ) THEN   ! no icebergs
          IF(lwp) THEN
             WRITE(numout,*)
-            WRITE(numout,*) 'icb_nam :   ln_icebergs = F , NO icebergs used'
+            WRITE(numout,*) 'icbini :   Namelist namberg ln_icebergs = F , NO icebergs used'
             WRITE(numout,*) '~~~~~~~~ '
          ENDIF
Index: branches/2013/dev_r3853_CNRS9_ConfSetting/NEMOGCM/NEMO/OPA_SRC/IOM/in_out_manager.F90
===================================================================
--- branches/2013/dev_r3853_CNRS9_ConfSetting/NEMOGCM/NEMO/OPA_SRC/IOM/in_out_manager.F90	(revision 3854)
+++ branches/2013/dev_r3853_CNRS9_ConfSetting/NEMOGCM/NEMO/OPA_SRC/IOM/in_out_manager.F90	(revision 3875)
@@ -107,17 +107,21 @@
    !!                        logical units
    !!----------------------------------------------------------------------
-   INTEGER ::   numstp      =   -1      !: logical unit for time step
-   INTEGER ::   numtime     =   -1      !: logical unit for timing
-   INTEGER ::   numout      =    6      !: logical unit for output print
-   INTEGER ::   numnam      =   -1      !: logical unit for namelist
-   INTEGER ::   numnam_ice  =   -1      !: logical unit for ice namelist
-   INTEGER ::   numevo_ice  =   -1      !: logical unit for ice variables (temp. evolution)
-   INTEGER ::   numsol      =   -1      !: logical unit for solver statistics
-   INTEGER ::   numdct_in   =   -1      !: logical unit for transports computing
-   INTEGER ::   numdct_vol  =   -1      !: logical unit for voulume transports output
-   INTEGER ::   numdct_heat =   -1      !: logical unit for heat    transports output
-   INTEGER ::   numdct_salt =   -1      !: logical unit for salt    transports output
-   INTEGER ::   numfl      =   -1      !: logical unit for floats ascii output
-   INTEGER ::   numflo     =   -1      !: logical unit for floats ascii output
+   INTEGER ::   numstp          =   -1      !: logical unit for time step
+   INTEGER ::   numtime         =   -1      !: logical unit for timing
+   INTEGER ::   numout          =    6      !: logical unit for output print
+   INTEGER ::   numnam_ref      =   -1      !: logical unit for reference namelist
+   INTEGER ::   numnam_cfg      =   -1      !: logical unit for configuration specific namelist
+   INTEGER ::   numond          =    7      !: logical unit for Output Namelist Dynamics
+   INTEGER ::   numnam_ice_ref  =   -1      !: logical unit for ice reference namelist
+   INTEGER ::   numnam_ice_cfg  =   -1      !: logical unit for ice reference namelist
+   INTEGER ::   numoni          =    8      !: logical unit for Output Namelist Ice
+   INTEGER ::   numevo_ice      =   -1      !: logical unit for ice variables (temp. evolution)
+   INTEGER ::   numsol          =   -1      !: logical unit for solver statistics
+   INTEGER ::   numdct_in       =   -1      !: logical unit for transports computing
+   INTEGER ::   numdct_vol      =   -1      !: logical unit for voulume transports output
+   INTEGER ::   numdct_heat     =   -1      !: logical unit for heat    transports output
+   INTEGER ::   numdct_salt     =   -1      !: logical unit for salt    transports output
+   INTEGER ::   numfl           =   -1      !: logical unit for floats ascii output
+   INTEGER ::   numflo          =   -1      !: logical unit for floats ascii output
 
    !!----------------------------------------------------------------------
Index: branches/2013/dev_r3853_CNRS9_ConfSetting/NEMOGCM/NEMO/OPA_SRC/IOM/restart.F90
===================================================================
--- branches/2013/dev_r3853_CNRS9_ConfSetting/NEMOGCM/NEMO/OPA_SRC/IOM/restart.F90	(revision 3854)
+++ branches/2013/dev_r3853_CNRS9_ConfSetting/NEMOGCM/NEMO/OPA_SRC/IOM/restart.F90	(revision 3875)
@@ -156,5 +156,5 @@
          WRITE(numout,*)
          SELECT CASE ( jprstlib )
-         CASE ( jpnf90    )   ;   WRITE(numout,*) 'rst_read : read oce NetCDF restart file'
+         CASE ( jpnf90    )   ;   WRITE(numout,*) 'rst_read : read oce NetCDF restart file ',TRIM(cn_ocerst_in)//'.nc'
          CASE ( jprstdimg )   ;   WRITE(numout,*) 'rst_read : read oce binary restart file'
          END SELECT
Index: branches/2013/dev_r3853_CNRS9_ConfSetting/NEMOGCM/NEMO/OPA_SRC/LBC/lib_mpp.F90
===================================================================
--- branches/2013/dev_r3853_CNRS9_ConfSetting/NEMOGCM/NEMO/OPA_SRC/LBC/lib_mpp.F90	(revision 3854)
+++ branches/2013/dev_r3853_CNRS9_ConfSetting/NEMOGCM/NEMO/OPA_SRC/LBC/lib_mpp.F90	(revision 3875)
@@ -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
@@ -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
       !
@@ -248,6 +251,14 @@
       !
       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
@@ -3455,8 +3466,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 +3648,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 +3791,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_r3853_CNRS9_ConfSetting/NEMOGCM/NEMO/OPA_SRC/LBC/mppini_2.h90
===================================================================
--- branches/2013/dev_r3853_CNRS9_ConfSetting/NEMOGCM/NEMO/OPA_SRC/LBC/mppini_2.h90	(revision 3854)
+++ branches/2013/dev_r3853_CNRS9_ConfSetting/NEMOGCM/NEMO/OPA_SRC/LBC/mppini_2.h90	(revision 3875)
@@ -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,*)
Index: branches/2013/dev_r3853_CNRS9_ConfSetting/NEMOGCM/NEMO/OPA_SRC/LDF/ldfdyn.F90
===================================================================
--- branches/2013/dev_r3853_CNRS9_ConfSetting/NEMOGCM/NEMO/OPA_SRC/LDF/ldfdyn.F90	(revision 3854)
+++ branches/2013/dev_r3853_CNRS9_ConfSetting/NEMOGCM/NEMO/OPA_SRC/LDF/ldfdyn.F90	(revision 3875)
@@ -63,4 +63,5 @@
       !!----------------------------------------------------------------------
       INTEGER ::   ioptio         ! ???
+      INTEGER ::   ios            ! Local : output status for namelist read
       LOGICAL ::   ll_print = .FALSE.    ! Logical flag for printing viscosity coef.
       !! 
@@ -73,6 +74,12 @@
    !!----------------------------------------------------------------------
 
-      REWIND( numnam )                  ! Read Namelist namdyn_ldf : Lateral physics
-      READ  ( numnam, namdyn_ldf )
+      REWIND( numnam_ref )              ! Namelist namdyn_ldf in reference namelist : Lateral physics
+      READ  ( numnam_ref, namdyn_ldf, IOSTAT = ios, ERR = 901)
+901   IF( ios /= 0 ) CALL ctl_nam ( ios , 'namdyn_ldf in reference namelist', lwp )
+
+      REWIND( numnam_cfg )              ! Namelist namdyn_ldf in configuration namelist : Lateral physics
+      READ  ( numnam_cfg, namdyn_ldf, IOSTAT = ios, ERR = 902 )
+902   IF( ios /= 0 ) CALL ctl_nam ( ios , 'namdyn_ldf in configuration namelist', lwp )
+      WRITE ( numond, namdyn_ldf )
 
       IF(lwp) THEN                      ! Parameter print
@@ -80,5 +87,5 @@
          WRITE(numout,*) 'ldf_dyn : lateral momentum physics'
          WRITE(numout,*) '~~~~~~~'
-         WRITE(numout,*) '   Namelist nam_dynldf : set lateral mixing parameters'
+         WRITE(numout,*) '   Namelist namdyn_ldf : set lateral mixing parameters'
          WRITE(numout,*) '      laplacian operator                      ln_dynldf_lap   = ', ln_dynldf_lap
          WRITE(numout,*) '      bilaplacian operator                    ln_dynldf_bilap = ', ln_dynldf_bilap
Index: branches/2013/dev_r3853_CNRS9_ConfSetting/NEMOGCM/NEMO/OPA_SRC/LDF/ldftra.F90
===================================================================
--- branches/2013/dev_r3853_CNRS9_ConfSetting/NEMOGCM/NEMO/OPA_SRC/LDF/ldftra.F90	(revision 3854)
+++ branches/2013/dev_r3853_CNRS9_ConfSetting/NEMOGCM/NEMO/OPA_SRC/LDF/ldftra.F90	(revision 3875)
@@ -62,4 +62,5 @@
       !!----------------------------------------------------------------------
       INTEGER ::   ioptio               ! temporary integer
+      INTEGER ::   ios                  ! temporary integer
       LOGICAL ::   ll_print = .FALSE.   ! =T print eddy coef. in numout
       !! 
@@ -76,6 +77,13 @@
       ! =============================================
     
-      REWIND( numnam )                  ! Read Namelist namtra_ldf : Lateral physics on tracers
-      READ  ( numnam, namtra_ldf )
+
+      REWIND( numnam_ref )              ! Namelist namtra_ldf in reference namelist : Lateral physics on tracers
+      READ  ( numnam_ref, namtra_ldf, IOSTAT = ios, ERR = 901)
+901   IF( ios /= 0 ) CALL ctl_nam ( ios , 'namtra_ldf in reference namelist', lwp )
+
+      REWIND( numnam_cfg )              ! Namelist namtra_ldf in configuration namelist : Lateral physics on tracers
+      READ  ( numnam_cfg, namtra_ldf, IOSTAT = ios, ERR = 902 )
+902   IF( ios /= 0 ) CALL ctl_nam ( ios , 'namtra_ldf in configuration namelist', lwp )
+      WRITE ( numond, namtra_ldf )
 
       IF(lwp) THEN                      ! control print
Index: branches/2013/dev_r3853_CNRS9_ConfSetting/NEMOGCM/NEMO/OPA_SRC/OBC/obcini.F90
===================================================================
--- branches/2013/dev_r3853_CNRS9_ConfSetting/NEMOGCM/NEMO/OPA_SRC/OBC/obcini.F90	(revision 3854)
+++ branches/2013/dev_r3853_CNRS9_ConfSetting/NEMOGCM/NEMO/OPA_SRC/OBC/obcini.F90	(revision 3875)
@@ -57,4 +57,5 @@
       !!
       INTEGER  ::   ji, jj, istop , inumfbc
+      INTEGER  ::   ios                     ! Local integer output status for namelist read
       INTEGER, DIMENSION(4) ::   icorner
       REAL(wp), DIMENSION(2) ::   ztestmask
@@ -66,6 +67,12 @@
       !!----------------------------------------------------------------------
 
-      REWIND( numnam )              ! Namelist namobc : open boundaries
-      READ  ( numnam, namobc )
+      REWIND( numnam_ref )              ! Namelist namobc in reference namelist : Open boundaries
+      READ  ( numnam_ref, namobc, IOSTAT = ios, ERR = 901)
+901   IF( ios /= 0 ) CALL ctl_nam ( ios , 'namobc in reference namelist', lwp )
+
+      REWIND( numnam_cfg )              ! Namelist namobc in configuration namelist : Open boundaries
+      READ  ( numnam_cfg, namobc, IOSTAT = ios, ERR = 902 )
+902   IF( ios /= 0 ) CALL ctl_nam ( ios , 'namobc in configuration namelist', lwp )
+      WRITE ( numond, namobc )
 
       ! convert DOCTOR namelist name into the OLD names
Index: branches/2013/dev_r3853_CNRS9_ConfSetting/NEMOGCM/NEMO/OPA_SRC/OBS/diaobs.F90
===================================================================
--- branches/2013/dev_r3853_CNRS9_ConfSetting/NEMOGCM/NEMO/OPA_SRC/OBS/diaobs.F90	(revision 3854)
+++ branches/2013/dev_r3853_CNRS9_ConfSetting/NEMOGCM/NEMO/OPA_SRC/OBS/diaobs.F90	(revision 3875)
@@ -197,4 +197,5 @@
       INTEGER :: ji
       INTEGER :: jset
+      INTEGER :: ios                 ! Local integer output status for namelist read
       LOGICAL :: lmask(MaxNumFiles), ll_u3d, ll_v3d
 
@@ -262,6 +263,12 @@
 
       ! Read Namelist namobs : control observation diagnostics
-      REWIND( numnam )
-      READ  ( numnam, namobs )
+      REWIND( numnam_ref )              ! Namelist namobs in reference namelist : Diagnostic: control observation
+      READ  ( numnam_ref, namobs, IOSTAT = ios, ERR = 901)
+901   IF( ios /= 0 ) CALL ctl_nam ( ios , 'namobs in reference namelist', lwp )
+
+      REWIND( numnam_cfg )              ! Namelist namobs in configuration namelist : Diagnostic: control observation
+      READ  ( numnam_cfg, namobs, IOSTAT = ios, ERR = 902 )
+902   IF( ios /= 0 ) CALL ctl_nam ( ios , 'namobs in configuration namelist', lwp )
+      WRITE ( numond, namobs )
 
       ! Count number of files for each type
Index: branches/2013/dev_r3853_CNRS9_ConfSetting/NEMOGCM/NEMO/OPA_SRC/SBC/albedo.F90
===================================================================
--- branches/2013/dev_r3853_CNRS9_ConfSetting/NEMOGCM/NEMO/OPA_SRC/SBC/albedo.F90	(revision 3854)
+++ branches/2013/dev_r3853_CNRS9_ConfSetting/NEMOGCM/NEMO/OPA_SRC/SBC/albedo.F90	(revision 3875)
@@ -199,4 +199,5 @@
       !! ** Method  :   Read the namelist namsbc_alb
       !!----------------------------------------------------------------------
+      INTEGER  ::   ios                 ! Local integer output status for namelist read
       NAMELIST/namsbc_alb/ rn_cloud, rn_albice, rn_alphd, rn_alphdi, rn_alphc
       !!----------------------------------------------------------------------
@@ -204,6 +205,12 @@
       albd_init = 1                     ! indicate that the initialization has been done
       !
-      REWIND( numnam )                  ! Read Namelist namsbc_alb : albedo parameters
-      READ  ( numnam, namsbc_alb )
+      REWIND( numnam_ref )              ! Namelist namsbc_alb in reference namelist : Albedo parameters
+      READ  ( numnam_ref, namsbc_alb, IOSTAT = ios, ERR = 901)
+901   IF( ios /= 0 ) CALL ctl_nam ( ios , 'namsbc_alb in reference namelist', lwp )
+
+      REWIND( numnam_cfg )              ! Namelist namsbc_alb in configuration namelist : Albedo parameters
+      READ  ( numnam_cfg, namsbc_alb, IOSTAT = ios, ERR = 902 )
+902   IF( ios /= 0 ) CALL ctl_nam ( ios , 'namsbc_alb in configuration namelist', lwp )
+      WRITE ( numond, namsbc_alb )
       !
       IF(lwp) THEN                      ! Control print
Index: branches/2013/dev_r3853_CNRS9_ConfSetting/NEMOGCM/NEMO/OPA_SRC/SBC/cyclone.F90
===================================================================
--- branches/2013/dev_r3853_CNRS9_ConfSetting/NEMOGCM/NEMO/OPA_SRC/SBC/cyclone.F90	(revision 3854)
+++ branches/2013/dev_r3853_CNRS9_ConfSetting/NEMOGCM/NEMO/OPA_SRC/SBC/cyclone.F90	(revision 3875)
@@ -103,7 +103,5 @@
          sn_tc = FLD_N( 'tc_track',     6     ,  'tc'     ,  .true.    , .false. ,   'yearly'  , ''       , ''         )
          !
-         !         REWIND( numnam )                    ! ... read in namlist namsbc_core
-         !         READ  ( numnam, namsbc_tc )
-         !
+         !  Namelist is read in namsbc_core
          ! set sf structure
          ALLOCATE( sf(1), STAT=ierror )
Index: branches/2013/dev_r3853_CNRS9_ConfSetting/NEMOGCM/NEMO/OPA_SRC/SBC/sbcana.F90
===================================================================
--- branches/2013/dev_r3853_CNRS9_ConfSetting/NEMOGCM/NEMO/OPA_SRC/SBC/sbcana.F90	(revision 3854)
+++ branches/2013/dev_r3853_CNRS9_ConfSetting/NEMOGCM/NEMO/OPA_SRC/SBC/sbcana.F90	(revision 3875)
@@ -64,4 +64,5 @@
       INTEGER, INTENT(in) ::   kt       ! ocean time step
       !
+      INTEGER  ::   ios                   ! Local integer output status for namelist read
       REAL(wp) ::   zfacto                ! local scalar
       REAL(wp) ::   zrhoa  = 1.22_wp      ! Air density kg/m3
@@ -74,6 +75,12 @@
       IF( kt == nit000 ) THEN
          !
-         REWIND( numnam )                    ! Read Namelist namsbc : surface fluxes
-         READ  ( numnam, namsbc_ana )
+         REWIND( numnam_ref )              ! Namelist namsbc_ana in reference namelist : Analytical surface fluxes
+         READ  ( numnam_ref, namsbc_ana, IOSTAT = ios, ERR = 901)
+901      IF( ios /= 0 ) CALL ctl_nam ( ios , 'namsbc_ana in reference namelist', lwp )
+
+         REWIND( numnam_cfg )              ! Namelist namsbc_ana in configuration namelist : Analytical surface fluxes
+         READ  ( numnam_cfg, namsbc_ana, IOSTAT = ios, ERR = 902 )
+902      IF( ios /= 0 ) CALL ctl_nam ( ios , 'namsbc_ana in configuration namelist', lwp )
+         WRITE ( numond, namsbc_ana )
          !
          IF(lwp) WRITE(numout,*)' '
Index: branches/2013/dev_r3853_CNRS9_ConfSetting/NEMOGCM/NEMO/OPA_SRC/SBC/sbcapr.F90
===================================================================
--- branches/2013/dev_r3853_CNRS9_ConfSetting/NEMOGCM/NEMO/OPA_SRC/SBC/sbcapr.F90	(revision 3854)
+++ branches/2013/dev_r3853_CNRS9_ConfSetting/NEMOGCM/NEMO/OPA_SRC/SBC/sbcapr.F90	(revision 3875)
@@ -65,4 +65,5 @@
       !!
       INTEGER            ::   ierror  ! local integer 
+      INTEGER            ::   ios     ! Local integer output status for namelist read
       !!
       CHARACTER(len=100) ::  cn_dir   ! Root directory for location of ssr files
@@ -83,6 +84,12 @@
          cn_dir  = './'          ! directory in which the Patm data are 
 
-         REWIND( numnam )                             !* read in namlist namsbc_apr
-         READ  ( numnam, namsbc_apr ) 
+         REWIND( numnam_ref )              ! Namelist namsbc_apr in reference namelist : File for atmospheric pressure forcing
+         READ  ( numnam_ref, namsbc_apr, IOSTAT = ios, ERR = 901)
+901      IF( ios /= 0 ) CALL ctl_nam ( ios , 'namsbc_apr in reference namelist', lwp )
+
+         REWIND( numnam_cfg )              ! Namelist namsbc_apr in configuration namelist : File for atmospheric pressure forcing
+         READ  ( numnam_cfg, namsbc_apr, IOSTAT = ios, ERR = 902 )
+902      IF( ios /= 0 ) CALL ctl_nam ( ios , 'namsbc_apr in configuration namelist', lwp )
+         WRITE ( numond, namsbc_apr )
          !
          ALLOCATE( sf_apr(1), STAT=ierror )           !* allocate and fill sf_sst (forcing structure) with sn_sst
Index: branches/2013/dev_r3853_CNRS9_ConfSetting/NEMOGCM/NEMO/OPA_SRC/SBC/sbcblk_clio.F90
===================================================================
--- branches/2013/dev_r3853_CNRS9_ConfSetting/NEMOGCM/NEMO/OPA_SRC/SBC/sbcblk_clio.F90	(revision 3854)
+++ branches/2013/dev_r3853_CNRS9_ConfSetting/NEMOGCM/NEMO/OPA_SRC/SBC/sbcblk_clio.F90	(revision 3875)
@@ -124,6 +124,7 @@
       INTEGER, INTENT( in  ) ::   kt   ! ocean time step
       !!
-      INTEGER  ::   ifpr, jfpr   ! dummy indices
+      INTEGER  ::   ifpr, jfpr                   ! dummy indices
       INTEGER  ::   ierr0, ierr1, ierr2, ierr3   ! return error code
+      INTEGER  ::   ios                          ! Local integer output status for namelist read
       !!
       CHARACTER(len=100) ::  cn_dir                            !   Root directory for location of CLIO files
@@ -153,6 +154,12 @@
          sn_prec = FLD_N( 'precip' ,    -1     , 'precip' ,  .true.    , .false. ,   'yearly'  , ''       , ''       ) 
 
-         REWIND( numnam )                    ! ... read in namlist namsbc_clio
-         READ  ( numnam, namsbc_clio )
+         REWIND( numnam_ref )              ! Namelist namsbc_clio in reference namelist : CLIO files
+         READ  ( numnam_ref, namsbc_clio, IOSTAT = ios, ERR = 901)
+901      IF( ios /= 0 ) CALL ctl_nam ( ios , 'namsbc_clio in reference namelist', lwp )
+
+         REWIND( numnam_cfg )              ! Namelist namsbc_clio in configuration namelist : CLIO files
+         READ  ( numnam_cfg, namsbc_clio, IOSTAT = ios, ERR = 902 )
+902      IF( ios /= 0 ) CALL ctl_nam ( ios , 'namsbc_clio in configuration namelist', lwp )
+         WRITE ( numond, namsbc_clio )
 
          ! store namelist information in an array
Index: branches/2013/dev_r3853_CNRS9_ConfSetting/NEMOGCM/NEMO/OPA_SRC/SBC/sbcblk_core.F90
===================================================================
--- branches/2013/dev_r3853_CNRS9_ConfSetting/NEMOGCM/NEMO/OPA_SRC/SBC/sbcblk_core.F90	(revision 3854)
+++ branches/2013/dev_r3853_CNRS9_ConfSetting/NEMOGCM/NEMO/OPA_SRC/SBC/sbcblk_core.F90	(revision 3875)
@@ -122,4 +122,5 @@
       INTEGER  ::   ifpr     ! dummy loop indice
       INTEGER  ::   jfld     ! dummy loop arguments
+      INTEGER  ::   ios      ! Local integer output status for namelist read
       !!
       CHARACTER(len=100) ::  cn_dir   !   Root directory for location of core files
@@ -151,6 +152,13 @@
          sn_tdif = FLD_N( 'taudif' ,    24     , 'taudif' ,  .true.    , .false. ,   'yearly'  , ''       , ''       )
          !
-         REWIND( numnam )                          ! read in namlist namsbc_core
-         READ  ( numnam, namsbc_core )
+
+         REWIND( numnam_ref )              ! Namelist namsbc_core in reference namelist : CORE bulk parameters
+         READ  ( numnam_ref, namsbc_core, IOSTAT = ios, ERR = 901)
+901      IF( ios /= 0 ) CALL ctl_nam ( ios , 'namsbc_core in reference namelist', lwp )
+
+         REWIND( numnam_cfg )              ! Namelist namsbc_core in configuration namelist : CORE bulk parameters
+         READ  ( numnam_cfg, namsbc_core, IOSTAT = ios, ERR = 902 )
+902      IF( ios /= 0 ) CALL ctl_nam ( ios , 'namsbc_core in configuration namelist', lwp )
+         WRITE ( numond, namsbc_core )
          !                                         ! check: do we plan to use ln_dm2dc with non-daily forcing?
          IF( ln_dm2dc .AND. sn_qsr%nfreqh /= 24 )   & 
Index: branches/2013/dev_r3853_CNRS9_ConfSetting/NEMOGCM/NEMO/OPA_SRC/SBC/sbcblk_mfs.F90
===================================================================
--- branches/2013/dev_r3853_CNRS9_ConfSetting/NEMOGCM/NEMO/OPA_SRC/SBC/sbcblk_mfs.F90	(revision 3854)
+++ branches/2013/dev_r3853_CNRS9_ConfSetting/NEMOGCM/NEMO/OPA_SRC/SBC/sbcblk_mfs.F90	(revision 3875)
@@ -104,4 +104,5 @@
       INTEGER  :: ifpr     ! dummy loop indice
       INTEGER  :: jj,ji    ! dummy loop arguments
+      INTEGER  ::   ios    ! Local integer output status for namelist read
       REAL(wp) :: act_hour
       !!--------------------------------------------------------------------
@@ -147,6 +148,13 @@
             sn_prec = FLD_N( 'precip_cmap' ,  -1   ,  'precip'  ,  .true.    ,  .true. ,   'yearly'  , ''       , ''         )
             !
-            REWIND( numnam )                    ! ... read in namlist namsbc_mfs
-            READ  ( numnam, namsbc_mfs )
+
+            REWIND( numnam_ref )              ! Namelist namsbc_msf in reference namelist : MFS files
+            READ  ( numnam_ref, namsbc_mfs, IOSTAT = ios, ERR = 901)
+901         IF( ios /= 0 ) CALL ctl_nam ( ios , 'namsbc_mfs in reference namelist', lwp )
+
+            REWIND( numnam_cfg )              ! Namelist namsbc_msf in configuration namelist : MFS files
+            READ  ( numnam_cfg, namsbc_mfs, IOSTAT = ios, ERR = 902 )
+902         IF( ios /= 0 ) CALL ctl_nam ( ios , 'namsbc_mfs in configuration namelist', lwp )
+            WRITE ( numond, namsbc_mfs )
             !
             ! store namelist information in an array
Index: branches/2013/dev_r3853_CNRS9_ConfSetting/NEMOGCM/NEMO/OPA_SRC/SBC/sbccpl.F90
===================================================================
--- branches/2013/dev_r3853_CNRS9_ConfSetting/NEMOGCM/NEMO/OPA_SRC/SBC/sbccpl.F90	(revision 3854)
+++ branches/2013/dev_r3853_CNRS9_ConfSetting/NEMOGCM/NEMO/OPA_SRC/SBC/sbccpl.F90	(revision 3875)
@@ -221,4 +221,5 @@
       !!
       INTEGER ::   jn   ! dummy loop index
+      INTEGER ::   ios  ! Local integer output status for namelist read
       REAL(wp), POINTER, DIMENSION(:,:) ::   zacs, zaos
       !!
@@ -258,6 +259,12 @@
       sn_rcv_co2    = FLD_C( 'none'                ,    'no'    ,     ''      ,         ''          ,   ''    )
 
-      REWIND( numnam )                    ! ... read namlist namsbc_cpl
-      READ  ( numnam, namsbc_cpl )
+      REWIND( numnam_ref )              ! Namelist namsbc_cpl in reference namelist : Variables for OASIS coupling
+      READ  ( numnam_ref, namsbc_cpl, IOSTAT = ios, ERR = 901)
+901   IF( ios /= 0 ) CALL ctl_nam ( ios , 'namsbc_cpl in reference namelist', lwp )
+
+      REWIND( numnam_cfg )              ! Namelist namsbc_cpl in configuration namelist : Variables for OASIS coupling
+      READ  ( numnam_cfg, namsbc_cpl, IOSTAT = ios, ERR = 902 )
+902   IF( ios /= 0 ) CALL ctl_nam ( ios , 'namsbc_cpl in configuration namelist', lwp )
+      WRITE ( numond, namsbc_cpl )
 
       IF(lwp) THEN                        ! control print
Index: branches/2013/dev_r3853_CNRS9_ConfSetting/NEMOGCM/NEMO/OPA_SRC/SBC/sbcflx.F90
===================================================================
--- branches/2013/dev_r3853_CNRS9_ConfSetting/NEMOGCM/NEMO/OPA_SRC/SBC/sbcflx.F90	(revision 3854)
+++ branches/2013/dev_r3853_CNRS9_ConfSetting/NEMOGCM/NEMO/OPA_SRC/SBC/sbcflx.F90	(revision 3875)
@@ -77,4 +77,5 @@
       INTEGER  ::   ji, jj, jf            ! dummy indices
       INTEGER  ::   ierror                ! return error code
+      INTEGER  ::   ios                   ! Local integer output status for namelist read
       REAL(wp) ::   zfact                 ! temporary scalar
       REAL(wp) ::   zrhoa  = 1.22         ! Air density kg/m3
@@ -100,6 +101,12 @@
          sn_emp  = FLD_N(  'emp'  ,    24     ,  'emp'     ,  .false.   , .false. ,   'yearly'  , ''       , ''        )
          !
-         REWIND ( numnam )                         ! read in namlist namflx
-         READ   ( numnam, namsbc_flx ) 
+         REWIND( numnam_ref )              ! Namelist namsbc_flx in reference namelist : Files for fluxes
+         READ  ( numnam_ref, namsbc_flx, IOSTAT = ios, ERR = 901)
+901      IF( ios /= 0 ) CALL ctl_nam ( ios , 'namsbc_flx in reference namelist', lwp )
+
+         REWIND( numnam_cfg )              ! Namelist namsbc_flx in configuration namelist : Files for fluxes
+         READ  ( numnam_cfg, namsbc_flx, IOSTAT = ios, ERR = 902 )
+902      IF( ios /= 0 ) CALL ctl_nam ( ios , 'namsbc_flx in configuration namelist', lwp )
+         WRITE ( numond, namsbc_flx ) 
          !
          !                                         ! check: do we plan to use ln_dm2dc with non-daily forcing?
Index: branches/2013/dev_r3853_CNRS9_ConfSetting/NEMOGCM/NEMO/OPA_SRC/SBC/sbcice_cice.F90
===================================================================
--- branches/2013/dev_r3853_CNRS9_ConfSetting/NEMOGCM/NEMO/OPA_SRC/SBC/sbcice_cice.F90	(revision 3854)
+++ branches/2013/dev_r3853_CNRS9_ConfSetting/NEMOGCM/NEMO/OPA_SRC/SBC/sbcice_cice.F90	(revision 3875)
@@ -759,6 +759,13 @@
          sn_bot5 = FLD_N( 'botmeltn5_1m' ,    -1.    ,  'botmeltn5' ,  .true.    , .true.  ,  ' yearly'  , ''       , ''         )
 
-!         REWIND ( numnam )               ! ... at some point might read in from NEMO namelist?
-!         READ   ( numnam, namsbc_cice ) 
+! ... at some point might read in from NEMO namelist?
+!!$      REWIND( numnam_ref )              ! Namelist namsbc_cice in reference namelist : 
+!!$      READ  ( numnam_ref, namsbc_cice, IOSTAT = ios, ERR = 901)
+!!$901   IF( ios /= 0 ) CALL ctl_nam ( ios , 'namsbc_cice in reference namelist', lwp )
+!!$
+!!$      REWIND( numnam_cfg )              ! Namelist namsbc_cice in configuration namelist : Parameters of the run
+!!$      READ  ( numnam_cfg, namsbc_cice, IOSTAT = ios, ERR = 902 )
+!!$902   IF( ios /= 0 ) CALL ctl_nam ( ios , 'namsbc_cice in configuration namelist', lwp )
+!!$      WRITE ( numond, namsbc_cice )
 
          ! store namelist information in an array
Index: branches/2013/dev_r3853_CNRS9_ConfSetting/NEMOGCM/NEMO/OPA_SRC/SBC/sbcice_if.F90
===================================================================
--- branches/2013/dev_r3853_CNRS9_ConfSetting/NEMOGCM/NEMO/OPA_SRC/SBC/sbcice_if.F90	(revision 3854)
+++ branches/2013/dev_r3853_CNRS9_ConfSetting/NEMOGCM/NEMO/OPA_SRC/SBC/sbcice_if.F90	(revision 3875)
@@ -59,4 +59,5 @@
       INTEGER  ::   ji, jj     ! dummy loop indices
       INTEGER  ::   ierror     ! return error code
+      INTEGER  ::   ios        ! Local integer output status for namelist read
       REAL(wp) ::   ztrp, zsice, zt_fzp, zfr_obs
       REAL(wp) ::   zqri, zqrj, zqrp, zqi
@@ -76,6 +77,12 @@
          sn_ice = FLD_N('ice_cover',    -1    ,  'ice_cov' ,  .true.    , .true. ,   'yearly'  , ''       , ''         )
 
-         REWIND ( numnam )               ! ... read in namlist namiif
-         READ   ( numnam, namsbc_iif )
+         REWIND( numnam_ref )              ! Namelist namsbc_iif in reference namelist : Ice if file
+         READ  ( numnam_ref, namsbc_iif, IOSTAT = ios, ERR = 901)
+901      IF( ios /= 0 ) CALL ctl_nam ( ios , 'namsbc_iif in reference namelist', lwp )
+
+         REWIND( numnam_cfg )              ! Namelist Namelist namsbc_iif in configuration namelist : Ice if file
+         READ  ( numnam_cfg, namsbc_iif, IOSTAT = ios, ERR = 902 )
+902      IF( ios /= 0 ) CALL ctl_nam ( ios , 'namsbc_iif in configuration namelist', lwp )
+         WRITE ( numond, namsbc_iif )
 
          ALLOCATE( sf_ice(1), STAT=ierror )
Index: branches/2013/dev_r3853_CNRS9_ConfSetting/NEMOGCM/NEMO/OPA_SRC/SBC/sbcmod.F90
===================================================================
--- branches/2013/dev_r3853_CNRS9_ConfSetting/NEMOGCM/NEMO/OPA_SRC/SBC/sbcmod.F90	(revision 3854)
+++ branches/2013/dev_r3853_CNRS9_ConfSetting/NEMOGCM/NEMO/OPA_SRC/SBC/sbcmod.F90	(revision 3875)
@@ -87,4 +87,5 @@
          &             ln_blk_mfs, ln_apr_dyn, nn_ice,  nn_ice_embd, ln_dm2dc   , ln_rnf,   &
          &             ln_ssr    , nn_fwb    , ln_cdgw , ln_wave , ln_sdw
+      INTEGER  ::   ios
       !!----------------------------------------------------------------------
 
@@ -95,6 +96,12 @@
       ENDIF
 
-      REWIND( numnam )           ! Read Namelist namsbc
-      READ  ( numnam, namsbc )
+      REWIND( numnam_ref )              ! Namelist namsbc in reference namelist : Surface boundary
+      READ  ( numnam_ref, namsbc, IOSTAT = ios, ERR = 901)
+901   IF( ios /= 0 ) CALL ctl_nam ( ios , 'namsbc in reference namelist', lwp )
+
+      REWIND( numnam_cfg )              ! Namelist namsbc in configuration namelist : Parameters of the run
+      READ  ( numnam_cfg, namsbc, IOSTAT = ios, ERR = 902 )
+902   IF( ios /= 0 ) CALL ctl_nam ( ios , 'namsbc in configuration namelist', lwp )
+      WRITE ( numond, namsbc )
 
       !                          ! overwrite namelist parameter using CPP key information
Index: branches/2013/dev_r3853_CNRS9_ConfSetting/NEMOGCM/NEMO/OPA_SRC/SBC/sbcrnf.F90
===================================================================
--- branches/2013/dev_r3853_CNRS9_ConfSetting/NEMOGCM/NEMO/OPA_SRC/SBC/sbcrnf.F90	(revision 3854)
+++ branches/2013/dev_r3853_CNRS9_ConfSetting/NEMOGCM/NEMO/OPA_SRC/SBC/sbcrnf.F90	(revision 3875)
@@ -245,4 +245,5 @@
       INTEGER           ::   ji, jj, jk    ! dummy loop indices
       INTEGER           ::   ierror, inum  ! temporary integer
+      INTEGER           ::   ios           ! Local integer output status for namelist read
       !
       NAMELIST/namsbc_rnf/ cn_dir, ln_rnf_emp, ln_rnf_depth, ln_rnf_tem, ln_rnf_sal,   &
@@ -264,6 +265,12 @@
       sn_dep_rnf = FLD_N( 'runoffs',   0.  , 'rodepth'  ,  .FALSE.   , .true. ,   'yearly'  , ''    , ''  )
       !
-      REWIND ( numnam )                         ! Read Namelist namsbc_rnf
-      READ   ( numnam, namsbc_rnf )
+      REWIND( numnam_ref )              ! Namelist namsbc_rnf in reference namelist : Runoffs 
+      READ  ( numnam_ref, namsbc_rnf, IOSTAT = ios, ERR = 901)
+901   IF( ios /= 0 ) CALL ctl_nam ( ios , 'namsbc_rnf in reference namelist', lwp )
+
+      REWIND( numnam_cfg )              ! Namelist namsbc_rnf in configuration namelist : Runoffs
+      READ  ( numnam_cfg, namsbc_rnf, IOSTAT = ios, ERR = 902 )
+902   IF( ios /= 0 ) CALL ctl_nam ( ios , 'namsbc_rnf in configuration namelist', lwp )
+      WRITE ( numond, namsbc_rnf )
       !
       !                                         ! Control print
Index: branches/2013/dev_r3853_CNRS9_ConfSetting/NEMOGCM/NEMO/OPA_SRC/SBC/sbcssr.F90
===================================================================
--- branches/2013/dev_r3853_CNRS9_ConfSetting/NEMOGCM/NEMO/OPA_SRC/SBC/sbcssr.F90	(revision 3854)
+++ branches/2013/dev_r3853_CNRS9_ConfSetting/NEMOGCM/NEMO/OPA_SRC/SBC/sbcssr.F90	(revision 3875)
@@ -79,5 +79,4 @@
       CHARACTER(len=100) ::  cn_dir          ! Root directory for location of ssr files
       TYPE(FLD_N) ::   sn_sst, sn_sss        ! informations about the fields to be read
-      NAMELIST/namsbc_ssr/ cn_dir, nn_sstr, nn_sssr, rn_dqdt, rn_deds, sn_sst, sn_sss, ln_sssr_bnd, rn_sssr_bnd
       !!----------------------------------------------------------------------
       !
@@ -164,4 +163,5 @@
       TYPE(FLD_N) ::   sn_sst, sn_sss        ! informations about the fields to be read
       NAMELIST/namsbc_ssr/ cn_dir, nn_sstr, nn_sssr, rn_dqdt, rn_deds, sn_sst, sn_sss, ln_sssr_bnd, rn_sssr_bnd
+      INTEGER     ::  ios
       !!----------------------------------------------------------------------
       !
@@ -173,7 +173,13 @@
       sn_sst = FLD_N( 'sst'    ,    24     ,  'sst'     ,  .false.   , .false. ,   'yearly'  , ''       , ''         )
       sn_sss = FLD_N( 'sss'    ,    -1     ,  'sss'     ,  .true.    , .false. ,   'yearly'  , ''       , ''         )
-
-      REWIND( numnam )             !* read in namlist namflx
-      READ  ( numnam, namsbc_ssr ) 
+ 
+      REWIND( numnam_ref )              ! Namelist namsbc_ssr in reference namelist : 
+      READ  ( numnam_ref, namsbc_ssr, IOSTAT = ios, ERR = 901)
+901   IF( ios /= 0 ) CALL ctl_nam ( ios , 'namsbc_ssr in reference namelist', lwp )
+
+      REWIND( numnam_cfg )              ! Namelist namsbc_ssr in configuration namelist :
+      READ  ( numnam_cfg, namsbc_ssr, IOSTAT = ios, ERR = 902 )
+902   IF( ios /= 0 ) CALL ctl_nam ( ios , 'namsbc_ssr in configuration namelist', lwp )
+      WRITE ( numond, namsbc_ssr )
 
       IF(lwp) THEN                 !* control print
Index: branches/2013/dev_r3853_CNRS9_ConfSetting/NEMOGCM/NEMO/OPA_SRC/SBC/sbcwave.F90
===================================================================
--- branches/2013/dev_r3853_CNRS9_ConfSetting/NEMOGCM/NEMO/OPA_SRC/SBC/sbcwave.F90	(revision 3854)
+++ branches/2013/dev_r3853_CNRS9_ConfSetting/NEMOGCM/NEMO/OPA_SRC/SBC/sbcwave.F90	(revision 3875)
@@ -67,4 +67,5 @@
       INTEGER                ::  ierror   ! return error code
       INTEGER                ::  ifpr, jj,ji,jk 
+      INTEGER                ::   ios     ! Local integer output status for namelist read
       REAL(wp),DIMENSION(:,:,:),POINTER             ::  udummy,vdummy,hdivdummy,rotdummy
       REAL                                          ::  z2dt,z1_2dt
@@ -92,7 +93,12 @@
          cn_dir = './'          ! directory in which the wave data are 
          
-
-         REWIND( numnam )                             !* read in namlist namsbc_wave
-         READ  ( numnam, namsbc_wave ) 
+         REWIND( numnam_ref )              ! Namelist namsbc_wave in reference namelist : File for drag coeff. from wave model
+         READ  ( numnam_ref, namsbc_wave, IOSTAT = ios, ERR = 901)
+901      IF( ios /= 0 ) CALL ctl_nam ( ios , 'namsbc_wave in reference namelist', lwp )
+
+         REWIND( numnam_cfg )              ! Namelist namsbc_wave in configuration namelist : File for drag coeff. from wave model
+         READ  ( numnam_cfg, namsbc_wave, IOSTAT = ios, ERR = 902 )
+902      IF( ios /= 0 ) CALL ctl_nam ( ios , 'namsbc_wave in configuration namelist', lwp )
+         WRITE ( numond, namsbc_wave )
          !
 
Index: branches/2013/dev_r3853_CNRS9_ConfSetting/NEMOGCM/NEMO/OPA_SRC/SBC/tideini.F90
===================================================================
--- branches/2013/dev_r3853_CNRS9_ConfSetting/NEMOGCM/NEMO/OPA_SRC/SBC/tideini.F90	(revision 3854)
+++ branches/2013/dev_r3853_CNRS9_ConfSetting/NEMOGCM/NEMO/OPA_SRC/SBC/tideini.F90	(revision 3875)
@@ -46,4 +46,5 @@
     INTEGER, INTENT( in ) ::   kt     ! ocean time-step
     CHARACTER(LEN=4), DIMENSION(jpmax_harmo) :: clname
+    INTEGER  ::   ios                 ! Local integer output status for namelist read
     !
     NAMELIST/nam_tide/ln_tide_pot, ln_tide_ramp, rdttideramp, clname
@@ -63,6 +64,12 @@
        !
        ! Read Namelist nam_tide
-       REWIND ( numnam )
-       READ   ( numnam, nam_tide )
+       REWIND( numnam_ref )              ! Namelist nam_tide in reference namelist : Tides
+       READ  ( numnam_ref, nam_tide, IOSTAT = ios, ERR = 901)
+901    IF( ios /= 0 ) CALL ctl_nam ( ios , 'nam_tide in reference namelist', lwp )
+
+       REWIND( numnam_cfg )              ! Namelist nam_tide in configuration namelist : Tides
+       READ  ( numnam_cfg, nam_tide, IOSTAT = ios, ERR = 902 )
+902    IF( ios /= 0 ) CALL ctl_nam ( ios , 'nam_tide in configuration namelist', lwp )
+       WRITE ( numond, nam_tide )
        !
        nb_harmo=0
Index: branches/2013/dev_r3853_CNRS9_ConfSetting/NEMOGCM/NEMO/OPA_SRC/SOL/solver.F90
===================================================================
--- branches/2013/dev_r3853_CNRS9_ConfSetting/NEMOGCM/NEMO/OPA_SRC/SOL/solver.F90	(revision 3854)
+++ branches/2013/dev_r3853_CNRS9_ConfSetting/NEMOGCM/NEMO/OPA_SRC/SOL/solver.F90	(revision 3875)
@@ -51,4 +51,5 @@
       !!----------------------------------------------------------------------
       INTEGER, INTENT(in) :: kt
+      INTEGER             ::   ios       ! Local integer output status for namelist read
       !!
       NAMELIST/namsol/ nn_solv, nn_sol_arp, nn_nmin, nn_nmax, nn_nmod, rn_eps, rn_resmax, rn_sor
@@ -62,6 +63,12 @@
       ENDIF
 
-      REWIND( numnam )              !* Namelist namsol : elliptic solver / free surface
-      READ  ( numnam, namsol )
+      REWIND( numnam_ref )              ! Namelist namsol in reference namelist : Elliptic solver / free surface
+      READ  ( numnam_ref, namsol, IOSTAT = ios, ERR = 901)
+901   IF( ios /= 0 ) CALL ctl_nam ( ios , 'namsol in reference namelist', lwp )
+
+      REWIND( numnam_cfg )              ! Namelist namsol in configuration namelist : Elliptic solver / free surface
+      READ  ( numnam_cfg, namsol, IOSTAT = ios, ERR = 902 )
+902   IF( ios /= 0 ) CALL ctl_nam ( ios , 'namsol in configuration namelist', lwp )
+      WRITE ( numond, namsol )
 
       IF(lwp) THEN                  !* Control print
Index: branches/2013/dev_r3853_CNRS9_ConfSetting/NEMOGCM/NEMO/OPA_SRC/TRA/eosbn2.F90
===================================================================
--- branches/2013/dev_r3853_CNRS9_ConfSetting/NEMOGCM/NEMO/OPA_SRC/TRA/eosbn2.F90	(revision 3854)
+++ branches/2013/dev_r3853_CNRS9_ConfSetting/NEMOGCM/NEMO/OPA_SRC/TRA/eosbn2.F90	(revision 3875)
@@ -708,7 +708,14 @@
       NAMELIST/nameos/ nn_eos, rn_alpha, rn_beta
       !!----------------------------------------------------------------------
-      !
-      REWIND( numnam )            ! Read Namelist nameos : equation of state
-      READ  ( numnam, nameos )
+      INTEGER  ::   ios
+      !
+      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 )
+
+      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 )
+      WRITE( numond, nameos )
       !
       IF(lwp) THEN                ! Control print
Index: branches/2013/dev_r3853_CNRS9_ConfSetting/NEMOGCM/NEMO/OPA_SRC/TRA/traadv.F90
===================================================================
--- branches/2013/dev_r3853_CNRS9_ConfSetting/NEMOGCM/NEMO/OPA_SRC/TRA/traadv.F90	(revision 3854)
+++ branches/2013/dev_r3853_CNRS9_ConfSetting/NEMOGCM/NEMO/OPA_SRC/TRA/traadv.F90	(revision 3875)
@@ -151,4 +151,5 @@
       !!----------------------------------------------------------------------
       INTEGER ::   ioptio
+      INTEGER ::   ios                 ! Local integer output status for namelist read
       !!
       NAMELIST/namtra_adv/ ln_traadv_cen2 , ln_traadv_tvd,     &
@@ -158,6 +159,12 @@
       !!----------------------------------------------------------------------
 
-      REWIND( numnam )                ! Read Namelist namtra_adv : tracer advection scheme
-      READ  ( numnam, namtra_adv )
+      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 )
+
+      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 )
+      WRITE ( numond, namtra_adv )
 
       IF(lwp) THEN                    ! Namelist print
Index: branches/2013/dev_r3853_CNRS9_ConfSetting/NEMOGCM/NEMO/OPA_SRC/TRA/trabbc.F90
===================================================================
--- branches/2013/dev_r3853_CNRS9_ConfSetting/NEMOGCM/NEMO/OPA_SRC/TRA/trabbc.F90	(revision 3854)
+++ branches/2013/dev_r3853_CNRS9_ConfSetting/NEMOGCM/NEMO/OPA_SRC/TRA/trabbc.F90	(revision 3875)
@@ -129,10 +129,17 @@
       INTEGER  ::   ji, jj              ! dummy loop indices
       INTEGER  ::   inum                ! temporary logical unit
+      INTEGER  ::   ios                 ! Local integer output status for namelist read
       !!
       NAMELIST/nambbc/ln_trabbc, nn_geoflx, rn_geoflx_cst 
       !!----------------------------------------------------------------------
 
-      REWIND( numnam )                 ! Read Namelist nambbc : bottom momentum boundary condition
-      READ  ( numnam, nambbc )
+      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 )
+
+      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 )
+      WRITE ( numond, nambbc )
 
       IF(lwp) THEN                     ! Control print
Index: branches/2013/dev_r3853_CNRS9_ConfSetting/NEMOGCM/NEMO/OPA_SRC/TRA/trabbl.F90
===================================================================
--- branches/2013/dev_r3853_CNRS9_ConfSetting/NEMOGCM/NEMO/OPA_SRC/TRA/trabbl.F90	(revision 3854)
+++ branches/2013/dev_r3853_CNRS9_ConfSetting/NEMOGCM/NEMO/OPA_SRC/TRA/trabbl.F90	(revision 3875)
@@ -560,4 +560,5 @@
       INTEGER ::   ji, jj               ! dummy loop indices
       INTEGER ::   ii0, ii1, ij0, ij1   ! temporary integer
+      INTEGER  ::   ios                 ! Local integer output status for namelist read
       REAL(wp), POINTER, DIMENSION(:,:) :: zmbk
       !!
@@ -570,6 +571,12 @@
       !
 
-      REWIND ( numnam )              !* Read Namelist nambbl : bottom boundary layer scheme
-      READ   ( numnam, nambbl )
+      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 )
+
+      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 )
+      WRITE ( numond, nambbl )
       !
       l_bbl = .TRUE.                 !* flag to compute bbl coef and transport
Index: branches/2013/dev_r3853_CNRS9_ConfSetting/NEMOGCM/NEMO/OPA_SRC/TRA/tradmp.F90
===================================================================
--- branches/2013/dev_r3853_CNRS9_ConfSetting/NEMOGCM/NEMO/OPA_SRC/TRA/tradmp.F90	(revision 3854)
+++ branches/2013/dev_r3853_CNRS9_ConfSetting/NEMOGCM/NEMO/OPA_SRC/TRA/tradmp.F90	(revision 3875)
@@ -194,8 +194,15 @@
       !!----------------------------------------------------------------------
       NAMELIST/namtra_dmp/ ln_tradmp, nn_hdmp, nn_zdmp, rn_surf, rn_bot, rn_dep, nn_file
-      !!----------------------------------------------------------------------
-
-      REWIND ( numnam )                  ! Read Namelist namtra_dmp : temperature and salinity damping term
-      READ   ( numnam, namtra_dmp )
+      INTEGER  ::   ios                 ! Local integer output status for namelist read
+      !!----------------------------------------------------------------------
+
+      REWIND( numnam_ref )              ! Namelist namtra_dmp in reference namelist : Temperature and salinity damping term
+      READ  ( numnam_ref, namtra_dmp, IOSTAT = ios, ERR = 901)
+901   IF( ios /= 0 ) CALL ctl_nam ( ios , 'namtra_dmp in reference namelist', lwp )
+
+      REWIND( numnam_cfg )              ! Namelist namtra_dmp in configuration namelist : Temperature and salinity damping term
+      READ  ( numnam_cfg, namtra_dmp, IOSTAT = ios, ERR = 902 )
+902   IF( ios /= 0 ) CALL ctl_nam ( ios , 'namtra_dmp in configuration namelist', lwp )
+      WRITE ( numond, namtra_dmp )
       
       IF( lzoom )   nn_zdmp = 0          ! restoring to climatology at closed north or south boundaries
Index: branches/2013/dev_r3853_CNRS9_ConfSetting/NEMOGCM/NEMO/OPA_SRC/TRA/traqsr.F90
===================================================================
--- branches/2013/dev_r3853_CNRS9_ConfSetting/NEMOGCM/NEMO/OPA_SRC/TRA/traqsr.F90	(revision 3854)
+++ branches/2013/dev_r3853_CNRS9_ConfSetting/NEMOGCM/NEMO/OPA_SRC/TRA/traqsr.F90	(revision 3875)
@@ -315,6 +315,7 @@
       !!----------------------------------------------------------------------
       !
-      INTEGER  ::   ji, jj, jk     ! dummy loop indices
+      INTEGER  ::   ji, jj, jk                   ! dummy loop indices
       INTEGER  ::   irgb, ierror, ioptio, nqsr   ! local integer
+      INTEGER  ::   ios                          ! Local integer output status for namelist read
       REAL(wp) ::   zz0, zc0  , zc1, zcoef       ! local scalars
       REAL(wp) ::   zz1, zc2  , zc3, zchl        !   -      -
@@ -342,6 +343,13 @@
       sn_chl = FLD_N( 'chlorophyll' ,    -1     ,  'CHLA'    ,  .true.     , .true.  ,   'yearly'  , ''       , ''         )
       !
-      REWIND( numnam )            ! Read Namelist namtra_qsr : ratio and length of penetration
-      READ  ( numnam, namtra_qsr )
+
+      REWIND( numnam_ref )              ! Namelist namtra_qsr in reference namelist : Ratio and length of penetration
+      READ  ( numnam_ref, namtra_qsr, IOSTAT = ios, ERR = 901)
+901   IF( ios /= 0 ) CALL ctl_nam ( ios , 'namtra_qsr in reference namelist', lwp )
+
+      REWIND( numnam_cfg )              !  Namelist namtra_qsr in configuration namelist : Ratio and length of penetration
+      READ  ( numnam_cfg, namtra_qsr, IOSTAT = ios, ERR = 902 )
+902   IF( ios /= 0 ) CALL ctl_nam ( ios , 'namtra_qsr in configuration namelist', lwp )
+      WRITE ( numond, namtra_qsr )
       !
       IF(lwp) THEN                ! control print
Index: branches/2013/dev_r3853_CNRS9_ConfSetting/NEMOGCM/NEMO/OPA_SRC/TRD/trdmod.F90
===================================================================
--- branches/2013/dev_r3853_CNRS9_ConfSetting/NEMOGCM/NEMO/OPA_SRC/TRD/trdmod.F90	(revision 3854)
+++ branches/2013/dev_r3853_CNRS9_ConfSetting/NEMOGCM/NEMO/OPA_SRC/TRD/trdmod.F90	(revision 3875)
@@ -251,11 +251,20 @@
       !!----------------------------------------------------------------------
       USE in_out_manager          ! I/O manager
+      USE lib_mpp                 ! MPP library
       !!    
       NAMELIST/namtrd/ nn_trd, nn_ctls, cn_trdrst_in, cn_trdrst_out, ln_trdmld_restart, rn_ucf, ln_trdmld_instant
+      INTEGER  ::   ios           ! Local integer output status for namelist read
       !!----------------------------------------------------------------------
 
       IF( l_trdtra .OR. l_trddyn )   THEN
-         REWIND( numnam )
-         READ  ( numnam, namtrd )      ! namelist namtrd : trends diagnostic
+ 
+         REWIND( numnam_ref )              ! Namelist namtrd in reference namelist : Diagnostics: trends
+         READ  ( numnam_ref, namtrd, IOSTAT = ios, ERR = 901)
+901      IF( ios /= 0 ) CALL ctl_nam ( ios , 'namtrd in reference namelist', lwp )
+
+         REWIND( numnam_cfg )              ! Namelist namtrd in configuration namelist : Diagnostics: trends
+         READ  ( numnam_cfg, namtrd, IOSTAT = ios, ERR = 902 )
+902      IF( ios /= 0 ) CALL ctl_nam ( ios , 'namtrd in configuration namelist', lwp )
+         WRITE ( numond, namtrd )
 
          IF(lwp) THEN
Index: branches/2013/dev_r3853_CNRS9_ConfSetting/NEMOGCM/NEMO/OPA_SRC/ZDF/zdfbfr.F90
===================================================================
--- branches/2013/dev_r3853_CNRS9_ConfSetting/NEMOGCM/NEMO/OPA_SRC/ZDF/zdfbfr.F90	(revision 3854)
+++ branches/2013/dev_r3853_CNRS9_ConfSetting/NEMOGCM/NEMO/OPA_SRC/ZDF/zdfbfr.F90	(revision 3875)
@@ -179,4 +179,5 @@
       INTEGER   ::   ikbu, ikbv   ! temporary integers
       INTEGER   ::   ictu, ictv   !    -          -
+      INTEGER   ::   ios
       REAL(wp)  ::   zminbfr, zmaxbfr   ! temporary scalars
       REAL(wp)  ::   zfru, zfrv         !    -         -
@@ -188,6 +189,12 @@
       IF( nn_timing == 1 )  CALL timing_start('zdf_bfr_init')
       !
-      REWIND ( numnam )               !* Read Namelist nam_bfr : bottom momentum boundary condition
-      READ   ( numnam, nambfr )
+      REWIND( numnam_ref )              ! Namelist nambfr in reference namelist : Bottom momentum boundary condition
+      READ  ( numnam_ref, nambfr, IOSTAT = ios, ERR = 901)
+901   IF( ios /= 0 ) CALL ctl_nam ( ios , 'nambfr in reference namelist', lwp )
+
+      REWIND( numnam_cfg )              ! Namelist nambfr in configuration namelist : Bottom momentum boundary condition
+      READ  ( numnam_cfg, nambfr, IOSTAT = ios, ERR = 902 )
+902   IF( ios /= 0 ) CALL ctl_nam ( ios , 'nambfr in configuration namelist', lwp )
+      WRITE ( numond, nambfr )
 
       !                               !* Parameter control and print
Index: branches/2013/dev_r3853_CNRS9_ConfSetting/NEMOGCM/NEMO/OPA_SRC/ZDF/zdfddm.F90
===================================================================
--- branches/2013/dev_r3853_CNRS9_ConfSetting/NEMOGCM/NEMO/OPA_SRC/ZDF/zdfddm.F90	(revision 3854)
+++ branches/2013/dev_r3853_CNRS9_ConfSetting/NEMOGCM/NEMO/OPA_SRC/ZDF/zdfddm.F90	(revision 3875)
@@ -213,8 +213,15 @@
       !!----------------------------------------------------------------------
       NAMELIST/namzdf_ddm/ rn_avts, rn_hsbfr
-      !!----------------------------------------------------------------------
-      !
-      REWIND( numnam )                ! Read Namelist namzdf_ddm : double diffusion mixing scheme
-      READ  ( numnam, namzdf_ddm )
+      INTEGER  ::   ios                 ! Local integer output status for namelist read
+      !!----------------------------------------------------------------------
+      !
+      REWIND( numnam_ref )              ! Namelist namzdf_ddm in reference namelist : Double diffusion mixing scheme
+      READ  ( numnam_ref, namzdf_ddm, IOSTAT = ios, ERR = 901)
+901   IF( ios /= 0 ) CALL ctl_nam ( ios , 'namzdf_ddm in reference namelist', lwp )
+
+      REWIND( numnam_cfg )              ! Namelist namzdf_ddm in configuration namelist : Double diffusion mixing scheme
+      READ  ( numnam_cfg, namzdf_ddm, IOSTAT = ios, ERR = 902 )
+902   IF( ios /= 0 ) CALL ctl_nam ( ios , 'namzdf_ddm in configuration namelist', lwp )
+      WRITE ( numond, namzdf_ddm )
       !
       IF(lwp) THEN                    ! Parameter print
Index: branches/2013/dev_r3853_CNRS9_ConfSetting/NEMOGCM/NEMO/OPA_SRC/ZDF/zdfgls.F90
===================================================================
--- branches/2013/dev_r3853_CNRS9_ConfSetting/NEMOGCM/NEMO/OPA_SRC/ZDF/zdfgls.F90	(revision 3854)
+++ branches/2013/dev_r3853_CNRS9_ConfSetting/NEMOGCM/NEMO/OPA_SRC/ZDF/zdfgls.F90	(revision 3875)
@@ -928,4 +928,5 @@
       !
       INTEGER ::   jk    ! dummy loop indices
+      INTEGER ::   ios   ! Local integer output status for namelist read
       REAL(wp)::   zcr   ! local scalar
       !!
@@ -940,6 +941,12 @@
       IF( nn_timing == 1 )  CALL timing_start('zdf_gls_init')
       !
-      REWIND( numnam )                 !* Read Namelist namzdf_gls
-      READ  ( numnam, namzdf_gls )
+      REWIND( numnam_ref )              ! Namelist namzdf_gls in reference namelist : Vertical eddy diffivity and viscosity using gls turbulent closure scheme
+      READ  ( numnam_ref, namzdf_gls, IOSTAT = ios, ERR = 901)
+901   IF( ios /= 0 ) CALL ctl_nam ( ios , 'namzdf_gls in reference namelist', lwp )
+
+      REWIND( numnam_cfg )              ! Namelist namzdf_gls in configuration namelist : Vertical eddy diffivity and viscosity using gls turbulent closure scheme
+      READ  ( numnam_cfg, namzdf_gls, IOSTAT = ios, ERR = 902 )
+902   IF( ios /= 0 ) CALL ctl_nam ( ios , 'namzdf_gls in configuration namelist', lwp )
+      WRITE ( numond, namzdf_gls )
 
       IF(lwp) THEN                     !* Control print
Index: branches/2013/dev_r3853_CNRS9_ConfSetting/NEMOGCM/NEMO/OPA_SRC/ZDF/zdfini.F90
===================================================================
--- branches/2013/dev_r3853_CNRS9_ConfSetting/NEMOGCM/NEMO/OPA_SRC/ZDF/zdfini.F90	(revision 3854)
+++ branches/2013/dev_r3853_CNRS9_ConfSetting/NEMOGCM/NEMO/OPA_SRC/ZDF/zdfini.F90	(revision 3875)
@@ -51,4 +51,5 @@
       !!----------------------------------------------------------------------
       INTEGER ::   ioptio       ! temporary scalar
+      INTEGER ::   ios
       !!
       NAMELIST/namzdf/ rn_avm0, rn_avt0, nn_avb, nn_havtb, ln_zdfexp, nn_zdfexp,   &
@@ -56,6 +57,12 @@
       !!----------------------------------------------------------------------
 
-      REWIND( numnam )           !* Read namzdf namelist : vertical mixing parameters
-      READ  ( numnam, namzdf )
+      REWIND( numnam_ref )              ! Namelist namzdf in reference namelist : Vertical mixing parameters
+      READ  ( numnam_ref, namzdf, IOSTAT = ios, ERR = 901)
+901   IF( ios /= 0 ) CALL ctl_nam ( ios , 'namzdf in reference namelist', lwp )
+
+      REWIND( numnam_cfg )              ! Namelist namzdf in reference namelist : Vertical mixing parameters
+      READ  ( numnam_cfg, namzdf, IOSTAT = ios, ERR = 902 )
+902   IF( ios /= 0 ) CALL ctl_nam ( ios , 'namzdf in configuration namelist', lwp )
+      WRITE ( numond, namzdf )
 
       IF(lwp) THEN               !* Parameter print
Index: branches/2013/dev_r3853_CNRS9_ConfSetting/NEMOGCM/NEMO/OPA_SRC/ZDF/zdfkpp.F90
===================================================================
--- branches/2013/dev_r3853_CNRS9_ConfSetting/NEMOGCM/NEMO/OPA_SRC/ZDF/zdfkpp.F90	(revision 3854)
+++ branches/2013/dev_r3853_CNRS9_ConfSetting/NEMOGCM/NEMO/OPA_SRC/ZDF/zdfkpp.F90	(revision 3875)
@@ -1382,4 +1382,5 @@
       REAL(wp) ::   zustar, zucube, zustvk, zeta, zehat   ! tempory scalars
 #endif
+      INTEGER  ::   ios            ! Local integer output status for namelist read
       REAL(wp) ::   zhbf           ! tempory scalars
       LOGICAL  ::   ll_kppcustom   ! 1st ocean level taken as surface layer
@@ -1391,6 +1392,12 @@
       IF( nn_timing == 1 )  CALL timing_start('zdf_kpp_init')
       !
-      REWIND ( numnam )               ! Read Namelist namkpp : K-Profile Parameterisation
-      READ   ( numnam, namzdf_kpp )
+      REWIND( numnam_ref )              ! Namelist namzdf_kpp in reference namelist : Vertical eddy diffivity and viscosity using kpp turbulent closure scheme
+      READ  ( numnam_ref, namzdf_kpp, IOSTAT = ios, ERR = 901)
+901   IF( ios /= 0 ) CALL ctl_nam ( ios , 'namzdf_kpp in reference namelist', lwp )
+
+      REWIND( numnam_cfg )              ! Namelist namzdf_kpp in configuration namelist : Vertical eddy diffivity and viscosity using kpp turbulent closure scheme
+      READ  ( numnam_cfg, namzdf_kpp, IOSTAT = ios, ERR = 902 )
+902   IF( ios /= 0 ) CALL ctl_nam ( ios , 'namzdf_kpp in configuration namelist', lwp )
+      WRITE ( numond, namzdf_kpp )
 
       IF(lwp) THEN                    ! Control print
Index: branches/2013/dev_r3853_CNRS9_ConfSetting/NEMOGCM/NEMO/OPA_SRC/ZDF/zdfric.F90
===================================================================
--- branches/2013/dev_r3853_CNRS9_ConfSetting/NEMOGCM/NEMO/OPA_SRC/ZDF/zdfric.F90	(revision 3854)
+++ branches/2013/dev_r3853_CNRS9_ConfSetting/NEMOGCM/NEMO/OPA_SRC/ZDF/zdfric.F90	(revision 3875)
@@ -247,4 +247,5 @@
       !!----------------------------------------------------------------------
       INTEGER :: ji, jj, jk   ! dummy loop indices
+      INTEGER ::   ios        ! Local integer output status for namelist read
       !!
       NAMELIST/namzdf_ric/ rn_avmri, rn_alp   , nn_ric  , rn_ekmfc,  &
@@ -252,6 +253,12 @@
       !!----------------------------------------------------------------------
       !
-      REWIND( numnam )               ! Read Namelist namzdf_ric : richardson number dependent Kz
-      READ  ( numnam, namzdf_ric )
+      REWIND( numnam_ref )              ! Namelist namzdf_ric in reference namelist : Vertical diffusion Kz depends on Richardson number
+      READ  ( numnam_ref, namzdf_ric, IOSTAT = ios, ERR = 901)
+901   IF( ios /= 0 ) CALL ctl_nam ( ios , 'namzdf_ric in reference namelist', lwp )
+
+      REWIND( numnam_cfg )              ! Namelist namzdf_ric in configuration namelist : Vertical diffusion Kz depends on Richardson number
+      READ  ( numnam_cfg, namzdf_ric, IOSTAT = ios, ERR = 902 )
+902   IF( ios /= 0 ) CALL ctl_nam ( ios , 'namzdf_ric in configuration namelist', lwp )
+      WRITE ( numond, namzdf_ric )
       !
       IF(lwp) THEN                   ! Control print
Index: branches/2013/dev_r3853_CNRS9_ConfSetting/NEMOGCM/NEMO/OPA_SRC/ZDF/zdftke.F90
===================================================================
--- branches/2013/dev_r3853_CNRS9_ConfSetting/NEMOGCM/NEMO/OPA_SRC/ZDF/zdftke.F90	(revision 3854)
+++ branches/2013/dev_r3853_CNRS9_ConfSetting/NEMOGCM/NEMO/OPA_SRC/ZDF/zdftke.F90	(revision 3875)
@@ -692,4 +692,5 @@
       !!----------------------------------------------------------------------
       INTEGER ::   ji, jj, jk   ! dummy loop indices
+      INTEGER ::   ios
       !!
       NAMELIST/namzdf_tke/ rn_ediff, rn_ediss , rn_ebb , rn_emin  ,   &
@@ -699,6 +700,12 @@
       !!----------------------------------------------------------------------
       !
-      REWIND ( numnam )               !* Read Namelist namzdf_tke : Turbulente Kinetic Energy
-      READ   ( numnam, namzdf_tke )
+      REWIND( numnam_ref )              ! Namelist namzdf_tke in reference namelist : Turbulent Kinetic Energy
+      READ  ( numnam_ref, namzdf_tke, IOSTAT = ios, ERR = 901)
+901   IF( ios /= 0 ) CALL ctl_nam ( ios , 'namzdf_tke in reference namelist', lwp )
+
+      REWIND( numnam_cfg )              ! Namelist namzdf_tke in configuration namelist : Turbulent Kinetic Energy
+      READ  ( numnam_cfg, namzdf_tke, IOSTAT = ios, ERR = 902 )
+902   IF( ios /= 0 ) CALL ctl_nam ( ios , 'namzdf_tke in configuration namelist', lwp )
+      WRITE ( numond, namzdf_tke )
       !
       ri_cri   = 2._wp    / ( 2._wp + rn_ediss / rn_ediff )   ! resulting critical Richardson number
Index: branches/2013/dev_r3853_CNRS9_ConfSetting/NEMOGCM/NEMO/OPA_SRC/ZDF/zdftmx.F90
===================================================================
--- branches/2013/dev_r3853_CNRS9_ConfSetting/NEMOGCM/NEMO/OPA_SRC/ZDF/zdftmx.F90	(revision 3854)
+++ branches/2013/dev_r3853_CNRS9_ConfSetting/NEMOGCM/NEMO/OPA_SRC/ZDF/zdftmx.F90	(revision 3875)
@@ -354,4 +354,5 @@
       INTEGER  ::   ji, jj, jk   ! dummy loop indices
       INTEGER  ::   inum         ! local integer
+      INTEGER  ::   ios
       REAL(wp) ::   ztpc, ze_z   ! local scalars
       REAL(wp), DIMENSION(:,:)  , POINTER ::  zem2, zek1   ! read M2 and K1 tidal energy
@@ -369,6 +370,12 @@
       CALL wrk_alloc( jpi,jpj,jpk, zpc )
       
-      REWIND( numnam )               ! Read Namelist namtmx : Tidal Mixing
-      READ  ( numnam, namzdf_tmx )
+      REWIND( numnam_ref )              ! Namelist namzdf_tmx in reference namelist : Tidal Mixing
+      READ  ( numnam_ref, namzdf_tmx, IOSTAT = ios, ERR = 901)
+901   IF( ios /= 0 ) CALL ctl_nam ( ios , 'namzdf_tmx in reference namelist', lwp )
+
+      REWIND( numnam_cfg )              ! Namelist namzdf_tmx in configuration namelist : Tidal Mixing
+      READ  ( numnam_cfg, namzdf_tmx, IOSTAT = ios, ERR = 902 )
+902   IF( ios /= 0 ) CALL ctl_nam ( ios , 'namzdf_tmx in configuration namelist', lwp )
+      WRITE ( numond, namzdf_tmx )
 
       IF(lwp) THEN                   ! Control print
Index: branches/2013/dev_r3853_CNRS9_ConfSetting/NEMOGCM/NEMO/OPA_SRC/module_example
===================================================================
--- branches/2013/dev_r3853_CNRS9_ConfSetting/NEMOGCM/NEMO/OPA_SRC/module_example	(revision 3854)
+++ branches/2013/dev_r3853_CNRS9_ConfSetting/NEMOGCM/NEMO/OPA_SRC/module_example	(revision 3875)
@@ -157,4 +157,5 @@
       !!----------------------------------------------------------------------
       INTEGER ::   ji, jj, jk, jit   ! dummy loop indices
+      INTEGER  ::   ios              ! Local integer output status for namelist read
       !!
       NAMELIST/namexa/ exa_v1, exa_v2, nexa_0, sn_ex     
@@ -164,6 +165,13 @@
       sn_ex%nfreqh = 2 
       !
-      REWIND( numnam )                          ! Read Namelist namexa : example parameters
-      READ  ( numnam, namexa )
+      REWIND( numnam_ref )              ! Namelist namexa in reference namelist : Example
+      READ  ( numnam_ref, namexa, IOSTAT = ios, ERR = 901)
+901   IF( ios /= 0 ) CALL ctl_nam ( ios , 'namexa in reference namelist', lwp )
+
+      REWIND( numnam_cfg )              ! Namelist namexa in configuration namelist : Example
+      READ  ( numnam_cfg, namexa, IOSTAT = ios, ERR = 902 )
+902   IF( ios /= 0 ) CALL ctl_nam ( ios , 'namexa in configuration namelist', lwp )
+   ! Output namelist for control
+      WRITE ( numond, namexa )
       !
       IF(lwp) THEN                              ! Control print
Index: branches/2013/dev_r3853_CNRS9_ConfSetting/NEMOGCM/NEMO/OPA_SRC/nemogcm.F90
===================================================================
--- branches/2013/dev_r3853_CNRS9_ConfSetting/NEMOGCM/NEMO/OPA_SRC/nemogcm.F90	(revision 3854)
+++ branches/2013/dev_r3853_CNRS9_ConfSetting/NEMOGCM/NEMO/OPA_SRC/nemogcm.F90	(revision 3875)
@@ -218,4 +218,5 @@
       INTEGER ::   ji            ! dummy loop indices
       INTEGER ::   ilocal_comm   ! local integer
+      INTEGER ::   ios
       CHARACTER(len=80), DIMENSION(16) ::   cltxt
       !!
@@ -227,8 +228,17 @@
       cltxt = ''
       !
-      !                             ! open Namelist file
-      CALL ctl_opn( numnam, 'namelist', 'OLD', 'FORMATTED', 'SEQUENTIAL', -1, 6, .FALSE. )
-      !
-      READ( numnam, namctl )        ! Namelist namctl : Control prints & Benchmark
+      !                             ! Open reference namelist and configuration namelist files
+      CALL ctl_opn( numnam_ref, 'namelist_ref', 'OLD', 'FORMATTED', 'SEQUENTIAL', -1, 6, .FALSE. )
+      CALL ctl_opn( numnam_cfg, 'namelist_cfg', 'OLD', 'FORMATTED', 'SEQUENTIAL', -1, 6, .FALSE. )
+      CALL ctl_opn( numond, 'output.namelist.dyn', 'REPLACE', 'FORMATTED', 'SEQUENTIAL', -1, 6, .FALSE., narea )
+      !
+      REWIND( numnam_ref )              ! Namelist namctl in reference namelist : Control prints & Benchmark
+      READ  ( numnam_ref, namctl, IOSTAT = ios, ERR = 901 )
+901   IF( ios /= 0 ) CALL ctl_nam ( ios , 'namctl in reference namelist', lwp )
+
+      REWIND( numnam_cfg )              ! Namelist namctl in confguration namelist : Control prints & Benchmark
+      READ  ( numnam_cfg, namctl, IOSTAT = ios, ERR = 902 )
+902   IF( ios /= 0 ) CALL ctl_nam ( ios , 'namctl in configuration namelist', lwp )
+      WRITE( numond, namctl )
       !
       !                             !--------------------------------------------!
@@ -244,5 +254,5 @@
 # endif
       ENDIF
-      narea = mynode( cltxt, numnam, nstop, ilocal_comm )   ! Nodes selection
+      narea = mynode( cltxt, numnam_ref, numnam_cfg, numond , nstop, ilocal_comm )   ! Nodes selection
 #else
 # if defined key_oasis3 || defined key_oasis4
@@ -250,8 +260,8 @@
          CALL cpl_prism_init( ilocal_comm )                 ! nemo local communicator given by oasis
       ENDIF
-      narea = mynode( cltxt, numnam, nstop, ilocal_comm )   ! Nodes selection (control print return in cltxt)
+      narea = mynode( cltxt, numnam_ref, numnam_cfg, numond , nstop, ilocal_comm )   ! Nodes selection (control print return in cltxt)
 # else
       ilocal_comm = 0
-      narea = mynode( cltxt, numnam, nstop )                 ! Nodes selection (control print return in cltxt)
+      narea = mynode( cltxt, numnam_ref, numnam_cfg, numond , nstop )                 ! Nodes selection (control print return in cltxt)
 # endif
 #endif
@@ -510,13 +520,15 @@
       CALL iom_close                                 ! close all input/output files managed by iom_*
       !
-      IF( numstp      /= -1 )   CLOSE( numstp      )   ! time-step file
-      IF( numsol      /= -1 )   CLOSE( numsol      )   ! solver file
-      IF( numnam      /= -1 )   CLOSE( numnam      )   ! oce namelist
-      IF( numnam_ice  /= -1 )   CLOSE( numnam_ice  )   ! ice namelist
-      IF( numevo_ice  /= -1 )   CLOSE( numevo_ice  )   ! ice variables (temp. evolution)
-      IF( numout      /=  6 )   CLOSE( numout      )   ! standard model output file
-      IF( numdct_vol  /= -1 )   CLOSE( numdct_vol  )   ! volume transports
-      IF( numdct_heat /= -1 )   CLOSE( numdct_heat )   ! heat transports
-      IF( numdct_salt /= -1 )   CLOSE( numdct_salt )   ! salt transports
+      IF( numstp          /= -1 )   CLOSE( numstp          )   ! time-step file
+      IF( numsol          /= -1 )   CLOSE( numsol          )   ! solver file
+      IF( numnam_ref      /= -1 )   CLOSE( numnam_ref      )   ! oce reference namelist
+      IF( numnam_cfg      /= -1 )   CLOSE( numnam_cfg      )   ! oce configuration namelist
+      IF( numnam_ice_ref  /= -1 )   CLOSE( numnam_ice_ref  )   ! ice reference namelist
+      IF( numnam_ice_cfg  /= -1 )   CLOSE( numnam_ice_cfg  )   ! ice configuration namelist
+      IF( numevo_ice      /= -1 )   CLOSE( numevo_ice      )   ! ice variables (temp. evolution)
+      IF( numout          /=  6 )   CLOSE( numout          )   ! standard model output file
+      IF( numdct_vol      /= -1 )   CLOSE( numdct_vol      )   ! volume transports
+      IF( numdct_heat     /= -1 )   CLOSE( numdct_heat     )   ! heat transports
+      IF( numdct_salt     /= -1 )   CLOSE( numdct_salt     )   ! salt transports
 
       !
