ADAS Subroutine e3file
SUBROUTINE E3FILE( IUNIT , IZ0 , IZ , IRCODE , DSNAME ) C----------------------------------------------------------------------- C C ****************** FORTRAN77 SUBROUTINE: E3FILE ********************* C C PURPOSE: TO OPEN A PHOTON EMISSIVITY 'IONELEC' DATA SET C BY DEFAULT, OR AN ALTERNATIVE DATA SET IF REQUIRED, FOR C EMITTING ION WITH NUCLEAR CHARGE 'IZ0' AND CHARGE 'IZ'. C THIS WILL BE CONNECTED TO UNIT 'IUNIT'. C C DATA SET OPENED: $ADASUSER/<DEFADF>/<GROUP>(OPTIONAL)/<TYPE>/ C <GROUP_EXT>#<ELEMENT SYMBOL><CHARGE> C C CALLING PROGRAM: SPEC 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 INPUT : (I*4) IZ = ION 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 6 => INVALID VALUE FOR 'IZ' ENTERED. C ( 0 <= 'IZ' <= 99 ) 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 C (I*4) IZEND = LAST BYTE WRITTEN TO IN 'CZ'. (= 1 OR 2) C (C*1) HASH = '#' IF NON-BLANK EXT, ELSE ' '. C (C*2) CZ = 'IZ' (NO LEADING BLANKS) C (C*2) XFESYM = FUNCTION - (SEE ROUTINES SECTION BELOW) C (C*2) ESYM = ELEMENT SYMBOL FOR NUCLEAR CHARGE 'IZ0' CA (C*3) USREXT = ADAS SOURCE DATA FILE EXTENSION CA (C*80) USERID = ADAS SOURCE DATA USER ID CA (C*8) USRGRP = ADAS SOURCE DATA GROUPNAME CA (C*80) USRTYP = ADAS SOURCE DATA TYPENAME C (C*6) 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 XXSPEC 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/67 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 XXSPEC 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: 1/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 UPDATE: 8/11/94 - L. JALOTA: ADDED DEFADF C C UPDATE: 22/11/94 - L. JALOTA: TIDIED UP CHARACTER STRING LENGTHS C C UPDATE: 22/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, IZ, IZ0