/[MITgcm]/MITgcm/pkg/seaice/seaice_ocean_stress.F
ViewVC logotype

Diff of /MITgcm/pkg/seaice/seaice_ocean_stress.F

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph | View Patch Patch

revision 1.1 by mlosch, Mon Mar 6 13:17:37 2006 UTC revision 1.16 by mlosch, Tue Apr 24 18:38:15 2007 UTC
# Line 18  C     === Global variables === Line 18  C     === Global variables ===
18  #include "SIZE.h"  #include "SIZE.h"
19  #include "EEPARAMS.h"  #include "EEPARAMS.h"
20  #include "PARAMS.h"  #include "PARAMS.h"
21    #include "GRID.h"
22  #include "FFIELDS.h"  #include "FFIELDS.h"
23  #include "SEAICE.h"  #include "SEAICE.h"
24  #include "SEAICE_PARAMS.h"  #include "SEAICE_PARAMS.h"
# Line 29  C     myThid - Thread no. that called th Line 30  C     myThid - Thread no. that called th
30        _RL     myTime        _RL     myTime
31        INTEGER myIter        INTEGER myIter
32        INTEGER myThid        INTEGER myThid
 CML      _RL COR_ICE    (1-OLx:sNx+OLx,1-OLy:sNy+OLy,  nSx,nSy)  
33  CEndOfInterface  CEndOfInterface
34    
35  #ifdef SEAICE_CGRID  #ifdef SEAICE_CGRID
# Line 37  C     === Local variables === Line 37  C     === Local variables ===
37  C     i,j,bi,bj - Loop counters  C     i,j,bi,bj - Loop counters
38    
39        INTEGER i, j, bi, bj        INTEGER i, j, bi, bj
40        _RL  SINWIN, COSWIN, SINWAT, COSWAT        _RL  SINWAT, COSWAT, SINWIN, COSWIN
41  #ifdef SEAICE_TEST_ICE_STRESS_1        _RL  fuIceLoc, fvIceLoc, FX, FY
42        _RL  fuIce, fvIce        _RL  areaW, areaS
43  #endif  
44          _RL e11         (1-Olx:sNx+Olx,1-Oly:sNy+Oly,nSx,nSy)
45          _RL e22         (1-Olx:sNx+Olx,1-Oly:sNy+Oly,nSx,nSy)
46          _RL e12         (1-Olx:sNx+Olx,1-Oly:sNy+Oly,nSx,nSy)
47          _RL press       (1-Olx:sNx+Olx,1-Oly:sNy+Oly,nSx,nSy)
48          _RL sig11       (1-Olx:sNx+Olx,1-Oly:sNy+Oly)
49          _RL sig22       (1-Olx:sNx+Olx,1-Oly:sNy+Oly)
50          _RL sig12       (1-Olx:sNx+Olx,1-Oly:sNy+Oly)
51          _RL eplus, eminus
52    
53  c     introduce turning angle (default is zero)  c     introduce turning angle (default is zero)
       SINWIN=SIN(SEAICE_airTurnAngle*deg2rad)  
       COSWIN=COS(SEAICE_airTurnAngle*deg2rad)  
