File indexing completed on 2018-03-02 18:44:31 UTC
view on githubraw file Latest commit add29e06 on 2018-01-31 20:35:05 UTC
fc7306ba7d Jean*0001 #include "THSICE_OPTIONS.h"
0002
87ea84cac6 Jean*0003
0004
0005
fc7306ba7d Jean*0006 SUBROUTINE THSICE_MONITOR( myTime, myIter, myThid )
87ea84cac6 Jean*0007
df4e8f7bcf Ed H*0008
0009
87ea84cac6 Jean*0010
0011
fc7306ba7d Jean*0012 IMPLICIT NONE
0013
0014
0015 #include "SIZE.h"
0016 #include "EEPARAMS.h"
0017 #include "PARAMS.h"
0018 #include "GRID.h"
0019 #include "THSICE_PARAMS.h"
87ea84cac6 Jean*0020 #include "THSICE_VARS.h"
fc7306ba7d Jean*0021 #ifdef ALLOW_MONITOR
d1c48a721f Jean*0022 # include "MONITOR.h"
fc7306ba7d Jean*0023 #endif
0024
87ea84cac6 Jean*0025
fc7306ba7d Jean*0026
b8b300fc52 Jean*0027
0028
0029
fc7306ba7d Jean*0030 _RL myTime
0031 INTEGER myIter
0032 INTEGER myThid
87ea84cac6 Jean*0033
fc7306ba7d Jean*0034
0035 #ifdef ALLOW_THSICE
0036 #ifdef ALLOW_MONITOR
0037
49aab2cab9 Jean*0038
94a46dfe0d Jean*0039 LOGICAL DIFFERENT_MULTIPLE
0040 EXTERNAL DIFFERENT_MULTIPLE
49aab2cab9 Jean*0041 LOGICAL MASTER_CPU_IO
0042 EXTERNAL MASTER_CPU_IO
0043
0044
fc7306ba7d Jean*0045 CHARACTER*(MAX_LEN_MBUF) msgBuf
0046 CHARACTER*10 mon_var
0047 CHARACTER*2 mon_sufx(0:2)
b1dc69f03d Jean*0048 _RS locMask(1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
fc7306ba7d Jean*0049 _RS yBand(2), locDr(1)
0050 _RL theMin(2), theMax(2)
0051 _RL theMean(2), theVar(2), theVol(2)
2cf110c259 Jean*0052 _RL theMeanG, theVolG
0053 _RL theMean1, theMean2, theEnergy
fc7306ba7d Jean*0054 _RL theMin0, theMax0, theSD, theDel2
3d1de02024 Jean*0055
b1dc69f03d Jean*0056 INTEGER i,j,bi,bj
2cf110c259 Jean*0057 #ifdef ALLOW_MNC
0058 INTEGER k
0059 #endif
fc7306ba7d Jean*0060
0061 DATA yBand / 0. , 0. /
0062 DATA locDr / 1. /
0063 DATA mon_sufx / '_G' , '_S' , '_N' /
0064
0065
0066
d1c48a721f Jean*0067 IF (
94a46dfe0d Jean*0068 & DIFFERENT_MULTIPLE(thSIce_monFreq,myTime,deltaTclock)
cb494b30de Jean*0069 & .OR. myIter.EQ.nIter0 ) THEN
fc7306ba7d Jean*0070
49aab2cab9 Jean*0071 IF ( MASTER_CPU_IO(myThid) ) THEN
d1c48a721f Jean*0072
88f72205aa Jean*0073
8af2e5c3d6 Jean*0074
d1c48a721f Jean*0075 IF ( thSIce_mon_stdio ) THEN
0076 mon_write_stdout = .TRUE.
0077 ELSE
0078 mon_write_stdout = .FALSE.
0079 ENDIF
0080 mon_write_mnc = .FALSE.
8af2e5c3d6 Jean*0081 #ifdef ALLOW_MNC
d1c48a721f Jean*0082 IF (useMNC .AND. thSIce_mon_mnc) THEN
0083 DO k = 1,MAX_LEN_MBUF
0084 mon_fname(k:k) = ' '
0085 ENDDO
0086 mon_fname(1:12) = 'monitor_sice'
0087 CALL MNC_CW_SET_UDIM(mon_fname, -1, myThid)
0088 CALL MNC_CW_I_W_S(
0089 & 'I',mon_fname,1,1,'iter', myIter, myThid)
0090 CALL MNC_CW_SET_UDIM(mon_fname, 0, myThid)
0091 CALL MNC_CW_RL_W_S(
0092 & 'D',mon_fname,1,1,'T', myTime, myThid)
0093 mon_write_mnc = .TRUE.
0094 ENDIF
0095 #endif /* ALLOW_MNC */
0096
0097 IF (mon_write_stdout) THEN
0098 WRITE(msgBuf,'(2A)') '// ==========================',
0099 & '============================='
0100 CALL PRINT_MESSAGE( msgBuf, mon_ioUnit, SQUEEZE_RIGHT , 1)
0101 WRITE(msgBuf,'(A)')
0102 & '// Begin MONITOR Therm.SeaIce statistics'
0103 CALL PRINT_MESSAGE( msgBuf, mon_ioUnit, SQUEEZE_RIGHT , 1)
0104 WRITE(msgBuf,'(2A)') '// ==========================',
0105 & '============================='
0106 CALL PRINT_MESSAGE( msgBuf, mon_ioUnit, SQUEEZE_RIGHT , 1)
0107 ENDIF
0108
49aab2cab9 Jean*0109
8af2e5c3d6 Jean*0110 ENDIF
fc7306ba7d Jean*0111
b1dc69f03d Jean*0112
0113 DO bj = myByLo(myThid), myByHi(myThid)
0114 DO bi = myBxLo(myThid), myBxHi(myThid)
0115 DO j=1-OLy,sNy+OLy
0116 DO i=1-OLx,sNx+OLx
0117 locMask(i,j,bi,bj) = iceMask(i,j,bi,bj)
0118 ENDDO
0119 ENDDO
0120 ENDDO
0121 ENDDO
0122
fc7306ba7d Jean*0123 CALL MON_SET_PREF('thSI_',myThid)
0124 CALL MON_OUT_RL('time_sec', myTime,mon_string_none,myThid)
d1c48a721f Jean*0125
fc7306ba7d Jean*0126
4c97384db0 Jean*0127 CALL MON_STATS_LATBND_RL(
0128 I 1, 1, 1, 2, yBand,
b8b300fc52 Jean*0129 I iceHeight, locMask, maskInC, rA, yC, locDr,
fc7306ba7d Jean*0130 O theMin, theMax, theMean, theVar, theVol,
0131 I myThid )
0132 theVolG= theVol(1)+theVol(2)
0133 theMeanG= theMean(1)*theVol(1)+theMean(2)*theVol(2)
0134 IF (theVolG.GT.0.) theMeanG = theMeanG / theVolG
0135
0136 mon_var='Ice_Area'
0137 CALL MON_OUT_RL(mon_var, theVolG , mon_sufx(0), myThid)
0138 CALL MON_OUT_RL(mon_var, theVol(1), mon_sufx(1), myThid)
0139 CALL MON_OUT_RL(mon_var, theVol(2), mon_sufx(2), myThid)
0140 mon_var='IceH_ave'
0141 CALL MON_OUT_RL(mon_var,theMeanG , mon_sufx(0), myThid)
0142 CALL MON_OUT_RL(mon_var,theMean(1), mon_sufx(1), myThid)
0143 CALL MON_OUT_RL(mon_var,theMean(2), mon_sufx(2), myThid)
0144 mon_var='IceH_max'
0145 CALL MON_OUT_RL(mon_var, theMax(1), mon_sufx(1), myThid)
0146 CALL MON_OUT_RL(mon_var, theMax(2), mon_sufx(2), myThid)
0147
0148
4c97384db0 Jean*0149 CALL MON_STATS_LATBND_RL(
0150 I 1, 1, 1, 2, yBand,
b8b300fc52 Jean*0151 I snowHeight, locMask, maskInC, rA, yC, locDr,
fc7306ba7d Jean*0152 O theMin, theMax, theMean, theVar, theVol,
0153 I myThid )
0154 theVolG= theVol(1)+theVol(2)
0155 theMeanG= theMean(1)*theVol(1)+theMean(2)*theVol(2)
0156 theEnergy = -rhos*Lfresh*theMeanG
0157 IF (theVolG.GT.0.) theMeanG = theMeanG / theVolG
0158
0159 mon_var='SnwH_ave'
0160 CALL MON_OUT_RL(mon_var,theMeanG , mon_sufx(0), myThid)
0161 CALL MON_OUT_RL(mon_var,theMean(1), mon_sufx(1), myThid)
0162 CALL MON_OUT_RL(mon_var,theMean(2), mon_sufx(2), myThid)
0163 mon_var='SnwH_max'
0164 CALL MON_OUT_RL(mon_var, theMax(1), mon_sufx(1), myThid)
0165 CALL MON_OUT_RL(mon_var, theMax(2), mon_sufx(2), myThid)
0166
0167
4c97384db0 Jean*0168 CALL MON_STATS_LATBND_RL(
0169 I 1, 1, 1, 2, yBand,
b8b300fc52 Jean*0170 I Tsrf, locMask, maskInC, rA, yC, locDr,
fc7306ba7d Jean*0171 O theMin, theMax, theMean, theVar, theVol,
0172 I myThid )
0173 theVolG= theVol(1)+theVol(2)
0174 theMeanG= theMean(1)*theVol(1)+theMean(2)*theVol(2)
0175 IF (theVolG.GT.0.) theMeanG = theMeanG / theVolG
0176
0177 mon_var='Tsrf_ave'
0178 CALL MON_OUT_RL(mon_var,theMeanG , mon_sufx(0), myThid)
0179 CALL MON_OUT_RL(mon_var,theMean(1), mon_sufx(1), myThid)
0180 CALL MON_OUT_RL(mon_var,theMean(2), mon_sufx(2), myThid)
0181 mon_var='Tsrf_min'
0182 CALL MON_OUT_RL(mon_var, theMin(1), mon_sufx(1), myThid)
0183 CALL MON_OUT_RL(mon_var, theMin(2), mon_sufx(2), myThid)
0184 mon_var='Tsrf_max'
0185 CALL MON_OUT_RL(mon_var, theMax(1), mon_sufx(1), myThid)
0186 CALL MON_OUT_RL(mon_var, theMax(2), mon_sufx(2), myThid)
0187
b1dc69f03d Jean*0188
0189 DO bj = myByLo(myThid), myByHi(myThid)
0190 DO bi = myBxLo(myThid), myBxHi(myThid)
0191 DO j=1-OLy,sNy+OLy
0192 DO i=1-OLx,sNx+OLx
0193 locMask(i,j,bi,bj)=iceMask(i,j,bi,bj)*iceHeight(i,j,bi,bj)
0194 ENDDO
0195 ENDDO
0196 ENDDO
0197 ENDDO
0198
fc7306ba7d Jean*0199
4c97384db0 Jean*0200 CALL MON_STATS_LATBND_RL(
0201 I 1, 1, 1, 2, yBand,
b8b300fc52 Jean*0202 I Tice1, locMask, maskInC, rA, yC, locDr,
fc7306ba7d Jean*0203 O theMin, theMax, theMean, theVar, theVol,
0204 I myThid )
0205 theVolG = theVol(1)+theVol(2)
0206 theMeanG= theMean(1)*theVol(1)+theMean(2)*theVol(2)
0207 IF (theVolG.GT.0.) theMeanG = theMeanG / theVolG
0208
0209
0210
0211
0212
0213 mon_var='Tic1_ave'
0214 CALL MON_OUT_RL(mon_var,theMeanG , mon_sufx(0), myThid)
0215 CALL MON_OUT_RL(mon_var,theMean(1), mon_sufx(1), myThid)
0216 CALL MON_OUT_RL(mon_var,theMean(2), mon_sufx(2), myThid)
0217 mon_var='Tic1_min'
0218 CALL MON_OUT_RL(mon_var, theMin(1), mon_sufx(1), myThid)
0219 CALL MON_OUT_RL(mon_var, theMin(2), mon_sufx(2), myThid)
0220 mon_var='Tic1_max'
0221 CALL MON_OUT_RL(mon_var, theMax(1), mon_sufx(1), myThid)
0222 CALL MON_OUT_RL(mon_var, theMax(2), mon_sufx(2), myThid)
d1c48a721f Jean*0223
fc7306ba7d Jean*0224
4c97384db0 Jean*0225 CALL MON_STATS_LATBND_RL(
0226 I 1, 1, 1, 2, yBand,
b8b300fc52 Jean*0227 I Tice2, locMask, maskInC, rA, yC, locDr,
fc7306ba7d Jean*0228 O theMin, theMax, theMean, theVar, theVol,
0229 I myThid )
0230 theMeanG= theMean(1)*theVol(1)+theMean(2)*theVol(2)
0231 IF (theVolG.GT.0.) theMeanG = theMeanG / theVolG
0232
0233 mon_var='Tic2_ave'
0234 CALL MON_OUT_RL(mon_var,theMeanG , mon_sufx(0), myThid)
0235 CALL MON_OUT_RL(mon_var,theMean(1), mon_sufx(1), myThid)
0236 CALL MON_OUT_RL(mon_var,theMean(2), mon_sufx(2), myThid)
0237 mon_var='Tic2_min'
0238 CALL MON_OUT_RL(mon_var, theMin(1), mon_sufx(1), myThid)
0239 CALL MON_OUT_RL(mon_var, theMin(2), mon_sufx(2), myThid)
0240 mon_var='Tic2_max'
0241 CALL MON_OUT_RL(mon_var, theMax(1), mon_sufx(1), myThid)
0242 CALL MON_OUT_RL(mon_var, theMax(2), mon_sufx(2), myThid)
b1dc69f03d Jean*0243
0244
3d1de02024 Jean*0245 CALL MON_CALC_STATS_RL(
b8b300fc52 Jean*0246 I 1, Qice1, locMask, maskInC, rA, locDr,
b1dc69f03d Jean*0247 O theMin0,theMax0,theMean1,theSD,theDel2,theVolG,
0248 I myThid )
3d1de02024 Jean*0249 CALL MON_CALC_STATS_RL(
b8b300fc52 Jean*0250 I 1, Qice2, locMask, maskInC, rA, locDr,
b1dc69f03d Jean*0251 O theMin0,theMax0,theMean2,theSD,theDel2,theVolG,
0252 I myThid )
0253 theEnergy = theEnergy -rhoi*(theMean1+theMean2)*theVolG/2
0254 mon_var='TotEnerg'
0255 CALL MON_OUT_RL(mon_var, theEnergy, mon_sufx(0), myThid)
de836be2bc Jean*0256
0257
0258
0259
0260
0261
0262 IF ( thSIceBalanceAtmFW.NE.0 ) THEN
0263 CALL MON_OUT_RL('adjustFrW',adjustFrW,mon_string_none,myThid)
0264 ENDIF
fc7306ba7d Jean*0265
49aab2cab9 Jean*0266 IF ( MASTER_CPU_IO(myThid) ) THEN
d1c48a721f Jean*0267
88f72205aa Jean*0268
d1c48a721f Jean*0269
0270 IF (mon_write_stdout) THEN
0271 WRITE(msgBuf,'(2A)') '// ==========================',
0272 & '============================='
0273 CALL PRINT_MESSAGE( msgBuf, mon_ioUnit, SQUEEZE_RIGHT , 1)
0274 WRITE(msgBuf,'(A)')
0275 & '// End MONITOR Therm.SeaIce statistics'
0276 CALL PRINT_MESSAGE( msgBuf, mon_ioUnit, SQUEEZE_RIGHT , 1)
0277 WRITE(msgBuf,'(2A)') '// ==========================',
0278 & '============================='
0279 CALL PRINT_MESSAGE( msgBuf, mon_ioUnit, SQUEEZE_RIGHT , 1)
0280 ENDIF
fc7306ba7d Jean*0281
d1c48a721f Jean*0282 mon_write_stdout = .FALSE.
0283 mon_write_mnc = .FALSE.
7e93e819a5 Jean*0284
49aab2cab9 Jean*0285
d1c48a721f Jean*0286 ENDIF
0287
0288
fc7306ba7d Jean*0289 ENDIF
0290
0291 #endif /* ALLOW_MONITOR */
0292 #endif /* ALLOW_THSICE */
d1c48a721f Jean*0293
fc7306ba7d Jean*0294 RETURN
0295 END