ESMF_ArraySMMStoreFromFile Subroutine

private subroutine ESMF_ArraySMMStoreFromFile(srcArray, dstArray, filename, routehandle, keywordEnforcer, ignoreUnmatchedIndices, srcTermProcessing, pipeLineDepth, rc)

Arguments

Type IntentOptional Attributes Name
type(ESMF_Array), intent(in) :: srcArray
type(ESMF_Array), intent(inout) :: dstArray
character(len=*), intent(in) :: filename
type(ESMF_RouteHandle), intent(inout) :: routehandle
type(ESMF_KeywordEnforcer), optional :: keywordEnforcer
logical, intent(in), optional :: ignoreUnmatchedIndices
integer, intent(inout), optional :: srcTermProcessing
integer, intent(inout), optional :: pipeLineDepth
integer, intent(out), optional :: rc

Calls

proc~~esmf_arraysmmstorefromfile~~CallsGraph proc~esmf_arraysmmstorefromfile ESMF_ArraySMMStoreFromFile interface~esmf_arraysmmstore ESMF_ArraySMMStore proc~esmf_arraysmmstorefromfile->interface~esmf_arraysmmstore proc~esmf_factorread ESMF_FactorRead proc~esmf_arraysmmstorefromfile->proc~esmf_factorread proc~esmf_logfounderror ESMF_LogFoundError proc~esmf_arraysmmstorefromfile->proc~esmf_logfounderror interface~esmf_arraysmmstore->proc~esmf_arraysmmstorefromfile proc~esmf_arraysmmstorefromfiletp ESMF_ArraySMMStoreFromFileTP interface~esmf_arraysmmstore->proc~esmf_arraysmmstorefromfiletp proc~esmf_arraysmmstoreind4i4 ESMF_ArraySMMStoreInd4I4 interface~esmf_arraysmmstore->proc~esmf_arraysmmstoreind4i4 proc~esmf_arraysmmstoreind4i4tp ESMF_ArraySMMStoreInd4I4TP interface~esmf_arraysmmstore->proc~esmf_arraysmmstoreind4i4tp proc~esmf_arraysmmstoreind4i8 ESMF_ArraySMMStoreInd4I8 interface~esmf_arraysmmstore->proc~esmf_arraysmmstoreind4i8 proc~esmf_arraysmmstoreind4i8tp ESMF_ArraySMMStoreInd4I8TP interface~esmf_arraysmmstore->proc~esmf_arraysmmstoreind4i8tp proc~esmf_arraysmmstoreind4r4 ESMF_ArraySMMStoreInd4R4 interface~esmf_arraysmmstore->proc~esmf_arraysmmstoreind4r4 proc~esmf_arraysmmstoreind4r4tp ESMF_ArraySMMStoreInd4R4TP interface~esmf_arraysmmstore->proc~esmf_arraysmmstoreind4r4tp proc~esmf_arraysmmstoreind4r8 ESMF_ArraySMMStoreInd4R8 interface~esmf_arraysmmstore->proc~esmf_arraysmmstoreind4r8 proc~esmf_arraysmmstoreind4r8tp ESMF_ArraySMMStoreInd4R8TP interface~esmf_arraysmmstore->proc~esmf_arraysmmstoreind4r8tp proc~esmf_arraysmmstoreind8i4 ESMF_ArraySMMStoreInd8I4 interface~esmf_arraysmmstore->proc~esmf_arraysmmstoreind8i4 proc~esmf_arraysmmstoreind8i4tp ESMF_ArraySMMStoreInd8I4TP interface~esmf_arraysmmstore->proc~esmf_arraysmmstoreind8i4tp proc~esmf_arraysmmstoreind8i8 ESMF_ArraySMMStoreInd8I8 interface~esmf_arraysmmstore->proc~esmf_arraysmmstoreind8i8 proc~esmf_arraysmmstoreind8i8tp ESMF_ArraySMMStoreInd8I8TP interface~esmf_arraysmmstore->proc~esmf_arraysmmstoreind8i8tp proc~esmf_arraysmmstoreind8r4 ESMF_ArraySMMStoreInd8R4 interface~esmf_arraysmmstore->proc~esmf_arraysmmstoreind8r4 proc~esmf_arraysmmstoreind8r4tp ESMF_ArraySMMStoreInd8R4TP interface~esmf_arraysmmstore->proc~esmf_arraysmmstoreind8r4tp proc~esmf_arraysmmstoreind8r8 ESMF_ArraySMMStoreInd8R8 interface~esmf_arraysmmstore->proc~esmf_arraysmmstoreind8r8 proc~esmf_arraysmmstoreind8r8tp ESMF_ArraySMMStoreInd8R8TP interface~esmf_arraysmmstore->proc~esmf_arraysmmstoreind8r8tp proc~esmf_arraysmmstorenf ESMF_ArraySMMStoreNF interface~esmf_arraysmmstore->proc~esmf_arraysmmstorenf proc~esmf_arraysmmstorenftp ESMF_ArraySMMStoreNFTP interface~esmf_arraysmmstore->proc~esmf_arraysmmstorenftp proc~esmf_logseterror ESMF_LogSetError proc~esmf_factorread->proc~esmf_logseterror esmf_breakpoint esmf_breakpoint proc~esmf_logfounderror->esmf_breakpoint proc~esmf_logrc2msg ESMF_LogRc2Msg proc~esmf_logfounderror->proc~esmf_logrc2msg proc~esmf_logwrite ESMF_LogWrite proc~esmf_logfounderror->proc~esmf_logwrite

