EMPIRE DA  v1.9.1
Data assimilation codes using EMPIRE communication
 All Classes Files Functions Variables Pages
relaxation_profile.f90
Go to the documentation of this file.
1 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
2 !!! Time-stamp: <2016-11-23 11:33:01 pbrowne>
3 !!!
4 !!! Subroutine to compute the relaxation strength
5 !!! Copyright (C) 2016 Philip A. Browne
6 !!!
7 !!! This program is free software: you can redistribute it and/or modify
8 !!! it under the terms of the GNU General Public License as published by
9 !!! the Free Software Foundation, either version 3 of the License, or
10 !!! (at your option) any later version.
11 !!!
12 !!! This program is distributed in the hope that it will be useful,
13 !!! but WITHOUT ANY WARRANTY; without even the implied warranty of
14 !!! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 !!! GNU General Public License for more details.
16 !!!
17 !!! You should have received a copy of the GNU General Public License
18 !!! along with this program. If not, see <http://www.gnu.org/licenses/>.
19 !!!
20 !!! Email: p.browne @ reading.ac.uk
21 !!! Mail: School of Mathematical and Physical Sciences,
22 !!! University of Reading,
23 !!! Reading, UK
24 !!! RG6 6BB
25 !!!
26 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
66 subroutine relaxation_profile(tau,p,zero)
67  use output_empire, only : emp_e
68  use pf_control
69  implicit none
70  integer, parameter :: rk = kind(1.0d0)
71  real(kind=rk), intent(in) :: tau
73  real(kind=rk), intent(out) :: p
74  logical, intent(out) :: zero
75 
76  select case (pf%relaxation_type)
77  case ('zero_linear')
78  if ( tau < pf%relaxation_freetime ) then
79  p = 0.0d0
80  zero = .true.
81  else
82  p = pf%nudgefac*(tau-pf%relaxation_freetime)/(1.0d0-pf&
83  &%relaxation_freetime)
84  zero = .false.
85  end if
86  case ('power_law')
87  if ( tau < pf%relaxation_freetime ) then
88  p = 0.0d0
89  zero = .true.
90  else
91  p = pf%nudgefac * ((tau-pf%relaxation_freetime)/(1.0d0-pf&
92  &%relaxation_freetime))**pf%power_law_p
93  end if
94  case ('exponential')
95  if ( tau < pf%relaxation_freetime ) then
96  p = 0.0d0
97  zero = .true.
98  else
99  p = pf%nudgefac*(exp( (tau-pf%relaxation_freetime)/(1.0d0-pf&
100  &%relaxation_freetime) ) - 1 )/exp(1.0d0)
101  zero = .false.
102  end if
103  case ('constant')
104  if ( tau < pf%relaxation_freetime ) then
105  p = 0.0d0
106  zero = .true.
107  else
108  p = pf%nudgefac
109  zero = .false.
110  end if
111  case ('user')
112  call user_relaxation_profile(tau,p,zero)
113  case default
114  write(emp_e,*) 'Wrong relaxation profile'
115  end select
116 end subroutine relaxation_profile
Module that stores the information about the outputting from empire.
module pf_control holds all the information to control the the main program
Definition: pf_control.f90:29
subroutine user_relaxation_profile(tau, p, zero)
subroutine to compute the relaxation strength that the user codes
subroutine relaxation_profile(tau, p, zero)
subroutine to compute the relaxation strength