File:Tidally locked desert planet surface temperature 1 1 1 1.png
![File:Tidally locked desert planet surface temperature 1 1 1 1.png](https://upload.wikimedia.org/wikipedia/commons/thumb/1/17/Tidally_locked_desert_planet_surface_temperature_1_1_1_1.png/800px-Tidally_locked_desert_planet_surface_temperature_1_1_1_1.png?20231030070817)
Original file (1,279 × 766 pixels, file size: 265 KB, MIME type: image/png)
Captions
Captions
Summary
[edit]DescriptionTidally locked desert planet surface temperature 1 1 1 1.png |
English: Trappist 1 simulated temperature. Assumptions ocean planet, slow rotation of substellar point. Atmosphere convection, assumed pressure, radius and mass same than Earth has. Solan insolation influx S=0.65 Sol. |
Date | |
Source | Own work |
Author | Merikanto |
Data for this image is simulated with Climt, without dynamical corea.
Warning: alpha only, take screenshot/save plot before code run crashes.
Installed to linux anaconda python 3.11 in that version of Python
seems to be function properly.
Version that i have used
"pip install gfs-dynamical-core"
Simulation packages git, pypi
https://github.com/CliMT/climt
https://github.com/Ai33L/gfs_dynamical_core
https://pypi.org/project/climt/
https://pypi.org/project/gfs-dynamical-core/
https://climt.readthedocs.io/en/latest/
Python 3 climt/gfs-dynamical core code, beta stage
- tidally locked desert planet temperature simulation python3 climt code
-
- Important note:
- uses Ubuntu Anaconda Python 3.10.11 and sometimes gfs_dynamical_core
-
- 20.10.2023 v 0000.0004
-
-
- if you use gfs_dynamical_core
-
- must create Python 3.10 enviroment in conda, ant then: pip install gfs-dynamical-core
- maybe not function in other python versions!
- gfs_dynamical_core
- pip install gfs_dynamical core
- of from source download sit source tree
- https://github.com/Ai33L/gfs_dynamical_core
- and mote to its directory "gfs_dynamical_core-develop"
- and then in python 3.9 ## pip install .
- 3
import matplotlib as mpl
import math
import numpy as np
import scipy.ndimage
from datetime import timedelta
from datetime import datetime
from netCDF4 import Dataset
- import sympl
- import gfs_dynamical_core
import climt
from sympl import (
DataArray, PlotFunctionMonitor,NetCDFMonitor,
AdamsBashforth
)
from climt import (
EmanuelConvection, RRTMGShortwave, RRTMGLongwave, SlabSurface,
DryConvectiveAdjustment, SimplePhysics, BucketHydrology, get_default_state
)
- basic params
steppi=4 # timestep hours
- dimx=16 ## dim of grid
- dimy=8
dimz=6
dimx=8 ## dim of grid
dimy=4
dimz=6
- pix=8 ## temperature et al specimen point insige grid
- piy=4
- piz=3
- S1=1.0
S1=0.65 ## solar constant coeff
co2coeff=1.0 ## co2 x330
- albedo=0.07 ## basalt surface like Moon
- albedo=0.30 ## like Earth
albedo=0.5
qq=0
qqlimit=int(24/steppi)
hourticks1=np.arange(0,24, steppi)
- print (hourticks1)
- quit(-1)
tempcache=np.zeros(qqlimit)+15
def save_netcdf_x(name1, blok1):
sheip1=np.shape(blok1)
dimx=sheip1[1]
dimy=sheip1[0]
ds = Dataset(name1, 'w', format='NETCDF4')
lat = ds.createDimension('lat', dimy)
lon = ds.createDimension('lon', dimx)
lats = ds.createVariable('lat', 'f4', ('lat',))
lons = ds.createVariable('lon', 'f4', ('lon',))
Tempe = ds.createVariable('Temperature', 'f4', ('lat', 'lon',))
Tempe.units = 'deg C'
lats[:] = np.arange(90, -90, -180/(dimy+0))
lons[:] = np.arange(-180.0, 180, 360/(dimx+0))
Tempe[:, :] = blok1
ds.close()
def plot_function(fig, state):
global qq, qqlimit
global tempcache
global pix, piy
global hourticks1
vmin1=-100
vmax1=100
Tsurf=np.array(state['surface_temperature']-273.15)
lons1=np.mean(state['longitude'], axis=0)
lats1=np.mean(state['latitude'], axis=1)
zonetemps=np.array(np.mean( Tsurf, axis=1))
lats2=np.array(np.mean( state['latitude'], axis=1))
print(zonetemps)
print(lats2)
lats3=lats2*math.pi/10
coslats=np.cos(lats2)
weightemps=zonetemps*np.abs(coslats)*np.abs(coslats)
meantemp=np.mean(weightemps)
print(" T mean ",meantemp)
ax = fig.add_subplot(2, 2, 1)
ax.contourf(state['longitude'], state['latitude'],
Tsurf, cmap=mpl.colormaps['turbo'], origin='lower',levels=10,extent=[0,360,-90,90])
#ax.imshow(Tsurf, origin='lower', vmin=vmin1, vmax=vmax1, cmap=mpl.colormaps['turbo'],extent=[0,360,-90,90])
cs1=ax.contour(state['longitude'], state['latitude'],
state['surface_temperature']-273.15, colors="k",levels=10, origin='lower', vmin=vmin1, vmax=vmax1, extent=[0,360,-90,90])
ax.clabel(cs1, cs1.levels, inline=True, fmt="%.1f", fontsize=16)
ax.set_xlabel('Longitude')
ax.set_ylabel('Latitude')
fig.suptitle('Surface temperature '+str(round(meantemp,2))+' at time: '+str(state['time']))
fig.canvas.draw()
fig.canvas.flush_events()
ax2 = fig.add_subplot(2, 2, 2)
#fig.suptitle('Tsurf lon profile: '+str(state['time']))
ax2.plot(lons1, np.mean(Tsurf, axis=0))
fig.canvas.draw()
fig.canvas.flush_events()
ax3 = fig.add_subplot(2, 2, 3)
#fig.suptitle('Tsurf lat profile: '+str(state['time']))
ax3.plot(lats1,np.mean( Tsurf, axis=1))
ax3.plot(lats1,zonetemps)
fig.canvas.draw()
fig.canvas.flush_events()
qq=qq+1
if(qq>=qqlimit): qq=0
tempcache[qq]=Tsurf[piy, pix]
ax4 = fig.add_subplot(2, 2, 4)
#fig.suptitle('Tsurf time profile: '+str(qq) )
ax4.plot(hourticks1, tempcache)
fig.canvas.draw()
fig.canvas.flush_events()
def plot_function_2(fig, state):
global qq, qqlimit
global tempcache
global pix, piy
global hourticks1
vmin1=-50
vmax1=50
Tsurf=np.array(state['surface_temperature']-273.15)
lons1=np.mean(state['longitude'], axis=0)
lats1=np.mean(state['latitude'], axis=1)
zonetemps=np.array(np.mean( Tsurf, axis=1))
lats2=np.array(np.mean( state['latitude'], axis=1))
#print(zonetemps)
#print(lats2)
lats3=lats2*math.pi/10
coslats=np.cos(lats2)
weightemps=zonetemps*np.abs(coslats)*np.abs(coslats)
meantemp1=round(np.mean(weightemps),2)
meantemp0=round(np.mean(Tsurf),2)
maxtemp0=round(np.max(Tsurf),2)
mintemp0=round(np.min(Tsurf),2)
deltemp0=maxtemp0-mintemp0
#print(" T mean min max ",meantemp0, mintemp0, maxtemp0)
ax = fig.add_subplot(1, 1, 1)
levels1=np.array([-250,-200,-120,-100,-80,-60,-40,-30,-20,0,5,10,15,20,25,30,35,40,45,50,60,70,80,90,100])
Tsurf2 = scipy.ndimage.zoom(Tsurf, 4)
#ax.contourf(state['longitude'], state['latitude'],Tsurf, cmap=mpl.colormaps['turbo'], origin='lower',levels=5,extent=[0,360,-90,90])
ax.imshow(Tsurf2,interpolation="bicubic", origin='lower', vmin=vmin1, vmax=vmax1, cmap='turbo',extent=[0,360,-90,90])
cs1=ax.contour(Tsurf2, alpha=0.5,colors="k",levels=levels1, origin='lower', vmin=vmin1, vmax=vmax1, extent=[0,360,-90,90])
ax.clabel(cs1, cs1.levels, inline=True, fmt="%.1f", fontsize=16)
ax.set_xlabel('Longitude', fontsize=16)
ax.set_ylabel('Latitude', fontsize=16)
ax.set_xticklabels(labels=ax.get_xticklabels(),fontsize=12)
ax.set_yticklabels(labels=ax.get_yticklabels(),fontsize=12)
#ax.set_xticklabels(labels=list(range(0,360, 45)),fontsize=16)
#fig.suptitle('Surface temperature '+str(round(meantemp,2))+' at time: '+str(state['time']))
fig.suptitle(' Desert planet simulated temperature deg C',fontsize=18)
#fig.subtitle('maxtemp '+str(maxtemp),fontsize=11)
fig.canvas.draw()
fig.canvas.flush_events()
- climt.list_available_constants()
- quit(-1)
climt.set_constants_from_dict({
'stellar_irradiance': {'value': S1*1365.2, 'units': 'W m^-2'}})
climt.set_constants_from_dict({
'obliquity': {'value': 0, 'units': 'degree'}})
climt.set_constants_from_dict({
'omega_tilde': {'value': 0, 'units': 'degree'}})
climt.set_constants_from_dict({
'lambda_m0': {'value': 0, 'units': 'degree'}})
- gravitational_acceleration: 9.80665 m s^-2
- planetary_radius: 6371000.0 m
- planetary_rotation_rate: 7.292e-05 s^-1
- seconds_per_day: 86400.0
- NON setting this 10 days
- climt.set_constants_from_dict({'planetary_rotation_rate:': {'value': 7.292e-6/365.25, 'units': 's^-1'}})
- climt.set_constants_from_dict({'seconds_per_day:': {'value': 864000*365.25, 'units': }})
- climt.list_available_constants()
- quit(-1)
- 4 subwin
- monitor = PlotFunctionMonitor(plot_function)
- one lat, lon subwin
monitor = PlotFunctionMonitor(plot_function_2)
instellation = climt.Instellation()
berger=climt.BergerSolarInsolation()
- print(instellation)
- quit(-1)
timestep = timedelta(hours=steppi)
convection = EmanuelConvection()
radiation_sw = RRTMGShortwave()
radiation_lw = RRTMGLongwave()
slab = SlabSurface()
simple_physics = SimplePhysics()
dry_convection = DryConvectiveAdjustment()
hydrology=BucketHydrology()
opticaldepth=climt.Frierson06LongwaveOpticalDepth()
gray=climt.GrayLongwaveRadiation()
condensation=climt.GridScaleCondensation()
- dcmip=climt.DcmipInitialConditions()
heldsuarez=climt.HeldSuarez()
ice = climt.IceSheet(maximum_snow_ice_height=30.) ## 30
- state = get_default_state(
- [simple_physics, convection, dry_convection,
- radiation_lw, radiation_sw, slab]
- )
- state = get_default_state(
- [instellation,
- radiation_lw, radiation_sw,simple_physics,convection, dry_convection,hydrology, slab],
- grid_state=climt.get_grid(nx=dimx, ny=dimy,latitude_grid='regular')
- )
state = get_default_state(
[instellation,berger,
radiation_lw, radiation_sw,simple_physics,convection, dry_convection,hydrology, slab, ice],
grid_state=climt.get_grid(nx=dimx, ny=dimy,latitude_grid='regular')
)
- dycore
- dycore code ....
- convection = climt.EmanuelConvection()
- simple_physics = TimeDifferencingWrapper(climt.SimplePhysics())
- radiation_step = timedelta(hours=1)
- radiation_lw = UpdateFrequencyWrapper(
- climt.RRTMGLongwave(), radiation_step)
- radiation_sw = UpdateFrequencyWrapper(
- climt.RRTMGShortwave(), radiation_step)
- slab_surface = climt.SlabSurface()
- dycore = gfs_dynamical_core.GFSDynamicalCore([simple_physics, slab_surface, radiation_sw,radiation_lw, convection], number_of_damped_levels=5)
- grid = climt.get_grid(nx=32, ny=16, nz=8)
- Create model state
- state = climt.get_default_state([dycore], grid_state=grid)
-
co2=state['mole_fraction_of_carbon_dioxide_in_air'].values[:]
print("Co2 ", round(np.mean(co2)*1e6,3))
- quit(-1)
co2=co2*co2coeff
- quit(-1)
state['mole_fraction_of_carbon_dioxide_in_air'].values[:]=co2
state['air_temperature'].values[:] = 288
state['surface_albedo_for_direct_shortwave'].values[:] = albedo
state['surface_albedo_for_direct_near_infrared'].values[:] = albedo
state['surface_albedo_for_diffuse_shortwave'].values[:] = albedo
state['surface_albedo_for_diffuse_near_infrared'].values[:] = albedo
- state['zenith_angle'].values[:] = np.pi/2.5
state['surface_temperature'].values[:] = 288.
state['ocean_mixed_layer_thickness'].values[:] = 10
- state['heat_capacity_of_soil'][:]=750
- state['surface_thermal_capacity'][:]=750
- state['soil_layer_thickness'][:]=0.1
- state['surface_material_density'][:]=1600 ## sand ## clay loam 1280
- state['surface_material_density'][:]=2700 ## stine, basalt 2900
- state['area_type'].values[:] = 'land'
state['area_type'].values[:] = 'sea'
- state['area_type'].values[:] = 'sea_ice'
- state['sea_ice_thickness'].values[:] = 2.
- state['surface_snow_thickness'].values[:] = 2.
- state['surface_temperature'].values[:] = 260.
- state['surface_upward_sensible_heat_flux'].values[:] = -0.5
- clouds, testing!
- state['mass_content_of_cloud_liquid_water_in_atmosphere_layer'].loc[dict(mid_levels=slice(4, 8))] = 0.03
- state['cloud_area_fraction_in_atmosphere_layer'].loc[dict(mid_levels=slice(4, 8))] = 0.15.
- clouds, testing!
state['mass_content_of_cloud_liquid_water_in_atmosphere_layer'][:]= 0.1
- state['cloud_area_fraction_in_atmosphere_layer'][:] = 1.0
state['cloud_area_fraction_in_atmosphere_layer'][:] = 0.0
print(state)
- quit(-1)
- print(state['time'])
- datetime(year, month, day, hour, minute, second, microsecond)
- newtime = datetime(2023, 7, 1, 11, 55, 59, 0)
- newtime = datetime(2023, 6, 14, 11, 55, 59, 0) ## near mid summer
newtime = datetime(1, 3, 20, 0, 0, 0, 0) ## near spring equinox
state['time']=newtime
print(state['time'])
- quit(-1)
diag = instellation(state)
print("Instellation")
print(diag)
- quit(-1)
fields_to_store = ['air_temperature', 'air_pressure', 'eastward_wind',
'northward_wind', 'air_pressure_on_interface_levels',
'surface_pressure', 'upwelling_longwave_flux_in_air',
'specific_humidity', 'surface_temperature',
'latitude', 'longitude',
'convective_heating_rate']
netcdf_monitor = NetCDFMonitor('climt_out.nc',
write_on_store=True,
store_names=fields_to_store)
time_stepper = AdamsBashforth([radiation_lw, radiation_sw, slab])
- dycore runner
- for i in range(1500*24):
- diag, state = dycore(state, model_time_step)
- state.update(diag)
- state['time'] += model_time_step
- if i % (20) == 0:
- #netcdf_monitor.store(state)
- monitor.store(state)
- print('max. zonal wind: ', np.amax(state['eastward_wind'].values))
- print('max. humidity: ', np.amax(state['specific_humidity'].values))
- print('max. surf temp: ', np.amax(state['surface_temperature'].values))
- print(state['time'])
print("Runnin simulation, insolation")
for i in range(32000000):
diagnostics, state = time_stepper(state, timestep)
state.update(diagnostics)
diag=berger(state)
state.update(diag)
diag, out = simple_physics(state, timestep)
state.update(diag)
state.update(out)
#diag, out = hydrology(state, timestep)
#state.update(diag)
#state.update(out)
diag, out = dry_convection(state, timestep)
state.update(diag)
state.update(out)
diag = instellation(state)
if(i==0): czenit=diag['zenith_angle'].values[:]
#if(i>0): state['zenith_angle'].values[:]=czenit
if(i>0): diag['zenith_angle'].values[:]=czenit
state.update(diag)
diag, out = ice(state, timestep)
state.update(diag)
state.update(out)
if((i%10)==0):
tempslice1=state['air_temperature'][0]
save_netcdf_x("temperature1.nc", tempslice1)
monitor.store(state)
netcdf_monitor.store(state)
state['time'] += timestep
Licensing
[edit]![w:en:Creative Commons](https://upload.wikimedia.org/wikipedia/commons/thumb/7/79/CC_some_rights_reserved.svg/90px-CC_some_rights_reserved.svg.png)
![attribution](https://upload.wikimedia.org/wikipedia/commons/thumb/1/11/Cc-by_new_white.svg/24px-Cc-by_new_white.svg.png)
![share alike](https://upload.wikimedia.org/wikipedia/commons/thumb/d/df/Cc-sa_white.svg/24px-Cc-sa_white.svg.png)
- You are free:
- to share – to copy, distribute and transmit the work
- to remix – to adapt the work
- Under the following conditions:
- attribution – You must give appropriate credit, provide a link to the license, and indicate if changes were made. You may do so in any reasonable manner, but not in any way that suggests the licensor endorses you or your use.
- share alike – If you remix, transform, or build upon the material, you must distribute your contributions under the same or compatible license as the original.
File history
Click on a date/time to view the file as it appeared at that time.
Date/Time | Thumbnail | Dimensions | User | Comment | |
---|---|---|---|---|---|
current | 07:08, 30 October 2023 | ![]() | 1,279 × 766 (265 KB) | Merikanto (talk | contribs) | Update of code |
09:35, 20 October 2023 | ![]() | 886 × 527 (172 KB) | Merikanto (talk | contribs) | Update | |
11:04, 18 October 2023 | ![]() | 1,222 × 598 (223 KB) | Merikanto (talk | contribs) | Update of layout | |
10:14, 18 October 2023 | ![]() | 1,168 × 529 (96 KB) | Merikanto (talk | contribs) | Uploaded own work with UploadWizard |
You cannot overwrite this file.
File usage on Commons
The following page uses this file:
- File:Trappist 1e simulated temperature 2 1 1 1.png (file redirect)
Metadata
This file contains additional information such as Exif metadata which may have been added by the digital camera, scanner, or software program used to create or digitize it. If the file has been modified from its original state, some details such as the timestamp may not fully reflect those of the original file. The timestamp is only as accurate as the clock in the camera, and it may be completely wrong.
Software used | |
---|---|
Horizontal resolution | 39.37 dpc |
Vertical resolution | 39.37 dpc |