function [sn, ln, u, c, cc, crd] = ODM_assign_long_info_DSD(the_fields, nfields, yrstr)

%%% function to assign long info, units, and long variable names to the variables of cruise data
% l = cell(nfields,1);     
ln = cell(nfields,1);    
sn = cell(nfields,1);    
u = cell(nfields,1);              
c = cell(nfields,1);     
cc = cell(nfields,1);     
crd = cell(nfields,1);     

%% units
u(ismember(the_fields,'P'))              = {'mm hr^-1'};
u(ismember(the_fields,'Pfortran'))       = {'mm hr^-1'};
u(ismember(the_fields,'z'))              = {'mm^6 m^-3'};
u(ismember(the_fields,'Z'))              = {'dBZ'};
u(ismember(the_fields,'W'))              = {'g m^-3'};
u(ismember(the_fields,'Pd'))             = {'mm hr^-1'};
u(ismember(the_fields,'zd'))             = {'mm^6 m^-3'};
u(ismember(the_fields,'Zd'))             = {'dBZ'};
u(ismember(the_fields,'Wd'))             = {'g m^-3'};
u(ismember(the_fields,'voltage'))        = {'volts'};
u(ismember(the_fields,'urel_anem'))      = {'m s^-1'};
u(ismember(the_fields,'nsumdrops'))      = {'drop count in all bins'};
u(ismember(the_fields,'ndrops'))         = {'drop count in each bin'};
u(ismember(the_fields,'Dmax'))           = {'mm'};
u(ismember(the_fields,'Dmax_i'))         = {'1'};
u(ismember(the_fields,'bin_nums'))       = {'counts'};
u(ismember(the_fields,'D'))              = {'mm'};
u(ismember(the_fields,'dD'))             = {'mm'};
u(ismember(the_fields,'edges'))          = {'mm'};
u(ismember(the_fields,'vfall'))          = {'m s^-1'};
u(ismember(the_fields,'mass'))           = {'kg'};
u(ismember(the_fields,'Nd'))             = {'mm^-1 m^-3'};
u(ismember(the_fields,'nd'))             = {'m^-3'};
u(ismember(the_fields,'Nw'))             = {'mm^-1 m^-3'};
u(ismember(the_fields,'D0'))             = {'mm'};
u(ismember(the_fields,'mu'))             = {'unitless'};
u(ismember(the_fields,'good_gamma'))     = {'index of level 1 DSD time series'};

%% long_name
ln(ismember(the_fields,'Pfortran'))       = {'rain_rate_fortran'};
ln(ismember(the_fields,'P'))              = {'rain_rate'};
ln(ismember(the_fields,'z'))              = {'radar_reflectvity_factor_linear'};
ln(ismember(the_fields,'Z'))              = {'radar_reflectivity_factor_logarithmic'};
ln(ismember(the_fields,'W'))              = {'liquid_water_content'};
ln(ismember(the_fields,'Pd'))             = {'rain_rate_per_bin'};
ln(ismember(the_fields,'zd'))             = {'radar_reflectvity_factor_linear_per_bin'};
ln(ismember(the_fields,'Zd'))             = {'radar_reflectivity_factor_logarithmic_per_bin'};
ln(ismember(the_fields,'Wd'))             = {'liquid_water_content_per_bin'};
ln(ismember(the_fields,'voltage'))        = {'voltage'};
ln(ismember(the_fields,'urel_anem'))      = {'relative_wind_speed_at_disdro_from_cup_anemometer'};
ln(ismember(the_fields,'nsumdrops'))      = {'drop_count_in_all_bins'};
ln(ismember(the_fields,'ndrops'))         = {'drop_count_in_each_bin'};
ln(ismember(the_fields,'Dmax'))           = {'max_drop_diameter'};
ln(ismember(the_fields,'Dmax_i'))         = {'max_drop_diameter_bin_number'};
ln(ismember(the_fields,'bin_nums'))       = {'bin_numbers'};
ln(ismember(the_fields,'D'))              = {'diameter_associated_with_bin_centerpoint'};
ln(ismember(the_fields,'dD'))             = {'bin_widths'};
ln(ismember(the_fields,'edges'))          = {'bin_edges'};
ln(ismember(the_fields,'vfall'))          = {'fall_speed_per_bin'};
ln(ismember(the_fields,'mass'))           = {'mass_per_bin'};
ln(ismember(the_fields,'Nd'))             = {'N_of_D_drop_density_meaning_count_per_size_bin_per_volume'};
ln(ismember(the_fields,'nd'))             = {'n_of_D_drop_concentration_meaning_count_per_size_bin'};
ln(ismember(the_fields,'Nw'))             = {'normalized_gamma_distribution_intercept_parameter'};
ln(ismember(the_fields,'D0'))             = {'median_volume_diameter'};
ln(ismember(the_fields,'mu'))             = {'shape_parameter'};
ln(ismember(the_fields,'good_gamma'))     = {'index_number_of_level_1_DSD_time_series_where_gamma_retrieval_was_possible'};

