function wramsinfil( thetitle, source_info, ssp_info, bathymetry_info, pe_info, output_info )

% Writes RAMS input file. 
%
% SYNTAX: wramsinfil( title, source, ssp, bottom, pe, output )
%

%*******************************************************************************
% Faro, 12/01/2011 at 22:00
% Written by Tordar 
%*******************************************************************************
% Get source data: 

freq = source_info.f ;
zs   = source_info.zs;

%*******************************************************************************
% Get sound speed data: 

c    = ssp_info.c;
z    = ssp_info.z; 
r    = ssp_info.r;

zc = [z;c];

%*******************************************************************************
% Get bathymetry data:

    xbty = bathymetry_info.x   ;
   cpbty = bathymetry_info.cp  ;
   csbty = bathymetry_info.cs  ;
  rhobty = bathymetry_info.rho ;
   apbty = bathymetry_info.ap  ;
   asbty = bathymetry_info.as  ;
 
%*******************************************************************************
% Get pe data:

   zr = pe_info.zr    ;
zmplt = pe_info.zmplt ;
  ndr = pe_info.ndr   ;
  ndz = pe_info.ndz   ;
   np = pe_info.np    ;
   dr = pe_info.dr    ;
   dz = pe_info.dz    ;
 irot = pe_info.irot  ;
   c0 = pe_info.c0    ;
theta = pe_info.theta ;
   
%*******************************************************************************
% Get output data: 

rmax = output_info.rmax;
zmax = output_info.zmax;

%*******************************************************************************  
% Write the INFIL: 
 
fid = fopen('rams.in','w');
fprintf(fid,'%s\n',thetitle);
fprintf(fid,'%f %f %f\n',freq,zs,zr );
fprintf(fid,'%f %f %d\n',rmax,dr,ndr);
fprintf(fid,'%f %f %d %f\n',zmax,dz,ndz,zmplt);
fprintf(fid,'%f %d %d %f\n',c0,np,irot,theta);
fprintf(fid,'%f %f\n',xbty);
fprintf(fid,'-1 -1\n');
fprintf(fid,'%f %f\n',zc);
fprintf(fid,'-1 -1\n');
fprintf(fid,'%f %f\n',cpbty);
fprintf(fid,'-1 -1\n');
fprintf(fid,'%f %f\n',csbty);
fprintf(fid,'-1 -1\n');
fprintf(fid,'%f %f\n',rhobty);
fprintf(fid,'-1 -1\n');
fprintf(fid,'%f %f\n',apbty);
fprintf(fid,'-1 -1\n');
fprintf(fid,'%f %f\n',asbty);
fprintf(fid,'-1 -1\n');

fclose( fid );
