Index: anches/NERC/dev_r5518_NOC_MEDUSA_Stable/NEMOGCM/NEMO/TOP_SRC/IDTRA/trcctl_idtra.F90
===================================================================
--- /branches/NERC/dev_r5518_NOC_MEDUSA_Stable/NEMOGCM/NEMO/TOP_SRC/IDTRA/trcctl_idtra.F90	(revision 6045)
+++ 	(revision )
@@ -1,105 +1,0 @@
-MODULE trcctl_idtra
-   !!======================================================================
-   !!                         ***  trcctl.idtra.F90  ***
-   !! TOP :                Control of IDEAL-TRA chemical model
-   !!======================================================================
-   !!----------------------------------------------------------------------
-   !! History :   1.0  !  2005-10 (C. Ethe) assign a parameter to name individual tracers
-   !!----------------------------------------------------------------------
-
-#if defined key_idtra
-
-   USE oce_trc
-   USE trc
-
-
-   IMPLICIT NONE
-   PRIVATE
-
-   PUBLIC trc_ctl_idtra      ! called by ???
-
-   !!----------------------------------------------------------------------
-   !! NEMO/TOP 1.0 , LOCEAN-IPSL (2005)
-   !! $Id$
-   !! Software governed by the CeCILL licence (modipsl/doc/NEMO_CeCILL.txt)
-   !!----------------------------------------------------------------------
-
-CONTAINS
-
-   SUBROUTINE trc_ctl_idtra
-      !!----------------------------------------------------------------------
-      !!                     ***  ROUTINE trc_ctl_idtra  ***
-      !!
-      !! ** Purpose :   control the cpp options, namelist and files
-      !!----------------------------------------------------------------------
-      INTEGER :: jl, jn
-
-      IF(lwp) THEN
-          WRITE(numout,*) ' IDEAL-TRA Model '
-          WRITE(numout,*) ' '
-      ENDIF
-
-      ! Check number of tracers
-      ! -----------------------
-      IF( jp_idtra > 5) THEN
-          IF(lwp) THEN
-              WRITE (numout,*) ' ===>>>> : w a r n i n g '
-              WRITE (numout,*) ' =======   ============= '
-              WRITE (numout,*)                             &
-              &   ' STOP, change jp_idtra to 1 in par_IDEAL-TRA module '
-          END IF
-          STOP 'TRC_CTL'
-      END IF
-
-      ! Check tracer names
-      ! ------------------
-      IF ( ctrcnm(jpidtra) /= 'Ideal-Tracer' ) THEN
-            ctrcnm(jpidtra) = 'Ideal-Tracer'
-            ctrcln(jpidtra) = 'Ideal-Tracer concentration'
-      ENDIF
-
-      IF(lwp) THEN
-         WRITE (numout,*) ' ===>>>> : w a r n i n g '
-         WRITE (numout,*) ' =======   ============= '
-         WRITE (numout,*) ' we force tracer names'
-         DO jl = 1, jp_idtra
-            jn = jp_idtra0 + jl - 1
-            WRITE(numout,*) ' tracer nb: ',jn,' name = ',ctrcnm(jn), ctrcln(jn)
-         END DO
-         WRITE(numout,*) ' '
-      ENDIF
-
-
-      ! Check tracer units
-      ! ------------------
-      DO jl = 1, jp_idtra
-         jn = jp_idtra0 + jl - 1
-        IF( ctrcun(jn) /= 'unit' ) THEN
-            ctrcun(jn) = 'unit'
-            IF(lwp) THEN
-               WRITE (numout,*) ' ===>>>> : w a r n i n g '
-               WRITE (numout,*) ' =======   ============= '
-               WRITE (numout,*) ' we force tracer unit'
-               WRITE(numout,*) ' tracer  ',ctrcnm(jn), 'UNIT= ',ctrcun(jn)
-               WRITE(numout,*) ' '
-            ENDIF
-         ENDIF
-      END DO
-      !
-   END SUBROUTINE trc_ctl_idtra
-
-#else
-   !!----------------------------------------------------------------------
-   !!  Empty module :                                                No IDEAL-TRA
-   !!----------------------------------------------------------------------
-CONTAINS
-   SUBROUTINE trc_ctl_idtra                      ! Dummy routine
-   END SUBROUTINE trc_ctl_idtra
-#endif
-
-   !!======================================================================
-END MODULE trcctl_idtra
-
-
-
-
Index: /branches/NERC/dev_r5518_NOC_MEDUSA_Stable/NEMOGCM/NEMO/TOP_SRC/IDTRA/trcice_idtra.F90
===================================================================
--- /branches/NERC/dev_r5518_NOC_MEDUSA_Stable/NEMOGCM/NEMO/TOP_SRC/IDTRA/trcice_idtra.F90	(revision 6046)
+++ /branches/NERC/dev_r5518_NOC_MEDUSA_Stable/NEMOGCM/NEMO/TOP_SRC/IDTRA/trcice_idtra.F90	(revision 6046)
@@ -0,0 +1,53 @@
+MODULE trcice_idtra
+   !!======================================================================
+   !!                         ***  MODULE trcice_idtra  ***
+   !! TOP :   Main module of the MY_TRC tracers
+   !!======================================================================
+   !! History :   2.0  !  2007-12  (C. Ethe, G. Madec) Original code
+   !!----------------------------------------------------------------------
+#if defined key_idtra
+   !!----------------------------------------------------------------------
+   !!   'key_idtra'                                    IDEAL TRACER tracers
+   !!----------------------------------------------------------------------
+   !! trc_ice_idtra       : MY_TRC model main routine
+   !!----------------------------------------------------------------------
+   USE par_trc         ! TOP parameters
+   USE oce_trc         ! Ocean variables
+   USE trc             ! TOP variables
+
+   IMPLICIT NONE
+   PRIVATE
+
+   PUBLIC   trc_ice_ini_idtra       ! called by trcice.F90 module
+
+   !!----------------------------------------------------------------------
+   !! NEMO/TOP 3.3 , NEMO Consortium (2010)
+   !! $Id$
+   !! Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt)
+   !!----------------------------------------------------------------------
+CONTAINS
+
+   SUBROUTINE trc_ice_ini_idtra
+      !!----------------------------------------------------------------------
+      !!                     ***  trc_ice_idtra  ***
+      !!
+      !! ** Purpose :   main routine of MY_TRC model
+      !!
+      !! ** Method  : -
+      !!----------------------------------------------------------------------
+      !
+      !
+   END SUBROUTINE trc_ice_ini_idtra
+
+
+#else
+   !!----------------------------------------------------------------------
+   !!   Dummy module                                        No MY_TRC model
+   !!----------------------------------------------------------------------
+CONTAINS
+   SUBROUTINE trc_ice_ini_idtra             ! Empty routine
+   END SUBROUTINE trc_ice_ini_idtra
+#endif
+
+   !!======================================================================
+END MODULE trcice_idtra
Index: /branches/NERC/dev_r5518_NOC_MEDUSA_Stable/NEMOGCM/NEMO/TOP_SRC/IDTRA/trcini_idtra.F90
===================================================================
--- /branches/NERC/dev_r5518_NOC_MEDUSA_Stable/NEMOGCM/NEMO/TOP_SRC/IDTRA/trcini_idtra.F90	(revision 6045)
+++ /branches/NERC/dev_r5518_NOC_MEDUSA_Stable/NEMOGCM/NEMO/TOP_SRC/IDTRA/trcini_idtra.F90	(revision 6046)
@@ -16,8 +16,8 @@
    USE trc             ! TOP variables
    USE trcsms_idtra    ! IDEAL-TRACER sms trends
