SUBROUTINE disturb_heatflux !--------------------------------------------------------------------------------! ! This file is part of PALM. ! ! PALM is free software: you can redistribute it and/or modify it under the terms ! of the GNU General Public License as published by the Free Software Foundation, ! either version 3 of the License, or (at your option) any later version. ! ! PALM is distributed in the hope that it will be useful, but WITHOUT ANY ! WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR ! A PARTICULAR PURPOSE. See the GNU General Public License for more details. ! ! You should have received a copy of the GNU General Public License along with ! PALM. If not, see . ! ! Copyright 1997-2012 Leibniz University Hannover !--------------------------------------------------------------------------------! ! ! Current revisions: ! ----------------- ! ! ! Former revisions: ! ----------------- ! $Id: disturb_heatflux.f90 1037 2012-10-22 14:10:22Z witha $ ! ! 1036 2012-10-22 13:43:42Z raasch ! code put under GPL (PALM 3.9) ! ! 555 2010-09-07 07:32:53Z raasch ! Bugfix in if statement ! ! RCS Log replace by Id keyword, revision history cleaned up ! ! Revision 1.7 2006/08/04 14:35:07 raasch ! Additional parameter in function random_gauss which limits the range of the ! created random numbers, izuf renamed iran ! ! Revision 1.1 1998/03/25 20:03:47 raasch ! Initial revision ! ! ! Description: ! ------------ ! Generate random, normally distributed heatflux values and store them as the ! near-surface heatflux. ! On parallel computers, too, this random generator is called at all grid points ! of the total array in order to guarantee the same random distribution of the ! total array regardless of the number of processors used during the model run. !------------------------------------------------------------------------------! USE arrays_3d USE control_parameters USE cpulog USE grid_variables USE indices USE interfaces IMPLICIT NONE INTEGER :: i, j REAL :: random_gauss, randomnumber CALL cpu_log( log_point(23), 'disturb_heatflux', 'start' ) ! !-- Generate random disturbances and store them DO i = 0, nx DO j = 0, ny randomnumber = random_gauss( iran, 5.0 ) IF ( nxl <= i .AND. nxr >= i .AND. nys <= j .AND. nyn >= j ) & THEN IF ( nzb_s_inner(j,i) == 0 ) THEN shf(j,i) = randomnumber * surface_heatflux ELSE ! !-- Over topography surface_heatflux is replaced by wall_heatflux(0) shf(j,i) = randomnumber * wall_heatflux(0) ENDIF ENDIF ENDDO ENDDO ! !-- Exchange lateral boundary conditions for the heatflux array CALL exchange_horiz_2d( shf ) CALL cpu_log( log_point(23), 'disturb_heatflux', 'stop' ) END SUBROUTINE disturb_heatflux