|
FMS
2025.04
Flexible Modeling System
|
A set of utilities for manipulating axes and extracting axis attributes. FMS2_IO equivalent version of axis_utils_mod. More...
Data Types | |
| interface | axis_edges |
| Perform 1D interpolation between grids. More... | |
Functions/Subroutines | |
| subroutine | axis_edges_ (fileobj, name, edge_data, reproduce_null_char_bug_flag) |
| get axis edge data from a given file More... | |
| subroutine | find_index_ (grid1, xs, xe, ks, ke) |
| real(kind=fms_au_kind_) function | frac_index_ (rval, array) |
| subroutine, public | get_axis_cart (fileobj, axisname, cart) |
| Returns X,Y,Z or T cartesian attribute. More... | |
| logical function, public | get_axis_modulo (fileobj, axisname) |
| Checks if 'modulo' variable exists for a given axis. More... | |
| logical function, public | get_axis_modulo_times (fileobj, axisname, tbeg, tend) |
| subroutine | interp_1d_1d_ (grid1, grid2, data1, data2, method, yp1, yp2) |
| subroutine | interp_1d_2d_ (grid1, grid2, data1, data2) |
| subroutine | interp_1d_3d_ (grid1, grid2, data1, data2, method, yp1, yp2) |
| subroutine | interp_1d_cubic_spline_ (grid1, grid2, data1, data2, yp1, ypn) |
| subroutine | interp_1d_linear_ (grid1, grid2, data1, data2) |
| real(kind=fms_au_kind_) function | lon_in_range_ (lon, l_strt) |
| Returns lon_strt <= longitude <= lon_strt+360. More... | |
| integer function | nearest_index_ (rval, array) |
| Return index of nearest point along axis. More... | |
| subroutine | tranlon_ (lon, lon_start, istrt) |
| Returns monotonic array of longitudes s.t., lon_strt <= lon(:) < lon_strt+360. More... | |
Variables | |
| real(r8_kind), parameter | epsln = 1.e-10_r8_kind |
| real(r8_kind), parameter | f360 = 360.0_r8_kind |
| real(r8_kind), parameter | fp5 = 0.5_r8_kind |
A set of utilities for manipulating axes and extracting axis attributes. FMS2_IO equivalent version of axis_utils_mod.
| interface axis_utils2_mod::axis_edges |
Perform 1D interpolation between grids.
Data and grids can have 1, 2, or 3 dimensions.
| grid1 | grid for data1 | |
| grid2 | grid for data2 | |
| data1 | Data to interpolate | |
| [in,out] | data2 | Interpolated data |
| method | Either "linear" or "cubic_spline" interpolation method, default="linear" |
Definition at line 59 of file axis_utils2.F90.
Private Member Functions | |
| axis_edges_r4 | |
| axis_edges_r8 | |
| subroutine axis_edges_ | ( | class(fmsnetcdffile_t), intent(in) | fileobj, |
| character(len=*), intent(in) | name, | ||
| real(fms_au_kind_), dimension(:), intent(out) | edge_data, | ||
| logical, intent(in), optional | reproduce_null_char_bug_flag | ||
| ) |
get axis edge data from a given file
| [in] | fileobj | File object to read from |
| [in] | name | Name of a given axis |
| [out] | edge_data | Returned edge data from given axis name |
| [in] | reproduce_null_char_bug_flag | Flag indicating to reproduce the mpp_io bug where the null characters were not removed after reading a string attribute |
Definition at line 28 of file axis_utils2.inc.
| real(kind=fms_au_kind_) function frac_index_ | ( | real(kind=fms_au_kind_) | rval, |
| real(kind=fms_au_kind_), dimension(:) | array | ||
| ) |
| rval | arbitrary data...same units as elements in "array" |
| array | array of data points (must be monotonically increasing) |
Definition at line 225 of file axis_utils2.inc.
| subroutine, public axis_utils2_mod::get_axis_cart | ( | type(fmsnetcdffile_t), intent(in) | fileobj, |
| character(len=*), intent(in) | axisname, | ||
| character(len=1), intent(out) | cart | ||
| ) |
Returns X,Y,Z or T cartesian attribute.
| [in] | fileobj | file object to read from |
| [in] | axisname | name of axis to retrieve |
| [out] | cart | Returned attribute axis |
Definition at line 103 of file axis_utils2.F90.
| logical function, public axis_utils2_mod::get_axis_modulo | ( | type(fmsnetcdffile_t), intent(in) | fileobj, |
| character(len=*), intent(in) | axisname | ||
| ) |
Checks if 'modulo' variable exists for a given axis.
Definition at line 178 of file axis_utils2.F90.
| logical function, public axis_utils2_mod::get_axis_modulo_times | ( | type(fmsnetcdffile_t), intent(in) | fileobj, |
| character(len=*), intent(in) | axisname, | ||
| character(len=*), intent(out) | tbeg, | ||
| character(len=*), intent(out) | tend | ||
| ) |
Definition at line 188 of file axis_utils2.F90.
| real(kind=fms_au_kind_) function lon_in_range_ | ( | real(kind=fms_au_kind_), intent(in) | lon, |
| real(kind=fms_au_kind_), intent(in) | l_strt | ||
| ) |
Returns lon_strt <= longitude <= lon_strt+360.
Definition at line 140 of file axis_utils2.inc.
| integer function nearest_index_ | ( | real(kind=fms_au_kind_), intent(in) | rval, |
| real(kind=fms_au_kind_), dimension(:), intent(in) | array | ||
| ) |
Return index of nearest point along axis.
nearest_index = index of nearest data point within "array" corresponding to
"value".
inputs:
rval = arbitrary data...same units as elements in "array"
array = array of data points (must be monotonically)
ia = dimension of "array"
output:
nearest_index = index of nearest data point to "value"
if "value" is outside the domain of "array" then nearest_index = 1
or "ia" depending on whether array(1) or array(ia) is
closest to "value"
note: if "array" is dimensioned array(0:ia) in the calling
program, then the returned index should be reduced
by one to account for the zero base.
example:
let model depths be defined by the following:
parameter (km=5)
dimension z(km)
data z /5.0, 10.0, 50.0, 100.0, 250.0/
k1 = nearest_index (12.5, z, km)
k2 = nearest_index (0.0, z, km)
k1 would be set to 2, and k2 would be set to 1 so that
z(k1) would be the nearest data point to 12.5 and z(k2) would
be the nearest data point to 0.0
| [in] | rval | arbitrary data...same units as elements in "array" |
| [in] | array | array of data points (must be monotonic) |
Definition at line 300 of file axis_utils2.inc.
| subroutine tranlon_ | ( | real(kind=fms_au_kind_), dimension(:), intent(inout) | lon, |
| real(kind=fms_au_kind_), intent(in) | lon_start, | ||
| integer, intent(out) | istrt | ||
| ) |
Returns monotonic array of longitudes s.t., lon_strt <= lon(:) < lon_strt+360.
This may require that entries be moved from the beginning of the array to the end. If no entries are moved (i.e., if lon(:) is already monotonic in the range from lon_start to lon_start + 360), then istrt is set to 0. If any entries are moved, then istrt is set to the original index of the entry which becomes lon(1).
e.g.,
lon = 0 1 2 3 4 5 ... 358 359; lon_strt = 3
==> lon = 3 4 5 6 7 8 ... 359 360 361 362; istrt = 4
Definition at line 184 of file axis_utils2.inc.