Skip to content

Commit 424806e

Browse files
authored
Merge pull request #111 from xylar/add-descriptors-to-remapper-init
Add more optional arguments to the remapper init
2 parents 48032c7 + 1b66be6 commit 424806e

File tree

1 file changed

+22
-4
lines changed

1 file changed

+22
-4
lines changed

Diff for: pyremap/remapper/remapper.py

+22-4
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,10 @@ def __init__(
7878
ntasks=1,
7979
map_filename=None,
8080
method='bilinear',
81+
src_descriptor=None,
82+
dst_descriptor=None,
83+
map_tool='esmf',
84+
parallel_exec='mpirun',
8185
use_tmp=True,
8286
):
8387
"""
@@ -95,6 +99,20 @@ def __init__(
9599
method : {'bilinear', 'neareststod', 'conserve'}, optional
96100
The method of interpolation used
97101
102+
src_descriptor: pyremap.descriptor.MeshDescriptor, optional
103+
The source mesh descriptor
104+
105+
dst_descriptor: pyremap.descriptor.MeshDescriptor, optional
106+
The destination mesh descriptor
107+
108+
map_tool : {'esmf', 'moab'}, optional
109+
The tool to use for building the mapping file. The default is
110+
``esmf``.
111+
112+
parallel_exec : {'mpirun', 'srun'}, optional
113+
The command to use for running the mapping tool. The default is
114+
``mpirun``.
115+
98116
use_tmp : bool, optional
99117
If True, use a temporary directory for the SCRIP files. The
100118
default is False, which means the SCRIP files will be created in
@@ -111,12 +129,12 @@ def __init__(
111129
self.src_scrip_filename = 'src_mesh.nc'
112130
self.dst_scrip_filename = 'dst_mesh.nc'
113131
self.format = 'NETCDF3_64BIT_DATA'
114-
self.src_descriptor = None
115-
self.dst_descriptor = None
116-
self.map_tool = 'esmf'
132+
self.src_descriptor = src_descriptor
133+
self.dst_descriptor = dst_descriptor
134+
self.map_tool = map_tool
117135
self.esmf_path = None
118136
self.moab_path = None
119-
self.parallel_exec = 'mpirun'
137+
self.parallel_exec = parallel_exec
120138
self._ds_map = None
121139
self._matrix = None
122140

0 commit comments

Comments
 (0)