FMS  2024.03
Flexible Modeling System
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
 Calculates the annual mean of solar information for a given latitude and time. More...
 
interface  daily_mean_solar
 Calculates the daily mean solar information for a given time and latitude. More...
 
interface  diurnal_solar
 Calculates solar information for the given location(lat & lon) and time. More...
 
interface  get_orbital_parameters
 
interface  get_period
 Gets the length of year for current calendar. More...
 
interface  half_day
 Private interface for internal use by dirunal_solar and daily_mean_solar. More...
 
interface  set_period
 Sets the length of a year for the calendar in use. More...
 

Functions/Subroutines

real(kind=fms_ast_kind_) function 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...
 
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_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_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, public astronomy_init (latb, lonb)
 astronomy_init is the constructor for astronomy_mod. 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_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_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_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_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 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_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_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...
 
real(kind=fms_ast_kind_) function declination_ (ang)
 Declination returns the solar declination angle at orbital position ang in earth's orbit. 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_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_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_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 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_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 get_orbital_parameters_ (ecc_out, obliq_out, per_out)
 get_orbital_parameters retrieves the orbital parameters for use by another module. More...
 
 get_orbital_parameters_r4
 
 get_orbital_parameters_r8
 
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, 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...
 
real(kind=fms_ast_kind_) 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(kind=fms_ast_kind_) 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...
 
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(kind=r8_kind) function, public orbital_time (time)
 Orbital time returns the time (1 year = 2*pi) since autumnal equinox. More...
 
real(kind=fms_ast_kind_) function 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...
 
subroutine 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...
 
 set_orbital_parameters_r4
 
 set_orbital_parameters_r8
 
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_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...
 
real(kind=r8_kind) function, public universal_time (time)
 universal_time returns the time of day at longitude = 0.0 (1 day = 2*pi) More...
 

Variables

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

Detailed Description

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

Data Type Documentation

◆ astronomy_mod::annual_mean_solar

interface astronomy_mod::annual_mean_solar

Calculates the annual mean of solar information for a given latitude and time.

call annual_mean_solar (js, je, lat, cosz, solar, fracday, rrsun)
call annual_mean_solar (lat, cosz, solar)

The second interface above is used by the spectral 2-layer model, which requires only cosz and solar as output arguments, and which makes this call during the initialization phase of the model. Separate routines exist within this interface for 1D or 2D input and output fields:

real, intent(in), dimension(:,:) :: lat
real, intent(in), dimension(:) :: lat
real, intent(out), dimension(:,:) :: cosz, solar, fracday
real, intent(out), dimension(:) :: cosz, solar, fracday
Parameters
[in]<jst>Starting subdomain j indices of data in the physics wiondow being integrated
[in]<jnd>Ending subdomain j indices of data in the physics wiondow being integrated
[in]<lat>Latitudes of model grid points [radians]
[out]<cosz>cosz is the average over the year of the cosine of an effective zenith angle that would produce the correct daily solar flux if the sun were fixed at that single position for the period of daylight on the given day. in this average, the daily mean effective cosz is weighted by the daily mean solar flux. [dimensionless]
[out]<solar>Normalized solar flux, averaged over the year, equal to the product of fracday*cosz*rrsun [dimensionless]
[out]<fracday>Daylight fraction calculated so as to make the average flux (solar) equal to the product of the flux-weighted avg cosz * this fracday * assumed annual mean avg Earth-Sun distance of 1.0. [dimensionless]
[out]<rrsun>Annual mean Earth-Sun distance (r) relative to semi-major axis of orbital ellipse (a):(a/r)**2 [dimensionless]

Definition at line 253 of file astronomy.F90.

Private Member Functions

 annual_mean_solar_1d_r4
 
 annual_mean_solar_1d_r8
 
 annual_mean_solar_2d_r4
 
 annual_mean_solar_2d_r8
 
 annual_mean_solar_2level_r4
 
 annual_mean_solar_2level_r8
 

◆ astronomy_mod::daily_mean_solar

interface astronomy_mod::daily_mean_solar

Calculates the daily mean solar information for a given time and latitude.

