Create independent variable (dimension). More...
Go to the source code of this file.
Functions/Subroutines | |
| subroutine | gtvarcreated (var, url, length, xtype, long_name, overwrite, err) |
Create independent variable (dimension).
This subroutine is provided through gtdata_generic.
Definition in file gtvarcreated.f90.
| subroutine gtvarcreated | ( | type(gt_variable), intent(out) | var, |
| character(len = *), intent(in) | url, | ||
| integer, intent(in) | length, | ||
| character(len = *), intent(in), optional | xtype, | ||
| character(len = *), intent(in), optional | long_name, | ||
| logical, intent(in), optional | overwrite, | ||
| logical, intent(out), optional | err ) |
Create dimension variable
Creates a variable of GT_VARIABLE type with itself as the dimension at location url with length length, and sets it to var. Like variables opened with Open, var must later be closed with Close.
Specifying length == 0 makes the variable an unlimited dimension. If xtype is omitted, it defaults to "float". Creation fails if the variable already exists, but continues by overwriting if overwrite == .true.. (Note: overwrite behavior is not yet guaranteed.) Omitting dims means setting a 0-dimensional variable.
Since dimension variables are often auto-generated, names are auto-generated for specifications lacking a variable name part.
If an error occurs during creation, outputs a message and terminates. If err is provided, returns .true. and program does not terminate.
| [out] | var | Variable handle |
| [in] | url | Variable URL |
| [in] | length | Dimension length (0 for unlimited) |
| [in] | xtype | Data type (optional, default "float") |
| [in] | long_name | Long name attribute (optional) |
| [in] | overwrite | Allow overwrite (optional) |
| [out] | err | Error flag (optional) |
Definition at line 77 of file gtvarcreated.f90.
References dc_trace::beginsub(), dc_trace::dbgmessage(), dc_error::dc_noerr, dc_trace::endsub(), gtdata_internal_map::gtvar_dump(), gtdata_internal_map::map_create(), dc_error::storeerror(), and dc_types::string.