00001
00002 include '../Include_file/include_modulefiles_RNS_CF_peos_plot.f90'
00003 include '../Include_file/include_modulefiles_analysis_RNS_CF_peos_plot.f90'
00004 include '../Include_file/include_interface_modulefiles_RNS_CF_peos_plot.f90'
00005 include '../Include_file/include_interface_modulefiles_analysis_RNS_CF_peos_plot.f90'
00006 include '../Include_file/include_subroutines_RNS_CF_peos_plot.f90'
00007 include '../Include_file/include_subroutines_analysis_RNS_CF_peos_plot.f90'
00008 include '../Include_file/include_PEOS_modulefile.f90'
00009 include '../Include_file/include_PEOS_subroutines.f90'
00010 include '../Include_file/include_functions.f90'
00011
00012
00013
00014
00015 PROGRAM coc2cac
00016
00017 use phys_constant
00018
00019 use grid_parameter
00020 use interface_modules_cartesian
00021 use coordinate_grav_r
00022 use coordinate_grav_phi
00023 use coordinate_grav_theta
00024 use coordinate_grav_extended
00025 use trigonometry_grav_theta
00026 use trigonometry_grav_phi
00027 use interface_IO_input_CF_grav_export
00028 use interface_IO_input_CF_star_export
00029 use interface_excurve_CF_gridpoint_export
00030 use interface_interpo_gr2fl_metric_CF_export
00031 implicit none
00032 character(30) :: char1
00033 character*400 :: dir_path
00034 real(8) :: xcac, ycac, zcac
00035 real(8) :: xcoc, ycoc, zcoc
00036 real(8) :: emdca, omefca, psica, alphca, bvxdca, bvydca, bvzdca, psi4ca, psif4ca
00037 real(8) :: hca, preca, rhoca, eneca, epsca
00038 real(8) :: axxca, axyca, axzca, ayyca, ayzca, azzca
00039 real(8) :: vxu, vyu, vzu
00040 real(8) :: bxcor, bycor, bzcor, bvxdfca, bvydfca, bvzdfca, psifca, alphfca
00041 real(8) :: gxx, gxy, gxz, gyy, gyz, gzz, kxx, kxy, kxz, kyy, kyz, kzz
00042 real(8) :: ome, ber, radi
00043
00044 real(8), pointer :: emd(:,:,:), omef(:,:,:), rs(:,:)
00045 real(8), pointer :: psif(:,:,:), alphf(:,:,:), bvxdf(:,:,:), bvydf(:,:,:), bvzdf(:,:,:)
00046 real(8), pointer :: psi(:,:,:) , alph(:,:,:) , bvxd(:,:,:) , bvyd(:,:,:) , bvzd(:,:,:)
00047 real(8), pointer :: axx(:,:,:), axy(:,:,:) , axz(:,:,:) , ayy(:,:,:) , ayz(:,:,:), azz(:,:,:)
00048
00049 gxx=0.0d0; gxy=0.0d0; gxz=0.0d0; gyy=0.0d0; gyz=0.0d0; gzz=0.0d0
00050 kxx=0.0d0; kxy=0.0d0; kxz=0.0d0; kyy=0.0d0; kyz=0.0d0; kzz=0.0d0
00051 axxca=0.0d0; axyca=0.0d0; axzca=0.0d0; ayyca=0.0d0; ayzca=0.0d0; azzca=0.0d0
00052
00053
00054
00055
00056 dir_path='.'
00057
00058
00059 call read_parameter_cactus(dir_path)
00060 call peos_initialize_cactus(dir_path)
00061 call grid_r
00062 call grid_theta
00063 call trig_grav_theta
00064 call grid_phi
00065 call allocate_trig_grav_mphi
00066 call trig_grav_phi
00067 call grid_extended
00068
00069
00070
00071
00072
00073 allocate ( emd(0:nrf,0:ntf,0:npf))
00074 allocate ( omef(0:nrf,0:ntf,0:npf))
00075 allocate ( psif(0:nrf,0:ntf,0:npf))
00076 allocate (alphf(0:nrf,0:ntf,0:npf))
00077 allocate (bvxdf(0:nrf,0:ntf,0:npf))
00078 allocate (bvydf(0:nrf,0:ntf,0:npf))
00079 allocate (bvzdf(0:nrf,0:ntf,0:npf))
00080 allocate ( rs(0:ntf,0:npf))
00081 allocate ( psi(0:nrg,0:ntg,0:npg))
00082 allocate ( alph(0:nrg,0:ntg,0:npg))
00083 allocate ( bvxd(0:nrg,0:ntg,0:npg))
00084 allocate ( bvyd(0:nrg,0:ntg,0:npg))
00085 allocate ( bvzd(0:nrg,0:ntg,0:npg))
00086 allocate ( axx(0:nrg,0:ntg,0:npg))
00087 allocate ( axy(0:nrg,0:ntg,0:npg))
00088 allocate ( axz(0:nrg,0:ntg,0:npg))
00089 allocate ( ayy(0:nrg,0:ntg,0:npg))
00090 allocate ( ayz(0:nrg,0:ntg,0:npg))
00091 allocate ( azz(0:nrg,0:ntg,0:npg))
00092 emd=0.0d0; rs =0.0d0; omef=0.0d0
00093 psi=0.0d0; alph=0.0d0; bvxd=0.0d0; bvyd=0.0d0; bvzd=0.0d0
00094 axx=0.0d0; axy =0.0d0; axz =0.0d0; ayy=0.0d0; ayz=0.0d0; azz=0.0d0
00095
00096 call IO_input_CF_grav_export(trim(dir_path)//"/rnsgra_3D.las",psi,alph,bvxd,bvyd,bvzd)
00097
00098 call IO_input_CF_star_export(trim(dir_path)//"/rnsflu_3D.las",emd,rs,omef,ome,ber,radi)
00099
00100 call excurve_CF_gridpoint_export(alph,bvxd,bvyd,bvzd, &
00101 & axx, axy, axz, ayy, ayz, azz)
00102
00103 call interpo_gr2fl_metric_CF_export(alph, psi, bvxd, bvyd, bvzd, &
00104 & alphf, psif, bvxdf, bvydf, bvzdf, rs)
00105
00106
00107 write(6,'(2e20.12)') emd(0,0,0), omef(0,0,0)
00108 write(6,'(3e20.12)') ome, ber, radi
00109
00110 write(6,'(a56)', ADVANCE = "NO") "Give cartesian coordinates (x,y,z) separated by a space:"
00111 read(5,*) xcac,ycac,zcac
00112 write(6,'(a23,3e20.12)') "Point given wrt CACTUS:", xcac,ycac,zcac
00113 write(6,'(a20,1e20.12)') "Cocal radius scale :", radi
00114 xcoc = xcac/(radi)
00115 ycoc = ycac/(radi)
00116 zcoc = zcac/(radi)
00117 write(6,'(a23,3e20.12)') "Point given wrt COCAL:", xcoc,ycoc,zcoc
00118
00119
00120 call interpo_gr2cgr_4th(psi , psica , xcoc, ycoc, zcoc)
00121 call interpo_gr2cgr_4th(alph, alphca, xcoc, ycoc, zcoc)
00122 call interpo_gr2cgr_4th(bvxd, bvxdca, xcoc, ycoc, zcoc)
00123 call interpo_gr2cgr_4th(bvyd, bvydca, xcoc, ycoc, zcoc)
00124 call interpo_gr2cgr_4th(bvzd, bvzdca, xcoc, ycoc, zcoc)
00125 call interpo_gr2cgr_4th(axx , axxca , xcoc, ycoc, zcoc)
00126 call interpo_gr2cgr_4th(axy , axyca , xcoc, ycoc, zcoc)
00127 call interpo_gr2cgr_4th(axz , axzca , xcoc, ycoc, zcoc)
00128 call interpo_gr2cgr_4th(ayy , ayyca , xcoc, ycoc, zcoc)
00129 call interpo_gr2cgr_4th(ayz , ayzca , xcoc, ycoc, zcoc)
00130 call interpo_gr2cgr_4th(azz , azzca , xcoc, ycoc, zcoc)
00131
00132 call interpo_fl2cgr_4th_export(emd , emdca , xcoc, ycoc, zcoc, rs)
00133 call interpo_fl2cgr_4th_export(omef , omefca , xcoc, ycoc, zcoc, rs)
00134 call interpo_fl2cgr_4th_export(psif , psifca , xcoc, ycoc, zcoc, rs)
00135 call interpo_fl2cgr_4th_export(alphf, alphfca , xcoc, ycoc, zcoc, rs)
00136 call interpo_fl2cgr_4th_export(bvxdf, bvxdfca , xcoc, ycoc, zcoc, rs)
00137 call interpo_fl2cgr_4th_export(bvydf, bvydfca , xcoc, ycoc, zcoc, rs)
00138 call interpo_fl2cgr_4th_export(bvzdf, bvzdfca , xcoc, ycoc, zcoc, rs)
00139
00140 bxcor = bvxdfca + omefca*(-ycoc)
00141 bycor = bvydfca + omefca*(xcoc)
00142 bzcor = bvzdfca
00143 psi4ca = psica**4
00144 psif4ca = psifca**4
00145
00146 if (dabs(emdca) > 1.0d-14) then
00147 vxu = bxcor/alphfca
00148 vyu = bycor/alphfca
00149 vzu = bzcor/alphfca
00150 else
00151 emdca=0.0d0
00152 vxu=0.0d0; vyu=0.0d0; vzu=0.0d0
00153 end if
00154
00155 gxx = psi4ca
00156 gxy = 0.0d0
00157 gxz = 0.0d0
00158 gyy = psi4ca
00159 gyz = 0.0d0
00160 gzz = psi4ca
00161
00162 kxx = psi4ca*axxca/(radi)
00163 kxy = psi4ca*axyca/(radi)
00164 kxz = psi4ca*axzca/(radi)
00165 kyy = psi4ca*ayyca/(radi)
00166 kyz = psi4ca*ayzca/(radi)
00167 kzz = psi4ca*azzca/(radi)
00168
00169 call peos_q2hprho(emdca, hca, preca, rhoca, eneca)
00170
00171 epsca = eneca/rhoca - 1.0d0
00172
00173 write(6,'(a6,e20.12)') "psi =", psica
00174 write(6,'(a6,e20.12)') "alph =", alphca
00175 write(6,'(a6,e20.12)') "bvxd =", bvxdca
00176 write(6,'(a6,e20.12)') "bvyd =", bvydca
00177 write(6,'(a6,e20.12)') "bvzd =", bvzdca
00178 write(6,'(a6,e20.12)') "Radi =", radi
00179 write(6,'(a6,e20.12)') "Omeg =", ome/radi
00180 write(6,'(a6,e20.12)') "emd =", emdca
00181 write(6,'(a6,e20.12)') "h =", hca
00182 write(6,'(a6,e20.12)') "pre =", preca
00183 write(6,'(a6,e20.12)') "rho =", rhoca
00184 write(6,'(a6,e20.12)') "ene =", eneca
00185 write(6,'(a6,e20.12)') "eps =", epsca
00186
00187 write(6,'(a18)') "Kij at gridpoints:"
00188 write(6,'(3e20.12)') kxx, kxy, kxz
00189 write(6,'(3e20.12)') kxy, kyy, kyz
00190 write(6,'(3e20.12)') kxz, kyz, kzz
00191
00192 write(6,'(a13)') "v^i eulerian:"
00193 write(6,'(a6,e20.12)') "vxu =", vxu
00194 write(6,'(a6,e20.12)') "vyu =", vyu
00195 write(6,'(a6,e20.12)') "vzu =", vzu
00196
00197 write(6,'(a16)') "Deallocating...."
00198 deallocate( emd)
00199 deallocate( omef)
00200 deallocate( psif)
00201 deallocate(alphf)
00202 deallocate(bvxdf)
00203 deallocate(bvydf)
00204 deallocate(bvzdf)
00205 deallocate( rs)
00206 deallocate( psi)
00207 deallocate( alph)
00208 deallocate( bvxd)
00209 deallocate( bvyd)
00210 deallocate( bvzd)
00211 deallocate( axx)
00212 deallocate( axy)
00213 deallocate( axz)
00214 deallocate( ayy)
00215 deallocate( ayz)
00216 deallocate( azz)
00217
00218
00219 END PROGRAM coc2cac