Skip to content

Commit

Permalink
update global_area
Browse files Browse the repository at this point in the history
  • Loading branch information
mlee03 authored and mlee03 committed Aug 18, 2023
1 parent 48a1df8 commit 457b13a
Show file tree
Hide file tree
Showing 9 changed files with 81 additions and 966 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ list(APPEND fms_c_src_files
mosaic/gradient_c2l.c
mosaic/interp.c
mosaic/mosaic_util.c
mosaic/read_mosaic.c
mosaic/get_global_area.c
mpp/mpp_memuse.c
parser/yaml_parser_binding.c
parser/yaml_output_functions.c
Expand Down
10 changes: 5 additions & 5 deletions mosaic/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -38,22 +38,22 @@ create_xgrid.c \
gradient_c2l.c \
interp.c \
mosaic_util.c \
read_mosaic.c \
get_global_area.c \
constant.h \
create_xgrid.h \
gradient_c2l.h \
interp.h \
mosaic_util.h \
read_mosaic.h
get_global_area.h

# Some mods are dependant on other mods in this dir.
grid_mod.$(FC_MODEXT): mosaic_mod.$(FC_MODEXT)

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

Expand Down
43 changes: 43 additions & 0 deletions mosaic/get_global_area.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
/***********************************************************************
* GNU Lesser General Public License
*
* This file is part of the GFDL Flexible Modeling System (FMS).
*
* FMS is free software: you can redistribute it and/or modify it under
* the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or (at
* your option) any later version.
*
* FMS is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with FMS. If not, see <http://www.gnu.org/licenses/>.
**********************************************************************/
#include <stdlib.h>
#include <stdio.h>
#include <math.h>
#include <string.h>
#include "get_global_area.h"
#include "constant.h"

/** \file
* \ingroup mosaic
* \brief Compute global area
*/

double get_global_area(void)
{
double garea;
garea = 4*M_PI*RADIUS*RADIUS;
return garea;
}

double get_global_area_(void)
{
double garea;
garea = 4*M_PI*RADIUS*RADIUS;
return garea;
}
27 changes: 27 additions & 0 deletions mosaic/get_global_area.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
/***********************************************************************
* GNU Lesser General Public License
*
* This file is part of the GFDL Flexible Modeling System (FMS).
*
* FMS is free software: you can redistribute it and/or modify it under
* the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or (at
* your option) any later version.
*
* FMS is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with FMS. If not, see <http://www.gnu.org/licenses/>.
**********************************************************************/
#ifndef GET_GLOBAL_AREA_
#define GET_GLOBAL_AREA_

/* get global area */

double get_global_area(void);
double get_global_area_(void);

#endif
3 changes: 2 additions & 1 deletion mosaic/grid.F90
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
!> @brief Routines for grid calculations

module grid_mod
#ifdef use_deprecated_io

use mpp_mod, only : mpp_root_pe, uppercase, lowercase, FATAL, NOTE, mpp_error
use constants_mod, only : PI, radius
Expand Down Expand Up @@ -1030,7 +1031,7 @@ subroutine define_cube_mosaic ( component, domain, layout, halo, maskmap )
deallocate(is2,ie2,js2,je2)

end subroutine define_cube_mosaic

#endif
end module grid_mod
!> @}
! close documentation grouping
3 changes: 2 additions & 1 deletion mosaic/mosaic.F90
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
!> @addtogroup mosaic_mod
!> @{
module mosaic_mod
#ifdef use_deprecated_io

use mpp_mod, only : mpp_error, FATAL, mpp_pe, mpp_root_pe
use mpp_io_mod, only : MPP_MULTI
Expand Down Expand Up @@ -488,7 +489,7 @@ function parse_string(string, set, value)
return

end function parse_string

#endif
end module mosaic_mod


Expand Down
Loading

0 comments on commit 457b13a

Please sign in to comment.