Skip to content

Commit

Permalink
Merge pull request #745 from galacticusorg/featHDF1.14.5
Browse files Browse the repository at this point in the history
Update code to work with v1.14.5 of the HDF5 library
  • Loading branch information
abensonca authored Dec 2, 2024
2 parents e7a298f + 59a239b commit a6a5c8c
Show file tree
Hide file tree
Showing 18 changed files with 684 additions and 678 deletions.
12 changes: 6 additions & 6 deletions .github/actions/buildMacOS/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -106,19 +106,19 @@ runs:
- name: Install HDF5
shell: bash
run: |
curl -L https://support.hdfgroup.org/ftp/HDF5/releases/hdf5-1.8/hdf5-1.8.20/src/hdf5-1.8.20.tar.gz --output hdf5-1.8.20.tar.gz
tar -vxzf hdf5-1.8.20.tar.gz
cd hdf5-1.8.20
curl -L https://support.hdfgroup.org/releases/hdf5/v1_14/v1_14_5/downloads/hdf5-1.14.5.tar.gz --output hdf5-1.14.5.tar.gz
tar -vxzf hdf5-1.14.5.tar.gz
cd hdf5-1.14.5
if [[ "${OS_VER}" -eq 13 ]]; then
# For MacOS 13 force use of the classic linker as the new linker does not support the '-commons' option - see https://trac.macports.org/ticket/68194#comment:15
CC=gcc-11 CXX=g++-11 FC=gfortran-11 LDFLAGS=-Wl,-ld_classic ./configure --prefix=/usr/local --enable-fortran --enable-production
CC=gcc-11 CXX=g++-11 FC=gfortran-11 LDFLAGS=-Wl,-ld_classic ./configure --prefix=/usr/local --enable-fortran --enable-build-mode=production
else
CC=gcc-11 CXX=g++-11 FC=gfortran-11 ./configure --prefix=/usr/local --enable-fortran --enable-production
CC=gcc-11 CXX=g++-11 FC=gfortran-11 ./configure --prefix=/usr/local --enable-fortran --enable-build-mode=production
fi
make -j3
sudo make install
cd ..
rm -rf hdf5-1.8.20 hdf5-1.8.20.tar.gz
rm -rf hdf5-1.14.5 hdf5-1.14.5.tar.gz
- name: Install FoX
shell: bash
run: |
Expand Down
12 changes: 8 additions & 4 deletions .github/workflows/cicd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -738,7 +738,8 @@ jobs:
needs: Build-Executable-Linux
uses: ./.github/workflows/testModel.yml
with:
file: validate-darkMatterOnlySubhalos.pl
install: python3 python3-h5py python3-numpy python3-git
file: validate-darkMatterOnlySubhalos.py
artifact: galacticus-exec
runPath: ./testSuite
cacheData: 0
Expand All @@ -749,7 +750,8 @@ jobs:
needs: Build-Executable-Linux
uses: ./.github/workflows/testModel.yml
with:
file: validate-milkyWay.pl
install: python3 python3-h5py python3-numpy python3-git
file: validate-milkyWay.py
artifact: galacticus-exec
runPath: ./testSuite
cacheData: 1
Expand All @@ -760,7 +762,8 @@ jobs:
needs: Build-Executable-Linux
uses: ./.github/workflows/testModel.yml
with:
file: validate-PonosV.pl
install: python3 python3-h5py python3-numpy python3-git
file: validate-PonosV.py
artifact: galacticus-exec
runPath: ./testSuite
cacheData: 0
Expand All @@ -771,7 +774,8 @@ jobs:
needs: Build-Executable-Linux
uses: ./.github/workflows/testModel.yml
with:
file: validate-baryonicSuppression.pl
install: python3 python3-h5py python3-numpy python3-git
file: validate-baryonicSuppression.py
artifact: galacticus-exec
runPath: ./testSuite
cacheData: 0
Expand Down
6 changes: 3 additions & 3 deletions source/intergalactic_medium.state.RecFast.F90
Original file line number Diff line number Diff line change
Expand Up @@ -141,9 +141,9 @@ function recFastConstructorInternal(cosmologyFunctions_,cosmologyParameters_) re
if (File_Exists(char(self%fileName))) then
! Check file version number.
!$ call hdf5Access%set()
call outputFile%openFile (char(self%fileName),overwrite=.false. )
call outputFile%readAttribute('fileFormat' , fileFormatVersion)
call outputFile%close ( )
call outputFile%openFile (char(self%fileName),overwrite=.false. ,readOnly=.true.)
call outputFile%readAttribute('fileFormat' , fileFormatVersion )
call outputFile%close ( )
!$ call hdf5Access%unset()
buildFile=fileFormatVersion /= fileFormatVersionCurrent
else
Expand Down
2 changes: 1 addition & 1 deletion source/output.analyses.Local_Group.occupation_fraction.F90
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ function localGroupOccupationFractionConstructorInternal(outputTimes_,positionTy

! Construct the target distribution.
!$ call hdf5Access%set ()
call fileData%openFile(char(inputPath(pathTypeDataStatic))//"observations/stellarHaloMassRelation/fractionOccupation_Local_Group_Nadler2020.hdf5")
call fileData%openFile(char(inputPath(pathTypeDataStatic))//"observations/stellarHaloMassRelation/fractionOccupation_Local_Group_Nadler2020.hdf5",readOnly=.true.)
call fileData%readDataset('massHalo' ,massHaloData )
call fileData%readDataset('fractionOccupation',fractionOccupationData)
call fileData%close ( )
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ function localGroupStellarMassHaloMassRelationConstructorInternal(outputTimes_,p

! Construct the target distribution.
!$ call hdf5Access%set ()
call fileData%openFile(char(inputPath(pathTypeDataStatic))//"observations/stellarHaloMassRelation/stellarHaloMassRelation_Local_Group_Nadler2020.hdf5")
call fileData%openFile(char(inputPath(pathTypeDataStatic))//"observations/stellarHaloMassRelation/stellarHaloMassRelation_Local_Group_Nadler2020.hdf5",readOnly=.true.)
call fileData%readDataset('massHalo' ,massHaloData )
call fileData%readDataset('massStellar' ,massStellarData )
call fileData%readDataset('massStellarScatter',massStellarScatterData)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@ function stellarVsHaloMassRelationLeauthaud2012ConstructorInternal(redshiftInter
!!]
! Read observational data and convert masses to logarithmic.
!$ call hdf5Access%set()
call fileData%openFile(char(inputPath(pathTypeDataStatic))//"observations/stellarHaloMassRelation/stellarHaloMassRelation_COSMOS_Leauthaud2012.hdf5")
call fileData%openFile(char(inputPath(pathTypeDataStatic))//"observations/stellarHaloMassRelation/stellarHaloMassRelation_COSMOS_Leauthaud2012.hdf5",readOnly=.true.)
groupRedshiftName=var_str('redshiftInterval')//redshiftInterval
groupRedshift=fileData%openGroup(char(groupRedshiftName))
call groupRedshift%readDataset('massStellar' ,massStellarData )
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1308,22 +1308,22 @@ subroutine filteredPowerFileRead(self)
if (.not.File_Exists(char(self%fileName))) return
call displayMessage('reading σ(M) data from: '//self%fileName,verbosityLevelWorking)
!$ call hdf5Access%set()
call dataFile%openFile (char(self%fileName) ,overWrite =.false.)
call dataFile%readDataset ('times' , timesTmp )
call dataFile%readDataset ('mass' , massTmp )
call dataFile%readDataset ('rootVariance' , rootVarianceTmp )
call dataFile%readDataset ('rootVarianceUnique' , rootVarianceUniqueTmp )
call dataFile%readDataset ('indexUnique' , indexTmp )
call dataFile%readDataset ('uniqueSize' , uniqueSizeTmp )
call dataFile%readAttribute('sigma8' ,self%sigma8Value )
call dataFile%readAttribute('sigmaNormalization' ,self%sigmaNormalization )
call dataFile%readAttribute('massMinimum' ,self%massMinimum )
call dataFile%readAttribute('massMaximum' ,self%massMaximum )
call dataFile%readAttribute('timeMinimum' ,self%timeMinimum )
call dataFile%readAttribute('timeMaximum' ,self%timeMaximum )
call dataFile%readAttribute('timeMinimumLogarithmic' ,self%timeMinimumLogarithmic )
call dataFile%readAttribute('timeLogarithmicDeltaInverse',self%timeLogarithmicDeltaInverse )
call dataFile%close ( )
call dataFile%openFile (char(self%fileName) ,overWrite =.false.,readOnly=.true.)
call dataFile%readDataset ('times' , timesTmp )
call dataFile%readDataset ('mass' , massTmp )
call dataFile%readDataset ('rootVariance' , rootVarianceTmp )
call dataFile%readDataset ('rootVarianceUnique' , rootVarianceUniqueTmp )
call dataFile%readDataset ('indexUnique' , indexTmp )
call dataFile%readDataset ('uniqueSize' , uniqueSizeTmp )
call dataFile%readAttribute('sigma8' ,self%sigma8Value )
call dataFile%readAttribute('sigmaNormalization' ,self%sigmaNormalization )
call dataFile%readAttribute('massMinimum' ,self%massMinimum )
call dataFile%readAttribute('massMaximum' ,self%massMaximum )
call dataFile%readAttribute('timeMinimum' ,self%timeMinimum )
call dataFile%readAttribute('timeMaximum' ,self%timeMaximum )
call dataFile%readAttribute('timeMinimumLogarithmic' ,self%timeMinimumLogarithmic )
call dataFile%readAttribute('timeLogarithmicDeltaInverse',self%timeLogarithmicDeltaInverse )
call dataFile%close ( )
!$ call hdf5Access%unset()
if (allocated(self%times )) deallocate(self%times )
if (allocated(self%rootVarianceTable )) deallocate(self%rootVarianceTable )
Expand Down
5 changes: 2 additions & 3 deletions source/tasks.halo_mass_function.F90
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ Implementation of a task which computes and outputs the halo mass function and r
double precision , allocatable, dimension(:) :: fractionModeMasses
type (virialDensityContrastList ), allocatable, dimension(:) :: virialDensityContrasts
! Pointer to the parameters for this task.
type (inputParameters ) :: parameters
type (inputParameters ), pointer :: parameters => null()
contains
!![
<methods>
Expand Down Expand Up @@ -401,8 +401,7 @@ function haloMassFunctionConstructorInternal(
<constructorAssign variables="haloMassMinimum, haloMassMaximum, pointsPerDecade, outputGroup, includeUnevolvedSubhaloMassFunction, includeMassAccretionRate, massesRelativeToHalfModeMass, fractionModeMasses, *cosmologyParameters_, *cosmologyFunctions_, *virialDensityContrast_, *criticalOverdensity_, *linearGrowth_, *haloMassFunction_, *haloEnvironment_, *unevolvedSubhaloMassFunction_, *darkMatterHaloScale_, *darkMatterProfileScaleRadius_, *darkMatterProfileShape_, *darkMatterHaloMassAccretionHistory_, *cosmologicalMassVariance_, *darkMatterHaloBias_, *transferFunction_, *transferFunctionReference, *transferFunctionRelative, *outputTimes_, *randomNumberGenerator_"/>
!!]

self%parameters=inputParameters(parameters)
call self%parameters%parametersGroupCopy(parameters)
self%parameters => parameters
allocate(self%virialDensityContrasts(size(virialDensityContrasts)))
do i=1,size(virialDensityContrasts)
self%virialDensityContrasts(i)%label=virialDensityContrasts(i)%label
Expand Down
Loading

0 comments on commit a6a5c8c

Please sign in to comment.