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

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

New:
---

GPU porting of pres, swap_timelevel. Adjustments of openACC directives.
Further porting of poisfft, which now runs completely on GPU without any
host/device data transfer for serial an parallel runs (but parallel runs
require data transfer before and after the MPI transpositions).
GPU-porting of tridiagonal solver:
tridiagonal routines split into extermal subroutines (instead using CONTAINS),
no distinction between parallel/non-parallel in poisfft and tridia any more,
tridia routines moved to end of file because of probable bug in PGI compiler
(otherwise "invalid device function" is indicated during runtime).
(cuda_fft_interfaces, fft_xy, flow_statistics, init_3d_model, palm, poisfft, pres, prognostic_equations, swap_timelevel, time_integration, transpose)
output of accelerator board information. (header)

optimization of tridia routines: constant elements and coefficients of tri are
stored in seperate arrays ddzuw and tric, last dimension of tri reduced from 5 to 2,
(init_grid, init_3d_model, modules, palm, poisfft)

poisfft_init is now called internally from poisfft,
(Makefile, Makefile_check, init_pegrid, poisfft, poisfft_hybrid)

CPU-time per grid point and timestep is output to CPU_MEASURES file
(cpu_statistics, modules, time_integration)

Changed:


resorting from/to array work changed, work now has 4 dimensions instead of 1 (transpose)
array diss allocated only if required (init_3d_model)

pressure boundary condition "Neumann+inhomo" removed from the code
(check_parameters, header, poisfft, poisfft_hybrid, pres)

Errors:


bugfix: dependency added for cuda_fft_interfaces (Makefile)
bugfix: CUDA fft plans adjusted for domain decomposition (before they always
used total domain) (fft_xy)

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