Index: branches/NERC/dev_r5518_GO6_Carb_Debug/NEMOGCM/NEMO/TOP_SRC/MEDUSA/bio_medusa_fin.F90
===================================================================
--- branches/NERC/dev_r5518_GO6_Carb_Debug/NEMOGCM/NEMO/TOP_SRC/MEDUSA/bio_medusa_fin.F90	(revision 8643)
+++ branches/NERC/dev_r5518_GO6_Carb_Debug/NEMOGCM/NEMO/TOP_SRC/MEDUSA/bio_medusa_fin.F90	(revision 8649)
@@ -33,5 +33,6 @@
       !!----------------------------------------------------------------------
       USE bio_medusa_mod
-      USE dom_oce,           ONLY: atfp, atfp1, neuler, rdt, e3t_n, tmask
+      USE dom_oce,           ONLY: atfp, atfp1, neuler, rdt,            &
+                                   e3t_0, e3t_n, tmask
       USE in_out_manager,    ONLY: lwp, numout
 # if defined key_iomput
@@ -55,4 +56,7 @@
       USE trcnam_trp,        ONLY: ln_trcadv_cen2, ln_trcadv_tvd
  
+   !!* Substitution
+#  include "domzgr_substitute.h90"
+
       !! time (integer timestep)
       INTEGER, INTENT( in ) ::    kt
@@ -61,5 +65,5 @@
       INTEGER :: jn
 
-      REAL(wp) :: fq0,fq1,fq2,fq3
+      REAL(wp) :: fq0,fq1,fq2,fq3,fq4
 
 # if defined key_roam                     
@@ -148,5 +152,5 @@
                   fq2 = fq0 + fq1
                   fq3 = f_benout_n(ji,jj)
-                  if (lwp) write (numout,'a,2i3,a,4f15,5)')                   &
+                  if (lwp) write (numout,'(a,2i3,a,4f15.5)')                     &
                      'AXY N   cons: (i,j)=',ji,jj,', (flx,ben,err,out)=',      &
                      fq0,fq1,fq2,fq3
@@ -162,5 +166,5 @@
                   fq2 = fq0 + fq1
                   fq3 = f_benout_si(ji,jj)
-                  if (lwp) write (numout,'a,2i3,a,4f15,5)')                   &
+                  if (lwp) write (numout,'(a,2i3,a,4f15.5)')                    &
                      'AXY Si  cons: (i,j)=',ji,jj,', (flx,ben,err,out)=',     &
                      fq0,fq1,fq2,fq3
@@ -177,5 +181,5 @@
                   fq3 = fq0 + fq1
                   fq4 = f_benout_c(ji,jj) + f_benout_ca(ji,jj)
-                  if (lwp) write (numout,'a,2i3,a,5f15,5)')                   &
+                  if (lwp) write (numout,'(a,2i3,a,5f15.5)')                    &
                      'AXY C   cons: (i,j)=',ji,jj,', (flx,ben,asf,err,out)=', &
                      fq0,fq1,fq2,fq3,fq4
@@ -191,5 +195,5 @@
                    fq2 = fq0 + fq1
                    fq3 = 2.0 * f_benout_ca(ji,jj)
-                   if (lwp) write (numout,'a,2i3,a,4f15,5)')                   &
+                   if (lwp) write (numout,'(a,2i3,a,4f15.5)')                    &
                       'AXY alk cons: (i,j)=',ji,jj,', (flx,ben,err,out)=',     &
                       fq0,fq1,fq2,fq3
Index: branches/NERC/dev_r5518_GO6_Carb_Debug/NEMOGCM/NEMO/TOP_SRC/MEDUSA/trcbio_medusa.F90
===================================================================
--- branches/NERC/dev_r5518_GO6_Carb_Debug/NEMOGCM/NEMO/TOP_SRC/MEDUSA/trcbio_medusa.F90	(revision 8643)
+++ branches/NERC/dev_r5518_GO6_Carb_Debug/NEMOGCM/NEMO/TOP_SRC/MEDUSA/trcbio_medusa.F90	(revision 8649)
@@ -181,4 +181,5 @@
       REAL(wp) ::    sumtsn, tsnavg
       INTEGER  ::    summask
+      CHARACTER(25) :: charout, charout2, charout3
       !!
       !!------------------------------------------------------------------
@@ -477,7 +478,9 @@
 	          !! AXY (28/02/14): check input fields
                   if (ztmp(ji,jj) .lt. -3.0 .or. ztmp(ji,jj) .gt. 40.0 ) then
