00001 subroutine calc_ang_mom_WL_MHD
00002
00003 use phys_constant, only : long, pi
00004 use grid_parameter, only : nrg, ntg, npg, nrf, ntf, npf, ntgeq
00005 use coordinate_grav_r, only : hrg
00006 use def_matter_parameter, only : radi
00007 use def_quantities, only : angmom
00008 use make_array_3d
00009 use interface_source_ang_mom_WL
00010 use interface_source_ang_mom_EMF
00011 use interface_vol_int_grav
00012 use interface_vol_int_fluid
00013 implicit none
00014 real(long) :: volf, volg, pi8inv
00015 real(long), pointer :: soug(:,:,:), souf(:,:,:), soug_EMF(:,:,:)
00016 integer :: irg, itg, ipg
00017
00018 call alloc_array3d(soug, 0, nrg, 0, ntg, 0, npg)
00019 call alloc_array3d(soug_EMF, 0, nrg, 0, ntg, 0, npg)
00020 call alloc_array3d(souf,0, nrf,0, ntf,0, npf)
00021
00022 call source_ang_mom_WL(soug,souf)
00023 call source_ang_mom_EMF(soug_EMF)
00024
00025 pi8inv = 0.125d0/pi
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042 soug(0:nrg,0:ntg,0:npg) = soug(0:nrg,0:ntg,0:npg) &
00043 & + soug_EMF(0:nrg,0:ntg,0:npg)
00044 call vol_int_grav(soug,volg)
00045 call vol_int_fluid(souf,volf)
00046
00047 angmom = radi**4*volf + pi8inv*radi**2*volg
00048
00049
00050
00051 deallocate(soug)
00052 deallocate(soug_EMF)
00053 deallocate(souf)
00054
00055 end subroutine calc_ang_mom_WL_MHD