Scheduled Downtime
On Friday 21 April 2023 @ 5pm MT, this website will be down for maintenance and expected to return online the morning of 24 April 2023 at the latest

(RESOLVED) "invalid category" geogrid warning after modifying GEOGRID.TBL

This post was from a previous version of the WRF&MPAS-A Support Forum. New replies have been disabled and if you have follow up questions related to this post, then please start a new thread from the forum home page.

kaelel18

Member
Hi WRF team. I am currently experiencing error when I try to change land use data in geogrid tbl. I downloaded a 2018 modis land use data which i plan to use as my base land use, hence I assigned it in land use priority 1

Code:
name=LANDUSEF
        priority=1
	dominant = LU_INDEX
        dest_type=categorical
        z_dim_name=land_cat
        landmask_water =    nlcd2006_9s:17         # Calculate a landmask from this field
        landmask_water =   nlcd2006_30s:17         # Calculate a landmask from this field
        landmask_water =    nlcd2011_9s:17         # Calculate a landmask from this field
        landmask_water =       nlcd2006:17         # Calculate a landmask from this field
        landmask_water =       ssib_10m:16         # Calculate a landmask from this field
        landmask_water  =       ssib_5m:16         # Calculate a landmask from this field
        landmask_water =      modis_15s:17         # Calculate a landmask from this field
        landmask_water =      modis_30s:17         # Calculate a landmask from this field
        landmask_water = modis_30s_lake:17,21      # Calculate a landmask from this field
        landmask_water =       usgs_30s:16         # Calculate a landmask from this field
        landmask_water =     usgs_lakes:16,28      # Calculate a landmask from this field
        landmask_water =    modis_lakes:17,21      # Calculate a landmask from this field
        landmask_water =        usgs_2m:16         # Calculate a landmask from this field
        landmask_water =        usgs_5m:16         # Calculate a landmask from this field
        landmask_water =       usgs_10m:16         # Calculate a landmask from this field
        landmask_water =        default:17,21      # Calculate a landmask from this field
        interp_option =    nlcd2006_9s:average_gcell(0.0)
        interp_option =   nlcd2006_30s:average_gcell(0.0)
        interp_option =    nlcd2011_9s:average_gcell(0.0)  
        interp_option =       nlcd2006:nearest_neighbor
        interp_option =       ssib_10m:four_pt
        interp_option =        ssib_5m:four_pt
        interp_option =      modis_15s:nearest_neighbor
        interp_option =      modis_30s:nearest_neighbor
        interp_option = modis_30s_lake:nearest_neighbor
        interp_option =       usgs_30s:nearest_neighbor
        interp_option =     usgs_lakes:nearest_neighbor
        interp_option =    modis_lakes:nearest_neighbor
        interp_option =        usgs_2m:four_pt
        interp_option =        usgs_5m:four_pt
        interp_option =       usgs_10m:four_pt
        interp_option =        default:nearest_neighbor
        rel_path =    nlcd2006_9s:nlcd2006_ll_9s/
        rel_path =   nlcd2006_30s:nlcd2006_ll_30s/
        rel_path =    nlcd2011_9s:nlcd2011_ll_9s/
        rel_path =       nlcd2006:nlcd2006_ll_30s/
        rel_path =       ssib_10m:ssib_landuse_10m/
        rel_path =        ssib_5m:ssib_landuse_5m/
        rel_path =      modis_15s:modis_landuse_20class_15s/
        rel_path =      modis_30s:modis_landuse_20class_30s/
        rel_path = modis_30s_lake:modis_landuse_20class_30s_with_lakes/
        rel_path =       usgs_30s:landuse_30s/
        rel_path =     usgs_lakes:landuse_30s_with_lakes/
        rel_path =    modis_lakes:modis_landuse_21class_30s/
        rel_path =        usgs_2m:landuse_2m/
        rel_path =        usgs_5m:landuse_5m/
        rel_path =       usgs_10m:landuse_10m/
        rel_path =       default:[b]metro_manila[/b]/

MODIS land use has two maps which I mosaic. After transforming it into binary file, and setting my path to it in the geogrid,tbl, I ran wrf with the namelist.wps details below,

Code:
&share
 wrf_core = 'ARW',
 max_dom = 3,
 start_date = '2018-04-21_00:00:00', '2018-04-21_00:00:00', '2018-04-21_00:00:00', 
 end_date   = '2018-04-30_00:00:00', '2018-04-30_00:00:00', '2018-30-21_00:00:00', 
 interval_seconds = 21600,
 io_form_geogrid = 2,
 debug_level = 0,
/

&geogrid
 parent_id         = 1,1,2,
 parent_grid_ratio = 1,5,5,
 i_parent_start    = 1,38,42,
 j_parent_start    = 1,27,44,
 e_we          = 100,111,151,
 e_sn          = 105,121,221,
 geog_data_res = '30s','30s',metro_manila+30s',
 dx = 7500,
 dy = 7500,
 map_proj =  'mercator',
 ref_lat   = 15.474,
 ref_lon   = 121.125,
 truelat1  = 15.474,
 truelat2  = 0,
 stand_lon = 121.125,
 geog_data_path = '/home/gil/WRF/WPS_GEOG',
 opt_geogrid_tbl_path = '/home/gil/WRF/WPS4.0/geogrid/',
 ref_x = 50.0,
 ref_y = 52.5,
