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

Issues with Single urban canopy model

Kenny_P

New member
Problem:
I ran my WRF simulation with sf_urban_physics =1 and sf_urban_physics =0 and seems to show no difference in T2. I also got no errors,warning, or faults in my rsl file. I am using WRF v4.6.0.

I think the urban canopy model (UCM) is not activating because it does not finds valid urban areas that matches all of the the required conditions (Frc_URB2D, UTYPE, IVGTYP, or some other factor) and only runs the Noah LSM for my domains. My best guess from looking at the modules is that I am missing UTYPE_URB2D or UTYPE, which causes WRF to default to 0 and tells the UCM to not run.

Background:
I am trying to run a Noah LSM with the single urban canopy model with my updated land use data from NLCD 2023 that I created. I am using ERA5 as my meteorological input data.

The updated land use data was created by: downloading NLCD 2023, subsetting NLCD 2023 to be slightly bigger than my domains, remapping the land use scheme to NLCD40, converting it to a binary raster, creating the index file, updating the geogrid table, and successfully ran WPS. I looked at the geogrid files and my LU_INDEX is correct for my study area domains. The table below shows the LULC in my domain and how I reclassed them.

NLCD In my DomainsNCLD40 (WRF)LULC
1121Open Water
2123Developed, Open Space
2224Developed, Low Intensity
2325Developed, Medium Intensity
2426Developed High Intensity
3127Barren Land (Rock/Sand/Clay)
4128Deciduous Forest
4229Evergreen Forest
4330Mixed Forest
5232Shrub/Scrub
7133Grassland/Herbaceous
8137Pasture/Hay
8238Cultivated Crops
9039Woody Wetlands
9540Emergent Herbaceous Wetlands

I am not using NUDAPT44_1KM and urbfrac_NLCD 2011 because the WRF Static Data Download page it said they were optional.

From my understanding not using NUDAPT44_1KM will make the UCM default to the URBPARM.TBL where I can modify the values in that TBL if necessarry. I am not using urbfrac_NLCD 2011 because a FRC_URB2D is produced in Real.exe using the Developed Low (24), medium (25), and high Intensity (26) LU_INDEX grid locations and set those locations as 0.9 for the FRC_URB2D in my wrfinput files (module_initialize_real.F). I created my own FRC_URB2D to test as well, where LU_INDEX 24 = 0.5, LU_INDEX 25 =.90 and LU_INDEX 26 =.95.

