1 |
C $Header: /u/gcmpack/MITgcm/model/src/update_etaws.F,v 1.1 2011/12/08 22:35:43 jmc Exp $ |
2 |
C $Name: $ |
3 |
|
4 |
#include "CPP_OPTIONS.h" |
5 |
|
6 |
CBOP |
7 |
C !ROUTINE: UPDATE_ETAWS |
8 |
C !INTERFACE: |
9 |
SUBROUTINE UPDATE_ETAWS( myTime, myIter, myThid ) |
10 |
C !DESCRIPTION: \bv |
11 |
C *==========================================================* |
12 |
C | SUBROUTINE UPDATE_ETAWS |
13 |
C | o For hybrid sigma-coordinate, derive SSH value |
14 |
C | (etaHw & etaHs) and SSH tendency (dEtaWdt & dEtaSdt) |
15 |
C | at grid-cell Western and Southern edges. |
16 |
C *==========================================================* |
17 |
C \ev |
18 |
|
19 |
C !USES: |
20 |
IMPLICIT NONE |
21 |
C == Global variables |
22 |
#include "SIZE.h" |
23 |
#include "EEPARAMS.h" |
24 |
#include "PARAMS.h" |
25 |
#include "DYNVARS.h" |
26 |
#include "GRID.h" |
27 |
#include "SURFACE.h" |
28 |
|
29 |
C !INPUT/OUTPUT PARAMETERS: |
30 |
C == Routine arguments == |
31 |
C myTime :: Current time in simulation |
32 |
C myIter :: Current iteration number |
33 |
C myThid :: my Thread Id number |
34 |
_RL myTime |
35 |
INTEGER myIter |
36 |
INTEGER myThid |
37 |
|
38 |
C !LOCAL VARIABLES: |
39 |
#ifdef EXACT_CONSERV |
40 |
C Local variables in common block |
41 |
|
42 |
#ifdef NONLIN_FRSURF |
43 |
# ifndef DISABLE_SIGMA_CODE |
44 |
C Local variables |
45 |
C i,j,bi,bj :: Loop counters |
46 |
INTEGER i,j,bi,bj |
47 |
CEOP |
48 |
|
49 |
IF ( nonlinFreeSurf.GT.0 .AND. selectSigmaCoord.NE.0 ) THEN |
50 |
|
51 |
DO bj=myByLo(myThid),myByHi(myThid) |
52 |
DO bi=myBxLo(myThid),myBxHi(myThid) |
53 |
C- 1rst bi,bj loop : |
54 |
|
55 |
C-- copy etaHX -> dEtaXdt |
56 |
DO j=1-OLy,sNy+OLy |
57 |
DO i=1-OLx,sNx+OLx |
58 |
dEtaWdt(i,j,bi,bj) = etaHw(i,j,bi,bj) |
59 |
dEtaSdt(i,j,bi,bj) = etaHs(i,j,bi,bj) |
60 |
ENDDO |
61 |
ENDDO |
62 |
|
63 |
DO j=1,sNy+1 |
64 |
DO i=1,sNx+1 |
65 |
etaHw(i,j,bi,bj) = ( etaH (i-1,j,bi,bj) |
66 |
& + etaH ( i ,j,bi,bj) )*0.5 _d 0 |
67 |
etaHs(i,j,bi,bj) = ( etaH (i,j-1,bi,bj) |
68 |
& + etaH (i, j ,bi,bj) )*0.5 _d 0 |
69 |
c etaHw(i,j,bi,bj) = 0.5 _d 0 |
70 |
c & *( etaH (i-1,j,bi,bj)*rA(i-1,j,bi,bj) |
71 |
c & + etaH ( i ,j,bi,bj)*rA( i ,j,bi,bj) |
72 |
c & )*recip_rAw(i,j,bi,bj) |
73 |
c etaHs(i,j,bi,bj) = 0.5 _d 0 |
74 |
c & *( etaH (i,j-1,bi,bj)*rA(i,j-1,bi,bj) |
75 |
c & + etaH (i, j ,bi,bj)*rA(i, j ,bi,bj) |
76 |
c & )*recip_rAs(i,j,bi,bj) |
77 |
ENDDO |
78 |
ENDDO |
79 |
|
80 |
C- end 1rst bi,bj loop. |
81 |
ENDDO |
82 |
ENDDO |
83 |
|
84 |
CALL EXCH_UV_XY_RL( etaHw, etaHs, .FALSE., myThid ) |
85 |
|
86 |
DO bj=myByLo(myThid),myByHi(myThid) |
87 |
DO bi=myBxLo(myThid),myBxHi(myThid) |
88 |
C- 2nd bi,bj loop : |
89 |
|
90 |
DO j=1-OLy,sNy+OLy |
91 |
DO i=1-OLx,sNx+OLx |
92 |
dEtaWdt(i,j,bi,bj) = ( etaHw(i,j,bi,bj) |
93 |
& - dEtaWdt(i,j,bi,bj) )/deltaTfreesurf |
94 |
dEtaSdt(i,j,bi,bj) = ( etaHs(i,j,bi,bj) |
95 |
& - dEtaSdt(i,j,bi,bj) )/deltaTfreesurf |
96 |
ENDDO |
97 |
ENDDO |
98 |
|
99 |
C- end 2nd bi,bj loop. |
100 |
ENDDO |
101 |
ENDDO |
102 |
|
103 |
ENDIF |
104 |
# endif /* DISABLE_SIGMA_CODE */ |
105 |
#endif /* NONLIN_FRSURF */ |
106 |
|
107 |
#endif /* EXACT_CONSERV */ |
108 |
|
109 |
RETURN |
110 |
END |