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

How can one know the lowest model level at a specific grid point?

mirabelle

Member
Hi,

I've run WRF for terrain sensitivity experiment, I want to know how to calculate lowest model level (Z1) for specific grid point?
What is the calculation formula?
Can the model directly output this value?
If I modify the terrain height at a specificc grid point without changing the eta_levels layers of the model, will the Z1 be affected?

PLEASE HELP!
 
Using python you could get the desired variable (height, height_agl, ...), using this function: wrf.getvar — wrf-python 1.3.4.1 documentation

Python:
from wrf import (getvar, ll_to_xy)
from netCDF4 import Dataset

#Open the output file (example)
ncfile=Dataset("wrfout_d01_....")

#Define the lat/lon:
latitude = -23 #random
longitude = 43 #random

#Convert the latitude and longitude of the grid point to the X and Y indexes:
X,Y=ll_to_xy(ncfile,latitude,longitude).values

#Then, get the variable at the level z and X,Y grid point coordinate
getvar(ncfile, "height_agl",timeidx=0)[z][X][Y]

For the first level, z = 0
It might need some adjustment, but i think this should help.
 
Hi. I tried it, and the calculated z varies with time. However, theoretically, it seems like it should remain constant.
Using python you could get the desired variable (height, height_agl, ...), using this function: wrf.getvar — wrf-python 1.3.4.1 documentation

Python:
from wrf import (getvar, ll_to_xy)
from netCDF4 import Dataset

#Open the output file (example)
ncfile=Dataset("wrfout_d01_....")

#Define the lat/lon:
latitude = -23 #random
longitude = 43 #random

#Convert the latitude and longitude of the grid point to the X and Y indexes:
X,Y=ll_to_xy(ncfile,latitude,longitude).values

#Then, get the variable at the level z and X,Y grid point coordinate
getvar(ncfile, "height_agl",timeidx=0)[z][X][Y]

For the first level, z = 0
It might need some adjustment, but i think this should help.
 
Hi. I tried it, and the calculated z varies with time. However, theoretically, it seems like it should remain constant.
Is the change in z-values meaningful? I checked with some runs I'm doing and the maximum variation was 3m.

In any case, I'm not sure why this value varies over time.
 
Is the change in z-values meaningful? I checked with some runs I'm doing and the maximum variation was 3m.

In any case, I'm not sure why this value varies over time.
HI
I previously misunderstood; it should vary with time. This is because WRF uses sigma coordinates
 
Top