Index: branches/2016/dev_r7012_ROBUST5_CNRS/NEMOGCM/NEMO/TOP_SRC/trcnam.F90
===================================================================
--- branches/2016/dev_r7012_ROBUST5_CNRS/NEMOGCM/NEMO/TOP_SRC/trcnam.F90	(revision 7068)
+++ branches/2016/dev_r7012_ROBUST5_CNRS/NEMOGCM/NEMO/TOP_SRC/trcnam.F90	(revision 7097)
@@ -35,4 +35,6 @@
    PUBLIC trc_nam      ! called in trcini
 
+   TYPE(PTRACER), DIMENSION(jpmaxtrc), PUBLIC  :: sn_tracer  ! type of tracer for saving if not key_iomput
+
    !!----------------------------------------------------------------------
    !! NEMO/TOP 3.3 , NEMO Consortium (2010)
@@ -58,5 +60,4 @@
       CALL trc_nam_trc     ! passive tracer informations
       !                                        
-      !
       IF( ln_rsttr                     )   ln_trcdta     = .FALSE.   ! restart : no need of clim data
       !
@@ -82,42 +83,14 @@
          ENDIF
       ENDIF
-
-      
-      rdttrc = rdt * FLOAT( nn_dttrc )   ! passive tracer time-step
-  
-      IF(lwp) THEN                   ! control print
+      !
+      rdttrc = rdt * FLOAT( nn_dttrc )          ! passive tracer time-step
+      ! 
+      IF(lwp) THEN                              ! control print
         WRITE(numout,*) 
         WRITE(numout,*) '    Passive Tracer  time step    rdttrc  = ', rdttrc
         WRITE(numout,*) 
       ENDIF
-
-
+      !
       IF( l_trdtrc )        CALL trc_nam_trd    ! Passive tracer trends
-
-                             
-                            CALL trc_nam_ice  ! ice module for tracerd
-
-      ! namelist of SMS
-      ! ---------------      
-      IF( ln_age     ) THEN   ;   CALL trc_nam_age         ! AGE     tracer
-      ELSE                    ;   IF(lwp) WRITE(numout,*) '          AGE not used'
-      ENDIF
-
-      IF( ll_cfc     ) THEN   ;   CALL trc_nam_cfc         ! CFC     tracers
-      ELSE                    ;   IF(lwp) WRITE(numout,*) '          CFC not used'
-      ENDIF
-
-      IF( ln_c14     ) THEN   ;   CALL trc_nam_c14         ! C14     tracers
-      ELSE                    ;   IF(lwp) WRITE(numout,*) '          C14 not used'
-      ENDIF
-
-      IF( ln_pisces  ) THEN   ;   CALL trc_nam_pisces      ! PISCES  bio-model
-      ELSE                    ;   IF(lwp) WRITE(numout,*) '          PISCES not used'
-      ENDIF
-
-
-      IF( ln_my_trc  ) THEN   ;   CALL trc_nam_my_trc      ! MY_TRC  tracers
-      ELSE                    ;   IF(lwp) WRITE(numout,*) '          MY_TRC not used'
-      ENDIF
       !
    END SUBROUTINE trc_nam
@@ -176,17 +149,16 @@
       !!
       !!---------------------------------------------------------------------
-      INTEGER  ::   ios, ierr, ioptio, icfc     ! Local integer output status for namelist read
-      INTEGER  ::   jn                    ! dummy loop indice
-      !
-      TYPE(PTRACER), DIMENSION(jpmaxtrc) :: sn_tracer  ! type of tracer for saving if not key_iomput
-      TYPE(STRACER), DIMENSION(jpmaxtrc) :: bc_tracer  ! type of tracer for saving if not key_iomput
+      INTEGER  ::   ios, ierr, icfc       ! Local integer output status for namelist read
       !!
       NAMELIST/namtrc/jptra, ln_pisces, ln_my_trc, ln_age, ln_cfc11, ln_cfc12, ln_c14, &
          &            sn_tracer, ln_trcdta, ln_trcdmp, ln_trcdmp_clo
       !!---------------------------------------------------------------------