-   USE par_idtra       ! IDEAL-TRACER parameters
-   USE in_out_manager  ! I/O manager
-   USE lib_mpp
-   USE iom
+   ! USE par_idtra       ! IDEAL-TRACER parameters
+   ! USE in_out_manager  ! I/O manager
+   ! USE lib_mpp
+   ! USE iom
 
    IMPLICIT NONE
Index: /branches/NERC/dev_r5518_NOC_MEDUSA_Stable/NEMOGCM/NEMO/TOP_SRC/IDTRA/trcnam_idtra.F90
===================================================================
--- /branches/NERC/dev_r5518_NOC_MEDUSA_Stable/NEMOGCM/NEMO/TOP_SRC/IDTRA/trcnam_idtra.F90	(revision 6045)
+++ /branches/NERC/dev_r5518_NOC_MEDUSA_Stable/NEMOGCM/NEMO/TOP_SRC/IDTRA/trcnam_idtra.F90	(revision 6046)
@@ -15,6 +15,6 @@
    USE par_trc         ! TOP parameters
    USE trc             ! TOP variables
-   USE trcsms_idtra      ! IDEAL-TRACER specific variable
-   USE in_out_manager  ! I/O manager
+   USE trcsms_idtra    ! IDEAL-TRACER specific variable
+   USE iom             ! I/O manager
 
    IMPLICIT NONE