+                     write(charout,*)  tsn(ji,jj,jk,jp_tem)
+                     write(charout2,*) mig(ji), mjg(jj), jk, kt 
                      Call ctl_warn(' trc_bio_medusa: T WARNING 3D : ',       &
-                                   tsn(ji,jj,jk,jp_tem), 'at I, J, K, kt :', & 
-                                   mig(ji), mjg(jj), jk, kt )
+                                   TRIM(charout), 'at I, J, K, kt :',        & 
+                                   TRIM(charout2) )
 # if defined key_debug_medusa
                      !! temperature
@@ -543,19 +546,21 @@
                           ( tsnavg .GT. 40.0 ) ) THEN    
                         IF (ztmp(ji,jj) .LT. -3.0 ) THEN
-                           CALL ctl_warn(                                    &
-                           ' trc_bio_medusa: T SWITCHING 3D, ',              &
-                           tsn(ji,jj,jk,jp_tem), ' -> -3.0 ' )
+                           write(charout,*)  tsn(ji,jj,jk,jp_tem)
+                           Call ctl_warn(' trc_bio_medusa: T SWITCHING 3D : ',     &
+                                        TRIM(charout), ' -> -3.0 ')
                            ztmp(ji,jj) = -3.0
                         ENDIF
                         IF (ztmp(ji,jj) .GT. 40.0 ) THEN
-                           CALL ctl_warn(                                    &
-                           ' trc_bio_medusa: T SWITCHING 3D, ',              &
-                           tsn(ji,jj,jk,jp_tem), ' -> 40.0 ' )
+                           write(charout,*)  tsn(ji,jj,jk,jp_tem)
+                           Call ctl_warn(' trc_bio_medusa: T SWITCHING 3D : ',     &
+                                        TRIM(charout), ' -> 40.0 ')
                            ztmp(ji,jj) = 40.0
                         ENDIF
                      ELSE 
-                        CALL ctl_warn(                                       &
-                        ' trc_bio_medusa: T SWITCHING 3D, ',                 &
-                        tsn(ji,jj,jk,jp_tem), ' -> surounding avg : ', tsnavg )
+                        write(charout,*)  tsn(ji,jj,jk,jp_tem)
+                        write(charout2,*) tsnavg
+                        Call ctl_warn(' trc_bio_medusa: T SWITCHING 3D : ',     &
+                                     TRIM(charout), ' -> surounding avg : ',    &
+                                     TRIM(charout2) )
                         ztmp(ji,jj) = tsnavg
                      ENDIF
@@ -563,19 +568,20 @@
                   !! end T chack
                   if (zsal(ji,jj) .lt. 1.0 .or. zsal(ji,jj) .gt. 47.0 ) then
-                        CALL ctl_warn(                                       &
-                        ' trc_bio_medusa: S WARNING 2D, ',                   &
-                        tsn(ji,jj,jk,jp_sal),                                &
-                        ' at I, J, K, kt : ', mig(ji), mjg(jj), jk, kt)
+                     write(charout,*)  tsn(ji,jj,jk,jp_sal)
+                     write(charout2,*) mig(ji), mjg(jj), jk, kt 
+                     Call ctl_warn(' trc_bio_medusa: S WARNING 3D : ',       &
+                                   TRIM(charout), 'at I, J, K, kt :',        & 
+                                   TRIM(charout2) )
                      !! Correct out of range values
                      IF (zsal(ji,jj) .LT. 1.0 ) THEN
-                        CALL ctl_warn(                                       &
-                        ' trc_bio_medusa: S SWITCHING 3D, ',                 &
-                        tsn(ji,jj,jk,jp_sal), ' -> 1.0 ')
+                        write(charout,*)  tsn(ji,jj,jk,jp_sal)
+                        Call ctl_warn(' trc_bio_medusa: S SWITCHING 3D : ',     &
+                                     TRIM(charout), ' -> 1.0 ')
                         zsal(ji,jj) = 1.0
                      ENDIF
                      IF (zsal(ji,jj) .GT. 47.0 ) THEN
-                        CALL ctl_warn(                                       &
-                        ' trc_bio_medusa: T SWITCHING 3D, ',                 &
-                        tsn(ji,jj,jk,jp_sal), ' -> 47.0 ')
+                        write(charout,*)  tsn(ji,jj,jk,jp_sal)
+                        Call ctl_warn(' trc_bio_medusa: S SWITCHING 3D : ',     &
+                                     TRIM(charout), ' -> 47.0 ')
                         zsal(ji,jj) = 47.0
                      ENDIF
