spherical_to_cartesian Subroutine

private subroutine spherical_to_cartesian(lon, lat, r, x, y, z)

Arguments

Type IntentOptional Attributes Name
real(kind=ESMF_KIND_R8), intent(in) :: lon
real(kind=ESMF_KIND_R8), intent(in) :: lat
real(kind=ESMF_KIND_R8), intent(in) :: r
real(kind=ESMF_KIND_R8), intent(out) :: x
real(kind=ESMF_KIND_R8), intent(out) :: y
real(kind=ESMF_KIND_R8), intent(out) :: z

Called by

proc~~spherical_to_cartesian~~CalledByGraph proc~spherical_to_cartesian spherical_to_cartesian proc~rot_3d rot_3d proc~rot_3d->proc~spherical_to_cartesian proc~rot_3d_new rot_3d_new proc~rot_3d_new->proc~spherical_to_cartesian proc~mirror_grid mirror_grid proc~mirror_grid->proc~rot_3d proc~mirror_grid_local mirror_grid_local proc~mirror_grid_local->proc~rot_3d proc~mirror_grid_local_new mirror_grid_local_new proc~mirror_grid_local_new->proc~rot_3d_new proc~esmf_utilcreatecscoords ESMF_UtilCreateCSCoords proc~esmf_utilcreatecscoords->proc~mirror_grid proc~esmf_utilcreatecscoordspar ESMF_UtilCreateCSCoordsPar proc~esmf_utilcreatecscoordspar->proc~mirror_grid_local proc~esmf_utilcreatecscoordspar->proc~mirror_grid_local_new proc~esmf_gridcreatecubedsphereireg ESMF_GridCreateCubedSphereIReg proc~esmf_gridcreatecubedsphereireg->proc~esmf_utilcreatecscoordspar proc~esmf_gridcreatecubedspherereg ESMF_GridCreateCubedSphereReg proc~esmf_gridcreatecubedspherereg->proc~esmf_utilcreatecscoordspar proc~esmf_meshcreatecubedsphere ESMF_MeshCreateCubedSphere proc~esmf_meshcreatecubedsphere->proc~esmf_utilcreatecscoords

Source Code

      subroutine spherical_to_cartesian(lon, lat, r, x, y, z)

         real(ESMF_KIND_R8) , intent(IN)  :: lon, lat, r
         real(ESMF_KIND_R8) , intent(OUT) :: x, y, z

         x = r * COS(lon) * cos(lat)
         y = r * SIN(lon) * cos(lat)

#ifdef RIGHT_HAND
         z =  r * SIN(lat)
#else
         z = -r * sin(lat)
#endif

      end subroutine spherical_to_cartesian