File indexing completed on 2021-06-06 05:11:47 UTC
view on githubraw file Latest commit aa6b2555 on 2021-06-06 02:50:10 UTC
69120513c5 Jean*0001 #include "CPP_EEOPTIONS.h"
207d64de49 Jean*0002
0003
0004
0005
0006 SUBROUTINE WRITE_FULLARRAY_RS( fnam, fld, kSize,
0007 I biArg, bjArg,
0008 I iRec, myIter, myThid )
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
aa6b2555c8 Jean*0019
0020
0021
0022
0023
207d64de49 Jean*0024
0025
0026
0027 IMPLICIT NONE
0028
0029
0030 #include "SIZE.h"
0031 #include "EEPARAMS.h"
0032
0033
0034
0035 CHARACTER*(*) fnam
0036 INTEGER kSize
0037 INTEGER biArg, bjArg
0038 INTEGER iRec
0039 INTEGER myIter
0040 INTEGER myThid
aa6b2555c8 Jean*0041 _RS fld(1-OLx:sNx+OLx,1-OLy:sNy+OLy,kSize,nSx,nSy)
207d64de49 Jean*0042
0043
0044
0045 INTEGER ILNBLNK, IFNBLNK, MDS_RECLEN
0046 EXTERNAL ILNBLNK, IFNBLNK, MDS_RECLEN
0047
0048
0049
0050 INTEGER i,j,k,bi,bj,iG,jG
0051 INTEGER s1Lo,s1Hi, dUnit, filePrec, length_of_rec, kRec
0052 CHARACTER*(MAX_LEN_FNAM) fullName
0053
0054
0055
0056
0057
0058 _BEGIN_MASTER( myThid )
0059
0060
0061 s1Lo = IFNBLNK(fnam)
0062 s1Hi = ILNBLNK(fnam)
0063 CALL MDSFINDUNIT( dUnit, myThid )
0064
0065
0066 #ifdef RS_IS_REAL4
0067 filePrec = precFloat32
0068 #else
0069 filePrec = precFloat64
0070 #endif
0071
0072 IF ( biArg.EQ.0 .AND. bjArg.EQ.0 ) THEN
0073
0074 DO bj = 1,nSy
0075 DO bi = 1,nSx
0076 iG=bi+(myXGlobalLo-1)/sNx
0077 jG=bj+(myYGlobalLo-1)/sNy
0078
0079 IF ( myIter.GE.0 ) THEN
0080 WRITE( fullName, '(2A,I10.10,2(A,I3.3),A)' )
0081 & fnam(s1Lo:s1Hi),'.',myIter,'.',iG,'.',jG,'.data'
0082 ELSE
0083 WRITE( fullName, '(A,2(A,I3.3),A)' )
0084 & fnam(s1Lo:s1Hi),'.',iG,'.',jG,'.data'
0085 ENDIF
0086
0087
0088
0089
aa6b2555c8 Jean*0090
0091
207d64de49 Jean*0092
0093 length_of_rec = MDS_RECLEN(
aa6b2555c8 Jean*0094 & filePrec, (sNx+2*OLx)*(sNy+2*OLy), myThid )
207d64de49 Jean*0095 OPEN( dUnit, file=fullName, status='unknown',
0096 & access='direct', recl=length_of_rec )
0097 DO k = 1,kSize
0098 kRec = k + (iRec-1)*kSize
0099 WRITE(dUnit,rec=kRec) (( fld(i,j,k,bi,bj),
aa6b2555c8 Jean*0100 & i=1-OLx,sNx+OLx),
0101 & j=1-OLy,sNy+OLy )
207d64de49 Jean*0102 ENDDO
0103 CLOSE(dUnit)
0104
0105 ENDDO
0106 ENDDO
0107
0108 ELSE
0109
0110 iG=biArg+(myXGlobalLo-1)/sNx
0111 jG=bjArg+(myYGlobalLo-1)/sNy
0112
0113 IF ( myIter.GE.0 ) THEN
0114 WRITE( fullName, '(2A,I10.10,2(A,I3.3),A)' )
0115 & fnam(s1Lo:s1Hi),'.',myIter,'.',iG,'.',jG,'.data'
0116 ELSE
0117 WRITE( fullName, '(A,2(A,I3.3),A)' )
0118 & fnam(s1Lo:s1Hi),'.',iG,'.',jG,'.data'
0119 ENDIF
0120
0121
0122
0123
aa6b2555c8 Jean*0124
0125
207d64de49 Jean*0126
0127 length_of_rec = MDS_RECLEN(
aa6b2555c8 Jean*0128 & filePrec, (sNx+2*OLx)*(sNy+2*OLy), myThid )
207d64de49 Jean*0129 OPEN( dUnit, file=fullName, status='unknown',
0130 & access='direct', recl=length_of_rec )
0131 DO k = 1,kSize
0132 kRec = k + (iRec-1)*kSize
0133 WRITE(dUnit,rec=kRec) (( fld(i,j,k,1,1),
aa6b2555c8 Jean*0134 & i=1-OLx,sNx+OLx),
0135 & j=1-OLy,sNy+OLy )
207d64de49 Jean*0136 ENDDO
0137 CLOSE(dUnit)
0138
0139 ENDIF
0140
0141 _END_MASTER( myThid )
0142
0143 RETURN
0144 END