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~6~~CallsGraph proc~setservices~6 SetServices ESMF_ConfigFindLabel ESMF_ConfigFindLabel proc~setservices~6->ESMF_ConfigFindLabel ESMF_ConfigGetDim ESMF_ConfigGetDim proc~setservices~6->ESMF_ConfigGetDim ESMF_ConfigNextLine ESMF_ConfigNextLine proc~setservices~6->ESMF_ConfigNextLine ESMF_GridCompGet ESMF_GridCompGet proc~setservices~6->ESMF_GridCompGet ESMF_UserCompSetInternalState ESMF_UserCompSetInternalState proc~setservices~6->ESMF_UserCompSetInternalState interface~mapl_addexportspec MAPL_AddExportSpec proc~setservices~6->interface~mapl_addexportspec interface~mapl_addinternalspec MAPL_AddInternalSpec proc~setservices~6->interface~mapl_addinternalspec none~addnewspec VarspecDescription%addNewSpec proc~setservices~6->none~addnewspec none~begin~78 VarspecDescriptionVector%begin proc~setservices~6->none~begin~78 none~get~159 VarspecDescriptionVectorIterator%get proc~setservices~6->none~get~159 none~next~79 VarspecDescriptionVectorIterator%next proc~setservices~6->none~next~79 none~push_back~50 VarspecDescriptionVector%push_back proc~setservices~6->none~push_back~50 proc~mapl_genericsetservices MAPL_GenericSetServices proc~setservices~6->proc~mapl_genericsetservices proc~mapl_gridcompsetentrypoint MAPL_GridCompSetEntryPoint proc~setservices~6->proc~mapl_gridcompsetentrypoint proc~mapl_return MAPL_Return proc~setservices~6->proc~mapl_return proc~mapl_verify MAPL_Verify proc~setservices~6->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