FV3 Bundle
astronomy_mod Module Reference

astronomy_mod provides astronomical variables for use by other modules within fms. The only currently used interface is for determination of astronomical values needed by the shortwave radiation packages. More...

Data Types

interface  annual_mean_solar
 
interface  daily_mean_solar
 
interface  diurnal_solar
 
interface  get_period
 
interface  half_day
 
interface  set_period
 

Functions/Subroutines

subroutine, public astronomy_init (latb, lonb)
 astronomy_init is the constructor for astronomy_mod. More...
 
subroutine get_period_integer (period_out)
 get_period_integer returns the length of the year as an integer number of seconds. More...
 
subroutine get_period_time_type (period_out)
 get_period_time_type returns the length of the year as a time_type variable. More...
 
subroutine set_period_integer (period_in)
 set_period_integer saves as the input length of the year (an integer) in a time_type module variable. More...
 
subroutine set_period_time_type (period_in)
 Set_period_time_type saves the length of the year (input as a time_type variable) into a time_type module variable. More...
 
subroutine, public set_orbital_parameters (ecc_in, obliq_in, per_in)
 set_orbital_parameters saves the input values of eccentricity, obliquity and perihelion time as module variables for use by astronomy_mod. More...
 
subroutine, public get_orbital_parameters (ecc_out, obliq_out, per_out)
 get_orbital_parameters retrieves the orbital parameters for use by another module. More...
 
subroutine, public set_ref_date_of_ae (day_in, month_in, year_in, second_in, minute_in, hour_in)
 set_ref_date_of_ae provides a means of specifying the reference date of the NH autumnal equinox for a particular year. More...
 
subroutine, public get_ref_date_of_ae (day_out, month_out, year_out, second_out, minute_out, hour_out)
 get_ref_date_of_ae retrieves the reference date of the autumnal equinox as integer variables. More...
 
subroutine diurnal_solar_2d (lat, lon, gmt, time_since_ae, cosz, fracday, rrsun, dt, allow_negative_cosz, half_day_out)
 diurnal_solar_2d returns 2d fields of cosine of zenith angle, daylight fraction and earth-sun distance at the specified latitudes, longitudes and time. These values may be instantaneous or averaged over a specified time interval. More...
 
subroutine diurnal_solar_1d (lat, lon, gmt, time_since_ae, cosz, fracday, rrsun, dt, allow_negative_cosz, half_day_out)
 diurnal_solar_1d takes 1-d input fields, adds a second dimension and calls diurnal_solar_2d. on return, the 2d fields are returned to the original 1d fields. More...
 
subroutine diurnal_solar_0d (lat, lon, gmt, time_since_ae, cosz, fracday, rrsun, dt, allow_negative_cosz, half_day_out)
 diurnal_solar_0d takes scalar input fields, makes them into 2d arrays dimensioned (1,1), and calls diurnal_solar_2d. on return, the 2d fields are converted back to the desired scalar output. More...
 
subroutine diurnal_solar_cal_2d (lat, lon, time, cosz, fracday, rrsun, dt_time, allow_negative_cosz, half_day_out)
 diurnal_solar_cal_2d receives time_type inputs, converts them to real variables and then calls diurnal_solar_2d to compute desired astronomical variables. More...
 
subroutine diurnal_solar_cal_1d (lat, lon, time, cosz, fracday, rrsun, dt_time, allow_negative_cosz, half_day_out)
 diurnal_solar_cal_1d receives time_type inputs, converts them to real variables and then calls diurnal_solar_2d to compute desired astronomical variables. More...
 
subroutine diurnal_solar_cal_0d (lat, lon, time, cosz, fracday, rrsun, dt_time, allow_negative_cosz, half_day_out)
 diurnal_solar_cal_0d receives time_type inputs, converts them to real variables and then calls diurnal_solar_2d to compute desired astronomical variables. More...
 
subroutine daily_mean_solar_2d (lat, time_since_ae, cosz, h_out, rr_out)
 daily_mean_solar_2d computes the daily mean astronomical parameters for the input points at latitude lat and time of year time_since_ae. More...
 
subroutine daily_mean_solar_1d (lat, time_since_ae, cosz, h_out, rr_out)
 daily_mean_solar_1d takes 1-d input fields, adds a second dimension and calls daily_mean_solar_2d. on return, the 2d fields are returned to the original 1d fields. More...
 
subroutine daily_mean_solar_2level (lat, time_since_ae, cosz, solar)
 daily_mean_solar_2level takes 1-d input fields, adds a second dimension and calls daily_mean_solar_2d. on return, the 2d fields are returned to the original 1d fields. More...
 
subroutine daily_mean_solar_0d (lat, time_since_ae, cosz, h_out, rr_out)
 daily_mean_solar_1d takes 1-d input fields, adds a second dimension and calls daily_mean_solar_2d. on return, the 2d fields are returned to the original 1d fields. More...
 
subroutine daily_mean_solar_cal_2d (lat, time, cosz, fracday, rrsun)
 daily_mean_solar_cal_2d receives time_type inputs, converts them to real variables and then calls daily_mean_solar_2d to compute desired astronomical variables. More...
 
subroutine daily_mean_solar_cal_1d (lat, time, cosz, fracday, rrsun)
 daily_mean_solar_cal_1d receives time_type inputs, converts them to real, 2d variables and then calls daily_mean_solar_2d to compute desired astronomical variables. More...
 
subroutine daily_mean_solar_cal_2level (lat, time, cosz, solar)
 daily_mean_solar_cal_2level receives 1d arrays and time_type input, converts them to real, 2d variables and then calls daily_mean_solar_2d to compute desired astronomical variables. More...
 
subroutine daily_mean_solar_cal_0d (lat, time, cosz, fracday, rrsun)
 daily_mean_solar_cal_0d converts scalar input fields to real, 2d variables and then calls daily_mean_solar_2d to compute desired astronomical variables. More...
 
subroutine annual_mean_solar_2d (js, je, lat, cosz, solar, fracday, rrsun)
 annual_mean_solar_2d returns 2d fields of annual mean values of the cosine of zenith angle, daylight fraction and earth-sun distance at the specified latitude. More...
 
