Skip to content

Commit

Permalink
excess ice distribution between tiles
Browse files Browse the repository at this point in the history
  • Loading branch information
mvdebolskiy committed Aug 5, 2022
1 parent 60c1e33 commit 0b97164
Showing 1 changed file with 22 additions and 6 deletions.
28 changes: 22 additions & 6 deletions src/cpl/share_esmf/ExcessIceStreamType.F90
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,9 @@ subroutine CalcExcessIce(this,bounds,exice_bulk_init)
use clm_varcon , only : tfrz
use ColumnType , only : col
use LandunitType , only : lun
use GridcellType , only : grc
use clm_varctl , only : use_excess_ice_tiles
use decompMod , only : bounds_type, get_global_index, subgrid_level_column
implicit none
class(excessicestream_type) :: this
type(bounds_type), intent(in) :: bounds
Expand All @@ -201,23 +204,36 @@ subroutine CalcExcessIce(this,bounds,exice_bulk_init)
! !LOCAL VARIABLES:
integer :: begc, endc
integer :: begg, endg
integer :: c, l, g !counters
integer :: c, l, l1, g !counters
integer :: gix, gix1 ! global index values

exice_bulk_init(bounds%begc:bounds%endc)=0.0_r8

do c = bounds%begc,bounds%endc
g = col%gridcell(c)
l = col%landunit(c)
if ((.not. lun%lakpoi(l)) .and. (.not. lun%urbpoi(l)) .and. (.not. lun%itype(l) == istwet) .and. (.not. lun%itype(l) == istice)) then !not lake
if (lun%itype(l) == istsoil .or. lun%itype(l) == istcrop) then
if (lun%itype(l) == istsoil .or. lun%itype(l) == istcrop) then
exice_bulk_init(c)=this%exice_bulk(g)
else
exice_bulk_init(c) = 0.0_r8
endif
else
exice_bulk_init(c)=0.0_r8
endif
enddo

if (use_excess_ice_tiles) then
do g = bounds%begg,bounds%endg
l = grc%landunit_indices(istsoil,g)
if (lun%ncolumns(l) == 2) then
c=lun%coli(l)
exice_bulk_init(c)=this%exice_bulk(g)*0.3_r8
c=lun%colf(l)
exice_bulk_init(c)=this%exice_bulk(g)*1.7_r8
!call endrun(msg=' CONDITION WORKS '//errMsg(sourcefile, __LINE__))
endif
enddo
endif




end subroutine CalcExcessIce

Expand Down

0 comments on commit 0b97164

Please sign in to comment.