Error in vertical velocity and meteorological variables along the trajectory

Topics about the HYSPLIT trajectory model.
Post Reply
midhun
Posts: 8
Joined: April 11th, 2016, 9:37 pm
Registered HYSPLIT User: Yes

Error in vertical velocity and meteorological variables along the trajectory

Post by midhun »

Hi

I was trying to run Hyspit using output from a GCM. I used MeteoInfoLab to convert model data into arl format. I found few issues with the simulated trajectory

1) Trajectory doesn't show proper vertical motion when I used GCM vertical velocity (vertical velocity option =0). When I used divergent field to calculate vertical motion, trajectory show good vertical movements.

2) Hysplit interpolated Relative humidity and Specific humidity are really different from its actual input values

Please help me to diagnose this issue.

Model data
https://jumpshare.com/v/ODUaOkPDbcYFZ07JaSfX

Arl formatted data
http://jmp.sh/udrtQpq

Script used for converting model to ARL
http://jmp.sh/p1oVTbT
Attachments
tdump_divg_w.txt
vertical velocity is calculated using divergence
(16.49 KiB) Downloaded 199 times
tdump_model_w.txt
vertical velocity is taken from model data
(16.49 KiB) Downloaded 217 times
trajplot_model_w.ps
vertical velocity is taken from model data
(147.06 KiB) Downloaded 203 times
Fantine
Posts: 150
Joined: November 8th, 2012, 3:41 pm

Re: Error in vertical velocity and meteorological variables along the trajectory

Post by Fantine »

It looks like the vertical component of wind is very small (or maybe even constant) in the GCM data you used for the trajectory calculation. Please check that variable in both the GCM file (a variable name like "W") and ARL format file (should be "WWND"). You can do plots and compare them. If they are consistent, you may consider to let HYSPLIT to re-diagnose the vertical motion using horizontal winds. If not, there may be an error in the conversion program, probably unit issue.

HYSPLIT does the interpolation between two data points (temporal and spatial) to get required variables at the location where the calculation takes place. It is still based on the input met data you provided. Can you elaborate what is your question #2?
yaqiang
Posts: 59
Joined: October 5th, 2015, 10:20 pm
Registered HYSPLIT User: Yes

Re: Error in vertical velocity and meteorological variables along the trajectory

Post by yaqiang »

In this case vertical levels are in normal order, so you don't need to reverse them.

Revised script:

Code: Select all

#---- Set data folder
datadir = 'E:/Temp'
#---- Set output data file
outfn = os.path.join(datadir, 'test_grib.arl')
#if os.path.exists(outfn):
#    os.remove(outfn)
#---- Read a GRIB data file
infn = os.path.join(datadir, 'pgb.nc')
print infn
inf = addfile(infn)
print 'Input data file has been opened...'
#---- Set output ARL data file
arlf = addfile(outfn, 'c', dtype='arl')
#---- Set variable and level list
gvar2d = ['pressfc','tmp2m','ugrd10m','vgrd10m','pratesfc']
gvar3d = ['hgtprs','tmpprs','vvelprs','ugrdprs','vgrdprs','rhprs','spfhprs']
avar2d = ['PRSS','T02M','U10M','V10M','TPP6']
avar3d = ['HGTS','TEMP','WWND','UWND','VWND','RELH','SPHU']
gv = inf['hgtprs']
nx = gv.dimlen(gv.ndim - 1)
ny = gv.dimlen(gv.ndim - 2)
#levels = gv.dimvalue(gv.ndim - 3)[::-1]
levels = gv.dimvalue(gv.ndim - 3)
nz = len(levels)
arlf.setlevels(levels)
arlf.set2dvar(avar2d)
for l in levels:
    arlf.set3dvar(avar3d)

#---- Write ARL data file
arlf.setx(gv.dimvalue(gv.ndim - 1))
arlf.sety(gv.dimvalue(gv.ndim - 2))
tNum = inf.timenum()
fhour = 0
for t in range(0, tNum):
    print 'Time index: ' + str(t)
    atime = inf.gettime(t)
    print atime.strftime('%Y-%m-%d %H:00')
    dhead = arlf.getdatahead(inf.proj, 'XXYY', 2, fhour)
    #Pre-write index record without checksum - will be over-write latter
    arlf.writeindexrec(atime, dhead)
    #Checksum list
    ksumlist = []
    # Write 2d variables
    ksums = []
    for avname,gvname in zip(avar2d, gvar2d):
        print avname + ' ' + gvname
        gdata = inf[gvname][t,:,:]
        if avname == 'PRSS':
            gdata = gdata * 0.01
        if avname == 'TPP6':
            gdata=gdata * 60 * 60 * 6 * 0.001
        ksum = arlf.writedatarec(atime, 0, avname, fhour, 99, gdata)
        ksums.append(ksum)
    ksumlist.append(ksums)
    # Write 3d variables
    for lidx in range(0, nz):
        ksums = []
        #llidx = nz - lidx - 1
        print lidx
        #print llidx
        for avname,gvname in zip(avar3d, gvar3d):
            print avname + ' ' + gvname
            #gdata = inf[gvname][t,llidx,:,:]
            gdata = inf[gvname][t,lidx,:,:]
            if avname == 'WWND':
              gdata = gdata * 0.01
            if avname == 'SPHU':
              gdata = gdata * 1000.
            ksum = arlf.writedatarec(atime, lidx + 1, avname, fhour, 99, gdata)
            ksums.append(ksum)
        ksumlist.append(ksums)
    #Re-write index record with checksum
    arlf.writeindexrec(atime, dhead, ksumlist)
    fhour += 1
arlf.close()
print 'Finished!'
Post Reply

Return to “Trajectory Model”