SetServices Subroutine

public subroutine SetServices(GC, RC)

Arguments

Type IntentOptional Attributes Name
type(ESMF_GridComp), intent(inout) :: GC
integer, intent(out) :: RC

Calls

proc~~setservices~7~~CallsGraph proc~setservices~7 SetServices ESMF_ConfigFindLabel ESMF_ConfigFindLabel proc~setservices~7->ESMF_ConfigFindLabel ESMF_ConfigGetDim ESMF_ConfigGetDim proc~setservices~7->ESMF_ConfigGetDim ESMF_ConfigNextLine ESMF_ConfigNextLine proc~setservices~7->ESMF_ConfigNextLine ESMF_GridCompGet ESMF_GridCompGet proc~setservices~7->ESMF_GridCompGet ESMF_UserCompSetInternalState ESMF_UserCompSetInternalState proc~setservices~7->ESMF_UserCompSetInternalState interface~mapl_addexportspec MAPL_AddExportSpec proc~setservices~7->interface~mapl_addexportspec interface~mapl_addinternalspec MAPL_AddInternalSpec proc~setservices~7->interface~mapl_addinternalspec none~addnewspec VarspecDescription%addNewSpec proc~setservices~7->none~addnewspec none~begin~102 VarspecDescriptionVector%begin proc~setservices~7->none~begin~102 none~get~198 VarspecDescriptionVectorIterator%get proc~setservices~7->none~get~198 none~next~106 VarspecDescriptionVectorIterator%next proc~setservices~7->none~next~106 none~push_back~65 VarspecDescriptionVector%push_back proc~setservices~7->none~push_back~65 proc~mapl_genericsetservices MAPL_GenericSetServices proc~setservices~7->proc~mapl_genericsetservices proc~mapl_gridcompsetentrypoint MAPL_GridCompSetEntryPoint proc~setservices~7->proc~mapl_gridcompsetentrypoint proc~mapl_return MAPL_Return proc~setservices~7->proc~mapl_return proc~mapl_verify MAPL_Verify proc~setservices~7->proc~mapl_verify

Source Code

      subroutine SetServices ( GC, RC )

! !ARGUMENTS:

         type(ESMF_GridComp), intent(INOUT) :: GC  ! gridded component
         integer,             intent(  OUT) :: RC  ! return code

         integer                                 :: STATUS
         character(len=ESMF_MAXSTR)              :: COMP_NAME

         type(ESMF_Config)          :: cf
         type(SyntheticFieldSupportWrapper) :: synthWrap
         type(SyntheticFieldSupport), pointer :: synth
         integer :: vloc

         call ESMF_GridCompGet( GC, NAME=COMP_NAME, CONFIG=CF, _RC )

         call MAPL_GridCompSetEntryPoint ( GC, ESMF_METHOD_INITIALIZE,  Initialize_, _RC)
         call MAPL_GridCompSetEntryPoint ( GC, ESMF_METHOD_RUN,   Run_, _RC)

         allocate(synth)
         synthWrap%ptr => synth
         call ESMF_UserCompSetInternalState(gc,wrap_name,synthWrap,status)
         _VERIFY(status)
         call ESMF_ConfigFindLabel(cf,"tiling_file:",isPresent=synth%on_tiles,_RC)
         if (synth%on_tiles) then
            vloc = MAPL_DimsTileOnly
         else
            vloc = MAPL_DimsHorzOnly
         end if

         call AddState(GC,CF,"IMPORT",_RC)
         call AddState(GC,CF,"EXPORT",_RC)

         call MAPL_AddInternalSpec(GC,&
               short_name='time', &
               long_name='na' , &
               units = 'na', &
               dims = vloc, &
               vlocation = MAPL_VLocationNone, _RC)
         call MAPL_AddInternalSpec(GC,&
               short_name='lats', &
               long_name='na' , &
               units = 'na', &
               dims = vloc, &
               vlocation = MAPL_VLocationNone, _RC)
         call MAPL_AddInternalSpec(GC,&
               short_name='lons', &
               long_name='na' , &
               units = 'na', &
               dims = vloc, &
               vlocation = MAPL_VLocationNone, _RC)
         call MAPL_AddInternalSpec(GC,&
               short_name='i_index', &
               long_name='na' , &
               units = 'na', &
               dims = vloc, &
               vlocation = MAPL_VLocationNone, _RC)
         call MAPL_AddInternalSpec(GC,&
               short_name='j_index', &
               long_name='na' , &
               units = 'na', &
               dims = vloc, &
               vlocation = MAPL_VLocationNone, _RC)
         call MAPL_AddInternalSpec(GC,&
               short_name='doy', &
               long_name='day_since_start_of_year' , &
               units = 'na', &
               dims = vloc, &
               vlocation = MAPL_VLocationNone, _RC)
         call MAPL_AddInternalSpec(GC,&
               short_name='rand', &
               long_name='random number' , &
               units = 'na', &
               dims = vloc, &
               vlocation = MAPL_VLocationNone, _RC)
         call MAPL_AddExportSpec(GC, &
               short_name='test_bundle', &
               long_name='test', &
               units='X', &
               datatype=MAPL_BundleItem, _RC)

         call MAPL_GenericSetServices ( GC, _RC)

         _RETURN(ESMF_SUCCESS)

      end subroutine SetServices