function [filenm] = make_layout(ENV,LAYOUT,name)


filenm = make_filename(ENV,LAYOUT,name);

fid = fopen([name '.spec'],'w');
str = ['#define TF ' num2str(ENV.tf) '\n'];   fprintf(fid,str);
str = ['#define DT ' num2str(ENV.dt) '\n'];   fprintf(fid,str);
str = ['#define DEPTH ' num2str(ENV.depth) '\n'];   fprintf(fid,str);
str = ['#define INPUT_TYPE ' ENV.input_type '\n'];   fprintf(fid,str);

str = ['#define XWAVEAMP ' num2str(ENV.amp) '\n'];   fprintf(fid,str);
str = ['#define XWAVEPERIOD ' num2str(ENV.period) '\n'];   fprintf(fid,str);
str = ['#define MASS ' num2str(LAYOUT.mass) '\n'];   fprintf(fid,str);

str = ['#define L0_UPPER ' num2str(round(LAYOUT.Lu)) '\n'];   fprintf(fid,str);
str = ['#define EA_UPPER ' num2str(LAYOUT.EAu) '\n'];   fprintf(fid,str);

str = ['#define L0_LOWER ' num2str(round(LAYOUT.Ll)) '\n'];   fprintf(fid,str);
str = ['#define EA_LOWER ' num2str(LAYOUT.EAl) '\n'];   fprintf(fid,str);

str = ['#define XCURRENT ' num2str(ENV.xcurrent) '\n'];   fprintf(fid,str);
str = ['#define XWIND ' num2str(ENV.xwind) '\n'];   fprintf(fid,str);

str = ['#define N_LOWERNODES ' num2str(LAYOUT.n_lower_nodes) '\n'];   fprintf(fid,str);
str = ['#define N_UPPERNODES ' num2str(LAYOUT.n_upper_nodes) '\n'];   fprintf(fid,str);


fclose(fid);


