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