File indexing completed on 2018-03-02 18:43:58 UTC
view on githubraw file Latest commit add29e06 on 2018-01-31 20:35:05 UTC
ffe464dc7d Mart*0001 #include "SHELFICE_OPTIONS.h"
0002
86db25ab4d Jean*0003
0004
0005
7bc95b10cc Jean*0006 SUBROUTINE SHELFICE_OUTPUT( myTime, myIter, myThid )
86db25ab4d Jean*0007
0008
d4bd695091 Jean*0009
7bc95b10cc Jean*0010
86db25ab4d Jean*0011
0012
d4bd695091 Jean*0013
86db25ab4d Jean*0014
0015
0016
ffe464dc7d Mart*0017 IMPLICIT NONE
0018
0019
0020 #include "SIZE.h"
0021 #include "EEPARAMS.h"
0022 #include "PARAMS.h"
0023 #include "SHELFICE.h"
7bc95b10cc Jean*0024 #include "SHELFICE_TAVE.h"
ffe464dc7d Mart*0025
86db25ab4d Jean*0026
ffe464dc7d Mart*0027
7bc95b10cc Jean*0028
0029
0030
ffe464dc7d Mart*0031 _RL myTime
0032 INTEGER myIter
0033 INTEGER myThid
0034
86db25ab4d Jean*0035
ffe464dc7d Mart*0036 LOGICAL DIFFERENT_MULTIPLE
0037 EXTERNAL DIFFERENT_MULTIPLE
86db25ab4d Jean*0038
0039
0040
af20bc5e19 Jean*0041 CHARACTER*(10) suff
86db25ab4d Jean*0042 #ifdef ALLOW_TIMEAVE
0043 INTEGER i, j, bi, bj
ffe464dc7d Mart*0044 LOGICAL dumpFiles
86db25ab4d Jean*0045 #endif
0046 #ifdef ALLOW_MNC
ffe464dc7d Mart*0047 CHARACTER*(1) pf
86db25ab4d Jean*0048 #endif
0049
d4bd695091 Jean*0050
ffe464dc7d Mart*0051 IF (SHELFICEwriteState) THEN
0052
86db25ab4d Jean*0053
0054 IF ( myIter .NE. nIter0 .AND.
0055 & DIFFERENT_MULTIPLE(SHELFICE_dumpFreq,myTime,deltaTClock)
0056 & ) THEN
d4bd695091 Jean*0057
ffe464dc7d Mart*0058 #ifdef ALLOW_MNC
0059 IF ( useMNC .AND. SHELFICE_dump_mnc ) THEN
86db25ab4d Jean*0060 IF ( writeBinaryPrec .EQ. precFloat64 ) THEN
0061 pf(1:1) = 'D'
0062 ELSE
0063 pf(1:1) = 'R'
0064 ENDIF
ffe464dc7d Mart*0065 CALL MNC_CW_SET_UDIM('shelfice', -1, myThid)
0066 CALL MNC_CW_RL_W_S('D','shelfice',0,0,'T', myTime, myThid)
0067 CALL MNC_CW_SET_UDIM('shelfice', 0, myThid)
0068 CALL MNC_CW_I_W_S('I','shelfice',0,0,'iter', myIter, myThid)
0069 CALL MNC_CW_RL_W_S('D','shelfice',0,0,'model_time',
0070 & myTime,myThid)
0071 CALL MNC_CW_RS_W(pf,'shelfice',0,0,'fwFlux',
0072 & shelfIceFreshWaterFlux,myThid)
0073 CALL MNC_CW_RS_W(pf,'shelfice',0,0,'heatFlux',
0074 & shelfIceHeatFlux,myThid)
0075 ENDIF
0076 #endif
0077 IF (SHELFICE_dump_mdsio) THEN
af20bc5e19 Jean*0078 IF ( rwSuffixType.EQ.0 ) THEN
0079 WRITE(suff,'(I10.10)') myIter
0080 ELSE
0081 CALL RW_GET_SUFFIX( suff, myTime, myIter, myThid )
0082 ENDIF
ffe464dc7d Mart*0083 CALL WRITE_FLD_XY_RS( 'SHICE_fwFlux.',suff,
0084 & shelficeFreshWaterFlux,myIter,myThid)
0085 CALL WRITE_FLD_XY_RS( 'SHICE_heatFlux.',suff,
0086 & shelficeHeatFlux,myIter,myThid)
0087 ENDIF
d4bd695091 Jean*0088
ffe464dc7d Mart*0089 ENDIF
0090 ENDIF
0091
0092
0093
0094
0095
0096 #ifdef ALLOW_TIMEAVE
0097 IF ( SHELFICE_taveFreq .GT. 0 ) THEN
86db25ab4d Jean*0098
0099 IF ( myIter.EQ.nIter0 ) THEN
0100
0101 DO bj = myByLo(myThid), myByHi(myThid)
0102 DO bi = myBxLo(myThid), myBxHi(myThid)
0103 CALL TIMEAVE_RESET( shelfice_frshFluxtave, 1, bi,bj, myThid )
0104 CALL TIMEAVE_RESET( shelfice_heatFluxtave, 1, bi,bj, myThid )
0105 SHELFICE_timeAve(bi,bj) = 0. _d 0
0106 ENDDO
0107 ENDDO
0108 ELSE
ffe464dc7d Mart*0109
86db25ab4d Jean*0110
0111 DO bj = myByLo(myThid), myByHi(myThid)
0112 DO bi = myBxLo(myThid), myBxHi(myThid)
0113 DO j=1,sNy
0114 DO i=1,sNx
0115 shelfice_FrshFluxtave(i,j,1,bi,bj)=
ffe464dc7d Mart*0116 & shelfice_frshFluxtave(i,j,1,bi,bj)
af20bc5e19 Jean*0117 & + shelficeFreshWaterFlux(i,j,bi,bj) *deltaTClock
86db25ab4d Jean*0118 shelfice_heatFluxtave(i,j,1,bi,bj) =
d4bd695091 Jean*0119 & shelfice_heatFluxtave(i,j,1,bi,bj)
af20bc5e19 Jean*0120 & + shelficeHeatFlux(i,j,bi,bj) *deltaTClock
86db25ab4d Jean*0121 ENDDO
0122 ENDDO
af20bc5e19 Jean*0123 SHELFICE_timeAve(bi,bj) = SHELFICE_timeAve(bi,bj)+deltaTClock
ffe464dc7d Mart*0124 ENDDO
0125 ENDDO
86db25ab4d Jean*0126 ENDIF
ffe464dc7d Mart*0127
0128
86db25ab4d Jean*0129 dumpFiles = .FALSE.
0130 IF ( myIter .NE. nIter0 ) THEN
d4bd695091 Jean*0131 dumpFiles =
742cf4499c Jean*0132 & DIFFERENT_MULTIPLE(SHELFICE_taveFreq,myTime,deltaTClock)
ffe464dc7d Mart*0133 #ifdef ALLOW_CAL
742cf4499c Jean*0134 IF ( useCAL ) THEN
7a31080eb8 Jean*0135 CALL CAL_TIME2DUMP( zeroRL, SHELFICE_taveFreq, deltaTClock,
742cf4499c Jean*0136 U dumpFiles,
0137 I myTime, myIter, myThid )
0138 ENDIF
ffe464dc7d Mart*0139 #endif
86db25ab4d Jean*0140 ENDIF
d4bd695091 Jean*0141
86db25ab4d Jean*0142 IF (dumpFiles) THEN
0143
0144 DO bj = myByLo(myThid), myByHi(myThid)
0145 DO bi = myBxLo(myThid), myBxHi(myThid)
0146 CALL TIMEAVE_NORMALIZE( shelfice_frshFluxtave,
0147 & SHELFICE_timeAve, 1, bi, bj, myThid )
0148 CALL TIMEAVE_NORMALIZE( shelfice_heatFluxtave,
0149 & SHELFICE_timeAve, 1, bi, bj, myThid )
0150 ENDDO
ffe464dc7d Mart*0151 ENDDO
0152
0153 #ifdef ALLOW_MNC
86db25ab4d Jean*0154 IF (useMNC .AND. SHELFICE_tave_mnc) THEN
0155 IF ( writeBinaryPrec .EQ. precFloat64 ) THEN
0156 pf(1:1) = 'D'
0157 ELSE
0158 pf(1:1) = 'R'
0159 ENDIF
0160 CALL MNC_CW_SET_UDIM('shelfice_tave', -1, myThid)
0161 CALL MNC_CW_RL_W_S( 'D','shelfice_tave', 0, 0,
0162 & 'T', myTime, myThid )
0163 CALL MNC_CW_SET_UDIM('shelfice_tave', 0, myThid)
0164 CALL MNC_CW_I_W_S( 'I', 'shelfice_tave', 0, 0,
0165 & 'iter', myIter, myThid )
0166
0167
0168 CALL MNC_CW_RL_W( pf, 'shelfice_tave', 0, 0,
0169 & 'fwFluxtave', Shelfice_FrshFluxtave, myThid )
0170 CALL MNC_CW_RL_W( pf, 'shelfice_tave', 0, 0,
0171 & 'heatFluxtave', Shelfice_HeatFluxtave, myThid )
0172 ENDIF
ffe464dc7d Mart*0173 #endif
86db25ab4d Jean*0174 IF (SHELFICE_tave_mdsio) THEN
af20bc5e19 Jean*0175 IF ( rwSuffixType.EQ.0 ) THEN
0176 WRITE(suff,'(I10.10)') myIter
0177 ELSE
0178 CALL RW_GET_SUFFIX( suff, myTime, myIter, myThid )
0179 ENDIF
86db25ab4d Jean*0180 CALL WRITE_FLD_XY_RL( 'SHICE_fwFluxtave.', suff,
0181 & shelfice_frshFluxtave, myIter, myThid )
0182 CALL WRITE_FLD_XY_RL( 'SHICE_heatFluxtave.', suff,
0183 & shelfice_heatFluxtave, myIter, myThid )
0184 ENDIF
d4bd695091 Jean*0185
86db25ab4d Jean*0186
0187 DO bj = myByLo(myThid), myByHi(myThid)
0188 DO bi = myBxLo(myThid), myBxHi(myThid)
0189 CALL TIMEAVE_RESET( shelfice_frshFluxtave, 1, bi,bj, myThid )
0190 CALL TIMEAVE_RESET( shelfice_heatFluxtave, 1, bi,bj, myThid )
0191 SHELFICE_timeAve(bi,bj) = 0. _d 0
0192 ENDDO
ffe464dc7d Mart*0193 ENDDO
d4bd695091 Jean*0194
86db25ab4d Jean*0195
0196 ENDIF
0197
0198
ffe464dc7d Mart*0199 ENDIF
0200 #endif /* ALLOW_TIMEAVE */
0201
0202 RETURN
0203 END