[Fortran] 纯文本查看 复制代码
Program www_fcode_cn
Use, Intrinsic :: ISO_C_BINDING !// 使用内部模块,保持与 C 语言变量类型一致
Implicit None
character(len=80) :: fline
character(len=8) :: flag1 !// 8字节
character(len=8) :: flag2 !// 8字节
character(len=24) :: flag3 !// 8字节
character(len=4) :: dtype !// 数据类型
integer(kind=4) :: i,j,k,n
integer(kind=4) :: ii,jj,kk,NUM,B1,B2,B3
real(kind=4):: x0,y0,x1,y1,x2,y2
integer(kind=4) :: X
integer vertex1(10)
real vertex(24)
real,ALLOCATABLE :: A(:)
DOUBLE PRECISION,ALLOCATABLE :: B(:)
integer,ALLOCATABLE :: C(:)
integer,ALLOCATABLE :: INTE(:)
DOUBLE PRECISION,ALLOCATABLE :: DOUB(:)
real,ALLOCATABLE :: REALM(:)
character,ALLOCATABLE :: CHARM(:)
logical,ALLOCATABLE :: LOGI(:)
Open(13, File = "BASE_FS_TEST_Streamline_1.out" , STATUS = 'New' , ACTION = 'Write') ! 打开名为test.out的1号文件
Open( 12 , File = "BASE_FS_Test.sln0042" ,convert='BIG_ENDIAN', access="stream" , form ="unformatted")
Read( 12 ) n,flag1,i,dtype,n
Write(13,*) flag1
if (i>0) then
ALLOCATE(INTE(i))
Read( 12 ) n,INTE,n
Write(13,100)INTE
100 format(3i12)
DEALLOCATE(INTE)
Write(13,*) "------------------------------------"
end if
Read( 12 ) n,flag1,i,dtype,n
Write(13,*) flag1
if (i>0) then
ALLOCATE(DOUB(i))
Read( 12 ) n,DOUB,n
Write(13,101)DOUB
101 format(3f12.4)
DEALLOCATE(DOUB)
Write(13,*) "------------------------------------"
end if
Read( 12 ) n,flag1,i,dtype,n
print *,flag1
Close(12)
Close(13)
print *,"Over..."
End Program www_fcode_cn