PSyclone
PSyclone copied to clipboard
Kernel extraction and partially written fields
The kernel ../calc_dep_pts_alg_mod_psy-invoke_10_calc_upwind_detj_at_w2_kernel_type:calc_upwind_detj_at_w2_code:r0 does:
real(kind=r_tran), dimension(undf_w2), intent(inout) :: detj_w2
do k = 1, nlayers-2
df = T
detj_w2(map_w2(df)+k) = &
I.e. it only writes the top part of the field. The kernel is declared as:
type(arg_type) :: meta_args(4) = (/ &
arg_type(GH_FIELD, GH_REAL, GH_WRITE, W2), &
...
As a result of this, the values of the original field are not written to the extraction file (since it's marked as output argument), only some of the output values are actually computed, and the driver detects many result differences.
Not sure what the proper solution is:
- Mark this argument as readwrite in the kernel meta-data? That would result in the original values being written, and the driver works as expected.
- Force the driver to even write output-only values to the NetCDF file. That might (significantly??) increase the size of the written files (and in most cases unnecessary).
- Initialise an output-only field not with 0 (which is what I do atm), but with the expected output value. This would also make this kernel pass, but ... it also would mean that we won't detect certain kind of errors (e.g. if the kernel would just do nothing ... the output values would be correct :( )
- Maybe add a command line option to let the user decide??