+      ! Dummy settings to fill tracers data structure
+      !                  !   name   !   title   !   unit   !   init  !   sbc   !   cbc   !   obc  !
+      sn_tracer = PTRACER( 'NONAME' , 'NOTITLE' , 'NOUNIT' , .false. , .false. , .false. , .false.)
+      !
       IF(lwp) WRITE(numout,*)
       IF(lwp) WRITE(numout,*) 'trc_nam_trc : read the passive tracer namelists'
       IF(lwp) WRITE(numout,*) '~~~~~~~'
-
 
       REWIND( numnat_ref )              ! Namelist namtrc in reference namelist : Passive tracer variables
@@ -199,13 +171,8 @@
       IF(lwm) WRITE ( numont, namtrc )
 
-      ioptio = 0
-      IF( ln_pisces )    ioptio = ioptio + 1
-      IF( ln_my_trc )    ioptio = ioptio + 1
-      !
-      IF( ioptio == 2 )   CALL ctl_stop( 'Choose only ONE BGC model - PISCES or MY_TRC' )
-      IF( ioptio == 0 )   jptra = 0
-
+      ! Control settings
+      IF( ln_pisces .AND. ln_my_trc )   CALL ctl_stop( 'Choose only ONE BGC model - PISCES or MY_TRC' )
+      IF( .NOT. ln_pisces .AND. .NOT. ln_my_trc )   jptra = 0
       ll_cfc = ln_cfc11 .OR. ln_cfc12
-  
       !
       jp_pisces   =  0    ;   jp_pcs0  =  0    ;   jp_pcs1  = 0
@@ -213,4 +180,5 @@
       jp_cfc      =  0    ;   jp_cfc0  =  0    ;   jp_cfc1  = 0
       jp_age      =  0    ;   jp_c14   = 0
+      !
       IF( ln_pisces )  THEN
          jp_pisces = jptra
@@ -241,5 +209,7 @@
            jp_c14    = jptra
       ENDIF
-
+      !
+      IF( jptra == 0 )   CALL ctl_stop( 'All TOP tracers disabled: change namtrc setting or check if key_top is active' )
+      !
       IF(lwp) THEN                   ! control print
          WRITE(numout,*)
@@ -247,46 +217,18 @@
          WRITE(numout,*) '   Total number of passive tracers              jptra         = ', jptra
          WRITE(numout,*) '   Simulating PISCES model                      ln_pisces     = ', ln_pisces
+         WRITE(numout,*) '   Simulating MY_TRC  model                     ln_my_trc     = ', ln_my_trc
          WRITE(numout,*) '   Simulating water mass age                    ln_age        = ', ln_age
          WRITE(numout,*) '   Simulating CFC11 passive tracer              ln_cfc11      = ', ln_cfc11
          WRITE(numout,*) '   Simulating CFC12 passive tracer              ln_cfc12      = ', ln_cfc12
          WRITE(numout,*) '   Simulating C14   passive tracer              ln_c14        = ', ln_c14
-         WRITE(numout,*) '   Simulating MY_TRC  model                     ln_my_trc     = ', ln_my_trc
          WRITE(numout,*) '   Read inputs data from file (y/n)             ln_trcdta     = ', ln_trcdta
          WRITE(numout,*) '   Damping of passive tracer (y/n)              ln_trcdmp     = ', ln_trcdmp
          WRITE(numout,*) '   Restoring of tracer on closed seas           ln_trcdmp_clo = ', ln_trcdmp_clo
+         WRITE(numout,*) '   Total number of BGC-like tracers             jp_bgc        = ', jp_bgc
          WRITE(numout,*) ' '
          WRITE(numout,*) ' '
       ENDIF
       !
-      ALLOCATE( ctrcnm(jptra)      , ctrcln(jptra) , ctrcun(jptra)       , ln_trc_ini(jptra),          &
-#if defined key_bdy
-         &      cn_trc_dflt(nb_bdy), cn_trc(nb_bdy), nn_trcdmp_bdy(nb_bdy), trcdta_bdy(jptra,nb_bdy),  &
-#endif
-         &      ln_trc_sbc(jptra), ln_trc_cbc(jptra), ln_trc_obc(jptra), STAT = ierr  )
-      !
       IF( ierr /= 0 )   CALL ctl_stop( 'STOP', 'trc_nam_ice: unable to allocate arrays' )
