function Var_ID=add_mainVar_attributes_v2020(ncid,ID,datatype,dimIDs,long_name,standard_name,units,coverage_content_type,valid_range,actual_range,fillNvalue,instrument,platform,statistic,grid_mapping,coordinates,cell_methods)

Var_ID = netcdf.defVar (ncid, ID, datatype, dimIDs);
    if ~isempty(long_name); netcdf.putAtt(ncid, Var_ID , 'long_name', long_name); end
    if ~isempty(standard_name);netcdf.putAtt(ncid, Var_ID , 'standard_name', standard_name);end;
    if ~isempty(units);netcdf.putAtt(ncid, Var_ID , 'units', units);end;
    if ~isempty(coverage_content_type);netcdf.putAtt(ncid, Var_ID , 'coverage_content_type', coverage_content_type); end; %An ISO 19115-1 code to indicate the source of the data (image, thematicClassification, physicalMeasurement, auxiliaryInformation, qualityInformation, referenceInformation, modelResult, or coordinate).
    if ~isempty(instrument);netcdf.putAtt(ncid, Var_ID , 'instrument', instrument);end;
    if ~isempty(platform);netcdf.putAtt(ncid, Var_ID , 'platform', platform);end;
    if ~isempty(statistic);netcdf.putAtt(ncid, Var_ID , 'statistic', statistic);end;
    if ~isempty(grid_mapping);netcdf.putAtt(ncid, Var_ID , 'grid_mapping', grid_mapping);end;
    if ~isempty(coordinates);netcdf.putAtt(ncid, Var_ID , 'coordinates', coordinates);end;
    if ~isempty(cell_methods);netcdf.putAtt(ncid, Var_ID , 'cell_methods', cell_methods);end;
    if ~isempty(valid_range);netcdf.putAtt(ncid, Var_ID , 'valid_range', valid_range);end;
    if ~isempty(actual_range);netcdf.putAtt(ncid, Var_ID , 'actual_range', actual_range);end;
    if ~isempty(fillNvalue);netcdf.defVarFill(ncid, Var_ID , false, fillNvalue); end;