source: CPL/oasis3/trunk/src/mod/oasis3/src/nextch.f

Last change on this file was 1677, checked in by aclsce, 12 years ago

Imported oasis3 (tag ipslcm5a) from cvs server to svn server (igcmg project).

File size: 2.0 KB
Line 
1      FUNCTION nextch (cdstr, kistr, knstr)
2C****
3C               ******************************
4C               * OASIS FUNCTION  -  LEVEL T *
5C               * --------------     ------- *
6C               ******************************
7C
8C**** *nextch*  - Search function
9C
10C     Purpose:
11C     -------
12C     Find the first non-blank in a character string
13C
14C**   Interface:
15C     ---------
16C       *ii =*  *nextch (cdstr, kistr, knstr)*
17C
18C     Input:
19C     -----
20C                cdstr : string to be searched (char string)
21C                kistr : initial search position within the string (integer)
22C                knstr : final search position within the string (integer)
23C
24C     Output:
25C     ------
26C     None
27C
28C     Workspace:
29C     ---------
30C     None
31C
32C     Externals:
33C     ---------
34C     None
35C
36C     Reference:
37C     ---------
38C     See OASIS manual (1995)
39C
40C     History:
41C     -------
42C       Version   Programmer     Date      Description
43C       -------   ----------     ----      ----------- 
44C       2.0       L. Terray      95/09/01  created
45C
46C %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
47C
48C* ---------------------------- Include files ---------------------------
49C
50      USE mod_unit
51C
52C* ---------------------------- Argument declarations -------------------
53C
54      CHARACTER*1 cdstr
55      DIMENSION cdstr(knstr)
56C
57C* ---------------------------- Local declarations -------------------
58C
59      CHARACTER (len=1), SAVE :: clblank = ' '
60C
61C* ---------------------------- Poema verses ----------------------------
62C
63C %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
64C
65C
66C*    1. Find the first non-blank character
67C        ----------------------------------
68C
69      DO 110 ji = kistr, knstr
70        idum = ji
71        IF (cdstr(ji) .NE. clblank) GO TO 120
72  110 CONTINUE
73  120 CONTINUE
74      nextch = idum
75      IF (idum .GE. knstr) nextch = -1
76C
77C
78C*    2. End of function
79C        ---------------
80C
81      RETURN
82      END
Note: See TracBrowser for help on using the repository browser.