source: palm/trunk/SOURCE/user_init_grid.f90 @ 2232

Last change on this file since 2232 was 2232, checked in by suehring, 7 years ago

Adjustments according new topography and surface-modelling concept implemented

  • Property svn:keywords set to Id
File size: 4.4 KB
RevLine 
[1682]1!> @file user_init_grid.f90
[2000]2!------------------------------------------------------------------------------!
[1036]3! This file is part of PALM.
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!
[2101]17! Copyright 1997-2017 Leibniz Universitaet Hannover
[2000]18!------------------------------------------------------------------------------!
[1036]19!
[258]20! Current revisions:
[211]21! -----------------
[2232]22! +Generic tunnel added
23! +Example of setting user-defined topography
[1683]24!
[1321]25! Former revisions:
26! -----------------
27! $Id: user_init_grid.f90 2232 2017-05-30 17:47:52Z suehring $
28!
[2001]29! 2000 2016-08-20 18:09:15Z knoop
30! Forced header and separation lines into 80 columns
31!
[1969]32! 1968 2016-07-18 12:01:49Z suehring
33! Change dimensions for nzb_local, which do not longer need to be set on
34! multigrid ghost points.
35!
[1683]36! 1682 2015-10-07 23:56:08Z knoop
37! Code annotations made doxygen readable
38!
[1321]39! 1320 2014-03-20 08:40:49Z raasch
[1320]40! kind-parameters added to all INTEGER and REAL declaration statements,
41! kinds are defined in new module kinds,
42! old module precision_kind is removed,
43! revision history before 2012 removed,
44! comment fields (!:) to be used for variable explanations added to
45! all variable declaration statements
[211]46!
[1037]47! 1036 2012-10-22 13:43:42Z raasch
48! code put under GPL (PALM 3.9)
49!
[226]50! 217 2008-12-09 18:00:48Z letzel
51! +topography_grid_convention
52! Former file user_interface.f90 split into one file per subroutine
53!
[211]54! Description:
55! ------------
[1682]56!> Execution of user-defined grid initializing actions
[211]57!------------------------------------------------------------------------------!
[2232]58 SUBROUTINE user_init_grid( topo_3d )
[1682]59 
[211]60
61    USE control_parameters
[1320]62   
[211]63    USE indices
[1320]64   
65    USE kinds
66   
[211]67    USE user
68
69    IMPLICIT NONE
70
[2232]71    INTEGER(iwp)                                           ::  k_topo      !< topography top index
72    INTEGER(iwp), DIMENSION(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ::  topo_3d     !< 3D topography field
[211]73
[2232]74    REAL(wp) ::  h_topo !< user-defined topography height
75
[211]76!
77!-- Here the user-defined grid initializing actions follow:
78
79!
80!-- Set the index array nzb_local for non-flat topography.
81!-- Here consistency checks concerning domain size and periodicity are necessary
82    SELECT CASE ( TRIM( topography ) )
83
[2232]84       CASE ( 'flat', 'single_building', 'single_street_canyon', 'tunnel' )
[211]85!
86!--       Not allowed here since these are the standard cases used in init_grid.
87
88       CASE ( 'user_defined_topography_1' )
89!
[256]90!--       Here the user can define his own topography.
[217]91!--       After definition, please remove the following three lines!
[258]92          message_string = 'topography "' // topography // '" not available yet'
93          CALL message( 'user_init_grid', 'UI0005', 1, 2, 0, 6, 0 )
[2232]94!
95!--       The user is allowed to set surface-mounted as well as non-surface
96!--       mounted topography (e.g. overhanging structures). For both, use
97!--       3D array topo_3d and set bit 0. The convention is: bit is zero inside
98!--       topography, bit is 1 for atmospheric grid point.
99!--       The following example shows how to prescribe sine-like topography
100!--       along x-direction with amplitude of 10 * dz and wavelength 10 * dy.
101!           DO  i = nxlg, nxrg
102!              h_topo = 10.0_wp * dz * (SIN(3.14_wp*0.5_wp)*i*dx / ( 5.0_wp * dy ) )**2
103!
104!              k_topo = MINLOC( ABS( zw - h_topo ), 1 ) - 1
105!
106!              topo_3d(k_topo+1:nzt+1,:,i) =                                     &
107!                                          IBSET( topo_3d(k_topo+1:nzt+1,:,i), 0 )
108!           ENDDO
109!
110!           CALL exchange_horiz_int( topo_3d, nbgp )
[211]111
112       CASE DEFAULT
113!
114!--       The DEFAULT case is reached if the parameter topography contains a
115!--       wrong character string that is neither recognized in init_grid nor
116!--       here in user_init_grid.
[258]117          message_string = 'unknown topography "' // topography // '"'
118          CALL message( 'user_init_grid', 'UI0006', 1, 2, 0, 6, 0 )
[211]119
120    END SELECT
121
122
[2232]123
124
[211]125 END SUBROUTINE user_init_grid
126
Note: See TracBrowser for help on using the repository browser.