-      !
-      DO jn = 1, jp_bgc
-         ctrcnm    (jn) = TRIM( sn_tracer(jn)%clsname )
-         ctrcln    (jn) = TRIM( sn_tracer(jn)%cllname )
-         ctrcun    (jn) = TRIM( sn_tracer(jn)%clunit  )
-         ln_trc_ini(jn) =       sn_tracer(jn)%llinit
-      END DO
-      !
-      IF( ln_my_trc ) THEN
-         DO jn = 1, jp_bgc
-           ln_trc_sbc(jn) =  bc_tracer(jn)%llsbc
-           ln_trc_cbc(jn) =  bc_tracer(jn)%llcbc
-           ln_trc_obc(jn) =  bc_tracer(jn)%llobc
-         END DO
-      ENDIF
-      !
-      IF(lwp) THEN                   ! control print
-         DO jn = 1, jp_bgc
-            WRITE(numout,*) '  tracer nb : ', jn, '    short name : ', ctrcnm(jn)
-         END DO
-         WRITE(numout,*) ' '
-      ENDIF
-      !
       !
       IF( ln_age .OR. ll_cfc .OR. ln_c14 ) THEN
@@ -299,61 +241,4 @@
 
    END SUBROUTINE trc_nam_trc
-
-
-   SUBROUTINE trc_nam_ice
-      !!---------------------------------------------------------------------
-      !!                     ***  ROUTINE trc_nam_ice ***
-      !!
-      !! ** Purpose :   Read the namelist for the ice effect on tracers
-      !!
-      !! ** Method  : -
-      !!
-      !!---------------------------------------------------------------------
-      INTEGER :: jn      ! dummy loop indices
-      INTEGER :: ios, ierr     ! Local integer output status for namelist read
-      !
-      TYPE(TRC_I_NML), DIMENSION(jpmaxtrc) :: sn_tri_tracer  ! type of tracer for saving if not key_iomput
-      !!
-      NAMELIST/namtrc_ice/ nn_ice_tr, sn_tri_tracer
-      !!---------------------------------------------------------------------
-      !
-      IF(lwp) THEN
-         WRITE(numout,*)
-         WRITE(numout,*) 'trc_nam_ice : Read the namelist for trc_ice'
-         WRITE(numout,*) '~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~'
-      ENDIF
-
-      IF( nn_timing == 1 )  CALL timing_start('trc_nam_ice')
-
-      !
-      REWIND( numnat_ref )              ! Namelist namtrc_ice in reference namelist : Passive tracer input data
-      READ  ( numnat_ref, namtrc_ice, IOSTAT = ios, ERR = 901)
- 901  IF( ios /= 0 ) CALL ctl_nam ( ios , ' namtrc_ice in reference namelist ', lwp )
-
-      REWIND( numnat_cfg )              ! Namelist namtrc_ice in configuration namelist : Pisces external sources of nutrients
-      READ  ( numnat_cfg, namtrc_ice, IOSTAT = ios, ERR = 902 )
- 902  IF( ios /= 0 ) CALL ctl_nam ( ios , 'namtrc_ice in configuration namelist', lwp )
-
-      IF( lwp ) THEN
-         WRITE(numout,*) ' '
-         WRITE(numout,*) ' Sea ice tracers option (nn_ice_tr) : ', nn_ice_tr
-         WRITE(numout,*) ' '
-      ENDIF
-
-      ALLOCATE( trc_ice_ratio(jptra), trc_ice_prescr(jptra), cn_trc_o(jptra), STAT = ierr  )
-      IF( ierr /= 0 )   CALL ctl_stop( 'STOP', 'trc_nam_ice: unable to allocate arrays' )
-      !
-      ! Assign namelist stuff
-      DO jn = 1, jptra
-         trc_ice_ratio (jn) = sn_tri_tracer(jn)%trc_ratio
-         trc_ice_prescr(jn) = sn_tri_tracer(jn)%trc_prescr
-         cn_trc_o      (jn) = sn_tri_tracer(jn)%ctrc_o
-      END DO
-
-      IF( nn_timing == 1 )   CALL timing_stop('trc_nam_ice')
-      !
-   END SUBROUTINE trc_nam_ice
-
-
 
    SUBROUTINE trc_nam_trd
