source: trunk/LMDZ.GENERIC/libf/phystd/forceWCfn.F @ 2987

Last change on this file since 2987 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
RevLine 
[1308]1      subroutine forceWCfn(ngrid,nlayer,nq,pplev,pt,dq,dqs)
[253]2
[787]3      USE tracer_h
[1384]4      use comcstfi_mod, only: g
[787]5
[253]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
[1308]21      INTEGER ngrid,nlayer,nq
[787]22
[253]23      real masse, Wtot, Wdiff
24
[1308]25      real pplev(ngrid,nlayer+1)
[787]26      real pt(ngrid)
[253]27
[787]28      real dqs(ngrid,nq)
[1308]29      real dq(ngrid,nlayer,nq)
[253]30
31      integer iq, ig, ilay
32
[787]33      do iq=1,nq
34        do ig=1,ngrid
[253]35           Wtot = 0.0
[1308]36           do ilay=1,nlayer
[253]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.