source: trunk/LMDZ.GENERIC/libf/phystd/callsedim.F @ 997

Last change on this file since 997 was 858, checked in by emillour, 12 years ago

Generic GCM:

  • Fixed sedimentation issue: ensure in callsedim that the correct radii are provided to newsedim and also that the updated temperature and tracer mixing ratios are used to compute sedimentation.
  • Updated the way aerosol radii are considered and used; routines in radii_mod (h2o_reffrad, co2_reffrad, etc.) only handle a single aerosol. The idea here is that these can be called from anywhere and that the caller doesn't need to have the full (naerkind size) array of aerosol radii.
  • cleanup (addition of intent(..) to routine arguments) in various routines

EM

File size: 5.0 KB
Line 
1      SUBROUTINE callsedim(ngrid,nlay, ptimestep,
2     &                pplev,zlev, pt, pdt,
3     &                pq, pdqfi, pdqsed,pdqs_sed,nq)
4
5      use radinc_h, only : naerkind
6      use radii_mod, only: h2o_reffrad
7      use aerosol_mod, only : iaero_h2o
8      USE tracer_h, only : igcm_co2_ice,igcm_h2o_ice,radius,rho_q
9
10      IMPLICIT NONE
11
12!==================================================================
13!     
14!     Purpose
15!     -------
16!     Calculates sedimentation of aerosols depending on their
17!     density and radius.
18!     
19!     Authors
20!     -------
21!     F. Forget (1999)
22!     Tracer generalisation by E. Millour (2009)
23!     
24!==================================================================
25
26c-----------------------------------------------------------------------
27c   declarations:
28c   -------------
29
30#include "dimensions.h"
31#include "dimphys.h"
32#include "comcstfi.h"
33#include "callkeys.h"
34
35c   arguments:
36c   ----------
37
38      integer,intent(in):: ngrid ! number of horizontal grid points
39      integer,intent(in):: nlay  ! number of atmospheric layers
40      real,intent(in):: ptimestep  ! physics time step (s)
41      real,intent(in):: pplev(ngrid,nlay+1) ! pressure at inter-layers (Pa)
42      real,intent(in):: pt(ngrid,nlay)      ! temperature at mid-layer (K)
43      real,intent(in):: pdt(ngrid,nlay) ! tendency on temperature
44      real,intent(in):: zlev(ngrid,nlay+1)  ! altitude at layer boundaries
45      integer,intent(in) :: nq ! number of tracers
46      real,intent(in) :: pq(ngrid,nlay,nq)  ! tracers (kg/kg)
47      real,intent(in) :: pdqfi(ngrid,nlay,nq)  ! tendency on tracers before
48                                               ! sedimentation (kg/kg.s-1)
49     
50      real,intent(out) :: pdqsed(ngrid,nlay,nq) ! tendency due to sedimentation (kg/kg.s-1)
51      real,intent(out) :: pdqs_sed(ngrid,nq)    ! flux at surface (kg.m-2.s-1)
52     
53c   local:
54c   ------
55
56      INTEGER l,ig, iq
57
58      ! for particles with varying radii:
59      real reffrad(ngrid,nlay,naerkind) ! particle radius (m)
60      real nueffrad(ngrid,nlay,naerkind) ! aerosol effective radius variance
61
62      real zqi(ngrid,nlay,nq) ! to locally store tracers
63      real zt(ngrid,nlay) ! to locally store temperature (K)
64      real masse (ngrid,nlay) ! Layer mass (kg.m-2)
65      real epaisseur (ngrid,nlay) ! Layer thickness (m)
66      real wq(ngrid,nlay+1) ! displaced tracer mass (kg.m-2)
67c      real dens(ngrid,nlayermx) ! Mean density of the ice part. accounting for dust core
68
69
70      LOGICAL,SAVE :: firstcall=.true.
71
72c    ** un petit test de coherence
73c       --------------------------
74
75      IF (firstcall) THEN
76        firstcall=.false.
77      ENDIF ! of IF (firstcall)
78     
79!=======================================================================
80!     Preliminary calculation of the layer characteristics
81!     (mass (kg.m-2), thickness (m), etc.
82
83      do  l=1,nlay
84        do ig=1, ngrid
85          masse(ig,l)=(pplev(ig,l) - pplev(ig,l+1)) /g
86          epaisseur(ig,l)= zlev(ig,l+1) - zlev(ig,l)
87          zt(ig,l)=pt(ig,l)+pdt(ig,l)*ptimestep
88        end do
89      end do
90
91!======================================================================
92! Calculate the transport due to sedimentation for each tracer
93! [This has been rearranged by L. Kerber to allow the sedimentation
94!  of general tracers.]
95 
96      do iq=1,nq
97       if((radius(iq).gt.1.e-9).and.(iq.ne.igcm_co2_ice)) then   
98!         (no sedim for gases, and co2_ice sedim is done in condense_cloud)     
99
100! store locally updated tracers
101
102          do l=1,nlay
103            do ig=1, ngrid
104              zqi(ig,l,iq)=pq(ig,l,iq)+pdqfi(ig,l,iq)*ptimestep
105            enddo
106          enddo ! of do l=1,nlay
107       
108!======================================================================
109! Sedimentation
110!======================================================================
111! Water         
112          if (water.and.(iq.eq.igcm_h2o_ice)) then
113            ! compute radii for h2o_ice
114             call h2o_reffrad(ngrid,zqi(1,1,igcm_h2o_ice),zt,
115     &                reffrad(1,1,iaero_h2o),nueffrad(1,1,iaero_h2o))
116            ! call sedimentation for h2o_ice
117             call newsedim(ngrid,nlay,ngrid*nlay,ptimestep,
118     &            pplev,masse,epaisseur,zt,reffrad(1,1,iaero_h2o),
119     &            rho_q(iq),zqi(1,1,igcm_h2o_ice),wq)
120
121! General Case
122          else
123             call newsedim(ngrid,nlay,1,ptimestep,
124     &            pplev,masse,epaisseur,zt,radius(iq),rho_q(iq),
125     &            zqi(1,1,iq),wq)
126          endif
127
128!=======================================================================
129!     Calculate the tendencies
130!======================================================================
131
132          do ig=1,ngrid
133!     Ehouarn: with new way of tracking tracers by name, this is simply
134            pdqs_sed(ig,iq) = wq(ig,1)/ptimestep
135          end do
136
137          DO l = 1, nlay
138            DO ig=1,ngrid
139              pdqsed(ig,l,iq)=(zqi(ig,l,iq)-
140     &        (pq(ig,l,iq) + pdqfi(ig,l,iq)*ptimestep))/ptimestep
141            ENDDO
142          ENDDO
143       endif ! of no gases no co2_ice
144      enddo ! of do iq=1,nq
145      return
146      end
Note: See TracBrowser for help on using the repository browser.