31 subroutine write_fileout_grid(file_name,file_xyz,count,proc,nv,vec,xx,yy,zz,loc_n_num,tstart)
34 character*70 :: file_name, file_xyz
36 integer*4 :: count,proc,nv
39 real*8,
dimension(nv) :: vec
41 real*8,
dimension(nv/3) :: xx,yy,zz
42 integer*4,
dimension(nv/3) :: loc_n_num
44 character*70 :: out_file, xyz_file
45 integer*4 :: i,lname, lnamexyz
47 lname = len_trim(file_name)
48 lnamexyz = len_trim(file_xyz)
50 out_file = file_name(1:lname) //
'000000_000000.out'
51 xyz_file = file_xyz(1:lname) //
'000000.out'
53 if (proc .lt. 10)
then
54 write(out_file(lname+6:lname+6),
'(i1)') proc
55 if(tstart .eq. 0.d0)
write(xyz_file(lname+6:lname+6),
'(i1)') proc
56 else if (proc .lt. 100)
then
57 write(out_file(lname+5:lname+6),
'(i2)') proc
58 if(tstart .eq. 0.d0)
write(xyz_file(lname+5:lname+6),
'(i2)') proc
59 else if (proc .lt. 1000)
then
60 write(out_file(lname+4:lname+6),
'(i3)') proc
61 if(tstart .eq. 0.d0)
write(xyz_file(lname+4:lname+6),
'(i3)') proc
62 else if (proc .lt. 10000)
then
63 write(out_file(lname+3:lname+6),
'(i4)') proc
64 if(tstart .eq. 0.d0)
write(xyz_file(lname+3:lname+6),
'(i4)') proc
65 else if (proc .lt. 100000)
then
66 write(out_file(lname+2:lname+6),
'(i5)') proc
67 if(tstart .eq. 0.d0)
write(xyz_file(lname+2:lname+6),
'(i5)') proc
69 write(out_file(lname+1:lname+6),
'(i6)') proc
70 if(tstart .eq. 0.d0)
write(xyz_file(lname+1:lname+6),
'(i6)') proc
73 if (count .lt. 10)
then
74 write(out_file(lname+13:lname+13),
'(i1)') count
75 else if (count .lt. 100)
then
76 write(out_file(lname+12:lname+13),
'(i2)') count
77 else if (count .lt. 1000)
then
78 write(out_file(lname+11:lname+13),
'(i3)') count
79 else if (count .lt. 10000)
then
80 write(out_file(lname+10:lname+13),
'(i4)') count
81 else if (count .lt. 100000)
then
82 write(out_file(lname+9:lname+13),
'(i5)') count
84 write(out_file(lname+8:lname+13),
'(i6)') count
87 open(20+proc, file=out_file)
89 write(20+proc,*) vec(i)
96 open(20+proc, file=xyz_file)
98 write(20+proc,*) loc_n_num(i), xx(i), yy(i), zz(i)
subroutine write_fileout_grid(file_name, file_xyz, count, proc, nv, vec
Writes output results for Restart.