1 |
C $Header: /u/gcmpack/MITgcm/pkg/rw/write_fld_xy_rs.F,v 1.2 2005/08/22 23:00:58 jmc Exp $ |
2 |
C $Name: $ |
3 |
|
4 |
#include "RW_OPTIONS.h" |
5 |
|
6 |
SUBROUTINE WRITE_FLD_XY_RS( pref,suff,field,myIter,myThid) |
7 |
C WRITE_FLD_XY_RS is a "front-end" interface to the low-level I/O |
8 |
C routines. It assumes single record files. |
9 |
IMPLICIT NONE |
10 |
C Global |
11 |
#include "SIZE.h" |
12 |
#include "EEPARAMS.h" |
13 |
#include "PARAMS.h" |
14 |
C Arguments |
15 |
CHARACTER*(*) pref,suff |
16 |
_RS field(1-Olx:sNx+Olx,1-Oly:sNy+Oly,nSx,nSy) |
17 |
INTEGER myIter |
18 |
INTEGER myThid |
19 |
C Functions |
20 |
INTEGER ILNBLNK,IFNBLNK |
21 |
C Common |
22 |
COMMON /RD_WR_FLD/ globalFile |
23 |
LOGICAL globalFile |
24 |
C Local |
25 |
CHARACTER*(2) fType |
26 |
INTEGER nNz |
27 |
INTEGER irec |
28 |
INTEGER s1Lo,s1Hi,s2Lo,s2Hi |
29 |
CHARACTER*(MAX_LEN_FNAM) fullName |
30 |
C |
31 |
C-- Build file name |
32 |
C Name has form 'prefix.suffix' |
33 |
C e.g. U.0000000100 |
34 |
s1Lo = IFNBLNK(pref) |
35 |
s1Hi = ILNBLNK(pref) |
36 |
IF ( suff .EQ. ' ' ) THEN |
37 |
WRITE( fullName, '(A)' ) pref(s1Lo:s1Hi) |
38 |
ELSE |
39 |
s2Lo = IFNBLNK(suff) |
40 |
s2Hi = ILNBLNK(suff) |
41 |
WRITE( fullName, '(A,A)' ) pref(s1Lo:s1Hi),suff(s2Lo:s2Hi) |
42 |
ENDIF |
43 |
C |
44 |
fType='RS' |
45 |
nNz=1 |
46 |
irec=1 |
47 |
#ifdef ALLOW_MDSIO |
48 |
CALL MDSWRITEFIELD( fullName, writeBinaryPrec, globalFile, |
49 |
& fType, nNz, field, irec, myIter, myThid ) |
50 |
#endif |
51 |
RETURN |
52 |
END |