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
c3c45044a0 Jean*0004
87ea84cac6 Jean*0005
c3c45044a0 Jean*0006 SUBROUTINE THSICE_OUTPUT( myTime, myIter, myThid )
87ea84cac6 Jean*0007
0008
0009
c3c45044a0 Jean*0010
0011
87ea84cac6 Jean*0012
c3c45044a0 Jean*0013
0014
87ea84cac6 Jean*0015
0016
0017
0018
fc7306ba7d Jean*0019 IMPLICIT NONE
0020
0021
0022 #include "SIZE.h"
0023 #include "EEPARAMS.h"
0024 #include "PARAMS.h"
0025 #include "THSICE_PARAMS.h"
87ea84cac6 Jean*0026 #include "THSICE_VARS.h"
0027 #include "THSICE_TAVE.h"
fc7306ba7d Jean*0028
87ea84cac6 Jean*0029
fc7306ba7d Jean*0030
c3c45044a0 Jean*0031
0032
0033
fc7306ba7d Jean*0034 _RL myTime
0035 INTEGER myIter
0036 INTEGER myThid
87ea84cac6 Jean*0037
fc7306ba7d Jean*0038
0039 #ifdef ALLOW_THSICE
0040
a444616fe4 Jean*0041
94a46dfe0d Jean*0042 LOGICAL DIFFERENT_MULTIPLE
0043 EXTERNAL DIFFERENT_MULTIPLE
a444616fe4 Jean*0044
0045
af20bc5e19 Jean*0046 CHARACTER*(10) suff
a444616fe4 Jean*0047 #ifdef ALLOW_TIMEAVE
0048 CHARACTER*(MAX_LEN_MBUF) fn
62772d8f61 Jean*0049 INTEGER bi, bj, kl
a444616fe4 Jean*0050 #endif
7c9cf9d5bc Jean*0051 #ifdef ALLOW_MNC
df4e8f7bcf Ed H*0052 INTEGER i
0053 CHARACTER*(MAX_LEN_MBUF) mncf
b22b541fe9 Ed H*0054 CHARACTER*(1) pf
df4e8f7bcf Ed H*0055 #endif
fc7306ba7d Jean*0056
0057 #ifdef ALLOW_TIMEAVE
0058
0059
0060 IF ( myIter .EQ. nIter0 ) THEN
0061 DO bj = myByLo(myThid), myByHi(myThid)
0062 DO bi = myBxLo(myThid), myBxHi(myThid)
87ea84cac6 Jean*0063 CALL TIMEAVE_RESET(ice_fract_Ave, 1, bi, bj, myThid)
0064 CALL TIMEAVE_RESET(ice_iceH_Ave, 1, bi, bj, myThid)
0065 CALL TIMEAVE_RESET(ice_snowH_Ave, 1, bi, bj, myThid)
0066 CALL TIMEAVE_RESET(ice_Tsrf_Ave, 1, bi, bj, myThid)
0067 CALL TIMEAVE_RESET(ice_Tice1_Ave, 1, bi, bj, myThid)
0068 CALL TIMEAVE_RESET(ice_Tice2_Ave, 1, bi, bj, myThid)
8d49675495 Jean*0069
87ea84cac6 Jean*0070 CALL TIMEAVE_RESET(ice_flx2oc_Ave, 1, bi, bj, myThid)
0071 CALL TIMEAVE_RESET(ice_frw2oc_Ave, 1, bi, bj, myThid)
0072 CALL TIMEAVE_RESET(ice_salFx_Ave, 1, bi, bj, myThid)
0073 CALL TIMEAVE_RESET(ice_flxAtm_Ave, 1, bi, bj, myThid)
0074 CALL TIMEAVE_RESET(ice_frwAtm_Ave, 1, bi, bj, myThid)
0075 CALL TIMEAVE_RESET(ice_albedo_Ave, 1, bi, bj, myThid)
0076 CALL TIMEAVE_RESET(ice_tMxL_Ave, 1, bi, bj, myThid)
0077 CALL TIMEAVE_RESET(ice_sMxL_Ave, 1, bi, bj, myThid)
77253a797d Jean*0078 ice_timeAve(bi,bj) = 0.
fc7306ba7d Jean*0079 ENDDO
0080 ENDDO
0081
0082
332055f833 Jean*0083 ELSEIF (
94a46dfe0d Jean*0084 & DIFFERENT_MULTIPLE(thSIce_taveFreq,myTime,deltaTClock)
fc7306ba7d Jean*0085 & ) THEN
62772d8f61 Jean*0086
0087
fc7306ba7d Jean*0088 DO bj = myByLo(myThid), myByHi(myThid)
0089 DO bi = myBxLo(myThid), myBxHi(myThid)
62772d8f61 Jean*0090
87ea84cac6 Jean*0091 CALL TIMEAVE_NORMA_2V( ice_iceH_Ave,
0092 & ice_fract_Ave, 1, bi, bj, myThid )
0093 CALL TIMEAVE_NORMA_2V( ice_snowH_Ave,
0094 & ice_fract_Ave, 1, bi, bj, myThid )
0095 CALL TIMEAVE_NORMA_2V( ice_Tsrf_Ave,
0096 & ice_fract_Ave, 1, bi, bj, myThid )
0097 CALL TIMEAVE_NORMA_2V( ice_Tice1_Ave,
0098 & ice_fract_Ave, 1, bi, bj, myThid )
0099 CALL TIMEAVE_NORMA_2V( ice_Tice2_Ave,
0100 & ice_fract_Ave, 1, bi, bj, myThid )
8d49675495 Jean*0101
0102
87ea84cac6 Jean*0103 CALL TIMEAVE_NORMA_2V( ice_albedo_Ave,
0104 & ice_fract_Ave, 1, bi, bj, myThid )
62772d8f61 Jean*0105
0106
77253a797d Jean*0107 CALL TIMEAVE_NORMALIZE(ice_fract_Ave,ice_timeAve,1 ,
fc7306ba7d Jean*0108 & bi,bj,myThid)
77253a797d Jean*0109
fc7306ba7d Jean*0110
77253a797d Jean*0111
fc7306ba7d Jean*0112
77253a797d Jean*0113
fc7306ba7d Jean*0114
77253a797d Jean*0115
fc7306ba7d Jean*0116
77253a797d Jean*0117
fc7306ba7d Jean*0118
77253a797d Jean*0119
fc7306ba7d Jean*0120
77253a797d Jean*0121 CALL TIMEAVE_NORMALIZE(ice_flx2oc_Ave, ice_timeAve, 1 ,
87ea84cac6 Jean*0122 & bi,bj,myThid)
77253a797d Jean*0123 CALL TIMEAVE_NORMALIZE(ice_frw2oc_Ave, ice_timeAve, 1 ,
fc7306ba7d Jean*0124 & bi,bj,myThid)
77253a797d Jean*0125 CALL TIMEAVE_NORMALIZE(ice_salFx_Ave, ice_timeAve, 1 ,
fc7306ba7d Jean*0126 & bi,bj,myThid)
9669509dca Jean*0127 IF ( fluidIsWater ) THEN
77253a797d Jean*0128 CALL TIMEAVE_NORMALIZE(ice_flxAtm_Ave,ice_timeAve, 1 ,
fc7306ba7d Jean*0129 & bi,bj,myThid)
77253a797d Jean*0130 CALL TIMEAVE_NORMALIZE(ice_frwAtm_Ave,ice_timeAve, 1 ,
fc7306ba7d Jean*0131 & bi,bj,myThid)
052421d6c5 Jean*0132 ENDIF
87ea84cac6 Jean*0133 IF ( stepFwd_oceMxL ) THEN
77253a797d Jean*0134 CALL TIMEAVE_NORMALIZE(ice_tMxL_Ave, ice_timeAve, 1 ,
fc7306ba7d Jean*0135 & bi,bj,myThid)
77253a797d Jean*0136 CALL TIMEAVE_NORMALIZE(ice_sMxL_Ave, ice_timeAve, 1 ,
87ea84cac6 Jean*0137 & bi,bj,myThid)
0138 ENDIF
fc7306ba7d Jean*0139 ENDDO
0140 ENDDO
332055f833 Jean*0141
62772d8f61 Jean*0142
0143
0144
0145
df4e8f7bcf Ed H*0146 IF ( thSIce_tave_mdsio ) THEN
0147
af20bc5e19 Jean*0148 IF ( rwSuffixType.EQ.0 ) THEN
0149 WRITE(fn,'(A,I10.10)') 'thSIce_tave.', myIter
0150 ELSE
0151 CALL RW_GET_SUFFIX( suff, myTime, myIter, myThid )
0152 WRITE(fn,'(A,A)') 'thSIce_tave.', suff
0153 ENDIF
df4e8f7bcf Ed H*0154
ef0c7f51d0 Jean*0155 CALL WRITE_REC_XY_RL( fn, ice_fract_Ave, 1, myIter, myThid )
0156 CALL WRITE_REC_XY_RL( fn, ice_iceH_Ave, 2, myIter, myThid )
0157 CALL WRITE_REC_XY_RL( fn, ice_snowH_Ave, 3, myIter, myThid )
0158 CALL WRITE_REC_XY_RL( fn, ice_Tsrf_Ave, 4, myIter, myThid )
0159 CALL WRITE_REC_XY_RL( fn, ice_Tice1_Ave, 5, myIter, myThid )
0160 CALL WRITE_REC_XY_RL( fn, ice_Tice2_Ave, 6, myIter, myThid )
8d49675495 Jean*0161
0162 CALL WRITE_REC_XY_RL( fn, ice_albedo_Ave, 7, myIter, myThid )
0163 CALL WRITE_REC_XY_RL( fn, ice_flx2oc_Ave, 8, myIter, myThid )
0164 CALL WRITE_REC_XY_RL( fn, ice_frw2oc_Ave, 9, myIter, myThid )
0165 kl = 10
ef0c7f51d0 Jean*0166 CALL WRITE_REC_XY_RL( fn, ice_salFx_Ave, kl, myIter, myThid )
df4e8f7bcf Ed H*0167 IF ( fluidIsWater ) THEN
ef0c7f51d0 Jean*0168 kl = kl+1
0169 CALL WRITE_REC_XY_RL(fn, ice_flxAtm_Ave,kl, myIter, myThid )
0170 kl = kl+1
0171 CALL WRITE_REC_XY_RL(fn, ice_frwAtm_Ave,kl, myIter, myThid )
df4e8f7bcf Ed H*0172 ENDIF
0173 IF ( stepFwd_oceMxL ) THEN
ef0c7f51d0 Jean*0174 kl = kl+1
0175 CALL WRITE_REC_XY_RL(fn, ice_tMxL_Ave, kl, myIter, myThid )
0176 kl = kl+1
0177 CALL WRITE_REC_XY_RL(fn, ice_sMxL_Ave, kl, myIter, myThid )
df4e8f7bcf Ed H*0178 ENDIF
62772d8f61 Jean*0179
052421d6c5 Jean*0180 ENDIF
df4e8f7bcf Ed H*0181
0182 #ifdef ALLOW_MNC
0183 IF ( useMNC .AND. thSIce_tave_mnc ) THEN
a444616fe4 Jean*0184 _BARRIER
b22b541fe9 Ed H*0185 IF ( writeBinaryPrec .EQ. precFloat64 ) THEN
0186 pf(1:1) = 'D'
0187 ELSE
0188 pf(1:1) = 'R'
0189 ENDIF
df4e8f7bcf Ed H*0190 DO i = 1,MAX_LEN_MBUF
0191 mncf(i:i) = ' '
0192 ENDDO
0193
0194 mncf(1:11) = 'thsice_tave'
7c9cf9d5bc Jean*0195 CALL MNC_CW_SET_UDIM(mncf, -1, myThid)
0196 CALL MNC_CW_RL_W_S('D',mncf,0,0,'T', myTime, myThid)
0197 CALL MNC_CW_SET_UDIM(mncf, 0, myThid)
0198 CALL MNC_CW_I_W_S('I',mncf,0,0,'iter', myIter, myThid)
b22b541fe9 Ed H*0199 CALL MNC_CW_RL_W(pf,mncf,0,0,
7c9cf9d5bc Jean*0200 & 'fract_ave', ice_fract_Ave, myThid)
b22b541fe9 Ed H*0201 CALL MNC_CW_RL_W(pf,mncf,0,0,
7c9cf9d5bc Jean*0202 & 'iceH_ave', ice_iceH_Ave, myThid)
b22b541fe9 Ed H*0203 CALL MNC_CW_RL_W(pf,mncf,0,0,
7c9cf9d5bc Jean*0204 & 'snowH_ave', ice_snowH_Ave, myThid)
b22b541fe9 Ed H*0205 CALL MNC_CW_RL_W(pf,mncf,0,0,
7c9cf9d5bc Jean*0206 & 'Tsrf_ave', ice_Tsrf_Ave, myThid)
b22b541fe9 Ed H*0207 CALL MNC_CW_RL_W(pf,mncf,0,0,
7c9cf9d5bc Jean*0208 & 'Tice1_ave', ice_Tice1_Ave, myThid)
b22b541fe9 Ed H*0209 CALL MNC_CW_RL_W(pf,mncf,0,0,
7c9cf9d5bc Jean*0210 & 'Tice2_ave', ice_Tice2_Ave, myThid)
8d49675495 Jean*0211
0212
b22b541fe9 Ed H*0213 CALL MNC_CW_RL_W(pf,mncf,0,0,
7c9cf9d5bc Jean*0214 & 'albedo_ave',ice_albedo_Ave,myThid)
b22b541fe9 Ed H*0215 CALL MNC_CW_RL_W(pf,mncf,0,0,
7c9cf9d5bc Jean*0216 & 'flx2oc_ave',ice_flx2oc_Ave,myThid)
b22b541fe9 Ed H*0217 CALL MNC_CW_RL_W(pf,mncf,0,0,
7c9cf9d5bc Jean*0218 & 'frw2oc_ave',ice_frw2oc_Ave,myThid)
df4e8f7bcf Ed H*0219 IF ( fluidIsWater ) THEN
b22b541fe9 Ed H*0220 CALL MNC_CW_RL_W(pf,mncf,0,0,
7c9cf9d5bc Jean*0221 & 'flxAtm_ave',ice_flxAtm_Ave,myThid)
b22b541fe9 Ed H*0222 CALL MNC_CW_RL_W(pf,mncf,0,0,
7c9cf9d5bc Jean*0223 & 'frwAtm_ave',ice_frwAtm_Ave,myThid)
df4e8f7bcf Ed H*0224 ENDIF
0225 IF ( stepFwd_oceMxL ) THEN
b22b541fe9 Ed H*0226 CALL MNC_CW_RL_W(pf,mncf,0,0,'tMxL_ave',ice_tMxL_Ave,myThid)
0227 CALL MNC_CW_RL_W(pf,mncf,0,0,'sMxL_ave',ice_sMxL_Ave,myThid)
df4e8f7bcf Ed H*0228 ENDIF
a444616fe4 Jean*0229 _BARRIER
87ea84cac6 Jean*0230 ENDIF
df4e8f7bcf Ed H*0231 #endif
fc7306ba7d Jean*0232
62772d8f61 Jean*0233
fc7306ba7d Jean*0234 DO bj = myByLo(myThid), myByHi(myThid)
0235 DO bi = myBxLo(myThid), myBxHi(myThid)
87ea84cac6 Jean*0236 CALL TIMEAVE_RESET(ice_fract_Ave, 1, bi,bj, myThid)
0237 CALL TIMEAVE_RESET(ice_iceH_Ave, 1, bi,bj, myThid)
0238 CALL TIMEAVE_RESET(ice_snowH_Ave, 1, bi,bj, myThid)
0239 CALL TIMEAVE_RESET(ice_Tsrf_Ave, 1, bi,bj, myThid)
0240 CALL TIMEAVE_RESET(ice_Tice1_Ave, 1, bi,bj, myThid)
0241 CALL TIMEAVE_RESET(ice_Tice2_Ave, 1, bi,bj, myThid)
8d49675495 Jean*0242
87ea84cac6 Jean*0243 CALL TIMEAVE_RESET(ice_flx2oc_Ave, 1, bi,bj, myThid)
0244 CALL TIMEAVE_RESET(ice_frw2oc_Ave, 1, bi,bj, myThid)
0245 CALL TIMEAVE_RESET(ice_salFx_Ave, 1, bi,bj, myThid)
0246 CALL TIMEAVE_RESET(ice_flxAtm_Ave, 1, bi,bj, myThid)
0247 CALL TIMEAVE_RESET(ice_frwAtm_Ave, 1, bi,bj, myThid)
0248 CALL TIMEAVE_RESET(ice_albedo_Ave, 1, bi,bj, myThid)
0249 CALL TIMEAVE_RESET(ice_tMxL_Ave, 1, bi, bj, myThid)
0250 CALL TIMEAVE_RESET(ice_sMxL_Ave, 1, bi, bj, myThid)
77253a797d Jean*0251 ice_timeAve(bi,bj) = 0.
fc7306ba7d Jean*0252 ENDDO
0253 ENDDO
332055f833 Jean*0254
fc7306ba7d Jean*0255 ENDIF
0256
0257 #endif /* ALLOW_TIMEAVE */
0258
0259
332055f833 Jean*0260 IF (
b17871c70b Jean*0261 & DIFFERENT_MULTIPLE( thSIce_diagFreq, myTime, deltaTClock )
0262 & .OR. dumpInitAndLast.AND.( myTime.EQ.endTime .OR.
0263 & myTime.EQ.startTime )
0264 & ) THEN
60671ed2f5 Jean*0265
d68d315665 Jean*0266 IF ( thSIce_snapshot_mdsio .AND.
0267 & ( myTime.NE.startTime .OR. .NOT.thSIce_skipThermo
0268 & .OR. .NOT.useCoupler )
0269 & ) THEN
332055f833 Jean*0270
af20bc5e19 Jean*0271 IF ( rwSuffixType.EQ.0 ) THEN
0272 WRITE(suff,'(I10.10)') myIter
0273 ELSE
0274 CALL RW_GET_SUFFIX( suff, myTime, myIter, myThid )
0275 ENDIF
332055f833 Jean*0276
df4e8f7bcf Ed H*0277 CALL WRITE_FLD_XY_RL('ice_fract.', suff,iceMask,
0278 & myIter,myThid)
c06c141378 Jean*0279 CALL WRITE_FLD_XY_RL('ice_iceH.', suff,iceHeight,
df4e8f7bcf Ed H*0280 & myIter,myThid)
c06c141378 Jean*0281 CALL WRITE_FLD_XY_RL('ice_snowH.', suff,snowHeight,
df4e8f7bcf Ed H*0282 & myIter,myThid)
0283 CALL WRITE_FLD_XY_RL('ice_Tsrf.', suff,Tsrf,
0284 & myIter,myThid)
0285 CALL WRITE_FLD_XY_RL('ice_Tice1.', suff,Tice1,
0286 & myIter,myThid)
0287 CALL WRITE_FLD_XY_RL('ice_Tice2.', suff,Tice2,
0288 & myIter,myThid)
0289 CALL WRITE_FLD_XY_RL('ice_Qice1.', suff,Qice1,
0290 & myIter,myThid)
0291 CALL WRITE_FLD_XY_RL('ice_Qice2.', suff,Qice2,
0292 & myIter,myThid)
0293 CALL WRITE_FLD_XY_RL('ice_snowAge.',suff,snowAge,
0294 & myIter,myThid)
332055f833 Jean*0295 IF ( myTime.NE.startTime ) THEN
7269783f6f Jean*0296 CALL WRITE_FLD_XY_RL('ice_flxAtm.',suff,icFlxAtm,
0297 & myIter,myThid)
0298 CALL WRITE_FLD_XY_RL('ice_frwAtm.',suff,icFrwAtm,
0299 & myIter,myThid)
332055f833 Jean*0300 ENDIF
df4e8f7bcf Ed H*0301 IF ( stepFwd_oceMxL ) THEN
0302 CALL WRITE_FLD_XY_RL('ice_tOceMxL.', suff, tOceMxL,
0303 & myIter,myThid)
0304 CALL WRITE_FLD_XY_RL('ice_sOceMxL.', suff, sOceMxL,
332055f833 Jean*0305 & myIter,myThid)
df4e8f7bcf Ed H*0306 ENDIF
332055f833 Jean*0307
df4e8f7bcf Ed H*0308 ENDIF
0309
0310 #ifdef ALLOW_MNC
0311 IF ( thSIce_snapshot_mnc ) THEN
a444616fe4 Jean*0312 _BARRIER
b22b541fe9 Ed H*0313 IF ( writeBinaryPrec .EQ. precFloat64 ) THEN
0314 pf(1:1) = 'D'
0315 ELSE
0316 pf(1:1) = 'R'
0317 ENDIF
df4e8f7bcf Ed H*0318 DO i = 1,MAX_LEN_MBUF
0319 mncf(i:i) = ' '
0320 ENDDO
0321
0322 mncf(1:15) = 'thsice_snapshot'
0323 CALL MNC_CW_SET_UDIM(mncf, -1, myThid)
0324 CALL MNC_CW_I_W_S('I',mncf,0,0,'iter', myIter, myThid)
0325 CALL MNC_CW_SET_UDIM(mncf, 0, myThid)
0326 CALL MNC_CW_RL_W_S('D',mncf,0,0,'T', myTime, myThid)
b22b541fe9 Ed H*0327 CALL MNC_CW_RL_W(pf,mncf,0,0,'iceMask', iceMask, myThid)
0328 CALL MNC_CW_RL_W(pf,mncf,0,0,'iceHeight', iceHeight, myThid)
0329 CALL MNC_CW_RL_W(pf,mncf,0,0,'snowHeight',snowHeight,myThid)
0330 CALL MNC_CW_RL_W(pf,mncf,0,0,'Tsrf', Tsrf, myThid)
0331 CALL MNC_CW_RL_W(pf,mncf,0,0,'Tice1', Tice1, myThid)
0332 CALL MNC_CW_RL_W(pf,mncf,0,0,'Tice2', Tice1, myThid)
0333 CALL MNC_CW_RL_W(pf,mncf,0,0,'Qice1', Qice1, myThid)
0334 CALL MNC_CW_RL_W(pf,mncf,0,0,'Qice2', Qice2, myThid)
0335 CALL MNC_CW_RL_W(pf,mncf,0,0,'snowAge', snowAge, myThid)
df4e8f7bcf Ed H*0336 IF ( stepFwd_oceMxL ) THEN
b22b541fe9 Ed H*0337 CALL MNC_CW_RL_W(pf,mncf,0,0,'tOceMxL',tOceMxL,myThid)
0338 CALL MNC_CW_RL_W(pf,mncf,0,0,'sOceMxL',sOceMxL,myThid)
df4e8f7bcf Ed H*0339 ENDIF
a444616fe4 Jean*0340 _BARRIER
df4e8f7bcf Ed H*0341 ENDIF
0342 #endif /* ALLOW_MNC */
0343
fc7306ba7d Jean*0344 ENDIF
332055f833 Jean*0345
fc7306ba7d Jean*0346 IF ( thSIce_monFreq.GT. 0. _d 0 )
0347 & CALL THSICE_MONITOR( myTime, myIter, myThid )
0348
0349 #endif /* ALLOW_THSICE */
332055f833 Jean*0350
fc7306ba7d Jean*0351 RETURN
0352 END