Data Types | |
| interface | dimrange |
Functions/Subroutines | |
| subroutine, public | vartable_dump (vid) |
| subroutine, public | vartableadd (vid, class, cid) |
| subroutine, public | vartabledelete (vid, action, err) |
| subroutine, public | vartablelookup (vid, class, cid) |
| subroutine, public | vartablemore (vid, err) |
| integer function, public | ndims (vid) |
| subroutine, public | query_growable (vid, result) |
Variables | |
| integer, parameter, public | vid_invalid = -1 |
| integer, parameter, public | vtb_class_unused = 0 |
| integer, parameter, public | vtb_class_netcdf = 1 |
| integer, parameter, public | classes_max = 2 |
| type(gd_nc_variable_search), save, public | gdnc_search |
gtool variable table management
This module is not directly referenced from the gtool module, therefore naming conventions are quite flexible. Users must not call this.
A gtool variable is actually just a handle and multi-dimensional iterator, where the handle is a small integer value. To access the actual entity, first lookup the map table using the handle value, then lookup the variable table using the vid obtained there to get the class and class-specific variable number. This is at most pointer + offset reference cost. While gtool variables create as many iterators as needed from entity variables, this variable table creates only one entry per entity variable, so it has a reference count. This eliminates the need for entity variables to manage reference counts.
| integer function, public gtdata_internal_vartable::ndims | ( | integer, intent(in) | vid | ) |
Get number of dimensions of variable
| [in] | vid | Variable ID |
Definition at line 356 of file gtdata_internal_vartable.f90.
References ndims(), dc_error::storeerror(), vartablelookup(), and vtb_class_netcdf.
| subroutine, public gtdata_internal_vartable::query_growable | ( | integer, intent(in) | vid, |
| logical, intent(out) | result | ||
| ) |
Query whether variable has unlimited dimension
| [in] | vid | Variable ID |
| [out] | result | .true. if variable has unlimited dimension |
Definition at line 384 of file gtdata_internal_vartable.f90.
References dc_error::storeerror(), vartablelookup(), and vtb_class_netcdf.
| subroutine, public gtdata_internal_vartable::vartable_dump | ( | integer, intent(in) | vid | ) |
Dump variable table entry for debugging
| [in] | vid | Variable ID to dump |
Definition at line 106 of file gtdata_internal_vartable.f90.
References dc_trace::dbgmessage(), vtb_class_netcdf, and vtb_class_unused.
| subroutine, public gtdata_internal_vartable::vartableadd | ( | integer, intent(out) | vid, |
| integer, intent(in) | class, | ||
| integer, intent(in) | cid | ||
| ) |
Add entry to variable table
If an entry with the same class and cid already exists, increments its reference count. Otherwise, creates a new entry.
| [out] | vid | Assigned variable ID |
| [in] | class | Variable class (VTB_CLASS_NETCDF, etc.) |
| [in] | cid | Class-specific ID |
Definition at line 168 of file gtdata_internal_vartable.f90.
References dc_trace::dbgmessage(), vid_invalid, and vtb_class_unused.
| subroutine, public gtdata_internal_vartable::vartabledelete | ( | integer, intent(in) | vid, |
| logical, intent(out) | action, | ||
| logical, intent(out), optional | err | ||
| ) |
Delete entry from variable table
Decrements the reference count. When it reaches zero, action is set to .true. indicating actual deletion should occur.
| [in] | vid | Variable ID to delete |
| [out] | action | .true. if actual deletion should be performed |
| [out] | err | Error flag (optional) |
Definition at line 234 of file gtdata_internal_vartable.f90.
References classes_max, and vtb_class_unused.
| subroutine, public gtdata_internal_vartable::vartablelookup | ( | integer, intent(in) | vid, |
| integer, intent(out), optional | class, | ||
| integer, intent(out), optional | cid | ||
| ) |
Look up variable table entry
Returns the class and cid of the entry with the specified vid.
| [in] | vid | Variable ID to look up |
| [out] | class | Variable class (optional) |
| [out] | cid | Class-specific ID (optional) |
Definition at line 270 of file gtdata_internal_vartable.f90.
References classes_max, and vtb_class_unused.
| subroutine, public gtdata_internal_vartable::vartablemore | ( | integer, intent(in) | vid, |
| logical, intent(out), optional | err | ||
| ) |
Increment reference count of variable table entry
| [in] | vid | Variable ID |
| [out] | err | Error flag (optional) |
Definition at line 297 of file gtdata_internal_vartable.f90.
References classes_max, and vtb_class_unused.
| integer, parameter, public gtdata_internal_vartable::classes_max = 2 |
Definition at line 70 of file gtdata_internal_vartable.f90.
| type(gd_nc_variable_search), save, public gtdata_internal_vartable::gdnc_search |
Definition at line 81 of file gtdata_internal_vartable.f90.
| integer, parameter, public gtdata_internal_vartable::vid_invalid = -1 |
Definition at line 66 of file gtdata_internal_vartable.f90.
| integer, parameter, public gtdata_internal_vartable::vtb_class_netcdf = 1 |
Definition at line 69 of file gtdata_internal_vartable.f90.
| integer, parameter, public gtdata_internal_vartable::vtb_class_unused = 0 |
Definition at line 68 of file gtdata_internal_vartable.f90.