libSUFR
a LIBrary of Some Useful Fortran Routines
All Classes Namespaces Files Functions Variables Pages
sufr_angles Module Reference

Procedures to handle angles. More...

Functions/Subroutines

pure real(double) function rev (ang)
 Returns angle in radians between 0 and 2pi.
 
pure real function rrev (ang)
 Returns angle in radians between 0 and 2pi – single precision.
 
pure real(double) function rev360 (ang)
 Returns angle in degrees between 0 and 360.
 
pure real(double) function rev2 (ang)
 Returns angle in radians between -pi and pi.
 
pure real function rrev2 (ang)
 Returns angle in radians between -pi and pi – single precision.
 
pure real(double) function revc (ang, cen)
 Returns angle in radians between cen-pi and cen+pi.
 
pure real(double) function rv (tm)
 Returns time in hours between 0 and 24.
 
pure real(double) function rv12 (tm)
 Returns time in hours between -12 and 12.
 
pure real(double) function rv180 (ang)
 Returns angle in degrees between -180 and 180.
 
pure real(double) function asep (l1, l2, b1, b2)
 Calculate the angular separation between two objects with given longitudes and latitudes.
 
pure real(double) function calpa (lon1, lon2, lat1, lat2)
 Calculates the position angle of object 2 with respect to object 1, COUNTERCLOCKWISE from the north.
 
pure character function, dimension(2) pastr_en (pa)
 Converts a position angle to one of eight English two-letter abbreviations (NE, SW)
 
pure character function, dimension(11) pastr_nl (pa)
 Converts a position angle to one of eight full Dutch strings (noordoosten, noorden)
 
pure character function, dimension(2) pastr_nls (pa)
 Converts a position angle to one of eight Dutch abbreviations (NO,ZW)
 
pure character function, dimension(14) wdstr_en (wd)
 Converts a wind direction/azimuth to one of 16 English wind directions (northnortheast, westsouthwest)
 
pure character function, dimension(3) wdstr_ens (wd)
 Converts a wind direction/azimuth to one of 16 three-letter English wind-direction abbreviations (NNE, WSW)
 
pure character function, dimension(3) wdstr_nls (wd)
 Converts a wind direction/azimuth to one of 16 three-letter Dutch wind-direction abbreviations (NNO, WZW)
 
pure character function, dimension(14) wdstr_nl (wd)
 Converts a wind direction/azimuth to one of 16 full Dutch wind-direction strings (noordnoordoost, zuidwest)
 
pure character function, dimension(2) wdstr_nls2 (wd)
 Converts a wind direction/azimuth to one of 8 two-letter Dutch secondary wind-direction abbreviations (NO, Z). Wrapper for pastr_nls().
 
pure character function, dimension(9) wdstr_nl8 (wd)
 Converts a wind direction/azimuth to one of 8 full Dutch secondary wind-direction (noordoost, zuid). Derived from pastr_nl().
 

Detailed Description

Procedures to handle angles.

Function/Subroutine Documentation

◆ asep()

pure real(double) function sufr_angles::asep ( real(double), intent(in) l1,
real(double), intent(in) l2,
real(double), intent(in) b1,
real(double), intent(in) b2 )

Calculate the angular separation between two objects with given longitudes and latitudes.

Parameters
l1Longitude of object 1 (rad).
l2Longitude of object 2 (rad).
b1Latitude of object 1 (rad).
b2Latitude of object 2 (rad).
Return values
asepAngular separation between the two objects (rad).
See also
Celestial Mechanics in a Nutshell (CMiaNS), Sect.5.3: Angular distance and phase angle between two celestial objects (CMiaNS.sf.net).

Definition at line 239 of file angles.f90.

References asep(), sufr_kinds::double, and rev2().

Referenced by asep().

Here is the call graph for this function:

◆ calpa()

pure real(double) function sufr_angles::calpa ( real(double), intent(in) lon1,
real(double), intent(in) lon2,
real(double), intent(in) lat1,
real(double), intent(in) lat2 )

Calculates the position angle of object 2 with respect to object 1, COUNTERCLOCKWISE from the north.

