source: palm/trunk/SOURCE/disturb_heatflux.f90 @ 1682

Last change on this file since 1682 was 1682, checked in by knoop, 6 years ago

Code annotations made doxygen readable

  • Property svn:keywords set to Id
File size: 3.6 KB
Line 
1!> @file disturb_heatflux.f90
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!
16! Copyright 1997-2014 Leibniz Universitaet Hannover
17!------------------------------------------------------------------------------!
18!
19! Current revisions:
20! ------------------
21! Code annotations made doxygen readable
22!
23! Former revisions:
24! -----------------
25! $Id: disturb_heatflux.f90 1682 2015-10-07 23:56:08Z knoop $
26!
27! 1353 2014-04-08 15:21:23Z heinze
28! REAL constants provided with KIND-attribute
29!
30! 1322 2014-03-20 16:38:49Z raasch
31! REAL constants defined as wp-kind
32!
33! 1320 2014-03-20 08:40:49Z raasch
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
40!
41! 1036 2012-10-22 13:43:42Z raasch
42! code put under GPL (PALM 3.9)
43!
44! Revision 1.1  1998/03/25 20:03:47  raasch
45! Initial revision
46!
47!
48! Description:
49! ------------
50!> Generate random, normally distributed heatflux values and store them as the
51!> near-surface heatflux.
52!> On parallel computers, too, this random generator is called at all grid points
53!> of the total array in order to guarantee the same random distribution of the
54!> total array regardless of the number of processors used during the model run.
55!------------------------------------------------------------------------------!
56 SUBROUTINE disturb_heatflux
57 
58
59    USE arrays_3d,                                                             &
60        ONLY:  shf
61       
62    USE control_parameters,                                                    &
63        ONLY:  iran, surface_heatflux, wall_heatflux
64       
65    USE cpulog,                                                                &
66        ONLY:  cpu_log, log_point
67       
68    USE kinds
69   
70    USE indices,                                                               &
71        ONLY:  nx, nxl, nxr, ny, nyn, nys, nzb_s_inner
72
73    IMPLICIT NONE
74
75    INTEGER(iwp) ::  j  !<
76    INTEGER(iwp) ::  i  !<
77   
78    REAL(wp) ::  random_gauss  !<
79    REAL(wp) ::  randomnumber  !<
80
81
82    CALL cpu_log( log_point(23), 'disturb_heatflux', 'start' )
83
84!
85!-- Generate random disturbances and store them
86    DO  i = 0, nx
87       DO  j = 0, ny
88          randomnumber = random_gauss( iran, 5.0_wp )
89          IF ( nxl <= i  .AND.  nxr >= i  .AND.  nys <= j  .AND.  nyn >= j )   &
90          THEN
91             IF ( nzb_s_inner(j,i) == 0 )  THEN
92                shf(j,i) = randomnumber * surface_heatflux
93             ELSE
94!
95!--             Over topography surface_heatflux is replaced by wall_heatflux(0)
96                shf(j,i) = randomnumber * wall_heatflux(0)
97             ENDIF
98          ENDIF
99       ENDDO
100    ENDDO
101
102!
103!-- Exchange lateral boundary conditions for the heatflux array
104    CALL exchange_horiz_2d( shf )
105
106    CALL cpu_log( log_point(23), 'disturb_heatflux', 'stop' )
107
108
109 END SUBROUTINE disturb_heatflux
Note: See TracBrowser for help on using the repository browser.