# elastic model 3d
function write_mor(fid::IOStream, model::elmod3d)
    write(fid,model.wf.vx)
    write(fid,model.wf.vy)
    write(fid,model.wf.vz)
    write(fid,model.wf.txx)
    write(fid,model.wf.tyy)
    write(fid,model.wf.tzz)
    write(fid,model.wf.txy)
    write(fid,model.wf.txz)
    write(fid,model.wf.tyz)
    write(fid,model.pml.PVxBTxx)
    write(fid,model.pml.PVxBTxy)
    write(fid,model.pml.PVxBTxz)
    write(fid,model.pml.PVyBTxy)
    write(fid,model.pml.PVyBTyy)
    write(fid,model.pml.PVyBTyz)
    write(fid,model.pml.PVzBTxz)
    write(fid,model.pml.PVzBTyz)
    write(fid,model.pml.PVzBTzz)
    write(fid,model.pml.PTxxBVx)
    write(fid,model.pml.PTxxBVy)
    write(fid,model.pml.PTxxBVz)
    write(fid,model.pml.PTyyBVx)
    write(fid,model.pml.PTyyBVy)
    write(fid,model.pml.PTyyBVz)
    write(fid,model.pml.PTzzBVx)
    write(fid,model.pml.PTzzBVy)
    write(fid,model.pml.PTzzBVz)
    write(fid,model.pml.PTxyBVx)
    write(fid,model.pml.PTxyBVy)
    write(fid,model.pml.PTxzBVx)
    write(fid,model.pml.PTxzBVz)
    write(fid,model.pml.PTyzBVy)
    write(fid,model.pml.PTyzBVz)
end

# acoustic model 3d
function write_mor(fid::IOStream, model::acmod3d)
    write(fid,model.wf.vx)
    write(fid,model.wf.vy)
    write(fid,model.wf.vz)
    write(fid,model.wf.tpp)
    write(fid,model.pml.PVxBTpp)
    write(fid,model.pml.PVyBTpp)
    write(fid,model.pml.PVzBTpp)
    write(fid,model.pml.PTppBVx)
    write(fid,model.pml.PTppBVy)
    write(fid,model.pml.PTppBVz)
end

# elastic model 2d
function write_mor(fid::IOStream, model::elmod2d)
    write(fid,model.wf.vx)
    write(fid,model.wf.vz)
    write(fid,model.wf.txx)
    write(fid,model.wf.tzz)
    write(fid,model.wf.txz)
    write(fid,model.pml.PVxBTxx)
    write(fid,model.pml.PVxBTxz)
    write(fid,model.pml.PVzBTxz)
    write(fid,model.pml.PVzBTzz)
    write(fid,model.pml.PTxxBVx)
    write(fid,model.pml.PTxxBVz)
    write(fid,model.pml.PTzzBVx)
    write(fid,model.pml.PTzzBVz)
    write(fid,model.pml.PTxzBVx)
    write(fid,model.pml.PTxzBVz)
end

# acoustic model 2d
function write_mor(fid::IOStream, model::acmod2d)
    write(fid,model.wf.vx)
    write(fid,model.wf.vz)
    write(fid,model.wf.tpp)
    write(fid,model.pml.PVxBTpp)
    write(fid,model.pml.PVzBTpp)
    write(fid,model.pml.PTppBVx)
    write(fid,model.pml.PTppBVz)
end
