@@ -2871,7 +2871,7 @@ program ESMF_GridCreateUTest
2871
2871
2872
2872
call ESMF_Test((rc.eq. ESMF_SUCCESS), name, failMsg, result, ESMF_SRCLINE)
2873
2873
!- ----------------------------------------------------------------------------
2874
-
2874
+
2875
2875
!- ----------------------------------------------------------------------------
2876
2876
! NEX_UTest
2877
2877
write (name, * ) " Testing GridCreateCubedSphere with SchmidtTransform"
@@ -3313,6 +3313,59 @@ program ESMF_GridCreateUTest
3313
3313
call ESMF_Test(((rc.eq. ESMF_SUCCESS) .and. correct), name, failMsg, result, ESMF_SRCLINE)
3314
3314
3315
3315
3316
+ !- ----------------------------------------------------------------------------
3317
+ ! NEX_UTest
3318
+ write (name, * ) " Testing GridCreateCubedSphere with calcCoordType=ESMF_CUBEDSPHERECALC_LOCAL"
3319
+ write (failMsg, * ) " Incorrect result"
3320
+
3321
+ ! create grid
3322
+ rc= ESMF_SUCCESS
3323
+ grid= ESMF_GridCreateCubedSphere(15 , &
3324
+ staggerLocList = (/ ESMF_STAGGERLOC_CENTER, ESMF_STAGGERLOC_CORNER/ ), &
3325
+ coordCalcFlag= ESMF_CUBEDSPHERECALC_LOCAL, rc= localrc)
3326
+ if (localrc .ne. ESMF_SUCCESS) rc= ESMF_FAILURE
3327
+
3328
+
3329
+ ! Write to make sure it looks ok
3330
+ call ESMF_GridCellWriteVTK(grid, " csGrid" , rc= localrc)
3331
+ if (localrc .ne. ESMF_SUCCESS) rc= ESMF_FAILURE
3332
+
3333
+ ! Loop through just making sure coordinates are there
3334
+ call ESMF_GridGet(grid, localDECount= localDECount, rc= localrc)
3335
+ if (localrc .ne. ESMF_SUCCESS) rc= ESMF_FAILURE
3336
+
3337
+ do lde = 0 , localDECount-1
3338
+
3339
+ call ESMF_GridGetCoord(grid, coordDim= 1 , localDE= lde, farrayPtr= fptr1, &
3340
+ exclusiveLBound= exlbnd, exclusiveUBound= exubnd, rc= localrc)
3341
+ if (localrc .ne. ESMF_SUCCESS) rc= ESMF_FAILURE
3342
+ call ESMF_GridGetCoord(grid, coordDim= 2 , localDE= lde, farrayPtr= fptr2, &
3343
+ exclusiveLBound= exlbnd, exclusiveUBound= exubnd, rc= localrc)
3344
+ if (localrc .ne. ESMF_SUCCESS) rc= ESMF_FAILURE
3345
+
3346
+ #if 0
3347
+ print *, "coords from de", lde
3348
+
3349
+ print *, "lower bounds = [", exlbnd(1), ", ", exlbnd(2), "]"
3350
+ print *, "upper bounds = [", exubnd(1), ", ", exubnd(2), "]"
3351
+
3352
+ print *, "["
3353
+ do j = 1, exubnd(1)
3354
+ do i = 1, exubnd(2)
3355
+ print *, "[", fptr1(i,j), ", ", fptr2(i,j), "]"
3356
+ enddo
3357
+ enddo
3358
+ print *, "]"
3359
+ #endif
3360
+ enddo
3361
+
3362
+ ! destroy grid
3363
+ call ESMF_GridDestroy(grid, rc= localrc)
3364
+ if (localrc .ne. ESMF_SUCCESS) rc= ESMF_FAILURE
3365
+
3366
+ call ESMF_Test((rc.eq. ESMF_SUCCESS), name, failMsg, result, ESMF_SRCLINE)
3367
+ !- ----------------------------------------------------------------------------
3368
+
3316
3369
!- ----------------------------------------------------------------------------
3317
3370
! Stop testing
3318
3371
call ESMF_TestEnd(ESMF_SRCLINE)
0 commit comments