Search Site | Contact Details | FAQ

ADAS Subroutine bxdata

       SUBROUTINE BXDATA( IUNIT  , NDLEV  , NDTRN ,
     &                    TITLED , IZ     , IZ0   , IZ1   , BWNO  ,
     &                    IL     ,
     &                    IA     , CSTRGA , ISA   , ILA   , XJA   , WA ,
     &                    NV     , SCEF   ,
     &                    ITRAN  , MAXLEV ,
     &                    TCODE  , I1A    , I2A   , AVAL  , SCOM
     &                  )
C-----------------------------------------------------------------------
C
C  ****************** FORTRAN77 SUBROUTINE: BXDATA *********************
C
C  PURPOSE:  TO FETCH DATA FROM INPUT COPASE DATA SET.
C
C  CALLING PROGRAM: ADAS205/ADAS206/ADAS201
C
C  DATA:
C           THE 'REAL' DATA IN THE FILE IS REPRESENTED IN AN ABBREVIATED
C           FORM WHICH OMITS THE "D" OR "E" EXPONENT SPECIFIER.
C           e.g. 1.23D-06 or 1.23E-06 IS REPRESENTED AS 1.23-06
C                6.75D+07 or 6.75E+07 IS REPRESENTED AS 6.75+07
C
C           THEREFORE THE FORM OF EACH 'REAL' NUMBER IN THE DATA SET IS:
C                          N.NN+NN or N.NN-NN
C
C           THE UNITS USED IN THE DATA FILE ARE TAKEN AS FOLLOWS:
C
C           IONISATION POTENTIAL: WAVE NUMBER (CM-1)
C           INDEX LEVEL ENERGIES: WAVE NUMBER (CM-1)
C           TEMPERATURES        : KELVIN
C           A-VALUES            : SEC-1
C           GAMMA-VALUES        :
C           RATE COEFFT.        : CM3 SEC-1
C
C
C  SUBROUTINE:
C
C  INPUT : (I*4)  IUNIT   = UNIT TO WHICH INPUT FILE IS ALLOCATED
C  INPUT : (I*4)  NDLEV   = MAXIMUM NUMBER OF LEVELS THAT CAN BE READ
C  INPUT : (I*4)  NDTRN   = MAX. NUMBER OF TRANSITIONS THAT CAN BE READ
C
C  OUTPUT: (C*3)  TITLED  = ELEMENT SYMBOL.
C  OUTPUT: (I*4)  IZ      =  RECOMBINED ION CHARGE READ
C  OUTPUT: (I*4)  IZ0     =         NUCLEAR CHARGE READ
C  OUTPUT: (I*4)  IZ1     = RECOMBINING ION CHARGE READ
C                           (NOTE: IZ1 SHOULD EQUAL IZ+1)
C  OUTPUT: (R*8)  BWNO    = IONISATION POTENTIAL (CM-1)
C
C  OUTPUT: (I*4)  IL      = INPUT DATA FILE: NUMBER OF ENERGY LEVELS
C
C  OUTPUT: (I*4)  IA()    = ENERGY LEVEL INDEX NUMBER
C  OUTPUT: (C*18) CSTRGA()= NOMENCLATURE/CONFIGURATION FOR LEVEL 'IA()'
C  OUTPUT: (I*4)  ISA()   = MULTIPLICITY FOR LEVEL 'IA()'
C                           NOTE: (ISA-1)/2 = QUANTUM NUMBER (S)
C  OUTPUT: (I*4)  ILA()   = QUANTUM NUMBER (L) FOR LEVEL 'IA()'
C  OUTPUT: (R*8)  XJA()   = QUANTUM NUMBER (J-VALUE) FOR LEVEL 'IA()'
C                           NOTE: (2*XJA)+1 = STATISTICAL WEIGHT
C  OUTPUT: (R*8)  WA()    = ENERGY RELATIVE TO LEVEL 1 (CM-1) FOR LEVEL
C                           'IA()'
C
C  OUTPUT: (I*4)  NV      = INPUT DATA FILE: NUMBER OF GAMMA/TEMPERATURE
C                           PAIRS FOR A GIVEN TRANSITION.
C  OUTPUT: (R*8)  SCEF()  = INPUT DATA FILE: ELECTRON TEMPERATURES (K)
C                           (INITIALLY JUST THE MANTISSA. SEE 'ITPOW()')
C                           (NOTE: TE=TP=TH IS ASSUMED)
C
C  OUTPUT: (I*4)  ITRAN   = INPUT DATA FILE: NUMBER OF TRANSITIONS
C  OUTPUT: (I*4)  MAXLEV  = HIGHEST INDEX LEVEL IN READ TRANSITIONS
C
C  OUTPUT: (C*1)  TCODE() = TRANSITION: DATA TYPE POINTER:
C                           ' ' => Electron Impact   Transition
C                           'P' => Proton   Impact   Transition
C                           'H' => Charge   Exchange Recombination
C                           'R' => Free     Electron Recombination
C  OUTPUT: (I*4)  I1A()   = TRANSITION:
C                            LOWER ENERGY LEVEL INDEX (CASE ' ' & 'P')
C                            SIGNED PARENT      INDEX (CASE 'H' & 'R')
C  OUTPUT: (I*4)  I2A()   = TRANSITION:
C                            UPPER ENERGY LEVEL INDEX (CASE ' ' & 'P')
C                            CAPTURING    LEVEL INDEX (CASE 'H' & 'R')
C  OUTPUT: (R*8)  AVAL()  = TRANSITION:
C                            A-VALUE (SEC-1)          (CASE ' ')
C                            NEUTRAL BEAM ENERGY      (CASE 'H')
C                            NOT USED                 (CASE 'P' & 'R')
C  OUTPUT: (R*8)  SCOM(,) = TRANSITION:
C                            GAMMA VALUES             (CASE ' ' & 'P')
C                            RATE COEFFT. (CM3 SEC-1) (CASE 'H' & 'R')
C                           1ST DIMENSION - TEMPERATURE 'SCEF()'
C                           2ND DIMENSION - TRANSITION NUMBER
C
C          (I*4)  NVMAX   = PARAMETER = MAX. NUMBER OF TEMPERATURES
C                                       THAT CAN BE READ IN.
C          (I*4)  MTIED   = PARAMETER = MUST BE GREATER THAN OR EQUAL TO
C                                       THE MAX. NO. OF LEVELS.
C          (R*8)  DZERO   = PARAMETER = MINIMUM VALUE FOR 'AVAL()' AND
C                                       'SCOM()' ARRAYS = 1.0D-30
C
C          (I*4)  I4UNIT  = FUNCTION (SEE ROUTINE SECTION BELOW)
C          (I*4)  IQS     = X-SECT DATA FORMAT SELECTOR
C                           NOTE: IQS=3 ONLY ALLOWED IN THIS PROGRAM
C          (I*4)  I       = GENERAL USE.
C          (I*4)  IABT    = RETURN CODE FROM 'R8FCTN' (0 => NO ERROR)
C                           OR FROM INTERROGATION OF 'C7'
C          (I*4)  IFIRST  = BYTE POSITION OF START OF NUMBER IN BUFFER
C          (I*4)  ILAST   = BYTE POSITION OF END   OF NUMBER IN BUFFER
C          (I*4)  IWORD   = THE WORD POSITION OF THE REQUIRED DATA IN
C                           A STRING TO BE INTERROGATED BY XXWORD.
C          (I*4)  J       = GENERAL USE.
C          (I*4)  J1      = INPUT DATA FILE - SELECTED TRANSITION:
C                            LOWER ENERGY LEVEL INDEX (CASE ' ' & 'P')
C          (I*4)  J2      = INPUT DATA FILE - SELECTED TRANSITION:
C                            UPPER ENERGY LEVEL INDEX (CASE ' ' & 'P')
C                            CAPTURING    LEVEL INDEX (CASE 'H' & 'R')
C          (I*4)  LENCST  = BYTE LENGTH OF STRING CSTRGA()
C          (I*4)  NWORDS  = NUMBER OF NUMBERS STORED IN BUFFER
C          (I*4)  ILINE   = ENERGY LEVEL INDEX FOR CURRENT LINE
C          (I*4)  IAPOW   = EXPONENT OF 'AVALM'
C          (I*4)  IGPOW() = EXPONENT OF 'GAMMA()'
C          (I*4)  ITPOW() = TEMPERATURES - EXPONENT
C                           NOTE: MANTISSA INITIALLY KEPT IN 'SCEF()'
C
C          (R*4)  ZF      = SHOULD BE EQUIVALENT TO 'IZ1'
C
C          (R*8)  AVALM   = INPUT DATA FILE - SELECTED TRANSITION:
C                           MANTISSA OF:   ('IAPOW' => EXPONENT)
C                            A-VALUE (SEC-1)          (CASE ' ')
C                            NEUTRAL BEAM ENERGY      (CASE 'H')
C                            NOT USED                 (CASE 'P' & 'R')
C          (R*8)  GAMMA() = INPUT DATA FILE - SELECTED TRANSITION:
C                           MANTISSA OF: ('IGPOW()' => EXPONENT)
C                            GAMMA VALUES             (CASE ' ' & 'P')
C                            RATE COEFFT. (CM3 SEC-1) (CASE 'H' & 'R')
C                           DIMENSION => TEMPERATURE 'SCEF()'
C
C          (C*7)  C7      = USED TO PARSE VALUE FOR XJA()
C          (C*7)  CDELIM  = DELIMITERS FOR INPUT OF DATA FROM HEADERS
C          (C*18) C18     = USED TO PARSE VALUE TO CSTRGA()
C          (C*80) CLINE   = CURRENT ENERGY LEVEL INDEX PARAMETER LINE
C          (C*128)BUFFER  = GENERAL STRING BUFFER STORAGE
C          (C*3)  CITPOW()= USED TO PARSE VALUES TO ITPOW()
C          (C*5)  CSCEF() = USED TO PARSE VALUES TO SCEF()
C          (C*7)  CFORM7  = FORMAT FOR INTERNAL READING OF REAL NUMBER
C
C          (L*4)  LDATA   = IDENTIFIES  WHETHER  THE END OF AN  INPUT
C                           SECTION IN THE DATA SET HAS BEEN LOCATED.
C                           (.TRUE. => END OF SECTION REACHED)
C          (L*4)  LTCHR   = .TRUE.  => CURRENT 'TCODE()' = 'H' OR 'R'.
C                         = .FALSE. => CURRENT 'TCODE()'.NE.'H' OR 'R'.
C          (L*4)  LTCPR   = .TRUE.  => CURRENT 'TCODE()' = 'P' OR 'R'.
C                         = .FALSE. => CURRENT 'TCODE()'.NE.'P' OR 'R'.
C          (L*4)  LERROR  = .TRUE.  => UNTIED LEVEL FOUND
C                         = .FALSE. => ALL LEVELS TIED
C          (L*4)  LTIED() = .TRUE.  => SPECIFIED LEVEL TIED
C                         = .FALSE. => SPECIFIED LEVEL IS UNTIED
C                           DIMENSION => LEVEL INDEX
C
C ROUTINES:
C          ROUTINE    SOURCE    BRIEF DESCRIPTION
C          -------------------------------------------------------------
C          XXWORD     ADAS      EXTRACT POSITION OF NUMBER IN BUFFER
C          I4UNIT     ADAS      FETCH UNIT NUMBER FOR OUTPUT OF MESSAGES
C          R8FCTN     ADAS      CONVERTS FROM CHARACTER TO REAL VARIABLE
C
C NOTE:            LTCHR        LTCPR         TCODE()
C                 -----------------------------------
C                 .TRUE.       .TRUE.    =>     'R'
C                 .TRUE.       .FALSE.   =>     'H'
C                 .FALSE.      .TRUE.    =>     'P'
C                 .FALSE.      .FALSE.   =>     ' '
C
C        FOR A-VALUES & GAMMA-VALUES ENTRIES LESS THAN 'DZERO' ARE TAKEN
C        AS BEING EQUAL TO DZERO. THIS AFFECTS THE 'AVAL()' AND 'SCOM()'
C        ARRAYS.
C
C ROUTINES: NONE
C
C AUTHOR:  PAUL E. BRIDEN (TESSELLA SUPPORT SERVICES PLC)
C          K1/0/37
C          JET EXT. 5023
C
C DATE:    09/10/90
C
C UPDATE:  16/11/90 - LEVEL LINE READ AS A CHARACTER*80 STRING FIRST
C                     (PE BRIDEN)
C
C UPDATE:  01/05/92 - CHECK MADE TO MAKE SURE NO UNTIED LEVEL EXISTS.
C                     IF UNTIED LEVELS EXIST PROGRAM IS TERMINATED
C                     WITH A MESSAGE.
C                     (PE BRIDEN)
C
C UPDATE:  26/06/92 - INCREASED PARAMETER MTIED FROM 100 TO 200
C
C UPDATE:  30/07/92 - INPUT VARIABLE 'XJA' NOW ALLOWED TO HAVE A LENGTH
C                     OF BETWEEN 1 AND 6 STARTING AT COLUMN 30 - IT MUST
C                     BE FOLLOWED BY A ')' WHICH CANNOT BE PLACED AFTER
C                     COLUMN 36. INTRODUCED VARIABLE 'C7' TO PARSE VALUE
C                     AND USE FUNCTION R8FCTN TO INTERROGATE C7.
C                     - EDITED FORMAT STATEMENT 1003 ACCORDINGLY.
C                     - INTRODUCED FORMAT STATEMENT 1012.
C
C UPDATE:  23/04/93 - PE BRIDEN - ADAS91: ADDED I4UNIT FUNCTION TO WRITE
C                                         STATEMENTS FOR SCREEN MESSAGES
C
C UPDATE:  24/05/93 - PE BRIDEN - ADAS91: CHANGED I4UNIT(0)-> I4UNIT(-1)
C
C UPDATE:  20/05/93 - PE BRIDEN - ADAS91: MAJOR REVISION -
C                                         MODIFIED TO READ IN NEW INPUT
C                                         DATA-SET STYLE AND ALSO ALLOW
C                                         THE OLD-STYLE TO BE READ.
C                                         ARGUMENT DIMENSIONS CHANGED
C                                         BUT CODE ROUTINE SHOULD SPOT
C                                         CASES WHERE THE ORIGINAL
C                                         ARGUMENT DIMS ARE USED AND
C                                         ACT ACCORDINGLY.
C
C UPDATE:  05/08/93 - PE BRIDEN - ADAS91: MINOR REVISION -
C                                         IF DATA TYPE POINTER (TCODE())
C                                         EQUALS 'H' (Charge Exchange
C                                         Recomb.) or 'R' (Free Electron
C                                         Recomb.) - I1A()  now stores
C                                         the signed parent index(see
C                                         I1A() above)
C UNIX-IDL PORT:
C
C VERSION: 1.1                          DATE: 04-05-93
C MODIFIED: ANDREW BOWEN (TESSELLA SUPPORT SERVICES PLC)
C               - FIRST VERSION
C
C VERSION: 1.2                          DATE: 04-05-93
C MODIFIED: ANDREW BOWEN 
C               - ERROR WRIES CHANGED TO UNIT 0.
C
C VERSION: 1.3                          DATE: 21-03-95
C MODIFIED: LALIT JALOTA (TESSELLA SUPPORT SERVICES PLC)
C               - 
C
C VERSION: 1.4                          DATE: 23-03-95
C MODIFIED: LALIT JALOTA 
C               -
C
C VERSION: 1.5                          DATE: 02-04-96
C MODIFIED: TIM HAMMOND/PAUL BRIDEN (TESSELLA SUPPORT SERVICES PLC)
C               - INSTEAD OF USING FORMAT SPECIFIER F15.0 WHEN
C                 INTERNALLY READING A FLOATING POINT NUMBER,
C                 CREATE THE APPROPRIATE SPECIFIER WITHIN CFORM7 
C                 AND USE THIS.
C
C VERSION: 1.6				DATE: 24-06-97
C MODIFIED: HUGH SUMMERS
C               - CHANGED PARAMETER MTIED FROM 200 TO 300
C
C VERSION: 1.7				DATE: 26-02-97
C MODIFIED: M.O'MULLANE AND R. MARTIN	
C		    - CHANGED 'I2' TO 'I4' TO IN FORMAT STATEMENT 1011
C
C VERSION: 1.8				DATE: 20-09-99
C MODIFIED: R. MARTIN	
C		    - CHANGED 'I3' TO 'I4' TO IN FORMAT STATEMENT 1001
C
C VERSION: 1.9				DATE: 28-05-2003
C MODIFIED: Martin O'Mullane
C		    - Warn user that the routine is now deprecated
C                     and that xxdata_04 should be used instead.
C
C-----------------------------------------------------------------------
C-----------------------------------------------------------------------
      CHARACTER*(*)       CSTRGA(NDLEV)
      CHARACTER           TCODE(NDTRN)
      CHARACTER*3         TITLED
      INTEGER             I1A(NDTRN),  I2A(NDTRN),  IA(NDLEV),   IL
      INTEGER             ILA(NDLEV),  ISA(NDLEV),  ITRAN,       IUNIT
      INTEGER             IZ,          IZ0,         IZ1,         MAXLEV
      INTEGER             NDLEV,       NDTRN,       NV
      REAL*8              AVAL(NDTRN), BWNO,        SCEF(NVMAX)
      REAL*8              SCOM(NVMAX,NDTRN),        WA(NDLEV)
      REAL*8              XJA(NDLEV)
© Copyright 1995-2018 The ADAS Project
Comments and questions to: adas-at-adas.ac.uk