How does one insert fortran code from an external file into a separate code?
问题 I'd like to have my code take code written in another document, read it, and then use it as though it was written in the code. Say we have the following: MODULE samplemod CONTAINS FUNCTION sillysum(boudary,function) RESULT(counter) IMPLICIT NONE REAL(KIND=8) :: boundary, counter REAL(KIND=8), DIMENSION(:) :: function INTEGER :: m counter = 0.d0 DO m = 1, my_mesh%me counter = function(m) + externalfunction END DO END FUNCTION sillysum END MODULE samplemod PROGRAM sampleprogram USE samplemod