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