Oasis3 4.0.2
nextch.f
Go to the documentation of this file.
00001       FUNCTION nextch (cdstr, kistr, knstr)
00002 C****
00003 C               ******************************
00004 C               * OASIS FUNCTION  -  LEVEL T *
00005 C               * --------------     ------- *
00006 C               ******************************
00007 C
00008 C**** *nextch*  - Search function
00009 C
00010 C     Purpose:
00011 C     -------
00012 C     Find the first non-blank in a character string
00013 C
00014 C**   Interface:
00015 C     ---------
00016 C       *ii =*  *nextch (cdstr, kistr, knstr)*
00017 C
00018 C     Input:
00019 C     -----
00020 C                cdstr : string to be searched (char string)
00021 C                kistr : initial search position within the string (integer)
00022 C                knstr : final search position within the string (integer)
00023 C
00024 C     Output:
00025 C     ------
00026 C     None
00027 C
00028 C     Workspace:
00029 C     ---------
00030 C     None
00031 C
00032 C     Externals:
00033 C     ---------
00034 C     None
00035 C
00036 C     Reference:
00037 C     ---------
00038 C     See OASIS manual (1995)
00039 C
00040 C     History:
00041 C     -------
00042 C       Version   Programmer     Date      Description
00043 C       -------   ----------     ----      -----------  
00044 C       2.0       L. Terray      95/09/01  created
00045 C
00046 C %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
00047 C
00048 C* ---------------------------- Include files ---------------------------
00049 C
00050       USE mod_unit
00051 C
00052 C* ---------------------------- Argument declarations -------------------
00053 C
00054       CHARACTER*1 cdstr
00055       DIMENSION cdstr(knstr)
00056 C
00057 C* ---------------------------- Local declarations -------------------
00058 C
00059       CHARACTER (len=1), SAVE :: clblank = ' '
00060 C
00061 C* ---------------------------- Poema verses ----------------------------
00062 C
00063 C %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
00064 C
00065 C*    1. Find the first non-blank character
00066 C        ----------------------------------
00067 C
00068       DO 110 ji = kistr, knstr
00069         idum = ji
00070         IF (cdstr(ji) .NE. clblank) GO TO 120
00071   110 CONTINUE
00072   120 CONTINUE
00073       nextch = idum
00074       IF (idum .GE. knstr) nextch = -1
00075 C
00076 C*    2. End of function
00077 C        ---------------
00078 C
00079       RETURN
00080       END
 All Data Structures Namespaces Files Functions Variables Defines