ensure_netcdf_var_exists_onedim Subroutine

private subroutine ensure_netcdf_var_exists_onedim(file_id, var_name, var_type, dim_id, var_id, compress, deflate_level)

Get the netCDF ID for a variable, creating it if it doesn't exist already. Aborts if any errors are detected.

Arguments

Type IntentOptional Attributes Name
integer(kind=kind_nf), intent(in) :: file_id

ID of the file or group to look for or create the variable under

character(len=*), intent(in) :: var_name

Name of the variable

integer(kind=kind_nf), intent(in) :: var_type

The netCDF type of the variable

integer(kind=kind_nf), intent(in) :: dim_id

Array of dimension IDs

integer(kind=kind_nf), intent(out) :: var_id

The netCDF ID of the variable under file_id

logical, intent(in), optional :: compress

Do we want to use compression for this variable

integer(kind=kind_nf), intent(in), optional :: deflate_level

The compression level to use for this variable


Contents


Source Code

  subroutine ensure_netcdf_var_exists_onedim(file_id, var_name, var_type, dim_id, var_id, &
       compress, deflate_level)
    !> ID of the file or group to look for or create the variable under
    integer(kind_nf), intent(in) :: file_id
    !> Name of the variable
    character(len=*), intent(in) :: var_name
    !> The netCDF type of the variable
    integer(kind_nf), intent(in) :: var_type
    !> Array of dimension IDs
    integer(kind_nf), intent(in) :: dim_id
    !> The netCDF ID of the variable under `file_id`
    integer(kind_nf), intent(out) :: var_id
    !> Do we want to use compression for this variable
    logical, intent(in), optional :: compress
    !> The compression level to use for this variable
    integer(kind_nf), intent(in), optional :: deflate_level

    call ensure_netcdf_var_exists_manydims(file_id, var_name, var_type, [dim_id], &
         var_id, compress, deflate_level)
  end subroutine ensure_netcdf_var_exists_onedim