subroutine sub1(first, second, third, out, res) real first, second, third, out, res c start mixing all variables : out = first*second + 3.0*third res = sin(first) + cos(second) first = 2.0 * first third = 2.0/second c now overwrite some values... if (first.gt.second) then first = cos(out) second = F(out) else c ...in one or in all cases first = exp(out) second = G(out) endif end