I am experiencing a strange error regarding the number of bed layers in a stratified cohesive sediment application:
The error is traced back to:Subscript #3 of the array BED has value 31 which is greater than the upper bound of 30
where the first is the line where tau_cr is being updated:coawstG 0000000001B1CFCF sed_bed_cohesive_ 581 sed_bed_cohesive.f90
coawstG 0000000001AC5196 sed_bed_cohesive_ 66 sed_bed_cohesive.f90
Code: Select all
bed(i,j,Ksed,ibtcr) = bed(i,j,Ksed+1,ibtcr)- &
& cff2*(bed(i,j,Ksed+1,ibtcr)-bed(i,j,Ksed,ibtcr))
The setup has 30 bed layers so 31 are indeed not correct. The error only occurs with cohesive sediment.
This is my initial setup in ana_sediment:
Code: Select all
! Set bed layer properties.
!
DO k=1,Nbed
bed(i,j,k,iaged)=time(ng)
! Each layer is 1cm thick and has porosity of 0.66
bed(i,j,k,ithck)=0.001_r8
bed(i,j,k,iporo)=0.66_r8
DO ised=1,NST
bed_frac(i,j,k,ised)=1.0_r8/REAL(NST,r8)
END DO
END DO
Code: Select all
!------------------------------------------------------------------------------
! Cohesive / Mixed bed critcal shear
! Bed critical shear stress values if cohesive or mixed Bed is active
! These values are applied to the entire bed. [1:Ngrids] values expected
!------------------------------------------------------------------------------
! Minimum shear for erosion
MUD_TAUCR_MIN = 0.01
! Maximum shear for erosion
MUD_TAUCR_MAX = 1.0
! Tau_crit profile slope
MUD_TAUCR_SLOPE = 4.0
! Tau_crit profile offset
!MUD_TAUCR_OFFSET = 1.0
MUD_TAUCR_OFFSET = 12.0
! Tau_crit consolidation rate Tc
MUD_TAUCR_TIME = 8800 !16 hours
Thank you!
Cate