%% standard_name
sn(ismember(the_fields,'Pfortran'))       = {'rainfall_rate'};
sn(ismember(the_fields,'P'))              = {'rainfall_rate'};
sn(ismember(the_fields,'z'))              = {''};
sn(ismember(the_fields,'Z'))              = {''};
sn(ismember(the_fields,'W'))              = {'mass_concentration_of_liquid_water_in_air'};
sn(ismember(the_fields,'Pd'))             = {'rainfall_rate'};
sn(ismember(the_fields,'zd'))             = {''};
sn(ismember(the_fields,'Zd'))             = {''};
sn(ismember(the_fields,'Wd'))             = {'mass_concentration_of_liquid_water_in_air'};
sn(ismember(the_fields,'voltage'))        = {''};
sn(ismember(the_fields,'urel_anem'))      = {'wind_speed'};
sn(ismember(the_fields,'nsumdrops'))      = {''};
sn(ismember(the_fields,'ndrops'))         = {''};
sn(ismember(the_fields,'Dmax'))           = {''};
sn(ismember(the_fields,'Dmax_i'))         = {''};
sn(ismember(the_fields,'bin_nums'))       = {''};
sn(ismember(the_fields,'D'))              = {''};
sn(ismember(the_fields,'dD'))             = {''};
sn(ismember(the_fields,'edges'))          = {''};
sn(ismember(the_fields,'vfall'))          = {''};
sn(ismember(the_fields,'mass'))           = {''};
sn(ismember(the_fields,'Nd'))             = {''};
sn(ismember(the_fields,'nd'))             = {'number_concentration_of_cloud_liquid_water_particles_in_air'};
sn(ismember(the_fields,'Nw'))             = {''};
sn(ismember(the_fields,'D0'))             = {''};
sn(ismember(the_fields,'mu'))             = {''};
sn(ismember(the_fields,'good_gamma'))     = {''};

%% comment
c(ismember(the_fields,'Pfortran'))       = {'this is less trustworthy, we do not recommend using it'};
c(ismember(the_fields,'P'))              = {''};
c(ismember(the_fields,'z'))              = {''};
c(ismember(the_fields,'Z'))              = {''};
c(ismember(the_fields,'W'))              = {''};
c(ismember(the_fields,'Pd'))             = {''};
c(ismember(the_fields,'zd'))             = {''};
c(ismember(the_fields,'Zd'))             = {''};
c(ismember(the_fields,'Wd'))             = {''};
c(ismember(the_fields,'voltage'))        = {''};
c(ismember(the_fields,'urel_anem'))      = {''};
c(ismember(the_fields,'nsumdrops'))      = {''};
c(ismember(the_fields,'ndrops'))         = {''};
c(ismember(the_fields,'Dmax'))           = {''};
c(ismember(the_fields,'Dmax_i'))         = {''};
c(ismember(the_fields,'bin_nums'))       = {'128 size bins total, which are logarithmically spaced'};
c(ismember(the_fields,'D'))              = {''};
c(ismember(the_fields,'dD'))             = {''};
c(ismember(the_fields,'edges'))          = {''};
c(ismember(the_fields,'vfall'))          = {''};
c(ismember(the_fields,'mass'))           = {''};
c(ismember(the_fields,'Nd'))             = {''};
c(ismember(the_fields,'nd'))             = {''};
c(ismember(the_fields,'Nw'))             = {''};
c(ismember(the_fields,'D0'))             = {''};
c(ismember(the_fields,'mu'))             = {''};
c(ismember(the_fields,'good_gamma'))     = {''};

