Commit 8ff96a05 authored by Roy Fabrice's avatar Roy Fabrice
Browse files

fhi integration + license update

parent 04fbeae5
include ../../../Make.inc
COMMONDIR = ../../../common/src/
OBJDIR=../../../obj/
MODDIR=../../../mod/
VPATH= $(COMMONDIR):.
EXE = conegravcreator
EXE = conegravcreator.exe
SRC = modconstant.f90 \
type_info_ramses_mod.f90 \
modmpicommons.f90 \
modhdf5.f90 \
modiocommons.f90 \
modreadinfo.f90 \
modvariables.f90 \
modwritemeta.f90 \
modio.f90 \
modsortpart.f90 \
conegravcreator.f90
OBJ = $(SRC:%.f90=%.o)
OBJS_NOPREFIX=$(SRC:%.f90=%.o)
OBJS=$(addprefix $(OBJDIR), $(OBJS_NOPREFIX))
%.o:%.f90
# variable containing if git is used or not
ifeq ($(wildcard ../../../.git/HEAD ../../../.git/index),)
OBJ_GIT =
USE_GIT =
else
USE_GIT = $(shell which git)
OBJ_GIT = ../../../.git/HEAD ../../../.git/index
endif
$(OBJDIR)%.o:%.f90
@echo "--------------------------------"
@echo building $*.o with parameters \
FC=$(MPIFC), FCFLAGS=$(FCFLAGS)
$(MPIFC) -c $(FCFLAGS) $<
FC=$(FC), FCFLAGS=$(FCFLAGS)
$(FC) -c $(FCFLAGS) $< -o $@
%.mod:%.f90
$(MODDIR)%.mod:%.f90
@echo "--------------------------------"
@echo building $*.mod with parameters \
FC=$(MPIFC), FCFLAGS=$(FCFLAGS)
$(MPIFC) -c $(FCFLAGS) $<
FC=$(FC), FCFLAGS=$(FCFLAGS)
$(FC) -c $(FCFLAGS) $<
all : $(EXE)
$(EXE) : svnrev $(OBJ)
all: directories release
release: $(EXE)
debug: FCFLAGS = $(DEBUGFLAGS)
debug: $(EXE)
$(EXE) : gitversion $(OBJS)
@echo "--------------------------------"
@echo building $(EXE)
$(MPIFC) -o $(EXE) $(OBJ) $(LDFLAGS)
$(FC) -o $(EXE) $(OBJS) $(LDFLAGS)
cleanall :
@echo "--------------------------------"
@echo cleaning compiled objects, modules and executable
rm -f $(OBJDIR)*.o $(MODDIR)*.mod *~ $(EXE) $(COMMONDIR)/gitversion.h
clean :
@echo "--------------------------------"
@echo cleaning compiled objects, modules and executable
rm -f *.o *.mod *~ $(EXE)
rm -f $(EXE)
# create file for git version
gitversion: $(OBJ_GIT)
ifneq ($(USE_GIT), )
@cd $(COMMONDIR) ;\
echo "#define GITVERSION \"$(shell git rev-parse HEAD)\"" > gitversion.h
else
@cd $(COMMONDIR) ;\
echo "#define GITVERSION \"no_version_found\"" > gitversion.h
endif
directories: ${MODDIR} ${OBJDIR}
svnrev:
@SVNVERSION=$(shell svnversion -n . 2>/dev/null) ; \
if [ $$? -eq 0 ] ; then cd $(COMMONDIR) ; \
echo "#define SVNREV \"$(shell svnversion -n .)\"" > svnrev.h ; cd - ;\
else cd $(COMMONDIR) ; echo "#define SVNREV \"no_version_found\"" > svnrev.h ; cd - ;\
fi
${OBJDIR}:
${MKDIR_P} $@
${MODDIR}:
${MKDIR_P} $@
.PHONY: svnrev clean all
.PHONY: gitversion clean cleanall directories all
!==============================================================================
! Project: pFoF
! File: tools/conegravcreator/src/conegravcreator.f90
! Copyright Fabrice Roy (2015)
! Fabrice.Roy@obspm.fr
!
! This software is a computer program whose purpose is to detect dark matter
! haloes in cosmological simulation with a parallel Friend of Friend algorithm.
!------------------------------------------------------------------------------------------------------------------------------------
! Copyright 2015 Fabrice Roy
!
! This software is governed by the CeCILL license under French law and
! abiding by the rules of distribution of free software. You can use,
! modify and/ or redistribute the software under the terms of the CeCILL
! license as circulated by CEA, CNRS and INRIA at the following URL
! "http://www.cecill.info".
! Contact: fabrice.roy@obspm.fr
!
! As a counterpart to the access to the source code and rights to copy,
! modify and redistribute granted by the license, users are provided only
! with a limited warranty and the software's author, the holder of the
! economic rights, and the successive licensors have only limited
! liability.
! This file is part of pFoF.
!
! In this respect, the user's attention is drawn to the risks associated
! with loading, using, modifying and/or developing or reproducing the
! software by the user in light of its specific status of free software,
! that may mean that it is complicated to manipulate, and that also
! therefore means that it is reserved for developers and experienced
! professionals having in-depth computer knowledge. Users are therefore
! encouraged to load and test the software's suitability as regards their
! requirements in conditions enabling the security of their systems and/or
! data to be ensured and, more generally, to use and operate it in the
! same conditions as regards security.
! pFoF is free software: you can redistribute it and/or modify
! it under the terms of the GNU General Public License as published by
! the Free Software Foundation, either version 3 of the License, or
! (at your option) any later version.
!
! The fact that you are presently reading this means that you have had
! knowledge of the CeCILL license and that you accept its terms.
!==============================================================================
! pFoF is distributed in the hope that it will be useful,
! but WITHOUT ANY WARRANTY; without even the implied warranty of
! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
! GNU General Public License for more details.
!
! You should have received a copy of the GNU General Public License
! along with pFoF. If not, see <http://www.gnu.org/licenses/>.
!> @file
!! Program that convert grav binary files from a RAMSES cone output to HDF5 files
!! @brief
!!
!! @author Fabrice Roy
!=======================================================================
! Author: Fabrice Roy (LUTH/CNRS/Observatoire de Paris)
! Fabrice.Roy@obspm.fr
!=======================================================================
!> Program that convert grav binary files from a RAMSES cone output to HDF5 files
!------------------------------------------------------------------------------------------------------------------------------------
Program conegravcreator
......@@ -46,7 +33,7 @@ Program conegravcreator
Use modsortpart
Use modvariables
Use mpi
Use modhdf5
Use fortran_hdf5_manage_interface_m
Implicit None
......
!==============================================================================
! Project: pFoF
! File: tools/conegravcreator/src/modio.f90
! Copyright Fabrice Roy and Vincent Bouillot (2015)
! Fabrice.Roy@obspm.fr
!
! This software is a computer program whose purpose is to detect dark matter
! haloes in cosmological simulation with a parallel Friend of Friend algorithm.
!------------------------------------------------------------------------------------------------------------------------------------
! Copyright 2015 Fabrice Roy and Vincent Bouillot
!
! This software is governed by the CeCILL license under French law and
! abiding by the rules of distribution of free software. You can use,
! modify and/ or redistribute the software under the terms of the CeCILL
! license as circulated by CEA, CNRS and INRIA at the following URL
! "http://www.cecill.info".
! Contact: fabrice.roy@obspm.fr
!
! As a counterpart to the access to the source code and rights to copy,
! modify and redistribute granted by the license, users are provided only
! with a limited warranty and the software's author, the holder of the
! economic rights, and the successive licensors have only limited
! liability.
! This file is part of pFoF.
!
! In this respect, the user's attention is drawn to the risks associated
! with loading, using, modifying and/or developing or reproducing the
! software by the user in light of its specific status of free software,
! that may mean that it is complicated to manipulate, and that also
! therefore means that it is reserved for developers and experienced
! professionals having in-depth computer knowledge. Users are therefore
! encouraged to load and test the software's suitability as regards their
! requirements in conditions enabling the security of their systems and/or
! data to be ensured and, more generally, to use and operate it in the
! same conditions as regards security.
! pFoF is free software: you can redistribute it and/or modify
! it under the terms of the GNU General Public License as published by
! the Free Software Foundation, either version 3 of the License, or
! (at your option) any later version.
!
! The fact that you are presently reading this means that you have had
! knowledge of the CeCILL license and that you accept its terms.
!==============================================================================
!=======================================================================
! Author: Fabrice Roy (LUTH/CNRS/Observatoire de Paris)
! and Vincent Bouillot (LUTH/Observatoire de Paris)
! Fabrice.Roy@obspm.fr
!=======================================================================
! pFoF is distributed in the hope that it will be useful,
! but WITHOUT ANY WARRANTY; without even the implied warranty of
! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
! GNU General Public License for more details.
!
! You should have received a copy of the GNU General Public License
! along with pFoF. If not, see <http://www.gnu.org/licenses/>.
!> @file
!! I/O subroutines for conegravcreator
!! @brief
!!
!! @author Fabrice Roy
!! @author Vincent Bouillot
!> I/O subroutines for conegravcreator
!------------------------------------------------------------------------------------------------------------------------------------
Module modio
Use mpi
Use modvariables
Use modhdf5
Integer(kind=4), dimension(:), allocatable :: ncelltab
Integer(kind=4), dimension(:,:), allocatable :: ncellperleveltab
......@@ -166,17 +151,18 @@ Contains
Subroutine readramsesfiles()
use modconstant
Use modmpicommons
Use modreadinfo
Use modiocommons
Implicit None
Integer(kind=4) :: ifile
Character(len=401) :: filedat
Character(len=401) :: filehdr
Character(len=400) :: filename
Character(len=FILENAME_LEN) :: filedat
Character(len=FILENAME_LEN) :: filehdr
Character(len=FILENAME_LEN) :: filename
Integer(kind=4) :: ioerr
Character(len=500) :: errormessage
Character(len=ERR_MSG_LEN) :: errormessage
If(procID==0) Then
filename = trim(param%input_path)//'/'//trim(param%info_cone_input_file)
......@@ -368,19 +354,26 @@ Contains
Subroutine h5writeconegrav()
Use modiocommons
use hdf5, only : HID_T
use fortran_hdf5_constants_m, only : H5_STR_LEN
use fortran_hdf5_manage_files_m
use fortran_hdf5_manage_groups_m
use fortran_hdf5_write_attribute_m
use fortran_hdf5_write_mpi_data_m
use modwritemeta
Implicit none
Character(len=8) :: charic
Character(len=5) :: charncoarse
Character(len=400) :: shellname
Character(len=H5STRLEN) :: aname
Character(len=H5STRLEN) :: groupname
Character(len=H5STRLEN) :: dsetname
Character(len=H5STRLEN) :: adata
Character(len=H5STRLEN) :: codename
Integer(kind=hid_t) :: file_id
Integer(kind=hid_t) :: gr_id, grlvl_id
Character(len=H5_STR_LEN) :: aname
Character(len=H5_STR_LEN) :: groupname
Character(len=H5_STR_LEN) :: dsetname
Character(len=H5_STR_LEN) :: adata
Character(len=H5_STR_LEN) :: codename
Integer(kind=HID_T) :: file_id
Integer(kind=HID_T) :: gr_id, grlvl_id
Integer(kind=4) :: ic, ilvl
Integer(kind=4) :: ipointer
Integer(kind=4) :: np
......@@ -403,10 +396,10 @@ Contains
codename = 'conecreator_grav'
tmpint4 = (2**inforamses%levelmin)
npart8 = tmpint4**3
Call h5write_meta_common(file_id, codename, npart8)
Call h5write_meta_info_cone(file_id, infocone, islast)
Call h5write_meta_info_ramses(file_id, inforamses, islast)
Call h5write_meta_conecreator_parameter(file_id, param)
Call write_meta_common(file_id, codename, npart8)
Call write_meta_info_cone(file_id, infocone, islast)
Call write_meta_info_ramses(file_id, inforamses, islast)
Call write_meta_conecreator_parameter(file_id, param)
! Write type as attribute
aname = 'file_type'
......
!==============================================================================
! Project: pFoF
! File: tools/conegravcreator/src/modsortpart.f90
! Copyright Fabrice Roy (2015)
! Fabrice.Roy@obspm.fr
!
! This software is a computer program whose purpose is to detect dark matter
! haloes in cosmological simulation with a parallel Friend of Friend algorithm.
!------------------------------------------------------------------------------------------------------------------------------------
! Copyright 2015 Fabrice Roy
!
! This software is governed by the CeCILL license under French law and
! abiding by the rules of distribution of free software. You can use,
! modify and/ or redistribute the software under the terms of the CeCILL
! license as circulated by CEA, CNRS and INRIA at the following URL
! "http://www.cecill.info".
! Contact: fabrice.roy@obspm.fr
!
! As a counterpart to the access to the source code and rights to copy,
! modify and redistribute granted by the license, users are provided only
! with a limited warranty and the software's author, the holder of the
! economic rights, and the successive licensors have only limited
! liability.
! This file is part of pFoF.
!
! In this respect, the user's attention is drawn to the risks associated
! with loading, using, modifying and/or developing or reproducing the
! software by the user in light of its specific status of free software,
! that may mean that it is complicated to manipulate, and that also
! therefore means that it is reserved for developers and experienced
! professionals having in-depth computer knowledge. Users are therefore
! encouraged to load and test the software's suitability as regards their
! requirements in conditions enabling the security of their systems and/or
! data to be ensured and, more generally, to use and operate it in the
! same conditions as regards security.
! pFoF is free software: you can redistribute it and/or modify
! it under the terms of the GNU General Public License as published by
! the Free Software Foundation, either version 3 of the License, or
! (at your option) any later version.
!
! The fact that you are presently reading this means that you have had
! knowledge of the CeCILL license and that you accept its terms.
!==============================================================================
! pFoF is distributed in the hope that it will be useful,
! but WITHOUT ANY WARRANTY; without even the implied warranty of
! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
! GNU General Public License for more details.
!
! You should have received a copy of the GNU General Public License
! along with pFoF. If not, see <http://www.gnu.org/licenses/>.
!=======================================================================
! Author: Fabrice Roy (LUTH/CNRS/Observatoire de Paris)
! Fabrice.Roy@obspm.fr
!=======================================================================
!> @file
!! Heapsort for conegravcreator
!! @brief
!!
!! @author Fabrice Roy
!> Heapsort for conegravcreator
!------------------------------------------------------------------------------------------------------------------------------------
Module modsortpart
Use mpi
......
!==============================================================================
! Project: pFoF
! File: tools/conegravcreator/src/modvariables.f90
! Copyright Fabrice Roy (2015)
! Fabrice.Roy@obspm.fr
!
! This software is a computer program whose purpose is to detect dark matter
! haloes in cosmological simulation with a parallel Friend of Friend algorithm.
!------------------------------------------------------------------------------------------------------------------------------------
! Copyright 2015 Fabrice Roy
!
! This software is governed by the CeCILL license under French law and
! abiding by the rules of distribution of free software. You can use,
! modify and/ or redistribute the software under the terms of the CeCILL
! license as circulated by CEA, CNRS and INRIA at the following URL
! "http://www.cecill.info".
! Contact: fabrice.roy@obspm.fr
!
! As a counterpart to the access to the source code and rights to copy,
! modify and redistribute granted by the license, users are provided only
! with a limited warranty and the software's author, the holder of the
! economic rights, and the successive licensors have only limited
! liability.
! This file is part of pFoF.
!
! In this respect, the user's attention is drawn to the risks associated
! with loading, using, modifying and/or developing or reproducing the
! software by the user in light of its specific status of free software,
! that may mean that it is complicated to manipulate, and that also
! therefore means that it is reserved for developers and experienced
! professionals having in-depth computer knowledge. Users are therefore
! encouraged to load and test the software's suitability as regards their
! requirements in conditions enabling the security of their systems and/or
! data to be ensured and, more generally, to use and operate it in the
! same conditions as regards security.
! pFoF is free software: you can redistribute it and/or modify
! it under the terms of the GNU General Public License as published by
! the Free Software Foundation, either version 3 of the License, or
! (at your option) any later version.
!
! The fact that you are presently reading this means that you have had
! knowledge of the CeCILL license and that you accept its terms.
!==============================================================================
! pFoF is distributed in the hope that it will be useful,
! but WITHOUT ANY WARRANTY; without even the implied warranty of
! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
! GNU General Public License for more details.
!
! You should have received a copy of the GNU General Public License
! along with pFoF. If not, see <http://www.gnu.org/licenses/>.
!=======================================================================
! Author: Fabrice Roy (LUTH/CNRS/Observatoire de Paris)
! Fabrice.Roy@obspm.fr
!=======================================================================
!> @file
!! Variables for conegravcreator
!! @brief
!!
!! @author Fabrice Roy
!> Variables for conegravcreator
!------------------------------------------------------------------------------------------------------------------------------------
Module modvariables
Use mpi
Use modconstant
use type_info_ramses_mod
Implicit none
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment