SPEED
READ_FILESYS.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
28subroutine read_filesys(filec, num_nodes, label, x, y, z, axis_rot)
29
30 implicit none
31
32 character*70 :: filec
33 character*100000 :: input_line
34 integer*4 :: i, num_nodes, ileft, iright, status
35 real*8, dimension(num_nodes) :: x, y, z, axis_rot
36 integer*4, dimension(num_nodes) :: label
37 real*8 :: dummy, pi
38
39 pi = 4.0*atan(1.d0);
40
41 open(20,file=filec)
42 read(20,'(A)',iostat = status) input_line
43 ileft = 1
44 iright = len(input_line)
45 read(input_line(ileft:iright),*) num_nodes
46
47 do i = 1,num_nodes
48 read(20,'(A)',iostat = status) input_line
49 if (status.ne.0) exit
50 ileft = 1
51 iright = len(input_line)
52 read(input_line(ileft:iright),*) label(i), x(i), y(i), z(i), dummy
53 axis_rot(i) = dummy*pi/180.d0
54 enddo
55
56 close(20)
57
58 return
59
60end subroutine read_filesys
subroutine read_filesys(filec, num_nodes, label, x, y, z, axis_rot)
Reads SYS.input file.