Commit efc85c5d authored by Roy Fabrice's avatar Roy Fabrice
Browse files

Add type_info_ramses_mod.f90

Remove type declarations for ramses_info and cone_info from modconstant.f90
Put them in separate file
parent 16a02c04
......@@ -52,10 +52,6 @@ module modconstant
PR, &
GIT_VERSION, &
type_common_metadata, &
type_info_cone, &
type_info_cone_grav, &
type_info_cone_part, &
type_info_ramses, &
type_parameter_conecreator, &
type_parameter_conecreator_grav, &
type_parameter_conecreator_part, &
......@@ -73,10 +69,10 @@ module modconstant
integer, parameter :: ERR_CODE_MEM_ALLOC = 20
integer, parameter :: ERR_CODE_READ_ERROR = 2
integer, parameter :: ERR_CODE_WRONG_PARAMETER = 3
integer, parameter :: ERR_MSG_LEN = 500
integer, parameter :: ERR_MSG_LEN = 256
! filename length
integer, parameter :: FILENAME_LEN = 400
integer, parameter :: FILENAME_LEN = 512
#ifdef LONGINT
integer, parameter :: IDKIND = 8
......@@ -105,81 +101,6 @@ module modconstant
! GIT Revision
character(len=64), parameter :: GIT_VERSION = GITVERSION
! type declaration for information read from cone info file
type :: type_info_cone !< type for information read from cone info file
integer(kind=4) :: ncpu
integer(kind=4) :: nstride
integer(kind=4) :: nstep_coarse
integer(kind=4) :: cone_id
integer(kind=4) :: nglobalfile
integer(kind=4) :: isfullsky
integer(kind=4) :: future
real(kind=8) :: aexp
real(kind=8) :: observer_x
real(kind=8) :: observer_y
real(kind=8) :: observer_z
real(kind=8) :: observer_rds
real(kind=8) :: cone_zlim
real(kind=8) :: amax
real(kind=8) :: amin
real(kind=8) :: zmax
real(kind=8) :: zmin
real(kind=8) :: dmax
real(kind=8) :: dmin
real(kind=8) :: dtol
real(kind=8) :: thetay
real(kind=8) :: thetaz
real(kind=8) :: theta
real(kind=8) :: phi
real(kind=8) :: aendconem2
real(kind=8) :: aendconem1
real(kind=8) :: aendcone
real(kind=8) :: zendconem2
real(kind=8) :: zendconem1
real(kind=8) :: zendcone
real(kind=8) :: dendconem2
real(kind=8) :: dendconem1
real(kind=8) :: dendcone
end type type_info_cone
type, extends(type_info_cone) :: type_info_cone_part !< extension of type_info_cone for particles cone
integer(kind=8) :: npart !! nglobalcell in the file
real(kind=8) :: aexpold
real(kind=8) :: zexpold
real(kind=8) :: zexp
real(kind=8) :: dexpold
real(kind=8) :: dexp
end type type_info_cone_part
type, extends(type_info_cone) :: type_info_cone_grav !< extension of type_info_cone for cells cone
integer(kind=4) :: nlevel
integer(kind=4) :: levelmin
integer(kind=4) :: levelmax
integer(kind=8) :: nglobalcell
end type type_info_cone_grav
! type declaration for information read from ramses info file
type :: type_info_ramses !< type for information read from ramses info file
integer(kind=4) :: ncpu
integer(kind=4) :: ndim !< number of dimensions
integer(kind=4) :: levelmin !< minimum mesh refinement level
integer(kind=4) :: levelmax
integer(kind=4) :: ngridmax
integer(kind=4) :: nstep_coarse
real(kind=8) :: boxlen
real(kind=8) :: time
real(kind=8) :: aexp
real(kind=8) :: h0
real(kind=8) :: omega_m
real(kind=8) :: omega_l
real(kind=8) :: omega_k
real(kind=8) :: omega_b
real(kind=8) :: unit_l
real(kind=8) :: unit_d
real(kind=8) :: unit_t
end type type_info_ramses
type :: type_parameter_halofinder
character(len=200) :: input_path !< path to the directory containing the ramses files
......
......@@ -29,14 +29,16 @@
module modmpicommons
use modconstant, only : err_msg_len,&
type_info_cone_part, &
type_info_cone_grav,&
type_parameter_conecreator_grav, &
type_parameter_conecreator_part,&
type_parameter_pfof_cone,&
type_parameter_pfof_snap,&
type_parameter_pfof_snap
use type_info_ramses_mod, only : type_info_cone_part, &
type_info_cone_grav,&
type_info_ramses
use mpi
implicit none
......
......@@ -44,8 +44,8 @@ contains
!> Read RAMSES snapshot info file
subroutine Readinforamses(filename, inforamses, ierr, errormessage)
use modconstant, only : type_info_ramses, &
ERR_MSG_LEN, FILENAME_LEN
use modconstant, only : ERR_MSG_LEN, FILENAME_LEN
use type_info_ramses_mod, only : type_info_ramses
character(len=FILENAME_LEN), intent(in) :: filename !< info file name
type(type_info_ramses), intent(out) :: inforamses !< info structure
......@@ -94,8 +94,8 @@ contains
!> Read RAMSES particles light cone info file
subroutine Readinfoconepart(filename, infocone, ierr, errormessage)
use modconstant, only : type_info_cone_part,&
ERR_MSG_LEN, FILENAME_LEN
use modconstant, only : ERR_MSG_LEN, FILENAME_LEN
use type_info_ramses_mod, only : type_info_cone_part
character(len=FILENAME_LEN), intent(in) :: filename !< info file name
type(type_info_cone_part), intent(out) :: infocone !< info structure
......@@ -164,8 +164,8 @@ contains
!> Read RAMSES cells light cone info file
subroutine Readinfoconegrav(filename, infocone, ierr, errormessage)
use modconstant, only : type_info_cone_grav,&
ERR_MSG_LEN, FILENAME_LEN
use modconstant, only : ERR_MSG_LEN, FILENAME_LEN
use type_info_ramses_mod, only : type_info_cone_grav
character(len=FILENAME_LEN), intent(in) :: filename !< info file name
type(type_info_cone_grav), intent(out) :: infocone !< info structure
......
......@@ -38,10 +38,6 @@ module modreadmeta
type_parameter_conecreator_part,&
type_parameter_conecreator_grav,&
type_parameter_psod_snap,&
type_info_ramses,&
type_info_cone,&
type_info_cone_part,&
type_info_cone_grav,&
type_common_metadata,&
NAME_PFOF_SNAP,&
NAME_PFOF_CONE,&
......@@ -50,6 +46,11 @@ module modreadmeta
NAME_CONECREATOR_GRAV,&
GIT_VERSION
use type_info_ramses_mod, only : type_info_cone,&
type_info_cone_part,&
type_info_cone_grav,&
type_info_ramses
use modhdf5, only : hid_t,&
H5_STR_LEN,&
Hdf5_create_group,&
......
......@@ -35,9 +35,8 @@ module modwritehalo
type_parameter_pfof,&
type_parameter_pfof_snap,&
type_parameter_pfof_cone,&
type_parameter_psod_snap,&
type_info_ramses,&
type_info_cone
type_parameter_psod_snap
use mpi
use modmpicommons, only : procID,&
type_info_process,&
......@@ -60,6 +59,9 @@ module modwritehalo
Write_meta_info_ramses,&
Write_meta_info_cone
use type_info_ramses_mod, only : type_info_cone, &
type_info_ramses
implicit none
private
......
......@@ -38,10 +38,6 @@ module modwritemeta
type_parameter_conecreator_part,&
type_parameter_conecreator_grav,&
type_parameter_psod_snap,&
type_info_ramses,&
type_info_cone,&
type_info_cone_part,&
type_info_cone_grav,&
type_common_metadata,&
NAME_PFOF_SNAP,&
NAME_PFOF_CONE,&
......@@ -50,6 +46,12 @@ module modwritemeta
NAME_CONECREATOR_GRAV,&
GIT_VERSION
use type_info_ramses_mod, only : type_info_ramses,&
type_info_cone,&
type_info_cone_part,&
type_info_cone_grav
use modhdf5, only : hid_t,&
H5_STR_LEN,&
Hdf5_create_group,&
......
!------------------------------------------------------------------------------------------------------------------------------------
! Copyright 2015 Fabrice Roy
!
! Contact: fabrice.roy@obspm.fr
!
! This file is part of pFoF.
!
! 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.
!
! 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
!! Type definitions for Ramses informations read from info_* files and info_cone_* files
!! @brief
!!
!! @author Fabrice Roy
!> Type definitions for Ramses informations read from info_* files and info_cone_* files
module type_info_ramses_mod
implicit none
private
public :: type_info_cone, type_info_cone_grav, type_info_cone_part, type_info_ramses
! type declaration for information read from cone info file
type :: type_info_cone !< type for information read from cone info file
integer(kind=4) :: ncpu
integer(kind=4) :: nstride
integer(kind=4) :: nstep_coarse
integer(kind=4) :: cone_id
integer(kind=4) :: nglobalfile
integer(kind=4) :: isfullsky
integer(kind=4) :: future
real(kind=8) :: aexp
real(kind=8) :: observer_x
real(kind=8) :: observer_y
real(kind=8) :: observer_z
real(kind=8) :: observer_rds
real(kind=8) :: cone_zlim
real(kind=8) :: amax
real(kind=8) :: amin
real(kind=8) :: zmax
real(kind=8) :: zmin
real(kind=8) :: dmax
real(kind=8) :: dmin
real(kind=8) :: dtol
real(kind=8) :: thetay
real(kind=8) :: thetaz
real(kind=8) :: theta
real(kind=8) :: phi
real(kind=8) :: aendconem2
real(kind=8) :: aendconem1
real(kind=8) :: aendcone
real(kind=8) :: zendconem2
real(kind=8) :: zendconem1
real(kind=8) :: zendcone
real(kind=8) :: dendconem2
real(kind=8) :: dendconem1
real(kind=8) :: dendcone
end type type_info_cone
type, extends(type_info_cone) :: type_info_cone_part !< extension of type_info_cone for particles cone
integer(kind=8) :: npart !! nglobalcell in the file
real(kind=8) :: aexpold
real(kind=8) :: zexpold
real(kind=8) :: zexp
real(kind=8) :: dexpold
real(kind=8) :: dexp
end type type_info_cone_part
type, extends(type_info_cone) :: type_info_cone_grav !< extension of type_info_cone for cells cone
integer(kind=4) :: nlevel
integer(kind=4) :: levelmin
integer(kind=4) :: levelmax
integer(kind=8) :: nglobalcell
end type type_info_cone_grav
! type declaration for information read from ramses info file
type :: type_info_ramses !< type for information read from ramses info file
integer(kind=4) :: ncpu
integer(kind=4) :: ndim !< number of dimensions
integer(kind=4) :: levelmin !< minimum mesh refinement level
integer(kind=4) :: levelmax
integer(kind=4) :: ngridmax
integer(kind=4) :: nstep_coarse
real(kind=8) :: boxlen
real(kind=8) :: time
real(kind=8) :: aexp
real(kind=8) :: h0
real(kind=8) :: omega_m
real(kind=8) :: omega_l
real(kind=8) :: omega_k
real(kind=8) :: omega_b
real(kind=8) :: unit_l
real(kind=8) :: unit_d
real(kind=8) :: unit_t
end type type_info_ramses
end module type_info_ramses_mod
......@@ -9,6 +9,7 @@ VPATH= $(COMMONDIR):.
SRC = modhdf5.f90 \
modconstant.f90 \
type_info_ramses_mod.f90\
modmpicommons.f90 \
modindex.f90 \
modvarcommons.f90 \
......
......@@ -24,7 +24,8 @@
!> This module contains some global variables declarations.
module modvariables
use modconstant, only : IDKIND, type_common_metadata, type_info_ramses, type_parameter_pfof_snap
use modconstant, only : IDKIND, type_common_metadata, type_parameter_pfof_snap
use type_info_ramses_mod, only : type_info_ramses
implicit none
integer(kind=IDKIND) :: ngrid !< total number of grid points: ngrid = nres ** 3
......
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