00001 subroutine line_int_fluid(cline, ia, ib, souf, line_int)
00002 use phys_constant, only : long, pi
00003 use grid_parameter, only : ntf, npf
00004 use weight_midpoint_fluid, only : hwdpf, hwdtf, dthg
00005 use interface_calc_dx_vec
00006 use make_array_1d
00007 implicit none
00008 character(len=2), intent(in) :: cline
00009 integer, intent(in) :: ia, ib
00010 real(long), pointer :: souf(:,:)
00011 real(long), intent(out) :: line_int
00012 real(long) :: hsou
00013 integer :: ipf, itf, irf, it, jj
00014 real(long), pointer :: dxv(:)
00015
00016 call alloc_array1d(dxv, 1, 3)
00017
00018 if (cline=="ph") then
00019 irf = ia
00020 itf = ib
00021 line_int = 0.0d0
00022 do ipf = 1, npf
00023 call calc_dx_vec(cline, irf, itf, ipf, dxv)
00024 hsou = souf(ipf,1)*dxv(1) + souf(ipf,2)*dxv(2) + souf(ipf,3)*dxv(3)
00025 line_int = line_int + hsou * hwdpf(ipf)
00026 end do
00027 end if
00028
00029 if (cline=="th") then
00030 irf = ia
00031 ipf = ib
00032 line_int = 0.0d0
00033 do itf = 1, ntf
00034 call calc_dx_vec(cline, irf, itf, ipf, dxv)
00035
00036
00037 hsou = souf(itf,1)*dxv(1) + souf(itf,2)*dxv(2) + souf(itf,3)*dxv(3)
00038 line_int = line_int + hsou * dthg
00039 end do
00040
00041
00042 do it = ntf+1, 2*ntf
00043 itf = ntf - (it - ntf) + 1
00044 ipf = ib + npf/2
00045 call calc_dx_vec(cline, irf, itf, ipf, dxv)
00046 dxv(1:3) = -dxv(1:3)
00047
00048
00049 hsou = souf(it,1)*dxv(1) + souf(it,2)*dxv(2) + souf(it,3)*dxv(3)
00050 line_int = line_int + hsou * dthg
00051 end do
00052 end if
00053
00054 deallocate(dxv)
00055
00056 end subroutine line_int_fluid