SPEED
READ_FILE_MPGM.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
30
31 subroutine read_file_mpgm(filec,&
32 nmonitors_pgm,&
33 n_monitor_pgm,&
34 el_monitor_pgm,&
35 xr_monitor_pgm,&
36 yr_monitor_pgm,&
37 zr_monitor_pgm)
38
39 implicit none
40
41 character*70 :: filec
42 character*100000 :: input_line
43
44 integer*4 :: nmonitors_pgm
45 integer*4 :: i
46 integer*4 :: trash
47 integer*4 :: ileft,iright
48 integer*4 :: status
49
50 integer*4,dimension(nmonitors_pgm) :: n_monitor_pgm
51 integer*4,dimension(nmonitors_pgm) :: el_monitor_pgm
52
53 real*8,dimension(nmonitors_pgm) :: xr_monitor_pgm
54 real*8,dimension(nmonitors_pgm) :: yr_monitor_pgm
55 real*8,dimension(nmonitors_pgm) :: zr_monitor_pgm
56
57
58 open(20,file=filec)
59 read(20,'(A)',iostat = status) input_line
60 ileft = 1
61 iright = len(input_line)
62 read(input_line(ileft:iright),*)nmonitors_pgm
63
64 do i = 1,nmonitors_pgm
65 read(20,'(A)',iostat = status) input_line
66 if (status.ne.0) exit
67
68 ileft = 1
69 iright = len(input_line)
70 read(input_line(ileft:iright),*)trash,n_monitor_pgm(i),el_monitor_pgm(i),&
71 xr_monitor_pgm(i),yr_monitor_pgm(i),zr_monitor_pgm(i)
72
73 enddo
74
75 close(20)
76
77 return
78
79 end subroutine read_file_mpgm
80
subroutine read_file_mpgm(filec, nmonitors_pgm, n_monitor_pgm, el_monitor_pgm, xr_monitor_pgm, yr_monitor_pgm, zr_monitor_pgm)
Reads files such as MLST.input, MLST.position or MPGM.input.