Skip to content

Commit

Permalink
ESMF_FileTypeCheck() does not appear to depend on PIO. Adjust the #if…
Browse files Browse the repository at this point in the history
…def logic of the UTest to accurately reflect the library dependency of the call.
  • Loading branch information
theurich committed Jun 19, 2023
1 parent 35194a4 commit 7babfad
Showing 1 changed file with 16 additions and 15 deletions.
31 changes: 16 additions & 15 deletions src/Infrastructure/IO/tests/ESMF_IO_FileTypeCheckUTest.F90
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ program ESMF_IO_FileTypeCheckUTest
!EX_UTest
call ESMF_FileTypeCheck("test_sph_3x3_scrip.nc", fileType, rc=rc)
write(name, *) "Detection of SCRIP grid file succeeds"
#if (defined ESMF_PIO && (defined ESMF_NETCDF || defined ESMF_PNETCDF))
#if (defined ESMF_NETCDF || defined ESMF_PNETCDF)
write(failMsg, *) "Did not return ESMF_SUCCESS"
call ESMF_Test(rc == ESMF_SUCCESS, name, failMsg, result, ESMF_SRCLINE)
#else
Expand All @@ -65,7 +65,7 @@ program ESMF_IO_FileTypeCheckUTest
#endif
!EX_UTest
write(name, *) "Detection of SCRIP grid file returns correct value"
#if (defined ESMF_PIO && (defined ESMF_NETCDF || defined ESMF_PNETCDF))
#if (defined ESMF_NETCDF || defined ESMF_PNETCDF)
write(failMsg, *) "Returned wrong file type"
call ESMF_Test(fileType == ESMF_FILEFORMAT_SCRIP, name, failMsg, result, ESMF_SRCLINE)
#else
Expand All @@ -78,7 +78,7 @@ program ESMF_IO_FileTypeCheckUTest
!EX_UTest
call ESMF_FileTypeCheck("test_sph_3x3_ugrid.nc", fileType, rc=rc)
write(name, *) "Detection of UGRID grid file succeeds"
#if (defined ESMF_PIO && (defined ESMF_NETCDF || defined ESMF_PNETCDF))
#if (defined ESMF_NETCDF || defined ESMF_PNETCDF)
write(failMsg, *) "Did not return ESMF_SUCCESS"
call ESMF_Test(rc == ESMF_SUCCESS, name, failMsg, result, ESMF_SRCLINE)
#else
Expand All @@ -87,7 +87,7 @@ program ESMF_IO_FileTypeCheckUTest
#endif
!EX_UTest
write(name, *) "Detection of UGRID grid file returns correct value"
#if (defined ESMF_PIO && (defined ESMF_NETCDF || defined ESMF_PNETCDF))
#if (defined ESMF_NETCDF || defined ESMF_PNETCDF)
write(failMsg, *) "Returned wrong file type"
call ESMF_Test(fileType == ESMF_FILEFORMAT_UGRID, name, failMsg, result, ESMF_SRCLINE)
#else
Expand All @@ -100,7 +100,7 @@ program ESMF_IO_FileTypeCheckUTest
!EX_UTest
call ESMF_FileTypeCheck("test_sph_3x3_esmf.nc", fileType, rc=rc)
write(name, *) "Detection of ESMFMESH grid file succeeds"
#if (defined ESMF_PIO && (defined ESMF_NETCDF || defined ESMF_PNETCDF))
#if (defined ESMF_NETCDF || defined ESMF_PNETCDF)
write(failMsg, *) "Did not return ESMF_SUCCESS"
call ESMF_Test(rc == ESMF_SUCCESS, name, failMsg, result, ESMF_SRCLINE)
#else
Expand All @@ -109,7 +109,7 @@ program ESMF_IO_FileTypeCheckUTest
#endif
!EX_UTest
write(name, *) "Detection of ESMFMESH grid file returns correct value"
#if (defined ESMF_PIO && (defined ESMF_NETCDF || defined ESMF_PNETCDF))
#if (defined ESMF_NETCDF || defined ESMF_PNETCDF)
write(failMsg, *) "Returned wrong file type"
call ESMF_Test(fileType == ESMF_FILEFORMAT_ESMFMESH, name, failMsg, result, ESMF_SRCLINE)
#else
Expand All @@ -122,7 +122,7 @@ program ESMF_IO_FileTypeCheckUTest
!EX_UTest
call ESMF_FileTypeCheck("GRIDSPEC_1x1_subset.nc", fileType, rc=rc)
write(name, *) "Detection of GRIDSPEC grid file succeeds"
#if (defined ESMF_PIO && (defined ESMF_NETCDF || defined ESMF_PNETCDF))
#if (defined ESMF_NETCDF || defined ESMF_PNETCDF)
write(failMsg, *) "Did not return ESMF_SUCCESS"
call ESMF_Test(rc == ESMF_SUCCESS, name, failMsg, result, ESMF_SRCLINE)
#else
Expand All @@ -131,7 +131,7 @@ program ESMF_IO_FileTypeCheckUTest
#endif
!EX_UTest
write(name, *) "Detection of GRIDSPEC grid file returns correct value"
#if (defined ESMF_PIO && (defined ESMF_NETCDF || defined ESMF_PNETCDF))
#if (defined ESMF_NETCDF || defined ESMF_PNETCDF)
write(failMsg, *) "Returned wrong file type"
call ESMF_Test(fileType == ESMF_FILEFORMAT_GRIDSPEC, name, failMsg, result, ESMF_SRCLINE)
#else
Expand All @@ -144,7 +144,7 @@ program ESMF_IO_FileTypeCheckUTest
!EX_UTest
call ESMF_FileTypeCheck("C48_mosaic.nc", fileType, rc=rc)
write(name, *) "Detection of MOSAIC grid file succeeds"
#if (defined ESMF_PIO && (defined ESMF_NETCDF || defined ESMF_PNETCDF))
#if (defined ESMF_NETCDF || defined ESMF_PNETCDF)
write(failMsg, *) "Did not return ESMF_SUCCESS"
call ESMF_Test(rc == ESMF_SUCCESS, name, failMsg, result, ESMF_SRCLINE)
#else
Expand All @@ -153,7 +153,7 @@ program ESMF_IO_FileTypeCheckUTest
#endif
!EX_UTest
write(name, *) "Detection of MOSAIC grid file returns correct value"
#if (defined ESMF_PIO && (defined ESMF_NETCDF || defined ESMF_PNETCDF))
#if (defined ESMF_NETCDF || defined ESMF_PNETCDF)
write(failMsg, *) "Returned wrong file type"
call ESMF_Test(fileType == ESMF_FILEFORMAT_MOSAIC, name, failMsg, result, ESMF_SRCLINE)
#else
Expand All @@ -166,7 +166,7 @@ program ESMF_IO_FileTypeCheckUTest
!EX_UTest
call ESMF_FileTypeCheck("horizontal_grid.tile6_subset.nc", fileType, rc=rc)
write(name, *) "Detection of TILE grid file succeeds"
#if (defined ESMF_PIO && (defined ESMF_NETCDF || defined ESMF_PNETCDF))
#if (defined ESMF_NETCDF || defined ESMF_PNETCDF)
write(failMsg, *) "Did not return ESMF_SUCCESS"
call ESMF_Test(rc == ESMF_SUCCESS, name, failMsg, result, ESMF_SRCLINE)
#else
Expand All @@ -175,7 +175,7 @@ program ESMF_IO_FileTypeCheckUTest
#endif
!EX_UTest
write(name, *) "Detection of TILE grid file returns correct value"
#if (defined ESMF_PIO && (defined ESMF_NETCDF || defined ESMF_PNETCDF))
#if (defined ESMF_NETCDF || defined ESMF_PNETCDF)
write(failMsg, *) "Returned wrong file type"
call ESMF_Test(fileType == ESMF_FILEFORMAT_TILE, name, failMsg, result, ESMF_SRCLINE)
#else
Expand All @@ -188,7 +188,7 @@ program ESMF_IO_FileTypeCheckUTest
!EX_UTest
call ESMF_FileTypeCheck("test_sph_3x3_scrip_units_look_like_gridspec.nc", fileType, rc=rc)
write(name, *) "Detection of SCRIP grid file (with units like GRIDSPEC) succeeds"
#if (defined ESMF_PIO && (defined ESMF_NETCDF || defined ESMF_PNETCDF))
#if (defined ESMF_NETCDF || defined ESMF_PNETCDF)
write(failMsg, *) "Did not return ESMF_SUCCESS"
call ESMF_Test(rc == ESMF_SUCCESS, name, failMsg, result, ESMF_SRCLINE)
#else
Expand All @@ -197,7 +197,7 @@ program ESMF_IO_FileTypeCheckUTest
#endif
!EX_UTest
write(name, *) "Detection of SCRIP grid file (with units like GRIDSPEC) returns correct value"
#if (defined ESMF_PIO && (defined ESMF_NETCDF || defined ESMF_PNETCDF))
#if (defined ESMF_NETCDF || defined ESMF_PNETCDF)
write(failMsg, *) "Returned wrong file type"
call ESMF_Test(fileType == ESMF_FILEFORMAT_SCRIP, name, failMsg, result, ESMF_SRCLINE)
#else
Expand All @@ -206,7 +206,8 @@ program ESMF_IO_FileTypeCheckUTest
#endif
!------------------------------------------------------------------------

#endif ! ESMF_TESTEXHAUSTIVE
! ESMF_TESTEXHAUSTIVE
#endif

!------------------------------------------------------------------------
call ESMF_TestEnd(ESMF_SRCLINE) ! calls ESMF_Finalize() internally
Expand Down

0 comments on commit 7babfad

Please sign in to comment.