Called by

proc~~esmf_arraysmmstorefromfile~~CalledByGraph proc~esmf_arraysmmstorefromfile ESMF_ArraySMMStoreFromFile interface~esmf_arraysmmstore ESMF_ArraySMMStore proc~esmf_arraysmmstorefromfile->interface~esmf_arraysmmstore interface~esmf_arraysmmstore->proc~esmf_arraysmmstorefromfile proc~esmf_arraysmmstorefromfiletp ESMF_ArraySMMStoreFromFileTP interface~esmf_arraysmmstore->proc~esmf_arraysmmstorefromfiletp proc~esmf_arraysmmstorefromfiletp->interface~esmf_arraysmmstore proc~esmf_fieldsmmstorei4 ESMF_FieldSMMStoreI4 proc~esmf_fieldsmmstorei4->interface~esmf_arraysmmstore proc~esmf_fieldsmmstorei4tr ESMF_FieldSMMStoreI4TR proc~esmf_fieldsmmstorei4tr->interface~esmf_arraysmmstore proc~esmf_fieldsmmstorei8 ESMF_FieldSMMStoreI8 proc~esmf_fieldsmmstorei8->interface~esmf_arraysmmstore proc~esmf_fieldsmmstorei8tr ESMF_FieldSMMStoreI8TR proc~esmf_fieldsmmstorei8tr->interface~esmf_arraysmmstore proc~esmf_fieldsmmstorenf ESMF_FieldSMMStoreNF proc~esmf_fieldsmmstorenf->interface~esmf_arraysmmstore proc~esmf_fieldsmmstorenftr ESMF_FieldSMMStoreNFTR proc~esmf_fieldsmmstorenftr->interface~esmf_arraysmmstore proc~esmf_fieldsmmstorer4 ESMF_FieldSMMStoreR4 proc~esmf_fieldsmmstorer4->interface~esmf_arraysmmstore proc~esmf_fieldsmmstorer4tr ESMF_FieldSMMStoreR4TR proc~esmf_fieldsmmstorer4tr->interface~esmf_arraysmmstore proc~esmf_fieldsmmstorer8 ESMF_FieldSMMStoreR8 proc~esmf_fieldsmmstorer8->interface~esmf_arraysmmstore proc~esmf_fieldsmmstorer8tr ESMF_FieldSMMStoreR8TR proc~esmf_fieldsmmstorer8tr->interface~esmf_arraysmmstore proc~test_smm test_smm proc~test_smm->interface~esmf_arraysmmstore proc~user_init~36 user_init proc~user_init~36->interface~esmf_arraysmmstore proc~user_init~53 user_init proc~user_init~53->interface~esmf_arraysmmstore program~esmf_arrayarbidxsmmutest ESMF_ArrayArbIdxSMMUTest program~esmf_arrayarbidxsmmutest->interface~esmf_arraysmmstore program~esmf_arraysparsematmulex ESMF_ArraySparseMatMulEx program~esmf_arraysparsematmulex->interface~esmf_arraysmmstore program~esmf_rhandlebitforbitex ESMF_RHandleBitForBitEx program~esmf_rhandlebitforbitex->interface~esmf_arraysmmstore interface~esmf_fieldsmmstore ESMF_FieldSMMStore interface~esmf_fieldsmmstore->proc~esmf_fieldsmmstorei4 interface~esmf_fieldsmmstore->proc~esmf_fieldsmmstorei4tr interface~esmf_fieldsmmstore->proc~esmf_fieldsmmstorei8 interface~esmf_fieldsmmstore->proc~esmf_fieldsmmstorei8tr interface~esmf_fieldsmmstore->proc~esmf_fieldsmmstorenf interface~esmf_fieldsmmstore->proc~esmf_fieldsmmstorenftr interface~esmf_fieldsmmstore->proc~esmf_fieldsmmstorer4 interface~esmf_fieldsmmstore->proc~esmf_fieldsmmstorer4tr interface~esmf_fieldsmmstore->proc~esmf_fieldsmmstorer8 interface~esmf_fieldsmmstore->proc~esmf_fieldsmmstorer8tr proc~run~2 run proc~run~2->proc~test_smm program~esmf_arraysmmutest ESMF_ArraySMMUTest program~esmf_arraysmmutest->proc~test_smm

