C------------------------------------------------------------------------------- C L I N V A D - Converter of a .LIN file to a frequencies block for C Vadim Ilyshin's RAM36 and RAM36HF programs C------------------------------------------------------------------------------- C C This program goes through the .LIN file for Pickett's SPFIT program C and produces line listing compatible with input required by C Vadim Ilyushin's sixfold/threefold internal rotation programs C C The input file for RAM36 and RAM36HF is INPUT.TXT and the LINVAD C generated block of lines is to be pasted into that, as appropriate C C C LINVAD requires a suitably filled out LINVAD.INP file, which has to C reside in the current directory from which LINVAD is called (also please C launch LINVAD using teh COMMAND window, and not by clicking on C the executable). C C For RAM36 the file LINVAD.INP should consist of two active lines : C C name of the input file: tolfin.lin C name of the output file: tolfinq_lines.txt C_______________________________________ C d e s c r i p t o r |_____ d a t a (starting on column 41) C C C For RAM36HF the file LINVAD.INP should consist of three active lines : C C name of the input file: cntolq.lin C name of the output file: cntolq_lines.txt C spin of hyperfine nucleus (real): 1.0 C_______________________________________ C d e s c r i p t o r |_____ d a t a (starting on column 41) C C C C ver. 29.III.2020 ----- Zbigniew KISIEL ----- C __________________________________________________ C | Institute of Physics, Polish Academy of Sciences | C | Al.Lotnikow 32/46, Warszawa, POLAND | C | kisiel@ifpan.edu.pl | C | http://info.ifpan.edu.pl/~kisiel/prospe.htm | C_________________________/-------------------------------------------------- C C Modification history: C c 8.11.10: creation from LINERH c 29.03.20: modification to deal also with RAM36HF C_____________________________________________________________________________ C C IMPLICIT REAL*8 (A-H,O-Z) IMPLICIT INTEGER*4 (I-N) character line*200,filein*30,filout*30,coment*150 integer linq(12) c c...Deal with the control file (unit 4) c WRITE(*,5500) 5500 FORMAT(1X//' ',76(1H_)/' |',T79,'|'/ * ' | LINVAD - Converter of a .LIN file to a transitions ', * ' block for ', * T79,'|'/ * ' | VADim Ilyushin''s RAM36 and RAM36HF programs' * ,T79,'|'/ * ' |',76(1H_),'|'/' version 29.III.2020',T64,'Zbigniew KISIEL'/) c open(4,file='linvad.inp',status='old') read(4,'(40x,a)')filein read(4,'(40x,a)')filout c c...LIN input: first check if RAM36 or RAM36HF c if RAM36HF then also read the nuclear spin c rewind the file for second time round c iram36hf=0 open(2,file=filein,status='old') write(*,'(1x,2a)')'Reading from: ',filein(1:len_trim(filein)) c 10 read(2,'(12I3)',err=11,end=11)linq if(linq(10).ne.0)then iram36hf=1 goto 11 endif goto 10 c 11 rewind(2) c if(iram36hf.eq.1)then read(4,'(40x,(f15.5))',err=12,end=12)spin if(spin.lt.1.d0)then write(*,'(1x//1x,a,f10.5//)')'Problem with the spin = ',spin stop endif goto 13 c 12 write(*,'(1x//1x,a//)')'Cannot read the spin from VADLIN.INP' stop c 13 write(*,'(1x//1x,a,f10.5)')'Input from RAM36HF, spin = ',spin ishalf=0 inthalf=(spin/0.5d0) hspin=spin-inthalf*0.5d0 write(*,'(1x,a,f10.5/)') ' half spin = ',hspin endif if(iram36hf.eq.0)then write(*,'(1x//1x,a,f10.5/)')'Input from RAM36' endif close(4) c c...RAM36 or RAM36HF frequency block output c open(3,file=filout,status='unknown') write(*,'(1x,2a)')' Writing to: ',filout(1:len_trim(filout)) c c Format in .LIN as output by AABS: c c47 18 29 2 46 18 28 2 0 0 0 0 208336.653535 0.050000 1.00000 only 0.5MHz off, good RI c48 30 18 2 47 30 17 2 0 0 0 0 208675.408618 0.050000 1.00000 c c Format required in INPUT.TXT: c c 82331.629 1 50 15 36 1 50 13 37 0 0.1000 c 94545.794 2 31 3 28 2 31 2 29 1 0.0300 ! c c...Go through the .LIN file and read lines c nlin=0 c 1 read(2,'(a)',err=4,end=4)line if(len_trim(line).lt.71)then write(3,'(a)')line(1:len_trim(line)) goto 1 endif c read(line,'(12I3)',err=4,end=4)linq coment=line(77:) line=line(37:len_trim(line)) c read(line,*,err=4,end=4)freq,ferr,rint c ifit=1 if(freq.eq.0.d0.or.ferr.gt.90.d0)then ifit=0 if(ferr.gt.900.d0)ferr=ferr-900.d0 endif c if(iram36hf.eq.1)then fupper=real(linq(5))-hspin flower=real(linq(10))-hspin endif c c...if necessary compensate for possibility of six quantum number scheme c for the ground state c c__RAM36 c if(iram36hf.eq.0)then if(linq(4).ne.0.and.(linq(7).eq.0.and.linq(8).eq.0))then write(3,5)freq,linq(7),linq(1),linq(2),linq(3), * linq(8),linq(4),linq(5),linq(6),ifit,ferr, * coment(1:len_trim(coment)) else write(3,5)freq,linq(4),linq(1),linq(2),linq(3), mu,ju,kau,kcu * linq(8),linq(5),linq(6),linq(7),ifit,ferr, ml,jl,kal,kcl * coment(1:len_trim(coment)) endif 5 format(f12.4,4i5,3x,4i5,i7,f11.4,1x,a) endif c c__RAM36HF c c from: c 3 0 3 1 4 2 0 2 1 3 0 0 5438.3114 0.0020 1.00000 ! c 3 0 3 1 3 2 0 2 1 2 0 0 5437.9401 0.0020 1.00000 c c to: c 5438.3114 1 4.0 3 0 3 1 3.0 2 0 2 1 0.0020 ! c 5437.9401 1 3.0 3 0 3 1 2.0 2 0 2 1 0.0020 c if(iram36hf.eq.1)then write(3,15)freq,linq(4),fupper,linq(1),linq(2),linq(3), mu,fu,ju,kau,kcu * linq(9),flower,linq(6),linq(7),linq(8), ml,fl,jl,kal,kcl * ifit,ferr, * coment(1:len_trim(coment)) 15 format(f12.4,i5,f6.1,3i5,3x,i5,f6.1,3i5,i7,f11.4,1x,a) endif c nlin=nlin+1 goto 1 c c 4 close(2) close(3) write(*,'(1x//i7,a//)')nlin,' lines have been output' stop c c stop end C_____________________________________________________________________________ C_____________________________________________________________________________