test_smm_from_file Subroutine

public subroutine test_smm_from_file(srcFile, dstFile, weightFile, checkMethod, rc)

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in) :: srcFile
character(len=*), intent(in) :: dstFile
character(len=*), intent(in) :: weightFile
type(ESMF_RWGCheckMethod_Flag), intent(in) :: checkMethod
integer, intent(out) :: rc

Source Code

  subroutine test_smm_from_file(srcFile, dstFile, weightFile, checkMethod, &
                                rc)
    character(len=*), intent(in) :: srcFile, dstFile, weightFile
    integer, intent(out) :: rc
    type(ESMF_RWGCheckMethod_Flag), intent(in) :: checkMethod

    rc = ESMF_FAILURE

    ! Generate the netCDF weights file.
    call ESMF_RegridWeightGen(srcFile, dstFile, weightFile=weightFile, rc=rc)
    if (ESMF_LogFoundError(rcToCheck=rc, msg=ESMF_LOGERR_PASSTHRU, &
      line=__LINE__, file=FILENAME)) return

    ! Validate generated weights produce acceptable errors. This subroutine
    ! calls ESMF_ArraySMMStoreFromFile or ESMF_FieldSMMStoreFromFile.
    call ESMF_RegridWeightGenCheck(weightFile, checkMethod=checkMethod, rc=rc)
    if (ESMF_LogFoundError(rcToCheck=rc, msg=ESMF_LOGERR_PASSTHRU, &
      line=__LINE__, file=FILENAME)) return

    rc = ESMF_SUCCESS

  end subroutine test_smm_from_file