首页 > 代码库 > [Fortran] Dump Data To File

[Fortran] Dump Data To File

 1 PROGRAM MAIN 2   I = 1 3   J = 2 4   K = 11 5   Call DumpData(I,J,K) 6 END  PROGRAM MAIN 7  8 SubRoutine DumpData(I,J,K) 9     OPEN(    UNIT   =   112                     &10             ,FILE   =   DumpErr.dat           &       11             ,FORM   = FORMATTED               &12             ,STATUS = REPLACE                 &13             ,ACCESS = SEQUENTIAL              &14     )15     16     WRITE(112,*),"I = ",I17     WRITE(112,*),"J = ",J18     WRITE(112,*),"K = ",K+119     20     Close(112)21     RETURN22 End SubRoutine DumpData
main.f90

 

大概就是文件操作~

[Fortran] Dump Data To File