RegridFromFile

class ESMF.api.regrid.RegridFromFile(srcfield, dstfield, filename=None, rh_filename=None)

The RegridFromFile object represents a regridding operator between two Fields that is read from a file. The creation of this object is analogous to= ESMF_FieldSMMStore(), and calling this object corresponds to ESMF_FieldRegrid(). ESMF_FieldRegridRelease() is called when the RegridFromFile object goes out of scope (this only happens when the Manager goes out of scope, there is a destroy() call for explicit deallocation of the RegridFromFile).

For more information about the ESMF Regridding functionality, please see the ESMF_FieldRegrid methods in the ESMF Reference Manual.

The following arguments are used to create a handle to a regridding operation between two Fields.

REQUIRED:

Parameters
  • srcfield (Field) – source Field associated with an underlying Grid, Mesh or LocStream.

  • dstfield (Field) – destination Field associated with an underlying Grid, Mesh or LocStream. The data in this Field may be overwritten by this call.

  • filename (string) – the name of the file from which to retrieve the weights.

  • rh_filename (string) – the name of the file from which to retrieve the routehandle information.

__call__(srcfield, dstfield, zero_region=None)

Call a regridding operation from srcfield to dstfield.

REQUIRED:

Parameters
  • srcfield (Field) – the Field of source data to regrid.

  • dstfield (Field) – the Field to hold the regridded data.

OPTIONAL:

Parameters

zero_region (Region) – specify which region of the field indices will be zeroed out before adding the values resulting from the interpolation. If None, defaults to TOTAL.

Returns

dstfield

copy()

Copy a Regrid in an ESMF-safe manner.

Returns

A Regrid shallow copy.

destroy()

Release the memory associated with the RegridFromFile object.