Commit 04fbeae5 authored by Roy Fabrice's avatar Roy Fabrice
Browse files

fhi integration, license update

parent 7943d84f
include ../../../Make.inc
EXE = conepartcreator.exe
COMMONDIR = ../../../common/src/
OBJDIR=../../../obj/
MODDIR=../../../mod/
VPATH= $(COMMONDIR):.
EXE = conepartcreator
SRC = modhdf5.f90 \
modconstant.f90 \
modiocommons.f90 \
SRC = modconstant.f90 \
type_info_ramses_mod.f90 \
modmpicommons.f90 \
modreadinfo.f90 \
modvariables.f90 \
modwritemeta.f90 \
modio.f90 \
modsortpart.f90 \
conepartcreator.f90
OBJ = $(SRC:%.f90=%.o)
OBJS_NOPREFIX=$(SRC:%.f90=%.o)
OBJS=$(addprefix $(OBJDIR), $(OBJS_NOPREFIX))
# 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
%.o:%.f90
$(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)
all: directories release
release: $(EXE)
debug: FCFLAGS = $(DEBUGFLAGS)
debug: $(EXE)
$(EXE) : svnrev $(OBJ)
$(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}
${OBJDIR}:
${MKDIR_P} $@
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
${MODDIR}:
${MKDIR_P} $@
.PHONY: gitversion clean cleanall directories all
.PHONY: svnrev clean all
!==============================================================================
! Project: pFoF
! File: tools/conepartcreator/src/conepartcreator.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
!! Contains program that convert particles 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
!=======================================================================
!> Contains program that convert particles binary files from a RAMSES cone output to HDF5 files
!------------------------------------------------------------------------------------------------------------------------------------
Program conepartcreator
......@@ -45,7 +33,7 @@ Program conepartcreator
Use modsortpart
Use modvariables
Use mpi
Use modhdf5
use fortran_hdf5_manage_interface_m
Use modmpicommons, only : procNB, procID
Implicit None
......
!==============================================================================
! Project: pFoF
! File: tools/conepartcreator/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.
!==============================================================================
! 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)
! and Vincent Bouillot (LUTH/Observatoire de Paris)
! Fabrice.Roy@obspm.fr
!=======================================================================
!> @file
!! I/O subroutines for conepartcreator
!! @brief
!!
!! @author Fabrice Roy
!! @author Vincent Bouillot
!> I/O subroutines for conepartcreator
!------------------------------------------------------------------------------------------------------------------------------------
Module modio
Use mpi
Use modvariables
Use modhdf5
Integer(kind=4), dimension(:), allocatable :: nparttab
Integer(kind=4) :: ioerr
......@@ -54,7 +41,7 @@ Module modio
Contains
!=======================================================================
!------------------------------------------------------------------------------------------------------------------------------------
Subroutine theend()
......@@ -66,13 +53,12 @@ Contains
End Subroutine theend
!=======================================================================
!------------------------------------------------------------------------------------------------------------------------------------
Subroutine readparameters
Use modconstant
Use modmpicommons
use modmpicommons
Implicit none
Character(len=16) :: infoconefile
......@@ -150,7 +136,7 @@ Contains
End Subroutine readparameters
!=======================================================================
!------------------------------------------------------------------------------------------------------------------------------------
Subroutine retrievefilelist()
......@@ -180,20 +166,21 @@ Contains
End Subroutine retrievefilelist
!=======================================================================
!------------------------------------------------------------------------------------------------------------------------------------
Subroutine readramsesfiles()
Use modmpicommons
use modconstant
Use modmpicommons
Use modreadinfo
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
Integer(kind=4) :: mpierr
! Call create_mpi_type_info()
......@@ -269,7 +256,7 @@ Contains
End Subroutine readramsesfiles
!=======================================================================
!------------------------------------------------------------------------------------------------------------------------------------
Subroutine readconehdr(file, npartloc)
......@@ -296,7 +283,7 @@ Contains
End Subroutine readconehdr
!=======================================================================
!------------------------------------------------------------------------------------------------------------------------------------
Subroutine readconedat(file,ifile)
......@@ -310,7 +297,7 @@ Contains
Integer :: ibloc, idim, i
Integer :: ndim
Real(kind=4), dimension(:), allocatable :: tmpsimple
Integer(kind=PRI), dimension(:), allocatable :: tmpinteger
Integer(kind=IDKIND), dimension(:), allocatable :: tmpinteger
ndim = 3
npartloc = nparttab(ifile)
......@@ -400,16 +387,24 @@ Contains
End Subroutine readconedat
!=======================================================================
!------------------------------------------------------------------------------------------------------------------------------------
Subroutine h5writecone()
Use modiocommons
Use modmpicommons, only : procNB, procID
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 fortran_hdf5_write_data_m
use modwritemeta
Implicit none
Character(len=8) :: charic
Character(len=H5STRLEN) :: name
Character(len=H5_STR_LEN) :: name
Character(len=20) :: adata
Integer(kind=hid_t) :: file_id
Integer(kind=hid_t) :: gr_id
......@@ -426,8 +421,8 @@ Contains
Character(len=400) :: shellname
Character(len=5) :: charncoarse
Integer(kind=8) :: npart8
Character(len=H5STRLEN) :: codename
Character(len=H5STRLEN) :: groupname
Character(len=H5_STR_LEN) :: codename
Character(len=H5_STR_LEN) :: groupname
Logical(kind=4) :: islast
islast = .false.
......@@ -440,10 +435,10 @@ Contains
codename = 'conecreator_part'
tmpint4 = (2**inforamses%levelmin)
npart8 = tmpint4**3
Call h5write_meta_common(file_id, codename, npart8, procID)
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, procID)
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)
groupname='metadata'
......
!==============================================================================
! Project: pFoF
! File: tools/conepartcreator/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 conepartcreator
!! @brief
!!
!! @author Fabrice Roy
!> Heapsort for conepartcreator
!------------------------------------------------------------------------------------------------------------------------------------
Module modsortpart
......@@ -48,7 +36,6 @@ Module modsortpart
Implicit none
Contains
Subroutine dividespace()
......@@ -135,7 +122,7 @@ Contains
! Input/Output variables
Real (kind=4), Intent(inout),dimension(3,*) :: tx,tv ! positions and velocities
Integer(kind=4), Intent(inout),dimension(*) :: tref
Integer(kind=PRI), Intent(inout), dimension(*), optional :: tid
Integer(kind=IDKIND), Intent(inout), dimension(*), optional :: tid
Real(kind=4), Intent(inout), dimension(*), optional :: tp
Real(kind=4), Intent(inout), dimension(3,*), optional :: tf
......@@ -217,7 +204,7 @@ Contains
! Input/Output variables
Real (kind=4), Intent(inout),dimension(3,*) :: tx,tv ! positions and velocities
Integer(kind=4), Intent(inout),dimension(*) :: tref
Integer(kind=PRI), Intent(inout), dimension(*), optional :: tid
Integer(kind=IDKIND), Intent(inout), dimension(*), optional :: tid
Real(kind=4), Intent(inout), dimension(*), optional :: tp
Real(kind=4), Intent(inout), dimension(3,*), optional :: tf
......@@ -278,7 +265,7 @@ Contains
! Input/Output variables
Real (kind=4), Intent(inout),dimension(3,*) :: tx,tv ! positions and velocities
Integer(kind=4), Intent(inout),dimension(*) :: tref
Integer(kind=PRI), Intent(inout), dimension(*), optional :: tid
Integer(kind=IDKIND), Intent(inout), dimension(*), optional :: tid
Real(kind=4), Intent(inout), dimension(*), optional :: tp
Real(kind=4), Intent(inout), dimension(3,*), optional :: tf
......@@ -343,7 +330,7 @@ Contains
! Input/Output variables
Real (kind=4), Intent(inout),dimension(3,*) :: tx,tv ! positions and velocities
Integer(kind=4), Intent(inout),dimension(*) :: tref
Integer(kind=PRI), Intent(inout), dimension(*), optional :: tid
Integer(kind=IDKIND), Intent(inout), dimension(*), optional :: tid
Real(kind=4), Intent(inout), dimension(*), optional :: tp
Real(kind=4), Intent(inout), dimension(3,*), optional :: tf
......@@ -353,7 +340,7 @@ Contains
! Local variables
Integer(kind=4) :: tmpi
Real(kind=4 ), dimension(3) :: tmpr
Integer(kind=PRI) :: tmpipri
Integer(kind=IDKIND) :: tmpipri
tmpi = tref(i)
tref(i) = tref(j)
......
!==============================================================================
! Project: pFoF
! File: tools/conepartcreator/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/>.
!> @file
!! Variables for conepartcreator
!! @brief
!!
!! @author Fabrice Roy
!=======================================================================
! Author: Fabrice Roy (LUTH/CNRS/Observatoire de Paris)
! Fabrice.Roy@obspm.fr
!=======================================================================
!> Variables for conepartcreator
!------------------------------------------------------------------------------------------------------------------------------------
Module modvariables
Use modconstant
Use mpi
use type_info_ramses_mod
Type(Type_parameter_conecreator_part) :: param
Integer(kind=PRI), dimension(:), allocatable :: id ! id of the particles in the halo just read
Integer(kind=IDKIND), dimension(:), allocatable :: id ! id of the particles in the halo just read
Real(kind=4), dimension(:,:), allocatable :: pos ! position of the particles in the halo just read
Real(kind=4), dimension(:,:), allocatable :: vel ! velocities of the particles in the halo just read
Integer(kind=PRI), dimension(:), allocatable :: ramsespartid
Integer(kind=IDKIND), dimension(:), allocatable :: ramsespartid
Real(kind=4), dimension(:), allocatable :: pot
Real(kind=4), dimension(:,:), allocatable :: field
......
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