00001 subroutine iteration_only_grav(iter_count)_peos
00002   use phys_constant, only :  long
00003   use grid_parameter
00004   use coordinate_grav_r
00005   use coordinate_grav_phi
00006   use coordinate_grav_theta
00007   use weight_midpoint_grav
00008   use make_array_2d
00009   use make_array_3d
00010   use make_array_4d
00011   use def_metric
00012   use def_matter
00013   use interface_interpo_fl2gr
00014   use interface_poisson_solver
00015   use interface_sourceterm_HaC_peos
00016   use interface_sourceterm_trG_peos
00017   use interface_sourceterm_MoC_peos
00018   use interface_compute_shift
00019   use interface_compute_alps2alph
00020   use interface_update_grfield
00021   use interface_update_parameter_peos
00022   implicit none
00023   real(long), pointer :: sou(:,:,:), pot(:,:,:),sou2(:,:,:)
00024   real(long), pointer :: potf(:,:,:), emd_bak(:,:,:)
00025   real(long), pointer :: potrs(:,:)
00026   real(long), pointer :: potx(:,:,:), poty(:,:,:), potz(:,:,:)
00027   real(long), pointer :: souvec(:,:,:,:)
00028   real(long) :: error_emd, count
00029   integer    :: iter_count, flag = 0
00030   integer    :: irf, itf, ipf, irg, itg, ipg, ihy
00031 
00032   call alloc_array3d(sou,0,nrg,0,ntg,0,npg)
00033   call alloc_array3d(sou2,0,nrg,0,ntg,0,npg)
00034   call alloc_array3d(potx,0,nrg,0,ntg,0,npg)
00035   call alloc_array3d(poty,0,nrg,0,ntg,0,npg)
00036   call alloc_array3d(potz,0,nrg,0,ntg,0,npg)
00037   call alloc_array3d(pot,0,nrg,0,ntg,0,npg)
00038   call alloc_array3d(potf,0,nrf,0,ntf,0,npf)
00039   call alloc_array3d(emd_bak,0,nrf,0,ntf,0,npf)
00040   call alloc_array2d(potrs,0,ntf,0,npf)
00041   call alloc_array4d(souvec,0,nrg,0,ntg,0,npg,1,3)
00042 
00043   iter_count = 0
00044   do
00045     iter_count = iter_count + 1      
00046     count = dble(iter_count) 
00047     conv_gra = dmin1(conv0_gra,conv_ini*count)
00048     conv_den = dmin1(conv0_den,conv_ini*count)
00049 
00050     emdg = 0.0d0
00051     call interpo_fl2gr(emd, emdg)
00052     call calc_vector_x_grav(1)
00053     call calc_vector_x_matter(1)
00054     call calc_vector_phi_grav(1)
00055     call calc_vector_phi_matter(1)
00056     call excurve
00057 
00058     call sourceterm_HaC_peos(sou)
00059     call poisson_solver(sou,pot)
00060     pot = pot + 1.0d0
00061     call update_grfield(pot,psi,conv_gra)
00062     call update_parameter_peos(conv_den)
00063 
00064     call sourceterm_trG_peos(sou)
00065     call poisson_solver(sou,pot)
00066     pot = pot + 1.0d0
00067     call compute_alps2alph(pot,psi)
00068     call update_grfield(pot,alph,conv_gra)
00069     call update_parameter_peos(conv_den)
00070 
00071     call sourceterm_MoC_peos(souvec,sou)
00072     sou2(1:nrg, 1:ntg, 1:npg) = souvec(1:nrg, 1:ntg, 1:npg, 1)
00073     call poisson_solver(sou2,potx)
00074     sou2(1:nrg, 1:ntg, 1:npg) = souvec(1:nrg, 1:ntg, 1:npg, 2)
00075     call poisson_solver(sou2,poty)
00076     sou2(1:nrg, 1:ntg, 1:npg) = souvec(1:nrg, 1:ntg, 1:npg, 3)
00077     call poisson_solver(sou2,potz)
00078     call poisson_solver(sou,pot)
00079     souvec(0:nrg, 0:ntg, 0:npg, 1) = potx(0:nrg, 0:ntg, 0:npg)
00080     souvec(0:nrg, 0:ntg, 0:npg, 2) = poty(0:nrg, 0:ntg, 0:npg)
00081     souvec(0:nrg, 0:ntg, 0:npg, 3) = potz(0:nrg, 0:ntg, 0:npg)
00082     call compute_shift(potx, poty, potz, souvec, pot)
00083     call update_grfield(potx,bvxd,conv_gra)
00084     call update_grfield(poty,bvyd,conv_gra)
00085     call update_grfield(potz,bvzd,conv_gra)
00086     call update_parameter_peos(conv_den)
00087 
00088 
00089 
00090 
00091 
00092 
00093 
00094 
00095 
00096 
00097 
00098 
00099 
00100 
00101 
00102 
00103 
00104 
00105     if (flag == 0) exit
00106     if (iter_count >= iter_max) exit
00107     flag = 0
00108 
00109   end do
00110   deallocate(sou)
00111   deallocate(sou2)
00112   deallocate(potx)
00113   deallocate(poty)
00114   deallocate(potz)
00115   deallocate(pot)
00116   deallocate(potf)
00117   deallocate(emd_bak)
00118   deallocate(potrs)
00119   deallocate(souvec)
00120 end subroutine iteration_only_grav_peos