/

&ungrib
 out_format = 'WPS',
 prefix = 'FILE',
/

&metgrid
 fg_name = 'FILE',
 io_form_metgrid = 2,
 opt_output_from_metgrid_path = '/home/gil/WRF/Test/SLUCM/',
 opt_metgrid_tbl_path = '/home/gil/WRF/Test/SLUCM/',
/

&mod_levs
 press_pa = 201300 , 200100 , 100000 ,
             95000 ,  90000 ,
             85000 ,  80000 ,
             75000 ,  70000 ,
             65000 ,  60000 ,
             55000 ,  50000 ,
             45000 ,  40000 ,
             35000 ,  30000 ,
             25000 ,  20000 ,
             15000 ,  10000 ,
              5000 ,   1000
 /

Geogrid then will show errors like this

Code:
WARNING: In source tile /home/gil/WRF/WPS_GEOG/metro_manila/00001-03199.00001-01200, point (748, 214) has an invalid category of 17
WARNING: In source tile /home/gil/WRF/WPS_GEOG/metro_manila/00001-03199.00001-01200, point (749, 213) has an invalid category of 17
WARNING: In source tile /home/gil/WRF/WPS_GEOG/metro_manila/00001-03199.00001-01200, point (749, 214) has an invalid category of 17
WARNING: In source tile /home/gil/WRF/WPS_GEOG/metro_manila/00001-03199.00001-01200, point (750, 213) has an invalid category of 17
WARNING: In source tile /home/gil/WRF/WPS_GEOG/metro_manila/00001-03199.00001-01200, point (750, 214) has an invalid category of 17
WARNING: In source tile /home/gil/WRF/WPS_GEOG/metro_manila/00001-03199.00001-01200, point (739, 215) has an invalid category of 17
WARNING: In source tile /home/gil/WRF/WPS_GEOG/metro_manila/00001-03199.00001-01200, point (740, 215) has an invalid category of 17
WARNING: In source tile /home/gil/WRF/WPS_GEOG/metro_manila/00001-03199.00001-01200, point (741, 215) has an invalid category of 17

Looking at the domain was located inside updated land use map, so I was wondering what seems to be the problem. I am attaching all relevant files. Thanks for the help.
 

Attachments

  • metro_manila.zip
    180 KB · Views: 76
  • GEOGRID.TBL
    15.5 KB · Views: 78
  • namelist.wps
    1.8 KB · Views: 71
  • geogrid.log
    1.6 MB · Views: 58
  • metromanila.JPG
    metromanila.JPG
    50.4 KB · Views: 1,757
You may just need to add the 'category_min' and 'category_max' keywords to your 'index' file, e.g.,
Code:
category_min=1
category_max=21
These options are required for categorical datasets, and they have no default value. We probably should add a check for these in geogrid so that we can print a more user-friendly message if they are not present.
 
Hi mgduda. Thank you for your response. I am encountering a new problem. Is it possible to replace the default usgs/modis with a recent one? For example, I am planning to use a 2018 modis landcover(reclassified to usgs classification) for my priority=1 in the geogrid.tbl encompassing the domains as seen in the picture I previously attached and update the urban area to the 3 urban classification? I tried doing it, but when I run geogrid memory cannot be allocated shows up.
 
Just to make sure I understand, are you trying to use the data from the "metro_manila.zip" file that you previously attached when you get the memory allocation error, or is this a different dataset?
 
Yes, it's from the zip file. I plan on replacing the default usgs/modis land use. I will use the what's in the zip file as my base landuse so as to update it to a more recent one, after which I plan on updating the urban category to cat 31,32, and 33 from another data set.
 
I was able to successfully use your namelist.wps file, your GEOGRID.TBL file, and your metro_manila data (after adding category_min and category_max to the index file) with geogrid v4.1. Which version of the WPS are you using, and which compilers and compiler versions have you used when building the code? Can you attach your geogrid.log and a capture of the stdout and stderr streams when geogrid is failing with a memory allocation error?
 
Hi. Thank you for the assistance. I figured out the reason for error and was able to solve this one out. Thanks again
 
It's good to hear you were able to resolve the issue. If you don't mind (and for the benefit of anyone else following this discussion), what was the source of the error?
 
I tried doing the run again. I transformed the 2018 MODIS data to USGS category. Originally, I had the two tiles, downloaded from modis, merged and then converted to a binary file which was kind of big. Probably the reason why memory issue happened(?). What I did was, create two binary files, each for downloaded tiles, updated the index and geogrid.tbl and run geogrid again. Upon checking, the geogrid output and actual data seems to match. Also, I made a mistake in naming the binary file which might have contributed to the error.
 
Thanks very much for the update. I think your assessment that the single, large tile of data may have lead to the memory allocation error may be right. The geogrid program reads only whole tiles of data, and for high-resolution datasets or datasets with global coverage, we've tiled the data to limit the amount of memory that geogrid allocates at any given time.
 
Top