FV3 Bundle
|
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_type) | autumnal_eq_ref |
time_type variable containing specified time of reference NH autumnal equinox More... | |
type(time_type) | period_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... | |
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.
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 |
|
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.
[in] | t | time of year (between 0 and 2*pi; t=0 at NH autumnal equinox |
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.
|
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.
[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.
|
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.
[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.
|
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.
FATAL,astronomy_mod annual_mean_solar_2level should be called only once |
[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) |
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.
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.
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.
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 |
[in] | latb | 2d array of model latitudes at cell corners [radians] |
[in] | lonb | 2d 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.
|
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.
[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.
|
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.
[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.
|
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.
[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. |
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.
|
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.
[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.
|
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.
[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.
|
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.
[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.
|
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.
[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 |
FATAL,astronomy_mod time_since_ae not between 0 and 2pi |
Definition at line 1594 of file astronomy.F90.
|
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.
[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.
|
private |
Declination returns the solar declination angle at orbital position ang in earth's orbit.
[in] | ang | solar orbital position ang in earth's orbit |
Definition at line 2129 of file astronomy.F90.
|
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.
[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.
|
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.
[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.
|
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.
[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 |
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.
|
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.
[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.
|
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.
[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.
|
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.
[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 |
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.
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.
FATAL,astronomy_mod module has not been initialized |
[out] | ecc_out | Eccentricity of orbital ellipse [dimensionless] |
[out] | obliq_out | Obliquity [degrees] |
[out] | per_out | Longitude of perihelion with respect to autumnal equinox in northern hemisphere [degrees] |
Definition at line 692 of file astronomy.F90.
|
private |
get_period_integer returns the length of the year as an integer number of seconds.
FATAL,astronomy_mod module has not been initialized |
[out] | period_out | Length of year [seconds] |
Definition at line 540 of file astronomy.F90.
|
private |
get_period_time_type returns the length of the year as a time_type variable.
FATAL,astronomy_mod module has not been initialized |
[in,out] | period_out | Length of year as time_type variable |
Definition at line 569 of file astronomy.F90.
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.
FATAL,astronomy_mod module has not been initialized |
[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.
|
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.
[in] | <latitude> | Latitutde of view point |
[in] | <dec> | Solar declination angle at view point |
Definition at line 2203 of file astronomy.F90.
|
private |
half_day_2d returns a 2-d array of half-day lengths at the latitudes and declination provided.
[in] | latitude | Latitutde of view point |
[in] | dec | Solar 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.
|
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.
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
[in] | time | time (1 year = 2*pi) since autumnal equinox |
Definition at line 2239 of file astronomy.F90.
|
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.
[in] | ang | angular 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] |
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.
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.
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 |
[in] | ecc_in | Eccentricity of orbital ellipse [dimensionless] |
[in] | obliq_in | Obliquity [degrees] |
[in] | per_in | Longitude of perihelion with respect to autumnal equinox in northern hemisphere [degrees] |
Definition at line 643 of file astronomy.F90.
|
private |
set_period_integer saves as the input length of the year (an integer) in a time_type module variable.
FATAL,astronomy_mod module has not been initialized |
[in] | period_in | Length of year as a time_type |
Definition at line 591 of file astronomy.F90.
|
private |
Set_period_time_type saves the length of the year (input as a time_type variable) into a time_type module variable.
FATAL,astronomy_mod module has not been initialized |
Definition at line 615 of file astronomy.F90.
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.
[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 |
FATAL,astronomy_mod module has not been initialized |
Definition at line 743 of file astronomy.F90.
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)
[in] | time | Time (1 year = 2*pi) since autumnal equinox |
Definition at line 2254 of file astronomy.F90.
|
private |
have the annual mean values been calculated?
Definition at line 395 of file astronomy.F90.
|
private |
time_type variable containing specified time of reference NH autumnal equinox
Definition at line 373 of file astronomy.F90.
|
private |
annual mean cos of zenith angle
Definition at line 390 of file astronomy.F90.
|
private |
Day of specified autumnal equinox.
Definition at line 351 of file astronomy.F90.
|
private |
conversion from degrees to radians
Definition at line 386 of file astronomy.F90.
|
private |
Eccentricity of Earth's orbit [dimensionless].
Definition at line 343 of file astronomy.F90.
|
private |
annual mean daylight fraction
Definition at line 390 of file astronomy.F90.
|
private |
Hour of specified autumnal equinox.
Definition at line 354 of file astronomy.F90.
|
private |
Minute of specified autumnal equinox.
Definition at line 355 of file astronomy.F90.
|
private |
has the module been initialized ?
Definition at line 388 of file astronomy.F90.
|
private |
Month of specified autumnal equinox.
Definition at line 352 of file astronomy.F90.
|
private |
Number of intervals into which the year is divided to compute orbital positions.
Definition at line 357 of file astronomy.F90.
|
private |
count of grid_boxes for which annual mean astronomy values have been calculated
Definition at line 396 of file astronomy.F90.
|
private |
Obliquity [degrees].
Definition at line 344 of file astronomy.F90.
|
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.
|
private |
Longitude of perihelion with respect to autumnal equinox in NH [degrees].
Definition at line 345 of file astronomy.F90.
|
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.
|
private |
time_type variable containing period of one orbit
Definition at line 377 of file astronomy.F90.
|
private |
annual mean earth-sun distance
Definition at line 394 of file astronomy.F90.
|
private |
Second of specified autumnal equinox.
Definition at line 356 of file astronomy.F90.
|
private |
seconds in a day
Definition at line 385 of file astronomy.F90.
|
private |
annual mean solar factor
Definition at line 390 of file astronomy.F90.
|
private |
number of grid boxes owned by the processor
Definition at line 399 of file astronomy.F90.
|
private |
2 *PI
Definition at line 387 of file astronomy.F90.
|
private |
Year of specified autumnal equinox.
Definition at line 353 of file astronomy.F90.