subroutine annual_mean_solar_1d (jst, jnd, lat, cosz, solar, fracday, rrsun_out)
 annual_mean_solar_1d creates 2-d input fields from 1-d input fields and then calls annual_mean_solar_2d to obtain 2-d output fields which are then stored into 1-d fields for return to the calling subroutine. More...
 
subroutine annual_mean_solar_2level (lat, cosz, solar)
 annual_mean_solar_2level creates 2-d input fields from 1-d input fields and then calls annual_mean_solar_2d to obtain 2-d output fields which are then stored into 1-d fields for return to the calling subroutine. This subroutine will be called during model initialization. More...
 
subroutine, public astronomy_end
 astronomy_end is the destructor for astronomy_mod. More...
 
subroutine, private orbit
 Orbit computes and stores a table of value of orbital angles as a function of orbital time (both the angle and time are zero at autumnal equinox in the NH, and range from 0 to 2*pi). More...
 
real function, private r_inv_squared (ang)
 r_inv_squared returns the inverse of the square of the earth-sun distance relative to the mean distance at angle ang in the Earth's orbit. More...
 
real function, private angle (t)
 angle determines the position within the earth's orbit at time t in the year (t = 0 at NH autumnal equinox) by interpolating into the orbital position table. More...
 
real function, private declination (ang)
 Declination returns the solar declination angle at orbital position ang in earth's orbit. More...
 
real function, dimension(size(latitude, 1), size(latitude, 2)) half_day_2d (latitude, dec)
 half_day_2d returns a 2-d array of half-day lengths at the latitudes and declination provided. More...
 
real function half_day_0d (latitude, dec)
 half_day_0d takes scalar input fields, makes them into 2-d fields dimensioned (1,1), and calls half_day_2d. On return, the 2-d fields are converted to the desired scalar output. More...
 
real function, public orbital_time (time)
 Orbital time returns the time (1 year = 2*pi) since autumnal equinox. More...
 
real function, public universal_time (time)
 universal_time returns the time of day at longitude = 0.0 (1 day = 2*pi) More...
 

Variables

real ecc = 0.01671
 Eccentricity of Earth's orbit [dimensionless]. More...
 
real obliq = 23.439
 Obliquity [degrees]. More...
 
real per = 102.932
 Longitude of perihelion with respect to autumnal equinox in NH [degrees]. More...
 
integer period = 0
 Specified length of year [seconds]; must be specified to override default value given by length_of_year in time_manager_mod. More...
 
integer day_ae = 23
 Day of specified autumnal equinox. More...
 
integer month_ae = 9
 Month of specified autumnal equinox. More...
 
integer year_ae = 1998
 Year of specified autumnal equinox. More...
 
integer hour_ae = 5
 Hour of specified autumnal equinox. More...
 
integer minute_ae = 37
 Minute of specified autumnal equinox. More...
 
integer second_ae = 0
 Second of specified autumnal equinox. More...
 
integer num_angles = 3600
 Number of intervals into which the year is divided to compute orbital positions. More...
 
