ADAS Subroutine baprs1
SUBROUTINE BAPRS1(NDMET,STRING,WNO,CPL,NPT,IPLA,ZPLA,IFAIL) C C----------------------------------------------------------------------- C C ****************** FORTRAN77 SUBROUTINE: BAPRS1 ********************* C C PURPOSE: TO ANALYSE THE TAIL CHARACTER STRING OF A LEVEL DATA LINE C OF A SPECIFIC ION FILE INTO WAVE-NUMBER AND SETS OF C (PARENT IDENTIFIER, EFFECTIVE ZETA FOR THE PARENT) PAIRS. C C CALLING PROGRAM: ADAS210 C C NOTES: DETECT - LEVEL WAVE NUMBER WHICH PRECEEDS FIRST '{' C - SETS OF PARENT INDEX CONTAINED IN '{.}' C FOLLOWED BY EFFECTIVE ZETA C NB. 'X' AS FIRST PARENT ASSIGNMENT MEANS EXCLUDE IONISATION C FROM THIS LEVEL. C NO PARENT ASSIGNMENT MEANS TAKE LOWEST PARENT WITH C ZETA =1. C LOWEST PARENT BUT NO ZETA MEANS TAKE ZETA =1. C IF THERE IS MORE THAN ONE PARENT THEN ZETA'S MUST BE IN. C C C SUBROUTINE: C C INPUT : (I*4) NDMET = MAXIMUM NUMBER OF PARENTS C INPUT : (C*(*))STRING = STRING TO BE PARSED C C OUTPUT: (R*8) WNO = EXCITATION WAVE NUMBER OF LEVEL RELATIVE C TO LOWEST PARENT C OUTPUT: (C*1) CPL = LEAD PARENT FOR IONISATION OR 'X' C OUTPUT: (I*4) NPT = NUMBER OF PARENTS DETECTED C OUTPUT: (I*4) IPLA() = PARENT INDICES. C OUTPUT: (R*8) ZPLA() = EFFECTIVE ZETA FOR PARENT IPLA() C OUTPUT: (I*4) IFAIL = 0 - SUBROUTINE CONCLUDES CORRECTLY C 1 - FAULT DETECTED IN SUBROUTINE C 2 - SINGLE IONISATION POTENTIAL DETECTED C C (I*4) MAXWRD = MAXIMUM NUMBER OF WORDS SOUGHT INITIALLY C INITIALLY, FINALLY NUMBER ACTUALLY FOUND C (I*4) NFIRST = FIRST WORD TO BE EXTRACTED FROM STRING C (I*4) IFIRST() = INDEX OF FIRST CHAR. OF WORD () IN STRING C (I*4) ILAST() = INDEX OF LAST CHAR. OF WORD () IN STRING C (I*4) IWORDS = NUMBER OF WORDS FOUND IN STRING C C (L*4) LSET = .TRUE. - WAVE NUMBER PART SET C .FALSE. - WAVE NUMBER PART NOT SET C (L*4) LWNO = .TRUE. - IN THE WAVE NUMBER PART C .FALSE. - NOT IN THE WAVE NUMBER PART C (L*4) LPRNT = .TRUE. - IN A PARENT SPECIFIER C .FALSE. - NOT IN A PARENT SPECIFIER C (L*4) LZETA = .TRUE. - IN A ZETA SPECIFIER C .FALSE. - NOT IN A ZETA SPECIFIER C (I*4) IC = GENERAL USE C (I*4) IABT = FAILURE NUMBER FROM R8FCTN C (I*4) NCHAR = NUMBER OF CHARACTERS IN SUBSTRING C (C*15) SSTRNG = ISOLATED SUBSTRING C C ROUTINES: C ROUTINE SOURCE BRIEF DESCRIPTION C ------------------------------------------------------------- C I4UNIT ADAS FETCH UNIT NUMBER FOR OUTPUT OF MESSAGES C R8FCTN ADAS CONVERTS FROM CHARACTER TO REAL VARIABLE C I4FCTN ADAS CONVERTS FROM CHAR. TO INTEGER VARIABLE C XXWORD ADAS PARSES A STRING INTO SEPARATE WORDS C FOR ' ()<>{}' DELIMITERS C C AUTHOR: HP SUMMERS C K1/1/57 C JET EXT. 4941 C C DATE: 22/06/92 C C UPDATE: 8/07/93 - HPS ALTERED TO USE XXWORD PARSING ROUTINE C C UPDATE: 21/12/95 - DHB INCREASED SIZE OF IFIRST & ILAST TO 12 IN C LINE WITH CHANGE TO NDMET C C UNIX-IDL PORT: C C VERSION: 1.1 DATE: 22-1-96 C MODIFIED: TIM HAMMOND (TESSELLA SUPPORT SERVICES PLC) C - PUT UNDER SCCS CONTROL C C----------------------------------------------------------------------- CHARACTER CPL CHARACTER*(*) STRING INTEGER IFAIL, IPLA(NDMET), NDMET, NPT REAL*8 WNO, ZPLA(NDMET)