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

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