[Fortran] 纯文本查看 复制代码
program ex110
implicit none
DIMENSION U(2),UI1(3),UI2(6),UI3(6)
REAL(8) Nv, chi, lambda0, detF0,vcho,vcmo,vcpo,fa,fb,Ka,Kb,vNa
REAL(8) U ,UI1, UI2 ,UI3,aa, bb, cc ,dd, ee, deltaa, deltab,deltac
REAL(8) BI1,BI2,AJ
REAL(8) delta,vch,GAJ, DGAJDAJ, DDGAJDDAJ, DDDGAJDDDAJ
REAL(8) DGAJDvch ,DDGAJDDvch, DDDGAJDDDvch
REAL(8) DDGAJDAJDvch, DDDGAJDAJDDvch, DDDGAJDDAJDvch
REAL(8) DvchDAJ, DDvchDDAJ, DDDvchDDDAJ
REAL(8) D1GAJDAJ, D2GAJDAJ, D3GAJDAJ,TEMP
BI1=10.0
AJ=1.0
TEMP=2.0
Nv = 0.001
chi = 0.1
lambda0 = 3.39
detF0 = lambda0**3.0
vNa=0.0602
vcpo=vNa*(10.0**(-3.0))
vcho=vNa*(10.0**(-TEMP))
vcmo=vcpo+vcho
Ka=10.0**(-4.3)
Kb=10.0**(-10.0)
fa=0.05
fb=0.0
!。。。。。。中间省略部分无关代码
aa=AJ*detF0*(vcho+vcpo)
bb=fb*vcho+AJ*detF0*Ka*(vcho+vcpo)*vNa+ AJ*detF0*Kb*(vcho +
&vcpo)*vNa
cc=-(AJ*detF0*vcho**2*vcmo)-fa*Ka*vcho*vNa+fb*Ka*vcho*vNa+
&AJ*detF0*Ka*Kb*(vcho+vcpo)*vNa**2
dd=-(AJ*detF0*Ka*vcho**2*vcmo*vNa)-AJ*detF0*Kb*vcho**2*vcmo*v
&Na-fa*Ka*Kb*vcho*vNa**2
ee=AJ*detF0*Ka*Kb*vcho**2*vcmo*vNa**2
deltaa=cc**2-3*bb*dd+12*aa*ee
deltab=2*cc**3-9*bb*cc*dd+27*aa*dd**2-72*aa*cc*ee
deltac=(deltab+Sqrt(abs(-4.0*deltaa**3.0+deltab**2.0)))
&**(1.0/3.0)
delta=(2**(1/3)*deltaa)/(3*aa*deltac)+deltac/(3*2**(1/3)*aa)
!。。。。。。。。。。。以下省略部分无关代码。。。。。。。。。
现在我的问题是,deltac=(deltab+Sqrt(abs(-4.0*deltaa**3.0+deltab**2.0)))