Skip to content

Commit

Permalink
test fprettify
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexanderRichert-NOAA committed Mar 5, 2024
1 parent 965aa4c commit 8d409fa
Show file tree
Hide file tree
Showing 32 changed files with 10,762 additions and 10,789 deletions.
1,073 changes: 536 additions & 537 deletions src/bicubic_interp_mod.F90

Large diffs are not rendered by default.

970 changes: 485 additions & 485 deletions src/bilinear_interp_mod.F90

Large diffs are not rendered by default.

1,360 changes: 680 additions & 680 deletions src/budget_interp_mod.F90

Large diffs are not rendered by default.

160 changes: 80 additions & 80 deletions src/earth_radius_mod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -5,92 +5,92 @@
!> @brief Determine earth radius and shape.
!> @author Gayno, Kyle Gerheiser
module earth_radius_mod
implicit none
implicit none

private
public :: earth_radius
private
public :: earth_radius

contains

!> Determine earth radius and shape.
!>
!> Determine the radius and shape of the earth from
!> the grib 2 grid definition template array - section 3.
!>
!> @param[in] igdtmpl integer (igdtlen) grid definition template
!> array. Corresponds to the gfld%igdtmpl component of the ncep g2
!> library gridmod data structure. For all map projections recognized
!> by iplib, the entries use by this routine are:
!> - 1 shape of earth, section 3, octet 15
!> - 2 scale factor of spherical earth radius, octet 16
!> - 3 scaled value of radius of spherical earth, octets 17-20
!> - 4 scale factor of major axis of elliptical earth, octet 21
!> - 5 scaled value of major axis of elliptical earth, octets 22-25
!> - 6 scale factor of minor axis of elliptical earth, octet 26
!> - 7 scaled value of minor axis of elliptical earth, octets 27-30
!> @param[in] igdtlen integer number of elements of the grid
!> definition template array. Corresponds to the gfld%igdtlen
!> component of the ncep g2 library gridmod data structure.
!> @param[out] radius real earth radius in meters. For ellipitical
!> earths, this is the semi major axis. See "map projectsions - a
!> working manual" by Snyder (1987) for details.
!> @param[out] eccen_squared real earth eccentricity squared
!>
!> @author Gayno @date 2015-07-14
SUBROUTINE EARTH_RADIUS(IGDTMPL, IGDTLEN, RADIUS, ECCEN_SQUARED)
IMPLICIT NONE
!> Determine earth radius and shape.
!>
!> Determine the radius and shape of the earth from
!> the grib 2 grid definition template array - section 3.
!>
!> @param[in] igdtmpl integer (igdtlen) grid definition template
!> array. Corresponds to the gfld%igdtmpl component of the ncep g2
!> library gridmod data structure. For all map projections recognized
!> by iplib, the entries use by this routine are:
!> - 1 shape of earth, section 3, octet 15
!> - 2 scale factor of spherical earth radius, octet 16
!> - 3 scaled value of radius of spherical earth, octets 17-20
!> - 4 scale factor of major axis of elliptical earth, octet 21
!> - 5 scaled value of major axis of elliptical earth, octets 22-25
!> - 6 scale factor of minor axis of elliptical earth, octet 26
!> - 7 scaled value of minor axis of elliptical earth, octets 27-30
!> @param[in] igdtlen integer number of elements of the grid
!> definition template array. Corresponds to the gfld%igdtlen
!> component of the ncep g2 library gridmod data structure.
!> @param[out] radius real earth radius in meters. For ellipitical
!> earths, this is the semi major axis. See "map projectsions - a
!> working manual" by Snyder (1987) for details.
!> @param[out] eccen_squared real earth eccentricity squared
!>
!> @author Gayno @date 2015-07-14
subroutine earth_radius(igdtmpl, igdtlen, radius, eccen_squared)
implicit none

INTEGER, INTENT(IN ) :: IGDTLEN
INTEGER, INTENT(IN ) :: IGDTMPL(IGDTLEN)
integer, intent(in) :: igdtlen
integer, intent(in) :: igdtmpl(igdtlen)

REAL, INTENT( OUT) :: ECCEN_SQUARED
REAL, INTENT( OUT) :: RADIUS
real, intent(out) :: eccen_squared
real, intent(out) :: radius

REAL :: FLAT
REAL :: MAJOR_AXIS, MINOR_AXIS
real :: flat
real :: major_axis, minor_axis

