File indexing completed on 2019-06-20 05:10:38 UTC
view on githubraw file Latest commit cf91654a on 2019-06-12 17:34:50 UTC
fb7cf9fffd Jean*0001 #include "EXF_OPTIONS.h"
0002
0003
0004
0005
0006 SUBROUTINE EXF_WEIGHT_SFX_DIAGS(
0007 I siceFrac, diagGroup,
0008 I myTime, myIter, myThid )
0009
0010
0011
0012
0013
0014
0015 IMPLICIT NONE
0016
0017
0018 #include "EEPARAMS.h"
0019 #include "SIZE.h"
0020 #include "PARAMS.h"
0021 #include "EXF_PARAM.h"
0022 #include "EXF_FIELDS.h"
0023
0024
0025
0026
0027
0028
0029
0030
0031 _RL siceFrac(1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
0032 INTEGER diagGroup
0033 _RL myTime
0034 INTEGER myIter
0035 INTEGER myThid
0036
0037 #ifdef ALLOW_DIAGNOSTICS
0038
0039 LOGICAL DIAGNOSTICS_IS_ON
0040 EXTERNAL DIAGNOSTICS_IS_ON
0041
0042
0043
0044
0045
0046 _RL tmpFld(1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
0047 INTEGER bi, bj
0048 INTEGER i, j
0049
0050
0051 IF ( useDiagnostics .AND. diags_opOceWeighted ) THEN
0052
0053
0054 IF ( diagGroup.EQ.-1 ) THEN
0055 CALL DIAGNOSTICS_FILL( ustress,'EXFtaux ', 0,1,0,1,1,myThid )
0056 CALL DIAGNOSTICS_FILL( vstress,'EXFtauy ', 0,1,0,1,1,myThid )
0057 ELSEIF ( diagGroup.EQ.1 ) THEN
0058
0059 IF ( DIAGNOSTICS_IS_ON('EXFtaux ',myThid) ) THEN
0060 DO bj=myByLo(myThid),myByHi(myThid)
0061 DO bi=myBxLo(myThid),myBxHi(myThid)
0062 IF ( stressIsOnCgrid ) THEN
0063 DO j = 1,sNy
0064 DO i = 1,sNx+1
0065 tmpFld(i,j,bi,bj) = ustress(i,j,bi,bj)
0066 & *( oneRL - halfRL*
0067 & ( siceFrac(i-1,j,bi,bj) + siceFrac(i,j,bi,bj) ) )
0068 ENDDO
0069 ENDDO
0070 ELSE
0071 DO j = 1-OLy,sNy+OLy
0072 DO i = 1-OLx,sNx+OLx
0073 tmpFld(i,j,bi,bj) = ustress(i,j,bi,bj)
0074 & *( oneRL - siceFrac(i,j,bi,bj) )
0075 ENDDO
0076 ENDDO
0077 ENDIF
0078 ENDDO
0079 ENDDO
0080 CALL DIAGNOSTICS_FILL( tmpFld, 'EXFtaux ', 0,1,0,1,1,myThid )
0081 ENDIF
0082
0083 IF ( DIAGNOSTICS_IS_ON('EXFtauy ',myThid) ) THEN
0084 DO bj=myByLo(myThid),myByHi(myThid)
0085 DO bi=myBxLo(myThid),myBxHi(myThid)
0086 IF ( stressIsOnCgrid ) THEN
0087 DO j = 1,sNy+1
0088 DO i = 1,sNx
0089 tmpFld(i,j,bi,bj) = vstress(i,j,bi,bj)
0090 & *( oneRL - halfRL*
0091 & ( siceFrac(i,j-1,bi,bj) + siceFrac(i,j,bi,bj) ) )
0092 ENDDO
0093 ENDDO
0094 ELSE
0095 DO j = 1-OLy,sNy+OLy
0096 DO i = 1-OLx,sNx+OLx
0097 tmpFld(i,j,bi,bj) = vstress(i,j,bi,bj)
0098 & *( oneRL - siceFrac(i,j,bi,bj) )
0099 ENDDO
0100 ENDDO
0101 ENDIF
0102 ENDDO
0103 ENDDO
0104 CALL DIAGNOSTICS_FILL( tmpFld, 'EXFtauy ', 0,1,0,1,1,myThid )
0105 ENDIF
0106
0107
0108 ENDIF
0109
0110
0111 IF ( diagGroup.EQ.-2 ) THEN
0112 CALL DIAGNOSTICS_FILL( hflux, 'EXFqnet ', 0,1,0,1,1,myThid )
0113 CALL DIAGNOSTICS_FILL( sflux, 'EXFempmr', 0,1,0,1,1,myThid )
0114 #if defined(ALLOW_ATM_TEMP) || defined(SHORTWAVE_HEATING)
0115 CALL DIAGNOSTICS_FILL( swflux, 'EXFswnet', 0,1,0,1,1,myThid )
cf91654aa8 Jean*0116 #endif /* ALLOW_ATM_TEMP or SHORTWAVE_HEATING */
fb7cf9fffd Jean*0117 ELSEIF ( diagGroup.EQ.2 ) THEN
0118
0119 IF ( DIAGNOSTICS_IS_ON('EXFqnet ',myThid) ) THEN
0120 DO bj=myByLo(myThid),myByHi(myThid)
0121 DO bi=myBxLo(myThid),myBxHi(myThid)
0122 DO j = 1-OLy,sNy+OLy
0123 DO i = 1-OLx,sNx+OLx
0124 tmpFld(i,j,bi,bj) = hflux(i,j,bi,bj)
0125 & *( oneRL - siceFrac(i,j,bi,bj) )
0126 ENDDO
0127 ENDDO
0128 ENDDO
0129 ENDDO
0130 CALL DIAGNOSTICS_FILL( tmpFld, 'EXFqnet ', 0,1,0,1,1,myThid )
0131 ENDIF
0132
0133 IF ( DIAGNOSTICS_IS_ON('EXFempmr',myThid) ) THEN
0134 DO bj=myByLo(myThid),myByHi(myThid)
0135 DO bi=myBxLo(myThid),myBxHi(myThid)
0136 DO j = 1-OLy,sNy+OLy
0137 DO i = 1-OLx,sNx+OLx
0138 tmpFld(i,j,bi,bj) = sflux(i,j,bi,bj)
0139 & *( oneRL - siceFrac(i,j,bi,bj) )
0140 ENDDO
0141 ENDDO
0142 ENDDO
0143 ENDDO
0144 CALL DIAGNOSTICS_FILL( tmpFld, 'EXFempmr', 0,1,0,1,1,myThid )
0145 ENDIF
0146
0147 #if defined(ALLOW_ATM_TEMP) || defined(SHORTWAVE_HEATING)
0148 IF ( DIAGNOSTICS_IS_ON('EXFswnet',myThid) ) THEN
0149 DO bj=myByLo(myThid),myByHi(myThid)
0150 DO bi=myBxLo(myThid),myBxHi(myThid)
0151 DO j = 1-OLy,sNy+OLy
0152 DO i = 1-OLx,sNx+OLx
0153 tmpFld(i,j,bi,bj) = swflux(i,j,bi,bj)
0154 & *( oneRL - siceFrac(i,j,bi,bj) )
0155 ENDDO
0156 ENDDO
0157 ENDDO
0158 ENDDO
0159 CALL DIAGNOSTICS_FILL( tmpFld, 'EXFswnet', 0,1,0,1,1,myThid )
0160 ENDIF
cf91654aa8 Jean*0161 #endif /* ALLOW_ATM_TEMP or SHORTWAVE_HEATING */
0162
0163
0164 ENDIF
fb7cf9fffd Jean*0165
0166 #ifdef ALLOW_ATM_TEMP
cf91654aa8 Jean*0167
0168
0169 IF ( diagGroup.EQ.-2 ) THEN
0170 #ifdef ALLOW_ATM_TEMP
0171 CALL DIAGNOSTICS_FILL( hs , 'EXFhs ', 0,1,0,1,1,myThid )
0172 CALL DIAGNOSTICS_FILL( hl , 'EXFhl ', 0,1,0,1,1,myThid )
0173 CALL DIAGNOSTICS_FILL( lwflux, 'EXFlwnet', 0,1,0,1,1,myThid )
0174 CALL DIAGNOSTICS_FILL( evap, 'EXFevap ', 0,1,0,1,1,myThid )
0175 #endif /* ALLOW_ATM_TEMP */
0176 ELSEIF ( diagGroup.EQ.2 ) THEN
fb7cf9fffd Jean*0177
cf91654aa8 Jean*0178 IF ( DIAGNOSTICS_IS_ON('EXFhs ',myThid) ) THEN
0179 DO bj=myByLo(myThid),myByHi(myThid)
0180 DO bi=myBxLo(myThid),myBxHi(myThid)
0181 DO j = 1-OLy,sNy+OLy
0182 DO i = 1-OLx,sNx+OLx
0183 tmpFld(i,j,bi,bj) = hs(i,j,bi,bj)
0184 & *( oneRL - siceFrac(i,j,bi,bj) )
0185 ENDDO
0186 ENDDO
0187 ENDDO
0188 ENDDO
0189 CALL DIAGNOSTICS_FILL( tmpFld, 'EXFhs ', 0,1,0,1,1,myThid )
0190 ENDIF
0191
0192 IF ( DIAGNOSTICS_IS_ON('EXFhl ',myThid) ) THEN
0193 DO bj=myByLo(myThid),myByHi(myThid)
0194 DO bi=myBxLo(myThid),myBxHi(myThid)
0195 DO j = 1-OLy,sNy+OLy
0196 DO i = 1-OLx,sNx+OLx
0197 tmpFld(i,j,bi,bj) = hl(i,j,bi,bj)
0198 & *( oneRL - siceFrac(i,j,bi,bj) )
0199 ENDDO
0200 ENDDO
0201 ENDDO
0202 ENDDO
0203 CALL DIAGNOSTICS_FILL( tmpFld, 'EXFhl ', 0,1,0,1,1,myThid )
0204 ENDIF
0205
0206 IF ( DIAGNOSTICS_IS_ON('EXFlwnet',myThid) ) THEN
0207 DO bj=myByLo(myThid),myByHi(myThid)
0208 DO bi=myBxLo(myThid),myBxHi(myThid)
0209 DO j = 1-OLy,sNy+OLy
0210 DO i = 1-OLx,sNx+OLx
0211 tmpFld(i,j,bi,bj) = lwflux(i,j,bi,bj)
0212 & *( oneRL - siceFrac(i,j,bi,bj) )
0213 ENDDO
0214 ENDDO
0215 ENDDO
0216 ENDDO
0217 CALL DIAGNOSTICS_FILL( tmpFld, 'EXFlwnet', 0,1,0,1,1,myThid )
0218 ENDIF
0219
0220 IF ( DIAGNOSTICS_IS_ON('EXFevap ',myThid) ) THEN
0221 DO bj=myByLo(myThid),myByHi(myThid)
0222 DO bi=myBxLo(myThid),myBxHi(myThid)
0223 DO j = 1-OLy,sNy+OLy
0224 DO i = 1-OLx,sNx+OLx
0225 tmpFld(i,j,bi,bj) = evap(i,j,bi,bj)
0226 & *( oneRL - siceFrac(i,j,bi,bj) )
0227 ENDDO
0228 ENDDO
0229 ENDDO
0230 ENDDO
0231 CALL DIAGNOSTICS_FILL( tmpFld, 'EXFevap ', 0,1,0,1,1,myThid )
0232 ENDIF
0233
0234
fb7cf9fffd Jean*0235 ENDIF
cf91654aa8 Jean*0236 #endif /* ALLOW_ATM_TEMP */
fb7cf9fffd Jean*0237
0238 ENDIF
0239 #endif /* ALLOW_DIAGNOSTICS */
0240
0241 RETURN
0242 END