%% coverage content type
cc(ismember(the_fields,'Pfortran'))       = {'modelResult'};
cc(ismember(the_fields,'P'))              = {'physicalMeasurement'};
cc(ismember(the_fields,'z'))              = {'modelResult'};
cc(ismember(the_fields,'Z'))              = {'modelResult'};
cc(ismember(the_fields,'W'))              = {'physicalMeasurement'};
cc(ismember(the_fields,'Pd'))             = {'modelResult'};
cc(ismember(the_fields,'zd'))             = {'modelResult'};
cc(ismember(the_fields,'Zd'))             = {'modelResult'};
cc(ismember(the_fields,'Wd'))             = {'modelResult'};
cc(ismember(the_fields,'voltage'))        = {'physicalMeasurement'};
cc(ismember(the_fields,'urel_anem'))      = {'physicalMeasurement'};
cc(ismember(the_fields,'nsumdrops'))      = {'physicalMeasurement'};
cc(ismember(the_fields,'ndrops'))         = {'physicalMeasurement'};
cc(ismember(the_fields,'Dmax'))           = {'physicalMeasurement'};
cc(ismember(the_fields,'Dmax_i'))         = {'referenceInformation'};
cc(ismember(the_fields,'bin_nums'))       = {'referenceInformation'};
cc(ismember(the_fields,'D'))              = {'coordinate'};
cc(ismember(the_fields,'dD'))             = {'referenceInformation'};
cc(ismember(the_fields,'edges'))          = {'coordinate'};
cc(ismember(the_fields,'vfall'))          = {'referenceInformation'};
cc(ismember(the_fields,'mass'))           = {'referenceInformation'};
cc(ismember(the_fields,'Nd'))             = {'physicalMeasurement'};
cc(ismember(the_fields,'nd'))             = {'physicalMeasurement'};
cc(ismember(the_fields,'Nw'))             = {'modelResult'};
cc(ismember(the_fields,'D0'))             = {'modelResult'};
cc(ismember(the_fields,'mu'))             = {'modelResult'};
cc(ismember(the_fields,'good_gamma'))     = {'modelResult'};

%% coverage content type
crd(ismember(the_fields,'Pfortran'))       = {'time'};
crd(ismember(the_fields,'P'))              = {'time'};
crd(ismember(the_fields,'z'))              = {'time'};
crd(ismember(the_fields,'Z'))              = {'time'};
crd(ismember(the_fields,'W'))              = {'time'};
crd(ismember(the_fields,'Pd'))             = {'time, D'};
crd(ismember(the_fields,'zd'))             = {'time, D'};
crd(ismember(the_fields,'Zd'))             = {'time, D'};
crd(ismember(the_fields,'Wd'))             = {'time, D'};
crd(ismember(the_fields,'voltage'))        = {'time'};
crd(ismember(the_fields,'urel_anem'))      = {'time'};
crd(ismember(the_fields,'nsumdrops'))      = {'time'};
crd(ismember(the_fields,'ndrops'))         = {'time, D'};
crd(ismember(the_fields,'Dmax'))           = {'time'};
crd(ismember(the_fields,'Dmax_i'))         = {'time'};
crd(ismember(the_fields,'bin_nums'))       = {'D'};
crd(ismember(the_fields,'D'))              = {''};
crd(ismember(the_fields,'dD'))             = {'D'};
crd(ismember(the_fields,'edges'))          = {''};
crd(ismember(the_fields,'vfall'))          = {'D'};
crd(ismember(the_fields,'mass'))           = {'D'};
crd(ismember(the_fields,'Nd'))             = {'time, D'};
crd(ismember(the_fields,'nd'))             = {'time, D'};
crd(ismember(the_fields,'Nw'))             = {'time'};
crd(ismember(the_fields,'D0'))             = {'time'};
crd(ismember(the_fields,'mu'))             = {'time'};
crd(ismember(the_fields,'good_gamma'))     = {'time'};



%%% replace _ with space in long names
for i = 1:length(ln)
    ln(i) = {strrep(char(ln{i}),'_',' ')};
end
