SPEED
READ_FILEOUT.f90 File Reference

Go to the source code of this file.

Functions/Subroutines

subroutine read_fileout (filename, counter, procs, nb_vec, vec)
 Reads files *.out for the restart of the simulation.
 

Function/Subroutine Documentation

◆ read_fileout()

subroutine read_fileout ( character*70  filename,
integer*4  counter,
integer*4  procs,
integer*4  nb_vec,
real*8, dimension(nb_vec)  vec 
)

Reads files *.out for the restart of the simulation.

Author
Ilario Mazzieri
Date
September, 2013
Version
1.0
Parameters
[in]filenamefile name
[in]counterindex for snapshot
[in]procsMPI process id
[in]nb_vecnumber of values
[out]vecvalues read

Definition at line 29 of file READ_FILEOUT.f90.

30
31 implicit none
32
33 integer*4 :: counter,procs,nb_vec
34 real*8, dimension(nb_vec) :: vec
35 character*70 :: filename
36
37 character*70 :: out_file
38 integer*4 :: i,lname
39
40 lname = len_trim(filename)
41 out_file = filename(1:lname) // '000000_000000.out'
42
43 if (procs .lt. 10) then
44 write(out_file(lname+6:lname+6),'(i1)') procs
45 else if (procs .lt. 100) then
46 write(out_file(lname+5:lname+6),'(i2)') procs
47 else if (procs .lt. 1000) then
48 write(out_file(lname+4:lname+6),'(i3)') procs
49 else if (procs .lt. 10000) then
50 write(out_file(lname+3:lname+6),'(i4)') procs
51 else if (procs .lt. 100000) then
52 write(out_file(lname+2:lname+6),'(i5)') procs
53 else
54 write(out_file(lname+1:lname+6),'(i6)') procs
55 endif
56
57 if (counter .lt. 10) then
58 write(out_file(lname+13:lname+13),'(i1)') counter
59 else if (counter .lt. 100) then
60 write(out_file(lname+12:lname+13),'(i2)') counter
61 else if (counter .lt. 1000) then
62 write(out_file(lname+11:lname+13),'(i3)') counter
63 else if (counter .lt. 10000) then
64 write(out_file(lname+10:lname+13),'(i4)') counter
65 else if (counter .lt. 100000) then
66 write(out_file(lname+9:lname+13),'(i5)') counter
67 else
68 write(out_file(lname+8:lname+13),'(i6)') counter
69 endif
70
71 open(20+procs, file=out_file)
72
73
74
75
76 do i = 1,nb_vec
77 read(20+procs,*) vec(i)
78 enddo
79
80 close(20+procs)
81
82 return
83
84
85 return
86