source: palm/trunk/SOURCE/user_actions.f90 @ 1822

Last change on this file since 1822 was 1822, checked in by hoffmann, 8 years ago

changes in LPM and bulk cloud microphysics

  • Property svn:keywords set to Id
File size: 5.9 KB
RevLine 
[1682]1!> @file user_actions.f90
[1036]2!--------------------------------------------------------------------------------!
3! This file is part of PALM.
4!
5! PALM is free software: you can redistribute it and/or modify it under the terms
6! of the GNU General Public License as published by the Free Software Foundation,
7! either version 3 of the License, or (at your option) any later version.
8!
9! PALM is distributed in the hope that it will be useful, but WITHOUT ANY
10! WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
11! A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
12!
13! You should have received a copy of the GNU General Public License along with
14! PALM. If not, see <http://www.gnu.org/licenses/>.
15!
[1818]16! Copyright 1997-2016 Leibniz Universitaet Hannover
[1036]17!--------------------------------------------------------------------------------!
18!
[258]19! Current revisions:
[1318]20! ------------------
[1822]21! qr/nr-tendency removed.
[1321]22!
23! Former revisions:
24! -----------------
25! $Id: user_actions.f90 1822 2016-04-07 07:49:42Z hoffmann $
26!
[1683]27! 1682 2015-10-07 23:56:08Z knoop
28! Code annotations made doxygen readable
29!
[1354]30! 1353 2014-04-08 15:21:23Z heinze
31! REAL constants provided with KIND-attribute
32!
[1321]33! 1320 2014-03-20 08:40:49Z raasch
[1320]34! kind-parameters added to all INTEGER and REAL declaration statements,
35! kinds are defined in new module kinds,
36! revision history before 2012 removed,
37! comment fields (!:) to be used for variable explanations added to
38! all variable declaration statements
[211]39!
[1319]40! 1318 2014-03-17 13:35:16Z raasch
41! module interfaces removed
42!
[1054]43! 1053 2012-11-13 17:11:03Z hoffmann
44! +qr-tendency, nr-tendency
45!
[1037]46! 1036 2012-10-22 13:43:42Z raasch
47! code put under GPL (PALM 3.9)
48!
[226]49! 211 2008-11-11 04:46:24Z raasch
50! Former file user_interface.f90 split into one file per subroutine
51!
[211]52! Description:
53! ------------
[1682]54!> Execution of user-defined actions before or after single timesteps
[211]55!------------------------------------------------------------------------------!
[1682]56 MODULE user_actions_mod
57 
[211]58
59    PRIVATE
60    PUBLIC user_actions
61
62    INTERFACE user_actions
63       MODULE PROCEDURE user_actions
64       MODULE PROCEDURE user_actions_ij
65    END INTERFACE user_actions
66
67 CONTAINS
68
69
70!------------------------------------------------------------------------------!
[1682]71! Description:
72! ------------
73!> Call for all grid points
[211]74!------------------------------------------------------------------------------!
75    SUBROUTINE user_actions( location )
76
77       USE control_parameters
[1320]78
[211]79       USE cpulog
[1320]80
[211]81       USE indices
[1320]82
83       USE kinds
84
[211]85       USE pegrid
[1320]86
[211]87       USE user
[1320]88
[211]89       USE arrays_3d
90
91       IMPLICIT NONE
92
[1682]93       CHARACTER (LEN=*) ::  location !<
[211]94
[1682]95       INTEGER(iwp) ::  i !<
96       INTEGER(iwp) ::  j !<
97       INTEGER(iwp) ::  k !<
[211]98
99       CALL cpu_log( log_point(24), 'user_actions', 'start' )
100
101!
102!--    Here the user-defined actions follow
103!--    No calls for single grid points are allowed at locations before and
104!--    after the timestep, since these calls are not within an i,j-loop
105       SELECT CASE ( location )
106
107          CASE ( 'before_timestep' )
108!
109!--          Enter actions to be done before every timestep here
110
111
112          CASE ( 'after_integration' )
113!
114!--          Enter actions to be done after every time integration (before
115!--          data output)
116!--          Sample for user-defined output:
[667]117!             DO  i = nxlg, nxrg
118!                DO  j = nysg, nyng
119!                   DO  k = nzb, nzt
[211]120!                      u2(k,j,i) = u(k,j,i)**2
121!                   ENDDO
122!                ENDDO
123!             ENDDO
[667]124!             DO  i = nxlg, nxr
125!                DO  j = nysg, nyn
[211]126!                   DO  k = nzb, nzt+1
127!                      ustvst(k,j,i) =  &
[1353]128!                         ( 0.5_wp * ( u(k,j,i) + u(k,j,i+1) ) - hom(k,1,1,0) ) * &
129!                         ( 0.5_wp * ( v(k,j,i) + v(k,j+1,i) ) - hom(k,1,2,0) )
[211]130!                   ENDDO
131!                ENDDO
132!             ENDDO
133
134
135          CASE ( 'after_timestep' )
136!
137!--          Enter actions to be done after every timestep here
138
139
140          CASE ( 'u-tendency' )
141!
142!--          Enter actions to be done in the u-tendency term here
143
144
145          CASE ( 'v-tendency' )
146
147
148          CASE ( 'w-tendency' )
149
150
151          CASE ( 'pt-tendency' )
152
153
154          CASE ( 'sa-tendency' )
155
156
157          CASE ( 'e-tendency' )
158
159
160          CASE ( 'q-tendency' )
161
162
163          CASE DEFAULT
[258]164             message_string = 'unknown location "' // location // '"'
165             CALL message( 'user_actions', 'UI0001', 1, 2, 0, 6, 0 )
[211]166
167       END SELECT
168
169       CALL cpu_log( log_point(24), 'user_actions', 'stop' )
170
171    END SUBROUTINE user_actions
172
173
174!------------------------------------------------------------------------------!
[1682]175! Description:
176! ------------
177!> Call for grid point i,j
[211]178!------------------------------------------------------------------------------!
179    SUBROUTINE user_actions_ij( i, j, location )
180
181       USE control_parameters
[1320]182       USE kinds
[211]183       USE pegrid
184       USE user
185
186       IMPLICIT NONE
187
188       CHARACTER (LEN=*) ::  location
189
[1320]190       INTEGER(iwp) ::  i
191       INTEGER(iwp) ::  idum
192       INTEGER(iwp) ::  j
[211]193
194!
195!--    Here the user-defined actions follow
196       SELECT CASE ( location )
197
198          CASE ( 'u-tendency' )
199!
200!--          Enter actions to be done in the u-tendency term here
201
202
203          CASE ( 'v-tendency' )
204
205
206          CASE ( 'w-tendency' )
207
208
209          CASE ( 'pt-tendency' )
210
211
212          CASE ( 'sa-tendency' )
213
214
215          CASE ( 'e-tendency' )
216
217
218          CASE ( 'q-tendency' )
219
220
221          CASE ( 'before_timestep', 'after_integration', 'after_timestep' )
[258]222             message_string = 'location "' // location // '" is not ' // &
[211]223                             'allowed to be called with parameters "i" and "j"'
[258]224             CALL message( 'user_actions', 'UI0002', 1, 2, 0, 6, 0 )
[211]225
226
227          CASE DEFAULT
[258]228             message_string = 'unknown location "' // location // '"'
229             CALL message( 'user_actions', 'UI0001', 1, 2, 0, 6, 0 )
230             
[211]231
232       END SELECT
233
234    END SUBROUTINE user_actions_ij
235
236 END MODULE user_actions_mod
Note: See TracBrowser for help on using the repository browser.