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