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_metric, only : alph, bvxu, bvyu, bvzu
00006 use def_emfield, only : va , vaxd, vayd, vazd
00007 use def_vector_phi, only : vec_phif
00008 use integrability_fnc_MHD
00009 use interface_interpo_gr2fl_type0
00010 implicit none
00011 real(long) :: Aphi, Aphi_max, Aphi_tmp, Ay, Aphi_max_NS, At0
00012 real(long) :: x, a, b, c, r, width, point
00013 real(long) :: stepfn, stepfn_int
00014 integer :: irf, itf, ipf
00015
00016 Aphi_max = Aphi_max_surf
00017 Aphi_max_NS = Aphi_max_vol
00018
00019
00020 MHDfnc_PSI = 0.0d0 ; MHDfnc_dPSI = 0.0d0 ; MHDfnc_d2PSI= 0.0d0
00021 if ((Aphi-Aphi_max).gt.0.0d0) then
00022 MHDfnc_PSI = MHDpar_apsi*(Aphi-Aphi_max)**(MHDidx_p+1.0d0) &
00023 & /(MHDidx_p+1.0d0)
00024 MHDfnc_dPSI = MHDpar_apsi*(Aphi-Aphi_max)** MHDidx_p
00025 MHDfnc_d2PSI= MHDpar_apsi*(Aphi-Aphi_max)**(MHDidx_p-1.0d0)*MHDidx_p
00026
00027
00028 MHDfnc_Lambda_phi = 0.0d0 ; MHDfnc_dLambda_phi= 0.0d0
00029
00030
00031
00032
00033 width = 10.0d0 ; point = 0.5d0
00034 b = width/(Aphi_max_NS - Aphi_max)
00035 c = point*(Aphi_max_NS - Aphi_max)
00036 stepfn = 0.5d0*( tanh(b*(Aphi - Aphi_max - c)) + 1.0d0)
00037 stepfn_int = 0.5d0*(log(cosh(b*(Aphi - Aphi_max - c))) + Aphi)
00038
00039 MHDfnc_Lambda_phi = MHDpar_a*stepfn_int
00040 MHDfnc_dLambda_phi= MHDpar_a*stepfn
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051 end if
00052
00053
00054 MHDfnc_At = 0.0d0
00055 MHDfnc_dAt = 0.0d0
00056 MHDfnc_d2At= 0.0d0
00057
00058 MHDfnc_At = - ome*Aphi**(MHDidx_q+1.0d0)/(MHDidx_q+1.0d0) + MHDpar_charge
00059 if (MHDidx_q.eq.0.0d0) MHDfnc_dAt = - ome
00060 if (Aphi.ne.0.0d0) then
00061 MHDfnc_dAt = - ome*Aphi** MHDidx_q
00062 MHDfnc_d2At= - ome*Aphi**(MHDidx_q-1.0d0)*MHDidx_q
00063 end if
00064
00065
00066 MHDfnc_Lambda = - MHDpar_Lc*Aphi - ber
00067 MHDfnc_dLambda = - MHDpar_Lc
00068 if (MHDidx_s.eq.2.0d0) then
00069 MHDfnc_Lambda = - MHDpar_Lc*Aphi**MHDidx_s - ber
00070 MHDfnc_dLambda = - MHDpar_Lc*Aphi *MHDidx_s
00071 end if
00072
00073
00074 MHDfnc_Lambda_GS = - MHDpar_Lc*Aphi
00075 MHDfnc_dLambda_GS = - MHDpar_Lc
00076 if (MHDidx_s.eq.2.0d0) then
00077 MHDfnc_Lambda_GS = - MHDpar_Lc*Aphi**MHDidx_s
00078 MHDfnc_dLambda_GS = - MHDpar_Lc*Aphi *MHDidx_s
00079 end if
00080
00081
00082 MHDfnc_Lambda_t = 0.0d0
00083
00084 end subroutine calc_integrability_fnc_MHD