write_output.f90 658 Bytes
subroutine write_output

use netcdf
use parameters
implicit none
include 'netcdf.inc'
	integer :: ncid,omID,xID,tID,SpectreID
	integer :: om_varID,x_varID,t_varID
	

nf90_create("foo.nc",nf90_noclobber,ncid)

nf90_def_dim(ncid,"omega", nfreq, omID)
nf90_def_dim(ncid,"x_axis", nbin, xID)
nf90_def_dim(ncid,"time", nsteps, tID)

nf90_def_var(ncid,"omega",nf90_double,omID,om_varID)
nf90_def_var(ncid,"x_axis",nf90_double,xID,x_varID)
nf90_def_var(ncid,"time",nf90_double,tID,t_varID)
nf90_def_var(ncid,"Spectrum",nf90_double,(/ tID, xID, omID /),SpectreID)


nf90_put_att(ncid,ID,"units", values)
nf90_put_var(ncid,SpectreID,E)



end subroutine write_output