SICOPOLIS V3.2
 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-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 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 
41 integer(i4b), intent(in) :: n_unit
42 real(dp), intent(out) :: para
43 
44 character :: check, ch_dummy
45 character(len=*), parameter :: fmt1='(a)', fmt3='(15x)'
46 logical :: first_read
47 
48 first_read = .true.
49 
50 do
51  if (first_read) then
52  read(unit=n_unit, fmt=trim(fmt1), advance='no') check
53  first_read=.false.
54  else
55  read(unit=n_unit, fmt=trim(fmt1)) ch_dummy
56  read(unit=n_unit, fmt=trim(fmt1), advance='no') check
57  end if
58 
59  if (check /= '%') then ! no comment line
60  read(unit=n_unit, fmt=trim(fmt3), advance='no')
61  read(unit=n_unit, fmt=*) para
62  exit
63  end if
64 end do
65 
66 end subroutine read_phys_para_value
67 !
Declarations of kind types for SICOPOLIS.
Definition: sico_types.F90:35
subroutine check(status, ch_calling_routine)
NetCDF error capturing.
Definition: nc_check.F90:45
subroutine read_phys_para_value(para, n_unit)
Reading of a value of a physical parameter from the phys_para file.