Create a new variable “dbz” (VAPOR 3.3)

Hello everyone.
I want to add a new variable “dbz” which represents the simulated radar reflectivity.
The python script consists of the following two lines:
import vapor_wrf
dbz = vapor_wrf.DBZ(P,PB,QRAIN,QGRAUP,QSNOW,T,QVAPOR)

However, there was error message as below:
Vapor 3.3.0.
OS: Windows 6.2 (9200)

Failed to calculate variable dbz

Failed to read variable “dbz” at time step (0), and
refinement level (-1) and level-of-detail (-1)
Failed to read region from variable/timestep/level/lod (dbz, 0, -1, -1)
PyRun_String() : Traceback (most recent call last):
File “”, line 1, in
File “C:\Program Files\VAPOR\share\python\vapor_wrf.py”, line 18, in
import vapor
ModuleNotFoundError: No module named ‘vapor’

Can anyone help me with this problem?
Thank you!

Jack

Unfortunately, support for the vapor_wrf module has not yet been added to VAPOR3. There is an open issue for it on GitHub here:

Feel free to comment or upvote. That said, the VAPOR2 vapor_wrf Python module is included with VAPOR3. I was able to get the DBZ code to work with the following change:

diff --git a/share/python/vapor_wrf.py b/share/python/vapor_wrf.py
index b87cf363..d5e9d175 100755
--- a/share/python/vapor_wrf.py
+++ b/share/python/vapor_wrf.py
@@ -14,8 +14,8 @@
        wrf_div_findiff - finite-difference divergence'''
        
 import numpy 
-import vapor_utils
-import vapor
+#import vapor_utils^M
+#import vapor^M
 def CTT(P,PB,T,QCLOUD,QICE):
        '''Calculate cloud-top temperature using WRF variables.
        Calling sequence: VAL=CTT(P,PB,T,QCLOUD,QICE)
@@ -114,11 +114,11 @@ def DBZ(P,PB,QRAIN,QGRAUP,QSNOW,T,QVAPOR,iliqskin=0,ivarint=0):
        QVAPOR = numpy.maximum(QVAPOR,0.0)
        QSNOW = numpy.maximum(QSNOW,0.0)
        QRAIN = numpy.maximum(QRAIN,0.0)
-       if (vapor.VariableExists(vapor.TIMESTEP,"QGRAUP")):
-               QGRAUP = numpy.maximum(QGRAUP,0.0)
-       else:   
+#      if (vapor.VariableExists(vapor.TIMESTEP,"QGRAUP")):
+#              QGRAUP = numpy.maximum(QGRAUP,0.0)
+#      else:  
 #Avoid divide by zero if QGRAUP is not present:
-               QGRAUP = 1.e-30 
+#              QGRAUP = 1.e-30 
        TestT = numpy.less(TK,CELKEL)
        QSNOW = numpy.where(TestT,QRAIN, QSNOW)
        QRAIN = numpy.where(TestT,0.0, QRAIN)