Search Site | Contact Details | FAQ

ADAS Subroutine d4data

      SUBROUTINE D4DATA( TITLE , DATE  , UIDIN  , USERID ,
     &                   ISWIT , NIND  , YEAR   , SELTAB , REPTAB ,
     &                   NDZ   , NDDEN , NDTIN  ,
     &                   IZ0   , IZ1   , NEL1   , IZ2    , NEL2   ,
     &                   T     , TL    , MAXT   ,
     &                   DENSA , DENSL , MAXD   ,
     &                   ATTY  , ARRAY , ZINTRP , DINTRP , TINTRP ,
     &                   DSNIN , DSNO  , OPEN17
     &                 )
C-----------------------------------------------------------------------
C
C  ****************** FORTRAN77 SUBROUTINE: D4DATA *********************
C
C  PURPOSE: TO OPEN/ACQUIRE DATA FROM STD.MASTER CONDENSED COLLISIONAL-
C           DIELECTRONIC   FILES,   OBTAIN  INTERPOLATED   COLLISIONAL-
C           DIELECTRONIC RECOMBINATION AND IONISATION COEFFICIENTS, AND
C           PREPARE ELEMENT MASTER FILE IF REQUIRED.
C
C  CALLING PROGRAM: ADAS404
C
C  DATA:
C
C       INPUT:
C       ------
C           THE  SOURCE  DATA IS CONTAINED AS  MEMBERS  OF  PARTITIONED
C           DATA SETS AS FOLLOWS:
C
C             1. JETUID.ACD<YR>.DATA
C             2. JETUID.SCD<YR>.DATA
C             3. JETUID.CCD<YR>.DATA
C             4. JETUID.PRB<YR>.DATA
C             5. JETUID.PRC<YR>.DATA
C             6. JETUID.PLT<YR>.DATA
C             7. JETUID.PLS<YR>.DATA
C
C           WHERE <YR> DENOTES TWO INTEGERS FOR THE YEAR SELECTED.
C           IF <YR> IS BLANK THEN THE CURRENT RECOMMENDED DATA SETS ARE
C           USED
C
C           'JETUID' IS GIVEN BY 'UIDIN'
C
C           THE PARTICULAR TYPE OPENED (1-7) IS SELECTED BY 'ISWIT'
C
C           THE MEMBERS OF THE PARTITIONED DATA SETS ARE  <SE>
C           WHERE <SE> IS THE ONE OR TWO LETTER ION SEQUENCE CODE
C
C           THIS PROGRAM ASSESSES ONLY STANDARD MASTER CONDENSED FILES.
C           -----------------------------------------------------------
C
C
C      OUTPUT:
C      -------
C           THE OUTPUT ELEMENT MASTER DATA IS IN SEQUENTIAL FILES AS
C           FOLLOWS:
C
C             1. JETUID.ACD<YR>#<EL>.DATA
C             2. JETUID.SCD<YR>#<EL>.DATA
C             3. JETUID.CCD<YR>#<EL>.DATA
C             4. JETUID.PRB<YR>#<EL>.DATA
C             5. JETUID.PRC<YR>#<EL>.DATA
C             6. JETUID.PLT<YR>#<EL>.DATA
C             7. JETUID.PLS<YR>#<EL>.DATA
C
C           WHERE <YR> IS AS ABOVE AND  <EL> IS THE ELEMENT SYMBOL
C
C           'JETUID' IS GIVEN BY 'USERID'
C
C  SUBROUTINE:
C
C  INPUT : (C*32) TITLE    = USER ENTERED PROGRAM RUN TITLE
C  INPUT : (C*8)  DATE     = CURRENT DATE (AS 'DD/MM/YY')
C  INPUT : (C*6)  UIDIN   = PROJECT UID FOR INPUT CONDENSED DATA FILE
C  INPUT : (C*6)  USERID  = USER ID FOR OUTPUT INC. ELEMENT MASTER FILE
C
C  INPUT : (I*4)  ISWIT    = DATA TYPE SELECTOR (SEE ABOVE) (1 -> 7)
C  INPUT : (I*4)  NIND     = NUMBER OF STAGES BEGINNING WITH LOWEST TO
C                            BE SKIPPED.   IT IS ASSUMED THAT DATA FOR
C                            THESE STAGES WILL BE SUPPLIED SEPARATELY.
C                            (DESIGNED FOR NEUTRAL STATE).
C  INPUT : (C*2)  YEAR     = REFERENCE  YEAR  (ABBREVIATED)  OF   INPUT
C                            MASTER CONDENSED COLL.-DIEL. COEFFTS. FILE.
C  INPUT : (L*4)  SELTAB  = .TRUE.  => PREPARE ELEMENT MASTER FILE
C                           .FALSE. => DO NOT PREPARE ELEM. MASTER FILE
C  INPUT : (L*4)  REPTAB  = .TRUE.  => REPLACE EXISTING ELEMENT MASTER
C                                      FILES.
C                         = .FALSE. => DO NOT REPLACE EXISTING ELEMENT
C                                      MASTER FILES.
C                           ('REPTAB' IS IGNORED IF 'SELTAB'=.FALSE.)
C
C  INPUT : (I*4)  NDZ      = NUMBER OF CHARGE STATES
C  INPUT : (I*4)  NDDEN    = MAXIMUM NUMBER OF INPUT DENSITIES
C  INPUT : (I*4)  NDTIN    = MAXIMUM NUMBER OF INPUT TEMPERATURES
C
C  INPUT : (I*4)  IZ0      = ELEMENT NUCLEAR CHARGE
C                                         (DETERMINES OUTPUT FILE NAME)
C  INPUT : (I*4)  IZ1      = MINIMUM ALLOWED IONIC CHARGE + 1
C                            (ACCORDING TO AVAILABLE NO. OF SEQUENCES
C                             STORED IN FILES FOR 'YEAR')
C  INPUT : (I*4)  NEL1     = NUMBER OF ELECTRONS IN STATE 'IZ1'
C  INPUT : (I*4)  IZ2      = MAXIMUM ALLOWED IONIC CHARGE + 1
C  INPUT : (I*4)  NEL2     = NUMBER OF ELECTRONS IN STATE 'IZ2'
C
C  INPUT : (R*8)  T()      = SET OF 'MAXT' ELECTRON TEMPERATURES: KELVIN
C  INPUT : (R*8)  TL()     = LOG10('T()')
C  INPUT : (I*4)  MAXT     = NUMBER OF TEMPERATURES (<= 'NDTIN' )
C
C  INPUT : (R*8)  DENSA()  = SET OF 'MAXD' ELECTRON DENSITIES: CM-3
C  INPUT : (R*8)  DENSL()  = LOG10 ('DENSA()')
C  INPUT : (I*4)  MAXD     = NUMBER OF DENSITIES (<= 'NDDEN' )
C
C  OUTPUT: (R*8)  ATTY(,) = WORKING SPACE FOR 3-WAY SPLINE ITERPOLATION
C                           ( STORES LOG10(INTERPOLATED VALUES) )
C                            1ST DIMENSION: TEMPERATURE
C                            2ND DIMENSION: DENSITY
C  OUTPUT: (R*8)  ARRAY(,,)= LOG10(INTERPOLATED DATA) FOR:
C                             1ST ARRAY DIMENSION - ION CHARGE/STAGE
C                             2ND ARRAY DIMENSION - TEMPERATURE
C                             3RD ARRAY DIMENSION - DENSITY
C  OUTPUT: (L*4)  ZINTRP() = .TRUE.  => 'ARRAY(,,)' VALUE FOR CHARGE-
C                                       STATE INTERPOLATED.
C                          = .FALSE. => 'ARRAY(,,)' VALUE FOR CHARGE-
C                                       STATE EXTRAPOLATED.
C                           1ST DIMENSION: CHARGE-STATE INDEX
C  OUTPUT: (L*4)  DINTRP(,)= .TRUE.  => 'ARRAY(,,)' VALUE FOR DENSITY
C                                       INDEX AND CHARGE INTERPOLATED.
C                          = .FALSE. => 'ARRAY(,,)' VALUE FOR DENSITY
C                                       INDEX AND CHARGE EXTRAPOLATED.
C                           1ST DIMENSION: DENSITY INDEX
C                           2ND DIMENSION: CHARGE-STATE INDEX
C  OUTPUT: (L*4)  TINTRP(,)= .TRUE.  =>'ARRAY(,,)' VALUE FOR TEMPERATURE
C                                      INDEX AND CHARGE INTERPOLATED.
C                          = .FALSE. =>'ARRAY(,,)' VALUE FOR TEMPERATURE
C                                      INDEX AND CHARGE EXTRAPOLATED.
C                           1ST DIMENSION: TEMPERATURE INDEX
C                           2ND DIMENSION: CHARGE-STATE INDEX
C  OUTPUT: (C*80) DSNO()  = OUPUT MASTER FILE NAME FOR EACH DATA TYPE
C
C  OUTPUT: (C*80) DSNIN(,)= INPUT FILE NAME FOR EACH DATA TYPE AND
C                           CHARGE
C
C          (I*4)  NKDIM   = PARAMETER =
C                           MAXIMUM  ARRAY  DIMENSIONS  FOR  CONDENSED
C                           MASTER FILE DATA FOR A GIVEN CHARGE STATE.
C          (I*4)  IUNT12  = PARAMETER = UNIT FOR READING DATA = 12
C
C          (R*8)  LOGMIN  = PARAMETER = MINIMUM LOG VALUE ALLOWED
C
C          (C*2)  XFESYM  = FUNCTION - (SEE ROUTINES SECTION BELOW)
C          (C*30) DSNAME  = INPUT MASTER CONDENSED FILE DATA SET NAME
C          (C*30) DSNOUT  = OUTPUT ELEMENT MASTER FILE DATA SET NAME
C          (C*2)  SEQUA   = ELEMENT SYMBOL FOR GIVEN NUCLEAR CHARGE
C          (C*3)  CDTYP() = INPUT MASTER CONDENSED FILE TYPE  USED  FOR
C                           CONSTRUCTING 'DSNAME'/'DSNOUT'. () = 'ISWIT'
C
C          (L*4)  LEXIST  = .TRUE.  => STANDARD MASTER CONDENSED FILE
C                                      EXISTS.
C                           .FALSE. => STANDARD MASTER CONDENSED FILE
C                                      DOES NOT EXIST.
C          (L*4)  LERROR  = .TRUE.  => ERROR FOUND IN READING STANDARD
C                                      MASTER CONDENSED FILE.
C                           .FALSE  =>NO ERROR FOUND IN READING STANDARD
C                                      MASTER CONDENSED FILE.
C          (L*4)  LSWIT   = .TRUE.  => SET OF 'EIA' VALUES PRESENT IN
C                                      MASTER CONDENSED FILE.
C                           .FALSE  => SET OF 'EIA' VALUES NOT PRESENT
C                                      IN MASTER CONDENSED FILE.
C
C          (I*4)  I4UNIT  = FUNCTION (SEE ROUTINE SECTION BELOW)
C          (I*4)  IZSTRT  = 'IZ1'
C          (I*4)  IZSTOP  = 'IZ2'
C          (I*4)  NZMAX   = 'NDZ'
C          (I*4)  NDMAX   = 'NDDEN'
C          (I*4)  NTMAX   = 'NDTIN'
C          (I*4)  ID      = ARRAY SUBSCRIPT USED FOR DENSITY VALUES
C          (I*4)  IS      = ARRAY SUBSCRIPT USED FOR SEQUENCE VALUES.
C                           REPRESENTS NUCLEAR CHARGE FOR ISO-ELECTRONIC
C                           SEQUENCE ELEMENT.
C                           (IMPLIES NUCLEAR CHARGE 'IS'-LIKE SEQUENCE)
C          (I*4)  IT      = ARRAY SUBSCRIPT USED FOR TEMPERATURE VALUES
C          (I*4)  IDE     = NUMBER OF REDUCED DENSITIES READ FROM INPUT
C                           MASTER CONDENSED FOR SEQUENCE 'IS'.
C          (I*4)  ITE     = NO. OF REDUCED TEMPERATURES READ FROM INPUT
C                           MASTER CONDENSED FOR SEQUENCE 'IS'.
C          (I*4)  IZE     = NO. OF CHARGE STATES GIVEN IN THE INPUT
C                           MASTER CONDENSED FOR SEQUENCE 'IS'.
C          (I*4)  IZF     = ELEMENT RECOMBINING ION CHARGE (IZ0+1-IS)
C          (I*4)  LS      = NON-BLANK LENGTH OF 'SEQUA'.
C          (I*4)  LD1     = VALUE  FOR  FIRST  DIMENSION OF 'ARRAY(,,)'
C                           (REPRESENTS STAGE/ION CHARGE)
C
C          (R*8)  ZIPT()  = SET OF 'IZE' INPUT RECOMBINING ION CHARGES
C                           READ FROM CONDENSED MASTER FILE.
C          (R*8)  TR()    = SET OF 'ITE'  INPUT  REDUCED  TEMPERATURES
C                           (K/Z1**2) READ FROM CONDENSED MASTER FILE.
C          (R*8)  DENSR() = SET OF 'IDE' INPUT REDUCED DENSITIES (CM-3/
C                           Z1**7) READ FROM CONDENSED MASTER FILE.
C          (R*8)  AIPT(,,)= CONDENSED MASTER FILE DATA. COLL-DIEL COEFF.
C                           1ST DIMENSION: REDUCED DENSITY ('DENSR()')
C                           2ND DIMENSION: REDUCED TEMPERATURE ('TR()')
C                           3RD DIMENSION: CHARGE STATE ('ZIPT()')
C          (R*8)  EIA()   = IONISATION RATE COEFFICIENTS: ()=ION CHARGE
C                           (UNITS: PRIOR TO 'XXCEIA' CALL: WAVE NUMBERS
C                                   AFTER CALL TO 'XXCEIA': RYDBERGS )
C NOTE:
C          STREAM HANDLING:
C                  STREAM 12 IS USED FOR READING CONDENSED MASTER FILES
C                  STREAM 13 IS USED FOR WRITING  ELEMENT  MASTER FILES
C
C          THIS SUBROUTINE IS A STRUCTURED AND AMENDED VERSION OF  THE
C          SUBROUTINE 'EIONST' WRITTEN BY H.P. SUMMERS, JET  (VERSION:
C          2 NOV 1989 / 1FEB 1990).
C
C ROUTINES:
C          ROUTINE    SOURCE    BRIEF DESCRIPTION
C          ------------------------------------------------------------
C          D4OUTF     ADAS      OUTPUT OF ELEMENT MASTER FILE
C          DXSPL1     ADAS      1ST PART OF 3-WAY SPLINE OF INPUT DATA
C          DXSPL2     ADAS      2ND PART OF 3-WAY SPLINE OF INPUT DATA
C          DXSPL3     ADAS      3RD PART OF 3-WAY SPLINE OF INPUT DATA
C          XXOPEN     ADAS      INQUIRE AND OPEN A DATA SET
C          XXINST     ADAS      FETCH   DATA   FROM   STANDARD  MASTER
C                               CONDENSED FILE.
C          XXCEIA     ADAS      CONVERT ION. RATE COEF. FROM WAVE NOS TO
C                               RYDBERGS AND EXTRAPOLATE MISSING VALUES
C          XFESYM     ADAS      CHARACTER*2 FUNCTION -
C                               FETCH ELEMENT SYMBOL FOR GIVEN NUCLEAR
C                               CHARGE
C          XXTERM     ADAS      TERMINATES PROGRAM WITH MESSAGE
C          I4UNIT     ADAS      FETCH UNIT NUMBER FOR OUTPUT OF MESSAGES
C
C
C AUTHOR:  PAUL E. BRIDEN (TESSELLA SUPPORT SERVICES PLC)
C          K1/0/81
C          JET EXT. 4569
C
C DATE:    08/10/90
C
C DATE:    26/10/90 - PE BRIDEN (JET/TESSELLA) - MINIMUM LOG10 VALUE
C                     ALLOWED WAS SET EQUAL TO 'LOGMIN'.  I.E. GIVES
C                     LOWER LIMIT FOR 'ARRAY(,,)'.
C
C UPDATE:  29/01/91 - PE BRIDEN - ADAS91 -INTRODUCED 'TINTRP' & 'DINTRP'
C                                        - AMENDED ARGUMENT LIST
C                                        - AMENDED ARGUMENT LISTS FOR
C                                          'D4SPL2' AND 'D4SPL3'.
C
C UPDATE:  30/01/91 - PE BRIDEN - ADAS91 -INTRODUCED 'ZINTRP'
C
C UPDATE:  13/02/91 - PE BRIDEN - ADAS91 - REPLACED XXESYM WITH XFESYM
C
C UPDATE:  21/02/91 - PE BRIDEN - ADAS91: INTRODUCED 'IZSTRT' , 'IZSTOP'
C                                 'NZMAX', 'NDMAX' AND 'NTMAX' TO  STOP
C                                 ICA MESSAGES BEING GENERATED.
C
C UPDATE:  05/03/91 - PE BRIDEN - ADAS91: ADDED CALL TO 'XXOPEN' BEFORE
C                                         AMENDED 'XXINST'.
C
C UPDATE:  20/03/91 - PE BRIDEN - ADAS91: MAJOR   CHANGES   TO   SPLINE
C                                         ROUTINES 'D4SPL?' -> 'DXSPL?'.
C                                         DENSA() ADDED TO ARGUMENT LIST
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 UNIX-IDL PORT:
C
C VERSION: 1.1				DATE: 11-11-96
C MODIFIED: WILLIAM OSBORN (TESSELLA SUPPORT SERVICES PLC)
C		- FIRST CONVERTED
C
C VERSION: 1.2				DATE: 20-11-96
C MODIFIED: WILLIAM OSBORN (TESSELLA SUPPORT SERVICES PLC)
C		- TIDIED OUTPUT
C
C VERSION: 1.3				DATE: 28-11-96
C MODIFIED: WILLIAM OSBORN (TESSELLA SUPPORT SERVICES PLC)
C		- CORRECTED DEFINITION OF OPEN17 TO LOGICAL TYPE
C
C-----------------------------------------------------------------------
C-----------------------------------------------------------------------
      CHARACTER*8         DATE
      CHARACTER*80        DSNIN(50,10),             DSNO(10)
      CHARACTER*32        TITLE
      CHARACTER*6         UIDIN,       USERID
      CHARACTER*2         YEAR
      INTEGER             ISWIT,       IZ0,         IZ1,         IZ2
      INTEGER             MAXD,        MAXT,        NDDEN,       NDTIN
      INTEGER             NDZ,         NEL1,        NEL2,        NIND
      LOGICAL             DINTRP(NDDEN,NDZ),        OPEN17,      REPTAB
      LOGICAL             SELTAB,      TINTRP(NDTIN,NDZ)
      LOGICAL             ZINTRP(NDZ)
      REAL*8              ARRAY(NDZ,NDTIN,NDDEN),   ATTY(NDTIN,NDDEN)
      REAL*8              DENSA(NDDEN),             DENSL(NDDEN)
      REAL*8              T(NDTIN),    TL(NDTIN)
© Copyright 1995-2018 The ADAS Project
Comments and questions to: adas-at-adas.ac.uk