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

Last change on this file since 1873 was 1873, checked in by maronga, 8 years ago

revised renaming of modules

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