54        SINWAT=SIN(SEAICE_waterTurnAngle*deg2rad)        SINWAT=SIN(SEAICE_waterTurnAngle*deg2rad)
55        COSWAT=COS(SEAICE_waterTurnAngle*deg2rad)        COSWAT=COS(SEAICE_waterTurnAngle*deg2rad)
56          SINWIN=SIN(SEAICE_airTurnAngle*deg2rad)
57  CML#ifdef SEAICE_ORIGINAL_BAD_ICE_STRESS        COSWIN=COS(SEAICE_airTurnAngle*deg2rad)
 CMLC--   Following formulation is problematic and is no longer used.  
 CML#ifdef SEAICE_ALLOW_DYNAMICS  
 CML      IF ( SEAICEuseDYNAMICS ) THEN  
 CMLC--   Compute ice-affected wind stress  
 CML       DO bj=myByLo(myThid),myByHi(myThid)  
 CML        DO bi=myBxLo(myThid),myBxHi(myThid)  
 CML         DO j=1,sNy  
 CML          DO i=1,sNx  
 CML           WINDX(I,J,bi,bj)=DWATN(I,J,bi,bj)  
 CML     &          *(COSWAT*(GWATX(I,J,bi,bj)-UICE(I,J,1,bi,bj))  
 CML     &          -SINWAT*(GWATY(I,J,bi,bj)-VICEC(I,J,bi,bj)))  
 CML           WINDY(I,J,bi,bj)=DWATN(I,J,bi,bj)  
 CML     &          *(SINWAT*(GWATX(I,J,bi,bj)-UICEC(I,J,bi,bj))  
 CML     &          +COSWAT*(GWATY(I,J,bi,bj)-VICE(I,J,1,bi,bj)))  
 CML           WINDX(I,J,bi,bj)=WINDX(I,J,bi,bj)-( COR_ICE(I,J,bi,bj)  
 CML     &          *GWATY(I,J,bi,bj)-COR_ICE(I,J,bi,bj)*VICEC(I,J,bi,bj))  
 CML           WINDY(I,J,bi,bj)=WINDY(I,J,bi,bj)-(-COR_ICE(I,J,bi,bj)  
 CML     &          *GWATX(I,J,bi,bj)+COR_ICE(I,J,bi,bj)*UICEC(I,J,bi,bj))  
 CML           WINDX(I,J,bi,bj)=WINDX(I,J,bi,bj)-(UICE(I,J,1,bi,bj)  
 CML     &          -UICE(I,J,3,bi,bj))*AMASS(I,J,bi,bj)/SEAICE_DT*TWO  
 CML           WINDY(I,J,bi,bj)=WINDY(I,J,bi,bj)-(VICE(I,J,1,bi,bj)  
 CML     &          -VICE(I,J,3,bi,bj))*AMASS(I,J,bi,bj)/SEAICE_DT*TWO  
 CML          ENDDO  
 CML         ENDDO  
 CML        ENDDO  
 CML       ENDDO  
 CML       DO bj=myByLo(myThid),myByHi(myThid)  
 CML        DO bi=myBxLo(myThid),myBxHi(myThid)  
 CML         DO j=1,sNy  
 CML          DO i=1,sNx  
 CML           WINDX(I,J,bi,bj)=-WINDX(I,J,bi,bj)  
 CML           WINDY(I,J,bi,bj)=-WINDY(I,J,bi,bj)  
 CML          ENDDO  
 CML         ENDDO  
 CML        ENDDO  
 CML       ENDDO  
 CML      ENDIF  
 CML#endif /*  SEAICE_ALLOW_DYNAMICS */  
 CML#endif /* SEAICE_ORIGINAL_BAD_ICE_STRESS */  
58    
59  C--   Update overlap regions  C--   Update overlap regions
60        CALL EXCH_UV_XY_RL(WINDX, WINDY, .TRUE., myThid)        CALL EXCH_UV_XY_RL(WINDX, WINDY, .TRUE., myThid)
61    
62  #ifndef SEAICE_EXTERNAL_FLUXES  #ifndef SEAICE_EXTERNAL_FLUXES
63  C--   Interpolate wind stress (N/m^2) from South-West B-grid  C--   Interpolate wind stress (N/m^2) from C-points of C-grid
64  C     to South-West C-grid for forcing ocean model.  C     to U and V points of C-grid for forcing the ocean model.
65        DO bj=myByLo(myThid),myByHi(myThid)        DO bj=myByLo(myThid),myByHi(myThid)
66         DO bi=myBxLo(myThid),myBxHi(myThid)         DO bi=myBxLo(myThid),myBxHi(myThid)
67          DO j=1,sNy          DO j=1,sNy
68           DO i=1,sNx           DO i=1,sNx
69              fu(I,J,bi,bj)=WINDX(I,J,bi,bj)            fu(I,J,bi,bj)=0.5*(WINDX(I,J,bi,bj) + WINDX(I-1,J,bi,bj))
70              fv(I,J,bi,bj)=WINDY(I,J,bi,bj)            fv(I,J,bi,bj)=0.5*(WINDY(I,J,bi,bj) + WINDY(I,J-1,bi,bj))
71           ENDDO           ENDDO
72          ENDDO          ENDDO
73         ENDDO         ENDDO
74        ENDDO        ENDDO
       CALL EXCH_UV_XY_RS(fu, fv, .TRUE., myThid)  
