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

Last change on this file since 1061 was 1037, checked in by raasch, 12 years ago

last commit documented

  • Property svn:keywords set to Id
File size: 2.8 KB
Line 
1 SUBROUTINE disturb_heatflux
2
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!
17! Copyright 1997-2012  Leibniz University Hannover
18!--------------------------------------------------------------------------------!
19!
20! Current revisions:
21! -----------------
22!
23!
24! Former revisions:
25! -----------------
26! $Id: disturb_heatflux.f90 1037 2012-10-22 14:10:22Z raasch $
27!
28! 1036 2012-10-22 13:43:42Z raasch
29! code put under GPL (PALM 3.9)
30!
31! 555 2010-09-07 07:32:53Z raasch
32! Bugfix in if statement
33!
34! RCS Log replace by Id keyword, revision history cleaned up
35!
36! Revision 1.7  2006/08/04 14:35:07  raasch
37! Additional parameter in function random_gauss which limits the range of the
38! created random numbers, izuf renamed iran
39!
40! Revision 1.1  1998/03/25 20:03:47  raasch
41! Initial revision
42!
43!
44! Description:
45! ------------
46! Generate random, normally distributed heatflux values and store them as the
47! near-surface heatflux.
48! On parallel computers, too, this random generator is called at all grid points
49! of the total array in order to guarantee the same random distribution of the
50! total array regardless of the number of processors used during the model run.
51!------------------------------------------------------------------------------!
52
53    USE arrays_3d
54    USE control_parameters
55    USE cpulog
56    USE grid_variables
57    USE indices
58    USE interfaces
59
60    IMPLICIT NONE
61
62    INTEGER ::  i, j
63    REAL    ::  random_gauss, randomnumber
64
65
66    CALL cpu_log( log_point(23), 'disturb_heatflux', 'start' )
67
68!
69!-- Generate random disturbances and store them
70    DO  i = 0, nx
71       DO  j = 0, ny
72          randomnumber = random_gauss( iran, 5.0 )
73          IF ( nxl <= i  .AND.  nxr >= i  .AND.  nys <= j  .AND.  nyn >= j ) &
74          THEN
75             IF ( nzb_s_inner(j,i) == 0 )  THEN
76                shf(j,i) = randomnumber * surface_heatflux
77             ELSE
78!
79!--             Over topography surface_heatflux is replaced by wall_heatflux(0)
80                shf(j,i) = randomnumber * wall_heatflux(0)
81             ENDIF
82          ENDIF
83       ENDDO
84    ENDDO
85
86!
87!-- Exchange lateral boundary conditions for the heatflux array
88    CALL exchange_horiz_2d( shf )
89
90    CALL cpu_log( log_point(23), 'disturb_heatflux', 'stop' )
91
92
93 END SUBROUTINE disturb_heatflux
Note: See TracBrowser for help on using the repository browser.