Last change
on this file since 3058 was
1384,
checked in by emillour, 10 years ago
|
Generic GCM:
- Some code cleanup: turning comcstfi.h into module comcstfi_mod.F90
EM
|
File size:
1003 bytes
|
Line | |
---|
1 | subroutine forceWCfn(ngrid,nlayer,nq,pplev,pt,dq,dqs) |
---|
2 | |
---|
3 | USE tracer_h |
---|
4 | use comcstfi_mod, only: g |
---|
5 | |
---|
6 | implicit none |
---|
7 | |
---|
8 | !================================================================== |
---|
9 | ! |
---|
10 | ! Purpose |
---|
11 | ! ------- |
---|
12 | ! Force tracer conservation in a column for a given pair of |
---|
13 | ! delta q, delta q_s |
---|
14 | ! |
---|
15 | ! Authors |
---|
16 | ! ------- |
---|
17 | ! R. Wordsworth |
---|
18 | ! |
---|
19 | !================================================================== |
---|
20 | |
---|
21 | INTEGER ngrid,nlayer,nq |
---|
22 | |
---|
23 | real masse, Wtot, Wdiff |
---|
24 | |
---|
25 | real pplev(ngrid,nlayer+1) |
---|
26 | real pt(ngrid) |
---|
27 | |
---|
28 | real dqs(ngrid,nq) |
---|
29 | real dq(ngrid,nlayer,nq) |
---|
30 | |
---|
31 | integer iq, ig, ilay |
---|
32 | |
---|
33 | do iq=1,nq |
---|
34 | do ig=1,ngrid |
---|
35 | Wtot = 0.0 |
---|
36 | do ilay=1,nlayer |
---|
37 | masse = (pplev(ig,ilay) - pplev(ig,ilay+1))/g |
---|
38 | Wtot = Wtot + masse*dq(ig,ilay,iq) |
---|
39 | enddo |
---|
40 | Wdiff = Wtot + dqs(ig,iq) |
---|
41 | |
---|
42 | dqs(ig,iq) = dqs(ig,iq) - Wdiff |
---|
43 | enddo |
---|
44 | enddo |
---|
45 | |
---|
46 | end |
---|
47 | |
---|
Note: See
TracBrowser
for help on using the repository browser.