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

Annotation of /MITgcm/pkg/mdsio/mdsio_wr_rec_rs.F

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


Revision 1.3 - (hide annotations) (download)
Wed Aug 31 21:28:18 2011 UTC (12 years, 9 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: +2 -2 lines
print message according to debugLevel value (in case many calls to these S/R)

1 jmc 1.3 C $Header: /u/gcmpack/MITgcm/pkg/mdsio/mdsio_wr_rec_rs.F,v 1.2 2011/06/07 22:28:02 jmc Exp $
2 jmc 1.1 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_WR_REC_RS
9    
10     C !INTERFACE:
11     SUBROUTINE MDS_WR_REC_RS(
12     I arr,
13     O r4Buf, r8Buf,
14     I fPrec, dUnit, iRec, nArr, myThid )
15    
16     C !DESCRIPTION:
17     C Write one reccord to already opened io-unit "dUnit", from 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 arr RS :: vector array to write
27     C fPrec integer :: file precision
28     C dUnit integer :: 'Opened' I/O channel
29     C iRec integer :: record number to WRITE
30     C nArr integer :: dimension off array "arr"
31     C myThid integer :: my Thread Id number
32     C !OUTPUT PARAMETERS:
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 jmc 1.3 IF ( debugLevel.GE.debLevD ) THEN
51 jmc 1.1 WRITE(msgBuf,'(A,I9,2x,I9)')
52     & ' MDS_WR_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     DO k=1,nArr
59     r4Buf(k) = arr(k)
60     ENDDO
61     #ifdef _BYTESWAPIO
62     CALL MDS_BYTESWAPR4( nArr, r4Buf )
63     #endif
64     WRITE( dUnit, rec=iRec ) r4Buf
65     ELSEIF ( fPrec.EQ.precFloat64 ) THEN
66     DO k=1,nArr
67     r8Buf(k) = arr(k)
68     ENDDO
69     #ifdef _BYTESWAPIO
70     CALL MDS_BYTESWAPR8( nArr, r8Buf )
71     #endif
72     WRITE( dUnit, rec=iRec ) r8Buf
73     ELSE
74     WRITE(msgBuf,'(A,I9)')
75     & ' MDS_WR_REC_RS: illegal value for fPrec=',fPrec
76     CALL PRINT_ERROR( msgBuf, myThid )
77     STOP 'ABNORMAL END: S/R MDS_WR_REC_RS'
78     ENDIF
79    
80     RETURN
81     END

  ViewVC Help
Powered by ViewVC 1.1.22