074. Avoid implicit save#
topic: Procedures
Note
This tip is a draft1.
A variable given a value in the declaration has the implicit SAVE attribute and is not re-initialized in later calls to the procedure. Write
integer :: i i = 0
instead of
integer :: i = 0
If SAVE is intended be explicit:
integer, save :: i = 0
A variable given a value in the declaration has the implicit SAVE attribute and is not re-initialized in later calls to the procedure. Write
— FortranTip (@fortrantip) January 4, 2022
integer :: i
i = 0
instead of
integer :: i = 0
If SAVE is intended be explicit:
integer, save :: i = 0pic.twitter.com/X1ZUSZblZX
- 1
From the perspective of FortranTip Browser, “draft” means that it hasn’t been edited for formatting, hasn’t had corresponding Fortran programs added, the text content hasn’t been enhanced, etc. Draft texts are extracted from the corresponding Tweet using the Twitter API.