Skip to content

Commit

Permalink
correct conversion to radians
Browse files Browse the repository at this point in the history
  • Loading branch information
glemieux committed Aug 3, 2022
1 parent 8b0ed78 commit 8186d50
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
1 change: 1 addition & 0 deletions main/FatesConstantsMod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -233,5 +233,6 @@ module FatesConstantsMod

! PI
real(fates_r8), parameter, public :: pi_const = 3.14159265359_fates_r8
real(fates_r8), parameter, public :: rad_per_deg = pi_const/180.0_fates_r8

end module FatesConstantsMod
10 changes: 5 additions & 5 deletions main/FatesUtilsMod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ end subroutine check_var_real
real(r8) function GreatCircleDist(slons,slonf,slats,slatf)

use FatesConstantsMod, only : earth_radius_eq &
, pi_const
, rad_per_deg
implicit none

!----- Local variables. ----------------------------------------------------------------!
Expand All @@ -107,10 +107,10 @@ real(r8) function GreatCircleDist(slons,slonf,slats,slatf)
!---------------------------------------------------------------------------------------!

!----- Convert the co-ordinates to double precision and to radians. --------------------!
lons = slons * pi_const
lonf = slonf * pi_const
lats = slats * pi_const
latf = slatf * pi_const
lons = slons * rad_per_deg
lonf = slonf * rad_per_deg
lats = slats * rad_per_deg
latf = slatf * rad_per_deg
dlon = lonf - lons
dlat = latf - lats

Expand Down

0 comments on commit 8186d50

Please sign in to comment.