SUBROUTINE init_pt_anomaly !--------------------------------------------------------------------------------! ! 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: init_pt_anomaly.f90 1037 2012-10-22 14:10:22Z witha $ ! ! 1036 2012-10-22 13:43:42Z raasch ! code put under GPL (PALM 3.9) ! ! 861 2012-03-26 14:18:34Z suehring ! Modification of the amplitude to obtain a visible temperature perturbation. ! ! 667 2010-12-23 12:06:00Z suehring/gryschka ! Call of exchange_horiz are modified. ! ! 75 2007-03-22 09:54:05Z raasch ! 2nd+3rd argument removed from exchange horiz ! ! 19 2007-02-23 04:53:48Z raasch ! Calculation extended for gridpoint nzt ! ! RCS Log replace by Id keyword, revision history cleaned up ! ! Revision 1.7 2005/03/26 20:36:55 raasch ! Arguments for non-cyclic boundary conditions added to argument list of ! routine exchange_horiz ! ! Revision 1.1 1997/08/29 08:58:56 raasch ! Initial revision ! ! ! Description: ! ------------ ! Impose a temperature perturbation for an advection test. !------------------------------------------------------------------------------! USE arrays_3d USE constants USE grid_variables USE indices USE control_parameters IMPLICIT NONE INTEGER :: i, ic, j, jc, k, kc REAL :: betrag, radius, rc, x, y, z ! !-- Defaults: radius rc, strength z, !-- position of centre: ic, jc, kc rc = 10.0 * dx ic = ( nx+1 ) / 2 jc = ic kc = nzt / 2 ! !-- Compute the perturbation. DO i = nxl, nxr DO j = nys, nyn DO k = nzb+1, nzt x = ( i - ic ) * dx y = ( j - jc ) * dy z = ABS( zu(k) - zu(kc) ) radius = SQRT( x**2 + y**2 + z**2 ) IF ( radius <= rc ) THEN betrag = 5.0 * EXP( -( radius * 0.001 / 2.0 )**2 ) ELSE betrag = 0.0 ENDIF pt(k,j,i) = pt(k,j,i) + betrag ENDDO ENDDO ENDDO ! !-- Exchange of boundary values for temperature CALL exchange_horiz( pt, nbgp ) END SUBROUTINE init_pt_anomaly