pre-release 1/2004: Variable names now appear on the inventory. Ok, only 1% of the GRIB names have been typed in and I plan to revise this code. pre-release 2/2004: Levels now work. Ok some levels may need polishing but it works. Inventory of sample eta file lacks grid information but is usable. pre-release 9/2004: Jaakko Hyvätti added the "gribtab" code pre-release 8/2005: extraction of grib data works v 0.1 9/2005: alpha release v 0.1.1 12/15/2005 added scan flags for various grids, fixed some scan code, malloced a large array that caused a seg fault if stack was too small v0.1.1a 4/28/2006 fix for lambert2ll Naoya Suda - Thanks, remove some debug statements v0.1.1b 5/4/2006 gaussian grid Sec3.c, grb2.h, rename nxny() to get_nxny() better grid output v0.1.1c 5/23/2006 added -processid option (ex which fcst model) 5/24/2006 added -range option for partial http transfers v0.1.1.d 5/31/2006 change in -grid .. location of print nl v0.1.1.e 6/2006 some time and level upgrades v0.1.2 6/2006 -text now prints "nx ny" rather than "ndata 1", fixed binary/text output of WE:NS files 7/2006 added the gaussian/polar/merc projections, make various FILE.c routines reentrant 7/2006 added more packing types 7/2006 -flush -> flush buffers for -lola lola 8/2006 -del renamed to -colon, modified read_inventory and write "rec_no:location" routines so that -colon , would work .. make comma seperated files added info about spherical harmonics moved PackVals into packing, triggered by verbose mode better info about various Gaussian and lat-lon grids decided to get critical values by code_table_X_Y(sec) and flag_table_X_Y(sec) calls changed (projection)2ll calls to use sec rather than gdas changed uint to unsigned int .. gcc extension fixed -lola bug report from D. Duncalf added -no_append -no_flush, renamed -nof77 to -no_f77 to be consistent with new names v0.1.3 9/2006 added -vt and -VT verf time added warning to bad lat-lon grid better testing for lat lon values mod for AIX compilation v0.1.4 9/2006 fixed problem with decoding of fields with bitmaps v0.1.4a added a test for failed memory allocation change to makefile for people without . on their path (suggested by Kristian Nilssen) 9/2006 change for Windows geo.c allocate memory explicitly closest() needs to be made faster v0.1.4b 9/2006 fixed comment for f_order, default order is we:sn not we:ns altered text_fmt to change format in init stage added -verf which is a macro like -s but uses -vt rather than -t 10/2006 f_lola, f_lat can take negative longitudes v0.1.4c 10/2006 made f_lola much faster 10/2006 f_lola uses append flag 10/2006 grid type stubs, v0.1.4d 11/2006 add order we:ns, add error check for lat-lon with -order != we:sn fix some minor scan code bugs 11/2006 text_format, text_col and header are used by -lola with text option added the -is -not options v0.1.4e 11/2006 fixed bug in un-scanning code: WE|EW:SN, (we:ns and we:sn were ok) added code for complex packing with spatial diff. undefined values added -match -not and -last upgraded g2clib 1.0.4 -f77 and -no_f77 are renamed to -header and -no_header, last name change, promise change to the "main" makefile g2clib-1.0.2 -> g2clib-1.0.4 12/2006 added flag_table_3.5/3.9/3.10 12/2006 modified -t and -vt to produce datecode in grads format when -v2 used v0.1.4f 1/2007 Many mods from Manfred Schwarb, remove wrtieee_header, libg2c -> libgrib2c, error checks for thinned grids error check on verftime many cleanup patches form M. Schwarb - no effect on code operation better thinned grid support .. in lat-lon grids uint8 fixed for numbers > 2 GB (ok, if I had 2GB grib record, I could check the fix) scan of spectral fields changed to unknown, scan handles some thinned grids ilat works with thinned grids, ijlat doesn't fixed Level.c () m under ground, removed factor of 1/100. found by Caser Tejeda Hernandez binary files written by -Lola now have header support many patches by M Schwarb (31 for this release)! v0.1.4gbeta 1/2007 Manfred Schwarb wrote program to download tables from the web documentation. The code writes a code fragment (body of a switch statement) which is then included by the code. code_table0.dat CodeTable_1.3.dat CodeTable_3.1.dat ncep_tableC.dat CodeTable_1.2.dat CodeTable_1.4.dat gribtab.dat v0.1.4g 2/2007 -help (string) is now case insensitive, -ens for ensemble info, -s includes -ens, aliases, v0.1.4h 2/2007 more tables, process is now an alias v0.1.5 3/2007 updated ftime so to handle product definition template 4.8 better (still has rough points) replace exit() with fatal_error moved #define MATCH to makefile add netcdf, thanks Kristian Nilssen added code table 4.10 added ensemble info to -verf v0.1.5a 4/2007 Netcdf conversion to time fixed, a local-UTC conversion problem v0.1.5b 4/2007 Netcdf module update: multiple times allowed, by Sergey Varlamov cname - multiple gribtable support, -tigge for modified TIGGE names Help: output format change some more ensemble support: derived products, pdt=12, N_ens, v0.1.5c 6/2007 updated Netcdf.c by Sergey Varlamov 7/2007 modified grib2/makefile and grib2/wgrib2/makefile (fixed clean) 8/2007 update to makefile -l netcdf -> -lnetcdf (S. Varlamov) netcdf: update format, more metadata (S. Varamov) Sec3 - mercator grid had wrong variable dimension location (Boi Vuong) Support for grid 204, some other minor grids added API for closest/closest_init made more general for future changes modified makefiles to be easier to change to pre-compiled libraries v0.1.5d 9/2007 changed to new version of g2clib (1.0.5), updated makefiles,minor netcdf changes v0.1.5e 10/2007 would segfault if -netcdf and undefined variable (fixed cname), modified makefile 10/2007 scaled2FLT has less roundoff error -spread doesn't print out undef values added more NCEP levels added g2ctl support -lev0 -ctl_inv (both are preliminary) added -undefine option 11/2007 added -ijundefine option 11/2007 allow inventories to start with blanks use tigge table if produced as a tigge product (secondary table) v0.1.5f 11/2007 11/2007 VerfTime.c fixed when not a forecast updated -CodeTable_5.0 and -packing updated CodeTable_4.10.dat added CodeTable_3.11 (thinned regional vs global grid) thinned grid support for lat-lon and the various thinned Gaussian grids 12/2007 grib2 output routines -grib_out, -undefine 1/2008 fix spelling mistake (matchs -> matches) update gribtab.dat .. ie variable names noticed so corrections to the table when variables changed numbers!!! added -undefine_val added fflush_mode to FILE.c added makefile_all_libs some updates to documentation update to Netcdf.c vsm v0.1.6 1/2008 --------------------------------------- fixed error compiling Tigge.c without no TIGGE option more descriptive Sec_len removed from add_time .. numerical precision problem write to stdout "-text -" write to stdout "-spread -" update to Netcdf.c vsm bug fix to GrADS, geo vsm lat-lon now double precision vsm I realized that I have been neglecting to put vsm's netcdf contributions into the Change log. The change log should be all contributors, not mine. 2/2008 -vector_dir prints whether N/S or grid winds ffopen added, allows multiple opens to same file -if works (previously just stub) -if REG_EX -grib file will do -grib if REG_EX LatD for lambert-conformal vsm updated Sec3 vsm make verification time consistent with grads (pdt=8) now at end of interval ` -grid -scan now shows the output_order as well as input order (scan) makefiles .. -lm put at the end of ldflags lambertll - used fixed radius of earth (different than normal) now uses value from code table 3.2 v0.1.6.1 2/2008 --------------------------------------- minor fix to lambertll (->latD) vsm change to g2clib/makefiles, fix INC= declaration f_h now uses CALL_ARG0, getting ready for double precision decode change to makefile_all_libs (use gmake for compiling wgrib2) vsm: bug fix to Netcdf.c (serious bug) vsm: restructuring Netcdf code for use by HDF library v0.1.6.2 2/2008 --------------------------------------- fixed version code thinned grids -> go to "raw" mode, done by adding output_type_wanted (fix error in display) v0.1.6.2a 2/2008 --------------------------------------- in makefiles got rid of space after -L and -I added grid_def, not_if removed decode flags from grib/GRIB options termendous speedup in -grib option 1:41 -> 3 sec v0.1.7.0 2/2008 ---------------------------------------- added -limit for nomads software fixed major bug in -i command, problem if grib file uses submessages and don't extract previous submessage. v0.1.7.1 3/2008 ---------------------------------------- fixed -v -grid, added code table 5.7 added verf-time for more code-table 4.0 9..14 makefiles (Manfred Schwarb) gunzip -n, use && lola is correctly called an output function -V by Manfred Schwarb Bbox by Arlindo da Silva update -packing error checking fix scan.c Manfred Schwarb fixed thined grid bug/changed scan order of grib_out now in grid order (we:sn default) sec8 now uses 55 instead of '7' for compatibility non-ascii reads single precision ieee-grib v0.1.7.2 3/2008 ---------------------------------------- -order should now work on 1 x ny or ny x 1 grids (lat/lon do not however) fixed broken makefile_all_libs v0.1.7.2a 3/2008 ---------------------------------------- fixed problem in makefile* (tmp.tar renamed to tmp?.tar) fixed problems in makefile_all_libs for CFSRR: update gribtable, update levels v0.1.7.2b 3/2008 ---------------------------------------- added: -little_endian and -big_endian for ieee output -grid: dlat and dlon now use code_table_3.3 to see if undefined jpeg packing ieee packing precision for jpeg scaling for jpeg various set_ routines Manfred Schwarb: big cleanup signed/unsigned, remove extern from wgrib2.h print statements, signed/unsigned conversions in lola/geo fixed v0.1.7.4 4/2008 ---------------------------------------- (internal release) wgrib.c: up to 8 parameters for mysql csv.c: added Niklas Sondell, Storm Weather Center mysql.c: added Niklas Sondell, Storm Weather Center ijsmall_domain, small_domain added wgrib2/makefile: mysql support v0.1.7.5 5/2008 ---------------------------------------- added: set_flag_table_3_3 in order to fix some polar stereographic files fixed Wrt_grib.c (tail not written) fixed small_domain v0.1.7.6 5/2008 ---------------------------------------- fixed small_domain fixed problem with makefile_all_libs v0.1.7.7 5/2008 ---------------------------------------- fixed netcdf=0 mysql=1 problem in makefile grib_ieee -- keep original scan order fixed f_set_date v0.1.7.7a 6/2008 ---------------------------------------- fixed typo in small_domain ij_undefined now uses ix=1..nx iy=1..ny -stats now has cos-weighted means v0.1.7.7b 6/2008 ---------------------------------------- sec3 - rotated lat-lon/gaussian, rotation pole, streach pole, factor fixed upgraded gribtable fixed GDS problems with writing *data in we:sn order, now write in original order affects -grib_ieee -grib_out broken makefile_all_libs v0.1.7.7c 6/2008 ---------------------------------------- updated header to f_ieee added Mysql_speed by Niklas Sondell (I can't test Mysql, WNE) radar and satellite products now return verf_time updated gribtab.dat changed check in nxny in cases of undefined grids the default -s is moved from front to back of arg list worked on time codes: Product Definition Template 4.8 added fix_ncep -- support for strange NCEP time codes codes added AAIG - support for Ascii ArcInfo Grid files (lat-lon grid) v0.1.7.7d 7/2008 ---------------------------------------- added makefile_all_libs_new, this makefile has configuration options in main makefile added code_table_4.11 continued to improve -fix_ncep improved Sec4 - time range = 8 new g2clib: v 1.1.7 (added fix from 1.0.5) replaced code_table_3_3 by flag_table_3_3 jpeg and simple unpacking doesn't use g2clib, use -g2clib to use g2clib Jose F. Nieves: Lambert/polar always uses dx&dy. Thanks added -match_inv changed -match/-not/-if/-not_if to use match_inv instead of -s (added vt=) updated Mysql_speed, Niklas Sondell, Storm Weather Center v0.1.7.7e 9/2008 ---------------------------------------- libpng is created as a static library in makefile_all_libs* (previously used default: sharded/dynamic library) support for NCEP e-grid (grid template=32768) added -ctl_ens for g2ctl fixed +/- ensemble member (got it backwards) changed ens= to ENS= v0.1.7.7f 9/2008 ------------------- internal release --------------------- makefile_all_libs_new: libpng: -disable-shared test to see if make == gnu-make rm grib2.h in Grib.c direct call to dec_png rather than go through g2clib Nick Lott - level 241 added added png packing info updated gribtab.dat (fix LOUV for marine branch) .. update mk_gribtab.sh added count function, modified wgrib2.c to send mode == -2 messages to stderr added grid_changes .. check for only 1 grid type -for option added: select range of records to process added -prob v0.1.7.7g 10/2008 ---------------------------------------- added import_text and import_ieee, fixed rdieee_file set_data_bin renamed as import_bin modified f_lev0 for more levels support for PDT=9 added set_byte changed description of fcst/anl ave/acc 0-6 hour acc -> 0-6 hour acc fcst fixed up description for 1 hour anl tested decode of ECMWF thinned gaussian files .. allowed now fixed bug in g2clib 1.1.7 (AIX) wrt_time: century fixed fixed grib_out: problem when #bits required > 16 wrong sign, affects jpeg and simple output f_lev0, layer between two hybrid levels added (105) v0.1.7.7h 12/2008 ---------------------------------------- examined all codes that handle the polar stereographic projection. wgrib2, g2ctl and grib2ctl were based on the same code which had to be modified to handle the south pole projection. v0.1.7.7i 12/2008 ---------------------------------------- warning if find a grib1 message Mod_grib.c unsigned char *p -> char *p; removed unused utmp int8: added flt2scaled fixed return Prob.c fixed sprintf %@ to @ in sprintf Sec4.c units.c added include Import_text: error messages fixed added #groups for complex packing: -v -packing replaced integer_power by the duplicate Int_Power For a constant field: NCEP routines (1/09): data(*) = reference_value WMO standard: data(*) = reference_value*10**(-dec_scaling) For jpeg/png/simple/complex packing (not spectral), you can get NCEP routines (1/09) by -g2clib 1 WMO standard by -g2clib 0 The default value of g2clib will depend on the installation Modified grib_out so that dec_scale is set to zero for constant fields as a result, the constant fields are NCEP-library compatible v0.1.7.8 1/2009 ---------------------------------------- changed Sec4.c so that when NCEP prints TMIN/TMAX old: 264:30420217:d=2004021912:TMIN:2 m above ground:66-72 hour missing fcst: new: 264:30420217:d=2004021912:TMIN:2 m above ground:66-72 hour fcst: the missing refers to a missing statistical operator (ex. ave, acc, min, max) this verion is 1 hour newer than v0.1.7.8 .. for operations v0.1.7.8a 1/2009 -------------------------------------------------- modified -set for better help/error message -code_table_4.4 prints units fixed normalize_time_units (missing breaks in switch) -ftime: enabled product defn template template 11 (ensemble stat processing) updated grib table, FRPRATE -> FPRATE, IPPRATE -> IPRATE, add FRZR (NCEP) v0.1.7.8b 1/2009 -------------------------------------------------- linked in g2clib 1.1.8 (change to wgrib2) linked in libpng 1.2.34 f_lev0 .. added level 241 (N in sequence) for WW3 data and filled other missing NCEP local levels added -fix_ncep_2, NCEP operations has probability for less than negative value wrong, used 2's complement to store integer rather than signed number. NCEP operations knows of the problem but can't fix it because of downstream software. changed -prob: prob>N to prob >N, probN in Grib.c from Arlindo da Silva renamed copy_sec to copy and added copy_data routines inv_out[INV_BUFFER] can overflow with help command update of grib name table v0.1.7.8f 3/2009 (internal release) ------------------------------ added -wind_speed, prototype for functions to make calculated grib files fixed description of -set_ijval added -config v0.1.7.8g 3/2009 ------------------------------ added -ncep_norm added -unix_time by Pablo Romero added -set_rename (removed 6/2009) makefile restructured, added config.h, support for netcdf5 -config shows last wgrib2 compile (not Config.c compile) rename makefile_all_libs_new -> makefile, remove old makefiles added some code in verftime for code table 1.2 (sig of RT) vertical level description added carets: "Potential vorticity [K m^-2 kg^-1 s^-1] to be consistent with grib name descriptions updated code table 4.3 .. uses NCEP specific codes updated code table 3.1, 3.2, 4.11 added more info to -Sec4 fixed -set_var v0.1.7.8h 4/2009 ------------------------------ added -fi (nop output operation) undocumented -plus and -times removed to be replaced by -rpn -for N is now the same as -for N:INT_MAX:1 -for N::M is same as N:INT_MAX:M added -n -for_n added -get_bytes fixed -set (broken 1/09) updated grib table mastertab between 0..4 is set to 1 in cname added -rpn fixed problems with -set_lev, handles pdt=0..14 (old=0 only) update level.c init_sec added to NCEP_norm, Wind_speed.c Netcdf.c added more filtering illegal characters in names v0.1.7.8i 5/2009 ------- old version posted on web site, posted for couple hours and replaced by 1.7.8j -Sec_len shows correct section 5 length change in g2clib makefile to use ${CFLAGS} removed -set_rename moved (config.c,Configure.c) -> Config.c & modified makefiles new gribtable v0.1.7.8j 6/2009 ------------------------------ removed a debug statement in geo.c added semicolon after match_inv N_ens works for more pdts more table specific code should be moved to Code_Values.c f_lev, f_lev0 use fixed_surfaces() this is in preparation for chemistry templates. Sergey Varlamov: add netcdf4 to Netcdf.c etc Reinoud Bokhorst: added -tosubmsg, thanks Fix rd_grib2_msg: Reinoud Bokhorst pointed out that code table 6.0=254 was handled incorrectly Reinoud Bokhorst: added Checksum.c and crc32.c thanks move reftime to Verftime.c, mod f_csv, AAIG, Sec1, Mysql to use reftime modified codetable_5_5, diagnostics for substitute missing values complex packing Reinoud Bokhorst: Scan.c, fix translation tables with multi-scan files and grib_out Reinoud Bokhorst: Grib.c, fixed sec[5] n points Reinoud Bokhorst: 0xSec check size of output writing to inv_out Pablo Romero: fixed a bug in makefile for mysql = -> += Mod_grib: added extern to use_scale, dec_scale, bin_scale subtle change in min_val of grib_out routines now making a new file reproduces old file changed -processid to add observational process id, new format added -spectral_bands (no test data) added internal code for for complex decoding added internal code for complex packing changed format of -packing -v for complex packing v0.1.8.0 8/2009 ------------------------------ added data packing 200 - run length - preliminary added get_int fixed grib_out (jpeg/simple) when has binary scaling is used old: i = (int) (max_val - ref)*scale + 0.5; new: i = (int) ((max_val - ref)*scale + 0.5); found by a loss of precision restructured grib_out v0.1.8.1 8/2009 ------------------------------ f_set_ftime now alters code table 1.2 and 1.3 f_time now calls a2time_range f_metadata calls f_time or f_ave f_RPN: added print_{min,max,rms,corr} corr/rms are cosine(lat) weighted modified wgrib2, all functions (not just inv) can write to inv_out in during execution added yrev to RPN.c, only applies to we:sn and we:ns files. added set_metadata: added field: scale=Dec_scaling,Bin_scaling unpk_run_length: fixed typo in bitmap secion set_lev: added: x m underground, x-x m below ground best_scaled_value: now handles zero fixed get_code*.sh added NCEP special levels to f_lev/f_metadata geo.c off by one in mercator from Jerry Stueve (VisiTech) mysql: tmpnam -> mkstemp from Jerry Stueve (VisiTech) mysql: LOAD LOCAL from Jerry Stueve (VisiTech) added f_set_pdt fixed undef_val? in fixed_surfaces, affects -v2 -lev v0.1.8.2 11/2009 ------------------------------ fixed f_domain for domains that cross the prime meridian set_ave: "added N@N hour ave anl, missing=0", "N@N hour ave (N hour fcst),missing=0" added if_n if_reg, if_n work if REGEX not installed complex_pack: replaced (int) (... +0.5) to floor(...+0.5) updated gribtab.dat, updated get_gribtab.sh updated Latlon to print out i, ix, iy for -lon when mode > 0 -packing now shows abreviations (good for saving the packing type) -fix_ncep .. handle more of ncep table 4.10 codes added ncep level 236-236 for cfsrr (cnvgribcfs) added set_lev support for "N-N m below sea level", "(N)C ocean isotherm" removed (m) from "bottom of ocean mixed layer" "bottom of ocean isothermal layer" in CodeTable_4.5_ncep.dat (manual edit) NCEP_local_levels_test.h support for pdt 4.15, some additions for 4.13 and 4.14 in the CodeTables comments that bitstreams are supported up to 25 bits fixed set_lev "X-Y mb" fixed a bug in if_reg that was introduced in code cleanup added -start_ft .. for use with -b option in gribmap from Manfred Schwarb: include "mysql.h" -> include Wrt_grib .. replaced strncat/strncpy with test & strcat/strcpy Mod_grib .. strncat/strncpy with strcat/strcpy (internal tables no need to worry about bad guys) gcc caught problems in f_get_int(), Sec5 and VerfTime. from Manfred Schwarb: code cleanup, found bug in f_get_int(), same fix as previous line Thanks Manfred. replaced Sec5:nval() by #define GB2_Sec5_nval(sec) as part to move details to .h and Code*.c added some prototypes that so that gcc wouldn't complain. added some cleanup by Manfred Schwarb: RPN, Wind_speed, copy, Csv, Grib, Import, jpeg_pk, NCEP_norm, Small_grib, test_sec, unpk, unpk_complex, unpk_run_length, Grads, Netcdf changed complex_pk: size_t -> size_tail, changed size_m and size_h too added Manfred Schwarb, level.c: "1000 m above ground - 0 m above ground" -> 1000-0 m above ground" level.c: like above, 102, 107 and 108 layers -VT -T verbose 2 has new date code format added -start_FT added -set_grib_type same Manfred Schwarb cleanup Macros.c output format updated gribtable change: "124@6 hour ave (3 hour fcst)" to "124@6 hour ave(3 hour fcst)" to be consistent with "124@6 hour ave(0-3 hour fcst)" ----- preliminary version sent to NCDC, NCAR trailing space in "ocean isotherm layer " removed ftime: stat proc, ignore dt when units == 255 added is one case from Manfred Schwarb: fixed spelling errors, error messages in RPN and others -rpn: added ln, exp, ceil, pow from Manfred Schwarb: added extern, extern double *lat, *lon; from J. Johnston: space in makefile broke Mac compile, repeated previous missing "extern" set_ave: removed space from "ave (" -> "ave(" Set4: max valid 10-11 hour -> 10-11 hour max anl -- consistent from Manfred Schwarb: Range, added unsigned: extern unsigned long int len; added more set_ave formats .. need more removed some changes to fix_ncep .. doesn't work for all cases Manfred more guard bits in jpeg2000 encoding - fixed jpeg_pk.c v0.1.8.3 3/2010 ------------------------------ bug report from Manfred Schwarb: increase size of new_sec4 from 58 to 70 in Mod_grib from Manfred Schwarb, cleanup AAIG Bbox Checksum Cyclic Data LatLon Macro Sec3 Small_grib Wrt_grib complex_pk geo, wgrib2 etc added set_grib_max_bits -rpn: added acos, asin, atan, atan2 -lev0: added "Xcm" for "X meters depth below land surface", corresponding to X_Ycm -lev0: added "clm" leve1 == 1 && level2 == 8 debug: added seq_input .. need to remove later with Manfred Schwarb: added different flavors of regex, added -set_regex, mod match, not, if, not_if -set_ave: now understands '120@6 hour ave(anl),missing=0' added v98 to get debuging from -rpn Sec4: 1@1 month ave(120@6 hour ave)(0-6 hour ave fcst) -> 1@1 month ave(120@6 hour ave(0-6 hour ave fcst)) set time to "anl" for radar and sat data pdt= 4.20, 4.30, 4.31 added -spatial_proc for pdt 4.15 added preliminary -spectral for satellite info for pdt 4.31 changed ave: problem with making climo of feb-monthly means (leap years) change code to use reference time rather than validation time for "expectation" bitstream.c -- replaced error message for n_bits > 25 bit by 32-bit-cpu && n_bits > 25 added grib to -lola CHECK code (wgrib2) is improved preliminary code to use latlon->ij codes, used by closest and closest_init only lat-lon grid supported right now -lola, -lon: now sensitive to lat/lon outside input domain will print UNDEF values lat/lon = 999 if request is outside the input domain and latlon->ij code is used. need to consider other interpolation methods and vector interpolations fixed -grib_out: now use the append flag updated set_metadata modified wgrib2's copy of g2clib 1.1.8, added new code from NCO's g2clib 1.1.9 (template 4.15) v0.1.8.4-testing 5/2010 ------------------------------------------------ v0.1.8.4 5/2010 ------------------------------------------------ updated set_pdt to handle pdt 4.0 .. 4.31 fixed set_date when PDT had stat_processing: only worked if pdt=8 && n=1 old: master table <=4 is set to 0, new: master table <=5 is set to 0 changed makefile to use zlib 1.2.5 and pnglib 1.2.43 updated LICENSEs if pdt=40, print chemical type, print msg for pdt=4.7 modified radius_earth to use user defined radius ground work for ncep grid 32689 -wind_speed: make test for U-V pair more restrictive, init_sec not used -lola old: shape of earth = NCEP default, new: same as input file geo.c (projection)2ll: nx, ny, npnts from gdt not external variables made uint4_missing compatible with 64 bit machines -grid & -V: added vector_dir (N/S) or (earth) RPN: sets use_scale = 0, default 12 bits precision new_grid: interpolation to new grib2 grids sec3_lola() moved from Lola to sec3_grids.c, other grids, functionality added interpolation package v0.1.8.5 6/2010 ------ removed from web site .. incompatible with g2ctl -------------------------- Manfred Schwarb: some cleanup patches, lev0 & hybrid layers: old hybrid level: hlevN -> hyN old hybrid layer: hlN_M -> hyN_M old hybrid layer: hlNp5 -> hyNp5 old scheme was confusing and inconsistent done because h-ell looks like h-one new_grid: added gaussian fixed set_ave: "N-M hour ave anl" used a hour time range added -new_grid_winds (grid|earth), only checked for lambert RPN.c: free stack when finished match inventory better: f_ens() -> f_misc() added support of multi-model ensemble from "ENS=?" to "MM-ENS=(run number)" change undefined ensemble info from "ENS=?" to "ENS=? table4.2=I pert=J" updated gribtab, two new variables, FROZR and TSNOW interpolation: gfortran support added, a few more NCEP grids g2ctl fix: -grid & -V: winds(N/S) -> winds(N/S): and winds(earth) -> winds(earth): v0.1.8.6 7/2010 ------------------------------------------------ sec3_grids, added if (x0 < 0) x0 += 360; complex_pk: added code to modify section size, more compressed radius of earth code table 3.2=3: convert from km to m added -radius .. shows earth radius and major/minor axes added -set_radius, need to add user defined radius/minor/major axes -new_grid: added varibles ftn_npnts and ftn_nout for removing error messages from AIX compiler fix problem with USE_REGEX = 0: reported by Y. Tosa added -if_rec option and parse_loop() code modified for, for_n, if_n to use parse_loop() mod: code_table_3_11, added new entry, changed old entry modified add_date.c, old: feb30 = jan1 + 1 month, now feb28/29 = jan1 + 1 month added -ncep_uv updated gribtab 10/1/2010 added new operator to RPN.c: alt_x_scan new_grid: fixed lambert conformal, polar stereographic (mk_kgds) fix AAIG: Hermann Peifer - longitude correction Macro.c -misc .. colons use between fields rather than spaces affect inventories if fatal decode .. error message suggests to use -g2clib 0 AAIG: new filename convention .. use extended names new_sec3: better precision (int) (X) -> (int) floor(X+0.5) cleanup WNE Rare bug in input routine: fails if NJB > max(64K,MGML) NJB = number of junk bytes between grib messages MGML = maximum grib message length prior to the problem In practice, nobody puts that much junk bytes between records. updated code_Table 4.3 ExtVar.c - code for extended variable names -- getExtName can getName, -set_ext_name 0/1 -csv, -netcdf now uses getExtName ECMWF uses funny table when master table <= 4. Flag and remove defn. f_misc: missing chemical was "??? see code table 4.230" now "(number)" g2clib v1.2.1 (bug fixes ported) NOTE: rotated lat-lon grid: location is ALPHA adaped from grib2ctl.pl space projection - grid parameters are printed out v0.1.9.0 11/2010 ------------------------------------------------ added ext_name to the match_inv -set_date: simpler code, fix seg fault, added date check, use old date code if not specified to change year -set_date YYYY, to set year and month, -set_date YYYYMM Ext_var.c undefined chemical changed from (1) to chemical_1 added UDF.c, modified Config.c new_grid: added undefined wind rotation, improved error messages, fixed problem with V without U prelim support for grid template 3.130 RPN: exc/swap .. was fixed but fix got lost (3/2012) cname.c old alias master table <= 5 to current table, now range is 8 added -set_lev "10C ocean isotherm" (was "10C ocean isotherm level") v0.1.9.1 11/2010 --------- unplanned early release ---- NCEP operations plans to use master table 5 in Feb 2011 and 6 in June/July 2011 ---- release support for master table 6 ASAP so people have time to upgrade removed free_sec4, not needed added -get_hex, -set_hex added -set background_process_id and -set analysis_or_forecast_process_id added -set_int added a check to geo for bad dlon in mercator2ll, should add more checks Manfred Schwarb: makefile cleanup multiple defn of msg_no, inv_no missing include in complex_pk.c UDF.c : missing close f_csv, f_udf : added inv_out[0] = 0 before call f_XXX(CALL_ARGN); replace extern int new_GDS by extern int GDS_change_no. (Handle -if bug) mod: grid_summary, lola, ijbox, ij, ijlat, ilat, lon, mysql_dump, mysql_speed new_grid: if negative x0 (longitude), add 360 ncep_grid.c added grid 128 gaussian T382 pipe support: flush_mode is for output pipes, seq_in_mode for input pipes -tosubmsg with flush_mode is now error wgrib2.c: recognize - as a synonym for stdin wgrib2.c: use -v98 for debug of code to recognize input grib type flag: seq_input - can only read grib input sequentially wgrib2.c rd_grib_msg: add sequential reads makefile works with new cygwin 1.7.7-1 changed error messages -ave, -NCEP_norm changed error message "Warning: g2lib/g2clib jpeg deocde may differ from WMO standard, use -g2clib 0 for WMO standard updated gribtab.dat from NCO website changed set_date to new syntax: -set_date INITIAL_DATE:DT:BLOCKSIZE DT > 0 BLOCKSIZE > 0, compatible to old syntax v0.1.9.2 3/2011 --- withdrawn 1st attempt at fixing set_date v0.1.9.2a 3/2011 -- withdrawn 2nd attempt at fixing set_date v0.1.9.2b 3/2011 ---- withdrawn restore to 1.9.1 set_date, the new set_date worked but conflicted with the use by set_metadata v0.1.9.2c 3/2011 ------------------------------------------------ added set_ts_dates added Table 4.5 values 118 and 119 to Levels.c added code to detect wrong size of section 7 for simple and IEEE packing changed initial value of ipopts(2) from 0 to -1 (good for budget) in Latlon.c fatal_error("no val","") change to be more informative f_radius, fix when code_table 3.2==3 added axes_earth() closest: changed initial value for j to -1 in search for closest point in case field is all NULL note to developers: undefined lat/lon is now 999 will change a format for -lon when outside of grid domain Config.h print MATCH_MAX, INT_MAX, ULONG_MAX increased MATCH_MAX 1000, N_ARGLIST 5000 verftime(): support code table 1.2=3 (observation time) f_lev0() 2.5C ocean isotherm -> "2.5C" (old), 2p5C (new) Mysql_dump, Mysql_speed: replaced char temp_pathname[L_tmpnam] by char temp_pathname[STRING_SIZE] bug found by Alexander Ryan space_view: prelim space_view2ll and space_view2ij added added better error message when ipolates fails when table 4.11 == 2 for the outer loop, fix time stamp old: 2@3 hour ave(180-183 hour ave fcst) new: 2@3 hour ave(180-183 hour++ ave fcst) old version can be confused with table 4.11 = 1 new convention for ftime when table 4.11 == 1 ...ave(...) when table 4.11 == 2 ...ave(...)++ when table 4.11 == 3 ...ave LAF[...]-- when table 4.11 == 4 ...ave LAF[...]++ when table 4.11 == X ...ave ?[...] this affect product definition template 8 set_pdt: added more default sizes, add -set_pdt +N, copys parameter category and number prt_stat_tr: if Code Table 4.11 = reserved, ":reserved:" -> "CodeTable 4.11=reserved" prt_stat_tr: if Code Table 4.11 = missing, ":missing:" -> "CodeTable 4.11=missing" wgrib2.c do not print warning about g2clib/g2lib bug when reference value == 0.0 added -n to f_match_inv(). support for silly ncep grid 32768/32769 non-E grid. version 1 that was sent to eumetsat-data testers Netcdf.c: rewrote error message for -nc4 and netcdf4 not avail fix code to handle lat/lon == 999: f_domain(), closest_init(), closest() update makefile for hdf 1.8.6 and netcdf 4.1.1 config() says version of Netcdf installed prelim version f_new_grid_vectors ffopen(): error check, - can be used for stdin, check for read & write of same file set flush_mode = 1 if output to a pipe or stdout Sander Hulst: Netcdf.c #if defined USE_NETCDF3 #undef NC_NETCDF4 $endif netcdf.h: NC_NETCDF4 .. implies netcdf v4 code Netcdf.h NC_NETCDF4 .. implies support for netcdf4 file types 3 lines patch converts netcdf.h to Netcdf.c defintion f_set_ave(): 3@1 hour XXX(0-1 hour max YYY),missing=0 .. XXX was replaced by YYY beta2:EUMETSAT data testers f_set_ave: added, 0-1 hr ave(0-1 hour ave fcst++), 0-1 hr ave(1 hour fcst++) prt_stat_tr: added code ++ in 10-20 ave@1 hour fcst++ seekgrib(): scan whole file for grib2 message, changes for grib1+grib2 ECMWF files added -fcst_ave v0.1.9.3 5/2011 ------------------------------------------------- O. Poplawski: Netcdf.c #if define USE_NETCDF3 -> #if defined USE_NETCDF3 v0.1.9.3a 5/2011 ------------------------------------------------- added set_sec_size, allows you to remove section 2, realloc(sec4), build new GDT Internal match_inv had n=0..N rather than n=1..N-1, can break code if used =-if ":n=22" -set_flag_table_3.3 and -set_flag_table_3.4 are on default help screen support for irregular grids (grid template 3.130), irr_grid2ll() and Sec3.c removed error messages if stat(input_grib_file) fails added more info about Albers equal area projection prelim Cressman analysis got sample pdt 4.15: update -spatial_proc with verbose setting got sample pdt 4.15: -V, -verf : replaced f_ens() by f_misc() unget_input() .. fixed check for programming error -cvs add code to init vt[] cname.c: make parameter category >= 192 local, pointed out by Alister Long added WxText (NDFD local section 2 keys) to various functions -ij, -ijlat, -ilat, -lon, -csv, -spread Grads.c -ctl_inv to support template 4.15 code_table_4.15: fix help message added -set table_4.10 and -set table_4.11 if n=1 and pdt 4.8 and code table 4.11=1 :53-59 hour acc anl -> :53-59 hour acc fcst,anl++: code_table .4.11 3 and 4 need to be done right .. need convention dlat/dlon for lat-lon grids are changed from signed to unsigned values compatibility with ECMWF -Sec_len, if submessage and a repeated sec2/3 then * to_we_sn, to_we_ns, ij2p, check for valid scan Macro.c change f_ens() to f_misc() added end_inv and -crlf made on_line into a setup module changes for open64 compilers: opencc and openf95 default optimization is -O3 from -O2 v0.1.9.4 8/2011 ------------------------------------------------- Spectral_band.c.. fixed sprintf to write to inv_out cleanup for openCC (C++), casts, and declarations, made argN: char * -> const char * had to add char *tptr for Netcdf_supp.c, changed set_metadata, replace arg1 by p removed code to test for cyclic on mercator grids .. not right did not fix ARG1..ARGN small_grib: added mercator and rotated lat-lon grids set HEADER:-1 for some uncommon options config.h added code to makefile for c and f95 compiler names -rpn: added print_diff, fix last_lat code: speedup no output difference Netcdf.c: changed illegal netcdf name code, turned off _FillValue for time variable added more units fixed bug in -wind_speed introduced 1.8.5 for pdt=5/9 .. change units to prob, for pdt=6/10, change units to %, affect NETCDF code irr_grid: limit -grid output to 300 lat-lon pairs otherwise inv_out would overflow added -grib_out_irr, write irr_grid grib message -set_ftime did not correctly set code_table 1.4 for forecasts (affected -set_metadata) added end_ft and end_FT which correspond to start_ft and start_FT added subtime.c which subtracts date codes and corresponds to addtime.c change print_ftime: format with unequal units .. add closing ) change print_ftime: "(0 month+26 day)" -> 26 day when 1st arg is 0 change 0 month- 0-1 month ave@(6 hour fcst)++ -> 0-1 month ave@(fcst,dt=6 hour) added -fix_CFSv2_fcst changed start_ft, start_FT help message added -set_ens_num, -set_ensm_derived_fcst f_misc: added check for code table 4.3 - add "forecast/analysis error" if needed -------- new inner loop time code table 4.11 code table 4.11 = 1: 29 day ave @1 day(420 hour fcst),missing=0 code table 4.11 = 2: 420 hour-(420 hour+29 day) ave@(fcst,dt=1 day),missing=0 code table 4.11 = 3: ensemble ave-3 valid 420 hour,missing=0 code table 4.11 = 4: ensemble ave-4 valid 420 hour,missing=0 fixed doc line for set_int updated help for -set_radius v0.1.9.5 12/2011 ------------------------------------------------- -set_ave: old 28@1 year ave(120@6 hour aveanl),missing=0 new 28@1 year ave(120@6 hour ave(anl)),missing=0 O. Poplawski: in the "cleanup for openCC (C++), casts, and declarations", a typo in Mysql_speed.c v0.1.9.5.1 12/2011 ------------------------------------------------- -radius fixed format: "IAU 1965 ave radisu=%.1lf m" to "IAU 1965 ave radius=%.1lf m" -radius fixed format: "oblate spheroid user defined major axis=%.1lf minor axis=%.1lf ave radius=%.1lf" to "oblate spheroid user defined major axis=%.1lf minor axis=%.1lf ave radius=%.1lf m" geo.c: lambert2ll .. fixed case where grid is not WE:SN geo.c: polar2ll .. fixed case where grid is not WE:SN rd_grib_msg: added code to check that section length >= 5 WxTalk: added support for grib variable: PWTHER (ncep + mdl) Regional Gaussian grid support: Small_grib: added Gaussian grid cyclic(): added gaussian grid (not thinned), modified ERROR grb2.h added GDS_Gaussian_dlon mk_kgds() .. allow regional gaussian grid enabled everywhere except writing by IPOLATES preliminary work for using gctpc for geolocation makefile changes for gctpc, optimizations passed onto wgrib2, gctpc added log prescaling data template 5.61 -misc includes chemical type for template 40..43,48 (before: only 40)\ support for PDT 4.48 calling convention for get_latlon (make library compatible) added code table 4.91 fixed -spectral_bands (note: no data to check) Earth.c fixed translation of scaled numbers (no effect on output) 2/10/2012: update gribtab, need to filter greek char and validation prelim for code table 4.52 validation added location for code table 4.5 a/b, changed fixed_surface to use code_table_4_5a_location code_table_4.3 added location cname.c, get_gribtab.sh: search_gribtab fixed, problem with param cat >= 192 OpenMP added to code makefile: NCEP CCS - fortran compiler changed xlf -> xlf_r, openmp changed f_set_var to search for mode >= 0, eliminate set_var(), use center when local table search support for template 4.52 version 2 of extended variable name from -misc: colon -> period, space -> underscore version 2 of full (new extended name).(-lev) space -> underscore extended name will be used when if flag is set (-set_ext_name 1): -s -S, -verf, -V, -csv, -AAIG, -netcdf added a couple of lev0 defn: clm cb top, cb bottom if pdt == 44 or 48, use internal decode routines until g2clib support New_grid.c, makefile: intel fortran support Jeff Smith: patch for azimuth-range projection - Thanks Jeff added to variables to RPN: days_in_ref_month, days_in_verf_month fix f_fcst_ave, wouldn't handle more than one averaging time rpn: swap now works. gctpc: change proj.h, redefine sincos() -> gctpc_sincos() because would crash gcc 4.4, gcc 4.6 and icc v0.1.9.6 5/2012 ------------------------------------------------- found by N Lott: conflict with Mysql: changed check_date() -> check_datecode() found by N. Lott: conflict with Mysql: days_in_month() -> num_days_in_month() v0.1.9.6a 5/2012 ------------------------------------------------- gribtab.dat var0o7 -> SWDIR, error introduced v1.9.6, Thanks N. Lott Dusan Jovic (NCEP): added -gdt Dusan Jovic (NCEP): updated grb2.h mk_kgds.c for NCEP grid 32769, 32768 updated CodeTables.c for NCEP grid 32769, 32768 changed all center == 7 to center == NCEP (same for ECMWF) Mod_grib.c: f_set(): added table_3.2, fixed problem when XX_loc(sec) returns NULL New_grid.c: change error messages, add mercator sec3_grids.c: removed the creating the lat-lon values, remove last two args change Cress_lola.c, New_grid.c, Lola.c: sec3_lola .. few args use zlib 1.2.7 Aerosol: allow for undefined intervals prt_code_table_4_91: 7: X-Y becomde >=X,<=Y, confusing in names makefile: use $(notdir $(FC)) and $(notddir $(CC)) instead of $(FC) and $(CC) gribtab.dat: fixed POZ TOZ and POZT (added names) change cname.c "ERROR: local table=D" -> "ERROR: local table=0" fixed f_ctl_inv() for template 48 (levels) fixed: code_table_4.233, fixed PDT=48, use table 4.233 rather than 4.230 fixed Sec3.c mercator grid: old: input WE:SN raw output rawoutput WE:SN res 48 removed "raw output raw" Extname.c: table 4.3: added 9: climatology, 192: confidence Indicator v0.1.9.7 11/2012 ------------------------------------------------- changed wgrib2 fprintf(inv_file, item_deliminator); to fprintf(inv_file,"%s", item_deliminator); changed grid_id.c to grid_ident.c because of MacOS problems (grid_id.c == Grid_id.c) minor bug fix in g2clib updated version from 1.9.7-beta to 1.9.7a v0.1.9.7a 11/2012 ----- Mac Release ------------------------------ small cleanup of makefile (C. R. Ferguson) changed g2clib = 0 -> internal decoders, 1 -> emulation of g2clib bugs, 2 -> g2clib added USE_G2CLIB, include/exclude g2clib decoders (still uses 2 small routines from g2clib) result of changes: g2clib decoders are not used for decoding unless enabled In the future, g2clib decoders will be eliminated from the default configuration. (Needed for the debug configurations.) added -wind_dir minor edit of set_ts_dates (HEADER line) and error message string add rand to RPN.n returns uncorrelated random number field 0 to 1 fixed OpenMP for unpk_complex.c, some optimization of unpk_complex removed OpenMP from iplib.2012. Never had a problem but C->fortran is already a problem. Why add a complication? fixed makefile: make clean cleanup GDT.c -ave, -fcst_ave: support pdt 4.1 (ensemble fcsts) added unsigned char *code_table_4_4_location(unsigned char **sec) updated with new pdt codetable 4.7 now has text descriptions updated f_ens for new codes -set_ftime works with more values of pdt updated Code_Values: forecast_time_in_units struct gribtab_s -> struct gribtable_s: added range of valid mastertables useful for handling distinct mastertables added user gribtables: setup_user_gribtab, mod: wgrib2, Mod_grib.c, cnames.c, Config.c update to iplib.2012 to handle larger gaussian grids (from WCOSS version) fixed error message from -import_bin added -err_bin, -err_string, -eof_bin, -eof_string v0.1.9.8 5/2013 ----------------------------------- fixed "decode" spelling mistake fixed code_table_0_0: reported by Matthew Foster, only affected -code_table_0.0 and -disc (alias to previous options). All other codes used a macro which was correct update year code on Changes file updated makefile for new version of netcdf4 fixed Ext_name.c for code table 4.3: added prob fcst, climatological thanks Manfred Schwarb added various Gaussian grids to ncep_grids.c better error message, f_g2clib can turn off png and jpeg2000 support by makefile if turn off png, jasper, proj4, netcdf3 and netcdf4, no external libraries that need to be configured. good for cross-compiling. 0xSec fixed section number output for mode >= 2 added lambertc grid defn for -new_grid: new_grid_lambertc, modified New_grid.c added radius_major and radius_minor to struct local in New_grid.c, so lambertc calculations don't have to be repeated if already done Wrt_grb.c fprintf(c,"#define PRODUCTNUMBER %d\n",i+9); -> fprintf(c,"#define PRODUCTNUMBER %d\n",i+10); use zlib-1.2.8 fixed same_sec4_nottime (test_sec.c) .. fixes -ave, -fcst_ave for pdt 8 and 9 works for pdt 0.15 bug report: K. Havener .. thanks v0.1.9.9.beta3 8/2013 ----------------------------------- v0.1.9.9 9/2013 ----------------------------------- Prelim support for grid templates 3.4, 3.5 and 3.12 update gribtable SWEATX ->SX, AMPFLX->ANPMFLX, APEMFLX->ANPEMFLX, AOSGO -> ASGSO EVERF -> EVGFC, DECF -> DECFC, KSSEDW -> KSSEW, gone: "2DSED" "FSEED" "DIRSED" "HSIGN" "PKDIR" "MNSTP" "DMSPR" "WFFRAC" "TEMM1" gone: "DIR11" "DIR22" "DSPR11" "DSPR22" "WLEN" "RDSXX" "RDSYY" "RDSXY" 7: name changes, 17 deletions, new variables added 32 differences total TYABA lost description, new variables, some defn changed renamed VERSION to WGRIB2_VERSION isdigit(c) -> isdigit ((unsigned char) c) isalpha(c) -> isalpha ((unsigned char) c) tolower(c) -> tolower ((unsigned char) c) added -get_int2 -set_int2, -get_ieee, -set_ieee changed help for get/set_byte/hex/int from location to octet update to gctpc: changes by Orion Poplawski (Fedora) support for ens pdt: test_ts_dates.c, NCEP_norm.c test_sec.c, Sec4.c, Code_Values.c CodeTable.c mk_kgds.c: fix to 32768 and 32769 rotated lat-lon E and B staggered Arakawa grids old code didn't set flag table 3.3 correctly, didn't handle grid winds reported by NCAR. major changes to -merge_fcst: supports ensembles, many changes, old code had problems wind_speed, wind_dir: old: failed if mastertab > 6, now works for all mastertab != 255 ie local table Grads.c: f_ctl_inv, change probability numbers to keep trailing zeros 3 and 30 were causing grads variable name to be aliased .. can stll happen if scaling factor isn't constant Grads.c: f_ctl_inv prob interval was fixed a2,first,first -> a2,first,second set_ftime: all pdts now wgrib2/makefile: compile Mod_grib.c with ${FLAGS} instead of ${CFLAGS}, minor fix set_date: updated for more PDTs. f_code_table_4.11s: added -set_ens, so that -1 to be no change fix -udf_arg buf[2] want all calls to f_*() to use call_ARGN(buffer, NULL, arg1..argN) if (local == NULL) then call is recursive. must examine code to check local not used! all code: CALL_ARG{N} -> call_ARG{N} netcdf/mysql*.c: f_lev(...) -> f_lev(call_ARG0) wgrib2: f_match_inv(..) -> f_match_inv(call_ARG0) f_help -> f_help(call_ARG0) added -set table_4.3 added -Werror=format-security to makefile by suggestion of Orion Poplawski modified sprintf(inv_out, string) to sprintf(inv_out,"%s", string) by Orion Poplawski this changed -ens code 4.7 10 -> 10% 50 -> 50% and 90 -> 90% rpn: ln is fixed, popped stack by mistake added -Werror=format to makefile removed unused variable from geo.c deleted empty file help.c, pot case insen fs prob found J. Taylor support for code table 3.20 better but incomplete support for cross-section grids updated gribtab again. web page copy needs to be edited by hand because Boi is not consistent update Grads: f_ctl_inv .. handle pdt == 15 removed -Werror=format from makefile (jasper would not compile) Cyclic.c updated for mercator and thinned grids Scan.c removed unused int scatter experimental staggered bits support: stagger.c geo.c grb2.h, mk_kgds.c removed: int packing_nx() from jpeg_pk.c, optimization that probably never gets used added: inv_f77 in Macro.c added: new item to match_inv npts= added: BUILD_COMMENTS to makefile, Help.c and Config.c and customization comments can add here wanted for special hwrf build fixed: mk_kgds for grid 203 id mass and wind fields updated producedure for making gribtable, add sort and edit, updated gribtable.dat updated complex_pk.c static int find_nbits(int i) -> static int find_nbits(unsigned int i) minor speed ups, cleanup Earth.c added code table 9. set_radius now handles user defined radius, major minor axes int8.c best_scaled_value() uses maximum scaled value < INT_MAX Netcdf.c Fixed latlon grid longitudes. COARDS wants longitude to be monotonic and left longitude can be any value. However, Some codes will not will not handle a left longitude of 180.5 but will work with -175.5. So left longitude is set to [-180,180) and longitudes are monotonic. Problem found by K. Havener who also did the testing. complex_pk: added nstruct (instead of ndata) for malloc of list and list_backup, save RAM fcst_ave: added test for valid dtime ave_test: added test for valid dtime rdieee: added to for read completion removed rd_bitstream(), renamed rd_bitstream_offset() as rd_bitstream(), added 31 bit support removed rd_var_len_bitstream(), mk_bitstream() changed error add_bitstream to n_bits > 25, added error msg to add_many_bitsteam() Gctpc.c - enabled Albers equal area projection Gctpc.c - added staggering to gctpc_get_latlon stagger.c - added x[] and y[] args to stagger(), altered geo.c and wgrib2.h added support for staggered grids added set_ival updated set_ival to support a list of pointsZ complex_pk.c free(u) early, reduce footprint by 4*ndata bytes int8.c best_scaled_value() increases scaling (giving more precision) as long as val-floor(val) != 0 and val/10 < INT_MAX, this means val=1000 is kept as 1000. NOTE: the scaling factor and scaled value changes from previous versions of wgrib2 NOTE: the scaled level1 and level2 have changed .. more precision gribtable: two SOILM with two different units kg/m/m and kg/m/m/m, both are deprecated rename SOILM (kg/m/m/m) to SOIL_M, so grib1 and grib2 tables are the same it is a deviation from NCO tables but NCO hasn't made a decision NOTE: SOIL_M is not in NCO tables v0.2.0.0 6/2014 ----------------------------------- -gctpc changed from inv to misc option -merge_fcst: if N == 0, output every merge step, for S2S (tigge) -set_metadata: fixed problems made in the 2.0.0 release. v0.2.0.1 7/2014 ----------------------------------- Level.c added more fixed levels support for PDT=60,61 alias pdt=code_table_4.0 set_pdt(), copies all metadata for common pdts (-set_pdt +PDT) not complete -Sec4, removed code for extra info when PDT=4.0 set_pdt(), fixed default sizes esp stat processing PDTs, added more PDTs enable staggered grids (gctpc) proj4_get_latlon: lambert, lat-lon, mercator, nps added ncep grids 4 and 45 to ncep_grids.c -s_out write new-line at end -nl_out is now inv_output function geo: regular2ll: 1x1 grids allowed updated code_table_4.3.dat updated code_table_4.10.dat updated: prod_def_temp_size.c add option -hybrid f_ctl_ens: fixed and updated pdt==2 and pdt==12 are ensembles, added new pdts updated CodeTable.4.7.dat support for pdt 4.6 and 4.10, added -percent, percent_value(), percent_value_location() support for pdt 4.6 and 4.10, in ctl_inv (Grads.c) fixed cname.c units for pdt 4.6 and 4.10 should not be % ffclose, by John Howard, ffclose_finished WND added ffclose to -bin -ieee -text -spread -grib -GRIB -import_ieee, -import_bin, -import_text -csv -cress_lola -ijbox -new_grid -small_grib -ijsmall_grib -grib_ieee -ncep_uv -set_metadata -grib_out -lola -s_out -inv_f77 -inv -print_out -nl_out -NCEP_norm -merge_fcst -ave -fcst_ave -irr_grid -grib_out_irr -eof_string -eof_bin EOF.c: if wgrib2 called with no arguments old: eof_bin and eof_string were called new: err_bin and err_string are called if f_h is called old: eof_bin and eof_string were called new: err_bin and err_string are called eof_string, eof_bin are called with mode -2 instead of explicitly err_bin, err_string: not called if no error all ffopens are paired with ffclose Match.c free memory, make match_count a global variable. rd_inventory: split from wgrib.c and put in own file, reads from input rather than stdin setup options will get finalized, so to close files pdt 4.44 only has 2 octets for forecast time! set_ftime .. forecast time from int -> uint added declaration Cyclic.c, dummy function f_proj4 from John Howard moved scaling() from Precision.c to Code_Values.c added png, complex spectral and simple log-pre-processed change exit(0) to return 0 in main() CALLABLE_WGRIB2: setjmp/longjmp, exit -> return, fopen -> ffopen (input) CALLABLE_WGRIB2: -persistant_file replace fopen by ffopen in options, AAIG, i_file, f_h does not print out help message setup_user_gribtable.c, close input file -unix_time is now compile time option for John Howard converted some strcpy -> strncpy is_match: reorder loops for speed, add OMP for one loop added Match_fs package, like Match but for fixed strings wgrib2.c change to add Match_fs package wgrib2.c reorder search for option names initial support for code table 1.5 and 1.6 wgrib2.c replaced seq_input into enum in_dev_type in_type; small_grib: unsigned int new_sec[7] -> new_sec[8] .. pretty typing rd_grib_msg* updated to read more than 1 file at a time increased size sec[], sec[9] = last valid bitmap .. only by sec[] used to read added error messages Gctpc.c unpk_run_length.c: David Bindermani while (vals[i]> mv && i < nvals) -> while (i < nvals && mvals[i]> mv) setup_user_gribtable.c added fclose(input) set_metadata: fixed format of scanf cleanup of defined but unused variables (found using cppcheck) Scan.c: added parameters to routines, make it callable by f_import_grib() added -import_grib -fcst_ave, -ave, -wind_dir, -wind_speed, -merge, -ncep_norm : old: picked up scaling from first record. Problem when first record was constant field. set use_scaling=0 -fcst_ave, -ave: replaced undo_scan_order, saved many mallocs/frees can now write complex-packed files with bitmaps (for NAM), added -set_bitmap added MAXUW and MAXUV to list of vector fields Ensemble.c Manfred Schwarb: treat number_of_forecasts_in_the_ensemble(sec) as signed instead of cast to unsigned, (no change in code behavior) Level.c Manfred Schwarb: if (type <= 192) -> if (type < 192) problem if level = 192 (local level) Merge.c Manfred Schwarb: treat code_table_4_10(sec) as signed instead of case to unsigned (no change in code behavior) NCEP_norm.c Manfred Schwarb: removed unused variable pdt, typo in format Prob.c Manfred Schwarb: fixed format print hex number with %u format f_new_grid_vectors() accepts lists NCEP_uv.c: put struct local_struct into function definition (looks better) NCEP_uv: better error messages match_inv: added -varX, -T, -start_FT and -end_FT, decided against -VT -VT has same value as -start_FT, -VT and -vt have similar vt=(number) entries complex_grib_out: strange nam file: RIME had val=(1e+10+i*2^1)*10^-10, i=0..511 (#bits=9) convert to data to integer vector u[i] = floor((data[i] - ref)*scale + 0.5); when using decimal scaling, ref is not quite the min value under all compilation options (could be 64-bit register vs 32-bit memory value). The scaling factor is so large that u[i] could be negative! Added a step to make sure u[i] is >= 0 -fcst_ave, -ave, -wind_dir, -wind_speed, -merge, -ncep_norm : restored to old behavior, scaling from first record. added -code_table_4.8 -set added table_4.7 table_4.8 -rpn: added smth9g and smth9r -set_percentile: added, added "N% level" to set_metadata Ensemble.c pdt=2 changed output to make clearer -pdt old output: code table 4.0=1 Individual ... new: pdt=1 added -pdt to match_inv -set_prob: added, added support in set_metadata -set_ens_num: now callable from code -set_metadata: supports ens=(+/-)number, ens=hi-res ctl ens=low-res ctl, X ensemble members note:earlier versions ignored "ens=low-res ctl" polar2ll: make openmp gau2ll Config.c: would say that gctpc was default even if not v0.2.0.2 3/2015 ----------------------------------- updated New_grid.c, vectors and default_vectors v0.2.0.2a beta 3/2015 ----------------------------------- -rpn: smth9r would do a wrap-around like smthg, fixed moved set_metadata() from Mod_grib.c to Set_metadata.c, added -set_metadata_str added UICE/VICE to list of vector fields in New_grid.c, George Trojan rd_inventory: changed save inventory in buffer for (future) grep operations added -fgrep, -fgrep_v, -egrep and -egrep_v fixed wgrib2 so that "wgrib2 file -last file.txt -s" works, if -last is 1st option, picks "message no:position" fixed makefile: added mkdir include space_view.c space_view2ll() Leon Majewski found that lop was incorrectly defined. lop = int4(sec[3]+38); -> lop = int4(sec[3]+42); Not noticed because EUMET satellite has lap = lop = 0.0. CW2: f_inv open files a+ and w+, need to opens rewind_file: changed from rewind() to fseek() to get error code CW2: fixed ffopen() so if error, link list is in good shape for future call forecast_time_in_units now signed: Code_Values.c Merge.c, Set_date.c Set_ts_dates.c, Mod_grib, Verftime.c added sub_dt, add_time: dtime can now be plus or minus Verftime.c use code_table_4_4() to check for no forecast hour f_rpn(): do not cleanup on mode == -2, allow callable wgrib2 to keep registers between calls updated to libpng from v1.2.50 to v1.2.52 changed GB2_Subcenter(sec) from (int) int2(..) to (int) uint2(..) changed GB2_Center(sec) from (int) int2(..) to (int) uint2(..) wgrib2(): if malloc of data fails && callable wgrib2 .. set ndata = 0 EOF.c: many small changes wgrib2: fixed setjmp code .. must save current stack frame!!!! else seg fault on subsequent calls to wgrib2 && fatal_error!!! rd_inventory: make buffer[STRING_SIZE] -> buffer[INV_STRING_SIZE] updated New_grid.c, vectors and default_vectors so can compile without IPOLATES removed unused variable i from Set_percentile.c updated Match.c extern int use_ext_name is now defined if REGEX is off added -ftn_api_fn0 cleanup wgrib2.c free memory Undefine.c Set_val.c Set_ensm_derived_fcst.c Import_grib.c Cress_lola.c Fix_CFSv2_fcst.c f_i: removed comparison of rd_inventory == stdin as done in ffclose int8: changed arguments from unsigned char * to unsigned const char where applicable ijsmall_grib, small_grib: now respects append flag many: replace FILE *xyz by struct seq_file *xyz and struct seq_File xyz to support @mem: files tosubmsg: better test for writes to pipes which is not allowed -last does not include \n -inv (write inventory to file) is changed from misc to setup wgrib2.c changed fprintf(inv_out,..) to fwrite(...,inv_out) inv_file changed to struct seq_file user_grib_file, all rejected table entries are printed out cname: use local table if (discipline, parmcat, parmnum) is member of [192..254] many files: changed FILE *file to struct seq_file *file. changed gctpc to remove warning about som_series by removing static som_series from proj.h and adding them to sominv.c and somfor.c Mem_buffer: data structures are statically initialized here instead of call to init_mem_buffers, this allows external routines to initialize memory file.for CW2 init_mem_buffers only checks that initialization was done RPN.c initialize rpn_n[] and rpn_data[] at compile time rather than at run time allows external routines to initialize RPN registers -full_name: fixed, now full_name = -ext_name "." level added U-GWD, V-GWD to vector list wrtieee: OpenMP the conversion loop works now. -import_grib: fixed definiton from read grib1 -> read grib2 swap_buffer: OpenMP version added MRMS grib table https://www.nssl.noaa.gov/projects/mrms/operational/tables.php change makefile: openmp and no gfortran is ok, MAKE_FTN_API prt_stat_tr: "-1-2 hour ave fcst,anl++" -> "-1-2 hour ave anl" affects inventories complex_pk.c: error when writing msg with all undefined (code table 6.0 is undefined) *** this bug affects writing of fields that are ALL undefined in complex packing *** complex_pk.c: OpenMP directives added, renamed igrp -> itmp added min_max_array() - OpenMN min/max of an array f_min, f_max, complex_pk.c call min_max_array() updated jasper to latest ubuntu code (security fixes) updated gribtable - thank Manfred for the updated get_gribtab.sh many formating changes to units/description some differences from NCO tables because of dup names SOILM -> SOILM and SOILM_ WILT -> WILT and WILTPT (WILT is old) CDCT -> CDCT and CDTYP TCOND -> TCOND and TCONDold TCOLW -> TCOLW and TCOLWold FRICV -> FRICV and FRICVW makefile: ubuntu 12.10 /usr/lib/libgfortran is gone get location of libgfortran from compiler link ipolates library before fortran library Mem_buffer.c gmerge.c: cleanup as indicated by clang added code_table_4_1_location and code_table_4_2_location preliminary support for local JMA table 4.50008 New_grid.c minor OpenMP additions update gribtable: get_gribtab.sh update by Manfred Schwarb make_gribtable.sh by Manfred Schwarb manual change to gribtab 0:1:0:255:0:0:6:17:TCOND:Total Condensate:kg/kg -> TCONDold 0:1:0:255:0:0:6:18:TCOLW:Total Column-Integrated Cloud Water:kg/m^2 -> TCOLWold 0:1:0:255:0:0:6:19:TCOLI:Total Column-Integrated Cloud Ice:kg/m^2 -> TCOLIold 10:1:0:0:0:17:FRICV:Friction Velocity:m/s -> FRICVW 2:1:0:0:0:26:WILT:Wilting Point:kg/m^3 -> WILTPT manual change to gribtab new_grid_lambertc: check return codes (long_i) misc changes to remove warning .. unused variables ieee_pk.c simple_pk.c Small_grib.c remove #include added dec_png_clone.c changes to makefile and unpk.c: Need to make wgrib2 totally independent of g2clib in default mode. Problem was NCEP Central Operations (NCO) had g2clib compiled with -D __64BITS__ which told g2clib that ints were 64 bits even though ints were 32 bits! Normal people don't do this. So if you linked in NCO's libraries you had problems in the API. However, NCO requires you to link in their libraries. I have no idea how many external versions of g2clib this will affect as it is unknown if the NCO makefile for g2clib is widely distributed. Small_grib.c small optimizations simple_pk.c: OpenMP optimizations grads.c: f_lev0() added adcl f_rpn(): number starts with +/-/0-9/. (period is new) free_mem_buffer(): added mem_buffer[n] = NULL; fixed seg fault with callable wgrib2 and mem files -last: old: rewind files, new: rewind all file types -rewind_file: warning if fails, support for memory files (@mem:0) added -error_count return code from wgrib2 is |= (all function calls in phase -2, finalize) -config: added more configuration details prelim Lambert Az. Equal Area projection: gctpc proj4.c gdt==32769 is now restricted to NCEP changed order of calculation of lat-lon: proj4, gctpc, built-in -- new programming rule: assume OpenMP can use unsigned ints in for loops unpk.c i and ndata are unsigned int Mysql_dump: make i,j unsigned int, format %d -> %u for ndata and npts updated level.c for more definitions update lev0 for more definitions -rewind_file -> -rewind_init, -rewind_final, -rewind_proc -close_persistent_file -> -transient -persistent_file -> -persistent wgrib2.c expanded error message for no input file added fatal_error_ss changed to new error message "too many grib files .. 1st=%s 2nd=%s" added error message for undefined option mem_init: set mem_buffer_size[n] = 0 on failed read f_AAIG(): change fclose to ffclose added preliminary version -AAIGlong Ftn_api.c: removed references to nndata enc_jpeg2000_clone: added #include "wgrib2.h" to add prototyping v0.2.0.3 11/2015 ----------------------------------- fix comments in import_grib.c, improved error message in import_bin changed NDFD_gribtable.dat, set local table=1, NDFD variable now work allow -d ' 1' f_dump() trim leading spaces added -rpn_rcl and -rpn_sto .. for CW2 .. no need for geolocation parallelized finding min/max jpeg_pk.c -set_prob will not crash with unsupported PDT return void: changed add_bitstream and add_many_bitstream, finish_bitstream -stats is optimized, cos -> cosf for speedup, may give slightly different results updated cyclic(): staggered grids never return cyclic, updated help msg -stats is openmp optimized, cos -> cosf for speedup, may give slightly different results 2G++ grids enabled: -f_lola, -set_ival, -set_ijval, simple_grib_out f_ctl_ens: went back to original version which was coded to GrADS documentation. complex_grib_out: removed u[], saved sizeof(int)*ndata bytes peak usage prelim: added support for JMA radar grid and template added f_JMA to f_misc complex packing: fixed, could not handle grid greater than 512M grid points limit should be 4G grid points, problem testing 4G limit because of limited memory complex packing: fixed, problem the group size could grow to >= 2**25 (artificial data) and the group size could not be stored because of a limitation of the bitstream package. f_ens(): for pdt=2,12 (derived ensemble fcst based on ALL ensemble members) removed mention of cluster mean in CodeTable 4.7. -N_ens: if N = 255 (undefined), print -1 -ensm_derived_fcst(): fixed case where pdt == 2 and 12 -ensm_derived_fcst(): can now be called by set_metadata_str -set_metadata and -set_metadata_str will scan 3 more free format fields 5 -> 8 new_grid: had to add sec1 in order to run mk_kgds. With locally defined grids, sec3 routines now have to look at the center. unpk_complex() some 2G+ modifications, test for more failed mallocs added BOM local grib table definitions, prelim (I made it up) grib variable names Scan.c: 2G+, speed-up, undef nx, ny = 0 or -1 translation[] from int -> unsigned int: ave(), -ave, -fcst_ave, Scan.c to_we_ns: fixed problem which caused "undo_output_order: program error" would appear with wgrib2 ndfdfile -order we:ns -grib_out junk regular2ll: Gctpc.c: f_bin: -checksum: 2G+ copy_sec(): size[] -> unsigned int*, copy_data(): fixed malloc to be 2G+ -wind_speed, -wind_dir: added openmp changed extern int npnts -> extern unsigned int npnts many, changed malloc(ndata *sizeof(XXX)) -> malloc(((size_t) ndata) * sizeof(XXX)) changed uint4_missing: old: return int , if missing return -1 new: return unsigned int, if missing return 0. added get_nxny_, like get_nxny but nx, ny are unsigned int rd_grib2_msg_seq_file(): change j to from int to size_t, len_grib to size_t; unsigned long int -> size_t: grib_ieee(), Checksum, cksum(), f_GRIB(), NCEP_uv(), submsg_uv() add xdev to -rpn xdev: deviation from zonal mean nx/ny -> nx_/ny_: AAIG.c remove f_spectral (satellite), -spectral_bands exists, works and provides more info support for pdt=4.32, 4.33, 4.34 space_view_closest: return long int, error if iy >= nny (before: iy > nny), 2G closest(), latlon_closest(), space_view_closest(): from int to long int bug fix: Many thanks to Steve Sullivan (mathcom.com) who found a bug in complex packing (complex_grib_out) and provided a bug fix. Complex packing divides the string of grid points into groups. The minimum grid point value within the group is the group reference value. In order to pack the group references, you need to find the maximum group reference value (grefmx). The loop that finds the grefmx bypasses the reference value of the 1st group. This is a problem when the reference value of the 1st group is the maximum reference values and the number of bits required to encode this value is larger than number of bits required to encode the second largest reference value. This bug is for versions 2.0.0 - 2.0.3. This bug is more likely to occur when the grid is small. v0.2.0.4 2/2016 ----------------------------------- updated to libpng.1.2.56 f_match_inv: old match inv depended on verbosity, new: match_inv is fixed -proj4_ll2i: works for lat-lon grids, always writes to inv updated ExtName.c adds new NCEP defn, and adds process=X for val >= 192 -lli2: 0 == out of domain, always write to inv -ave: support pdt = 2 and 12 wrtieee(): initialize i added -set_date +10hr, set_date -12mo, -ave: pdt==1, fixed rt, sec4[50] = 1; updated code for table 4.233, updated table 4.233, remove and support for pdt 4.45, 4.46, 4.47 wgrib2.c: "g2lib/g2clib XXX decode may differ from WMO standard" replaced by "g2lib/g2clib XXX encode/decode may differ from WMO standard" FlagTable.c break; break; -> break; parallelize missing_points(), unpk_0, unpacking of simple packed fields mk_sec5_sec7(): fixed seg fault when number of grid points is 0, added test for mem allocation affects v2.0.3-v2.0.4 jpeg_pk: if n_defined == 0, initialized min_val = max_val = 0.0, no change in validity of output ext_name: do not print out code table 4.3 if value = 255 set_metadata: added code table X.Y=Z and flag table X.Y=Z -set table_0.0, -set discipline now works unpk_run_length.c: Takayuki Usui found that the code was off by one in reading the table values. Suggested a bug fix. -config show the version of IPOLATES library makefile shows version of gcc iplib.2012: interpolation to Gaussian grid and writing to stdout fails: wgrib2 IN.grb -new_grid_winds earth -new_grid ncep grid t62 - | wgrib2 - debug write statement in gdswiz04.f gets written into grib message. Fortran and C buffers are not unified and problems occur on flushing the buffers. remove writes from gdswiz04.f and splat.f iplib.v3.0.0: added as possible iplib, same output, faster (16s -> 15s) will make it the default iplib after more testing code table 4.15: added location function preliminary support for PDT 4.57 set_pdt: copy percentile info, all probability info units.c: added a2code_4_10() new_grid: added ncep grid 194 added struct full_date: make code nicer by storing date in a structure added Ref_time which is the same as reftime but uses struct full_date added Get_time which is the same as get_time but uses struct full_date New_grid.c added #ifdef CRAYCE for cray fortran compiler, cray compilers compatibility has not been tested tried using setvbuf() but removed change: minimal improvement vs portability? added --version as an alias to -version added f_ftime2 code as a replacement of f_ftime: bug fixes, easier to understand move f_ftime code to Ftime.c, in prep of eventual removal changed makefile so that zlib is static than dynamic linked changed makefile so that pngs grids can be up to (200M x 1M) updated gribtable (HWRF upgrade) Sam Trahan (HWRF upgrade) updated Spectral.c for the current defn of PDT 4.32 and mod ExtName Gregor Schnee, Daniel Lee both of DWD: added support for CCSDS/aec compression, template 5.42 renamed min_max_array.c to openmp_util.c openmp_util.c: added min_max_array_all_defined() jpeg_pk: openmp to find min/max of data[] complex_grib_out: preprocessing are now all openmp complex_grib_out: problem when all grid points undefined, fixed sec5[51] = 1; -> sec[41] = 1 note: output is a valid grib file, possible problem when making file added Verf_time(sec, &date; AAIG.c AAIGlong.c: allow dx != dy cleanup (Manfred Schwarb) cleanup: format, small errors, compiler warnings, grammar Manfred Schwarb Manfred Schwarb: output from gctpc renamed gctpc_1.txt -> gctpc_error.txt gctpc_2.txt -> gctpc_param.txt simple_pk: handle case of n_defined == 0, affects v2.0.4 add_bitstream: can handle n_bits up to 32. (previously was up to 25) fread_mem: (void *) mem_buffer[n] + mem_buffer_pos[n] -> (void *) (mem_buffer[n] + mem_buffer_pos[n]) swap_buffer(a,b) b changed from int to unsigned int v0.2.0.5rc 7/2016 ----------------------------------- mv Setftime2.c and Ftime2.c to *.cc (code in development) v0.2.0.5 7/2016 ----------------------------------- added -set table_4.5a, -set table_4.5b (some MDL files used a bad code table 4.5b) removed error message from wgrib2_set_mem_buffer() and wgrib2_get_mem_buffer() changed return code for wgrib2_set_mem_buffer from 2 to 3. unify return codes for set/get mem_buffer() change N_REGS -> N_RPN_REGS, moved to wgrib2.h, set N_RPN_REGS=20 fixed RPN.c to reflect new values of N_RPN_REGS (vectors had to be manually increased) changed grb2_inq() in wgrib2api.c: old: used rpn register 0,1,2 new: uses registers 17,18,19 ftn_api grb2_inq(): added lastuse variable wgrib2.h: fixed int stagger(unsigned char **sec, unsigned int assumed_npnts, double *x, double *y) parse_time_range2: error if no match f_ftime(): removed \n in fatal_error message t ftime2_tr(): added fatal_error "Statistical processing bad n=0" RPN.c: dimensioned rpn_n[N_RPN_REGS], and rpn_data[N_RPN_REG] rather than default which causes an error message when N_RPN_REGS is modified. Now assume that undeclared inits are 0 and NULL. main(): combined scans for input_files/inv_option and compile into one loop search for option names is done once instead of twice removed the (alpha) from -mysql header fixed header for -v97 BOM gribtable: removed colons as they adversely affected g2ctl libaec 3.4 now used, Config.c changed new versions of netcdf4 4.4.1 and hdf5 1.8.17 unpk.c for (i=0;iheight_;i++) { .. i replaced by ii .. undefined variable. unpk.c remove declaration for c when compiling Jasper init.c, rd_inventory.c: egrep* is only used when REGEX, bug report by J. Crockett stagger.c assumed_npnts -> unsigned int enc_jpeg2000_clone.c: jasper v1.900.25+ changes ABI, need to comment out line image.inmem_=1 in makefile, JASPER_1_900_25PLUS is defined in config.h at this point jasper v1.900.29 doesn't test cleanly on redhat but library works. added grib_max_bits: so set_metadata can look like inventory added precision: so set_metadata can look like inventory simplified set_bin_prec metadata string: added "encode %d bits" wgrib2(..): flush_inv_file: so for CW2, inventory is readable updated level.c, lev0(..) for new fixed levels updated Ensemble.c for new table entries Ngoan Tan: updates to CodeTable.c, fill in some missing info for JMA pdt 50011 and 50008. note: I did not have any readable documentation to verify locations. Sec1: f_t(..): added warning if minutes or seconds is non-zero makefile: fixed problem: $TMPDIR is required to compile pnglib, fixed makefile: fixed problem with icc with openmp in compiling pnglib status_fopen(): now prints out usage mk_file_transient, mk_file_persistent: always return 0 wgrib2_free_file: removes file from ffopen link lists if usage == 0 main(); int err_4_3_count -> static int err_4_3_count = 0; so only 3 msgs for CW2 -grid_def: will not free NULL, will work on all records makefile: TMPDIR is now set f_set_lev(): support of A-B m ocean layer (WMO version) level(): A-B m ocean layer, old: ncep version, new: ncep & WMO added code_4_230_location(..) makefile: fix ifndef ${..} =? ifndef ... makefile: zlib: make check fails with undefined symbol cygwin64 v0.2.0.6 2/2017 ----------------------------------- withdrawn before 48 hours to allow changes to ftn_api The following changes are so that metadata returned from grb2_inq(..) is of the format: D=YYYYMMDDHHmmss:var:lev:etc The rest is so that index file is a superset of that format and compatibility with the D= instead of d= set_metadata: old str: x:x:d=yyyymmddhh(mmss):etc new str: x:x:(d|D)=yyyymmddhh(mmss):etc grb2_inq(..,desc=str,.. old: str=`wgrib2 -s` ie d=YYYYMMDDHH:var:lev:,etc new: str=`wgrib2 -S` ie D=YYYYMMDDHHmmss:var:lev:etc grb2_mk_inv: old wgrib2 GRB -match_inv > INV new wgrib2 GRB -Match_inv > INV swap D= and d= so desc=meta, then meta can be used in a search grb2_inq: searches are now fixed strings rather than reg use regex=1 to convert to regex searches v0.2.0.6a 2/2017 ----------------------------------- withdrawn to fix problems with compiling on Macs. (6 hours of release) set_ftime2: uint missing -> unsigned int missing fix makefile so that it will compile on Macs .. thanks Daniel Bowman v0.2.0.6b 2/2017 ----------------------------------- fixed code_4_230_location(..) broken in v2.0.6 v0.2.0.6c 2/2017 ----------------------------------- added -set table_4.230 number and -set table_4.230 string chemical types f_misc: chemical=chemical_40009 => chemical=40009 CodeTable. 4.6: pdt 40 and 42 identified as ensemble -set_num_ens: works with any PDT with code table 4.6 error if g2clib == 1 and decoding png field decoding png is ok decimal scaling is set to decimal scale of last constant field or 0. This causes an error in -grib (BAD) or using the input scaling parameters (Not Great) The BAD effects are rare because pngs are rare and people rarely decode and do -grib at the same time The Not Great problems are only rare vs rare**2. This involves a change a precision which could results in a loss of precision. -set_grib_type now understands complex1-bitmap (c1b), complex2-bitmap (c2b), complex3-bitmap (c3b) -mysql_speed: size of character strings for table data changed from 1500 to MAX_SQL_INSERT=3000 user added an additional variable to a 40-level GFS output and wgrib2 crashed. code should be updated to keep "row" from overflowing. makefile: added -I../include to compiling libpng (needed by Windows 10, WLS) makefile: added code so that gfortran on MacOS could find gfortran.dylib grb2_wrt: old: order='ns' -> order='we:ns' or order='ns', doc should say we:ns -ftime2: some fixes new makefile: old libwgrib2.a uses thinned archived which is a gnu ar feature libwgrib2a_small.a -> libwgrib2x.a because unix ar has 15 letter limit added lib/makefile Set_ftime2.c: allow -set_ftime2 "0-1 month ave anl" same_sec4_not_time: all pdts better diagnostics: same_sec4_not_time(sec, sec) -> same_sec_not_time(int mode, sec, sec) better diagnostics: same_sec1_not_time(sec, sec) -> same_sec_not_time(int mode, sec, sec) added timing='6 hour fcst' into wgrib2api: grb2_wrt(..) changed fatal_error if n=0 (statistical processing) to warning seperate n=0 and memory size to different error messages (stat processing) -ncep_norm: changed debug output is output with v98 instead of v99 several: tried to make ** Warning: reference time includes non-zero minutes/seconds ** better, turn off if f_T(..) is called f_new_grid(..): improved error message if ipolates fails if 1st or 2nd grid is smaller than grid cell of 2nd or 1st grid -ftn_api_fn0: output format changed from i8,5(1x,i8) to i8,5(1x,i11) grb_inq(..): read of ftn_api_fn0 changed from i8,5(1x,i8) to i11,5(1x,i11) this allows reading of grids bigger than 99,999,999 points -v -varX : the output has been reformatted for local variables have the format var discipline=0 center=34 local_table=1 parmcat=1 parm=203 -set_var(..) now understands: -var (undefined variables) and -varX formats var discipline=0 center=34 local_table=1 parmcat=1 parm=203 var discipline=10 master_table=2 parmcat=0 parm=11 var10_2_1_7_0_11 small_domain(..) use GDS_change_no to avoid duplicate calculations small_domain(..) for lat/lon, mercator, only scan axis to save time fwrite_file(..): added ferror(..) after fwrite fread_file(..): added ferror(..) after fread mk_bms(..): optimize code by finding 1st undefined grid point value added check for malloc(..) working -set_pdt: supports aerosols pdt=46, 48 -set_ftime2: fixed error message Set_ftime2: no match string=$s -set_pdt, if len specified, do not add extra bytes if len not specified, add extra bytes for n time ranges f_misc: print aerosol size for pdt 44..47 (only did 44 before) f_spatial_proc(..): pdt 15, changed output format, more info -set_metadata, -set_metadata_str: uses f_set_ftime2 rather than f_set_ftime / f_set_ave f_set_pdt: moved code into new_pdt(..), so other codes can call -set_pdt: supports minutes_of_observational_data_cutoff_after_reference_time -set_pdt: supports model version date pdt 60, 61 -f_Match_inv, f_match_inv, replace CALL_ARG0 by call_ARG0 (modern) Set_metadata.c replace CALL_ARG0 by call_ARG1 (modern) f_(set|get)_(byte|hex|int|int2|ieee): Boi used octet == 0, so I added error checking for octet <= 0, slightly changed error message for out of bounds section Config.c: make #include conditionally compiled added -time_processing changed: -ave -> -ave0, -fcst_ave -> -fcst_ave0 added: -ave, -fcst_ave, both point to -time_processing axes_earth, radius_earth: change GRS80 and WGS84 minor axis .xxx m -radius now prints out major/minor axes -radius output for user define oblate spheroid changed, consistent with other new output -rpn print_ave,print_rms,print_diff,print_corr will work when lat not defined -rpn_rcl, -rpn_sto, bug fix: do not set decode=1 makefile: clean now cleans ftp_api default vector fields: added USSD/VSSD added -alarm, terminates wgrib2 after N seconds by the alarm function added for web processing (nomads) to terminate jobs that may have stopped running because of broken I/O links added code_table 3.2 for grid def 101 modified Earth.c as grid def 101 does not support user major/minor axes sec3_lc: change LatSP 0.000000 LonSP 0.000000 -> LatSP -90.000000 LonSP 0.000000 change definition of latitude of southern pole THIS CHANGE REQUIRES TIN for interpolation products support for grid 101: -grib_out_irr2, Sec3.c updated documenation: undefine_val.html to reflect that the code can undefine a range added -import_netcdf Changed -alarm: text description, removed un-needed test added -match_inv_add, so can customize match_inv/Match_inv makefile: fixed clang support Ftime2: defined left and right in in unsupported cases received space view perspective grid with a satellite not on 0N OE but 0N 41.5E which exposed some problems. space_view.c: remove conversion of lop to radians space_view2ij.c: fix value of lap, fix corrections of lap, lop to radians note: codes still requires lap, position of satellite, to be on equator get_latlon(): return error code instead of 0 geo.c improved error messages, a little OpenMP for mercator2ll set_pdt(): removed char *sec4 because it was unused RPN.c xave and xdev fixed after bug introduced signed -> unsigned conversion RPN.c some missing 2G+ conversions fixed Sec3.c: in -grid for thinned Gaussian grid, remove print of dlon .. dlon doesn't apply here cyclic(), handles thinned Gaussian grid, handles 4G grids .. for incorrect ECMWF files. Lat/lon is assumes a global Gaussian grid updated gribtable fix: rpn_rcl, rpn_sto: Aug 8 2017: removed decode=1 from rpn_rcl and rpn_sto 12/5/2017 added it back Small_grib.c: added check for thinned grids. Never should be encountered. complex_pk.c: cleanup code, change so that old g2lib can read c2 and c3 files. wrtieee.c: fixed sizeof(ieee-float) = sizeof(float) to 4. I can't think of a current machine for which this is not true. added: -reduced_gaussian_grid, transform from reduced Gaussian to full Gaussian grids v0.2.0.7 12/2017 ----------------------------------- report that missing. zlib.h in RedHat system, changed makefile which may but probably doesn't fix the problem update Code_Values.c Time_processing.c: do_ave .. quit if save->n_fields == 0 added -ens_processing Level.c update code table 4.5 (level_table[]), replace CodeTable_4.5_ncep.dat by ncep_level_table[] (needed by -set_lev) and makes codes more consistent eliminated need for CodeTable_4.5_ncep.dat and get_code_Table_4.5_ncep.sh simplified special ncep levels -set_lev: fixed lowest level 11% integrated cloud cover -set_lev: added (level1) - (level2) ftn_wgrib2api: added grb2_UNDEFINED, grb2_DEFINED_VAL(), grb2_UNDEFINED_VAL() -set_lev: added %g in sequence (ncep level 241) net result: inventory levels is updated, -set_lev handles more levels makefile: gfort, icc, ifort more info in -config wgrib2(argc, const char **argv) => wgrib2(argc, char **argv) added -box_ave ncep grid 184 added: C. McGill grb2_inq(): bufer size was 53 instead of 71. move -fi from Match.c -> Fi.c move -end from Match.c -> End.c wgrib2api: grb2_inv: grid/desc, -last -> -last0 no affect on good code, less space used code with non-unique matches prob: added fcst number/total prob >2.54 -> prob >2.54:prob fcst 255/255 wgrib2_get_mem_buffer_size(int n): return 0 instead of -1 size_t is unsigned bug in sub_dt(..): if subtract time, and result should be dec 31 bug: dtime > jday -> dtime >= jday bug affects: -set_date when using -set_date -Xhr and the reference date should be dec 31. bug affects: verfification time when using negative forecast time (rare) and verification time should be Dec 31. wgrib2api.f90: changes len=100 to len=300 for longer file names USE_IPOLATES = 0,1,3 (new): changed makefile, Config.c ncep_grids.c mk_kgds.c New_grid.c -new_grid_winds: old-needed IPOLATES to be installed. new-IPOLATES does not need to be installed, needed for -submsg_uv wgrib2/makefile: removed references to NCEP_local_levels_test.h as no longer used added copy_dbl_data(..) same as copy_data(..) except for double rather than float support for PDT 70 (post processing) sec3_grids.c sets wind rotation to earth modified -match_inv_add to use 2 arguments to the option added diagnostics to -merge_fcst: same_sec4_for_merge(.) when fails to merge fixed -set_radius 3:major_km:minor_km -set data_* and -set data_+ added closest(..): 2G+, some openmp speedup removed OpenMP from gctpc_ll2xy. gctpc_ll2i rot_regular2ll (returns lat-lon of rotated lat-lon grid) OpenMP enabled. fixed Warn_old_g2lib.c, HEADER swapped 0:inv (from Dusan Jovic) rm jasper-1.900.1 jasper-1.900.1.orig from jasper-1.900.1-14ubuntu3.2.debian.tgz (from Dusan Jovic) fix rpn smth9r makefile: rm tmpz.tar, ${cwd}/share, ${cwd}/tmp (from Dusan Jovic) Manfred Schwarb made his usual no-changes-needed contribution. He fixed and updated get_gribtab.sh which updates the gribtable. Some corrections and units are made more consistent. Thanks Manfred. -new_grid: correct file name in error message if could not open output file grb2_inq(..) fix error message if no message matches. -ens_processing: do all calcs from sorted data (speedup) Ensemble.c: added more statistics, set code_table 4.3 updated code table table 4.3 changed makefile: cd ${proj4} -> cd ${proj4dir} thansk Simon Horton changed makefile to use latest netcdf4 and hdf5 v4.6.1 and 1.8.20 note: hdf5 v1.10 can read v1.8 but not vice versa. stupid. ftime2: change "ave(0 min fcst)" to "ave anl", like ftime1, set_ftime2 already works added to -set_lev "n-m hybrid layer", needed for fv3 iplib2_d: change splat -> ip_splat wgrib2api: added get_(ref/start/end)_edate, dynamical allocation of @mem:XX change number of memory buffers to 30, should fix wgrib2api to read N_num_memory_buffers from wgrib2.h file Level.c and Mod_grib.c added %g (Eta|logarithmic hybrid|hybrid height|hybrid pressure) level and layers, needed by fv3-core Grads.c: added hyp and hyh (hybrid pressure level/layer and hybrid height level/layer) changed Ftime2.c so that when NCEP prints TMIN/TMAX old: 264:30420217:d=2004021912:TMIN:2 m above ground:66-72 hour missing fcst: new: 264:30420217:d=2004021912:TMIN:2 m above ground:66-72 hour fcst: the missing refers to a missing statistical operator (ex. ave, acc, min, max) this verion is 1 hour newer than v0.1.7.8 .. for operations RPN.c: old: -rpn :asasdf was ignored, now a warning netcdf4 - change hdf5 1.8.18/1.8.18 to 1.10.4 problem with newer gcc (ubuntu) with v1.8.20, however, 1.10.x may produce files that are not compatible with 1.8. Aerosol.c if (pdt < 44 && pdt > 48) -> if (pdt < 44 || pdt > 48) from Manfred Schwarb Time_processing.c duplicate else if (pdt == 12) from Manfred Schwarb Reduced_gaussian.c removed extran extern output_order_type output_order; from Manfred Schwarb dec_png_clone.c void user_read_data_clone(.... png_uint_32) -> void user_read_data_clone(... png_size_t) from Manfred Schwarb, worked on 32 bit machines because png_uint_32 == png_size_t worked on X86_64 because X86_64 calling conventions transferred arg in a 64-bit register for both microsoft, linux and AIX(?) calling conventions makefile, config.h and Config.c: list version of hdf5 11/2018 updated gribtab manually changed CLWMR to CLMR Sec3.c added static print_stagger(), more grids with stagger -ens_processing: fixed bug in setting number of ens members -N_ens: fixed to print nothing if doesn't exist -import_text, open changed from r+ to r -import_ieee, -import_bin, open changed from rb+ to rb added const char *wgrib2api_info() .. library info makefile: compile netcdf4 without OpenMP fixed same_sec4_but_ensemble .. f1..f4 were off by 1, no affect on released codes fixed ens_processing v0.2.0.8b9 12/2018 - never released v2.0.8 -ens_processing: fixed spread calculation (one pass -> 2 pass calculation) -ndate, -ndates: added with mn (minutes) support -set_date, -time_processing: now supports mn time offsets added spectral option to -new_grid new_grid: removed loop to determine ibi -set_ftime2: works with pdt 2, 3, 4, 5, 6, 9, 10, 12, 13, 15, 41, 43 -alarm will clear alarm in finalize stage init.c added include in v0.2.0.8 2/2019 - v2.0.8 fix makefile to put png.h into include support for proposed cubed sphere (gdt-60) added new if-structure: else, elseif, endif, nested if added -start_timer -timer added -import_grib_fs -grib_out, checks if gds was changed, if ndata != npnts, warns and sets data to undefined added -wind_uv enhanced -wind_dir, wind_speed to have error messages like wind_uv -grid_def: recognize GEOLAT and GEOLON makefile: added for g95: -wFFLAGS+=-O2 -> wFFLAGS+=-c -O2 -rpn: added sto_lat, sto_lon -wind_speed, wind_dir, diagnostics for no match if mode > 0 added -set_gds, update_sec3 -wind_dir: scaling .. to nearest degree complex_pk.c: parallelized a loop added int check_datecode(int year, int month, int day, int hour, int minute, int second); -ndate, -ndates now check for valid date code ip2lib_d: polefix for nearest neighbor added -new_grid grib (template) dummy new_file takes gdt from template, dummy will be used in irr2 files new_grid: wind_direction is now initialized by init(); affects calls to wgrib2 require -new_grid_winds new_grid: added grib for ip2lib_d (IPOLATES==3) fixed debug statement in c_api/grb2_cmds(); fixed mk_gdt, test for failed lookup added -new_grid location fixed: import_text updated code table 4.9, Prob.c CodeTable.c added: Level.c "highest level > xxx DBz" -set_prob can take values of "", so can make set_meta work. set_meta.c: fix prob -new_grid, undefined -new_grid_winds, fix error message same_sec4_but_ensemble(), do not check code table 4.6 -ens_processing: can ensemble process perturbed runs and control runs code table 4.6 is not checked -submsg_uv: added flush_file() new_grid: support for FLANG (LLVM compiler) added -new_grid_order, replaces -submsg_uv more support for pdt 70 -GRIB: free memory when mode==-2 -ieee: free memory when mode==-2 -bin: free memory when mode==-2 -grib_out: free memory when mode==-2 added string2time_unit() set_date: calls string2time_unit() time_processing: calls string2time_unit() ndates: calls string2time_unit() updated gribtable: STPRATE -> STRPRATE (Stratiform Precipitation Rate:kg/m^2/s) BNEGLAY -> BNEGELAY:Bourgoiun Negative Energy Layer TSEC -> RTSEC SRAD -> SCRAD (Scaled Radiance) TSEC -> IRTSEC import_netcdf: fix scale_factor, import_netcdf: data can be in anytype (old: float only) import_netcdf: calculations are in double precision, before returning float[] import_netcdf: fix scaling: old: required offset and scaling to be set import_netcdf: parallelized code -new_grid: lambertc ignored the -new_grid_winds option. -ndates: check to prevent of overflow of inv_out[] added char *base_inv_out(void) to check size of inv_out that is used INV_BUFFER increased to 50000 (from 30000) -grid: lambert conformal: remove "mode %d" which printed out res flag, added " " after m -grid: Albert eq area: remove "mode %d" which printed out res flag -AAIG output filenames include ensemble info (Manfred Schwarb) initialize nc_time_step (doesn't appear to need it) but compiler complains (Manfred Schwarb) -fix_CFSv2_fcst: fixes the encode the number of ensemble members (Manfred Schwarb) reduced-_gaussian_grid: fixed declaration of enum interpol note: cubed_sphere2ll is not complete added: int sub_angle(char *)) old: grb2.h used int4(p) to read subangle new: grb2.h uses sub_angle(p) to read subangle handles case: subangle == 0 -> use 1, subangle == undefined -> use 1e6 this changes subangle displayed in -v -grid removed tab from ip2lib_d/splat.f90 new_grid: added checks for thinned grids, staggered grids, and ploughing order -ens_processing: fix d75 (typo) .. better accuracy for 75 percentile -ens_processing: will not do illegal memory reference to ens[save->n_ens] (value is multiplied by zero, so value is effectively not used) -ens_processing: k2 is made private -ens_processing: OpenMP structure revised to eliminate non-reproduceability with gcc 6.3.0 testing of reproducablity OMP_NUM_THREADS > 1 same as OMP_NUM_THREADS=1 gcc 4.4.8 good testing of wgrib2 v2.0.8 gcc 4.8.1 good gcc 5.3.0 good (bad with wgrib2 v2.0.9beta) gcc 6.3.0 bad intel 18.0.1 good comment: I don't see why the original OpenMP pragmas were wrong aside from the k2 not being private.ZZ summary: wgrib2 v2.0.8 -ens_processing should be avoided 1. newer versions of gcc have problems when OMP_NUM_THREADS > 1 2. 75% interpolation between 2 points is inaccurate 3. precip trace amounts is bad (cpc private) 4. possible seg fault (array out of bounds multiplied by zero). Dump.c -d, added dump_offset from George Trojan fseek_file: works with pipe is whence is SEEK_CUR, needed by -d dump_offset init.c wgrib2.c: updates for -d dump_offset ffopen.c change mode of file by freopen: (George Trojan) added: geolocation variable that indicates which geolocation package created lat/lon values added: -geolocation which prints out which geolocation package created lat/lon values added: -new_grid_format makefile: fix typos to make USE_G2CLIB work, submitted G. Trojan -rpn: old: (number)(characters) -> number new: (number)(characters) -> error changed grib2/makefile and grib2/lib/makefile to make shared library libwgrib2.so, for COMP_SYS=gnu_linux in use by python interface wgrib2lowapi.f90: changed c_char -> c_signed_char for buffer splib: ncpus.f -> ncpus.F .. now compile when compiled without OpenMP splib: #if USE_SPECTRAL == 1 in polatess4.f90 -> polatess4.F90 splib: #if USE_SPECTRAL == 1 in polatesv4.f90 -> polatesv4.F90 RPN.c logf() -> log() fix bug in gclib RPN.c more parallel code wgrib2.c: flush after writes to inv_file -rpn_rcl: fixed if (rpn_data == NULL and rpn_n != 0) should never occur makefile, New_grid.c minor fixes George Trojan mk_gdt.c: added grid 101, added \x03 to interpreted bytes new_grid() ip2lib_d version, if wind_rotation == undefined , use wind_rot of old file ffopen.c(): changed wgrib2_free_file(): old would remove file from linked list if not in use new: will close file and removee from linked list if in use/unused f_new_grid(): fix up wind_rotation. should be set in phase == -1 on setjmp: fclose(&infile) George Trojan added: -S_out .. needed for python set_metadata_str(): now allows metadata of form (d|D)=....... besides n:byte:(d|D)=... f_last(), f_last0(), added repeat_inv_out(): allow -last file1 -last file2 fixed *new_mem_buffer(int n, size_t size) when buffer is unallocated. until pywgrib2_s, nobody can closed a memory file. wgrib2_free_file: removed warning if file not found grib2/makefile --fast-math -> -ffast-math George Trojan grib2/makefile, ftp_api/makefile: changes to get make -j N to work with gcc and aocc Tried making it work before but compiling was too slow with hard disks and a slow cpu. With newish home system with nvme and 3600 cpu allowed me to make the many trials. fixed: ffopen() works with all models r/w/a Mem_buffer.c George Trojan fixed errors KMA local levels and local grib table added, Dong-il Jang added extern to init.c and wgrib2.c for following variables: run_flag, free_gribfield, grib_data, found by George Trojan using gcc v10.x GDT.c: added free list_opt, George Trojan mk_gdt.c: added Space View Perspective or orthographic, George Trojan mk_gdt.c: minor cleanup PyInv.c: added for pywgrib2_xr, George Trojan makefile: check for f77, quit if used added fatal_error_lu(..) added check for memory allocation in rd_seq_grib.c found by George Trojan wgrib2.h changed INV_BUFFER from 50000 to 100000 added pyinv: for pywgrib2_xr and pywgrib2_lite, George Trojan, expermental v3.0.0 9/2020 - v2.0.8 unmerge_fcst: fix error messages makefile fails for gnu make v4.3, fixed makefile, lib/makefile: add make shared library support for clang/flang makefile, lib/makefile: minor fixes, mac update for FTN_LEGACY, George Trojan added -gribtable_used, thanks Manfred Schwarb if USE_REGEX == 0, warn_nonzero_min_sec is never defined. reported Kyle Gerheiser, EMC only affects compilers without the regex library (windows C compilers .. Watcom?) split Match.c -> Match.c and Match_inv.c updated for OpenJPEG: makefile, jpeg_pk.c unpk.c wgrib2.h Grib.c Config.c added for OpenJPEG: enc_jpeg2000_openjpeg.c, decenc_openjpeg.c: from ECMWF with mods by Dusan Jovic OpenJPEG: optional replacement for jasper jpeg_pk.c: parallelize some loops fixed: code table 4.8 was pointing wrong location fixed: code table 4.7 had bad entries (200,201), updated code table 4.7 added more pdts to code table 4.8 fixed: ExtName.c and f_misc(..) with regards to trailing : in inventory .. should be the same inv updated -set: cluster added check for pdt size: check_pdt_size(sec), added delayed fatal errors using last message > 1 problem, could not see last message that caused error, added check_pdt_size to delayed errors redefined last_message: old: 0/1 (stop), new 0/1..N (stop), contains error reason for last_message > 0 updated wgrib2.c f_end(sec) -bin: added check for error in writing header added: -export_sec, -import_sec added delayed error: local gribtable=255, grid size mismatch, ftime2 error -limit: freed memory when finished last_message: changed from int to unsigned int makefile: initial support for nvc and nvfortran, fortran config update Wind_uv.c: save->grib_type changed from int to enum output_grib_type Cleanup CodeTable.c FlagTable.c added ecmwf grib table, Manfred Schwarb wrote script to read ECMWF web pages added -names (ecmwf|ncep), Names.c changed: cname.c init.c, f_set_var() fixed number of clusters in Clusters.c removed debug print in f_code_table_4_233 fixed print in Submsg_uv.c added check_pdt_size to wgrib2.h cleaned code for eof_bin and eof_string, memory leak removed added #include "fnlist.h" to Check_pdt_size.c ffopen(): changed code to remove "note:" (code was good) AAIG.c cleanup sprintf to remove warnings from gcc9 added -names dwd, updated cname.c Names.c gribtab.c, makefile moved all gribtables to gribtables/(center)/ made directory grib2/wgrib2/gribtables/(dwd,ecmwf), move gribtables there updated wgrib2/makefile to compile gribtab.c if gribtable.dat was changed fatal_error.c combine all fatal_error*(..) codes into one fatal_error.c: removed #ifndef SIMPLE_ERROR because preprocessor symbol is unused Time_processing.c: fixed error message, George Trojan Gctpc.c: fixed error message, George Trojan update Level.c wgrib2(): test for too many cmd line arguments upgraded ncep gribtable added code_table_0_0_location added code_table_1_0_location fixed: -new_grid location, did not set discpline of GEOLAT/GEOLON (bug found by B. Reen) minor change wgrib2/makefile cleaned warnings for jpeg_pk.c/wgrib2.h when using OpenJPEG changed isdigit(artN[i]) -> isdigit((unsigned char) argN[i]), Ndates.c Write_sec.c rd_inventory.c, CubeFace2Global changed isdigit((int) *p) -> isdigit((unsigned char) *p), Netcdf_sup.c changed makefile, lib/makefile for cygwin_win, made lib/makefile shorter (shared library) updated: c_api/*.c to remove pointer warnings v3.0.1 released 2/24/2021, removed because wrong file went to ftp.cpc.noaa.gov -netcdf doesn't output unique variable names for href file using -set_ext_name 1 helps but some fields need ftime info to uniquely identify the fields. So changed getExtName(), changed int use_ext_name -> unsigned int type_ext_name. change getExtName() to same parameters as getName(). The replacement delim and space are now "global" variables and characters. v3.0.2 released 3/01/2021 -ndates, -ndate, -ndates_fmt: changed from misc option to setup option, -ndates_fmt: better description updated -ndates: write to inv_file rather than *inv_out to avoid buffer overflows fixed tar_all script to tarball one copy of each file, problem with BSD-varient tar Reset_delayed_error.c: no output to inv_out dec_png_clone(): Sec 5 octet 20 needs to match bit_depth from png decode. A mismatch means that the grib file is not right. With A mismatch, old wgrib2 will produce the wrong grid values for a png decode. Now check for mismatch, and produce a delayed fatal error (with correct decode) old png decode only handled bit depths of 8, 16, 24 and 32 correctly. Other bit_depths would produce a silent error and give invalid grid values. update png decode to handle valid png bit_depths, 1, 2, 4, 8, 16, 24 and 32. dec_png_clone: change char *cout -> unsigned char *cout, added grib2_bit_depth unpk.c: change char *c to unsigned char *c, added grib2_bit_depth to call to dec_png_clone() wgrib2.c add DELAYED_ERROR_MISC, error must be explained in message to stdout removed one of many warnings when compiling gctpc fixed EOF.c comparison gctpc: explicityly defined sign(x) to be int. sign(x) -> int gctpc_sign(double x) makefile: changed lib/ to ${lib} makefile: added ${mod} for location of fortran mods. Keep ${mod} == ${lib} updated ncep grib table on 6/4/2021 Data.c f_stats(): code clean up, used reduction clauses (part of OpenMP 3.1) int_min_max(): used reduction clause to cleanup code Note: stat() is used, defined in IEEE Std 1003.1-2001. (POSIX-1) added DISABLE_STAT, stat(..) is posix, used to test for pipes and disk files if stat(..) does not exist, set DISABLE_STAT=1 in grib2/makefile this results in flush_mode=1, and files are assumed to disk files i.e. could try to random access or rewind on a pipe updated ffopen.c, rd_seq_grib.c and grib2/makefile remove unused code: delta_delta(), delta() gauss2lat(): parallelized code updated: -names description fixed closest(): when staggered grid and latlon or spaceview added gaussian2ij.c, updated closest(), closest_init() note: for lon=90 and lon=-90, old code could give arbitray longitudes which is valid note: for lat=0, could give either +/- lat which is valid cleanup lat2ij.c, add public domain notice -names: now understand NCEP, ECMWF, DWD (old: only ncep, ecmwf, dwd) -config: if default WMO names was DWD, would display ECMWF. Sec3.c orographic -> orthographic spelling (Earl Baker) SPBRT spelling of temperature (Earl Baker) Manfred Schwarb rewrote *.sh scripts that read tables from NCO web pages, new versions read data from WMO github Thanks! updated get_code_Table_0.0.sh: CodeTable_0.0.dat: updated, text changes updated get_code_Table_1.2.sh: CodeTable_1.2.dat: updated, text changes updated get_code_Table_3.1.sh: CodeTable_3.1.dat: updated, text changes updated get_code_Table_3.2.sh: CodeTable_3.2.dat: updated, text changes updated get_code_Table_3.8.sh: CodeTable_3.8.dat: center -> centres updated get_code_Table_3.11.sh: CodeTable_3.11.dat: updated, cleanup, text changes updated get_code_Table_3.15.sh: CodeTable_3.15.dat: updated, text changes updated get_code_Table_3.20.sh: CodeTable_3.20.dat: cap change updated get_code_Table_3.21.sh: CodeTable_3.21.dat: text changes updated get_code_Table_4.0.sh: CodeTable_4.0.dat: update, text changes updated get_code_Table_4.3.sh: CodeTable_4.3.dat: update, text changes updated get_code_Table_4.4.sh: CodeTable_4.4.dat: text changes updated get_code_Table_4.4.sh: CodeTable_4.4.dat: text changes updated get_code_Table_4.7.sh: updated get_code_Table_4.9.sh: CodeTable_4.9.dat: text changes new get_code_Table_4.10.sh: CodeTable_4.10.dat: comments lost updated get_code_Table_4.11.sh: CodeTable_4.11.dat: text changes updated get_code_Table_4.15.sh: updated get_code_Table_4.91.sh: CodeTable_4.91.dat: text changes updated get_code_Table_4.208.sh: CodeTable_4.208.dat: text changes updated get_code_Table_4.212.sh: CodeTable_4.212.dat: text changes updated get_code_Table_4.222.sh: CodeTable_4.222.dat: text changes, "Missing" added updated get_code_Table_4.230.sh: codetable_4_230.c: updated, text changes updated get_code_Table_4.233.sh: updates later updated get_code_Table_4.240.sh: CodeTable_4.240.dat: text changes updated get_code_Table_5.0.sh: CodeTable_5.0.dat: text changes updated get_code_Table_5.1.sh: CodeTable_5.1.dat: cap changes updated get_code_Table_6.0.sh: CodeTable_6.0.dat: text changes CodeTable.c: update code for 4.233: use table from 4.230 ExtName.c: update code for 4.233: use table from 4.230 Code Table 4.233 has been removed added is_uint(char *p) -set: chemical/codetable_4.230: fixed error if chemical starts with digit cleanup, no error if applied to non-chemical template -set: added aerosol/codetable_4.233 -misc: before :(chemical type): now :chemical=(chemical type): affects all inventories needed for -set_metadata, esp when chemical had no name, now consistent with aerosol -set_lev: if level == "" do nothing if level == "no_level" and PDT has no level, do nothing updated explaination for -process in Alias.c update -set, added process fix -import_grib, -import_grib_fs bug found by R. T. Inouye error in NCEP-lib bug correction when main input record is a constant field and dscale != 0 init.c: nc4 = 0, mode changed to nc4 = 0 (netcdf3 mode) nc4 needs to be conditional on netcdf (Dusan Jovic) more -rpn is parallelized for pdt with no fcst time (radar, satellite), -set_ftime2 will accept anl rather than error affects pdt == 20 || pdt == 30 || pdt == 31 || pdt == 35 || pdt == 254 check_pdt_size: added pdt 254 -spectral_band: added sat=, ex "METEOSAT 10 SEVIRI 10.79 um" -> "sat=METEOSAT 10 SEVIRI 10.79 um" -set: better error message OpenJPEG update: v2.3.1 -> v2.4.0, multithreading is not enabled, update -config updated wgrib2/makefile, fnlist.c, can be corrupted when make -jN when N > 1 Spectral_bands.c: remove misleading indentation, some minor cleanup proj4_initialize.c: added projection->radius_major = r_maj initialization (from M. Schwarb, thanks) note: code does not use projection->radius_major, so no change in the code behavior Config.c: replace DWD by DWD1 grib2/makefile: new: allow USE_NAME=DWD, old: USE_NAME=DWD1 update: get_code_Table_4.222.sh (from M. Schwarb, thanks) update: get_code_Table_4.10.sh (from M. Schwarb, thanks) update: codetable_4_230.c (from M. Schwarb, thanks) v3.1.0 released 10/7/2021 unpk_complex.c: better vectorization The next two fixes improve the accuracy of the calculations. Mathematically the same results but by not simplifying the calculation, the optimized version (-march=...) of the code are getting the same results as the non-optimized version. The differences are round-off errors but it is nice to get 0.0 vs 1e-15 (when values are O(1)). unpk_complex.c: (ref_val+udata[i])*factor -> (ref_val0+udata[i]*factor_2)*factor_10 for more accuracy when -march=znver2 unpk_0.c: (ref+flt[i])*factor -> (ref0+flt[i]*bin_scale)*dec_scale for more accuracy when -march=znver2 wgrib2 was failing in a MPMD program with a write error. Error message did not say name of output file which made debug more difficult. 3 changes to add filename to error meessages. wgrib2.h: struct seq_file: added char filename[STRING_SIZE], to store filename rd_seq_file.c fopen_file: save filename in file->filename added filename to error messages wgrib2.c added filename to error messages -ens_processing: closed output file on exit, minor cleanup -ens_qc: new option faster than -ens_processing for ens mean and spread. Mean and spread defined if N > 0. For -ens_processing, mean and spread are defined only if N = numnber of ensemble members. fix -unix_time: bad glib fails for UTC and daylight savings time reset $TZ not working, year 2038 problem (overflow of 32-bit ints) use get_unixtime(..) from the netcdf package get_unixtime(..): moved from Netcdf_sup.c to get_unixtime.c, used by -netcdf and -unix_time makefile: remove DISABLE_TIMEZONE because -unix_time is now C89 (ansi C) which is the minimum specs for the required C compiler best_scaled_value(..) fixed for exponent overfloa numbers> 10^127 and 10^-126 added checks for integer overflow : i = floor(val + 0.5) hasn't been a problem because best_scaled_value(..) is used for vertical levels, and levels don't have extreme values -set_lev: problem if abs(numerical value of level) is > 2e9, problem or 2e7 mb didn't handle byte <-> signed bytes correctly int8.c: added int1_char(..), int -> signed byte added scaled_char(..), (factor, value) -> p[0..4] (level) cleanup flt2scaled(..), best_scaled_value(..) fixed: set_lev(..), parse_level1(..) Int_Power(..): converted int to unsigned int, so avoid a future compiler message cleanup of fixed_surfaces(..) -set_prob: cleanup, new use scaled_char(..) added -set aerosol_size, -set aerosol_wavelength -set_ftime2: support 2@1 hour min(13-14 hour acc fcst)++ and 2@1 hour min(13-14 hour acc fcst)-- set_ftime2: error if n >= N_MAX (complexity) -ens: fixed ECMWF ensemble files, if code table 4.7 is undefined, set to 0 or 3, Manfred Schwarb -number_of_coordinate_values_after_template: added, support on Code_Values.c updated stat_proc_verf_time_location(unsigned char **sec) new pdt_len(..) replaces check_pdt_size(..) check_pdt_size: remove calculation of expected pdt size, now calls pdt_len(..) -hybrid: uses pdt_len(..) instead of prod_def_temp_size(sec); -Sec4: calculation for free is wrong, change format to size and expected size use pdt_len(..) instead of prod_def_temp_size(sec) f_spectral_bands_extname(..) spectral_bands(..) removed prod_def_temp_size(..) replaced by size of pdt (vs calculated size of pdt) -set_pdt: cleaned up code, save vertical coordinates, replaced smallest_pdt_len(..) by pdt_len(..) bug fixes CodeTable.c: added code_table_4_16, more support for pdt 31, 32, 33,34, 35 added number_of_contributing_spectral_bands(sec) and location -import_netcdf: new hypercube arg: * can be used for start-N:count-N, cleanup prints out hypercube data if npnts != ndata, include standard time makefile changes for netcdf4: thanks David Ryglicki, -set_radius: better help -ftime2: remove code to check initial pdt size, do outside -set_pdt: allow optional parmeters pdt:len:nc=1:n=1, new_pdt(...,char *misc_arg) -set_date: understands unix time -set_date u(integer) -level: new: 57-58 generalized vertical height coordinate (150) -set_level: new: 57-58 generalized vertical height coordinate (150) -set_ftime2: change pdt 0->8 (old: -set_pdt +8:len new: -set_pdt +8:n=X) saves vert_cord data) updated: zlib 1.2.11 -> 1.2.12, libpng 1.2.57 -> 1.2.59, netcdf-c-4.8.1.tar.gz, hdf5-1.12.1.tar.gz -prob: unknown code table 4.9: old: "probtype=255 :" new: "prob ?? (code table 4.9=255)" bug: sprintf(inv_out,"probtype=%d ") is missing inv_out += strlen(inv_out) -set_ens_num: changed code to use new_pdt(..), promotes more pdts size_all(..): tried parallelize .. slower because work per threads was too small handle size of sections to 2G. complex_grib_out(..): error if ndef < packing mode changed -new_grid_wind -> -new_grid_winds New_grid.c fprintf(stderr,..) and Changes, M Schwarb openmp_util.c: use reduction(max:) and reduction(min:) to reduce size of code (requires openmp v3.1) v3.1.1 released 4/14/2022 removed Unix_time_old.c -unix_time_old, this was used for testing, forgot to remove function.sh: export LC_ALL=C prior to sort, so order is consistent at all locations M Schwarb updated NCEP grib table 4/26/2022. locally defined SOILM and SOIL_M added, M Schwarb updated get_code_Table_4.10.sh CodeTable_4.10.dat, CodeTable_3.20.dat, M Schwarb updated get_code_Table_3.15.sh BUFRTable_0_01_007.dat, M Schwarb updated BUFRTable_0_02_019.dat BUFRTable_0_02_020.dat CodeTable_3.2.dat, M Schwarb ieee_pk.c error message: "ieee_pk: grib2 data section is limited to 4G bytes" changed to "ieee_pk: grib2 data section is limited to 4G-1 bytes" fixed test for too large, old: assumed that int was 32 bits mk_bms(..): bms_size calculation could overflow for 4G-8 < ndata < 4G complex_pk.c: fixes for 4G grids unpk_complex.c: 4G fix, number bits would overflow, change n -> n_bytes, n_bits get_hex: 1st byte was printed as %d instead of %.2u, reported by R. Dabrowski, thanks RD Set_byte.c change: else seclen = uint4(sec[i[); by else seclen = sec[i] ? uint4(sec[i]) : 0; rd_bitstream_flt: n is now unsigned int (4G) rd_bitstream: n is now unsigned int (4G) add_many_bitstream: n is now unsigned int (4G) complex_pk.c: free(itmp2) Unmerge_fcst.c: 4G fix Undefined. extern int nx_, ny_; -> extern unsigned int nx_, ny_; New_grid.c extern int nx_, ny_; -> extern unsigned int nx_, ny_; New_grid.c extern unsigned int nx, ny; -> extern int nx, ny; -import_lonlat: old: fseek to start of file, not 4G new: fseek to start of file if EOF, removed debug that was not 4G new: check to see that 0 was read in Fcst_ave.c: 4G fixes -ilat: 4G rdieee_file(): fixed error if ndata/4 > 2G and using header aec_pk.c: ECMWF found that buffer was too small in the case that the data had high entropy increase buffer size by 5% + 256, Thanks S. Najm makefile: add HAS_CMAKE, more libraries will need cmake, libaec and openjpeg for now makefile: libaec updated to version 1.0.6 unpk_0.c: improve openmp parallelization of calls to rd_bitstream unpk_complex.c openmp parallelization of calls to rd_bitstream used by unpk_0.c ijsmall_grib and small_grib works for rotated lat-lon grids -rpn, parallelized print_rms and print_corr update OpenJPEG to v2.5.0 decenc_openjpeg.c, remove use of bpp fix grib2/makefile: USE_PROJ4 didn't work, missing quote, bug report J. Assheton removed warning count for equal areal Lambert fixed problem with equal area Lambert, UK Met fcst, bug report J. Assheton grb2.h old #define GDS_Lambert_Az_Lo1(gds) (uint4(gds+42) * 0.000001) new #define GDS_Lambert_Az_Lo1(gds) (int4(gds+42) * 0.000001) Proj4.c improve error messages Gctpc.c remove warning_LamAZ .. no limit to warnings to aspherical equal area Lambert Proj4.c: proj4_get_latlon() remove redundant mallocs Proj4.c: abs -> fabs Proj4.c: remove handling of GDT=0 makefile: always install Proj4 wgrib2.h: enable Proj4 as default wgrib2.c, Config.c: changed priority of geolocation to :gctpc, Proj4, internal Earth.c: axes_earth(sec, &major, &minor) => axes_earth(sec, &major, &minor, &is_spherical) affects Earth.c Gctpc.c gctpc_ll2xy.c grid_ident.c New_grid.c Proj4.c proj4_initialize.c spaceview.c spaceview2ij.c Earth.c f_radius, radius now call axes_earth. f_radius output changed geolocation set: RPN.c (sto_lat, sto_lon), Import_latlon.c read_latlon.c, grid_def.c f_geolocation(..): added new values to -geolocation (external) gctpc_get_latlon: new: will not work for aspherical eq area lambert, require proj4 OpenJPEG: \#define to $Hdefine in makefile for OpenJPEG, thanks J Stroik enabled interpolation neighbor-budget for ip2lib_d added "ncep grid core", "ncep grid t170" should produce the same results but slightly different northern most Gaussian lat. This version produces the same section 3 as coming from CORe using gcc v4.8.5 makefile: USE_NETCDF4, USE_HDF5DIR changed from 0/1 to 0/compile/system/INC:LIB for using provided netcdf4/hdf5 libraries. Note external libraries are not tested, however netcdf4/hdf5 are not tested because of compile problems. Note clean compile is not the same as a working HDF5 library. contributed by M. Fontana .. thanks Config.c: changes to show netcdf4/hdf5 libraries Added JMA pdts .. testing by R. Hanai, thanks Small_grib.c: fix free of non-allocated memory simple_pk.c: fix for oneAPI, random seg fault with oneAPI but not other compilers Could not see error with original code. Compiler bug? Config.c: fixed order geolocation support for proj4, clarified default updated lib/makefile to make shared library for new intel compiler (icx/ifx) grib2_split: changed to shell script Ftime2.c: convert seconds to minutes in X-Y sec (type) fcst added -set_ftime_mode: added int ftime_mode, Set_ftime_mode, changed init.c Ftime2.c units.c by request of NBM removed -set_version_ftime, only way to get ftime1 and set_ftime1 is explictily v3.1.2 -------------------feb 9, 2023 pdt_len.c pdt=91: fix off by one error in WMO doc M. Schwarb 2/10/23 only takes one day for the next fix! added to wgrib2.h IS_OPENMP_3_1 IS_OPENMP_4_0 IS_OPENMP_4_5 IS_OPENMP_5_0 IS_OPENMP_X.Y is true when version of OpenMP >= X.Y for use in adding new features that require higher versions of OpenMP fixed spelling in warning: deocde -> decode (wgrib2.c) added -type_reftime (code table 1.2), modified -misc, need to modify set_meta, and set add show -set options to-config , changed Config.h, Mod_grib.c makefile: error in compiling shared library, revert to v3.1.1 code .. W. Brown geo.c gauss2lat(): added openmp, minor cleanup in closest_init() and closest() -- makefile: USE_OPENJPEG works on machines with missing libraries (dogwood/cactus) -- patch only works on dogwood/cactus remove -fast-math, proj4 doesn't pass check using gcc on Mac. could affect other libraries that check the results intel compilers make fast-math the default. unpk_complex.c: added simd, combination of -march=native -mtune=native reduced complex unpk from 13sec to 12sec for master file with cached data unpk.c: more loops are parallel Unmerge_fcst.c added omp simd complex_pk.c: cleanup indentation rdieee_file.c: parallelized increased buffer size makefile: ifort option: replace -nofor_main with -nofor-main wgrib2/makefile: create fnlist.h if missing makefile: if not spectral, update ip2lib_d/config.h trivial: simd in bitstreams.c -ens_processing: for usage, change "Y=future use" to "Y=0/1 default/CORe" openmp_util.c: loops are simd from threaded fixed makefile, changed \#define to $Hdefine -set_bitmap 1, fix bug in complex_pack.c makefile enables openmp for OneAPI correctly makefile cleans up libaec using brute force v3.1.2 -------------------Oct 24/2023