I did noticed that there is some old documentation from 2007 talking about NLCD reclassification for the developed low, medium, and high intensity Urban Categories to 31, 32, 33. (https://ral.ucar.edu/sites/default/files/public/product-tool/WRF-LSM-Urban.pdf) I test this reclass method as well.

I also modified my WRF registry by adding and h to the 8th column to output the TS_URB2D, FRC_URB2D, and UTYPE_URB2D to help with diagnostics in my wrfout file.

Overview of what happens currently in my tests
TestWPSRealWRF
1My data with Normal NLCD40 Scheme Land Use
No FRC_URB2D
Creates FRC_URB2D with 0.9 for all urban areas (based on the low, medium and high intensity LU_INDEX). Do not see UTYPE_URB2D. LU_INDEX is unchanged.FRC_URB2D is all 0 now.
TS_URB2D has values but stays static.
UTYPE_URB2D is all 0.
2My data with Normal NLCD40 Scheme Land use
With my FRC_URB2D
I see my FRC_URB2D with values of 0.5, 0.9, and 0.95 I defined.
However I see that it set grid cells to new LU_INDEX class 13 and I know it has something to do to some sort of condition met in module_initialize_real.F. Do not see UTYPE_URB2D.
FRC_URB2D is all 0 now.
TS_URB2D has values but stays static.
UTYPE_URB2D is all 0.
3My data Modified NLCD40 Scheme (Reclassed urban to 31,32,33)
No FRC_URB2D
Creates FRC_URB2D with only 0. Since there is no longer Urban classes in the normal NLCD40 scheme to identify the urban areas. LU_INDEX is unchanged. Do not see UTYPE_URB2D.FRC_URB2D is all 0 now.
TS_URB2D has values but stays static.
UTYPE_URB2D is all 0.
4My data Modified NLCD40 Scheme (Reclassed urban to 31,32,33)
With my FRC_URB2D
I see my FRC_URB2D with values of 0.5, 0.9, and 0.95 I defined.
However I see that it set grid cells to new LU_INDEX class 13 and I know it has something to do to some sort of condition met in module_initialize_real.F. Do not see UTYPE_URB2D.
Crashes.
Warning “FRC_URB2D = 0 BUT IVGTYP IS URBAN”. This is likely due to the reclass of 31,32,33. However I do see UTYPE_URB2D does have values 0,1,2 in wrf out file. Also segmentation faults.

I attached my namelist files. I also attached the rsl.error files for test 1 and 4.

My thoughts:
There might be something wrong with the way I created my FRC_URB2D because it triggers something in Real (module_initialize_real.F) to reclass LU_INDEX 13. I created the FRC_URB2D following the users guide's "NLCD Urban Fraction Field" but this is something I will look more into.

However I feel like the FRC_URB2D created from Real should have been fine to run the UCM in test 1 at least. I think my biggest issue and the thing I least understand is UTYPE_URB2D or UTYPE because I see that in module_physics_init.F that BOTH FRC_URB2d and UTYPE_URB2D need to be present to call/active other processes to run the UCM. I also UTYPE and UTYPE_URB2D required in module_sf_urban.F.

I am unsure about the reclassing of 31,32,33 because of the already existing LU_INDEX, however the FRC_URB2D does outline the correct/valid urban areas. I feel like I might be overlooking something.

After thinking about it more, I think the root of the issue is that 32 and 33 already had a valid LU_INDEX locations, by reclassing the developed low, medium, and high intensity to 31,32,33 causes confusion in WRF because the FRC_URB2D I created only has values for the developed low, medium, and high intensity area inside 31,32,33 causing the “FRC_URB2D = 0 BUT IVGTYP IS URBAN”.

Main Questions:
  • Is reclassing the NLCD Developed Low, Medium, and High intensity to 31,32,33 still required for the UCM?
    • When should this remapping occur if necessary?
  • Is the problem NLCD40? If so what should I do?
  • Where, when, or how is UTYPE_URB2D or UTYPE created?
Thank you for reading and if you have any ideas please let me know.
 

Attachments

  • namelist.input
    4.1 KB · Views: 2
  • namelist.wps
    1.4 KB · Views: 3
  • rsl.error_test1.0000
    2 MB · Views: 3
  • rsl.error_test4.0000
    22 KB · Views: 3
Last edited:
In your namelist.wps, I found the options below:

geog_data_res = 'NLCD_2023+frac2023+default','NLCD_2023+frac2023+default','NLCD_2023+frac2023+default',

Please clarify what is frac2023?
 
In your namelist.wps, I found the options below:

geog_data_res = 'NLCD_2023+frac2023+default','NLCD_2023+frac2023+default','NLCD_2023+frac2023+default',

Please clarify what is frac2023?
frac2023 is the FRC_URB2D binary raster file that I created for the based on the NLCD 2023.
I followed the instructions from the user guide on how to create NLCD Urban Fraction Field. I used the uf converter from: https://www2.mmm.ucar.edu/people/duda/uf/uf.c. I had to slightly tweak the converter because my raster was slightly bigger than 2gb, but I made sure everything looked good. The frac2023 (FRC_URB2D) assigned the Developed Low, medium, and high Intensity to 0.5, 0.9, and 0.95 respectively.

I also uploaded my NLCD_2023+index, frac2023+index, and geogrid.tbl to the nexcloud. The file name is GEOG_FILES.tar and it is currently uploading, but should be available to you when you read this. The NLCD_2023 and frac2023 was made slightly bigger than my domain and does not cover the entire US. Also, in WPS I only used the Mandatory static data.
 
Last edited:
Potentially Useful Information for those trying to use NLCD for the UCM:

In WRF version 4.3 LCZ (Local Climate Zones) were added to the UCM, where it expanded from 3 traditional urban categories (31-33) to 11 LCZ (31-41). You can still use the 3 traditional urban categories 31,32,33 by using “use_wudapt_lcz = 0” (set to 0 by default) in your namelist.input.
In WRF version 4.4.2 the LCZ was updated to 51-61 to avoid overlapping with NLCD land categories of 31~40 causing errors.
In the User Guide Version 4.5 under WRF Namelist Variables for “use_wudapt_lcz” still mentions the 31-33 for the traditional categories and 31-41 for the LCZ categories. I think the user guide might want to update the “use_wudapt_lcz” to reduce potential confusion.
From this information it seem like:

If you are using a WRF version before 4.4.2 you will need to reclass the NLCD Urban Categories to 31, 32, 33 like the documentation says in: https://ral.ucar.edu/sites/default/files/public/product-tool/WRF-LSM-Urban.pdf.
  • Developed, Open Space and Developed, Low Intensity = 31
  • Developed, Medium Intensity = 32
  • Developed, High Intensity = 33
If you are using WRF Version 4.4.2 or newer you need to reclass the NLCD Urban Categories to 51, 52, 53.
  • Developed, Open Space and Developed, Low Intensity = 51
  • Developed, Medium Intensity = 52
  • Developed, High Intensity = 53
 
Last edited:
Issues I am Facing Still
Issue 1 and Resolution:

I reclassed the NLCD Urban categories to 51,52,53 in my land use data and ran WPS and Real with no issues.
However in WRF and I got an error saying:

“FATAL CALLED FROM FILE: <stdin> LINE: 1833
ERROR: LANDUSE OUTSIDE RANGE = 52 AT 28 1 LUN= 40”

The issue come from the “module_physics_init” because the LANDUSE.TBL for NLCD40 only has 40 land use categories, but my data has 51,52,53 for the urban areas for the UCM.

It seems like in WRF version 4.4.2, they forgot to update NLCD40 in the LANDUSE.TBL with additional land use classes for 51-61 (LCZ 1-11) like they did with other land use schemes, which you can see in the GITHUB commit. You can also see that they updated the VEGPARM.TBL for NLCD40 to include 51-61.Bug fix: Update urban LCZ number in parameter tables (#1786) · wrf-model/WRF@61a1bde I updated NLCD40 to include the proper LCZ by matching what was done to the other land use scheme. I reran REAL and WRF and the LANDUSE OUTSIDE OF RANGE error was gone.

I believe what I did was correct, if it was not please let me know. I attached the LANDUSE.TBL inside the zipped file.

Issue 2 Just Mentioning:
The bl_pbl_physics = 5 would not work with sf_sfclay_physics 1,2, or 5, when I tried. The error I got was:

At line 726 of file module_bl_mynn.f90
Fortran runtime error: Array bound mismatch for dimension 1 of array 'sqi' (43/44)

I think sqi has to do something with my e_vert because I have mine set at 44 when I got that error. I increased my e_vert multiple time and I would get the same error saying I was 1 short (For example 44/45 or 49/50). I saw on another thread that the MYNN PBL scheme has been updated with significant changes in WRFV4.6 so it is hard for me to know how to pinpoint this issue. I do not need to use bl_pbl_physics = 5 in my simulation, but I just wanted to mention a potential issue.

UPDATE: Issue 2 was caused by running wrf while being in debug mode.

Issue 3 Unresolved and Need Help:
I tried bl_pbl_physics = 2 with sf_sfclay_physics 2 and I got an error that stopped WRF that said:

At line 1970 of file module_sf_urban.f90
Fortran runtime error: Index '0' of dimension 1 of array 'zr_tbl' below lower bound of 1

I am pretty sure Zr_tbl is based on UTYPE. UTYPE should be 1,2, or 3 to reflect the three urban categories in the URBPARM.TBL. I looked at my WRF out file and saw that my UTYPE_URB does show 0,1,2,3. The UTYPE_URB was created inside WRF. I did not provide an urban fraction field so it should have assign 51,52,53 to the UTYPE 1,2,3. I believe that is why you see this in my rsl.error file”

WARNING, FRC_URB2D = 0 BUT IVGTYP IS URBAN
WARNING, THE URBAN FRACTION WILL BE READ FROM URBPARM.TBL

I attached the namelist.wps, namelist.input, and a rsl file for Issue 3 in the zip file.
I am lost at this point and need some help on how to fix this error, if you have any ideas please let me know.
 

Attachments

  • issues.zip
    12.1 KB · Views: 1
Last edited:
Update:
When I run my UCM with 1 domain instead of 3 it works as intended with no issues now. I see ts_urb values change over time and the FRC_URB2D shows the expected values of 0, 0.5, 0.9, 0.95 in the WRF out file.

But when I try to run 2 domains I get the same error as when I try to run 3 domains. The error happens right at the beginning of the simulation.

At line 1970 of file module_sf_urban.f90
Fortran runtime error: Index '0' of dimension 1 of array 'zr_tbl' below lower bound of 1.

Since the UCM works with 1 domain, I think the input data is correct? So my questions are:
  1. Is there a mistake in my namelist.input that is causing my error when I use nested domains?
  2. OR is there something wrong with a module that is feeding data to the module_sf_urban.f90 or a direct issue in moduel_sf_urban.f90 when using nested domains?
I attached the namelists that I used in the successful 1 domain UCM and examples of the rsl file I see with sucessful and failed runs.
  • In the namelist.wps the NLCD_2023_UCM is my NLCD 2023 that I reclassed to NLCD40 and I reclassed the urban Developed, Open Space and Developed, Low Intensity = 51, Developed, Medium Intensity = 52, and Developed, High Intensity = 53.
  • For Real.exe I used my updated LANDUSE.TBL I mentioned in my last post.
 

Attachments

  • namelist.wps
    963 bytes · Views: 1
  • namelist.input
    4.1 KB · Views: 3
  • rsl.Sucess.0000
    169.7 KB · Views: 2
  • rsl.fail.0000
    103.4 KB · Views: 1
Last edited:
Top