Skip to content

Commit

Permalink
mixed precision interpolator_mod (#1305)
Browse files Browse the repository at this point in the history
  • Loading branch information
mlee03 authored Aug 18, 2023
1 parent 0501ed2 commit 82e2674
Show file tree
Hide file tree
Showing 11 changed files with 1,420 additions and 4,202 deletions.
6 changes: 4 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,8 @@ foreach(kind ${kinds})
axis_utils/include
field_manager/include
time_interp/include
tracer_manager/include)
tracer_manager/include
interpolator/include)

target_compile_definitions(${libTgt}_f PRIVATE "${fms_defs}")
target_compile_definitions(${libTgt}_f PRIVATE "${${kind}_defs}")
Expand Down Expand Up @@ -361,7 +362,8 @@ foreach(kind ${kinds})
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/diag_integral/include>
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/diag_manager/include>
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/random_numbers/include>
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/tracer_manager/include>)
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/tracer_manager/include>
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/interpolator/include>)


target_include_directories(${libTgt} INTERFACE
Expand Down
7 changes: 5 additions & 2 deletions interpolator/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,17 @@
# 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)/interpolator/include
AM_FCFLAGS = $(FC_MODINC). $(FC_MODOUT)$(MODDIR)

# Build this uninstalled convenience library.
noinst_LTLIBRARIES = libinterpolator.la

# The convenience library depends on its source.
libinterpolator_la_SOURCES = interpolator.F90
libinterpolator_la_SOURCES = interpolator.F90 \
include/interpolator.inc \
include/interpolator_r4.fh \
include/interpolator_r8.fh

BUILT_SOURCES = interpolator_mod.$(FC_MODEXT)
nodist_include_HEADERS = interpolator_mod.$(FC_MODEXT)
Expand Down
1,323 changes: 436 additions & 887 deletions interpolator/include/interpolator.inc

Large diffs are not rendered by default.

70 changes: 70 additions & 0 deletions interpolator/include/interpolator_r4.fh
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
#undef FMS_INTP_KIND_
#define FMS_INTP_KIND_ r4_kind

#undef FMS_INTP_TYPE_
#define FMS_INTP_TYPE_ r4_type

#undef INTERPOLATOR_INIT_
#define INTERPOLATOR_INIT_ interpolator_init_r4

#undef FMS2IO_INTERPOLATOR_INIT_
#define FMS2IO_INTERPOLATOR_INIT_ fms2io_interpolator_init_r4

#undef GET_AXIS_LATLON_DATA_
#define GET_AXIS_LATLON_DATA_ get_axis_latlon_data_r4

#undef GET_AXIS_LEVEL_DATA_
#define GET_AXIS_LEVEL_DATA_ get_axis_level_data_r4

#undef CELL_CENTER2_
#define CELL_CENTER2_ cell_center2_r4

#undef CART_TO_LATLON_
#define CART_TO_LATLON_ cart_to_latlon_r4

#undef LATLON2XYZ_
#define LATLON2XYZ_ latlon2xyz_r4

#undef INIT_CLIM_DIAG_
#define INIT_CLIM_DIAG_ init_clim_diag_r4

#undef OBTAIN_INTERPOLATOR_TIME_SLICES_
#define OBTAIN_INTERPOLATOR_TIME_SLICES_ obtain_interpolator_time_slices_r4

#undef INTERPOLATOR_4D_
#define INTERPOLATOR_4D_ interpolator_4d_r4

#undef INTERPOLATOR_3D_
#define INTERPOLATOR_3D_ interpolator_3d_r4

#undef INTERPOLATOR_2D_
#define INTERPOLATOR_2D_ interpolator_2d_r4

#undef INTERPOLATOR_4D_NO_TIME_AXIS_
#define INTERPOLATOR_4D_NO_TIME_AXIS_ interpolator_4d_no_time_axis_r4

#undef INTERPOLATOR_3D_NO_TIME_AXIS_
#define INTERPOLATOR_3D_NO_TIME_AXIS_ interpolator_3d_no_time_axis_r4

#undef INTERPOLATOR_2D_NO_TIME_AXIS_
#define INTERPOLATOR_2D_NO_TIME_AXIS_ interpolator_2d_no_time_axis_r4

#undef READ_DATA_
#define READ_DATA_ read_data_r4

#undef READ_DATA_NO_TIME_AXIS_
#define READ_DATA_NO_TIME_AXIS_ read_data_no_time_axis_r4

#undef DIAG_READ_DATA_
#define DIAG_READ_DATA_ diag_read_data_r4

#undef INTERP_WEIGHTED_SCALAR_2D_
#define INTERP_WEIGHTED_SCALAR_2D_ interp_weighted_scalar_2d_r4

#undef INTERP_WEIGHTED_SCALAR_1D_
#define INTERP_WEIGHTED_SCALAR_1D_ interp_weighted_scalar_1d_r4

#undef INTERP_LINEAR_
#define INTERP_LINEAR_ interp_linear_r4

#include "interpolator.inc"
70 changes: 70 additions & 0 deletions interpolator/include/interpolator_r8.fh
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
#undef FMS_INTP_KIND_
#define FMS_INTP_KIND_ r8_kind

#undef FMS_INTP_TYPE_
#define FMS_INTP_TYPE_ r8_type

#undef INTERPOLATOR_INIT_
#define INTERPOLATOR_INIT_ interpolator_init_r8

#undef FMS2IO_INTERPOLATOR_INIT_
#define FMS2IO_INTERPOLATOR_INIT_ fms2io_interpolator_init_r8

#undef GET_AXIS_LATLON_DATA_
#define GET_AXIS_LATLON_DATA_ get_axis_latlon_data_r8

#undef GET_AXIS_LEVEL_DATA_
#define GET_AXIS_LEVEL_DATA_ get_axis_level_data_r8

#undef CELL_CENTER2_
#define CELL_CENTER2_ cell_center2_r8

#undef CART_TO_LATLON_
#define CART_TO_LATLON_ cart_to_latlon_r8

#undef LATLON2XYZ_
#define LATLON2XYZ_ latlon2xyz_r8

#undef INIT_CLIM_DIAG_
#define INIT_CLIM_DIAG_ init_clim_diag_r8

#undef OBTAIN_INTERPOLATOR_TIME_SLICES_
#define OBTAIN_INTERPOLATOR_TIME_SLICES_ obtain_interpolator_time_slices_r8

#undef INTERPOLATOR_4D_
#define INTERPOLATOR_4D_ interpolator_4D_r8

#undef INTERPOLATOR_3D_
#define INTERPOLATOR_3D_ interpolator_3D_r8

#undef INTERPOLATOR_2D_
#define INTERPOLATOR_2D_ interpolator_2D_r8

#undef INTERPOLATOR_4D_NO_TIME_AXIS_
#define INTERPOLATOR_4D_NO_TIME_AXIS_ interpolator_4D_no_time_axis_r8

#undef INTERPOLATOR_3D_NO_TIME_AXIS_
#define INTERPOLATOR_3D_NO_TIME_AXIS_ interpolator_3D_no_time_axis_r8

#undef INTERPOLATOR_2D_NO_TIME_AXIS_
#define INTERPOLATOR_2D_NO_TIME_AXIS_ interpolator_2D_no_time_axis_r8

#undef READ_DATA_
#define READ_DATA_ read_data_r8

#undef READ_DATA_NO_TIME_AXIS_
#define READ_DATA_NO_TIME_AXIS_ read_data_no_time_axis_r8

#undef DIAG_READ_DATA_
#define DIAG_READ_DATA_ diag_read_data_r8

#undef INTERP_WEIGHTED_SCALAR_2D_
#define INTERP_WEIGHTED_SCALAR_2D_ interp_weighted_scalar_2d_r8

#undef INTERP_WEIGHTED_SCALAR_1D_
#define INTERP_WEIGHTED_SCALAR_1D_ interp_weighted_scalar_1d_r8

#undef INTERP_LINEAR_
#define INTERP_LINEAR_ interp_linear_r8

#include "interpolator.inc"
Loading

0 comments on commit 82e2674

Please sign in to comment.