[1682] | 1 | !> @file lpm_calc_liquid_water_content.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 | ! ------------------ |
---|
[1682] | 21 | ! Code annotations made doxygen readable |
---|
[1360] | 22 | ! |
---|
[1321] | 23 | ! Former revisions: |
---|
| 24 | ! ----------------- |
---|
| 25 | ! $Id: lpm_calc_liquid_water_content.f90 1682 2015-10-07 23:56:08Z knoop $ |
---|
| 26 | ! |
---|
[1360] | 27 | ! 1359 2014-04-11 17:15:14Z hoffmann |
---|
| 28 | ! New particle structure integrated. |
---|
| 29 | ! Kind definition added to all floating point numbers. |
---|
| 30 | ! |
---|
[1321] | 31 | ! 1320 2014-03-20 08:40:49Z raasch |
---|
[1320] | 32 | ! ONLY-attribute added to USE-statements, |
---|
| 33 | ! kind-parameters added to all INTEGER and REAL declaration statements, |
---|
| 34 | ! kinds are defined in new module kinds, |
---|
| 35 | ! comment fields (!:) to be used for variable explanations added to |
---|
| 36 | ! all variable declaration statements |
---|
[849] | 37 | ! |
---|
[1037] | 38 | ! 1036 2012-10-22 13:43:42Z raasch |
---|
| 39 | ! code put under GPL (PALM 3.9) |
---|
| 40 | ! |
---|
[850] | 41 | ! 849 2012-03-15 10:35:09Z raasch |
---|
| 42 | ! initial revision (former part of advec_particles) |
---|
[849] | 43 | ! |
---|
[850] | 44 | ! |
---|
[849] | 45 | ! Description: |
---|
| 46 | ! ------------ |
---|
[1682] | 47 | !> Calculate the liquid water content for each grid box. |
---|
[849] | 48 | !------------------------------------------------------------------------------! |
---|
[1682] | 49 | SUBROUTINE lpm_calc_liquid_water_content |
---|
| 50 | |
---|
[849] | 51 | |
---|
[1320] | 52 | USE arrays_3d, & |
---|
| 53 | ONLY: ql, ql_v, ql_vp |
---|
[849] | 54 | |
---|
[1320] | 55 | USE cloud_parameters, & |
---|
| 56 | ONLY: rho_l |
---|
| 57 | |
---|
| 58 | USE constants, & |
---|
| 59 | ONLY: pi |
---|
| 60 | |
---|
| 61 | USE control_parameters, & |
---|
| 62 | ONLY: dz, message_string, rho_surface |
---|
| 63 | |
---|
| 64 | USE cpulog, & |
---|
| 65 | ONLY: cpu_log, log_point_s |
---|
| 66 | |
---|
| 67 | USE grid_variables, & |
---|
| 68 | ONLY: dx, dy |
---|
| 69 | |
---|
| 70 | USE indices, & |
---|
| 71 | ONLY: nxl, nxr, nyn, nys, nzb, nzt |
---|
| 72 | |
---|
| 73 | USE kinds |
---|
| 74 | |
---|
| 75 | USE particle_attributes, & |
---|
[1359] | 76 | ONLY: grid_particles, number_of_particles, particles, prt_count |
---|
[1320] | 77 | |
---|
[849] | 78 | IMPLICIT NONE |
---|
| 79 | |
---|
[1682] | 80 | INTEGER(iwp) :: i !< |
---|
| 81 | INTEGER(iwp) :: j !< |
---|
| 82 | INTEGER(iwp) :: k !< |
---|
| 83 | INTEGER(iwp) :: n !< |
---|
| 84 | INTEGER(iwp) :: psi !< |
---|
[849] | 85 | |
---|
| 86 | CALL cpu_log( log_point_s(45), 'lpm_calc_ql', 'start' ) |
---|
| 87 | |
---|
| 88 | ! |
---|
| 89 | !-- Set water content initially to zero |
---|
[1359] | 90 | ql = 0.0_wp; ql_v = 0.0_wp; ql_vp = 0.0_wp |
---|
[849] | 91 | |
---|
| 92 | ! |
---|
| 93 | !-- Calculate for each grid box |
---|
| 94 | DO i = nxl, nxr |
---|
| 95 | DO j = nys, nyn |
---|
[1359] | 96 | DO k = nzb+1, nzt |
---|
[849] | 97 | |
---|
[1359] | 98 | number_of_particles = prt_count(k,j,i) |
---|
| 99 | IF ( number_of_particles <= 0 ) CYCLE |
---|
| 100 | particles => grid_particles(k,j,i)%particles(1:number_of_particles) |
---|
| 101 | |
---|
[849] | 102 | ! |
---|
| 103 | !-- Calculate the total volume in the boxes (ql_v, weighting factor |
---|
| 104 | !-- has to beincluded) |
---|
[1359] | 105 | DO n = 1, prt_count(k,j,i) |
---|
[849] | 106 | ql_v(k,j,i) = ql_v(k,j,i) + particles(n)%weight_factor * & |
---|
| 107 | particles(n)%radius**3 |
---|
| 108 | ENDDO |
---|
| 109 | |
---|
| 110 | ! |
---|
| 111 | !-- Calculate the liquid water content |
---|
[1359] | 112 | IF ( ql_v(k,j,i) /= 0.0_wp ) THEN |
---|
| 113 | ql(k,j,i) = ql(k,j,i) + rho_l * 1.33333333_wp * pi * & |
---|
[849] | 114 | ql_v(k,j,i) / & |
---|
| 115 | ( rho_surface * dx * dy * dz ) |
---|
| 116 | |
---|
[1359] | 117 | IF ( ql(k,j,i) < 0.0_wp ) THEN |
---|
[849] | 118 | WRITE( message_string, * ) 'LWC out of range: ' , & |
---|
[1359] | 119 | ql(k,j,i),i,j,k |
---|
[849] | 120 | CALL message( 'lpm_calc_liquid_water_content', '', 2, 2, & |
---|
| 121 | -1, 6, 1 ) |
---|
| 122 | ENDIF |
---|
| 123 | |
---|
| 124 | ELSE |
---|
| 125 | |
---|
[1359] | 126 | ql(k,j,i) = 0.0_wp |
---|
[849] | 127 | |
---|
| 128 | ENDIF |
---|
| 129 | |
---|
| 130 | ENDDO |
---|
| 131 | ENDDO |
---|
| 132 | ENDDO |
---|
| 133 | |
---|
| 134 | CALL cpu_log( log_point_s(45), 'lpm_calc_ql', 'stop' ) |
---|
| 135 | |
---|
| 136 | |
---|
| 137 | END SUBROUTINE lpm_calc_liquid_water_content |
---|