example line 11 100.021386 1.591E-20 2.345E-010.439 882.8904 0 0 0 0 0 0 8 2 6 8 1 7 0.0596 0.0030 7.754E-04 4.794E+00 5.891E-02 4.898E-01 0.00189 0.00050-7.440E-06-7.612E-01 1.904E-03 1.349E+00 5553334 164 1 1 17.0 17.0 mol,iso,ν, S, A, γ(self), E", Vupper, Vlower, Rotupper, Rotlower, γ(N2), γe(N2), c1, n1, c2, n2, δ(N2), δe(N2), d1, q1, d2, q2, Ier(3), IRef(6), g_up, g_low parameter units FORTRAN C++/python ---------------------------------------------------------------------------------------------- molecule id NA I2 %d2 isotopologue id NA I1 %d2 line position ν cm^-1 F12.6 %f12.6 line intensity S (cm^-1)/(molecule cm^-2) ES10.3E2 %10.3E Einstein A s^-1 ES10.3E2 %10.3E self-broadened half-width γ(self) cm^-1 atm^-1 F5.3 %5.3f lower state energy (term value) E" cm^-1 F10.4 %10.4f upper state vibrational quantum numbers NA A15 %15s lower state vibrational quantum numbers NA A15 %15s upper state rotational quantum numbers J', Ka', Kc' NA A15 %15s lower state rotational quantum numbers J", Ka", Kc" NA A15 %15s H2-broadened half-width γ(H2) cm^-1 atm^-1 F8.4 %8.4f uncertainty in γ(H2) γe(H2) cm^-1 atm^-1 F8.4 %8.4f temperature dependence coefficients for γ(H2): c1, c2 cm^-1 atm^-1 ES10.3E2 %10.3E for γ(H2): n1, n2 unitless ES10.3E2 %10.3E H2-pressure induced line shift δ(H2) cm^-1 atm^-1 F8.5 %8.5f uncertainty in δ(H2) δe(H2) cm^-1 atm^-1 F8.5 %8.5f temperature dependence coefficients for δ(H2): d1, d2 cm^-1 atm^-1 ES10.3E2 %10.3E for δ(H2): q1, q2 unitless ES10.3E2 %10.3E error codes for ν; S; γself NA I1 %d1 reference codes for ν; S; γ(H2), γself ; n(H2) ; δ(H2) NA I2 %d2 The upper and lower state statistical weights unitless F7.1 %7.1f ---------------------------------------------------------------------------------------------- FORTRAN code to read the file c************************************************************************************************************** program read_par implicit double precision(a-h,o-z) parameter (eof = -1) logical read_more_data open(1,file='H2O-H2_2018.par',status='old') 900 FORMAT(I2,I1,F12.6,2ES10.3E2,0pF5.3,F10.4,4A15,2F8.4,4ES10.3E2,2F8.5,4ES10.3E2,1x,3I1,6I2,1x,2F7.1) nr = 0 read_more_data=.TRUE. dowhile(read_more_data) read(1,900) mol,iso,freq,S,A,gself,E_lower,Qvib_up,Qvib_lo,Qrot_up,Qrot_lo,g_H2,g_H2_err,c1,n1,c2,n2, + shift,shift_err,d1,q1,d2,q2,Ie_F,Ie_S,Ie_gself, + IRef_F,IRef_S,IRef_g_H2,IRef_gself,IRef_n,IRef_shift_H2,gj_up,gj_lo if(ios.eq.eof)then write(*,*) ' Data input finished' read_more_data=.FALSE. else nr = nr + 1 ! do your thing here endif enddo end c************************************************************************************************************** python code to read the file #------------------------------------------------- import decimal import numpy as np infile = 'H2O-H2_2018.par' outfile = 'H2O-H2_2018.out' # output file H2OH2 = open(infile) f2 = open(outfile, 'w') n1 = 0 n2 = 0 n3 = 0 n1_1 = 0 n2_1 = 0 n3_1 = 0 n1_2 = 0 n2_2 = 0 n3_2 = 0 n1_3 = 0 n2_3 = 0 n3_3 = 0 n123 = 0 nt = 0 for line in H2OH2: nt = nt + 1 line = line.rstrip() mol = line[0:2] iso = line[2:3] freq = float(line[3:15]) S = float(line[15:25]) A = float(line[25:35]) gself = float(line[35:40]) E_lower = float(line[40:50]) V_upper = line[50:65] V_lower = line[65:80] Qrot_up = line[80:95] Qrot_lo = line[95:110] g_H2 = float(line[110:118]) g_H2_err = float(line[118:126]) c1 = float(line[126:136]) c2 = float(line[136:146]) c3 = float(line[146:156]) c4 = float(line[156:166]) shift = float(line[166:174]) shift_err = float(line[174:182]) d1 = float(line[182:192]) d2 = float(line[192:202]) d3 = float(line[202:212]) d4 = float(line[212:222]) Ie_F = line[223:224] Ie_S = line[224:225] Ie_gself = line[225:226] IRef_F = line[226:228] IRef_S = line[228:230] IRef_g_H2 = line[230:232] IRef_gself =line[232:234] IRef_n = line[234:236] IRef_shift_H2 = line[236:238] gj_up = float(line[239:246]) gj_lo = float(line[246:253]) # do your thing here #-------------------------------------------------