Source Code

  subroutine ESMF_ArraySMMStoreFromFile(srcArray, dstArray, filename, &
    routehandle, keywordEnforcer, ignoreUnmatchedIndices, &
    srcTermProcessing, pipelineDepth, rc)

! ! ARGUMENTS:
    type(ESMF_Array),       intent(in)              :: srcArray
    type(ESMF_Array),       intent(inout)           :: dstArray
    character(len=*),       intent(in)              :: filename
    type(ESMF_RouteHandle), intent(inout)           :: routehandle
type(ESMF_KeywordEnforcer), optional:: keywordEnforcer ! must use keywords below
    logical,                intent(in),    optional :: ignoreUnmatchedIndices
    integer,                intent(inout), optional :: srcTermProcessing
    integer,                intent(inout), optional :: pipeLineDepth
    integer,                intent(out),   optional :: rc
!
! !DESCRIPTION:
!
! Compute an {\tt ESMF\_RouteHandle} using factors read from file.
!
! The arguments are:
!
! \begin{description}
!
! \item [srcArray]
!     {\tt ESMF\_Array} with source data.
!
! \item [dstArray]
!       {\tt ESMF\_Array} with destination data. The data in this Array may be
!       destroyed by this call.
!
! \item [filename]
!       Path to the file containing weights for creating an {\tt ESMF\_RouteHandle}.
!       See ~(\ref{sec:weightfileformat}) for a description of the SCRIP weight
!       file format. Only "row", "col", and "S" variables are required. They
!       must be one-dimensionsal with dimension "n\_s".
!
! \item [routehandle]
!       Handle to the {\tt ESMF\_RouteHandle}.
!
!   \item [{[ignoreUnmatchedIndices]}]
!     A logical flag that affects the behavior for when sequence indices
!     in the sparse matrix are encountered that do not have a match on the
!     {\tt srcArray} or {\tt dstArray} side. The default setting is
!     {\tt .false.}, indicating that it is an error when such a situation is
!     encountered. Setting {\tt ignoreUnmatchedIndices} to {\tt .true.} ignores
!     entries with unmatched indices.
!
!   \item [{[srcTermProcessing]}]
!     The {\tt srcTermProcessing} parameter controls how many source terms,
!     located on the same PET and summing into the same destination element,
!     are summed into partial sums on the source PET before being transferred
!     to the destination PET. A value of 0 indicates that the entire arithmetic
!     is done on the destination PET; source elements are neither multiplied
!     by their factors nor added into partial sums before being sent off by the
!     source PET. A value of 1 indicates that source elements are multiplied
!     by their factors on the source side before being sent to the destination
!     PET. Larger values of {\tt srcTermProcessing} indicate the maximum number
!     of terms in the partial sums on the source side.
!
!     Note that partial sums may lead to bit-for-bit differences in the results.
!     See section \ref{RH:bfb} for an in-depth discussion of {\em all}
!     bit-for-bit reproducibility aspects related to route-based communication
!     methods.
!
!     \begin{sloppypar}
!     The {\tt ESMF\_ArraySMMStore()} method implements an auto-tuning scheme
!     for the {\tt srcTermProcessing} parameter. The intent on the
!     {\tt srcTermProcessing} argument is "{\tt inout}" in order to
!     support both overriding and accessing the auto-tuning parameter.
!     If an argument $>= 0$ is specified, it is used for the
!     {\tt srcTermProcessing} parameter, and the auto-tuning phase is skipped.
!     In this case the {\tt srcTermProcessing} argument is not modified on
!     return. If the provided argument is $< 0$, the {\tt srcTermProcessing}
!     parameter is determined internally using the auto-tuning scheme. In this
!     case the {\tt srcTermProcessing} argument is re-set to the internally
!     determined value on return. Auto-tuning is also used if the optional
!     {\tt srcTermProcessing} argument is omitted.
!     \end{sloppypar}
!
!   \item [{[pipelineDepth]}]
!     The {\tt pipelineDepth} parameter controls how many messages a PET
!     may have outstanding during a sparse matrix exchange. Larger values
!     of {\tt pipelineDepth} typically lead to better performance. However,
!     on some systems too large a value may lead to performance degradation,
!     or runtime errors.
!
!     Note that the pipeline depth has no effect on the bit-for-bit
!     reproducibility of the results. However, it may affect the performance
!     reproducibility of the exchange.
!     The {\tt ESMF\_ArraySMMStore()} method implements an auto-tuning scheme
!     for the {\tt pipelineDepth} parameter. The intent on the
!     {\tt pipelineDepth} argument is "{\tt inout}" in order to
!     support both overriding and accessing the auto-tuning parameter.
!     If an argument $>= 0$ is specified, it is used for the
!     {\tt pipelineDepth} parameter, and the auto-tuning phase is skipped.
!     In this case the {\tt pipelineDepth} argument is not modified on
!     return. If the provided argument is $< 0$, the {\tt pipelineDepth}
!     parameter is determined internally using the auto-tuning scheme. In this
!     case the {\tt pipelineDepth} argument is re-set to the internally
!     determined value on return. Auto-tuning is also used if the optional
!     {\tt pipelineDepth} argument is omitted.
!
!   \item [{[rc]}]
!     Return code; equals {\tt ESMF\_SUCCESS} if there are no errors.
!
! \end{description}
!
!EOP
!-------------------------------------------------------------------------------
    real(ESMF_KIND_R8), dimension(:), allocatable :: factorList
    integer, dimension(:, :), allocatable :: factorIndexList
    integer :: localrc

    ! Initialize return code; assume routine not implemented
    localrc = ESMF_RC_NOT_IMPL
    if (present(rc)) rc = ESMF_RC_NOT_IMPL

    ! Fill the factorList and factorIndexList.
    call ESMF_FactorRead(filename, &
                         factorList, &
                         factorIndexList, &
                         rc=localrc)
    if (ESMF_LogFoundError(localrc, ESMF_ERR_PASSTHRU, &
      ESMF_CONTEXT, rcToReturn=rc)) return

    ! Generate routeHandle from factorList and factorIndexList
    call ESMF_ArraySMMStore(srcArray=srcArray, &
                            dstArray=dstArray, &
                            routehandle=routeHandle, &
                            factorList=factorList, &
                            factorIndexList=factorIndexList,   &
                            ignoreUnmatchedIndices=ignoreUnmatchedIndices, &
                            srcTermProcessing=srcTermProcessing, &
                            pipeLineDepth=pipeLineDepth, &
                            rc=localrc)
    if (ESMF_LogFoundError(localrc, ESMF_ERR_PASSTHRU, &
      ESMF_CONTEXT, rcToReturn=rc)) return

    deallocate(factorList)
    deallocate(factorIndexList)

    if (present(rc)) rc = ESMF_SUCCESS

  end subroutine ESMF_ArraySMMStoreFromFile