igfuw / UWLCM

University of Warsaw Lagrangian Cloud Model
GNU General Public License v3.0
6 stars 13 forks source link

Add an option to continue simulation from saved snapshot #89

Open pdziekan opened 4 years ago

pdziekan commented 4 years ago

Snapshots would be huge, though.

trontrytel commented 4 years ago

It would be awesome to have that. Do you think it would be much different than what you wrote for the piggybacker? We are reading in the velocities and scalars there anyhow?

trontrytel commented 4 years ago

Also, for the bulk schemes we wouldn't need to save that much? If you tell me how to start I could try adding that

pdziekan commented 4 years ago

Right, with bulk microphysics snapshots would not bo so large.

With bulk, all variables are stored as blitz arrays, so IO to file can be done the same way as for velocity fields in piggybacking. You simply open a text file and use << for output and >> for input.

It would be much better to store snapshots in binary files (hdf5), but that would take some more effort.

How this could be implemented (from the top of my head, probably missing a lot of details): Each snapshot should contain the following arrays: u, v (only in 3D), w, th, rv, rc, rr and simulation time.

When running from the snapshot, the arrays should be read after "intcond" method of the case class has been called. Also, timestep should be set to the one from the snapshot.

trontrytel commented 4 years ago

Thanks!. I'll work on it