SPEED
WRITE_FILEOUT_GRID_SV.f90 File Reference

Go to the source code of this file.

Functions/Subroutines

subroutine write_fileout_grid_sv (file_name, file_xyz, count, proc, n
 Writes output results for Restart.
 

Function/Subroutine Documentation

◆ write_fileout_grid_sv()

subroutine write_fileout_grid_sv ( character*70  file_name,
character*70  file_xyz,
integer*4  count,
integer*4  proc,
  n 
)

Writes output results for Restart.

Author
Ilario Mazzieri
Date
September, 2013
Version
1.0
Parameters
[in,out]file_namedirectory where saving files
[in]countindex for snapshot
[in]procmpi process id
[in]nvnumber of values to print
[in]vecvalues to print
[in]xx,yy,zzcoordinates of the grid nodes to print
[in]localto global numbering for nodes

Definition at line 31 of file WRITE_FILEOUT_GRID_SV.f90.

32 vec,xx,yy,zz,loc_n_num,tstart)
33
34
35
36 character*70 :: file_name, file_xyz
37
38 integer*4 :: count,proc,nv, ncol
39
40 real*8 :: tstart
41 real*8, dimension(nv,ncol) :: vec
42
43 real*8, dimension(nv/6) :: xx,yy,zz
44 integer*4, dimension(nv/6) :: loc_n_num
45
46 character*70 :: out_file, xyz_file
47 integer*4 :: i,lname, lnamexyz
48
49 lname = len_trim(file_name)
50 lnamexyz = len_trim(file_xyz)
51
52 out_file = file_name(1:lname) // '000000_000000.out'
53 xyz_file = file_xyz(1:lname) // '000000.out'
54
55 if (proc .lt. 10) then
56 write(out_file(lname+6:lname+6),'(i1)') proc
57 if(tstart .eq. 0.d0) write(xyz_file(lname+6:lname+6),'(i1)') proc
58 else if (proc .lt. 100) then
59 write(out_file(lname+5:lname+6),'(i2)') proc
60 if(tstart .eq. 0.d0) write(xyz_file(lname+5:lname+6),'(i2)') proc
61 else if (proc .lt. 1000) then
62 write(out_file(lname+4:lname+6),'(i3)') proc
63 if(tstart .eq. 0.d0) write(xyz_file(lname+4:lname+6),'(i3)') proc
64 else if (proc .lt. 10000) then
65 write(out_file(lname+3:lname+6),'(i4)') proc
66 if(tstart .eq. 0.d0) write(xyz_file(lname+3:lname+6),'(i4)') proc
67 else if (proc .lt. 100000) then
68 write(out_file(lname+2:lname+6),'(i5)') proc
69 if(tstart .eq. 0.d0) write(xyz_file(lname+2:lname+6),'(i5)') proc
70 else
71 write(out_file(lname+1:lname+6),'(i6)') proc
72 if(tstart .eq. 0.d0) write(xyz_file(lname+1:lname+6),'(i6)') proc
73 endif
74
75 if (count .lt. 10) then
76 write(out_file(lname+13:lname+13),'(i1)') count
77 else if (count .lt. 100) then
78 write(out_file(lname+12:lname+13),'(i2)') count
79 else if (count .lt. 1000) then
80 write(out_file(lname+11:lname+13),'(i3)') count
81 else if (count .lt. 10000) then
82 write(out_file(lname+10:lname+13),'(i4)') count
83 else if (count .lt. 100000) then
84 write(out_file(lname+9:lname+13),'(i5)') count
85 else
86 write(out_file(lname+8:lname+13),'(i6)') count
87 endif
88
89 open(20+proc, file=out_file)
90 do i = 1,nv
91 write(20+proc,*) vec(i,:)
92 enddo
93 close(20+proc)
94
95
96! write(20+proc,*) loc_n_num(i), xx(i), yy(i), zz(i), &
97! vec(3*(i-1)+1), vec(3*(i-1)+2),vec(3*(i-1)+3)
98 open(20+proc, file=xyz_file)
99 do i = 1,nv/6
100 write(20+proc,*) loc_n_num(i), xx(i), yy(i), zz(i)
101 enddo
102 close(20+proc)
103
104
105
106 return
107