Skip to content

Commit 0bebf1a

Browse files
committed
Replaced MAPL_GridCompGetChildrenNames with a loop over MAPL_GridCompGetChildName
1 parent fb9a555 commit 0bebf1a

File tree

1 file changed

+12
-16
lines changed

1 file changed

+12
-16
lines changed

ESMF/GOCART2G_GridComp/GOCART2G_GridCompMod.F90

Lines changed: 12 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ module GOCART2G_GridCompMod
1111
use MAPL_Constants, only: MAPL_GRAV, MAPL_PI
1212

1313
use mapl3g_generic, only: MAPL_GridCompSetEntryPoint, MAPL_GridCompGet, MAPL_GridCompAddSpec
14-
use mapl3g_generic, only: MAPL_GridCompAddChild, MAPL_GridCompGetChildrenNames, MAPL_GridCompRunChild
14+
use mapl3g_generic, only: MAPL_GridCompAddChild, MAPL_GridCompGetChildName, MAPL_GridCompRunChild
1515
use mapl3g_generic, only: MAPL_GridCompAddConnectivity
1616
use mapl3g_generic, only: MAPL_GridCompGetResource, MAPL_GridCompReexport
1717
use mapl3g_generic, only: MAPL_STATEITEM_STATE, MAPL_STATEITEM_FIELDBUNDLE
@@ -470,17 +470,15 @@ subroutine Run1 (gc, import, export, clock, RC)
470470
!DESCRIPTION: Run method
471471
!EOP
472472
class(logger_t), pointer :: logger
473-
type(StringVector) :: children
474473
character(len=:), allocatable :: child_name
475-
integer :: iter, status
474+
integer :: num_children, iter, status
476475

477-
call MAPL_GridCompGet(gc, logger=logger, _RC)
476+
call MAPL_GridCompGet(gc, logger=logger, num_children=num_children, _RC)
478477
call logger%info("Run1: starting...")
479-
children = MAPL_GridCompGetChildrenNames(gc, _RC)
480-
do iter = 1, children%size()
481-
child_name = children%of(iter)
478+
do iter = 1, num_children
479+
child_name = MAPL_GridCompGetChildName(gc, iter, _RC)
482480
if ((index(child_name, "data")) /= 0) cycle
483-
call MAPL_GridCompRunChild(gc, child_name, phase_name="Run0", _RC)
481+
call MAPL_GridCompRunChild(gc, child_name, phase_name="Run1", _RC)
484482
end do
485483
call logger%info("Run1: ...complete")
486484

@@ -570,19 +568,17 @@ subroutine Run2 (gc, import, export, clock, rc)
570568
integer :: ind550, ind532
571569
integer :: i1, i2, j1, j2, km, k,kk
572570
class(logger_t), pointer :: logger
573-
type(StringVector) :: children
574571
character(len=:), allocatable :: child_name
575-
integer :: n, w, iter, status
572+
integer :: n, w, num_children, iter, status
576573

577574
#include "GOCART2G_DeclarePointer___.h"
578575

579-
call MAPL_GridCompGet(gc, logger=logger, _RC)
576+
call MAPL_GridCompGet(gc, logger=logger, num_children=num_children, _RC)
580577
call logger%info("Run2: starting...")
581-
children = MAPL_GridCompGetChildrenNames(gc, _RC)
582578

583579
! Run zero Klid for children
584-
do iter = 1, children%size()
585-
child_name = children%of(iter)
580+
do iter = 1, num_children
581+
child_name = MAPL_GridCompGetChildName(gc, iter, _RC)
586582
if ((index(child_name, "data")) /= 0) cycle
587583
call MAPL_GridCompRunChild(gc, child_name, phase_name="Run0", _RC)
588584
end do
@@ -617,8 +613,8 @@ subroutine Run2 (gc, import, export, clock, rc)
617613
if(associated(pso4tot)) pso4tot(:,:,:) = 0.
618614

619615
! Run the children
620-
do iter = 1, children%size()
621-
child_name = children%of(iter)
616+
do iter = 1, num_children
617+
child_name = MAPL_GridCompGetChildName(gc, iter, _RC)
622618
if ((index(child_name, "data")) /= 0) cycle
623619
call MAPL_GridCompRunChild(gc, child_name, phase_name="Run2", _RC)
624620
end do

0 commit comments

Comments
 (0)