/[MITgcm]/MITgcm/verification/hs94.cs-32x32x5/code/external_forcing.F
ViewVC logotype

Contents of /MITgcm/verification/hs94.cs-32x32x5/code/external_forcing.F

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


Revision 1.5 - (show annotations) (download)
Fri Jul 6 22:13:37 2001 UTC (22 years, 9 months ago) by jmc
Branch: MAIN
CVS Tags: checkpoint46n_post, checkpoint51k_post, checkpoint47e_post, checkpoint52l_pre, checkpoint46l_post, checkpoint57g_pre, checkpoint46g_pre, checkpoint47c_post, release1_p13_pre, checkpoint50c_post, checkpoint57b_post, checkpoint46f_post, checkpoint57g_post, checkpoint48e_post, checkpoint56b_post, checkpoint50g_post, checkpoint46b_post, checkpoint52j_pre, checkpoint43a-release1mods, checkpoint51o_pre, checkpoint44g_post, checkpoint54d_post, checkpoint48c_post, checkpoint54e_post, release1_p13, checkpoint40pre3, checkpoint51l_post, checkpoint40pre7, checkpoint40pre6, checkpoint48i_post, checkpoint40pre9, checkpoint40pre8, checkpoint46l_pre, checkpoint57d_post, checkpoint57i_post, checkpoint50d_pre, checkpoint52k_post, chkpt44d_post, checkpoint55, checkpoint54, checkpoint57, checkpoint56, checkpoint51, checkpoint53, checkpoint52, release1_p8, release1_p9, checkpoint50d_post, release1_p1, release1_p2, release1_p3, release1_p4, release1_p5, release1_p6, release1_p7, checkpoint52f_post, checkpoint50b_pre, checkpoint44e_pre, checkpoint54f_post, checkpoint51f_post, release1_b1, checkpoint48b_post, checkpoint43, checkpoint51d_post, checkpoint48c_pre, checkpoint55a_post, checkpoint51t_post, checkpoint51n_post, release1_chkpt44d_post, checkpoint55i_post, checkpoint57l_post, checkpoint52i_pre, checkpoint51s_post, checkpoint55c_post, checkpoint48d_pre, checkpoint51j_post, checkpoint47i_post, checkpoint52e_pre, checkpoint57f_post, checkpoint52e_post, checkpoint51n_pre, checkpoint47d_post, checkpoint53d_post, checkpoint46d_pre, checkpoint40pre2, checkpoint57a_post, checkpoint48d_post, release1-branch_tutorials, checkpoint57h_pre, checkpoint48f_post, checkpoint45d_post, checkpoint52b_pre, checkpoint54b_post, checkpoint46j_pre, checkpoint57h_post, checkpoint51l_pre, checkpoint52m_post, chkpt44a_post, checkpoint55g_post, checkpoint44h_pre, checkpoint48h_post, checkpoint51q_post, checkpoint40pre4, checkpoint51b_pre, checkpoint46a_post, checkpoint47g_post, checkpoint52b_post, checkpoint52c_post, checkpoint46j_post, checkpoint51h_pre, checkpoint46k_post, checkpoint46b_pre, chkpt44c_pre, checkpoint52h_pre, checkpoint45a_post, checkpoint57c_post, checkpoint50f_post, checkpoint50a_post, checkpoint50f_pre, checkpoint52f_pre, checkpoint55d_post, checkpoint44e_post, release1_p12, release1_p10, release1_p11, release1_p16, release1_p17, release1_p14, release1_p15, checkpoint47j_post, checkpoint54a_pre, checkpoint47a_post, checkpoint53c_post, checkpoint55d_pre, checkpoint57c_pre, checkpoint55j_post, branch-exfmods-tag, branchpoint-genmake2, checkpoint54a_post, checkpoint46e_pre, checkpoint55h_post, checkpoint51r_post, checkpoint45b_post, checkpoint51i_post, checkpoint57e_post, release1-branch-end, release1_final_v1, checkpoint55b_post, checkpoint51b_post, release1_p12_pre, checkpoint46c_pre, checkpoint53a_post, checkpoint46, checkpoint44f_post, checkpoint47b_post, checkpoint44b_post, checkpoint55f_post, checkpoint46h_pre, checkpoint52d_post, checkpoint53g_post, checkpoint46m_post, checkpoint46a_pre, checkpoint50c_pre, checkpoint45c_post, checkpoint44h_post, eckpoint57e_pre, checkpoint46g_post, checkpoint51c_post, checkpoint52a_pre, checkpoint50h_post, checkpoint52i_post, checkpoint50e_pre, checkpoint50i_post, checkpoint51i_pre, checkpoint48a_post, checkpoint56a_post, checkpoint53f_post, checkpoint40pre5, checkpoint57h_done, checkpoint52j_post, checkpoint47f_post, checkpoint50e_post, chkpt44a_pre, checkpoint46i_post, checkpoint57j_post, checkpoint57f_pre, checkpoint46c_post, branch-netcdf, checkpoint52l_post, checkpoint52n_post, checkpoint53b_pre, checkpoint46e_post, release1_beta1, checkpoint56c_post, checkpoint51e_post, checkpoint44b_pre, checkpoint42, checkpoint57a_pre, checkpoint40, checkpoint41, checkpoint47d_pre, checkpoint47, checkpoint44, checkpoint45, checkpoint48, checkpoint49, checkpoint46h_post, checkpoint51o_post, checkpoint50, checkpoint57k_post, checkpoint51f_pre, chkpt44c_post, checkpoint53b_post, checkpoint47h_post, checkpoint52a_post, checkpoint44f_pre, checkpoint51g_post, ecco_c52_e35, checkpoint46d_post, checkpoint50b_post, release1-branch_branchpoint, checkpoint51m_post, checkpoint53d_pre, checkpoint55e_post, checkpoint54c_post, checkpoint51a_post, checkpoint51p_post, checkpoint48g_post, checkpoint51u_post
Branch point for: branch-exfmods-curt, release1_coupled, release1_final, release1-branch, branch-genmake2, release1, branch-nonh, tg2-branch, release1_50yr, netcdf-sm0, checkpoint51n_branch
Changes since 1.4: +39 -33 lines
fixed a Pb in kV with non flat topography ;
use the (standard) atmospheric constants (in PARAMS.h)

