Intel Fortran compiler 2013 (Visual Studio2010): best way to increase stack for long scalar strings

痞子三分冷 提交于 2019-12-12 03:27:00

问题


I was having a stack overflow error in a fortran code compiled with fortran compiler 2013 and VS2010 under windows 7. I first try to set HeapArrays=0 in Project Properties ->Fortran -> Optimization -> Heap (Allocates temporary arrays of size n in the heap rather than in the stack). In that way all the arrays should move to the heap. However, nothing changed and the stack overflow error was still there. Then I added the flag /stack:2000000 in the Link Options and now everything runs smoothly. Why HeapArrays=0 does not work? I have a bunch of character*2650 declarations, both in the main code and in subroutines. Is it possible the declarations in the main code are not considered "temporary arrays" ? The stack overflow error shows up right at the beginning.

EDIT: this is my declaration in the main program. I have similar ones (but shorter ) in subroutines:

character*2560 DOScallINV,FORMdosCALLtxt,FORMdosCALLinv,filenam,FILEinv,provSTR,FMTtimeMETEO,&
            TIMEstring,fmtGRID,fmtTIMEstring,FMTdataMETEO,WORKINGdir,path,DIRgribs,PATHgribs,&
            DIRresultsRUN,PATHoutput,previousDIR,filePATH,PATHresultsRUN,PATHinputD3D,textFILE,&
            newLINE,textFILE1,textFILE2,PATHlogs,LOGfile,LOGdir,ilineTXT,message,PATHresultsREST,&
            LastRUNfolder,PATHobs,PATHopenda,PATHresultsRUNm1,workworkWITHnum,pathSTOBS,pathSTMOD,pathALG,&
            toBEfound,COLLECTdirect,COLLECTdirectLOC,PATHwork,filePATHtot,filePATHlong,stringCAL,string,&
            pathNM,filePATH_d3model,CDstring,toBEadded,stringCALini,filePATH_d3wrapper,fileWIND,dudFILE,stringL,stringU,fileWINDcal,&
            PATHweb,pathREGR,fileWEB,PATHfileANALYSIS,threadFILE,threadFILEcopy

来源:https://stackoverflow.com/questions/36470210/intel-fortran-compiler-2013-visual-studio2010-best-way-to-increase-stack-for

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!