I'm not sure if this really what you are asking for, but if you simple want to write and compile a fortran code that is not using system functions of the phone you can try using the android app GNURoot Debian on your Jolla device. I wrote a simple Hello Word code and it compiled and worked fine.