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

Last change on this file since 3285 was 3035, checked in by schwenkel, 7 years ago

Add option to initialize warm air bubble close to surface

  • Property svn:keywords set to Id
File size: 5.8 KB
RevLine 
[1682]1!> @file init_pt_anomaly.f90
[2000]2!------------------------------------------------------------------------------!
[2696]3! This file is part of the PALM model system.
[1036]4!
[2000]5! PALM is free software: you can redistribute it and/or modify it under the
6! terms of the GNU General Public License as published by the Free Software
7! Foundation, either version 3 of the License, or (at your option) any later
8! version.
[1036]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!
[2718]17! Copyright 1997-2018 Leibniz Universitaet Hannover
[2000]18!------------------------------------------------------------------------------!
[1036]19!
[484]20! Current revisions:
[1]21! -----------------
[1354]22!
[2001]23!
[1321]24! Former revisions:
25! -----------------
26! $Id: init_pt_anomaly.f90 3035 2018-05-24 09:35:20Z scharf $
[3035]27! Add option to initialize warm air bubble close to surface
28!
29! 2718 2018-01-02 08:49:38Z maronga
[2716]30! Corrected "Former revisions" section
31!
32! 2696 2017-12-14 17:12:51Z kanani
33! Change in file header (GPL part)
[1321]34!
[2716]35! 2101 2017-01-05 16:42:31Z suehring
36!
[2001]37! 2000 2016-08-20 18:09:15Z knoop
38! Forced header and separation lines into 80 columns
39!
[1683]40! 1682 2015-10-07 23:56:08Z knoop
41! Code annotations made doxygen readable
42!
[1354]43! 1353 2014-04-08 15:21:23Z heinze
44! REAL constants provided with KIND-attribute
45!
[1323]46! 1322 2014-03-20 16:38:49Z raasch
47! REAL constants defined as wp_kind
48!
[1321]49! 1320 2014-03-20 08:40:49Z raasch
[1320]50! ONLY-attribute added to USE-statements,
51! kind-parameters added to all INTEGER and REAL declaration statements,
52! kinds are defined in new module kinds,
53! revision history before 2012 removed,
54! comment fields (!:) to be used for variable explanations added to
55! all variable declaration statements
[1]56!
[1037]57! 1036 2012-10-22 13:43:42Z raasch
58! code put under GPL (PALM 3.9)
59!
[863]60! 861 2012-03-26 14:18:34Z suehring
61! Modification of the amplitude to obtain a visible temperature perturbation.
62!
[1]63! Revision 1.1  1997/08/29 08:58:56  raasch
64! Initial revision
65!
66!
67! Description:
68! ------------
[1682]69!> Impose a temperature perturbation for an advection test.
[1]70!------------------------------------------------------------------------------!
[1682]71 SUBROUTINE init_pt_anomaly
72 
[1]73
[1320]74    USE arrays_3d,                                                             &
75        ONLY:  pt, zu
[1]76
[3035]77    USE control_parameters   
78       
[1320]79    USE grid_variables,                                                        &
80        ONLY:  dx, dy
81
82    USE indices,                                                               &
[3035]83        ONLY:  nbgp, nx, nxl, nxr, ny, nyn, nys, nzb, nzt
[1320]84       
85    USE kinds
86
[1]87    IMPLICIT NONE
88
[3035]89    INTEGER(iwp) ::  i  !< grid index along x
90    INTEGER(iwp) ::  ic !< center index along x
91    INTEGER(iwp) ::  j  !< grid index along y
92    INTEGER(iwp) ::  jc !< center index along y
93    INTEGER(iwp) ::  k  !< grid index along z
94    INTEGER(iwp) ::  kc !< center index along z
[1320]95   
[3035]96    REAL(wp)     ::  amount                               !< amount of temperature perturbation
97    REAL(wp)     ::  bubble_center_y                      !< center of bubble in y
98    REAL(wp)     ::  bubble_center_z = 170.0              !< center of bubble in z
99    REAL(wp)     ::  bubble_sigma_y = 300.0               !< width of bubble in y
100    REAL(wp)     ::  bubble_sigma_z = 150.0               !< width of bubble in z
101    REAL(wp)     ::  initial_temperature_difference = 0.4 !< temperature perturbation for bubble in K
102    REAL(wp)     ::  radius                               !< radius of pt anomaly
103    REAL(wp)     ::  rc                                   !< radius of pt anomaly
104    REAL(wp)     ::  x                                    !< x dimension of pt anomaly
105    REAL(wp)     ::  y                                    !< y dimension of pt anomaly
106    REAL(wp)     ::  z                                    !< z dimension of pt anomaly
[1320]107   
[3035]108   
[1]109!
110!-- Defaults: radius rc, strength z,
[3035]111!--           position of center: ic, jc, kc
[1353]112    rc =  10.0_wp * dx
[1]113    ic =  ( nx+1 ) / 2
114    jc =  ic
[1353]115    kc =  nzt / 2
[3035]116   
117    IF ( INDEX( initializing_actions, 'initialize_ptanom' ) /= 0 )  THEN
[1]118!
[3035]119!--    Compute the perturbation.
120       DO  i = nxl, nxr
121          DO  j = nys, nyn
122             DO  k = nzb+1, nzt
123                x = ( i - ic ) * dx
124                y = ( j - jc ) * dy
125                z = ABS( zu(k) - zu(kc) )
126                radius = SQRT( x**2 + y**2 + z**2 )
127                IF ( radius <= rc )  THEN
128                   amount = 5.0_wp * EXP( -( radius * 0.001_wp / 2.0_wp )**2 )
129                ELSE
130                   amount = 0.0_wp
131                ENDIF
[1]132
[3035]133                pt(k,j,i) = pt(k,j,i) + amount
[1]134
[3035]135             ENDDO
[1]136          ENDDO
137       ENDDO
[3035]138       
139!
140!-- Initialize warm air bubble close to surface and homogenous elegonated
141!-- along x-Axis
142    ELSEIF ( INDEX( initializing_actions, 'initialize_bubble' ) /= 0 )  THEN
143!
144!--    Calculate y-center of model domain
145       bubble_center_y = ( ny + 1.0 ) * dy / 2.0
146   
147!
148!--    Compute perturbation for potential temperaure
149       DO  i = nxl, nxr
150          DO  j = nys, nyn
151             DO  k = nzb+1, nzt 
152                pt(k,j,i) = pt(k,j,i) +                                        &
153                               EXP( -0.5 * ( (j* dy  - bubble_center_y) /      &
154                                                       bubble_sigma_y )**2) *  &
155                               EXP( -0.5 * ( (zu(k)  - bubble_center_z) /      &
156                                                       bubble_sigma_z)**2) *   &
157                               initial_temperature_difference
158             ENDDO
159          ENDDO
160       ENDDO
161    ENDIF
[1]162
163!
164!-- Exchange of boundary values for temperature
[667]165    CALL exchange_horiz( pt, nbgp )
[1]166
167
168 END SUBROUTINE init_pt_anomaly
Note: See TracBrowser for help on using the repository browser.