/[MITgcm]/MITgcm/pkg/rw/write_local_rs.F
ViewVC logotype

Annotation of /MITgcm/pkg/rw/write_local_rs.F

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


Revision 1.6 - (hide annotations) (download)
Tue Sep 1 19:28:24 2009 UTC (14 years, 9 months ago) by jmc
Branch: MAIN
CVS Tags: checkpoint62v, checkpoint62u, checkpoint62t, checkpoint65z, checkpoint65x, checkpoint65y, checkpoint65r, checkpoint65s, checkpoint65p, checkpoint65q, checkpoint65v, checkpoint65w, checkpoint65t, checkpoint65u, checkpoint65j, checkpoint65k, checkpoint65h, checkpoint65i, checkpoint65n, checkpoint65l, checkpoint65m, checkpoint65b, checkpoint65c, checkpoint65a, checkpoint65f, checkpoint65g, checkpoint65d, checkpoint65e, checkpoint62c, checkpoint62s, checkpoint62r, checkpoint62q, checkpoint62p, checkpoint62a, checkpoint62g, checkpoint62f, checkpoint62e, checkpoint62d, checkpoint62k, checkpoint62j, checkpoint62i, checkpoint62h, checkpoint62o, checkpoint62n, checkpoint62m, checkpoint62l, checkpoint62w, checkpoint62z, checkpoint62y, checkpoint62x, checkpoint63g, checkpoint64, checkpoint65, checkpoint62, checkpoint63, checkpoint66g, checkpoint66f, checkpoint66e, checkpoint66d, checkpoint66c, checkpoint66b, checkpoint66a, checkpoint66o, checkpoint66n, checkpoint66m, checkpoint66l, checkpoint66k, checkpoint66j, checkpoint66i, checkpoint66h, checkpoint63p, checkpoint63q, checkpoint63r, checkpoint63s, checkpoint63l, checkpoint63m, checkpoint63n, checkpoint63o, checkpoint63h, checkpoint63i, checkpoint63j, checkpoint63k, checkpoint63d, checkpoint63e, checkpoint63f, checkpoint63a, checkpoint63b, checkpoint63c, checkpoint65o, checkpoint62b, 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, checkpoint61v, checkpoint61w, checkpoint61z, checkpoint61x, checkpoint61y, HEAD
Changes since 1.5: +9 -5 lines
updated after changing MDS-IO high level S/R interface.

1 jmc 1.6 C $Header: /u/gcmpack/MITgcm/pkg/rw/write_local_rs.F,v 1.5 2009/06/09 22:52:57 jmc Exp $
2 jmc 1.2 C $Name: $
3 adcroft 1.1
4 jmc 1.2 #include "RW_OPTIONS.h"
5 adcroft 1.1
6 jmc 1.5 CBOP
7     C !ROUTINE: WRITE_LOCAL_RS
8     C !INTERFACE:
9 adcroft 1.1 SUBROUTINE WRITE_LOCAL_RS(
10 jmc 1.5 I pref, suff, nNr, field,
11     I bi, bj, iRec, myIter, myThArg )
12    
13     C !DESCRIPTION:
14     C Write "RS" type local-tile array "field" corresponding to tile bi,bj
15     C to binary file (prefix,suffix) at record position "iRec".
16    
17     C !USES:
18 adcroft 1.1 IMPLICIT NONE
19 jmc 1.5 C Global variables / common blocks
20 adcroft 1.1 #include "SIZE.h"
21     #include "EEPARAMS.h"
22     #include "PARAMS.h"
23 jmc 1.5
24     C !INPUT/OUTPUT PARAMETERS:
25     C pref :: file name prefix
26     C suff :: file name suffix
27     C nNr :: Number of levels to write
28     C field :: field array to write
29     C bi,bj :: tile indices
30     C iRec :: record number in output file
31     C myIter :: Iteration number
32     C myThArg :: thread argument (= my Thread Id or = 0 to simply
33     C write 1 tile without thread synchronisation)
34 adcroft 1.1 CHARACTER*(*) pref,suff
35     INTEGER nNr
36     _RS field(1-Olx:sNx+Olx,1-Oly:sNy+Oly,nNr)
37     INTEGER bi,bj
38     INTEGER iRec
39     INTEGER myIter
40 jmc 1.5 INTEGER myThArg
41    
42     C !FUNCTIONS
43     INTEGER IFNBLNK, ILNBLNK
44     EXTERNAL IFNBLNK, ILNBLNK
45    
46     C Common block
47 adcroft 1.1 COMMON /RD_WR_FLD/ globalFile
48     LOGICAL globalFile
49 jmc 1.5
50     C !LOCAL VARIABLES:
51     LOGICAL useCurrentDir
52 jmc 1.6 _RL dummyRL(1)
53 adcroft 1.1 CHARACTER*(2) fType
54 jmc 1.5 CHARACTER*(MAX_LEN_FNAM) fullName
55 adcroft 1.1 INTEGER s1Lo,s1Hi,s2Lo,s2Hi
56 jmc 1.5 INTEGER myThid
57 adcroft 1.1
58     C-- Build file name
59     C Name has form 'prefix.suffix'
60     C e.g. U.0000000100
61     s1Lo = IFNBLNK(pref)
62     s1Hi = ILNBLNK(pref)
63     IF ( suff .EQ. ' ' ) THEN
64     WRITE( fullName, '(A)' ) pref(s1Lo:s1Hi)
65     ELSEIF ( suff .EQ. 'I10' ) THEN
66     WRITE( fullName, '(A,A,I10.10)' ) pref(s1Lo:s1Hi),'.',myIter
67     ELSE
68     s2Lo = IFNBLNK(suff)
69     s2Hi = ILNBLNK(suff)
70     WRITE( fullName, '(A,A)' ) pref(s1Lo:s1Hi),suff(s2Lo:s2Hi)
71     ENDIF
72     C
73 jmc 1.5 useCurrentDir = .TRUE.
74 adcroft 1.1 fType='RS'
75 jmc 1.2 #ifdef ALLOW_MDSIO
76 jmc 1.5 IF (nSx.EQ.1.AND.nSy.EQ.1) THEN
77     C The hack below replaces MDS_WRITELOCAL with MDS_WRITE_FIELD for
78     C single-threaded execution because the former does not support the
79     C singleCpuIo option. This is a placeholder until MDS_WRITELOCAL
80     C functionality is superseded by pkg/diagnostics.
81     myThid = MAX(myThArg,1)
82     CALL MDS_WRITE_FIELD(
83 jmc 1.6 I fullName, writeBinaryPrec,
84     I globalFile, useCurrentDir,
85     I fType, nNr, 1, nNr, dummyRL, field,
86     I iRec, myIter, myThid )
87 jmc 1.5 ELSE
88     CALL MDS_WRITELOCAL(
89 jmc 1.6 I fullName, writeBinaryPrec, globalFile,
90     I fType, nNr, dummyRL, field,
91     I bi, bj, iRec, myIter, myThArg )
92 jmc 1.5 ENDIF
93 jmc 1.2 #endif
94 jmc 1.5
95 adcroft 1.1 RETURN
96     END

  ViewVC Help
Powered by ViewVC 1.1.22