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

Last change on this file since 858 was 668, checked in by suehring, 14 years ago

last commit documented

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