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

Last change on this file since 1330 was 1323, checked in by raasch, 11 years ago

last commit documented

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