Dear Anders Blom,
Thanks for your kind reply.
This suggestion is not only for the eye, but for the read in code.
I now use a fortran code of the following to read the cube data
| open(unit=11,file=inputcube) |
| read(11,*) head1 |
| read(11,*) head2 |
| |
| read(11,*), N_atom,Orig(1),Orig(2),Orig(3) |
| read(11,*), nX,dV1(1),dV1(2),dV1(3) |
| read(11,*), nY,dV2(1),dV2(2),dV2(3) |
| read(11,*), nZ,dV3(1),dV3(2),dV3(3) |
| |
| allocate(cube_a(nX,nY,nZ)) |
| allocate(cube_b(nX,nY,nZ)) |
| allocate(xuhao(N_atom),zb_0(N_atom)) |
| allocate(zb_x(N_atom),zb_y(N_atom),zb_z(N_atom)) |
| |
| do i=1, N_atom |
| read(11,*) xuhao(i),zb_0(i),zb_x(i),zb_y(i),zb_z(i) |
| enddo |
| |
| read(11,*) |
| & (((cube_a(i,j,k),k=1,nZ),j=1,nY),i=1,nX) |
| |
| close(11) |
this kind of read directives need white for seperate the numbers apart.
I am glad to know how to read a fixed width number even though it may melt with the neighbours?
With best regards,
/Guangping Zhang