ESMF_FieldSMMFromFileUTest Program

Uses

  • program~~esmf_fieldsmmfromfileutest~~UsesGraph program~esmf_fieldsmmfromfileutest ESMF_FieldSMMFromFileUTest module~esmf ESMF program~esmf_fieldsmmfromfileutest->module~esmf module~esmf_fieldsmmfromfileutestmod ESMF_FieldSMMFromFileUTestMod program~esmf_fieldsmmfromfileutest->module~esmf_fieldsmmfromfileutestmod module~esmf_testmod ESMF_TestMod program~esmf_fieldsmmfromfileutest->module~esmf_testmod

Calls

program~~esmf_fieldsmmfromfileutest~~CallsGraph program~esmf_fieldsmmfromfileutest ESMF_FieldSMMFromFileUTest proc~esmf_finalize ESMF_Finalize program~esmf_fieldsmmfromfileutest->proc~esmf_finalize proc~esmf_test ESMF_Test program~esmf_fieldsmmfromfileutest->proc~esmf_test proc~esmf_testend ESMF_TestEnd program~esmf_fieldsmmfromfileutest->proc~esmf_testend proc~esmf_teststart ESMF_TestStart program~esmf_fieldsmmfromfileutest->proc~esmf_teststart proc~test_regrid_store_from_file test_regrid_store_from_file program~esmf_fieldsmmfromfileutest->proc~test_regrid_store_from_file proc~test_smm_from_file~2 test_smm_from_file program~esmf_fieldsmmfromfileutest->proc~test_smm_from_file~2

Variables

Type Attributes Name Initial
character(len=*), parameter :: dstFile = 'data/T42_grid.nc'
character(len=*), parameter :: srcFile = 'data/T42_grid.nc'
character(len=*), parameter :: version = '$Id$'
character(len=*), parameter :: weightFile = 'data/test_smm_from_file_weights.nc'
character(len=ESMF_MAXSTR) :: failMsg
character(len=ESMF_MAXSTR) :: name
integer :: rc
integer :: result = 0

Source Code

program ESMF_FieldSMMFromFileUTest

!==============================================================================
!BOP
! !PROGRAM: ESMF_FieldSMMFromFileUTest - Tests FieldSMMFromFile()
!
! !DESCRIPTION:
!
!-----------------------------------------------------------------------------
! !USES:
  use ESMF_TestMod ! test methods
  use ESMF

  use ESMF_FieldSMMFromFileUTestMod

  implicit none

!------------------------------------------------------------------------------
! The following line turns the CVS identifier string into a printable variable.
  character(*), parameter :: version = &
    '$Id$'
!------------------------------------------------------------------------------

!-------------------------------------------------------------------------
!=========================================================================

  character(ESMF_MAXSTR)      :: failMsg
  character(ESMF_MAXSTR)      :: name
  character(len=*), parameter :: srcFile = 'data/T42_grid.nc'
  character(len=*), parameter :: dstFile = 'data/T42_grid.nc'
  character(len=*), parameter :: weightFile = 'data/test_smm_from_file_weights.nc'
  integer                     :: rc
  integer                     :: result = 0

!-------------------------------------------------------------------------------
! The unit tests are divided into Sanity and Exhaustive. The Sanity tests are
! always run. When the environment variable, EXHAUSTIVE, is set to ON then
! the EXHAUSTIVE and sanity tests both run. If the EXHAUSTIVE variable is set
! to OFF, then only the sanity unit tests.
! Special strings (Non-exhaustive and exhaustive) have been
! added to allow a script to count the number and types of unit tests.
!-------------------------------------------------------------------------------

  !------------------------------------------------------------------------
  call ESMF_TestStart(ESMF_SRCLINE, rc=rc)  ! calls ESMF_Initialize() internally
  if (rc /= ESMF_SUCCESS) call ESMF_Finalize(endflag=ESMF_END_ABORT)
  !------------------------------------------------------------------------

  !------------------------------------------------------------------------
  !NEX_UTest
  write(name, *) "ESMF_FieldSMMFromFile Unit Test"
  write(failMsg, *) "Did not return ESMF_SUCCESS"

  call test_smm_from_file(srcFile, dstFile, weightFile, &
                          ESMF_RWGCHECKMETHOD_FIELD, rc)

#if defined ESMF_NETCDF
  call ESMF_Test((rc .eq. ESMF_SUCCESS), name, failMsg, result, ESMF_SRCLINE)
#else
  write(failMsg, *) "Did not return ESMF_RC_LIB_NOT_PRESENT"
  call ESMF_Test((rc .eq. ESMF_RC_LIB_NOT_PRESENT), name, failMsg, result, ESMF_SRCLINE)
#endif
  !------------------------------------------------------------------------

  !------------------------------------------------------------------------
  !NEX_UTest
  write(name, *) "ESMF_FieldRegridStoreFromFile Unit Test"
  write(failMsg, *) "Did not return ESMF_SUCCESS"

  call test_regrid_store_from_file(rc)

#if (defined ESMF_PIO && ( defined ESMF_NETCDF || defined ESMF_PNETCDF))
  call ESMF_Test((rc .eq. ESMF_SUCCESS), name, failMsg, result, ESMF_SRCLINE)
#else
  write(failMsg, *) "Did not return ESMF_RC_LIB_NOT_PRESENT"
  call ESMF_Test((rc .eq. ESMF_RC_LIB_NOT_PRESENT), name, failMsg, result, ESMF_SRCLINE)
#endif
  !------------------------------------------------------------------------

  call ESMF_TestEnd(ESMF_SRCLINE) ! calls ESMF_Finalize() internally

end program ESMF_FieldSMMFromFileUTest