@@ -42,28 +42,21 @@
       !! ** input   :   Namelist namidtra
       !!----------------------------------------------------------------------
-      REAL(wp) ::   tmp_decay          !! Years ; half time decay of our idealize tracer
-      REAL(wp) ::   TDECyr, TDEC   
-      CHARACTER(LEN=32)   ::   clname
-      !! 
+      INTEGER  :: numnatm_ref = -1   ! Logical unit for reference ID-TRA namelist
+      INTEGER  :: numnatm_cfg = -1   ! Logical unit for configuration ID-TRA namelist
+      INTEGER  :: numonc      = -1   ! Logical unit for output namelist
+      INTEGER  :: ios                 ! Local integer output status for namelist read
+      REAL(wp) :: tmp_decay          !! Years ; half time decay of our idealize tracer
+      REAL(wp) :: TDECyr, TDEC   
+      !! ----------------------------------------------------------------
       NAMELIST/namidtra/tmp_decay
-!! #if defined key_trc_diaadd
-!!      ! definition of additional diagnostic as a structure
-!!      INTEGER :: jl, jn
-!!
-!! #endif
-      !!
-
-!!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-!! Jpalm -- 4-11-2014
-!! namelist for idealize tracer
-!! only thing in namelist is the chosen half time decay
-!! no atmospheric conditions, cause we do impose a surface concentration of 1,
-!! and no additionnal diagnostics, 
-!! because the only thing we are interested in is the water mass concentration on this tracer.
-!!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-
-
+      !!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+      !! Jpalm -- 4-11-2014
+      !! namelist for idealize tracer
+      !! only thing in namelist is the chosen half time decay
+      !! no atmospheric conditions, cause we do impose a surface concentration of 1,
+      !! and no additionnal diagnostics, 
+      !! because the only thing we are interested in is the water mass concentration on this tracer.
+      !!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
       IF(lwp) WRITE(numout,*)
-      clname = 'namelist_idtra'
       IF(lwp) WRITE(numout,*) ' trc_nam_idtra: read IDEAL-TRACER namelist'
       IF(lwp) WRITE(numout,*) ' ~~~~~~~~~~~~~~'
@@ -71,6 +64,7 @@
       !! Open the namelist file :
       !!~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-      CALL ctl_opn( numnatm, TRIM( clname ), 'OLD', 'FORMATTED', 'SEQUENTIAL', -1, numout, .FALSE. )
-
+      CALL ctl_opn( numnatm_ref, 'namelist_idtra_ref', 'OLD', 'FORMATTED', 'SEQUENTIAL', -1, numout, .FALSE. )
+      CALL ctl_opn( numnatm_cfg, 'namelist_idtra_cfg', 'OLD', 'FORMATTED', 'SEQUENTIAL', -1, numout, .FALSE. )
+      IF(lwm) CALL ctl_opn( numonc, 'output.namelist.idtra', 'UNKNOWN', 'FORMATTED', 'SEQUENTIAL', -1, numout, .FALSE. )
       !! Read the namelists :
       !!~~~~~~~~~~~~~~~~~~~~~~~
@@ -79,5 +73,13 @@
       !! tmp_decay = 1y ; 10y ; 100y or 1000y depending of which water mass you want to track
       !!~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-      READ(numnatm,namidtra)
