feeding emisions from spatial and temporal variaying sources

Topics about the HYSPLIT dispersion model.
Post Reply
aragong
Posts: 8
Joined: November 13th, 2020, 9:08 am
Registered HYSPLIT User: Yes
Contact:

feeding emisions from spatial and temporal variaying sources

Post by aragong »

Hello again,

I am trying to link some emissions rates [g/h] as inputs of hysplit. I found 2 possible ways:

1- Through EMITIMES, defining several blocks per hour:
YYYY MM DD HH DURATION(hhhh) #RECORDS
YYYY MM DD HH MM DURATION(hhmm) LAT LON HGT(m) RATE(/h) AREA(m2) HEAT(w)
2021 03 16 09 0001 3
2021 03 16 09 00 0100 41.0 -90.0 10.0 1.0 0.0 0.0
2021 03 16 09 00 0100 42.0 -90.0 10.0 1.0 0.0 0.0
2021 03 16 09 00 0100 43.0 -90.0 10.0 1.0 0.0 0.0
YYYY MM DD HH DURATION(hhhh) #RECORDS
YYYY MM DD HH MM DURATION(hhmm) LAT LON HGT(m) RATE(/h) AREA(m2) HEAT(w)
2021 03 16 10 0001 3
2021 03 16 10 00 0100 44.0 -90.0 10.0 1.0 0.0 0.0
2021 03 16 10 00 0100 45.0 -90.0 10.0 1.0 0.0 0.0
2021 03 16 10 00 0100 46.0 -90.0 10.0 1.0 0.0 0.0
YYYY MM DD HH DURATION(hhhh) #RECORDS
YYYY MM DD HH MM DURATION(hhmm) LAT LON HGT(m) RATE(/h) AREA(m2) HEAT(w)
2021 03 16 11 0001 3
2021 03 16 11 00 0100 47.0 -90.0 10.0 1.0 0.0 0.0
2021 03 16 11 00 0100 48.0 -90.0 10.0 1.0 0.0 0.0
2021 03 16 11 00 0100 49.0 -90.0 10.0 1.0 0.0 0.0
And following the documentation, I found that seems possible to use PARINIT file to feed the model, which seems quite straight-forward but the file is binary and I do not found any ASCII format + conversor to reach that solution. Does anyone know any way to create this file based on external data using python or similar?

Thank you in advance!
alicec
Posts: 283
Joined: February 8th, 2016, 12:56 pm
Registered HYSPLIT User: Yes

Re: feeding emisions from spatial and temporal variaying sources

Post by alicec »

Description of the pardump/parinit file is here.
https://www.ready.noaa.gov/hysplitusersguide/S442.htm

There is python code with a class that can read/write pardump files here in pardump.py.
https://github.com/noaa-oar-arl/monetio ... tio/models
aragong
Posts: 8
Joined: November 13th, 2020, 9:08 am
Registered HYSPLIT User: Yes
Contact:

Re: feeding emisions from spatial and temporal variaying sources

Post by aragong »

Thank you for the link to your python repo! I was busy with others task and I am now resuming these developing... sorry for that!

I am trying to use Pardump with different positions and rates each hour or 30 min in order to set up my emissions. So I am trying to use your .write() method using the option "append binary" - "ab" intesead of your "write binary" - "wb" that I suposse is used only for PARINIT files.
So, I am looping over times to generate a longer file with all my emissions per time. Is that correct isn't it?
I paste the piece of code I am using to a better understanding...

Code: Select all

        for index, time in enumerate(particles["time"].unique()[1:-1]):

            df = particles[particles["time"] == time]
            rate = list(emision_rates.values[index])

            numpar = n_particles
            pmass = rate*n_particles
            lon = df["longitude"].to_list()
            lat = df["latitude"].to_list()
            ht = 1
            pollnum = 1
            sdate = datetime.strptime(time,"%Y-%m-%dT%H:%M:%S")

            pardump = Pardump(fname="PARDUMP")
            pardump.write(numpar, pmass, lon, lat, ht, pollnum, sdate)
Finally, my intention is to select in Hysplit the option "Read file each hour and replace particles" in the advanced concentration menu of "input and output particle files", the model will be feed with these locations and rates at each defined time, isn't it?

Thank you very much for your time and your work! These python codes are very useful for everyone!! have a nice day!
alicec
Posts: 283
Joined: February 8th, 2016, 12:56 pm
Registered HYSPLIT User: Yes

Re: feeding emisions from spatial and temporal variaying sources

Post by alicec »

You should use ninit=2 because you don’t want to remove particles that were added previously.
-----------------------------------------------------------------------------------------
Example.
You want to emit 100 g of mass over 1 hour at a constant rate.
Set the model time step to 5 minutes (DELT=5)

At 05:00 z Emit 100 particles. Mass of each particle is 100 g / (100 particles * 12 time steps/hour) = 0.0833g.

At 05:05z, 05:10z, 05:15z, 05:20z…..05:55z
Also emit 100 particles with 0.0833 g of mass.

Over 1 hour you have emitted 1200 particles with 1200*0.0833g = 100g of mass.
--------------------------------------------------------------------------------------------------
Note that if you are adding particles more frequently than every hour, then you should not use the default variable time step. You should set the model time step (DELT) so that it always coincides with the times in your PARINIT file. If the variable time step is used then some particles in your PARINIT file may not be added because the model only checks to see if they are there at the beginning of a time step.

Yes – currently the python method is designed to only write PARINIT files with one time period. It would be nice to make it more general.
aragong
Posts: 8
Joined: November 13th, 2020, 9:08 am
Registered HYSPLIT User: Yes
Contact:

Re: feeding emisions from spatial and temporal variaying sources

Post by aragong »

Thanks for the clarification, I've finally used the EMITIME file because Is less complex and quite straightforward than use PARDUMP and binary files for my marine-atmosphere application.

I've fed hysplit with the results of my marine model: evolution of the centre of mass of the spill, substance evaporation and spill area and works fine. If I need more precision in the future, I will try to create PARDUMP, but for now, this is more than enough.

I used your EMTITIME method and works perfect, thank you very much for that, it is great and easy to use!
alicec
Posts: 283
Joined: February 8th, 2016, 12:56 pm
Registered HYSPLIT User: Yes

Re: feeding emisions from spatial and temporal variaying sources

Post by alicec »

I'm glad you were able to use the EMITIMES files.
They are designed to be the main way people create complicated emission scenarios.

The pardump files are mostly designed for restarting the model from a previous run and diagnostics.
Post Reply