Skip to content

Commit

Permalink
remove unneeded variable causing segfaults
Browse files Browse the repository at this point in the history
  • Loading branch information
rem1776 authored and rem1776 committed Dec 19, 2024
1 parent 617c55a commit 762bff4
Showing 1 changed file with 2 additions and 9 deletions.
11 changes: 2 additions & 9 deletions time_interp/time_interp_external2.F90
Original file line number Diff line number Diff line change
Expand Up @@ -768,7 +768,6 @@ subroutine load_record(field, rec, interp, is_in, ie_in, js_in, je_in, window_id
real(r8_kind), allocatable :: mask_out(:,:,:)
real(r4_kind), allocatable :: hi_tmp_data(:,:,:,:) !< used to hold a copy of field%domain_data if using r4_kind
real(r4_kind), allocatable :: hi_tmp_msk_out(:,:,:) !< used return the field mask if using r4_kind
real(r4_kind), allocatable :: hi_tmp_src_data(:,:,:,:) !< used return the field mask if using r4_kind

window_id = 1
if( PRESENT(window_id_in) ) window_id = window_id_in
Expand Down Expand Up @@ -848,23 +847,17 @@ subroutine load_record(field, rec, interp, is_in, ie_in, js_in, je_in, window_id
LBOUND(field%domain_data,2):UBOUND(field%domain_data,2), &
LBOUND(field%domain_data,3):UBOUND(field%domain_data,3), &
LBOUND(field%domain_data,4):UBOUND(field%domain_data,4)))
allocate(hi_tmp_src_data(LBOUND(field%src_data,1):UBOUND(field%src_data,1), &
LBOUND(field%src_data,2):UBOUND(field%src_data,2), &
LBOUND(field%src_data,3):UBOUND(field%src_data,3), &
LBOUND(field%src_data,4):UBOUND(field%src_data,4)))
! assign if needed
! copy over to r4
hi_tmp_data = real(field%domain_data, r4_kind)
hi_tmp_src_data = real(field%src_data, r4_kind)
! do interpolation
call horiz_interp(interp, hi_tmp_src_data(:,:,:,ib), hi_tmp_data(isw:iew,jsw:jew,:,ib), &
call horiz_interp(interp, real(field%src_data(:,:,:,ib),r4_kind), hi_tmp_data(isw:iew,jsw:jew,:,ib), &
mask_in=real(mask_in,r4_kind), mask_out=hi_tmp_msk_out)
! assign any output
field%domain_data = real(hi_tmp_data, r8_kind)
field%mask(isw:iew,jsw:jew,:,ib) = hi_tmp_msk_out(isw:iew,jsw:jew,:) > 0.0_r4_kind

if(allocated(hi_tmp_data)) deallocate(hi_tmp_data)
if(allocated(hi_tmp_msk_out)) deallocate(hi_tmp_msk_out)
if(allocated(hi_tmp_src_data)) deallocate(hi_tmp_src_data)
else
allocate(mask_out(isw:iew,jsw:jew, size(field%src_data,3)))
call horiz_interp(interp, field%src_data(:,:,:,ib),field%domain_data(isw:iew,jsw:jew,:,ib), &
Expand Down

0 comments on commit 762bff4

Please sign in to comment.