yinyang
Module
Description
$Id$
MODULE_DOC: This module contains Yin-Yang related types and functions MODULE_DOC: which are incompatible with FORTRAN 95.
Quick access
- Types:
- Variables:
ind_coeffs,lgap,lmarg,lmarg2,lneigh,lneigh2,nasym_ph,nasym_th,nogap,overlap_phrngs,overlap_thrngs,rgap,rmarg,rmarg2,rneigh,rneigh2- Routines:
bilin_interp(),biquad_interp(),coeffs_to_weights(),in_overlap_mask(),prep_bicub_interp(),prep_biquad_interp(),prep_biquint_interp(),prep_interp(),prep_quadspline_interp(),qualify_position_bicub(),qualify_position_bilin(),qualify_position_biquin()
Needed modules
cparam(impossible(),nygrid(),nx(),pi()): $Id$cdata(iproc_world(),lroot(),yy_biquad_weights(),iproc(),lyang()): $Id$
Types
- type yinyang/ind_coeffs
- Type fields:
% coeffs (,,*) [real,allocatable]
% coeffs2 (,,*,*) [real,allocatable]
% icoors (,,*) [integer,allocatable]
% igaps (,,*) [integer,allocatable]
% inds (,,*) [integer,allocatable]
% pcoors (,,*) [real,allocatable]
Variables
- yinyang/ind_coeffs
- yinyang/lgap [integer,parameter=-3]
- yinyang/lmarg [integer,parameter=-2]
- yinyang/lmarg2 [integer,parameter=-1]
- yinyang/lneigh [integer,parameter=-4]
- yinyang/lneigh2 [integer,parameter=-5]
- yinyang/nasym_ph [integer,optional/default=0]
- yinyang/nasym_th [integer,optional/default=0]
- yinyang/nogap [integer,parameter=0]
- yinyang/overlap_phrngs (*) [integer,allocatable]
- yinyang/overlap_thrngs (*) [integer,allocatable]
- yinyang/rgap [integer,parameter=3]
- yinyang/rmarg [integer,parameter=2]
- yinyang/rmarg2 [integer,parameter=1]
- yinyang/rneigh [integer,parameter=4]
- yinyang/rneigh2 [integer,parameter=5]
Subroutines and functions
- subroutine yinyang/biquad_interp(indcoeffs, ith, iph, f, buffer, i2buf, i3buf)
Performs biquadratic, bicubic or biquintic interpolation for a pencil at position (ith, iph) of the original strip from values in f-array using the precalculated weights in indcoeffs%coeffs. Result is returned in buffer(i2buf,i3buf)=(ith,iph) or buffer(i2buf,i3buf)=(iph,ith), the latter if transposition is required.
20-dec-15/MR: coded
- Parameters:
indcoeffs [ind_coeffs,in]
ith [integer,in]
iph [integer,in]
f (,,*,*) [real,in]
buffer (,,*,*) [real,out]
i2buf [integer,in]
i3buf [integer,in]
- Use :
general(transform_spher_cart_yy(),notanumber(),transform_cart_spher(),transform_thph_yy_other(),yy_transform_strip_other()),cdata(iproc_world(),itsub(),m1(),m2(),n1(),n2(),lrun())- Call to:
qualify_position_biquin(),qualify_position_bicub(),qualify_position_bilin(),prep_interp(),prep_biquad_interp(),prep_bicub_interp(),prep_biquint_interp(),prep_quadspline_interp(),in_overlap_mask()
- subroutine yinyang/bilin_interp(indcoeffs, ith, iph, f, buffer, i2buf, i3buf)
Performs bilinear interpolation for a pencil at position (ith, iph) of the original strip from values in f-array using the precalculated weights in indcoeffs%coeffs. Result is returned in buffer(i2buf,i3buf)=(ith,iph) or buffer(i2buf,i3buf)=(iph,ith), the latter if transposition is required.
20-dec-15/MR: coded
- Parameters:
indcoeffs [ind_coeffs,in]
ith [integer,in]
iph [integer,in]
f (,,*,*) [real,in]
buffer (,,*,*) [real,out]
i2buf [integer,in]
i3buf [integer,in]
- Use :
general(transform_spher_cart_yy(),notanumber()),cdata(lrun(),nx(),lyang(),iproc())- Call to:
qualify_position_biquin(),qualify_position_bicub(),qualify_position_bilin(),prep_interp(),prep_biquad_interp(),prep_bicub_interp(),prep_biquint_interp(),prep_quadspline_interp(),in_overlap_mask()
- subroutine yinyang/prep_biquad_interp(pprime, indth, indph, indcoeffs, ip, jp, ma, me, na, ne)
- Parameters:
pprime (2) [real,in]
indth [integer,in]
indph [integer,in]
indcoeffs [ind_coeffs,inout]
ip [integer,in]
jp [integer,in]
ma [integer,in]
me [integer,in]
na [integer,in]
ne [integer,in]
- Use :
- Called from:
bilin_interp(),biquad_interp(),prep_interp(),prep_biquad_interp(),prep_bicub_interp(),prep_biquint_interp(),prep_quadspline_interp(),qualify_position_biquin(),qualify_position_bicub(),qualify_position_bilin()- Call to:
qualify_position_biquin(),qualify_position_bicub(),qualify_position_bilin(),prep_interp(),prep_biquad_interp(),prep_bicub_interp(),prep_biquint_interp(),prep_quadspline_interp(),in_overlap_mask()
- subroutine yinyang/prep_bicub_interp(pprime, indth, indph, indcoeffs, ip, jp, igapt, igapp)
Establishes data needed for the bicubic interpolation.
12-jan-2016/MR: coded 12-dec-2017/MR: modified for fixing the gap problem 10-jan-2018/MR: now on each side of a processor domain three situations
considered in which the interpolation stencil overlaps with the present and the neighboring processor domain. Then the array of interpolation coefficients is only partly filled for both. Situations with asymmetric interpolation detected - warning launched when present.
- Parameters:
pprime (2) [real,in]
indth [integer,in]
indph [integer,in]
indcoeffs [ind_coeffs,inout]
ip [integer,in]
jp [integer,in]
igapt [integer,in]
igapp [integer,in]
- Use :
cdata(m1(),m2(),n1(),n2(),y(),z(),dy(),dz(),lfirst_proc_y(),llast_proc_y(),lfirst_proc_z(),llast_proc_z())- Called from:
bilin_interp(),biquad_interp(),prep_interp(),prep_biquad_interp(),prep_bicub_interp(),prep_biquint_interp(),prep_quadspline_interp(),qualify_position_biquin(),qualify_position_bicub(),qualify_position_bilin()- Call to:
qualify_position_biquin(),qualify_position_bicub(),qualify_position_bilin(),prep_interp(),prep_biquad_interp(),prep_bicub_interp(),prep_biquint_interp(),prep_quadspline_interp(),in_overlap_mask()
- subroutine yinyang/prep_biquint_interp(pprime, indth, indph, indcoeffs, ip, jp, igapt, igapp)
Establishes data needed for the biquintic interpolation.
- 12-jan-2018/MR: coded.
On each side of a processor domain there are five situations possible in which the interpolation stencil overlaps with the present and the neighboring processor domain. Then the array of interpolation coefficients is only partly filled for both.
- Parameters:
pprime (2) [real,in]
indth [integer,in]
indph [integer,in]
indcoeffs [ind_coeffs,inout]
ip [integer,in]
jp [integer,in]
igapt [integer,in]
igapp [integer,in]
- Use :
cdata(m1(),m2(),n1(),n2(),y(),z(),dy(),dz(),ygrid(),zgrid(),ny(),nz(),nghost(),ipy(),ipz())- Called from:
bilin_interp(),biquad_interp(),prep_interp(),prep_biquad_interp(),prep_bicub_interp(),prep_biquint_interp(),prep_quadspline_interp(),qualify_position_biquin(),qualify_position_bicub(),qualify_position_bilin()- Call to:
qualify_position_biquin(),qualify_position_bicub(),qualify_position_bilin(),prep_interp(),prep_biquad_interp(),prep_bicub_interp(),prep_biquint_interp(),prep_quadspline_interp(),in_overlap_mask()
- subroutine yinyang/prep_quadspline_interp(pprime, indth, indph, indcoeffs, ip, jp, ma, me, na, ne)
Establishes data needed for the quadratic spline interpolation.
12-jan-2016/MR: coded
- Parameters:
pprime (2) [real,in]
indth [integer,inout]
indph [integer,inout]
indcoeffs [ind_coeffs,inout]
ip [integer,in]
jp [integer,in]
ma [integer,in]
me [integer,in]
na [integer,in]
ne [integer,in]
- Use :
- Called from:
bilin_interp(),biquad_interp(),prep_interp(),prep_biquad_interp(),prep_bicub_interp(),prep_biquint_interp(),prep_quadspline_interp(),qualify_position_biquin(),qualify_position_bicub(),qualify_position_bilin()- Call to:
qualify_position_biquin(),qualify_position_bicub(),qualify_position_bilin(),prep_interp(),prep_biquad_interp(),prep_bicub_interp(),prep_biquint_interp(),prep_quadspline_interp(),in_overlap_mask()
- function yinyang/qualify_position_biquin(ind, nl, nu, lrestr_par_low, lrestr_par_up, lrestr_perp)
Qualifies the position of a point w.r.t the neighboring processors for quintic interpolation (six-points-stencil). If the calling proc is the first (lrestr_par_low=T) or last (lrestr_par_up=T) proc in the considered direction, a position near the margin of its domain is not special, likewise not if it is not the first or last in the perpendicular direction (lrestr_perp=F).
- Parameters:
ind [integer,in]
nl [integer,in]
nu [integer,in]
lrestr_par_low [logical,in]
lrestr_par_up [logical,in]
lrestr_perp [logical,in]
- Return:
qual [integer]
- Called from:
bilin_interp(),biquad_interp(),prep_interp(),prep_biquad_interp(),prep_bicub_interp(),prep_biquint_interp(),prep_quadspline_interp(),qualify_position_biquin(),qualify_position_bicub(),qualify_position_bilin()- Call to:
qualify_position_bicub(),qualify_position_bilin(),prep_interp(),qualify_position_biquin(),prep_biquad_interp(),prep_bicub_interp(),prep_biquint_interp(),prep_quadspline_interp(),in_overlap_mask()
- function yinyang/qualify_position_bicub(ind, nl, nu, lrestr_par_low, lrestr_par_up, lrestr_perp)
Qualifies the position of a point w.r.t the neighboring processors for cubic interpolation (four-points-stencil).
- Parameters:
ind [integer,in]
nl [integer,in]
nu [integer,in]
lrestr_par_low [logical,in]
lrestr_par_up [logical,in]
lrestr_perp [logical,in]
- Return:
qual [integer]
- Called from:
bilin_interp(),biquad_interp(),prep_interp(),prep_biquad_interp(),prep_bicub_interp(),prep_biquint_interp(),prep_quadspline_interp(),qualify_position_biquin(),qualify_position_bicub(),qualify_position_bilin()- Call to:
qualify_position_bilin(),prep_interp(),qualify_position_biquin(),qualify_position_bicub(),prep_biquad_interp(),prep_bicub_interp(),prep_biquint_interp(),prep_quadspline_interp(),in_overlap_mask()
- function yinyang/qualify_position_bilin(ind, nl, nu)
Qualifies the position of a point w.r.t the neighboring processors for linear interpolation (two-points-stencil).
- Parameters:
ind [integer,in]
nl [integer,in]
nu [integer,in]
- Return:
qual [integer]
- Called from:
bilin_interp(),biquad_interp(),prep_interp(),prep_biquad_interp(),prep_bicub_interp(),prep_biquint_interp(),prep_quadspline_interp(),qualify_position_biquin(),qualify_position_bicub(),qualify_position_bilin()- Call to:
prep_interp(),qualify_position_biquin(),qualify_position_bicub(),qualify_position_bilin(),prep_biquad_interp(),prep_bicub_interp(),prep_biquint_interp(),prep_quadspline_interp(),in_overlap_mask()
- function yinyang/prep_interp(thphprime, indcoeffs, itype[, ngap[, th_range]])
For each of the points in the strip thphprime (with shape 2 x thprime-extent x phprime-extent), arbitrarily positioned in the yz-plane, determine in which cell of the grid y(ma:me) x z(na:ne) it lies, store indices of the cell’s upper right corner in indcoeffs%inds and the weights of bilinear interpolation for the four corners in indcoeffs%coeffs. If no cell is found for a point, indcoeffs%inds and indcoeffs%coeffs are set zero. If present, return in th_range the interval in thprime-extent in which interpolation cells could be assigned to any points. Returns number of points in thphprime for which interpolation cell could be found.
20-dec-15/MR: coded 12-dec-17/MR: modifications for fixing the gap problem. Determination of
index ranges for overlap regions added.
- 20-jan-18/MR: biquintic interpolation added: now on each side five situations
exist in which two processors contribute to interpoland.
- Parameters:
thphprime (,,*) [real,in]
indcoeffs [ind_coeffs,out]
itype [integer,in]
ngap [integer,inout,]
th_range (2) [integer,out,]
- Return:
nok [integer]
- Use :
general(find_index_range_hill(),notanumber(),itoa()),cdata(ny(),nz(),y(),z(),dy(),dz(),lfirst_proc_y(),lfirst_proc_z(),nghost(),llast_proc_y(),llast_proc_z(),lroot(),iproc(),lyang(),lstart()),cparam(m1(),m2(),n1(),n2(),bilin(),biquad(),bicub(),quadspline(),biquin())- Called from:
bilin_interp(),biquad_interp(),reduce_zsum(),zsum_yy(),initialize_zaver_yy(),prep_biquad_interp(),prep_bicub_interp(),prep_biquint_interp(),prep_quadspline_interp(),qualify_position_biquin(),qualify_position_bicub(),qualify_position_bilin()- Call to:
qualify_position_biquin(),qualify_position_bicub(),qualify_position_bilin(),prep_biquad_interp(),prep_bicub_interp(),prep_biquint_interp(),prep_quadspline_interp(),in_overlap_mask()
- function yinyang/in_overlap_mask(indth, indph)
Determines whether point (indth,indph) of Yang grid lies in overlap region.
12-dec-17/MR: coded
- Parameters:
indth [integer,in]
indph [integer,in]
- Return:
ok [logical]
- Use :
cdata(lfirst_proc_y(),lfirst_proc_z(),llast_proc_y(),llast_proc_z(),nghost(),iproc())- Called from:
initialize_diagnostics(),initialize_diagnostic_arrays(),prints(),report_undefined_diagnostics(),gen_form_legend(),write_sound(),get_average_density(),diagnostic(),initialize_time_integrals(),xyaverages_z(),xzaverages_y(),yzaverages_x(),phizaverages_r(),yaverages_xz(),zaverages_xy(),phiaverages_rz(),write_1daverages(),write_1daverages_prepare(),write_2daverages_prepare(),write_2daverages(),trim_averages(),fparse_name(),set_type(),save_name(),save_name_sound(),save_name_halfz(),max_mn_name(),bilin_interp(),biquad_interp(),prep_interp(),prep_biquad_interp(),prep_bicub_interp(),prep_biquint_interp(),prep_quadspline_interp(),qualify_position_biquin(),qualify_position_bicub(),qualify_position_bilin()
- subroutine yinyang/coeffs_to_weights(intcoeffs, indweights)
Transforms interpolation data w.r.t to a yz strip of (non-grid) points to a representation in which for each (m,n) in the local range (m1,m2)x(n1,n2) it is stored to which phi-coordinate line of the strip (its theta index) a grid point with (m,n) contributes and with which weight. As the use is within z sums (or averages) the contributions are summed up.
20-mar-16/MR: coded
- Parameters:
intcoeffs [ind_coeffs,in]
indweights [ind_coeffs,out]
- Use :
general(pos_in_array(),itoa()),cparam(m1(),m2(),n1(),n2()),cdata(lroot())- Called from: