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