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


if(ENV.tf > 0)
filenm = ['X_' name ...
            '_d' num2str(ENV.depth) ...
            '_c' num2str(ENV.currentscale) ...
            '_A' num2str(ENV.xwaveamp) ...
            '_T' num2str(ENV.xwaveperiod) ...
            '_W' num2str(ENV.xwind) ...
            '_t' num2str(ENV.tf) ...
            '_dt' num2str(ENV.dt) ...
            '_rt' num2str(ENV.ramptime) ...
	    '_ft-' ENV.forcing_type ...
	    '_it-' ENV.input_type ...
	    '_hl' num2str(LAYOUT.stretch_hose_length) ...
	    '_h' num2str(LAYOUT.hose) ...
	    '_pm' num2str(LAYOUT.pigmass) ...
	    '_espww' num2str(LAYOUT.ESP_wetweight) ...
   ];
else
filenm = ['X_' name ...
            '_d' num2str(ENV.depth) ...
            '_c' num2str(ENV.currentscale) ...
            '_W' num2str(ENV.xwind) ...
            '_t' num2str(ENV.tf) ...
	    '_hl' num2str(LAYOUT.stretch_hose_length) ...
	    '_h' num2str(LAYOUT.hose) ...
	    '_pm' num2str(LAYOUT.pigmass) ...
	    '_espww' num2str(LAYOUT.ESP_wetweight) ...
   ];
end

end

