Commit 58b876bd authored by Matthias Steffen's avatar Matthias Steffen
Browse files

missing IDL routines added

parent a4275b60
pro ff1, t, glog, z, ALi, qiso, ff1_out
;
; Coefficients based on re-computed 1D NLTE corrections by mst
; Cijk mm00 mm05 mm10 mm20 mm30
ff1_c1d_000=[ 0.1791557D0, 0.1050792D0, 0.0990588D0, 0.0328342D0, 0.0124536D0]
ff1_c1d_100=[-0.0073790D0, -0.0084633D0, -0.0070312D0, -0.0032602D0, -0.0587628D0]
ff1_c1d_001=[-0.1406743D0, -0.1530184D0, -0.2250787D0, -0.1734033D0, -0.0807081D0]
ff1_c1d_101=[ 0.0561255D0, 0.0583358D0, 0.1517873D0, 0.0513971D0, 0.2173629D0]
ff1_c1d_002=[ 0.1231245D0, 0.2275670D0, 0.4254515D0, 0.3390962D0, 0.1571438D0]
ff1_c1d_102=[-0.1741239D0, -0.1280650D0, -0.4558604D0, -0.1418215D0, -0.2973344D0]
ff1_c1d_003=[-0.1497231D0, -0.1886872D0, -0.3898447D0, -0.2990925D0, -0.1397715D0]
ff1_c1d_103=[ 0.1935423D0, 0.0873244D0, 0.4176210D0, 0.1312618D0, 0.1654042D0]
ff1_c1d_004=[ 0.0536468D0, 0.0499225D0, 0.1203871D0, 0.0905645D0, 0.0401296D0]
ff1_c1d_104=[-0.0675082D0, -0.0183153D0, -0.1236082D0, -0.0432368D0, -0.0335796D0]
ff1_c1d_010=[-0.0111539D0, -0.0073209D0, -0.0051128D0, -0.0041143D0, -0.0080132D0]
ff1_c1d_110=[ 0.0046478D0, 0.0038263D0, 0.0008493D0, 0.0058993D0, 0.0047513D0]
ff1_c1d_011=[-0.0042783D0, 0.0023326D0, 0.0007908D0, -0.0005678D0, -0.0023488D0]
ff1_c1d_111=[-0.0146549D0, -0.0232104D0, -0.0205851D0, -0.0043562D0, 0.0108387D0]
ff1_c1d_012=[-0.0085580D0, -0.0180569D0, -0.0272235D0, -0.0223643D0, 0.0063592D0]
ff1_c1d_112=[ 0.0069384D0, 0.0264662D0, 0.0329991D0, 0.0043666D0, 0.0036971D0]
ff1_c1d_013=[ 0.0196931D0, 0.0185953D0, 0.0255633D0, 0.0231517D0, 0.0073388D0]
ff1_c1d_113=[ 0.0002411D0, -0.0085541D0, -0.0130252D0, -0.0057535D0, -0.0107872D0]
ff1_c1d_020=[ 0.0216719D0, 0.0188139D0, 0.0160754D0, 0.0149103D0, 0.0149583D0]
ff1_c1d_120=[-0.0036719D0, -0.0032942D0, -0.0003223D0, -0.0091198D0, -0.0155050D0]
ff1_c1d_021=[-0.0064836D0, -0.0034779D0, 0.0022292D0, 0.0004144D0, -0.0149522D0]
ff1_c1d_121=[ 0.0096988D0, 0.0076570D0, 0.0005769D0, 0.0071321D0, -0.0049674D0]
ff1_c1d_022=[-0.0249244D0, -0.0211086D0, -0.0245816D0, -0.0255060D0, -0.0194343D0]
ff1_c1d_122=[-0.0038088D0, -0.0031284D0, -0.0005112D0, 0.0051264D0, 0.0128407D0]
ff1_c1d_030=[-0.0052306D0, -0.0068116D0, -0.0056458D0, -0.0046855D0, -0.0006729D0]
ff1_c1d_130=[ 0.0006315D0, 0.0013540D0, 0.0010385D0, 0.0028883D0, 0.0091173D0]
ff1_c1d_031=[ 0.0188565D0, 0.0183322D0, 0.0181051D0, 0.0205227D0, 0.0213070D0]
ff1_c1d_131=[-0.0010174D0, -0.0012430D0, -0.0004732D0, -0.0056278D0, -0.0069360D0]
ff1_c1d_040=[-0.0040438D0, -0.0040839D0, -0.0043396D0, -0.0054409D0, -0.0063454D0]
ff1_c1d_140=[-0.0000474D0, -0.0001415D0, -0.0001646D0, 0.0006245D0, -0.0001072D0]
;
; Coefficients based on original 3D NLTE corrections by A. Mott
; Cijk mm00 mm05 mm10 mm20 mm30
ff1_c3d_000=[ 0.1934700D0, 0.1137574D0, 0.1059171D0, 0.0110396D0, 0.0302943D0]
ff1_c3d_100=[-0.0239075D0, -0.0257894D0, -0.0307899D0, -0.0160289D0, -0.0730075D0]
ff1_c3d_001=[-0.1479080D0, -0.1209572D0, -0.1251443D0, 0.0061589D0, -0.0496778D0]
ff1_c3d_101=[ 0.1187087D0, -0.0034667D0, 0.1605346D0, -0.2109836D0, 0.1059637D0]
ff1_c3d_002=[ 0.1429609D0, 0.2182036D0, 0.1630807D0, 0.1021026D0, 0.1900663D0]
ff1_c3d_102=[-0.3658550D0, 0.0199786D0, -0.4815992D0, 0.3694110D0, 0.0988528D0]
ff1_c3d_003=[-0.1536380D0, -0.2343304D0, -0.1063167D0, -0.1538708D0, -0.2032447D0]
ff1_c3d_103=[ 0.3933365D0, 0.0043123D0, 0.4460331D0, -0.1835116D0, -0.2011892D0]
ff1_c3d_004=[ 0.0504229D0, 0.0804113D0, 0.0225933D0, 0.0569504D0, 0.0615852D0]
ff1_c3d_104=[-0.1317260D0, -0.0116685D0, -0.1317514D0, 0.0189035D0, 0.0706434D0]
ff1_c3d_010=[-0.0112007D0, -0.0095449D0, -0.0071110D0, -0.0101823D0, -0.0140992D0]
ff1_c3d_110=[ 0.0014934D0, 0.0041522D0, -0.0008530D0, 0.0101311D0, 0.0110694D0]
ff1_c3d_011=[-0.0157936D0, -0.0057599D0, -0.0049469D0, 0.0077487D0, 0.0031318D0]
ff1_c3d_111=[-0.0035633D0, -0.0132778D0, -0.0108938D0, -0.0188577D0, 0.0021892D0]
ff1_c3d_012=[-0.0029972D0, -0.0097395D0, -0.0218368D0, -0.0330288D0, -0.0016796D0]
ff1_c3d_112=[ 0.0015286D0, 0.0149844D0, 0.0249090D0, 0.0265209D0, 0.0200220D0]
ff1_c3d_013=[ 0.0226405D0, 0.0190282D0, 0.0262789D0, 0.0303408D0, 0.0146414D0]
ff1_c3d_113=[-0.0007266D0, -0.0054095D0, -0.0108755D0, -0.0155570D0, -0.0209639D0]
ff1_c3d_020=[ 0.0228360D0, 0.0220577D0, 0.0198897D0, 0.0230061D0, 0.0223846D0]
ff1_c3d_120=[ 0.0001464D0, -0.0048820D0, -0.0002827D0, -0.0148570D0, -0.0242930D0]
ff1_c3d_021=[-0.0015479D0, -0.0023546D0, 0.0026504D0, -0.0048869D0, -0.0188727D0]
ff1_c3d_121=[ 0.0028341D0, 0.0042002D0, -0.0048818D0, 0.0090188D0, -0.0036151D0]
ff1_c3d_022=[-0.0304533D0, -0.0255947D0, -0.0278502D0, -0.0282937D0, -0.0237323D0]
ff1_c3d_122=[-0.0001805D0, -0.0008105D0, 0.0014137D0, 0.0056108D0, 0.0164049D0]
ff1_c3d_030=[-0.0047771D0, -0.0070773D0, -0.0069892D0, -0.0073567D0, -0.0025587D0]
ff1_c3d_130=[-0.0015685D0, 0.0022109D0, 0.0023593D0, 0.0061664D0, 0.0125796D0]
ff1_c3d_031=[ 0.0190796D0, 0.0192168D0, 0.0190010D0, 0.0229878D0, 0.0236960D0]
ff1_c3d_131=[-0.0001362D0, -0.0008104D0, 0.0003031D0, -0.0062793D0, -0.0082827D0]
ff1_c3d_040=[-0.0040627D0, -0.0040545D0, -0.0040723D0, -0.0051027D0, -0.0060987D0]
ff1_c3d_140=[ 0.0002129D0, -0.0004152D0, -0.0006280D0, -0.0000427D0, -0.0006542D0]
;
;
z_grid = [0.0D0, -0.5D0, -1.0D0, -2.0D0, -3.0D0]
;
; --- check input parameters
if (t lt 4900.0 or t gt 6600.0) then begin
print, '% FF123: Teff out of range: ' + string(t,format='(F8.2)') + ' K'
print, '% FF123: must be in the range 5000 .. 6500 K'
ff1_out = [-99.9,-99.9]
return
endif
if (glog lt 3.4 or glog gt 4.6) then begin
print, '% FF123: log g out of range: ' + string(glog,format='(F5.2)')
print, '% FF123: must be in the range 3.5 .. 4.5'
ff1_out = [-99.9,-99.9]
return
endif
if (z lt -3.2 or z gt 0.2) then begin
print, '% FF123: [Fe/H] out of range: ' + string(z,format='(F5.2)')
print, '% FF123: must be in the range -3.0 .. 0.0'
ff1_out = [-99.9,-99.9]
return
endif
if (ALi lt 0.9 or ALi gt 3.1) then begin
print, '% FF123: A(Li) out of range: ' + string(Ali,format='(F5.2)')
print, '% FF123: must be in the range 1.0 .. 3.0'
ff1_out = [-99.9,-99.9]
return
endif
if (qiso lt 0.0 or qiso gt 0.1) then begin
print, '% FF123: 6Li/7Li out of range: ' + string(qiso,format='(F5.2)')
print, '% FF123: must be in the range 0.0 .. 0.082'
ff1_out = [-99.9,-99.9]
return
endif
;normalization of the T and log g
;
a = (t-5000.0D0)/1000.0D0
b = glog-3.5D0
; correction for isotopic ratio
d1= 0.035D0*(1.0D0-qiso/0.082D0)
c = ALi + d1
;
ff1_1d=(ff1_c1d_000 + ff1_c1d_100*b) + $
(ff1_c1d_001 + ff1_c1d_101*b)*a + $
(ff1_c1d_002 + ff1_c1d_102*b)*a*a + $
(ff1_c1d_003 + ff1_c1d_103*b)*a*a*a + $
(ff1_c1d_004 + ff1_c1d_104*b)*a*a*a*a + $
(ff1_c1d_010 + ff1_c1d_110*b)*c + $
(ff1_c1d_011 + ff1_c1d_111*b)*c*a + $
(ff1_c1d_012 + ff1_c1d_112*b)*c*a*a + $
(ff1_c1d_013 + ff1_c1d_113*b)*c*a*a*a + $
(ff1_c1d_020 + ff1_c1d_120*b)*c*c + $
(ff1_c1d_021 + ff1_c1d_121*b)*c*c*a + $
(ff1_c1d_022 + ff1_c1d_122*b)*c*c*a*a + $
(ff1_c1d_030 + ff1_c1d_130*b)*c*c*c + $
(ff1_c1d_031 + ff1_c1d_131*b)*c*c*c*a + $
(ff1_c1d_040 + ff1_c1d_140*b)*c*c*c*c
;
ff1_3d=(ff1_c3d_000 + ff1_c3d_100*b) + $
(ff1_c3d_001 + ff1_c3d_101*b)*a + $
(ff1_c3d_002 + ff1_c3d_102*b)*a*a + $
(ff1_c3d_003 + ff1_c3d_103*b)*a*a*a + $
(ff1_c3d_004 + ff1_c3d_104*b)*a*a*a*a + $
(ff1_c3d_010 + ff1_c3d_110*b)*c + $
(ff1_c3d_011 + ff1_c3d_111*b)*c*a + $
(ff1_c3d_012 + ff1_c3d_112*b)*c*a*a + $
(ff1_c3d_013 + ff1_c3d_113*b)*c*a*a*a + $
(ff1_c3d_020 + ff1_c3d_120*b)*c*c + $
(ff1_c3d_021 + ff1_c3d_121*b)*c*c*a + $
(ff1_c3d_022 + ff1_c3d_122*b)*c*c*a*a + $
(ff1_c3d_030 + ff1_c3d_130*b)*c*c*c + $
(ff1_c3d_031 + ff1_c3d_131*b)*c*c*c*a + $
(ff1_c3d_040 + ff1_c3d_140*b)*c*c*c*c
;
;
; --- interpolation to required z ---
ff1_1dz = mcubic(ff1_1d,z_grid,z)
ff1_3dz = mcubic(ff1_3d,z_grid,z)
;
ff1_out = [ff1_1dz,ff1_3dz]
;
end
pro ff2, t, glog, z, ALi, qiso, ff2_out
;
; Coefficients based on original 1D NLTE equivalent widths by A. Mott
; Cijk mm00 mm05 mm10 mm20 mm30
ff2_c1d_000=[ 0.1668157D0, 0.2358674D0, 0.2338765D0, 0.2696325D0, 0.2404062D0]
ff2_c1d_100=[ 0.0149293D0, 0.0173628D0, 0.0081412D0, 0.0048003D0, -0.0302344D0]
ff2_c1d_001=[-1.0165459D0, -1.1335444D0, -1.0981356D0, -1.1334040D0, -0.9817465D0]
ff2_c1d_101=[-0.0210521D0, 0.1219691D0, 0.2055447D0, 0.0515904D0, 0.0651075D0]
ff2_c1d_002=[ 0.1444629D0, 0.6690733D0, 0.3493729D0, 0.5578882D0, 0.4516058D0]
ff2_c1d_102=[ 0.1364904D0, -0.2768881D0, -0.3623220D0, -0.0860166D0, 0.0226130D0]
ff2_c1d_003=[ 0.1038219D0, -0.4558280D0, 0.0130863D0, -0.2255391D0, -0.2897598D0]
ff2_c1d_103=[-0.1815287D0, 0.2097250D0, 0.1752576D0, 0.0647830D0, -0.0531376D0]
ff2_c1d_004=[-0.0652711D0, 0.1265842D0, -0.0550262D0, 0.0308042D0, 0.0826828D0]
ff2_c1d_104=[ 0.0725737D0, -0.0500634D0, -0.0108072D0, -0.0134427D0, 0.0153335D0]
ff2_c1d_010=[ 1.0132868D0, 1.0417293D0, 1.0374104D0, 1.0327493D0, 1.0081008D0]
ff2_c1d_110=[-0.0064728D0, -0.0379439D0, -0.0345743D0, -0.0132608D0, -0.0198091D0]
ff2_c1d_011=[-0.0207368D0, -0.0674934D0, -0.0327851D0, -0.0506050D0, -0.0586258D0]
ff2_c1d_111=[-0.0421332D0, -0.0226979D0, -0.0642451D0, -0.0323514D0, -0.0026935D0]
ff2_c1d_012=[-0.1076595D0, -0.1195333D0, -0.1635718D0, -0.1613043D0, -0.0994343D0]
ff2_c1d_112=[ 0.0420931D0, 0.0555183D0, 0.1068789D0, 0.0442803D0, 0.0442668D0]
ff2_c1d_013=[ 0.0443194D0, 0.0354617D0, 0.0530645D0, 0.0442895D0, 0.0199720D0]
ff2_c1d_113=[-0.0087720D0, -0.0160399D0, -0.0309735D0, -0.0087144D0, -0.0101419D0]
ff2_c1d_020=[ 0.0064495D0, -0.0006828D0, -0.0036903D0, 0.0062150D0, 0.0227895D0]
ff2_c1d_120=[ 0.0083023D0, 0.0282699D0, 0.0317697D0, 0.0112594D0, 0.0099326D0]
ff2_c1d_021=[ 0.0627791D0, 0.0999068D0, 0.0990063D0, 0.1104659D0, 0.0848678D0]
ff2_c1d_121=[ 0.0091549D0, -0.0062510D0, -0.0082175D0, -0.0011886D0, -0.0238849D0]
ff2_c1d_022=[-0.0242035D0, -0.0155056D0, -0.0155906D0, -0.0093547D0, -0.0059664D0]
ff2_c1d_122=[-0.0067343D0, -0.0054689D0, -0.0079125D0, -0.0053423D0, -0.0008217D0]
ff2_c1d_030=[-0.0166254D0, -0.0235642D0, -0.0215853D0, -0.0282541D0, -0.0286804D0]
ff2_c1d_130=[-0.0027657D0, -0.0069611D0, -0.0073040D0, -0.0009272D0, 0.0041802D0]
ff2_c1d_031=[ 0.0127171D0, 0.0048428D0, 0.0042163D0, 0.0004064D0, 0.0033798D0]
ff2_c1d_131=[-0.0003911D0, 0.0015833D0, 0.0030302D0, 0.0002764D0, 0.0023297D0]
ff2_c1d_040=[-0.0036484D0, -0.0021369D0, -0.0023126D0, -0.0012000D0, -0.0016354D0]
ff2_c1d_140=[ 0.0002877D0, 0.0005860D0, 0.0004177D0, 0.0000390D0, -0.0008902D0]
;
; Coefficients based on original 3D NLTE equivalent widths by A. Mott
; Cijk mm00 mm05 mm10 mm20 mm30
ff2_c3d_000=[ 0.1475069D0, 0.2245458D0, 0.2239167D0, 0.2849084D0, 0.2068955D0]
ff2_c3d_100=[ 0.0347089D0, 0.0339855D0, 0.0306456D0, 0.0223937D0, 0.0133552D0]
ff2_c3d_001=[-1.0208849D0, -1.1469250D0, -1.2259755D0, -1.3272777D0, -0.9932886D0]
ff2_c3d_101=[-0.0669732D0, 0.1537401D0, 0.2371681D0, 0.3296509D0, 0.1479368D0]
ff2_c3d_002=[ 0.2054467D0, 0.5791591D0, 0.7219083D0, 0.8228920D0, 0.4085410D0]
ff2_c3d_102=[ 0.2143639D0, -0.2905753D0, -0.4994409D0, -0.6173923D0, -0.3156809D0]
ff2_c3d_003=[ 0.0014179D0, -0.2833503D0, -0.3976060D0, -0.3689554D0, -0.2145625D0]
ff2_c3d_103=[-0.2303063D0, 0.1320859D0, 0.3419425D0, 0.3533569D0, 0.2474548D0]
ff2_c3d_004=[-0.0188241D0, 0.0516219D0, 0.0878278D0, 0.0580685D0, 0.0553802D0]
ff2_c3d_104=[ 0.0782668D0, -0.0003866D0, -0.0704236D0, -0.0529642D0, -0.0656191D0]
ff2_c3d_010=[ 1.0254700D0, 1.0536114D0, 1.0482122D0, 1.0525770D0, 1.0448927D0]
ff2_c3d_110=[-0.0123804D0, -0.0402674D0, -0.0328853D0, -0.0274988D0, -0.0895899D0]
ff2_c3d_011=[-0.0370201D0, -0.0563704D0, -0.0354928D0, -0.0487050D0, -0.0955188D0]
ff2_c3d_111=[-0.0224963D0, -0.0349607D0, -0.0656007D0, -0.0428780D0, 0.0236516D0]
ff2_c3d_012=[-0.1005337D0, -0.1450037D0, -0.1672949D0, -0.2049884D0, -0.0942996D0]
ff2_c3d_112=[ 0.0257704D0, 0.0782432D0, 0.0999685D0, 0.0993408D0, 0.0422533D0]
ff2_c3d_013=[ 0.0385082D0, 0.0430121D0, 0.0515689D0, 0.0606149D0, 0.0203157D0]
ff2_c3d_113=[-0.0049530D0, -0.0276824D0, -0.0309441D0, -0.0416862D0, -0.0082573D0]
ff2_c3d_020=[-0.0012442D0, -0.0111443D0, -0.0123488D0, -0.0087517D0, -0.0016854D0]
ff2_c3d_120=[ 0.0115008D0, 0.0312578D0, 0.0315381D0, 0.0227707D0, 0.0650281D0]
ff2_c3d_021=[ 0.0727088D0, 0.1046035D0, 0.1053274D0, 0.1329422D0, 0.1065020D0]
ff2_c3d_121=[ 0.0038124D0, -0.0052565D0, -0.0022758D0, -0.0118978D0, -0.0372886D0]
ff2_c3d_022=[-0.0223655D0, -0.0130742D0, -0.0143628D0, -0.0106278D0, -0.0077959D0]
ff2_c3d_122=[-0.0049537D0, -0.0047638D0, -0.0063133D0, 0.0020711D0, -0.0033688D0]
ff2_c3d_030=[-0.0159346D0, -0.0212027D0, -0.0199292D0, -0.0273466D0, -0.0233474D0]
ff2_c3d_130=[-0.0035786D0, -0.0086870D0, -0.0090606D0, -0.0054171D0, -0.0138632D0]
ff2_c3d_031=[ 0.0101170D0, 0.0031635D0, 0.0027428D0, -0.0033878D0, -0.0005013D0]
ff2_c3d_131=[ 0.0004436D0, 0.0013816D0, 0.0015143D0, 0.0004107D0, 0.0057651D0]
ff2_c3d_040=[-0.0033853D0, -0.0021711D0, -0.0022738D0, -0.0007230D0, -0.0017665D0]
ff2_c3d_140=[ 0.0002804D0, 0.0008126D0, 0.0008187D0, 0.0006392D0, 0.0011240D0]
;
;
z_grid = [0.0D0, -0.5D0, -1.0D0, -2.0D0, -3.0D0]
;
; --- check input parameters
if (t lt 4900.0 or t gt 6600.0) then begin
print, '% FF123: Teff out of range: ' + string(t,format='(F8.2)') + ' K'
print, '% FF123: must be in the range 5000 .. 6500 K'
ff2_out = [-99.9,-99.9]
return
endif
if (glog lt 3.4 or glog gt 4.6) then begin
print, '% FF123: log g out of range: ' + string(glog,format='(F5.2)')
print, '% FF123: must be in the range 3.5 .. 4.5'
ff2_out = [-99.9,-99.9]
return
endif
if (z lt -3.2 or z gt 0.2) then begin
print, '% FF123: [Fe/H] out of range: ' + string(z,format='(F5.2)')
print, '% FF123: must be in the range -3.0 .. 0.0'
ff2_out = [-99.9,-99.9]
return
endif
if (ALi lt 0.9 or ALi gt 3.1) then begin
print, '% FF123: A(Li) out of range: ' + string(Ali,format='(F5.2)')
print, '% FF123: must be in the range 1.0 .. 3.0'
ff2_out = [-99.9,-99.9]
return
endif
if (qiso lt 0.0 or qiso gt 0.1) then begin
print, '% FF123: 6Li/7Li out of range: ' + string(qiso,format='(F5.2)')
print, '% FF123: must be in the range 0.0 .. 0.082'
ff2_out = [-99.9,-99.9]
return
endif
;normalization of the T and log g
;
a = (t-5000.0D0)/1000.0D0
b = glog-3.5D0
; correction for isotopic ratio
d2= 0.045D0*(1.0D0-qiso/0.082D0)
c = ALi + d2
;
ff2_1d=(ff2_c1d_000 + ff2_c1d_100*b) + $
(ff2_c1d_001 + ff2_c1d_101*b)*a + $
(ff2_c1d_002 + ff2_c1d_102*b)*a*a + $
(ff2_c1d_003 + ff2_c1d_103*b)*a*a*a + $
(ff2_c1d_004 + ff2_c1d_104*b)*a*a*a*a + $
(ff2_c1d_010 + ff2_c1d_110*b)*c + $
(ff2_c1d_011 + ff2_c1d_111*b)*c*a + $
(ff2_c1d_012 + ff2_c1d_112*b)*c*a*a + $
(ff2_c1d_013 + ff2_c1d_113*b)*c*a*a*a + $
(ff2_c1d_020 + ff2_c1d_120*b)*c*c + $
(ff2_c1d_021 + ff2_c1d_121*b)*c*c*a + $
(ff2_c1d_022 + ff2_c1d_122*b)*c*c*a*a + $
(ff2_c1d_030 + ff2_c1d_130*b)*c*c*c + $
(ff2_c1d_031 + ff2_c1d_131*b)*c*c*c*a + $
(ff2_c1d_040 + ff2_c1d_140*b)*c*c*c*c
;
ff2_3d=(ff2_c3d_000 + ff2_c3d_100*b) + $
(ff2_c3d_001 + ff2_c3d_101*b)*a + $
(ff2_c3d_002 + ff2_c3d_102*b)*a*a + $
(ff2_c3d_003 + ff2_c3d_103*b)*a*a*a + $
(ff2_c3d_004 + ff2_c3d_104*b)*a*a*a*a + $
(ff2_c3d_010 + ff2_c3d_110*b)*c + $
(ff2_c3d_011 + ff2_c3d_111*b)*c*a + $
(ff2_c3d_012 + ff2_c3d_112*b)*c*a*a + $
(ff2_c3d_013 + ff2_c3d_113*b)*c*a*a*a + $
(ff2_c3d_020 + ff2_c3d_120*b)*c*c + $
(ff2_c3d_021 + ff2_c3d_121*b)*c*c*a + $
(ff2_c3d_022 + ff2_c3d_122*b)*c*c*a*a + $
(ff2_c3d_030 + ff2_c3d_130*b)*c*c*c + $
(ff2_c3d_031 + ff2_c3d_131*b)*c*c*c*a + $
(ff2_c3d_040 + ff2_c3d_140*b)*c*c*c*c
;
;
; --- interpolation to required z ---
ff2_1dz = mcubic(ff2_1d,z_grid,z) - d2
ff2_3dz = mcubic(ff2_3d,z_grid,z) - d2
;
ff2_out = [ff2_1dz,ff2_3dz]
;
end
pro ff3, t, glog, z, EW, qiso, ff3_out
;
; Coefficients based on original 1D NLTE equivalent widths by A. Mott
; Cijk mm00 mm05 mm10 mm20 mm30
ff3_c1d_000=[ 1.0034880D0, 0.9969588D0, 0.9946962D0, 0.9947520D0, 0.9761783D0]
ff3_c1d_100=[-0.0149131D0, -0.0012568D0, 0.0012896D0, -0.0014573D0, 0.0395208D0]
ff3_c1d_001=[-0.0070700D0, 0.1701429D0, 0.0837970D0, 0.1427269D0, 0.1456125D0]
ff3_c1d_101=[ 0.0600870D0, -0.1039627D0, -0.1483714D0, -0.0204912D0, -0.0444751D0]
ff3_c1d_002=[ 0.0778053D0, -0.5129522D0, -0.1001108D0, -0.3366641D0, -0.3424794D0]
ff3_c1d_102=[-0.1876247D0, 0.2598852D0, 0.3102002D0, 0.0590798D0, -0.0621787D0]
ff3_c1d_003=[-0.1373179D0, 0.4948993D0, -0.0283389D0, 0.2445354D0, 0.3244218D0]
ff3_c1d_103=[ 0.2092790D0, -0.2249752D0, -0.1888596D0, -0.0636695D0, 0.0678418D0]
ff3_c1d_004=[ 0.0658496D0, -0.1461374D0, 0.0473187D0, -0.0465606D0, -0.0964052D0]
ff3_c1d_104=[-0.0800654D0, 0.0586372D0, 0.0229167D0, 0.0126802D0, -0.0208056D0]
ff3_c1d_010=[ 1.4863001D0, 1.4397544D0, 1.4525720D0, 1.4504639D0, 1.4938299D0]
ff3_c1d_110=[-0.0129561D0, -0.0107809D0, -0.0196197D0, -0.0334373D0, -0.0392963D0]
ff3_c1d_011=[ 0.4811911D0, 0.4921130D0, 0.4573048D0, 0.4333948D0, 0.3481754D0]
ff3_c1d_111=[ 0.0435972D0, 0.0324621D0, 0.0619665D0, 0.0383781D0, 0.0388136D0]
ff3_c1d_012=[-0.1143308D0, -0.1531218D0, -0.0943043D0, -0.1027095D0, -0.1124205D0]
ff3_c1d_112=[-0.0699413D0, -0.0597135D0, -0.1132561D0, -0.0532867D0, -0.0459816D0]
ff3_c1d_013=[-0.0831284D0, -0.0613116D0, -0.0878985D0, -0.0772232D0, -0.0415169D0]
ff3_c1d_113=[ 0.0356960D0, 0.0364476D0, 0.0626087D0, 0.0514719D0, 0.0511127D0]
ff3_c1d_020=[ 0.0323323D0, 0.0641480D0, 0.0701729D0, 0.0757278D0, 0.0785333D0]
ff3_c1d_120=[ 0.0297583D0, 0.0277220D0, 0.0287614D0, 0.0668523D0, 0.0775074D0]
ff3_c1d_021=[ 0.2677503D0, 0.3584981D0, 0.3004327D0, 0.3354400D0, 0.4029507D0]
ff3_c1d_121=[-0.0101038D0, -0.0243102D0, 0.0291790D0, -0.0641447D0, -0.0807435D0]
ff3_c1d_022=[ 0.2705392D0, 0.2603878D0, 0.2783551D0, 0.2747025D0, 0.2155212D0]
ff3_c1d_122=[-0.0249536D0, -0.0318485D0, -0.0715133D0, -0.1116670D0, -0.1230486D0]
ff3_c1d_030=[-0.3389264D0, -0.4639441D0, -0.4374807D0, -0.4779056D0, -0.5137561D0]
ff3_c1d_130=[-0.0418873D0, -0.0263805D0, -0.0514110D0, -0.0003870D0, 0.0050233D0]
ff3_c1d_031=[-0.8119198D0, -0.8934028D0, -0.8646667D0, -0.8982424D0, -0.8600781D0]
ff3_c1d_131=[ 0.0660941D0, 0.0973589D0, 0.1099220D0, 0.2498231D0, 0.2818613D0]
ff3_c1d_040=[ 0.8224663D0, 0.9672014D0, 0.9390500D0, 1.0030741D0, 1.0015136D0]
ff3_c1d_140=[-0.0164435D0, -0.0449689D0, -0.0440915D0, -0.1620551D0, -0.1865475D0]
;
; Coefficients based on original 3D NLTE equivalent widths by A. Mott
; Cijk mm00 mm05 mm10 mm20 mm30
ff3_c3d_000=[ 1.0129539D0, 1.0048051D0, 1.0073185D0, 1.0018589D0, 0.9843768D0]
ff3_c3d_100=[-0.0320762D0, -0.0181588D0, -0.0225066D0, -0.0135131D0, 0.0258085D0]
ff3_c3d_001=[-0.0047474D0, 0.1561165D0, 0.1868200D0, 0.2595673D0, 0.1117859D0]
ff3_c3d_101=[ 0.0966525D0, -0.1225815D0, -0.1843958D0, -0.2946401D0, -0.1551465D0]
ff3_c3d_002=[ 0.0107189D0, -0.3957869D0, -0.4996260D0, -0.5756683D0, -0.2655631D0]
ff3_c3d_102=[-0.2652379D0, 0.2545796D0, 0.4620044D0, 0.6000681D0, 0.3281206D0]
ff3_c3d_003=[-0.0300389D0, 0.3105966D0, 0.4199568D0, 0.4078356D0, 0.2412711D0]
ff3_c3d_103=[ 0.2674269D0, -0.1445944D0, -0.3654113D0, -0.4031672D0, -0.2896941D0]
ff3_c3d_004=[ 0.0199194D0, -0.0706069D0, -0.1063437D0, -0.0853998D0, -0.0668322D0]
ff3_c3d_104=[-0.0896722D0, 0.0127179D0, 0.0855543D0, 0.0816975D0, 0.0796513D0]
ff3_c3d_010=[ 1.4826018D0, 1.4363913D0, 1.4479415D0, 1.4363663D0, 1.4851382D0]
ff3_c3d_110=[-0.0122440D0, -0.0120726D0, -0.0224080D0, -0.0332608D0, -0.0266341D0]
ff3_c3d_011=[ 0.4809866D0, 0.4890558D0, 0.4584515D0, 0.4533793D0, 0.3895906D0]
ff3_c3d_111=[ 0.0315554D0, 0.0315003D0, 0.0671112D0, 0.0233328D0, 0.0026447D0]
ff3_c3d_012=[-0.1093419D0, -0.1443315D0, -0.0745938D0, -0.0858786D0, -0.1282260D0]
ff3_c3d_112=[-0.0582297D0, -0.0676528D0, -0.1250455D0, -0.0366054D0, 0.0103118D0]
ff3_c3d_013=[-0.0811257D0, -0.0608838D0, -0.0967849D0, -0.0887680D0, -0.0404274D0]
ff3_c3d_113=[ 0.0315529D0, 0.0419535D0, 0.0693063D0, 0.0455033D0, 0.0214958D0]
ff3_c3d_020=[ 0.0397534D0, 0.0658588D0, 0.0650056D0, 0.0664652D0, 0.0979962D0]
ff3_c3d_120=[ 0.0310409D0, 0.0362215D0, 0.0456162D0, 0.0816874D0, 0.0243971D0]
ff3_c3d_021=[ 0.2289434D0, 0.3330445D0, 0.2619056D0, 0.2722017D0, 0.3058020D0]
ff3_c3d_121=[ 0.0119482D0, -0.0044280D0, 0.0319514D0, -0.0529941D0, -0.0511880D0]
ff3_c3d_022=[ 0.2664408D0, 0.2528331D0, 0.2841167D0, 0.2869350D0, 0.2237575D0]
ff3_c3d_122=[-0.0300937D0, -0.0414550D0, -0.0792486D0, -0.1155353D0, -0.1034352D0]
ff3_c3d_030=[-0.3033826D0, -0.4262138D0, -0.3866560D0, -0.3930803D0, -0.4543772D0]
ff3_c3d_130=[-0.0669515D0, -0.0577996D0, -0.0822305D0, -0.0379099D0, 0.0486115D0]
ff3_c3d_031=[-0.7817028D0, -0.8713536D0, -0.8517458D0, -0.8782503D0, -0.7977752D0]
ff3_c3d_131=[ 0.0597030D0, 0.1003228D0, 0.1256164D0, 0.2541338D0, 0.2421975D0]
ff3_c3d_040=[ 0.7897918D0, 0.9366162D0, 0.9056341D0, 0.9497166D0, 0.9366128D0]
ff3_c3d_140=[-0.0023798D0, -0.0321545D0, -0.0377751D0, -0.1493477D0, -0.1960495D0]
;
ff3_p1d=dblarr(3,5)
ff3_p3d=dblarr(3,5)
ff3_q1d=dblarr(3,5)
ff3_q3d=dblarr(3,5)
;
; Coefficients for 1D NLTE EW lower boundary
ff3_p1d[*,0]=[ 1.1717118D0, -0.96369743D0, 0.096907951D0] ;mm00
ff3_p1d[*,1]=[ 1.2508765D0, -0.93910623D0, 0.088800728D0] ;mm05
ff3_p1d[*,2]=[ 1.2407464D0, -0.94574118D0, 0.102237680D0] ;mm10
ff3_p1d[*,3]=[ 1.2765080D0, -0.93972653D0, 0.107441570D0] ;mm20
ff3_p1d[*,4]=[ 1.2212788D0, -0.81842232D0, 0.053878609D0] ;mm30
;
; Coefficients for 1D NLTE EW upper boundary
ff3_q1d[*,0]=[ 2.5373471D0, -0.30657116D0, -0.0994211448D0] ;mm00
ff3_q1d[*,1]=[ 2.5629222D0, -0.27704242D0, -0.0945872070D0] ;mm05
ff3_q1d[*,2]=[ 2.5642192D0, -0.29072073D0, -0.0840242280D0] ;mm10
ff3_q1d[*,3]=[ 2.5933402D0, -0.31231794D0, -0.0640284270D0] ;mm20
ff3_q1d[*,4]=[ 2.5898440D0, -0.30371687D0, -0.0647640150D0] ;mm30
;
; Coefficients for 3D NLTE EW lower boundary
ff3_p3d[*,0]=[ 1.1666957, -0.97443050, 0.099899225D0] ;mm00
ff3_p3d[*,1]=[ 1.2504734, -0.94860297, 0.086008452D0] ;mm05
ff3_p3d[*,2]=[ 1.2464725, -0.97929758, 0.110358680D0] ;mm10
ff3_p3d[*,3]=[ 1.3043333, -1.00515020, 0.123410810D0] ;mm20
ff3_p3d[*,4]=[ 1.2126223, -0.87928706, 0.083180308D0] ;mm30
;
; Coefficients for 3D NLTE EW upper boundary
ff3_q3d[*,0]=[ 2.5298152, -0.31967881, -0.094098978D0] ;mm00
ff3_q3d[*,1]=[ 2.5573504, -0.28434482, -0.096172124D0] ;mm05
ff3_q3d[*,2]=[ 2.5622675, -0.31144020, -0.080478013D0] ;mm10
ff3_q3d[*,3]=[ 2.6001840, -0.34407923, -0.061484154D0] ;mm20
ff3_q3d[*,4]=[ 2.5832374, -0.34905300, -0.047986072D0] ;mm30
;
z_grid = [0.0D0, -0.5D0, -1.0D0, -2.0D0, -3.0D0]
;
; --- check input parameters
if (t lt 4900.0 or t gt 6600.0) then begin
print, '% FF123: Teff out of range: ' + string(t,format='(F8.2)') + ' K'
print, '% FF123: must be in the range 5000 .. 6500 K'
ff3_out = [-99.9,-99.9]
return
endif
if (glog lt 3.4 or glog gt 4.6) then begin
print, '% FF123: log g out of range: ' + string(glog,format='(F5.2)')
print, '% FF123: must be in the range 3.5 .. 4.5'
ff3_out = [-99.9,-99.9]
return
endif
if (z lt -3.2 or z gt 0.2) then begin
print, '% FF123: [Fe/H] out of range: ' + string(z,format='(F5.2)')
print, '% FF123: must be in the range -3.0 .. 0.0'
ff3_out = [-99.9,-99.9]
return
endif
if (qiso lt 0.0 or qiso gt 0.1) then begin
print, '% FF123: 6Li/7Li out of range: ' + string(qiso,format='(F5.2)')
print, '% FF123: must be in the range 0.0 .. 0.082'
ff3_out = [-99.9,-99.9]
return
endif
;normalization of the T and log g
;
a = (t-5000.0D0)/1000.0D0
b = glog-3.5D0
; correction for isotopic ratio
d3= 0.045D0*(1.0D0-qiso/0.082D0)
c = EW + d3
;
pz1d = reform(ff3_p1d[0,*] + ff3_p1d[1,*]*a + ff3_p1d[2,*]*a*a)
qz1d = reform(ff3_q1d[0,*] + ff3_q1d[1,*]*a + ff3_q1d[2,*]*a*a)
y = reform((c-pz1d)/(qz1d-pz1d))
;
ff3_1d=(ff3_c1d_000 + ff3_c1d_100*b) + $
(ff3_c1d_001 + ff3_c1d_101*b)*a + $
(ff3_c1d_002 + ff3_c1d_102*b)*a*a + $
(ff3_c1d_003 + ff3_c1d_103*b)*a*a*a + $
(ff3_c1d_004 + ff3_c1d_104*b)*a*a*a*a + $
(ff3_c1d_010 + ff3_c1d_110*b)*y + $
(ff3_c1d_011 + ff3_c1d_111*b)*y*a + $
(ff3_c1d_012 + ff3_c1d_112*b)*y*a*a + $
(ff3_c1d_013 + ff3_c1d_113*b)*y*a*a*a + $
(ff3_c1d_020 + ff3_c1d_120*b)*y*y + $
(ff3_c1d_021 + ff3_c1d_121*b)*y*y*a + $
(ff3_c1d_022 + ff3_c1d_122*b)*y*y*a*a + $
(ff3_c1d_030 + ff3_c1d_130*b)*y*y*y + $
(ff3_c1d_031 + ff3_c1d_131*b)*y*y*y*a + $
(ff3_c1d_040 + ff3_c1d_140*b)*y*y*y*y
;
pz3d = reform(ff3_p3d[0,*] + ff3_p3d[1,*]*a + ff3_p3d[2,*]*a*a)
qz3d = reform(ff3_q3d[0,*] + ff3_q3d[1,*]*a + ff3_q3d[2,*]*a*a)
y = reform((c-pz3d)/(qz3d-pz3d))
;
ff3_3d=(ff3_c3d_000 + ff3_c3d_100*b) + $
(ff3_c3d_001 + ff3_c3d_101*b)*a + $
(ff3_c3d_002 + ff3_c3d_102*b)*a*a + $
(ff3_c3d_003 + ff3_c3d_103*b)*a*a*a + $
(ff3_c3d_004 + ff3_c3d_104*b)*a*a*a*a + $
(ff3_c3d_010 + ff3_c3d_110*b)*y + $
(ff3_c3d_011 + ff3_c3d_111*b)*y*a + $
(ff3_c3d_012 + ff3_c3d_112*b)*y*a*a + $
(ff3_c3d_013 + ff3_c3d_113*b)*y*a*a*a + $
(ff3_c3d_020 + ff3_c3d_120*b)*y*y + $
(ff3_c3d_021 + ff3_c3d_121*b)*y*y*a + $
(ff3_c3d_022 + ff3_c3d_122*b)*y*y*a*a + $
(ff3_c3d_030 + ff3_c3d_130*b)*y*y*y + $
(ff3_c3d_031 + ff3_c3d_131*b)*y*y*y*a + $
(ff3_c3d_040 + ff3_c3d_140*b)*y*y*y*y
;
;
; --- interpolation to required z ---
ff3_1dz = mcubic(ff3_1d,z_grid,z) - d3
ff3_3dz = mcubic(ff3_3d,z_grid,z) - d3
;
; --- check if input EW gives reasonable Li abundance ---
if (ff3_1dz lt 0.9 or ff3_1dz gt 3.1) then ff3_1dz = -99.9
if (ff3_3dz lt 0.9 or ff3_3dz gt 3.1) then ff3_3dz = -99.9
;
ff3_out = [ff3_1dz,ff3_3dz]
;
end
function mcubic, yinput, xinput, xout
;
nout=n_elements(xout)
nx =n_elements(xinput)
ny =n_elements(yinput)
if (nx eq ny) then begin
n=nx
endif else begin
print, 'xinput and yinput must have the same number of elements!'
stop
endelse
;
; print, 'xinput: ',xinput
; print, 'yinput: ',yinput
; print, 'xout:',xout
; --- we assume that xinput is a sequence at least 4 elements,
; composed of unique, monotonically increasing or decraesing values ---
if (n lt 4) then begin
print, 'xinput, yinput must have at least 4 elements!'
stop
endif
;
if (xinput[0] lt xinput[n-1]) then begin
xin=xinput
yin=yinput
endif else begin
xin=reverse(xinput)
yin=reverse(yinput)
endelse
;
; --- Compute x-step h, linear slope s and slope of parabola p ---
h= xin[1:n-1] - xin[0:n-2]
s=(yin[1:n-1] - yin[0:n-2])/h
p=(s[0:n-3]*h[1:n-2]+s[1:n-2]*h[0:n-3])/(h[0:n-3]+h[1:n-2])
q0=signum(s[0:n-3])+signum(s[1:n-2])
q1=[[ abs(s[0:n-3])], [abs(s[1:n-2])], [0.5*abs(p)] ]
q2=q0*MIN(q1,dim=2)
y1=dblarr(n)
y1[1:n-2]=q2
; print, 'h:',h
; print, 's:',s
; print, 'p:',p
; print, 'q0:',q0
; print, 'q1:',q1
; print, 'q2:',q2,q2.dtype
; print, 'y1:',y1,y1.dtype
;
; --- Boundary handling d2y/dx2=0 [bcfac=1.5] ---