Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using urbparm_lcz.tbl with old 3 urban classes. Set use_wudapt_lcz=0 #125

Closed
VladimirSobral opened this issue Dec 29, 2023 · 18 comments
Closed

Comments

@VladimirSobral
Copy link

Describe your issue

Hi @matthiasdemuzere

Could you help me with this bug?
After use w2w, I have this message running wrf.exe: USING URBPARM_LCZ.TBL WITH OLD 3 URBAN CLASSES. SET USE_WUDAPT_LCZ=0
I supposed that the w2w output is correct (please see the attached figure - there are 39 classes because the region doesn't have classes 1 and 11). ). I can't find a solution on WRF forum or similar.
I also attached the namelist.input and a screenshot of the wrf.

Image
namelist.txt
Captura de tela de 2023-12-29 16-22-18

Cheers,
Vladimir

w2w --version

w2w 0.5.0

nc-config --all

This netCDF 4.9.0 has been built with the following features: 

  --cc            -> gcc
  --cflags        -> -I/home/juliao/libs/netcdf/include -I/home/juliao/libs/include -I/home/juliao/libs/netcdf/include -I/home/juliao/libs/grib2/include
  --libs          -> -L/home/juliao/libs/netcdf/lib -lnetcdf
  --static        -> -lm -lsz -lcurl -lnetcdf -lhdf5_hl -lhdf5 -lz

  --has-c++       -> no
  --cxx           -> 

  --has-c++4      -> no
  --cxx4          -> 

  --has-fortran   -> yes
  --fc            -> gfortran
  --fflags        -> -I/home/juliao/libs/netcdf/include -I/home/juliao/libs/netcdf/include
  --flibs         -> -L/home/juliao/libs/netcdf/lib -lnetcdff -L/home/juliao/libs/lib -L/home/juliao/libs/netcdf/lib -L/home/juliao/libs/grib2/lib -lnetcdf -lm -lnetcdf -lhdf5_hl -lhdf5 -lz
  --has-f90       -> 
  --has-f03       -> yes

  --has-dap       -> no
  --has-dap2      -> no
  --has-dap4      -> no
  --has-nc2       -> yes
  --has-nc4       -> yes
  --has-hdf5      -> yes
  --has-hdf4      -> no
  --has-logging   -> no
  --has-pnetcdf   -> no
  --has-szlib     -> yes
  --has-cdf5      -> yes
  --has-parallel4 -> no
  --has-parallel  -> no
  --has-nczarr    -> yes
  --has-zstd      -> no
  --has-benchmarks -> no

  --prefix        -> /home/juliao/libs/netcdf
  --includedir    -> /home/juliao/libs/netcdf/include
  --libdir        -> /home/juliao/libs/netcdf/lib
  --version       -> netCDF 4.9.0

Installed Packages

.

Traceback

No response

@VladimirSobral VladimirSobral changed the title USING URBPARM_LCZ.TBL WITH OLD 3 URBAN CLASSES. SET USE_WUDAPT_LCZ=0 Using urbparm_lcz.tbl with old 3 urban classes. Set use_wudapt_lcz=0 Dec 29, 2023
@matthiasdemuzere
Copy link
Owner

Hi @VladimirSobral,

Thanks for reaching out.

What WRF/WPS version are you using? I wonder whether this error message has to do with the change in LCZ class numbers in the latest releases? @andreazonato?

@VladimirSobral
Copy link
Author

Hi @matthiasdemuzere,

I'm using WRF 4.5.2 and WPS 4.5.
Please, let me update you on my last trial.
I have used CGLC-MODIS-LCZ dataset in WRF. With this dataset, Wrf runs successfully.
Do you think I could find better results using w2w compared to CGLC-MODIS-LCZ?
The purpose of my research is to evaluate outdoor thermal comfort at a local scale.

Cheers,
Vladimir

@matthiasdemuzere
Copy link
Owner

I see.

Ok, so this version of WRF expects the LCZ classes to be numbered 50-61, consistent with the CGLC-MODIS-LCZ dataset. So good to hear that this works.

But ... as far as I know the full integration of W2W in WPS/WRF is not finished yet? Is this correct @andreazonato?

The CGLC-MODIS-LCZ data is based on the global LCZ map. So if you use this map in W2W, the urban areas should be more or less the same. What might differ are the natural areas, that are based on CGLC data or the default MODIS data.
Though I believe that the CGLC-MODIS-LCZ data contains the most up to date information.

Also, the treatment of LCZ-based urban canopy parameters should be improved in the latest WRF releases compared to what I developed for W2W. But again here, I am not sure if these developments are already available ...

@andreazonato
Copy link
Collaborator

Hello everyone,

Yes @matthiasdemuzere, now the 4.5* version uses 50-61 LCZ instead of 30-41, in order to avoid the overlapping with NLCD landuse categories.

So, @VladimirSobral you have 2 possibilities

  1. To employ W2W, and shift all the categories of 20, and modify num_land_cat accordingly
  2. as Matthias is suggesting using the CGLC-MODIS-LCZ data, present now in the geog static data.

I have a WRF-integrated version of W2W right now. However, since it takes some time to release this in the new WRF version, it may takes some month to have it publicly available

Andrea

@VladimirSobral
Copy link
Author

Hi everyone,

Thank you so much @matthiasdemuzere and @andreazonato for the information.
So I find that CGLC-MODIS-LCZ data can be suitable for my study.
When the WRF-integrated version of W2W is publicly available, I can test it too.

Vladimir

@wefoust
Copy link

wefoust commented Jan 11, 2024

Hello everyone,
I have a similar issue as Vladimir, where I am attempting to use W2W with WRF 4.5.X and the land cover categories have shifted. As mentioned by @andreazonato, I have attempted to manually shift the data with NCO tools. I can change LU_INDEX values appropriately, but I've spent an embarrassing amount of time trying to convert LANDUSEF values with no success. The trouble exists because LANDUSEF is a variable, and I need to change land_cat values which is a dimension of LANDUSEF.

Since I am not familiar with doing this, I am curious to know if anyone has done this before or has some recommended steps to take in addition to what @andreazonato posted. I am not tied to any particular library (xarray was also attempted) so any suggestion is welcome.

Lastly, I apologize in advance if this is not the appropriate place to post, but I could not find a better area.

(For reference: this is the most basic iteration of the command I have been using, and I've made many attempts surrounding this:
ncap2 -O -s 'where (LU_INDEX==31) LU_INDEX=51' geo_em.d03.nc geo_em.d03.nc)

~Eliott

@matthiasdemuzere
Copy link
Owner

matthiasdemuzere commented Jan 15, 2024

Hi @wefoust,

The only thing you need to do is to change the LCZ class values in LU_INDEX. There is no need to change any of the other parameters.

Changing the LCZ class values in LU_INDEX can be done with the following code snippet:

import xarray as xr
import os

ds = xr.open_dataset('./geo_em.d04_LCZ_params.nc')
print(ds['LU_INDEX'].max())
ds['LU_INDEX'] = ds['LU_INDEX'].where(ds['LU_INDEX'] <= 30, ds['LU_INDEX'] + 20)
print(ds['LU_INDEX'].max())
ds.to_netcdf('./geo_em.d04_LCZ_params_UPDATED.nc')

You probably also have to change the number of land catagories, from 41 to 61?

ds.attrs['NUM_LAND_CAT'] = 61

I hope this helps.

@andreazonato
Copy link
Collaborator

Hi @wefoust
Actually, LANDUSEF is not used by WRF.
You should modify LU_INDEX and IVGTYP (AND NUM_LAND_CAT=61 to make them readable by WRF

Andrea

@wefoust
Copy link

wefoust commented Jan 26, 2024

Thank you all! I was surprised how I got stuck on this. Xarray turned out to be a great tool to do this, and that helped me convert the LANDUSEF variable is well (Needed to maintain consistency as I pass files along to others)

@ss0293
Copy link

ss0293 commented Feb 15, 2024

Hi @wefoust are you able to solve the problem, I am using the 4.5.1 version WRF and got the same problem (able to run metgrid, real.exe but fails at wrf.exe), then I changed the LCZ class values in LU_INDEX (as suggested by @matthiasdemuzere but now I got a problem in metgrid.exe), any suggestions??

@dargueso
Copy link
Collaborator

dargueso commented Mar 15, 2024

Yes, I also have this issue (v4.5.1), even if the geo_em has 61 categories. I'm investigating what may be the problem.

@dargueso
Copy link
Collaborator

In my case, this error pops up when using the NoUrban file and may be related to this bug wrf-model/WRF#1878. Was this fix in 4.5.2 @andreazonato? I will try with that version...

The geo_em.d0?.LCZ_params.nc file doesn't work either, but the error message is more cryptic and produces a memory issue (?)

@andreazonato
Copy link
Collaborator

Hi @dargueso ,

I do not think the NoUrban file should be the problem. The params too is strange! What are the errors?

@dargueso
Copy link
Collaborator

My setup is a large domain and then two identical domains focused on a city, one with urban areas and the other without. That's why I thought the NoUrban file could be the problem, but I'm not sure. Still looking at it.
The LCZ_params doesn't work either because GREENFRAC is NaN in all urban areas, and WRF crashes. This is probably related to #127 (comment), but I need to check too.

@dargueso
Copy link
Collaborator

Could it be related to the bug above (wrf-model/WRF#1878)? Because using only the NoUrb and setting:
USE_WUDAPT_LCZ = 1
I get:

-------------- FATAL CALLED ---------------
USING URBPARM_LCZ.TBL WITH OLD 3 URBAN CLASSES. SET USE_WUDAPT_LCZ=0
-------------------------------------------

and setting it to:
USE_WUDAPT_LCZ = 0

I get:

-------------- FATAL CALLED ---------------
USING 10 WUDAPT LCZ WITHOUT URBPARM_LCZ.TBL. SET USE_WUDAPT_LCZ=1
-------------------------------------------

@dargueso
Copy link
Collaborator

dargueso commented Mar 22, 2024

Hi @wefoust Actually, LANDUSEF is not used by WRF. You should modify LU_INDEX and IVGTYP (AND NUM_LAND_CAT=61 to make them readable by WRF

Andrea

Not at all @andreazonato? I'm trying to implement the option of having different LCZs in the input (geo_em) and when running WRF, it reverts LU_INDEX to 13, despite the fact that the met_em files have LCZs. I've been ignoring LANDUSEF based on this comment but I suspect that real.exe is actually using LANDUSEF to set LU_INDEX in the wrfinput files.

@andreazonato
Copy link
Collaborator

No, it doesn't use LANDUSEF. It is used just for tiling NOAH in case you use the MOSAIC approach.

BUT it is the variable I'm using in WRF to use LCZ from geo em, ad it is the one you should use to employ LCZ from geo em (it brings the subgrid information, i.e. the percentage of every landuse classes on every grid cell)

Hope I explained pretty clear

Andrea

@dargueso
Copy link
Collaborator

OK, I've updated the code to define LANDUSEF based on LCZ categories, so WRF doesn't revert LU_INDEX to 13. See #127.
I've tested it and it works fine - at least it doesn't complain anymore.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants