Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

solve icb related segfault #638

Merged
merged 1 commit into from
Oct 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions src/icb_step.F90
Original file line number Diff line number Diff line change
Expand Up @@ -464,7 +464,7 @@ subroutine iceberg_step1(ice, mesh, partit, dynamics, ib, height_ib_single,lengt
i_have_element=.false.
!if the first node belongs to this processor.. (just one processor enters here!)
!if( local_idx_of(iceberg_elem) > 0 .and. elem2D_nodes(1,local_idx_of(iceberg_elem)) <= myDim_nod2D ) then
if((local_idx_of(iceberg_elem)>0) .and. (local_idx_of(iceberg_elem)<=partit%myDim_elem2D+partit%eDim_elem2D) ) then
if((local_idx_of(iceberg_elem)>0) .and. (local_idx_of(iceberg_elem)<=partit%myDim_elem2D) ) then
if( elem2D_nodes(1,local_idx_of(iceberg_elem)) <= partit%myDim_nod2D ) then

i_have_element=.true.
Expand Down Expand Up @@ -804,14 +804,19 @@ subroutine iceberg_step2(mesh, partit,arr, elem_from_block, ib, height_ib_single
write(*,*) " * set iceberg ", ib, " back to elem ", old_element, " from elem ", iceberg_elem
write(*,*) " * area_ib = ", length_ib_single * width_ib_single, "; area_ib_tot = ", area_ib_tot, "; elem_area = ", elem_area_tmp
end if

left_mype = 0.0
lon_rad = old_lon
lat_rad = old_lat
lon_deg = lon_rad/rad
lat_deg = lat_rad/rad
iceberg_elem = old_element
u_ib = 0.
v_ib = 0.

i_have_element= (local_idx_of(iceberg_elem) .ne. 0)
if(i_have_element) then
i_have_element= mesh%elem2D_nodes(1,local_idx_of(iceberg_elem)) <= partit%myDim_nod2D !1 PE still .true.
end if
end if
else
if (mype==0) write(*,*) 'iceberg ',ib, ' changed PE or was very fast'
Expand Down
2 changes: 1 addition & 1 deletion src/io_meandata.F90
Original file line number Diff line number Diff line change
Expand Up @@ -1049,7 +1049,7 @@ subroutine ini_mean_io(ice, dynamics, tracers, partit, mesh)
call def_stream(nod2D, myDim_nod2D, 'ibfwbv', 'basal iceberg melting', 'm/s', ibfwbv(:), 1, 'm', i_real4, partit, mesh)
call def_stream(nod2D, myDim_nod2D, 'ibfwl', 'lateral iceberg melting', 'm/s', ibfwl(:), 1, 'm', i_real4, partit, mesh)
call def_stream(nod2D, myDim_nod2D, 'ibfwe', 'iceberg erosion', 'm/s', ibfwe(:), 1, 'm', i_real4, partit, mesh)
call def_stream((/nl,nod2D/), (/nl,myDim_nod2D/), 'ibhf', 'heat flux from iceberg melting', 'm/s', ibhf_n(:,:), 1, 'm', i_real4, partit, mesh)
call def_stream((/nl,nod2D/), (/nl,myDim_nod2D/), 'ibhf', 'heat flux from iceberg melting', 'W/m2', ibhf_n(:,:), 1, 'm', i_real4, partit, mesh)
end if
!------------------------------------------
!_______________________________________________________________________________
Expand Down
Loading