[1] | 1 | MODULE advec_v_up_mod |
---|
| 2 | |
---|
| 3 | !------------------------------------------------------------------------------! |
---|
| 4 | ! Actual revisions: |
---|
| 5 | ! ----------------- |
---|
| 6 | ! |
---|
| 7 | ! |
---|
| 8 | ! Former revisions: |
---|
| 9 | ! ----------------- |
---|
[3] | 10 | ! $Id: advec_v_up.f90 4 2007-02-13 11:33:16Z raasch $ |
---|
| 11 | ! RCS Log replace by Id keyword, revision history cleaned up |
---|
| 12 | ! |
---|
[1] | 13 | ! Revision 1.12 2006/02/23 09:46:37 raasch |
---|
| 14 | ! nzb_2d replaced by nzb_v_inner |
---|
| 15 | ! |
---|
| 16 | ! Revision 1.1 1997/08/29 08:56:05 raasch |
---|
| 17 | ! Initial revision |
---|
| 18 | ! |
---|
| 19 | ! |
---|
| 20 | ! Description: |
---|
| 21 | ! ------------ |
---|
| 22 | ! Advection term for the v velocity-component using upstream scheme. |
---|
| 23 | ! NOTE: vertical advection at k=1 still has wrong grid spacing for w>0! |
---|
| 24 | ! The same problem occurs for all topography boundaries! |
---|
| 25 | !------------------------------------------------------------------------------! |
---|
| 26 | |
---|
| 27 | PRIVATE |
---|
| 28 | PUBLIC advec_v_up |
---|
| 29 | |
---|
| 30 | INTERFACE advec_v_up |
---|
| 31 | MODULE PROCEDURE advec_v_up |
---|
| 32 | MODULE PROCEDURE advec_v_up_ij |
---|
| 33 | END INTERFACE advec_v_up |
---|
| 34 | |
---|
| 35 | CONTAINS |
---|
| 36 | |
---|
| 37 | |
---|
| 38 | !------------------------------------------------------------------------------! |
---|
| 39 | ! Call for all grid points |
---|
| 40 | !------------------------------------------------------------------------------! |
---|
| 41 | SUBROUTINE advec_v_up |
---|
| 42 | |
---|
| 43 | USE arrays_3d |
---|
| 44 | USE control_parameters |
---|
| 45 | USE grid_variables |
---|
| 46 | USE indices |
---|
| 47 | |
---|
| 48 | IMPLICIT NONE |
---|
| 49 | |
---|
| 50 | INTEGER :: i, j, k |
---|
| 51 | REAL :: ukomp, vkomp, wkomp |
---|
| 52 | |
---|
| 53 | |
---|
| 54 | DO i = nxl, nxr |
---|
| 55 | DO j = nys, nyn+vynp |
---|
| 56 | DO k = nzb_v_inner(j,i)+1, nzt |
---|
| 57 | ! |
---|
| 58 | !-- x-direction |
---|
| 59 | ukomp = 0.25 * ( u(k,j,i) + u(k,j-1,i) + & |
---|
| 60 | u(k,j,i+1) + u(k,j-1,i+1) ) - u_gtrans |
---|
| 61 | IF ( ukomp > 0.0 ) THEN |
---|
| 62 | tend(k,j,i) = tend(k,j,i) - ukomp * & |
---|
| 63 | ( v(k,j,i) - v(k,j,i-1) ) * ddx |
---|
| 64 | ELSE |
---|
| 65 | tend(k,j,i) = tend(k,j,i) - ukomp * & |
---|
| 66 | ( v(k,j,i+1) - v(k,j,i) ) * ddx |
---|
| 67 | ENDIF |
---|
| 68 | ! |
---|
| 69 | !-- y-direction |
---|
| 70 | vkomp = v(k,j,i) - v_gtrans |
---|
| 71 | IF ( vkomp > 0.0 ) THEN |
---|
| 72 | tend(k,j,i) = tend(k,j,i) - vkomp * & |
---|
| 73 | ( v(k,j,i) - v(k,j-1,i) ) * ddy |
---|
| 74 | ELSE |
---|
| 75 | tend(k,j,i) = tend(k,j,i) - vkomp * & |
---|
| 76 | ( v(k,j+1,i) - v(k,j,i) ) * ddy |
---|
| 77 | ENDIF |
---|
| 78 | ! |
---|
| 79 | !-- z-direction |
---|
| 80 | wkomp = 0.25 * ( w(k,j,i) + w(k-1,j,i) + & |
---|
| 81 | w(k,j-1,i) + w(k-1,j-1,i) ) |
---|
| 82 | IF ( wkomp > 0.0 ) THEN |
---|
| 83 | tend(k,j,i) = tend(k,j,i) - wkomp * & |
---|
| 84 | ( v(k,j,i) - v(k-1,j,i) ) * ddzu(k) |
---|
| 85 | ELSE |
---|
| 86 | tend(k,j,i) = tend(k,j,i) - wkomp * & |
---|
| 87 | ( v(k+1,j,i) - v(k,j,i) ) * ddzu(k+1) |
---|
| 88 | ENDIF |
---|
| 89 | |
---|
| 90 | ENDDO |
---|
| 91 | ENDDO |
---|
| 92 | ENDDO |
---|
| 93 | |
---|
| 94 | END SUBROUTINE advec_v_up |
---|
| 95 | |
---|
| 96 | |
---|
| 97 | !------------------------------------------------------------------------------! |
---|
| 98 | ! Call for grid point i,j |
---|
| 99 | !------------------------------------------------------------------------------! |
---|
| 100 | SUBROUTINE advec_v_up_ij( i, j ) |
---|
| 101 | |
---|
| 102 | USE arrays_3d |
---|
| 103 | USE control_parameters |
---|
| 104 | USE grid_variables |
---|
| 105 | USE indices |
---|
| 106 | |
---|
| 107 | IMPLICIT NONE |
---|
| 108 | |
---|
| 109 | INTEGER :: i, j, k |
---|
| 110 | |
---|
| 111 | REAL :: ukomp, vkomp, wkomp |
---|
| 112 | |
---|
| 113 | |
---|
| 114 | DO k = nzb_v_inner(j,i)+1, nzt |
---|
| 115 | ! |
---|
| 116 | !-- x-direction |
---|
| 117 | ukomp = 0.25 * ( u(k,j,i) + u(k,j-1,i) + u(k,j,i+1) + u(k,j-1,i+1) & |
---|
| 118 | ) - u_gtrans |
---|
| 119 | IF ( ukomp > 0.0 ) THEN |
---|
| 120 | tend(k,j,i) = tend(k,j,i) - ukomp * & |
---|
| 121 | ( v(k,j,i) - v(k,j,i-1) ) * ddx |
---|
| 122 | ELSE |
---|
| 123 | tend(k,j,i) = tend(k,j,i) - ukomp * & |
---|
| 124 | ( v(k,j,i+1) - v(k,j,i) ) * ddx |
---|
| 125 | ENDIF |
---|
| 126 | ! |
---|
| 127 | !-- y-direction |
---|
| 128 | vkomp = v(k,j,i) - v_gtrans |
---|
| 129 | IF ( vkomp > 0.0 ) THEN |
---|
| 130 | tend(k,j,i) = tend(k,j,i) - vkomp * & |
---|
| 131 | ( v(k,j,i) - v(k,j-1,i) ) * ddy |
---|
| 132 | ELSE |
---|
| 133 | tend(k,j,i) = tend(k,j,i) - vkomp * & |
---|
| 134 | ( v(k,j+1,i) - v(k,j,i) ) * ddy |
---|
| 135 | ENDIF |
---|
| 136 | ! |
---|
| 137 | !-- z-direction |
---|
| 138 | wkomp = 0.25 * ( w(k,j,i) + w(k-1,j,i) + w(k,j-1,i) + w(k-1,j-1,i) ) |
---|
| 139 | IF ( wkomp > 0.0 ) THEN |
---|
| 140 | tend(k,j,i) = tend(k,j,i) - wkomp * & |
---|
| 141 | ( v(k,j,i) - v(k-1,j,i) ) * ddzu(k) |
---|
| 142 | ELSE |
---|
| 143 | tend(k,j,i) = tend(k,j,i) - wkomp * & |
---|
| 144 | ( v(k+1,j,i) - v(k,j,i) ) * ddzu(k+1) |
---|
| 145 | ENDIF |
---|
| 146 | |
---|
| 147 | ENDDO |
---|
| 148 | |
---|
| 149 | END SUBROUTINE advec_v_up_ij |
---|
| 150 | |
---|
| 151 | END MODULE advec_v_up_mod |
---|