function [epic_code, status] = match_varname( input_varname )

global epic_key_data;
global epic_data;


if ( strcmp ( input_varname, 'a' ) )
    epic_code = 4070;

elseif ( strcmp ( input_varname, 'a_1' ) )
    epic_code = 4070;

elseif ( strcmp ( input_varname, 'a_2' ) )
    epic_code = 4070;

elseif ( strcmp ( input_varname, 'air_temp' ) )
    epic_code = 21;

elseif ( strcmp ( input_varname, 'abads' ) )
    epic_code = 4074;

elseif ( strcmp ( input_varname, 'abads_1' ) )
    epic_code = 4074;

elseif ( strcmp ( input_varname, 'abads_2' ) )
    epic_code = 4074;

elseif ( strcmp ( input_varname, 'atmos_press' ) )
    epic_code = 915;

elseif ( strcmp ( input_varname, 'att_1' ) )
    epic_code = 55;

elseif ( strcmp ( input_varname, 'atten' ) )
    epic_code = 55;

elseif ( strcmp ( input_varname, 'b' ) )
    epic_code = 4071;

elseif ( strcmp ( input_varname, 'b_1' ) )
    epic_code = 4071;

elseif ( strcmp ( input_varname, 'b_2' ) )
    epic_code = 4071;

elseif ( strcmp ( input_varname, 'bearing' ) )
    epic_code = 1411;

elseif ( strcmp ( input_varname, 'bbads' ) )
    epic_code = 4075;

elseif ( strcmp ( input_varname, 'bbads_1' ) )
    epic_code = 4075;

elseif ( strcmp ( input_varname, 'bbads_2' ) )
    epic_code = 4075;

elseif ( strcmp ( input_varname, 'c' ) )
    epic_code = 4072;

elseif ( strcmp ( input_varname, 'c_1' ) )
    epic_code = 4072;

elseif ( strcmp ( input_varname, 'c_2' ) )
    epic_code = 4072;

elseif ( strcmp ( input_varname, 'cbads' ) )
    epic_code = 4076;

elseif ( strcmp ( input_varname, 'cbads_1' ) )
    epic_code = 4076;

elseif ( strcmp ( input_varname, 'cbads_2' ) )
    epic_code = 4076;

elseif ( strcmp ( input_varname, 'compass' ) )
    epic_code = 1404;

elseif ( strcmp ( input_varname, 'cond_1' ) )
    epic_code = 50;

elseif ( strcmp ( input_varname, 'conductivity' ) )
    epic_code = 50;

elseif ( strcmp ( input_varname, 'd' ) )
    epic_code = 4073;

elseif ( strcmp ( input_varname, 'd_1' ) )
    epic_code = 4073;

elseif ( strcmp ( input_varname, 'd_2' ) )
    epic_code = 4073;

elseif ( strcmp ( input_varname, 'dbads' ) )
    epic_code = 4077;

elseif ( strcmp ( input_varname, 'dbads_1' ) )
    epic_code = 4077;

elseif ( strcmp ( input_varname, 'dbads_2' ) )
    epic_code = 4077;

elseif ( strcmp(input_varname,'east') & epic_data.is_wind )
    epic_code = 422;

elseif ( strcmp(input_varname,'east') & epic_data.is_water )
    epic_code = 1205;

elseif ( strcmp(input_varname,'east_lp') & epic_data.is_wind )
    epic_code = 422;

elseif ( strcmp(input_varname,'east_lp') & epic_data.is_water )
    epic_code = 1205;

elseif ( strcmp(input_varname,'factor')  )
    epic_code = 81;

elseif ( strcmp ( input_varname, 'flor' ) )
    epic_code = 903;

elseif ( strcmp ( input_varname, 'fluor' ) )
    epic_code = 903;

elseif ( strcmp(input_varname,'int_rotor1')  )
    epic_code = 4001;

elseif ( strcmp(input_varname,'int_rotor2')  )
    epic_code = 4003;

elseif ( strcmp(input_varname,'lower')  )
    epic_code = 1404;

elseif ( strcmp(input_varname,'north') & epic_data.is_wind )
    epic_code = 423;

elseif ( strcmp(input_varname,'north') & epic_data.is_water )
    epic_code = 1206;

elseif ( strcmp(input_varname,'north_lp') & epic_data.is_wind )
    epic_code = 423;

elseif ( strcmp(input_varname,'north_lp') & epic_data.is_water )
    epic_code = 1206;

elseif ( strcmp ( input_varname, 'par' ) )
    epic_code = 253;

