/[MITgcm]/MITgcm/verification/hs94.128x64x5/code/external_forcing.F
ViewVC logotype

Contents of /MITgcm/verification/hs94.128x64x5/code/external_forcing.F

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


Revision 1.8 - (show annotations) (download)
Sun Jul 17 18:40:10 2005 UTC (18 years, 8 months ago) by jmc
Branch: MAIN
CVS Tags: checkpoint57m_post, checkpoint57s_post, checkpoint58b_post, checkpoint57y_post, checkpoint65z, checkpoint65x, checkpoint65y, checkpoint65r, checkpoint65s, checkpoint65p, checkpoint65q, checkpoint65v, checkpoint65w, checkpoint65t, checkpoint65u, checkpoint65j, checkpoint65k, checkpoint65h, checkpoint65i, checkpoint65n, checkpoint65l, checkpoint65m, checkpoint65b, checkpoint65c, checkpoint65a, checkpoint65f, checkpoint65g, checkpoint65d, checkpoint65e, checkpoint62c, checkpoint57r_post, checkpoint59, checkpoint58, checkpoint58f_post, checkpoint58d_post, checkpoint58a_post, checkpoint57z_post, 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, checkpoint58t_post, checkpoint58m_post, checkpoint57t_post, checkpoint57v_post, checkpoint64, checkpoint65, checkpoint60, checkpoint61, checkpoint62, checkpoint63, checkpoint66g, checkpoint66f, checkpoint66e, checkpoint66d, checkpoint66c, checkpoint66b, checkpoint66a, checkpoint66o, checkpoint66n, checkpoint66m, checkpoint66l, checkpoint66k, checkpoint66j, checkpoint66i, checkpoint66h, checkpoint58w_post, checkpoint57y_pre, checkpoint58o_post, checkpoint58p_post, checkpoint58q_post, checkpoint58e_post, checkpoint63p, checkpoint63q, checkpoint63r, checkpoint63s, checkpoint63l, checkpoint63m, checkpoint63n, checkpoint63o, checkpoint63h, checkpoint63i, checkpoint63j, checkpoint63k, checkpoint63d, checkpoint63e, checkpoint63f, checkpoint63g, checkpoint63a, checkpoint63b, checkpoint63c, checkpoint58r_post, checkpoint58n_post, checkpoint65o, checkpoint59q, checkpoint59p, checkpoint59r, checkpoint59e, checkpoint59d, checkpoint59g, checkpoint59f, checkpoint59a, checkpoint59c, checkpoint59b, checkpoint59m, checkpoint59l, checkpoint59o, checkpoint59n, checkpoint59i, checkpoint59h, checkpoint59k, checkpoint59j, checkpoint57p_post, checkpint57u_post, checkpoint57q_post, checkpoint58k_post, checkpoint62b, checkpoint58v_post, checkpoint64y, checkpoint64x, checkpoint58l_post, checkpoint64z, checkpoint64q, checkpoint64p, checkpoint64s, checkpoint64r, checkpoint64u, checkpoint64t, checkpoint64w, checkpoint64v, checkpoint64i, checkpoint64h, checkpoint64k, checkpoint64j, checkpoint64m, checkpoint64l, checkpoint64o, checkpoint64n, checkpoint64a, checkpoint64c, checkpoint64b, checkpoint64e, checkpoint64d, checkpoint64g, checkpoint64f, checkpoint61f, checkpoint58g_post, checkpoint58x_post, checkpoint61n, checkpoint58h_post, checkpoint58j_post, checkpoint57o_post, checkpoint61q, checkpoint61z, checkpoint57w_post, checkpoint61e, checkpoint58i_post, checkpoint57x_post, checkpoint58c_post, checkpoint58u_post, checkpoint58s_post, checkpoint61g, checkpoint61d, checkpoint61b, checkpoint61c, checkpoint61a, checkpoint61o, checkpoint61l, checkpoint61m, checkpoint61j, checkpoint61k, checkpoint61h, checkpoint61i, checkpoint61v, checkpoint61w, checkpoint61t, checkpoint61u, checkpoint61r, checkpoint61s, checkpoint61p, checkpoint61x, checkpoint61y, HEAD
Changes since 1.7: +145 -104 lines
use tutorial_held_suarez_cs version.

