Skip to content

Commit

Permalink
Try different 3D vector calculations for north and east in test.
Browse files Browse the repository at this point in the history
  • Loading branch information
oehmke committed Aug 1, 2023
1 parent 0edb448 commit 825d9f7
Showing 1 changed file with 19 additions and 4 deletions.
23 changes: 19 additions & 4 deletions src/Infrastructure/Field/tests/ESMF_FieldRegridUTest.F90
Original file line number Diff line number Diff line change
Expand Up @@ -44960,9 +44960,16 @@ subroutine calc_unit_basis_vecs(lon_rad, lat_rad, e_vec, n_vec)
real(ESMF_KIND_R8) :: n_vec(3)
real(ESMF_KIND_R8) :: e_len, n_len


! East vector
e_vec(1)=cos(lon_rad)
e_vec(2)=sin(lon_rad)
! OLD
!e_vec(1)=cos(lon_rad)
!e_vec(2)=sin(lon_rad)
!e_vec(3)=0

! Try this one instead: [-sin(lng), cos(lng), 0]
e_vec(1)=-sin(lon_rad)
e_vec(2)=cos(lon_rad)
e_vec(3)=0

! Make unit vec
Expand All @@ -44976,11 +44983,19 @@ subroutine calc_unit_basis_vecs(lon_rad, lat_rad, e_vec, n_vec)
e_vec(3)=e_vec(3)/e_len
endif

! TODO: Try this one instead: [-sin(lat) * cos(lng), -sin(lat) * sin(lng), cos(lat)]

! North vector
n_vec(1)=-sin(lat_rad)*sin(lon_rad)
n_vec(2)=sin(lat_rad)*cos(lon_rad)
! OLD
!n_vec(1)=-sin(lat_rad)*sin(lon_rad)
!n_vec(2)=sin(lat_rad)*cos(lon_rad)
!n_vec(3)=cos(lat_rad)

n_vec(1)=-sin(lat_rad)*cos(lon_rad)
n_vec(2)=-sin(lat_rad)*sin(lon_rad)
n_vec(3)=cos(lat_rad)


! Make unit vec
n_len=sqrt(n_vec(1)*n_vec(1) + &
n_vec(2)*n_vec(2) + &
Expand Down

0 comments on commit 825d9f7

Please sign in to comment.