A WUDAPT-to-WRF python tool that translates WUDAPT's Local Climate Zone information into WRF.
- This is a beta version of the tool, that is currently still being tested. So please use with caution, and file an issue in case something does not work for you.
- The outputs of this tool have only been tested with the most recent WRF version 4.3.x. So we advise you to work with this version as well, which is now able to ingest the urban LCZ classes by default.
An important objective of WUDAPT, the World Urban Database and Acces Portals Tools community project, is to generate urban canopy information and provide the (open-source) tools to facilitate urban-focused modelling studies (Ching et al., 2018).
Since the work of Brousse et al. (2016), the level-0 WUDAPT information, the Local Climate Zone maps, have been used increasingly in WRF, the community “Weather Research and Forecasting” model. Their original guide and code on how to use WUDAPT information into WRF (originally designed for WRF v3.2) is available here. Note that this tool was first assigning the LCZ mode to each WRF grid cell, and only afterwards assigning corresponding morphological, radiative and thermal properties to this modal LCZ class. This is done differently in w2w, see below.
As of spring 2021, WRF v4.3.x is able to ingest LCZ information by default (previous versions required manual WRF code changes by the user). See more details on "Updates of WRF-urban in WRF 4.3: Local Climate Zones, Mitigation Strategies, building materials permeability and new buildings drag coefficient" here. Because of this, we decided to simultaneously built an improved WUDAPT-to-WRF routine, to make the translation of LCZ-based parameters better and more simple. As before, the LCZ-based urban canopy parameters generally follow the values provided by Stewart and Oke (2012) and Stewart et al. (2014).
The procedure in this new w2w
tool is different from the former tool. Morphological parameters are assigned directly to the high-resolution LCZ map, and only afterwards aggregated to the WRF grid. In this way, the method produces a unique value of the different urban morphology parameters for each model cell. This was found to be more efficient in reproducing urban boundary layer features, especially in the outskirts of the city (Zonato et al., 2020), and is in line with the WUDAPT-to-COSMO routine (Varentsov et al., 2020). Other radiative and thermal parameters are for now still assigned to the modal LCZ class. More details on the procedure and its assumptions will soon be available here.
Create a virtual python environment, for example with anaconda:
- If you do not have anaconda on your system yet, please install it first (information here). This repository has been tested with python 3.8.
- Clone the w2w repository in your folder of choice, and enter it:
> git clone https://github.com/matthiasdemuzere/w2w.git
> cd w2w
- Then, create the virtual environment from within this repository:
> conda env create -f w2w.yml
- Activate this new environment:
> conda activate w2w
-
A geo_em.d0X.nc file (produced by WRF's WPS geoegrid.exe), for the inner WRF model domain in which you would like to use the LCZ-based information.
-
A Local Climate Zone map (lcz.tif) that is slightly bigger than the domain of the geo_em.d0X.nc file. There are a number of ways to obtain an LCZ map for your region of interest:
- Extract your domain from the continental-scale LCZ maps for Europe (Demuzere et al., 2019) or the United States (Demuzere et al., 2020). For more information, see here. Make sure you use the version ending with _epsg4326.tif.
- Check if your region of interest is already covered by the many LCZ maps available in the LCZ Generator submission table.
- Use the LCZ Generator to make an LCZ map for your region of interest. In case the geo_em.d0X.nc domain is larger than ~ 2.5 x 2.5°, the LCZ Generator will fail. In that case, please contact Matthias Demuzere for support.
Important notes:
- Also the geo_em.d0[0 to X].nc file(s) of the parent domain(s) should be available in the same INPUT_DIRECTORY. This is needed because the
w2w.py
routine will check whetherNUM_LAND_CAT
is set to 41 in all these parent domain files. If that is not the case, this will be fixed. - Your LCZ .tif and geo_em*.d0X.nc files should live in the same directory.
- Also, this directory should be writeable by the user.
- In case you use an LCZ map produced by the LCZ Generator, make sure to use
-lcz_band 1
. As such, the best-quality gaussian filtered LCZ map will be used in the process (see Demuzere et al. (2021) for more info).
- Check out its help:
python w2w.py -h
- Try with the provided sample:
python w2w.py ./sample_data lcz_zaragoza.tif geo_em.d04.nc
- Deploy using your own data:
python w2w.py INPUT_DIRECTORY YOUR_LCZ.TIF YOUR_GEO_EM.d0X.NC
The project is licensed under the MIT license.
Not available yet.
Contributions to w2w
are welcome! This is how:
-
Bugs: If you find a bug, please report it by opening an issue. if possible, please attach the error, code, version, and other details.
-
Fixing Issues: If you want to contributte by fixing an issue, please check the issues: contributions are welcome for open issues with labels :code:
bug
and :code:help wanted
. -
Enhancement: New features and modules are welcome! You can check the issues: contributions are welcome for open issues with labels :code:
enhancement
and :code:help wanted
.
- Matthias Demuzere: Lead developer
- Daniel Argueso: WRF expert
- Andrea Zonato: WUDAPT-WRF expert and liaison
- We appreciate the feedback and suggestions provided by Alberto Martilli and Oscar Brousse, lead developers of the original Wudapt-to-wrf fortran package.
- Thanks to Alberto Martilli and Alejandro Rodriguez Sanchez for allowing us to use of their Zaragoza case-study files as sample data.