Hello smasson,

Thank you so much for letting me know in detail.

I have used ORCA2_ICE_PISCES configuration.

As you advise, I set `ln_dynspg_exp`

to `.true.`

and `rn_rdt`

to `100`

.

An error occurred at the same time as before, I think it’s related iceberg issue…

I tested changing the iceberg restart file to another file, but the same error occurs at the same point.

```
At line 242 of file
/media/cmlws/Data1/hjc/NEMO/r4.0.6/cfgs/TEST5/BLD/ppsrc/nemo/icbdyn.f90
Fortran runtime error: Index '-2147483648' of dimension 1 of array 'mi1' below lower bound of 1
Error termination. Backtrace:
At line 242 of file /media/cmlws/Data1/hjc/NEMO/r4.0.6/cfgs/TEST5/BLD/ppsrc/nemo/icbdyn.f90
Fortran runtime error: Index '-2147483648' of dimension 1 of array 'mi1' below lower bound of 1
Error termination. Backtrace:
At line 242 of file /media/cmlws/Data1/hjc/NEMO/r4.0.6/cfgs/TEST5/BLD/ppsrc/nemo/icbdyn.f90
Fortran runtime error: Index '-2147483648' of dimension 1 of array 'mi1' below lower bound of 1
Error termination. Backtrace:
#0 0x153d6d12dd21 in ???
#1 0x153d6d12e869 in ???
#2 0x153d6d12eee6 in ???
#0 0x154af2237d21 in ???
#1 0x154af2238869 in ???
#2 0x154af2238ee6 in ???
#3 0x555ae6e8864c in icb_ground
at /media/cmlws/Data1/hjc/NEMO/r4.0.6/cfgs/TEST5/BLD/ppsrc/nemo/icbdyn.f90:242
#4 0x555ae6e88cc7 in __icbdyn_MOD_icb_dyn
at /media/cmlws/Data1/hjc/NEMO/r4.0.6/cfgs/TEST5/BLD/ppsrc/nemo/icbdyn.f90:115
#3 0x55fe02e2064c in icb_ground
at /media/cmlws/Data1/hjc/NEMO/r4.0.6/cfgs/TEST5/BLD/ppsrc/nemo/icbdyn.f90:242
#4 0x55fe02e20cc7 in __icbdyn_MOD_icb_dyn
at /media/cmlws/Data1/hjc/NEMO/r4.0.6/cfgs/TEST5/BLD/ppsrc/nemo/icbdyn.f90:115
#5 0x555ae64b8c5f in __icbstp_MOD_icb_stp
at /media/cmlws/Data1/hjc/NEMO/r4.0.6/cfgs/TEST5/BLD/ppsrc/nemo/icbstp.f90:148
#5 0x55fe02450c5f in __icbstp_MOD_icb_stp
at /media/cmlws/Data1/hjc/NEMO/r4.0.6/cfgs/TEST5/BLD/ppsrc/nemo/icbstp.f90:148
#0 0x149800982d21 in ???
#6 0x555ae5b09842 in __sbcmod_MOD_sbc
at /media/cmlws/Data1/hjc/NEMO/r4.0.6/cfgs/TEST5/BLD/ppsrc/nemo/sbcmod.f90:484
#6 0x55fe01aa1842 in __sbcmod_MOD_sbc
at /media/cmlws/Data1/hjc/NEMO/r4.0.6/cfgs/TEST5/BLD/ppsrc/nemo/sbcmod.f90:484
#7 0x55fe01b21c2c in __step_MOD_stp
at /media/cmlws/Data1/hjc/NEMO/r4.0.6/cfgs/TEST5/BLD/ppsrc/nemo/step.f90:138
```

##
icbdyn.f90

```
SUBROUTINE icb_ground( pi, pi0, pu, &
& pj, pj0, pv, ld_bounced )
!!----------------------------------------------------------------------
!! *** ROUTINE icb_ground ***
!!
!! ** Purpose : iceberg grounding.
!!
!! ** Method : - adjust velocity and then put iceberg back to start position
!! NB two possibilities available one of which is hard-coded here
!!----------------------------------------------------------------------
REAL(wp), INTENT(inout) :: pi , pj ! current iceberg position
REAL(wp), INTENT(in ) :: pi0, pj0 ! previous iceberg position
REAL(wp), INTENT(inout) :: pu , pv ! current iceberg velocities
LOGICAL , INTENT( out) :: ld_bounced ! bounced indicator
!
INTEGER :: ii, ii0
INTEGER :: ij, ij0
INTEGER :: ibounce_method
!!----------------------------------------------------------------------
!
ld_bounced = .FALSE.
!
ii0 = INT( pi0+0.5 ) ; ij0 = INT( pj0+0.5 ) ! initial gridpoint position (T-cell)
ii = INT( pi +0.5 ) ; ij = INT( pj +0.5 ) ! current - -
!
IF( ii == ii0 .AND. ij == ij0 ) RETURN ! berg remains in the same cell
!
! map into current processor
ii0 = mi1( ii0 )
ij0 = mj1( ij0 )
ii = mi1( ii ) !! <<<<<<<<<<<<<<<<<<<<<<< line 242
ij = mj1( ij )
!
IF( tmask(ii,ij,1) /= 0._wp ) RETURN ! berg reach a new t-cell, but an ocean one
!
! From here, berg have reach land: treat grounding/bouncing
! -------------------------------
ld_bounced = .TRUE.
```

