FV3 Bundle
pv_operator.f90
Go to the documentation of this file.
1 ! (C) Copyright 2009-2016 ECMWF.
2 !
3 ! This software is licensed under the terms of the Apache Licence Version 2.0
4 ! which can be obtained at http://www.apache.org/licenses/LICENSE-2.0.
5 ! In applying this licence, ECMWF does not waive the privileges and immunities
6 ! granted to it by virtue of its status as an intergovernmental organisation nor
7 ! does it submit to any jurisdiction.
8 
9 !> Potential vorticity operator
10 
11 !> Applies the linear operator part of the PV calculation:
12 !! \f{eqnarray*}{
13 !! q_1 &=& \nabla^2 \psi_1 - F_1 (\psi_1 -\psi_2 ) \\\\
14 !! q_2 &=& \nabla^2 \psi_2 - F_2 (\psi_2 -\psi_1 )
15 !! \f}
16 !!
17 !! (Note: The full potential vorticity calculation is done in calc_pv, and
18 !! includes additional beta and orography terms.)
19 
20 subroutine pv_operator (x,pv,nx,ny,F1,F2,deltax,deltay)
21 
22 !--- The part of the pv calculation that acts on internal streamfunction.
23 
24 use kinds
25 
26 implicit none
27 integer, intent(in) :: nx !< Zonal grid dimension
28 integer, intent(in) :: ny !< Meridional grid dimension
29 real(kind=kind_real), intent(in) :: x(nx,ny,2) !< Streamfunction
30 real(kind=kind_real), intent(out) :: pv(nx,ny,2) !< Result of applying the operator to x
31 real(kind=kind_real), intent(in) :: F1 !< Parameter in the PV operator
32 real(kind=kind_real), intent(in) :: F2 !< Parameter in the PV operator
33 real(kind=kind_real), intent(in) :: deltax !< Zonal grid spacing (non-dimensional)
34 real(kind=kind_real), intent(in) :: deltay !< Meridional grid spacing (non-dimensional)
35 
36 !--- del-squared of the streamfunction
37 
38 call laplacian_2d (x(:,:,1),pv(:,:,1),nx,ny,deltax,deltay)
39 call laplacian_2d (x(:,:,2),pv(:,:,2),nx,ny,deltax,deltay)
40 
41 !--- vertical differences:
42 
43 pv(:,:,1) = pv(:,:,1) -f1*(x(:,:,1)-x(:,:,2))
44 pv(:,:,2) = pv(:,:,2) -f2*(x(:,:,2)-x(:,:,1))
45 
46 end subroutine pv_operator
subroutine pv_operator(x, pv, nx, ny, F1, F2, deltax, deltay)
Potential vorticity operator.
Definition: pv_operator.f90:21
subroutine laplacian_2d(x, del2x, nx, ny, deltax, deltay)
Horizontal Laplacian operator.