Search Site | Contact Details | FAQ

ADAS Subroutine b4datd

       SUBROUTINE B4DATD ( XRMEMB    , NPMNCL , IMAXX  ,
     &                     NREPX     , MAXTM  , TEM    ,
     &                     NDBFILM   , NBFIL  , NCUTMC ,
     &                     AUGM      , DRM    , DRMSF  ,
     &                     PWSAT     , DSNXRT , OPEN17 ,
     &                     dsnin     , adas_c , adas_u
     &                   )
C-----------------------------------------------------------------------
C
C  ************** FORTRAN77 SUBROUTINE: B4DATD  ************************
C
C  VERSION:  1.1
C
C  PURPOSE:  PROCESS  DIELECTRONIC DATA FILES TO PREPARE
C            DIELECTRONIC AND AUGER DATA FOR ADAS204
C
C            THE DR FILE LAYOUT IS SPECIFIED BY THE ADF09 FORMAT
C
C  DATA:     THE SOURCE DATA IS ACCESSED THROUGH A CROSS-REFERENCE FILE
C                 /../adas/adf18/a09_p204/<ion>n.dat
C            WHERE <ION> DENOTES THE RECOMBINED ION (EG. C4)
C
C            THE PARENT CROSS-REFERENCING IS BASED ON THE ADAS204
C            DRIVING INPUT DATA FILE SPECIFIED BY THE ADF25 FORMAT
C                 /../adas/adf25/bns<yr>#<seq>/bns<yr>#<seq>_<code>.dat
C            WHERE <yr>   IS A TWO DIGIT YEAR NUMBER
C                  <seq>  IS THE ISO=ELECTRONIC SEQUENCE SYMBOL
C                  <code> IS AN ION CODE (eg. c4) OR ELEMENT CODE
C                         (EG. c ) IF A NUMBER OF IONS OF THE
C                         ISO-ELECTRONIC SEQUENCE ARE STACKED
C                         SEQUENTIALLY.
C
C            THE FILE NAMES ARE ANALYSED BY ADAS204 AND WARNINGS ISSUED
C            IF APPROPRIATE.  THESE WARNINGS ARE NOT NECESSARILY FATAL.
C            FOR EXAMPLE, THE ADF18 FILE CONTAINS THE NAME OF ITS
C            EXPECTED DRIVING ADF25 FILE.  THESE DIFFER IF THE ADF25
C            FILE IS DRIVING A COMPLETE ISO-ELECTRONIC SEQUENCE CALC.
C            RATHER THAN JUST A SINGLE ION CASE.
C
C
C  INPUT:  (C*8)  XRMEMB  = CROSS-REFERENCE PARTITIONED DATA SET MEMBER
C          (I*4)  IMAXX   = NUMBER OF REPRESENTATIVE LEVELS IN THE
C                               EXTENDED SET REQUIRED FOR THE MAIN CODE
C          (I*4)  NREPX() = REPRESENTATIVE N-SHELLS FOR THE MAIN CODE
C          (I*4)  NPMNCL  = NUMBER OF PARENTS INCLUDED IN THE MAIN CODE
C                               ( GIVEN BY THE <INMEMB> FILE )
C          (I*4)  MAXTM   = NUMBER OF TEMPERATURES USED IN MAIN CODE
C          (R*8)  TEM()   = TEMPERATURES (K) USED IN THE MAIN CODE
C          (I*4)  NDBFILM = PARAMETER = MAXIMUM NUMBER OF DR FILES
C                                       MUST BE GREATER THAN NDBFIL
C          (C*120)DSNXRT  = FIRST PART OF CROSS REFERENCE FILE NAME
C	     (L)    OPEN17  = .FALSE. -OUTPUT TO UNIT=17 SWITCHED OFF.
C
C  OUTPUT: (I*4)  NCUTMC(,) = N-SHELL CUT FOR AUGER RATES (AUGER CHANNEL
C                             OPENS AT NCUTMC+1)
C                                1ST. INDEX = INITIAL PARENT
C                                2ND. INDEX = FINAL PARENT
C          (R*8)  AUGM(,,,) = AUGER RATES (SEC-1)
C                                1ST INDEX =  REPRESENTATIVE LEVEL
C                                2ND INDEX =  INITIAL PARENT
C                                3RD INDEX =  INITIAL SPIN SYSTEM
C                                4TH INDEX =  FINAL PARENT
C          (R*8)  DRM(,,,,) = DIELECTRONIC RATE COEFFTS. (CM3 SEC-1)
C                                1ST INDEX =  REPRESENTATIVE LEVEL
C                                2ND INDEX =  TEMPERATURE
C                                3RD INDEX =  INITIAL PARENT
C                                4TH INDEX =  INITIAL SPIN SYSTEM
C                                5TH INDEX =  FINAL PARENT
C          (I*4)  NBFIL     = NUMBER OF DR FILES
C
C  PROGRAM:(I*4)  NDREP   = PARAMETER = MAXIMUM NUMBER OF
C                                       REPRESENTATIVE LEVELS
C          (I*4)  NDPRT   = PARAMETER = MAXIMUM NUMBER OF PARENTS
C          (I*4)  NDSYS   = PARAMETER = MAXIMUM NUMBER OF SPIN SYSTEMS
C          (I*4)  NDT     = PARAMETER = MAXIMUM NUMBER OF TEMPERATURES
C          (I*4)  NDBFIL  = PARAMETER = MAXIMUM NUMBER OF DR FILES
C          (I*4)  NDPAIR  = PARAMETER = MAXIMUM NUMBER OF AUGER RATE
C                                       PARENT PAIRS
C          (I*4)  NDREP   = PARAMETER = MAXIMUM NUMBER OF MAIN CODE
C                                       REPRESENTATIVE LEVELS
C          (I*4)  NDBREP  = PARAMETER = MAXIMUM NUMBER OF DR
C                                       REPRESENTATIVE LEVELS
C
C          (C*1)  CHARS1  = ONE CHARACTER
C          (C*4)  CHARS4  = FOUR CHARACTERS
C          (C*120)DSNBD() = DR DIELECTRONIC DATA FILE MEMBER NAMES
C          (C*30) BPDS    = DR PARENT STATE DESCRIPTOR
C          (C*30) BPDSC() = DR PARENT STATE DESCRIPTOR ARRAY
C          (C*120)DSNMC   = MAINCL CODE INPUT FILE MEMBER NAME
C          (C*120)DSNMCO  = MAINCL CODE OUTPUT FILE MEMBER NAME
C          (C*120)DSN     = CHARACTER FILE NAME WORKSPACE
C          (C*120)DSHORT  = CURRENT FILE NAME WITH SYMBOLIC NAMES
C          (C*8)  MEMBER  = FILE MEMBER NAME WORKSPACE
C          (C*80) STRING  = LINE OUT STRING
C          (C*133)LSTRNG  = LINE IN STRING
C          (C*89) LSTRGO  = LONG LINE OUT STRING
C          (L*4)  OPEN12  = 'TRUE' IF OPEN
C          (L*4)  OPEN13  = 'TRUE' IF OPEN
C          (L*4)  OPEN14  = 'TRUE' IF OPEN
C          (L*4)  LEXIST  = 'TRUE' IF FILE EXISTS
C          (L*4)  LSJ     = 'TRUE' IF FILE EXISTS
C          (L*4)  LSETX   = 'TRUE' IF SPLINE UNINITIATED
C
C          (I*4)  I         = RUNNING INDEX
C          (I*4)  IBDPA()   = PARENT INDEX IN THE COMPLETE DR LIST
C          (I*4)  IBFIL     = RUNNING INDEX FOR DR FILES
C          (I*4)  IBREP     = RUNNING REPRESENTATIVE SHELL INDEX
C          (I*4)  IBMAX()   = NUMBER OF DR REPRESENTATIVE LEVELS
C                                 1ST. INDEX = DR FILE INDEX
C          (I*4)  IBPR      = CURRENT PARENT READ FROM DR FILE
C          (I*4)  IBPRIA(,) = INITIAL PARENT INDEX FROM LIST FOR A FILE
C                                 1ST. INDEX = LEVEL INDEX
C                                 2ND. INDEX = DR FILE INDEX
C          (I*4)  IBPRFA(,) = FINAL   PARENT INDEX FROM LIST FOR A FILE
C                                 1ST. INDEX = LEVEL INDEX
C                                 2ND. INDEX = DR FILE INDEX
C          (I*4)  IBREP     = RUNNING INDEX FOR REPRESENTATIVE LEVELS
C          (I*4)  IC        = COUNTER OF N-SHELLS BELOW AUGER CUT
C          (I*4)  IF        = RUNNING INDEX ON TOTAL PARENT LIST
C          (I*4)  II        = RUNNING INDEX ON TOTAL PARENT LIST
C          (I*4)  IMNPA()   = PARENT INDEX CORRESPONDING TO MAIN CODE
C          (I*4)  IND       = CHARACTER INDEX POSITION MARKER ON STRING
C          (I*4)  IOPT      =  SPLINE END CONDITION OPTION (SET =-1)
C          (I*4)  IP        = RUNNING INDEX ON TOTAL PARENT COUNT FROM
C                             DR FILES
C          (I*4)  IPI       = INITIAL PARENT OF SUPPL. AUGERING STATE
C          (I*4)  IPF       = FINAL PARENT AFTER SUPPL. AUGER
C          (I*4)  ISYSI     = INITIAL SPIN INDX. OF SUPPL.AUGERING STATE
C          (I*4)  IS        = RUNNING INDEX
C          (I*4)  ISREP     = SUPPLEMENTARY REPRESENTATIVE LEVEL INDEX
C          (I*4)  ISUPPLE   = NUMBER OF SUPPLE. AUGER RATES
C          (I*4)  IPAIRS    = RUNNING INDEX FOR AUGER RATE PARENT PAIRS
C          (I*4)  IPARM1    = DR FILE PARAMETER - PRTI
C          (I*4)  IPARM2    = DR FILE PARAMETER - TRMPRT
C          (I*4)  IPARM3    = DR FILE PARAMETER - SPNPRT
C          (I*4)  IPARM4    = DR FILE PARAMETER - PRTF
C          (I*4)  IPARM5    = DR FILE PARAMETER - TRMPRT
C          (I*4)  IPARM6    = DR FILE PARAMETER - SPNPRT
C          (I*4)  IPARM7    = DR FILE PARAMETER - NSYS
C          (I*4)  IPARM8    = DR FILE PARAMETER - SYS
C          (I*4)  IPARM9    = DR FILE PARAMETER - SPNSYS
C          (I*4)  IPRT      = RUNNING INDEX FOR PARENTS
C          (I*4)  IPT       = RUNNING INDEX ON TOTAL PARENT COUNT FROM
C                             DR FILES
C          (I*4)  IR        = UNSPECIFIED LINE COUNTER
C          (I*4)  IREAD     = FLAG FOR READ OPTION
C          (I*4)  IREFI()   = INITIAL PARENT FOR AUGER RATE IN FULL LIST
C          (I*4)  IREFF()   = FINAL PARENT FOR AUGER RATE IN FULL LIST
C          (I*4)  IREP      = MAIN CODE REPRESENTATIVE LEVEL COUNTER
C          (I*4)  IRFF      = POINTER TO FINAL PARENT IN FULL LIST
C          (I*4)  IRFI      = POINTER TO INITIAL PARENT IN FULL LIST
C          (I*4)  IS        = SPIN SYSTEM INDEX
C          (I*4)  ISET(,,)   = FLAG FOR INPUT OF SUPP. AUGER DATA
C                                       ISET = 0  NO SUPP. DATA
C                                       ISET = 1  SUPP. DATA
C                                       1ST INDEX - IPRT
C                                       2ND INDEX - ISYS
C                                       3RD INDEX - JPRT
C          (I*4)  ISPF      = FINAL PARENT SPIN FOR AUGER RATE
C          (I*4)  ISPFA(,)  = FINAL PARENT SPIN FOR AUGER RATE
C                                 1ST. INDEX = AUGER PARENT PAIR
C                                 2ND. INDEX = DR FILE INDEX
C          (I*4)  ISPI      = INITIAL PARENT SPIN FOR AUGER RATE
C          (I*4)  ISPIA(,)  = FINAL PARENT SPIN FOR AUGER RATE
C                                 1ST. INDEX = AUGER PARENT PAIR
C                                 2ND. INDEX = DR FILE INDEX
C          (I*4)  IST1    = PARAMETER = MAIN OUTPUT STREAM
C          (I*4)  ISYS      = RUNNING INDEX FOR SPIN SYSTEMS
C          (I*4)  IT        = RUNNING INDEX FOR TEMPERATURES
C          (I*4)  JPRT      = RUNNING INDEX FOR PARENTS
C          (I*4)  LEN1      = FIRST NON-BLANK CHARACTER IN MEMBER NAME
C          (I*4)  LEN2      = LAST NON-BLANK CHARACTER IN MEMBER NAME
C          (I*4)  MP()      = INITIAL PARENT INDEX FOR AUGER RATE
C          (I*4)  MPA()     = FINAL PARENT INDEX FOR AUGER RATE
C          (I*4)  NBCUT(,)  = N-SHELL CUT FOR AUGER RATES (AUGER CHANNEL
C                             OPENS AT NBCUT+1)
C                                 1ST. INDEX = AUGER PARENT PAIR
C                                 2ND. INDEX = DR FILE INDEX
C          (I*4)  NBFIL     = NUMBER OF DR FILES TO BE INCLUDED
C          (I*4)  NBREP(,)  = DR REPRESENTATIVE LEVEL N -VALUE
C                                 1ST. INDEX = LEVEL INDEX
C                                 2ND. INDEX = DR FILE INDEX
C          (I*4)  NBT       = NUMBER OF DR TEMPERATURES
C          (I*4)  NCUTS     = FIRST OPENING NSHELL FOR SUPPL. AUGER
C          (I*4)  NDAUG     = PARAMETER = MAXIMUM N-SHELL OF SPECIFIC
C                                       AUGER DATA
C          (I*4)  NPAIRS    = NUMBER OF AUGER RATE PARENT PAIRS
C          (I*4)  NPRNT     =
C          (I*4)  NPRNTF()  = NUMBER OF FINAL DR PARENTS FOR FILE
C          (I*4)  NPRNTI()  = NUMBER OF INITIAL DR PARENTS FOR FILE
C          (I*4)  NPTOT     = TOTAL NUMBER OF PARENTS ACCUMULATED FROM
C          (I*4)  NREP      = VALUE OF REPRESENTATIVE N-SHELL NREPX(IREP)
C                             DR FILES
C          (I*4)  NSREP()   = SUPPLEMENTARY AUGER REPRESENT. N-SHELLS
C          (I*4)  NTOP      = MARKS DRM ARRAY ZERO FOR N>NTOP
C
C          (R*8)  AA()      = SET OF AUGER RATES ON A LINE
C          (R*8)  AAS       = SUPPL. AUGER COEFFT. AT NCUTS (SEC-1)
C          (R*8)  AUGTMP(N)  = TEMPORARY STORE OF SUPP. AUGER RATES
C                                       1ST INDEX - N-SHELL VALUE
C          (R*8)  DDRROUT() = SCALED DIELECTRONIC DATA FOR SPLINE IN N
C          (R*8)  DELTAE    = SATELLITE ENERGY LEVEL ( K)
C          (R*8)  DRRIN()   = SCALED DIELECTRONIC DATA FOR SPLINE IN N
C          (R*8)  DRMSF(,,,,)  SUMMED DR COEFFICIENT
C                                       1ST INDEX - FILE
C                                       2ND INDEX - TEMPERATURE
C                                       3RD INDEX - INITIAL PARENT
C                                       4TH INDEX - SPIN SYSTEM
C                                       5TH INDEX - FINAL PARENT
C          (R*8)  DRMS()       TEMPORARY STORE OF SUMMED DR RATES
C                                       1ST INDEX - TEMPERATURE
C          (R*8)  DRMF(,)      TEMPORARY STORE OF DR RATES FOR NBREP
C                                       1ST INDEX - REPRESENTATIVE LEVEL
C                                       2ND INDEX - TEMPERATURE
C          (R*8)  DTMP()    = TEMPORARY STORE OF DIEL. COEFFICIENTS
C          (R*8)  DRROUT()  = SCALED DIELECTRONIC DATA FOR SPLINE IN N
C          (R*8)  DY()      = WORK VECTOR FOR SPLINE
C          (R*8)  SLOPE     = N POWER FOR SUPPL. AUGER RATE ABOVE NCUTS
C          (R*8)  SYSFAC(,) = SPIN SYSTEM RESOLUTION OF AUGER RATES
C                                 1ST. INDEX = AUGER RATE INDEX ON LINE
C                                 2ND. INDEX = SPIN SYSTEM
C          (R*8)  TEB()     = DR TEMPERATURES (K)
C          (R*8)  XIN()     = WORK VECTOR FOR SPLINES
C          (R*8)  XOUT()    = WORK VECTOR FOR SPLINE
C          (R*8)  XNBREP()  = DR REPRES. LEVEL N -VALUE AS A REAL
C                                 1ST. INDEX = LEVEL INDEX
C          (R*8)  XNREPX()  = REPRES. LEVEL N-VALUE FROM MAIN CODE AS A
C                                  REAL
C          (R*8)  YIN()     = WORK VECTOR FOR SPLINES
C          (R*8)  YOUT()    = WORK VECTOR FOR SPLINE
C
C
C          (R*8)  XNREP    = REAL VARIABLE FORM OF NREP
C
C          (R*8)  XICENH   = IC ENHANCEMENT FACTOR FOR SPECIFIC
C                            N-SHELL
C
C
C  ROUTINES:
C          ROUTINE    SOURCE    BRIEF DESCRIPTION
C          -------------------------------------------------------------
C           B4FLNM      ADAS    EXPAND FILENAME SYMBOLIC PART IF PRESENT
C           B4SUMD      ADAS    SUMS DR COEFFICIENTS OVER ALL N-SHELLS
C           FINTB       HPS     CONVERTS X-VALUES FOR N SHELL SPINE
C           XXSLEN      ADAS    FINDS LENGTH OF NON-BLANK PART OF STRINGS
C           XXSPLN      ADAS    GENERAL CUBIC SPLINE
C
C
C  AUTHOR:  HUGH P. SUMMERS, JET
C           K1/1/57
C           JET EXT. 4941
C
C  DATE:    12/05/92
C
C  UPDATE:  04/06/92,  WILLIAM J. DICKSON , JET
C           ADJUSTED FORMAT STATEMENTS FROM ORIGINAL SPEC.
C           TO READ DR FILES WITH CHARACTERS SHIFTED ONE
C           SPACE TO THE LEFT.
C           DEFINED OUTPUT STREAM BY PARAMETER IST1
C
C  UPDATE:  07/92,  WILLIAM J. DICKSON , JET
C           DEFINE VALUE OF LSETX AT BEGINNING OF CODE
C
C  UPDATE:  27/08/92,  WILLIAM J. DICKSON , JET
C           (1)  ALLOW FOR SPECIFIC DATA FOR LOWEST N-SHELLS WHEN
C           INPUTING SUPPLEMENTARY AUGER TRANSITION PROBABILITIES
C           (2)  DEFINE VARIABLE ISET TO MARK SUPPLEMENTARY DATA INPUT
C
C  UPDATE:  06/09/92,  WILLIAM J. DICKSON , JET
C           XREF FILES NOW STORED UNDER JETXLE
C
C  UPDATE:  14/12/92,  WILLIAM J. DICKSON , JET
C           SET UP ROUTINE TO SUM DR COEFFICIENTS OVER
C           REPRESENTATIVE SET
C  UPDATE:  13/11/93,  WILLIAM J. DICKSON , JET
C           (1)  ALLOW FOR IC ENHANCEMENT FACTOR TO BE READ IN AS PART
C                FILE AND SUBSEQUENT ADJUSTMENT OF DR RATE COEFFICIENT
C                  CHECK CODING AROUND FORMAT STATEMENT 1036.
C                  (NOTE THAT 1037 WAS ADDED AT THIS STAGE)
C
C  UPDATE:  29/05/96  HP SUMMERS - COMPLETED UNIX FILE NAME PROCUREMENT
C                                  WITH ENVIRONMENT VARIABLE SYMBOL
C                                  SUBSTITUTION USING B4FLNM
C  UPDATE:  22/01/97  HP SUMMERS - CHANGED NAME TO B4DATD FROM BDMNCL1
C                                  AND SUBROUTINE BDDRSM2 TO B4SUMD
C  UPDATE:  11/02/97  HP SUMMERS - IMPROVED INTERPOLATION OF SUPPLE.
C                                  AUGER DATA FROM X-REF FILE.
C  UPDATE:  17/02/97  HP SUMMERS - IMPROVED INTERPOLATION OF DR. DATA
C                                  WITH N, TO ENSURE ABSOLUTE ZEROS
C                                  ABOVE CUT-OFF N-SHELL
C-----------------------------------------------------------------------
C
C UNIX-IDL CONVERSION:
C
C VERSION: 1.1					DATE: 05-03-98
C MODIFIED: H. SUMMERS
C		    - MODIFIED VESION OF BDMNCL1.FOR v 1.1
C
C VERSION: 1.2 					DATE: 26-11-98  
C MODIFIED: Martin O'Mullane 
C                   - redefine DSNXRT as the full DR supplement file
C                     name. It is now given in the adf25 dataset and
C                     passed through to here.
C
C VERSION: 1.3 					DATE: 22-09-2000  
C MODIFIED: Martin O'Mullane 
C                   - Initialize ibmax to 0 to avoid troubles in the 
C                     H-like case where we have no DR.
C
C-----------------------------------------------------------------------
C-----------------------------------------------------------------------
      CHARACTER*80        ADAS_C,      ADAS_U
      CHARACTER*120       DSNIN,       DSNXRT
      CHARACTER*8         XRMEMB
      INTEGER             IMAXX,       MAXTM,       NBFIL
      INTEGER             NCUTMC(NDPRT,NDPRT),      NDBFILM,     NPMNCL
      INTEGER             NREPX(NDREP)
      LOGICAL             OPEN17
      REAL*8              AUGM(NDREP,NDPRT,NDSYS,NDPRT)
      REAL*8              DRM(NDREP,NDT,NDPRT,NDSYS,NDPRT)
      REAL*8              DRMSF(NDBFILM,NDT,NDPRT,NDSYS,NDPRT)
      REAL*8              PWSAT(NDBFILM,NDT,NDPRT,NDSYS,NDPRT)
      REAL*8              TEM(NDT)
© Copyright 1995-2024 The ADAS Project
Comments and questions to: adas-at-adas.ac.uk