ADAS Subroutine e2file
SUBROUTINE E2FILE( IUNIT , IZ0 , IRCODE , DSNAME ) C----------------------------------------------------------------------- C C ****************** FORTRAN77 SUBROUTINE: E2FILE ********************* C C PURPOSE: TO OPEN AN IONIZATION RATE-COEFFT 'IONELEC' DATA SET C BY DEFAULT, OR AN ALTERNATIVE DATA SET IF REQUIRED, FOR C IONIZING ION WITH NUCLEAR CHARGE 'IZ0' C THIS WILL BE CONNECTED TO UNIT 'IUNIT'. C C DATA SET OPENED: $ADASUSER/<DEFADF>/<GROUP>(OPTIONAL)/<TYPE>/ C <GROUP_EXT>#<ELEMENT SYMBOL>' C C CALLING PROGRAM: SSZD C C SUBROUTINE: C C INPUT : (I*4) IUNIT = UNIT TO WHICH DATA SET WILL BE CONNECTED C INPUT : (I*4) IZ0 = NUCLEAR CHARGE OF EMITTING ION REQUESTED C C OUTPUT: (I*4) IRCODE = RETURN CODE FROM SUBROUTINE: C 0 => DATA SET SUCCESSFULLY CONNECTED C 1 => REQUESTED DATA SET MEMBER DOES NOT C EXISTS - DATA SET NOT CONNECTED. C 9 => REQUESTED DATA SET EXISTS BUT CANNOT C BE OPENED. C OUTPUT: (C*80) DSNAME = NAME OF OPENED DATA SET UNDER UNIX C C (I*4) IDLEN = LENGTH, IN BYTES, OF FIXED 'DSNAME' PREFIX C (I*4) LENF1 = FIRST NON-BLANK CHR OF 'DSNAME' GROUP PART C (I*4) LENF2 = LAST NON-BLANK CHR OF 'DSNAME' GROUP PART C (I*4) LENF3 = FIRST NON-BLANK CHR OF 'DSNAME' TYPE PART C (I*4) LENF4 = LAST NON-BLANK CHR OF 'DSNAME' TYPE PART C (I*4) LENF5 = LAST NON-BLANK CHR OF 'DSNAME' USERID PART C (I*4) LENF6 = LAST NON-BLANK CHR OF 'DSNAME' USERID PART C (I*4) LENF7 = LAST NON-BLANK CHR OF 'DSNAME' EXTENSION PART C (I*4) LENF8 = LAST NON-BLANK CHR OF 'DSNAME' EXTENSION PART CA (C*1) HASH = '#' IF NON-BLANK EXT, ELSE ' '. C (C*2) XFESYM = FUNCTION - (SEE ROUTINES SECTION BELOW) C (C*2) ESYM = ELEMENT SYMBOL FOR NUCLEAR CHARGE 'IZ0' C (C*3) USREXT = ADAS SOURCE DATA FILE EXTENSION CA (C*80) USERID = ADAS SOURCE DATA USER ID C (C*8) USRGRP = ADAS SOURCE DATA GROUPNAME CA (C*80) USRTYP = ADAS SOURCE DATA TYPENAME C (C*5) DEFADF = DEFAULT DATA DIRECTORY, I.E. ADF13 C C (L*4) LEXIST = .TRUE. => REQUESTED DATA SET EXISTS. C .FALSE. => REQUESTED DATA SET DOES NOT C EXIST. C C ROUTINES: C ROUTINE SOURCE BRIEF DESCRIPTION C ------------------------------------------------------------ C XXUID ADAS FETCHES/SETS ADAS SOURCE DATA USER ID C XXSSZD ADAS FETCHES/SETS ADAS SOURCE DATA FILENAME C AND FILE EXTENSION C XFESYM ADAS CHARACTER*2 FUNCTION - C GATHERS ELEMENT SYMBOL FOR NUC. CHARGE C XXSLEN ADAS FINDS FIRST AND LAST NON-BLANK C CHARACTERS IN STRING. C C AUTHOR: H.P. SUMMERS C K1/1/57 C JET EXT. 4941 C DATE: 11/10/91 C C UPDATE: 10/03/93 - PE BRIDEN: ADDED CALL TO XXUID AND USERID VARIABLE C - NOW ALLOWS ANY INPUT DATASET USER ID. C UPDATE: 2/09/93 - HPS : ADDED CALL TO XXSSZD AND USRGRP, USRTYP C AND USREXT NAMES C - NOW ALLOWS ANY INPUT DATASET FILENAME C AND EXTENSION C UPDATE: 23/11/93 - PEB : CORRECT ERROR - A '.' HAD MISTAKENLY C BEEN PLACED BEFORE THE MEMBER NAME IN C VARIABLE DSNAME. C C UPDATE: 10/11/94 - L. JALOTA: MODIFIED CODE FOR RUNNING UNDER UNIX C USING NEW FILE NAMING CONVENTION. C "ACTION" KEYWORD IN OPEN COMMAND IS IBM C SO REMOVED HERE. C ADDED DEFADF C UPDATE: 22/11/94 - L. JALOTA: TIDIED UP CHARACTER LENGTH DEFINITIONS C C UPDATE: 24/03/95 - HPS : INTRODUCED HASH TO ELIMINATE # IN FILE IF C THERE IS NO EXTENSION PART OF THE FILE NAME C ALTER LOGIC TO ALLOW USRTYP, USREXT TO BE A C SINGLE CHARACTER. C C----------------------------------------------------------------------- C----------------------------------------------------------------------- C C----------------------------------------------------------------------- CHARACTER*80 DSNAME INTEGER IRCODE, IUNIT, IZ0