Take the 2-minute tour ×  I have a FORTRAN code with a routine:
integer ncid, recid character*(*) varname real*8 vardata
dimension vardata(15,45,75)   I want to add some flexibility to
this code, and I thought I would do it by first adding an
optional flag argument:   ! everything the same and then ...
logical, optional :: how_to_calculate  Now, at this point, I am
not even using "how_to_calculate". I am just putting it into the
code for testing. So I compile the code without a hitch. Then I
run it, and I get an error in the subroutine. Specifically, some
of the values in the code later on are "magically" altered from
what they were without that optional argument. The new values
don't make sense to the logic of the code, so it exits politely
with an error message. Let me stress again that at this point, I
am not even using this optional argument. So then, on a lark, I
go back to all the places in the source that call this routine
and, even though my new argument in optional, I put in values
for it in all the