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

Last change on this file since 1053 was 1053, checked in by hoffmann, 11 years ago

two-moment cloud physics implemented

  • Property svn:keywords set to Id
File size: 5.4 KB
Line 
1 MODULE user_actions_mod
2
3!--------------------------------------------------------------------------------!
4! This file is part of PALM.
5!
6! PALM is free software: you can redistribute it and/or modify it under the terms
7! of the GNU General Public License as published by the Free Software Foundation,
8! either version 3 of the License, or (at your option) any later 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-2012  Leibniz University Hannover
18!--------------------------------------------------------------------------------!
19!
20! Current revisions:
21! -----------------
22! +qr-tendency, nr-tendency
23!
24! Former revisions:
25! -----------------
26! $Id: user_actions.f90 1053 2012-11-13 17:11:03Z hoffmann $
27!
28! 1036 2012-10-22 13:43:42Z raasch
29! code put under GPL (PALM 3.9)
30!
31! 667 2010-12-23 12:06:00Z suehring/gryschka
32! nxl-1, nxr+1, nys-1, nyn+1 replaced by nxlg, nxrg, nysg, nyng
33!
34! 258 2009-03-13 12:36:03Z heinze
35! Output of messages replaced by message handling routine.
36!
37! 211 2008-11-11 04:46:24Z raasch
38! Former file user_interface.f90 split into one file per subroutine
39!
40! Description:
41! ------------
42! Execution of user-defined actions before or after single timesteps
43!------------------------------------------------------------------------------!
44
45    PRIVATE
46    PUBLIC user_actions
47
48    INTERFACE user_actions
49       MODULE PROCEDURE user_actions
50       MODULE PROCEDURE user_actions_ij
51    END INTERFACE user_actions
52
53 CONTAINS
54
55
56!------------------------------------------------------------------------------!
57! Call for all grid points
58!------------------------------------------------------------------------------!
59    SUBROUTINE user_actions( location )
60
61       USE control_parameters
62       USE cpulog
63       USE indices
64       USE interfaces
65       USE pegrid
66       USE user
67       USE arrays_3d
68
69       IMPLICIT NONE
70
71       CHARACTER (LEN=*) ::  location
72
73       INTEGER ::  i, j, k
74
75       CALL cpu_log( log_point(24), 'user_actions', 'start' )
76
77!
78!--    Here the user-defined actions follow
79!--    No calls for single grid points are allowed at locations before and
80!--    after the timestep, since these calls are not within an i,j-loop
81       SELECT CASE ( location )
82
83          CASE ( 'before_timestep' )
84!
85!--          Enter actions to be done before every timestep here
86
87
88          CASE ( 'after_integration' )
89!
90!--          Enter actions to be done after every time integration (before
91!--          data output)
92!--          Sample for user-defined output:
93!             DO  i = nxlg, nxrg
94!                DO  j = nysg, nyng
95!                   DO  k = nzb, nzt
96!                      u2(k,j,i) = u(k,j,i)**2
97!                   ENDDO
98!                ENDDO
99!             ENDDO
100!             DO  i = nxlg, nxr
101!                DO  j = nysg, nyn
102!                   DO  k = nzb, nzt+1
103!                      ustvst(k,j,i) =  &
104!                         ( 0.5 * ( u(k,j,i) + u(k,j,i+1) ) - hom(k,1,1,0) ) * &
105!                         ( 0.5 * ( v(k,j,i) + v(k,j+1,i) ) - hom(k,1,2,0) )
106!                   ENDDO
107!                ENDDO
108!             ENDDO
109
110
111          CASE ( 'after_timestep' )
112!
113!--          Enter actions to be done after every timestep here
114
115
116          CASE ( 'u-tendency' )
117!
118!--          Enter actions to be done in the u-tendency term here
119
120
121          CASE ( 'v-tendency' )
122
123
124          CASE ( 'w-tendency' )
125
126
127          CASE ( 'pt-tendency' )
128
129
130          CASE ( 'sa-tendency' )
131
132
133          CASE ( 'e-tendency' )
134
135
136          CASE ( 'q-tendency' )
137
138
139          CASE ( 'qr-tendency' )
140
141
142          CASE ( 'nr-tendency' )
143
144
145          CASE DEFAULT
146             message_string = 'unknown location "' // location // '"'
147             CALL message( 'user_actions', 'UI0001', 1, 2, 0, 6, 0 )
148
149       END SELECT
150
151       CALL cpu_log( log_point(24), 'user_actions', 'stop' )
152
153    END SUBROUTINE user_actions
154
155
156!------------------------------------------------------------------------------!
157! Call for grid point i,j
158!------------------------------------------------------------------------------!
159    SUBROUTINE user_actions_ij( i, j, location )
160
161       USE control_parameters
162       USE pegrid
163       USE user
164
165       IMPLICIT NONE
166
167       CHARACTER (LEN=*) ::  location
168
169       INTEGER ::  i, idum, j
170
171
172!
173!--    Here the user-defined actions follow
174       SELECT CASE ( location )
175
176          CASE ( 'u-tendency' )
177!
178!--          Enter actions to be done in the u-tendency term here
179
180
181          CASE ( 'v-tendency' )
182
183
184          CASE ( 'w-tendency' )
185
186
187          CASE ( 'pt-tendency' )
188
189
190          CASE ( 'sa-tendency' )
191
192
193          CASE ( 'e-tendency' )
194
195
196          CASE ( 'q-tendency' )
197
198
199          CASE ( 'qr-tendency' )
200
201
202          CASE ( 'nr-tendency' )
203
204
205          CASE ( 'before_timestep', 'after_integration', 'after_timestep' )
206             message_string = 'location "' // location // '" is not ' // &
207                             'allowed to be called with parameters "i" and "j"'
208             CALL message( 'user_actions', 'UI0002', 1, 2, 0, 6, 0 )
209
210
211          CASE DEFAULT
212             message_string = 'unknown location "' // location // '"'
213             CALL message( 'user_actions', 'UI0001', 1, 2, 0, 6, 0 )
214             
215
216       END SELECT
217
218    END SUBROUTINE user_actions_ij
219
220 END MODULE user_actions_mod
Note: See TracBrowser for help on using the repository browser.