1 |
C $Header$ |
C $Header$ |
2 |
C $Name$ |
C $Name$ |
3 |
|
|
4 |
|
#include "PACKAGES_CONFIG.h" |
5 |
#include "CPP_OPTIONS.h" |
#include "CPP_OPTIONS.h" |
6 |
|
|
7 |
CBOP |
CBOP |
28 |
#include "DYNVARS.h" |
#include "DYNVARS.h" |
29 |
#include "GRID.h" |
#include "GRID.h" |
30 |
#include "SURFACE.h" |
#include "SURFACE.h" |
31 |
|
#ifdef ALLOW_SEAICE |
32 |
|
#include "SEAICE.h" |
33 |
|
#endif /* ALLOW_SEAICE */ |
34 |
|
|
35 |
C !INPUT/OUTPUT PARAMETERS: |
C !INPUT/OUTPUT PARAMETERS: |
36 |
C === Routine arguments === |
C === Routine arguments === |
57 |
kSurface = 1 |
kSurface = 1 |
58 |
endif |
endif |
59 |
|
|
60 |
|
C-- Surface Fluxes : |
61 |
|
|
62 |
DO j = jMin, jMax |
DO j = jMin, jMax |
63 |
DO i = iMin, iMax |
DO i = iMin, iMax |
64 |
|
|
74 |
surfaceTendencyT(i,j,bi,bj) = |
surfaceTendencyT(i,j,bi,bj) = |
75 |
& -Qnet(i,j,bi,bj)*recip_Cp*horiVertRatio*recip_rhoConst |
& -Qnet(i,j,bi,bj)*recip_Cp*horiVertRatio*recip_rhoConst |
76 |
& *recip_drF(kSurface)*recip_hFacC(i,j,kSurface,bi,bj) |
& *recip_drF(kSurface)*recip_hFacC(i,j,kSurface,bi,bj) |
77 |
& -lambdaThetaClimRelax |
C Net Salt Flux : |
78 |
& *(theta(i,j,kSurface,bi,bj)-SST(i,j,bi,bj)) |
surfaceTendencyS(i,j,bi,bj) = |
79 |
C Salt Flux (restoring term) : |
& -saltFlux(i,j,bi,bj)*horiVertRatio*recip_rhoConst |
80 |
C surfaceTendencyS(i,j,bi,bj) = |
& *recip_drF(kSurface)*recip_hFacC(i,j,kSurface,bi,bj) |
|
C & -lambdaSaltClimRelax*(salt(i,j,kSurface,bi,bj)-SSS(i,j,bi,bj)) |
|
|
C notes : because truncation is different when this tendency is splitted |
|
|
C in 2 parts, keep this salt flux with freshwater flux (see below) |
|
81 |
|
|
82 |
#ifdef ALLOW_PASSIVE_TRACER |
#ifdef ALLOW_PASSIVE_TRACER |
83 |
c *** define the tracer surface tendency here *** |
c *** define the tracer surface tendency here *** |
85 |
|
|
86 |
ENDDO |
ENDDO |
87 |
ENDDO |
ENDDO |
88 |
|
|
89 |
|
C-- Surface restoring term : |
90 |
|
|
91 |
c---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----| |
IF ( doThetaClimRelax .OR. doSaltClimRelax ) THEN |
|
C Surface salinity tendency and freshwater flux EmPmR: |
|
|
|
|
|
#ifdef NONLIN_FRSURF |
|
|
IF ( (nonlinFreeSurf.GT.0 .OR. buoyancyRelation.EQ.'OCEANICP') |
|
|
& .AND. useRealFreshWaterFlux ) THEN |
|
|
|
|
|
c Salt Flux (restoring term) : |
|
92 |
DO j = jMin, jMax |
DO j = jMin, jMax |
93 |
DO i = iMin, iMax |
DO i = iMin, iMax |
94 |
surfaceTendencyS(i,j,bi,bj) = |
#ifdef ALLOW_SEAICE |
95 |
|
C Don't restore under sea-ice |
96 |
|
C Heat Flux (restoring term) : |
97 |
|
surfaceTendencyT(i,j,bi,bj) = surfaceTendencyT(i,j,bi,bj) |
98 |
|
& -lambdaThetaClimRelax * (1-AREA(i,j,1,bi,bj)) |
99 |
|
& *(theta(i,j,kSurface,bi,bj)-SST(i,j,bi,bj)) |
100 |
|
C Salt Flux (restoring term) : |
101 |
|
surfaceTendencyS(i,j,bi,bj) = surfaceTendencyS(i,j,bi,bj) |
102 |
|
& -lambdaSaltClimRelax * (1-AREA(i,j,1,bi,bj)) |
103 |
|
& *(salt(i,j,kSurface,bi,bj)-SSS(i,j,bi,bj)) |
104 |
|
#else /* ifndef ALLOW_SEAICE */ |
105 |
|
C Heat Flux (restoring term) : |
106 |
|
IF ( abs(yC(i,j,bi,bj)).LE.latBandClimRelax ) THEN |
107 |
|
surfaceTendencyT(i,j,bi,bj) = surfaceTendencyT(i,j,bi,bj) |
108 |
|
& -lambdaThetaClimRelax |
109 |
|
& *(theta(i,j,kSurface,bi,bj)-SST(i,j,bi,bj)) |
110 |
|
C Salt Flux (restoring term) : |
111 |
|
surfaceTendencyS(i,j,bi,bj) = surfaceTendencyS(i,j,bi,bj) |
112 |
& -lambdaSaltClimRelax |
& -lambdaSaltClimRelax |
113 |
& *(salt(i,j,kSurface,bi,bj)-SSS(i,j,bi,bj)) |
& *(salt(i,j,kSurface,bi,bj)-SSS(i,j,bi,bj)) |
114 |
ENDDO |
ENDIF |
115 |
|
#endif /* ALLOW_SEAICE */ |
116 |
|
ENDDO |
117 |
ENDDO |
ENDDO |
118 |
|
ENDIF |
119 |
|
|
120 |
|
C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----| |
121 |
|
C-- Fresh-water flux |
122 |
|
|
123 |
|
#ifdef NONLIN_FRSURF |
124 |
|
IF ( (nonlinFreeSurf.GT.0 .OR. buoyancyRelation.EQ.'OCEANICP') |
125 |
|
& .AND. useRealFreshWaterFlux ) THEN |
126 |
|
|
127 |
c- NonLin_FrSurf and RealFreshWaterFlux : PmEpR effectively changes |
c- NonLin_FrSurf and RealFreshWaterFlux : PmEpR effectively changes |
128 |
c the water column height ; temp., salt, (tracer) flux associated |
c the water column height ; temp., salt, (tracer) flux associated |
155 |
ENDDO |
ENDDO |
156 |
ENDIF |
ENDIF |
157 |
|
|
|
#ifdef ALLOW_PASSIVE_TRACER |
|
|
c *** add the tracer flux associated with P-E+R here *** |
|
|
c IF (trac_EvPrRn.NE.UNSET_RL) THEN |
|
|
c & + PmEpR(i,j,bi,bj)*( trac_EvPrRn - tr1(i,j,kSurface,bi,bj) ) |
|
|
c & *recip_drF(kSurface)*recip_hFacC(i,j,kSurface,bi,bj) |
|
|
c ENDIF |
|
|
#endif /* ALLOW_PASSIVE_TRACER */ |
|
|
|
|
158 |
C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----| |
C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----| |
159 |
ELSE |
ELSE |
160 |
#else /* NONLIN_FRSURF */ |
#else /* NONLIN_FRSURF */ |
168 |
c- converts EmPmR to salinity tendency using surface local salinity |
c- converts EmPmR to salinity tendency using surface local salinity |
169 |
DO j = jMin, jMax |
DO j = jMin, jMax |
170 |
DO i = iMin, iMax |
DO i = iMin, iMax |
171 |
surfaceTendencyS(i,j,bi,bj) = |
surfaceTendencyS(i,j,bi,bj) = surfaceTendencyS(i,j,bi,bj) |
172 |
& + EmPmR(i,j,bi,bj)*salt(i,j,kSurface,bi,bj) |
& + EmPmR(i,j,bi,bj)*salt(i,j,kSurface,bi,bj) |
173 |
& *recip_drF(kSurface)*recip_hFacC(i,j,kSurface,bi,bj) |
& *recip_drF(kSurface)*recip_hFacC(i,j,kSurface,bi,bj) |
174 |
& *convertEmP2rUnit |
& *convertEmP2rUnit |
|
& -lambdaSaltClimRelax |
|
|
& *(salt(i,j,kSurface,bi,bj)-SSS(i,j,bi,bj)) |
|
175 |
ENDDO |
ENDDO |
176 |
ENDDO |
ENDDO |
177 |
ELSE |
ELSE |
178 |
c- converts EmPmR to virtual salt flux using uniform salinity (default=35) |
c- converts EmPmR to virtual salt flux using uniform salinity (default=35) |
179 |
DO j = jMin, jMax |
DO j = jMin, jMax |
180 |
DO i = iMin, iMax |
DO i = iMin, iMax |
181 |
surfaceTendencyS(i,j,bi,bj) = |
surfaceTendencyS(i,j,bi,bj) = surfaceTendencyS(i,j,bi,bj) |
182 |
& + EmPmR(i,j,bi,bj)*convertFW2Salt |
& + EmPmR(i,j,bi,bj)*convertFW2Salt |
183 |
& *recip_drF(kSurface)*recip_hFacC(i,j,kSurface,bi,bj) |
& *recip_drF(kSurface)*recip_hFacC(i,j,kSurface,bi,bj) |
184 |
& *convertEmP2rUnit |
& *convertEmP2rUnit |
|
& -lambdaSaltClimRelax |
|
|
& *(salt(i,j,kSurface,bi,bj)-SSS(i,j,bi,bj)) |
|
185 |
ENDDO |
ENDDO |
186 |
ENDDO |
ENDDO |
187 |
ENDIF |
ENDIF |
188 |
|
|
189 |
ENDIF |
ENDIF |
190 |
|
|
191 |
C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----| |
C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----| |
192 |
|
|
193 |
#ifdef ALLOW_PTRACERS |
#ifdef ALLOW_PTRACERS |
194 |
IF ( usePTRACERS ) THEN |
IF ( usePTRACERS ) THEN |
195 |
CALL PTRACERS_FORCING_SURF( |
CALL PTRACERS_FORCING_SURF( |
196 |
I bi, bj, iMin, iMax, jMin, jMax, |
I bi, bj, iMin, iMax, jMin, jMax, |
197 |
I myTime,myIter,myThid ) |
I myTime,myIter,myThid ) |
198 |
ENDIF |
ENDIF |
199 |
#endif /* ALLOW_PTRACERS */ |
#endif /* ALLOW_PTRACERS */ |
200 |
|
|
222 |
|
|
223 |
#endif /* ATMOSPHERIC_LOADING */ |
#endif /* ATMOSPHERIC_LOADING */ |
224 |
|
|
225 |
|
#ifdef ALLOW_EBM |
226 |
|
c-- Values for surfaceTendencyT, surfaceTendencyS |
227 |
|
c are overwritten by those produced by EBM |
228 |
|
cph AD recomputation problems if these IF useEBM are used |
229 |
|
cph IF ( useEBM ) THEN |
230 |
|
CALL EBM_FORCING_SURF( |
231 |
|
I bi, bj, iMin, iMax, jMin, jMax, |
232 |
|
I myTime,myIter,myThid ) |
233 |
|
cph ENDIF |
234 |
|
#endif |
235 |
|
|
236 |
|
#ifdef ALLOW_TIMEAVE |
237 |
|
IF ( taveFreq .NE. 0. _d 0 ) THEN |
238 |
|
CALL TIMEAVE_SURF_FLUX( bi, bj, myTime, myIter, myThid) |
239 |
|
ENDIF |
240 |
|
#endif /* ALLOW_TIMEAVE */ |
241 |
|
|
242 |
RETURN |
RETURN |
243 |
END |
END |