1 C $Header: /u/gcmpack/MITgcm/verification/tutorial_held_suarez_cs/code/external_forcing.F,v 1.1 2005/07/15 21:25:20 jmc Exp $
2 C $Name: $
3
4 #include "CPP_OPTIONS.h"
5
6 CBOP
7 C !ROUTINE: EXTERNAL_FORCING_U
8 C !INTERFACE:
9 SUBROUTINE EXTERNAL_FORCING_U(
10 I iMin,iMax, jMin,jMax, bi,bj, kLev,
11 I myTime, myThid )
12 C !DESCRIPTION: \bv
13 C *==========================================================*
14 C | S/R EXTERNAL_FORCING_U
15 C | o Contains problem specific forcing for zonal velocity.
16 C *==========================================================*
17 C | Adds terms to gU for forcing by external sources
18 C | e.g. wind stress, bottom friction etc ...
19 C *==========================================================*
20 C \ev
21
22 C !USES:
23 IMPLICIT NONE
24 C == Global data ==
25 #include "SIZE.h"
26 #include "EEPARAMS.h"
27 #include "PARAMS.h"
28 #include "GRID.h"
29 #include "DYNVARS.h"
30 #include "FFIELDS.h"
31
32 C !INPUT/OUTPUT PARAMETERS:
33 C == Routine arguments ==
34 C iMin,iMax :: Working range of x-index for applying forcing.
35 C jMin,jMax :: Working range of y-index for applying forcing.
36 C bi,bj :: Current tile indices
37 C kLev :: Current vertical level index
38 C myTime :: Current time in simulation
39 C myThid :: Thread Id number
40 INTEGER iMin, iMax, jMin, jMax, kLev, bi, bj
41 _RL myTime
42 INTEGER myThid
43
44 C !LOCAL VARIABLES:
45 C == Local variables ==
46 C i,j :: Loop counters
47 INTEGER i, j
48 CEOP
49 _RL recip_P0g, termP, kV, kF, sigma_b
50
51 C-- Forcing term(s)
52 kF=1. _d 0/86400. _d 0
53 sigma_b = 0.7 _d 0
54 c DO j=1,sNy
55 C-jmc: Without CD-scheme, this is OK ; but with CD-scheme, needs to cover [0:sNy+1]
56 DO j=0,sNy+1
57 DO i=1,sNx+1
58 IF ( hFacW(i,j,kLev,bi,bj) .GT. 0. ) THEN
59 recip_P0g=MAX(recip_Rcol(i,j,bi,bj),recip_Rcol(i-1,j,bi,bj))
60 termP=0.5 _d 0*( MIN(rF(kLev)*recip_P0g,1. _d 0)
61 & +rF(kLev+1)*recip_P0g )
62 c termP=0.5 _d 0*( rF(kLev) + rF(kLev+1) )*recip_P0g
63 kV=kF*MAX( 0. _d 0, (termP-sigma_b)/(1. _d 0-sigma_b) )
64 gU(i,j,kLev,bi,bj)=gU(i,j,kLev,bi,bj)
65 & -kV*uVel(i,j,kLev,bi,bj)
66 ENDIF
67 ENDDO
68 ENDDO
69
70 RETURN
71 END
72
73 C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|
74 CBOP
75 C !ROUTINE: EXTERNAL_FORCING_V
76 C !INTERFACE:
77 SUBROUTINE EXTERNAL_FORCING_V(
78 I iMin,iMax, jMin,jMax, bi,bj, kLev,
79 I myTime, myThid )
80 C !DESCRIPTION: \bv
81 C *==========================================================*
82 C | S/R EXTERNAL_FORCING_V
83 C | o Contains problem specific forcing for merid velocity.
84 C *==========================================================*
85 C | Adds terms to gV for forcing by external sources
86 C | e.g. wind stress, bottom friction etc ...
87 C *==========================================================*
88 C \ev
89
90 C !USES:
91 IMPLICIT NONE
92 C == Global data ==
93 #include "SIZE.h"
94 #include "EEPARAMS.h"
95 #include "PARAMS.h"
96 #include "GRID.h"
97 #include "DYNVARS.h"
98 #include "FFIELDS.h"
99
100 C !INPUT/OUTPUT PARAMETERS:
101 C == Routine arguments ==
102 C iMin,iMax :: Working range of x-index for applying forcing.
103 C jMin,jMax :: Working range of y-index for applying forcing.
104 C bi,bj :: Current tile indices
105 C kLev :: Current vertical level index
106 C myTime :: Current time in simulation
107 C myThid :: Thread Id number
108 INTEGER iMin, iMax, jMin, jMax, kLev, bi, bj
109 _RL myTime
110 INTEGER myThid
111
112 C !LOCAL VARIABLES:
113 C == Local variables ==
114 C i,j :: Loop counters
115 INTEGER i, j
116 CEOP
117 _RL recip_P0g, termP, kV, kF, sigma_b
118
119 C-- Forcing term(s)
120 kF=1. _d 0/86400. _d 0
121 sigma_b = 0.7 _d 0
122 DO j=1,sNy+1
123 c DO i=1,sNx
124 C-jmc: Without CD-scheme, this is OK ; but with CD-scheme, needs to cover [0:sNx+1]
125 DO i=0,sNx+1
126 IF ( hFacS(i,j,kLev,bi,bj) .GT. 0. ) THEN
127 recip_P0g=MAX(recip_Rcol(i,j,bi,bj),recip_Rcol(i,j-1,bi,bj))
128 termP=0.5 _d 0*( MIN(rF(kLev)*recip_P0g,1. _d 0)
129 & +rF(kLev+1)*recip_P0g )
130 c termP=0.5 _d 0*( rF(kLev) + rF(kLev+1) )*recip_P0g
131 kV=kF*MAX( 0. _d 0, (termP-sigma_b)/(1. _d 0-sigma_b) )
132 gV(i,j,kLev,bi,bj)=gV(i,j,kLev,bi,bj)
133 & -kV*vVel(i,j,kLev,bi,bj)
134 ENDIF
135 ENDDO
136 ENDDO
137
138 RETURN
139 END
140
141 C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|
142 CBOP
143 C !ROUTINE: EXTERNAL_FORCING_T
144 C !INTERFACE:
145 SUBROUTINE EXTERNAL_FORCING_T(
146 I iMin,iMax, jMin,jMax, bi,bj, kLev,
147 I myTime, myThid )
148 C !DESCRIPTION: \bv
149 C *==========================================================*
150 C | S/R EXTERNAL_FORCING_T
151 C | o Contains problem specific forcing for temperature.
152 C *==========================================================*
153 C | Adds terms to gT for forcing by external sources
154 C | e.g. heat flux, climatalogical relaxation, etc ...
155 C *==========================================================*
156 C \ev
157
158 C !USES:
159 IMPLICIT NONE
160 C == Global data ==
161 #include "SIZE.h"
162 #include "EEPARAMS.h"
163 #include "PARAMS.h"
164 #include "GRID.h"
165 #include "DYNVARS.h"
166 #include "FFIELDS.h"
167
168 C !INPUT/OUTPUT PARAMETERS:
169 C == Routine arguments ==
170 C iMin,iMax :: Working range of x-index for applying forcing.
171 C jMin,jMax :: Working range of y-index for applying forcing.
172 C bi,bj :: Current tile indices
173 C kLev :: Current vertical level index
174 C myTime :: Current time in simulation
175 C myThid :: Thread Id number
176 INTEGER iMin, iMax, jMin, jMax, kLev, bi, bj
177 _RL myTime
178 INTEGER myThid
179
180 C !LOCAL VARIABLES:
181 C == Local variables ==
182 C i,j :: Loop counters
183 INTEGER i, j
184 CEOP
185 _RL thetaLim,kT,ka,ks,sigma_b,term1,term2,thetaEq,termP
186
187 C-- Forcing term(s)
188 ka=1. _d 0/(40. _d 0*86400. _d 0)
189 ks=1. _d 0/(4. _d 0 *86400. _d 0)
190 sigma_b = 0.7 _d 0
191 DO j=1,sNy
192 DO i=1,sNx
193 term1=60. _d 0*(SIN(yC(i,j,bi,bj)*deg2rad)**2)
194 termP=0.5 _d 0*( rF(kLev) + rF(kLev+1) )
195 term2=10. _d 0*LOG(termP/atm_po)
196 & *(COS(yC(i,j,bi,bj)*deg2rad)**2)
197 thetaLim = 200. _d 0/ ((termP/atm_po)**atm_kappa)
198 thetaEq=315. _d 0-term1-term2
199 thetaEq=MAX(thetaLim,thetaEq)
200 termP=0.5 _d 0*( MIN(rF(kLev),Ro_surf(i,j,bi,bj))+rF(kLev+1) )
201 kT=ka+(ks-ka)
202 & *MAX(0. _d 0,
203 & (termP*recip_Rcol(i,j,bi,bj)-sigma_b)/(1. _d 0-sigma_b) )
204 & *COS((yC(i,j,bi,bj)*deg2rad))**4
205 gT(i,j,kLev,bi,bj)=gT(i,j,kLev,bi,bj)
206 & - kT*( theta(i,j,kLev,bi,bj)-thetaEq )
207 & *maskC(i,j,kLev,bi,bj)
208 ENDDO
209 ENDDO
210
211 RETURN
212 END
213
214 C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|
215 CBOP
216 C !ROUTINE: EXTERNAL_FORCING_S
217 C !INTERFACE:
218 SUBROUTINE EXTERNAL_FORCING_S(
219 I iMin,iMax, jMin,jMax, bi,bj, kLev,
220 I myTime, myThid )
221
222 C !DESCRIPTION: \bv
223 C *==========================================================*
224 C | S/R EXTERNAL_FORCING_S
225 C | o Contains problem specific forcing for merid velocity.
226 C *==========================================================*
227 C | Adds terms to gS for forcing by external sources
228 C | e.g. fresh-water flux, climatalogical relaxation, etc ...
229 C *==========================================================*
230 C \ev
231
232 C !USES:
233 IMPLICIT NONE
234 C == Global data ==
235 #include "SIZE.h"
236 #include "EEPARAMS.h"
237 #include "PARAMS.h"
238 #include "GRID.h"
239 #include "DYNVARS.h"
240 #include "FFIELDS.h"
241
242 C !INPUT/OUTPUT PARAMETERS:
243 C == Routine arguments ==
244 C iMin,iMax :: Working range of x-index for applying forcing.
245 C jMin,jMax :: Working range of y-index for applying forcing.
246 C bi,bj :: Current tile indices
247 C kLev :: Current vertical level index
248 C myTime :: Current time in simulation
249 C myThid :: Thread Id number
250 INTEGER iMin, iMax, jMin, jMax, kLev, bi, bj
251 _RL myTime
252 INTEGER myThid
253
254 C !LOCAL VARIABLES:
255 C == Local variables ==
256 C i,j :: Loop counters
257 c INTEGER i, j
258 CEOP
259
260 C-- Forcing term(s)
261
262 RETURN
263 END

  ViewVC Help
Powered by ViewVC 1.1.22