Parameters
lon1Longitude of object 1 - RA if measuring from the north (rad)
lon2Longitude of object 2 - RA if measuring from the north (rad)
lat1Latitude of object 1 - Dec if measuring from the north (rad)
lat2Latitude of object 2 - Dec if measuring from the north (rad)
Return values
calpaPosition angle of object 2 wrt object 1 (rad)

Definition at line 269 of file angles.f90.

References calpa().

Referenced by calpa().

Here is the call graph for this function:

◆ pastr_en()

pure character function, dimension(2) sufr_angles::pastr_en ( real(double), intent(in) pa)

Converts a position angle to one of eight English two-letter abbreviations (NE, SW)

Parameters
paPosition angle (radians, N=0)
Return values
pastr_enEnglish two-letter wind-direction abbreviation

Definition at line 289 of file angles.f90.

References sufr_kinds::double, pastr_en(), sufr_constants::pi2, and rev().

Referenced by pastr_en().

Here is the call graph for this function:

◆ pastr_nl()

pure character function, dimension(11) sufr_angles::pastr_nl ( real(double), intent(in) pa)

Converts a position angle to one of eight full Dutch strings (noordoosten, noorden)

Parameters
paPosition angle (radians, N=0)
Return values
pastr_nlFull Dutch wind-direction string

Definition at line 310 of file angles.f90.

References sufr_kinds::double, pastr_nl(), sufr_constants::pi2, and rev().

Referenced by pastr_nl().

Here is the call graph for this function:

◆ pastr_nls()

pure character function, dimension(2) sufr_angles::pastr_nls ( real(double), intent(in) pa)

Converts a position angle to one of eight Dutch abbreviations (NO,ZW)

Parameters
paPosition angle (radians, N=0)
Return values
pastr_nlsDutch wind-direction abbreviation

Definition at line 332 of file angles.f90.

References sufr_kinds::double, pastr_nls(), sufr_constants::pi2, and rev().

Referenced by pastr_nls(), and wdstr_nls2().

Here is the call graph for this function:

◆ rev()

◆ rev2()

◆ rev360()

pure real(double) function sufr_angles::rev360 ( real(double), intent(in) ang)

Returns angle in degrees between 0 and 360.

Parameters
angInput angle (degrees)
Return values
rev360Angle in degrees between 0 and 360

Definition at line 79 of file angles.f90.

References sufr_kinds::double, and rev360().

Referenced by rev360().

Here is the call graph for this function:

◆ revc()

pure real(double) function sufr_angles::revc ( real(double), intent(in) ang,
real(double), intent(in) cen )

Returns angle in radians between cen-pi and cen+pi.

Parameters
angInput angle (radians)
cen'Central value' (radians)
Return values
revcAngle in radians between cen-pi and cen+pi

Definition at line 147 of file angles.f90.

References sufr_kinds::double, sufr_constants::pi, sufr_constants::pi2, and revc().

Referenced by revc().

Here is the call graph for this function:

◆ rrev()

pure real function sufr_angles::rrev ( real, intent(in) ang)

Returns angle in radians between 0 and 2pi – single precision.

Parameters
angInput angle (radians)
Return values
rrevAngle in radians between 0 and 2pi

Definition at line 59 of file angles.f90.

References sufr_constants::rpi2, and rrev().

Referenced by rrev().

Here is the call graph for this function:

◆ rrev2()

pure real function sufr_angles::rrev2 ( real, intent(in) ang)

Returns angle in radians between -pi and pi – single precision.

Parameters
angInput angle (radians)
Return values
rrev2Angle in radians between -pi and pi

Definition at line 122 of file angles.f90.

References sufr_constants::rpi, sufr_constants::rpi2, and rrev2().

Referenced by rrev2().

Here is the call graph for this function:

◆ rv()

pure real(double) function sufr_angles::rv ( real(double), intent(in) tm)

Returns time in hours between 0 and 24.

Parameters
tmInput time (hours)
Return values
rvTime in hours between 0 and 24

Definition at line 174 of file angles.f90.

References sufr_kinds::double, and rv().

Referenced by rv().

Here is the call graph for this function:

◆ rv12()

pure real(double) function sufr_angles::rv12 ( real(double), intent(in) tm)

