ABSTRACT

Different blocks of code may be selected for execution according to different possible values of an expression (the “case expression”)which may be of integer, logical or character type. The construct begins with a SELECT CASE statement, then there are one or more blocks each starting with a CASE statement, and finally an END SELECT statement. This very simple example makes a selection according to the value of a logical expression:

Switch: SELECT CASE (input(1:1)=="Y") CASE (.TRUE.) .