1 |
C $Header: /u/gcmpack/MITgcm/pkg/rw/write_local_rs.F,v 1.3 2005/11/04 01:33:51 jmc Exp $ |
2 |
C $Name: $ |
3 |
|
4 |
#include "RW_OPTIONS.h" |
5 |
|
6 |
SUBROUTINE WRITE_LOCAL_RS( |
7 |
I pref,suff,nNr,field,bi,bj,iRec,myIter,myThid) |
8 |
C WRITE_LOCAL_RS 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 nNr |
18 |
_RS field(1-Olx:sNx+Olx,1-Oly:sNy+Oly,nNr) |
19 |
INTEGER bi,bj |
20 |
INTEGER iRec |
21 |
INTEGER myIter |
22 |
INTEGER myThid |
23 |
C Functions |
24 |
INTEGER ILNBLNK,IFNBLNK |
25 |
C Common |
26 |
COMMON /RD_WR_FLD/ globalFile |
27 |
LOGICAL globalFile |
28 |
C Local |
29 |
CHARACTER*(2) fType |
30 |
INTEGER s1Lo,s1Hi,s2Lo,s2Hi |
31 |
CHARACTER*(MAX_LEN_FNAM) fullName |
32 |
|
33 |
C-- Build file name |
34 |
C Name has form 'prefix.suffix' |
35 |
C e.g. U.0000000100 |
36 |
s1Lo = IFNBLNK(pref) |
37 |
s1Hi = ILNBLNK(pref) |
38 |
IF ( suff .EQ. ' ' ) THEN |
39 |
WRITE( fullName, '(A)' ) pref(s1Lo:s1Hi) |
40 |
ELSEIF ( suff .EQ. 'I10' ) THEN |
41 |
WRITE( fullName, '(A,A,I10.10)' ) pref(s1Lo:s1Hi),'.',myIter |
42 |
ELSE |
43 |
s2Lo = IFNBLNK(suff) |
44 |
s2Hi = ILNBLNK(suff) |
45 |
WRITE( fullName, '(A,A)' ) pref(s1Lo:s1Hi),suff(s2Lo:s2Hi) |
46 |
ENDIF |
47 |
C |
48 |
fType='RS' |
49 |
#ifdef ALLOW_MDSIO |
50 |
CALL MDS_WRITELOCAL( |
51 |
& fullName, writeBinaryPrec, globalFile, |
52 |
& fType, nNr, field, bi, bj, iRec, myIter, myThid ) |
53 |
#endif |
54 |
RETURN |
55 |
END |