PSyclone
PSyclone copied to clipboard
Some more bugs in arrayrange2loop_trans
In some cases (e.g. NEMO sbcblk.f90), range expressions like:
zrhoa(:,:) = rho_air( sf(jp_tair)%fnow(:,:,1), sf(jp_humi)%fnow(:,:,1), sf(jp_slp)%fnow(:,:,1) )
are converted to explicit loops like:
zrhoa(idx_15,idx_14) = rho_air(sf(jp_tair)%fnow(:,:,1),sf(jp_humi)%fnow(:,:,1),sf(jp_slp)%fnow(idx_15,idx_14,1))
this should not happend because rho_air is NOT declared as an elemental function.
even if it was, it should have unrolled the expression in each argument.
Curiously if the expression is.
zrhoa(:,:) = rho_air(t_zu(:,:),q_zu(:,:),sf(jp_slp)%fnow(:,:,1))
it is correctly rejected