Skip to content

Commit 8f4bbfe

Browse files
committed
Add an error to prevent vector regridding with conservative regrid methods (a combination that isn't currently supported).
1 parent ee9aef2 commit 8f4bbfe

File tree

1 file changed

+12
-5
lines changed

1 file changed

+12
-5
lines changed

src/Infrastructure/Field/src/ESMF_FieldRegrid.F90

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -553,7 +553,8 @@ subroutine ESMF_FieldRegridStoreNX(srcField, dstField, keywordEnforcer, &
553553
! second as the north component.
554554
! In addition, this functionality presently only
555555
! works when both the source and destination Fields are build on a geometry (e.g. an ESMF Grid) with
556-
! a spherical coordinate system (e.g. ESMF\_COORDSYS\_SPH\_DEG). We expect these restrictions to be loosened over
556+
! a spherical coordinate system (e.g. ESMF\_COORDSYS\_SPH\_DEG). Also, this functionality is not currently supported with conservative
557+
! regrid methods (e.g. {\tt regridmethod=ESMF\_REGRIDMETHOD\_CONSERVE}). We expect these restrictions to be loosened over
557558
! time as new requirements come in from users. See section~\ref{sec::vectorRegrid} for further
558559
! information on this functionality. If not specified, this argument defaults to false.
559560
! \item [{[extrapMethod]}]
@@ -969,10 +970,16 @@ subroutine ESMF_FieldRegridStoreNX(srcField, dstField, keywordEnforcer, &
969970
endif
970971
endif
971972

972-
973-
974-
975-
973+
! Can't use vectorRegrid with conservative right now
974+
if (localVectorRegrid) then
975+
if ((lregridmethod .eq. ESMF_REGRIDMETHOD_CONSERVE) .or. &
976+
(lregridmethod .eq. ESMF_REGRIDMETHOD_CONSERVE_2ND)) then
977+
call ESMF_LogSetError(rcToCheck=ESMF_RC_ARG_BAD, &
978+
msg=" vector regridding currently not supported with conservative "// &
979+
"regrid methods.", ESMF_CONTEXT, rcToReturn=rc)
980+
return
981+
endif
982+
endif
976983

977984

978985
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

0 commit comments

Comments
 (0)