/[MITgcm]/MITgcm/pkg/mdsio/mdsio_rd_rec_rs.F
ViewVC logotype

Contents of /MITgcm/pkg/mdsio/mdsio_rd_rec_rs.F

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


Revision 1.3 - (show annotations) (download)
Wed Aug 31 21:28:18 2011 UTC (12 years, 8 months ago) by jmc
Branch: MAIN
CVS Tags: checkpoint64y, checkpoint64x, checkpoint64z, checkpoint64q, checkpoint64p, checkpoint64s, checkpoint64r, checkpoint64u, checkpoint64t, checkpoint64w, checkpoint64v, checkpoint64i, checkpoint64h, checkpoint64k, checkpoint64j, checkpoint64m, checkpoint64l, checkpoint64o, checkpoint64n, checkpoint64a, checkpoint64c, checkpoint64b, checkpoint64e, checkpoint64d, checkpoint64g, checkpoint64f, checkpoint63p, checkpoint63q, checkpoint63r, checkpoint63s, checkpoint63l, checkpoint63m, checkpoint63n, checkpoint63o, checkpoint63h, checkpoint63i, checkpoint63j, checkpoint63k, checkpoint63d, checkpoint63e, checkpoint63f, checkpoint63g, checkpoint63c, checkpoint64, checkpoint65, checkpoint66g, checkpoint66f, checkpoint66e, checkpoint66d, checkpoint66c, checkpoint66b, checkpoint66a, checkpoint66o, checkpoint66n, checkpoint66m, checkpoint66l, checkpoint66k, checkpoint66j, checkpoint66i, checkpoint66h, checkpoint65z, checkpoint65x, checkpoint65y, checkpoint65r, checkpoint65s, checkpoint65p, checkpoint65q, checkpoint65v, checkpoint65w, checkpoint65t, checkpoint65u, checkpoint65j, checkpoint65k, checkpoint65h, checkpoint65i, checkpoint65n, checkpoint65o, checkpoint65l, checkpoint65m, checkpoint65b, checkpoint65c, checkpoint65a, checkpoint65f, checkpoint65g, checkpoint65d, checkpoint65e, HEAD
Changes since 1.2: +3 -3 lines
print message according to debugLevel value (in case many calls to these S/R)

1 C $Header: /u/gcmpack/MITgcm/pkg/mdsio/mdsio_rd_rec_rs.F,v 1.2 2011/06/07 22:28:02 jmc Exp $
2 C $Name: $
3
4 #include "MDSIO_OPTIONS.h"
5
6 C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|
7 CBOP 0
8 C !ROUTINE: MDS_RD_REC_RS
9
10 C !INTERFACE:
11 SUBROUTINE MDS_RD_REC_RS(
12 O arr,
13 O r4Buf, r8Buf,
14 I fPrec, dUnit, iRec, nArr, myThid )
15
16 C !DESCRIPTION:
17 C Read one reccord from already opened io-unit "dUnit", into RS array "arr"
18
19 C !USES:
20 IMPLICIT NONE
21 #include "EEPARAMS.h"
22 #include "SIZE.h"
23 #include "PARAMS.h"
24
25 C !INPUT PARAMETERS:
26 C fPrec integer :: file precision
27 C dUnit integer :: 'Opened' I/O channel
28 C iRec integer :: record number to WRITE
29 C nArr integer :: dimension off array "arr"
30 C myThid integer :: my Thread Id number
31 C !OUTPUT PARAMETERS:
32 C arr RS :: vector array to read in
33 C r4Buf real*4 :: buffer array
34 C r8Buf real*8 :: buffer array
35 INTEGER fPrec
36 INTEGER dUnit
37 INTEGER iRec
38 INTEGER nArr
39 INTEGER myThid
40 _RS arr(nArr)
41 Real*4 r4Buf(nArr)
42 Real*8 r8Buf(nArr)
43 CEOP
44
45 C !LOCAL VARIABLES:
46 CHARACTER*(MAX_LEN_MBUF) msgBuf
47 INTEGER k
48
49 C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|
50 IF ( debugLevel.GE.debLevC ) THEN
51 WRITE(msgBuf,'(A,I9,2x,I9)')
52 & ' MDS_RD_REC_RS: iRec,Dim = ', iRec, nArr
53 CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,
54 & SQUEEZE_RIGHT , myThid )
55 ENDIF
56
57 IF ( fPrec.EQ.precFloat32 ) THEN
58 READ( dUnit, rec=iRec ) r4Buf
59 #ifdef _BYTESWAPIO
60 CALL MDS_BYTESWAPR4( nArr, r4Buf )
61 #endif
62 DO k=1,nArr
63 arr(k) = r4Buf(k)
64 ENDDO
65 ELSEIF ( fPrec.EQ.precFloat64 ) THEN
66 READ( dUnit, rec=iRec ) r8Buf
67 #ifdef _BYTESWAPIO
68 CALL MDS_BYTESWAPR8( nArr, r8Buf )
69 #endif
70 DO k=1,nArr
71 arr(k) = r8Buf(k)
72 ENDDO
73 ELSE
74 WRITE(msgBuf,'(A,I9)')
75 & ' MDS_RD_REC_RS: illegal value for fPrec=',fPrec
76 CALL PRINT_ERROR( msgBuf, myThid )
77 STOP 'ABNORMAL END: S/R MDS_RD_REC_RS'
78 ENDIF
79
80 RETURN
81 END

  ViewVC Help
Powered by ViewVC 1.1.22