Skip to content

Is extending variables supported? #2015

@anton-seaice

Description

@anton-seaice

I have defined a dataset with one dimensions of type NF90_UNLIMITED, and am trying to extend it, but when I do, I get an error:

Abort with message NetCDF: Attempt to extend dataset during NC_INDEPENDENT I/O operation. Use nc_var_par_access to set mode NC_COLLECTIVE before extending variable.

The code block is:

        pio_inq_dimid(File, 'time', timid)
        pio_inquire_dimension(File, timid, len=i_time)
        pio_inq_varid(File,'time',varid)
        i_time = i_time + 1 ! index of the current history time
        pio_put_var(File,varid,(/i_time/),ltime)

File is type pio_iotype_netcdf4p

Is this a supported use-case? Obviously it's possible in the underlying netcdf library by setting the mode to NC_COLLECTIVE

These are the versions being used:

    netcdf-c:
      require:
      - '@4.9.2'
    netcdf-fortran:
      require:
      - '@4.6.1'
    parallelio:
      require:
      - '@2.6.2'
    openmpi:
      require:
      - '@4.1.5'

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions