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

Last change on this file since 1322 was 1322, checked in by raasch, 7 years ago

REAL functions and a lot of REAL constants provided with KIND-attribute,
some small bugfixes

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