EMPIRE DA  v1.9.1
Data assimilation codes using EMPIRE communication
 All Classes Files Functions Variables Pages
loc_function.f90
Go to the documentation of this file.
1 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
2 !!! Time-stamp: <2016-10-18 15:24:16 pbrowne>
3 !!!
4 !!! subroutine to compute a localisation weighting based on distance
5 !!! Copyright (C) 2015 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 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
27 
28 
31 subroutine loc_function(loctype,dis,scal,inc)
32  use output_empire, only : emp_e
33  use pf_control
34  implicit none
35  integer, parameter :: rk = kind(1.0d0)
36  integer, intent(in) :: loctype
38  real(kind=rk), intent(in) :: dis
39  real(kind=rk), intent(out) :: scal
41  logical, intent(out) :: inc
43  real(kind=rk), parameter :: minscal_gaussian = exp(-8.0d0)
44 
45 
46  select case(loctype)
47  case(1) ! exponential function
48  scal = exp(-(dis**2)/(2.0_rk*pf%len**2))
49  if(scal .gt. minscal_gaussian) then
50  inc = .true.
51  else
52  inc = .false.
53  end if
54  case default
55  write(emp_e,*) 'EMP: ERROR: loctype not supported in subroutine loc_funct&
56  &ion'
57  stop '-1'
58  end select
59 
60 
61 end subroutine loc_function
Module that stores the information about the outputting from empire.
subroutine loc_function(loctype, dis, scal, inc)
subroutine to compute a localisation weighting based on a distance
module pf_control holds all the information to control the the main program
Definition: pf_control.f90:29