Jump to content

[1.8x - 1.11x] Kerbal Weather Project (KWP) v1.0.0


cmet24
 Share

Recommended Posts

On 1/30/2022 at 10:36 AM, cmet24 said:

@blackrack Excellent questions!

  • Your correct. Currently, the API is set up to request point data. I honestly have little knowledge of rendering textures in KSP. That said, I do think it would be possible to pass a 2D array  (with a timestamp) containing cloud cover data for the entire planet. The issue is that the GIF showed in the first post was produced from the full MPAS simulation. The climatological data used in the mod was averaged by hour (across 5-years of data) so that it could be loaded during gameplay.  Taking a look at the MPAS cloud cover data it appears that a full year (2557 hours) of data at 1 x 1 deg resolution (~24 km on Kerbin) is around 633 MB. That said, there are ways the data  could be compressed. The horizontal resolution could be halved and the time-series could be sliced to retrieve cloud cover data over a smaller chunk of the year.                                                                                                                                                                                                                              
  • Regarding the simulation. MPAS is a state of the art global climate model for Earth! It was developed by scientists at Los Alamos National Laboratory (COSIM) and the National Center for Atmospheric Research. I got MPAS to work for Kerbin because Kerbin is actually quite similar to earth in terms of atmospheric composition and solar irradiance. Modelling planets whose atmospheric composition differs significantly from Earth's (e.g. Mars, Venus, etc.) is quite tricky because a lot of the assumptions that are made in Earth-based climate models break down big-time! NASA does have a model for simulating the climate of exoplanets and other Solar System terrestrial planets. In my experience, their model is quite difficult to customize. To simulate custom KSP planets there would have to be an easy way to modify the surface terrain within the model.                                                                                                            
  • With respect to model performance, I ran MPAS with half precision. I also choose to output only variables which I found necessary for understanding Kerbin's climate. I used 55 vertical levels to ensure model stability. When your running a numerical weather model with a vertical top of 70-km you need to have quite a few layers to adequately resolve vertical motions and vertically propagating waves. For the MPAS models runs,  perhaps around 1/4 - 1/3 of the RAM was used. This is because numerical weather prediction at coarse resolution (1 x 1 degree) is largely constrained by computation limits (CPU clock speed). When you increase the horizontal resolution of the model that's when your RAM usage goes up! It'd be nice if one could run numerical weather models on a high-end GPUs. Nevertheless, porting millions of lines FORTRAN code to run on modern GPUs remains an ongoing and challenging process. There are a few industry leaders (Nividia/IBM) and quite a few Ph.D. students working on this very problem. Unfortunately, MPAS does not yet have the capability to utilize GPUs.

As an aside, I think the real power of KWP is the framework it provides for incorporating meteorological data into gameplay. One could produce a climatological (4D) dataset for their planet and use KWP's framework to implement that data into the game. The challenge is how to produce that climatology. Modders could design their own or modify existing data from real terrestrial planets. Either way it's not all about realism. For me its really all about having fun with meteorology and KSP! :)

7 hours ago, blackrack said:

Thank you for the complete reply.

There does appear to be a GPU-enabled MPAS branch here but I haven't read into it much to see how much is actually run on the GPU and what the requirements are: https://mpas-dev.github.io/atmosphere/OpenACC/index.html

Regarding resolution, if 1x1 degree resolution used 1/4 of your server's ram (so 32gb) , then I'm thinking a 2x2 or 3x3 resolution should fit in a modern GPU's memory, the cloud cover data for one year could also go from 633 mb to 150mb or 70mb respectively. Question is how coarse/bad would the simulation be at that resolution(the cloud cover gif already looks quite coarse but not sure if that's because of simulation resolution or how the gif was made)? At least for the purpose of being used in a game like this.

For the nasa model do you have a link? The link above doesn't seem to be working.

Oh, being able to create our own data would be quite cool. For smaller GPUs, I wonder if it be possible to, like, chop the thing into chunks that are each processed in sequence, trading memory for time? I've only got a 2 gig laptop GPU which'd mean it'd need to run at a 4x4 resolution or maybe even 5x5 if you're right and it does scale like that, but what if the map was in like 4 quadrants at 2x2 resolution and it ran 4x as long? Personally at least I don't mind leaving my computer on for a week if need be (tho the computer might). I'd also be very interested if anyone finds a more customizable version of the exoplanet model

Link to comment
Share on other sites

52 minutes ago, WarriorSabe said:

Oh, being able to create our own data would be quite cool. For smaller GPUs, I wonder if it be possible to, like, chop the thing into chunks that are each processed in sequence, trading memory for time? I've only got a 2 gig laptop GPU which'd mean it'd need to run at a 4x4 resolution or maybe even 5x5 if you're right and it does scale like that, but what if the map was in like 4 quadrants at 2x2 resolution and it ran 4x as long? Personally at least I don't mind leaving my computer on for a week if need be (tho the computer might). I'd also be very interested if anyone finds a more customizable version of the exoplanet model

If you are fine with waiting you are probably fine running the CPU version anyway.

Link to comment
Share on other sites

2 hours ago, blackrack said:

If you are fine with waiting you are probably fine running the CPU version anyway.

Yeah but like might as well go faster, right? I'm not sure how much the GPU accelerates things so even going slower maybe it'll be faster overall

Link to comment
Share on other sites

  • 4 weeks later...

Here's a question:

