mikibelavista
Technical User
- Jan 18, 2012
- 32
I have modified one code,guy creates like this input file:
integer*2 veli(nxmax)
open(unit=36, file='vel.mod', form='unformatted')
do 130 k=1,nz
do 130 j=1,ny
do 131 i=1,nx
131 veli(i)=vel(i,j,k)*1000.
130 write(36) (veli(i),i=1,nx)
c
stop
My code ::
program newbuild
integer nmax,i
real*4,dimension(61) :: n1,n2,n3,n4,n5,n6,n7
integer*2,allocatable :: b1),b2),b3),b4),b5),b6),b7)
open(15,file='nodev1.dat',status='old')
open(16,file='nodev2.dat',status='old')
open(17,file='nodev3.dat',status='old')
open(18,file='nodev4.dat',status='old')
open(19,file='nodev5.dat',status='old')
open(20,file='nodev6.dat',status='old')
open(21,file='nodev7.dat',status='old')
read(15,*)n1
read(16,*)n2
read(17,*)n3
read(18,*)n4
read(19,*)n5
read(20,*)n6
read(21,*)n7
nmax=61
allocate(b1(nmax))
allocate(b2(nmax))
allocate(b3(nmax))
allocate(b4(nmax))
allocate(b5(nmax))
allocate(b6(nmax))
allocate(b7(nmax))
open(36,file='vel.mod',form='unformatted')
b1=n1
b2=n2
b3=n3
b4=n4
b5=n5
b6=n6
b7=n7
write(36)b1
write(36)b2
write(36)b3
write(36)b4
write(36)b5
write(36)b6
write(36)b7
end program
In my case nx=61 and nz=7 and ny=1
integer*2 veli(nxmax)
open(unit=36, file='vel.mod', form='unformatted')
do 130 k=1,nz
do 130 j=1,ny
do 131 i=1,nx
131 veli(i)=vel(i,j,k)*1000.
130 write(36) (veli(i),i=1,nx)
c
stop
My code ::
program newbuild
integer nmax,i
real*4,dimension(61) :: n1,n2,n3,n4,n5,n6,n7
integer*2,allocatable :: b1),b2),b3),b4),b5),b6),b7)
open(15,file='nodev1.dat',status='old')
open(16,file='nodev2.dat',status='old')
open(17,file='nodev3.dat',status='old')
open(18,file='nodev4.dat',status='old')
open(19,file='nodev5.dat',status='old')
open(20,file='nodev6.dat',status='old')
open(21,file='nodev7.dat',status='old')
read(15,*)n1
read(16,*)n2
read(17,*)n3
read(18,*)n4
read(19,*)n5
read(20,*)n6
read(21,*)n7
nmax=61
allocate(b1(nmax))
allocate(b2(nmax))
allocate(b3(nmax))
allocate(b4(nmax))
allocate(b5(nmax))
allocate(b6(nmax))
allocate(b7(nmax))
open(36,file='vel.mod',form='unformatted')
b1=n1
b2=n2
b3=n3
b4=n4
b5=n5
b6=n6
b7=n7
write(36)b1
write(36)b2
write(36)b3
write(36)b4
write(36)b5
write(36)b6
write(36)b7
end program
In my case nx=61 and nz=7 and ny=1