29 type(
qg_geom),
intent(in) :: geom
30 real(kind_real),
intent(in) :: q(geom%nx,geom%ny,geom%nz)
31 real(kind_real),
intent(in) :: x_north(geom%nz)
32 real(kind_real),
intent(in) :: x_south(geom%nz)
33 real(kind_real),
intent(inout) :: x(geom%nx,geom%ny,geom%nz)
37 real(kind_real) :: q_nobc(geom%nx,geom%ny,geom%nz),pinv_q(geom%nx,geom%ny,geom%nz),pinv_x(geom%nx,geom%ny,geom%nz)
43 q_nobc(:,iy,:) = q(:,iy,:)-geom%bet(iy)
44 q_nobc(:,iy,1) = q_nobc(:,iy,1)-geom%heat(:,iy)
49 zz = 1.0 / (geom%deltay * geom%deltay)
52 q_nobc(:,1,iz) = q_nobc(:,1,iz)-x_south(iz)*zz
53 q_nobc(:,geom%ny,iz) = q_nobc(:,geom%ny,iz)-x_north(iz)*zz
62 pinv_q(ix,iy,iz) = sum(geom%f_pinv(iz,:)*q_nobc(ix,iy,:))
70 call solve_helmholz(geom,geom%f_d(iz),pinv_q(:,:,iz),pinv_x(:,:,iz))
78 x(ix,iy,iz) = sum(geom%f_p(iz,:)*pinv_x(ix,iy,:))
92 type(
qg_geom),
intent(in) :: geom
93 real(kind_real),
intent(in) :: q(geom%nx,geom%ny,geom%nz)
94 real(kind_real),
intent(inout) :: x(geom%nx,geom%ny,geom%nz)
98 real(kind_real) :: pinv_q(geom%nx,geom%ny,geom%nz),pinv_x(geom%nx,geom%ny,geom%nz)
109 pinv_q(ix,iy,iz) = sum(geom%f_pinv(iz,:)*q(ix,iy,:))
117 call solve_helmholz(geom,geom%f_d(iz),pinv_q(:,:,iz),pinv_x(:,:,iz))
125 x(ix,iy,iz) = sum(geom%f_p(iz,:)*pinv_x(ix,iy,:))
139 type(
qg_geom),
intent(in) :: geom
140 real(kind_real),
intent(in) :: x(geom%nx,geom%ny,geom%nz)
141 real(kind_real),
intent(inout) :: q(geom%nx,geom%ny,geom%nz)
145 real(kind_real) :: pinv_q(geom%nx,geom%ny,geom%nz),pinv_x(geom%nx,geom%ny,geom%nz),qtmp(geom%nx,geom%ny,geom%nz)
152 pinv_x(ix,iy,iz) = sum(geom%f_p(:,iz)*x(ix,iy,:))
169 qtmp(ix,iy,iz) = sum(geom%f_pinv(:,iz)*pinv_q(ix,iy,:))
subroutine, public solve_helmholz_ad(geom, c, x, b)
Solve a Helmholz equation - adjoint.
subroutine, public solve_helmholz(geom, c, b, x)
Solve a Helmholz equation.
subroutine, public convert_q_to_x_tl(geom, q, x)
Convert potential vorticity to streamfunction - tangent linear.
subroutine, public convert_q_to_x(geom, q, x_north, x_south, x)
Convert potential vorticity to streamfunction.
subroutine, public convert_q_to_x_ad(geom, x, q)
Convert potential vorticity to streamfunction - adjoint.