source: palm/trunk/SOURCE/init_pt_anomaly.f90 @ 1320

Last change on this file since 1320 was 1320, checked in by raasch, 10 years ago

ONLY-attribute added to USE-statements,
kind-parameters added to all INTEGER and REAL declaration statements,
kinds are defined in new module kinds,
old module precision_kind is removed,
revision history before 2012 removed,
comment fields (!:) to be used for variable explanations added to all variable declaration statements

  • Property svn:keywords set to Id
File size: 3.2 KB
Line 
1 SUBROUTINE init_pt_anomaly
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-2014 Leibniz Universitaet Hannover
18!--------------------------------------------------------------------------------!
19!
20! Current revisions:
21! -----------------
22! ONLY-attribute added to USE-statements,
23! kind-parameters added to all INTEGER and REAL declaration statements,
24! kinds are defined in new module kinds,
25! revision history before 2012 removed,
26! comment fields (!:) to be used for variable explanations added to
27! all variable declaration statements
28!
29! Former revisions:
30! -----------------
31! $Id: init_pt_anomaly.f90 1320 2014-03-20 08:40:49Z raasch $
32!
33! 1036 2012-10-22 13:43:42Z raasch
34! code put under GPL (PALM 3.9)
35!
36! 861 2012-03-26 14:18:34Z suehring
37! Modification of the amplitude to obtain a visible temperature perturbation.
38!
39! Revision 1.1  1997/08/29 08:58:56  raasch
40! Initial revision
41!
42!
43! Description:
44! ------------
45! Impose a temperature perturbation for an advection test.
46!------------------------------------------------------------------------------!
47
48    USE arrays_3d,                                                             &
49        ONLY:  pt, zu
50
51    USE grid_variables,                                                        &
52        ONLY:  dx, dy
53
54    USE indices,                                                               &
55        ONLY:  nbgp, nx, nxl, nxr, nyn, nys, nzb, nzt
56       
57    USE kinds
58
59    IMPLICIT NONE
60
61    INTEGER(iwp) ::  i  !:
62    INTEGER(iwp) ::  ic !:
63    INTEGER(iwp) ::  j  !:
64    INTEGER(iwp) ::  jc !:
65    INTEGER(iwp) ::  k  !:
66    INTEGER(iwp) ::  kc !:
67   
68    REAL(wp)     ::  betrag !:
69    REAL(wp)     ::  radius !:
70    REAL(wp)     ::  rc     !:
71    REAL(wp)     ::  x      !:
72    REAL(wp)     ::  y      !:
73    REAL(wp)     ::  z      !:
74   
75!
76!-- Defaults: radius rc, strength z,
77!--           position of centre: ic, jc, kc
78    rc =  10.0 * dx
79    ic =  ( nx+1 ) / 2
80    jc =  ic
81    kc = nzt / 2
82
83!
84!-- Compute the perturbation.
85    DO  i = nxl, nxr
86       DO  j = nys, nyn
87          DO  k = nzb+1, nzt
88             x = ( i - ic ) * dx
89             y = ( j - jc ) * dy
90             z = ABS( zu(k) - zu(kc) )
91             radius = SQRT( x**2 + y**2 + z**2 )
92             IF ( radius <= rc )  THEN
93                betrag = 5.0 * EXP( -( radius * 0.001 / 2.0 )**2 )
94             ELSE
95                betrag = 0.0
96             ENDIF
97
98             pt(k,j,i) = pt(k,j,i) + betrag
99
100          ENDDO
101       ENDDO
102    ENDDO
103
104!
105!-- Exchange of boundary values for temperature
106    CALL exchange_horiz( pt, nbgp )
107
108
109 END SUBROUTINE init_pt_anomaly
Note: See TracBrowser for help on using the repository browser.