program test
	use netcdf
	implicit none

	type(NC_FILE)::		file, file2
	type(NC_VARIABLE)::	a
	type(NC_DIMENSION), pointer::	dims(:)
	integer:: stat

	call Create(file, 'test.nc')
	print *, 'test file test.nc created, id=', Id(file)

	a = Variable(file, 'a', NF_FLOAT)
	call NetcdfAssert

	dims = Dimensions(a)
	call NetcdfAssert
	print *, 'dimensions check ', associated(dims)

	call Close(file)

	call Open(file, 'test.nc', writable=.TRUE.)
	print *, 're-opened file id=', Id(file)
	call Open(file2, 'test.nc')
	print *, 'double-opened file id=', Id(file2)
	call Close(file)
	call Close(file2)
	print *, 'terminated successfully'
end program
