diff --git a/Aircraft/Generic/aar.nas b/Aircraft/Generic/aar.nas index c5bf8039c..a2e09c748 100644 --- a/Aircraft/Generic/aar.nas +++ b/Aircraft/Generic/aar.nas @@ -81,7 +81,7 @@ var update_loop = func { # and the aircraft maximum rate. Both are expressed # in lbs/min var fuel_rate = math.min(tankers[0].getNode("refuel/max-fuel-transfer-lbs-min", 1).getValue() or 6000, - refuelingN.getNode("max-fuel-transfer-lbs-min", 1).getValue()); + refuelingN.getNode("max-fuel-transfer-lbs-min", 1).getValue() or 6000); var received = UPDATE_PERIOD * fuel_rate / 60; consumed -= received; } diff --git a/Effects/cloud.eff b/Effects/cloud.eff index fa22fa610..f888436a1 100644 --- a/Effects/cloud.eff +++ b/Effects/cloud.eff @@ -11,6 +11,7 @@ /sim/rendering/eye-altitude-m /environment/cloud-self-shading /environment/moonlight + /environment/air-pollution-norm /environment/visibility-m @@ -107,6 +108,11 @@ float moonlight + + air_pollution + float + air_pollution + visibility float diff --git a/Materials/regions/madagascar.xml b/Materials/regions/madagascar.xml new file mode 100644 index 000000000..10b3d4f1d --- /dev/null +++ b/Materials/regions/madagascar.xml @@ -0,0 +1,33 @@ + + + + + + + + sim/startup/season + summer + + + + position/longitude-deg + 40.0 + + + position/longitude-deg + 50.0 + + + position/latitude-deg + -35.0 + + + position/latitude-deg + -10.0 + + + + + + + diff --git a/Materials/regions/materials.xml b/Materials/regions/materials.xml index d400e7c39..f5fe5cb21 100644 --- a/Materials/regions/materials.xml +++ b/Materials/regions/materials.xml @@ -2627,6 +2627,186 @@ + + + + + + EvergreenBroadCover + EvergreenForest + Effects/forest + + Terrain/rainforest-hawaii.png + Terrain/rainforest-hawaii.png + Terrain/shrub-hawaii.png + + 2000 + 2000 + 10000000.0 + 4000.0 + Trees/tropical-summer.png + 8 + + 35.0 + 30.0 + 1 + 1 + + + + GrassCover + BareTundraCover + MixedTundraCover + Cemetery + Effects/landmass-nowood + + Terrain/tundra-hawaii.png + Terrain/rainforest-hawaii.png + Terrain/shrub-hawaii.png + Terrain/airport_grass2.png + + + 0.0 + + 2000 + 2000 + 4000000.0 + + 0.93 + 0.95 + 0.93 + 1.0 + + + 0.1 + 0.12 + 0.1 + 1.0 + + 1.2 + 1 + 0.7 + 0.1 + 0.15 + 1e30 + + + + MixedCropPastureCover + MixedCrop + ComplexCrop + + Terrain/cropgrass-madagascar.png + Terrain/shrub-hawaii.png + + + 0.5 + + 2000 + 2000 + 2000000.0 + 1 + 0.9 + 0.1 + 0.7 + 1e30 + + + + Effects/crop + DryCropPastureCover + DryCrop + + Terrain/tundra-hawaii.png + Terrain/rainforest-hawaii.png + Terrain/shrub-hawaii.png + + 2000 + 2000 + 1 + 0.9 + 0.1 + 0.6 + 1e30 + 2000000.0 + 50000.0 + Trees/tropical-summer.png + 8 + + 20.0 + 12.0 + + + + + BuiltUpCover + Urban + Terrain/town-madagascar.png + Terrain/town-europe.mask.png + 1024 + 1024 + 100000.0 + + 0.05 + 0.05 + 0.02 + 1.0 + + + 500.0 + 0.9 + 0.1 + 0.0 + 4 + 1000.0 + Trees/tropical-alt-summer.png + 8 + + 15.0 + 10.0 + + + + DeciduousBroadCover + DeciduousForest + Bog + Heath + + Terrain/rainforest-hawaii.png + Terrain/marsh2a.png + + + 0.4 + + 2000 + 2000 + 10000000.0 + 4000.0 + Trees/tropical-summer.png + 8 + + 25.0 + 15.0 + 1 + 0.85 + + + + Sand + + Terrain/sand-hawaii4.png + Terrain/sand-hawaii4.png + + 2000 + 2000 + 10000000.0 + 2.5 + 0.1 + 0.7 + 0.1 + + + diff --git a/Nasal/geo.nas b/Nasal/geo.nas index c0d73fd6f..024a52b68 100644 --- a/Nasal/geo.nas +++ b/Nasal/geo.nas @@ -163,6 +163,12 @@ var Coord = { me._pupdate(); course *= D2R; dist /= ERAD; + + if (dist < 0.0) { + dist = abs(dist); + course = course - math.pi; + } + me._lat = math.asin(math.sin(me._lat) * math.cos(dist) + math.cos(me._lat) * math.sin(dist) * math.cos(course)); diff --git a/Nasal/local_weather/cloud_definitions.nas b/Nasal/local_weather/cloud_definitions.nas index e9e0a217a..1daf7859b 100644 --- a/Nasal/local_weather/cloud_definitions.nas +++ b/Nasal/local_weather/cloud_definitions.nas @@ -384,13 +384,13 @@ else if (type == "Altocumulus"){ #characterize the cloud cloudAssembly.bottom_shade = 0.7; - cloudAssembly.n_sprites = 10; - cloudAssembly.min_width = 400.0 * mult; - cloudAssembly.max_width = 700.0 * mult; + cloudAssembly.n_sprites = 6; + cloudAssembly.min_width = 40.0 * mult; + cloudAssembly.max_width = 600.0 * mult; cloudAssembly.min_height = 400.0 * mult; - cloudAssembly.max_height = 700.0 * mult; - cloudAssembly.min_cloud_width = 1200 * mult * mult; - cloudAssembly.min_cloud_height = 1200 * mult * mult; + cloudAssembly.max_height = 600.0 * mult; + cloudAssembly.min_cloud_width = 1000 * mult * mult; + cloudAssembly.min_cloud_height = 1000 * mult * mult; cloudAssembly.z_scale = 0.8; #signal that new routines are used @@ -424,16 +424,15 @@ else if (type == "Stratus (structured)"){ #signal that new routines are used path = "new"; - } -else if (type == "Altocumulus perlucidus"){ - - # new code + +else if (type == "Stratus structured CS"){ + cloudAssembly = local_weather.cloud.new(type, subtype); var mult = 1.0; - if (subtype == "small") {mult = 0.7;} - else {mult = 1.0;} + + mult = mult * local_weather.cloud_size_scale; # characterize the basic texture sheet cloudAssembly.texture_sheet = "/Models/Weather/altocumulus_sheet1.rgb"; @@ -441,7 +440,36 @@ else if (type == "Altocumulus perlucidus"){ cloudAssembly.num_tex_y = 3; #characterize the cloud - cloudAssembly.bottom_shade = 0.8; + cloudAssembly.bottom_shade = 0.4; + cloudAssembly.n_sprites = 6; + cloudAssembly.min_width = 1000.0 * mult; + cloudAssembly.max_width = 1000.0 * mult; + cloudAssembly.min_height = 1000.0 * mult; + cloudAssembly.max_height = 1000.0 * mult; + cloudAssembly.min_cloud_width = 1305 * mult; + cloudAssembly.min_cloud_height = 1305.0 * mult; + cloudAssembly.z_scale = 0.3; + + #signal that new routines are used + path = "new"; + } + +else if (type == "Altocumulus perlucidus"){ + + # new code + cloudAssembly = local_weather.cloud.new(type, subtype); + + var mult = 1.0; + if (subtype == "small") {mult = 0.7;} + else if (subtype == "huge") {mult = 1.5;} + + # characterize the basic texture sheet + cloudAssembly.texture_sheet = "/Models/Weather/altocumulus_sheet1.rgb"; + cloudAssembly.num_tex_x = 3; + cloudAssembly.num_tex_y = 3; + + #characterize the cloud + cloudAssembly.bottom_shade = 0.7; cloudAssembly.n_sprites = 25; cloudAssembly.min_width = 1700.0 * mult; cloudAssembly.max_width = 2500.0 * mult; @@ -508,7 +536,7 @@ else if (type == "Cirrocumulus (cloudlet)") { var mult = 1.0; if (subtype == "small") {mult = 0.6;} - else {mult = 1.0;} + else if (subtype == "huge") {mult = 1.5;} # characterize the basic texture sheet cloudAssembly.texture_sheet = "/Models/Weather/cirrocumulus_sheet1.rgb"; @@ -527,9 +555,6 @@ else if (type == "Cirrocumulus (cloudlet)") { cloudAssembly.z_scale = 0.3; path = "new"; - - - } else if (type == "Cirrocumulus (new)") { @@ -537,7 +562,7 @@ else if (type == "Cirrocumulus (new)") { var mult = 1.0; if (subtype == "small") {mult = 0.7;} - else {mult = 1.0;} + else {mult = 1.3;} # characterize the basic texture sheet cloudAssembly.texture_sheet = "/Models/Weather/cirrocumulus_sheet1.rgb"; @@ -559,6 +584,36 @@ else if (type == "Cirrocumulus (new)") { path = "new"; } +else if (type == "Fogpatch") { + + cloudAssembly = local_weather.cloud.new(type, subtype); + + var mult = 1.0; + if (subtype == "small") {mult = 0.7;} + else {mult = 1.0;} + + mult = mult * local_weather.cloud_size_scale; + + # characterize the basic texture sheet + cloudAssembly.texture_sheet = "/Models/Weather/fogpatch_sheet1.rgb"; + cloudAssembly.num_tex_x = 1; + cloudAssembly.num_tex_y = 1; + + #characterize the cloud + cloudAssembly.bottom_shade = 1.0; + cloudAssembly.n_sprites = 1; + cloudAssembly.min_width = 300.0 * mult; + cloudAssembly.max_width = 300.0 * mult; + cloudAssembly.min_height = 300.0 * mult; + cloudAssembly.max_height = 300.0 * mult; + cloudAssembly.min_cloud_width = 305.0 * mult; + cloudAssembly.min_cloud_height = 305.0 * mult; + cloudAssembly.z_scale = 0.5; + + #signal that new routines are used + path = "new"; + } + else if (type == "Nimbus") { cloudAssembly = local_weather.cloud.new(type, subtype); @@ -698,6 +753,35 @@ else if (type == "Cirrostratus") { path = "new"; } +else if (type == "Cirrostratus (small)") { + + cloudAssembly = local_weather.cloud.new(type, subtype); + + var mult = 1.0; + if (subtype == "small") {mult = 0.45;} + else {mult = 0.7;} + + # characterize the basic texture sheet + cloudAssembly.texture_sheet = "/Models/Weather/cirrostratus_sheet1.rgb"; + cloudAssembly.num_tex_x = 2; + cloudAssembly.num_tex_y = 2; + + #characterize the cloud + cloudAssembly.bottom_shade = 1.0; + cloudAssembly.n_sprites = 2; + cloudAssembly.min_width = 3500.0 * mult; + cloudAssembly.max_width = 4000.0 * mult; + cloudAssembly.min_height = 3500.0 * mult; + cloudAssembly.max_height = 4000.0 * mult; + cloudAssembly.min_cloud_width = 4500.0 * mult; + cloudAssembly.min_cloud_height = 4500.0 * mult; + cloudAssembly.z_scale = 0.5; + + #signal that new routines are used + path = "new"; + + } + else if (type == "Fog (thin)") { if (subtype == "small") { if (rn > 0.8) {path = "Models/Weather/stratus_thin1.xml";} diff --git a/Nasal/local_weather/cloud_placement_lowlevel.nas b/Nasal/local_weather/cloud_placement_lowlevel.nas index 5773994a7..bbf9554e1 100644 --- a/Nasal/local_weather/cloud_placement_lowlevel.nas +++ b/Nasal/local_weather/cloud_placement_lowlevel.nas @@ -80,6 +80,190 @@ for (var i=0; i 0.7) + { + flag = 1; + path = select_cloud_model(arg.type,"large") + } + else if (comp > 0.4) + { + flag = 1; + path = select_cloud_model(arg.type,"small") + } + + var lat = arg.blat + m_to_lat * (y * math.cos(arg.dir) - x * math.sin(arg.dir)); + var lon = arg.blon + m_to_lon * (x * math.cos(arg.dir) + y * math.sin(arg.dir)); + + var alt = arg.balt + arg.alt_var * 2 * (rand() - 0.5); + + if (flag > 0) + {create_cloud_vec(path, lat, lon, alt, 0.0); counter = counter +1;} + } + + } + print("Cloud count: ",counter); + +} + + +########################################################### +# place a stick bundle pattern +########################################################### + +var sgn = func (x) { + +if (x<0.0) {return -1.0;} +else {return 1.0;} +} + +var create_stick_bundle = func (arg) { + +var path = "Models/Weather/blank.ac"; +var base_size_scale = local_weather.cloud_size_scale; + +for (var i = 0; i 0.888) +# rn = 0.01; + +if (rn > 0.916) { # cloud scenario 1: weak cumulus development and blue thermals @@ -237,21 +242,22 @@ if (rn > 0.888) # and specify the atmosphere local_weather.set_atmosphere_ipoint(blat, blon, vis + 10000.0, alt+alt_offset, vis + 15000.0, 0.0, 25000.0, 30000.0, 0.95, alt+alt_offset, alt+alt_offset + 2500.0); } -else if (rn > 0.777) +else if (rn > 0.833) { # cloud scenario 2: some Cirrocumulus patches strength = rand() * 0.03; local_weather.create_cumosys(blat,blon, alt + alt_offset, get_n(strength), 20000.0); - create_2_8_cirrocumulus(blat, blon, alt + alt_offset + 5000.0, alpha); - + #create_2_8_cirrocumulus(blat, blon, alt + alt_offset + 5000.0, alpha); + create_1_8_alttstratus_domains(blat, blon, alt + alt_offset + 5000.0, alpha); + create_2_8_cirrus(blat, blon, alt + alt_offset + 35000.0, alpha); # and specify the atmosphere local_weather.set_atmosphere_ipoint(blat, blon, vis + 10000.0, alt+alt_offset, vis + 15000.0, 0.1, alt+alt_offset +30000.0, alt+alt_offset + 35000.0, 0.95, alt+alt_offset, alt+alt_offset + 2500.0); } -else if (rn > 0.666) +else if (rn > 0.75) { # cloud scenario 3: Cirrostratus undulatus over weak cumulus @@ -264,19 +270,22 @@ else if (rn > 0.666) local_weather.set_atmosphere_ipoint(blat, blon, vis + 10000.0, alt+alt_offset, vis + 15000.0, 0.15, alt+alt_offset +28000.0, alt+alt_offset + 32000.0, 0.95, alt+alt_offset, alt+alt_offset + 2500.0); } -else if (rn > 0.555) +else if (rn > 0.666) { - # cloud scenario 4: Cirrostratus undulatus streak + # cloud scenario 4: Cirrocumulus mackerel sky strength = rand() * 0.03; local_weather.create_cumosys(blat,blon, alt + alt_offset, get_n(strength), 20000.0); - create_1_8_cirrostratus_undulatus(blat, blon, alt + alt_offset + 32000.0, alpha); - + ##create_1_8_cirrostratus_undulatus(blat, blon, alt + alt_offset + 32000.0, alpha); + create_1_8_cirrocumulus_mackerel(blat, blon, alt + alt_offset + 32000.0, alpha); + #create_4_8_cirrus_bundle(blat, blon, alt + alt_offset + 32000.0, alpha); + + # and specify the atmosphere - local_weather.set_atmosphere_ipoint(blat, blon, vis + 10000.0, alt+alt_offset, vis + 15000.0, 0.15, alt+alt_offset +28000.0, alt+alt_offset + 32000.0, 0.9, alt+alt_offset, alt+alt_offset + 2500.0); + local_weather.set_atmosphere_ipoint(blat, blon, vis + 10000.0, alt+alt_offset, vis + 15000.0, 0.25, alt+alt_offset +28000.0, alt+alt_offset + 32000.0, 0.9, alt+alt_offset, alt+alt_offset + 2500.0); } -else if (rn > 0.444) +else if (rn > 0.5833) { # cloud scenario 5: Cirrus @@ -291,25 +300,25 @@ else if (rn > 0.444) # and specify the atmosphere local_weather.set_atmosphere_ipoint(blat, blon, vis + 10000.0, alt+alt_offset, vis + 15000.0, 0.0, alt+alt_offset +28000.0, alt+alt_offset + 33000.0, 0.95, alt+alt_offset, alt+alt_offset + 2500.0); } -else if (rn > 0.333) +else if (rn > 0.5) { # cloud scenario 6: strong Cirrus cover create_4_8_cirrus(blat, blon, alt + alt_offset + 35000.0, alpha); local_weather.set_atmosphere_ipoint(blat, blon, vis + 10000.0, alt+alt_offset, vis + 15000.0, 0.0, alt+alt_offset +28000.0, alt+alt_offset + 33000.0, 0.9, alt+alt_offset, alt+alt_offset + 2500.0); } -else if (rn > 0.222) +else if (rn > 0.25) { # cloud scenario 7: clear local_weather.set_atmosphere_ipoint(blat, blon, vis + 10000.0, alt+alt_offset, vis + 15000.0, 0.0, alt+alt_offset +28000.0, alt+alt_offset + 33000.0, 1.0, alt+alt_offset, alt+alt_offset + 2500.0); } -else if (rn > 0.111) +else if (rn > 0.166) { # cloud scenario 8: Stratiform hazy clouds local_weather.top_shade = 0.8; - create_2_8_alttstratus(blat, blon, alt+alt_offset, alpha); + create_2_8_alttstratus_domains(blat, blon, alt+alt_offset, alpha); local_weather.top_shade = 0.9; create_4_8_tstratus_undulatus(blat, blon, alt+alt_offset + 4000, alpha); @@ -317,17 +326,30 @@ else if (rn > 0.111) local_weather.set_atmosphere_ipoint(blat, blon, vis + 10000.0, alt+alt_offset, vis + 15000.0, 0.25, alt+alt_offset +24000.0, alt+alt_offset + 26000.0, 0.9, alt+alt_offset, alt+alt_offset + 2500.0); } -else if (rn > 0.0) +else if (rn > 0.0833) { # cloud scenario 9: Cirrocumulus - if (rand() > 0.7) # this is very expensive, so don't do it for every tile - {create_2_8_cirrocumulus_patches(blat, blon, alt + alt_offset + 26000.0, alpha);} - else - {create_2_8_cirrocumulus(blat, blon, alt + alt_offset + 26000.0, alpha);} + if (rand() > 0.4) # this is very expensive, so don't do it for every tile + {create_2_8_cirrocumulus_domains(blat, blon, alt + alt_offset + 26000.0, alpha);} + #else + # {create_2_8_cirrocumulus(blat, blon, alt + alt_offset + 26000.0, alpha);} # and specify the atmosphere - local_weather.set_atmosphere_ipoint(blat, blon, vis + 10000.0, alt+alt_offset, vis + 15000.0, 0.2, alt+alt_offset +24000.0, alt+alt_offset + 26000.0, 0.9, alt+alt_offset, alt+alt_offset + 2500.0); + local_weather.set_atmosphere_ipoint(blat, blon, vis + 10000.0, alt+alt_offset, vis + 15000.0, 0.2, alt+alt_offset +24000.0, alt+alt_offset + 26000.0, 0.9, alt+alt_offset, alt+alt_offset + 2500.0); + + } +else + { + # cloud scenario 10: amorphous Cirrostratus + + strength = rand() * 0.03; + local_weather.create_cumosys(blat,blon, alt + alt_offset, get_n(strength), 20000.0); + + create_4_8_cirrus_bundle(blat, blon, alt + alt_offset + 32000.0, alpha); + + # and specify the atmosphere + local_weather.set_atmosphere_ipoint(blat, blon, vis + 10000.0, alt+alt_offset, vis + 15000.0, 0.45, alt+alt_offset +28000.0, alt+alt_offset + 32000.0, 0.9, alt+alt_offset, alt+alt_offset + 2500.0); } @@ -396,9 +418,16 @@ if (rand() < small_scale_persistence) else {rnd_store = rn;} -# rn = 0.1; +# daily modulation - layers are more pronounced during morning and evening and dissolve during the day + +var t = getprop("sim/time/utc/day-seconds"); +t = t + getprop("sim/time/local-offset"); +var sec_to_rad = 2.0 * math.pi/86400; +var t_factor1 = 0.5 * (1.0-math.cos((t * sec_to_rad))); + +#rn = 0.01; -if (rn > 0.875) +if (rn > 0.9) { # cloud scenario 1: possible Cirrus over Cumulus strength = 0.2 + rand() * 0.4; @@ -423,20 +452,21 @@ if (rn > 0.875) local_weather.set_atmosphere_ipoint(blat, blon, vis + 10000.0, alt+alt_offset, vis + 15000.0, 0.0, alt+alt_offset +28000.0, alt+alt_offset + 30000.0, 0.85, alt+alt_offset, alt+alt_offset + 2500.0); } -else if (rn > 0.75) +else if (rn > 0.8) { # cloud scenario 2: Cirrostratus over weak Cumulus strength = 0.2 + rand() * 0.2; local_weather.create_cumosys(blat,blon, alt + alt_offset, get_n(strength), 20000.0); - create_2_8_cirrostratus(blat, blon, alt+alt_offset+25000.0, alpha); + #create_2_8_cirrostratus(blat, blon, alt+alt_offset+25000.0, alpha); + create_2_8_cirrostratus_mackerel(blat, blon, alt+alt_offset+25000.0, alpha); # and specify the atmosphere local_weather.set_atmosphere_ipoint(blat, blon, vis + 10000.0, alt+alt_offset, vis + 15000.0, 0.2, alt+alt_offset +20000.0, alt+alt_offset + 25000.0, 0.9, alt+alt_offset, alt+alt_offset + 2500.0); } -else if (rn > 0.625) +else if (rn > 0.7) { # cloud scenario 3: Cirrocumulus sheet over Cumulus @@ -455,19 +485,26 @@ else if (rn > 0.625) local_weather.set_atmosphere_ipoint(blat, blon, vis + 10000.0, alt+alt_offset, vis + 15000.0, 0.0, alt+alt_offset +20000.0, alt+alt_offset + 24000.0, 0.85, alt+alt_offset, alt+alt_offset + 2500.0); } -else if (rn > 0.5) +else if (rn > 0.6) { # cloud scenario 4: Cirrostratus undulatus over weak Cumulus strength = 0.15 + rand() * 0.15; local_weather.create_cumosys(blat,blon, alt + alt_offset, get_n(strength), 20000.0); - create_4_8_cirrostratus_undulatus(blat, blon, alt + alt_offset + 25000.0, alpha); + if (rand()>0.5) + { + create_4_8_cirrostratus_undulatus(blat, blon, alt + alt_offset + 25000.0, alpha); + } + else + { + create_4_8_cirrus_bundle(blat, blon, alt + alt_offset + 25000.0, alpha); + } # and specify the atmosphere - local_weather.set_atmosphere_ipoint(blat, blon, vis + 10000.0, alt+alt_offset, vis + 15000.0, 0.15, alt+alt_offset +20000.0, alt+alt_offset + 25000.0, 0.85, alt+alt_offset, alt+alt_offset + 2500.0); + local_weather.set_atmosphere_ipoint(blat, blon, vis + 10000.0, alt+alt_offset, vis + 15000.0, 0.35, alt+alt_offset +20000.0, alt+alt_offset + 25000.0, 0.85, alt+alt_offset, alt+alt_offset + 2500.0); } -else if (rn > 0.375) +else if (rn > 0.5) { # cloud scenario 5: some scattered Altocumuli over Cumulus @@ -481,42 +518,71 @@ else if (rn > 0.375) # and specify the atmosphere local_weather.set_atmosphere_ipoint(blat, blon, vis + 10000.0, alt+alt_offset, vis + 15000.0, 0.0, alt+alt_offset +20000.0, alt+alt_offset + 25000.0, 0.8, alt+alt_offset, alt+alt_offset + 2500.0); } -else if (rn > 0.25) +else if (rn > 0.4) { # cloud scenario 6: Cirrocumulus over Cumulus strength = 0.2 + rand() * 0.1; local_weather.create_cumosys(blat,blon, alt + alt_offset, get_n(strength), 20000.0); - if (rand() > 0.8) # this is very expensive, so don't do it for every tile - {create_2_8_cirrocumulus_patches(blat, blon, alt + alt_offset + 26000.0, alpha);} + if (rand() > 0.6) # this is very expensive, so don't do it for every tile + {create_2_8_cirrocumulus_domains(blat, blon, alt + alt_offset + 26000.0, alpha);} else - {create_2_8_cirrocumulus(blat, blon, alt + alt_offset + 26000.0, alpha);} + {create_1_8_alttstratus_domains(blat, blon, alt + alt_offset + 26000.0, alpha);} # and specify the atmosphere local_weather.set_atmosphere_ipoint(blat, blon, vis + 10000.0, alt+alt_offset, vis + 15000.0, 0.3, alt+alt_offset +24000.0, alt+alt_offset + 26000.0, 0.85, alt+alt_offset, alt+alt_offset + 2500.0); } -else if (rn > 0.125) +else if (rn > 0.3) { # cloud scenario 7: just Cumulus - strength = 0.3 + rand() * 0.1; + strength = 0.3 + rand() * 0.2; local_weather.create_cumosys(blat,blon, alt + alt_offset, get_n(strength), 20000.0); # and specify the atmosphere - local_weather.set_atmosphere_ipoint(blat, blon, vis + 10000.0, alt+alt_offset, vis + 15000.0, 0.0, alt+alt_offset +20000.0, alt+alt_offset + 25000.0, 0.8, alt+alt_offset, alt+alt_offset + 2500.0); + local_weather.set_atmosphere_ipoint(blat, blon, vis + 10000.0, alt+alt_offset, vis + 15000.0, 0.0, alt+alt_offset +20000.0, alt+alt_offset + 25000.0, 0.85, alt+alt_offset, alt+alt_offset + 2500.0); } -else if (rn > 0.0) +else if (rn > 0.2) { # cloud scenario 8: Altocumulus Perlucidus over Cumulus strength = 0.2 + rand() * 0.1; local_weather.create_cumosys(blat,blon, alt + alt_offset, get_n(strength), 20000.0); - - create_2_8_altocumulus_perlucidus(blat, blon, alt + alt_offset + 12000.0, alpha); + + + if (rand()>0.5* t_factor1) + {create_2_8_altocumulus_perlucidus_domains(blat, blon, alt + alt_offset + 12000.0, alpha);} # and specify the atmosphere local_weather.set_atmosphere_ipoint(blat, blon, vis + 10000.0, alt+alt_offset, vis + 15000.0, 0.0, alt+alt_offset +20000.0, alt+alt_offset + 25000.0, 0.8, alt+alt_offset, alt+alt_offset + 2500.0); } +else if (rn > 0.1) + { + # cloud scenario 9: Thin Stratus over Cumulus + + strength = 0.2 + rand() * 0.1; + local_weather.create_cumosys(blat,blon, alt + alt_offset, get_n(strength), 20000.0); + + if (rand()>0.5* t_factor1) + {create_2_8_alttstratus_domains(blat, blon, alt + alt_offset + 12000.0, alpha);} + + # and specify the atmosphere + local_weather.set_atmosphere_ipoint(blat, blon, vis + 10000.0, alt+alt_offset, vis + 15000.0, 0.0, alt+alt_offset +20000.0, alt+alt_offset + 25000.0, 0.85, alt+alt_offset, alt+alt_offset + 2500.0); + } +else + { + # cloud scenario 10: Mackerel Cirrocumulus + + strength = 0.3 + rand() * 0.1; + local_weather.create_cumosys(blat,blon, alt + alt_offset, get_n(strength), 20000.0); + + if(rand() > 0.6) + {create_1_8_cirrocumulus_mackerel(blat, blon, alt + alt_offset + 20000.0, alpha);} + + # and specify the atmosphere + local_weather.set_atmosphere_ipoint(blat, blon, vis + 10000.0, alt+alt_offset, vis + 15000.0, 0.0, alt+alt_offset +20000.0, alt+alt_offset + 25000.0, 0.9, alt+alt_offset, alt+alt_offset + 2500.0); + } + # store convective altitude and strength @@ -584,7 +650,7 @@ else {rnd_store = rn;} -# rn = 0.05; +#rn = 0.85; if (rn > 0.9) { @@ -592,10 +658,11 @@ if (rn > 0.9) strength = 0.1 + rand() * 0.1; local_weather.create_cumosys(blat,blon, alt + alt_offset, get_n(strength), 20000.0); - x = 2.0 * (rand()-0.5) * 5000; - y = 2.0 * (rand()-0.5) * 5000; - local_weather.create_streak("Altocumulus",blat+get_lat(x,y,phi), blon+get_lon(x,y,phi), 12000.0+alt+alt_offset,1500.0,30,1000.0,0.2,1200.0,30,1000.0,0.2,1200.0,alpha ,1.0); - + #x = 2.0 * (rand()-0.5) * 5000; + #y = 2.0 * (rand()-0.5) * 5000; + #local_weather.create_streak("Altocumulus",blat+get_lat(x,y,phi), blon+get_lon(x,y,phi), 12000.0+alt+alt_offset,1500.0,30,1000.0,0.2,1200.0,30,1000.0,0.2,1200.0,alpha ,1.0); + + create_2_8_altocumulus_domains(blat, blon, alt+alt_offset +12000.0, alpha); # and specify the atmosphere local_weather.set_atmosphere_ipoint(blat, blon, vis + 10000.0, alt+alt_offset, vis + 15000.0, 0.0, alt+alt_offset +20000.0, alt+alt_offset + 25000.0, 0.85, alt+alt_offset, alt+alt_offset + 2500.0); @@ -603,17 +670,22 @@ if (rn > 0.9) } else if (rn > 0.8) { - # cloud scenario 2: Altocumulus streaks - strength = 0.15 + rand() * 0.2; + # cloud scenario 2: Perlucidus variations + strength = 0.1 + rand() * 0.15; local_weather.create_cumosys(blat,blon, alt + alt_offset, get_n(strength), 20000.0); - x = 2.0 * (rand()-0.5) * 10000; - y = 2.0 * (rand()-0.5) * 10000; - local_weather.create_streak("Altocumulus",blat+get_lat(x,y,phi), blon+get_lon(x,y,phi), 12000.0+alt+alt_offset,1500.0,25,700.0,0.2,800.0,10,700.0,0.2,800.0,alpha ,1.4); - x = 2.0 * (rand()-0.5) * 10000; - y = 2.0 * (rand()-0.5) * 10000; - local_weather.create_streak("Altocumulus",blat+get_lat(x,y,phi), blon+get_lon(x,y,phi), 12000.0+alt+alt_offset,1500.0,22,750.0,0.2,1000.0,8,750.0,0.2,1000.0,alpha ,1.1); + #x = 2.0 * (rand()-0.5) * 10000; + #y = 2.0 * (rand()-0.5) * 10000; + #local_weather.create_streak("Altocumulus",blat+get_lat(x,y,phi), blon+get_lon(x,y,phi), 12000.0+alt+alt_offset,1500.0,25,700.0,0.2,800.0,10,700.0,0.2,800.0,alpha ,1.4); + #x = 2.0 * (rand()-0.5) * 10000; + #y = 2.0 * (rand()-0.5) * 10000; + #local_weather.create_streak("Altocumulus",blat+get_lat(x,y,phi), blon+get_lon(x,y,phi), 12000.0+alt+alt_offset,1500.0,22,750.0,0.2,1000.0,8,750.0,0.2,1000.0,alpha ,1.1); + if (rand() > 0.6) + {create_2_8_perlucidus_mackerel(blat, blon, alt+alt_offset +12000.0, alpha);} + else + {create_2_8_sstratus_hires_bundle(blat, blon, alt+alt_offset +12000.0, alpha);} + # and specify the atmosphere local_weather.set_atmosphere_ipoint(blat, blon, vis + 10000.0, alt+alt_offset, vis + 15000.0, 0.0, alt+alt_offset +20000.0, alt+alt_offset + 25000.0, 0.85, alt+alt_offset, alt+alt_offset + 2500.0); @@ -638,23 +710,26 @@ else if (rn > 0.6) strength = 0.7 + rand() * 0.3; local_weather.create_cumosys(blat,blon, alt + alt_offset, get_n(strength), 20000.0); - create_4_8_alttstratus_streaks(blat, blon, alt+alt_offset +10000.0, alpha); + #create_4_8_alttstratus_streaks(blat, blon, alt+alt_offset +10000.0, alpha); + create_4_8_alttstratus_domains(blat, blon, alt+alt_offset +10000.0, alpha); # and specify the atmosphere - local_weather.set_atmosphere_ipoint(blat, blon, vis + 10000.0, alt+alt_offset, vis + 15000.0, 0.0, alt+alt_offset +20000.0, alt+alt_offset + 25000.0, 0.8, alt+alt_offset, alt+alt_offset + 2500.0); + local_weather.set_atmosphere_ipoint(blat, blon, vis + 10000.0, alt+alt_offset, vis + 15000.0, 0.0, alt+alt_offset +10000.0, alt+alt_offset + 25000.0, 0.8, alt+alt_offset, alt+alt_offset + 2500.0); } else if (rn > 0.5) { - # cloud scenario 5: scattered Stratus + # cloud scenario 5: scattered Altocumulus perlucidus strength = 0.4 + rand() * 0.2; local_weather.create_cumosys(blat,blon, alt + alt_offset, get_n(strength), 20000.0); var size_offset = 0.5 * m_to_ft * local_weather.cloud_vertical_size_map["Stratus_structured"]; - local_weather.create_streak("Stratus (structured)",blat, blon, alt+6000.0+alt_offset+size_offset,1000.0,18,0.0,0.3,20000.0,18,0.0,0.3,20000.0,0.0,1.0); - + #local_weather.create_streak("Stratus (structured)",blat, blon, alt+6000.0+alt_offset+size_offset,1000.0,18,0.0,0.3,20000.0,18,0.0,0.3,20000.0,0.0,1.0); + create_4_8_sstratus_domains(blat, blon, alt+alt_offset+size_offset +6000.0, alpha); + #create_2_8_sstratus_hires_bundle(blat, blon, alt+alt_offset+size_offset +6000.0, alpha); + # and specify the atmosphere local_weather.set_atmosphere_ipoint(blat, blon, vis + 10000.0, alt+alt_offset, vis + 15000.0, 0.2, alt+alt_offset +20000.0, alt+alt_offset + 25000.0, 0.8, alt+alt_offset, alt+alt_offset + 2500.0); @@ -689,10 +764,11 @@ else if (rn > 0.3) strength = 0.05 + rand() * 0.1; local_weather.create_cumosys(blat,blon, alt + alt_offset, get_n(strength), 20000.0); - create_4_8_cirrocumulus_streaks(blat, blon, alt + 6000.0 + alt_offset, alpha); - + #create_4_8_cirrocumulus_streaks(blat, blon, alt + 6000.0 + alt_offset, alpha); + create_4_8_alttstratus_domains(blat, blon, alt + 6000.0 + alt_offset, alpha); + # and specify the atmosphere - local_weather.set_atmosphere_ipoint(blat, blon, vis + 10000.0, alt+alt_offset, vis + 15000.0, 0.05, alt+alt_offset +20000.0, alt+alt_offset + 25000.0, 0.8, alt+alt_offset, alt+alt_offset + 2500.0); + local_weather.set_atmosphere_ipoint(blat, blon, vis + 10000.0, alt+alt_offset, vis + 15000.0, 0.25, alt+alt_offset +6000.0, alt+alt_offset + 25000.0, 0.8, alt+alt_offset, alt+alt_offset + 2500.0); } else if (rn > 0.2) @@ -801,9 +877,9 @@ if (rand() < small_scale_persistence) else {rnd_store = rn;} +#rn = 0.01; - -if (rn > 0.888) +if (rn > 0.9) { # cloud scenario 1: low Stratocumulus, thin streaks above @@ -812,82 +888,88 @@ if (rn > 0.888) create_detailed_stratocumulus_bank(blat, blon, alt+alt_offset,alpha); - create_4_8_alttstratus_streaks(blat, blon, alt+alt_offset+4000.0,alpha); + create_2_8_alttstratus_domains(blat, blon, alt+alt_offset+4000.0,alpha); # and specify the atmosphere local_weather.set_atmosphere_ipoint(blat, blon, vis + 10000.0, alt+alt_offset, vis + 15000.0, 0.0, alt+alt_offset +20000.0, alt+alt_offset + 25000.0, 0.75, alt+alt_offset, alt+alt_offset + 2500.0); } -else if (rn > 0.777) +else if (rn > 0.8) { # cloud scenario 2: weak Cumulus, Stratus undulatus above strength = 0.2 + rand() * 0.2; local_weather.create_cumosys(blat,blon, alt + alt_offset, get_n(strength), 20000.0); - create_6_8_tstratus_undulatus(blat, blon, alt+alt_offset+4000.0,alpha); + #create_6_8_tstratus_undulatus(blat, blon, alt+alt_offset+4000.0,alpha); + create_6_8_tstratus_mackerel(blat, blon, alt+alt_offset+4000.0,alpha); - create_2_8_alttstratus(blat, blon, alt+alt_offset+7000.0,alpha); + create_2_8_alttstratus_domains(blat, blon, alt+alt_offset+7000.0,alpha); # and specify the atmosphere local_weather.set_atmosphere_ipoint(blat, blon, vis + 10000.0, alt+alt_offset, vis + 15000.0, 0.0, alt+alt_offset +20000.0, alt+alt_offset + 25000.0, 0.8, alt+alt_offset, alt+alt_offset + 2500.0); } -else if (rn > 0.666) +else if (rn > 0.7) { # cloud scenario 3: Stratocumulus banks with patches above create_detailed_stratocumulus_bank(blat, blon, alt+alt_offset,alpha); create_detailed_small_stratocumulus_bank(blat, blon, alt+alt_offset,alpha); - create_4_8_alttstratus_patches(blat, blon, alt+alt_offset+4000.0,alpha); + create_4_8_alttstratus_domains(blat, blon, alt+alt_offset+4000.0,alpha); # and specify the atmosphere local_weather.set_atmosphere_ipoint(blat, blon, vis + 10000.0, alt+alt_offset, vis + 15000.0, 0.0, alt+alt_offset +20000.0, alt+alt_offset + 25000.0, 0.7, alt+alt_offset, alt+alt_offset + 2500.0); } -else if (rn > 0.555) +else if (rn > 0.6) { # cloud scenario 4: structured Stratus alt = alt + local_weather.cloud_vertical_size_map["Stratus"] * 0.5 * m_to_ft; create_4_8_sstratus_patches(blat, blon, alt+alt_offset,alpha); - create_2_8_alttstratus(blat, blon, alt+alt_offset+7000.0,alpha); + create_2_8_alttstratus_domains(blat, blon, alt+alt_offset+7000.0,alpha); # and specify the atmosphere local_weather.set_atmosphere_ipoint(blat, blon, vis + 10000.0, alt+alt_offset, vis + 15000.0, 0.25, alt+alt_offset +20000.0, alt+alt_offset + 25000.0, 0.7, alt+alt_offset, alt+alt_offset + 2500.0); } -else if (rn > 0.444) +else if (rn > 0.5) { # cloud scenario 5: Stratus blending with Cumulus with Cirrocumulus above strength = 0.1 + rand() * 0.1; local_weather.create_cumosys(blat,blon, alt + alt_offset, get_n(strength), 20000.0); - create_4_8_tstratus_patches(blat, blon, alt+alt_offset,alpha); - - create_4_8_cirrocumulus_undulatus(blat, blon, alt+alt_offset + 12000.0,alpha); + #create_4_8_tstratus_patches(blat, blon, alt+alt_offset,alpha); + create_4_8_tstratus_domains(blat, blon, alt+alt_offset,alpha); + #create_4_8_cirrocumulus_undulatus(blat, blon, alt+alt_offset + 12000.0,alpha); + create_2_8_perlucidus_mackerel(blat, blon, alt+alt_offset + 12000.0,alpha); + # and specify the atmosphere local_weather.set_atmosphere_ipoint(blat, blon, vis + 10000.0, alt+alt_offset, vis + 15000.0, 0.15, alt+alt_offset +20000.0, alt+alt_offset + 25000.0, 0.75, alt+alt_offset, alt+alt_offset + 2500.0); } -else if (rn > 0.333) +else if (rn > 0.4) { # cloud scenario 6: small Stratocumulus banks create_detailed_small_stratocumulus_bank(blat, blon, alt+alt_offset,alpha); create_detailed_small_stratocumulus_bank(blat, blon, alt+alt_offset,alpha); - create_4_8_tstratus_patches(blat, blon, alt+alt_offset,alpha); - + #create_4_8_tstratus_patches(blat, blon, alt+alt_offset,alpha); + create_4_8_tstratus_domains(blat, blon, alt+alt_offset,alpha); + create_2_8_cirrostratus(blat, blon, alt+alt_offset + 25000.0,alpha); # and specify the atmosphere local_weather.set_atmosphere_ipoint(blat, blon, vis + 10000.0, alt+alt_offset, vis + 15000.0, 0.3, alt+alt_offset +20000.0, alt+alt_offset + 25000.0, 0.75, alt+alt_offset, alt+alt_offset + 2500.0); } -else if (rn > 0.222) +else if (rn > 0.3) { # cloud scenario 7: blended structured and unstructured Stratiform clouds - create_4_8_tstratus_patches(blat, blon, alt+alt_offset,alpha); + #create_4_8_tstratus_patches(blat, blon, alt+alt_offset,alpha); + create_4_8_tstratus_domains(blat, blon, alt+alt_offset,alpha); + create_4_8_sstratus_patches(blat, blon, alt+alt_offset,alpha); create_2_8_cirrostratus(blat, blon, alt+alt_offset + 25000.0,alpha); @@ -895,7 +977,7 @@ else if (rn > 0.222) # and specify the atmosphere local_weather.set_atmosphere_ipoint(blat, blon, vis + 10000.0, alt+alt_offset, vis + 15000.0, 0.2, alt+alt_offset +20000.0, alt+alt_offset + 25000.0, 0.75, alt+alt_offset, alt+alt_offset + 2500.0); } -else if (rn > 0.111) +else if (rn > 0.2) { # cloud scenario 8: Cumulus alleys beneath a high dense stratus cover @@ -903,12 +985,13 @@ else if (rn > 0.111) create_4_8_cumulus_alleys(blat, blon, alt+ alt_offset, alpha); local_weather.top_shade = 1.0; - create_6_8_tstratus_undulatus(blat, blon, alt+alt_offset + 6000.0,alpha); + #create_6_8_tstratus_undulatus(blat, blon, alt+alt_offset + 6000.0,alpha); + create_6_8_tstratus_mackerel(blat, blon, alt+alt_offset + 6000.0,alpha); # and specify the atmosphere local_weather.set_atmosphere_ipoint(blat, blon, vis + 10000.0, alt+alt_offset, vis + 15000.0, 0.5, alt+alt_offset +5500.0, alt+alt_offset + 6500.0, 0.65, alt+alt_offset + 6000.0, alt+alt_offset + 7500.0); } -else if (rn > 0.0) +else if (rn > 0.1) { # cloud scenario 9: weak Cumulus benath a high dense stratus cover @@ -917,15 +1000,29 @@ else if (rn > 0.0) strength = 0.2 + rand() * 0.2; #local_weather.create_cumosys(blat,blon, alt + alt_offset, get_n(strength), 20000.0); - var n = int(4000 * strength) * 0.2; + var n = int(3000 * strength) * 0.2; local_weather.cumulus_exclusion_layer(blat, blon, alt+alt_offset, n, 20000.0, 20000.0, alpha, 0.3,1.4 , size(elat), elat, elon, erad); local_weather.top_shade = 1.0; create_6_8_stratus(blat, blon, alt+alt_offset + 8000.0,alpha); + create_1_8_cirrus_bundle(blat, blon, alt+alt_offset + 34000.0,alpha); + # and specify the atmosphere local_weather.set_atmosphere_ipoint(blat, blon, vis + 10000.0, alt+alt_offset + 8000.0, vis + 15000.0, 0.7, alt+alt_offset +7500.0, alt+alt_offset + 8500.0, 0.65, alt+alt_offset + 8000.0, alt+alt_offset + 9500.0); } +else + { + # cloud scenario 10: broken structured Stratus cover + + + create_4_8_sstratus_bundle(blat, blon, alt+alt_offset,alpha); + + #create_2_8_cirrostratus(blat, blon, alt+alt_offset + 25000.0,alpha); + + # and specify the atmosphere + local_weather.set_atmosphere_ipoint(blat, blon, vis + 10000.0, alt+alt_offset, vis + 15000.0, 0.2, alt+alt_offset +20000.0, alt+alt_offset + 25000.0, 0.75, alt+alt_offset, alt+alt_offset + 2500.0); + } @@ -1022,7 +1119,9 @@ if (rn > 0.8) local_weather.create_effect_volume(2, blat+get_lat(x,y,phi), blon+get_lon(x,y,phi), 9000.0, 5000.0, beta, 0.0, alt + alt_offset, 5000.0, 0.3, -1, -1, -1,0 ,-1); local_weather.create_effect_volume(2, blat+get_lat(x,y,phi), blon+get_lon(x,y,phi), 8000.0, 4000.0, beta, 0.0, alt+alt_offset-300.0, 1500.0, 0.5, -1, -1, -1,0,-1 ); - create_4_8_sstratus_undulatus(blat, blon, alt+alt_offset +3000.0, alpha); + #create_4_8_sstratus_undulatus(blat, blon, alt+alt_offset +3000.0, alpha); + create_4_8_sstratus_bundle(blat, blon, alt+alt_offset +3000.0, alpha); + create_2_8_tstratus(blat, blon, alt+alt_offset +6000.0, alpha); # and specify the atmosphere @@ -1038,7 +1137,7 @@ else if (rn >0.6) create_8_8_stratus(blat, blon, alt+alt_offset,alpha); local_weather.create_effect_volume(3, blat, blon, 18000.0, 18000.0, 0.0, 0.0, 1800.0, 8000.0, -1, -1, -1, -1, 0,-1); local_weather.create_effect_volume(3, blat, blon, 14000.0, 14000.0, 0.0, 0.0, 1500.0, 6000.0, 0.1, -1, -1, -1,0,-1 ); - create_2_8_sstratus(blat, blon, alt+alt_offset+3000,alpha); + create_2_8_sstratus_bundle(blat, blon, alt+alt_offset+3000,alpha); # and specify the atmosphere local_weather.set_atmosphere_ipoint(blat, blon, vis + 17000.0, alt+alt_offset, vis + 25000.0, 0.3, alt+alt_offset +15000.0, alt+alt_offset + 20000.0, 0.6, alt+alt_offset, alt+alt_offset + 2500.0); @@ -1052,7 +1151,7 @@ else if (rn >0.4) alt = alt + local_weather.cloud_vertical_size_map["Stratus"] * 0.5 * m_to_ft; create_4_8_stratus(blat, blon, alt+alt_offset,alpha); create_4_8_stratus_patches(blat, blon, alt+alt_offset+3000,alpha); - create_4_8_sstratus_undulatus(blat, blon, alt+alt_offset+6000,alpha); + create_4_8_sstratus_bundle(blat, blon, alt+alt_offset+6000,alpha); create_2_8_tstratus(blat, blon, alt+alt_offset+8000,alpha); # and specify the atmosphere @@ -1065,7 +1164,7 @@ else if (rn >0.2) alt = alt + local_weather.cloud_vertical_size_map["Stratus"] * 0.5 * m_to_ft; create_6_8_stratus(blat, blon, alt+alt_offset,alpha); - create_2_8_sstratus(blat, blon, alt+alt_offset+6000,alpha); + create_2_8_sstratus_bundle(blat, blon, alt+alt_offset+6000,alpha); # and specify the atmosphere local_weather.set_atmosphere_ipoint(blat, blon, vis + 15000.0, alt+alt_offset, vis + 24000.0, 0.2, alt+alt_offset +15000.0, alt+alt_offset + 22000.0, 0.7 - rand() * 0.1, alt+alt_offset, alt+alt_offset + 2500.0); @@ -1344,8 +1443,8 @@ else if (rn > 0.6) var size_offset = 0.5 * m_to_ft * local_weather.cloud_vertical_size_map["Stratus_structured"]; - create_2_8_sstratus_streak(blat, blon, alt+alt_offset + size_offset + 2000.0, alpha); - create_2_8_sstratus_streak(blat, blon, alt+alt_offset + size_offset + 4000.0, alpha); + create_2_8_sstratus_bundle(blat, blon, alt+alt_offset + size_offset + 2000.0, alpha); + create_2_8_sstratus_hires_bundle(blat, blon, alt+alt_offset + size_offset + 4000.0, alpha); # and specify the atmosphere local_weather.set_atmosphere_ipoint(blat, blon, vis + 1000.0, alt+alt_offset, vis + 3000.0, 0.2, alt+alt_offset +20000.0, alt+alt_offset + 25000.0, 0.75, alt+alt_offset, alt+alt_offset + 2500.0); @@ -1371,8 +1470,9 @@ else if (rn > 0.2) var size_offset = 0.5 * m_to_ft * local_weather.cloud_vertical_size_map["Cirrocumulus"]; - create_4_8_cirrocumulus_undulatus(blat, blon, alt+alt_offset + size_offset + 6000.0, alpha); - + #create_4_8_cirrocumulus_undulatus(blat, blon, alt+alt_offset + size_offset + 6000.0, alpha); + create_2_8_perlucidus_mackerel(blat, blon, alt+alt_offset + size_offset + 6000.0, alpha); + # and specify the atmosphere local_weather.set_atmosphere_ipoint(blat, blon, vis + 1000.0, alt+alt_offset, vis + 3000.0, 0.2, alt+alt_offset +20000.0, alt+alt_offset + 25000.0, 0.72, alt+alt_offset, alt+alt_offset + 2500.0); } @@ -2371,12 +2471,14 @@ for (var i = n; i 0.75) + if (rn > 0.8) {create_4_8_stratus(blat, blon, altitude+metar_alt_offset, alpha);} - else if (rn > 0.5) + else if (rn > 0.6) {create_4_8_stratus_patches(blat, blon, altitude+metar_alt_offset, alpha);} - else if (rn > 0.25) + else if (rn > 0.4) {create_4_8_sstratus_patches(blat, blon, altitude+metar_alt_offset, alpha);} + else if (rn > 0.2) + {create_4_8_sstratus_bundle(blat, blon, altitude+metar_alt_offset, alpha);} else if (rn > 0.0) {create_4_8_sstratus_undulatus(blat, blon, altitude+metar_alt_offset, alpha);} } @@ -2386,10 +2488,12 @@ for (var i = n; i 0.5) + if (rn > 0.3) {create_2_8_stratus(blat, blon, altitude+metar_alt_offset, alpha);} - else if (rn > 0.0) - {create_2_8_sstratus(blat, blon, altitude+metar_alt_offset, alpha);} + else if (rn > 0.6) + {create_2_8_sstratus_bundle(blat, blon, altitude+metar_alt_offset, alpha);} + else + {create_2_8_sstratus_hires_bundle(blat, blon, altitude+metar_alt_offset, alpha);} } else { @@ -2409,7 +2513,7 @@ for (var i = n; i 4) { if (altitude < 14000.0) - {create_6_8_tstratus_undulatus(blat, blon, altitude+metar_alt_offset, alpha);} + {create_6_8_tstratus_mackerel(blat, blon, altitude+metar_alt_offset, alpha);} else {create_6_8_cirrostratus(blat, blon, altitude+metar_alt_offset, alpha);} } @@ -2417,9 +2521,9 @@ for (var i = n; i 0.75) - {create_4_8_tstratus_patches(blat, blon, altitude+metar_alt_offset, alpha);} + {create_4_8_tstratus_domains(blat, blon, altitude+metar_alt_offset, alpha);} else if (rn > 0.5) - {create_4_8_alttstratus_streaks(blat, blon, altitude+metar_alt_offset, alpha);} + {create_4_8_alttstratus_domains(blat, blon, altitude+metar_alt_offset, alpha);} else if (rn > 0.25) {create_4_8_alttstratus_patches(blat, blon, altitude+metar_alt_offset, alpha);} else if (rn > 0.0) @@ -2433,11 +2537,11 @@ for (var i = n; i 0.75) {create_2_8_tstratus(blat, blon, altitude+metar_alt_offset, alpha);} else if (rn > 0.5) - {create_2_8_sstratus(blat, blon, altitude+metar_alt_offset, alpha);} + {create_2_8_sstratus_bundle(blat, blon, altitude+metar_alt_offset, alpha);} else if (rn > 0.25) - {create_2_8_altocumulus_perlucidus(blat, blon, altitude+metar_alt_offset, alpha);} + {create_2_8_altocumulus_perlucidus_domains(blat, blon, altitude+metar_alt_offset, alpha);} else if (rn > 0.0) - {create_2_8_alttstratus(blat, blon, altitude+metar_alt_offset, alpha);} + {create_2_8_alttstratus_domains(blat, blon, altitude+metar_alt_offset, alpha);} } else { @@ -2445,9 +2549,9 @@ for (var i = n; i 0.9) {create_2_8_cirrocumulus_patches(blat, blon, altitude+metar_alt_offset, alpha);} if (rn > 0.4) - {create_2_8_cirrocumulus(blat, blon, altitude+metar_alt_offset, alpha);} + {create_1_8_alttstratus_domains(blat, blon, altitude+metar_alt_offset, alpha);} else if (rn > 0.0) - {create_2_8_alttstratus(blat, blon, altitude+metar_alt_offset, alpha);} + {create_2_8_alttstratus_domains(blat, blon, altitude+metar_alt_offset, alpha);} } } @@ -2901,6 +3005,37 @@ if (local_weather.hardcoded_clouds_flag == 1) {alt = alt - local_weather.offset_ local_weather.create_undulatus("Stratus (thin)",lat, lon, alt,300.0,10,4000.0,0.1,400.0,50,800.0,0.1,100.0, 1000.0, alpha,1.0); } +var create_6_8_tstratus_mackerel = func (lat, lon, alt, alpha) { + +var phi = alpha * math.pi/180.0; + +var x = 2.0 * (rand()-0.5) * 3000; +var y = 2.0 * (rand()-0.5) * 3000; + +var arg = {}; + +arg.cloud_spacing = 900.0; +arg.undulatus_spacing = 4200.0; +arg.undulatus_slant = 0.4; +arg.undulatus_amplitude = 2000.0; +arg.aspect = 0.5; +arg.Dx = 100.0; +arg.Dy = 100.0; +arg.xsize = 35000.0 + rand() * 10000.0; +arg.ysize = 35000.0 + rand() * 10000.0; +arg.blat = lat + get_lat(x,y,phi); +arg.blon = lon + get_lon(x,y,phi); +arg.balt = alt; +arg.alt_var = 0.0; +arg.dir = alpha; +arg.size_bias = 0.5; +arg.type = "Stratus (thin)"; + +local_weather.create_adv_undulatus(arg); +} + + + var create_6_8_cirrostratus = func (lat, lon, alt, alpha) { if (local_weather.hardcoded_clouds_flag == 1) {alt = alt - local_weather.offset_map["Cirrostratus"];} @@ -2993,7 +3128,36 @@ for (var i=0; i<22; i=i+1) local_weather.create_streak("Stratus (thin)",lat+get_lat(x,y,phi), lon+get_lon(x,y,phi), alt,300.0,m,1000.0,0.2,500.0,n,1000.0,0.2,500.0,alpha+beta,1.0); } +} + +var create_4_8_tstratus_domains = func (lat, lon, alt, alpha) { + +var arg = {}; + +arg.xsize = 36000.0; +arg.ysize = 36000.0; +arg.min_domain_size_x = 5000.0; +arg.max_domain_size_x = 24000.0; +arg.min_domain_size_y = 5000.0; +arg.max_domain_size_y = 24000.0; +arg.node_fraction = 0.0; +arg.halo_fraction = 0.4; +arg.n_domains = 12; +arg.n = 30; +arg.blat = lat; +arg.blon = lon; +arg.balt = alt; +arg.alt_var = 0.0; +arg.dir = alpha; +arg.type = "Stratus (thin)"; +arg.subtype = "large"; +arg.ntype = "Altocumulus perlucidus"; +arg.nsubtype = "large"; +arg.htype = "Stratus (thin)"; +arg.hsubtype = "small"; + +local_weather.create_domains(arg); } @@ -3217,7 +3381,9 @@ var tri = 1.0 + 0.4 * rand(); # create_cumulus_alleys = func (blat, blong, balt, alt_var, nx, xoffset, edgex, x_var, ny, yoffset, edgey, y_var, und_strength, direction, tri) -local_weather.create_cumulus_alleys(lat+get_lat(x,y,phi), lon+get_lon(x,y,phi), alt, 0.0, 9, 3500.0,0.2, 500.0, 30 ,1130.0, 0.2, 300.0, 1000.0, alpha,tri); +#local_weather.create_cumulus_alleys(lat+get_lat(x,y,phi), lon+get_lon(x,y,phi), alt, 0.0, 9, 3500.0,0.2, 500.0, 30 ,1130.0, 0.2, 300.0, 1000.0, alpha,tri);#local_weather.create_cumulus_alleys(lat+get_lat(x,y,phi), lon+get_lon(x,y,phi), alt, 0.0, 9, 3500.0,0.2, 500.0, 30 ,1130.0, 0.2, 300.0, 1000.0, alpha,tri); + +local_weather.create_cumulus_alleys(lat+get_lat(x,y,phi), lon+get_lon(x,y,phi), alt, 0.0, 8, 3930.0,0.2, 500.0, 25 ,1350.0, 0.2, 300.0, 1000.0, alpha,tri);#local_weather.create_cumulus_alleys(lat+get_lat(x,y,phi), lon+get_lon(x,y,phi), alt, 0.0, 9, 3500.0,0.2, 500.0, 30 ,1130.0, 0.2, 300.0, 1000.0, alpha,tri); } @@ -3250,6 +3416,387 @@ local_weather.create_streak("Cirrus",lat+get_lat(x,y,phi), lon+get_lon(x,y,phi), } +var create_4_8_sstratus_bundle = func (lat, lon, alt, alpha) { + +var phi = alpha * math.pi/180.0; + +var arg = {}; + +arg.cloud_spacing = 1500.0; +arg.stick_length_min = 6; +arg.stick_length_max = 12; +arg.stick_Dphi_min = 15.0 * math.pi/180.0; +arg.stick_Dphi_max = 55.0 * math.pi/180.0; +arg.Dx = 0.0; +arg.Dy = 0.0; +arg.balt = alt; +arg.alt_var = 0.0; +arg.dir = alpha; +arg.type = "Stratus structured CS"; + +local_weather.cloud_size_scale = 1.5; + +for (var i=0; i<4; i=i+1) + { + var x = 2.0 * (rand()-0.5) * 15000.0; + var y = 2.0 * (rand()-0.5) * 20000.0; + var rel_size_x = 0.8 + rand() * 0.2; + var rel_size_y = 0.5 + rand() * 0.5; + arg.xsize = 20000.0 * rel_size_x; + arg.ysize = 16000.0 * rel_size_y; + arg.n_sticks = int (20 * rel_size_y); + arg.blat = lat+get_lat(x,y,phi); + arg.blon = lon+get_lon(x,y,phi); + local_weather.create_stick_bundle(arg); + } + +local_weather.cloud_size_scale = 1.0; +} + + +var create_4_8_sstratus_domains = func (lat, lon, alt, alpha) { + +var arg = {}; + +arg.xsize = 35000.0; +arg.ysize = 35000.0; +arg.min_domain_size_x = 10000.0; +arg.max_domain_size_x = 20000.0; +arg.min_domain_size_y = 10000.0; +arg.max_domain_size_y = 20000.0; +arg.node_fraction = 0.0; +arg.halo_fraction = 0.6; +arg.n_domains = 8; +arg.n = 30; +arg.blat = lat; +arg.blon = lon; +arg.balt = alt; +arg.alt_var = 0.0; +arg.dir = alpha; +arg.type = "Stratus (structured)"; +arg.subtype = "large"; +arg.ntype = "Altocumulus perlucidus"; +arg.nsubtype = "large"; +arg.htype = "Stratus (structured)"; +arg.hsubtype = "small"; + +local_weather.create_domains(arg); +} + +var create_4_8_cirrus_bundle = func (lat, lon, alt, alpha) { + +var phi = alpha * math.pi/180.0; + +var x = 2.0 * (rand()-0.5) * 12000; +var y = 2.0 * (rand()-0.5) * 12000; + +var arg = {}; + +arg.cloud_spacing = 1100.0; +arg.n_sticks = 17; +arg.stick_length_min = 16; +arg.stick_length_max = 34; +arg.stick_Dphi_min = 15.0 * math.pi/180.0; +arg.stick_Dphi_max = 45.0 * math.pi/180.0; +arg.Dx = 0.0; +arg.Dy = 250.0; +arg.xsize = 40000.0; +arg.ysize = 40000.0; +arg.blat = lat+get_lat(x,y,phi); +arg.blon = lon+get_lon(x,y,phi); +arg.balt = alt; +arg.alt_var = 0.0; +arg.dir = alpha; +arg.type = "Fogpatch"; + +local_weather.cloud_size_scale = 12.0; +local_weather.create_stick_bundle(arg); +local_weather.cloud_size_scale = 1.0; +} + + +var create_4_8_alttstratus_domains = func (lat, lon, alt, alpha) { + +var arg = {}; + +arg.xsize = 35000.0; +arg.ysize = 35000.0; +arg.min_domain_size_x = 6000.0; +arg.max_domain_size_x = 12000.0; +arg.min_domain_size_y = 3000.0; +arg.max_domain_size_y = 6000.0; +arg.node_fraction = 0.1; +arg.halo_fraction = 0.7; +arg.n_domains = 40; +arg.n = 30; +arg.blat = lat; +arg.blon = lon; +arg.balt = alt; +arg.alt_var = 0.0; +arg.dir = alpha; +arg.type = "Cirrocumulus (cloudlet)"; +arg.subtype = "large"; +arg.ntype = "Stratus (thin)"; +arg.nsubtype = "small"; +arg.htype = "Cirrocumulus (cloudlet)"; +arg.hsubtype = "small"; + +local_weather.create_domains(arg); +} + + +var create_2_8_sstratus_bundle = func (lat, lon, alt, alpha) { + +var phi = alpha * math.pi/180.0; + +var x = 2.0 * (rand()-0.5) * 12000; +var y = 2.0 * (rand()-0.5) * 12000; + +var arg = {}; + +arg.cloud_spacing = 1500.0; +arg.n_sticks = 30; +arg.stick_length_min = 6; +arg.stick_length_max = 12; +arg.stick_Dphi_min = 15.0 * math.pi/180.0; +arg.stick_Dphi_max = 55.0 * math.pi/180.0; +arg.Dx = 0.0; +arg.Dy = 0.0; +arg.xsize = 20000.0 + rand() * 2000.0; +arg.ysize = 8000.0 + rand() * 8000.0; +arg.blat = lat+get_lat(x,y,phi); +arg.blon = lon+get_lon(x,y,phi); +arg.balt = alt; +arg.alt_var = 0.0; +arg.dir = alpha; +arg.type = "Stratus structured CS"; + +local_weather.cloud_size_scale = 1.5; +local_weather.create_stick_bundle(arg); +local_weather.cloud_size_scale = 1.0; +} + +var create_2_8_sstratus_hires_bundle = func (lat, lon, alt, alpha) { + +var phi = alpha * math.pi/180.0; + +var x = 2.0 * (rand()-0.5) * 20000; +var y = 2.0 * (rand()-0.5) * 20000; + +var arg = {}; + +arg.cloud_spacing = 500.0; +arg.n_sticks = 40; +arg.stick_length_min = 8; +arg.stick_length_max = 16; +arg.stick_Dphi_min = 15.0 * math.pi/180.0; +arg.stick_Dphi_max = 55.0 * math.pi/180.0; +arg.Dx = 200.0; +arg.Dy = 200.0; +arg.xsize = 12000.0 + rand() * 2000.0; +arg.ysize = 6000.0 + rand() * 5000.0; +arg.blat = lat+get_lat(x,y,phi); +arg.blon = lon+get_lon(x,y,phi); +arg.balt = alt; +arg.alt_var = 0.0; +arg.dir = alpha; +arg.type = "Stratus structured CS"; + +local_weather.cloud_size_scale = 0.7; +local_weather.create_stick_bundle(arg); + +var x = 2.0 * (rand()-0.5) * 20000; +var y = 2.0 * (rand()-0.5) * 20000; +arg.blat = lat+get_lat(x,y,phi); +arg.blon = lon+get_lon(x,y,phi); +arg.xsize = 12000.0 + rand() * 2000.0; +arg.ysize = 6000.0 + rand() * 5000.0; +local_weather.create_stick_bundle(arg); + +local_weather.cloud_size_scale = 1.0; +} + +var create_2_8_cirrostratus_mackerel = func (lat, lon, alt, alpha) { + +var phi = alpha * math.pi/180.0; + +var x = 2.0 * (rand()-0.5) * 12000; +var y = 2.0 * (rand()-0.5) * 12000; + +var arg = {}; + +arg.cloud_spacing = 250.0; +arg.undulatus_spacing = 2400.0; +arg.undulatus_slant = 0.0; +arg.undulatus_amplitude = 800.0; +arg.aspect = 0.7; +arg.Dx = 100.0; +arg.Dy = 0.0; +arg.xsize = 35000.0; +arg.ysize = 35000.0; +arg.blat = lat + get_lat(x,y,phi); +arg.blon = lon + get_lon(x,y,phi); +arg.balt = alt; +arg.alt_var = 0.0; +arg.dir = alpha; +arg.size_bias = 0.0; +arg.type = "Cirrostratus (small)"; + +local_weather.create_adv_undulatus(arg); +} + +var create_2_8_perlucidus_mackerel = func (lat, lon, alt, alpha) { + +var phi = alpha * math.pi/180.0; + +var x = 2.0 * (rand()-0.5) * 12000; +var y = 2.0 * (rand()-0.5) * 12000; + +var arg = {}; + +arg.cloud_spacing = 150.0; +arg.undulatus_spacing = 2100.0; +arg.undulatus_slant = 30.0 + rand() * 40; +arg.undulatus_amplitude = 200.0 + rand() * 100.0; +arg.aspect = 0.7; +arg.Dx = 100.0; +arg.Dy = 0.0; +arg.xsize = 22000.0 + rand() * 10000.0; +arg.ysize = 32000.0 + rand() * 10000.0; +arg.blat = lat + get_lat(x,y,phi); +arg.blon = lon + get_lon(x,y,phi); +arg.balt = alt; +arg.alt_var = 0.0; +arg.dir = alpha; +arg.size_bias = 0.0; +arg.type = "Cirrocumulus (cloudlet)"; + +local_weather.create_adv_undulatus(arg); +} + + +var create_2_8_alttstratus_domains = func (lat, lon, alt, alpha) { + +var arg = {}; + +arg.xsize = 35000.0; +arg.ysize = 35000.0; +arg.min_domain_size_x = 6000.0; +arg.max_domain_size_x = 12000.0; +arg.min_domain_size_y = 3000.0; +arg.max_domain_size_y = 6000.0; +arg.node_fraction = 0.1; +arg.halo_fraction = 0.7; +arg.n_domains = 20; +arg.n = 30; +arg.blat = lat; +arg.blon = lon; +arg.balt = alt; +arg.alt_var = 0.0; +arg.dir = alpha; +arg.type = "Cirrocumulus (cloudlet)"; +arg.subtype = "large"; +arg.ntype = "Stratus (thin)"; +arg.nsubtype = "small"; +arg.htype = "Cirrocumulus (cloudlet)"; +arg.hsubtype = "small"; + +local_weather.create_domains(arg); +} + + + +var create_2_8_altocumulus_domains = func (lat, lon, alt, alpha) { + +var arg = {}; + +arg.xsize = 35000.0; +arg.ysize = 35000.0; +arg.min_domain_size_x = 10000.0; +arg.max_domain_size_x = 20000.0; +arg.min_domain_size_y = 10000.0; +arg.max_domain_size_y = 10000.0; +arg.node_fraction = 0.0; +arg.halo_fraction = 0.6; +arg.n_domains = 15; +arg.n = 60; +arg.blat = lat; +arg.blon = lon; +arg.balt = alt; +arg.alt_var = 0.0; +arg.dir = alpha; +arg.type = "Altocumulus"; +arg.subtype = "large"; +arg.ntype = "Altocumulus"; +arg.nsubtype = "large"; +arg.htype = "Altocumulus"; +arg.hsubtype = "small"; + +local_weather.create_domains(arg); +} + + + + +var create_2_8_altocumulus_perlucidus_domains = func (lat, lon, alt, alpha) { + +var arg = {}; + +arg.xsize = 35000.0; +arg.ysize = 35000.0; +arg.min_domain_size_x = 15000.0; +arg.max_domain_size_x = 22000.0; +arg.min_domain_size_y = 6000.0; +arg.max_domain_size_y = 8000.0; +arg.node_fraction = 0.1; +arg.halo_fraction = 0.6; +arg.n_domains = 14; +arg.n = 30; +arg.blat = lat; +arg.blon = lon; +arg.balt = alt; +arg.alt_var = 0.0; +arg.dir = alpha; +arg.type = "Altocumulus perlucidus"; +arg.subtype = "small"; +arg.ntype = "Altocumulus perlucidus"; +arg.nsubtype = "large"; +arg.htype = "Cirrocumulus (cloudlet)"; +arg.hsubtype = "small"; + +local_weather.create_domains(arg); +} + +var create_2_8_cirrocumulus_domains = func (lat, lon, alt, alpha) { + +var arg = {}; + +arg.xsize = 25000.0; +arg.ysize = 25000.0; +arg.min_domain_size_x = 8000.0; +arg.max_domain_size_x = 10000.0; +arg.min_domain_size_y = 3000.0; +arg.max_domain_size_y = 5000.0; +arg.node_fraction = 0.0; +arg.halo_fraction = 0.7; +arg.n_domains = 10; +arg.n = 200; +arg.blat = lat; +arg.blon = lon; +arg.balt = alt; +arg.alt_var = 0.0; +arg.dir = alpha; +arg.type = "Cirrocumulus (new)"; +arg.subtype = "large"; +arg.ntype = "Cirrocumulus (new)"; +arg.nsubtype = "large"; +arg.htype = "Cirrocumulus (new)"; +arg.hsubtype = "small"; + +local_weather.create_domains(arg); +} + + var create_2_8_stratus = func (lat, lon, alt, alpha) { if (local_weather.hardcoded_clouds_flag == 1) {alt = alt - local_weather.offset_map["Stratus"];} @@ -3415,7 +3962,66 @@ for (var i=0; i<2; i=i+1) } } +var create_1_8_cirrocumulus_mackerel = func (lat, lon, alt, alpha) { +var phi = alpha * math.pi/180.0; + +var x = 2.0 * (rand()-0.5) * 12000; +var y = 2.0 * (rand()-0.5) * 12000; + +var arg = {}; + +arg.cloud_spacing = 40.0; +arg.undulatus_spacing = 320.0; +arg.undulatus_slant = 20.0; +arg.undulatus_amplitude = 100.0; +arg.aspect = 0.7; +arg.Dx = 30.0; +arg.Dy = 5.0; +arg.xsize = 7000.0 + rand() * 5000.0; +arg.ysize = 12000.0 + rand() * 4000.0; +arg.blat = lat+get_lat(x,y,phi); +arg.blon = lon+get_lon(x,y,phi); +arg.balt = alt; +arg.alt_var = 0.0; +arg.dir = alpha; +arg.size_bias = 0.0; +arg.type = "Cirrocumulus (new)"; +#arg.type = "Fogpatch"; + +local_weather.create_adv_undulatus(arg); +} + +var create_1_8_alttstratus_domains = func (lat, lon, alt, alpha) { + +if (local_weather.hardcoded_clouds_flag == 1) {alt = alt - 300.0;} + +var arg = {}; + +arg.xsize = 35000.0; +arg.ysize = 35000.0; +arg.min_domain_size_x = 6000.0; +arg.max_domain_size_x = 12000.0; +arg.min_domain_size_y = 3000.0; +arg.max_domain_size_y = 6000.0; +arg.node_fraction = 0.1; +arg.halo_fraction = 0.7; +arg.n_domains = 7; +arg.n = 30; +arg.blat = lat; +arg.blon = lon; +arg.balt = alt; +arg.alt_var = 0.0; +arg.dir = alpha; +arg.type = "Cirrocumulus (cloudlet)"; +arg.subtype = "large"; +arg.ntype = "Stratus (thin)"; +arg.nsubtype = "small"; +arg.htype = "Cirrocumulus (cloudlet)"; +arg.hsubtype = "small"; + +local_weather.create_domains(arg); +} @@ -3470,6 +4076,39 @@ local_weather.create_streak("Cirrus",lat+get_lat(x,y,phi), lon+get_lon(x,y,phi), } +var create_1_8_cirrus_bundle = func (lat, lon, alt, alpha) { + +var phi = alpha * math.pi/180.0; + +var x = 2.0 * (rand()-0.5) * 12000; +var y = 2.0 * (rand()-0.5) * 12000; + +var arg = {}; + +arg.cloud_spacing = 1100.0; +arg.n_sticks = 4; +arg.stick_length_min = 16; +arg.stick_length_max = 34; +arg.stick_Dphi_min = 15.0 * math.pi/180.0; +arg.stick_Dphi_max = 45.0 * math.pi/180.0; +arg.Dx = 0.0; +arg.Dy = 250.0; +arg.xsize = 40000.0; +arg.ysize = 40000.0; +arg.blat = lat+get_lat(x,y,phi); +arg.blon = lon+get_lon(x,y,phi); +arg.balt = alt; +arg.alt_var = 0.0; +arg.dir = alpha; +arg.type = "Fogpatch"; + +local_weather.cloud_size_scale = 12.0; +local_weather.create_stick_bundle(arg); +local_weather.cloud_size_scale = 1.0; +} + + + var create_1_8_cirrostratus_undulatus = func (lat, lon, alt, alpha) { if (local_weather.hardcoded_clouds_flag == 1) {alt = alt - local_weather.offset_map["Cirrostratus"];} diff --git a/Nasal/route_manager.nas b/Nasal/route_manager.nas index 3ccfefff1..a3f1e2a3e 100644 --- a/Nasal/route_manager.nas +++ b/Nasal/route_manager.nas @@ -1,13 +1,13 @@ -# route_manager.nas - default FlightPlan delegate corresponding to the build -# in route-manager dialog. Intended to provide a sensible default behaviour, -# but be disabled by an aircraft-specific FMS / GPS system. +# route_manager.nas - FlightPlan delegate(s) corresponding to the built- +# in route-manager dialog and GPS. Intended to provide a sensible default behaviour, +# but can be disabled by an aircraft-specific FMS / GPS system. var RouteManagerDelegate = { new: func(fp) { - # if this property is set, don't build a delegate at all - if (getprop('/autopilot/route-manager/disable-fms')) - return nil; - + # if this property is set, don't build a delegate at all + if (getprop('/autopilot/route-manager/disable-route-manager')) + return nil; + var m = { parents: [RouteManagerDelegate] }; m.flightplan = fp; return m; @@ -82,17 +82,70 @@ var RouteManagerDelegate = { fgcommand("activate-flightplan", props.Node.new({"activate": 0})); }, + endOfFlightPlan: func + { + debug.dump("end of flight-plan, deactivating"); + fgcommand("activate-flightplan", props.Node.new({"activate": 0})); + } +}; + + +var FMSDelegate = { + new: func(fp) { + # if this property is set, don't build a delegate at all + if (getprop('/autopilot/route-manager/disable-fms')) + return nil; + + var m = { parents: [FMSDelegate], flightplan:fp, landingCheck:nil }; + return m; + }, + + _landingCheckTimeout: func + { + var cur = me.flightplan.currentWP(); + var wow = getprop('gear/gear[0]/wow'); + var gs = getprop('velocities/groundspeed-kt'); + if (wow and (gs < 25)) { + debug.dump('touchdown on destination runway, end of route.'); + me.landingCheck.stop(); + # record touch-down time? + me.flightplan.finish(); + } + }, + waypointsChanged: func { }, + endOfFlightPlan: func + { + debug.dump('end of flight-plan'); + }, + currentWaypointChanged: func { - debug.dump('saw current WP changed, now ' ~ me.flightplan.current); + if (me.landingCheck != nil) { + me.landingCheck.stop(); + me.landingCheck = nil; # delete timer + } + + #debug.dump('saw current WP changed, now ' ~ me.flightplan.current); + var active = me.flightplan.currentWP(); + if (active == nil) return; + + if (active.alt_cstr_type != 'none') { + debug.dump('new WP has valid altitude restriction, setting on AP'); + setprop('/autopilot/settings/target-altitude-ft', active.alt_cstr); + } + + var activeRunway = active.runway(); + if ((activeRunway != nil) and (activeRunway.id == me.flightplan.destination_runway.id)) { + me.landingCheck = maketimer(2.0, me, FMSDelegate._landingCheckTimeout); + me.landingCheck.start(); + } } }; -# debug.dump('register routemanager delegate factory'); - +registerFlightPlanDelegate(FMSDelegate.new); registerFlightPlanDelegate(RouteManagerDelegate.new); diff --git a/Nasal/tanker.nas b/Nasal/tanker.nas index 420d09fd2..c4ed56850 100644 --- a/Nasal/tanker.nas +++ b/Nasal/tanker.nas @@ -70,7 +70,7 @@ var identity = { var Tanker = { - new: func(aiid, callsign, tacan, type, model, kias, maxfuel, pattern, heading, coord) { + new: func(aiid, callsign, tacan, type, model, kias, maxfuel, pattern, contacts, heading, coord) { var m = { parents: [Tanker] }; m.callsign = callsign; m.tacan = tacan; @@ -79,6 +79,7 @@ var Tanker = { m.out_of_range_time = 0; m.interval = 10; m.length = pattern; + m.contacts = contacts; m.roll = 0; m.coord = geo.Coord.new(coord); m.anchor = geo.Coord.new(coord).apply_course_distance(m.track_course, m.length); # ARCP @@ -155,7 +156,7 @@ var Tanker = { } var distance = dt * (me.ktas - me.headwind) * NM2M / 3600; - var deviation = me.roll ? 0.5 * dt * 1085.941 * math.tan(me.roll * D2R) / me.ktas : 0; + var deviation = me.roll ? dt * 1085.941 * math.tan(me.roll * D2R) / me.ktas : 0; if (me.mode == "leg") { if (me.lastmode != "leg") { @@ -218,9 +219,43 @@ var Tanker = { me.brgN.setDoubleValue(me.bearing); me.elevN.setDoubleValue(elev); - me.contactN.setBoolValue(me.distance < ac_contact_dist and - dalt > 0 and - abs(view.normdeg(me.bearing - ac_hdg)) < 20); + # Determine if any of the contact points are in contact + var offset_x = getprop("/systems/refuel/offset-x-m") or 0; + var offset_y = getprop("/systems/refuel/offset-y-m") or 0; + var offset_z = getprop("/systems/refuel/offset-z-m") or 0; + var roll = getprop("/orientation/roll-deg") * globals.D2R; + + # Determine contact position + var probe_pos = geo.Coord.new(me.ac); + + probe_pos.apply_course_distance(ac_hdg, offset_x); + probe_pos.apply_course_distance(ac_hdg + 90, offset_y * math.cos(roll) + offset_z * math.sin(roll)); + probe_pos.set_alt(me.ac.alt() + offset_z * math.cos(roll) - offset_y * math.sin(roll)); + + me.contactN.setBoolValue(0); + + foreach (var c; me.contacts) { + var drogue_pos = geo.Coord.new(me.coord); + + # Offset longitudonally + drogue_pos.apply_course_distance(me.course, c.x); + + var r = me.roll * globals.D2R; + + # Offset laterally, taking into account any roll + drogue_pos.apply_course_distance(me.course +90, c.y * math.cos(r) + c.z * math.sin(r)); + + # Offset vertically, again, taking into account any roll + drogue_pos.set_alt(drogue_pos.alt() + c.z * math.cos(r) - c.y * math.sin(r)); + + #print("Distance: " ~ probe_pos.distance_to(drogue_pos) ~ " vs. " ~ me.distance); + + if (probe_pos.distance_to(drogue_pos) < ac_contact_dist and + abs(view.normdeg(me.course - ac_hdg)) < 20) { + # Contact! + me.contactN.setBoolValue(1); + } + } me.hOffsetN.setDoubleValue(me.bearing - ac_hdg); me.vOffsetN.setDoubleValue(elev - ac_pitch); @@ -278,13 +313,27 @@ var create_tanker = func(tanker_node, course) { var spd = tanker_node.getNode("speed-kts", 1).getValue() or 250; var pattern = (tanker_node.getNode("pattern-length-nm", 1).getValue() or 50) * NM2M; var maxfuel = tanker_node.getNode("max-fuel-transfer-lbs-min", 1).getValue() or 6000; + + var contacts = []; + + foreach (var contact; tanker_node.getChildren("contact")) { + var x = (contact.getNode("x-m") != nil) ? contact.getNode("x-m").getValue() : 0; + var y = (contact.getNode("y-m") != nil) ? contact.getNode("y-m").getValue() : 0; + var z = (contact.getNode("z-m") != nil) ? contact.getNode("z-m").getValue() : 0; + append(contacts, { "x" : x, "y" : y, "z" : z }); + } + + + if (size(contacts) == 0) { + append(contacts, {x: 0, y:0, z:0}); + } var alt = int(10 + rand() * 15) * 1000; # FL100--FL250 alt = skip_cloud_layer(alt * FT2M); var dist = 6000 + rand() * 4000; var coord = geo.aircraft_position().apply_course_distance(course, dist).set_alt(alt); - Tanker.new(aiid, callsign, tacanid, type, model, spd, maxfuel, pattern, course, coord); + Tanker.new(aiid, callsign, tacanid, type, model, spd, maxfuel, pattern, contacts, course, coord); } # Request a new tanker diff --git a/Shaders/3dcloud-lightfield.vert b/Shaders/3dcloud-lightfield.vert index a3e580bfe..0d1797f61 100644 --- a/Shaders/3dcloud-lightfield.vert +++ b/Shaders/3dcloud-lightfield.vert @@ -12,6 +12,7 @@ uniform float altitude; uniform float cloud_self_shading; uniform float visibility; uniform float moonlight; +uniform float air_pollution; attribute vec3 usrAttr1; attribute vec3 usrAttr2; @@ -151,8 +152,8 @@ void main(void) float lightArg = (terminator-yprime_alt)/100000.0; - light_diffuse.b = light_func(lightArg, 1.330e-05, 0.264, 2.227, 1.08e-05, 1.0); - light_diffuse.g = light_func(lightArg, 3.931e-06, 0.264, 3.827, 7.93e-06, 1.0); + light_diffuse.b = light_func(lightArg -1.2 * air_pollution, 1.330e-05, 0.264, 2.227, 1.08e-05, 1.0); + light_diffuse.g = light_func(lightArg -0.6 * air_pollution, 3.931e-06, 0.264, 3.827, 7.93e-06, 1.0); light_diffuse.r = light_func(lightArg, 8.305e-06, 0.161, 3.827, 3.04e-05, 1.0); light_diffuse.a = 1.0; @@ -160,9 +161,9 @@ void main(void) light_diffuse.rgb = intensity * normalize(mix(light_diffuse.rgb, shadedFogColor, (1.0 - smoothstep(0.5,0.9, min(scattering, cloud_self_shading) )))); // correct ambient light intensity and hue before sunrise - if (earthShade < 0.8) + if (earthShade < 0.6) { - light_diffuse.rgb = intensity * normalize(mix(light_diffuse.rgb, shadedFogColor, 1.0 -smoothstep(0.1, 0.8,earthShade ) )); + light_diffuse.rgb = intensity * normalize(mix(light_diffuse.rgb, shadedFogColor, 1.0 -smoothstep(0.1, 0.6,earthShade ) )); } diff --git a/gui/dialogs/environment-settings.xml b/gui/dialogs/environment-settings.xml index d066cbd71..e0c797315 100644 --- a/gui/dialogs/environment-settings.xml +++ b/gui/dialogs/environment-settings.xml @@ -148,6 +148,9 @@ + + /sim/rendering/shaders/skydome + left 3 @@ -155,6 +158,9 @@ + + /sim/rendering/shaders/skydome + right 3 @@ -162,6 +168,9 @@ + + /sim/rendering/shaders/skydome + snow-thickness 3 2 @@ -176,6 +185,9 @@ + + /sim/rendering/shaders/skydome + left 3 @@ -183,6 +195,9 @@ + + /sim/rendering/shaders/skydome + left 4 @@ -190,6 +205,9 @@ + + /sim/rendering/shaders/skydome + right 4 @@ -197,6 +215,9 @@ + + /sim/rendering/shaders/skydome + dust-level 4 2 @@ -211,6 +232,9 @@ + + /sim/rendering/shaders/skydome + left 4 @@ -218,6 +242,9 @@ + + /sim/rendering/shaders/skydome + left 5 @@ -225,6 +252,9 @@ + + /sim/rendering/shaders/skydome + right 5 @@ -232,6 +262,9 @@ + + /sim/rendering/shaders/skydome + wetness 5 2 @@ -246,6 +279,9 @@ + + /sim/rendering/shaders/skydome + left 5 @@ -254,6 +290,9 @@ + + /sim/rendering/shaders/skydome + left 6 @@ -261,6 +300,9 @@ + + /sim/rendering/shaders/skydome + right 6 @@ -268,6 +310,9 @@ + + /sim/rendering/shaders/skydome + lichen-level 6 2 @@ -282,6 +327,9 @@ + + /sim/rendering/shaders/skydome + left 6 @@ -290,13 +338,19 @@ - + + /sim/rendering/shaders/skydome + + left 7 0 + + /sim/rendering/shaders/skydome + right 7 @@ -304,6 +358,9 @@ + + /sim/rendering/shaders/skydome + season 7 2 @@ -318,6 +375,9 @@ + + /sim/rendering/shaders/skydome + left 7 diff --git a/gui/dialogs/gps.xml b/gui/dialogs/gps.xml index b3722091f..73d99691b 100644 --- a/gui/dialogs/gps.xml +++ b/gui/dialogs/gps.xml @@ -4,23 +4,134 @@ 430 false - + 1); + updateScratch(); + } + + var doScratchNext = func + { + var index = dlg.getNode("scratch-index").getValue(); + var lastIndex = size(searchResults) - 1; + if (index == lastIndex) return; + + dlg.getNode("scratch-has-next", 1).setValue((index + 1) < lastIndex); + dlg.getNode("scratch-index").setValue(index + 1); + updateScratch(); + } + + var searchResults = []; + updateSearchResults(0); + var slaved = props.globals.getNode("/instrumentation/nav[0]/slaved-to-gps", 1); - + ]]> + gps vbox @@ -304,6 +415,8 @@ ndb fix wpt + city + town true dialog-apply @@ -336,36 +449,21 @@ Search nasal - + @@ -484,7 +578,7 @@ diff --git a/gui/dialogs/route-manager.xml b/gui/dialogs/route-manager.xml index 1781c7471..1b72bb38e 100644 --- a/gui/dialogs/route-manager.xml +++ b/gui/dialogs/route-manager.xml @@ -224,9 +224,38 @@ command interface /autopilot/route-manager/input: gui.dialog_update("route-manager", "approach"); } - + var initPosition = func { + var routeActive = routem.getNode("active").getValue(); + if (routeActive) return; + + # FIXME have user waypoints check + var fp = flightplan(); + + var airborne = getprop('/gear/gear[0]/wow') == 0; + if (airborne) { + debug.dump('route-manager dialog, init in-air, clearing departure settings'); + fp.departure = nil; + return; + } + + + + # we're on the ground, find the nearest airport to start from + if (fp.departure == nil) { + var apts = findAirportsWithinRange(25.0); + if (size(apts) == 0) return; # no airports nearby + fp.departure = apts[0]; # use the closest one + } + + if (fp.departure_runway == nil) { + debug.dump('selecting departure runway'); + var rwy = fp.departure.findBestRunwayForPos( geo.aircraft_position() ); + fp.departure_runway = rwy; + } + } + # initialise departure values based on current position - cmd.setValue("@posinit"); + initPosition(); updateRunways(); updateSIDs();