OMPTargetTrans does not exclude CodeBlocks
While working on https://github.com/stfc/PSycloneBench/pull/87 it turns out that OMPTargetTrans happily puts directives around a loop that does both a reduction and a WRITE. At the very least it should spot the CodeBlock containing the WRITE and refuse to transform it. Possibly OMPTargetTrans should sub-class ParallelRegionTrans rather than just RegionTrans and perhaps this is true for ACCKernelsTrans too? (See https://psyclone-ref.readthedocs.io/en/latest/_static/html/classpsyclone_1_1psyir_1_1transformations_1_1region__trans_1_1RegionTrans.html)

I agree to exclude all codeblocks in the OMPTargetTrans, in the Nemo script I have it as a condition to the loop that walks the Loop nodes. But it would be safer to avoid it a the transformation level to prevent silent issues like in tracer advection.
I don't think reductions are invalid for OMPTargetTrans as the directive alone does not parallelise the body. The reduction should be catch and prevent the OMPLoopTrans though but we may still want to run a reduction serially on the GPU to avoid transfering data (or not but this is up to the psyclone script to decide)
I am taking this. I will not make it a ParallelRegionTrans since by itself is not really a Parallel Region (it needs another directive to make the contents parallel) but I will prevent CodeBlocks, UBOUNDS and LBOUNDS inside the directive body.
I do also not think that ACCKernels should be ParallelRegionTrans, in this case we offload the decision if the loop should be parallel to the compiler's automatic parallelisation algorithm. But it is not semantically incorrect to put a kernels directive in a loop that can not be parallelised.
I think it is the same for the CodeBlock exclusion but in this case it would be OK to add it if it often trips the compiler.. but I don't have enough experience with this directive, so I will let you decide what's best.