source: codes/icosagcm/branches/SATURN_DYNAMICO/LMDZ.COMMON/libf/phystd/forceWCfn.F @ 224

Last change on this file since 224 was 222, checked in by ymipsl, 10 years ago

Creating temporary dynamico/lmdz/saturn branche

YM

File size: 1.0 KB
Line 
1      subroutine forceWCfn(ngrid,nq,pplev,pt,dq,dqs)
2
3      USE tracer_h
4
5      implicit none
6
7!==================================================================
8!     
9!     Purpose
10!     -------
11!     Force tracer conservation in a column for a given pair of
12!     delta q, delta q_s
13!
14!     Authors
15!     -------
16!     R. Wordsworth
17!     
18!==================================================================
19
20#include "dimensions.h"
21#include "dimphys.h"
22#include "comcstfi.h"
23
24      INTEGER ngrid,nq
25
26      real masse, Wtot, Wdiff
27
28      real pplev(ngrid,nlayermx+1)
29      real pt(ngrid)
30
31      real dqs(ngrid,nq) 
32      real dq(ngrid,nlayermx,nq)
33
34      integer iq, ig, ilay
35
36      do iq=1,nq 
37        do ig=1,ngrid
38           Wtot = 0.0
39           do ilay=1,nlayermx
40              masse = (pplev(ig,ilay) - pplev(ig,ilay+1))/g
41              Wtot  = Wtot + masse*dq(ig,ilay,iq)
42           enddo
43           Wdiff = Wtot + dqs(ig,iq)
44         
45           dqs(ig,iq) = dqs(ig,iq) - Wdiff
46        enddo
47      enddo
48
49      end 
50
Note: See TracBrowser for help on using the repository browser.