Commits

Nathan Goldbaum committed 25e296b Merge

Merged in MatthewTurk/enzo-dev (pull request #43)

  • Participants
  • Parent commits 1f32c5e, bc8b8e9

Comments (0)

Files changed (1)

File src/enzo/Grid_StarParticleHandler.C

   /* Find Multi-species fields. */
   int DeNum, HINum, HIINum, HeINum, HeIINum, HeIIINum, HMNum, H2INum, H2IINum,
     DINum, DIINum, HDINum; 
-  if (IdentifySpeciesFields(DeNum, HINum, HIINum, HeINum, HeIINum, HeIIINum,
-			    HMNum, H2INum, H2IINum, DINum, DIINum, HDINum) == FAIL) {
-    ENZO_FAIL("Error in grid->IdentifySpeciesFields.\n");
-  }
 
   /* If only star cluster formation, check now if we're restricting
      formation in a region. */
     }
   }
 
+  if (MultiSpecies > 1) {
+      H2INum   = FindField(H2IDensity, FieldType, NumberOfBaryonFields);
+      H2IINum  = FindField(H2IIDensity, FieldType, NumberOfBaryonFields);
+  }
+
   /* Find metallicity field and set flag. */
  
   int SNColourNum, MetalNum, MBHColourNum, Galaxy1ColourNum, Galaxy2ColourNum,
     if ( STARMAKE_METHOD(H2REG_STAR) && 
 	 ( this->MakeStars || !StarFormationOncePerRootGridTimeStep ) ) {
 
+      if (IdentifySpeciesFields(DeNum, HINum, HIINum, HeINum, HeIINum, HeIIINum,
+                    HMNum, H2INum, H2IINum, DINum, DIINum, HDINum) == FAIL) {
+        ENZO_FAIL("Error in grid->IdentifySpeciesFields.\n");
+      }
+
       NumberOfNewParticlesSoFar = NumberOfNewParticles;
 
       /* If StarFormationOncePerRootGridTimeStep, use the root grid