00001 subroutine calc_h_udf_axisym
00002 use phys_constant, only : long
00003 use grid_parameter
00004 use coordinate_grav_r, only : rg
00005 use trigonometry_grav_phi, only : sinphig, cosphig
00006 use def_matter, only : rs, emd, hhf, utf , uxf , uyf , uzf, &
00007 & utdf, uxdf, uydf, uzdf
00008 use def_matter_parameter, only : ome, ber
00009 use def_metric, only : alph, psi, bvxd, bvyd, bvzd, bvxu, bvyu, bvzu
00010 use def_metric_hij, only : hxxd, hxyd, hxzd, hyyd, hyzd, hzzd
00011 use def_emfield, only : vayd
00012 use def_vector_phi, only : vec_phif
00013 use trigonometry_grav_phi, only : sinphig, cosphig
00014 use integrability_fnc_MHD
00015 use make_array_3d
00016 use interface_interpo_gr2fl
00017 use interface_flgrad_4th_gridpoint
00018 implicit none
00019 real(long), pointer :: alphf(:,:,:), psif(:,:,:)
00020 real(long), pointer :: bvxdf(:,:,:), bvydf(:,:,:), bvzdf(:,:,:)
00021 real(long), pointer :: bvxuf(:,:,:), bvyuf(:,:,:), bvzuf(:,:,:)
00022 real(long), pointer :: hxxdf(:,:,:), hxydf(:,:,:), hxzdf(:,:,:),
00023 hyydf(:,:,:), hyzdf(:,:,:), hzzdf(:,:,:)
00024 real(long) :: hh, utd, ut, ux, uy, uz, vx, vy, vz, pre, rho, ene, qq
00025 real(long) :: bvdfc(3), ovufc(3), ovdfc(3)
00026 real(long) :: gmxxdf, gmxydf, gmxzdf, gmyxdf, gmyydf, gmyzdf,
00027 gmzxdf, gmzydf, gmzzdf, ovovf, alphff, psiff
00028 integer :: irf, itf, ipf
00029
00030 call alloc_array3d(psif, 0, nrf, 0, ntf, 0, npf)
00031 call alloc_array3d(alphf, 0, nrf, 0, ntf, 0, npf)
00032 call alloc_array3d(bvxdf, 0, nrf, 0, ntf, 0, npf)
00033 call alloc_array3d(bvydf, 0, nrf, 0, ntf, 0, npf)
00034 call alloc_array3d(bvzdf, 0, nrf, 0, ntf, 0, npf)
00035 call alloc_array3d(bvxuf, 0, nrf, 0, ntf, 0, npf)
00036 call alloc_array3d(bvyuf, 0, nrf, 0, ntf, 0, npf)
00037 call alloc_array3d(bvzuf, 0, nrf, 0, ntf, 0, npf)
00038 call alloc_array3d(hxxdf, 0, nrf, 0, ntf, 0, npf)
00039 call alloc_array3d(hxydf, 0, nrf, 0, ntf, 0, npf)
00040 call alloc_array3d(hxzdf, 0, nrf, 0, ntf, 0, npf)
00041 call alloc_array3d(hyydf, 0, nrf, 0, ntf, 0, npf)
00042 call alloc_array3d(hyzdf, 0, nrf, 0, ntf, 0, npf)
00043 call alloc_array3d(hzzdf, 0, nrf, 0, ntf, 0, npf)
00044
00045 call interpo_gr2fl(alph, alphf)
00046 call interpo_gr2fl(psi, psif)
00047 call interpo_gr2fl(bvxd, bvxdf)
00048 call interpo_gr2fl(bvyd, bvydf)
00049 call interpo_gr2fl(bvzd, bvzdf)
00050 call interpo_gr2fl(bvxu, bvxuf)
00051 call interpo_gr2fl(bvyu, bvyuf)
00052 call interpo_gr2fl(bvzu, bvzuf)
00053 call interpo_gr2fl(hxxd, hxxdf)
00054 call interpo_gr2fl(hxyd, hxydf)
00055 call interpo_gr2fl(hxzd, hxzdf)
00056 call interpo_gr2fl(hyyd, hyydf)
00057 call interpo_gr2fl(hyzd, hyzdf)
00058 call interpo_gr2fl(hzzd, hzzdf)
00059
00060 ipf = 0
00061 do itf = 0, ntf
00062 do irf = 0, nrf
00063
00064 psiff = psif(irf,itf,ipf)
00065 alphff = alphf(irf,itf,ipf)
00066 gmxxdf = 1.0d0 + hxxdf(irf,itf,ipf)
00067 gmxydf = hxydf(irf,itf,ipf)
00068 gmxzdf = hxzdf(irf,itf,ipf)
00069 gmyydf = 1.0d0 + hyydf(irf,itf,ipf)
00070 gmyzdf = hyzdf(irf,itf,ipf)
00071 gmzzdf = 1.0d0 + hzzdf(irf,itf,ipf)
00072 gmyxdf = gmxydf
00073 gmzxdf = gmxzdf
00074 gmzydf = gmyzdf
00075
00076 ut = utf(irf,itf,ipf)
00077 ux = uxf(irf,itf,ipf)
00078 uy = uyf(irf,itf,ipf)
00079 uz = uzf(irf,itf,ipf)
00080 vx = ux/ut
00081 vy = uy/ut
00082 vz = uz/ut
00083 bvdfc(1) = bvxdf(irf,itf,ipf)
00084 bvdfc(2) = bvydf(irf,itf,ipf)
00085 bvdfc(3) = bvzdf(irf,itf,ipf)
00086 ovufc(1) = bvxuf(irf,itf,ipf) + vx
00087 ovufc(2) = bvyuf(irf,itf,ipf) + vy
00088 ovufc(3) = bvzuf(irf,itf,ipf) + vz
00089 ovdfc(1) = bvxdf(irf,itf,ipf) + gmxxdf*vx + gmxydf*vy + gmxzdf*vz
00090 ovdfc(2) = bvydf(irf,itf,ipf) + gmyxdf*vx + gmyydf*vy + gmyzdf*vz
00091 ovdfc(3) = bvzdf(irf,itf,ipf) + gmzxdf*vx + gmzydf*vy + gmzzdf*vz
00092
00093 utd = ut*(-alphff**2 + psiff**4*(bvdfc(1)*ovufc(1) &
00094 & + bvdfc(2)*ovufc(2) + bvdfc(3)*ovufc(3)))
00095
00096 qq = emd(irf,itf,ipf)
00097 call peos_q2hprho(qq, hh, pre, rho, ene)
00098 hhf( irf,itf,ipf) = hh
00099 utdf(irf,itf,ipf) = utd
00100 uxdf(irf,itf,ipf) = ut*psiff**4*ovdfc(1)
00101 uydf(irf,itf,ipf) = ut*psiff**4*ovdfc(2)
00102 uzdf(irf,itf,ipf) = ut*psiff**4*ovdfc(3)
00103
00104 end do
00105 end do
00106
00107
00108
00109 do ipf = 1, npf
00110 do itf = 0, ntf
00111 do irf = 0, nrf
00112 hhf(irf,itf,ipf) = hhf(irf,itf,0)
00113 utdf(irf,itf,ipf) = utdf(irf,itf,0)
00114 uxdf(irf,itf,ipf) = cosphig(ipf)*uxdf(irf,itf,0) &
00115 & - sinphig(ipf)*uydf(irf,itf,0)
00116 uydf(irf,itf,ipf) = sinphig(ipf)*uxdf(irf,itf,0) &
00117 & + cosphig(ipf)*uydf(irf,itf,0)
00118 uzdf(irf,itf,ipf) = uzdf(irf,itf,0)
00119 end do
00120 end do
00121 end do
00122
00123 deallocate(psif)
00124 deallocate(alphf)
00125 deallocate(bvxdf)
00126 deallocate(bvydf)
00127 deallocate(bvzdf)
00128 deallocate(bvxuf)
00129 deallocate(bvyuf)
00130 deallocate(bvzuf)
00131 deallocate(hxxdf)
00132 deallocate(hxydf)
00133 deallocate(hxzdf)
00134 deallocate(hyydf)
00135 deallocate(hyzdf)
00136 deallocate(hzzdf)
00137
00138 end subroutine calc_h_udf_axisym