Skip to content

Commit

Permalink
Merge pull request #30 from xylar/add_extrap_method
Browse files Browse the repository at this point in the history
Add a flag to set the ESMF extrapolation method
  • Loading branch information
xylar authored May 23, 2021
2 parents 975799b + 5509ed1 commit 7d8f5a2
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion pyremap/remapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,8 @@ def __init__(self, sourceDescriptor, destinationDescriptor,

def build_mapping_file(self, method='bilinear', additionalArgs=None,
logger=None, mpiTasks=1, tempdir=None,
esmf_path=None, esmf_parallel_exec=None): # {{{
esmf_path=None, esmf_parallel_exec=None,
extrap_method=None): # {{{
"""
Given a source file defining either an MPAS mesh or a lat-lon grid and
a destination file or set of arrays defining a lat-lon grid, constructs
Expand Down Expand Up @@ -140,6 +141,9 @@ def build_mapping_file(self, method='bilinear', additionalArgs=None,
The name of the parallel executable to use to launch ESMF tools.
But default, 'mpirun' from the conda environment is used
extrap_method : {'neareststod', 'nearestidavg','creep'}, optional
The method used to extrapolate unmapped destination locations
Raises
------
OSError
Expand Down Expand Up @@ -197,6 +201,9 @@ def build_mapping_file(self, method='bilinear', additionalArgs=None,
'--netcdf4',
'--no_log']

if extrap_method is not None:
args.extend(['--extrap_method', extrap_method])

parallel_args = []

if mpiTasks > 1:
Expand Down

0 comments on commit 7d8f5a2

Please sign in to comment.