SICOPOLIS V3.2
 All Classes Files Functions Variables Macros
read_kei.F90
Go to the documentation of this file.
1 !+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
2 !
3 ! Subroutine : r e a d _ k e i
4 !
5 !> @file
6 !!
7 !! Reading of the tabulated kei function.
8 !!
9 !! @section Copyright
10 !!
11 !! Copyright 2009-2016 Ralf Greve
12 !!
13 !! @section License
14 !!
15 !! This file is part of SICOPOLIS.
16 !!
17 !! SICOPOLIS is free software: you can redistribute it and/or modify
18 !! it under the terms of the GNU General Public License as published by
19 !! the Free Software Foundation, either version 3 of the License, or
20 !! (at your option) any later version.
21 !!
22 !! SICOPOLIS is distributed in the hope that it will be useful,
23 !! but WITHOUT ANY WARRANTY; without even the implied warranty of
24 !! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
25 !! GNU General Public License for more details.
26 !!
27 !! You should have received a copy of the GNU General Public License
28 !! along with SICOPOLIS. If not, see <http://www.gnu.org/licenses/>.
29 !<
30 !+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
31 
32 !-------------------------------------------------------------------------------
33 !> Reading of the tabulated kei function.
34 !<------------------------------------------------------------------------------
35 subroutine read_kei()
36 
37 use sico_types
39 use sico_vars
40 
41 implicit none
42 
43 integer(i4b) :: n, n_data_kei_max
44 integer(i4b) :: ios
45 real(dp) :: r_val, d_dummy
46 character :: ch_dummy
47 
48 n_data_kei_max = 10000
49 
50 kei = 0.0_dp
51 
52 !-------- Reading of tabulated values --------
53 
54 open(unit=11, iostat=ios, &
55  file=inpath//'/general/kei.dat', &
56  status='old')
57 if (ios /= 0) stop ' read_kei: Error when opening the kei file!'
58 
59 read(unit=11, fmt='(a)') ch_dummy
60 read(unit=11, fmt='(15x,f5.0)') kei_r_max
61 read(unit=11, fmt='(15x,f5.0)') kei_r_incr
62 read(unit=11, fmt='(a)') ch_dummy
63 
64 n_data_kei = nint(kei_r_max/kei_r_incr)
65 
66 if (n_data_kei > n_data_kei_max) stop ' read_kei: Array kei too small!'
67 
68 read(unit=11, fmt='(a)') ch_dummy
69 read(unit=11, fmt='(a)') ch_dummy
70 read(unit=11, fmt='(a)') ch_dummy
71 
72 do n=-n_data_kei, n_data_kei
73  read(unit=11, fmt=*) d_dummy, kei(n)
74 end do
75 
76 close(unit=11, status='keep')
77 
78 end subroutine read_kei
79 !
Declarations of kind types for SICOPOLIS.
Definition: sico_types.F90:35
Declarations of global variables for SICOPOLIS (for the ANT domain).
Definition: sico_vars.F90:35
subroutine read_kei()
Reading of the tabulated kei function.
Definition: read_kei.F90:35
Declarations of global variables for SICOPOLIS.