Index: branches/UKMO/dev_r5518_GO6_package/NEMOGCM/NEMO/TOP_SRC/MEDUSA/air_sea.F90
===================================================================
--- branches/UKMO/dev_r5518_GO6_package/NEMOGCM/NEMO/TOP_SRC/MEDUSA/air_sea.F90	(revision 8441)
+++ branches/UKMO/dev_r5518_GO6_package/NEMOGCM/NEMO/TOP_SRC/MEDUSA/air_sea.F90	(revision 8442)
@@ -124,4 +124,10 @@
       !! Air-sea gas exchange
       !!-----------------------------------------------------------
+
+#   if defined key_debug_medusa
+               IF (lwp) write (numout,*)                     & 
+               'air-sea: gas_transfer kt = ', kt
+               CALL flush(numout)
+#   endif
       DO jj = 2,jpjm1
          DO ji = 2,jpim1
@@ -145,18 +151,15 @@
                !!                 Wanninkhof (2014), option 7
                !!
+               CALL gas_transfer( wndm(ji,jj), 1, 7,         &  ! inputs
+                                  f_kw660(ji,jj) )              ! outputs
+            ENDIF
+         ENDDO
+      ENDDO
+
 #   if defined key_debug_medusa
-               IF (lwp) write (numout,*) 'trc_bio_medusa: entering gas_transfer'
+               IF (lwp) write (numout,*)                     &
+               'air-sea: carb-chem kt = ', kt
                CALL flush(numout)
 #   endif
-               CALL gas_transfer( wndm(ji,jj), 1, 7,         &  ! inputs
-                                  f_kw660(ji,jj) )              ! outputs
-#   if defined key_debug_medusa
-               IF (lwp) write (numout,*) 'trc_bio_medusa: exiting gas_transfer'
-               CALL flush(numout)
-#   endif
-            ENDIF
-         ENDDO
-      ENDDO
-
       DO jj = 2,jpjm1
          DO ji = 2,jpim1
@@ -228,5 +231,5 @@
                !!                 failure position can be determined
                if (iters .eq. 25) then
-                  IF(lwp) WRITE(numout,*) ' trc_bio_medusa: ITERS WARNING, ', &
+                  IF(lwp) WRITE(numout,*) 'air-sea: ITERS WARNING, ',       &
                      iters, ' AT (', ji, ', ', jj, ', 1) AT ', kt
                endif
@@ -335,7 +338,6 @@
                                          hmld(ji,jj),qsr(ji,jj),              &
                                          zdin(ji,jj), dms_nlim(ji,jj),        &
-                                         dms_andr(ji,jj),dms_simo(ji,jj),     &
-                                         dms_aran(ji,jj),dms_hall(ji,jj),     &
-                                         dms_andm(ji,jj))
+                                         dms_andr,dms_simo,dms_aran,dms_hall, & 
+                                         dms_andm)
                   else
                      !! use diel-average inputs
@@ -346,53 +348,49 @@
                                          zn_dms_mld(ji,jj),zn_dms_qsr(ji,jj), &
                                          zn_dms_din(ji,jj),dms_nlim(ji,jj),   &
-                                         dms_andr(ji,jj),dms_simo(ji,jj),     &
-                                         dms_aran(ji,jj),dms_hall(ji,jj),     &
-                                         dms_andm(ji,jj))
+                                         dms_andr,dms_simo,dms_aran,dms_hall, & 
+                                         dms_andm)
                   endif
                   !!
                   !! assign correct output to variable passed to atmosphere
                   if (jdms_model .eq. 1) then
-                     dms_surf(ji,jj) = dms_andr(ji,jj)
+                     dms_surf = dms_andr
                   elseif (jdms_model .eq. 2) then
-                     dms_surf(ji,jj) = dms_simo(ji,jj)
+                     dms_surf = dms_simo
                   elseif (jdms_model .eq. 3) then
-                     dms_surf(ji,jj) = dms_aran(ji,jj)
+                     dms_surf = dms_aran
                   elseif (jdms_model .eq. 4) then
-                     dms_surf(ji,jj) = dms_hall(ji,jj)
+                     dms_surf = dms_hall
                   elseif (jdms_model .eq. 5) then
-                     dms_surf(ji,jj) = dms_andm(ji,jj)
+                     dms_surf = dms_andm
                   endif
                   !!
                   !! 2D diag through iom_use
-                  IF( lk_iomput ) THEN
-                     IF( med_diag%DMS_SURF%dgsave ) THEN
-                        dms_surf2d(ji,jj) = dms_surf(ji,jj)
-                     ENDIF
-                     IF( med_diag%DMS_ANDR%dgsave ) THEN
-                        dms_andr2d(ji,jj) = dms_andr(ji,jj)
-                     ENDIF
-                     IF( med_diag%DMS_SIMO%dgsave ) THEN
-                        dms_simo2d(ji,jj) = dms_simo(ji,jj)
-                     ENDIF
-                     IF( med_diag%DMS_ARAN%dgsave ) THEN
-                        dms_aran2d(ji,jj) = dms_aran(ji,jj)
-                     ENDIF
-                     IF( med_diag%DMS_HALL%dgsave ) THEN
-                        dms_hall2d(ji,jj) = dms_hall(ji,jj)
-                     ENDIF 
-                     IF( med_diag%DMS_ANDM%dgsave ) THEN 
-                        dms_andm2d(ji,jj) = dms_andm(ji,jj) 
-                     ENDIF
-#   if defined key_debug_medusa
-                     IF (lwp) write (numout,*)                                &
-                        'trc_bio_medusa: finish calculating dms'
-                     CALL flush(numout)
-#   endif 
-                  ENDIF      !! End iom
+                  IF( med_diag%DMS_SURF%dgsave ) THEN
+                     dms_surf2d(ji,jj) = dms_surf
+                  ENDIF
+                  IF( med_diag%DMS_ANDR%dgsave ) THEN
+                     dms_andr2d(ji,jj) = dms_andr
+                  ENDIF
+                  IF( med_diag%DMS_SIMO%dgsave ) THEN
+                     dms_simo2d(ji,jj) = dms_simo
+                  ENDIF
+                  IF( med_diag%DMS_ARAN%dgsave ) THEN
+                     dms_aran2d(ji,jj) = dms_aran
+                  ENDIF
+                  IF( med_diag%DMS_HALL%dgsave ) THEN
+                     dms_hall2d(ji,jj) = dms_hall
+                  ENDIF 
+                  IF( med_diag%DMS_ANDM%dgsave ) THEN 
+                     dms_andm2d(ji,jj) = dms_andm
+                  ENDIF
                ENDIF
             ENDDO
          ENDDO
+#   if defined key_debug_medusa
+         IF (lwp) write (numout,*)                                &
+            'air-sea: finish calculating dms kt = ',kt
+            CALL flush(numout)
+#   endif 
       ENDIF                  !! End IF (jdms == 1)
-
 
       !!
