Skip to content

Commit

Permalink
fixes #3255
Browse files Browse the repository at this point in the history
  • Loading branch information
bena-nasa committed Dec 18, 2024
1 parent c3d2046 commit 4c07622
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 9 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Changed

- Removed restrction that vector regridding in ExtData2G must be bilinear

### Fixed

- Fixed by when using multiple rules for a vector item in ExtData2G

### Removed

### Deprecated
Expand Down
21 changes: 16 additions & 5 deletions gridcomps/ExtData2G/ExtDataConfig.F90
Original file line number Diff line number Diff line change
Expand Up @@ -324,11 +324,12 @@ subroutine add_new_rule(this,key,export_rule,multi_rule,rc)
logical, optional, intent(in) :: multi_rule
integer, intent(out), optional :: rc

integer :: semi_pos,status
integer :: semi_pos,status,rule_n_pos
type(ExtDataRule) :: rule,ucomp,vcomp
type(ExtDataRule), pointer :: temp_rule
character(len=:), allocatable :: uname,vname
character(len=:), allocatable :: uname,vname,original_key
logical :: usable_multi_rule
character(len=1) :: rule_num

if (present(multi_rule)) then
usable_multi_rule = multi_rule
Expand All @@ -341,14 +342,24 @@ subroutine add_new_rule(this,key,export_rule,multi_rule,rc)
rule = ExtDataRule(export_rule,this%sample_map,key,multi_rule=usable_multi_rule,_RC)
semi_pos = index(key,";")
if (semi_pos > 0) then
call rule%split_vector(key,ucomp,vcomp,rc=status)
rule_n_pos = index(key,rule_sep)
original_key = key
if (rule_n_pos > 0) original_key = key(1:rule_n_pos-1)

call rule%split_vector(original_key,ucomp,vcomp,rc=status)
uname = key(1:semi_pos-1)
vname = key(semi_pos+1:len_trim(key))

if (rule_n_pos > 0) then
rule_num = key(rule_n_pos+1:rule_n_pos+1)
uname=uname//rule_sep//rule_num
end if

temp_rule => this%rule_map%at(trim(uname))
_ASSERT(.not.associated(temp_rule),"duplicated export entry key: "//trim(key))
_ASSERT(.not.associated(temp_rule),"duplicated export entry key: "//trim(uname))
call this%rule_map%insert(trim(uname),ucomp)
temp_rule => this%rule_map%at(trim(vname))
_ASSERT(.not.associated(temp_rule),"duplicated export entry key: "//trim(key))
_ASSERT(.not.associated(temp_rule),"duplicated export entry key: "//trim(vname))
call this%rule_map%insert(trim(vname),vcomp)
else
temp_rule => this%rule_map%at(trim(key))
Expand Down
4 changes: 0 additions & 4 deletions gridcomps/ExtData2G/ExtDataGridCompNG.F90
Original file line number Diff line number Diff line change
Expand Up @@ -1464,10 +1464,6 @@ subroutine create_bracketing_fields(item,ExtDataState,cf,rc)

else if (item%vartype == MAPL_VectorField) then

if (item%Trans /= REGRID_METHOD_BILINEAR) then
_FAIL('No conservative re-gridding with vectors')
end if

call ESMF_StateGet(ExtDataState, trim(item%vcomp1), field,_RC)
call ESMF_FieldGet(field,grid=grid,rank=fieldRank,_RC)

Expand Down

0 comments on commit 4c07622

Please sign in to comment.