C+ C NAME: C ForeignI4ArgN C PURPOSE: C Extract multiple integer*4 value from keyword/value pair C CALLING SEQUENCE: subroutine ForeignI4ArgN(cStr,cName,Def,nVal,Val) C INPUTS: C cStr character*(*) string with keywords C cName character*(*) name of keyword C Def integer value assigned if keyword not present C nVal integer max nr of values extracted C OUTPUTS: C nVal integer actual nr of values extracted C (if more than nVal numbers were extracted C then the negative of the input nVal is C returned; see href=Str2Flt=) C Val integer value of keyword C If less then the input nVal are found then C the remaining values are set to the default C INCLUDE: include 'dirspec.h' C CALLS: C ForeignArgFind, itrim, LocFirstLen, Str2Int C MODIFICATION HISTORY: C NOV-2004, Paul Hick (UCSD/CASS) C JUN-2006, Paul Hick (UCSD/CASS; pphick@ucsd.edu) C Modified to skip past cSwitch when it is followed by a C numeric char (123456789.). This allows negative value to be C specified on Linux C- character cStr *(*) character cName*(*) integer Def integer nVal integer Val(*) do i=1,nVal Val(i) = Def end do call ForeignArgFind(0,cStr,cName,i,j) if (i .ne. 0) then ! Position switch at i n = itrim(cStr) i = j ! Position after = ! Skip past cSwitch followed by numeric char j = j-1+LocFirstLen(cSwitch(:iSwitch),cStr(j:n)) k = j+1 do while (j .lt. n .and. index('1234567890.',cStr(k:k)) .ne. 0) j = k j = j-1+LocFirstLen(cSwitch(:iSwitch),cStr(j:n)) k = j+1 end do if (j .gt. i) then call Str2Int(cStr(i:j-1),nVal,Val) else nVal = 0 end if else nVal = 0 end if return end