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

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

Code annotations made doxygen readable

  • Property svn:keywords set to Id
File size: 3.4 KB
RevLine 
[1682]1!> @file init_pt_anomaly.f90
[1036]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!
[1310]16! Copyright 1997-2014 Leibniz Universitaet Hannover
[1036]17!--------------------------------------------------------------------------------!
18!
[484]19! Current revisions:
[1]20! -----------------
[1682]21! Code annotations made doxygen readable
[1354]22!
[1321]23! Former revisions:
24! -----------------
25! $Id: init_pt_anomaly.f90 1682 2015-10-07 23:56:08Z knoop $
26!
[1354]27! 1353 2014-04-08 15:21:23Z heinze
28! REAL constants provided with KIND-attribute
29!
[1323]30! 1322 2014-03-20 16:38:49Z raasch
31! REAL constants defined as wp_kind
32!
[1321]33! 1320 2014-03-20 08:40:49Z raasch
[1320]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
[1]40!
[1037]41! 1036 2012-10-22 13:43:42Z raasch
42! code put under GPL (PALM 3.9)
43!
[863]44! 861 2012-03-26 14:18:34Z suehring
45! Modification of the amplitude to obtain a visible temperature perturbation.
46!
[1]47! Revision 1.1  1997/08/29 08:58:56  raasch
48! Initial revision
49!
50!
51! Description:
52! ------------
[1682]53!> Impose a temperature perturbation for an advection test.
[1]54!------------------------------------------------------------------------------!
[1682]55 SUBROUTINE init_pt_anomaly
56 
[1]57
[1320]58    USE arrays_3d,                                                             &
59        ONLY:  pt, zu
[1]60
[1320]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
[1]69    IMPLICIT NONE
70
[1682]71    INTEGER(iwp) ::  i  !<
72    INTEGER(iwp) ::  ic !<
73    INTEGER(iwp) ::  j  !<
74    INTEGER(iwp) ::  jc !<
75    INTEGER(iwp) ::  k  !<
76    INTEGER(iwp) ::  kc !<
[1320]77   
[1682]78    REAL(wp)     ::  betrag !<
79    REAL(wp)     ::  radius !<
80    REAL(wp)     ::  rc     !<
81    REAL(wp)     ::  x      !<
82    REAL(wp)     ::  y      !<
83    REAL(wp)     ::  z      !<
[1320]84   
[1]85!
86!-- Defaults: radius rc, strength z,
87!--           position of centre: ic, jc, kc
[1353]88    rc =  10.0_wp * dx
[1]89    ic =  ( nx+1 ) / 2
90    jc =  ic
[1353]91    kc =  nzt / 2
[1]92
93!
94!-- Compute the perturbation.
95    DO  i = nxl, nxr
96       DO  j = nys, nyn
[19]97          DO  k = nzb+1, nzt
[1]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
[1353]103                betrag = 5.0_wp * EXP( -( radius * 0.001_wp / 2.0_wp )**2 )
[1]104             ELSE
[1353]105                betrag = 0.0_wp
[1]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
[667]116    CALL exchange_horiz( pt, nbgp )
[1]117
118
119 END SUBROUTINE init_pt_anomaly
Note: See TracBrowser for help on using the repository browser.