[1682] | 1 | !> @file impact_of_latent_heat.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 | ! |
---|
[484] | 19 | ! Current revisions: |
---|
[1] | 20 | ! ----------------- |
---|
[1354] | 21 | ! |
---|
[1683] | 22 | ! |
---|
[1321] | 23 | ! Former revisions: |
---|
| 24 | ! ----------------- |
---|
| 25 | ! $Id: impact_of_latent_heat.f90 1683 2015-10-07 23:57:51Z raasch $ |
---|
| 26 | ! |
---|
[1683] | 27 | ! 1682 2015-10-07 23:56:08Z knoop |
---|
| 28 | ! Code annotations made doxygen readable |
---|
| 29 | ! |
---|
[1354] | 30 | ! 1353 2014-04-08 15:21:23Z heinze |
---|
| 31 | ! REAL constants provided with KIND-attribute |
---|
| 32 | ! |
---|
[1321] | 33 | ! 1320 2014-03-20 08:40:49Z raasch |
---|
[1320] | 34 | ! ONLY-attribute added to USE-statements, |
---|
| 35 | ! kind-parameters added to all INTEGER and REAL declaration statements, |
---|
| 36 | ! kinds are defined in new module kinds, |
---|
| 37 | ! revision history before 2012 removed, |
---|
| 38 | ! comment fields (!:) to be used for variable explanations added to |
---|
| 39 | ! all variable declaration statements |
---|
[1321] | 40 | ! |
---|
[1037] | 41 | ! 1036 2012-10-22 13:43:42Z raasch |
---|
| 42 | ! code put under GPL (PALM 3.9) |
---|
| 43 | ! |
---|
[1] | 44 | ! Revision 1.1 2000/04/13 14:48:40 schroeter |
---|
| 45 | ! Initial revision |
---|
| 46 | ! |
---|
| 47 | ! |
---|
| 48 | ! Description: |
---|
| 49 | ! ------------ |
---|
[1682] | 50 | !> Calculate the impact of latent heat due to precipitation |
---|
| 51 | !> (simplified Kessler scheme) |
---|
[1] | 52 | !------------------------------------------------------------------------------! |
---|
[1682] | 53 | MODULE impact_of_latent_heat_mod |
---|
| 54 | |
---|
[1] | 55 | |
---|
| 56 | PRIVATE |
---|
| 57 | PUBLIC impact_of_latent_heat |
---|
| 58 | |
---|
| 59 | INTERFACE impact_of_latent_heat |
---|
| 60 | MODULE PROCEDURE impact_of_latent_heat |
---|
| 61 | MODULE PROCEDURE impact_of_latent_heat_ij |
---|
| 62 | END INTERFACE impact_of_latent_heat |
---|
| 63 | |
---|
| 64 | CONTAINS |
---|
| 65 | |
---|
| 66 | |
---|
| 67 | !------------------------------------------------------------------------------! |
---|
[1682] | 68 | ! Description: |
---|
| 69 | ! ------------ |
---|
| 70 | !> Call for all grid points |
---|
[1] | 71 | !------------------------------------------------------------------------------! |
---|
| 72 | SUBROUTINE impact_of_latent_heat |
---|
| 73 | |
---|
[1320] | 74 | USE arrays_3d, & |
---|
| 75 | ONLY: ql, tend |
---|
| 76 | |
---|
| 77 | USE cloud_parameters, & |
---|
| 78 | ONLY: l_d_cp, prec_time_const, pt_d_t, ql_crit |
---|
| 79 | |
---|
| 80 | USE indices, & |
---|
| 81 | ONLY: nxl, nxr, nyn, nys, nzb_2d, nzt |
---|
| 82 | |
---|
| 83 | USE kinds |
---|
[1] | 84 | |
---|
| 85 | IMPLICIT NONE |
---|
| 86 | |
---|
[1682] | 87 | INTEGER(iwp) :: i !< |
---|
| 88 | INTEGER(iwp) :: j !< |
---|
| 89 | INTEGER(iwp) :: k !< |
---|
[1320] | 90 | |
---|
[1682] | 91 | REAL(wp) :: dqdt_precip !< |
---|
[1] | 92 | |
---|
| 93 | |
---|
| 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 |
---|
[1353] | 101 | dqdt_precip = 0.0_wp |
---|
[1] | 102 | ENDIF |
---|
[72] | 103 | tend(k,j,i) = tend(k,j,i) + dqdt_precip * l_d_cp * pt_d_t(k) |
---|
[1] | 104 | |
---|
| 105 | ENDDO |
---|
| 106 | ENDDO |
---|
| 107 | ENDDO |
---|
| 108 | |
---|
| 109 | END SUBROUTINE impact_of_latent_heat |
---|
| 110 | |
---|
| 111 | |
---|
| 112 | !------------------------------------------------------------------------------! |
---|
[1682] | 113 | ! Description: |
---|
| 114 | ! ------------ |
---|
| 115 | !> Call for grid point i,j |
---|
[1] | 116 | !------------------------------------------------------------------------------! |
---|
| 117 | SUBROUTINE impact_of_latent_heat_ij( i, j ) |
---|
| 118 | |
---|
[1320] | 119 | USE arrays_3d, & |
---|
| 120 | ONLY: ql, tend |
---|
| 121 | |
---|
| 122 | USE cloud_parameters, & |
---|
| 123 | ONLY: l_d_cp, prec_time_const, pt_d_t, ql_crit |
---|
| 124 | |
---|
| 125 | USE indices, & |
---|
| 126 | ONLY: nzb_2d, nzt |
---|
| 127 | |
---|
| 128 | USE kinds |
---|
[1] | 129 | |
---|
| 130 | IMPLICIT NONE |
---|
| 131 | |
---|
[1682] | 132 | INTEGER(iwp) :: i !< |
---|
| 133 | INTEGER(iwp) :: j !< |
---|
| 134 | INTEGER(iwp) :: k !< |
---|
[1320] | 135 | |
---|
[1682] | 136 | REAL(wp) :: dqdt_precip !< |
---|
[1] | 137 | |
---|
| 138 | |
---|
[19] | 139 | DO k = nzb_2d(j,i)+1, nzt |
---|
[1] | 140 | |
---|
| 141 | IF ( ql(k,j,i) > ql_crit ) THEN |
---|
[72] | 142 | dqdt_precip = prec_time_const * ( ql(k,j,i) - ql_crit ) |
---|
[1] | 143 | ELSE |
---|
[1353] | 144 | dqdt_precip = 0.0_wp |
---|
[1] | 145 | ENDIF |
---|
[72] | 146 | tend(k,j,i) = tend(k,j,i) + dqdt_precip * l_d_cp * pt_d_t(k) |
---|
[1] | 147 | |
---|
| 148 | ENDDO |
---|
| 149 | |
---|
| 150 | END SUBROUTINE impact_of_latent_heat_ij |
---|
| 151 | |
---|
| 152 | END MODULE impact_of_latent_heat_mod |
---|