75  #endif /* ifndef SEAICE_EXTERNAL_FLUXES */  #endif /* ifndef SEAICE_EXTERNAL_FLUXES */
76    
77  #ifdef SEAICE_TEST_ICE_STRESS_1        IF ( useHB87StressCoupling ) THEN
78  C--   Compute ice-affected wind stress (interpolate to U/V-points)  C
79    C     use an intergral over ice and ocean surface layer to define
80    C     surface stresses on ocean following Hibler and Bryan (1987, JPO)
81    C    
82    C     recompute strain rates, viscosities, etc. from updated ice velocities
83           IF ( .NOT. SEAICEuseEVP ) THEN
84    C     only for EVP we already have the stress components otherwise we need
85    C     to recompute them here
86            CALL SEAICE_CALC_STRAINRATES(
87         I       uIce(1-Olx,1-Oly,1,1,1), vIce(1-Olx,1-Oly,1,1,1),
88         O       e11, e22, e12,
89         I       myThid )
90    
91            CALL SEAICE_CALC_VISCOSITIES(
92         I       e11, e22, e12, zMin, zMax, hEffM, press0,
93         O       eta, zeta, press,
94         I       myThid )
95           ENDIF
96    C     re-compute internal stresses with updated ice velocities
97           DO bj=myByLo(myThid),myByHi(myThid)
98            DO bi=myBxLo(myThid),myBxHi(myThid)
99             IF ( .NOT. SEAICEuseEVP ) THEN
100    C     only for EVP we already have computed the stress divergences, for
101    C     anything else we have to do it here
102              DO j=1-Oly,sNy+Oly
103               DO i=1-Olx,sNx+Olx
104                sig11(I,J) = 0. _d 0
105                sig22(I,J) = 0. _d 0
106                sig12(I,J) = 0. _d 0
107               ENDDO
108              ENDDO
109    
110              DO j=1-Oly+1,sNy+Oly-1
111               DO i=1-Olx+1,sNx+Olx-1
112                eplus = e11(I,J,bi,bj) + e22(I,J,bi,bj)
113                eminus= e11(I,J,bi,bj) - e22(I,J,bi,bj)
114                sig11(I,J) = zeta(I,J,bi,bj)*eplus + eta(I,J,bi,bj)*eminus
115         &           - 0.5 _d 0 * PRESS(I,J,bi,bj)
116                sig22(I,J) = zeta(I,J,bi,bj)*eplus - eta(I,J,bi,bj)*eminus
117         &           - 0.5 _d 0 * PRESS(I,J,bi,bj)
118                sig12(I,J) = 2. _d 0 * e12(I,J,bi,bj) *
119         &           ( eta(I,J  ,bi,bj) + eta(I-1,J  ,bi,bj)
120         &           + eta(I,J-1,bi,bj) + eta(I-1,J-1,bi,bj) )
121         &           /MAX(1. _d 0,
122         &             hEffM(I,J  ,bi,bj) + hEffM(I-1,J  ,bi,bj)
123         &           + hEffM(I,J-1,bi,bj) + hEffM(I-1,J-1,bi,bj))
124               ENDDO
125              ENDDO
126    C     evaluate divergence of stress and apply to forcing
127              DO J=1,sNy
128               DO I=1,sNx
129                FX = ( sig11(I  ,J  ) * _dyF(I  ,J  ,bi,bj)
130         &           - sig11(I-1,J  ) * _dyF(I-1,J  ,bi,bj)
131         &           + sig12(I  ,J+1) * _dxV(I  ,J+1,bi,bj)
132         &           - sig12(I  ,J  ) * _dxV(I  ,J  ,bi,bj)
133         &           ) * recip_rAw(I,J,bi,bj)
134         &           -
135         &           ( sig12(I,J) + sig12(I,J+1) )
136         &           * _tanPhiAtU(I,J,bi,bj) * recip_rSphere
137         &           +
138         &           ( sig22(I,J) + sig22(I-1,J) ) * 0.5 _d 0
139         &           * _tanPhiAtU(I,J,bi,bj) * recip_rSphere
140    C     one metric term  missing for general curvilinear coordinates
141                FY = ( sig22(I  ,J  ) * _dxF(I  ,J  ,bi,bj)
142         &           - sig22(I  ,J-1) * _dxF(I  ,J-1,bi,bj)
143         &           + sig12(I+1,J  ) * _dyU(I+1,J  ,bi,bj)
144         &           - sig12(I  ,J  ) * _dyU(I  ,J  ,bi,bj)
145         &           ) * recip_rAs(I,J,bi,bj)
146         &           -
147         &           ( sig22(I,J) + sig22(I,J-1) ) * 0.5 _d 0
148         &           * _tanPhiAtV(I,J,bi,bj) * recip_rSphere
149    C     two metric terms missing for general curvilinear coordinates
150    C     average wind stress over ice and ocean and apply averaged wind
151    C     stress and internal ice stresses to surface layer of ocean
152                areaW = 0.5 * (AREA(I,J,1,bi,bj) + AREA(I-1,J,1,bi,bj))
153         &           * SEAICEstressFactor
154                areaS = 0.5 * (AREA(I,J,1,bi,bj) + AREA(I,J-1,1,bi,bj))
155         &           * SEAICEstressFactor
156                fu(I,J,bi,bj)=(ONE-areaW)*fu(I,J,bi,bj)
157         &           + areaW*taux(I,J,bi,bj)
158         &           + FX * SEAICEstressFactor
159                fv(I,J,bi,bj)=(ONE-areaS)*fv(I,J,bi,bj)
160         &           + areaS*tauy(I,J,bi,bj)
161         &           + FY * SEAICEstressFactor
162    C     save stress divergence for later
163    #ifdef SEAICE_ALLOW_EVP
164                stressDivergenceX(I,J,bi,bj) = FX
165                stressDivergenceY(I,J,bi,bj) = FY
166    #endif /* SEAICE_ALLOW_EVP */
167               ENDDO
168              ENDDO
169             ELSE
170    #ifdef SEAICE_ALLOW_EVP
171              DO J=1,sNy
172               DO I=1,sNx
173    C     average wind stress over ice and ocean and apply averaged wind
174    C     stress and internal ice stresses to surface layer of ocean
175                areaW = 0.5 * (AREA(I,J,1,bi,bj) + AREA(I-1,J,1,bi,bj))
176         &           * SEAICEstressFactor
177                areaS = 0.5 * (AREA(I,J,1,bi,bj) + AREA(I,J-1,1,bi,bj))
178         &           * SEAICEstressFactor
179                fu(I,J,bi,bj)=(ONE-areaW)*fu(I,J,bi,bj)
180         &           + areaW*taux(I,J,bi,bj)
181         &           + stressDivergenceX(I,J,bi,bj) * SEAICEstressFactor
182                fv(I,J,bi,bj)=(ONE-areaS)*fv(I,J,bi,bj)
183         &           + areaS*tauy(I,J,bi,bj)
184         &           + stressDivergenceY(I,J,bi,bj) * SEAICEstressFactor
185               ENDDO
186              ENDDO
187    #endif /* SEAICE_ALLOW_EVP */
188             ENDIF
189            ENDDO
190           ENDDO
191          ELSE
192    
193    C--   Compute ice-affected wind stress (interpolate to U/V-points)
194    C     by averaging wind stress and ice-ocean stress according to
195    C     ice cover
196        DO bj=myByLo(myThid),myByHi(myThid)        DO bj=myByLo(myThid),myByHi(myThid)
197         DO bi=myBxLo(myThid),myBxHi(myThid)         DO bi=myBxLo(myThid),myBxHi(myThid)
198          DO j=1,sNy          DO j=1,sNy
199           DO i=1,sNx           DO i=1,sNx
200            fuIce=HALF*( DWATN(I,J,bi,bj)+DWATN(I,J+1,bi,bj) )*(            fuIceLoc=HALF*( DWATN(I,J,bi,bj)+DWATN(I,J+1,bi,bj) )*
201       &         COSWAT *       &         COSWAT *
202       &         ( UICE(I,J,1,bi,bj)-GWATX(I,J,bi,bj) )       &         ( UICE(I,J,1,bi,bj)-GWATX(I,J,bi,bj) )
203       &         - SINWAT* 0.5 _d 0 * (       &         - SIGN(SINWAT, _fCori(I,J,bi,bj)) * 0.5 _d 0 *
204       &          0.5 _d 0*(vIce(I  ,J  ,1,bi,bj)-GWATY(I  ,J  ,bi,bj)       &         ( DWATN(I  ,J,bi,bj) *
205       &                   +vIce(I-1,J  ,1,bi,bj)-GWATY(I-1,J  ,bi,bj))       &         0.5 _d 0*(vIce(I  ,J  ,1,bi,bj)-GWATY(I  ,J  ,bi,bj)
206       &         +0.5 _d 0*(vIce(I  ,J+1,1,bi,bj)-GWATY(I  ,J+1,bi,bj)       &                  +vIce(I  ,J+1,1,bi,bj)-GWATY(I  ,J+1,bi,bj))
207       &                   +vIce(I-1,J+1,1,bi,bj)-GWATY(I-1,J+1,bi,bj)) )       &         + DWATN(I-1,J,bi,bj) *
208         &         0.5 _d 0*(vIce(I-1,J  ,1,bi,bj)-GWATY(I-1,J  ,bi,bj)
209         &                  +vIce(I-1,J+1,1,bi,bj)-GWATY(I-1,J+1,bi,bj))
210       &         )       &         )
211            fvIce=HALF*( DWATN(I,J,bi,bj)+DWATN(I+1,J,bi,bj) )*(            fvIceLoc=HALF*( DWATN(I,J,bi,bj)+DWATN(I+1,J,bi,bj) )*
212       &         SINWAT *       &         COSWAT *
213       &         ( UICE(I,J,1,bi,bj)-GWATX(I,J,bi,bj) )       &         ( VICE(I,J,1,bi,bj)-GWATY(I,J,bi,bj) )
214       &         + COSWAT * 0.5 _d 0 * (       &         + SIGN(SINWAT,  _fCori(I,J,bi,bj)) * 0.5 _d 0 *
215       &          0.5 _d 0*(uIce(I  ,J  ,1,bi,bj)-GWATY(I  ,J  ,bi,bj)       &         ( DWATN(I,J  ,bi,bj) *
216       &                   +uIce(I+1,J  ,1,bi,bj)-GWATX(I+1,J  ,bi,bj))       &         0.5 _d 0*(uIce(I  ,J  ,1,bi,bj)-GWATX(I  ,J  ,bi,bj)
217       &         +0.5 _d 0*(uIce(I  ,J-1,1,bi,bj)-GWATY(I  ,J-1,bi,bj)       &                  +uIce(I+1,J  ,1,bi,bj)-GWATX(I+1,J  ,bi,bj))
218       &                   +uIce(I+1,J-1,1,bi,bj)-GWATX(I+1,J-1,bi,bj)) )       &         + DWATN(I,J-1,bi,bj) *
219         &         0.5 _d 0*(uIce(I  ,J-1,1,bi,bj)-GWATX(I  ,J-1,bi,bj)
220         &                  +uIce(I+1,J-1,1,bi,bj)-GWATX(I+1,J-1,bi,bj))
221       &         )       &         )
222            fu(I,J,bi,bj)=(ONE-AREA(I,J,1,bi,bj))*fu(I,J,bi,bj)+            areaW = 0.5 _d 0 * (AREA(I,J,1,bi,bj) + AREA(I-1,J,1,bi,bj))
223       &         AREA(I,J,1,bi,bj)*fuIce       &         * SEAICEstressFactor
224            fv(I,J,bi,bj)=(ONE-AREA(I,J,1,bi,bj))*fv(I,J,bi,bj)+            areaS = 0.5 _d 0 * (AREA(I,J,1,bi,bj) + AREA(I,J-1,1,bi,bj))
225       &         AREA(I,J,1,bi,bj)*fvIce       &         * SEAICEstressFactor
226              fu(I,J,bi,bj)=(ONE-areaW)*fu(I,J,bi,bj)+areaW*fuIceLoc
227              fv(I,J,bi,bj)=(ONE-areaS)*fv(I,J,bi,bj)+areaS*fvIceLoc
228           ENDDO           ENDDO
229          ENDDO          ENDDO
230         ENDDO         ENDDO
231        ENDDO        ENDDO
232          ENDIF
233        CALL EXCH_UV_XY_RS(fu, fv, .TRUE., myThid)        CALL EXCH_UV_XY_RS(fu, fv, .TRUE., myThid)
234  #endif /* SEAICE_TEST_ICE_STRESS_1 */  
235  #endif /* not SEAICE_CGRID */  #endif /* not SEAICE_CGRID */
236    
237        RETURN        RETURN

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.16

  ViewVC Help
Powered by ViewVC 1.1.22