00001 subroutine IO_output_1D_general(filename,fg,mg,pot,jr,jt,jp)
00002 use phys_constant, only : long
00003 use grid_parameter, only : nrg, ntg, npg, nrf, ntf, npf
00004 use coordinate_grav_r, only : rg
00005 use coordinate_grav_theta, only : thg
00006 use coordinate_grav_phi, only : phig
00007 implicit none
00008 integer :: ir, it, ip, nrtmp, nttmp, nptmp, ii, ir0,it0,ip0
00009 real(long), pointer :: pot(:,:,:)
00010 integer, intent(in) :: jr, jt, jp
00011 character(len=1), intent(in) :: fg,mg
00012 character(len=30), intent(in) :: filename
00013
00014 if(fg == 'f') then
00015 nrtmp=nrf; nttmp=ntf; nptmp=npf
00016 else
00017 nrtmp=nrg; nttmp=ntg; nptmp=npg
00018 end if
00019
00020 if (mg=='m') then
00021 ir0=1; it0=1; ip0=1
00022 else
00023 ir0=0; it0=0; ip0=0
00024 end if
00025
00026 open(12,file=filename, status='unknown')
00027 if (jr==-1) then
00028 do ii=ir0,nrtmp
00029 write(12,'(1p,2e20.12)') rg(ii), pot(ii,jt,jp)
00030 end do
00031 end if
00032 if (jt==-1) then
00033 do ii=it0,nttmp
00034 write(12,'(1p,2e20.12)') thg(ii), pot(jr,ii,jp)
00035 end do
00036 end if
00037 if (jp==-1) then
00038 do ii=ip0,nptmp
00039 write(12,'(1p,2e20.12)') phig(ii), pot(jr,jt,ii)
00040 end do
00041 end if
00042 close(12)
00043
00044 end subroutine IO_output_1D_general