[1] | 1 | MODULE advec_u_pw_mod |
---|
| 2 | |
---|
| 3 | !------------------------------------------------------------------------------! |
---|
[484] | 4 | ! Current revisions: |
---|
[1] | 5 | ! ----------------- |
---|
[110] | 6 | ! |
---|
[1] | 7 | ! |
---|
| 8 | ! Former revisions: |
---|
| 9 | ! ----------------- |
---|
[3] | 10 | ! $Id: advec_u_pw.f90 484 2010-02-05 07:36:54Z hoffmann $ |
---|
[77] | 11 | ! |
---|
[110] | 12 | ! 106 2007-08-16 14:30:26Z raasch |
---|
| 13 | ! i loop is starting from nxlu (needed for non-cyclic boundary conditions) |
---|
| 14 | ! |
---|
[77] | 15 | ! 75 2007-03-22 09:54:05Z raasch |
---|
| 16 | ! uxrp eliminated |
---|
| 17 | ! |
---|
[3] | 18 | ! RCS Log replace by Id keyword, revision history cleaned up |
---|
| 19 | ! |
---|
[1] | 20 | ! Revision 1.15 2006/02/23 09:44:21 raasch |
---|
| 21 | ! nzb_2d replaced by nzb_u_inner |
---|
| 22 | ! |
---|
| 23 | ! Revision 1.1 1997/08/11 06:09:21 raasch |
---|
| 24 | ! Initial revision |
---|
| 25 | ! |
---|
| 26 | ! |
---|
| 27 | ! Description: |
---|
| 28 | ! ------------ |
---|
| 29 | ! Advection term for u velocity-component using Piacsek and Williams. |
---|
| 30 | ! Vertical advection at the first grid point above the surface is done with |
---|
| 31 | ! normal centred differences, because otherwise no information from the surface |
---|
| 32 | ! would be communicated upwards due to w=0 at K=nzb. |
---|
| 33 | !------------------------------------------------------------------------------! |
---|
| 34 | |
---|
| 35 | PRIVATE |
---|
| 36 | PUBLIC advec_u_pw |
---|
| 37 | |
---|
| 38 | INTERFACE advec_u_pw |
---|
| 39 | MODULE PROCEDURE advec_u_pw |
---|
| 40 | MODULE PROCEDURE advec_u_pw_ij |
---|
| 41 | END INTERFACE advec_u_pw |
---|
| 42 | |
---|
| 43 | CONTAINS |
---|
| 44 | |
---|
| 45 | |
---|
| 46 | !------------------------------------------------------------------------------! |
---|
| 47 | ! Call for all grid points |
---|
| 48 | !------------------------------------------------------------------------------! |
---|
| 49 | SUBROUTINE advec_u_pw |
---|
| 50 | |
---|
| 51 | USE arrays_3d |
---|
| 52 | USE control_parameters |
---|
| 53 | USE grid_variables |
---|
| 54 | USE indices |
---|
| 55 | |
---|
| 56 | IMPLICIT NONE |
---|
| 57 | |
---|
| 58 | INTEGER :: i, j, k |
---|
| 59 | REAL :: gu, gv |
---|
| 60 | |
---|
| 61 | gu = 2.0 * u_gtrans |
---|
| 62 | gv = 2.0 * v_gtrans |
---|
[106] | 63 | DO i = nxlu, nxr |
---|
[1] | 64 | DO j = nys, nyn |
---|
| 65 | DO k = nzb_u_inner(j,i)+1, nzt |
---|
| 66 | tend(k,j,i) = tend(k,j,i) - 0.25 * ( & |
---|
| 67 | ( u(k,j,i+1) * ( u(k,j,i+1) + u(k,j,i) - gu ) & |
---|
| 68 | - u(k,j,i-1) * ( u(k,j,i) + u(k,j,i-1) - gu ) ) * ddx & |
---|
| 69 | + ( u(k,j+1,i) * ( v(k,j+1,i) + v(k,j+1,i-1) - gv ) & |
---|
| 70 | - u(k,j-1,i) * ( v(k,j,i) + v(k,j,i-1) - gv ) ) * ddy & |
---|
| 71 | + ( u(k+1,j,i) * ( w(k,j,i) + w(k,j,i-1) ) & |
---|
| 72 | - u(k-1,j,i) * ( w(k-1,j,i) + w(k-1,j,i-1) ) ) & |
---|
| 73 | * ddzw(k) & |
---|
| 74 | ) |
---|
| 75 | ENDDO |
---|
| 76 | ENDDO |
---|
| 77 | ENDDO |
---|
| 78 | |
---|
| 79 | END SUBROUTINE advec_u_pw |
---|
| 80 | |
---|
| 81 | |
---|
| 82 | !------------------------------------------------------------------------------! |
---|
| 83 | ! Call for grid point i,j |
---|
| 84 | !------------------------------------------------------------------------------! |
---|
| 85 | SUBROUTINE advec_u_pw_ij( i, j ) |
---|
| 86 | |
---|
| 87 | USE arrays_3d |
---|
| 88 | USE control_parameters |
---|
| 89 | USE grid_variables |
---|
| 90 | USE indices |
---|
| 91 | |
---|
| 92 | IMPLICIT NONE |
---|
| 93 | |
---|
| 94 | INTEGER :: i, j, k |
---|
| 95 | REAL :: gu, gv |
---|
| 96 | |
---|
| 97 | gu = 2.0 * u_gtrans |
---|
| 98 | gv = 2.0 * v_gtrans |
---|
| 99 | DO k = nzb_u_inner(j,i)+1, nzt |
---|
| 100 | tend(k,j,i) = tend(k,j,i) - 0.25 * ( & |
---|
| 101 | ( u(k,j,i+1) * ( u(k,j,i+1) + u(k,j,i) - gu ) & |
---|
| 102 | - u(k,j,i-1) * ( u(k,j,i) + u(k,j,i-1) - gu ) ) * ddx & |
---|
| 103 | + ( u(k,j+1,i) * ( v(k,j+1,i) + v(k,j+1,i-1) - gv ) & |
---|
| 104 | - u(k,j-1,i) * ( v(k,j,i) + v(k,j,i-1) - gv ) ) * ddy & |
---|
| 105 | + ( u(k+1,j,i) * ( w(k,j,i) + w(k,j,i-1) ) & |
---|
| 106 | - u(k-1,j,i) * ( w(k-1,j,i) + w(k-1,j,i-1) ) ) & |
---|
| 107 | * ddzw(k) & |
---|
| 108 | ) |
---|
| 109 | ENDDO |
---|
| 110 | |
---|
| 111 | END SUBROUTINE advec_u_pw_ij |
---|
| 112 | |
---|
| 113 | END MODULE advec_u_pw_mod |
---|