Index: palm/trunk/SOURCE/plant_canopy_model.f90
===================================================================
--- palm/trunk/SOURCE/plant_canopy_model.f90	(revision 142)
+++ palm/trunk/SOURCE/plant_canopy_model.f90	(revision 153)
@@ -4,4 +4,10 @@
 ! Actual revisions:
 ! -----------------
+! Consideration of heat sources within the forest canopy which represent the
+! rate of heat input into the air from the forest leaves
+!
+! Evaluation of sinks and sources for scalar concentration due to canopy 
+! elements
+!
 ! Bugfix: remove IF statement in plant_canopy_model_ij
 !
@@ -15,5 +21,6 @@
 ! Description:
 ! ------------
-! Evaluation of the drag due to vegetation
+! Evaluation of sinks and sources of momentum, heat and scalar concentration 
+! due to canopy elements
 !------------------------------------------------------------------------------!
 
@@ -59,5 +66,5 @@
                                               v(k,j,i)        +  &
                                               v(k,j+1,i)      +  &
-                                              v(k,j+1,i+1) )     &
+                                              v(k,j+1,i-1) )     &
                                             / 4.0 )**2        +  &
                                           ( ( w(k-1,j,i-1)    +  &
@@ -120,6 +127,42 @@
 
 !
+!--       potential temperature
+          CASE ( 4 )
+             DO  i = nxl, nxr
+                DO  j = nys, nyn
+                   DO  k = nzb_s_inner(j,i)+1, pch_index
+                      tend(k,j,i) = tend(k,j,i) +                     &
+                                    ( canopy_heat_flux(k,j,i) -     &
+                                      canopy_heat_flux(k-1,j,i) ) / &
+                                      dzw(k)
+                   ENDDO
+                ENDDO
+             ENDDO
+
+!
+!--       scalar concentration
+          CASE ( 5 )
+             DO  i = nxl, nxr
+                DO  j = nys, nyn
+                   DO  k = nzb_s_inner(j,i)+1, pch_index
+                      tend(k,j,i) = tend(k,j,i) -                     &
+                                    sec(k,j,i) * lad_s(k,j,i) *       &
+                                    SQRT( ( ( u(k,j,i)        +       &
+                                              u(k,j,i+1) )            &
+                                            / 2.0 )**2        +       &
+                                          ( ( v(k,j,i)        +       &
+                                              v(k,j+1,i) )            &
+                                            / 2.0 )**2        +       &
+                                          ( ( w(k-1,j,i)      +       & 
+                                              w(k,j,i) )              &
+                                            / 2.0 )**2 )      *       &
+                                    ( q(k,j,i) - sls(k,j,i) )
+                   ENDDO
+                ENDDO
+             ENDDO
+
+!
 !--       sgs-tke
-          CASE ( 4 )
+          CASE ( 6 )
              DO  i = nxl, nxr
                 DO  j = nys, nyn
@@ -180,5 +223,5 @@
                                         v(k,j,i)    +        &
                                         v(k,j+1,i)  +        &
-                                        v(k,j+1,i+1) )       &
+                                        v(k,j+1,i-1) )       &
                                       / 4.0 )**2    +        &
                                     ( ( w(k-1,j,i-1) +       &
@@ -232,6 +275,35 @@
 
 !
+!--       potential temperature
+          CASE ( 4 )
+             DO  k = nzb_s_inner(j,i)+1, pch_index
+                tend(k,j,i) = tend(k,j,i) +                     &
+                              ( canopy_heat_flux(k,j,i) -     &
+                                canopy_heat_flux(k-1,j,i) ) / &
+                                dzw(k)
+             ENDDO
+
+
+!
+!--       scalar concentration 
+          CASE ( 5 )
+             DO  k = nzb_s_inner(j,i)+1, pch_index
+                tend(k,j,i) = tend(k,j,i) -                     &
+                              sec(k,j,i) * lad_s(k,j,i) *       &
+                              SQRT( ( ( u(k,j,i)        +       &
+                                        u(k,j,i+1) )            &
+                                      / 2.0 )**2        +       &
+                                    ( ( v(k,j,i)        +       &
+                                        v(k,j+1,i) )            &
+                                      / 2.0 )**2        +       &
+                                    ( ( w(k-1,j,i)      +       &
+                                        w(k,j,i) )              &
+                                      / 2.0 )**2 )      *       &
+                              ( q(k,j,i) - sls(k,j,i) )
+             ENDDO   
+
+!
 !--       sgs-tke
-       CASE ( 4 )
+       CASE ( 6 )
           DO  k = nzb_s_inner(j,i)+1, pch_index   
              tend(k,j,i) = tend(k,j,i) -                     &
