Atmosphere Modeling

Joined
Jun 19, 2005
Messages
884
Location
New Mexico
Hello,

Since the chase "season" for me is over, I have started to get a little "restless". I've been recently thinking, perhaps trying my hand at making a weather model from the ground up would be an interesting, and I certainly admit likely an impossible feat. While this enthusiasm will probably fizzle (hope not), I started anyways. To keep it simple I decided to start very simple, 1D and isothermal, eventually increasing its complications. While this is certainly not extremely note worthy, I was at least happy with my first day of progress. The resulting images are a run of an environment with a “step” in pressure and no initial wind in MATLAB. The scale is not set, however they can be added. I made it a box, so further timesteps cause the pressure wave to reflect off the “wall”.

pressure vs distance
density1qz9.jpg


wind speed vs distance
wind1sv5.jpg




later pressure vs distance
density7pm1.jpg




later wind speed vs distance
wind7xr9.jpg




Note the noise I believe is created because the environment has been “binned” up.



Anyhow, I was wondering if anyone know who might have some background in this area? I was thinking, for me, since I am not a meteorologist, moisture transport is a big unknown to me, and it might be helpful if I could gain insight from someone who knows about it (mathematically).

Either way this hopefully will at least be an exercise that will help me shore up some unknowns in the physics of weather for me.
 
Last edited by a moderator:
Just to give an update, I'm about 600 lines of MATLAB coding in and trying to make a 3d model, at least going to be several more hundred lines. Those darn boundary conditions are the worst. I'm worried that if I can allow mass to leave, which I am allowing, that there won't be anything to stop it from leaving. There are several other concerns too. I've found surface heating to be quite tricky, and am not sure how to deal with it. Was thinking of several approaches and am going to try two different variations. Still haven't thought of adding radiation, think I'll hold off until I have a model and a few runs with out it. Naturally, computation time is a concern. Most likely this will not be a forecasting tool that I'm making, because I don't think it'll be able to keep up with the present on the size scales I'm aming for. Either way this certainly helps to clear up some knowledge about meteorology.
 
I bet this is a very in-depth, but rewarding project you have going here. Can't wait to see how things go when you get finished. Good luck with the project!
 
I finally finished my first 3-d model. I'll post later images of some runs. Right now I'm trying to figure my time step sizes, and I need to work on creating some initial condition "cubes". I ended up having the time step to small for one run, and I think I had a pressure or density go negative, which then messed up everything cause things started going imaginary when they got squarerooted.
 
Have you thought about coding some of this in C/FORTRAN and using the mex-interface to speed up the computation time (if you know those languages)? They are very helpful when you have looped code, which is a virtual certainty in a case like this. Having the PDE toolbox may also be of some benefit.

When I was in graduate school, I used MATLAB to generate a 1-D bin microphysics model for some of my research, and I use it daily at work. If you are having any problems, feel free to PM or email me. Best of luck to you.
 
Thanks for the suggestion. I had thought about using C to help speed up computation time, however I'm just starting to learn C. So, until I get to a point where I must increase speed this should suffice.

With regards to computation time, an itteration presently takes ~0.2 seconds with one million boxes (not bad with a computer I bought from staples). I'm trying different methods to figure out how perhaps best do deal with time steping. I'm starting to think that I may not always need the same time step for each itteration. I feel I probably can make the time step dependent on the present itteration's wind speeds. Thus a timestep could probably be larger when the wind speed is low.
 
So I said I'd put up an image soon. I know it took a little longer but that's because I've been having some "issues". Within the modeled atmosphere there has been some feed back issues (i guess that's what I'd call them) that has been amplifying the wind speeds. Eventually it cause the simulation to go haywire, not that this is even close to realistic right now (at least with respect to the initial conditions). Well here it is...

This is the start of an updraft from a converging wind boundary. Interestingly the cloud seems to trail the updraft of winds. I haven't provided an image of this because, the image is even more abstract, because it shows locations of active condensation, not where the actual condensation is.
updraft2km3.jpg


redder colors indicate motion upward, axes east and upward... (and each pixel is ~100m)

The arrows show how the wind is converging. Anyhow, I believe these "issues" may be resolved by putting in turbulent diffusion (after many nights of pulling my hair that's my present conclusion). Hopefully that will get me to something better.

Also, sadly, this is not a future forecasting tool, atleast with my computational resources. It lags greatly behind the rate at which time progresses, so much so that I don't think programing in C would help either.

Another fun note, any much bigger I end up using my whole 4gigs of ram! I've never had that problem before...
 
Last edited by a moderator:
So turbulent diffusion wasn't my problem... After talking to someone who knows something about modeling, I apparently came across what is called computational instability. I had actually already taken some suggested steps to counter the issue, however I was given a few more suggestions. One idea, from the reading of some notes, would be to take multiple timesteps to compute a future timestep (may have not said that exactly right)... I guess a second order derivative with respect to time.
Haven't added that in yet, since that would require a large revamp of the code. However, I realized some of my steps to counter this needed some correcting. Currently doing a run, so I'll see in a few hours, if I'll have to do the complete revamp of the code...
 
I have a few ideas on how to deal with computational instability, but does anyone here have any knowledge on dealing with it? I would like to ask a few questions to, and bounce a few ideas off you if you do...
 
Still working on the model, here is the latest image...
uoutgp4.jpg


This is an image of east-west wind with a high altitude wind, and below is the resulting "waves" from a converging boundary, still with 100m box sizes.

In the top right you can see some model instabilities beginning to form. After reading apparently they grow at a rate of a^b^t w/ a>1 & b>1. This is a stronger function than e^t! Waiting on book from the library that may have some descriptions of how to damp out these problems. They're still developing despite an attempt to vary time stepping and include some 3d smoothing. However, it would still be helpful if anyone here knew anything on modeling atmospheres! If I could bounce a few ideas it would greatly help!
 
Does anyone here have experience with atmospheric model instabilities and/or know someone who does?

Just being able to ask an individual what books to read would help!
 
I'm starting a run right now, and I think this time it's going to work...

I finally figured out how to filter my wind. Those darn fourier transforms always get me (especially in 3d).

Thanks to those who gave some help, some of the references made something click inside...
 
So, I thought it was going to work. The FFT filtering allows the model to run about 3 times longer until the instabilities grow again. That means I can run the simulation about 30s instead of 10s. I've also been having problems with the filter too. The filter, since it isn't perfect, has problems near the boundaries. I have been thinking of trying another method. I was reading about one method that induces a sort of fake diffusion term if the wind field begins to accelerate(could apply to other parameters). I've been avoiding doing this because it requires more memory since I must save 3 time steps to calculate if a parameter is accelerating. I've already been having a memory crunch with my RAM. Thoughts on dealing with computational instabilities?
 
Last edited by a moderator:
Back
Top