elseif ( strcmp ( input_varname, 'percent_1' ) )
    epic_code = 4011;

elseif ( strcmp ( input_varname, 'press' ) )
    epic_code = 4023;

elseif ( strcmp ( input_varname, 'pressure' ) )
    epic_code = 4023;

elseif ( strcmp ( input_varname, 'psdev' ) )
    epic_code = 850;

elseif ( strcmp ( input_varname, 'r1_r2' ) )
    epic_code = 4004;

elseif ( strcmp ( input_varname, 'rotor' ) )
    epic_code = 4001;

elseif ( strcmp ( input_varname, 'sal' ) )
    epic_code = 40;

elseif ( strcmp ( input_varname, 'salt' ) )
    epic_code = 40;

elseif ( strcmp ( input_varname, 'salinity' ) )
    epic_code = 40;

elseif ( strcmp ( input_varname, 'sea_surf_tem' ) )
    epic_code = 25;

elseif ( strcmp ( input_varname, 'sea_surf_temp' ) )
    epic_code = 25;

elseif ( strcmp ( input_varname, 'sea_surf_temperature' ) )
    epic_code = 25;

elseif ( strcmp ( input_varname, 'sigm' ) )
    epic_code = 70;

elseif ( strcmp ( input_varname, 'sigma' ) )
    epic_code = 70;

elseif ( strcmp ( input_varname, 'sigmat' ) )
    epic_code = 70;

elseif ( strcmp ( input_varname, 'sigma_t' ) )
    epic_code = 70;

elseif ( strcmp ( input_varname, 'sigma_theta' ) )
    epic_code = 71;

elseif ( strcmp ( input_varname, 'sndspd' ) )
    epic_code = 80;

elseif ( strcmp ( input_varname, 'temp' ) )
    epic_code = 20;

elseif ( strcmp ( input_varname, 'temp_lp' ) )
    epic_code = 20;

elseif ( strcmp ( input_varname, 'temp_1' ) )
    epic_code = 20;

elseif ( strcmp ( input_varname, 'temp_2' ) )
    epic_code = 20;

elseif ( strcmp ( input_varname, 'temperature' ) )
    epic_code = 20;

elseif ( strcmp ( input_varname, 'tiltx' ) )
    epic_code = 4017;

elseif ( strcmp ( input_varname, 'tilty' ) )
    epic_code = 4018;

elseif ( strcmp ( input_varname, 'trans' ) )
    epic_code = 4010;

elseif ( strcmp ( input_varname, 'tran' ) )
    epic_code = 4010;

elseif ( strcmp ( input_varname, 'trans_1' ) )
    epic_code = 4010;

elseif ( strcmp ( input_varname, 'uperiod' ) )
    epic_code = 4056;

elseif ( strcmp ( input_varname, 'uperiod_1' ) )
    epic_code = 4056;

elseif ( strcmp ( input_varname, 'uperiod_2' ) )
    epic_code = 4056;

elseif ( strcmp ( input_varname, 'upper' ) )
    epic_code = 4000;

elseif ( strcmp ( input_varname, 'uvariance' ) )
    epic_code = 4050;

elseif ( strcmp ( input_varname, 'uvariance_1' ) )
    epic_code = 4050;

elseif ( strcmp ( input_varname, 'uvariance_2' ) )
    epic_code = 4050;

elseif ( strcmp ( input_varname, 'uvcovar' ) )
    epic_code = 4051;

elseif ( strcmp ( input_varname, 'uvcovar_1' ) )
    epic_code = 4051;

elseif ( strcmp ( input_varname, 'uvcovar_2' ) )
    epic_code = 4051;

elseif ( strcmp ( input_varname, 'uwcovar' ) )
    epic_code = 4053;

elseif ( strcmp ( input_varname, 'uwcovar_1' ) )
    epic_code = 4053;

elseif ( strcmp ( input_varname, 'uwcovar_2' ) )
    epic_code = 4053;

elseif ( strcmp(input_varname,'u_1') & epic_data.is_wind )
    epic_code = 422;

elseif ( strcmp(input_varname,'u_1') & epic_data.is_water )
    epic_code = 1205;

elseif ( strcmp(input_varname,'u_1_lp') & epic_data.is_wind )
    epic_code = 422;

elseif ( strcmp(input_varname,'u_1_lp') & epic_data.is_water )
    epic_code = 1205;

elseif ( strcmp(input_varname,'u_2') & epic_data.is_wind )
    epic_code = 422;

elseif ( strcmp(input_varname,'u_2') & epic_data.is_water )
    epic_code = 1205;

