MODULE advec_w_pw_mod !------------------------------------------------------------------------------! ! Current revisions: ! ----------------- ! ! ! Former revisions: ! ----------------- ! $Id: advec_w_pw.f90 667 2010-12-23 12:06:00Z witha $ ! RCS Log replace by Id keyword, revision history cleaned up ! ! Revision 1.15 2006/02/23 09:47:01 raasch ! nzb_2d replaced by nzb_w_inner ! ! Revision 1.1 1997/08/11 06:10:29 raasch ! Initial revision ! ! ! Description: ! ------------ ! Advection term for w 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_w_pw INTERFACE advec_w_pw MODULE PROCEDURE advec_w_pw MODULE PROCEDURE advec_w_pw_ij END INTERFACE advec_w_pw CONTAINS !------------------------------------------------------------------------------! ! Call for all grid points !------------------------------------------------------------------------------! SUBROUTINE advec_w_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 DO j = nys, nyn DO k = nzb_w_inner(j,i)+1, nzt tend(k,j,i) = tend(k,j,i) - 0.25 * ( & ( w(k,j,i+1) * ( u(k+1,j,i+1) + u(k,j,i+1) - gu ) & - w(k,j,i-1) * ( u(k+1,j,i) + u(k,j,i) - gu ) ) * ddx & + ( w(k,j+1,i) * ( v(k+1,j+1,i) + v(k,j+1,i) - gv ) & - w(k,j-1,i) * ( v(k+1,j,i) + v(k,j,i) - gv ) ) * ddy & + ( w(k+1,j,i) * ( w(k+1,j,i) + w(k,j,i) ) & - w(k-1,j,i) * ( w(k,j,i) + w(k-1,j,i) ) ) & * ddzu(k+1) & ) ENDDO ENDDO ENDDO END SUBROUTINE advec_w_pw !------------------------------------------------------------------------------! ! Call for grid point i,j !------------------------------------------------------------------------------! SUBROUTINE advec_w_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_w_inner(j,i)+1, nzt tend(k,j,i) = tend(k,j,i) - 0.25 * ( & ( w(k,j,i+1) * ( u(k+1,j,i+1) + u(k,j,i+1) - gu ) & - w(k,j,i-1) * ( u(k+1,j,i) + u(k,j,i) - gu ) ) * ddx & + ( w(k,j+1,i) * ( v(k+1,j+1,i) + v(k,j+1,i) - gv ) & - w(k,j-1,i) * ( v(k+1,j,i) + v(k,j,i) - gv ) ) * ddy & + ( w(k+1,j,i) * ( w(k+1,j,i) + w(k,j,i) ) & - w(k-1,j,i) * ( w(k,j,i) + w(k-1,j,i) ) ) & * ddzu(k+1) & ) ENDDO END SUBROUTINE advec_w_pw_ij END MODULE advec_w_pw_mod