call daily_mean_solar (lat, time, cosz, fracday, rrsun)
call daily_mean_solar (lat, time_since_ae, cosz, fracday, rrsun)
call daily_mean_solar (lat, time, cosz, solar)
call daily_mean_solar (lat, time_since_ae, cosz, solar)

The first option (used in conjunction with time_manager_mod) generates the real variable time_since_ae from the time_type input time, and then calls daily_mean_solar with this real input (option 2). The third and fourth options correspond to the first and second and are used with then spectral 2-layer model, where only cosz and solar are desired as output. These routines generate dummy arguments and then call option 2, where the calculation is done.

The time of year is set by

real, intent(in) :: time_since_ae

With time_type input, the time of year is extracted from

type(time_type), intent(in) :: time

Separate routines exist within this interface for scalar, 1D or 2D input and output fields:

real, intent(in), dimension(:,:) :: lat
real, intent(in), dimension(:) :: lat
real, intent(in) :: lat
real, intent(out), dimension(:,:) :: cosz, fracday
real, intent(out), dimension(:) :: cosz, fracday
real, intent(out) :: cosz, fracday
Parameters
[in]<lat>Latitudes of model grid points [radians]
[in]<time_since_ae>Time of year; autumnal equinox = 0.0, one year = 2 * pi [radians]
[in]<time>Time at which astronomical values are desired (time_type variable) [seconds, days]
[out]<cosz>Cosine of solar zenith angle, set to zero when entire period is in darkness [dimensionless]
[out]<fracday>Daylight fraction of time interval [dimensionless]
[out]<rrsun>Earth-Sun distance (r) relative to semi-major axis of orbital ellipse (a):(a/r)**2 [dimensionless]
[out]<solar>shortwave flux factor: cosine of zenith angle * daylight fraction / (earth-sun distance squared) [dimensionless]

Definition at line 206 of file astronomy.F90.

Private Member Functions

 daily_mean_solar_0d_r4
 
 daily_mean_solar_0d_r8
 
 daily_mean_solar_1d_r4
 
 daily_mean_solar_1d_r8
 
 daily_mean_solar_2d_r4
 
 daily_mean_solar_2d_r8
 
 daily_mean_solar_2level_r4
 
 daily_mean_solar_2level_r8
 
 daily_mean_solar_cal_0d_r4
 
 daily_mean_solar_cal_0d_r8
 
 daily_mean_solar_cal_1d_r4
 
 daily_mean_solar_cal_1d_r8
 
 daily_mean_solar_cal_2d_r4
 
 daily_mean_solar_cal_2d_r8
 
 daily_mean_solar_cal_2level_r4
 
 daily_mean_solar_cal_2level_r8
 

◆ astronomy_mod::diurnal_solar

interface astronomy_mod::diurnal_solar

Calculates solar information for the given location(lat & lon) and time.

call diurnal_solar (lat, lon, time, cosz, fracday, rrsun, dt_time)
call diurnal_solar (lat, lon, gmt, time_since_ae, cosz, fracday, rrsun, dt)

The first option (used in conjunction with time_manager_mod) generates the real variables gmt and time_since_ae from the time_type input, and then calls diurnal_solar with these real inputs.

The time of day is set by

real, intent(in) :: gmt

The time of year is set by

real, intent(in) :: time_since_ae

with time_type input, both of these are extracted from

type(time_type), intent(in) :: time

Separate routines exist within this interface for scalar, 1D or 2D input and output fields:

real, intent(in), dimension(:,:) :: lat, lon
real, intent(in), dimension(:) :: lat, lon
real, intent(in) :: lat, lon
real, intent(out), dimension(:,:) :: cosz, fracday
real, intent(out), dimension(:) :: cosz, fracday
real, intent(out) :: cosz, fracday

One may also average the output fields over the time interval between gmt and gmt + dt by including the optional argument dt (or dt_time). dt is measured in radians and must be less than pi (1/2 day). This average is computed analytically, and should be exact except for the fact that changes in earth-sun distance over the time interval dt are ignored. In the context of a diurnal GCM, this option should always be employed to insure that the total flux at the top of the atmosphere is not modified by time truncation error.

