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