SICOPOLIS V3.0
 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-2013 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 
40 implicit none
41 
42 integer(i4b) :: n, n_data_kei_max
43 integer(i4b) :: ios
44 real(dp) :: r_val, d_dummy
45 character :: ch_dummy
46 
47 n_data_kei_max = 10000
48 
49 kei = 0.0_dp
50 
51 !-------- Reading of tabulated values --------
52 
53 open(11, iostat=ios, &
54  file=inpath//'/general/kei.dat', &
55  status='old')
56 if (ios /= 0) stop ' read_kei: Error when opening the kei file!'
57 
58 read(11,'(a)') ch_dummy
59 read(11,'(15x,f5.0)') kei_r_max
60 read(11,'(15x,f5.0)') kei_r_incr
61 read(11,'(a)') ch_dummy
62 
63 n_data_kei = nint(kei_r_max/kei_r_incr)
64 
65 if (n_data_kei > n_data_kei_max) stop ' read_kei: Array kei too small!'
66 
67 read(11,'(a)') ch_dummy
68 read(11,'(a)') ch_dummy
69 read(11,'(a)') ch_dummy
70 
71 do n=-n_data_kei, n_data_kei
72  read(11,*) d_dummy, kei(n)
73 end do
74 
75 close(11, status='keep')
76 
77 end subroutine read_kei
78 !