MODULE advec_v_pw_mod !--------------------------------------------------------------------------------! ! This file is part of PALM. ! ! PALM is free software: you can redistribute it and/or modify it under the terms ! of the GNU General Public License as published by the Free Software Foundation, ! either version 3 of the License, or (at your option) any later version. ! ! PALM is distributed in the hope that it will be useful, but WITHOUT ANY ! WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR ! A PARTICULAR PURPOSE. See the GNU General Public License for more details. ! ! You should have received a copy of the GNU General Public License along with ! PALM. If not, see . ! ! Copyright 1997-2012 Leibniz University Hannover !--------------------------------------------------------------------------------! ! ! Current revisions: ! ----------------- ! ! ! Former revisions: ! ----------------- ! $Id: advec_v_pw.f90 1037 2012-10-22 14:10:22Z gryschka $ ! ! 1036 2012-10-22 13:43:42Z raasch ! code put under GPL (PALM 3.9) ! ! 106 2007-08-16 14:30:26Z raasch ! j loop is starting from nysv (needed for non-cyclic boundary conditions) ! ! 75 2007-03-22 09:54:05Z raasch ! vynp eliminated ! ! RCS Log replace by Id keyword, revision history cleaned up ! ! Revision 1.15 2006/02/23 09:46:08 raasch ! nzb_2d replaced by nzb_v_inner ! ! Revision 1.1 1997/08/11 06:09:57 raasch ! Initial revision ! ! ! Description: ! ------------ ! Advection term for v 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_v_pw INTERFACE advec_v_pw MODULE PROCEDURE advec_v_pw MODULE PROCEDURE advec_v_pw_ij END INTERFACE advec_v_pw CONTAINS !------------------------------------------------------------------------------! ! Call for all grid points !------------------------------------------------------------------------------! SUBROUTINE advec_v_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 = nysv, nyn DO k = nzb_v_inner(j,i)+1, nzt tend(k,j,i) = tend(k,j,i) - 0.25 * ( & ( v(k,j,i+1) * ( u(k,j-1,i+1) + u(k,j,i+1) - gu ) & - v(k,j,i-1) * ( u(k,j-1,i) + u(k,j,i) - gu ) ) * ddx & + ( v(k,j+1,i) * ( v(k,j+1,i) + v(k,j,i) - gv ) & - v(k,j-1,i) * ( v(k,j,i) + v(k,j-1,i) - gv ) ) * ddy & + ( v(k+1,j,i) * ( w(k,j-1,i) + w(k,j,i) ) & - v(k-1,j,i) * ( w(k-1,j-1,i) + w(k-1,j,i) ) ) & * ddzw(k) & ) ENDDO ENDDO ENDDO END SUBROUTINE advec_v_pw !------------------------------------------------------------------------------! ! Call for grid point i,j !------------------------------------------------------------------------------! SUBROUTINE advec_v_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_v_inner(j,i)+1, nzt tend(k,j,i) = tend(k,j,i) - 0.25 * ( & ( v(k,j,i+1) * ( u(k,j-1,i+1) + u(k,j,i+1) - gu ) & - v(k,j,i-1) * ( u(k,j-1,i) + u(k,j,i) - gu ) ) * ddx & + ( v(k,j+1,i) * ( v(k,j+1,i) + v(k,j,i) - gv ) & - v(k,j-1,i) * ( v(k,j,i) + v(k,j-1,i) - gv ) ) * ddy & + ( v(k+1,j,i) * ( w(k,j-1,i) + w(k,j,i) ) & - v(k-1,j,i) * ( w(k-1,j-1,i) + w(k-1,j,i) ) ) & * ddzw(k) & ) ENDDO END SUBROUTINE advec_v_pw_ij END MODULE advec_v_pw_mod