diff --git a/CMakeLists.txt b/CMakeLists.txt
index ff75d3cf90..5e84858862 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -201,7 +201,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
diff --git a/mosaic/Makefile.am b/mosaic/Makefile.am
index d097207105..4aac5e4608 100644
--- a/mosaic/Makefile.am
+++ b/mosaic/Makefile.am
@@ -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)
diff --git a/mosaic/get_global_area.c b/mosaic/get_global_area.c
new file mode 100644
index 0000000000..daba49b0f9
--- /dev/null
+++ b/mosaic/get_global_area.c
@@ -0,0 +1,57 @@
+/***********************************************************************
+ * 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 .
+ **********************************************************************/
+#include
+#include
+#include
+#include
+#include "get_global_area.h"
+#include "constant.h"
+
+/** \file
+ * \ingroup mosaic
+ * \brief Compute global area
+ */
+
+#ifdef OVERLOAD_R4
+float get_global_area(void)
+{
+ float garea;
+#else
+ double get_global_area(void)
+{
+ double garea;
+#endif
+ garea = 4*M_PI*RADIUS*RADIUS;
+
+ return garea;
+}
+
+#ifdef OVERLOAD_R4
+ float get_global_area_(void)
+{
+ float garea;
+#else
+ double get_global_area_(void)
+{
+ double garea;
+#endif
+ garea = 4*M_PI*RADIUS*RADIUS;
+
+ return garea;
+}
diff --git a/mosaic/get_global_area.h b/mosaic/get_global_area.h
new file mode 100644
index 0000000000..271c5d362f
--- /dev/null
+++ b/mosaic/get_global_area.h
@@ -0,0 +1,45 @@
+/***********************************************************************
+ * 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 .
+ **********************************************************************/
+#ifndef GET_GLOBAL_AREA_
+#define GET_GLOBAL_AREA_
+
+/* get global area */
+
+
+#ifdef OVERLOAD_R4
+
+float get_global_area(void);
+
+#else
+
+double get_global_area(void);
+
+#endif
+
+#ifdef OVERLOAD_R4
+
+float get_global_area_(void);
+
+#else
+
+double get_global_area_(void);
+
+#endif /* OVERLOAD_R4 */
+
+#endif
diff --git a/mosaic/read_mosaic.c b/mosaic/read_mosaic.c
deleted file mode 100644
index b855d4267b..0000000000
--- a/mosaic/read_mosaic.c
+++ /dev/null
@@ -1,838 +0,0 @@
-/***********************************************************************
- * 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 .
- **********************************************************************/
-#include
-#include
-#include
-#include
-#include "read_mosaic.h"
-#include "constant.h"
-#include "mosaic_util.h"
-#ifdef use_netCDF
-#include
-#endif
-
-/** \file
- * \ingroup mosaic
- * \brief Support for reading mosaic netcdf grid files.
- */
-
-/*********************************************************************
- void netcdf_error( int status )
- status is the returning value of netcdf call. this routine will
- handle the error when status is not NC_NOERR.
-********************************************************************/
-void handle_netcdf_error(const char *msg, int status )
-{
- char errmsg[512];
-
- sprintf( errmsg, "%s: %s", msg, (char *)nc_strerror(status) );
- error_handler(errmsg);
-
-} /* handle_netcdf_error */
-
-/***************************************************************************
- void get_file_dir(const char *file, char *dir)
- get the directory where file is located. The dir will be the complate path
- before the last "/". If no "/" exist in file, the path will be current ".".
-***************************************************************************/
-void get_file_dir(const char *file, char *dir)
-{
- int len;
- const char *strptr = NULL;
-
- /* get the diretory */
-
- strptr = strrchr(file, '/');
- if(strptr) {
- len = strptr - file;
- strncpy(dir, file, len);
- }
- else {
- len = 1;
- strcpy(dir, ".");
- }
- dir[len] = 0;
-
-} /* get_file_dir */
-
-
-int field_exist(const char* file, const char *name)
-{
- int ncid, varid, status;
- char msg[512];
- int existed=0;
-
-#ifdef use_netCDF
-
- status = nc_open(file, NC_NOWRITE, &ncid);
- if(status != NC_NOERR) {
- sprintf(msg, "field_exist: in opening file %s", file);
- handle_netcdf_error(msg, status);
- }
-
- status = nc_inq_varid(ncid, name, &varid);
- if(status == NC_NOERR){
- existed = 1;
- }
-
- status = nc_close(ncid);
- if(status != NC_NOERR) {
- sprintf(msg, "field_exist: in closing file %s.", file);
- handle_netcdf_error(msg, status);
- }
-
-#else /* ndef use_netCDF */
- error_handler("read_mosaic: Add flag -Duse_netCDF when compiling");
-#endif /* use_netcdf */
-
- return existed;
-
-} /* field_exist */
-
-int get_dimlen(const char* file, const char *name)
-{
- int ncid, dimid, status, len;
- size_t size;
- char msg[512];
-
- len = 0;
-#ifdef use_netCDF
- status = nc_open(file, NC_NOWRITE, &ncid);
- if(status != NC_NOERR) {
- sprintf(msg, "in opening file %s", file);
- handle_netcdf_error(msg, status);
- }
-
- status = nc_inq_dimid(ncid, name, &dimid);
- if(status != NC_NOERR) {
- sprintf(msg, "in getting dimid of %s from file %s.", name, file);
- handle_netcdf_error(msg, status);
- }
-
- status = nc_inq_dimlen(ncid, dimid, &size);
- if(status != NC_NOERR) {
- sprintf(msg, "in getting dimension size of %s from file %s.", name, file);
- handle_netcdf_error(msg, status);
- }
- status = nc_close(ncid);
- if(status != NC_NOERR) {
- sprintf(msg, "in closing file %s.", file);
- handle_netcdf_error(msg, status);
- }
-
- len = size;
- if(status != NC_NOERR) {
- sprintf(msg, "in closing file %s", file);
- handle_netcdf_error(msg, status);
- }
-#else
- error_handler("read_mosaic: Add flag -Duse_netCDF when compiling");
-#endif
-
- return len;
-
-} /* get_dimlen */
-
-/*******************************************************************************
- void get_string_data(const char *file, const char *name, char *data)
- get string data of field with "name" from "file".
-******************************************************************************/
-void get_string_data(const char *file, const char *name, char *data)
-{
- int ncid, varid, status;
- char msg[512];
-
-#ifdef use_netCDF
- status = nc_open(file, NC_NOWRITE, &ncid);
- if(status != NC_NOERR) {
- sprintf(msg, "in opening file %s", file);
- handle_netcdf_error(msg, status);
- }
- status = nc_inq_varid(ncid, name, &varid);
- if(status != NC_NOERR) {
- sprintf(msg, "in getting varid of %s from file %s.", name, file);
- handle_netcdf_error(msg, status);
- }
- status = nc_get_var_text(ncid, varid, data);
- if(status != NC_NOERR) {
- sprintf(msg, "in getting data of %s from file %s.", name, file);
- handle_netcdf_error(msg, status);
- }
- status = nc_close(ncid);
- if(status != NC_NOERR) {
- sprintf(msg, "in closing file %s.", file);
- handle_netcdf_error(msg, status);
- }
-#else
- error_handler("read_mosaic: Add flag -Duse_netCDF when compiling");
-#endif
-
-} /* get_string_data */
-
-/*******************************************************************************
- void get_string_data_level(const char *file, const char *name, const size_t *start, const size_t *nread, char *data)
- get string data of field with "name" from "file".
-******************************************************************************/
-void get_string_data_level(const char *file, const char *name, char *data, const unsigned int *level)
-{
- int ncid, varid, status, i;
- size_t start[4], nread[4];
- char msg[512];
-
-#ifdef use_netCDF
- status = nc_open(file, NC_NOWRITE, &ncid);
- if(status != NC_NOERR) {
- sprintf(msg, "in opening file %s", file);
- handle_netcdf_error(msg, status);
- }
- status = nc_inq_varid(ncid, name, &varid);
- if(status != NC_NOERR) {
- sprintf(msg, "in getting varid of %s from file %s.", name, file);
- handle_netcdf_error(msg, status);
- }
- for(i=0; i<4; i++) {
- start[i] = 0; nread[i] = 1;
- }
- start[0] = *level; nread[1] = STRING;
- status = nc_get_vara_text(ncid, varid, start, nread, data);
- if(status != NC_NOERR) {
- sprintf(msg, "in getting data of %s from file %s.", name, file);
- handle_netcdf_error(msg, status);
- }
- status = nc_close(ncid);
- if(status != NC_NOERR) {
- sprintf(msg, "in closing file %s.", file);
- handle_netcdf_error(msg, status);
- }
-#else
- error_handler("read_mosaic: Add flag -Duse_netCDF when compiling");
-#endif
-
-} /* get_string_data_level */
-
-
-/*******************************************************************************
- void get_var_data(const char *file, const char *name, double *data)
- get var data of field with "name" from "file".
-******************************************************************************/
-void get_var_data(const char *file, const char *name, void *data)
-{
-
- int ncid, varid, status;
- nc_type vartype;
- char msg[512];
-
-#ifdef use_netCDF
- status = nc_open(file, NC_NOWRITE, &ncid);
- if(status != NC_NOERR) {
- sprintf(msg, "in opening file %s", file);
- handle_netcdf_error(msg, status);
- }
- status = nc_inq_varid(ncid, name, &varid);
- if(status != NC_NOERR) {
- sprintf(msg, "in getting varid of %s from file %s.", name, file);
- handle_netcdf_error(msg, status);
- }
-
- status = nc_inq_vartype(ncid, varid, &vartype);
- if(status != NC_NOERR) {
- sprintf(msg, "get_var_data: in getting vartype of of %s in file %s ", name, file);
- handle_netcdf_error(msg, status);
- }
-
- switch (vartype) {
- case NC_DOUBLE:case NC_FLOAT:
-#ifdef OVERLOAD_R4
- status = nc_get_var_float(ncid, varid, (float *)data);
-#else
- status = nc_get_var_double(ncid, varid, (double *)data);
-#endif
- break;
- case NC_INT:
- status = nc_get_var_int(ncid, varid, (int *)data);
- break;
- default:
- sprintf(msg, "get_var_data: field %s in file %s has an invalid type, "
- "the type should be NC_DOUBLE, NC_FLOAT or NC_INT", name, file);
- error_handler(msg);
- }
- if(status != NC_NOERR) {
- sprintf(msg, "in getting data of %s from file %s.", name, file);
- handle_netcdf_error(msg, status);
- }
- status = nc_close(ncid);
- if(status != NC_NOERR) {
- sprintf(msg, "in closing file %s.", file);
- handle_netcdf_error(msg, status);
- }
-#else
- error_handler("read_mosaic: Add flag -Duse_netCDF when compiling");
-#endif
-
-} /* get_var_data */
-
-/*******************************************************************************
- void get_var_data(const char *file, const char *name, double *data)
- get var data of field with "name" from "file".
-******************************************************************************/
-void get_var_data_region(const char *file, const char *name, const size_t *start, const size_t *nread, void *data)
-{
-
- int ncid, varid, status;
- nc_type vartype;
- char msg[512];
-
-#ifdef use_netCDF
- status = nc_open(file, NC_NOWRITE, &ncid);
- if(status != NC_NOERR) {
- sprintf(msg, "get_var_data_region: in opening file %s", file);
- handle_netcdf_error(msg, status);
- }
- status = nc_inq_varid(ncid, name, &varid);
- if(status != NC_NOERR) {
- sprintf(msg, "in getting varid of %s from file %s.", name, file);
- handle_netcdf_error(msg, status);
- }
-
- status = nc_inq_vartype(ncid, varid, &vartype);
- if(status != NC_NOERR) {
- sprintf(msg, "get_var_data_region: in getting vartype of of %s in file %s ", name, file);
- handle_netcdf_error(msg, status);
- }
-
- switch (vartype) {
- case NC_DOUBLE:case NC_FLOAT:
-#ifdef OVERLOAD_R4
- status = nc_get_vara_float(ncid, varid, start, nread, (float *)data);
-#else
- status = nc_get_vara_double(ncid, varid, start, nread, (double *)data);
-#endif
- break;
- case NC_INT:
- status = nc_get_vara_int(ncid, varid, start, nread, (int *)data);
- break;
- default:
- sprintf(msg, "get_var_data_region: field %s in file %s has an invalid type, "
- "the type should be NC_DOUBLE, NC_FLOAT or NC_INT", name, file);
- error_handler(msg);
- }
-
- if(status != NC_NOERR) {
- sprintf(msg, "get_var_data_region: in getting data of %s from file %s.", name, file);
- handle_netcdf_error(msg, status);
- }
- status = nc_close(ncid);
- if(status != NC_NOERR) {
- sprintf(msg, "get_var_data_region: in closing file %s.", file);
- handle_netcdf_error(msg, status);
- }
-#else
- error_handler("read_mosaic: Add flag -Duse_netCDF when compiling");
-#endif
-
-} /* get_var_data_region */
-
-/******************************************************************************
- void get_var_text_att(const char *file, const char *name, const char *attname, char *att)
- get text attribute of field 'name' from 'file
-******************************************************************************/
-void get_var_text_att(const char *file, const char *name, const char *attname, char *att)
-{
- int ncid, varid, status;
- char msg[512];
-
-#ifdef use_netCDF
- status = nc_open(file, NC_NOWRITE, &ncid);
- if(status != NC_NOERR) {
- sprintf(msg, "in opening file %s", file);
- handle_netcdf_error(msg, status);
- }
- status = nc_inq_varid(ncid, name, &varid);
- if(status != NC_NOERR) {
- sprintf(msg, "in getting varid of %s from file %s.", name, file);
- handle_netcdf_error(msg, status);
- }
- status = nc_get_att_text(ncid, varid, attname, att);
- if(status != NC_NOERR) {
- sprintf(msg, "in getting attribute %s of %s from file %s.", attname, name, file);
- handle_netcdf_error(msg, status);
- }
- status = nc_close(ncid);
- if(status != NC_NOERR) {
- sprintf(msg, "in closing file %s.", file);
- handle_netcdf_error(msg, status);
- }
-#else
- error_handler("read_mosaic: Add flag -Duse_netCDF when compiling");
-#endif
-
-} /* get_var_text_att */
-
-/***********************************************************************
- return number of overlapping cells.
-***********************************************************************/
-int read_mosaic_xgrid_size_( const char *xgrid_file )
-{
- return read_mosaic_xgrid_size(xgrid_file);
-}
-
-int read_mosaic_xgrid_size( const char *xgrid_file )
-{
- int ncells;
-
- ncells = get_dimlen(xgrid_file, "ncells");
- return ncells;
-}
-
-#ifdef OVERLOAD_R4
-float get_global_area(void)
-{
- float garea;
-#else
- double get_global_area(void)
- {
- double garea;
-#endif
- garea = 4*M_PI*RADIUS*RADIUS;
-
- return garea;
- }
-
-#ifdef OVERLOAD_R4
- float get_global_area_(void)
- {
- float garea;
-#else
- double get_global_area_(void)
- {
- double garea;
-#endif
- garea = 4*M_PI*RADIUS*RADIUS;
-
- return garea;
- }
-
-
- /****************************************************************************/
-#ifdef OVERLOAD_R4
- void read_mosaic_xgrid_order1_(const char *xgrid_file, int *i1, int *j1, int *i2, int *j2, float *area )
-#else
- void read_mosaic_xgrid_order1_(const char *xgrid_file, int *i1, int *j1, int *i2, int *j2, double *area )
-#endif
- {
- read_mosaic_xgrid_order1(xgrid_file, i1, j1, i2, j2, area);
-
- }
-
-#ifdef OVERLOAD_R4
- void read_mosaic_xgrid_order1(const char *xgrid_file, int *i1, int *j1, int *i2, int *j2, float *area )
-#else
- void read_mosaic_xgrid_order1(const char *xgrid_file, int *i1, int *j1, int *i2, int *j2, double *area )
-#endif
- {
- int ncells, n;
- int *tile1_cell, *tile2_cell;
-#ifdef OVERLOAD_R4
- float garea;
-#else
- double garea;
-#endif
-
- ncells = get_dimlen(xgrid_file, "ncells");
-
- tile1_cell = (int *)malloc(ncells*2*sizeof(int));
- tile2_cell = (int *)malloc(ncells*2*sizeof(int));
- get_var_data(xgrid_file, "tile1_cell", tile1_cell);
- get_var_data(xgrid_file, "tile2_cell", tile2_cell);
-
- get_var_data(xgrid_file, "xgrid_area", area);
-
- garea = 4*M_PI*RADIUS*RADIUS;
-
- for(n=0; n istart_in ) {
- istart_out[0] = istart_in - 1;
- iend_out[0] = iend_in - refine_ratio;
- }
- else {
- istart_out[0] = istart_in - refine_ratio;
- iend_out[0] = iend_in - 1;
- }
-
- if( istart_out[0]%refine_ratio || iend_out[0]%refine_ratio)
- error_handler("Error from read_mosaic: mismatch between refine_ratio and istart_in/iend_in");
- istart_out[0] /= refine_ratio;
- iend_out[0] /= refine_ratio;
- }
-
- return type;
-
- }
-
-
- void read_mosaic_contact(const char *mosaic_file, int *tile1, int *tile2, int *istart1, int *iend1,
- int *jstart1, int *jend1, int *istart2, int *iend2, int *jstart2, int *jend2)
- {
- char contacts[STRING];
- char **gridtiles;
-#define MAXVAR 40
- char pstring[MAXVAR][STRING];
- unsigned int nstr, ntiles, ncontacts, n, m, l, found;
- const int x_refine = 2, y_refine = 2;
- int i1_type, j1_type, i2_type, j2_type;
-
- ntiles = get_dimlen(mosaic_file, "ntiles");
- gridtiles = (char **)malloc(ntiles*sizeof(char *));
- for(n=0; n '9' || pstring[m][l] < '0' ) {
- error_handler("Error from read_mosaic: some of the character in "
- "contact_indices except token is not digit number");
- }
- }
- }
- istart1[n] = atoi(pstring[0]);
- iend1[n] = atoi(pstring[1]);
- jstart1[n] = atoi(pstring[2]);
- jend1[n] = atoi(pstring[3]);
- istart2[n] = atoi(pstring[4]);
- iend2[n] = atoi(pstring[5]);
- jstart2[n] = atoi(pstring[6]);
- jend2[n] = atoi(pstring[7]);
- i1_type = transfer_to_model_index(istart1[n], iend1[n], istart1+n, iend1+n, x_refine);
- j1_type = transfer_to_model_index(jstart1[n], jend1[n], jstart1+n, jend1+n, y_refine);
- i2_type = transfer_to_model_index(istart2[n], iend2[n], istart2+n, iend2+n, x_refine);
- j2_type = transfer_to_model_index(jstart2[n], jend2[n], jstart2+n, jend2+n, y_refine);
- if( i1_type == 0 && j1_type == 0 )
- error_handler("Error from read_mosaic_contact:istart1==iend1 and jstart1==jend1");
- if( i2_type == 0 && j2_type == 0 )
- error_handler("Error from read_mosaic_contact:istart2==iend2 and jstart2==jend2");
- if( i1_type + j1_type != i2_type + j2_type )
- error_handler("Error from read_mosaic_contact: It is not a line or overlap contact");
-
- }
-
- for(m=0; m.
- **********************************************************************/
-#ifndef READ_MOSAIC_H_
-#define READ_MOSAIC_H_
-
-/* netcdf helpers */
-/* perhaps should consider making static, or breaking out into seperate file,
- some of these names (field_exist) could pollute namespace... */
-
-void handle_netcdf_error(const char *msg, int status );
-
-void get_file_dir(const char *file, char *dir);
-
-int field_exist(const char* file, const char *name);
-
-int get_dimlen(const char* file, const char *name);
-
-void get_string_data_level(const char *file, const char *name, char *data, const unsigned int* level);
-
-void get_var_data(const char *file, const char *name, void *data);
-
-void get_var_data_region(const char *file, const char *name, const size_t *start, const size_t *nread, void *data);
-
-void get_string_data(const char *file, const char *name, char *data);
-
-void get_var_text_att(const char *file, const char *name, const char *attname, char *att);
-/* end netcdf helpers */
-
-int read_mosaic_xgrid_size( const char *xgrid_file );
-
-#ifdef OVERLOAD_R4
-
-void read_mosaic_xgrid_order1(const char *xgrid_file, int *i1, int *j1, int *i2, int *j2, float *area );
-
-void read_mosaic_xgrid_order1_region(const char *xgrid_file, int *i1, int *j1, int *i2, int *j2, float *area, int *isc, int *iec );
-
-void read_mosaic_xgrid_order2(const char *xgrid_file, int *i1, int *j1, int *i2, int *j2,
- float *area, float *di, float *dj );
-
-float get_global_area(void);
-
-#else
-
-void read_mosaic_xgrid_order1(const char *xgrid_file, int *i1, int *j1, int *i2, int *j2, double *area );
-
-void read_mosaic_xgrid_order1_region(const char *xgrid_file, int *i1, int *j1, int *i2, int *j2, double *area, int *isc, int *iec );
-
-void read_mosaic_xgrid_order2(const char *xgrid_file, int *i1, int *j1, int *i2, int *j2,
- double *area, double *di, double *dj );
-
-double get_global_area(void);
-
-#endif
-
-int read_mosaic_ntiles(const char *mosaic_file);
-
-int read_mosaic_ncontacts(const char *mosaic_file);
-
-void read_mosaic_grid_sizes(const char *mosaic_file, int *nx, int *ny);
-
-void read_mosaic_contact(const char *mosaic_file, int *tile1, int *tile2, int *istart1, int *iend1,
- int *jstart1, int *jend1, int *istart2, int *iend2, int *jstart2, int *jend2);
-
-int transfer_to_model_index(int istart_in, int iend_in, int *istart_out, int *iend_out, int refine_ratio);
-
-void read_mosaic_grid_data(const char *mosaic_file, const char *name, int nx, int ny,
- double *data, unsigned int level, int ioff, int joff);
-
-
-void read_mosaic_contact_(const char *mosaic_file, int *tile1, int *tile2, int *istart1, int *iend1,
- int *jstart1, int *jend1, int *istart2, int *iend2, int *jstart2, int *jend2);
-
-int read_mosaic_xgrid_size_( const char *xgrid_file );
-
-int read_mosaic_ntiles_(const char *mosaic_file);
-
-int read_mosaic_ncontacts_(const char *mosaic_file);
-
-void read_mosaic_grid_sizes_(const char *mosaic_file, int *nx, int *ny);
-
-#ifdef OVERLOAD_R4
-
-float get_global_area_(void);
-
-void read_mosaic_xgrid_order1_(const char *xgrid_file, int *i1, int *j1, int *i2, int *j2, float *area );
-
-void read_mosaic_xgrid_order1_region_(const char *xgrid_file, int *i1, int *j1, int *i2, int *j2, float *area, int *isc, int *iec );
-
-void read_mosaic_xgrid_order2_(const char *xgrid_file, int *i1, int *j1, int *i2, int *j2, float *area, float *di, float *dj );
-
-#else
-
-double get_global_area_(void);
-
-void read_mosaic_xgrid_order1_(const char *xgrid_file, int *i1, int *j1, int *i2, int *j2, double *area );
-
-void read_mosaic_xgrid_order1_region_(const char *xgrid_file, int *i1, int *j1, int *i2, int *j2, double *area, int *isc, int *iec );
-
-void read_mosaic_xgrid_order2_(const char *xgrid_file, int *i1, int *j1, int *i2, int *j2, double *area, double *di, double *dj );
-
-#endif /* OVERLOAD_R4 */
-
-#endif