ADAS Subroutine ccnst7
SUBROUTINE CCNST7(NLREP,IR,I,V,E,EXE,EXS,K,ISG,CGBBA,ENL,ENL2, & EXPTE,EXPTS,KPF,ISG1,NMIN,NMAX,IMAX, & A0,CA0,A,CA,RH,CRH, & IOPT,NG,LG,NGL,LTG,FPG,NG1,LG1, & NGL1,LTG1,FPG1,ARL,ISARL,AC1,RHSC1, & C1,C2,C3,SCLA,NIMP,ZIMPA,FRIMPA,AMIMPA, & EXMTE ) C----------------------------------------------------------------------- C C ********** FORTRAN 77 ROUTINE : CCNST7 ********** C C PURPOSE : ASSEMBLES ARRAYS USED TO CONSTRUCT THE C COLLISIONAL-RADIATIVE MATRIX. C C HISTORY : ROUTINE WAS ORIGINALLY WRITTEN BY H.P.SUMMERS. C RESTRUCURED AND MODIFIED BY H.ANDERSON. C C INPUT : C C (I*4) NLREP() : ARRAY CONTAINING ALL OF THE REPRESENTATIVE C LEVELS. C (I*4) IR : COUNTER GIVEN AS INPUT WHICH RANGES FROM C NMIN TO NMAX AND IS USED TO REFERENCE THE C REPRESENTATIVE LEVEL. C (I*4) I : REPRESENTATIVE LEVEL WHICH IS GIVEN BY C NLREP(IR) C (R*8) V : EFFECTIVE PRINCIPAL QUANTUM NUMBER FOR THE C REPRESENTATIVE LEVEL I. C (R*8) E : RECIPROCAL OF THE EFFECTIVE PRINCIPAL QUANTUM C NUMBER SQUARED FOR THE REPRESENTATIVE LEVEL I. C (R*8) EXE : VARIABLE ASSIGNED THE VALUE OF EXP(I/k*Te) C ASSOCIATED WITH THE REPRESENTATIVE LEVEL I. C (R*8) EXS : VARIABLE ASSIGNED THE VALUE OF EXP(I/k*TS) C ASSOCIATED WITH THE REPRESENTATIVE LEVEL I. C (I*4) K : VARIABLE ASSIGNED THE QUANTUM NUMBERS FOR C THE REPRESENTATIVE LEVEL I. STORAGE OF THE C NUMBERS ARE OF THE SAME FORMAT AS KPF(). C (I*4) ISG : MULTIPLICITY ?. C C (R*8) CGBBA : **** UNKNOWN **** C (R*8) ENL() : ARRAY CONTAINING THE EFFECTIVE PRINCIPAL C QUANTUM NUMBERS FOR EACH REPRESENTATIVE C LEVEL. C (R*8) ENL2() : ARRAY CONTAINING THE RECIPROCAL OF THE C EFFECTIVE PRINCIPAL QUANTUM NUMBER C SQUARED FOR EACH REPRESENTATIVE LEVEL. C (R*8) EXPTE() : ARRAY CONTAINING THE VALUE OF EXP(I/k*Te) C FOR EACH REPRESENTATIVE LEVEL FOR THE C TRIPLETS. C C (R*8) EXMTE() : ARRAY CONTAINING THE VALUE OF EXP(I/k*Te) C FOR EACH REPRESENTATIVE LEVEL FOR THE C SINGLETS. C (R*8) EXPTS() : ARRAY CONTAINING THE VALUE OF EXP(I/k*TS) C FOR EACH REPRESENTATIVE LEVEL. C (I*4) KPF() : ARRAY CONTAINING THE QUANTUM NUMBERS, C N,l,L FROM NMIN TO NMAX, IN ORDER C OF DECREASING BINDING ENERGY. EACH 32 BIT C ELEMENT OF THE ARRAY IS USED TO STORE N,l C AND L FOR EACH REPRESENTATIVE LEVEL. THE C FIRST 10 BITS ARE USED TO STORE THE TOTAL C ANGULAR MOMENTUM QUANTUM NUMBER. THE NEXT C 10 BITS ARE USED TO STORE THE ORBITAL C QUANTUM NUMBER. THE LAST 12 BITS ARE USED C TO STORE THE PRINCIPAL QUANTUM NUMBER. C C |<---------4 BYTE INTEGER--------->| C |<---------32 BIT INTEGER--------->| C |<----N----->|<----l--->|<---L---->| C C [ |.....N......|.....l....|.....L....| ] C C BIT OPERATORS ARE THEN EMPLOYED TO C INTEROGATE ARRAYS,E.G IAND,ISHFR, C USING HEXIDECIMAL MASKS. C C (I*4) ISG1 : *****UNKNOWN***** C (I*4) NMIN : MINIMUM PRINCIPAL QUANTUM NUMBER OF THE C RANGE WHICH CONTAINS THE REPRESENTATIVE C LEVELS. C C (I*4) NMAX : MAXIMUM PRINCIPAL QUANTUM NUMBER OF THE C RANGE WHICH CONTAINS THE REPRESENTATIVE C LEVELS. C (I*4) IMAX : THE MAXIMUM NUMBER OF REPRESENTATIVE C LEVELS. C C OUTPUT : C C (R*8) A0 : C (R*8) CA0 : C (R*8) A : C (R*8) CA : C (R*8) RH : C (R*8) CRH : C (I*4) IOPT : SWITCH USED TO DETERMINE IF CCNST7 C SHOULD ASSEMBLE ARRAYS USED TO C CONSTRUCT THE COLLISIONAL-RADIATIVE C MATRIX EXCLUDING SPIN CHANGING C CROSS SECTIONS ( IOPT = 1 ) OR IF C CCNST7 SHOULD ONLY CONTRUCT THE C ARRAYS CONTAINING SPIN CHANGING C CROSS SECTIONS ( IOPT GT 1 ). C (I*4) NG : C (I*4) LG : C (I*4) NGL : C (I*4) LTG : C (R*8) FPG : C (I*4) NG1 : C (I*4) LG1 : C (I*4) NGL1 : C (I*4) iLTG1 : C (R*8) FPG1 : C (R*8) ARL : C (I*4) ISARL : C (R*8) AC1 : C (R*8) RHSC1 : C (R*8) C1() : COEFFICIENTS OF THE QUANTUM DEFECT C EXPANSION. C (R*8) C2() : COEFFICIENTS OF THE QUANTUM DEFECT C EXPANSION. C (R*8) C3() : COEFFICIENTS OF THE QUANTUM DEFECT C EXPANSION. C (R*8) SCLA : C (I*4) NIMP : NUMBER OF IMPURITIES IN THE PLASMA. C (R*8) ZIMPA : ARRAY CONTAINING THE NUCLEAR CHARGE C OF THE IMPURITIES IN THE PLASMA. C (R*8) FRIMPA : IMPURITY FRACTIONS. C (R**) AMIMPA : THE ATOMIC MASS OF EACH IMPURITY C WITHIN THE PLASMA. C C C C ROUTINES: C C ROUTINE SOURCE DESCRIPTION C ----------------------------------------------- C GBBR ADAS C GBB ADAS C PYVR ADAS C PYPR ADAS C PYIPHE ADAS C RQVNEW ADAS C RQLNEW ADAS C RQBNEW ADAS C GHNLV ADAS C GHNLE ADAS C COLINT ADAS C RQINEW ADAS C PHOTO2 ADAS C NDIEL ADAS C RNDEGV ADAS C WIG6J ADAS C OVLP ADAS C COLEXC ADAS C ..... C ..... C ..... C C C CONTACT : HARVEY ANDERSON C UNIVERSITY OF STRATHCLYDE C ANDERSON@BARWANI.PHYS.STRATH.AC.UK C C DATE : 2/2/98 C C C C WARNING!!! : CODE IS UNDER DEVELOPMENT C C HARVEY ANDERSON C UNIVERSITY OF STRATHCLYDE C C VERSION: 1.2 DATE: 21-10-99 C MODIFIED: RICHARD MARTIN C CHANGED HEXADECIMAL CONSTANTS TO Z'FFF00000' FORM. C CORRECTED ARRAY INDEXING PROBLEM C C VERSION : 1.3 C MODIFIED: Martin O'Mullane C DATE : 3-6-2000 C iLTG1 is a scalar here but is passed from start7 C as an integer array. It should be LTG1 not iLTG1. C COR should be 20 not 6 - seel NDIEL subroutine. C CORS should be an array not a scalar. C C VERSION : 1.4 C DATE : 18-11-2004 C MODIFIED: Martin O'Mullane C - Align with Harvey Anderson's last version. C - Make implicit none and remove unecessary code. C C VERSION : 1.5 C DATE : 24-02-2005 C MODIFIED: Martin O'Mullane C - Make implicit none and remove unecessary code. C C----------------------------------------------------------------------- INTEGER I, IMAX, IOPT, IR INTEGER ISARL(80), ISG, ISG1, K INTEGER KPF(1000), LG, LG1, LTG(5) INTEGER LTG1(5), NG, NG1, NGL INTEGER NGL1, NIMP, NLREP(80), NMAX INTEGER NMIN REAL*8 A(1000), A0, AC1 REAL*8 AMIMPA(10), ARL(80), C1(5,5,3) REAL*8 C2(5,5,3), C3(5,5,3), CA(1000), CA0 REAL*8 CGBBA(800,3), CRH, E REAL*8 ENL(1000), ENL2(1000), EXE REAL*8 EXMTE(1000), EXPTE(1000), EXPTS(1000), EXS REAL*8 FPG(5), FPG1(5), FRIMPA(10), RH REAL*8 RHSC1, SCLA(240,8), V REAL*8 ZIMPA(10)