65 |
|
|
66 |
_BEGIN_MASTER( myThid ) |
_BEGIN_MASTER( myThid ) |
67 |
C-- Check size & parameter first: |
C-- Check size & parameter first: |
68 |
IF ( (diagSt_regMaskFile.NE.' ' .AND. nLevRegMskFile.EQ.0) |
IF ( (diagSt_regMaskFile.NE.' ' .AND. nSetRegMskFile.EQ.0) |
69 |
& .OR.(diagSt_regMaskFile.EQ.' ' .AND. nLevRegMskFile.GT.0) ) THEN |
& .OR.(diagSt_regMaskFile.EQ.' ' .AND. nSetRegMskFile.GT.0) ) THEN |
70 |
WRITE(msgBuf,'(2A)') 'DIAGSTATS_SET_REGIONS:', |
WRITE(msgBuf,'(2A)') 'DIAGSTATS_SET_REGIONS:', |
71 |
& ' regMaskFile and nLevRegMskFile Not consistent' |
& ' regMaskFile and nSetRegMskFile Not consistent' |
72 |
CALL PRINT_ERROR( msgBuf , myThid ) |
CALL PRINT_ERROR( msgBuf , myThid ) |
73 |
STOP 'ABNORMAL END: S/R DIAGSTATS_SET_REGIONS' |
STOP 'ABNORMAL END: S/R DIAGSTATS_SET_REGIONS' |
74 |
ENDIF |
ENDIF |
75 |
IF ( nLevRegMskFile.GT.sizRegMsk ) THEN |
IF ( nSetRegMskFile.GT.sizRegMsk ) THEN |
76 |
WRITE(msgBuf,'(2A,I4,A,I4)') 'DIAGSTATS_SET_REGIONS:', |
WRITE(msgBuf,'(2A,I4,A,I4)') 'DIAGSTATS_SET_REGIONS:', |
77 |
& ' regMaskFile level number=', nLevRegMskFile, |
& ' regMaskFile set-index number=', nSetRegMskFile, |
78 |
& ' exceeds sizRegMsk=', sizRegMsk |
& ' exceeds sizRegMsk=', sizRegMsk |
79 |
CALL PRINT_ERROR( msgBuf , myThid ) |
CALL PRINT_ERROR( msgBuf , myThid ) |
80 |
STOP 'ABNORMAL END: S/R DIAGSTATS_SET_REGIONS' |
STOP 'ABNORMAL END: S/R DIAGSTATS_SET_REGIONS' |
88 |
IF (debugLevel.GE.debLevB) WRITE(ioUnit,'(2A)') |
IF (debugLevel.GE.debLevB) WRITE(ioUnit,'(2A)') |
89 |
& ' DIAGSTATS_SET_REGIONS: start reading region-mask file: ', |
& ' DIAGSTATS_SET_REGIONS: start reading region-mask file: ', |
90 |
& diagSt_regMaskFile(1:iLen) |
& diagSt_regMaskFile(1:iLen) |
91 |
DO k=1,nLevRegMskFile |
DO k=1,nSetRegMskFile |
92 |
C _BEGIN_MASTER( myThid ) |
C _BEGIN_MASTER( myThid ) |
93 |
IF (debugLevel.GE.debLevB) WRITE(ioUnit,'(A,I3)') |
IF (debugLevel.GE.debLevB) WRITE(ioUnit,'(A,I3)') |
94 |
& ' DIAGSTATS_SET_REGIONS: reading lev k=',k |
& ' DIAGSTATS_SET_REGIONS: reading set k=',k |
95 |
CALL READ_REC_XY_RS( diagSt_regMaskFile, tmpVar, k, |
CALL READ_REC_XY_RS( diagSt_regMaskFile, tmpVar, k, |
96 |
& nIter0, myThid ) |
& nIter0, myThid ) |
97 |
IF (debugLevel.GE.debLevB) WRITE(ioUnit,'(A,I3,A)') |
IF (debugLevel.GE.debLevB) WRITE(ioUnit,'(A,I3,A)') |
98 |
& ' DIAGSTATS_SET_REGIONS: lev k=',k,' <= done' |
& ' DIAGSTATS_SET_REGIONS: set k=',k,' <= done' |
99 |
C _END_MASTER( myThid ) |
C _END_MASTER( myThid ) |
100 |
_EXCH_XY_RS( tmpVar, myThid ) |
_EXCH_XY_RS( tmpVar, myThid ) |
101 |
DO bj = myByLo(myThid), myByHi(myThid) |
DO bj = myByLo(myThid), myByHi(myThid) |
110 |
C- end of k loop |
C- end of k loop |
111 |
ENDDO |
ENDDO |
112 |
ENDIF |
ENDIF |
113 |
nLevRegMask = nLevRegMskFile |
nSetRegMask = nSetRegMskFile |
114 |
|
|
115 |
C-- Other way to define regions (e.g., latitude bands): |
C-- Other way to define regions (e.g., latitude bands): |
116 |
C set corresponding levels of the region-mask array, |
C set corresponding set-index of the region-mask array, |
117 |
C starting from nLevRegMskFile+1 up to nLevRegMask |
C starting from nSetRegMskFile+1 up to nSetRegMask |
118 |
C note: for now, empty ! |
C note: for now, empty ! |
119 |
|
|
120 |
C-- Region Identificator arrays |
C-- Region Identificator arrays |
132 |
CALL PRINT_ERROR( msgBuf , myThid ) |
CALL PRINT_ERROR( msgBuf , myThid ) |
133 |
STOP 'ABNORMAL END: S/R DIAGSTATS_SET_REGIONS' |
STOP 'ABNORMAL END: S/R DIAGSTATS_SET_REGIONS' |
134 |
C- check for unset region-mask: |
C- check for unset region-mask: |
135 |
ELSEIF ( diagSt_kRegMsk(j).GT.nLevRegMask ) THEN |
ELSEIF ( diagSt_kRegMsk(j).GT.nSetRegMask ) THEN |
136 |
WRITE(msgBuf,'(2A,I3,A,I3,A)') 'DIAGSTATS_SET_REGIONS: ', |
WRITE(msgBuf,'(2A,I3,A,I3,A)') 'DIAGSTATS_SET_REGIONS: ', |
137 |
& 'region',j,' , kRegMsk=', diagSt_kRegMsk(j), |
& 'region',j,' , kRegMsk=', diagSt_kRegMsk(j), |
138 |
& ' <- has not been set !' |
& ' <- has not been set !' |
204 |
& .OR. diagSt_vRegMsk(j).NE.0. |
& .OR. diagSt_vRegMsk(j).NE.0. |
205 |
ENDDO |
ENDDO |
206 |
iLen = ILNBLNK(diagSt_regMaskFile) |
iLen = ILNBLNK(diagSt_regMaskFile) |
207 |
IF ( flag .OR. iLen.GE.1 .OR. nLevRegMskFile.NE.0 ) THEN |
IF ( flag .OR. iLen.GE.1 .OR. nSetRegMskFile.NE.0 ) THEN |
208 |
WRITE(msgBuf,'(2A)') 'DIAGSTATS_SET_REGIONS:', |
WRITE(msgBuf,'(2A)') 'DIAGSTATS_SET_REGIONS:', |
209 |
& ' #define DIAGSTATS_REGION_MASK missing in DIAG_OPTIONS.h' |
& ' #define DIAGSTATS_REGION_MASK missing in DIAG_OPTIONS.h' |
210 |
CALL PRINT_ERROR( msgBuf , myThid ) |
CALL PRINT_ERROR( msgBuf , myThid ) |