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

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

changes in LPM and bulk cloud microphysics

  • Property svn:keywords set to Id
File size: 5.9 KB
Line 
1!> @file user_actions.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 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!
16! Copyright 1997-2016 Leibniz Universitaet Hannover
17!--------------------------------------------------------------------------------!
18!
19! Current revisions:
20! ------------------
21! qr/nr-tendency removed.
22!
23! Former revisions:
24! -----------------
25! $Id: user_actions.f90 1822 2016-04-07 07:49:42Z hoffmann $
26!
27! 1682 2015-10-07 23:56:08Z knoop
28! Code annotations made doxygen readable
29!
30! 1353 2014-04-08 15:21:23Z heinze
31! REAL constants provided with KIND-attribute
32!
33! 1320 2014-03-20 08:40:49Z raasch
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
39!
40! 1318 2014-03-17 13:35:16Z raasch
41! module interfaces removed
42!
43! 1053 2012-11-13 17:11:03Z hoffmann
44! +qr-tendency, nr-tendency
45!
46! 1036 2012-10-22 13:43:42Z raasch
47! code put under GPL (PALM 3.9)
48!
49! 211 2008-11-11 04:46:24Z raasch
50! Former file user_interface.f90 split into one file per subroutine
51!
52! Description:
53! ------------
54!> Execution of user-defined actions before or after single timesteps
55!------------------------------------------------------------------------------!
56 MODULE user_actions_mod
57 
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!------------------------------------------------------------------------------!
71! Description:
72! ------------
73!> Call for all grid points
74!------------------------------------------------------------------------------!
75    SUBROUTINE user_actions( location )
76
77       USE control_parameters
78
79       USE cpulog
80
81       USE indices
82
83       USE kinds
84
85       USE pegrid
86
87       USE user
88
89       USE arrays_3d
90
91       IMPLICIT NONE
92
93       CHARACTER (LEN=*) ::  location !<
94
95       INTEGER(iwp) ::  i !<
96       INTEGER(iwp) ::  j !<
97       INTEGER(iwp) ::  k !<
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:
117!             DO  i = nxlg, nxrg
118!                DO  j = nysg, nyng
119!                   DO  k = nzb, nzt
120!                      u2(k,j,i) = u(k,j,i)**2
121!                   ENDDO
122!                ENDDO
123!             ENDDO
124!             DO  i = nxlg, nxr
125!                DO  j = nysg, nyn
126!                   DO  k = nzb, nzt+1
127!                      ustvst(k,j,i) =  &
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) )
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
164             message_string = 'unknown location "' // location // '"'
165             CALL message( 'user_actions', 'UI0001', 1, 2, 0, 6, 0 )
166
167       END SELECT
168
169       CALL cpu_log( log_point(24), 'user_actions', 'stop' )
170
171    END SUBROUTINE user_actions
172
173
174!------------------------------------------------------------------------------!
175! Description:
176! ------------
177!> Call for grid point i,j
178!------------------------------------------------------------------------------!
179    SUBROUTINE user_actions_ij( i, j, location )
180
181       USE control_parameters
182       USE kinds
183       USE pegrid
184       USE user
185
186       IMPLICIT NONE
187
188       CHARACTER (LEN=*) ::  location
189
190       INTEGER(iwp) ::  i
191       INTEGER(iwp) ::  idum
192       INTEGER(iwp) ::  j
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' )
222             message_string = 'location "' // location // '" is not ' // &
223                             'allowed to be called with parameters "i" and "j"'
224             CALL message( 'user_actions', 'UI0002', 1, 2, 0, 6, 0 )
225
226
227          CASE DEFAULT
228             message_string = 'unknown location "' // location // '"'
229             CALL message( 'user_actions', 'UI0001', 1, 2, 0, 6, 0 )
230             
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.