subroutine setup(outer_gc, states, rc)
type(ESMF_GridComp), intent(inout) :: outer_gc
type(MultiState), intent(out) :: states
integer, intent(out) :: rc
integer :: status, userRC
type(ESMF_Grid) :: grid
type(ESMF_HConfig) :: config
integer :: i
type(BasicVerticalGrid) :: vertical_grid
type(ESMF_Time) :: t
type(ESMF_TimeInterval) :: dt
type(ESMF_Clock) :: clock
rc = 0
call NUOPC_FieldDictionarySetup('./scenarios/FieldDictionary.yml', _RC)
config = ESMF_HConfigCreate(filename = './scenarios/scenario_1/parent.yaml',rc=status)
@assert_that(status, is(0))
call ESMF_TimeSet(t, h=0)
call ESMF_TimeIntervalSet(dt, h=1)
clock = ESMF_ClockCreate(dt, t)
outer_gc = create_grid_comp('P', user_setservices('libconfigurable_gridcomp'), config, clock, _RC)
call ESMF_GridCompSetServices(outer_gc, setServices, userRC=userRC, _RC)
_VERIFY(userRC)
grid = ESMF_GridCreateNoPeriDim(maxIndex=[4,4], name='I_AM_GROOT', _RC)
call MAPL_GridCompSetGeom(outer_gc, grid, _RC)
vertical_grid = BasicVerticalGrid(4)
call MAPL_GridCompSetVerticalGrid(outer_gc, vertical_grid, _RC)
associate (import => states%importState, export => states%exportState)
import = ESMF_StateCreate(_RC)
export = ESMF_StateCreate(_RC)
do i = 1, size(GENERIC_INIT_PHASE_SEQUENCE)
associate (phase => GENERIC_INIT_PHASE_SEQUENCE(i))
call ESMF_GridCompInitialize(outer_gc, &
importState=import, exportState=export, clock=clock, &
phase=phase, userRC=userRC, _RC)
_VERIFY(userRC)
end associate
end do
end associate
rc = 0
end subroutine setup