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

Last change on this file since 263 was 227, checked in by milmd, 10 years ago

Last LMDZ version (1315) with OpenMP directives and other stuff

File size: 1.0 KB
Line 
1      subroutine forceWCfn(ngrid,nlayer,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,nlayer,nq
25
26      real masse, Wtot, Wdiff
27
28      real pplev(ngrid,nlayer+1)
29      real pt(ngrid)
30
31      real dqs(ngrid,nq) 
32      real dq(ngrid,nlayer,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,nlayer
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.