SCMI Writer can produce un-ingestable AWIPS files
**Describe the bug**

This was reported to me by @spruceboy as part of a Polar2Grid bug. By default, the SCMI writer will use the hostname of the current machine as the "production_location" global attribute in the produced NetCDF4 files. For some systems this value can be really long. AWIPS, the software ingesting these files, has an internal database limit of 31 characters (as far as we know) for this field.

**Expected behavior**
AWIPS can read any file generated by the SCMI writer.

**Actual results**
AWIPS ingest fails with an odd error. Note, this can be worked around by specifying the `ORGANIZATION` environment variable.

**Proposed solution**
Raise an error if the `product_location` is longer than 31 characters. The error message should include a mention about the environment variable to override the value.

Other solution would be to just always limit the string to 31 characters, but I think this is a little too magical and could not be what the user wants. It would also be nice if `production_location` could be provided from the python code (no environment variable needed).

FYI to anyone who fixes this before me, the place to look is `satpy/writers/scmi.py:AttributeHelper._global_production_location()`.
diff --git a/satpy/etc/writers/awips_tiled.yaml b/satpy/etc/writers/awips_tiled.yaml
index 7a6840c26..90afd30c0 100644
--- a/satpy/etc/writers/awips_tiled.yaml
+++ b/satpy/etc/writers/awips_tiled.yaml
@@ -777,7 +777,7 @@ templates:
   glm_l2_radc:
     single_variable: false
     # OR_GLM-L2-GLMF-M6_G16_T10_e20201105150300.nc
-    filename: 'OR_GLM-L2-GLM{scene_abbr}-{scan_mode}_{platform_shortname}_T{tile_number:02d}_{end_time:%Y%m%d%H%M%S}.nc'
+    filename: '{environment_prefix}_GLM-L2-GLM{scene_abbr}-{scan_mode}_{platform_shortname}_T{tile_number:02d}_{end_time:%Y%m%d%H%M%S}.nc'
     global_attributes:
       # FIXME: This should come from the reader's metadata
       dataset_name:
@@ -951,7 +951,7 @@ templates:
   glm_l2_radf:
     single_variable: false
     # OR_GLM-L2-GLMF-M6_G16_T10_e20201105150300.nc
-    filename: 'OR_GLM-L2-GLM{scene_abbr}-{scan_mode}_{platform_shortname}_T{tile_number:02d}_{end_time:%Y%m%d%H%M%S}.nc'
+    filename: '{environment_prefix}_GLM-L2-GLM{scene_abbr}-{scan_mode}_{platform_shortname}_T{tile_number:02d}_{end_time:%Y%m%d%H%M%S}.nc'
     global_attributes:
       # FIXME: This should come from the reader's metadata
       dataset_name:
diff --git a/satpy/tests/writer_tests/test_awips_tiled.py b/satpy/tests/writer_tests/test_awips_tiled.py
index 39471830a..f7681530c 100644
--- a/satpy/tests/writer_tests/test_awips_tiled.py
+++ b/satpy/tests/writer_tests/test_awips_tiled.py
@@ -25,6 +25,18 @@ import dask.array as da
 import pytest
 
 
+def _check_production_location(ds):
+    if 'production_site' in ds.attrs:
+        prod_loc_name = 'production_site'
+    elif 'production_location' in ds.attrs:
+        prod_loc_name = 'producton_location'
+    else:
+        return
+
+    if prod_loc_name in ds.attrs:
+        assert len(ds.attrs[prod_loc_name]) == 31
+
+
 def check_required_common_attributes(ds):
     """Check common properties of the created AWIPS tiles for validity."""
     assert 'x' in ds.coords
@@ -50,6 +62,7 @@ def check_required_common_attributes(ds):
                       'number_product_tiles',
                       'product_rows', 'product_columns'):
         assert attr_name in ds.attrs
+    _check_production_location(ds)
 
     for data_arr in ds.data_vars.values():
         if data_arr.ndim == 0:
@@ -518,13 +531,23 @@ class TestAWIPSTiledWriter:
         ['C',
          'F']
     )
-    def test_multivar_numbered_tiles_glm(self, sector):
+    @pytest.mark.parametrize(
+        "extra_kwargs",
+        [
+            {},
+            {'environment_prefix': 'AA'},
+            {'environment_prefix': 'BB', 'filename': '{environment_prefix}_{name}_GLM_T{tile_number:04d}.nc'},
+        ]
+    )
+    def test_multivar_numbered_tiles_glm(self, sector, extra_kwargs):
         """Test creating a tiles with multiple variables."""
         import xarray as xr
         from satpy.writers.awips_tiled import AWIPSTiledWriter
         from xarray import DataArray
         from pyresample.geometry import AreaDefinition
         from pyresample.utils import proj4_str_to_dict
