source: CPL/oasis3/trunk/src/mod/oasis3/src/locread.f @ 1677

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

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

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