Fortls error with modern fortran and fortran intellisense

There is not enough information to get to the root of your problem. There are many posts in this Discourse and the web troubleshooting such problems. Here are some examples, which you might want to read and try as solutions:

My guess is that you are using an outdated version of vscode and/or modern fortran and/or fortls and/or using deprecated third-party extensions and/or passing incorrect options to vscode. There are simply too many unknowns. Easiest way to get to the bottom of this is update your VSCode, Modern Fortran to the latest Pre-Release and install with pip fortls. Follow the errors that pop up, try and resolve them using the posts above (or others you might find) and post any questions if you get stuck.