source: palm/trunk/SOURCE/user_actions.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: 6.3 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
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_actions.f90 2000 2016-08-20 18:09:15Z knoop $
27!
28! 1960 2016-07-12 16:34:24Z suehring
29! New CASE statement for scalar tendency
30!
31! 1873 2016-04-18 14:50:06Z maronga
32! Module renamed (removed _mod)
33!
34!
35! 1850 2016-04-08 13:29:27Z maronga
36! Module renamed
37!
38!
39! 1822 2016-04-07 07:49:42Z hoffmann
40! qr/nr-tendency removed.
41!
42! 1682 2015-10-07 23:56:08Z knoop
43! Code annotations made doxygen readable
44!
45! 1353 2014-04-08 15:21:23Z heinze
46! REAL constants provided with KIND-attribute
47!
48! 1320 2014-03-20 08:40:49Z raasch
49! kind-parameters added to all INTEGER and REAL declaration statements,
50! kinds are defined in new module kinds,
51! revision history before 2012 removed,
52! comment fields (!:) to be used for variable explanations added to
53! all variable declaration statements
54!
55! 1318 2014-03-17 13:35:16Z raasch
56! module interfaces removed
57!
58! 1053 2012-11-13 17:11:03Z hoffmann
59! +qr-tendency, nr-tendency
60!
61! 1036 2012-10-22 13:43:42Z raasch
62! code put under GPL (PALM 3.9)
63!
64! 211 2008-11-11 04:46:24Z raasch
65! Former file user_interface.f90 split into one file per subroutine
66!
67! Description:
68! ------------
69!> Execution of user-defined actions before or after single timesteps
70!------------------------------------------------------------------------------!
71 MODULE user_actions_mod
72 
73
74    PRIVATE
75    PUBLIC user_actions
76
77    INTERFACE user_actions
78       MODULE PROCEDURE user_actions
79       MODULE PROCEDURE user_actions_ij
80    END INTERFACE user_actions
81
82 CONTAINS
83
84
85!------------------------------------------------------------------------------!
86! Description:
87! ------------
88!> Call for all grid points
89!------------------------------------------------------------------------------!
90    SUBROUTINE user_actions( location )
91
92       USE control_parameters
93
94       USE cpulog
95
96       USE indices
97
98       USE kinds
99
100       USE pegrid
101
102       USE user
103
104       USE arrays_3d
105
106       IMPLICIT NONE
107
108       CHARACTER (LEN=*) ::  location !<
109
110       INTEGER(iwp) ::  i !<
111       INTEGER(iwp) ::  j !<
112       INTEGER(iwp) ::  k !<
113
114       CALL cpu_log( log_point(24), 'user_actions', 'start' )
115
116!
117!--    Here the user-defined actions follow
118!--    No calls for single grid points are allowed at locations before and
119!--    after the timestep, since these calls are not within an i,j-loop
120       SELECT CASE ( location )
121
122          CASE ( 'before_timestep' )
123!
124!--          Enter actions to be done before every timestep here
125
126
127          CASE ( 'after_integration' )
128!
129!--          Enter actions to be done after every time integration (before
130!--          data output)
131!--          Sample for user-defined output:
132!             DO  i = nxlg, nxrg
133!                DO  j = nysg, nyng
134!                   DO  k = nzb, nzt
135!                      u2(k,j,i) = u(k,j,i)**2
136!                   ENDDO
137!                ENDDO
138!             ENDDO
139!             DO  i = nxlg, nxr
140!                DO  j = nysg, nyn
141!                   DO  k = nzb, nzt+1
142!                      ustvst(k,j,i) =  &
143!                         ( 0.5_wp * ( u(k,j,i) + u(k,j,i+1) ) - hom(k,1,1,0) ) * &
144!                         ( 0.5_wp * ( v(k,j,i) + v(k,j+1,i) ) - hom(k,1,2,0) )
145!                   ENDDO
146!                ENDDO
147!             ENDDO
148
149
150          CASE ( 'after_timestep' )
151!
152!--          Enter actions to be done after every timestep here
153
154
155          CASE ( 'u-tendency' )
156!
157!--          Enter actions to be done in the u-tendency term here
158
159
160          CASE ( 'v-tendency' )
161
162
163          CASE ( 'w-tendency' )
164
165
166          CASE ( 'pt-tendency' )
167
168
169          CASE ( 'sa-tendency' )
170
171
172          CASE ( 'e-tendency' )
173
174
175          CASE ( 'q-tendency' )
176         
177         
178          CASE ( 's-tendency' )         
179
180
181          CASE DEFAULT
182             message_string = 'unknown location "' // location // '"'
183             CALL message( 'user_actions', 'UI0001', 1, 2, 0, 6, 0 )
184
185       END SELECT
186
187       CALL cpu_log( log_point(24), 'user_actions', 'stop' )
188
189    END SUBROUTINE user_actions
190
191
192!------------------------------------------------------------------------------!
193! Description:
194! ------------
195!> Call for grid point i,j
196!------------------------------------------------------------------------------!
197    SUBROUTINE user_actions_ij( i, j, location )
198
199       USE control_parameters
200       USE kinds
201       USE pegrid
202       USE user
203
204       IMPLICIT NONE
205
206       CHARACTER (LEN=*) ::  location
207
208       INTEGER(iwp) ::  i
209       INTEGER(iwp) ::  idum
210       INTEGER(iwp) ::  j
211
212!
213!--    Here the user-defined actions follow
214       SELECT CASE ( location )
215
216          CASE ( 'u-tendency' )
217!
218!--          Enter actions to be done in the u-tendency term here
219
220
221          CASE ( 'v-tendency' )
222
223
224          CASE ( 'w-tendency' )
225
226
227          CASE ( 'pt-tendency' )
228
229
230          CASE ( 'sa-tendency' )
231
232
233          CASE ( 'e-tendency' )
234
235
236          CASE ( 'q-tendency' )
237         
238         
239          CASE ( 's-tendency' )
240
241
242          CASE ( 'before_timestep', 'after_integration', 'after_timestep' )
243             message_string = 'location "' // location // '" is not ' // &
244                             'allowed to be called with parameters "i" and "j"'
245             CALL message( 'user_actions', 'UI0002', 1, 2, 0, 6, 0 )
246
247
248          CASE DEFAULT
249             message_string = 'unknown location "' // location // '"'
250             CALL message( 'user_actions', 'UI0001', 1, 2, 0, 6, 0 )
251             
252
253       END SELECT
254
255    END SUBROUTINE user_actions_ij
256
257 END MODULE user_actions_mod
Note: See TracBrowser for help on using the repository browser.