Conversion Problem

Ideas, problems or suggestions regarding the WRF software.

Conversion Problem

Postby sdegan » Thu Mar 14, 2013 2:03 pm

WRF treats my sulfur dioxide variable as a number density (molecules/m3) in the code, but converts this to a mixing ratio (ppm) before it writes to the NetCDF output. I've tried to convert this ppm value back to molecules/m3, but when I do I'm lower than the actual input.

For example, if I initialize 1 Tg of SO2, I calculate 0.89 Tg in the NetCDF file. The calculations I am doing are correct, I think. In NCL I have

P = a->P ;Grab the pressure
PB = a->PB ;Grab the base pressure
pres = P + PB ;Add to get hPa
TK = wrf_tk(pres,PT) ;NCL function which gets T in K
av = 6.02 * 10^23 ;Avegadro's number
avp = av * pres ;Ave. Num times the pressure
RT = 8.314 * TK ;Real gas constant multiplied by T in K
nair = avp/RT ;nair is equal to the number density of air
so2=so2*nair ;Convert my SO2 array to number density

These equations make sense to me, but give me slightly lower chemistry values than I expect. Does anyone have any ideas how else I could solve this so that I would get the correct mass?
Posts: 8
Joined: Wed Jan 09, 2013 8:17 pm

Return to Software Engineering

Who is online

Users browsing this forum: No registered users and 1 guest