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

Last change on this file since 1682 was 1682, checked in by knoop, 6 years ago

Code annotations made doxygen readable

  • Property svn:keywords set to Id
File size: 3.4 KB
Line 
1!> @file init_pt_anomaly.f90
2!--------------------------------------------------------------------------------!
3! This file is part of PALM.
4!
5! PALM is free software: you can redistribute it and/or modify it under the terms
6! of the GNU General Public License as published by the Free Software Foundation,
7! either version 3 of the License, or (at your option) any later version.
8!
9! PALM is distributed in the hope that it will be useful, but WITHOUT ANY
10! WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
11! A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
12!
13! You should have received a copy of the GNU General Public License along with
14! PALM. If not, see <http://www.gnu.org/licenses/>.
15!
16! Copyright 1997-2014 Leibniz Universitaet Hannover
17!--------------------------------------------------------------------------------!
18!
19! Current revisions:
20! -----------------
21! Code annotations made doxygen readable
22!
23! Former revisions:
24! -----------------
25! $Id: init_pt_anomaly.f90 1682 2015-10-07 23:56:08Z knoop $
26!
27! 1353 2014-04-08 15:21:23Z heinze
28! REAL constants provided with KIND-attribute
29!
30! 1322 2014-03-20 16:38:49Z raasch
31! REAL constants defined as wp_kind
32!
33! 1320 2014-03-20 08:40:49Z raasch
34! ONLY-attribute added to USE-statements,
35! kind-parameters added to all INTEGER and REAL declaration statements,
36! kinds are defined in new module kinds,
37! revision history before 2012 removed,
38! comment fields (!:) to be used for variable explanations added to
39! all variable declaration statements
40!
41! 1036 2012-10-22 13:43:42Z raasch
42! code put under GPL (PALM 3.9)
43!
44! 861 2012-03-26 14:18:34Z suehring
45! Modification of the amplitude to obtain a visible temperature perturbation.
46!
47! Revision 1.1  1997/08/29 08:58:56  raasch
48! Initial revision
49!
50!
51! Description:
52! ------------
53!> Impose a temperature perturbation for an advection test.
54!------------------------------------------------------------------------------!
55 SUBROUTINE init_pt_anomaly
56 
57
58    USE arrays_3d,                                                             &
59        ONLY:  pt, zu
60
61    USE grid_variables,                                                        &
62        ONLY:  dx, dy
63
64    USE indices,                                                               &
65        ONLY:  nbgp, nx, nxl, nxr, nyn, nys, nzb, nzt
66       
67    USE kinds
68
69    IMPLICIT NONE
70
71    INTEGER(iwp) ::  i  !<
72    INTEGER(iwp) ::  ic !<
73    INTEGER(iwp) ::  j  !<
74    INTEGER(iwp) ::  jc !<
75    INTEGER(iwp) ::  k  !<
76    INTEGER(iwp) ::  kc !<
77   
78    REAL(wp)     ::  betrag !<
79    REAL(wp)     ::  radius !<
80    REAL(wp)     ::  rc     !<
81    REAL(wp)     ::  x      !<
82    REAL(wp)     ::  y      !<
83    REAL(wp)     ::  z      !<
84   
85!
86!-- Defaults: radius rc, strength z,
87!--           position of centre: ic, jc, kc
88    rc =  10.0_wp * dx
89    ic =  ( nx+1 ) / 2
90    jc =  ic
91    kc =  nzt / 2
92
93!
94!-- Compute the perturbation.
95    DO  i = nxl, nxr
96       DO  j = nys, nyn
97          DO  k = nzb+1, nzt
98             x = ( i - ic ) * dx
99             y = ( j - jc ) * dy
100             z = ABS( zu(k) - zu(kc) )
101             radius = SQRT( x**2 + y**2 + z**2 )
102             IF ( radius <= rc )  THEN
103                betrag = 5.0_wp * EXP( -( radius * 0.001_wp / 2.0_wp )**2 )
104             ELSE
105                betrag = 0.0_wp
106             ENDIF
107
108             pt(k,j,i) = pt(k,j,i) + betrag
109
110          ENDDO
111       ENDDO
112    ENDDO
113
114!
115!-- Exchange of boundary values for temperature
116    CALL exchange_horiz( pt, nbgp )
117
118
119 END SUBROUTINE init_pt_anomaly
Note: See TracBrowser for help on using the repository browser.