diff --git a/CHANGELOG.md b/CHANGELOG.md index 32cc50cd27..2c616e647d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -20,7 +20,7 @@ sequential patch number (starting from `01`). - LIBFMS: The libFMS.F90 file (module name `fms`) meant to provide global access has been updated to include 'fms' and it's module/subdirectory name as prefixes for all names. This will only affect external codes that are already using the global module (via `use fms`) and not individual modules. - MIXED PRECISION: Updates the axis_utils2, horiz_interp, sat_vapor_pressure, and axis_utils subdirectories to support mixed precision real values. - FMS2_IO: Added in mpp_scatter and mpp_gather performance changes from the 2023.01.01 patch. See below for more details. -- FMS2_IO: Improved error messages to give more debugging information +- FMS2_IO: Improved error messages to give more debugging information - FMS_MOD: Changed fms_init to include a system call to set the stack size to unlimited, removed previously added stack size fixes - MONIN_OBUKHOV: Restructures the subroutines in `stable_mix` interface so that 1d calls the underlying implementation, and 2 and 3d call it on 1d slices of the data as opposed to passing in mismatched arrays. - MPP: Updates from JEDI for ajoint version the mpp halo filling (mpp_do_update_ad.fh), adds checkpoint for forward buffer information. diff --git a/CMakeLists.txt b/CMakeLists.txt index ff75d3cf90..f5ef9a7d38 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -305,12 +305,26 @@ foreach(kind ${kinds}) fms2_io/include string_utils/include mpp/include + column_diagnostics/include + monin_obukhov/include sat_vapor_pres/include horiz_interp/include + diag_integral/include + random_numbers/include diag_manager/include constants4 + topography/include + axis_utils/include + mosaic2/include constants - axis_utils/include) + astronomy/include + field_manager/include + time_interp/include + tracer_manager/include + interpolator/include + coupler/include + data_override/include) + target_compile_definitions(${libTgt}_f PRIVATE "${fms_defs}") target_compile_definitions(${libTgt}_f PRIVATE "${${kind}_defs}") @@ -346,11 +360,25 @@ 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..48e314efd8 100644 --- a/astronomy/astronomy.F90 +++ b/astronomy/astronomy.F90 @@ -29,296 +29,321 @@ 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 fms_io_utils_mod, only: get_data_type_string + 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]