elseif ( strcmp(input_varname,'u_2_lp') & epic_data.is_wind )
    epic_code = 422;

elseif ( strcmp(input_varname,'u_2_lp') & epic_data.is_water )
    epic_code = 1205;

elseif ( strcmp(input_varname,'v_1') & epic_data.is_wind )
    epic_code = 423;

elseif ( strcmp(input_varname,'v_1') & epic_data.is_water )
    epic_code = 1206;

elseif ( strcmp(input_varname,'v_1_lp') & epic_data.is_wind )
    epic_code = 423;

elseif ( strcmp(input_varname,'v_1_lp') & epic_data.is_water )
    epic_code = 1206;

elseif ( strcmp(input_varname,'v_2') & epic_data.is_wind )
    epic_code = 423;

elseif ( strcmp(input_varname,'v_2') & epic_data.is_water )
    epic_code = 1206;

elseif ( strcmp(input_varname,'v_2_lp') & epic_data.is_wind )
    epic_code = 423;

elseif ( strcmp(input_varname,'v_2_lp') & epic_data.is_water )
    epic_code = 1206;

elseif ( strcmp(input_varname,'vdir') & epic_data.is_wind )
    epic_code = 410;

elseif ( strcmp(input_varname,'vdir') & epic_data.is_water )
    epic_code = 310;

elseif ( strcmp(input_varname,'vdir_1') & epic_data.is_wind )
    epic_code = 410;

elseif ( strcmp(input_varname,'vdir_1') & epic_data.is_water )
    epic_code = 310;

elseif ( strcmp(input_varname,'vdir_2') & epic_data.is_wind )
    epic_code = 410;

elseif ( strcmp(input_varname,'vdir_2') & epic_data.is_water )
    epic_code = 310;

elseif ( strcmp(input_varname,'vane') )
    epic_code = 1403;

elseif ( strcmp(input_varname,'vperiod') )
    epic_code = 4057;

elseif ( strcmp(input_varname,'vperiod_1') )
    epic_code = 4057;

elseif ( strcmp(input_varname,'vperiod_2') )
    epic_code = 4057;

elseif ( strcmp(input_varname,'vspd') & epic_data.is_wind )
    epic_code = 401;

elseif ( strcmp(input_varname,'vspd') & epic_data.is_water )
    epic_code = 300;

elseif ( strcmp(input_varname,'vspd_1') & epic_data.is_wind )
    epic_code = 401;

elseif ( strcmp(input_varname,'vspd_1') & epic_data.is_water )
    epic_code = 300;

elseif ( strcmp(input_varname,'vspd_2') & epic_data.is_wind )
    epic_code = 401;

elseif ( strcmp(input_varname,'vspd_2') & epic_data.is_water )
    epic_code = 300;

elseif ( strcmp ( input_varname, 'vvariance' ) )
    epic_code = 4052;

elseif ( strcmp ( input_varname, 'vvariance_1' ) )
    epic_code = 4052;

elseif ( strcmp ( input_varname, 'vvariance_2' ) )
    epic_code = 4052;

elseif ( strcmp ( input_varname, 'vwcovar' ) )
    epic_code = 4054;

elseif ( strcmp ( input_varname, 'vwcovar_1' ) )
    epic_code = 4054;

elseif ( strcmp ( input_varname, 'vwcovar_2' ) )
    epic_code = 4054;

elseif ( strcmp ( input_varname, 'w_1' ) )
    epic_code = 1204;

elseif ( strcmp ( input_varname, 'w_1_lp' ) )
    epic_code = 1204;

elseif ( strcmp ( input_varname, 'w_2' ) )
    epic_code = 1204;

elseif ( strcmp ( input_varname, 'w_2_lp' ) )
    epic_code = 1204;

elseif ( strcmp ( input_varname, 'wave_direc' ) )
    epic_code = 4062;

elseif ( strcmp ( input_varname, 'wave_height' ) )
    epic_code = 4061;

elseif ( strcmp ( input_varname, 'wave_period' ) )
    epic_code = 4060;

elseif ( strcmp ( input_varname, 'wvariance' ) )
    epic_code = 4055;

elseif ( strcmp ( input_varname, 'wvariance_1' ) )
    epic_code = 4055;

elseif ( strcmp ( input_varname, 'wvariance_2' ) )
    epic_code = 4055;

else
    fprintf ( 2, '\tCould not find a match for %s!!\n', input_varname );
    fprintf ( 2, '\tCheck the ''match_varnames'' file and add code to handle this.\n' );
    status = -1;
    return;
end
    

status = 1;
return;


