MODULE advec_u_pw_mod !------------------------------------------------------------------------------! ! Actual revisions: ! ----------------- ! ! ! Former revisions: ! ----------------- ! $Log: advec_u_pw.f90,v $ ! Revision 1.15 2006/02/23 09:44:21 raasch ! nzb_2d replaced by nzb_u_inner ! ! Revision 1.14 2005/03/26 14:49:31 raasch ! Extension of horizontal loop upper bounds for non-cyclic boundary conditions ! ! Revision 1.13 2004/01/30 10:11:21 raasch ! Scalar lower k index nzb replaced by 2d-array nzb_2d ! ! Revision 1.12 2003/03/12 16:17:06 raasch ! Full code replaced in the call for all gridpoints instead of calling the ! _ij version (required by NEC, because otherwise no vectorization) ! ! Revision 1.11 2002/06/11 12:25:00 raasch ! Former subroutine changed to a module which allows to be called for all grid ! points of a single vertical column with index i,j or for all grid points by ! using function overloading. ! ! Revision 1.10 2001/03/29 17:34:21 raasch ! Translation of remaining German identifiers (variables, subroutines, etc.) ! ! Revision 1.9 2001/01/22 04:55:36 raasch ! Module test_variables removed ! ! Revision 1.8 2000/01/20 09:34:26 letzel ! All comments translated into English ! ! Revision 1.7 1998/08/05 06:47:04 raasch ! Alle Gitterpunkte gleich behandelt (keine zentralen Differenzenquotienten ! mehr bei Vertikaladvektion bei k=1) ! ! Revision 1.1 1997/08/11 06:09:21 raasch ! Initial revision ! ! ! Description: ! ------------ ! Advection term for u velocity-component using Piacsek and Williams. ! Vertical advection at the first grid point above the surface is done with ! normal centred differences, because otherwise no information from the surface ! would be communicated upwards due to w=0 at K=nzb. !------------------------------------------------------------------------------! PRIVATE PUBLIC advec_u_pw INTERFACE advec_u_pw MODULE PROCEDURE advec_u_pw MODULE PROCEDURE advec_u_pw_ij END INTERFACE advec_u_pw CONTAINS !------------------------------------------------------------------------------! ! Call for all grid points !------------------------------------------------------------------------------! SUBROUTINE advec_u_pw USE arrays_3d USE control_parameters USE grid_variables USE indices IMPLICIT NONE INTEGER :: i, j, k REAL :: gu, gv gu = 2.0 * u_gtrans gv = 2.0 * v_gtrans DO i = nxl, nxr+uxrp DO j = nys, nyn DO k = nzb_u_inner(j,i)+1, nzt tend(k,j,i) = tend(k,j,i) - 0.25 * ( & ( u(k,j,i+1) * ( u(k,j,i+1) + u(k,j,i) - gu ) & - u(k,j,i-1) * ( u(k,j,i) + u(k,j,i-1) - gu ) ) * ddx & + ( u(k,j+1,i) * ( v(k,j+1,i) + v(k,j+1,i-1) - gv ) & - u(k,j-1,i) * ( v(k,j,i) + v(k,j,i-1) - gv ) ) * ddy & + ( u(k+1,j,i) * ( w(k,j,i) + w(k,j,i-1) ) & - u(k-1,j,i) * ( w(k-1,j,i) + w(k-1,j,i-1) ) ) & * ddzw(k) & ) ENDDO ENDDO ENDDO END SUBROUTINE advec_u_pw !------------------------------------------------------------------------------! ! Call for grid point i,j !------------------------------------------------------------------------------! SUBROUTINE advec_u_pw_ij( i, j ) USE arrays_3d USE control_parameters USE grid_variables USE indices IMPLICIT NONE INTEGER :: i, j, k REAL :: gu, gv gu = 2.0 * u_gtrans gv = 2.0 * v_gtrans DO k = nzb_u_inner(j,i)+1, nzt tend(k,j,i) = tend(k,j,i) - 0.25 * ( & ( u(k,j,i+1) * ( u(k,j,i+1) + u(k,j,i) - gu ) & - u(k,j,i-1) * ( u(k,j,i) + u(k,j,i-1) - gu ) ) * ddx & + ( u(k,j+1,i) * ( v(k,j+1,i) + v(k,j+1,i-1) - gv ) & - u(k,j-1,i) * ( v(k,j,i) + v(k,j,i-1) - gv ) ) * ddy & + ( u(k+1,j,i) * ( w(k,j,i) + w(k,j,i-1) ) & - u(k-1,j,i) * ( w(k-1,j,i) + w(k-1,j,i-1) ) ) & * ddzw(k) & ) ENDDO END SUBROUTINE advec_u_pw_ij END MODULE advec_u_pw_mod