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

Contents of /MITgcm/pkg/rw/write_local_rl.F

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


Revision 1.8 - (show annotations) (download)
Tue Sep 1 19:28:24 2009 UTC (14 years, 8 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.7: +9 -5 lines
updated after changing MDS-IO high level S/R interface.

1 C $Header: /u/gcmpack/MITgcm/pkg/rw/write_local_rl.F,v 1.7 2009/06/09 22:52:57 jmc Exp $
2 C $Name: $
3
4 #include "RW_OPTIONS.h"
5
6 CBOP
7 C !ROUTINE: WRITE_LOCAL_RL
8 C !INTERFACE:
9 SUBROUTINE WRITE_LOCAL_RL(
10 I pref, suff, nNr, field,
11 I bi, bj, iRec, myIter, myThArg )
12
13 C !DESCRIPTION:
14 C Write "RL" 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 IMPLICIT NONE
19 C Global variables / common blocks
20 #include "SIZE.h"
21 #include "EEPARAMS.h"
22 #include "PARAMS.h"
23
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 CHARACTER*(*) pref,suff
35 INTEGER nNr
36 _RL field(1-Olx:sNx+Olx,1-Oly:sNy+Oly,nNr)
37 INTEGER bi,bj
38 INTEGER iRec
39 INTEGER myIter
40 INTEGER myThArg
41
42 C !FUNCTIONS
43 INTEGER IFNBLNK, ILNBLNK
44 EXTERNAL IFNBLNK, ILNBLNK
45
46 C Common block
47 COMMON /RD_WR_FLD/ globalFile
48 LOGICAL globalFile
49
50 C !LOCAL VARIABLES:
51 LOGICAL useCurrentDir
52 _RS dummyRS(1)
53 CHARACTER*(2) fType
54 CHARACTER*(MAX_LEN_FNAM) fullName
55 INTEGER s1Lo,s1Hi,s2Lo,s2Hi
56 INTEGER myThid
57
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 useCurrentDir = .TRUE.
74 fType='RL'
75 #ifdef ALLOW_MDSIO
76 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 I fullName, writeBinaryPrec,
84 I globalFile, useCurrentDir,
85 I fType, nNr, 1, nNr, field, dummyRS,
86 I iRec, myIter, myThid )
87 ELSE
88 CALL MDS_WRITELOCAL(
89 I fullName, writeBinaryPrec, globalFile,
90 I fType, nNr, field, dummyRS,
91 I bi, bj, iRec, myIter, myThArg )
92 ENDIF
93 #endif
94
95 RETURN
96 END

  ViewVC Help
Powered by ViewVC 1.1.22