@simong excellent, thanks for posting it!
We discussed this at our latest call, summary is here: Fortran Monthly Call: October 2020. Can you please also post your code to this issue:
That way we can include it at the new “autodiff” section at our website that we just agreed at the call to create.