This is usually caused by TMW including a compiler option in the mex option files to force fixed field source even if the file has a .f90 extension. Normally, files ending in .f or .for are compiled as fixed field and files ending in .f90 are compiled as free field. But TMW has an option in their compiler flags to override that. I have no idea why they continue to do this. To fix it, edit the appropriate mexopts file(s) on your system. E.g., on my system there are these files:
intelf11msvs2008engmatopts.bat
intelf11msvs2008opts.bat
:
intelf11msvs2008shellengmatopts.bat
intelf11msvs2008shellopts.bat
:
etc
In these files you will see a COMPFLAGS line like this:
set COMPFLAGS=/fpp /Qprec /I"
See that /fixed option? GET RID OF IT!!! It should never have been there in the first place and I have been unsuccessful in getting TMW to remove it. E.g., I typically do this just so that it is documented what was there originally in a rem statement:
rem set COMPFLAGS=/fpp /Qprec /I"
set COMPFLAGS=/fpp /Qprec /I"
Best Answer