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

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

last commit documented

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