GerritGroot
Technical User
Hi,
Does anyone know how I can write a variable number of columns?
If the number is known, let’s say 100 I’d do:
------------------------------------------------
WRITE(1,FMT=’(100(E20.10))’)(myvar(i),i=1,100,1)
------------------------------------------------
But if the number is not known, let’s say it is imxcol, I cannot say:
------------------------------------------------------
WRITE(1,FMT=’(imxcol(E20.10))’)(myvar(i),i=1,imxcol,1)
------------------------------------------------------
Because the format descriptor doesn’t work anymore, the compiler doesn't take it at least.
So I tried in F90:
-----------------------------------------------
DO i=1,imxcol,1
WRITE(1,FMT=’(E20.10)’,ADVANCE=’NO’)myvar(i)
END DO
-----------------------------------------------
But at imxcol>85 the code breaks down!!
How can I solve this?
Thanks,
Gerrit
Does anyone know how I can write a variable number of columns?
If the number is known, let’s say 100 I’d do:
------------------------------------------------
WRITE(1,FMT=’(100(E20.10))’)(myvar(i),i=1,100,1)
------------------------------------------------
But if the number is not known, let’s say it is imxcol, I cannot say:
------------------------------------------------------
WRITE(1,FMT=’(imxcol(E20.10))’)(myvar(i),i=1,imxcol,1)
------------------------------------------------------
Because the format descriptor doesn’t work anymore, the compiler doesn't take it at least.
So I tried in F90:
-----------------------------------------------
DO i=1,imxcol,1
WRITE(1,FMT=’(E20.10)’,ADVANCE=’NO’)myvar(i)
END DO
-----------------------------------------------
But at imxcol>85 the code breaks down!!
How can I solve this?
Thanks,
Gerrit