+        import os
+        os.environ['ORGANIZATION'] = '1' * 50
         w = AWIPSTiledWriter(base_dir=self.base_dir, compress=True)
         area_def = AreaDefinition(
             'test',
@@ -570,8 +593,10 @@ class TestAWIPSTiledWriter:
         })
 
         w.save_datasets([ds1, ds2, ds3, dqf], sector_id='TEST', source_name="TESTS",
-                        tile_count=(3, 3), template='glm_l2_rad{}'.format(sector.lower()))
-        all_files = glob(os.path.join(self.base_dir, '*_GLM*.nc'))
+                        tile_count=(3, 3), template='glm_l2_rad{}'.format(sector.lower()),
+                        **extra_kwargs)
+        fn_glob = self._get_glm_glob_filename(extra_kwargs)
+        all_files = glob(os.path.join(self.base_dir, fn_glob))
         assert len(all_files) == 9
         for fn in all_files:
             ds = xr.open_dataset(fn, mask_and_scale=False)
@@ -580,3 +605,11 @@ class TestAWIPSTiledWriter:
                 assert ds.attrs['time_coverage_end'] == end_time.strftime('%Y-%m-%dT%H:%M:%S.%fZ')
             else:  # 'F'
                 assert ds.attrs['time_coverage_end'] == end_time.strftime('%Y-%m-%dT%H:%M:%SZ')
+
+    @staticmethod
+    def _get_glm_glob_filename(extra_kwargs):
+        if 'filename' in extra_kwargs:
+            return 'BB*_GLM*.nc'
+        elif 'environment_prefix' in extra_kwargs:
+            return 'AA*_GLM*.nc'
+        return 'DR*_GLM*.nc'
diff --git a/satpy/writers/awips_tiled.py b/satpy/writers/awips_tiled.py
index b19b4aafb..692a60295 100644
--- a/satpy/writers/awips_tiled.py
+++ b/satpy/writers/awips_tiled.py
@@ -216,6 +216,7 @@ lettered tile locations.
 import os
 import logging
 import string
+import warnings
 import sys
 from datetime import datetime, timedelta
 from collections import namedtuple
@@ -915,10 +916,20 @@ class AWIPSNetCDFTemplate(NetCDFTemplate):
         del input_metadata
         org = os.environ.get('ORGANIZATION', None)
         if org is not None:
-            return org
-        LOG.warning('environment ORGANIZATION not set for .production_location attribute, using hostname')
-        import socket
-        return socket.gethostname()  # FUTURE: something more correct but this will do for now
+            prod_location = org
+        else:
+            LOG.warning('environment ORGANIZATION not set for .production_location attribute, using hostname')
+            import socket
+            prod_location = socket.gethostname()  # FUTURE: something more correct but this will do for now
+
+        if len(prod_location) > 31:
+            warnings.warn("Production location attribute is longer than 31 "
+                          "characters (AWIPS limit). Set it to a smaller "
+                          "value with the 'ORGANIZATION' environment "
+                          "variable. Defaults to hostname and is currently "
+                          "set to '{}'.".format(prod_location))
+            prod_location = prod_location[:31]
+        return prod_location
 
     _global_production_site = _global_production_location
 
@@ -1397,6 +1408,7 @@ class AWIPSTiledWriter(Writer):
                 columns=area_def.width,
                 sector_id=sector_id,
                 tile_id=tile_info.tile_id,
+                tile_number=tile_info.tile_number,
                 **kwargs)
         except RuntimeError:
             # the user didn't provide a specific filename, use the template
@@ -1445,7 +1457,7 @@ class AWIPSTiledWriter(Writer):
                       lettered_grid=False, num_subtiles=None,
                       use_end_time=False, use_sector_reference=False,
                       template='polar', check_categories=True,
-                      extra_global_attrs=None,
+                      extra_global_attrs=None, environment_prefix='DR',
                       compute=True, **kwargs):
         """Write a series of DataArray objects to multiple NetCDF4 Tile files.
 
@@ -1464,6 +1476,12 @@ class AWIPSTiledWriter(Writer):
             source_name (str): Name of producer of these files (ex. "SSEC").
                 This name is used to create the output filename for some
                 templates.
+            environment_prefix (str): Prefix of filenames for some templates.
+                For operational real-time data this is usually "OR", "OT" for
+                test data, "IR" for test system real-time data, and "IT" for
+                test system test data. This defaults to "DR" for "Developer
+                Real-time" to avoid anyone accidentally producing files that
+                could be mistaken for the operational system.
             tile_count (tuple): For numbered tiles only, how many tile rows
                 and tile columns to produce. Default to ``(1, 1)``, a single
                 giant tile. Either ``tile_count``, ``tile_size``, or
@@ -1535,6 +1553,7 @@ class AWIPSTiledWriter(Writer):
                                                source_name)
             output_filename = self.get_filename(template, area_def,
                                                 tile_info, sector_id,
+                                                environment_prefix=environment_prefix,
                                                 **ds_info)
             self.check_tile_exists(output_filename)
             # TODO: Provide attribute caching for things that likely won't change (functools lrucache)
['satpy/tests/writer_tests/test_awips_tiled.py', 'satpy/etc/writers/awips_tiled.yaml', 'satpy/writers/awips_tiled.py']