From the course: Introduction to Fortran

Unlock the full course today

Join today to access over 23,200 courses taught by industry experts.

Argument association and execution semantics

Argument association and execution semantics - FORTRAN Tutorial

From the course: Introduction to Fortran

Argument association and execution semantics

- Understanding how execution of a procedure unfolds and how things are associated is key. In this lesson, we're going to walk very methodically through what happens. I've taken an example we saw in a previous lesson and moved pieces of it into procedures. We've got get_file_name, read_name, write_greeting, and make_greeting. Now, we can talk about scope a little bit more concretely. So the subroutine get_file_name doesn't have any arguments and it doesn't declare any local variables. So anything that it's referring to is in its host scope. So the file variable that we're assigning to or getting from the command line is this particular variable declared on line 4. However, read_name, the subroutine read_name, has two arguments, and it declares a local variable. Within this subroutine, it doesn't refer to anything other than its arguments and its local variable. And so we don't really have to worry too much about scope.…

Contents