-
Notifications
You must be signed in to change notification settings - Fork 77
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Missing interface for OPERATOR(/=) in ESMF_Geom.F90 #302
Comments
oops - my bad. I did not go to look at the actual implementation in the file. Here So my request is instead provide operators that compare whether 2 geoms are aliases for the same object. |
Being the well-intended citizen that I am, I offer this quick and dirty implementation: impure elemental logical function ESMF_GeomEqual(geom1, geom2)
type(ESMF_Geom), intent(in) :: geom1, geom2
type(ESMF_GeomType_Flag) :: geomtype1, geomtype2
type(ESMF_Grid) :: grid1, grid2
type(ESMF_LocStream) :: locstream1, locstream2
type(ESMF_Mesh) :: mesh1, mesh2
type(ESMF_XGrid) :: xgrid1, xgrid2
ESMF_GeomEqual = .false.
call ESMF_GeomGet(geom1, geomtype=geomtype1)
call ESMF_GeomGet(geom2, geomtype=geomtype2)
if (geomtype1 /= geomtype2) return
if (geomtype1 == ESMF_GEOMTYPE_GRID) then
call ESMF_GeomGet(geom1, grid=grid1)
call ESMF_GeomGet(geom2, grid=grid2)
ESMF_GeomEqual = (grid1 == grid2)
return
end if
if (geomtype1 == ESMF_GEOMTYPE_LOCSTREAM) then
call ESMF_GeomGet(geom1, locstream=locstream1)
call ESMF_GeomGet(geom2, locstream=locstream2)
ESMF_GeomEqual = (locstream1 == locstream2)
return
end if
if (geomtype1 == ESMF_GEOMTYPE_MESH) then
call ESMF_GeomGet(geom1, mesh=mesh1)
call ESMF_GeomGet(geom2, mesh=mesh2)
ESMF_GeomEqual = (mesh1 == mesh2)
return
end if
if (geomtype1 == ESMF_GEOMTYPE_XGRID) then
call ESMF_GeomGet(geom1, xgrid=xgrid1)
call ESMF_GeomGet(geom2, xgrid=xgrid2)
ESMF_GeomEqual = (xgrid1 == xgrid2)
return
end if
end function ESMF_GeomEqual
impure elemental logical function ESMF_GeomNotEqual(geom1, geom2)
type(ESMF_Geom), intent(in) :: geom1, geom2
ESMF_GeomNotEqual = .not. (geom1 == geom2)
end function ESMF_GeomNotEqual
|
Bob will follow up during his typical meeting with the NASA Team. If there is a working code from NASA, should be easy to insert into the next release. Dan: may need a subroutine in Geom Match. possibly medium size of work. |
Bob had worked on this and currently in develop |
The file declares both
OPERATOR(==)
andOPERATOR(/=)
to be public, but only defines an implementation for the first.The other is not an error because other USE statements there are bringing in
/=
on other types.Easy fix.
Also - documentation does not even mention
OPERATOR(==)
for this type, and that should be addressed at the same time.The text was updated successfully, but these errors were encountered: