How to use Fortran statement labels well?

I am working on a model written in Fortran 95, for which I am completely new. The concept of operator labels seems strange, and so far I have only found an explanation that labels can be arbitrarily resolved by the author, usually increasing by 10.

Are there any practical uses for these labels, other than being easier to choose where the statement ends? And the generally accepted standard on how to label.

+4
source share
1 answer

The only way I can think that tag labels are useful in modern Fortran is by managing errors when using goto (yes, they can be useful sometimes - when handling with care ;-)). Chapman lists them under "obsolete."

A name construct, on the other hand, can be useful sometimes to help the reader understand your code, for example. for large loops or if . Another use for construct names is advanced contour control, for example. during cyclic movement of the outer contour:

 outer: do i=1,10 do ii=1,10 if ( i == 2 .and. ii == 3 ) cycle outer z(ii,i) = 1.d0 enddo enddo outer 
+7
source

All Articles