![]() Module kd use kdtree2_module implicit none !things that we can access from Python! public :: createtree, nnearest, rnearest integer, allocatable, dimension (:), public :: inds real * 8, allocatable, dimension (:), public :: dis real * 8, allocatable, dimension (:,:), public :: dlocs integer, public :: nd !things we can't access from Python: type ( kdtree2 ), pointer, private :: tree type ( kdtree2_result ), allocatable, target, private :: datainds (:) contains subroutine createtree () real * 8, allocatable, dimension (:,:) :: tlocs if ( allocated ( dlocs )) then if ( size ( dlocs, 1 ) > 3 ) then write ( *, * ) 'Data must be dim x nd dimensioned!' return endif if ( associated ( tree )) call kdtree2_destroy ( tree ) tree => kdtree2_create ( dlocs, 3. Output array with a realization in each columnįirst, the function needs to be loaded into Python: ![]() rseed ( int) – A seed value to pass to the random number generator.nreal ( int) – Number of realizations to sub-sample.nsub ( int) – Number of sub-samples to output.ncell ( int) – The number of cells within a single realization, can also be interpreted as the.col ( int) – Column containing data to sub-sample.datafl ( str) – A single input datafile with the variable being sampled.Sub-sampled.Each realizations sub-sample is within a unique column. Only one realization is sub-sampled, or a2D array in the case where multiple realizations are Deutsch’s use of Fisher-Yates shuffle inĪssumes that the data file being read is in GSLIB format. A Fisher-Yates shuffle is implemented.This subroutine was designed with the intent of When datasets become too large to efficiently use, a sub-sample maybe extracted and used in subsample ( datafl, col, ncell, nsub, nreal, rseed ) ¶ compiler ( str) – either "intel", "gnu" or a path to a compiler bin directory.tmpdir, outdir ( srcdir ,) – various locations to consider.name ( str) – if sources is a list, a name must be provided for the resulting.wraponly ( list or dict) – matching item to sources and includes that contains a list orĭictionary of functions that get wrapped for python, other functions in the f2py fortranĬode are ignored.Items to include on the link step of compilation. includes ( list or dict) – a matching item to sources that contains a list or dict of extra.See pygeostat/fortran/sourcedefs.pyįor inspiration on the structure of these dictionaries Lists of associated sources to generate that module. Keys in the dictionary indicate the name of the module to be built and the values are the sources ( list or dict) – either a list of fortran files where the last depends on the firstĪnd the last file in the list contains the f2py wrapping code, or a dictionary where.This function replaces FortranBuild as a more succinct methodology This function is intended to allow arbitrary f2py extensions to be constructed using the tooling build_custom_fortran ( sources, includes=, name=None, srcdir='./', outdir='./', tmpdir='./tmp/', compiler='gnu', mode='release', exflags='', opt='O2', clean=True, verbose=True ) ¶ verbose ( bool) – write all output to the terminalīuild Custom Fortran ¶.clean ( bool) – if True then the build directory is cleaned before compiling (recommended).opt ( str) – optimization level, defaults to O2. ![]() exflags ( str) – compiler-specific permissable fortran compiler flags.compiler ( str) – either "intel", "gnu" or a path to a local folder containing gfortran.pygeostatmodules ( str) – either "all" or one of the dictionary keys found in.Nothing), then conda install mingw -y is run to install MinGW, and this compiler is used. If no gnu compiling tools are found on the path ( gfortran -v, gcc -v returns Modules are compiled to pygeostat/fortran/, regardless of where the function is called from. Sorted out automatically resulting in a set of compiled pygeostat fortran extensions. Make this function callable with gs.build_pygeostat_fortran(), and have all requirements ![]() This function builds the f2py extensions with minimal interaction from the user. build_pygeostat_fortran ( pygeostatmodules='all', compiler='gnu', mode='release', exflags='', opt='O2', clean=True, verbose=False ) ¶ ![]()
0 Comments
Leave a Reply. |