Skip to content
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

Potentially Fixes #288 ESMF_ArrayCreateGetUTest #289

Merged
merged 2 commits into from
Sep 23, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions src/Infrastructure/Array/tests/ESMF_ArrayCreateGetUTest.F90
Original file line number Diff line number Diff line change
Expand Up @@ -369,7 +369,8 @@ program ESMF_ArrayCreateGetUTest
!NEX_UTest_Multi_Proc_Only
write(name, *) "ArrayCreate from Copy (ALLOC), 2D ESMF_TYPEKIND_R8 Test"
write(failMsg, *) "Did not return ESMF_SUCCESS"
farrayPtr2D = real(localPet+10, ESMF_KIND_R8) ! fill with data to check
call random_number(farrayPtr2D) ! fill with data to check
farrayPtr2D = farrayPtr2D * 1000.0_ESMF_KIND_R8
arrayDup = ESMF_ArrayCreate(array, datacopyflag=ESMF_DATACOPY_ALLOC, rc=rc)
call ESMF_Test((rc.eq.ESMF_SUCCESS), name, failMsg, result, ESMF_SRCLINE)

Expand Down Expand Up @@ -398,14 +399,14 @@ program ESMF_ArrayCreateGetUTest
!NEX_UTest_Multi_Proc_Only
write(name, *) "Verify Array vs Array Copy (ALLOC) no data copy"
write(failMsg, *) "Unexpected data copy"
dataCorrect = .true.
dataCorrect = .false.
do j=lbound(farrayPtr2D,2), ubound(farrayPtr2D,2)
do i=lbound(farrayPtr2D,1), ubound(farrayPtr2D,1)
write (msg,*) "farrayPtr2D(",i,",",j,")=", farrayPtr2D(i,j), &
" farrayPtr2DCpy(",i,",",j,")=", farrayPtr2DCpy(i,j)
call ESMF_LogWrite(msg, ESMF_LOGMSG_INFO, rc=rc)
if (rc /= ESMF_SUCCESS) call ESMF_Finalize(endflag=ESMF_END_ABORT)
if (abs(farrayPtr2D(i,j)-farrayPtr2DCpy(i,j)) < 1.d-10) dataCorrect=.false.
if (abs(farrayPtr2D(i,j)-farrayPtr2DCpy(i,j)) >= 1.d-10) dataCorrect=.true.
enddo
enddo
call ESMF_Test((dataCorrect), name, failMsg, result, ESMF_SRCLINE)
Expand Down