00001 subroutine poisson_solver_1bh_homosol(char_bc,sou, &
00002 & sou_insurf,dsou_insurf, &
00003 & sou_outsurf,dsou_outsurf,pot)
00004 use phys_constant, only : long
00005 use grid_parameter, only : nrg, npg, ntg, npgxzm, npgxzp, ntgeq
00006 use coordinate_grav_r, only : rg
00007 use def_metric, only : psi, alph, bvxd, bvyd
00008 use make_array_3d
00009 use interface_poisson_solver
00010 use interface_poisson_solver_bhex_surf_int
00011 use interface_sourceterm_surface_int_homosol
00012 use interface_copy_to_hgfn_and_gfnsf
00013 use radial_green_fn_grav_bhex_dd
00014 use radial_green_fn_grav_bhex_nd
00015 use radial_green_fn_grav_bhex_nb
00016 use radial_green_fn_grav_bhex_sd
00017 use radial_green_fn_grav_bhex_dh
00018 use radial_green_fn_grav_bhex_nh
00019 implicit none
00020
00021 real(long), pointer :: pot(:,:,:), sou(:,:,:)
00022 real(long), pointer :: sou_insurf(:,:), dsou_insurf(:,:)
00023 real(long), pointer :: sou_outsurf(:,:), dsou_outsurf(:,:)
00024 real(long), pointer :: sou_iosurf(:,:,:)
00025 real(long), pointer :: pot_vol(:,:,:)
00026 real(long), pointer :: pot_insurf(:,:,:), pot_outsurf(:,:,:)
00027 real(long), pointer :: pot_integrals(:,:,:)
00028 character(len=2) :: char_bc
00029 integer :: irg, itg, ipg
00030
00031 call alloc_array3d(pot_vol,0,nrg,0,ntg,0,npg)
00032 call alloc_array3d(pot_insurf,0,nrg,0,ntg,0,npg)
00033 call alloc_array3d(pot_outsurf,0,nrg,0,ntg,0,npg)
00034 call alloc_array3d(pot_integrals,0,nrg,0,ntg,0,npg)
00035 call alloc_array3d(sou_iosurf,0,ntg,0,npg,1,4)
00036
00037 call calc_hgfn_bhex_nb
00038 call copy_to_hgfn_and_gfnsf(hgfn_nb,gfnsf_nb)
00039 call poisson_solver(sou,pot_vol)
00040
00041 pot_integrals(0:nrg,0:ntg,0:npg) = pot_vol(0:nrg,0:ntg,0:npg)
00042
00043 if (char_bc.eq.'nd') then
00044 call calc_hgfn_bhex_nd
00045 call copy_to_hgfn_and_gfnsf(hgfn_nd,gfnsf_nd)
00046 end if
00047 if (char_bc.eq.'dd') then
00048 call calc_hgfn_bhex_dd
00049 call copy_to_hgfn_and_gfnsf(hgfn_dd,gfnsf_dd)
00050 end if
00051 if (char_bc.eq.'sd') then
00052 call calc_hgfn_bhex_sd
00053 call copy_to_hgfn_and_gfnsf(hgfn_sd,gfnsf_sd)
00054 end if
00055
00056 call sourceterm_surface_int_homosol(pot_integrals,0,sou_insurf,dsou_insurf)
00057 sou_iosurf(1:ntg,1:npg,1) = dsou_insurf(1:ntg,1:npg)
00058 sou_iosurf(1:ntg,1:npg,2) = sou_insurf(1:ntg,1:npg)
00059 call poisson_solver_bhex_surf_int('in',sou_iosurf,pot_insurf)
00060
00061 call sourceterm_surface_int_homosol(pot_integrals,nrg,sou_outsurf,dsou_outsurf)
00062 sou_iosurf(1:ntg,1:npg,3) = dsou_outsurf(1:ntg,1:npg)
00063 sou_iosurf(1:ntg,1:npg,4) = sou_outsurf(1:ntg,1:npg)
00064 call poisson_solver_bhex_surf_int('ou',sou_iosurf,pot_outsurf)
00065
00066 pot(0:nrg,0:ntg,0:npg) = pot_integrals(0:nrg,0:ntg,0:npg) &
00067 & + pot_insurf(0:nrg,0:ntg,0:npg) &
00068 & + pot_outsurf(0:nrg,0:ntg,0:npg)
00069
00070 deallocate(pot_vol)
00071 deallocate(pot_insurf)
00072 deallocate(pot_outsurf)
00073 deallocate(pot_integrals)
00074 deallocate(sou_iosurf)
00075
00076 end subroutine poisson_solver_1bh_homosol