From 58966b9ca8862ad2525e641a4d509e173e734586 Mon Sep 17 00:00:00 2001 From: uturuncoglu Date: Wed, 15 Jun 2022 10:00:30 -0600 Subject: [PATCH] update test to write out fields --- .../XGrid/tests/ESMF_XGridUTest.F90 | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/src/Infrastructure/XGrid/tests/ESMF_XGridUTest.F90 b/src/Infrastructure/XGrid/tests/ESMF_XGridUTest.F90 index 5f059aa706..817d5c0765 100644 --- a/src/Infrastructure/XGrid/tests/ESMF_XGridUTest.F90 +++ b/src/Infrastructure/XGrid/tests/ESMF_XGridUTest.F90 @@ -2498,6 +2498,7 @@ subroutine test_MeshToMesh_2nd(rc) integer :: numOwnedElems real(ESMF_KIND_R8), pointer :: ownedElemCoords(:) + character(len=255) :: filename ! result code integer :: finalrc @@ -2740,7 +2741,7 @@ subroutine test_MeshToMesh_2nd(rc) if (ESMF_LogFoundError(localrc, & ESMF_ERR_PASSTHRU, & ESMF_CONTEXT, rcToReturn=rc)) return - + ! Field on XGrid xField = ESMF_FieldCreate(xgrid, arrayspec, & name="xfield", rc=localrc) @@ -2787,6 +2788,21 @@ subroutine test_MeshToMesh_2nd(rc) ESMF_ERR_PASSTHRU, & ESMF_CONTEXT, rcToReturn=rc)) return + ! Write fields + write(filename, fmt='(a,i1,a)') 'xField', petCount, '.nc' + call ESMF_FieldWrite(xField, trim(filename), & + overwrite=.true., rc=localrc) + if (ESMF_LogFoundError(localrc, & + ESMF_ERR_PASSTHRU, & + ESMF_CONTEXT, rcToReturn=rc)) return + + write(filename, fmt='(a,i1,a)') 'dstField', petCount, '.nc' + call ESMF_FieldWrite(dstField, trim(filename), & + overwrite=.true., rc=localrc) + if (ESMF_LogFoundError(localrc, & + ESMF_ERR_PASSTHRU, & + ESMF_CONTEXT, rcToReturn=rc)) return + ! Release routehandles call ESMF_FieldRegridrelease(StoXrouteHandle, rc=localrc) if (ESMF_LogFoundError(localrc, &