1 | SUBROUTINE locread (cdfldn, pfield, kdimax, knulre, kflgre) |
---|
2 | C**** |
---|
3 | C ***************************** |
---|
4 | C * OASIS ROUTINE - LEVEL 0 * |
---|
5 | C * ------------- ------- * |
---|
6 | C ***************************** |
---|
7 | C |
---|
8 | C**** *locread* - Read binary field on unit knulre |
---|
9 | C |
---|
10 | C Purpose: |
---|
11 | C ------- |
---|
12 | C Find string cdfldn on unit knulre and read array pfield |
---|
13 | C |
---|
14 | C** Interface: |
---|
15 | C --------- |
---|
16 | C *CALL* *locread (cdfldn, pfield, kdimax, knulre, kflgre)* |
---|
17 | C |
---|
18 | C Input: |
---|
19 | C ----- |
---|
20 | C cdfldn : character string locator |
---|
21 | C kdimax : dimension of field to be read |
---|
22 | C knulre : logical unit to be read |
---|
23 | C |
---|
24 | C Output: |
---|
25 | C ------ |
---|
26 | C pfield : field array (real 1D) |
---|
27 | C kflgre : error status flag |
---|
28 | C |
---|
29 | C Workspace: |
---|
30 | C --------- |
---|
31 | C None |
---|
32 | C |
---|
33 | C Externals: |
---|
34 | C --------- |
---|
35 | C None |
---|
36 | C |
---|
37 | C Reference: |
---|
38 | C --------- |
---|
39 | C See OASIS manual (1995) |
---|
40 | C |
---|
41 | C History: |
---|
42 | C ------- |
---|
43 | C Version Programmer Date Description |
---|
44 | C ------- ---------- ---- ----------- |
---|
45 | C 2.0 L. Terray 95/09/01 created |
---|
46 | C 2.3 S. Valcke 99/04/30 added: printing levels |
---|
47 | C |
---|
48 | C %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
---|
49 | C |
---|
50 | C* ---------------------------- Include files --------------------------- |
---|
51 | C |
---|
52 | USE mod_kinds_oasis |
---|
53 | USE mod_unit |
---|
54 | USE mod_printing |
---|
55 | C |
---|
56 | C* ---------------------------- Argument declarations ------------------- |
---|
57 | C |
---|
58 | REAL (kind=ip_realwp_p) pfield(kdimax) |
---|
59 | CHARACTER*8 cdfldn |
---|
60 | C |
---|
61 | C* ---------------------------- Local declarations ---------------------- |
---|
62 | C |
---|
63 | CHARACTER*8 clecfl |
---|
64 | C |
---|
65 | C* ---------------------------- Poema verses ---------------------------- |
---|
66 | C |
---|
67 | C %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
---|
68 | C |
---|
69 | C* 1. Initialization |
---|
70 | C -------------- |
---|
71 | C |
---|
72 | IF (nlogprt .GE. 2) THEN |
---|
73 | WRITE (UNIT = nulou,FMT = *) ' ' |
---|
74 | WRITE (UNIT = nulou,FMT = *) ' ' |
---|
75 | WRITE (UNIT = nulou,FMT = *) |
---|
76 | $ ' ROUTINE locread - Level 0' |
---|
77 | WRITE (UNIT = nulou,FMT = *) |
---|
78 | $ ' *************** *******' |
---|
79 | WRITE (UNIT = nulou,FMT = *) ' ' |
---|
80 | WRITE (UNIT = nulou,FMT = 1001) knulre |
---|
81 | WRITE (UNIT = nulou,FMT = *) ' ' |
---|
82 | ENDIF |
---|
83 | C |
---|
84 | C* Formats |
---|
85 | C |
---|
86 | 1001 FORMAT(5X,' Read binary file connected to unit = ',I3) |
---|
87 | C |
---|
88 | C 2. Find field in file |
---|
89 | C ------------------ |
---|
90 | C |
---|
91 | REWIND knulre |
---|
92 | 200 CONTINUE |
---|
93 | C* Find string |
---|
94 | READ (UNIT = knulre, ERR = 200, END = 210) clecfl |
---|
95 | IF (clecfl .NE. cdfldn) GO TO 200 |
---|
96 | C* Read associated field |
---|
97 | READ (UNIT = knulre, ERR = 210, END = 210) pfield |
---|
98 | C* Reading done and ok |
---|
99 | kflgre = 0 |
---|
100 | GO TO 220 |
---|
101 | C* Problem in reading |
---|
102 | 210 kflgre = 1 |
---|
103 | 220 CONTINUE |
---|
104 | C |
---|
105 | C |
---|
106 | C* 3. End of routine |
---|
107 | C -------------- |
---|
108 | C |
---|
109 | IF (nlogprt .GE. 2) THEN |
---|
110 | WRITE (UNIT = nulou,FMT = *) |
---|
111 | $ ' --------- End of routine locread ---------' |
---|
112 | WRITE (UNIT = nulou,FMT = *) ' ' |
---|
113 | CALL FLUSH (nulou) |
---|
114 | ENDIF |
---|
115 | RETURN |
---|
116 | END |
---|
117 | |
---|
118 | |
---|