-
Notifications
You must be signed in to change notification settings - Fork 1
/
cosmological_evolution.f90
69 lines (50 loc) · 1.87 KB
/
cosmological_evolution.f90
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
!>
!! \brief This module contains routines for cosmological evolution
!!
!! Module for Capreole / C2-Ray (f90)
!!
!! \b Author: Garrelt Mellema
!!
!! \b Date: 04-Mar-2006
!!
!! The density and lengths and volumes evolve due to the expansion
!! of the Universe. The cosmo_evol routines evolves the geometrical
!! variables (r, dr, vol) and the material density variables (ndens)
!! according to the current redshift (zfactor from the cosmology module).
!!
!! \b Programming \b note: this is probably a separate module from the cosmology
!! module because of
!! dependency problems. For the cosmo_evol routines, the grid and material
!! variables have to be available, but for those the cosmology module has
!! to be available. As cosmo_evol really belongs within the cosmology module
!! a different solution would be desirable (GM, 20100308).
module cosmological_evolution
! This module contains routines having to do with the cosmological
! evolution of state and grid variables
! - cosmo_evol: cosmological evolution of space, density
use precision, only: dp
use cosmology, only: zfactor
use grid, only: r,dr,vol
use material, only: ndens
implicit none
contains
! =======================================================================
!> Calculates the cosmological evolution of space and densities\n
!! Changes variables: ndens, r, dr, vol
subroutine cosmo_evol ()
! Calculates the cosmological evolution of space and densities
! Author: Garrelt Mellema
! Date: 04-Mar-2006
! Version: F90 first version
! History:
! - 19-Nov-2004: first version f77
real(kind=dp) :: zfactor3
zfactor3=zfactor*zfactor*zfactor
! Change the grid coordinates
r(:)=r(:)*zfactor
dr=dr*zfactor
vol(:)=vol(:)*zfactor3
! Change the densities
ndens(:)=ndens(:)/zfactor3
end subroutine cosmo_evol
end module cosmological_evolution