Search Site | Contact Details | FAQ

ADAS Subroutine d2data

       SUBROUTINE D2DATA( DSFULL , TITLF  , IFAIL  , LRESO ,IPRT , IGRND
     &                  , IZ0    , IZ1    , ICLASS , ITMAX , IEVCUT
     &                  , ITDIMD , ITMAXD , IDMAXD , IZMAXD
     &                  , DTEV   , DDENS
     &                  , DTEVD  , DDENSD , DRCOFD , ZDATA
     &                  , DRCOFI , YEAR
     &                  )

C-----------------------------------------------------------------------
C
C PURPOSE : TO EXTRACT adf11 COLLISIONAL DIELECTRONIC DATA 
C
C NOTE    : THE SOURCE DATA IS CONTAINED IN CENTRAL (OR USER) ADAS
C           DATASETS AS:
C           /home/adas/adas/adf11/<typ><yr>/<typ><yr>_<el>.<fl>.dat 
C
C           where, <yr>  = nominal year of data
C                  <el>  = element name
C                  <typ> = type of data
C                  <fl>  = optional filter for power data
C           
C           The classes are
C              iclass = 1 : acd
C              iclass = 2 : scd
C              iclass = 3 : ccd
C              iclass = 4 : prb
C              iclass = 5 : prc
C              iclass = 6 : plt
C              iclass = 7 : pls
C
C
C           This routine was originally used to extract data for the SANCO
C           impurity transport code where filenames were constructed from
C           a userid, the year and a cutoff energy. The routine was 
C           rewritten so that the full adf11 filename was passed. Hence some
C           of the inputs are unecessary but are retained for backwards
C           compatibility in calling codes.    
C  
C INPUT  : (C*2)  YEAR      = YEAR OF DATA (not used)
C          (C*2)  YEARDF    = DEFAULT YEAR OF DATA IF REQUESTED YEAR
C                             DOES NOT EXIST
C          (I*4)  IZ0       = NUCLEAR CHARGE 
C          (I*4)  IZ1       = MINIMUM ION CHARGE + 1 (not used)
C          (I*4)  ICLASS    = CLASS OF DATA (1 - 6)
C          (I*4)  ITMAX     = NUMBER OF ( DTEV() , DDENS() ) PAIRS
C          (I*4)  IEVCUT    = ENERGY CUT-OFF (EV) (not used)
C          (R*8)  DTEV()    = DLOG10(ELECTRON TEMPERATURES (EV))
C          (R*8)  DDENS()   = DLOG10(ELECTRON DENSITIES (CM-3))
C          (I*4)  IPRT      = INDEX OF PARENT STATE
C          (I*4)  IGRND     = INDEX OF GROUND STATE
C          (L*4)  LRESO     = FLAG WHETHER RESOLVED DATA
C
C OUTPUT : (C*120)TITLF     = INFORMATION STRING
C          (I*4)  ITDIMD    = MAXIMUM NUMBER OF DATA TEMP & DENS
C          (I*4)  ITMAXD    = NUMBER OF DATA DTEVD()
C          (I*4)  IDMAXD    = NUMBER OF DATA DDENS()
C          (I*4)  IZMAXD    = NUMBER OF DATA ZDATA()
C          (I*4)  ITDIMD    = MAXIMUM NUMBER OF DATA TEMP & DENS
C          (I*4)  ZDATA()   = Z1 CHARGES IN DATASET
C          (I*4)  IFAIL     = -1   IF ROUTINE SUCCESSFUL BUT THE DEFAULT
C                                  YEAR FOR THE DATA WAS USED.
C                           = 0    IF ROUTINE SUCCESSFUL - DATA FOT THE
C                                  REQUESTED YEAR USED.
C                           = 1    IF ROUTINE OPEN STATEMENT FAILED
C          (R*8)  DTEVD()   = DLOG10(DATA ELECTRON TEMPERATURES (EV))
C          (R*8)  DDENSD()  = DLOG10(DATA ELECTRON DENSITIES (CM-3))
C          (R*8)  DRCOFD()  = DLOG10(DATA RATE COEFFICIENTS (CM-3/S))
C          (R*8)  DRCOFI()  = INTERPOLATION OF DRCOFD(,,) FOR
C                             DTEV() & DDENS()
C
C PROGRAM: (C*80) STRING    = GENERAL VARIABLE
C          (C*80) BLANK     = BLANK STRING
C          (C*2)  YEARSV    = LAST YEAR USED IN THIS ROUTINE
C          (I*4)  IREAD     = INPUT STREAM FOR OPEN STATEMENT
C          (I*4)  IZ0SV     = LAST IZ0 USED IN THIS ROUTINE
C          (I*4)  ICLSV     = LAST ICLASS USED IN THIS ROUTINE
C          (I*4)  INDXZ1    = LOCATION OF IZ1 IN ZDATA()
C          (I*4)  LCK       = MUST BE GREATER THAN 'ITMAXD' & 'IDMAXD'
C                             & 'ITMAX' - ARRAY SIZE FOR SPLINE CALCS.
C          (R*8)  A()       = GENERAL ARRAY
C          (R*8)  DRCOF0(,) = INTERPOLATION OF DRCOFD(,,) W.R.T DTEV()
C          (L*8)  LEXIST    = TRUE --- FILE TO OPEN EXISTS ELSE NOT
C
C PE BRIDEN = ADDED VARIABLES (14/01/91)
C
C          (I*4)  L1      = PARAMETER = 1
C          (I*4)  IOPT    = DEFINES THE BOUNDARY DERIVATIVES FOR THE
C                             SPLINE ROUTINE 'XXSPLE', SEE 'XXSPLE'.
C
C          (L*4)  LSETX   = .TRUE.  => SET UP SPLINE PARAMETERS RELATING
C                                      TO X-AXIS.
C                           .FALSE. => DO NOT SET UP SPLINE PARAMETERS
C                                      RELATING TO X-AXIS.
C                                      (I.E. THEY WERE SET IN A PREVIOUS
C                                            CALL )
C                           (VALUE SET TO .FALSE. BY 'XXSPLE')
C
C
C          (R*8)  DY()    = SPLINE INTERPOLATED DERIVATIVES
C
C          (R*8 ADAS FUNCTION - 'R8FUN1' ( X -> X) )
C
C PE BRIDEN = ADDED VARIABLES (23/04/93)
C
C          (I*4 ADAS FUNCTION - 'I4UNIT' (OUTPUT STREAM))
C
C AUTHOR : JAMES SPENCE (TESSELLA SUPPORT SERVICES PLC)
C          K1/0/80
C          JET  EXT. 4866
C
C DATE   : 22/02/90
C
C DATE   : 21/08/90 PE BRIDEN - REVISION: SEQUA(43) CHANGED ('TE'->'TC')
C
C DATE   : 08/10/90 PE BRIDEN - REVISION: RENAMED SUBROUTINE
C
C DATE   : 12/11/90 PE BRIDEN - CORRECTION: MOVE THE SETTING OF 'INDXZ1'
C                                           TO AFTER THE  '20 CONTINUE'
C                                           STATEMENT.   ALSO SAVE  THE
C                                           VALUE OF 'IZ1MIN'.
C
C DATE   : 14/01/91 PE BRIDEN - ADAS91:     CALLS TO NAG SPLINE ROUTINES
C                                           'E01BAF' & 'E02BBF' REPLACED
C                                           BY  CALLS   TO  ADAS  SPLINE
C                                           ROUTINE 'XXSPLE'.
C
C DATE   : 25/06/91 PE BRIDEN - CORRECTION: CHANGED FOLLOWING DIMENSION:
C                                            'DIMENSION DRCOFI(ITDIMD)'
C                                           TO
C                                            'DIMENSION DRCOFI(ITMAX)'
C
C DATE   : 07/08/91 PE BRIDEN - ADDED ERROR HANDLING IF THE OPEN STATE-
C                               MENT FAILS. (IFAIL=1 RETURNED)
C
C DATE   : 27/04/92 PE BRIDEN - ADDED DEFAULT YEAR FOR DATA IF REQUESTED
C                               YEAR DOES NOT EXIST. (ADDED 'YEARDF')
C                               INTRODUCED IFAIL = -1 IF DEFAULT YEAR
C                               WAS USED AND NOT THE REQUESTED YEAR.
C
C DATE   : 10/03/93 PE BRIDEN - ALLOWED INPUT DATA SETS TO BE ACCESSED
C                               FROM ANY USERID (DEFAULT = JETSHP)
C                               - INTRODUCED USERID VARIABLE AND CALL
C                                 TO XXUID.
C
C DATE   : 23/04/93 PE BRIDEN - 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:  14/09/94 - PE BRIDEN - ADAS91: ADDED CHECK TO MAKE SURE THAT
C                                         ITMAX, ITMAXD AND IDMAXD ARE
C                                         IN RANGE (I.E. <= LCK).
C
C UPDATE:  16/08/96 - PE BRIDEN - ADAS91: MINOR MOD - IF DEFAULT DATA
C                                         IS NOT FOUND THEN ASSIGN TITLF
C                                         BEFORE EXITING WITH AN ERROR.
C
C-----------------------------------------------------------------------
C
C UNIX-IDL PORT:
C
C VERSION: 1.1				DATE: 28-10-96
C MODIFIED: WILLIAM OSBORN (TESSELLA SUPPORT SERVICES PLC)
C		- FIRST CONVERTED
C
C VERSION: 1.2				DATE: 14-02-97
C MODIFIED: RICHARD MARTIN
C		- CHANGED DEFINITION OF 'BLANKS' TO 80 CHARACTERS ONLY
C
C VERSION: 1.3				DATE: 26-10-97
C MODIFIED: LORNE HORTON (JET)
C		- CHANGED EXTRAPOLATION ALGORITHM
C
C VERSION: 1.4				DATE: 23-07-99
C MODIFIED: Martin O'Mullane (JET)
C		- Changed the test for checking whether the file was opened.
C               - Removed commented out code for constructing filenames
C               - Modified the comments at the top of the file
C               - Converted code to implicit none
C               - Increased LCK to 200
C-----------------------------------------------------------------------
C-----------------------------------------------------------------------

C-----------------------------------------------------------------------
      CHARACTER*80        DSFULL
      CHARACTER*120       TITLF
      CHARACTER*2         YEAR
      INTEGER             ICLASS,      IDMAXD,      IEVCUT,      IFAIL
      INTEGER             IGRND,       IPRT,        ITDIMD,      ITMAX
      INTEGER             ITMAXD,      IZ0,         IZ1,         IZMAXD
      LOGICAL             LRESO
      REAL*8              DDENS(ITMAX),             DDENSD(ITDIMD)
      REAL*8              DRCOFD(ITDIMD,ITDIMD,ITDIMD)
      REAL*8              DRCOFI(ITMAX),            DTEV(ITMAX)
      REAL*8              DTEVD(ITDIMD),            ZDATA(ITDIMD)
© Copyright 1995-2024 The ADAS Project
Comments and questions to: adas-at-adas.ac.uk