next up previous contents
Next: 2 Modules used in Up: 1 General Modules and Previous: 13 Kind types   Contents


14 MCT Datatypes

14.1 Module cpl_mct_mod - provides a standard API naming convention for MCT code (Source File: cpl_mct_mod.F90)

This module should be used instead of accessing mct modules directly. This module:

This module also includes some MCT-only functions to augment the MCT library.


       2001-Aug-14 - B. Kauffman - first prototype
 module cpl_mct_mod
    use shr_sys_mod          ! share system routines
    use shr_mpi_mod          ! mpi layer
    use cpl_kind_mod         ! kinds
    use cpl_const_mod        ! constant module
    use m_MCTWorld           ,only: cpl_mct_world_init     => init
    use m_AttrVect           ,only: cpl_mct_aVect          => AttrVect
    use m_AttrVect           ,only: cpl_mct_aVect_init     => init
    use m_AttrVect           ,only: cpl_mct_aVect_clean    => clean
    use m_AttrVect           ,only: cpl_mct_aVect_zero     => zero
    use m_AttrVect           ,only: cpl_mct_aVect_lsize    => lsize
    use m_AttrVect           ,only: cpl_mct_aVect_indexIA  => indexIA
    use m_AttrVect           ,only: cpl_mct_aVect_indexRA  => indexRA
    use m_AttrVect           ,only: cpl_mct_aVect_getIList => getIList
    use m_AttrVect           ,only: cpl_mct_aVect_getRList => getRList
    use m_AttrVect           ,only: cpl_mct_aVect_nIAttr   => nIAttr
    use m_AttrVect           ,only: cpl_mct_aVect_nRAttr   => nRAttr
    use m_AttrVect           ,only: cpl_mct_aVect_copy     => Copy
    use m_AttrVectComms      ,only: cpl_mct_aVect_scatter  => scatter
    use m_AttrVectComms      ,only: cpl_mct_aVect_gather   => gather 
    use m_AttrVectComms      ,only: cpl_mct_aVect_bcast    => bcast  
    use m_Transfer           ,only: cpl_mct_send          => Send
    use m_Transfer           ,only: cpl_mct_recv          => Recv
    use m_GlobalSegMap       ,only: cpl_mct_gsMap         => GlobalSegMap
    use m_GlobalSegMap       ,only: cpl_mct_gsMap_init    => init
    use m_GlobalSegMap       ,only: cpl_mct_gsMap_clean   => clean
    use m_GlobalSegMap       ,only: cpl_mct_gsMap_lsize   => lsize
    use m_GlobalSegMap       ,only: cpl_mct_gsMap_gsize   => gsize
    use m_Rearranger         ,only: cpl_mct_rearr           => Rearranger
    use m_Rearranger         ,only: cpl_mct_rearr_init      => init
    use m_Rearranger         ,only: cpl_mct_rearr_clean     => clean
    use m_Rearranger         ,only: cpl_mct_rearr_rearrange => rearrange
    use m_Router             ,only: cpl_mct_router        => Router
    use m_Router             ,only: cpl_mct_router_init   => init
    use m_Router             ,only: cpl_mct_router_clean  => clean
    use m_SparseMatrixToMaps ,only: cpl_mct_sMat_2XgsMap  => SparseMatrixToXGlobalSegMap
    use m_SparseMatrixToMaps ,only: cpl_mct_sMat_2YgsMap  => SparseMatrixToYGlobalSegMap
    use m_SparseMatrix       ,only: cpl_mct_sMat              => SparseMatrix
    use m_SparseMatrix       ,only: cpl_mct_sMat_Init         => init
    use m_SparseMatrix       ,only: cpl_mct_sMat_Vecinit      => vecinit
    use m_SparseMatrix       ,only: cpl_mct_sMat_Clean        => clean
    use m_SparseMatrix       ,only: cpl_mct_sMat_indexIA      => indexIA
    use m_SparseMatrix       ,only: cpl_mct_sMat_indexRA      => indexRA
    use m_SparseMatrix       ,only: cpl_mct_sMat_lsize        => lsize
    use m_SparseMatrix       ,only: cpl_mct_sMat_nrows        => nRows
    use m_SparseMatrix       ,only: cpl_mct_sMat_ncols        => nCols
    use m_SparseMatrix       ,only: cpl_mct_sMat_SortPermute  => SortPermute
    use m_SparseMatrix       ,only: cpl_mct_sMat_GNumEl       => GlobalNumElements
    use m_SparseMatrixComms  ,only: cpl_mct_sMat_ScatterByRow => ScatterByRow
    use m_SparseMatrixComms  ,only: cpl_mct_sMat_ScatterByCol => ScatterByColumn
    use m_MatAttrVectMul     ,only: cpl_mct_sMat_avMult       => sMatAvMult
    use m_GlobalToLocal      ,only: cpl_mct_sMat_g2lMat       => GlobalToLocalMatrix
    use m_List               ,only: cpl_mct_list          => list     
    use m_List               ,only: cpl_mct_list_init     => init
    use m_List               ,only: cpl_mct_list_get      => get 
    use m_List               ,only: cpl_mct_list_nitem    => nitem 
    use m_List               ,only: cpl_mct_list_clean    => clean
    use m_string             ,only: cpl_mct_string        => string 
    use m_string             ,only: cpl_mct_string_clean  => clean
    use m_string             ,only: cpl_mct_string_toChar => toChar 
    use m_die                ,only: cpl_mct_perr_die      => mp_perr_die
    implicit none
    This was added specifically for ES compiler bug:
    public :: cpl_mct_list, cpl_mct_gsmap, cpl_mct_router

