[1] | 1 | MODULE calc_precipitation_mod |
---|
| 2 | |
---|
[1036] | 3 | !--------------------------------------------------------------------------------! |
---|
| 4 | ! This file is part of PALM. |
---|
| 5 | ! |
---|
| 6 | ! PALM is free software: you can redistribute it and/or modify it under the terms |
---|
| 7 | ! of the GNU General Public License as published by the Free Software Foundation, |
---|
| 8 | ! either version 3 of the License, or (at your option) any later 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 | ! |
---|
[1310] | 17 | ! Copyright 1997-2014 Leibniz Universitaet Hannover |
---|
[1036] | 18 | !--------------------------------------------------------------------------------! |
---|
| 19 | ! |
---|
[484] | 20 | ! Current revisions: |
---|
[1] | 21 | ! ----------------- |
---|
[1321] | 22 | ! |
---|
| 23 | ! |
---|
| 24 | ! Former revisions: |
---|
| 25 | ! ----------------- |
---|
| 26 | ! $Id: calc_precipitation.f90 1321 2014-03-20 09:40:40Z suehring $ |
---|
| 27 | ! |
---|
| 28 | ! 1320 2014-03-20 08:40:49Z raasch |
---|
[1320] | 29 | ! ONLY-attribute added to USE-statements, |
---|
| 30 | ! kind-parameters added to all INTEGER and REAL declaration statements, |
---|
| 31 | ! kinds are defined in new module kinds, |
---|
| 32 | ! revision history before 2012 removed, |
---|
| 33 | ! comment fields (!:) to be used for variable explanations added to |
---|
| 34 | ! all variable declaration statements |
---|
[1] | 35 | ! |
---|
[1037] | 36 | ! 1036 2012-10-22 13:43:42Z raasch |
---|
| 37 | ! code put under GPL (PALM 3.9) |
---|
| 38 | ! |
---|
[1] | 39 | ! Revision 1.1 2000/04/13 14:45:22 schroeter |
---|
| 40 | ! Initial revision |
---|
| 41 | ! |
---|
| 42 | ! |
---|
| 43 | ! |
---|
| 44 | ! Description: |
---|
| 45 | ! ------------ |
---|
| 46 | ! Calculate the change of total water content due to precipitation |
---|
| 47 | ! (simplified Kessler scheme) |
---|
| 48 | !------------------------------------------------------------------------------! |
---|
| 49 | |
---|
| 50 | PRIVATE |
---|
| 51 | PUBLIC calc_precipitation |
---|
| 52 | |
---|
| 53 | INTERFACE calc_precipitation |
---|
| 54 | MODULE PROCEDURE calc_precipitation |
---|
| 55 | MODULE PROCEDURE calc_precipitation_ij |
---|
| 56 | END INTERFACE calc_precipitation |
---|
[403] | 57 | |
---|
[1] | 58 | CONTAINS |
---|
| 59 | |
---|
| 60 | |
---|
| 61 | !------------------------------------------------------------------------------! |
---|
| 62 | ! Call for all grid points |
---|
| 63 | !------------------------------------------------------------------------------! |
---|
| 64 | SUBROUTINE calc_precipitation |
---|
| 65 | |
---|
[1320] | 66 | USE arrays_3d, & |
---|
| 67 | ONLY: dzw, ql, tend |
---|
[1] | 68 | |
---|
[1320] | 69 | USE cloud_parameters, & |
---|
| 70 | ONLY: precipitation_amount, precipitation_rate, prec_time_const, & |
---|
| 71 | ql_crit |
---|
| 72 | |
---|
| 73 | USE control_parameters, & |
---|
| 74 | ONLY: dt_do2d_xy, dt_3d, & |
---|
| 75 | intermediate_timestep_count, intermediate_timestep_count_max,& |
---|
| 76 | precipitation_amount_interval, time_do2d_xy |
---|
| 77 | |
---|
| 78 | USE indices, & |
---|
| 79 | ONLY: nxl, nxr, nyn, nys, nzb_2d, nzt |
---|
| 80 | |
---|
| 81 | USE kinds |
---|
| 82 | |
---|
| 83 | |
---|
[1] | 84 | IMPLICIT NONE |
---|
| 85 | |
---|
[1320] | 86 | INTEGER(iwp) :: i !: |
---|
| 87 | INTEGER(iwp) :: j !: |
---|
| 88 | INTEGER(iwp) :: k !: |
---|
| 89 | |
---|
| 90 | REAL(wp) :: dqdt_precip !: |
---|
[1] | 91 | |
---|
[403] | 92 | precipitation_rate = 0.0 |
---|
[72] | 93 | |
---|
[1] | 94 | DO i = nxl, nxr |
---|
| 95 | DO j = nys, nyn |
---|
[19] | 96 | DO k = nzb_2d(j,i)+1, nzt |
---|
[1] | 97 | |
---|
| 98 | IF ( ql(k,j,i) > ql_crit ) THEN |
---|
[72] | 99 | dqdt_precip = prec_time_const * ( ql(k,j,i) - ql_crit ) |
---|
[1] | 100 | ELSE |
---|
[72] | 101 | dqdt_precip = 0.0 |
---|
[1] | 102 | ENDIF |
---|
[72] | 103 | tend(k,j,i) = tend(k,j,i) - dqdt_precip |
---|
| 104 | ! |
---|
[73] | 105 | !-- Precipitation rate in kg / m**2 / s (= mm/s) |
---|
[1320] | 106 | precipitation_rate(j,i) = precipitation_rate(j,i) + & |
---|
[73] | 107 | dqdt_precip * dzw(k) |
---|
[1] | 108 | |
---|
| 109 | ENDDO |
---|
[72] | 110 | ! |
---|
[73] | 111 | !-- Sum up the precipitation amount, unit kg / m**2 (= mm) |
---|
[1320] | 112 | IF ( intermediate_timestep_count == & |
---|
| 113 | intermediate_timestep_count_max .AND. & |
---|
[72] | 114 | ( dt_do2d_xy-time_do2d_xy ) < precipitation_amount_interval )& |
---|
| 115 | THEN |
---|
[1320] | 116 | precipitation_amount(j,i) = precipitation_amount(j,i) + & |
---|
[72] | 117 | precipitation_rate(j,i) * dt_3d |
---|
| 118 | ENDIF |
---|
[1] | 119 | ENDDO |
---|
| 120 | ENDDO |
---|
| 121 | |
---|
| 122 | END SUBROUTINE calc_precipitation |
---|
| 123 | |
---|
| 124 | |
---|
| 125 | !------------------------------------------------------------------------------! |
---|
| 126 | ! Call for grid point i,j |
---|
| 127 | !------------------------------------------------------------------------------! |
---|
| 128 | SUBROUTINE calc_precipitation_ij( i, j ) |
---|
| 129 | |
---|
[1320] | 130 | USE arrays_3d, & |
---|
| 131 | ONLY: dzw, ql, tend |
---|
[403] | 132 | |
---|
[1320] | 133 | USE cloud_parameters, & |
---|
| 134 | ONLY: precipitation_amount, precipitation_rate, prec_time_const, & |
---|
| 135 | ql_crit |
---|
| 136 | |
---|
| 137 | USE control_parameters, & |
---|
| 138 | ONLY: dt_do2d_xy, dt_3d, & |
---|
| 139 | intermediate_timestep_count, intermediate_timestep_count_max,& |
---|
| 140 | precipitation_amount_interval, time_do2d_xy |
---|
| 141 | |
---|
| 142 | USE indices, & |
---|
| 143 | ONLY: nzb_2d, nzt |
---|
| 144 | |
---|
| 145 | USE kinds |
---|
| 146 | |
---|
| 147 | |
---|
[1] | 148 | IMPLICIT NONE |
---|
| 149 | |
---|
[1320] | 150 | INTEGER(iwp) :: i !: |
---|
| 151 | INTEGER(iwp) :: j !: |
---|
| 152 | INTEGER(iwp) :: k !: |
---|
| 153 | |
---|
| 154 | REAL(wp) :: dqdt_precip !: |
---|
[1] | 155 | |
---|
[403] | 156 | precipitation_rate(j,i) = 0.0 |
---|
[1] | 157 | |
---|
[72] | 158 | ! |
---|
| 159 | !-- Ghostpoints are included (although not needed for tend) to avoid a later |
---|
| 160 | !-- exchange of these data for the precipitation amount/rate arrays |
---|
[19] | 161 | DO k = nzb_2d(j,i)+1, nzt |
---|
[1] | 162 | |
---|
| 163 | IF ( ql(k,j,i) > ql_crit ) THEN |
---|
[72] | 164 | dqdt_precip = prec_time_const * ( ql(k,j,i) - ql_crit ) |
---|
[1] | 165 | ELSE |
---|
[72] | 166 | dqdt_precip = 0.0 |
---|
[1] | 167 | ENDIF |
---|
[72] | 168 | tend(k,j,i) = tend(k,j,i) - dqdt_precip |
---|
[1] | 169 | |
---|
[72] | 170 | ! |
---|
[403] | 171 | !-- Precipitation rate in kg / m**2 / s (= mm/s) |
---|
[1320] | 172 | precipitation_rate(j,i) = precipitation_rate(j,i) + dqdt_precip * & |
---|
[403] | 173 | dzw(k) |
---|
[72] | 174 | |
---|
[1] | 175 | ENDDO |
---|
| 176 | |
---|
[72] | 177 | ! |
---|
[403] | 178 | !-- Sum up the precipitation amount , unit kg / m**2 (= mm) |
---|
[72] | 179 | IF ( intermediate_timestep_count == intermediate_timestep_count_max & |
---|
| 180 | .AND. ( dt_do2d_xy-time_do2d_xy ) < precipitation_amount_interval )& |
---|
| 181 | THEN |
---|
[1320] | 182 | precipitation_amount(j,i) = precipitation_amount(j,i) + & |
---|
[72] | 183 | precipitation_rate(j,i) * dt_3d |
---|
| 184 | ENDIF |
---|
| 185 | |
---|
[1] | 186 | END SUBROUTINE calc_precipitation_ij |
---|
| 187 | |
---|
| 188 | END MODULE calc_precipitation_mod |
---|