diff --git a/CMakeLists.txt b/CMakeLists.txt index ff75d3cf90..86826add70 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -305,12 +305,21 @@ foreach(kind ${kinds}) fms2_io/include string_utils/include mpp/include + monin_obukhov/include sat_vapor_pres/include horiz_interp/include + diag_integral/include + random_numbers/include diag_manager/include constants4 + axis_utils/include constants - axis_utils/include) + astronomy/include + field_manager/include + time_interp/include + tracer_manager/include + interpolator/include) + target_compile_definitions(${libTgt}_f PRIVATE "${fms_defs}") target_compile_definitions(${libTgt}_f PRIVATE "${${kind}_defs}") @@ -346,11 +355,19 @@ foreach(kind ${kinds}) $ $ $ + $ + $ $ + $ $ $ $ - $) + $ + $ + $ + $ + $) + target_include_directories(${libTgt} INTERFACE $ diff --git a/astronomy/Makefile.am b/astronomy/Makefile.am index 33d4acaf3c..50a1449412 100644 --- a/astronomy/Makefile.am +++ b/astronomy/Makefile.am @@ -23,14 +23,23 @@ # Ed Hartnett 2/22/19 # Include .h and .mod files. -AM_CPPFLAGS = -I$(top_srcdir)/include +AM_CPPFLAGS = -I$(top_srcdir)/include -I$(top_srcdir)/astronomy/include AM_FCFLAGS = $(FC_MODINC). $(FC_MODOUT)$(MODDIR) # Build this uninstalled convenience library. noinst_LTLIBRARIES = libastronomy.la # The convenience library depends on its source. -libastronomy_la_SOURCES = astronomy.F90 +libastronomy_la_SOURCES = \ + astronomy.F90 \ + include/astronomy_r4.fh \ + include/astronomy_r8.fh \ + include/astronomy.inc + +astronomy.$(FC_MODEXT): \ +include/astronomy_r4.fh \ +include/astronomy_r8.fh \ +include/astronomy.inc BUILT_SOURCES = astronomy_mod.$(FC_MODEXT) nodist_include_HEADERS = astronomy_mod.$(FC_MODEXT) diff --git a/astronomy/astronomy.F90 b/astronomy/astronomy.F90 index 192fc8f22a..0a7af2cc6e 100644 --- a/astronomy/astronomy.F90 +++ b/astronomy/astronomy.F90 @@ -29,296 +29,320 @@ module astronomy_mod -use fms_mod, only: fms_init, & - mpp_pe, mpp_root_pe, stdlog, & - write_version_number, & - check_nml_error, error_mesg, & - FATAL, NOTE, WARNING -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 -------------------------- + use fms_mod, only: fms_init, & + mpp_pe, mpp_root_pe, stdlog, & + write_version_number, & + check_nml_error, error_mesg, & + FATAL, NOTE, WARNING + 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 + use platform_mod, only: r4_kind, r8_kind, i4_kind, i8_kind + + !-------------------------------------------------------------------- + + 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 - -!> @} - -!> @brief Calculates solar information for the given location(lat & lon) and time -!! -!> ~~~~~~~~~~{.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 -!! ~~~~~~~~~~ -!! -!! @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]