00001
00002
00003 module weight_midpoint_fluid_sphcoord
00004 use phys_constant, only : long
00005 implicit none
00006
00007 real(long), pointer :: hwrtpg_fc(:,:,:)
00008 real(long), pointer :: hwtpg_fc(:,:)
00009
00010 contains
00011
00012 subroutine allocate_weight_midpoint_fluid_sphcoord
00013 use grid_parameter, only : nrf, ntg, npg
00014 use make_array_2d
00015 use make_array_3d
00016 implicit none
00017 call alloc_array3d(hwrtpg_fc,1,nrf,1,ntg,1,npg)
00018 call alloc_array2d(hwtpg_fc,1,ntg,1,npg)
00019 end subroutine allocate_weight_midpoint_fluid_sphcoord
00020
00021 subroutine calc_weight_midpoint_fluid_sphcoord
00022 use grid_parameter, only : nrf, ntg, npg
00023 use coordinate_grav_r, only : rg, hrg
00024 use weight_midpoint_grav, only : hwdrg, hwdtg, hwdpg
00025 use def_matter, only : rs
00026 implicit none
00027 real(long) :: wgr, wgt, wgp, rrff
00028 integer :: irg, itg, ipg
00029
00030
00031
00032
00033 hwrtpg_ex(:,:,:) = 0.0d0
00034 do ipg = 1, npg
00035 do itg = 1, ntg
00036 call interpo_linear_type0_2Dsurf(rrff,rs,itg,ipg)
00037 do irg = 1, nrf
00038 wgr = hwdrg(irg)
00039 wgt = hwdtg(itg)
00040 wgp = hwdpg(ipg)
00041 hwrtpg_fc(irg,itg,ipg) = wgr*wgt*wgp
00042 if (hrg(irg+1).gt.rrff*rg(nrf) then
00043 wgr = hrg(irg)**2*(rrff*rg(nrf) - rg(irg-1))
00044 hwrtpg_fc(irg,itg,ipg) = wgr*wgt*wgp
00045 exit
00046 end if
00047 end do
00048 end do
00049 end do
00050
00051 end subroutine calc_weight_midpoint_fluid_sphcoord
00052 end module weight_midpoint_fluid_sphcoord