rodrigo-caballero / climt-legacy Goto Github PK
View Code? Open in Web Editor NEWClimate modelling and diagnostics toolkit
License: BSD 3-Clause "New" or "Revised" License
Climate modelling and diagnostics toolkit
License: BSD 3-Clause "New" or "Revised" License
**** CAUTION: THIS IS THE LEGACY BRANCH OF CLIMT. DEVELOPMENT HAS BEEN DISCONTINUED AS OF MID-2017 PLEASE GO TO THE CURRENT BRANCH https://github.com/CliMT/climt **** CliMT: Climate Modeling and Diagnostics Toolkit CliMT is a Python-based software component toolkit which provides a flexible, multi-purpose problem-solving environment geared to climate science problems. See http://people.su.se/~rcaba/climt for further details. Requirements: Python 2.4 or higher Numpy 1.0 or higher GNU gcc and a Fortran compiler Installation: Make sure that numpy is installed, and that the version of f2py on your path is the one installed by numpy. Then: python setup.py build will build the package using the default fortran compiler. For information on the compilers available on your platform: f2py -c --help-fcompiler To build with a different compiler: python setup.py build --fcompiler=<compiler> where <compiler> is one of the choices offered by f2py above. When the build is complete: python setup.py install --prefix=<dir where you want climt to live> You can also install the "lite" version of CliMT, used in Ray Pierrehumbert's book "Principles of Planetary Climate", by doing python setup.py install --lite Rodrigo Caballero ([email protected]) Feb 2012
I'm trying to install this library on my mac using the gnu95 compiler and running into this error:
ld: symbol(s) not found for architecture x86_64 collect2: error: ld returned 1 exit status error: Command "/usr/local/bin/gfortran -Wall -g -L/opt/boxen/homebrew/lib /var/folders/r5/qd2yr2tx55gf5sn_29hkz63c0000gn/T/tmpuYUrO2/var/folders/r5/qd2yr2tx55gf5sn_29hkz63c0000gn/T/tmpuYUrO2/src.macosx-10.10-x86_64-2.7/_gridmodule.o /var/folders/r5/qd2yr2tx55gf5sn_29hkz63c0000gn/T/tmpuYUrO2/var/folders/r5/qd2yr2tx55gf5sn_29hkz63c0000gn/T/tmpuYUrO2/src.macosx-10.10-x86_64-2.7/fortranobject.o /var/folders/r5/qd2yr2tx55gf5sn_29hkz63c0000gn/T/tmpuYUrO2/src/grid/Driver.o /var/folders/r5/qd2yr2tx55gf5sn_29hkz63c0000gn/T/tmpuYUrO2/src/grid/src/dimensions.o /var/folders/r5/qd2yr2tx55gf5sn_29hkz63c0000gn/T/tmpuYUrO2/var/folders/r5/qd2yr2tx55gf5sn_29hkz63c0000gn/T/tmpuYUrO2/src.macosx-10.10-x86_64-2.7/_grid-f2pywrappers.o -L/usr/local/Cellar/gcc/5.3.0/lib/gcc/5/gcc/x86_64-apple-darwin14.5.0/5.3.0 -L/usr/local/lib -L/usr/local/opt/openssl/lib -L/usr/local/opt/sqlite/lib -lgfortran -o ./_grid.so" failed with exit status 1 +++ Compilation failed
The file crm.F90
converts the output from subroutines radcswmx
and radclwmx
from CGS to MKS units, e.g. on line 346:
qrl = qrl*1.e-3
Two problems:
1.E-4
, not 1.E-3
.qrl
and qrs
are actually already converted to MKS units (J/kg/s).radlw.F90
and line 2422 of radsw.F90
, where the factor 1.E-4
is applied.So in the Python module, the heating rates swhr
, lwhr
and TdotRad
seem to be a factor of 1000 too small. Also the Tinc
temperature increment for the atmosphere, same problem.
If I'm right, then the fix is very simple -- just removing the lines that apply the incorrect conversion in crm.F90
. I did this on my master branch of the CliMT code. Can't figure out how to submit a pull request for just this change without all the other stuff I've done recently.
I think there may be some issue with the Asselin filter, at least if an external time increment is imposed. I'm not sure what exactly is going on, but it may arise from the leapfrog step and filter being called for each component consecutively? (Sorry, I'm not good at python...)
Here is an example script which illustrates the issue. The results here are significantly dependent on the Asselin filter constant - even though a steady state is reached, in which case one would hope that the latter shouldn't do anything. Moreover, the radiative cooling rate does not agree with the externally applied heating rate (which it should in steady state), and there is a pretty clear relationship between the mismatch and the Asselin filter constant (seee comments in the script).
Maybe this is just an issue of understanding what the actual "effective" model time-step is. But it seems a bit funny that the latter should depend on the Asselin filter constant.
Cheers,
Malte
#!/usr/bin/env python
from numpy import *
import climt
### Initialize parameters
kwargs = {}
kwargs['lev'] = (arange(climt.get_nlev())+1)*(1000.-0.)/climt.get_nlev() ### Set pressure levels to what was modified above
kwargs['solin'] = 100 ### Solar insolation
kwargs['afc'] = 0.2
kwargs['dt'] = 60.*60. ### Timestep
kwargs['Hslab'] = 2.
kwargs['tau_inf'] = 2.0 ### Tau
kwargs['Ts'] = 250. ### Surface temperature init
kwargs['T'] = ones((climt.get_nlev()))*250. ### Temperature profile init
NSteps = int( 1000*86400./kwargs['dt'] ) ## Number of steps (1000 days)
# Prescribe vertically constant heating rate of (supposedly) 1K/day
dTa = kwargs['dt']*2.*1./86400.+0.0*kwargs['lev']
rad = climt.radiation(scheme = 'grey', **kwargs) ### Radiation component
ocn = climt.ocean() ### ML Ocean
fed = climt.federation(rad,ocn,**kwargs) ### Coupler
### Run model
for i in range(NSteps):
# This formulation appears to give an effective heating rate of 1K *(1-afc) per day
fed.step(Inc={'T':dTa})
# This formulation appears to give an effective heating rate of 1K *(1-2*afc) per day
#fed.step()
#fed['T']=fed['T']+dTa
print 'Ts: %10.5f' % (fed['Ts']-273.15)
# Print radiative temperature tendency by level - this should be -1K per day in equilibrium
print(fed['TdotRad'])
In grid.py
, shouldn't the dimensions for latitude and longitude be set as
self.value['nlat'] = self.Shape3D[1]
self.value['nlon'] = self.Shape3D[2]
At the moment they all get set to self.Shape3D[0]
.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.