[1682] | 1 | !> @file lpm_release_set.f90 |
---|
[1036] | 2 | !--------------------------------------------------------------------------------! |
---|
| 3 | ! This file is part of PALM. |
---|
| 4 | ! |
---|
| 5 | ! PALM is free software: you can redistribute it and/or modify it under the terms |
---|
| 6 | ! of the GNU General Public License as published by the Free Software Foundation, |
---|
| 7 | ! either version 3 of the License, or (at your option) any later version. |
---|
| 8 | ! |
---|
| 9 | ! PALM is distributed in the hope that it will be useful, but WITHOUT ANY |
---|
| 10 | ! WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR |
---|
| 11 | ! A PARTICULAR PURPOSE. See the GNU General Public License for more details. |
---|
| 12 | ! |
---|
| 13 | ! You should have received a copy of the GNU General Public License along with |
---|
| 14 | ! PALM. If not, see <http://www.gnu.org/licenses/>. |
---|
| 15 | ! |
---|
[1310] | 16 | ! Copyright 1997-2014 Leibniz Universitaet Hannover |
---|
[1036] | 17 | !--------------------------------------------------------------------------------! |
---|
| 18 | ! |
---|
[849] | 19 | ! Current revisions: |
---|
| 20 | ! ------------------ |
---|
[1329] | 21 | ! |
---|
[1784] | 22 | ! |
---|
[1321] | 23 | ! Former revisions: |
---|
| 24 | ! ----------------- |
---|
| 25 | ! $Id: lpm_release_set.f90 1784 2016-03-06 19:14:40Z maronga $ |
---|
| 26 | ! |
---|
[1784] | 27 | ! 1783 2016-03-06 18:36:17Z raasch |
---|
| 28 | ! module control_parameters removed |
---|
| 29 | ! |
---|
[1683] | 30 | ! 1682 2015-10-07 23:56:08Z knoop |
---|
| 31 | ! Code annotations made doxygen readable |
---|
| 32 | ! |
---|
[1360] | 33 | ! 1359 2014-04-11 17:15:14Z hoffmann |
---|
| 34 | ! New particle structure integrated. |
---|
| 35 | ! Kind definition added to all floating point numbers. |
---|
| 36 | ! lpm_init changed form a subroutine to a module. |
---|
| 37 | ! |
---|
[1329] | 38 | ! 1327 2014-03-21 11:00:16Z raasch |
---|
| 39 | ! -netcdf output queries |
---|
| 40 | ! |
---|
[1321] | 41 | ! 1320 2014-03-20 08:40:49Z raasch |
---|
[1320] | 42 | ! ONLY-attribute added to USE-statements, |
---|
| 43 | ! kind-parameters added to all INTEGER and REAL declaration statements, |
---|
| 44 | ! kinds are defined in new module kinds, |
---|
| 45 | ! comment fields (!:) to be used for variable explanations added to |
---|
| 46 | ! all variable declaration statements |
---|
[849] | 47 | ! |
---|
[1037] | 48 | ! 1036 2012-10-22 13:43:42Z raasch |
---|
| 49 | ! code put under GPL (PALM 3.9) |
---|
| 50 | ! |
---|
[850] | 51 | ! 849 2012-03-15 10:35:09Z raasch |
---|
| 52 | ! initial revision (former part of advec_particles) |
---|
[849] | 53 | ! |
---|
[850] | 54 | ! |
---|
[849] | 55 | ! Description: |
---|
| 56 | ! ------------ |
---|
[1682] | 57 | !> Release a new set of particles and, if required, particle tails. These |
---|
| 58 | !> particles/tails are added at the end of the existing arrays. Extend the |
---|
| 59 | !> respective particle and tail arrays, if neccessary. |
---|
[849] | 60 | !------------------------------------------------------------------------------! |
---|
[1682] | 61 | SUBROUTINE lpm_release_set |
---|
| 62 | |
---|
[849] | 63 | |
---|
[1359] | 64 | USE lpm_init_mod, & |
---|
| 65 | ONLY: lpm_create_particle, PHASE_RELEASE |
---|
| 66 | |
---|
[1320] | 67 | USE grid_variables, & |
---|
| 68 | ONLY: dx, dy |
---|
| 69 | |
---|
| 70 | USE indices, & |
---|
| 71 | ONLY: nxl, nxr, nyn, nys |
---|
| 72 | |
---|
| 73 | USE kinds |
---|
| 74 | |
---|
| 75 | USE particle_attributes, & |
---|
[1359] | 76 | ONLY: minimum_tailpoint_distance, number_of_tails, particles, & |
---|
| 77 | particle_tail_coordinates, use_particle_tails |
---|
[1320] | 78 | |
---|
[849] | 79 | IMPLICIT NONE |
---|
| 80 | |
---|
[1682] | 81 | INTEGER(iwp) :: ie !< |
---|
| 82 | INTEGER(iwp) :: is !< |
---|
| 83 | INTEGER(iwp) :: n !< |
---|
| 84 | INTEGER(iwp) :: nn !< |
---|
[849] | 85 | |
---|
| 86 | |
---|
[1359] | 87 | CALL lpm_create_particle(PHASE_RELEASE) |
---|
[849] | 88 | ! |
---|
[1359] | 89 | !-- particle tails currently not available |
---|
| 90 | ! ! |
---|
| 91 | ! !-- Set the beginning of the new particle tails and their age |
---|
| 92 | ! IF ( use_particle_tails ) THEN |
---|
| 93 | ! |
---|
| 94 | ! DO n = is, ie |
---|
| 95 | ! ! |
---|
| 96 | ! !-- New particles which should have a tail, already have got a |
---|
| 97 | ! !-- provisional tail id unequal zero (see lpm_init) |
---|
| 98 | ! IF ( particles(n)%tail_id /= 0 ) THEN |
---|
| 99 | ! |
---|
| 100 | ! number_of_tails = number_of_tails + 1 |
---|
| 101 | ! nn = number_of_tails |
---|
| 102 | ! particles(n)%tail_id = nn ! set the final tail id |
---|
| 103 | ! particle_tail_coordinates(1,1,nn) = particles(n)%x |
---|
| 104 | ! particle_tail_coordinates(1,2,nn) = particles(n)%y |
---|
| 105 | ! particle_tail_coordinates(1,3,nn) = particles(n)%z |
---|
| 106 | ! particle_tail_coordinates(1,4,nn) = particles(n)%class |
---|
| 107 | ! particles(n)%tailpoints = 1 |
---|
| 108 | ! |
---|
| 109 | ! IF ( minimum_tailpoint_distance /= 0.0 ) THEN |
---|
| 110 | ! particle_tail_coordinates(2,1,nn) = particles(n)%x |
---|
| 111 | ! particle_tail_coordinates(2,2,nn) = particles(n)%y |
---|
| 112 | ! particle_tail_coordinates(2,3,nn) = particles(n)%z |
---|
| 113 | ! particle_tail_coordinates(2,4,nn) = particles(n)%class |
---|
| 114 | ! particle_tail_coordinates(1:2,5,nn) = 0.0_wp |
---|
| 115 | ! particles(n)%tailpoints = 2 |
---|
| 116 | ! ENDIF |
---|
| 117 | ! |
---|
| 118 | ! ENDIF |
---|
| 119 | ! |
---|
| 120 | ! ENDDO |
---|
| 121 | ! |
---|
| 122 | ! ENDIF |
---|
[849] | 123 | |
---|
| 124 | |
---|
| 125 | END SUBROUTINE lpm_release_set |
---|