00001 subroutine printout_NS_shape_seq(iseq)
00002 use phys_constant, only : long, pi
00003 use coordinate_grav_theta, only : thg
00004 use coordinate_grav_phi, only : phig
00005 use trigonometry_grav_theta, only : sinthg, costhg
00006 use trigonometry_grav_phi, only : sinphig, cosphig
00007 use grid_parameter, only : ntf, npf, ntfeq, ntfxy, &
00008 & npfxzp, npfxzm, npfyzp, npfyzm
00009 use def_matter, only : rs
00010 implicit none
00011 integer :: iseq
00012 integer :: it, ip
00013
00014 if (iseq.eq.1) then
00015 open(20,file='rnsshape_seq_xy.dat',status='unknown')
00016 open(21,file='rnsshape_seq_xz.dat',status='unknown')
00017 open(22,file='rnsshape_seq_zy.dat',status='unknown')
00018 open(23,file='rnsshape_seq_yz.dat',status='unknown')
00019 open(24,file='rnsshape_NS_gnuplot.dat',status='unknown')
00020 else
00021 open(20,file='rnsshape_seq_xy.dat',status='old', position="append")
00022 open(21,file='rnsshape_seq_xz.dat',status='old', position="append")
00023 open(22,file='rnsshape_seq_zy.dat',status='old', position="append")
00024 open(23,file='rnsshape_seq_yz.dat',status='old', position="append")
00025 open(24,file='rnsshape_NS_gnuplot.dat',status='old', position="append")
00026 end if
00027
00028 it = ntfeq
00029 do ip = 0, npf
00030 write(20,'(1p,2e14.6)') &
00031 & rs(it,ip)*sinthg(it)*cosphig(ip), rs(it,ip)*sinthg(it)*sinphig(ip)
00032 end do
00033 write(20,'(1x)')
00034
00035 ip = npfxzp
00036 do it = 0, ntf
00037 write(21,'(1p,2e14.6)') &
00038 & rs(it,ip)*sinthg(it)*cosphig(ip), rs(it,ip)*costhg(it)
00039 end do
00040 ip = npfxzm
00041 do it = ntf-1, 0, -1
00042 write(21,'(1p,2e14.6)') &
00043 & rs(it,ip)*sinthg(it)*cosphig(ip), rs(it,ip)*costhg(it)
00044 end do
00045 write(21,'(1x)')
00046
00047 ip = npfyzp
00048 do it = 0, ntf
00049 write(22,'(1p,2e14.6)') &
00050 & rs(it,ip)*costhg(it), rs(it,ip)*sinthg(it)*sinphig(ip)
00051 end do
00052 ip = npfyzm
00053 do it = ntf-1, 0, -1
00054 write(22,'(1p,2e14.6)') &
00055 & rs(it,ip)*costhg(it), rs(it,ip)*sinthg(it)*sinphig(ip)
00056 end do
00057 write(22,'(1x)')
00058
00059 ip = npfyzp
00060 do it = 0, ntf
00061 write(23,'(1p,2e14.6)') &
00062 & rs(it,ip)*sinthg(it)*sinphig(ip), rs(it,ip)*costhg(it)
00063 end do
00064 ip = npfyzm
00065 do it = ntf-1, 0, -1
00066 write(23,'(1p,2e14.6)') &
00067 & rs(it,ip)*sinthg(it)*sinphig(ip), rs(it,ip)*costhg(it)
00068 end do
00069 write(23,'(1x)')
00070
00071 do ip = 0, npf
00072 do it = 0, ntf
00073 write(24,'(1p,6e20.12)') phig(ip), thg(it)-0.5d0*pi, rs(it,ip)
00074 end do
00075 write(24,'(1x)')
00076 end do
00077
00078 close(20)
00079 close(21)
00080 close(22)
00081 close(23)
00082 close(24)
00083
00084 end subroutine printout_NS_shape_seq