source: palm/trunk/SOURCE/user_data_output_2d.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: 5.2 KB
Line 
1!> @file user_data_output_2d.f90
2!------------------------------------------------------------------------------!
3! This file is part of PALM.
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.
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!
17! Copyright 1997-2017 Leibniz Universitaet Hannover
18!------------------------------------------------------------------------------!
19!
20! Current revisions:
21! -----------------
22! Example code added for accessing output quantities stored on surface-data
23! types
24!
25! Former revisions:
26! -----------------
27! $Id: user_data_output_2d.f90 2232 2017-05-30 17:47:52Z suehring $
28!
29! 2000 2016-08-20 18:09:15Z knoop
30! Forced header and separation lines into 80 columns
31!
32! 1682 2015-10-07 23:56:08Z knoop
33! Code annotations made doxygen readable
34!
35! 1551 2015-03-03 14:18:16Z maronga
36! Replaced nzb and nzt+1 with the new array bounds nzb_do and nzt_do.
37!
38! 1320 2014-03-20 08:40:49Z raasch
39! kind-parameters added to all INTEGER and REAL declaration statements,
40! kinds are defined in new module kinds,
41! revision history before 2012 removed,
42! comment fields (!:) to be used for variable explanations added to
43! all variable declaration statements
44!
45! 1036 2012-10-22 13:43:42Z raasch
46! code put under GPL (PALM 3.9)
47!
48! 211 2008-11-11 04:46:24Z raasch
49! Former file user_interface.f90 split into one file per subroutine
50!
51! Description:
52! ------------
53!> Resorts the user-defined output quantity with indices (k,j,i) to a
54!> temporary array with indices (i,j,k) and sets the grid on which it is defined.
55!> Allowed values for grid are "zu" and "zw".
56!------------------------------------------------------------------------------!
57 SUBROUTINE user_data_output_2d( av, variable, found, grid, local_pf, two_d, nzb_do, nzt_do )
58 
59
60    USE indices
61
62    USE kinds
63
64    USE surface_mod
65
66    USE user
67
68    IMPLICIT NONE
69
70    CHARACTER (LEN=*) ::  grid     !<
71    CHARACTER (LEN=*) ::  variable !<
72
73    INTEGER(iwp) ::  av     !< flag to control data output of instantaneous or time-averaged data
74    INTEGER(iwp) ::  i      !< grid index along x-direction
75    INTEGER(iwp) ::  j      !< grid index along y-direction
76    INTEGER(iwp) ::  k      !< grid index along z-direction
77    INTEGER(iwp) ::  m      !< running index surface elements
78    INTEGER(iwp) ::  nzb_do !< lower limit of the domain (usually nzb)
79    INTEGER(iwp) ::  nzt_do !< upper limit of the domain (usually nzt+1)
80
81    LOGICAL      ::  found !<
82    LOGICAL      ::  two_d !< flag parameter that indicates 2D variables (horizontal cross sections)
83
84    REAL(wp), DIMENSION(nxlg:nxrg,nysg:nyng,nzb:nzt+1) ::  local_pf !<
85
86
87    found = .TRUE.
88
89    SELECT CASE ( TRIM( variable ) )
90
91!
92!--    Uncomment and extend the following lines, if necessary.
93!--    The arrays for storing the user defined quantities (here u2 and u2_av)
94!--    have to be declared and defined by the user!
95!--    Sample for user-defined output:
96!       CASE ( 'u2_xy', 'u2_xz', 'u2_yz' )
97!          IF ( av == 0 )  THEN
98!             DO  i = nxlg, nxrg
99!                DO  j = nysg, nyng
100!                   DO  k = nzb_do, nzt_do
101!                      local_pf(i,j,k) = u2(k,j,i)
102!                   ENDDO
103!                ENDDO
104!             ENDDO
105!          ELSE
106!             DO  i = nxlg, nxrg
107!                DO  j = nysg, nyng
108!                   DO  k = nzb_do, nzt_do
109!                      local_pf(i,j,k) = u2_av(k,j,i)
110!                   ENDDO
111!                ENDDO
112!             ENDDO
113!          ENDIF
114!
115!          grid = 'zu'
116!
117!--    In case two-dimensional surface variables are outputted, the user
118!--    has to access related surface-type. Uncomment and extend following lines
119!--    appropriately (example output of vertical surface momentum flux of u-
120!--    component). Please note, surface elements can be distributed over
121!--    several data type, depending on their respective surface properties.
122!       CASE ( 'usws_xy' )
123!          IF ( av == 0 )  THEN
124!
125!--           Horizontal default-type surfaces
126!             DO  m = 1, surf_def_h(0)%ns
127!                i = surf_def_h(0)%i(m)
128!                j = surf_def_h(0)%j(m)
129!                local_pf(i,j,1) = surf_def_h(0)%usws(m)
130!             ENDDO
131!
132!--           Horizontal natural-type surfaces
133!             DO  m = 1, surf_lsm_h%ns
134!                i = surf_lsm_h%i(m)
135!                j = surf_lsm_h%j(m)
136!                local_pf(i,j,1) = surf_lsm_h%usws(m)
137!             ENDDO
138!
139!--           Horizontal urban-type surfaces
140!             DO  m = 1, surf_usm_h%ns
141!                i = surf_usm_h%i(m)
142!                j = surf_usm_h%j(m)
143!                local_pf(i,j,1) = surf_usm_h%usws(m)
144!             ENDDO
145!          ENDIF
146!
147!          grid = 'zu'
148!--       
149
150
151       CASE DEFAULT
152          found = .FALSE.
153          grid  = 'none'
154
155    END SELECT
156
157
158 END SUBROUTINE user_data_output_2d
159
Note: See TracBrowser for help on using the repository browser.