gnomonic_angl Subroutine

private subroutine gnomonic_angl(im, lamda, theta)

Arguments

Type IntentOptional Attributes Name
integer :: im
real(kind=ESMF_KIND_R8) :: lamda(im+1,im+1)
real(kind=ESMF_KIND_R8) :: theta(im+1,im+1)

Source Code

 subroutine gnomonic_angl(im, lamda, theta)
! This is the commonly known equi-angular grid
 integer im
 real(ESMF_KIND_R8) lamda(im+1,im+1)
 real(ESMF_KIND_R8) theta(im+1,im+1)
 real(ESMF_KIND_R8) p(3,im+1,im+1)
! Local
 real(ESMF_KIND_R8) rsq3, xf, y0, z0, y, x, z, ds
 real(ESMF_KIND_R8) dy, dz
 integer j,k
 real(ESMF_KIND_R8) dp

 dp = 0.5*pi/real(im,ESMF_KIND_R8)

 rsq3 = 1./sqrt(3.) 
 do k=1,im+1
    do j=1,im+1
       p(1,j,k) =-rsq3               ! constant
       p(2,j,k) =-rsq3*tan(-0.25*pi+(j-1)*dp)
       p(3,j,k) = rsq3*tan(-0.25*pi+(k-1)*dp)
    enddo
 enddo

 call cart_to_latlon( (im+1)*(im+1), p, lamda, theta)

 end subroutine gnomonic_angl