Skip to content

Commit

Permalink
Merge pull request #223 from lolMEvans/gridfile-abundances-fix
Browse files Browse the repository at this point in the history
Seems legit, thanks for that.
  • Loading branch information
allegroLeiden authored Apr 19, 2017
2 parents 7654865 + d8db96a commit ea5327a
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/grid2fits.c
Original file line number Diff line number Diff line change
Expand Up @@ -990,7 +990,11 @@ If a COLLPARn keywords are found in the GRID extension header then collPartNames
return; /* I.e. with dataFlags left unchanged. */
}

mallocAndSetDefaultGrid(gp, (size_t)numGridCells, 0);
/* Count the numbers of ABUNMOL columns here so that, if appropriate, we can malloc 'gp' molecular data array
with this call to mallocAndSetDefaultGrid (only happens if nSpecies > 0)
*/
gridInfoRead->nSpecies = (unsigned short)countColsBasePlusInt(fptr, "ABUNMOL");
mallocAndSetDefaultGrid(gp, (size_t)numGridCells, gridInfoRead->nSpecies);

/* Read the columns.
*/
Expand Down Expand Up @@ -1148,9 +1152,6 @@ If a COLLPARn keywords are found in the GRID extension header then collPartNames
(*dataFlags) |= (1 << DS_bit_density);
}

/* Count the numbers of ABUNMOLm columns:
*/
gridInfoRead->nSpecies = (unsigned short)countColsBasePlusInt(fptr, "ABUNMOL");
if(gridInfoRead->nSpecies > 0){
/* Read the ABUNMOL columns:
*/
Expand Down

0 comments on commit ea5327a

Please sign in to comment.