source: trunk/LMDZ.MARS/libf/phymars/simpleclouds.F @ 1266

Last change on this file since 1266 was 1266, checked in by aslmd, 11 years ago

LMDZ.MARS
IMPORTANT CHANGE

  • Remove all reference/use of nlayermx and dimphys.h
  • Made use of automatic arrays whenever arrays are needed with dimension nlayer
  • Remove lots of obsolete reference to dimensions.h
  • Converted iono.h and param_v4.h into corresponding modules

(with embedded subroutine to allocate arrays)
(no arrays allocated if thermosphere not used)

  • Deleted param.h and put contents into module param_v4_h
  • Adapted testphys1d, newstart, etc...
  • Made DATA arrays in param_read to be initialized by subroutine

fill_data_thermos in module param_v4_h

  • Optimized computations in paramfoto_compact (twice less dlog10 calculations)
  • Checked consistency before/after modification in debug mode
  • Checked performance is not impacted (same as before)
File size: 6.4 KB
Line 
1      subroutine simpleclouds(ngrid,nlay,ptimestep,
2     &             pplay,pzlay,pt,pdt,
3     &             pq,pdq,pdqcloud,pdtcloud,
4     &             nq,tau,rice)
5      USE updaterad
6      use tracer_mod, only: igcm_h2o_vap, igcm_h2o_ice
7      USE comcstfi_h
8      use dimradmars_mod, only: naerkind
9      implicit none
10c------------------------------------------------------------------
11c  This routine is used to form clouds when a parcel of the GCM is
12c    saturated. It is a simplified scheme, and there is almost no
13c    microphysics involved. When the air is saturated, water-ice
14c    clouds form on a fraction of the dust particles, specified by
15c    the constant called "ccn_factor". There is no supersaturation,
16c    and no nucleation rates computed. A more accurate scheme can
17c    be found in the routine called "improvedclouds.F".
18
19c  Modif de zq si saturation dans l'atmosphere
20c  si zq(ig,l)> zqsat(ig,l) ->    zq(ig,l)=zqsat(ig,l)
21c  Le test est effectue de bas en haut. L'eau condensee
22c    (si saturation) est remise dans la couche en dessous.
23c  L'eau condensee dans la couche du bas est deposee a la surface
24
25c  Authors: Franck Montmessin (water ice scheme)
26c           Francois Forget (changed nuclei density & outputs)
27c           Ehouarn Millour (sept.2008, tracers are now handled
28c                                   by name and not fixed index)
29c           J.-B. Madeleine (developed a single routine called
30c                            simpleclouds.F, and corrected calculations
31c                            of the typical CCN profile, Oct. 2011)
32c------------------------------------------------------------------
33#include "callkeys.h"
34
35c------------------------------------------------------------------
36c     Arguments:
37c     ---------
38c     Inputs:
39      INTEGER ngrid,nlay
40      integer nq                 ! nombre de traceurs
41      REAL ptimestep             ! pas de temps physique (s)
42      REAL pplay(ngrid,nlay)     ! pression au milieu des couches (Pa)
43      REAL pzlay(ngrid,nlay)     ! altitude at the middle of the layers
44      REAL pt(ngrid,nlay)        ! temperature at the middle of the
45                                 !   layers (K)
46      REAL pdt(ngrid,nlay)       ! tendance temperature des autres
47                                 !   param.
48      real pq(ngrid,nlay,nq)     ! traceur (kg/kg)
49      real pdq(ngrid,nlay,nq)    ! tendance avant condensation
50                                 !   (kg/kg.s-1)
51      REAL tau(ngrid,naerkind)   ! Column dust optical depth at each point
52
53c     Output:
54      REAL rice(ngrid,nlay)      ! Ice mass mean radius (m)
55                                 ! (r_c in montmessin_2004)
56      real pdqcloud(ngrid,nlay,nq) ! tendance de la condensation
57                                   !   H2O(kg/kg.s-1)
58      REAL pdtcloud(ngrid,nlay)    ! tendance temperature due
59                                   !   a la chaleur latente
60
61c------------------------------------------------------------------
62c     Local variables:
63
64      LOGICAL,SAVE :: firstcall = .true.
65           
66      REAL rhocloud(ngrid,nlay)  ! Cloud density (kg.m-3)
67
68      INTEGER ig,l
69
70      REAL zq(ngrid,nlay,nq)    ! local value of tracers
71      REAL zq0(ngrid,nlay,nq)   ! local initial value of tracers
72      REAL zt(ngrid,nlay)       ! local value of temperature
73      REAL zqsat(ngrid,nlay)    ! saturation
74      REAL*8 dzq                      ! masse de glace echangee (kg/kg)
75      REAL lw                         !Latent heat of sublimation (J.kg-1)
76      REAL,PARAMETER :: To=273.15     ! reference temperature, T=273.15 K
77      real rdusttyp(ngrid,nlay) ! Typical dust geom. mean radius (m)
78      REAL ccntyp(ngrid,nlay)
79                                      ! Typical dust number density (#/kg)
80c     CCN reduction factor
81c      REAL, PARAMETER :: ccn_factor = 4.5  !! comme TESTS_JB // 1. avant
82     
83
84c-----------------------------------------------------------------------
85c    1. initialisation
86c    -----------------
87
88c    On "update" la valeur de q(nq) (water vapor) et temperature.
89c    On effectue qqes calculs preliminaires sur les couches :
90
91      do l=1,nlay
92        do ig=1,ngrid
93          zq(ig,l,igcm_h2o_vap)=
94     &      pq(ig,l,igcm_h2o_vap)+pdq(ig,l,igcm_h2o_vap)*ptimestep
95          zq(ig,l,igcm_h2o_vap)=max(zq(ig,l,igcm_h2o_vap),1.E-30) ! FF 12/2004
96          zq0(ig,l,igcm_h2o_vap)=zq(ig,l,igcm_h2o_vap)
97          zt(ig,l)=pt(ig,l)+ pdt(ig,l)*ptimestep
98
99          zq(ig,l,igcm_h2o_ice)=
100     &      pq(ig,l,igcm_h2o_ice)+pdq(ig,l,igcm_h2o_ice)*ptimestep
101          zq(ig,l,igcm_h2o_ice)=max(zq(ig,l,igcm_h2o_ice),0.) ! FF 12/2004
102          zq0(ig,l,igcm_h2o_ice)=zq(ig,l,igcm_h2o_ice)
103        enddo
104      enddo
105
106
107      pdqcloud(1:ngrid,1:nlay,1:nq)=0
108      pdtcloud(1:ngrid,1:nlay)=0
109
110c     ----------------------------------------------
111c
112c
113c     Rapport de melange a saturation dans la couche l : -------
114c     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
115
116      call watersat(ngrid*nlay,zt,pplay,zqsat)
117
118c     taux de condensation (kg/kg/s-1) dans les differentes couches
119c     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
120
121      do l=1,nlay
122        do ig=1,ngrid
123
124          if (zq(ig,l,igcm_h2o_vap).ge.zqsat(ig,l))then  !  Condensation
125            dzq=zq(ig,l,igcm_h2o_vap)-zqsat(ig,l)               
126          elseif(zq(ig,l,igcm_h2o_vap).lt.zqsat(ig,l))then  ! Sublimation
127            dzq=-min(zqsat(ig,l)-zq(ig,l,igcm_h2o_vap),
128     &               zq(ig,l,igcm_h2o_ice))
129          endif
130
131c         Water Mass change
132c         ~~~~~~~~~~~~~~~~~
133          zq(ig,l,igcm_h2o_ice)=zq(ig,l,igcm_h2o_ice)+dzq
134          zq(ig,l,igcm_h2o_vap)=zq(ig,l,igcm_h2o_vap)-dzq
135         
136
137        enddo ! of do ig=1,ngrid
138      enddo ! of do l=1,nlay
139
140c     Tendance finale
141c     ~~~~~~~~~~~~~~~
142      do l=1, nlay
143        do ig=1,ngrid
144          pdqcloud(ig,l,igcm_h2o_vap)=(zq(ig,l,igcm_h2o_vap)
145     &                            -zq0(ig,l,igcm_h2o_vap))/ptimestep
146          pdqcloud(ig,l,igcm_h2o_ice) =
147     &      (zq(ig,l,igcm_h2o_ice) - zq0(ig,l,igcm_h2o_ice))/ptimestep
148          lw=(2834.3-0.28*(zt(ig,l)-To)-0.004*(zt(ig,l)-To)**2)*1.e+3
149          pdtcloud(ig,l)=-pdqcloud(ig,l,igcm_h2o_vap)*lw/cpp
150        end do
151      end do
152
153c     ice crystal radius
154      do l=1, nlay
155        do ig=1,ngrid
156          call updaterice_typ(zq(ig,l,igcm_h2o_ice),
157     &       tau(ig,1),pzlay(ig,l),rice(ig,l))
158        end do
159      end do
160
161c------------------------------------------------------------------
162      return
163      end
Note: See TracBrowser for help on using the repository browser.