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

get "tk" using wrf_user_getvar

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.


New member
I am using the function "wrf_user_getvar" in NCL to get the variable temperature ("tk"), but I noticed that it will call another .ncl file ($NCARG_ROOT/lib/ncarg/nclscripts/contrib/cd_inv_string.ncl) to calculate it. what I am confused is that in the following scrpits:
if( any( variable .eq. (/"tk","tc"/) ) ) then
;; function wrf_tk needs theta and pressure (Pa) on input and returns temperature in K on return
if(isfilevar(nc_file,"T")) then
T = _get_wrf_var(file_handle,"T",time)
P = _get_wrf_var(file_handle,"P",time)
PB = _get_wrf_var(file_handle,"PB",time)
T = T + 300.
P = P + PB
t = wrf_tk( P , T )
I don't know where this "300 K" comes from. I think 300 K should be the reference temperature. So is it equal to the variable "T00" in wrfout files? But I found the "T00" in my wrfout is 290 K, not 300 K.
Thank you in advance!

p.s. The wrf-chem version I used is v3.6.1.