source: palm/trunk/SOURCE/user_3d_data_averaging.f90 @ 2000

Last change on this file since 2000 was 2000, checked in by knoop, 5 years ago

Forced header and separation lines into 80 columns

  • Property svn:keywords set to Id
File size: 4.1 KB
Line 
1!> @file user_3d_data_averaging.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-2016 Leibniz Universitaet Hannover
18!------------------------------------------------------------------------------!
19!
20! Current revisions:
21! -----------------
22! Forced header and separation lines into 80 columns
23!
24! Former revisions:
25! -----------------
26! $Id: user_3d_data_averaging.f90 2000 2016-08-20 18:09:15Z knoop $
27!
28! 1682 2015-10-07 23:56:08Z knoop
29! Code annotations made doxygen readable
30!
31! 1353 2014-04-08 15:21:23Z heinze
32! REAL constants provided with KIND-attribute
33!
34! 1322 2014-03-20 16:38:49Z raasch
35! REAL functions provided with KIND-attribute
36!
37! 1320 2014-03-20 08:40:49Z raasch
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
43!
44! 1036 2012-10-22 13:43:42Z raasch
45! code put under GPL (PALM 3.9)
46!
47! 211 2008-11-11 04:46:24Z raasch
48! Former file user_interface.f90 split into one file per subroutine
49!
50! Description:
51! ------------
52!> Sum up and time-average user-defined output quantities as well as allocate
53!> the array necessary for storing the average.
54!------------------------------------------------------------------------------!
55 SUBROUTINE user_3d_data_averaging( mode, variable )
56 
57
58    USE control_parameters
59
60    USE indices
61
62    USE kinds
63
64    USE user
65
66    IMPLICIT NONE
67
68    CHARACTER (LEN=*) ::  mode    !<
69    CHARACTER (LEN=*) :: variable !<
70
71    INTEGER(iwp) ::  i !<
72    INTEGER(iwp) ::  j !<
73    INTEGER(iwp) ::  k !<
74
75    IF ( mode == 'allocate' )  THEN
76
77       SELECT CASE ( TRIM( variable ) )
78
79!
80!--       Uncomment and extend the following lines, if necessary.
81!--       The arrays for storing the user defined quantities (here u2_av) have
82!--       to be declared and defined by the user!
83!--       Sample for user-defined output:
84!          CASE ( 'u2' )
85!             IF ( .NOT. ALLOCATED( u2_av ) )  THEN
86!                ALLOCATE( u2_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) )
87!             ENDIF
88!             u2_av = 0.0_wp
89
90          CASE DEFAULT
91             CONTINUE
92
93       END SELECT
94
95    ELSEIF ( mode == 'sum' )  THEN
96
97       SELECT CASE ( TRIM( variable ) )
98
99!
100!--       Uncomment and extend the following lines, if necessary.
101!--       The arrays for storing the user defined quantities (here u2 and
102!--       u2_av) have to be declared and defined by the user!
103!--       Sample for user-defined output:
104!          CASE ( 'u2' )
105!             DO  i = nxlg, nxrg
106!                DO  j = nysg, nyng
107!                   DO  k = nzb, nzt+1
108!                      u2_av(k,j,i) = u2_av(k,j,i) + u2(k,j,i)
109!                   ENDDO
110!                ENDDO
111!             ENDDO
112
113          CASE DEFAULT
114             CONTINUE
115
116       END SELECT
117
118    ELSEIF ( mode == 'average' )  THEN
119
120       SELECT CASE ( TRIM( variable ) )
121
122!
123!--       Uncomment and extend the following lines, if necessary.
124!--       The arrays for storing the user defined quantities (here u2_av) have
125!--       to be declared and defined by the user!
126!--       Sample for user-defined output:
127!          CASE ( 'u2' )
128!             DO  i = nxlg, nxrg
129!                DO  j = nysg, nyng
130!                   DO  k = nzb, nzt+1
131!                      u2_av(k,j,i) = u2_av(k,j,i) / REAL( average_count_3d, KIND=wp )
132!                   ENDDO
133!                ENDDO
134!             ENDDO
135
136       END SELECT
137
138    ENDIF
139
140
141 END SUBROUTINE user_3d_data_averaging
Note: See TracBrowser for help on using the repository browser.