6 |
CBOP |
CBOP |
7 |
C !ROUTINE: THSICE_AVE |
C !ROUTINE: THSICE_AVE |
8 |
C !INTERFACE: |
C !INTERFACE: |
9 |
SUBROUTINE THSICE_AVE( |
SUBROUTINE THSICE_AVE( |
|
I frwAtm, flxAtm, |
|
10 |
I bi, bj, myTime, myIter, myThid ) |
I bi, bj, myTime, myIter, myThid ) |
11 |
C !DESCRIPTION: \bv |
C !DESCRIPTION: \bv |
12 |
C *==========================================================* |
C *==========================================================* |
13 |
C | S/R THSICE_AVE |
C | S/R THSICE_AVE |
14 |
C | o save values for timeaveraging |
C | o save values for timeaveraging |
15 |
C *==========================================================* |
C *==========================================================* |
16 |
C \ev |
C \ev |
35 |
C bi,bj :: tile indices |
C bi,bj :: tile indices |
36 |
C myIter :: iteration counter for this thread |
C myIter :: iteration counter for this thread |
37 |
C myThid :: thread number for this instance of the routine. |
C myThid :: thread number for this instance of the routine. |
38 |
_RL frwAtm(1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
c _RL frwAtm(1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
39 |
_RL flxAtm(1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
c _RL flxAtm(1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
40 |
INTEGER bi,bj |
INTEGER bi,bj |
41 |
_RL myTime |
_RL myTime |
42 |
INTEGER myIter |
INTEGER myIter |
47 |
C == Local variables == |
C == Local variables == |
48 |
LOGICAL DIFFERENT_MULTIPLE |
LOGICAL DIFFERENT_MULTIPLE |
49 |
EXTERNAL DIFFERENT_MULTIPLE |
EXTERNAL DIFFERENT_MULTIPLE |
50 |
INTEGER wrtIter |
c INTEGER wrtIter |
51 |
|
|
52 |
#ifdef ALLOW_TIMEAVE |
#ifdef ALLOW_TIMEAVE |
53 |
|
|
54 |
IF ( thSIce_taveFreq .LE. 0. _d 0 ) RETURN |
IF ( thSIce_taveFreq .GT. 0. _d 0 ) THEN |
55 |
|
|
56 |
C-- Time-average |
C-- Time-average |
57 |
CALL TIMEAVE_CUMULATE(ice_fract_Ave, iceMask, |
CALL TIMEAVE_CUMULATE(ice_fract_Ave, iceMask, |
58 |
& 1, thSIce_deltaT, bi, bj, myThid ) |
& 1, thSIce_deltaT, bi, bj, myThid ) |
59 |
C-- area weighted average (with ice-fraction) |
C-- area weighted average (with ice-fraction) |
60 |
CALL TIMEAVE_CUMUL_2V( ice_iceH_Ave, iceheight, iceMask, |
CALL TIMEAVE_CUMUL_2V( ice_iceH_Ave, iceHeight, iceMask, |
61 |
& 1, 0, thSIce_deltaT, bi, bj, myThid ) |
& 1, 0, thSIce_deltaT, bi, bj, myThid ) |
62 |
CALL TIMEAVE_CUMUL_2V( ice_snowH_Ave, snowheight, iceMask, |
CALL TIMEAVE_CUMUL_2V( ice_snowH_Ave, snowHeight, iceMask, |
63 |
& 1, 0, thSIce_deltaT, bi, bj, myThid ) |
& 1, 0, thSIce_deltaT, bi, bj, myThid ) |
64 |
CALL TIMEAVE_CUMUL_2V( ice_Tsrf_Ave, Tsrf, iceMask, |
CALL TIMEAVE_CUMUL_2V( ice_Tsrf_Ave, Tsrf, iceMask, |
65 |
& 1, 0, thSIce_deltaT, bi, bj, myThid ) |
& 1, 0, thSIce_deltaT, bi, bj, myThid ) |
69 |
& 1, 0, thSIce_deltaT, bi, bj, myThid ) |
& 1, 0, thSIce_deltaT, bi, bj, myThid ) |
70 |
CALL TIMEAVE_CUMUL_2V( ice_snowPr_Ave,snowPrc, iceMask, |
CALL TIMEAVE_CUMUL_2V( ice_snowPr_Ave,snowPrc, iceMask, |
71 |
& 1, 0, thSIce_deltaT, bi, bj, myThid ) |
& 1, 0, thSIce_deltaT, bi, bj, myThid ) |
72 |
|
C-- notes: siceAlb is already multiplied by iceFraction |
73 |
|
CALL TIMEAVE_CUMULATE(ice_albedo_Ave, siceAlb, |
74 |
|
& 1, thSIce_deltaT, bi, bj, myThid ) |
75 |
C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----| |
C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----| |
76 |
C-- simple average (without ice-fraction) |
C-- simple average (without ice-fraction) |
77 |
c CALL TIMEAVE_CUMULATE(ice_iceH_Ave,iceheight, |
c CALL TIMEAVE_CUMULATE(ice_iceH_Ave,iceHeight, |
78 |
c & 1, thSIce_deltaT, bi, bj, myThid ) |
c & 1, thSIce_deltaT, bi, bj, myThid ) |
79 |
c CALL TIMEAVE_CUMULATE(ice_snowH_Ave,snowHeight, |
c CALL TIMEAVE_CUMULATE(ice_snowH_Ave,snowHeight, |
80 |
c & 1, thSIce_deltaT, bi, bj, myThid ) |
c & 1, thSIce_deltaT, bi, bj, myThid ) |
87 |
c CALL TIMEAVE_CUMULATE(ice_snowPr_Ave, snowPrc, |
c CALL TIMEAVE_CUMULATE(ice_snowPr_Ave, snowPrc, |
88 |
c & 1, thSIce_deltaT, bi, bj, myThid ) |
c & 1, thSIce_deltaT, bi, bj, myThid ) |
89 |
|
|
90 |
C-- average of atmospheric fluxes : |
C-- average of atmospheric fluxes : |
91 |
#ifdef ALLOW_TIMEAVE |
IF ( fluidIsWater ) THEN |
92 |
CALL TIMEAVE_CUMUL_1T(ice_flxAtm_Ave, flxAtm, |
CALL TIMEAVE_CUMULATE(ice_flxAtm_Ave, icFlxAtm, |
93 |
& 1, thSIce_deltaT, bi, bj, myThid ) |
& 1, thSIce_deltaT, bi, bj, myThid ) |
94 |
CALL TIMEAVE_CUMUL_1T(ice_frwAtm_Ave, frwAtm, |
CALL TIMEAVE_CUMULATE(ice_frwAtm_Ave, icFrwAtm, |
95 |
& 1, thSIce_deltaT, bi, bj, myThid ) |
& 1, thSIce_deltaT, bi, bj, myThid ) |
96 |
#endif /*ALLOW_TIMEAVE*/ |
ENDIF |
97 |
|
|
98 |
C-- average of oceanic fluxes : |
C-- average of oceanic fluxes : |
99 |
#ifndef CHECK_ENERGY_CONSERV |
#ifndef CHECK_ENERGY_CONSERV |
100 |
CALL TIMEAVE_CUMULATE(ice_flx2oc_Ave, Qnet, |
CALL TIMEAVE_CUMULATE(ice_flx2oc_Ave, Qnet, |
101 |
& 1, thSIce_deltaT, bi, bj, myThid ) |
& 1, thSIce_deltaT, bi, bj, myThid ) |
115 |
|
|
116 |
ice_timeAve(1,bi,bj)=ice_timeAve(1,bi,bj)+thSIce_deltaT |
ice_timeAve(1,bi,bj)=ice_timeAve(1,bi,bj)+thSIce_deltaT |
117 |
|
|
118 |
|
ENDIF |
119 |
#endif /* ALLOW_TIMEAVE */ |
#endif /* ALLOW_TIMEAVE */ |
120 |
|
|
121 |
IF ( DIFFERENT_MULTIPLE(thSIce_diagFreq,myTime+deltaTClock,myTime) |
c IF ( DIFFERENT_MULTIPLE(thSIce_diagFreq, |
122 |
& ) THEN |
c & myTime+deltaTClock,deltaTClock) |
123 |
wrtIter = myIter+1 |
c & .AND. fluidIsWater ) THEN |
124 |
CALL WRITE_LOCAL_RL('ice_flxAtm','I10',1,flxAtm, |
c wrtIter = myIter+1 |
125 |
& bi,bj,1,wrtIter,myThid) |
c CALL WRITE_LOCAL_RL('ice_flxAtm','I10',1,flxAtm, |
126 |
CALL WRITE_LOCAL_RL('ice_frwAtm','I10',1,frwAtm, |
c & bi,bj,1,wrtIter,myThid) |
127 |
& bi,bj,1,wrtIter,myThid) |
c CALL WRITE_LOCAL_RL('ice_frwAtm','I10',1,frwAtm, |
128 |
|
c & bi,bj,1,wrtIter,myThid) |
129 |
|
c ENDIF |
130 |
|
|
131 |
|
C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----| |
132 |
|
|
133 |
|
#ifdef ALLOW_DIAGNOSTICS |
134 |
|
IF ( useDiagnostics ) THEN |
135 |
|
|
136 |
|
C-- Atmospheric fluxes : |
137 |
|
IF ( fluidIsWater ) THEN |
138 |
|
CALL DIAGNOSTICS_FILL(icFlxAtm,'SIflxAtm',0,1,1,bi,bj,myThid) |
139 |
|
CALL DIAGNOSTICS_FILL(icFrwAtm,'SIfrwAtm',0,1,1,bi,bj,myThid) |
140 |
|
ENDIF |
141 |
|
|
142 |
|
C-- Oceanic fluxes : |
143 |
|
c #ifndef CHECK_ENERGY_CONSERV |
144 |
|
CALL DIAGNOSTICS_FILL(Qnet, 'SIflx2oc',0,1,1,bi,bj,myThid) |
145 |
|
CALL DIAGNOSTICS_FILL(EmPmR, 'SIfrw2oc',0,1,1,bi,bj,myThid) |
146 |
|
CALL DIAGNOSTICS_FILL(saltFlux,'SIsaltFx',0,1,1,bi,bj,myThid) |
147 |
|
c #endif /* CHECK_ENERGY_CONSERV */ |
148 |
|
|
149 |
ENDIF |
ENDIF |
150 |
|
#endif /* ALLOW_DIAGNOSTICS */ |
151 |
|
|
152 |
#endif /* ALLOW_THSICE */ |
#endif /* ALLOW_THSICE */ |
153 |
|
|