Many simple C functions are similar to FORTRAN function subroutines as shown in the example below:
A simple C function
An equivalent FORTRAN function
int myfunction(int x)
INTEGER FUNCTION MYFUNCTION(X)
{
int x,y,z;
int x,y,z
INTEGER X,Y,Z
y = 11;
y = 11
Y = 11
z = x+y;
z = x+y
Z = X+Y
printf("z = %d",z);
printf("z = %d",z)
WRITE (*,100) Z
return z;
return z
MYFUNCTION = Z
}
END
Release 18.2 - © ANSYS, Inc. All rights reserved.