Re: [netcdfgroup] [EXTERNAL] Re: Quantize Support in netCDF-Fortran: Only Bit Groom possible?

  • To: Edward Hartnett - NOAA Affiliate <edward.hartnett@xxxxxxxx>, Charlie Zender <zender@xxxxxxx>
  • Subject: Re: [netcdfgroup] [EXTERNAL] Re: Quantize Support in netCDF-Fortran: Only Bit Groom possible?
  • From: "Thompson, Matt (GSFC-610.1)[SCIENCE SYSTEMS AND APPLICATIONS INC]" <matthew.thompson@xxxxxxxx>
  • Date: Mon, 7 Nov 2022 17:41:44 +0000
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nasa.gov; dmarc=pass action=none header.from=nasa.gov; dkim=pass header.d=nasa.gov; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=C+ObDs07DHvkdA3p/tDzyFbj+s0UlcAMqehbpwDr5oc=; b=QZPOXIUOMdlC1NLLcSRJTujlCLQ5OL5vlWaC4LZXK27haIz9R2nhkyOQQKPUmD75iReKtxVC3KUy+z8brbYcsvvsPmk4Ju/n8Fh4Vs2cRs9fGQMNDSQJXT90EYmZYzOgN0mGoq/IIWNQb9Xnl8vFZ5WcbjwwIEliEjz8cpi+neybjkNk66gno2TJB+1vrY2Z9dHbgoc0SwTLKPKXMCt8QzUccOtqawGZ/xYE7YatH1lOLFeIwKQ9jvCE6DVZxRKgjdlJ1Nyybzg/dfXH05af8AjizABD+31DSuR5ZOujkvPRrAGpDFtQaFItBktmi7uk+0k+hVdoJrsUGvXw27LREw==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=VqEjlI66vLetjWbEtTMOWSH8t/BydNpNYg+GA4QsEh7+KYvrkcA52VgwUVkMxPIucXnPii7HuQld8Gr2N0srfQP/n+/T79UTgdGiuaAWKSnLw+MDbx8PuxVtllM1Py33nnaXmtNELul4OvICa5bMxIm5DU1P4b1UQ8i+35LZexYJ6jnNBtRgLHUt2CO8ohRHAyMlzxuYqwROHKVrZAUUMspABLi6pFp0UPxBdSOO17sYlJQha85jtMUdRgHekB/zbJQ8a8ysXdtAyOVrzyomY+cpe2SvxKK98Fz08fBp9eLmunjMoA0SRQbkIr4ac9XdthvpYTZ0OPBR05XV1XF/fg==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nasa.gov;
Charlie and Ed,

Thanks. I made some comments on the PR as I think some changes are needed.

I suppose my next question is (and I think Charlie answered it), is that 
BitGroom and Granular BitRound use NSD, but BitRound uses NSB, right?

So, if I do:

  nf90_def_var_quantize(ncid, varid, quantize_mode, nsd)

if quantize_mode = 3, nsd is actually nsb even if the argument isn't named as 
such?

By my trying to picture floating points in binary, I'd need to...roughly triple 
(?) for equivalence, I think. That is NSD=3 is roughly NSB=9, right?

I'm going to compare this to the current MAPL bit-shaving (like bitgroom, but 
to all zero, I believe) and we often keep 10 bits, so I'm thinking I might 
compare to nsd=3 or nsd=4.

Matt

PS: I could be wrong and we
--
Matt Thompson, SSAI, Ld Scientific Programmer/Analyst
NASA GSFC,    Global Modeling and Assimilation Office
Code 610.1,  8800 Greenbelt Rd,  Greenbelt,  MD 20771
Phone: 301-614-6712                 Fax: 301-614-6246
http://science.gsfc.nasa.gov/sed/bio/matthew.thompson

From: netcdfgroup <netcdfgroup-bounces@xxxxxxxxxxxxxxxx> on behalf of Edward 
Hartnett - NOAA Affiliate via netcdfgroup <netcdfgroup@xxxxxxxxxxxxxxxx>
Reply-To: Edward Hartnett - NOAA Affiliate <edward.hartnett@xxxxxxxx>
Date: Saturday, November 5, 2022 at 2:59 PM
To: Charlie Zender <zender@xxxxxxx>
Cc: "netcdfgroup@xxxxxxxxxxxxxxxx" <netcdfgroup@xxxxxxxxxxxxxxxx>
Subject: [EXTERNAL] Re: [netcdfgroup] Quantize Support in netCDF-Fortran: Only 
Bit Groom possible?

