File indexing completed on 2018-03-02 18:37:23 UTC
view on githubraw file Latest commit add29e06 on 2018-01-31 20:35:05 UTC
d676f916b2 Jean*0001 #include "AIM_OPTIONS.h"
0002
6d903038e0 Jean*0003
0004
0005
d676f916b2 Jean*0006 SUBROUTINE AIM_WRITE_TAVE( myTime, myIter, myThid )
6d903038e0 Jean*0007
0008
d676f916b2 Jean*0009
0010
0011
0012
6d903038e0 Jean*0013
0014
d676f916b2 Jean*0015 IMPLICIT NONE
0016
0017
0018 #include "SIZE.h"
0019 #include "EEPARAMS.h"
0020 #include "PARAMS.h"
3a474aa258 Jean*0021 #include "AIM_PARAMS.h"
10308cbe80 Jean*0022 #include "AIM_TAVE.h"
d676f916b2 Jean*0023
6d903038e0 Jean*0024
d676f916b2 Jean*0025
6d903038e0 Jean*0026
0027
0028
d676f916b2 Jean*0029 _RL myTime
0030 INTEGER myIter
0031 INTEGER myThid
6d903038e0 Jean*0032
d676f916b2 Jean*0033 #ifdef ALLOW_AIM
ab33782b56 Jean*0034 #ifdef ALLOW_AIM_TAVE
d676f916b2 Jean*0035
6d903038e0 Jean*0036
0037 LOGICAL DIFFERENT_MULTIPLE
0038 EXTERNAL DIFFERENT_MULTIPLE
0039
0040
d676f916b2 Jean*0041
10308cbe80 Jean*0042 INTEGER bi, bj
6d903038e0 Jean*0043 CHARACTER*(10) suff
0044 CHARACTER*(MAX_LEN_FNAM) fn
0045 CHARACTER*(MAX_LEN_MBUF) msgBuf
ad0ca66649 Ed H*0046 #ifdef ALLOW_MNC
0047 CHARACTER*(8) mncfn
b22b541fe9 Ed H*0048 CHARACTER*(1) pf
ad0ca66649 Ed H*0049 #endif
6d903038e0 Jean*0050
3a474aa258 Jean*0051 IF (aim_taveFreq.LE.0.) RETURN
6d903038e0 Jean*0052
4b996cbf32 Jean*0053 IF ( myIter.EQ.nIter0 ) THEN
0054
0055 DO bj = myByLo(myThid), myByHi(myThid)
0056 DO bi = myBxLo(myThid), myBxHi(myThid)
0057 CALL TIMEAVE_RESET(USTRtave, 1, bi, bj, myThid)
0058 CALL TIMEAVE_RESET(VSTRtave, 1, bi, bj, myThid)
0059 CALL TIMEAVE_RESET(TSRtave, 1, bi, bj, myThid)
0060 CALL TIMEAVE_RESET(OLRtave, 1, bi, bj, myThid)
0061 CALL TIMEAVE_RESET(SSRtave, 1, bi, bj, myThid)
0062 CALL TIMEAVE_RESET(SLRtave, 1, bi, bj, myThid)
0063 CALL TIMEAVE_RESET(SHFtave, 1, bi, bj, myThid)
0064 CALL TIMEAVE_RESET(EVAPtave, 1, bi, bj, myThid)
0065 CALL TIMEAVE_RESET(PRECNVtave,1, bi, bj, myThid)
0066 CALL TIMEAVE_RESET(PRECLStave,1, bi, bj, myThid)
0067 CALL TIMEAVE_RESET(CLOUDCtave,1, bi, bj, myThid)
0068 CALL TIMEAVE_RESET(CLTOPtave, 1, bi, bj, myThid)
0069 CALL TIMEAVE_RESET(CBMFtave, 1, bi, bj, myThid)
0070 CALL TIMEAVE_RESET(DRAGtave, 1, bi, bj, myThid)
0071 CALL TIMEAVE_RESET(aimV0tave, 1, bi, bj, myThid)
0072 CALL TIMEAVE_RESET(aimT0tave, 1, bi, bj, myThid)
0073 CALL TIMEAVE_RESET(aimQ0tave, 1, bi, bj, myThid)
0074 CALL TIMEAVE_RESET(EnFxPrtave,1, bi, bj, myThid)
0075 CALL TIMEAVE_RESET(albedotave,1, bi, bj, myThid)
0076 CALL TIMEAVE_RESET(dTsurftave,1, bi, bj, myThid)
0077 CALL TIMEAVE_RESET(aimRHtave,Nr, bi, bj, myThid)
10308cbe80 Jean*0078 aim_timeAve(bi,bj) = 0.
4b996cbf32 Jean*0079 ENDDO
0080 ENDDO
0081 ENDIF
0082
d676f916b2 Jean*0083
0084 IF ( myIter.NE.nIter0 .AND.
94a46dfe0d Jean*0085 & DIFFERENT_MULTIPLE(aim_taveFreq,myTime,deltaTClock)
391a25579e Jean*0086 & ) THEN
d676f916b2 Jean*0087
0088
0089 DO bj = myByLo(myThid), myByHi(myThid)
0090 DO bi = myBxLo(myThid), myBxHi(myThid)
10308cbe80 Jean*0091 CALL TIMEAVE_NORMALIZE(USTRtave, aim_timeAve,1,bi,bj,myThid)
0092 CALL TIMEAVE_NORMALIZE(VSTRtave, aim_timeAve,1,bi,bj,myThid)
0093 CALL TIMEAVE_NORMALIZE(TSRtave, aim_timeAve,1,bi,bj,myThid)
0094 CALL TIMEAVE_NORMALIZE(OLRtave, aim_timeAve,1,bi,bj,myThid)
0095 CALL TIMEAVE_NORMALIZE(SSRtave, aim_timeAve,1,bi,bj,myThid)
0096 CALL TIMEAVE_NORMALIZE(SLRtave, aim_timeAve,1,bi,bj,myThid)
0097 CALL TIMEAVE_NORMALIZE(SHFtave, aim_timeAve,1,bi,bj,myThid)
0098 CALL TIMEAVE_NORMALIZE(EVAPtave, aim_timeAve,1,bi,bj,myThid)
0099 CALL TIMEAVE_NORMALIZE(PRECNVtave,aim_timeAve,1,bi,bj,myThid)
0100 CALL TIMEAVE_NORMALIZE(PRECLStave,aim_timeAve,1,bi,bj,myThid)
0101 CALL TIMEAVE_NORMALIZE(CLOUDCtave,aim_timeAve,1,bi,bj,myThid)
0102 CALL TIMEAVE_NORMALIZE(CLTOPtave, aim_timeAve,1,bi,bj,myThid)
0103 CALL TIMEAVE_NORMALIZE(CBMFtave, aim_timeAve,1,bi,bj,myThid)
0104 CALL TIMEAVE_NORMALIZE(DRAGtave, aim_timeAve,1,bi,bj,myThid)
0105 CALL TIMEAVE_NORMALIZE(aimV0tave, aim_timeAve,1,bi,bj,myThid)
0106 CALL TIMEAVE_NORMALIZE(aimT0tave, aim_timeAve,1,bi,bj,myThid)
0107 CALL TIMEAVE_NORMALIZE(aimQ0tave, aim_timeAve,1,bi,bj,myThid)
0108 CALL TIMEAVE_NORMALIZE(EnFxPrtave,aim_timeAve,1,bi,bj,myThid)
0109 CALL TIMEAVE_NORMALIZE(albedotave,aim_timeAve,1,bi,bj,myThid)
0110 CALL TIMEAVE_NORMALIZE(dTsurftave,aim_timeAve,1,bi,bj,myThid)
0111
0112 CALL TIMEAVE_NORMALIZE(aimRHtave,aim_timeAve,Nr,bi,bj,myThid)
d676f916b2 Jean*0113 ENDDO
0114 ENDDO
0115
ad0ca66649 Ed H*0116 #ifdef ALLOW_MNC
78ad6fc820 Ed H*0117 IF (useMNC .AND. aim_timeave_mnc) THEN
10308cbe80 Jean*0118 _BARRIER
6d903038e0 Jean*0119
b22b541fe9 Ed H*0120 IF ( writeBinaryPrec .EQ. precFloat64 ) THEN
0121 pf(1:1) = 'D'
0122 ELSE
0123 pf(1:1) = 'R'
0124 ENDIF
ad0ca66649 Ed H*0125
0126 mncfn(1:8) = 'aim_tave'
0127 CALL MNC_CW_SET_UDIM(mncfn, -1, myThid)
0128 CALL MNC_CW_RL_W_S('D',mncfn,0,0,'T',myTime,myThid)
0129 CALL MNC_CW_SET_UDIM(mncfn, 0, myThid)
0130 CALL MNC_CW_I_W_S('I',mncfn,0,0,'iter',myIter,myThid)
6d903038e0 Jean*0131
b22b541fe9 Ed H*0132 CALL MNC_CW_RL_W(pf,mncfn,0,0,'USTRtave', USTRtave, myThid)
0133 CALL MNC_CW_RL_W(pf,mncfn,0,0,'VSTRtave', VSTRtave, myThid)
0134 CALL MNC_CW_RL_W(pf,mncfn,0,0,'TSRtave', TSRtave, myThid)
0135 CALL MNC_CW_RL_W(pf,mncfn,0,0,'OLRtave', OLRtave, myThid)
0136 CALL MNC_CW_RL_W(pf,mncfn,0,0,'SSRtave', SSRtave, myThid)
0137 CALL MNC_CW_RL_W(pf,mncfn,0,0,'SLRtave', SLRtave, myThid)
0138 CALL MNC_CW_RL_W(pf,mncfn,0,0,'SHFtave', SHFtave, myThid)
0139 CALL MNC_CW_RL_W(pf,mncfn,0,0,'EVAPtave', EVAPtave, myThid)
0140 CALL MNC_CW_RL_W(pf,mncfn,0,0,'PRECNVtave',PRECNVtave,myThid)
0141 CALL MNC_CW_RL_W(pf,mncfn,0,0,'PRECLStave',PRECLStave,myThid)
0142 CALL MNC_CW_RL_W(pf,mncfn,0,0,'CLOUDCtave',CLOUDCtave,myThid)
0143 CALL MNC_CW_RL_W(pf,mncfn,0,0,'CLTOPtave', CLTOPtave, myThid)
0144 CALL MNC_CW_RL_W(pf,mncfn,0,0,'CBMFtave', CBMFtave, myThid)
0145 CALL MNC_CW_RL_W(pf,mncfn,0,0,'DRAGtave', DRAGtave, myThid)
0146 CALL MNC_CW_RL_W(pf,mncfn,0,0,'aimV0tave', aimV0tave, myThid)
0147 CALL MNC_CW_RL_W(pf,mncfn,0,0,'aimT0tave', aimT0tave, myThid)
0148 CALL MNC_CW_RL_W(pf,mncfn,0,0,'aimQ0tave', aimQ0tave, myThid)
0149 CALL MNC_CW_RL_W(pf,mncfn,0,0,'EnFxPrtave',EnFxPrtave,myThid)
0150 CALL MNC_CW_RL_W(pf,mncfn,0,0,'albedotave',albedotave,myThid)
0151 CALL MNC_CW_RL_W(pf,mncfn,0,0,'dTsurftave',dTsurftave,myThid)
0152 CALL MNC_CW_RL_W(pf,mncfn,0,0,'aimRHtave', aimRHtave, myThid)
6d903038e0 Jean*0153
10308cbe80 Jean*0154 _BARRIER
ad0ca66649 Ed H*0155 ENDIF
0156 #endif /* ALLOW_MNC */
0157
78ad6fc820 Ed H*0158 IF (aim_timeave_mdsio) THEN
ab33782b56 Jean*0159 IF ( rwSuffixType.EQ.0 ) THEN
0160 WRITE(suff,'(I10.10)') myIter
0161 ELSE
0162 CALL RW_GET_SUFFIX( suff, myTime, myIter, myThid )
0163 ENDIF
ad0ca66649 Ed H*0164
ab33782b56 Jean*0165 WRITE(fn,'(A,A)') 'aimPhytave.', suff
6d903038e0 Jean*0166 CALL WRITE_REC_XY_RL( fn, USTRtave, 1, myIter, myThid )
0167 CALL WRITE_REC_XY_RL( fn, VSTRtave, 2, myIter, myThid )
0168 CALL WRITE_REC_XY_RL( fn, TSRtave , 3, myIter, myThid )
0169 CALL WRITE_REC_XY_RL( fn, OLRtave , 4, myIter, myThid )
0170 CALL WRITE_REC_XY_RL( fn, SSRtave , 5, myIter, myThid )
0171 CALL WRITE_REC_XY_RL( fn, SLRtave , 6, myIter, myThid )
0172 CALL WRITE_REC_XY_RL( fn, SHFtave , 7, myIter, myThid )
0173 CALL WRITE_REC_XY_RL( fn, EVAPtave, 8, myIter, myThid )
0174 CALL WRITE_REC_XY_RL( fn, PRECNVtave, 9, myIter, myThid )
0175 CALL WRITE_REC_XY_RL( fn, PRECLStave, 10, myIter, myThid )
0176 CALL WRITE_REC_XY_RL( fn, CLOUDCtave, 11, myIter, myThid )
0177 CALL WRITE_REC_XY_RL( fn, CLTOPtave, 12, myIter, myThid )
0178 CALL WRITE_REC_XY_RL( fn, CBMFtave, 13, myIter, myThid )
0179 CALL WRITE_REC_XY_RL( fn, DRAGtave, 14, myIter, myThid )
0180 CALL WRITE_REC_XY_RL( fn, aimV0tave, 15, myIter, myThid )
0181 CALL WRITE_REC_XY_RL( fn, aimT0tave, 16, myIter, myThid )
0182 CALL WRITE_REC_XY_RL( fn, aimQ0tave, 17, myIter, myThid )
0183 CALL WRITE_REC_XY_RL( fn, EnFxPrtave, 18, myIter, myThid )
0184 CALL WRITE_REC_XY_RL( fn, albedotave, 19, myIter, myThid )
0185 CALL WRITE_REC_XY_RL( fn, dTsurftave, 20, myIter, myThid )
0186
ab33782b56 Jean*0187 CALL WRITE_FLD_XYZ_RL( 'aim_RHtave.', suff, aimRHtave,
0188 & myIter, myThid )
6d903038e0 Jean*0189
ad0ca66649 Ed H*0190 WRITE(msgBuf,'(A,I10)')
0191 & '// AIM Time-average written, t-step', myIter
0192 CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,
0193 & SQUEEZE_RIGHT, myThid )
0194 WRITE(msgBuf,'(A)') ' '
0195 CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,
0196 & SQUEEZE_RIGHT, myThid )
6d903038e0 Jean*0197
ad0ca66649 Ed H*0198 ENDIF
3a474aa258 Jean*0199
d676f916b2 Jean*0200
0201 DO bj = myByLo(myThid), myByHi(myThid)
0202 DO bi = myBxLo(myThid), myBxHi(myThid)
0203 CALL TIMEAVE_RESET(USTRtave, 1, bi, bj, myThid)
0204 CALL TIMEAVE_RESET(VSTRtave, 1, bi, bj, myThid)
0205 CALL TIMEAVE_RESET(TSRtave, 1, bi, bj, myThid)
0206 CALL TIMEAVE_RESET(OLRtave, 1, bi, bj, myThid)
0207 CALL TIMEAVE_RESET(SSRtave, 1, bi, bj, myThid)
0208 CALL TIMEAVE_RESET(SLRtave, 1, bi, bj, myThid)
0209 CALL TIMEAVE_RESET(SHFtave, 1, bi, bj, myThid)
0210 CALL TIMEAVE_RESET(EVAPtave, 1, bi, bj, myThid)
0211 CALL TIMEAVE_RESET(PRECNVtave,1, bi, bj, myThid)
0212 CALL TIMEAVE_RESET(PRECLStave,1, bi, bj, myThid)
0213 CALL TIMEAVE_RESET(CLOUDCtave,1, bi, bj, myThid)
3a474aa258 Jean*0214 CALL TIMEAVE_RESET(CLTOPtave, 1, bi, bj, myThid)
0215 CALL TIMEAVE_RESET(CBMFtave, 1, bi, bj, myThid)
0216 CALL TIMEAVE_RESET(DRAGtave, 1, bi, bj, myThid)
0217 CALL TIMEAVE_RESET(aimV0tave, 1, bi, bj, myThid)
0218 CALL TIMEAVE_RESET(aimT0tave, 1, bi, bj, myThid)
0219 CALL TIMEAVE_RESET(aimQ0tave, 1, bi, bj, myThid)
b3097ed02d Jean*0220 CALL TIMEAVE_RESET(EnFxPrtave,1, bi, bj, myThid)
bb334a5ac2 Jean*0221 CALL TIMEAVE_RESET(albedotave,1, bi, bj, myThid)
0222 CALL TIMEAVE_RESET(dTsurftave,1, bi, bj, myThid)
3a474aa258 Jean*0223 CALL TIMEAVE_RESET(aimRHtave,Nr, bi, bj, myThid)
10308cbe80 Jean*0224 aim_timeAve(bi,bj) = 0.
d676f916b2 Jean*0225 ENDDO
0226 ENDDO
0227
0228 ENDIF
0229
3a474aa258 Jean*0230 #endif /* ALLOW_AIM_TAVE */
d676f916b2 Jean*0231 #endif /* ALLOW_AIM */
0232
0233 RETURN
0234 END