KWP on a JNSQ Kerbin with Kerbal Konstructs launch sites,  and KWP set to point weather data. Will KWP have an issue with the KSC location on JNSQ-Kerbin, and then would the point weather launch conditions get applied to other detected launch sites, like ones added by KK?

Link to comment
Share on other sites

  • 1 month later...
  • 4 weeks later...
Posted (edited)
On 2/8/2022 at 5:27 AM, blackrack said:

Thank you for the complete reply.

There does appear to be a GPU-enabled MPAS branch here but I haven't read into it much to see how much is actually run on the GPU and what the requirements are: https://mpas-dev.github.io/atmosphere/OpenACC/index.html

Regarding resolution, if 1x1 degree resolution used 1/4 of your server's ram (so 32gb) , then I'm thinking a 2x2 or 3x3 resolution should fit in a modern GPU's memory, the cloud cover data for one year could also go from 633 mb to 150mb or 70mb respectively. Question is how coarse/bad would the simulation be at that resolution(the cloud cover gif already looks quite coarse but not sure if that's because of simulation resolution or how the gif was made)? At least for the purpose of being used in a game like this.

For the nasa model do you have a link? The link above doesn't seem to be working.

@blackrack Sorry, for the delayed response.  I finally had some time to spin up KSP this weekend and check back on the forum. :)

Good find! I didn't realize there was a GPU-enabled branch of MPAS . Unfortunately, it's scope is quite narrow. The version of the model is not up to date (the GPU branch uses MPAS v6) and is only supported on IBM's AC922 architecture. Not to say that one couldn't get it to compile on a home GPU but I don't think the effort would reap much benefit. The radiation code is still run through the CPU and the physics options are highly limited in the GPU branch. 

FYI: Here is the link to the NASA model: ROCKE-3D. I've run it successfully but it requires quite a bit of manual adaption to modify the terrain and land surface of the planet being modeled. 

Regarding the quality of a lower resolution simulation, reducing the resolution to 2x2 or 2.5x2.5 degrees wouldn't be unreasonable. In fact, many global climate models used to project the impacts of anthropogenic climate change are run at coarse resolutions on the order of a (1-2.5 deg). It should be noted that, on Kerbin, 1 x 1 deg (at the equator) is on the order of ~25 x 25 km. So, when projected onto Kerbin's coordinate grid, a little goes a long way. This is why KWP is able to resolve difference in climate conditions between the mountains west of the KSC and the ocean to the east. In the model, the mountains are ~200 km away from the KSC. In the game, they're maybe ~20 km from the KSC, since the planet has a radius of 600 km. In MPAS the terrain is scaled up and the model is run with the planetary radius set to Earth's radii. The reasoning behind this approach is outlined in the background section of the KWP webpage.
 

On 3/3/2022 at 12:27 PM, RocketRyleigh said:

Here's a question:

KWP on a JNSQ Kerbin with Kerbal Konstructs launch sites,  and KWP set to point weather data. Will KWP have an issue with the KSC location on JNSQ-Kerbin, and then would the point weather launch conditions get applied to other detected launch sites, like ones added by KK?

@RocketRyleigh So, KWP should still work in JNSQ its just that the point-weather data was run for the stock planet and not the JNSQ version of Kerbin. So, the data may not line up perfectly with what you might expect for the local micro climate. If I recall correectly, the JNSQ KSC site is at a similar latitude as the KSC site in the stock game. In JNSQ the KSC is also relatively close to the water so I wouldn't expect the point weather data at the KSC (for JNSQ) to be terribly off base. That said, one potential complication of using KWP on a modified version of Kerbin is the difference in the length of the day. In JNSQ, Kerbin is ~2.5X larger and the day length is 12 hours (instead of 6). This means that the diurnal cycle of weather (from KWP) would be invalid in a JNSQ playthrough. Basically, when playing JNSQ, you'd have two days of weather in one. While this is wholly inaccurate it's probably not game breaking.

With respect to other launch sites. KWP supports a selection of launch sites from the Kerbinside Remastered mod in addition to the other stock launch sites (i.e. DLS and WLS). In JNSQ, moving to a different site added by KK would simply result in KWP grabing point weather data from the nearest site in its database. For example, say KK adds a site at 35 N, 120 E.  If you spawned at this site, KWP would use the point weather data from the Woomerang Launch Site location (45 N, 136 E) as that would be the closest site (coordinate) for which point weather was available. Essentially KWP grabs data from the nearest site it can find, if the current location is not in its database. For the climate data this is irrelevant, only for point weather data does the latitude/longitude location matter.

Edited by cmet24
Link to comment
Share on other sites

  • 4 weeks later...

Hello guys!

I just discovered this mod from the Kottabos channel video and I really liked what I saw. I would like to know if this mod will be compatible with RSS and Realism Overhaul in the future? I'm curious to know because I really wanted to use this mod so I could have one more challenge to launch rockets and planes on planet Earth and especially have a closer realism to real life.

Thank you very much! And congratulations on the great work!

Link to comment
Share on other sites

  • 3 months later...

@cmet24 What is the time resolution for the climate weather data? I suppose half resolution means double the overall time for the same amount of data? Or maybe there's a possibility for compression, when data doesn't change very much? I.e. instead of 5 entries with wind speeds between 10.5 and 11.5 m/s, just make 1 entry for 11 m/s and specify a start and end time?

Link to comment
Share on other sites

  • 1 month later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...