From 39f94a88e760f50dcbfdc9305f1f23c00e7fdbcf Mon Sep 17 00:00:00 2001 From: jeff beck Date: Fri, 24 Mar 2023 22:17:04 +0000 Subject: [PATCH 1/7] Update documentation to inform users about duplicate grib2 variables and levels when concatenating files, and how to remove them. --- docs/source/chgres_cube.rst | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/docs/source/chgres_cube.rst b/docs/source/chgres_cube.rst index 38c48e491..0756f0ab3 100644 --- a/docs/source/chgres_cube.rst +++ b/docs/source/chgres_cube.rst @@ -141,6 +141,22 @@ Initializing global domains with GRIB2 data - some caveats * Soil moisture in the GRIB2 files is created using bilinear interpolation and, therefore, may be a mixture of values from different soil types. Could result in poor latent/sensible heat fluxes. * Ozone is not available at all isobaric levels. Missing levels are set to a nominal value defined in the variable mapping (VARMAP) file (1E-07). * Only tested with GRIB2 data from GFS v14 and v15 (from 12z July 19, 2017 to current). May not work with older GFS data. Will not work with GRIB2 data from other models. + * Note that when concatenating grib2 files for use in initialization of global simulations, it is possible to inadvertently introduce duplicate variables and levels into the subsequent grib2 files. Chgres_cube will automatically fail with a warning message indicating that the grib2 file used contains these duplicate entries. Prior to continuing it will be necessary to strip out duplicate entries. Users can remove these entries through use of wgrib2, such as in the following command: + * wgrib2 IN.grb -submsg 1 | unique.pl | wgrib2 -i IN.grb -GRIB OUT.grb, where IN.grb is the original concatenated grib2 file, and OUT.grb is the resulting grib2 file, with duplicates removed. The "unique.pl" Perl script is as follows, taken from the `Tricks for wgrib2 `_ website: + * ----------------------- unique.pl ------------------------ + #!/usr/bin/perl -w + # print only lines where fields 3..N are different + # + while () { + chomp; + $line = $_; + $_ =~ s/^[0-9.]*:[0-9]*://; + if (! defined $inv{$_}) { + $inv{$_} = 1; + print "$line\n"; + } + } + --------------------- end unique.pl ---------------------- Near Sea Surface Temperature (NSST) data and GRIB2 initialization ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -304,6 +320,22 @@ Keep these things in mind when using FV3GFS GRIB2 data for model initialization: * For FV3GFS GRIB2 data, soil moisture is created using bilinear interpolation and, therefore, may be a mixture of values from different soil types. Could result in poor latent/sensible heat fluxes. * Ozone is not available at all isobaric levels. Missing levels are set to a nominal value defined in the variable mapping (VARMAP) file (1E-07). * Only tested with GRIB2 data from FV3GFS, RAP, NAM, and HRRR data. May not work with GRIB2 data from other models. Use these at your own risk. + * Note that when concatenating grib2 files for use in initialization of global simulations, it is possible to inadvertently introduce duplicate variables and levels into the subsequent grib2 files. Chgres_cube will automatically fail with a warning message indicating that the grib2 file used contains these duplicate entries. Prior to continuing it will be necessary to strip out duplicate entries. Users can remove these entries through use of wgrib2, such as in the following command: + * wgrib2 IN.grb -submsg 1 | unique.pl | wgrib2 -i IN.grb -GRIB OUT.grb, where IN.grb is the original concatenated grib2 file, and OUT.grb is the resulting grib2 file, with duplicates removed. The "unique.pl" Perl script is as follows, taken from the `Tricks for wgrib2 `_ website: + * ----------------------- unique.pl ------------------------ + #!/usr/bin/perl -w + # print only lines where fields 3..N are different + # + while () { + chomp; + $line = $_; + $_ =~ s/^[0-9.]*:[0-9]*://; + if (! defined $inv{$_}) { + $inv{$_} = 1; + print "$line\n"; + } + } + --------------------- end unique.pl ---------------------- Regional chgres_cube namelist options ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ From e855be761aeb274a2b74ba31e8ec8b09e7d4159f Mon Sep 17 00:00:00 2001 From: JeffBeck-NOAA <55201531+JeffBeck-NOAA@users.noreply.github.com> Date: Sun, 26 Mar 2023 12:39:38 -0600 Subject: [PATCH 2/7] Update chgres_cube.rst --- docs/source/chgres_cube.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/source/chgres_cube.rst b/docs/source/chgres_cube.rst index 0756f0ab3..29659cabd 100644 --- a/docs/source/chgres_cube.rst +++ b/docs/source/chgres_cube.rst @@ -320,7 +320,7 @@ Keep these things in mind when using FV3GFS GRIB2 data for model initialization: * For FV3GFS GRIB2 data, soil moisture is created using bilinear interpolation and, therefore, may be a mixture of values from different soil types. Could result in poor latent/sensible heat fluxes. * Ozone is not available at all isobaric levels. Missing levels are set to a nominal value defined in the variable mapping (VARMAP) file (1E-07). * Only tested with GRIB2 data from FV3GFS, RAP, NAM, and HRRR data. May not work with GRIB2 data from other models. Use these at your own risk. - * Note that when concatenating grib2 files for use in initialization of global simulations, it is possible to inadvertently introduce duplicate variables and levels into the subsequent grib2 files. Chgres_cube will automatically fail with a warning message indicating that the grib2 file used contains these duplicate entries. Prior to continuing it will be necessary to strip out duplicate entries. Users can remove these entries through use of wgrib2, such as in the following command: + * Note that when concatenating grib2 files for use in initialization of regional simulations, it is possible to inadvertently introduce duplicate variables and levels into the subsequent grib2 files. Chgres_cube will automatically fail with a warning message indicating that the grib2 file used contains these duplicate entries. Prior to continuing it will be necessary to strip out duplicate entries. Users can remove these entries through use of wgrib2, such as in the following command: * wgrib2 IN.grb -submsg 1 | unique.pl | wgrib2 -i IN.grb -GRIB OUT.grb, where IN.grb is the original concatenated grib2 file, and OUT.grb is the resulting grib2 file, with duplicates removed. The "unique.pl" Perl script is as follows, taken from the `Tricks for wgrib2 `_ website: * ----------------------- unique.pl ------------------------ #!/usr/bin/perl -w From 69a0f19bdad8d48e16f8444fa9d032723c825105 Mon Sep 17 00:00:00 2001 From: jeff beck Date: Mon, 27 Mar 2023 16:01:25 +0000 Subject: [PATCH 3/7] Documentation syntax modifications for the perl script. --- docs/source/chgres_cube.rst | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/docs/source/chgres_cube.rst b/docs/source/chgres_cube.rst index 0756f0ab3..71f1274c3 100644 --- a/docs/source/chgres_cube.rst +++ b/docs/source/chgres_cube.rst @@ -142,8 +142,11 @@ Initializing global domains with GRIB2 data - some caveats * Ozone is not available at all isobaric levels. Missing levels are set to a nominal value defined in the variable mapping (VARMAP) file (1E-07). * Only tested with GRIB2 data from GFS v14 and v15 (from 12z July 19, 2017 to current). May not work with older GFS data. Will not work with GRIB2 data from other models. * Note that when concatenating grib2 files for use in initialization of global simulations, it is possible to inadvertently introduce duplicate variables and levels into the subsequent grib2 files. Chgres_cube will automatically fail with a warning message indicating that the grib2 file used contains these duplicate entries. Prior to continuing it will be necessary to strip out duplicate entries. Users can remove these entries through use of wgrib2, such as in the following command: - * wgrib2 IN.grb -submsg 1 | unique.pl | wgrib2 -i IN.grb -GRIB OUT.grb, where IN.grb is the original concatenated grib2 file, and OUT.grb is the resulting grib2 file, with duplicates removed. The "unique.pl" Perl script is as follows, taken from the `Tricks for wgrib2 `_ website: - * ----------------------- unique.pl ------------------------ + * ``wgrib2 IN.grb -submsg 1 | unique.pl | wgrib2 -i IN.grb -GRIB OUT.grb``, where IN.grb is the original concatenated grib2 file, and OUT.grb is the resulting grib2 file, with duplicates removed. The "unique.pl" Perl script is as follows, taken from the `Tricks for wgrib2 `_ website: + + .. code-block:: console + + ----------------------- unique.pl ------------------------ #!/usr/bin/perl -w # print only lines where fields 3..N are different # @@ -320,9 +323,12 @@ Keep these things in mind when using FV3GFS GRIB2 data for model initialization: * For FV3GFS GRIB2 data, soil moisture is created using bilinear interpolation and, therefore, may be a mixture of values from different soil types. Could result in poor latent/sensible heat fluxes. * Ozone is not available at all isobaric levels. Missing levels are set to a nominal value defined in the variable mapping (VARMAP) file (1E-07). * Only tested with GRIB2 data from FV3GFS, RAP, NAM, and HRRR data. May not work with GRIB2 data from other models. Use these at your own risk. - * Note that when concatenating grib2 files for use in initialization of global simulations, it is possible to inadvertently introduce duplicate variables and levels into the subsequent grib2 files. Chgres_cube will automatically fail with a warning message indicating that the grib2 file used contains these duplicate entries. Prior to continuing it will be necessary to strip out duplicate entries. Users can remove these entries through use of wgrib2, such as in the following command: - * wgrib2 IN.grb -submsg 1 | unique.pl | wgrib2 -i IN.grb -GRIB OUT.grb, where IN.grb is the original concatenated grib2 file, and OUT.grb is the resulting grib2 file, with duplicates removed. The "unique.pl" Perl script is as follows, taken from the `Tricks for wgrib2 `_ website: - * ----------------------- unique.pl ------------------------ + * Note that when concatenating grib2 files for use in initialization of regional simulations, it is possible to inadvertently introduce duplicate variables and levels into the subsequent grib2 files. Chgres_cube will automatically fail with a warning message indicating that the grib2 file used contains these duplicate entries. Prior to continuing it will be necessary to strip out duplicate entries. Users can remove these entries through use of wgrib2, such as in the following command: + * ``wgrib2 IN.grb -submsg 1 | unique.pl | wgrib2 -i IN.grb -GRIB OUT.grb``, where IN.grb is the original concatenated grib2 file, and OUT.grb is the resulting grib2 file, with duplicates removed. The "unique.pl" Perl script is as follows, taken from the `Tricks for wgrib2 `_ website: + + .. code-block:: console + + ----------------------- unique.pl ------------------------ #!/usr/bin/perl -w # print only lines where fields 3..N are different # From 1b7efe37ccf916e6a74e71013288c9ae39419401 Mon Sep 17 00:00:00 2001 From: jeff beck Date: Mon, 27 Mar 2023 17:05:20 +0000 Subject: [PATCH 4/7] Console block change test. --- docs/source/_static/theme_overrides.css | 3 +++ docs/source/chgres_cube.rst | 2 -- docs/source/conf.py | 1 + 3 files changed, 4 insertions(+), 2 deletions(-) create mode 100644 docs/source/_static/theme_overrides.css diff --git a/docs/source/_static/theme_overrides.css b/docs/source/_static/theme_overrides.css new file mode 100644 index 000000000..654620929 --- /dev/null +++ b/docs/source/_static/theme_overrides.css @@ -0,0 +1,3 @@ +highlight { + width: 300px; +} diff --git a/docs/source/chgres_cube.rst b/docs/source/chgres_cube.rst index a7e572e4f..71f1274c3 100644 --- a/docs/source/chgres_cube.rst +++ b/docs/source/chgres_cube.rst @@ -145,7 +145,6 @@ Initializing global domains with GRIB2 data - some caveats * ``wgrib2 IN.grb -submsg 1 | unique.pl | wgrib2 -i IN.grb -GRIB OUT.grb``, where IN.grb is the original concatenated grib2 file, and OUT.grb is the resulting grib2 file, with duplicates removed. The "unique.pl" Perl script is as follows, taken from the `Tricks for wgrib2 `_ website: .. code-block:: console - :width: #px ----------------------- unique.pl ------------------------ #!/usr/bin/perl -w @@ -328,7 +327,6 @@ Keep these things in mind when using FV3GFS GRIB2 data for model initialization: * ``wgrib2 IN.grb -submsg 1 | unique.pl | wgrib2 -i IN.grb -GRIB OUT.grb``, where IN.grb is the original concatenated grib2 file, and OUT.grb is the resulting grib2 file, with duplicates removed. The "unique.pl" Perl script is as follows, taken from the `Tricks for wgrib2 `_ website: .. code-block:: console - :width: #px ----------------------- unique.pl ------------------------ #!/usr/bin/perl -w diff --git a/docs/source/conf.py b/docs/source/conf.py index e322267b8..9598e8bc6 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -105,6 +105,7 @@ def setup(app): app.add_css_file('custom.css') # may also be an URL + app.add_css_file('theme_overrides.css') # may also be a URL # Custom sidebar templates, must be a dictionary that maps document names # to template names. From 2f48f255e6674e64ef637b9fe8f6272c92032674 Mon Sep 17 00:00:00 2001 From: jeff beck Date: Mon, 27 Mar 2023 17:12:43 +0000 Subject: [PATCH 5/7] Fix syntax in css file. --- docs/source/_static/theme_overrides.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/source/_static/theme_overrides.css b/docs/source/_static/theme_overrides.css index 654620929..c22ef9cf0 100644 --- a/docs/source/_static/theme_overrides.css +++ b/docs/source/_static/theme_overrides.css @@ -1,3 +1,3 @@ -highlight { +.highlight { width: 300px; } From dde3504135ce8cb6ee18e3f7ef5131418e1c0432 Mon Sep 17 00:00:00 2001 From: jeff beck Date: Mon, 27 Mar 2023 17:14:56 +0000 Subject: [PATCH 6/7] Syntax change. --- docs/source/_static/theme_overrides.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/source/_static/theme_overrides.css b/docs/source/_static/theme_overrides.css index c22ef9cf0..61b3a59c1 100644 --- a/docs/source/_static/theme_overrides.css +++ b/docs/source/_static/theme_overrides.css @@ -1,3 +1,3 @@ .highlight { - width: 300px; + width: 300px important!; } From 8da1baee9a8c7108f1227a4085292351cdab53e5 Mon Sep 17 00:00:00 2001 From: jeff beck Date: Mon, 27 Mar 2023 17:19:59 +0000 Subject: [PATCH 7/7] Revert CSS changes. --- docs/source/_static/theme_overrides.css | 3 --- docs/source/conf.py | 1 - 2 files changed, 4 deletions(-) delete mode 100644 docs/source/_static/theme_overrides.css diff --git a/docs/source/_static/theme_overrides.css b/docs/source/_static/theme_overrides.css deleted file mode 100644 index 61b3a59c1..000000000 --- a/docs/source/_static/theme_overrides.css +++ /dev/null @@ -1,3 +0,0 @@ -.highlight { - width: 300px important!; -} diff --git a/docs/source/conf.py b/docs/source/conf.py index 9598e8bc6..e322267b8 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -105,7 +105,6 @@ def setup(app): app.add_css_file('custom.css') # may also be an URL - app.add_css_file('theme_overrides.css') # may also be a URL # Custom sidebar templates, must be a dictionary that maps document names # to template names.