calc_test_field Subroutine

subroutine calc_test_field(lon_rad, lat_rad, e, n)

Arguments

Type IntentOptional Attributes Name
real(kind=ESMF_KIND_R8) :: lon_rad
real(kind=ESMF_KIND_R8) :: lat_rad
real(kind=ESMF_KIND_R8) :: e
real(kind=ESMF_KIND_R8) :: n

Calls

proc~~calc_test_field~~CallsGraph proc~calc_test_field calc_test_field proc~calc_unit_basis_vecs calc_unit_basis_vecs proc~calc_test_field->proc~calc_unit_basis_vecs

Called by

proc~~calc_test_field~~CalledByGraph proc~calc_test_field calc_test_field proc~test_sph_vec_blnr_csg_to_llg test_sph_vec_blnr_csG_to_llG proc~test_sph_vec_blnr_csg_to_llg->proc~calc_test_field proc~test_sph_vec_blnr_csg_to_llg_p test_sph_vec_blnr_csG_to_llG_p proc~test_sph_vec_blnr_csg_to_llg_p->proc~calc_test_field

Source Code

  subroutine calc_test_field(lon_rad, lat_rad, e, n)
   real(ESMF_KIND_R8) :: lon_rad,lat_rad, e, n
   real(ESMF_KIND_R8) :: e_vec(3)
   real(ESMF_KIND_R8) :: n_vec(3)
   real(ESMF_KIND_R8) :: len

   ! Get basis vectors
   call calc_unit_basis_vecs(lon_rad, lat_rad, e_vec, n_vec)
   
   ! Dot with a vector going along x-axis (essentially just use x component)
   e=e_vec(1)
   n=n_vec(1)

   ! Make unit vec
   len=sqrt(e*e + n*n)
   if (len .ne. 0.0) then
      e=e/len
      n=n/len
   endif

 end subroutine calc_test_field