Returns time in hours between -12 and 12.

Parameters
tmInput time (hours)
Return values
rv12Time in hours between -12 and 12

Definition at line 192 of file angles.f90.

References sufr_kinds::double, and rv12().

Referenced by sufr_time2string::hm2(), sufr_time2string::hms2(), and rv12().

Here is the call graph for this function:

◆ rv180()

pure real(double) function sufr_angles::rv180 ( real(double), intent(in) ang)

Returns angle in degrees between -180 and 180.

Parameters
angInput angle (degrees)
Return values
rv180Angle in degrees between -180 and 180

Definition at line 211 of file angles.f90.

References sufr_kinds::double, and rv180().

Referenced by rv180().

Here is the call graph for this function:

◆ wdstr_en()

pure character function, dimension(14) sufr_angles::wdstr_en ( real(double), intent(in) wd)

Converts a wind direction/azimuth to one of 16 English wind directions (northnortheast, westsouthwest)

Parameters
wdWind direction/azimuth (radians, N=0)
Return values
wdstr_enFull English wind direction

Definition at line 357 of file angles.f90.

References sufr_kinds::double, sufr_constants::r2d, and wdstr_en().

Referenced by wdstr_en().

Here is the call graph for this function:

◆ wdstr_ens()

pure character function, dimension(3) sufr_angles::wdstr_ens ( real(double), intent(in) wd)

Converts a wind direction/azimuth to one of 16 three-letter English wind-direction abbreviations (NNE, WSW)

Parameters
wdWind direction/azimuth (radians, N=0)
Return values
wdstr_ensThree-letter English wind-direction abbreviation

Definition at line 380 of file angles.f90.

References sufr_kinds::double, sufr_constants::r2d, and wdstr_ens().

Referenced by wdstr_ens().

Here is the call graph for this function:

◆ wdstr_nl()

pure character function, dimension(14) sufr_angles::wdstr_nl ( real(double), intent(in) wd)

Converts a wind direction/azimuth to one of 16 full Dutch wind-direction strings (noordnoordoost, zuidwest)

Parameters
wdWind direction (radians, N=0)
Return values
wdstr_nlFull Dutch wind-direction string

Definition at line 422 of file angles.f90.

References sufr_kinds::double, sufr_constants::r2d, and wdstr_nl().

Referenced by wdstr_nl().

Here is the call graph for this function:

◆ wdstr_nl8()

pure character function, dimension(9) sufr_angles::wdstr_nl8 ( real(double), intent(in) wd)

Converts a wind direction/azimuth to one of 8 full Dutch secondary wind-direction (noordoost, zuid). Derived from pastr_nl().

Parameters
wdWind direction (radians, N=0)
Return values
wdstr_nl8String with full Dutch wind-direction

Definition at line 470 of file angles.f90.

References sufr_kinds::double, sufr_constants::pi2, rev(), and wdstr_nl8().

Referenced by wdstr_nl8().

Here is the call graph for this function:

◆ wdstr_nls()

pure character function, dimension(3) sufr_angles::wdstr_nls ( real(double), intent(in) wd)

Converts a wind direction/azimuth to one of 16 three-letter Dutch wind-direction abbreviations (NNO, WZW)

Parameters
wdWind direction/azimuth (radians, N=0)
Return values
wdstr_nlsThree-letter Dutch wind-direction abbreviation

Definition at line 401 of file angles.f90.

References sufr_kinds::double, sufr_constants::r2d, and wdstr_nls().

Referenced by wdstr_nls().

Here is the call graph for this function:

◆ wdstr_nls2()

pure character function, dimension(2) sufr_angles::wdstr_nls2 ( real(double), intent(in) wd)

Converts a wind direction/azimuth to one of 8 two-letter Dutch secondary wind-direction abbreviations (NO, Z). Wrapper for pastr_nls().

Parameters
wdWind direction (radians, N=0)
Return values
wdstr_nls2Dutch two-letter wind-direction abbreviation

Definition at line 449 of file angles.f90.

References sufr_kinds::double, pastr_nls(), and wdstr_nls2().

Referenced by wdstr_nls2().

Here is the call graph for this function: