00001 subroutine hydro_spbns_vep_CF_peos(vpot,iter,impt,ihy)
00002 use phys_constant, only : long
00003 use grid_parameter, only : nrf, ntf, npf
00004 use coordinate_grav_r, only : rg, hrg
00005 use def_matter, only : rs
00006 use make_array_2d
00007 use make_array_3d
00008 use weight_midpoint_fluid_sphcoord
00009 use interface_source_vep_CF_peos_spin
00010 use interface_interpo_flsfc2flsph_midpoint
00011 use interface_poisson_solver_fluid_sphcoord
00012 use interface_interpo_flsph2flsfc
00013 use interface_source_vep_surface_CF_peos
00014 use interface_poisson_solver_homogeneous_sol_spin
00015 use radial_green_fn_grav
00016
00017 use interface_interpo_linear_type0_2Dsurf
00018
00019
00020
00021 implicit none
00022 real(long), pointer :: vpot(:,:,:)
00023 real(long), pointer :: sou(:,:,:), soufc(:,:,:), surp(:,:)
00024 real(long), pointer :: vpotfc(:,:,:), vpot_v(:,:,:), vpot_b(:,:,:)
00025 integer :: ir,it,ip, iter, impt, ihy
00026 real(long) :: rrff
00027 character(30) :: char1, char2, char3, char4, char5, char6, char7
00028
00029 call alloc_array3d(sou, 0, nrf, 0, ntf, 0, npf)
00030 call alloc_array3d(soufc, 0, nrf, 0, ntf, 0, npf)
00031 call alloc_array2d(surp, 0, ntf, 0, npf)
00032 call alloc_array3d(vpotfc, 0, nrf, 0, ntf, 0, npf)
00033 call alloc_array3d(vpot_v, 0, nrf, 0, ntf, 0, npf)
00034 call alloc_array3d(vpot_b, 0, nrf, 0, ntf, 0, npf)
00035
00036 call source_vep_CF_peos_spin(sou)
00037
00038 call interpo_flsfc2flsph_midpoint(sou,soufc)
00039
00040 call calc_weight_midpoint_fluid_sphcoord
00041
00042 call calc_hgfn
00043
00044 call poisson_solver_fluid_sphcoord(soufc,vpotfc)
00045
00046 call interpo_flsph2flsfc(vpotfc,vpot_v)
00047
00048 call source_vep_surface_CF_peos(vpot_v,surp)
00049
00050 call poisson_solver_homogeneous_sol_spin(surp,vpot_b)
00051
00052 if (mod(iter,5)==0.and.impt==1.and.ihy==4) then
00053 write(char1, '(i5)') iter
00054 char2 = adjustl(char1)
00055 write(char4, '(i5)') impt
00056 char5 = adjustl(char4)
00057 write(char6, '(i5)') ihy
00058 char7 = adjustl(char6)
00059
00060
00061 char3 = 'iteration' // trim(char2) // '_mpt' // trim(char5) // '.txt'
00062 open(12,file=char3,status='unknown')
00063 it=12; ip=6
00064 call interpo_linear_type0_2Dsurf(rrff,rs,it,ip)
00065 write(12,'(a1,a2,4a16,a30)') '#', 'ir', 'hrg*rrff', 'sou', 'hrg', 'soufc', 'plot using every :::0::0'
00066 do ir=1,nrf
00067 write(12,'(i3,4e16.6)') ir, hrg(ir)*rrff, sou(ir,it,ip), hrg(ir), soufc(ir,it,ip)
00068 end do
00069 write(12,*) '#------------------------------------------------------------------------------------------------------'
00070 write(12,*) ""
00071 write(12,'(a1,a2,5a16,a30)') '#', 'ir', 'rg', 'vpotfc', 'rs*rg', 'vpot_v', 'vpot_b', 'plot using every :::1::1'
00072 do ir=0,nrf
00073 write(12,'(i3,5e16.6)') ir, rg(ir), vpotfc(ir,it,ip), &
00074 & rs(it,ip)*rg(ir), vpot_v(ir,it,ip), vpot_b(ir,it,ip)
00075 end do
00076 write(12,*) ""
00077 close(12)
00078 endif
00079
00080 vpot(0:nrf,0:ntf,0:npf) = vpot_v(0:nrf,0:ntf,0:npf) + vpot_b(0:nrf,0:ntf,0:npf)
00081
00082 deallocate(sou)
00083 deallocate(soufc)
00084 deallocate(surp)
00085 deallocate(vpotfc)
00086 deallocate(vpot_v)
00087 deallocate(vpot_b)
00088 end subroutine hydro_spbns_vep_CF_peos