Fortran SAVE statement

后端 未结 3 1184
梦谈多话
梦谈多话 2020-11-30 01:07

I\'ve read about the save statement in the (Intel\'s) language reference document, but I cannot quite grasp what it does. Could someone explain to me in simple

3条回答
  •  死守一世寂寞
    2020-11-30 01:54

    A short explanation could be: the attribute save says that the value of a variable must be preserved across different calls to the same subroutine/function. Otherwise normally when you return from a subroutine/function, "local" variables lose their values since the memory where those vars were stored is released. It is like static in C, if you know this language.

提交回复
热议问题