The upcoming Fortran 2008 standard introduces the BLOCK construct which allows to declare local variables with a limited scope inside a procedure.
This is not yet implemented by gfortran. Some ideas and discussion here: http://gcc.gnu.org/ml/fortran/2009-04/msg00003.html -- Summary: Fortran 2008: Implement BLOCK construct Product: gcc Version: unknown Status: UNCONFIRMED Severity: enhancement Priority: P3 Component: fortran AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: domob at gcc dot gnu dot org http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39626