FV3 Bundle
zonal_wind_ad.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 !> Calculate zonal wind - Adjoint
10 
11 subroutine zonal_wind_ad (u,x,nx,ny,deltay)
12 
13 use kinds
14 implicit none
15 
16 integer, intent(in) :: nx !< Zonal grid dimension
17 integer, intent(in) :: ny !< Meridional grid dimension
18 real(kind=kind_real), intent(inout) :: u(nx,ny,2) !< Zonal wind adjoint variable
19 real(kind=kind_real), intent(inout) :: x(nx,ny,2) !< Streamfunction adjoint variable
20 real(kind=kind_real), intent(in) :: deltay !< Meridional grid spacing (non-dimensional)
21 
22 x(:,2:ny ,:) = x(:,2:ny ,:) - (0.5_kind_real/deltay)*u(:,1:ny-1,:)
23 x(:,1:ny-1,:) = x(:,1:ny-1,:) + (0.5_kind_real/deltay)*u(:,2:ny ,:)
24 u(:,:,:) = 0.0_kind_real
25 
26 end subroutine zonal_wind_ad
subroutine zonal_wind_ad(u, x, nx, ny, deltay)
Calculate zonal wind - Adjoint.