/[MITgcm]/MITgcm_contrib/cg2d_bench/utils.F
ViewVC logotype

Annotation of /MITgcm_contrib/cg2d_bench/utils.F

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.1 - (hide annotations) (download)
Fri May 12 21:58:06 2006 UTC (17 years, 11 months ago) by ce107
Branch: MAIN
Initial version of CG2D benchmark code (serial and parallel) by Chris Hill

1 ce107 1.1 C-- File utils.F: General purpose support routines
2     C-- Contents
3     C-- IFNBLNK - Returns index of first non-blank string character.
4     C-- ILNBLNK - Returns index of last non-blank string character.
5    
6    
7     CStartOfInterface
8     INTEGER FUNCTION IFNBLNK( string )
9     C /==========================================================\
10     C | FUNCTION IFNBLNK |
11     C | o Find first non-blank in character string. |
12     C \==========================================================/
13     C
14     CHARACTER*(*) string
15     CEndOfInterface
16     C
17     INTEGER L, LS
18     C
19     LS = LEN(string)
20     IFNBLNK = 0
21     DO 10 L = 1, LS
22     IF ( string(L:L) .EQ. ' ' ) GOTO 10
23     IFNBLNK = L
24     GOTO 11
25     10 CONTINUE
26     11 CONTINUE
27     C
28     RETURN
29     END
30    
31     CStartOfInterface
32     INTEGER FUNCTION ILNBLNK( string )
33     C /==========================================================\
34     C | FUNCTION ILNBLNK |
35     C | o Find last non-blank in character string. |
36     C \==========================================================/
37     CHARACTER*(*) string
38     CEndOfInterface
39     INTEGER L, LS
40     C
41     LS = LEN(string)
42     ILNBLNK = LS
43     DO 10 L = LS, 1, -1
44     IF ( string(L:L) .EQ. ' ' ) GOTO 10
45     ILNBLNK = L
46     GOTO 11
47     10 CONTINUE
48     11 CONTINUE
49     C
50     RETURN
51     END

  ViewVC Help
Powered by ViewVC 1.1.22