source: palm/trunk/SOURCE/lpm_merging.f90 @ 2270

Last change on this file since 2270 was 2263, checked in by schwenkel, 7 years ago

Implemented splitting and merging algorithm

  • Property svn:executable set to *
  • Property svn:keywords set to Id
File size: 5.0 KB
Line 
1!> @file lpm_merging.f90
2!------------------------------------------------------------------------------!
3! This file is part of PALM.
4!
5! PALM is free software: you can redistribute it and/or modify it under the
6! terms of the GNU General Public License as published by the Free Software
7! Foundation, either version 3 of the License, or (at your option) any later
8! version.
9!
10! PALM is distributed in the hope that it will be useful, but WITHOUT ANY
11! WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
12! A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
13!
14! You should have received a copy of the GNU General Public License along with
15! PALM. If not, see <http://www.gnu.org/licenses/>.
16!
17! Copyright 1997-2017 Leibniz Universitaet Hannover
18!------------------------------------------------------------------------------!
19!
20! Current revisions:
21! ------------------
22!
23!
24! Former revisions:
25! -----------------
26!
27! Inital revision
28!
29!
30!
31! Description:
32! ------------
33! This routine is a part of the Lagrangian particle model. Two Super droplets
34! which fulfill certain criterion's (e.g. a big weighting factor and a small
35! radius) can be merged into one super droplet with a increased number of
36! represented particles of the super droplet. This mechanism ensures an
37! improved a feasible amount of computational costs. The limits of particle
38! creation should be chosen carefully! The idea of this algorithm is based on
39! Unterstrasser and Soelch, 2014.
40!------------------------------------------------------------------------------!
41 SUBROUTINE lpm_merging
42
43
44    USE arrays_3d,                                                             &
45        ONLY:  ql
46
47    USE cpulog,                                                                &
48        ONLY:  cpu_log, log_point_s
49
50    USE indices,                                                               &
51        ONLY:  nxl, nxr, nyn, nys, nzb, nzt
52
53    USE kinds
54
55    USE particle_attributes,                                                   &
56        ONLY:  deleted_particles, grid_particles, initial_weighting_factor,    &     
57               merge_drp, merging, number_of_particles, particles, prt_count,  &
58               radius_merge, sum_merge_drp, weight_factor_merge
59
60    USE pegrid
61
62    IMPLICIT NONE
63
64    INTEGER(iwp) ::  i         !<     
65    INTEGER(iwp) ::  j         !<       
66    INTEGER(iwp) ::  k         !<       
67    INTEGER(iwp) ::  n         !<   
68   
69    REAL(wp) ::  ql_crit = 1.0E-5_wp  !< threshold lwc for cloudy grid cells
70                                      !< (e.g. Siebesma et al 2003, JAS, 60)
71   
72    CALL cpu_log( log_point_s(81), 'lpm_merging', 'start' )
73
74    merge_drp  = 0
75   
76    IF ( weight_factor_merge == -1.0_wp )  THEN
77       weight_factor_merge = 0.5_wp * initial_weighting_factor 
78    ENDIF
79
80    DO  i = nxl, nxr
81       DO  j = nys, nyn
82          DO  k = nzb+1, nzt
83   
84             number_of_particles = prt_count(k,j,i)
85             IF ( number_of_particles <= 0  .OR.                               &
86                   ql(k,j,i) >= ql_crit )  CYCLE
87             particles => grid_particles(k,j,i)%particles(1:number_of_particles)
88!
89!--          Start merging operations: This routine delete super droplets with
90!--          a small radius (radius <= radius_merge) and a low weighting
91!--          factor (weight_factor  <= weight_factor_merge). The number of
92!--          represented particles will be added to the next particle of the
93!--          particle array. Tests showed that this simplified method can be
94!--          used because it will only take place outside of cloudy grid
95!--          boxes where ql <= 1.0E-5 kg/kg. Therefore, especially former cloned   
96!--          and subsequent evaporated super droplets will be merged.
97             DO  n = 1, number_of_particles-1
98                IF ( particles(n)%particle_mask                    .AND.       &
99                     particles(n+1)%particle_mask                  .AND.       &
100                     particles(n)%radius        <= radius_merge    .AND.       &
101                     particles(n)%weight_factor <= weight_factor_merge )       &   
102                THEN
103                   particles(n+1)%weight_factor  =                             &
104                                       particles(n+1)%weight_factor +          &
105                                       ( particles(n)%radius**3     /          &
106                                         particles(n+1)%radius**3   *          &
107                                         particles(n)%weight_factor            &
108                                       )
109                   particles(n)%particle_mask = .FALSE.
110                   deleted_particles          = deleted_particles + 1 
111                   merge_drp                  = merge_drp + 1
112               
113                ENDIF
114             ENDDO
115          ENDDO
116       ENDDO
117    ENDDO
118       
119    sum_merge_drp = sum_merge_drp + merge_drp
120
121    CALL cpu_log( log_point_s(81), 'lpm_merging', 'stop' )
122
123 END SUBROUTINE lpm_merging
Note: See TracBrowser for help on using the repository browser.