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

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

Forced header and separation lines into 80 columns

  • Property svn:keywords set to Id
File size: 4.1 KB
RevLine 
[1682]1!> @file user_3d_data_averaging.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!
[1818]17! Copyright 1997-2016 Leibniz Universitaet Hannover
[2000]18!------------------------------------------------------------------------------!
[1036]19!
[484]20! Current revisions:
[211]21! -----------------
[2000]22! Forced header and separation lines into 80 columns
[1354]23!
[1321]24! Former revisions:
25! -----------------
26! $Id: user_3d_data_averaging.f90 2000 2016-08-20 18:09:15Z knoop $
27!
[1683]28! 1682 2015-10-07 23:56:08Z knoop
29! Code annotations made doxygen readable
30!
[1354]31! 1353 2014-04-08 15:21:23Z heinze
32! REAL constants provided with KIND-attribute
33!
[1323]34! 1322 2014-03-20 16:38:49Z raasch
35! REAL functions provided with KIND-attribute
36!
[1321]37! 1320 2014-03-20 08:40:49Z raasch
[1320]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
[211]43!
[1037]44! 1036 2012-10-22 13:43:42Z raasch
45! code put under GPL (PALM 3.9)
46!
[226]47! 211 2008-11-11 04:46:24Z raasch
48! Former file user_interface.f90 split into one file per subroutine
49!
[211]50! Description:
51! ------------
[1682]52!> Sum up and time-average user-defined output quantities as well as allocate
53!> the array necessary for storing the average.
[211]54!------------------------------------------------------------------------------!
[1682]55 SUBROUTINE user_3d_data_averaging( mode, variable )
56 
[211]57
58    USE control_parameters
[1320]59
[211]60    USE indices
[1320]61
62    USE kinds
63
[211]64    USE user
65
66    IMPLICIT NONE
67
[1682]68    CHARACTER (LEN=*) ::  mode    !<
69    CHARACTER (LEN=*) :: variable !<
[211]70
[1682]71    INTEGER(iwp) ::  i !<
72    INTEGER(iwp) ::  j !<
73    INTEGER(iwp) ::  k !<
[211]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
[667]86!                ALLOCATE( u2_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) )
[211]87!             ENDIF
[1353]88!             u2_av = 0.0_wp
[211]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' )
[667]105!             DO  i = nxlg, nxrg
106!                DO  j = nysg, nyng
[211]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' )
[667]128!             DO  i = nxlg, nxrg
129!                DO  j = nysg, nyng
[211]130!                   DO  k = nzb, nzt+1
[1322]131!                      u2_av(k,j,i) = u2_av(k,j,i) / REAL( average_count_3d, KIND=wp )
[211]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.