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