自己写的代码终于可以出结果了,但是用cgns存坐标数据的时候发现只能存一半,很奇怪,代码举例如下
三维的面网格,节点数2x11,因此是1x10个网格, 坐标储存在x,y,z数组中
real, dimesion(2,11) :: x,y,z
CALL CG_BASE_WRITE_F(INDEX_FILE, BASENAME, 2, 3, INDEX_BASE, IER)
ISIZE(1,1) = 2
ISIZE(2,1) = 11
ISIZE(1,2) = 1
ISIZE(2,2) = 10
ISIZE(:,3) = 0
CALL CG_ZONE_WRITE_F(INDEX_FILE, INDEX_BASE, ZONENAME, ISIZE, Structured, INDEX_ZONE, IER)
CALL CG_COORD_WRITE_F(INDEX_FILE,INDEX_BASE,INDEX_ZONE, RealSingle, &
'CoordinateX', x, INDEX_COORD, IER)
YZ坐标同上
读取时代码为
real :: node(2,11)
node = 0.0
call CG_COORD_READ_F(INDEX_FILE,INDEX_BASE,INDEX_ZONE, 'CoordinateX', RealSingle, (/1,1/),(/2,11/),node,IER )
write(*,*) node
node的读取结果为
x(1,1)
x(2,1)
...
x(1,6)
0.0
0.0
...
0.0
请问有没有大佬能指点一下