I think the current iceberg position (`pi`

) has NaN value.

I found the part where `icb_ground`

was used in the code below, is it because of the time step (`zdt`

)?

##
icb_dyn

```
SUBROUTINE icb_dyn( kt )
!!----------------------------------------------------------------------
!! *** ROUTINE icb_dyn ***
!!
!! ** Purpose : iceberg evolution.
!!
!! ** Method : - See Martin & Adcroft, Ocean Modelling 34, 2010
!!----------------------------------------------------------------------
INTEGER, INTENT(in) :: kt !
!
LOGICAL :: ll_bounced
REAL(wp) :: zuvel1 , zvvel1 , zu1, zv1, zax1, zay1, zxi1 , zyj1
REAL(wp) :: zuvel2 , zvvel2 , zu2, zv2, zax2, zay2, zxi2 , zyj2
REAL(wp) :: zuvel3 , zvvel3 , zu3, zv3, zax3, zay3, zxi3 , zyj3
REAL(wp) :: zuvel4 , zvvel4 , zu4, zv4, zax4, zay4, zxi4 , zyj4
REAL(wp) :: zuvel_n, zvvel_n, zxi_n , zyj_n
REAL(wp) :: zdt, zdt_2, zdt_6, ze1, ze2
TYPE(iceberg), POINTER :: berg
TYPE(point) , POINTER :: pt
!!----------------------------------------------------------------------
!
! 4th order Runge-Kutta to solve: d/dt X = V, d/dt V = A
! with I.C.'s: X=X1 and V=V1
!
! ; A1=A(X1,V1)
! X2 = X1+dt/2*V1 ; V2 = V1+dt/2*A1 ; A2=A(X2,V2)
! X3 = X1+dt/2*V2 ; V3 = V1+dt/2*A2 ; A3=A(X3,V3)
! X4 = X1+ dt*V3 ; V4 = V1+ dt*A3 ; A4=A(X4,V4)
!
! Xn = X1+dt*(V1+2*V2+2*V3+V4)/6
! Vn = V1+dt*(A1+2*A2+2*A3+A4)/6
! time steps
zdt = berg_dt
zdt_2 = zdt * 0.5_wp
zdt_6 = zdt / 6._wp
berg => first_berg ! start from the first berg
!
DO WHILE ( ASSOCIATED(berg) ) !== loop over all bergs ==!
!
pt => berg%current_point
ll_bounced = .FALSE.
! STEP 1 !
! ====== !
zxi1 = pt%xi ; zuvel1 = pt%uvel !** X1 in (i,j) ; V1 in m/s
zyj1 = pt%yj ; zvvel1 = pt%vvel
! !** A1 = A(X1,V1)
CALL icb_accel( kt, berg , zxi1, ze1, zuvel1, zuvel1, zax1, &
& zyj1, ze2, zvvel1, zvvel1, zay1, zdt_2, 0.5_wp )
!
zu1 = zuvel1 / ze1 !** V1 in d(i,j)/dt
zv1 = zvvel1 / ze2
! STEP 2 !
! ====== !
! !** X2 = X1+dt/2*V1 ; V2 = V1+dt/2*A1
! position using di/dt & djdt ! V2 in m/s
zxi2 = zxi1 + zdt_2 * zu1 ; zuvel2 = zuvel1 + zdt_2 * zax1
zyj2 = zyj1 + zdt_2 * zv1 ; zvvel2 = zvvel1 + zdt_2 * zay1
!
CALL icb_ground( zxi2, zxi1, zu1, &
& zyj2, zyj1, zv1, ll_bounced )
! !** A2 = A(X2,V2)
CALL icb_accel( kt, berg , zxi2, ze1, zuvel2, zuvel1, zax2, &
& zyj2, ze2, zvvel2, zvvel1, zay2, zdt_2, 0.5_wp )
!
zu2 = zuvel2 / ze1 !** V2 in d(i,j)/dt
zv2 = zvvel2 / ze2
!
! STEP 3 !
! ====== !
! !** X3 = X1+dt/2*V2 ; V3 = V1+dt/2*A2; A3=A(X3)
zxi3 = zxi1 + zdt_2 * zu2 ; zuvel3 = zuvel1 + zdt_2 * zax2
zyj3 = zyj1 + zdt_2 * zv2 ; zvvel3 = zvvel1 + zdt_2 * zay2
!
CALL icb_ground( zxi3, zxi1, zu2, &
& zyj3, zyj1, zv2, ll_bounced )
```

Thank you

Hwa-Jin Choi