Skip to content
Snippets Groups Projects
Commit c3e762ac authored by s2006749's avatar s2006749
Browse files

fixed csv outputs

parent 46e6e8f7
No related branches found
No related tags found
1 merge request!1Adding ellip_utils
...@@ -1054,7 +1054,7 @@ contains ...@@ -1054,7 +1054,7 @@ contains
if ((itime==ifirst).or.(itime==0)) then if ((itime==ifirst).or.(itime==0)) then
endif endif
if ((nrank .eq. 0).and.(record_var.eq.1)) then if ((nrank .eq. 0).and.(record_var.eq.1).and.(mod(itime,ilist)==0)) then
! write(*,*) 'TIME STEP = ', itime ! write(*,*) 'TIME STEP = ', itime
write(38+(iv-1),*) t,dra1,dra2,dra3, sum(tdiffx), sum(tdiffx2), tp1, -mom1, -sum(tunstx(:)), -sum(tconvx(:)), -sum(tconvx2(:)) write(38+(iv-1),*) t,dra1,dra2,dra3, sum(tdiffx), sum(tdiffx2), tp1, -mom1, -sum(tunstx(:)), -sum(tconvx(:)), -sum(tconvx2(:))
! write(*,*) 'written to file number', 38+(iv-1), t, dra1,dra2,dra3 ! write(*,*) 'written to file number', 38+(iv-1), t, dra1,dra2,dra3
...@@ -1868,7 +1868,7 @@ contains ...@@ -1868,7 +1868,7 @@ contains
if ((itime==ifirst).or.(itime==0)) then if ((itime==ifirst).or.(itime==0)) then
endif endif
if ((nrank .eq. 0).and.(record_var.eq.1)) then if ((nrank .eq. 0).and.(record_var.eq.1).and.(mod(itime,ilist)==0)) then
! write(*,*) 'TIME STEP = ', itime ! write(*,*) 'TIME STEP = ', itime
write(45+(iv-1),*) t,dra1,dra2,dra3, sum(tdiffx), sum(tdiffx2), tp1, -mom1, -sum(tunstx(:)), -sum(tconvx(:)), -sum(tconvx2(:)) write(45+(iv-1),*) t,dra1,dra2,dra3, sum(tdiffx), sum(tdiffx2), tp1, -mom1, -sum(tunstx(:)), -sum(tconvx(:)), -sum(tconvx2(:))
! write(*,*) 'written to file number', 38+(iv-1), t, dra1,dra2,dra3 ! write(*,*) 'written to file number', 38+(iv-1), t, dra1,dra2,dra3
......
...@@ -22,6 +22,8 @@ program xcompact3d ...@@ -22,6 +22,8 @@ program xcompact3d
real(mytype) :: dummy,drag(10),lift(10),lat(10),grav_effy(10),grav_effx(10),grav_effz(10),xtorq(10),ytorq(10),ztorq(10),maxrad real(mytype) :: dummy,drag(10),lift(10),lat(10),grav_effy(10),grav_effx(10),grav_effz(10),xtorq(10),ytorq(10),ztorq(10),maxrad
integer :: iounit,ierr,i integer :: iounit,ierr,i
real, dimension(100) :: x real, dimension(100) :: x
character(len=30) :: filename!, filename2
call init_xcompact3d() call init_xcompact3d()
...@@ -38,7 +40,10 @@ program xcompact3d ...@@ -38,7 +40,10 @@ program xcompact3d
end if end if
if (nrank==0) then if (nrank==0) then
open(unit=12, file='body.dat1', status='unknown', form='formatted') do i = 1,nbody
write(filename,"('body.dat',I1.1)") i
open(unit=11+i, file=filename, status='unknown', form='formatted')
enddo
endif endif
! do i = 1,100 ! do i = 1,100
! x(i) = i ! x(i) = i
...@@ -180,11 +185,12 @@ program xcompact3d ...@@ -180,11 +185,12 @@ program xcompact3d
enddo enddo
! if (nrank==0) then if (nrank==0) then
! write(12 ,*) t, position(1), position(2), position(3), orientation(1), orientation(2), orientation(3), orientation(4), linearVelocity(1), linearVelocity(2), linearVelocity(3), angularVelocity(2), angularVelocity(3), angularVelocity(4), drag, lift, lat, xtorq, ytorq, ztorq do i = 1,nbody
! flush(12) write(11+i ,*) t, position(i,1), position(i,2), position(i,3), orientation(i,1), orientation(i,2), orientation(i,3), orientation(i,4), linearVelocity(i,1), linearVelocity(i,2), linearVelocity(i,3), angularVelocity(i,2), angularVelocity(i,3), angularVelocity(i,4), linearForce(i,1), linearForce(i,2), linearForce(i,3), torque(i,1), torque(i,2), torque(i,3)
! endif flush(11+i)
! endif enddo
endif
if ((nrank==0).and.(mod(itime,ilist)==0)) then if ((nrank==0).and.(mod(itime,ilist)==0)) then
do i = 1,nbody do i = 1,nbody
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment