/[MITgcm]/MITgcm/pkg/shelfice/shelfice_forcing.F
ViewVC logotype

Contents of /MITgcm/pkg/shelfice/shelfice_forcing.F

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


Revision 1.2 - (show annotations) (download)
Mon Aug 14 16:52:46 2006 UTC (17 years, 8 months ago) by mlosch
Branch: MAIN
CVS Tags: checkpoint58u_post, checkpoint58w_post, checkpoint63p, checkpoint63l, checkpoint63m, checkpoint63n, checkpoint63o, checkpoint63h, checkpoint63i, checkpoint63j, checkpoint63k, checkpoint63d, checkpoint63e, checkpoint63f, checkpoint63g, checkpoint63a, checkpoint63b, checkpoint63c, checkpoint60, checkpoint61, checkpoint62, checkpoint63, checkpoint58r_post, checkpoint58x_post, checkpoint58t_post, checkpoint58q_post, checkpoint59q, checkpoint59p, checkpoint59r, checkpoint59e, checkpoint59d, checkpoint59g, checkpoint59f, checkpoint59a, checkpoint59c, checkpoint59b, checkpoint59m, checkpoint59l, checkpoint59o, checkpoint59n, checkpoint59i, checkpoint59h, checkpoint59k, checkpoint59j, checkpoint59, checkpoint58o_post, checkpoint62c, checkpoint62b, checkpoint62a, checkpoint62g, checkpoint62f, checkpoint62e, checkpoint62d, checkpoint62k, checkpoint62j, checkpoint62i, checkpoint62h, checkpoint62o, checkpoint62n, checkpoint62m, checkpoint62l, checkpoint62s, checkpoint62r, checkpoint62q, checkpoint62p, checkpoint62w, checkpoint62v, checkpoint62u, checkpoint62t, checkpoint62z, checkpoint62y, checkpoint62x, checkpoint58y_post, checkpoint58v_post, checkpoint58s_post, checkpoint61f, checkpoint61g, checkpoint61d, checkpoint61e, checkpoint61b, checkpoint61c, checkpoint58p_post, checkpoint61a, checkpoint61n, checkpoint61o, checkpoint61l, checkpoint61m, checkpoint61j, checkpoint61k, checkpoint61h, checkpoint61i, checkpoint61v, checkpoint61w, checkpoint61t, checkpoint61u, checkpoint61r, checkpoint61s, checkpoint61p, checkpoint61q, checkpoint61z, checkpoint61x, checkpoint61y
Changes since 1.1: +69 -31 lines
add a simple boundary layer scheme to reduce noise, off by default for
now

