File:Fast rotating ocean planet like earth annual temperature 1 1 1 1.png

From Wikimedia Commons, the free media repository
Jump to navigation Jump to search

Original file(1,185 × 653 pixels, file size: 205 KB, MIME type: image/png)

Captions

Captions

Fast rotating ocean planet like Earth annual temperature deg C

Summary

[edit]
Description
English: Fast rotating ocean planet like Earth annual temperature deg C.
Date
Source Own work
Author Merikanto

Python exoplasim output annual temperature only visualizing code

    1. python3 exoplasim netcf data visualize
    1. 30.10.2023 v 0000.0000

import matplotlib.mlab as mlab import matplotlib.pyplot as plt import netCDF4 from netCDF4 import Dataset from matplotlib.pylab import * import numpy as np from scipy import interpolate from scipy.interpolate import griddata

def savenetcdf_single_frommem(outfilename1, outvarname1, xoutvalue1,xoutlats1,xoutlons1): nlat1=len(xoutlats1) nlon1=len(xoutlons1) #indata_set1=indata1 print(outfilename1) ncout1 = netCDF4.Dataset(outfilename1, 'w', format='NETCDF4') outlat1 = ncout1.createDimension('lat', nlat1) outlon1 = ncout1.createDimension('lon', nlon1) outlats1 = ncout1.createVariable('lat', 'f4', ('lat',)) outlons1 = ncout1.createVariable('lon', 'f4', ('lon',)) outvalue1 = ncout1.createVariable(outvarname1, 'f4', ('lat', 'lon',)) outvalue1.units = 'Unknown' outlats1[:] = xoutlats1 outlons1[:] = xoutlons1 outvalue1[:, :] =xoutvalue1[:] ncout1.close() return 0

def loadnetcdf_single_tomem(infilename1, invarname1): global cache_lons1 global cache_lats1 print(infilename1) inc1 = netCDF4.Dataset(infilename1) inlatname1="lat" inlonname1="lon" inlats1=inc1[inlatname1][:] inlons1=inc1[inlonname1][:] cache_lons1=inlons1 cache_lats1=inlats1 indata1_set1 = inc1[invarname1][:] dim1=indata1_set1.shape nlat1=dim1[0] nlon1=dim1[1] inc1.close() return (indata1_set1)

num1=1 kk1=1

vari1="tas"

fintemp1 = "./earth_fastrot_ocean.nc"

  1. fintemp1 = "./planet_run/MOST.0000"+str(num1)+".nc"
  2. fintemp1="fields_biogem_2d.nc"

print(num1, kk1)

print(fintemp1)

ncinu1 = Dataset(fintemp1, "r+", format = "NETCDF4")

print(ncinu1)

  1. quit(-1)
  1. navalue=9.969209968386869e+36

lon0 = ncinu1.variables['lon'] lat0 = ncinu1.variables['lat']

kindex1=kk1-1

  1. tsa00 = ncinu1.variables['tsa'][kindex1]-273.15
    1. tsa00 = ncinu1.variables[vari1][kindex1]

Kelvin=273.15

tsa00=np.mean(ncinu1.variables[vari1], axis=0)-Kelvin

  1. mask00=ncinu1.variables['lsm']
  1. print(mask00)

print(np.shape(tsa00))

  1. quit(-1)
  1. print(tsa00)
  1. quit(-1)
  1. print(type(lon1))

lon1=np.array(lon0) lat1=np.array(lat0)

  1. print(lon1)

tsa=np.array(tsa00)

  1. mask1=np.array(mask00)
  1. print(mask1)
  1. quit(-1)

avgtemp1=np.mean(tsa)

print("Tavg: ",avgtemp1)

  1. quit(-1)

newx=36 newy=36

X = np.arange(-180, 180, 360/newx) Y = np.arange(-90, 90, 180/newy)

oname1="atm_temp.nc" ovar1="Band1"

  1. savenetcdf_single_frommem(oname1, ovar1, tsa,Y, X)

kmap2 = plt.cm.get_cmap('RdBu_r') kmap1=plt.get_cmap('YlGnBu') mint1=round(np.min(tsa),1) maxt1=round(np.max(tsa),1)

title1="Fast rotating ocean planet like Earth" title2="Temperature deg C: min "+str(mint1)+" max "+str(maxt1)

plt.suptitle(title1, fontsize=22) plt.title(title2, fontsize=18)

plt.xlabel("Longitude", fontsize=18) plt.xticks(fontsize=18) plt.ylabel("Latitude", fontsize=18) plt.yticks(fontsize=18)

  1. contourrange1=[-50,-30,-20,-10,0,10,20,30,40,50]

contourrange1=[-200,-150,-120,-100,-80,-50,-45,-40,-35,-30,-25,-20,-15,-10,-5,0,5,10,15,20,25,30,35,40,45,50,100,200,400]

from skimage.transform import resize

tsa2 = resize(tsa, (tsa.shape[0] *3, tsa.shape[1]*2),anti_aliasing=True)


plt.imshow( tsa2, origin="upper",extent=(-180,180,-90,90), cmap=plt.cm.coolwarm, vmin=-50, vmax=50, interpolation="bicubic" )

cs = plt.contour(tsa2, origin="upper", alpha=0.5, extent=(-180,180,-90,90), inline=True, colors=['#3f0000'],levels=contourrange1)

plt.clabel(cs, fontsize=20, inline=1,fmt = '%3.0f', colors=['#3f0000'])

plt.grid(alpha=0.3, linestyle="--")


plt.show()

Python3 exoplasim code to create data

import numpy as np import math import exoplasim as exo

numyears=40

fluksi=1361.5

planet = exo.Model(workdir="planet_run",modelname="Planet",ncpus=4,resolution="T21",outputtype=".nc")

planet.configure(flux=fluksi, eccentricity=0.,obliquity=0.,fixedorbit=True,synchronous=False,rotationperiod=1, aquaplanet=True,desertplanet=False,timestep=30.0,snapshots=None,physicsfilter="gp|exp|sp")

planet.exportcfg()

print("Running, takes very long time ...") planet.run(years=numyears,crashifbroken=True)

print(".")

Licensing

[edit]
I, the copyright holder of this work, hereby publish it under the following license:
w:en:Creative Commons
attribution share alike
This file is licensed under the Creative Commons Attribution-Share Alike 4.0 International license.
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/TimeThumbnailDimensionsUserComment
current11:25, 30 October 2023Thumbnail for version as of 11:25, 30 October 20231,185 × 653 (205 KB)Merikanto (talk | contribs)Uploaded own work with UploadWizard

There are no pages that use this file.

Metadata