14.1.1 cpl_mct_aVect_info - print out aVect info for debugging

Print out information about the input MCT AttributeVector aVect to stdout. flag sets the level of information:

  1. print out names of attributes in aVect.
  2. also print out local max and min of data in aVect.
  3. also print out global max and min of data in aVect.
  4. Same as 3 but include name of this routine.
If flag is 3 or higher, then optional argument comm must be provided. If optional argument fld is present, only information for that field will be printed. If optional argument istr is present, it will be output before any of the information.


       2003 Jul 01 - B. Kauffman, T. Craig - first version
 subroutine cpl_mct_aVect_info(flag,aVect,comm,pe,fld,istr)
    integer(IN),intent(in)           :: flag  ! info level flag
    type(cpl_mct_aVect),intent(in)   :: aVect ! Attribute vector
    integer(IN),intent(in),optional  :: comm  ! MPI communicator
    integer(IN),intent(in),optional  :: pe    ! processor number
    character(*),intent(in),optional :: fld   ! fld
    character(*),intent(in),optional :: istr  ! string for print

14.1.2 cpl_mct_aVect_getRAttr - get real F90 array data out of an aVect

Get the data associated with attribute str in AttributeVector aVect and return in the real F90 array data data. rcode will be 0 if succesful, 1 if size of data does not match size of aVect and 2 if str is not found.


     This is like the MCT routine exportRAttr except the output argument
     is not a pointer.
       2002 Apr xx - B. Kauffman - first version
 subroutine cpl_mct_aVect_getRAttr(aVect,str,data,rcode)
    type(cpl_mct_aVect),intent(in)  :: aVect    ! an Attribute vector
    character(*)       ,intent(in)  :: str      ! field name string
    real(R8)           ,intent(out) :: data(:)  ! an F90 array
    integer(IN)        ,intent(out) :: rcode    ! return code

14.1.3 cpl_mct_aVect_putRAttr - put real F90 array data into an aVect

Put the data in array data into the AttributeVector aVect under the attribute str. rcode will be 0 if succesful, 1 if size of data does not match size of aVect and 2 if str is not found.


     This is like the MCT routine importRAttr except the output argument
     is not a pointer.
       2002 Apr xx - B. Kauffman - first version
 subroutine cpl_mct_aVect_putRAttr(aVect,str,data,rcode)
    type(cpl_mct_aVect),intent(out) :: aVect ! Attribute vector
    character(*)       ,intent(in)  :: str
    real(R8)           ,intent(in)  :: data(:)
    integer(IN)        ,intent(out) :: rcode

14.1.4 cpl_mct_aVect_accum - accumulate attributes from one aVect to another

This routine accumulates from input argment aVin into the output AttrVect argument aVout the real and integer attributes specified in input CHARACTER argument iList and rList. The attributes can be listed in any order. If neither iList nor rList are provided, all attributes shared between aVin and aVout will be copied.

If any attributes in aVout have different names but represent the the same quantity and should still be copied, you must provide a translation argument TrList and/or TiList. The translation arguments should be identical to the rList or iList but with the correct aVout name subsititued at the appropriate place.

N.B.: This routine will fail if the aVout is not initialized or if any of the specified attributes are not present in either aVout or aVin.


      2002 Sep 15 - ? - initial version.
 subroutine cpl_mct_aVect_accum(aVin, rList, TrList, iList, TiList, aVout)
    use m_die ,          only : die
    use m_stdio ,        only : stderr
    use m_String ,       only : String_toChar => toChar
    use m_String ,       only : String
    use m_String ,       only : String_init
    use m_String ,       only : String_clean => clean
    use m_List ,         only : List
    use m_List,          only : List_get => get
    use m_List,          only : List_nullify => nullify
    use m_List,          only : List_clean => clean
    use m_List,          only : init,nitem
    use m_AttrVect,      only : AttrVect
    use m_AttrVect,      only : lsize
    use m_AttrVect,      only : SharedAttrIndexList
    implicit none
    type(AttrVect)        ,intent(in)    :: aVin
    character(*), optional,intent(in)    :: iList
    character(*), optional,intent(in)    :: rList
    character(*), optional,intent(in)    :: TiList
    character(*), optional,intent(in)    :: TrList
    type(AttrVect)        ,intent(inout) :: aVout

next up previous contents
Next: 2 Modules used in Up: 1 General Modules and Previous: 13 Kind types   Contents