00001 subroutine plane_surf_int_fluid(cline, ia, ib, souf, surf_int)
00002 use phys_constant, only : long, pi
00003 use grid_parameter, only : ntf, npf, nrf
00004 use coordinate_grav_r, only : drg, hrg
00005 use weight_midpoint_fluid, only : hwdpf, hwdtf, dthg
00006 use def_matter, only : rs
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) :: surf_int
00012 real(long) :: hsou, hsurf
00013 integer :: ipf, itf, irf, ir, it
00014
00015 if (cline=="ph") then
00016 itf = ib
00017 surf_int = 0.0d0
00018 do irf = 1, ia
00019 do ipf = 1, npf
00020 hsou = souf(irf,ipf)
00021 hsurf = 0.5d0*(rs(itf,ipf) + rs(itf,ipf-1))
00022 surf_int = surf_int + hsou * hsurf * (hrg(irf)*drg(irf)*hwdpf(ipf))
00023 end do
00024 end do
00025 end if
00026
00027 if (cline=="th") then
00028 surf_int = 0.0d0
00029 do irf = 1, ia
00030 ipf = ib
00031 do itf = 1, ntf
00032 hsou = souf(irf,itf)
00033 hsurf = 0.5d0*(rs(itf,ipf) + rs(itf-1,ipf))
00034 surf_int = surf_int + hsou * hsurf * (hrg(irf)*drg(irf)*dthg)
00035 end do
00036
00037 ipf = ib + npf/2
00038 do it = ntf+1, 2*ntf
00039 itf = ntf - (it - ntf) + 1
00040
00041 hsou = souf(irf,it)
00042
00043 hsurf = 0.5d0*(rs(itf,ipf) + rs(itf-1,ipf))
00044 surf_int = surf_int + hsou * hsurf * (hrg(irf)*drg(irf)*dthg)
00045 end do
00046 end do
00047 end if
00048
00049 end subroutine plane_surf_int_fluid