Index: /branches/UKMO/dev_r5518_GO6_package_asm_3d_bgc_v3/NEMOGCM/NEMO/OPA_SRC/ASM/asmbgc.F90
===================================================================
--- /branches/UKMO/dev_r5518_GO6_package_asm_3d_bgc_v3/NEMOGCM/NEMO/OPA_SRC/ASM/asmbgc.F90	(revision 10076)
+++ /branches/UKMO/dev_r5518_GO6_package_asm_3d_bgc_v3/NEMOGCM/NEMO/OPA_SRC/ASM/asmbgc.F90	(revision 10077)
@@ -552,5 +552,5 @@
          chl_bkg(:,:,:)    = chl_bkg(:,:,:)    * tmask(:,:,:)
          cchl_p_bkg(:,:,:) = cchl_p_bkg(:,:,:) * tmask(:,:,:)
-#elif defined key_medusa
+#elif defined key_medusa && defined key_foam_medusa
          CALL iom_get( inum, jpdom_autoglo, 'medusa_chn', tracer_bkg(:,:,:,jpchn) )
          CALL iom_get( inum, jpdom_autoglo, 'medusa_chd', tracer_bkg(:,:,:,jpchd) )
@@ -578,5 +578,5 @@
             CALL iom_get( inum, jpdom_autoglo, 'hadocc_dic', tracer_bkg(:,:,:,jp_had_dic) )
             CALL iom_get( inum, jpdom_autoglo, 'hadocc_alk', tracer_bkg(:,:,:,jp_had_alk) )
-#elif defined key_medusa
+#elif defined key_medusa && defined key_foam_medusa
             CALL iom_get( inum, jpdom_autoglo, 'medusa_zmi', tracer_bkg(:,:,:,jpzmi) )
             CALL iom_get( inum, jpdom_autoglo, 'medusa_zme', tracer_bkg(:,:,:,jpzme) )
@@ -594,5 +594,5 @@
             CALL iom_get( inum, jpdom_autoglo, 'hadocc_dic', tracer_bkg(:,:,:,jp_had_dic) )
             CALL iom_get( inum, jpdom_autoglo, 'hadocc_alk', tracer_bkg(:,:,:,jp_had_alk) )
-#elif defined key_medusa
+#elif defined key_medusa && defined key_foam_medusa
             CALL iom_get( inum, jpdom_autoglo, 'medusa_dic', tracer_bkg(:,:,:,jpdic) )
             CALL iom_get( inum, jpdom_autoglo, 'medusa_alk', tracer_bkg(:,:,:,jpalk) )
@@ -620,5 +620,5 @@
          CALL iom_get( inum, jpdom_autoglo, 'hadocc_dic', tracer_bkg(:,:,:,jp_had_dic) )
          CALL iom_get( inum, jpdom_autoglo, 'hadocc_alk', tracer_bkg(:,:,:,jp_had_alk) )
-#elif defined key_medusa
+#elif defined key_medusa && defined key_foam_medusa
          CALL iom_get( inum, jpdom_autoglo, 'medusa_dic', tracer_bkg(:,:,:,jpdic) )
          CALL iom_get( inum, jpdom_autoglo, 'medusa_alk', tracer_bkg(:,:,:,jpalk) )
@@ -690,5 +690,5 @@
             & ln_schltotinc  .OR. ln_slphytotinc .OR. ln_slphydiainc .OR. &
             & ln_slphynoninc ) THEN
-#if defined key_medusa
+#if defined key_medusa && defined key_foam_medusa
             CALL iom_rstput( kt, kt, inum, 'phy2d_chn', phyto2d_balinc(:,:,:,jpchn) )
             CALL iom_rstput( kt, kt, inum, 'phy2d_chd', phyto2d_balinc(:,:,:,jpchd) )
@@ -721,5 +721,5 @@
 
          IF ( ln_plchltotinc .OR. ln_pchltotinc ) THEN
-#if defined key_medusa
+#if defined key_medusa && defined key_foam_medusa
             CALL iom_rstput( kt, kt, inum, 'phy3d_chn', phyto3d_balinc(:,:,:,jpchn) )
             CALL iom_rstput( kt, kt, inum, 'phy3d_chd', phyto3d_balinc(:,:,:,jpchd) )
@@ -733,5 +733,5 @@
 
          IF ( ln_spco2inc ) THEN
-#if defined key_medusa
+#if defined key_medusa && defined key_foam_medusa
             CALL iom_rstput( kt, kt, inum, 'pco2_dic', pco2_balinc(:,:,:,jpdic) )
             CALL iom_rstput( kt, kt, inum, 'pco2_alk', pco2_balinc(:,:,:,jpalk) )
@@ -741,5 +741,5 @@
 #endif
          ELSE IF ( ln_sfco2inc ) THEN
-#if defined key_medusa
+#if defined key_medusa && defined key_foam_medusa
             CALL iom_rstput( kt, kt, inum, 'fco2_dic', pco2_balinc(:,:,:,jpdic) )
             CALL iom_rstput( kt, kt, inum, 'fco2_alk', pco2_balinc(:,:,:,jpalk) )
@@ -751,5 +751,5 @@
 
          IF ( ln_pphinc ) THEN
-#if defined key_medusa
+#if defined key_medusa && defined key_foam_medusa
             CALL iom_rstput( kt, kt, inum, 'ph_dic', ph_balinc(:,:,:,jpdic) )
             CALL iom_rstput( kt, kt, inum, 'ph_alk', ph_balinc(:,:,:,jpalk) )
@@ -990,5 +990,5 @@
          ! Select mixed layer
          IF ( ll_asmdin ) THEN
-#if defined key_top
+#if defined key_top && ( defined key_hadocc || (defined key_medusa && defined key_foam_medusa) )
             CALL ctl_warn( ' Doing direct initialisation with ocean colour assimilation', &
                &           ' Mixed layer depth taken to be background maximum mld_max_bkg' )
@@ -1388,5 +1388,5 @@
 
          IF ( ln_sfco2inc ) THEN
-#if defined key_medusa && defined key_roam
+#if defined key_medusa && defined key_foam_medusa && defined key_roam
             ! If assimilating fCO2, then convert to pCO2 using MEDUSA MOCSY subroutine
             patm(1) = 1.0
@@ -1421,5 +1421,5 @@
          ENDIF
 
-#if defined key_medusa
+#if defined key_medusa && defined key_foam_medusa
          ! Account for phytoplankton balancing if required
          IF ( ln_phytobal ) THEN
@@ -1861,5 +1861,5 @@
 #if defined key_hadocc
             it = jp_had_nut
-#elif defined key_medusa
+#elif defined key_medusa && defined key_foam_medusa
             it = jpdin
 #endif
@@ -1905,5 +1905,5 @@
 #if defined key_hadocc
             it = jp_had_dic
-#elif defined key_medusa
+#elif defined key_medusa && defined key_foam_medusa
             it = jpdic
 #endif
@@ -1929,5 +1929,5 @@
 #if defined key_hadocc
             it = jp_had_alk
-#elif defined key_medusa
+#elif defined key_medusa && defined key_foam_medusa
             it = jpalk
 #endif
