00001 subroutine IO_output_3D_general(filename,fg,mg,pot)
00002 use phys_constant, only : long
00003 use grid_parameter, only : nrg, ntg, npg, nrf, ntf, npf
00004 implicit none
00005 integer :: ir, it, ip, nrtmp, nttmp, nptmp, ir0,it0,ip0
00006 real(long), pointer :: pot(:,:,:)
00007 character(len=1), intent(in) :: fg, mg
00008 character(len=30), intent(in) :: filename
00009
00010 if(fg == 'f') then
00011 nrtmp=nrf; nttmp=ntf; nptmp=npf
00012 else
00013 nrtmp=nrg; nttmp=ntg; nptmp=npg
00014 end if
00015
00016 if (mg=='m') then
00017 ir0=1; it0=1; ip0=1
00018 else
00019 ir0=0; it0=0; ip0=0
00020 end if
00021
00022 open(12,file=filename, status='unknown')
00023 write(12,'(5i5)') nrtmp, nttmp, nptmp
00024 do ip = ip0, nptmp
00025 do it = it0, nttmp
00026 do ir = ir0, nrtmp
00027 write(12,'(1p,e20.12)') pot(ir,it,ip)
00028 end do
00029 end do
00030 end do
00031 close(12)
00032
00033 end subroutine IO_output_3D_general