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