1 subroutine da_get_aspoles(x, &
3 ims, ime, jms, jme, kms, kme, &
4 its, ite, jts, jte, kts, kte )
6 !---------------------------------------------------------------------------
7 ! Purpose: Treatment for Adjoint of Scalar field at Poles
8 !---------------------------------------------------------------------------
12 integer, intent(in) :: ids, ide, jds, jde
13 integer, intent(in) :: ims, ime, jms, jme, kms, kme
14 integer, intent(in) :: its, ite, jts, jte, kts, kte
15 real, intent(inout) :: x(ims:ime,jms:jme,kms:kme)
20 real :: tmp_s(kts:kte)
22 tmpvar = 1.0/real(ide-ids+1)
24 if (trace_use) call da_trace_entry("da_get_aspoles")
30 tmp_s(k) = tmpvar*sum(x(its:ite,jts,k))
34 call wrf_dm_sum_reals(tmp_s(:),tmps(:))
38 x(its:ite,jts+1,k) = x(its:ite,jts+1,k) + tmps(k)
39 x(its:ite,jts,k) = 0.0
47 tmp_s(k) = tmpvar*sum(x(its:ite,jte,k))
51 call wrf_dm_sum_reals(tmp_s(:),tmps(:))
55 x(its:ite,jte-1,k) = x(its:ite,jte-1,k) + tmps(k)
56 x(its:ite,jte,k) = 0.0
60 if (trace_use) call da_trace_exit("da_get_aspoles")
62 end subroutine da_get_aspoles