00001 subroutine calc_integrability_fnc_MHD(Aphi)
00002 use phys_constant, only : long
00003 use grid_parameter, only : nrf, ntf
00004 use def_matter_parameter, only : ome, ber
00005 use def_emfield, only : vayd
00006 use def_vector_phi, only : vec_phif
00007 use integrability_fnc_MHD
00008 use interface_interpo_gr2fl_type0
00009 implicit none
00010 real(long) :: Aphi, Aphi_max, Aphi_tmp, Ay
00011 real(long) :: x, a, b, c, r
00012 integer :: irf, itf, ipf
00013
00014 Aphi_max = 0.0d0
00015 irf = nrf; ipf = 0
00016 do itf = 0, ntf
00017 call interpo_gr2fl_type0(Ay,vayd,irf,itf,ipf)
00018 Aphi_tmp = Ay*vec_phif(irf,itf,ipf,2)
00019 Aphi_max = dmax1(Aphi_tmp,Aphi_max)
00020 end do
00021
00022 MHDfnc_PSI = 0.0d0 ; MHDfnc_dPSI = 0.0d0 ; MHDfnc_d2PSI= 0.0d0
00023 MHDfnc_Lambda_phi = 0.0d0 ; MHDfnc_dLambda_phi= 0.0d0
00024 if ((Aphi-Aphi_max).gt.0.0d0) then
00025 MHDfnc_PSI = MHDpar_apsi*(Aphi-Aphi_max)**(MHDidx_p+1.0d0) &
00026 & /(MHDidx_p+1.0d0)
00027 MHDfnc_dPSI = MHDpar_apsi*(Aphi-Aphi_max)** MHDidx_p
00028 MHDfnc_d2PSI= MHDpar_apsi*(Aphi-Aphi_max)**(MHDidx_p-1.0d0)*MHDidx_p
00029
00030 MHDfnc_Lambda_phi = MHDpar_a*(Aphi-Aphi_max)**(MHDidx_k+1.0d0) &
00031 & /(MHDidx_k+1.0d0)
00032 MHDfnc_dLambda_phi= MHDpar_a*(Aphi-Aphi_max)** MHDidx_k
00033
00034
00035
00036
00037
00038
00039
00040
00041 end if
00042
00043 MHDfnc_At = 0.0d0
00044 MHDfnc_dAt = 0.0d0
00045 MHDfnc_d2At= 0.0d0
00046 if (MHDidx_q.eq.0.0d0) MHDfnc_dAt = - ome
00047 if (Aphi.ne.0.0d0) then
00048 MHDfnc_At = - ome*Aphi**(MHDidx_q+1.0d0)/(MHDidx_q+1.0d0) + MHDpar_charge
00049 MHDfnc_dAt = - ome*Aphi** MHDidx_q
00050 MHDfnc_d2At= - ome*Aphi**(MHDidx_q-1.0d0)*MHDidx_q
00051 end if
00052
00053 MHDfnc_Lambda = - MHDpar_Lc*Aphi - ber
00054 MHDfnc_dLambda = - MHDpar_Lc
00055 if (MHDidx_s.eq.2.0d0) then
00056 MHDfnc_Lambda = - MHDpar_Lc*Aphi**MHDidx_s - ber
00057 MHDfnc_dLambda = - MHDpar_Lc*Aphi *MHDidx_s
00058 end if
00059
00060 MHDfnc_Lambda_t = 0.0d0
00061
00062 end subroutine calc_integrability_fnc_MHD