主题:想在模型子程序中读取新文件,求大神指导新文件名如何赋
新读入文件格式为‘节点号,对应代码号’,最终将节点号所对应的代码号赋给KFROPT,源程序如下:
1 NFILE = T2D_FILES(T2DFO1)%LU ! 这一行代码不理解,能否将新文件名赋给NFILE,又担心11行的写入出问题
23 ! File Read in order to know the number of node in the mesh
4
5 NPOIN_GLOB = 0
6 DO
7 READ(NFILE,*,END=666)
8 NPOIN_GLOB = NPOIN_GLOB + 1
9 ENDDO
10 666 CONTINUE
11 WRITE(LU,*) 'FRICTION_USER: ',NPOIN_GLOB,' POINTS IN FILE'
12 REWIND(NFILE)
13
14 ! File Read
15 ! ---------
16 DO I = 1,NPOIN_GLOB
17 READ(NFILE,*,END=999,ERR=998) IVAL1, IVAL2
18 IF (NCSIZE>1) THEN
19 K = MESH%KNOGL%I(I)
20 ELSE
21 K = I
22 ENDIF
23 KFROPT%I(K) = IVAL2
24 ENDDO