type(time_typeautumnal_eq_ref
 time_type variable containing specified time of reference NH autumnal equinox More...
 
type(time_typeperiod_time_type
 time_type variable containing period of one orbit More...
 
real, dimension(:), allocatable orb_angle
 table of orbital positions (0 to 2*pi) as a function of time used to find actual orbital position via interpolation More...
 
real seconds_per_day =86400.
 seconds in a day More...
 
real deg_to_rad
 conversion from degrees to radians More...
 
real twopi
 2 *PI More...
 
logical module_is_initialized =.false.
 has the module been initialized ? More...
 
real, dimension(:,:), allocatable cosz_ann
 annual mean cos of zenith angle More...
 
real, dimension(:,:), allocatable solar_ann
 annual mean solar factor More...
 
real, dimension(:,:), allocatable fracday_ann
 annual mean daylight fraction More...
 
real rrsun_ann
 annual mean earth-sun distance More...
 
logical annual_mean_calculated =.false.
 have the annual mean values been calculated? More...
 
integer num_pts = 0
 count of grid_boxes for which annual mean astronomy values have been calculated More...
 
integer total_pts
 number of grid boxes owned by the processor More...
 

Detailed Description

astronomy_mod provides astronomical variables for use by other modules within fms. The only currently used interface is for determination of astronomical values needed by the shortwave radiation packages.

Author
Fei Liu Fei.L.nosp@m.iu@n.nosp@m.oaa.g.nosp@m.ov http://www.gfdl.noaa.gov/fms-cgi-bin/cvsweb.cgi/FMS/

Modules Included:

Module Name Functions Included
fms_mod open_namelist_file, fms_init, mpp_pe, mpp_root_pe, stdlog, file_exist, write_version_number, check_nml_error, error_mesg, FATAL, NOTE, WARNING, close_file
time_manager_mod time_type, set_time, get_time, get_date_julian, set_date_julian, set_date, length_of_year, time_manager_init, operator(-), operator(+), operator( // ), operator(<)
constants_mod constants_init, PI
mpp_mod input_nml_file

Function/Subroutine Documentation

◆ angle()

real function, private astronomy_mod::angle ( real, intent(in)  t)
private

angle determines the position within the earth's orbit at time t in the year (t = 0 at NH autumnal equinox) by interpolating into the orbital position table.

Parameters
[in]ttime of year (between 0 and 2*pi; t=0 at NH autumnal equinox
Returns
Orbital position relative to NH autumnal equinox [radians]

Define orbital tables indices bracketing current orbital time (int and int_1). Define table index distance between the lower table value (int) and the actual orbital time (x). Define orbital position as being x of the way between int and int_1. Renormalize angle to be within the range 0 to 2*pi.

Definition at line 2094 of file astronomy.F90.

Here is the caller graph for this function:

◆ annual_mean_solar_1d()

subroutine astronomy_mod::annual_mean_solar_1d ( integer, intent(in)  jst,
integer, intent(in)  jnd,
real, dimension(:), intent(in)  lat,
real, dimension(:), intent(out)  cosz,
real, dimension(:), intent(out)  solar,
real, dimension(:), intent(out)  fracday,
real, intent(out)  rrsun_out 
)
private

annual_mean_solar_1d creates 2-d input fields from 1-d input fields and then calls annual_mean_solar_2d to obtain 2-d output fields which are then stored into 1-d fields for return to the calling subroutine.

Parameters
[in]<jst>Starting index of latitude window
[in]<jnd>Ending index of latitude window
[in]<lat>Latitudes of model grid points
[out]<cosz>Cosine of solar zenith angle
[out]<solar>Shortwave flux factor: cosine of zenith angle * daylight fraction / (earth-sun distance squared)
[out]<fracday>Daylight fraction of time interval
[out]<rrsun_out>Earth-Sun distance (r) relative to semi-major axis of orbital ellipse (a):(a/r)**2

define 2-d versions of input data array.

call annual_mean_solar_2d to calculate the astronomy fields.

place output fields into 1-D arrays for return to calling routine.

if the calculation has been done, simply return the module variables contain the results at the desired latitudes.

Definition at line 1873 of file astronomy.F90.

Here is the call graph for this function:

◆ annual_mean_solar_2d()

subroutine astronomy_mod::annual_mean_solar_2d ( integer, intent(in)  js,
integer, intent(in)  je,
real, dimension(:,:), intent(in)  lat,
real, dimension(:,:), intent(out)  cosz,
real, dimension(:,:), intent(out)  solar,
real, dimension(:,:), intent(out)  fracday,
real, intent(out)  rrsun 
)
private

annual_mean_solar_2d returns 2d fields of annual mean values of the cosine of zenith angle, daylight fraction and earth-sun distance at the specified latitude.

Parameters
[in]<jst>Starting index of latitude window
[in]<jnd>Ending index of latitude window
[in]<lat>Latitudes of model grid points
[out]<cosz>Cosine of solar zenith angle
[out]<solar>Shortwave flux factor: cosine of zenith angle * daylight fraction / (earth-sun distance squared)
[out]<fracday>Daylight fraction of time interval
[out]<rrsun>Earth-Sun distance (r) relative to semi-major axis of orbital ellipse (a):(a/r)**2

determine annual mean values of solar flux and product of cosz and solar flux by integrating the annual cycle in num_angles orbital increments.

define the flux-weighted annual mean cosine of the zenith angle.

define avg fracday such as to make the avg flux (solar) equal to the product of the avg cosz * avg fracday * assumed mean avg radius of 1.0. it is unlikely that these avg fracday and avg rr will ever be used.

save the values that have been calculated as module variables, if those variables are present; i.e., not the spectral 2-layer model.

increment the points computed counter. set flag to end execution once values have been calculated for all points owned by the processor.

if the calculation has been done, return the appropriate module variables.

Definition at line 1766 of file astronomy.F90.

Here is the caller graph for this function:

◆ annual_mean_solar_2level()

subroutine astronomy_mod::annual_mean_solar_2level ( real, dimension(:), intent(in)  lat,
real, dimension(:), intent(out)  cosz,
real, dimension(:), intent(out)  solar 
)
private

annual_mean_solar_2level creates 2-d input fields from 1-d input fields and then calls annual_mean_solar_2d to obtain 2-d output fields which are then stored into 1-d fields for return to the calling subroutine. This subroutine will be called during model initialization.

Exceptions
FATAL,astronomy_mod annual_mean_solar_2level should be called only once
Parameters
[in]latLatitudes of model grid points
[out]coszCosine of solar zenith angle
[out]solarshortwave flux factor: cosine of zenith angle * daylight fraction / (earth-sun distance squared)

define 2-d versions of input data array.

call annual_mean_solar_2d to calculate the astronomy fields.

place output fields into 1-D arrays for return to calling routine.

if the calculation has been done, print an error message since this subroutine should be called only once.

Definition at line 1933 of file astronomy.F90.

Here is the call graph for this function:

◆ astronomy_end()

subroutine, public astronomy_mod::astronomy_end ( )

astronomy_end is the destructor for astronomy_mod.

check if the module has been initialized.

deallocate module variables.

mark the module as uninitialized.

Definition at line 1989 of file astronomy.F90.

◆ astronomy_init()

subroutine, public astronomy_mod::astronomy_init ( real, dimension(:,:), intent(in), optional  latb,
real, dimension(:,:), intent(in), optional  lonb 
)

astronomy_init is the constructor for astronomy_mod.

Exceptions
FATAL,astronomy_mod ecc must be between 0 and 0.99
FATAL,astronomy_mod obliquity must be between -90 and 90 degrees
FATAL,astronomy_mod perihelion must be between 0 and 360 degrees
Parameters
[in]latb2d array of model latitudes at cell corners [radians]
[in]lonb2d array of model longitudes at cell corners [radians]

Verify that modules used by this module have been initialized.

Read namelist.

Write version number and namelist to logfile.

Be sure input values are within valid ranges.

Set up time-type variable defining specified time of autumnal equinox.

Set up time-type variable defining length of year.

Define useful module variables.

Call orbit to define table of orbital angles as function of orbital time.

If annual mean radiation is desired, then latb will be present. allocate arrays to hold the needed astronomical factors. define the total number of points that the processor is responsible for.

Mark the module as initialized.

Definition at line 421 of file astronomy.F90.

Here is the call graph for this function:

◆ daily_mean_solar_0d()

subroutine astronomy_mod::daily_mean_solar_0d ( real, intent(in)  lat,
real, intent(in)  time_since_ae,
real, intent(out)  cosz,
real, intent(out)  h_out,
real, intent(out)  rr_out 
)
private

daily_mean_solar_1d takes 1-d input fields, adds a second dimension and calls daily_mean_solar_2d. on return, the 2d fields are returned to the original 1d fields.

Parameters
[in]<lat>Latitudes of model grid points
[in]<time_since_ae>Time of year; autumnal equinox = 0.0, one year = 2 * pi
[out]<cosz>Cosine of solar zenith angle
[out]<h_out>2-d array of half-day lengths at the latitudes
[out]<rr_out>the inverse of the square of the earth-sun distance relative to the mean distance at angle ang in the earth's orbit.

define 2-d versions of input data array.

call daily_mean_solar_2d to calculate astronomy fields.

return output fields to scalars for return to calling routine.

Definition at line 1553 of file astronomy.F90.

Here is the call graph for this function:

◆ daily_mean_solar_1d()

subroutine astronomy_mod::daily_mean_solar_1d ( real, dimension(:), intent(in)  lat,
real, intent(in)  time_since_ae,
real, dimension(size(lat(:))), intent(out)  cosz,
real, dimension(size(lat(:))), intent(out)  h_out,
real, intent(out)  rr_out 
)
private

daily_mean_solar_1d takes 1-d input fields, adds a second dimension and calls daily_mean_solar_2d. on return, the 2d fields are returned to the original 1d fields.

Parameters
[in]<lat>Latitudes of model grid points
[in]<time_since_ae>Time of year; autumnal equinox = 0.0, one year = 2 * pi
[out]<cosz>Cosine of solar zenith angle
[out]<h_out>2-d array of half-day lengths at the latitudes
[out]<rr_out>the inverse of the square of the earth-sun distance relative to the mean distance at angle ang in the earth's orbit.

define 2-d versions of input data array.

call daily_mean_solar_2d to calculate astronomy fields.

place output fields into 1-d arguments for return to calling routine.

Definition at line 1464 of file astronomy.F90.

Here is the call graph for this function:

◆ daily_mean_solar_2d()

subroutine astronomy_mod::daily_mean_solar_2d ( real, dimension(:,:), intent(in)  lat,
real, intent(in)  time_since_ae,
real, dimension(:,:), intent(out)  cosz,
real, dimension(:,:), intent(out)  h_out,
real, intent(out)  rr_out 
)
private

daily_mean_solar_2d computes the daily mean astronomical parameters for the input points at latitude lat and time of year time_since_ae.

Parameters
[in]<lat>Latitudes of model grid points
[in]<time_since_ae>Time of year; autumnal equinox = 0.0, one year = 2 * pi
[out]<cosz>Cosine of solar zenith angle
[out]<h_out>2-d array of half-day lengths at the latitudes
[out]<rr_out>the inverse of the square of the earth-sun distance relative to the mean distance at angle ang in the earth's orbit.
Exceptions
FATAL,astronomy_mod time_since_ae not between 0 and 2pi

Define the orbital angle (location in year), solar declination, half-day length and earth sun distance factor. Use functions contained in this module.

Where the entire day is dark, define cosz to be zero. otherwise use the standard formula. Define the daylight fraction and earth- sun distance.

Definition at line 1406 of file astronomy.F90.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ daily_mean_solar_2level()

subroutine astronomy_mod::daily_mean_solar_2level ( real, dimension(:), intent(in)  lat,
real, intent(in)  time_since_ae,
real, dimension(size(lat(:))), intent(out)  cosz,
real, dimension(size(lat(:))), intent(out)  solar 
)
private

daily_mean_solar_2level takes 1-d input fields, adds a second dimension and calls daily_mean_solar_2d. on return, the 2d fields are returned to the original 1d fields.

Parameters
[in]<lat>Latitudes of model grid points
[in]<time_since_ae>Time of year; autumnal equinox = 0.0, one year = 2 * pi
[out]<cosz>Cosine of solar zenith angle
[out]<solar>Shortwave flux factor: cosine of zenith angle * daylight fraction / (earth-sun distance squared)

define 2-d versions of input data array.

call daily_mean_solar_2d to calculate astronomy fields.

place output fields into 1-d arguments for return to calling routine.

Definition at line 1508 of file astronomy.F90.

Here is the call graph for this function:

◆ daily_mean_solar_cal_0d()

subroutine astronomy_mod::daily_mean_solar_cal_0d ( real, intent(in)  lat,
type(time_type), intent(in)  time,
real, intent(out)  cosz,
real, intent(out)  fracday,
real, intent(out)  rrsun 
)
private

daily_mean_solar_cal_0d converts scalar input fields to real, 2d variables and then calls daily_mean_solar_2d to compute desired astronomical variables.

Parameters
[in]<lat>Latitudes of model grid points
[in]<time>Time of year (time_type)
[out]<cosz>Cosine of solar zenith angle
[out]<fracday>Daylight fraction of time interval
[out]<rrsun>Earth-Sun distance (r) relative to semi-major axis of orbital ellipse (a):(a/r)**2

define 2-d versions of input data array.

call daily_mean_solar_cal_2d to convert the time_types to reals and then calculate the astronomy fields.

place output fields into scalar arguments for return to calling routine.

Definition at line 1720 of file astronomy.F90.

Here is the call graph for this function:

◆ daily_mean_solar_cal_1d()

subroutine astronomy_mod::daily_mean_solar_cal_1d ( real, dimension(:), intent(in)  lat,
type(time_type), intent(in)  time,
real, dimension(:), intent(out)  cosz,
real, dimension(:), intent(out)  fracday,
real, intent(out)  rrsun 
)
private

daily_mean_solar_cal_1d receives time_type inputs, converts them to real, 2d variables and then calls daily_mean_solar_2d to compute desired astronomical variables.

Parameters
[in]<lat>Latitudes of model grid points
[in]<time>Time of year (time_type)
[out]<cosz>Cosine of solar zenith angle
[out]<fracday>Daylight fraction of time interval
[out]<rrsun>Earth-Sun distance (r) relative to semi-major axis of orbital ellipse (a):(a/r)**2

define 2-d versions of input data array.

call daily_mean_solar_cal_2d to convert the time_types to reals and then calculate the astronomy fields.

place output fields into 1-d arguments for return to calling routine.

Definition at line 1634 of file astronomy.F90.

Here is the call graph for this function:

◆ daily_mean_solar_cal_2d()

subroutine astronomy_mod::daily_mean_solar_cal_2d ( real, dimension(:,:), intent(in)  lat,
type(time_type), intent(in)  time,
real, dimension(:,:), intent(out)  cosz,
real, dimension(:,:), intent(out)  fracday,
real, intent(out)  rrsun 
)
private

daily_mean_solar_cal_2d receives time_type inputs, converts them to real variables and then calls daily_mean_solar_2d to compute desired astronomical variables.

Parameters
[in]<lat>Latitudes of model grid points
[in]<time>Time of year (time_type)
[out]<cosz>Cosine of solar zenith angle
[out]<fracday>Daylight fraction of time interval
[out]<rrsun>Earth-Sun distance (r) relative to semi-major axis of orbital ellipse (a):(a/r)**2
Exceptions
FATAL,astronomy_mod time_since_ae not between 0 and 2pi

Definition at line 1594 of file astronomy.F90.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ daily_mean_solar_cal_2level()

subroutine astronomy_mod::daily_mean_solar_cal_2level ( real, dimension(:), intent(in)  lat,
type(time_type), intent(in)  time,
real, dimension(:), intent(out)  cosz,
real, dimension(:), intent(out)  solar 
)
private

daily_mean_solar_cal_2level receives 1d arrays and time_type input, converts them to real, 2d variables and then calls daily_mean_solar_2d to compute desired astronomical variables.

Parameters
[in]<lat>Latitudes of model grid points
[in]<time>Time of year (time_type)
[out]<cosz>Cosine of solar zenith angle
[out]<solar>Shortwave flux factor: cosine of zenith angle * daylight fraction / (earth-sun distance squared)

define 2-d versions of input data array.

call daily_mean_solar_cal_2d to convert the time_types to reals and then calculate the astronomy fields.

place output fields into 1-d arguments for return to calling routine.

Definition at line 1677 of file astronomy.F90.

Here is the call graph for this function:

◆ declination()

real function, private astronomy_mod::declination ( real, intent(in)  ang)
private

Declination returns the solar declination angle at orbital position ang in earth's orbit.

Parameters
[in]angsolar orbital position ang in earth's orbit
Returns
Solar declination angle [radians]

Definition at line 2129 of file astronomy.F90.

Here is the caller graph for this function:

◆ diurnal_solar_0d()

subroutine astronomy_mod::diurnal_solar_0d ( real, intent(in)  lat,
real, intent(in)  lon,
real, intent(in)  gmt,
real, intent(in)  time_since_ae,
real, intent(out)  cosz,
real, intent(out)  fracday,
real, intent(out)  rrsun,
real, intent(in), optional  dt,
logical, intent(in), optional  allow_negative_cosz,
real, intent(out), optional  half_day_out 
)
private

diurnal_solar_0d takes scalar input fields, makes them into 2d arrays dimensioned (1,1), and calls diurnal_solar_2d. on return, the 2d fields are converted back to the desired scalar output.

Parameters
[in]<lat>Latitudes of model grid points
[in]<lon>Longitudes of model grid points
[in]<gmt>Time of day at longitude 0.0; midnight = 0.0, one day = 2 * pi
[in]<time_since_ae>Time of year; autumnal equinox = 0.0, one year = 2 * pi
[out]<cosz>Cosine of solar zenith angle
[out]<fracday>Daylight fraction of time interval
[out]<rrsun>earth-sun distance (r) relative to semi-major axis of orbital ellipse (a):(a/r)**2
[in]<dt>OPTIONAL: time interval after gmt over which the astronomical variables are to be averaged. this produces averaged output rather than instantaneous.
[in]<allow_negative_cosz>Allow negative values for cosz?
[out]<half_day_out>half_day_out

create 2d arrays from the scalar input fields.

call diurnal_solar_2d to calculate astronomy fields.

place output fields into scalars for return to calling routine.

Definition at line 1130 of file astronomy.F90.

Here is the call graph for this function:

◆ diurnal_solar_1d()

subroutine astronomy_mod::diurnal_solar_1d ( real, dimension(:), intent(in)  lat,
real, dimension(:), intent(in)  lon,
real, intent(in)  gmt,
real, intent(in)  time_since_ae,
real, dimension(:), intent(out)  cosz,
real, dimension(:), intent(out)  fracday,
real, intent(out)  rrsun,
real, intent(in), optional  dt,
logical, intent(in), optional  allow_negative_cosz,
real, dimension(:), intent(out), optional  half_day_out 
)
private

diurnal_solar_1d takes 1-d input fields, adds a second dimension and calls diurnal_solar_2d. on return, the 2d fields are returned to the original 1d fields.

Parameters
[in]<lat>Latitudes of model grid points
[in]<lon>Longitudes of model grid points
[in]<gmt>Time of day at longitude 0.0; midnight = 0.0, one day = 2 * pi
[in]<time_since_ae>Time of year; autumnal equinox = 0.0, one year = 2 * pi
[out]<cosz>Cosine of solar zenith angle
[out]<fracday>Daylight fraction of time interval
[out]<rrsun>earth-sun distance (r) relative to semi-major axis of orbital ellipse (a):(a/r)**2
[in]<dt>OPTIONAL: time interval after gmt over which the astronomical variables are to be averaged. this produces averaged output rather than instantaneous.
[in]<allow_negative_cosz>Allow negative values for cosz?
[out]<half_day_out>half_day_out

define 2-d versions of input data arrays.

call diurnal_solar_2d to calculate astronomy fields.

place output fields into 1-d arguments for return to calling routine.

Definition at line 1064 of file astronomy.F90.

Here is the call graph for this function:

◆ diurnal_solar_2d()

subroutine astronomy_mod::diurnal_solar_2d ( real, dimension(:,:), intent(in)  lat,
real, dimension(:,:), intent(in)  lon,
real, intent(in)  gmt,
real, intent(in)  time_since_ae,
real, dimension(:,:), intent(out)  cosz,
real, dimension(:,:), intent(out)  fracday,
real, intent(out)  rrsun,
real, intent(in), optional  dt,
logical, intent(in), optional  allow_negative_cosz,
real, dimension(:,:), intent(out), optional  half_day_out 
)
private

diurnal_solar_2d returns 2d fields of cosine of zenith angle, daylight fraction and earth-sun distance at the specified latitudes, longitudes and time. These values may be instantaneous or averaged over a specified time interval.

Parameters
[in]<lat>Latitudes of model grid points
[in]<lon>Longitudes of model grid points
[in]<gmt>Time of day at longitude 0.0; midnight = 0.0, one day = 2 * pi
[in]<time_since_ae>Time of year; autumnal equinox = 0.0, one year = 2 * pi
[out]<cosz>Cosine of solar zenith angle
[out]<fracday>Daylight fraction of time interval
[out]<rrsun>earth-sun distance (r) relative to semi-major axis of orbital ellipse (a):(a/r)**2
[in]<dt>OPTIONAL: time interval after gmt over which the astronomical variables are to be averaged. this produces averaged output rather than instantaneous.
[in]<allow_negative_cosz>Allow negative values for cosz?
[out]<half_day_out>half_day_out
Exceptions
FATAL,astronomy_mod time_since_ae not between 0 and 2pi
FATAL,astronomy_mod gmt not between 0 and 2pi

define the orbital angle (location in year), solar declination and earth sun distance factor. use functions contained in this module.

define terms needed in the cosine zenith angle equation.

define local time. force it to be between -pi and pi.

perform a time integration to obtain cosz and fracday if desired. output is valid over the period from t to t + dt.

if instantaneous values are desired, define cosz at time t.

Check that cosz is not negative, if desired.

Definition at line 841 of file astronomy.F90.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ diurnal_solar_cal_0d()

subroutine astronomy_mod::diurnal_solar_cal_0d ( real, intent(in)  lat,
real, intent(in)  lon,
type(time_type), intent(in)  time,
real, intent(out)  cosz,
real, intent(out)  fracday,
real, intent(out)  rrsun,
type(time_type), intent(in), optional  dt_time,
logical, intent(in), optional  allow_negative_cosz,
real, intent(out), optional  half_day_out 
)
private

diurnal_solar_cal_0d receives time_type inputs, converts them to real variables and then calls diurnal_solar_2d to compute desired astronomical variables.

Parameters
[in]<lat>Latitudes of model grid points
[in]<lon>Longitudes of model grid points
[in]<time>Time of year (time_type)
[out]<cosz>Cosine of solar zenith angle
[out]<fracday>Daylight fraction of time interval
[out]<rrsun>Earth-Sun distance (r) relative to semi-major axis of orbital ellipse (a) : (a/r)**2
[out]<dt_time>OPTIONAL: time interval after gmt over which the astronomical variables are to be averaged. this produces averaged output rather than instantaneous.
[in]<allow_negative_cosz>allow_negative_cosz
[out]<half_day_out>half_day_out

Define 2-d versions of input data arrays.

Call diurnal_solar_cal_2d to convert the time_types to reals and then calculate the astronomy fields.

Place output fields into 1-d arguments for return to calling routine.

Definition at line 1344 of file astronomy.F90.

Here is the call graph for this function:

◆ diurnal_solar_cal_1d()

subroutine astronomy_mod::diurnal_solar_cal_1d ( real, dimension(:), intent(in)  lat,
real, dimension(:), intent(in)  lon,
type(time_type), intent(in)  time,
real, dimension(:), intent(out)  cosz,
real, dimension(:), intent(out)  fracday,
real, intent(out)  rrsun,
type(time_type), intent(in), optional  dt_time,
logical, intent(in), optional  allow_negative_cosz,
real, dimension(:), intent(out), optional  half_day_out 
)
private

diurnal_solar_cal_1d receives time_type inputs, converts them to real variables and then calls diurnal_solar_2d to compute desired astronomical variables.

Parameters
[in]<lat>Latitudes of model grid points
[in]<lon>Longitudes of model grid points
[in]<gmt>Time of day at longitude 0.0; midnight = 0.0, one day = 2 * pi
[in]<time>Time of year (time_type)
[out]<cosz>Cosine of solar zenith angle
[out]<fracday>Daylight fraction of time interval
[out]<rrsun>earth-sun distance (r) relative to semi-major axis of orbital ellipse (a):(a/r)**2
[in]<dt>OPTIONAL: time interval after gmt over which the astronomical variables are to be averaged. this produces averaged output rather than instantaneous.
[in]<allow_negative_cosz>Allow negative values for cosz?
[out]<half_day_out>half_day_out

Define 2-d versions of input data arrays.

Call diurnal_solar_cal_2d to convert the time_types to reals and then calculate the astronomy fields.

Place output fields into 1-d arguments for return to calling routine.

Definition at line 1276 of file astronomy.F90.

Here is the call graph for this function:

◆ diurnal_solar_cal_2d()

subroutine astronomy_mod::diurnal_solar_cal_2d ( real, dimension(:,:), intent(in)  lat,
real, dimension(:,:), intent(in)  lon,
type(time_type), intent(in)  time,
real, dimension(:,:), intent(out)  cosz,
real, dimension(:,:), intent(out)  fracday,
real, intent(out)  rrsun,
type(time_type), intent(in), optional  dt_time,
logical, intent(in), optional  allow_negative_cosz,
real, dimension(:,:), intent(out), optional  half_day_out 
)
private

diurnal_solar_cal_2d receives time_type inputs, converts them to real variables and then calls diurnal_solar_2d to compute desired astronomical variables.

Parameters
[in]<lat>Latitudes of model grid points
[in]<lon>Longitudes of model grid points
[in]<gmt>Time of day at longitude 0.0; midnight = 0.0, one day = 2 * pi
[in]<time>Time of year (time_type)
[out]<cosz>Cosine of solar zenith angle
[out]<fracday>Daylight fraction of time interval
[out]<rrsun>earth-sun distance (r) relative to semi-major axis of orbital ellipse (a):(a/r)**2
[in]<dt>OPTIONAL: time interval after gmt over which the astronomical variables are to be averaged. this produces averaged output rather than instantaneous.
[in]<allow_negative_cosz>Allow negative values for cosz?
[out]<half_day_out>half_day_out
Exceptions
FATAL,astronomy_mod radiation time step must be no longer than 12 hrs
FATAL,astronomy_mod radiation time step must not be an integral number of days

Extract time of day (gmt) from time_type variable time with function universal_time.

Extract the time of year (time_since_ae) from time_type variable time using the function orbital_time.

Convert optional time_type variable dt_time (length of averaging period) to a real variable dt with the function universal_time.

Call diurnal_solar_2d to calculate astronomy fields, with or without the optional argument dt.

Definition at line 1194 of file astronomy.F90.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ get_orbital_parameters()

subroutine, public astronomy_mod::get_orbital_parameters ( real, intent(out)  ecc_out,
real, intent(out)  obliq_out,
real, intent(out)  per_out 
)

get_orbital_parameters retrieves the orbital parameters for use by another module.

Exceptions
FATAL,astronomy_mod module has not been initialized
Parameters
[out]ecc_outEccentricity of orbital ellipse [dimensionless]
[out]obliq_outObliquity [degrees]
[out]per_outLongitude of perihelion with respect to autumnal equinox in northern hemisphere [degrees]

Definition at line 692 of file astronomy.F90.

Here is the call graph for this function:

◆ get_period_integer()

subroutine astronomy_mod::get_period_integer ( integer, intent(out)  period_out)
private

get_period_integer returns the length of the year as an integer number of seconds.

Exceptions
FATAL,astronomy_mod module has not been initialized
Parameters
[out]period_outLength of year [seconds]

Definition at line 540 of file astronomy.F90.

Here is the call graph for this function:

◆ get_period_time_type()

subroutine astronomy_mod::get_period_time_type ( type(time_type), intent(inout)  period_out)
private

get_period_time_type returns the length of the year as a time_type variable.

Exceptions
FATAL,astronomy_mod module has not been initialized
Parameters
[in,out]period_outLength of year as time_type variable

Definition at line 569 of file astronomy.F90.

Here is the call graph for this function:

◆ get_ref_date_of_ae()

subroutine, public astronomy_mod::get_ref_date_of_ae ( integer, intent(out)  day_out,
integer, intent(out)  month_out,
integer, intent(out)  year_out,
integer, intent(out)  second_out,
integer, intent(out)  minute_out,
integer, intent(out)  hour_out 
)

get_ref_date_of_ae retrieves the reference date of the autumnal equinox as integer variables.

Exceptions
FATAL,astronomy_mod module has not been initialized
Parameters
[out]<day_out>Day of reference autumnal equinox
[out]<month_out>Month of reference autumnal equinox
[out]<year_out>Year of reference autumnal equinox
[out]<second_out>Second of reference autumnal equinox
[out]<minute_out>Minute of reference autumnal equinox
[out]<hour_out>Hour of reference autumnal equinox

Definition at line 794 of file astronomy.F90.

Here is the call graph for this function:

◆ half_day_0d()

real function astronomy_mod::half_day_0d ( real, intent(in)  latitude,
real, intent(in)  dec 
)
private

half_day_0d takes scalar input fields, makes them into 2-d fields dimensioned (1,1), and calls half_day_2d. On return, the 2-d fields are converted to the desired scalar output.

Parameters
[in]<latitude>Latitutde of view point
[in]<dec>Solar declination angle at view point

Definition at line 2203 of file astronomy.F90.

◆ half_day_2d()

real function, dimension(size(latitude,1),size(latitude,2)) astronomy_mod::half_day_2d ( real, dimension(:,:), intent(in)  latitude,
real, intent(in)  dec 
)
private

half_day_2d returns a 2-d array of half-day lengths at the latitudes and declination provided.

Parameters
[in]latitudeLatitutde of view point
[in]decSolar declination angle at view point

define tangent of the declination.

adjust latitude so that its tangent will be defined.

define the cosine of the half-day length. adjust for cases of all daylight or all night.

Definition at line 2155 of file astronomy.F90.

◆ orbit()

subroutine, private astronomy_mod::orbit ( )
private

Orbit computes and stores a table of value of orbital angles as a function of orbital time (both the angle and time are zero at autumnal equinox in the NH, and range from 0 to 2*pi).

allocate the orbital angle array, sized by the namelist parameter num_angles, defining the annual cycle resolution of the earth's orbit. define some constants to be used.

define the orbital angle at each of the num_angles locations in the orbit.

Definition at line 2025 of file astronomy.F90.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ orbital_time()

real function, public astronomy_mod::orbital_time ( type(time_type), intent(in)  time)

Orbital time returns the time (1 year = 2*pi) since autumnal equinox.

Orbital time returns the time (1 year = 2*pi) since autumnal equinox; autumnal_eq_ref is a module variable of time_type and will have been defined by default or by a call to set_ref_date_of_ae; length_of_year is available through the time manager and is set at the value approriate for the calandar being used

Parameters
[in]timetime (1 year = 2*pi) since autumnal equinox

Definition at line 2239 of file astronomy.F90.

Here is the caller graph for this function:

◆ r_inv_squared()

real function, private astronomy_mod::r_inv_squared ( real, intent(in)  ang)
private

r_inv_squared returns the inverse of the square of the earth-sun distance relative to the mean distance at angle ang in the Earth's orbit.

Parameters
[in]angangular position of earth in its orbit, relative to a value of 0.0 at the NH autumnal equinox, value between 0.0 and 2 * pi [radians]
Returns
The inverse of the square of the earth-sun distance relative to the mean distance [dimensionless]

define the earth-sun distance (r) and then return the inverse of its square (r_inv_squared) to the calling routine.

Definition at line 2063 of file astronomy.F90.

Here is the caller graph for this function:

◆ set_orbital_parameters()

subroutine, public astronomy_mod::set_orbital_parameters ( real, intent(in)  ecc_in,
real, intent(in)  obliq_in,
real, intent(in)  per_in 
)

set_orbital_parameters saves the input values of eccentricity, obliquity and perihelion time as module variables for use by astronomy_mod.

Exceptions
FATAL,astronomy_mod module has not been initialized
FATAL,astronomy_mod ecc must be between 0 and 0.99
FATAL,astronomy_mod obliquity must be between -90. and 90. degrees
FATAL,astronomy_mod perihelion must be between 0.0 and 360. degrees
Parameters
[in]ecc_inEccentricity of orbital ellipse [dimensionless]
[in]obliq_inObliquity [degrees]
[in]per_inLongitude of perihelion with respect to autumnal equinox in northern hemisphere [degrees]

Definition at line 643 of file astronomy.F90.

Here is the call graph for this function:

◆ set_period_integer()

subroutine astronomy_mod::set_period_integer ( integer, intent(in)  period_in)
private

set_period_integer saves as the input length of the year (an integer) in a time_type module variable.

Exceptions
FATAL,astronomy_mod module has not been initialized
Parameters
[in]period_inLength of year as a time_type

Definition at line 591 of file astronomy.F90.

Here is the call graph for this function:

◆ set_period_time_type()

subroutine astronomy_mod::set_period_time_type ( type(time_type), intent(in)  period_in)
private

Set_period_time_type saves the length of the year (input as a time_type variable) into a time_type module variable.

Exceptions
FATAL,astronomy_mod module has not been initialized

Definition at line 615 of file astronomy.F90.

Here is the call graph for this function:

◆ set_ref_date_of_ae()

subroutine, public astronomy_mod::set_ref_date_of_ae ( integer, intent(in)  day_in,
integer, intent(in)  month_in,
integer, intent(in)  year_in,
integer, intent(in), optional  second_in,
integer, intent(in), optional  minute_in,
integer, intent(in), optional  hour_in 
)

set_ref_date_of_ae provides a means of specifying the reference date of the NH autumnal equinox for a particular year.

set_ref_date_of_ae provides a means of specifying the reference date of the NH autumnal equinox for a particular year. It is only used if calls are made to the calandar versions of the routines diurnal_solar and daily_mean_solar. If the NOLEAP calendar is used, then the date of autumnal equinox will be the same every year. If JULIAN is used, then the date of autumnal equinox will return to the same value every 4th year.

Parameters
[in]<day_in>Day of reference autumnal equinox
[in]<month_in>Month of reference autumnal equinox
[in]<year_in>Year of reference autumnal equinox
[out]<second_in>OPTIONAL: Second of reference autumnal equinox
[out]<minute_in>OPTIONAL: Minute of reference autumnal equinox
[out]<hour_in>OPTIONAL: Hour of reference autumnal equinox
Exceptions
FATAL,astronomy_mod module has not been initialized

Definition at line 743 of file astronomy.F90.

Here is the call graph for this function:

◆ universal_time()

real function, public astronomy_mod::universal_time ( type(time_type), intent(in)  time)

universal_time returns the time of day at longitude = 0.0 (1 day = 2*pi)

Parameters
[in]timeTime (1 year = 2*pi) since autumnal equinox

Definition at line 2254 of file astronomy.F90.

Here is the call graph for this function:
Here is the caller graph for this function:

Variable Documentation

◆ annual_mean_calculated

logical astronomy_mod::annual_mean_calculated =.false.
private

have the annual mean values been calculated?

Definition at line 395 of file astronomy.F90.

◆ autumnal_eq_ref

type(time_type) astronomy_mod::autumnal_eq_ref
private

time_type variable containing specified time of reference NH autumnal equinox

Definition at line 373 of file astronomy.F90.

◆ cosz_ann

real, dimension(:,:), allocatable astronomy_mod::cosz_ann
private

annual mean cos of zenith angle

Definition at line 390 of file astronomy.F90.

◆ day_ae

integer astronomy_mod::day_ae = 23
private

Day of specified autumnal equinox.

Definition at line 351 of file astronomy.F90.

◆ deg_to_rad

real astronomy_mod::deg_to_rad
private

conversion from degrees to radians

Definition at line 386 of file astronomy.F90.

◆ ecc

real astronomy_mod::ecc = 0.01671
private

Eccentricity of Earth's orbit [dimensionless].

Definition at line 343 of file astronomy.F90.

◆ fracday_ann

real, dimension(:,:), allocatable astronomy_mod::fracday_ann
private

annual mean daylight fraction

Definition at line 390 of file astronomy.F90.

◆ hour_ae

integer astronomy_mod::hour_ae = 5
private

Hour of specified autumnal equinox.

Definition at line 354 of file astronomy.F90.

◆ minute_ae

integer astronomy_mod::minute_ae = 37
private

Minute of specified autumnal equinox.

Definition at line 355 of file astronomy.F90.

◆ module_is_initialized

logical astronomy_mod::module_is_initialized =.false.
private

has the module been initialized ?

Definition at line 388 of file astronomy.F90.

◆ month_ae

integer astronomy_mod::month_ae = 9
private

Month of specified autumnal equinox.

Definition at line 352 of file astronomy.F90.

◆ num_angles

integer astronomy_mod::num_angles = 3600
private

Number of intervals into which the year is divided to compute orbital positions.

Definition at line 357 of file astronomy.F90.

◆ num_pts

integer astronomy_mod::num_pts = 0
private

count of grid_boxes for which annual mean astronomy values have been calculated

Definition at line 396 of file astronomy.F90.

◆ obliq

real astronomy_mod::obliq = 23.439
private

Obliquity [degrees].

Definition at line 344 of file astronomy.F90.

◆ orb_angle

real, dimension(:), allocatable astronomy_mod::orb_angle
private

table of orbital positions (0 to 2*pi) as a function of time used to find actual orbital position via interpolation

Definition at line 380 of file astronomy.F90.

◆ per

real astronomy_mod::per = 102.932
private

Longitude of perihelion with respect to autumnal equinox in NH [degrees].

Definition at line 345 of file astronomy.F90.

◆ period

integer astronomy_mod::period = 0
private

Specified length of year [seconds]; must be specified to override default value given by length_of_year in time_manager_mod.

Definition at line 347 of file astronomy.F90.

◆ period_time_type

type(time_type) astronomy_mod::period_time_type
private

time_type variable containing period of one orbit

Definition at line 377 of file astronomy.F90.

◆ rrsun_ann

real astronomy_mod::rrsun_ann
private

annual mean earth-sun distance

Definition at line 394 of file astronomy.F90.

◆ second_ae

integer astronomy_mod::second_ae = 0
private

Second of specified autumnal equinox.

Definition at line 356 of file astronomy.F90.

◆ seconds_per_day

real astronomy_mod::seconds_per_day =86400.
private

seconds in a day

Definition at line 385 of file astronomy.F90.

◆ solar_ann

real, dimension(:,:), allocatable astronomy_mod::solar_ann
private

annual mean solar factor

Definition at line 390 of file astronomy.F90.

◆ total_pts

integer astronomy_mod::total_pts
private

number of grid boxes owned by the processor

Definition at line 399 of file astronomy.F90.

◆ twopi

real astronomy_mod::twopi
private

2 *PI

Definition at line 387 of file astronomy.F90.

◆ year_ae

integer astronomy_mod::year_ae = 1998
private

Year of specified autumnal equinox.

Definition at line 353 of file astronomy.F90.