00001 subroutine adjust_omega_BBH_bisection(flag_omega,error_ome)
00002 use grid_parameter, only : mass_eps, eps
00003 use def_quantities, only : admmass_asymp, komarmass_asymp
00004 use def_bh_parameter, only : ome_bh, spin_bh
00005 implicit none
00006 integer :: flag_omega
00007 integer, save :: count_adj, ii
00008 real(8), save :: fnc_val, fnc_val_bak, dfdval,
00009 ome_bh_bak, delta_ome_bh, fac0
00010 real(8), save :: facp(5) = (/ 1.0d-1, 2.0d-1, 4.0d-1, 7.0d-1, 1.0d-0 /)
00011 real(8) :: error_ome
00012
00013
00014
00015
00016
00017 if (flag_omega.eq.99) then
00018 if (admmass_asymp.le.komarmass_asymp) delta_ome_bh = -0.1d0*ome_bh
00019 if (admmass_asymp.ge.komarmass_asymp) delta_ome_bh = 0.1d0*ome_bh
00020 ome_bh = ome_bh + delta_ome_bh
00021 fnc_val = (admmass_asymp - komarmass_asymp)/admmass_asymp
00022 flag_omega = nint(delta_ome_bh/dabs(delta_ome_bh))
00023 count_adj = 0
00024 return
00025 end if
00026
00027 if (flag_omega.ne.99.and.flag_omega.ne.0) then
00028 if (flag_omega.eq.+1.and.admmass_asymp.le.komarmass_asymp) &
00029 & delta_ome_bh = -0.5d0*dabs(delta_ome_bh)
00030 if (flag_omega.eq.-1.and.admmass_asymp.ge.komarmass_asymp) &
00031 & delta_ome_bh = 0.5d0*dabs(delta_ome_bh)
00032 end if
00033
00034 fnc_val_bak = fnc_val
00035 fnc_val = (admmass_asymp - komarmass_asymp)/admmass_asymp
00036 flag_omega = nint(delta_ome_bh/dabs(delta_ome_bh))
00037
00038 count_adj = count_adj + 1
00039 ome_bh_bak = ome_bh
00040 ome_bh = ome_bh + delta_ome_bh
00041 error_ome = dabs(delta_ome_bh/ome_bh)
00042
00043 if (error_ome.le.eps) flag_omega = 0
00044
00045 write(6,'(1a24,2(7x,i5))') ' -- ome iteration # -- ',count_adj
00046 write(6,'(1a24,1p,2e12.4)')' -- ome OLD -> NEW -- ',ome_bh_bak, ome_bh
00047 write(6,*)'-- ADM and Komar --', admmass_asymp, komarmass_asymp
00048 write(6,*)'-- 1 - MK/MADM --', fnc_val_bak, fnc_val
00049
00050
00051
00052
00053
00054
00055
00056
00057
00058
00059 return
00060 end subroutine adjust_omega_BBH_bisection