real, intent(in), optional :: dt
type(time_type), optional :: dt_time
Parameters
[in]<lat>Latitudes of model grid points [radians]
[in]<lon>Longitudes of model grid points [radians]
[in]<gmt>Time of day at longitude 0.0; midnight = 0.0, one day = 2 * pi [radians]
[in]<time_since_ae>Time of year; autumnal equinox = 0.0, one year = 2 * pi [radians]
[in]<time>Time at which astronomical values are desired (time_type variable) [seconds, days]
[out]<cosz>Cosine of solar zenith angle, set to zero when entire period is in darkness [dimensionless]
[out]<fracday>Daylight fraction of time interval [dimensionless]
[out]<rrsun>Earth-Sun distance (r) relative to semi-major axis of orbital ellipse (a):(a/r)**2 [dimensionless]
[in]<dt>OPTIONAL: Time interval after gmt over which the astronomical variables are to be averaged. this produces averaged output rather than instantaneous. [radians], (1 day = 2 * pi)
[in]<dt_time>OPTIONAL: Time interval after gmt over which the astronomical variables are to be averaged. this produces averaged output rather than instantaneous. time_type, [days, seconds]
[in]<allow_negative_cosz>Allow negative values for cosz?
[out]<half_day_out>half_day_out

Definition at line 148 of file astronomy.F90.

Private Member Functions

 diurnal_solar_0d_r4
 
 diurnal_solar_0d_r8
 
 diurnal_solar_1d_r4
 
 diurnal_solar_1d_r8
 
 diurnal_solar_2d_r4
 
 diurnal_solar_2d_r8
 
 diurnal_solar_cal_0d_r4
 
 diurnal_solar_cal_0d_r8
 
 diurnal_solar_cal_1d_r4
 
 diurnal_solar_cal_1d_r8
 
 diurnal_solar_cal_2d_r4
 
 diurnal_solar_cal_2d_r8
 

◆ astronomy_mod::get_orbital_parameters

interface astronomy_mod::get_orbital_parameters

Definition at line 74 of file astronomy.F90.

Private Member Functions

 get_orbital_parameters_r4
 
 get_orbital_parameters_r8
 

◆ astronomy_mod::get_period

interface astronomy_mod::get_period

Gets the length of year for current calendar.

call get_period (period)

Separate routines exist within this interface for integer and time_type output:

integer, intent(out) :: period
type(time_type), intent(out) :: period
Parameters
[out]<period_out>Length of year for calendar in use

Definition at line 275 of file astronomy.F90.

Private Member Functions

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...
 

Member Function/Subroutine Documentation

◆ get_period_integer()

subroutine 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 572 of file astronomy.F90.

◆ get_period_time_type()

subroutine 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 600 of file astronomy.F90.

◆ astronomy_mod::half_day

interface astronomy_mod::half_day

Private interface for internal use by dirunal_solar and daily_mean_solar.

Example usage:

half_day(latitude, dec) result(h)

Separate routines exist within this interface for scalar, or 2D input and output fields:

real, intent(in), dimension(:,:) :: latitude
real, intent(in) :: latitude
real, dimension(size(latitude,1),size(latitude,2)) :: h
real :: h
Parameters
[in]<latitude>Latitudes of model grid points [radians]
[in]<dec>Solar declination [radians]
[out]<h>Half of the length of daylight at the given latitude and orbital position (dec); value ranges between 0 (all darkness) and pi (all daylight) [dimensionless]

Definition at line 342 of file astronomy.F90.

Private Member Functions

 half_day_0d_r4
 
 half_day_0d_r8
 
 half_day_2d_r4
 
 half_day_2d_r8
 

◆ astronomy_mod::set_period

interface astronomy_mod::set_period

Sets the length of a year for the calendar in use.

call set_period (period_in)

Separate routines exist within this interface for integer and time_type output:

integer, intent(out) :: period_in
type(time_type), intent(out) :: period_in
Parameters
[in]<period_in>Length of year for calendar in use

Definition at line 295 of file astronomy.F90.

Private Member Functions

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...
 

Member Function/Subroutine Documentation

◆ set_period_integer()

subroutine 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 621 of file astronomy.F90.

◆ set_period_time_type()

subroutine 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 644 of file astronomy.F90.

Function/Subroutine Documentation

◆ angle_()

