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

fixed heat budget #69

Merged
merged 1 commit into from
Apr 15, 2024
Merged
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
15 changes: 8 additions & 7 deletions src/icebergs.F90
Original file line number Diff line number Diff line change
Expand Up @@ -6156,6 +6156,7 @@ subroutine accumulate_calving(bergs)
! Local variables
type(icebergs_gridded), pointer :: grd
real :: remaining_dist_s, remaining_dist_n, net_calving_used
real, dimension(bergs%grd%isd:bergs%grd%ied,bergs%grd%jsd:bergs%grd%jed) :: remaining_dist
integer :: k, i, j
logical, save :: first_call=.true.
integer :: stderrunit
Expand Down Expand Up @@ -6203,20 +6204,20 @@ subroutine accumulate_calving(bergs)
call error_mesg('KID, accumulate_calving', 'calving is OVER distributed!', WARNING)
endif
where (grd%lat<0.)
grd%tmp=remaining_dist_s
remaining_dist=remaining_dist_s
elsewhere
grd%tmp=remaining_dist_n
remaining_dist=remaining_dist_n
end where
net_calving_used=sum( grd%calving(grd%isc:grd%iec,grd%jsc:grd%jec) *(1.-grd%tmp(grd%isc:grd%iec,grd%jsc:grd%jec)))
net_calving_used=sum( grd%calving(grd%isc:grd%iec,grd%jsc:grd%jec)*(1.-remaining_dist(grd%isc:grd%iec,grd%jsc:grd%jec)) )
bergs%net_calving_used=bergs%net_calving_used+net_calving_used*bergs%dt
! Remove the calving accounted for by accumulation
grd%calving(:,:)=grd%calving(:,:)*grd%tmp(:,:)
grd%calving(:,:)=grd%calving(:,:)*remaining_dist(:,:)

! Do the same for heat (no separate classes needed)
grd%calving_hflx(:,:)=grd%calving_hflx(:,:)*grd%tmp(:,:)
grd%tmp(:,:)=bergs%dt*grd%calving_hflx(:,:)*grd%area(:,:)*(1.-grd%tmp(:,:))
grd%tmp(:,:)=bergs%dt*grd%calving_hflx(:,:)*grd%area(:,:)*(1.-remaining_dist(:,:))
bergs%net_incoming_calving_heat_used=bergs%net_incoming_calving_heat_used+sum( grd%tmp(grd%isc:grd%iec,grd%jsc:grd%jec) )
grd%stored_heat(:,:)=grd%stored_heat(:,:)+grd%tmp(:,:) ! +=bergs%dt*grd%calving_hflx(:,:)*grd%area(:,:)*(1.-remaining_dist)
grd%stored_heat(:,:)=grd%stored_heat(:,:)+grd%tmp(:,:) ! +=bergs%dt*grd%calving_hflx(:,:)*grd%area(:,:)*(1.-remaining_dist(:,:))
grd%calving_hflx(:,:)=grd%calving_hflx(:,:)*remaining_dist(:,:)

end subroutine accumulate_calving

Expand Down
Loading