SELECT CASE (IGDTMPL(1))
CASE (0)
RADIUS = 6367470.0
ECCEN_SQUARED = 0.0
CASE (1) ! USER SPECIFIED SPHERICAL
RADIUS = FLOAT(IGDTMPL(3))/FLOAT(10**IGDTMPL(2))
ECCEN_SQUARED = 0.0
CASE (2) ! IAU 1965
RADIUS = 6378160.0 ! SEMI MAJOR AXIS
FLAT = 1.0/297.0 ! FLATTENING
ECCEN_SQUARED = (2.0*FLAT) - (FLAT**2)
CASE (3) ! USER SPECIFIED ELLIPTICAL (KM)
MAJOR_AXIS = FLOAT(IGDTMPL(5))/FLOAT(10**IGDTMPL(4))
MAJOR_AXIS = MAJOR_AXIS * 1000.0
MINOR_AXIS = FLOAT(IGDTMPL(7))/FLOAT(10**IGDTMPL(6))
MINOR_AXIS = MINOR_AXIS * 1000.0
ECCEN_SQUARED = 1.0 - (MINOR_AXIS**2 / MAJOR_AXIS**2)
RADIUS = MAJOR_AXIS
CASE (4) ! IAG-GRS80 MODEL
RADIUS = 6378137.0 ! SEMI MAJOR AXIS
FLAT = 1.0/298.2572 ! FLATTENING
ECCEN_SQUARED = (2.0*FLAT) - (FLAT**2)
CASE (5) ! WGS84 DATUM
RADIUS = 6378137.0 ! SEMI MAJOR AXIS
ECCEN_SQUARED = 0.00669437999013
CASE (6)
RADIUS = 6371229.0
ECCEN_SQUARED = 0.0
CASE (7) ! USER SPECIFIED ELLIPTICAL (M)
MAJOR_AXIS = FLOAT(IGDTMPL(5))/FLOAT(10**IGDTMPL(4))
MINOR_AXIS = FLOAT(IGDTMPL(7))/FLOAT(10**IGDTMPL(6))
ECCEN_SQUARED = 1.0 - (MINOR_AXIS**2 / MAJOR_AXIS**2)
RADIUS = MAJOR_AXIS
CASE (8)
RADIUS = 6371200.0
ECCEN_SQUARED = 0.0
CASE DEFAULT
RADIUS = -9999.
ECCEN_SQUARED = -9999.
END SELECT
!
RETURN
!
END SUBROUTINE EARTH_RADIUS
select case (igdtmpl(1))
case (0)
radius = 6367470.0
eccen_squared = 0.0
case (1) ! USER SPECIFIED SPHERICAL
radius = float(igdtmpl(3))/float(10**igdtmpl(2))
eccen_squared = 0.0
case (2) ! IAU 1965
radius = 6378160.0 ! SEMI MAJOR AXIS
flat = 1.0/297.0 ! FLATTENING
eccen_squared = (2.0*flat)-(flat**2)
case (3) ! USER SPECIFIED ELLIPTICAL (KM)
major_axis = float(igdtmpl(5))/float(10**igdtmpl(4))
major_axis = major_axis*1000.0
minor_axis = float(igdtmpl(7))/float(10**igdtmpl(6))
minor_axis = minor_axis*1000.0
eccen_squared = 1.0-(minor_axis**2/major_axis**2)
radius = major_axis
case (4) ! IAG-GRS80 MODEL
radius = 6378137.0 ! SEMI MAJOR AXIS
flat = 1.0/298.2572 ! FLATTENING
eccen_squared = (2.0*flat)-(flat**2)
case (5) ! WGS84 DATUM
radius = 6378137.0 ! SEMI MAJOR AXIS
eccen_squared = 0.00669437999013
case (6)
radius = 6371229.0
eccen_squared = 0.0
case (7) ! USER SPECIFIED ELLIPTICAL (M)
major_axis = float(igdtmpl(5))/float(10**igdtmpl(4))
minor_axis = float(igdtmpl(7))/float(10**igdtmpl(6))
eccen_squared = 1.0-(minor_axis**2/major_axis**2)
radius = major_axis
case (8)
radius = 6371200.0
eccen_squared = 0.0
case default
radius = -9999.
eccen_squared = -9999.
end select
!
return
!
end subroutine earth_radius
end module earth_radius_mod
Loading

0 comments on commit 8d409fa

Please sign in to comment.