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