/[MITgcm]/MITgcm/pkg/diagnostics/diagstats_set_regions.F
ViewVC logotype

Diff of /MITgcm/pkg/diagnostics/diagstats_set_regions.F

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph | View Patch Patch

revision 1.1 by jmc, Mon Jan 23 22:28:57 2006 UTC revision 1.2 by jmc, Tue Jan 24 02:59:47 2006 UTC
# Line 65  C--   Initialize region-mask array to ze Line 65  C--   Initialize region-mask array to ze
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'
# Line 88  C--   Read region-mask from file Line 88  C--   Read region-mask from file
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)
# Line 110  C       _END_MASTER( myThid ) Line 110  C       _END_MASTER( 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
# Line 132  C-      check for valid region-mask inde Line 132  C-      check for valid region-mask inde
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 !'
# Line 204  C--   Check parameter consitency: Line 204  C--   Check parameter consitency:
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 )

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.2

  ViewVC Help
Powered by ViewVC 1.1.22