Encyclopaedia Index

FNxxx subroutines

The following coding sequences exemplify the structure of FNxxx subroutines with various numbers and types of arguments.

Users may create their own FNxxx subroutines by copying or modifying these.

Also see the Encyclopaedia entries:
FUNCTION, F-array and Fortran.







      SUBROUTINE FN1(K1,A)

      INCLUDE '/phoenics/d_includ/farray'

      COMMON/IGE/IXF,IXL,IYF,IYL,IGFILL(21)

      CALL L0F1(K1,I,IADD,'FN1   ')

      DO 1 IX=IXF,IXL

        I=I+IADD

        DO 1 IY=IYF,IYL

          I=I+1

    1 F(I)=A

      END


SUBROUTINE FN8(K1,K2,A,B,C,D) INCLUDE '/phoenics/d_includ/farray' COMMON/IGE/IXF,IXL,IYF,IYL,IGFILL(21) CALL L0F2(K1,K2,I,I2M1,IADD,'FN8 ') DO 1 IX=IXF,IXL I=I+IADD DO 1 IY=IYF,IYL I=I+1 FARG=F(I2M1+I)+B 1 F(I)=A*(AMAX1(0.0,FARG))**C+D END
SUBROUTINE FN10(K1,K2,K3,A,B2,B3) INCLUDE '/phoenics/d_includ/farray' COMMON/IGE/IXF,IXL,IYF,IYL,IGFILL(21) CALL L0F3(K1,K2,K3,I,I2M1,I3M1,IADD,'FN10 ') DO 1 IX=IXF,IXL I=I+IADD DO 1 IY=IYF,IYL I=I+1 1 F(I)=A+B2*F(I2M1+I)+B3*F(I3M1+I) END

wbs