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