Skip to content

Commit 1d077cf

Browse files
bena-nasamathomp4
andauthored
Fix blatant bug in ExtData3G (#4804)
Co-authored-by: Matt Thompson <matthew.thompson@nasa.gov>
1 parent 7e1e70e commit 1d077cf

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

gridcomps/ExtData3G/ExtDataGridComp.F90

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ module mapl3g_ExtDataGridComp
3333
type(PrimaryExportVector) :: export_vector
3434
type(integerVector) :: rules_per_export
3535
type(integerVector) :: export_id_start
36+
type(StringVector) :: export_names
3637
logical :: has_run_mod_advert = .false.
3738
type(StringVector) :: active_items
3839
type(StringIntegerMap) :: last_item
@@ -103,6 +104,7 @@ subroutine modify_advertise(gridcomp, importState, exportState, clock, rc)
103104
has_rule = config%has_rule_for(item_name, _RC)
104105
_ASSERT(has_rule, 'no rule for extdata item: '//item_name)
105106
rules_for_item = config%count_rules_for_item(item_name, _RC)
107+
call extdata_gridcomp%export_names%push_back(item_name)
106108
call extdata_gridcomp%export_id_start%push_back(rule_counter+1)
107109
call extdata_gridcomp%rules_per_export%push_back(rules_for_item)
108110

@@ -226,9 +228,8 @@ function get_item_index(this,base_name,current_time,rc) result(item_index)
226228
type(PrimaryExport), pointer :: item
227229

228230
found = .false.
229-
do i=1,this%export_vector%size()
230-
item => this%export_vector%at(i)
231-
export_name = item%get_export_var_name()
231+
do i=1,this%export_names%size()
232+
export_name = this%export_names%of(i)
232233
if (export_name == base_name) then
233234
found = .true.
234235
i_start => this%export_id_start%at(i)

0 commit comments

Comments
 (0)