get_gnomonic_dist_coords Subroutine

private subroutine get_gnomonic_dist_coords(im, start, lambda, theta)

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: im
integer, intent(in) :: start(:)
real(kind=ESMF_KIND_R8), intent(out) :: lambda(start(1):,start(2):)
real(kind=ESMF_KIND_R8), intent(out) :: theta(start(1):,start(2):)

Calls

proc~~get_gnomonic_dist_coords~~CallsGraph proc~get_gnomonic_dist_coords get_gnomonic_dist_coords proc~cart_to_latlon_new cart_to_latlon_new proc~get_gnomonic_dist_coords->proc~cart_to_latlon_new

Called by

proc~~get_gnomonic_dist_coords~~CalledByGraph proc~get_gnomonic_dist_coords get_gnomonic_dist_coords proc~get_gnomonic_local_coords get_gnomonic_local_coords proc~get_gnomonic_local_coords->proc~get_gnomonic_dist_coords proc~esmf_utilcreatecscoordspar ESMF_UtilCreateCSCoordsPar proc~esmf_utilcreatecscoordspar->proc~get_gnomonic_local_coords proc~esmf_gridcreatecubedsphereireg ESMF_GridCreateCubedSphereIReg proc~esmf_gridcreatecubedsphereireg->proc~esmf_utilcreatecscoordspar proc~esmf_gridcreatecubedspherereg ESMF_GridCreateCubedSphereReg proc~esmf_gridcreatecubedspherereg->proc~esmf_utilcreatecscoordspar interface~esmf_gridcreatecubedsphere ESMF_GridCreateCubedSphere interface~esmf_gridcreatecubedsphere->proc~esmf_gridcreatecubedsphereireg interface~esmf_gridcreatecubedsphere->proc~esmf_gridcreatecubedspherereg

Source Code

  subroutine get_gnomonic_dist_coords(im, start, lambda, theta)
     integer, intent(in) :: im
     integer, intent(in) :: start(:)
     real(ESMF_KIND_R8), intent(out) :: lambda(start(1):, start(2):)
     real(ESMF_KIND_R8), intent(out) :: theta(start(1):, start(2):)

     ! Local
     real(ESMF_KIND_R8) rsq3, xf
     real(ESMF_KIND_R8) dx
     real(ESMF_KIND_R8) p(3,lbound(lambda,1):ubound(lambda,1),lbound(lambda,2):ubound(lambda,2))
     integer i, j

     ! Face-2

     rsq3 = 1./sqrt(3.) 
     xf = -rsq3
     dx = rsq3/im

     do j = lbound(lambda,2), ubound(lambda,2)
        do i = lbound(lambda,1), ubound(lambda,1)
           p(1,i,j) = xf
           p(2,i,j) = +dx * (im + 2 - 2*i)
           p(3,i,j) = -dx * (im + 2 - 2*j)
        enddo
     enddo
     call cart_to_latlon_new(p, lambda, theta)

  end subroutine get_gnomonic_dist_coords