fortran - How can I interpolate data represented in (r,spherical harmonic) space to a regular cartesian grid (F90)? -
fortran - How can I interpolate data represented in (r,spherical harmonic) space to a regular cartesian grid (F90)? -
i'm trying interpolate spherical harmonics cubic, cartesian grid.
the output info of spherical, pseudo-spectral simulation has nr radial levels between rmin , rmax, each containing set of finite-order spherical harmonics longitude , latitude. spherical harmonics mapped physical spherical grid containing ni latitudes , nj longitudes via triangular truncation.
the domain follows:
radial levels:rmin <= r(k) <= rmax, indexing 1 <= k <= nr spherical harmonics (triangular truncation, without aliasing transform): nm = (nj-1)/3 0 <= m <= nm m <= l <= nm nlm == (nm+1)*(nm+2)/2 (the total number of l,m combinations) data arrays:
spectral form:complex*16, dimension( 1:nlm, 1:nr ) :: foo_spectral cartesian form: real*8, dimension( 1:nx, 1:ny, 1:nz ) :: foo_cartesian i'm looking accurate , efficient way interpolate info spectral representation cubic cartesian grid edge-length 2*rmax, such spherical domain fits inside. want interpolate within sphere, however: points corresponding r<rmin or rmax<r, cubic grid should have outside_domain values.
currently, have transform info spectral representation (spherical harmonics: foo(nr,nlm)) physical representation (spherical grid: foo(nr,ni,nj)), , utilize qhull routine in idl interpolate physical, spherical grid physical, cubic grid (foo(nx,ny,nz)) (note nx==ny==nz cubic grid).
the size of info larger existing code (written in idl) can handle, , converting spherical space unnecessary purposes. i'd more direct method stand-alone -- not dependent on idl, instance.
any thoughts how done? i'm willing utilize open-source libraries, nice not have to.
thanks in advance!
i recommend using libraries this; spherical harmonic transform hard efficiently , accurately , it's unlikely first attempts existing routines.
one library colleague thinks quite highly of shtns, both synthesis (inverse transform) , interpolation (for given shell) @ arbitrary point. has fortran bindings. you'd still have handle multiple radial shells yourself, 1 way or (probably doing you're doing - transform onto spherical grid, , utilize standard interpolation methods onto cubic grid), , while little tricky right it's much more straightforward spherical harmonic transform part.
fortran representation interpolation spectral qhull
Comments
Post a Comment