Changeset 4648 for palm/trunk/SOURCE/init_slope.f90
- Timestamp:
- Aug 25, 2020 7:52:08 AM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
palm/trunk/SOURCE/init_slope.f90
r4360 r4648 1 1 !> @file init_slope.f90 2 !------------------------------------------------------------------------------ !2 !--------------------------------------------------------------------------------------------------! 3 3 ! This file is part of the PALM model system. 4 4 ! 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. 5 ! PALM is free software: you can redistribute it and/or modify it under the terms of the GNU General 6 ! Public License as published by the Free Software Foundation, either version 3 of the License, or 7 ! (at your option) any later version. 9 8 ! 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 FOR12 ! A PARTICULAR PURPOSE. See the GNU GeneralPublic License for more details.9 ! PALM is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the 10 ! implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General 11 ! Public License for more details. 13 12 ! 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/>.13 ! You should have received a copy of the GNU General Public License along with PALM. If not, see 14 ! <http://www.gnu.org/licenses/>. 16 15 ! 17 16 ! Copyright 1997-2020 Leibniz Universitaet Hannover 18 !------------------------------------------------------------------------------ !17 !--------------------------------------------------------------------------------------------------! 19 18 ! 20 19 ! Current revisions: 21 20 ! ----------------- 22 ! 23 ! 21 ! 22 ! 24 23 ! Former revisions: 25 24 ! ----------------- 26 25 ! $Id$ 26 ! file re-formatted to follow the PALM coding standard 27 ! 28 ! 4360 2020-01-07 11:25:50Z suehring 27 29 ! Corrected "Former revisions" section 28 ! 30 ! 29 31 ! 3655 2019-01-07 16:51:22Z knoop 30 32 ! Modularization of all bulk cloud physics code components … … 36 38 ! Description: 37 39 ! ------------ 38 !> Initialization of the temperature field and other variables used in case 39 !> of a sloping surface. 40 !> Initialization of the temperature field and other variables used in case of a sloping surface. 40 41 !> @note when a sloping surface is used, only one constant temperature 41 42 !> gradient is allowed! 42 !------------------------------------------------------------------------------ !43 !--------------------------------------------------------------------------------------------------! 43 44 SUBROUTINE init_slope 44 45 45 46 USE arrays_3d, & 46 47 USE arrays_3d, & 47 48 ONLY: pt, pt_init, pt_slope_ref, zu 48 49 USE basic_constants_and_equations_mod, &49 50 USE basic_constants_and_equations_mod, & 50 51 ONLY: pi 51 52 USE control_parameters, &53 ONLY: alpha_surface, initializing_actions, pt_slope_offset, &54 pt_ surface, pt_vertical_gradient, sin_alpha_surface55 56 USE grid_variables, &52 53 USE control_parameters, & 54 ONLY: alpha_surface, initializing_actions, pt_slope_offset, pt_surface, & 55 pt_vertical_gradient, sin_alpha_surface 56 57 USE grid_variables, & 57 58 ONLY: dx 58 59 USE indices, &59 60 USE indices, & 60 61 ONLY: ngp_2dh, nx, nxl, nxlg, nxr, nxrg, nyn, nyng, nys, nysg, nzb, nzt 61 62 62 63 USE kinds 63 64 … … 70 71 INTEGER(iwp) :: j !< 71 72 INTEGER(iwp) :: k !< 72 73 73 74 REAL(wp) :: alpha !< 74 75 REAL(wp) :: height !< 75 76 REAL(wp) :: pt_value !< 76 77 REAL(wp) :: radius !< 77 78 78 79 REAL(wp), DIMENSION(:), ALLOCATABLE :: pt_init_local !< 79 80 … … 86 87 87 88 ! 88 !-- Compute height of grid-point relative to lower left corner of 89 !-- the total domain. 90 !-- First compute the distance between the actual grid point and the 91 !-- lower left corner as well as the angle between the line connecting 92 !-- these points and the bottom of the model. 89 !-- Compute height of grid-point relative to lower left corner of the total domain. 90 !-- First compute the distance between the actual grid point and the lower left corner as well 91 !-- as the angle between the line connecting these points and the bottom of the model. 93 92 IF ( k /= nzb ) THEN 94 93 radius = SQRT( ( i * dx )**2 + zu(k)**2 ) … … 106 105 !-- Compute temperatures in the rotated coordinate system 107 106 alpha = alpha + alpha_surface / 180.0_wp * pi 108 pt_value = pt_surface + radius * SIN( alpha ) * & 109 pt_vertical_gradient(1) / 100.0_wp 107 pt_value = pt_surface + radius * SIN( alpha ) * pt_vertical_gradient(1) / 100.0_wp 110 108 pt_slope_ref(k,i) = pt_value 111 ENDDO 109 ENDDO 112 110 ENDDO 113 111 114 112 ! 115 !-- Temperature difference between left and right boundary of the total domain, 116 !-- used for the cyclic boundary in x-direction 117 pt_slope_offset = (nx+1) * dx * sin_alpha_surface * & 118 pt_vertical_gradient(1) / 100.0_wp 113 !-- Temperature difference between left and right boundary of the total domain, used for the cyclic 114 !-- boundary in x-direction 115 pt_slope_offset = (nx+1) * dx * sin_alpha_surface * pt_vertical_gradient(1) / 100.0_wp 119 116 120 117 … … 129 126 130 127 ! 131 !-- Recompute the mean initial temperature profile (mean along x-direction of 132 !-- the rotatedcoordinate system)128 !-- Recompute the mean initial temperature profile (mean along x-direction of the rotated 129 !-- coordinate system) 133 130 ALLOCATE( pt_init_local(nzb:nzt+1) ) 134 131 pt_init_local = 0.0_wp … … 143 140 #if defined( __parallel ) 144 141 IF ( collective_wait ) CALL MPI_BARRIER( comm2d, ierr ) 145 CALL MPI_ALLREDUCE( pt_init_local, pt_init, nzt+2-nzb, MPI_REAL, & 146 MPI_SUM, comm2d, ierr ) 142 CALL MPI_ALLREDUCE( pt_init_local, pt_init, nzt+2-nzb, MPI_REAL, MPI_SUM, comm2d, ierr ) 147 143 #else 148 144 pt_init = pt_init_local
Note: See TracChangeset
for help on using the changeset viewer.