!*********************************************************************** !* GNU Lesser General Public License !* !* This file is part of the GFDL Flexible Modeling System (FMS). !* !* FMS is free software: you can redistribute it and/or modify it under !* the terms of the GNU Lesser General Public License as published by !* the Free Software Foundation, either version 3 of the License, or (at !* your option) any later version. !* !* FMS is distributed in the hope that it will be useful, but WITHOUT !* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or !* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License !* for more details. !* !* You should have received a copy of the GNU Lesser General Public !* License along with FMS. If not, see . !*********************************************************************** !> \author Fei Liu !! \link http://www.gfdl.noaa.gov/fms-cgi-bin/cvsweb.cgi/FMS/ \endlink !! !! \brief 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 NameFunctions Included
fms_modopen_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_modtime_type, set_time, get_time, get_date_julian, set_date_julian, !! set_date, length_of_year, time_manager_init, operator(-), !! operator(+), operator( // ), operator(<)
constants_modconstants_init, PI
mpp_modinput_nml_file
module astronomy_mod use fms_mod, only: 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 use time_manager_mod, only: time_type, set_time, get_time, & get_date_julian, set_date_julian, & set_date, length_of_year, & time_manager_init, & operator(-), operator(+), & operator( // ), operator(<) use constants_mod, only: constants_init, PI use mpp_mod, only: input_nml_file !-------------------------------------------------------------------- implicit none private !--------------------------------------------------------------------- !----------- version number for this module -------------------------- ! Include variable "version" to be written to log file. #include !--------------------------------------------------------------------- !------- interfaces -------- public & astronomy_init, get_period, set_period, & set_orbital_parameters, get_orbital_parameters, & set_ref_date_of_ae, get_ref_date_of_ae, & diurnal_solar, daily_mean_solar, annual_mean_solar, & astronomy_end, universal_time, orbital_time !> \page diurnal_solar diurnal_solar Interface !! !! ~~~~~~~~~~{.f90} !! 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 !! ~~~~~~~~~~{.f90} !! real, intent(in) :: gmt !! ~~~~~~~~~~ !! The time of year is set by !! ~~~~~~~~~~{.f90} !! real, intent(in) :: time_since_ae !! ~~~~~~~~~~ !! with time_type input, both of these are extracted from !! ~~~~~~~~~~{.f90} !! type(time_type), intent(in) :: time !! ~~~~~~~~~~ !! !! Separate routines exist within this interface for scalar, !! 1D or 2D input and output fields: !! !! ~~~~~~~~~~{.f90} !! 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. !! !! ~~~~~~~~~~{.f90} !! real, intent(in), optional :: dt !! type(time_type), optional :: dt_time !! ~~~~~~~~~~ !! (see test.90 for examples of the use of these types) !! !! \param [in] Latitudes of model grid points [radians] !! \param [in] Longitudes of model grid points [radians] !! \param [in] Time of day at longitude 0.0; midnight = 0.0, one day = 2 * pi [radians] !! \param [in] Time of year; autumnal equinox = 0.0, one year = 2 * pi [radians] !! \param [in]