For Q1, “defualt(none)” can only be used on a compute construct (kernels or parallel) so the error is correct that isn’t not allowed on a data region.
For Q2, I’m not sure what you mean by “redundant”. It does change the behavior over the default.
I have arrays and scalars inside the compute construct, without any data-clauses.
If the variables are declared inside the compute construct, that would make them local.
If these variables are declared outside of the compute region, then only variables that “do not have predetermined data attributes” would the “default(none)” clause apply. In other words, it wouldn’t apply to scalars.
For the arrays, do you have these in a structured data region? If the region is visible to the compiler, it would be the same as if you put them in a data clause on the compute region itself.
1015 The default clause is optional. The none argument tells the compiler to require that all variables
1016 used in the compute construct that do not have predetermined data attributes to explicitly appear
1017 in a data clause on the compute construct, a data construct that lexically contains the compute
1018 construct, or a visible declare directive
I would imagine the default(none) clause should raise an error.
I would think it would cause an error as well and my quick tests here shows that it does. If you can provide a reproducing example that shows what you think should error, that would be appreciated so we can investigate.
Here’s an example of the type of error that I would expect:
% nvfortran -acc -Minfo=accel acc_f2.f90
NVFORTRAN-S-1069-Data clause required with default(none) - a(1:n) (acc_f2.f90: 36)
NVFORTRAN-S-1069-Data clause required with default(none) - r(1:n) (acc_f2.f90: 36)