1 C $Header: /u/gcmpack/MITgcm/pkg/shelfice/shelfice_forcing.F,v 1.1 2006/02/07 11:45:21 mlosch Exp $
2 C $Name: $
3
4 #include "PACKAGES_CONFIG.h"
5 #include "CPP_OPTIONS.h"
6
7 C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|
8 CBOP
9 C !ROUTINE: SHELFICE_FORCING_T
10 C !INTERFACE:
11 SUBROUTINE SHELFICE_FORCING_T(
12 I iMin,iMax, jMin,jMax, bi,bj, kLev,
13 I myTime, myThid )
14 C !DESCRIPTION: \bv
15 C *==========================================================*
16 C | S/R SHELFICE_FORCING_T
17 C | o Contains problem specific forcing for temperature.
18 C *==========================================================*
19 C | Adds terms to gT for forcing by shelfice sources
20 C | e.g. heat flux
21 C *==========================================================*
22 C \ev
23
24 C !USES:
25 IMPLICIT NONE
26 C == Global data ==
27 #include "SIZE.h"
28 #include "EEPARAMS.h"
29 #include "PARAMS.h"
30 #include "GRID.h"
31 #include "DYNVARS.h"
32 #include "FFIELDS.h"
33 #include "SHELFICE.h"
34
35 C !INPUT/OUTPUT PARAMETERS:
36 C == Routine arguments ==
37 C iMin,iMax :: Working range of x-index for applying forcing.
38 C jMin,jMax :: Working range of y-index for applying forcing.
39 C bi,bj :: Current tile indices
40 C kLev :: Current vertical level index
41 C myTime :: Current time in simulation
42 C myThid :: Thread Id number
43 INTEGER iMin, iMax, jMin, jMax, kLev, bi, bj
44 _RL myTime
45 INTEGER myThid
46
47 #ifdef ALLOW_SHELFICE
48 C !LOCAL VARIABLES:
49 C == Local variables ==
50 C i,j :: Loop counters
51 C kp1,km1 :: index of next/previous level
52 C gTloc :: local tendency in boundary layer
53 C drLoc :: fractional cell width of boundary layer in (k+/-1)th layer
54 INTEGER i, j
55 INTEGER Kp1, Km1
56 _RS drLoc
57 _RL gTloc
58 CEOP
59
60 C-- Forcing term
61 DO j=1,sNy
62 DO i=1,sNx
63 IF ( SHELFICEBoundaryLayer ) THEN
64 IF ( kLev .LT. Nr .AND. kLev .EQ. kTopC(I,J,bi,bj) ) THEN
65 kp1 = MIN(kLev+1,Nr)
66 drLoc = drF(kLev)*( 1. _d 0 - _hFacC(I,J,kLev,bi,bj) )
67 drLoc = MIN( drLoc, drF(Kp1) * _hFacC(I,J,Kp1,bi,bj) )
68 gTloc = shelficeForcingT(i,j,bi,bj)
69 & /( drF(kLev)*_hFacC(I,J,kLev,bi,bj)+drLoc )
70 gT(i,j,kLev,bi,bj)=gT(i,j,kLev,bi,bj) + gTloc
71 ELSEIF ( kLev .GT. 1 .AND. kLev-1 .EQ. kTopC(I,J,bi,bj) ) THEN
72 km1 = MAX(kLev-1,1)
73 drLoc = drF(km1)*( 1. _d 0 - _hFacC(I,J,km1,bi,bj) )
74 drLoc = MIN( drLoc, drF(kLev) * _hFacC(I,J,kLev,bi,bj) )
75 gTloc = shelficeForcingT(i,j,bi,bj)
76 & /( drF(km1)*_hFacC(I,J,km1,bi,bj)+drLoc )
77 C The following is shorthand for the averaged tendency:
78 C gT(k+1) = gT(k+1) + { gTloc * [drF(k)*(1-hFacC(k))]
79 C + 0 * [drF(k+1) - drF(k)*(1-hFacC(k))]
80 C }/[drF(k+1)*hFacC(k+1)]
81 gT(i,j,kLev,bi,bj)=gT(i,j,kLev,bi,bj) + gTloc
82 & * drLoc*recip_drF(kLev)* _recip_hFacC(i,j,kLev,bi,bj)
83 ENDIF
84 ELSE
85 IF ( kLev .EQ. kTopC(I,J,bi,bj) ) THEN
86 gT(i,j,kLev,bi,bj)=gT(i,j,kLev,bi,bj)
87 & +shelficeForcingT(i,j,bi,bj)
88 & *recip_drF(kLev)* _recip_hFacC(i,j,kLev,bi,bj)
89 ENDIF
90 ENDIF
91 ENDDO
92 ENDDO
93
94 #endif /* ALLOW_SHELFICE */
95 RETURN
96 END
97
98 C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|
99 CBOP
100 C !ROUTINE: SHELFICE_FORCING_S
101 C !INTERFACE:
102 SUBROUTINE SHELFICE_FORCING_S(
103 I iMin,iMax, jMin,jMax, bi,bj, kLev,
104 I myTime, myThid )
105
106 C !DESCRIPTION: \bv
107 C *==========================================================*
108 C | S/R SHELFICE_FORCING_S
109 C | o Contains problem specific forcing for merid velocity.
110 C *==========================================================*
111 C | Adds terms to gS for forcing by shelfice sources
112 C | e.g. fresh-water flux (virtual salt flux).
113 C *==========================================================*
114 C \ev
115
116 C !USES:
117 IMPLICIT NONE
118 C == Global data ==
119 #include "SIZE.h"
120 #include "EEPARAMS.h"
121 #include "PARAMS.h"
122 #include "GRID.h"
123 #include "DYNVARS.h"
124 C#include "FFIELDS.h"
125 #include "SHELFICE.h"
126
127 C !INPUT/OUTPUT PARAMETERS:
128 C == Routine arguments ==
129 C iMin,iMax :: Working range of x-index for applying forcing.
130 C jMin,jMax :: Working range of y-index for applying forcing.
131 C bi,bj :: Current tile indices
132 C kLev :: Current vertical level index
133 C myTime :: Current time in simulation
134 C myThid :: Thread Id number
135 INTEGER iMin, iMax, jMin, jMax, kLev, bi, bj
136 _RL myTime
137 INTEGER myThid
138
139 #ifdef ALLOW_SHELFICE
140 C !LOCAL VARIABLES:
141 C == Local variables ==
142 C i,j :: Loop counters
143 C kp/m1 :: index of next/previous level
144 C gTloc :: local tendency in boundary layer
145 C drLoc :: fractional cell width of boundary layer
146 INTEGER i, j
147 INTEGER Kp1, Km1
148 _RS drLoc
149 _RL gSloc
150 CEOP
151
152 C-- Forcing term
153 DO j=1,sNy
154 DO i=1,sNx
155 IF ( SHELFICEBoundaryLayer ) THEN
156 IF ( kLev .LT. Nr .AND. kLev .EQ. kTopC(I,J,bi,bj) ) THEN
157 kp1 = MIN(kLev+1,Nr)
158 drLoc = drF(kLev)*( 1. _d 0 - _hFacC(I,J,kLev,bi,bj) )
159 drLoc = MIN( drLoc, drF(Kp1) * _hFacC(I,J,Kp1,bi,bj) )
160 gSloc = shelficeForcingS(i,j,bi,bj)
161 & /( drF(kLev)*_hFacC(I,J,kLev,bi,bj)+drLoc )
162 gS(i,j,kLev,bi,bj)=gS(i,j,kLev,bi,bj) + gSloc
163 ELSEIF ( kLev .GT. 1 .AND. kLev-1 .EQ. kTopC(I,J,bi,bj) ) THEN
164 km1 = MAX(kLev-1,1)
165 drLoc = drF(km1)*( 1. _d 0 - _hFacC(I,J,km1,bi,bj) )
166 drLoc = MIN( drLoc, drF(kLev) * _hFacC(I,J,kLev,bi,bj) )
167 gSloc = shelficeForcingS(i,j,bi,bj)
168 & /( drF(km1)*_hFacC(I,J,km1,bi,bj)+drLoc )
169 C The following is shorthand for the averaged tendency:
170 C gS(k+1) = gS(k+1) + { gSloc * [drF(k)*(1-hFacC(k))]
171 C + 0 * [drF(k+1) - drF(k)*(1-hFacC(k))]
172 C }/[drF(k+1)*hFacC(k+1)]
173 gS(i,j,kLev,bi,bj)=gS(i,j,kLev,bi,bj) + gSloc
174 & * drLoc*recip_drF(kLev)* _recip_hFacC(i,j,kLev,bi,bj)
175 ENDIF
176 ELSE
177 IF ( kLev .EQ. kTopC(I,J,bi,bj) ) THEN
178 gS(i,j,kLev,bi,bj)=gS(i,j,kLev,bi,bj)
179 & +shelficeForcingS(i,j,bi,bj)
180 & *recip_drF(kLev)* _recip_hFacC(i,j,kLev,bi,bj)
181 ENDIF
182 ENDIF
183 ENDDO
184 ENDDO
185
186 #endif /* ALLOW_SHELFICE */
187 RETURN
188 END

  ViewVC Help
Powered by ViewVC 1.1.22