real(kind=fms_ast_kind_) function angle_ ( real(kind=fms_ast_kind_), intent(in)  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.

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 1436 of file astronomy.inc.

◆ annual_mean_solar_1d_()

subroutine annual_mean_solar_1d_ ( integer, intent(in)  jst,
integer, intent(in)  jnd,
real(kind=fms_ast_kind_), dimension(:), intent(in)  lat,
real(kind=fms_ast_kind_), dimension(:), intent(out)  cosz,
real(kind=fms_ast_kind_), dimension(:), intent(out)  solar,
real(kind=fms_ast_kind_), dimension(:), intent(out)  fracday,
real(kind=fms_ast_kind_), intent(out)  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.

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 1267 of file astronomy.inc.

◆ annual_mean_solar_2d_()

subroutine annual_mean_solar_2d_ ( integer, intent(in)  js,
integer, intent(in)  je,
real(kind=fms_ast_kind_), dimension(:,:), intent(in)  lat,
real(kind=fms_ast_kind_), dimension(:,:), intent(out)  cosz,
real(kind=fms_ast_kind_), dimension(:,:), intent(out)  solar,
real(kind=fms_ast_kind_), dimension(:,:), intent(out)  fracday,
real(kind=fms_ast_kind_), intent(out)  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.

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 1150 of file astronomy.inc.

◆ annual_mean_solar_2level_()

subroutine annual_mean_solar_2level_ ( real(kind=fms_ast_kind_), dimension(:), intent(in)  lat,
real(kind=fms_ast_kind_), dimension(:), intent(out)  cosz,
real(kind=fms_ast_kind_), dimension(:), intent(out)  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.

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 1333 of file astronomy.inc.

◆ 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 759 of file astronomy.F90.

◆ astronomy_init()

subroutine, public astronomy_mod::astronomy_init ( class(*), dimension(:,:), intent(in), optional  latb,
class(*), 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]

This routine will: 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 431 of file astronomy.F90.

◆ daily_mean_solar_0d_()

subroutine daily_mean_solar_0d_ ( real(kind=fms_ast_kind_), intent(in)  lat,
real(kind=fms_ast_kind_), intent(in)  time_since_ae,
real(kind=fms_ast_kind_), intent(out)  cosz,
real(kind=fms_ast_kind_), intent(out)  h_out,
real(kind=fms_ast_kind_), intent(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.

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 918 of file astronomy.inc.

◆ daily_mean_solar_1d_()

subroutine daily_mean_solar_1d_ ( real(kind=fms_ast_kind_), dimension(:), intent(in)  lat,
real(kind=fms_ast_kind_), intent(in)  time_since_ae,
real(kind=fms_ast_kind_), dimension(size(lat(:))), intent(out)  cosz,
real(kind=fms_ast_kind_), dimension(size(lat(:))), intent(out)  h_out,
real(kind=fms_ast_kind_), intent(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.

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 816 of file astronomy.inc.

◆ daily_mean_solar_2d_()

subroutine daily_mean_solar_2d_ ( real(kind=fms_ast_kind_), dimension(:,:), intent(in)  lat,
real(kind=fms_ast_kind_), intent(in)  time_since_ae,
real(kind=fms_ast_kind_), dimension(:,:), intent(out)  cosz,
real(kind=fms_ast_kind_), dimension(:,:), intent(out)  h_out,
real(kind=fms_ast_kind_), intent(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.

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 753 of file astronomy.inc.

◆ daily_mean_solar_2level_()

subroutine daily_mean_solar_2level_ ( real(kind=fms_ast_kind_), dimension(:), intent(in)  lat,
real(kind=fms_ast_kind_), intent(in)  time_since_ae,
real(kind=fms_ast_kind_), dimension(size(lat(:))), intent(out)  cosz,
real(kind=fms_ast_kind_), dimension(size(lat(:))), intent(out)  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.

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 867 of file astronomy.inc.

◆ daily_mean_solar_cal_0d_()

subroutine daily_mean_solar_cal_0d_ ( real(kind=fms_ast_kind_), intent(in)  lat,
type(time_type), intent(in)  time,
real(kind=fms_ast_kind_), intent(out)  cosz,
real(kind=fms_ast_kind_), intent(out)  fracday,
real(kind=fms_ast_kind_), intent(out)  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.

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 1100 of file astronomy.inc.

◆ daily_mean_solar_cal_1d_()

subroutine daily_mean_solar_cal_1d_ ( real(kind=fms_ast_kind_), dimension(:), intent(in)  lat,
type(time_type), intent(in)  time,
real(kind=fms_ast_kind_), dimension(:), intent(out)  cosz,
real(kind=fms_ast_kind_), dimension(:), intent(out)  fracday,
real(kind=fms_ast_kind_), intent(out)  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.

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 1007 of file astronomy.inc.

◆ daily_mean_solar_cal_2d_()

subroutine daily_mean_solar_cal_2d_ ( real(kind=fms_ast_kind_), dimension(:,:), intent(in)  lat,
type(time_type), intent(in)  time,
real(kind=fms_ast_kind_), dimension(:,:), intent(out)  cosz,
real(kind=fms_ast_kind_), dimension(:,:), intent(out)  fracday,
real(kind=fms_ast_kind_), intent(out)  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.

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 964 of file astronomy.inc.

◆ daily_mean_solar_cal_2level_()

subroutine daily_mean_solar_cal_2level_ ( real(kind=fms_ast_kind_), dimension(:), intent(in)  lat,
type(time_type), intent(in)  time,
real(kind=fms_ast_kind_), dimension(:), intent(out)  cosz,
real(kind=fms_ast_kind_), dimension(:), intent(out)  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.

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 1054 of file astronomy.inc.

◆ declination_()

real(kind=fms_ast_kind_) function declination_ ( real(kind=fms_ast_kind_), intent(in)  ang)

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 1477 of file astronomy.inc.

◆ diurnal_solar_0d_()

subroutine diurnal_solar_0d_ ( real(kind=fms_ast_kind_), intent(in)  lat,
real(kind=fms_ast_kind_), intent(in)  lon,
real(kind=fms_ast_kind_), intent(in)  gmt,
real(kind=fms_ast_kind_), intent(in)  time_since_ae,
real(kind=fms_ast_kind_), intent(out)  cosz,
real(kind=fms_ast_kind_), intent(out)  fracday,
real(kind=fms_ast_kind_), intent(out)  rrsun,
real(kind=fms_ast_kind_), intent(in), optional  dt,
logical, intent(in), optional  allow_negative_cosz,
real(kind=fms_ast_kind_), intent(out), optional  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.

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 456 of file astronomy.inc.

◆ diurnal_solar_1d_()

subroutine diurnal_solar_1d_ ( real(kind=fms_ast_kind_), dimension(:), intent(in)  lat,
real(kind=fms_ast_kind_), dimension(:), intent(in)  lon,
real(kind=fms_ast_kind_), intent(in)  gmt,
real(kind=fms_ast_kind_), intent(in)  time_since_ae,
real(kind=fms_ast_kind_), dimension(:), intent(out)  cosz,
real(kind=fms_ast_kind_), dimension(:), intent(out)  fracday,
real(kind=fms_ast_kind_), intent(out)  rrsun,
real(kind=fms_ast_kind_), intent(in), optional  dt,
logical, intent(in), optional  allow_negative_cosz,
real(kind=fms_ast_kind_), dimension(:), intent(out), optional  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.

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 384 of file astronomy.inc.

◆ diurnal_solar_2d_()

subroutine diurnal_solar_2d_ ( real(kind=fms_ast_kind_), dimension(:,:), intent(in)  lat,
real(kind=fms_ast_kind_), dimension(:,:), intent(in)  lon,
real(kind=fms_ast_kind_), intent(in)  gmt,
real(kind=fms_ast_kind_), intent(in)  time_since_ae,
real(kind=fms_ast_kind_), dimension(:,:), intent(out)  cosz,
real(kind=fms_ast_kind_), dimension(:,:), intent(out)  fracday,
real(kind=fms_ast_kind_), intent(out)  rrsun,
real(kind=fms_ast_kind_), intent(in), optional  dt,
logical, intent(in), optional  allow_negative_cosz,
real(kind=fms_ast_kind_), dimension(:,:), intent(out), optional  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.

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 142 of file astronomy.inc.

◆ diurnal_solar_cal_0d_()

subroutine diurnal_solar_cal_0d_ ( real(kind=fms_ast_kind_), intent(in)  lat,
real(kind=fms_ast_kind_), intent(in)  lon,
type(time_type), intent(in)  time,
real(kind=fms_ast_kind_), intent(out)  cosz,
real(kind=fms_ast_kind_), intent(out)  fracday,
real(kind=fms_ast_kind_), intent(out)  rrsun,
type(time_type), intent(in), optional  dt_time,
logical, intent(in), optional  allow_negative_cosz,
real(kind=fms_ast_kind_), intent(out), optional  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.

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 683 of file astronomy.inc.

◆ diurnal_solar_cal_1d_()

subroutine diurnal_solar_cal_1d_ ( real(kind=fms_ast_kind_), dimension(:), intent(in)  lat,
real(kind=fms_ast_kind_), dimension(:), intent(in)  lon,
type(time_type), intent(in)  time,
real(kind=fms_ast_kind_), dimension(:), intent(out)  cosz,
real(kind=fms_ast_kind_), dimension(:), intent(out)  fracday,
real(kind=fms_ast_kind_), intent(out)  rrsun,
type(time_type), intent(in), optional  dt_time,
logical, intent(in), optional  allow_negative_cosz,
real(kind=fms_ast_kind_), dimension(:), intent(out), optional  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.

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 610 of file astronomy.inc.

◆ diurnal_solar_cal_2d_()

subroutine diurnal_solar_cal_2d_ ( real(kind=fms_ast_kind_), dimension(:,:), intent(in)  lat,
real(kind=fms_ast_kind_), dimension(:,:), intent(in)  lon,
type(time_type), intent(in)  time,
real(kind=fms_ast_kind_), dimension(:,:), intent(out)  cosz,
real(kind=fms_ast_kind_), dimension(:,:), intent(out)  fracday,
real(kind=fms_ast_kind_), intent(out)  rrsun,
type(time_type), intent(in), optional  dt_time,
logical, intent(in), optional  allow_negative_cosz,
real(kind=fms_ast_kind_), dimension(:,:), intent(out), optional  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.

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 524 of file astronomy.inc.

◆ get_orbital_parameters_()

subroutine get_orbital_parameters_ ( real(kind=fms_ast_kind_), intent(out)  ecc_out,
real(kind=fms_ast_kind_), intent(out)  obliq_out,
real(kind=fms_ast_kind_), 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 90 of file astronomy.inc.

◆ 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 572 of file astronomy.F90.

◆ 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 600 of file astronomy.F90.

◆ 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 733 of file astronomy.F90.

◆ half_day_0d_()

real(kind=fms_ast_kind_) function half_day_0d_ ( real(kind=fms_ast_kind_), intent(in)  latitude,
real(kind=fms_ast_kind_), intent(in)  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.

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

Definition at line 1562 of file astronomy.inc.

◆ half_day_2d_()

real(kind=fms_ast_kind_) function, dimension(size(latitude,1),size(latitude,2)) half_day_2d_ ( real(kind=fms_ast_kind_), dimension(:,:), intent(in)  latitude,
real(kind=fms_ast_kind_), intent(in)  dec 
)

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 1507 of file astronomy.inc.

◆ 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 794 of file astronomy.F90.

◆ orbital_time()

real(kind=r8_kind) 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 837 of file astronomy.F90.

◆ r_inv_squared_()

real(kind=fms_ast_kind_) function r_inv_squared_ ( real(kind=fms_ast_kind_), intent(in)  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.

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 1400 of file astronomy.inc.

◆ set_orbital_parameters_()

subroutine set_orbital_parameters_ ( real(kind=fms_ast_kind_), intent(in)  ecc_in,
real(kind=fms_ast_kind_), intent(in)  obliq_in,
real(kind=fms_ast_kind_), 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 39 of file astronomy.inc.

◆ 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 621 of file astronomy.F90.

◆ 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 644 of file astronomy.F90.

◆ 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 683 of file astronomy.F90.

◆ universal_time()

real(kind=r8_kind) 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 851 of file astronomy.F90.