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