Skip to content

Commit

Permalink
refactor: mosaic directory cleanup and rename to grid_utils (#1626)
Browse files Browse the repository at this point in the history
  • Loading branch information
mlee03 authored Dec 19, 2024
1 parent 33373c9 commit a5662f0
Show file tree
Hide file tree
Showing 27 changed files with 3,980 additions and 7,470 deletions.
17 changes: 8 additions & 9 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -168,9 +168,7 @@ list(APPEND fms_fortran_src_files
memutils/memutils.F90
monin_obukhov/monin_obukhov_inter.F90
monin_obukhov/monin_obukhov.F90
mosaic/gradient.F90
mosaic/grid.F90
mosaic/mosaic.F90
grid_utils/gradient.F90
mosaic2/grid2.F90
mosaic2/mosaic2.F90
mpp/mpp.F90
Expand Down Expand Up @@ -205,11 +203,10 @@ list(APPEND fms_fortran_src_files
list(APPEND fms_c_src_files
affinity/affinity.c
fms/fms_stacksize.c
mosaic/create_xgrid.c
mosaic/gradient_c2l.c
mosaic/interp.c
mosaic/mosaic_util.c
mosaic/read_mosaic.c
grid_utils/gradient_c2l.c
grid_utils/grid_utils.c
grid_utils/tree_utils.c
horiz_interp/include/horiz_interp_conserve_xgrid.c
mpp/mpp_memuse.c
parser/yaml_parser_binding.c
parser/yaml_output_functions.c
Expand Down Expand Up @@ -300,7 +297,8 @@ foreach(kind ${kinds})
# C
add_library(${libTgt}_c OBJECT ${fms_c_src_files})

target_include_directories(${libTgt}_c PRIVATE include)
target_include_directories(${libTgt}_c PRIVATE include
grid_utils)
target_compile_definitions(${libTgt}_c PRIVATE "${fms_defs}")

target_link_libraries(${libTgt}_c PRIVATE NetCDF::NetCDF_C
Expand Down Expand Up @@ -388,6 +386,7 @@ foreach(kind ${kinds})
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/monin_obukhov/include>
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/sat_vapor_pres/include>
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/field_manager/include>
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/grid_utils>
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/horiz_interp/include>
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/mosaic2/include>
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/string_utils/include>
Expand Down
3 changes: 1 addition & 2 deletions Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ SUBDIRS = \
parser \
string_utils \
affinity \
mosaic \
grid_utils \
time_manager \
axis_utils \
diag_manager \
Expand Down Expand Up @@ -147,4 +147,3 @@ install-data-hook:
@echo '| please see our page: https://www.github.com/NOAA-GFDL/FMS |'
@echo '+-------------------------------------------------------------+'
@echo ''

4 changes: 2 additions & 2 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -479,7 +479,7 @@ AC_CONFIG_FILES([
tridiagonal/Makefile
tracer_manager/Makefile
topography/Makefile
mosaic/Makefile
grid_utils/Makefile
mosaic2/Makefile
monin_obukhov/Makefile
memutils/Makefile
Expand Down Expand Up @@ -541,4 +541,4 @@ AC_OUTPUT()

if test $enable_deprecated_io = yes; then
AC_MSG_WARN(FMS_IO WILL BE DEPRECATED IN A FUTURE RLEASE. PLEASE UPDATE TO USE FMS2_IO AND REMOVE --enable-deprecated-io FROM YOUR CONFIGURE OPTIONS)
fi
fi
30 changes: 9 additions & 21 deletions mosaic/Makefile.am → grid_utils/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -28,32 +28,20 @@ AM_FCFLAGS = $(FC_MODINC). $(FC_MODOUT)$(MODDIR)

# Build these uninstalled convenience libraries.

noinst_LTLIBRARIES = libmosaic.la
noinst_LTLIBRARIES = libgrid_utils.la

libmosaic_la_SOURCES = \
mosaic.F90 \
grid.F90 \
gradient.F90 \
create_xgrid.c \
libgrid_utils_la_SOURCES = \
grid_utils.c \
grid_utils.h \
tree_utils.c \
tree_utils.h \
gradient_c2l.c \
interp.c \
mosaic_util.c \
read_mosaic.c \
constant.h \
create_xgrid.h \
gradient_c2l.h \
interp.h \
mosaic_util.h \
read_mosaic.h

# Some mods are dependant on other mods in this dir.
grid_mod.$(FC_MODEXT): mosaic_mod.$(FC_MODEXT)
gradient.F90 \
constant.h

# Mod files are built and then installed as headers.
MODFILES = \
mosaic_mod.$(FC_MODEXT) \
grid_mod.$(FC_MODEXT) \
gradient_mod.$(FC_MODEXT)
MODFILES = gradient_mod.$(FC_MODEXT)
nodist_include_HEADERS = $(MODFILES)
BUILT_SOURCES = $(MODFILES)

Expand Down
12 changes: 10 additions & 2 deletions mosaic/constant.h → grid_utils/constant.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,13 @@
* You should have received a copy of the GNU Lesser General Public
* License along with FMS. If not, see <http://www.gnu.org/licenses/>.
**********************************************************************/
#define RADIUS (6371000.)
#define STRING 255
#define RADIUS (6371000.)
#define STRING 255

#define EPSLN8 (1.e-8)
#define EPSLN15 (1.0e-15)
#define EPSLN30 (1.0e-30)
#define EPSLN10 (1.0e-10)
#define R2D (180/M_PI)
#define TPI (2.0*M_PI)
#define HPI (0.5*M_PI)
File renamed without changes.
2 changes: 1 addition & 1 deletion mosaic/gradient_c2l.c → grid_utils/gradient_c2l.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
#include <math.h>
#include <stdlib.h>
#include "constant.h"
#include "mosaic_util.h"
#include "grid_utils.h"
#include "gradient_c2l.h"
#include <stdio.h>

Expand Down
File renamed without changes.
Loading

0 comments on commit a5662f0

Please sign in to comment.