Skip to content

Commit

Permalink
fixs #3025
Browse files Browse the repository at this point in the history
  • Loading branch information
bena-nasa committed Sep 16, 2024
1 parent 0fe9a5e commit 7052154
Showing 1 changed file with 42 additions and 43 deletions.
85 changes: 42 additions & 43 deletions gridcomps/ExtData2G/ExtDataGridCompNG.F90
Original file line number Diff line number Diff line change
Expand Up @@ -390,7 +390,6 @@ SUBROUTINE Initialize_ ( GC, IMPORT, EXPORT, CLOCK, rc )
current_base_name => self%derived%import_names%at(i)
num_derived=num_derived+1
allocate(derived_item)
!call config_yaml%fillin_derived(current_base_name,self%derived%item(num_derived),time,clock,_RC)
call config_yaml%fillin_derived(current_base_name,derived_item,time,clock,_RC)
call self%derived%item_vec%push_back(derived_item)
call ESMF_StateGet(Export,current_base_name,field,_RC)
Expand Down Expand Up @@ -612,15 +611,15 @@ SUBROUTINE Run_ ( GC, IMPORT, EXPORT, CLOCK, rc )
call MAPL_TimerOff(MAPLSTATE,"---read-prefetch")
call MAPL_TimerOff(MAPLSTATE,"--PRead")

!bundle_iter = IOBundles%begin()
!do while (bundle_iter /= IOBundles%end())
!io_bundle => bundle_iter%get()
!bracket_side = io_bundle%bracket_side
!entry_num = io_bundle%entry_index
!item => self%primary%item(entry_num)
!call MAPL_ExtDataVerticalInterpolate(self,item,bracket_side,current_time,_RC)
!call bundle_iter%next()
!enddo
bundle_iter = IOBundles%begin()
do while (bundle_iter /= IOBundles%end())
io_bundle => bundle_iter%get()
bracket_side = io_bundle%bracket_side
entry_num = io_bundle%entry_index
item => self%primary%item_vec%at(entry_num)
call MAPL_ExtDataVerticalInterpolate(self,item,bracket_side,current_time,_RC)
call bundle_iter%next()
enddo
call MAPL_ExtDataDestroyCFIO(IOBundles,_RC)

call MAPL_TimerOff(MAPLSTATE,"-Read_Loop")
Expand Down Expand Up @@ -873,21 +872,21 @@ subroutine MAPL_ExtDataInterpField(item,state,time,rc)
_RETURN(ESMF_SUCCESS)
end subroutine MAPL_ExtDataInterpField

!subroutine MAPL_ExtDataVerticalInterpolate(ExtState,item,filec,current_time,rc)
!type(MAPL_ExtData_State), intent(inout) :: ExtState
!type(PrimaryExport), intent(inout) :: item
!integer, intent(in ) :: filec
!type(ESMF_Time), intent(in ) :: current_time
!integer, optional, intent(out ) :: rc
subroutine MAPL_ExtDataVerticalInterpolate(ExtState,item,filec,current_time,rc)
type(MAPL_ExtData_State), intent(inout) :: ExtState
type(PrimaryExport), intent(inout) :: item
integer, intent(in ) :: filec
type(ESMF_Time), intent(in ) :: current_time
integer, optional, intent(out ) :: rc

!integer :: status
!integer :: id_ps
!type(ESMF_Field) :: field, newfield,psF
integer :: status
integer :: id_ps
type(ESMF_Field) :: field, newfield,psF

!if (item%do_VertInterp) then
!if (trim(item%importVDir)/=trim(item%fileVDir)) then
!call MAPL_ExtDataFlipVertical(item,filec,_RC)
!end if
if (item%do_VertInterp) then
if (trim(item%importVDir)/=trim(item%fileVDir)) then
call MAPL_ExtDataFlipVertical(item,filec,_RC)
end if
!if (item%vartype == MAPL_fieldItem) then
!call MAPL_ExtDataGetBracket(item,filec,newField,getRL=.true.,_RC)
!call MAPL_ExtDataGetBracket(item,filec,Field,_RC)
Expand All @@ -908,27 +907,27 @@ end subroutine MAPL_ExtDataInterpField

!end if

!else if (item%do_Fill) then
!if (item%vartype == MAPL_fieldItem) then
!call MAPL_ExtDataGetBracket(item,filec,newField,getRL=.true.,_RC)
!call MAPL_ExtDataGetBracket(item,filec,Field,_RC)
!call MAPL_ExtDataFillField(item,field,newfield,_RC)
!else if (item%vartype == MAPL_VectorField) then
!call MAPL_ExtDataGetBracket(item,filec,newField,getRL=.true.,vcomp=1,_RC)
!call MAPL_ExtDataGetBracket(item,filec,Field,vcomp=1,_RC)
!call MAPL_ExtDataFillField(item,field,newfield,_RC)
!call MAPL_ExtDataGetBracket(item,filec,newField,getRL=.true.,vcomp=2,_RC)
!call MAPL_ExtDataGetBracket(item,filec,Field,vcomp=2,_RC)
!call MAPL_ExtDataFillField(item,field,newfield,_RC)
!end if
!else
!if (trim(item%importVDir)/=trim(item%fileVDir)) then
!call MAPL_ExtDataFlipVertical(item,filec,_RC)
!end if
!end if
else if (item%do_Fill) then
if (item%vartype == MAPL_fieldItem) then
call MAPL_ExtDataGetBracket(item,filec,newField,getRL=.true.,_RC)
call MAPL_ExtDataGetBracket(item,filec,Field,_RC)
call MAPL_ExtDataFillField(item,field,newfield,_RC)
else if (item%vartype == MAPL_VectorField) then
call MAPL_ExtDataGetBracket(item,filec,newField,getRL=.true.,vcomp=1,_RC)
call MAPL_ExtDataGetBracket(item,filec,Field,vcomp=1,_RC)
call MAPL_ExtDataFillField(item,field,newfield,_RC)
call MAPL_ExtDataGetBracket(item,filec,newField,getRL=.true.,vcomp=2,_RC)
call MAPL_ExtDataGetBracket(item,filec,Field,vcomp=2,_RC)
call MAPL_ExtDataFillField(item,field,newfield,_RC)
end if
else
if (trim(item%importVDir)/=trim(item%fileVDir)) then
call MAPL_ExtDataFlipVertical(item,filec,_RC)
end if
end if

!_RETURN(ESMF_SUCCESS)
!end subroutine MAPL_ExtDataVerticalInterpolate
_RETURN(ESMF_SUCCESS)
end subroutine MAPL_ExtDataVerticalInterpolate

function MAPL_ExtDataGridChangeLev(Grid,CF,lm,rc) result(NewGrid)

Expand Down

0 comments on commit 7052154

Please sign in to comment.