I have submitted a PR to netcdf-fortran with the fix and tests:
https://github.com/Unidata/netcdf-fortran/pull/383<https://gcc02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2FUnidata%2Fnetcdf-fortran%2Fpull%2F383&data=05%7C01%7Cmatthew.thompson%40nasa.gov%7Ca419fa451b074194c4ff08dabf5fcf7b%7C7005d45845be48ae8140d43da96dd17b%7C0%7C0%7C638032715485339287%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=xHfAmw4m9FdaRRDI8g1BTi6qARpOLOVljljJMjBx%2F8k%3D&reserved=0>

On Fri, Nov 4, 2022 at 1:23 PM Edward Hartnett - NOAA Affiliate 
<edward.hartnett@xxxxxxxx<mailto:edward.hartnett@xxxxxxxx>> wrote:
I will submit a PR with a fix for the missing constants in netcdf-fortran.

It's entirely my fault - but will be fixed for the next release.

Until then, just use the constants 2 and 3, as defined in the C netcdf.h file:

#define NC_QUANTIZE_BITGROOM 1 /**< Use BitGroom quantization. */
#define NC_QUANTIZE_GRANULARBR 2 /**< Use Granular BitRound quantization. */
#define NC_QUANTIZE_BITROUND 3 /**< Use BitRound quantization. */

On Fri, Nov 4, 2022 at 12:22 PM Charlie Zender 
<zender@xxxxxxx<mailto:zender@xxxxxxx>> wrote:
Hi Matt,

 > So I was wondering: Is there a fundamental Fortran reason for not
supporting the other two variants? Or perhaps, is it that, of the three
variants, Bit Groom is by far the one people should use, so that's what
was exposed by the Fortran interface?

Great question. No fundamental reason.
All three quantization methods are
intended to be in the netCDF Fortran library via
the same API as BitGroom.
I'm unsure about the status of Granular BitRound
and BitRound in the latest Fortran release.
Others can chime in about that.
When all three are available in your Fortran
library, I recommend using either Granular BitRound
(with number of significant digits) or BitRound
(with number of stored bits). They both yield
better compression than BitGroom, as shown here:

https://nco.sourceforge.net/nco.html#fgr_003aqnt_005fcr_005fzst<https://gcc02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fnco.sourceforge.net%2Fnco.html%23fgr_003aqnt_005fcr_005fzst&data=05%7C01%7Cmatthew.thompson%40nasa.gov%7Ca419fa451b074194c4ff08dabf5fcf7b%7C7005d45845be48ae8140d43da96dd17b%7C0%7C0%7C638032715485495488%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=KEpOY5y0T45%2FLKXgtIozj1guk2Jy%2FrqEr6y8IZTo4z4%3D&reserved=0>

Charlie
--
Charlie Zender, Earth System Sci. & Computer Sci.
University of California, Irvine 949-891-2429 )'(

_______________________________________________
NOTE: All exchanges posted to Unidata maintained email lists are
recorded in the Unidata inquiry tracking system and made publicly
available through the web.  Users who post to any of the lists we
maintain are reminded to remove any personal information that they
do not want to be made public.


netcdfgroup mailing list
netcdfgroup@xxxxxxxxxxxxxxxx<mailto:netcdfgroup@xxxxxxxxxxxxxxxx>
For list information or to unsubscribe,  visit: 
https://www.unidata.ucar.edu/mailing_lists/<https://gcc02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.unidata.ucar.edu%2Fmailing_lists%2F&data=05%7C01%7Cmatthew.thompson%40nasa.gov%7Ca419fa451b074194c4ff08dabf5fcf7b%7C7005d45845be48ae8140d43da96dd17b%7C0%7C0%7C638032715485495488%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=jnaV%2BGVbrgz%2BkWtsXz38QDseB0FiOhCUpBoNmp%2Bpbqg%3D&reserved=0>
  • 2022 messages navigation, sorted by:
    1. Thread
    2. Subject
    3. Author
    4. Date
    5. ↑ Table Of Contents
  • Search the netcdfgroup archives: