File indexing completed on 2018-03-02 18:37:33 UTC
view on githubraw file Latest commit add29e06 on 2018-01-31 20:35:05 UTC
1be817fa63 Jean*0001
0002 #include "ATM_CPL_OPTIONS.h"
0003
0004
0005
0006
0007
0008 SUBROUTINE ATM_CHECK_CPLCONFIG(
0009 U errFlag, errMsg,
0010 I landMask, myThid )
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025 IMPLICIT NONE
0026
0027 #include "SIZE.h"
0028 #include "EEPARAMS.h"
0029 #include "PARAMS.h"
0030
0031 #include "CPL_PARAMS.h"
0032 #include "ATMCPL.h"
0033
0034
0035
0036
0037
0038
0039 LOGICAL errFlag
0040 CHARACTER*(*) errMsg
0041 _RL landMask(1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
0042 INTEGER myThid
0043
0044
0045 INTEGER i, j, bi, bj
0046 CHARACTER*(MAX_LEN_MBUF) msgBuf
0047 _RL atm_waterOnly, atm_landOnly, mxlD_noWater
0048
0049
0050
0051
0052 IF ( debugLevel.GE.debLevB ) THEN
0053 CALL WRITE_FLD_XY_RL( 'Ocn_MxlD', ' ', ocMxlD, 0, myThid )
0054 ENDIF
a24915ab1a Jean*0055 IF ( plotLevel.GE.debLevC ) THEN
1be817fa63 Jean*0056 CALL PLOT_FIELD_XYRL( ocMxlD,
0057 & 'Ocean mixed-layer depth on atmos grid',
0058 & 1, myThid )
0059 ENDIF
0060
0061
0062 _BEGIN_MASTER( myThid )
0063
0064 IF ( cplErrorCount.NE.0 ) THEN
0065 errFlag = .TRUE.
0066 WRITE(msgBuf,'(2A,I4,A)') 'ATM_CHECK_CPLCONFIG: ',
0067 & ' cplErrorCount=', cplErrorCount, ' (from previous error)'
0068 CALL PRINT_ERROR( msgBuf, myThid )
0069 ENDIF
0070
0071
0072
0073
0074
0075 atm_waterOnly = 0. _d 0
0076 atm_landOnly = 1. _d 0
0077 mxlD_noWater = 0. _d 0
0078 DO bj=1,nSy
0079 DO bi=1,nSx
0080 DO j=1,sNy
0081 DO i=1,sNx
0082 IF ( ( landMask(i,j,bi,bj) .EQ. atm_waterOnly
0083 & .AND. ocMxlD(i,j,bi,bj) .EQ. mxlD_noWater )
0084 & .OR. ( landMask(i,j,bi,bj) .EQ. atm_landOnly
0085 & .AND. ocMxlD(i,j,bi,bj) .NE. mxlD_noWater ) ) THEN
0086 errFlag = .TRUE.
0087 WRITE(msgBuf,'(2(A,I6),2(A,I4),A)')
0088 & 'Inconsistent land/sea mask @ (i=', i, ',j=', j,
0089 & ',bi=', bi, ',bj=', bj, ')'
0090 CALL PRINT_ERROR( msgBuf, myThid )
0091 WRITE(msgBuf,'(A,E30.15)')
0092 & 'Land (atmosphere) ==', landMask(i,j,bi,bj)
0093 CALL PRINT_ERROR( msgBuf, myThid )
0094 WRITE(msgBuf,'(A,E30.15)')
0095 & 'Mxl-Depth (ocean) ==', ocMxlD(i,j,bi,bj)
0096 CALL PRINT_ERROR( msgBuf, myThid )
0097 ENDIF
0098 ENDDO
0099 ENDDO
0100 ENDDO
0101 ENDDO
0102
0103 IF ( errFlag ) WRITE(errMsg,'(A)')
0104 & 'ATM_CHECK_CPLCONFIG: inconsistent ATM/CPL/OCN config'
0105
0106 _END_MASTER( myThid )
0107
0108 RETURN
0109 END