SICOPOLIS V3.0
 All Classes Files Functions Variables Macros
read_phys_para_value.F90
Go to the documentation of this file.
1 !+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
2 !
3 ! Subroutine : r e a d _ p h y s _ p a r a _ v a l u e
4 !
5 !> @file
6 !!
7 !! Reading of a value of a physical parameter from the phys_para file.
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 a value of a physical parameter from the phys_para file.
34 !<------------------------------------------------------------------------------
35 subroutine read_phys_para_value(para, n_unit)
36 
37 use sico_types
38 
39 implicit none
40 integer(i4b) :: n_unit
41 real(dp) :: para
42 character :: check, ch_dummy
43 character (len=*), parameter :: form1='(a)', form3='(15x)'
44 logical :: first_read
45 
46 first_read = .true.
47 
48 do
49  if (first_read) then
50  read(n_unit,form1,advance='no') check
51  first_read=.false.
52  else
53  read(n_unit,form1) ch_dummy
54  read(n_unit,form1,advance='no') check
55  end if
56 
57  if (check /= '%') then ! no comment line
58  read(n_unit,form3,advance='no')
59  read(n_unit,*) para
60  exit
61  end if
62 end do
63 
64 end subroutine read_phys_para_value
65 !