SPEED
READ_FILE_TRAV_POINT.f90
Go to the documentation of this file.
1! Copyright (C) 2012 The SPEED FOUNDATION
2! Author: Ilario Mazzieri
3!
4! This file is part of SPEED.
5!
6! SPEED is free software; you can redistribute it and/or modify it
7! under the terms of the GNU Affero General Public License as
8! published by the Free Software Foundation, either version 3 of the
9! License, or (at your option) any later version.
10!
11! SPEED is distributed in the hope that it will be useful, but
12! WITHOUT ANY WARRANTY; without even the implied warranty of
13! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14! Affero General Public License for more details.
15!
16! You should have received a copy of the GNU Affero General Public License
17! along with SPEED. If not, see <http://www.gnu.org/licenses/>.
18
27
28 subroutine read_file_trav_point(filec,&
29 nmonitors_pgm,&
30 n_monitor_pgm,&
31 dist_monitor_pgm)
32
33 implicit none
34
35 character*70 :: filec
36 character*100000 :: input_line
37
38 integer*4 :: nmonitors_pgm
39 integer*4 :: i
40 integer*4 :: trash
41 integer*4 :: ileft,iright
42 integer*4 :: status
43
44 integer*4,dimension(nmonitors_pgm) :: n_monitor_pgm
45
46 real*8 :: trash_real
47 real*8,dimension(nmonitors_pgm) :: dist_monitor_pgm
48
49
50 open(20,file=filec)
51 read(20,'(A)',iostat = status) input_line
52 ileft = 1
53 iright = len(input_line)
54 read(input_line(ileft:iright),*) nmonitors_pgm
55
56 ! write(*,*) nmonitors_pgm
57 ! read(*,*)
58
59 do i = 1,nmonitors_pgm
60 read(20,'(A)',iostat = status) input_line
61 if (status.ne.0) exit
62
63 ileft = 1
64 iright = len(input_line)
65 read(input_line(ileft:iright),*) trash, n_monitor_pgm(i), trash_real, trash_real, trash_real, dist_monitor_pgm(i)
66
67 enddo
68
69 close(20)
70
71 return
72
73 end subroutine read_file_trav_point
74
subroutine read_file_trav_point(filec, nmonitors_pgm, n_monitor_pgm, dist_monitor_pgm)
Reads files such as MLST.input, MLST.position or MPGM.input.