1 C $Header: /u/gcmpack/models/MITgcmUV/verification/hs94.cs-32x32x5/code/external_forcing.F,v 1.4 2001/06/06 20:31:48 adcroft Exp $
2 C $Name: $
3
4 #include "CPP_OPTIONS.h"
5
6 CStartOfInterface
7 SUBROUTINE EXTERNAL_FORCING_U(
8 I iMin, iMax, jMin, jMax,bi,bj,kLev,
9 I myCurrentTime,myThid)
10 C /==========================================================\
11 C | S/R EXTERNAL_FORCING_U |
12 C | o Contains problem specific forcing for zonal velocity. |
13 C |==========================================================|
14 C | Adds terms to gU for forcing by external sources |
15 C | e.g. wind stress, bottom friction etc.................. |
16 C \==========================================================/
17 IMPLICIT NONE
18
19 C == Global data ==
20 #include "SIZE.h"
21 #include "EEPARAMS.h"
22 #include "PARAMS.h"
23 #include "GRID.h"
24 #include "DYNVARS.h"
25 #include "FFIELDS.h"
26
27 C == Routine arguments ==
28 C iMin - Working range of tile for applying forcing.
29 C iMax
30 C jMin
31 C jMax
32 C kLev
33 INTEGER iMin, iMax, jMin, jMax, kLev, bi, bj
34 _RL myCurrentTime
35 INTEGER myThid
36 CEndOfInterface
37
38 C == Local variables ==
39 C Loop counters
40 INTEGER I, J
41 C _RL uKf
42 C _RL levelOfGround
43 C _RL criticalLevel
44 C _RL levelOfVelPoint
45 C _RL dist1
46 C _RL dist2
47 C _RL decayFac
48 C _RL velDragHeightFac
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=jMin,jMax
55 c DO I=iMin,iMax
56 DO J=1,sNy
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 CStartOfInterface
73 SUBROUTINE EXTERNAL_FORCING_V(
74 I iMin, iMax, jMin, jMax,bi,bj,kLev,
75 I myCurrentTime,myThid)
76 C /==========================================================\
77 C | S/R EXTERNAL_FORCING_V |
78 C | o Contains problem specific forcing for merid velocity. |
79 C |==========================================================|
80 C | Adds terms to gV for forcing by external sources |
81 C | e.g. wind stress, bottom friction etc.................. |
82 C \==========================================================/
83 IMPLICIT NONE
84
85 C == Global data ==
86 #include "SIZE.h"
87 #include "EEPARAMS.h"
88 #include "PARAMS.h"
89 #include "GRID.h"
90 #include "DYNVARS.h"
91 #include "FFIELDS.h"
92
93
94 C == Routine arguments ==
95 C iMin - Working range of tile for applying forcing.
96 C iMax
97 C jMin
98 C jMax
99 C kLev
100 INTEGER iMin, iMax, jMin, jMax, kLev, bi, bj
101 _RL myCurrentTime
102 INTEGER myThid
103 CEndOfInterface
104 C == Local variables ==
105 C Loop counters
106 INTEGER I, J
107 C _RL uKf
108 C _RL levelOfGround
109 C _RL criticalLevel
110 C _RL levelOfVelPoint
111 C _RL dist1
112 C _RL dist2
113 C _RL decayFac
114 C _RL velDragHeightFac
115 _RL recip_P0g,termP,kV,kF,sigma_b
116
117 C-- Forcing term(s)
118 kF=1. _d 0/86400. _d 0
119 sigma_b = 0.7 _d 0
120 c DO J=jMin,jMax
121 c DO I=iMin,iMax
122 DO J=1,sNy+1
123 DO I=1,sNx
124 IF ( hFacS(i,j,kLev,bi,bj) .GT. 0. ) THEN
125 recip_P0g=MAX(recip_Rcol(I,J,bi,bj),recip_Rcol(I,J-1,bi,bj))
126 termP=0.5 _d 0*( MIN(rF(kLev)*recip_P0g,1. _d 0)
127 & +rF(kLev+1)*recip_P0g )
128 c termP=0.5 _d 0*( rF(kLev) + rF(kLev+1) )*recip_P0g
129 kV=kF*MAX( 0. _d 0, (termP-sigma_b)/(1. _d 0-sigma_b) )
130 gV(i,j,kLev,bi,bj)=gV(i,j,kLev,bi,bj)
131 & -kV*vVel(i,j,kLev,bi,bj)
132 ENDIF
133 ENDDO
134 ENDDO
135
136 RETURN
137 END
138 CStartOfInterface
139 SUBROUTINE EXTERNAL_FORCING_T(
140 I iMin, iMax, jMin, jMax,bi,bj,kLev,
141 I myCurrentTime,myThid)
142 C /==========================================================\
143 C | S/R EXTERNAL_FORCING_T |
144 C | o Contains problem specific forcing for temperature. |
145 C |==========================================================|
146 C | Adds terms to gT for forcing by external sources |
147 C | e.g. heat flux, climatalogical relaxation.............. |
148 C \==========================================================/
149 IMPLICIT NONE
150
151 C == Global data ==
152 #include "SIZE.h"
153 #include "EEPARAMS.h"
154 #include "PARAMS.h"
155 #include "GRID.h"
156 #include "DYNVARS.h"
157 #include "FFIELDS.h"
158
159 C == Routine arguments ==
160 C iMin - Working range of tile for applying forcing.
161 C iMax
162 C jMin
163 C jMax
164 C kLev
165 INTEGER iMin, iMax, jMin, jMax, kLev, bi, bj
166 _RL myCurrentTime
167 INTEGER myThid
168 CEndOfInterface
169
170 C == Local variables ==
171 C Loop counters
172 INTEGER I, J
173 _RL thetaLim,kT,ka,ks,sigma_b,term1,term2,thetaEq,termP
174
175 C-- Forcing term(s)
176 ka=1. _d 0/(40. _d 0*86400. _d 0)
177 ks=1. _d 0/(4. _d 0 *86400. _d 0)
178 sigma_b = 0.7 _d 0
179 DO J=jMin,jMax
180 DO I=iMin,iMax
181 term1=60. _d 0*(sin(yC(I,J,bi,bj)*deg2rad)**2)
182 termP=0.5 _d 0*( rF(kLev) + rF(kLev+1) )
183 term2=10. _d 0*log(termP/atm_po)
184 & *(cos(yC(I,J,bi,bj)*deg2rad)**2)
185 thetaLim = 200. _d 0/ ((termP/atm_po)**atm_kappa)
186 thetaEq=315. _d 0-term1-term2
187 thetaEq=MAX(thetaLim,thetaEq)
188 termP=0.5 _d 0*( MIN(rF(kLev),Ro_surf(I,J,bi,bj))+rF(kLev+1) )
189 kT=ka+(ks-ka)
190 & *MAX(0. _d 0,
191 & (termP*recip_Rcol(I,J,bi,bj)-sigma_b)/(1. _d 0-sigma_b) )
192 & *COS((yC(I,J,bi,bj)*deg2rad))**4
193 gT(i,j,kLev,bi,bj)=gT(i,j,kLev,bi,bj)
194 & - kT*( theta(I,J,kLev,bi,bj)-thetaEq )
195 & *maskC(i,j,kLev,bi,bj)
196 ENDDO
197 ENDDO
198
199 RETURN
200 END
201 CStartOfInterface
202 SUBROUTINE EXTERNAL_FORCING_S(
203 I iMin, iMax, jMin, jMax,bi,bj,kLev,
204 I myCurrentTime,myThid)
205 C /==========================================================\
206 C | S/R EXTERNAL_FORCING_S |
207 C | o Contains problem specific forcing for merid velocity. |
208 C |==========================================================|
209 C | Adds terms to gS for forcing by external sources |
210 C | e.g. fresh-water flux, climatalogical relaxation....... |
211 C \==========================================================/
212 IMPLICIT NONE
213
214 C == Global data ==
215 #include "SIZE.h"
216 #include "EEPARAMS.h"
217 #include "PARAMS.h"
218 #include "GRID.h"
219 #include "DYNVARS.h"
220 #include "FFIELDS.h"
221
222 C == Routine arguments ==
223 C iMin - Working range of tile for applying forcing.
224 C iMax
225 C jMin
226 C jMax
227 C kLev
228 INTEGER iMin, iMax, jMin, jMax, kLev, bi, bj
229 _RL myCurrentTime
230 INTEGER myThid
231 CEndOfInterface
232
233 C == Local variables ==
234 C Loop counters
235 INTEGER I, J
236
237 C-- Forcing term(s)
238
239 RETURN
240 END

  ViewVC Help
Powered by ViewVC 1.1.22