Commit 621979cd authored by Roy Fabrice's avatar Roy Fabrice
Browse files

fhi integration and license update

parent 3cb7b8ba
include ../../../Make.inc
COMMONDIR = ../../../common/src/
OBJDIR=../../../obj/
MODDIR=../../../mod/
VPATH= $(COMMONDIR):.
SRC = modhdf5.f90 \
modconstant.f90 \
modiocommons.f90 \
EXE = conemapper.exe
SRC = modconstant.f90 \
type_info_ramses_mod.f90 \
modreadparameters.f90 \
modvariables.f90 \
modio.f90 \
modmap.f90 \
conemapper_var_m.f90 \
conemapper_io_m.f90 \
map_m.f90 \
conemapper.f90
OBJ = $(SRC:%.f90=%.o)
EXE = conemapper
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)
$(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}
${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/conemapper/src/conemapper.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
!! Conemapper computes the optimal processes placement for a Ramses cone analysis
!! @brief
!!
!! @author Fabrice Roy
!> @file
!! This file contains the conemapper tool main program.
!> Conemapper computes the optimal processes placement for a Ramses cone analysis
!------------------------------------------------------------------------------------------------------------------------------------
!> This in the conemapper tool main program.
Program conemapper
program conemapper
Use modhdf5
Use modio
Use modmap
use conemapper_io_m
use fortran_hdf5_manage_interface_m
use map_m
Implicit None
implicit none
! Initialization of HDF5
Call hdf5_init()
call hdf5_init()
Call readparameters()
call readparameters()
Call h5readshellinfo()
call h5readshellinfo()
Call exploremap()
call exploremap()
! Finalize HDF5
Call hdf5_finalize()
call hdf5_finalize()
End Program conemapper
end program conemapper
!==============================================================================
! Project: pFoF
! File: tools/conemapper/src/modio.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
!! This file contains some input/output subroutines for the conemapper tool.
!> @file
!! Conemapper computes the optimal processes placement for a Ramses cone analysis
!! Input/output subroutines for the conemapper tool.
!! @brief
!!
!! @author Fabrice Roy
!> This module contains some input/output subroutines for the conemapper tool.
Module modio
Use modhdf5
Use modvariables
Use modreadparameters
!> Input/output subroutines for the conemapper tool.
!------------------------------------------------------------------------------------------------------------------------------------
Module conemapper_io_m
Integer :: ioerr
use conemapper_var_m
use modreadparameters
implicit none
private
public :: theend, readparameters, h5readshellinfo, h5writemap
Contains
integer :: ioerr
contains
!=======================================================================
Subroutine theend()
Implicit none
Print *,' '
Print *,'Run Completed!'
......@@ -64,11 +56,11 @@ Contains
!> This subroutine reads the parameters from the file pfof_cone.nml
Subroutine readparameters()
Implicit None
use modconstant
Character(len=400) :: parameters_file
Character(len=FILENAME_LEN) :: parameters_file
Integer(kind=4) :: errcode
Character(len=500) :: errmessage
Character(len=ERR_MSG_LEN) :: errmessage
parameters_file = 'pfof_cone.nml'
......@@ -91,11 +83,17 @@ Contains
!> cubic group from each shell file, then perform a reduction to get the
!> total number of particles for each cubic group.
Subroutine h5readshellinfo()
Implicit None
Character(len=H5STRLEN) :: dataname
Character(len=H5STRLEN) :: groupname
use fortran_hdf5_constants_m, only : H5_STR_LEN
use fortran_hdf5_manage_files_m
use fortran_hdf5_manage_groups_m
use fortran_hdf5_read_attribute_m
use fortran_hdf5_read_data_m
use hdf5, only : HID_T
Character(len=H5_STR_LEN) :: dataname
Character(len=H5_STR_LEN) :: groupname
Character(len=5) :: charish
Character(len=400) :: shellname
Integer :: ish, ic
......@@ -178,15 +176,20 @@ Contains
!> pfof_cone process.
Subroutine h5writemap(factor, procNB, dims, coords)
Implicit None
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_data_m
use hdf5, only : HID_T
Integer(kind=4), intent(in) :: factor
Integer(kind=4), intent(in) :: procNB
Integer(kind=4), dimension(3), intent(in) :: dims
Integer(kind=4), dimension(3,procNB), intent(in) :: coords
Character(len=400) :: filename
Character(len=H5STRLEN) :: groupname
Character(len=H5STRLEN) :: dataname
Character(len=H5_STR_LEN) :: groupname
Character(len=H5_STR_LEN) :: dataname
Character(len=6) :: charpnb
Character(len=4) :: charfac
Character(len=8) :: charpid
......@@ -240,4 +243,4 @@ Contains
End Subroutine h5writemap
End Module modio
End Module conemapper_io_m
!==============================================================================
! Project: pFoF
! File: tools/conemapper/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
!!This file contains some global variables declarations.
!! Global variables declarations.
!! @brief
!!
!! @author Fabrice Roy
!> Global variables declarations.
!------------------------------------------------------------------------------------------------------------------------------------
!> This module contains some global variables declarations.
Module modvariables
Use modconstant
Module conemapper_var_m
use modconstant
Implicit None
implicit none
Type(Type_parameter_pfof_cone) :: parameters !< Input parameters read from the pfof_cone.nml file.
......@@ -58,4 +47,4 @@ Module modvariables
Real(kind=8), dimension(:,:), allocatable :: boundaries ! (x,y,z)min, (x,y,z)max of each pfof cube
Logical :: fullsky ! is it a fullsky cone?
End Module modvariables
end module conemapper_var_m
!==============================================================================
! Project: pFoF
! File: tools/conemapper/src/modmap.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
!! Core functions of the conemapper tool: the functions that compute
!! the mapping between the narrow or fullsky light cone and the processes topology that pfof_cone will have to use.
!! @brief
!!
!! @author Fabrice Roy
!> @file
!! This file contains the core functions of the conemapper tool: the functions that compute the mapping between the narrow or fullsky light cone and the processes topology that pfof_cone will have to use.
!> Core functions of the conemapper tool: the functions that compute
!! the mapping between the narrow or fullsky light cone and the processes topology that pfof_cone will have to use.
!------------------------------------------------------------------------------------------------------------------------------------
!> This module contains the core functions of the conemapper tool: the functions that compute the mapping between the narrow or fullsky light cone and the processes topology that pfof_cone will have to use.
Module modmap
Module map_m
Use modvariables
Use conemapper_var_m
Implicit None
implicit none
Integer(kind=4) :: fofgrid_imin, fofgrid_imax
Integer(kind=4) :: fofgrid_jmin, fofgrid_jmax
......@@ -55,8 +46,6 @@ Contains
!> Calls the mapping function for different pfof cube size
Subroutine exploremap()
Implicit None
Integer(kind=4) :: factor
Integer(kind=4) :: if
Integer(kind=4) :: fmax
......@@ -88,9 +77,9 @@ Contains
!> Creates a mapping between the cone and the processes topology for pfof_cone given a factor that corresponds to the ratio between the pfof cube edge length and the shell cube edge length.
Subroutine map(factor)
Use modio
use conemapper_io_m, only : H5writemap
Implicit None
implicit none
Integer(kind=4), intent(in) :: factor
Integer(kind=4), dimension(3) :: vertex
......@@ -411,4 +400,4 @@ Contains
End Subroutine getnpfromshell
End Module modmap
End Module map_m
Markdown is supported
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