Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mosaic cleanup and rename to grid_utils #1626

Open
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

mlee03
Copy link
Contributor

@mlee03 mlee03 commented Dec 10, 2024

Description
In this PR,

  1. The mosaic directory has been renamed to grid_utils.
  2. The files mosaic_utils.c/h have been renamed to grid_utils.c/h
  3. create_xgrid.c/h files have been moved to horiz_interp/include and have been renamed to horiz_interp_conserve_xgrid.c/h
  4. The unused files - interp.c/h, mosaic.F90, grid.F90, read_mosaic.c/h- have been removed. The sole function that is used in read_mosaic - get_global_area has been moved to grid_utils.c/h
  5. Functions used for working with the tree data structure in the great_circle algorithms have been moved from create_xgrid.c/h and grids_utils.c/h to the new files called tree_utils.c/h
  6. All non-create_xgrid methods in create_xgrid.c/h have been moved to grid_utils.c/h
  7. Unused functions in grid_utils.c/h haave been removed. These include box_area, nearest_index, tokenize, grid_box_radius, dist_between_boxes, box_ctrlat, box_ctrlon, and get_grid_area_dimen
  8. A simple unit test ensuring that create_xgrid_2dx2d_order2 can be invoked successful has been added. (The currently existing horiz_interp unit tests already test for create_xgrid_2dx2d_order1)

With these changes, grid_utils now consists of

  • constants.h
  • grid_utils.c/h
  • tree_utils.c/h
  • gradient_c2l.c/h (functions are used by gradient_mod)
  • gradient.F90 (the module is used in exchange_mod)

Grid_utils is now used by exchange, mosaic2, and horiz_interp

Horiz_interp/include now in addition holds horiz_interp_conserve_xgrid.c/h .

Fixes #1618

How Has This Been Tested?
FMS compiles with cmake and autotools. Horiz_interp unit tests pass.

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • Any dependent changes have been merged and published in downstream modules
  • New check tests, if applicable, are included
  • make distcheck passes

Copy link
Contributor

@rem1776 rem1776 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes look good, just had two small comments before i approve.

grid_utils/constant.h Show resolved Hide resolved
test_fms/horiz_interp/test_create_xgrid_order2.sh Outdated Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

FMS-fregrid consolidation I: remove mosaic directory
2 participants