source: palm/trunk/SOURCE/swap_timelevel.f90 @ 1036

Last change on this file since 1036 was 1036, checked in by raasch, 11 years ago

code has been put under the GNU General Public License (v3)

  • Property svn:keywords set to Id
File size: 3.7 KB
Line 
1 SUBROUTINE swap_timelevel
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!
23!
24! Former revisions:
25! -----------------
26! $Id: swap_timelevel.f90 1036 2012-10-22 13:43:42Z raasch $
27!
28! 1032 2012-10-21 13:03:21Z letzel
29! save memory by not allocating pt_2 in case of neutral = .T.
30!
31! 1010 2012-09-20 07:59:54Z raasch
32! cpp switch __nopointer added for pointer free version
33!
34! 1001 2012-09-13 14:08:46Z raasch
35! all actions concerning leapfrog scheme removed
36!
37! 102 2007-07-27 09:09:17Z raasch
38! swaping of uswst, vswst included
39!
40! 95 2007-06-02 16:48:38Z raasch
41! Swaping of salinity
42!
43! 75 2007-03-22 09:54:05Z raasch
44! moisture renamed humidity
45!
46! 19 2007-02-23 04:53:48Z raasch
47! Swaping of top fluxes
48!
49! RCS Log replace by Id keyword, revision history cleaned up
50!
51! Revision 1.8  2004/01/28 15:28:18  raasch
52! Swaping for Runge-Kutta schemes implemented
53!
54! Revision 1.1  2000/01/10  10:08:58  10:08:58  raasch (Siegfried Raasch)
55! Initial revision
56!
57!
58! Description:
59! ------------
60! Swap of timelevels of variables after each timestep
61!------------------------------------------------------------------------------!
62
63    USE arrays_3d
64    USE cpulog
65    USE interfaces
66    USE control_parameters
67
68    IMPLICIT NONE
69
70!
71!-- Incrementing timestep counter
72    timestep_count = timestep_count + 1
73
74!
75!-- Swap of variables
76#if defined( __nopointer )
77    CALL cpu_log( log_point(28), 'swap_timelevel (nop)', 'start' )
78
79    u  = u_p
80    v  = v_p
81    w  = w_p
82    pt = pt_p
83    IF ( .NOT. constant_diffusion )  THEN
84       e = e_p
85    ENDIF
86    IF ( ocean )  THEN
87       sa = sa_p
88    ENDIF
89    IF ( humidity  .OR.  passive_scalar )  THEN
90       q = q_p
91    ENDIF
92
93    CALL cpu_log( log_point(28), 'swap_timelevel (nop)', 'stop' )
94#else
95    CALL cpu_log( log_point(28), 'swap_timelevel', 'start' )
96
97    SELECT CASE ( MOD( timestep_count, 2 ) )
98
99       CASE ( 0 )
100
101          u  => u_1;   u_p  => u_2
102          v  => v_1;   v_p  => v_2
103          w  => w_1;   w_p  => w_2
104          IF ( .NOT. neutral )  THEN
105             pt => pt_1;  pt_p => pt_2
106          ENDIF
107          IF ( .NOT. constant_diffusion )  THEN
108             e => e_1;    e_p => e_2
109          ENDIF
110          IF ( ocean )  THEN
111             sa => sa_1;  sa_p => sa_2
112          ENDIF
113          IF ( humidity  .OR.  passive_scalar )  THEN
114             q => q_1;    q_p => q_2
115          ENDIF
116
117
118       CASE ( 1 )
119
120          u  => u_2;   u_p  => u_1
121          v  => v_2;   v_p  => v_1
122          w  => w_2;   w_p  => w_1
123          IF ( .NOT. neutral )  THEN
124             pt => pt_2;  pt_p => pt_1
125          ENDIF
126          IF ( .NOT. constant_diffusion )  THEN
127             e => e_2;    e_p => e_1
128          ENDIF
129          IF ( ocean )  THEN
130             sa => sa_2;  sa_p => sa_1
131          ENDIF
132          IF ( humidity  .OR.  passive_scalar )  THEN
133             q => q_2;    q_p => q_1
134          ENDIF
135
136
137    END SELECT
138
139    CALL cpu_log( log_point(28), 'swap_timelevel', 'stop' )
140#endif
141
142 END SUBROUTINE swap_timelevel
143
144
Note: See TracBrowser for help on using the repository browser.