+
+      REWIND( numnatm_ref )              ! Namelist namidtra in reference namelist : IDTRA parameters
+      READ  ( numnatm_ref, namidtra, IOSTAT = ios, ERR = 901)
+901   IF( ios /= 0 ) CALL ctl_nam ( ios , 'namidtra in reference namelist', lwp )
+
+      REWIND( numnatm_cfg )              ! Namelist namidtra in configuration namelist : IDTRA parameters
+      READ  ( numnatm_cfg, namidtra, IOSTAT = ios, ERR = 902 )
+902   IF( ios /= 0 ) CALL ctl_nam ( ios , 'namidtra in configuration namelist', lwp )
+      IF(lwm) WRITE ( numonc, namidtra )
 
       IF(lwp) WRITE(numout,*) '   -  half time decay of our idealize tracer : ', tmp_decay
Index: /branches/NERC/dev_r5518_NOC_MEDUSA_Stable/NEMOGCM/NEMO/TOP_SRC/IDTRA/trcsms_idtra.F90
===================================================================
--- /branches/NERC/dev_r5518_NOC_MEDUSA_Stable/NEMOGCM/NEMO/TOP_SRC/IDTRA/trcsms_idtra.F90	(revision 6045)
+++ /branches/NERC/dev_r5518_NOC_MEDUSA_Stable/NEMOGCM/NEMO/TOP_SRC/IDTRA/trcsms_idtra.F90	(revision 6046)
@@ -18,5 +18,5 @@
    USE par_trc      ! TOP parameters
    USE trc          ! TOP variables
-   USE trdtrc_oce
+   USE trd_oce
    USE trdtrc
    USE iom
@@ -29,5 +29,4 @@
    INTEGER , PUBLIC    ::   nyear_res      ! restoring time constant (year)
    INTEGER , PUBLIC    ::   numnatm
-
    REAL(wp), PUBLIC    ::   FDEC
    !                          ! coefficients for conversion
Index: /branches/NERC/dev_r5518_NOC_MEDUSA_Stable/NEMOGCM/NEMO/TOP_SRC/IDTRA/trcwri_idtra.F90
===================================================================
--- /branches/NERC/dev_r5518_NOC_MEDUSA_Stable/NEMOGCM/NEMO/TOP_SRC/IDTRA/trcwri_idtra.F90	(revision 6045)
+++ /branches/NERC/dev_r5518_NOC_MEDUSA_Stable/NEMOGCM/NEMO/TOP_SRC/IDTRA/trcwri_idtra.F90	(revision 6046)
@@ -13,8 +13,8 @@
    !! trc_wri_idtra   :  outputs of concentration fields
    !!----------------------------------------------------------------------
-   USE oce_trc         ! Ocean variables
-   USE par_trc         ! TOP parameters
+   ! USE oce_trc         ! Ocean variables
+   ! USE par_trc         ! TOP parameters
    USE trc             ! passive tracers common variables
-   USE trcsms_idtra    ! IDEALIZE TRACER sms trends
+   ! USE trcsms_idtra    ! IDEALIZE TRACER sms trends
    USE iom             ! I/O manager
 
Index: /branches/NERC/dev_r5518_NOC_MEDUSA_Stable/NEMOGCM/NEMO/TOP_SRC/trcwri.F90
===================================================================
--- /branches/NERC/dev_r5518_NOC_MEDUSA_Stable/NEMOGCM/NEMO/TOP_SRC/trcwri.F90	(revision 6045)
+++ /branches/NERC/dev_r5518_NOC_MEDUSA_Stable/NEMOGCM/NEMO/TOP_SRC/trcwri.F90	(revision 6046)
@@ -83,6 +83,14 @@
 # endif
       !
-      !!! JPALM
-      !!! don't forget to add idtra 
+      IF( lk_idtra   )   CALL trc_wri_idtra       ! Idealize tracers
+      !
+# if defined key_debug_medusa
+      CALL flush(numout)
+      IF (lwp) write (numout,*) '------------------------------'
+      IF (lwp) write (numout,*) 'Jpalm - debug'
+      IF (lwp) write (numout,*) 'CALL trc_wri_idtra -- OK'
+      IF (lwp) write (numout,*) ' '
+      CALL flush(numout)
+# endif
       !
       IF( nn_timing == 1 )  CALL timing_stop('trc_wri')
