1
!% Contains a module which implements the \cite{white_galaxy_1991} method for computing the time available for cooling in hot
4
module Cooling_Time_Available_White_Frenk
5
!% Implements the \cite{white_galaxy_1991} method for computing the time available for cooling in hot halos.
7
public :: Cooling_Time_Available_WF_Initialize
9
! Parameter which interpolates between age of Universe and dynamical time for the time available for cooling.
10
double precision :: coolingTimeAvailableAgeFactor
14
!# <coolingTimeAvailableMethod>
15
!# <unitName>Cooling_Time_Available_WF_Initialize</unitName>
16
!# </coolingTimeAvailableMethod>
17
subroutine Cooling_Time_Available_WF_Initialize(coolingTimeAvailableMethod,Cooling_Time_Available_Get&
18
&,Cooling_Time_Available_Increase_Rate_Get)
19
!% Initialize the \cite{white_galaxy_1991} cooling time available module.
20
use ISO_Varying_String
24
type(varying_string), intent(in) :: coolingTimeAvailableMethod
25
procedure(), pointer, intent(inout) :: Cooling_Time_Available_Get,Cooling_Time_Available_Increase_Rate_Get
27
if (coolingTimeAvailableMethod.eq.'White-Frenk') then
28
Cooling_Time_Available_Get => Cooling_Time_Available_WF
29
Cooling_Time_Available_Increase_Rate_Get => Cooling_Time_Available_Increase_Rate_WF
31
!@ <name>coolingTimeAvailableAgeFactor</name>
32
!@ <defaultValue>1</defaultValue>
33
!@ <attachedTo>module</attachedTo>
35
!@ Interpolates (geometrically) between the age of the Universe and the halo dynamical time for the time available for cooling in the {\tt White-Frenk} method.
38
call Get_Input_Parameter('coolingTimeAvailableAgeFactor',coolingTimeAvailableAgeFactor,defaultValue=1.0d0)
39
if (coolingTimeAvailableAgeFactor < 0.0d0 .or. coolingTimeAvailableAgeFactor > 1.0d0) call Galacticus_Error_Report('Cooling_Time_Available_WF_Initialize','0 <= coolingTimeAvailableAgeFactor <= 1 is required')
43
end subroutine Cooling_Time_Available_WF_Initialize
45
double precision function Cooling_Time_Available_WF(thisNode)
46
!% Compute the time available for cooling using the \cite{white_galaxy_1991} method. This is assumed to be equal to the
47
!% dynamical timescale of the halo.
50
use Dark_Matter_Halo_Scales
52
type(treeNode), intent(inout), pointer :: thisNode
54
! Return the appropriate time.
55
if (coolingTimeAvailableAgeFactor == 1.0d0) then
56
! Time available equals the age of the Universe, which is just the time for this node.
57
Cooling_Time_Available_WF=Tree_Node_Time(thisNode)
58
else if (coolingTimeAvailableAgeFactor == 0.0d0) then
59
! Time available equals the halo dynamical time.
60
Cooling_Time_Available_WF=Dark_Matter_Halo_Dynamical_Timescale(thisNode)
62
! Time is interpolated between age of Universe and dynamical time. Do the interpolation.
63
Cooling_Time_Available_WF=dexp(dlog(Tree_Node_Time(thisNode))*coolingTimeAvailableAgeFactor&
64
&+dlog(Dark_Matter_Halo_Dynamical_Timescale(thisNode))*(1.0d0-coolingTimeAvailableAgeFactor))
67
end function Cooling_Time_Available_WF
69
double precision function Cooling_Time_Available_Increase_Rate_WF(thisNode)
70
!% Compute the rate of increase of the time available for cooling using the \cite{white_galaxy_1991} method. We return a rate
71
!% of 1, even though technically it can depend on halo properties.
74
type(treeNode), intent(inout), pointer :: thisNode
76
! Simply return unit rate.
77
Cooling_Time_Available_Increase_Rate_WF=1.0d0
79
end function Cooling_Time_Available_Increase_Rate_WF
81
end module Cooling_Time_Available_White_Frenk