Index: /NEMO/branches/2019/dev_r11842_SI3-10_EAP/cfgs/SHARED/field_def_nemo-ice.xml
===================================================================
--- /NEMO/branches/2019/dev_r11842_SI3-10_EAP/cfgs/SHARED/field_def_nemo-ice.xml	(revision 12260)
+++ /NEMO/branches/2019/dev_r11842_SI3-10_EAP/cfgs/SHARED/field_def_nemo-ice.xml	(revision 12261)
@@ -82,4 +82,7 @@
           <field id="iceshe"       long_name="Maximum shear of sea-ice velocity field"                 standard_name="maximum_shear_of_sea_ice_velocity"         unit="s-1"  />
           <field id="aniso"        long_name="anisotropy of sea ice floe orientation (0.5 - 1)"        standard_name="anisotropy"                                unit=""     />
+          <field id="yield11"      long_name="yield surface tensor component 11"                       standard_name="yield11"                                   unit="N/m"  />
+          <field id="yield22"      long_name="yield surface tensor component 22"                       standard_name="yield22"                                   unit="N/m"  />
+          <field id="yield12"      long_name="yield surface tensor component 12"                       standard_name="yield12"                                   unit="N/m"  />
 	  
 	  <!-- surface heat fluxes -->
@@ -416,8 +419,4 @@
           <field field_ref="vfxthin"          name="vfxthin" />
 	
-	  <!-- diag error for negative ice volume after advection -->
-	  <field field_ref="iceneg_pres"      name="sineg_pres" />
-	  <field field_ref="iceneg_volu"      name="sineg_volu" />
-	  <field field_ref="iceneg_hfx"       name="sineg_hfx"  />
         </field_group>
 
Index: /NEMO/branches/2019/dev_r11842_SI3-10_EAP/src/ICE/ice.F90
===================================================================
--- /NEMO/branches/2019/dev_r11842_SI3-10_EAP/src/ICE/ice.F90	(revision 12260)
+++ /NEMO/branches/2019/dev_r11842_SI3-10_EAP/src/ICE/ice.F90	(revision 12261)
@@ -146,4 +146,6 @@
    !
    !                                     !!** ice-rheology namelist (namdyn_rhg) **
+   LOGICAL , PUBLIC ::   ln_rhg_EVP       ! EVP rheology switch, used for rdgrft and rheology
+   LOGICAL , PUBLIC ::   ln_rhg_EAP       ! EAP rheology switch, used for rdgrft and rheology
    LOGICAL , PUBLIC ::   ln_aEVP          !: using adaptive EVP (T or F) 
    REAL(wp), PUBLIC ::   rn_creepl        !: creep limit : has to be under 1.0e-9
Index: /NEMO/branches/2019/dev_r11842_SI3-10_EAP/src/ICE/icedyn_rdgrft.F90
===================================================================
--- /NEMO/branches/2019/dev_r11842_SI3-10_EAP/src/ICE/icedyn_rdgrft.F90	(revision 12260)
+++ /NEMO/branches/2019/dev_r11842_SI3-10_EAP/src/ICE/icedyn_rdgrft.F90	(revision 12261)
@@ -23,4 +23,5 @@
    USE icevar         ! sea-ice: operations
    USE icectl         ! sea-ice: control prints
+   !USE icedyn_rhg     ! sea-ice: rheology choice
    !
    USE in_out_manager ! I/O manager
@@ -138,4 +139,5 @@
       INTEGER , DIMENSION(jpij) ::   iptidx        ! compute ridge/raft or not
       REAL(wp), DIMENSION(jpij) ::   zdivu, zdelt  ! 1D divu_i & delta_i
+      REAL(wp), DIMENSION(jpij) ::   conv          ! 1D rdg_conv (if EAP rheology)
       !
       INTEGER, PARAMETER ::   jp_itermax = 20    
@@ -174,5 +176,6 @@
         
          ! just needed here
-         CALL tab_2d_1d( npti, nptidx(1:npti), zdelt   (1:npti)      , delta_i )
+         CALL tab_2d_1d( npti, nptidx(1:npti), zdelt   (1:npti)      , delta_i  )
+         CALL tab_2d_1d( npti, nptidx(1:npti), conv    (1:npti)      , rdg_conv )
          ! needed here and in the iteration loop
          CALL tab_2d_1d( npti, nptidx(1:npti), zdivu   (1:npti)      , divu_i) ! zdivu is used as a work array here (no change in divu_i)
@@ -185,4 +188,6 @@
             !                                                        - ice area added in new ridges
             closing_net(ji) = rn_csrdg * 0.5_wp * ( zdelt(ji) - ABS( zdivu(ji) ) ) - MIN( zdivu(ji), 0._wp )
+            IF( ln_rhg_EVP )  closing_net(ji) = rn_csrdg * 0.5_wp * ( zdelt(ji) - ABS( zdivu(ji) ) ) - MIN( zdivu(ji), 0._wp )
+            IF( ln_rhg_EAP )  closing_net(ji) = conv(ji)
             !
             IF( zdivu(ji) < 0._wp )   closing_net(ji) = MAX( closing_net(ji), -zdivu(ji) )   ! make sure the closing rate is large enough
Index: /NEMO/branches/2019/dev_r11842_SI3-10_EAP/src/ICE/icedyn_rhg.F90
===================================================================
--- /NEMO/branches/2019/dev_r11842_SI3-10_EAP/src/ICE/icedyn_rhg.F90	(revision 12260)
+++ /NEMO/branches/2019/dev_r11842_SI3-10_EAP/src/ICE/icedyn_rhg.F90	(revision 12261)
@@ -37,6 +37,8 @@
 
    ! ** namelist (namrhg) **
-   LOGICAL ::   ln_rhg_EVP       ! EVP rheology
-   LOGICAL ::   ln_rhg_EAP       ! EVP rheology
+!   LOGICAL ::   ln_rhg_EVP       ! EVP rheology, used by icedyn_rdgrft
+!   LOGICAL ::   ln_rhg_EAP       ! EAP rheology, used by icedyn_rdgrft
+   !LOGICAL, PUBLIC ::   ln_rhg_EVP       ! EVP rheology, used by icedyn_rdgrft
+   !LOGICAL, PUBLIC ::   ln_rhg_EAP       ! EAP rheology, used by icedyn_rdgrft
    !
    !! * Substitutions
Index: /NEMO/branches/2019/dev_r11842_SI3-10_EAP/src/ICE/icedyn_rhg_eap.F90
===================================================================
--- /NEMO/branches/2019/dev_r11842_SI3-10_EAP/src/ICE/icedyn_rhg_eap.F90	(revision 12260)
+++ /NEMO/branches/2019/dev_r11842_SI3-10_EAP/src/ICE/icedyn_rhg_eap.F90	(revision 12261)
@@ -145,4 +145,5 @@
       !
       REAL(wp), DIMENSION(jpi,jpj) ::   stress12tmp                     ! anisotropic stress tensor component for regridding
+      REAL(wp), DIMENSION(jpi,jpj) ::   yield11, yield22, yield12       ! yield surface tensor for history
       REAL(wp), DIMENSION(jpi,jpj) ::   zp_delt                         ! P/delta at T points
       REAL(wp), DIMENSION(jpi,jpj) ::   zbeta                           ! beta coef from Kimmritz 2017
@@ -384,4 +385,6 @@
                   &   + zds(ji,jj-1) * e1e2f(ji,jj-1) + zds(ji-1,jj-1) * e1e2f(ji-1,jj-1)  &
                   &   ) * 0.25_wp * r1_e1e2t(ji,jj)
+               !WRITE(numout,*) 'shear output', ji, jj, zdsT
+               
 
                ! shear**2 at T points (doc eq. A16)
@@ -409,4 +412,7 @@
                                        alphar, alphas)
                IF (jter == nn_nevp) THEN
+                  yield11(ji,jj) = 0.5_wp * (stressptmp + stressmtmp)
+                  yield22(ji,jj) = 0.5_wp * (stressptmp - stressmtmp)
+                  yield12(ji,jj) = stress12tmp(ji,jj)
                   rdg_conv(ji,jj) = -min( alphar, 0._wp)    
                ENDIF
@@ -421,8 +427,8 @@
                !   gamma = 0.5*P/(delta+creepl) * (c*pi)**2/Area * dt/m
                !   alpha = beta = sqrt(4*gamma)
-               !IF( ln_aEVP ) THEN
-               !   zalph1   = MAX( 50._wp, rpi * SQRT( 0.5_wp * zp_delt(ji,jj) * r1_e1e2t(ji,jj) * zdt_m(ji,jj) ) )
-               !   z1_alph1 = 1._wp / ( zalph1 + 1._wp )
-               !ENDIF
+               IF( ln_aEVP ) THEN
+                  zalph1   = MAX( 50._wp, rpi * SQRT( 0.5_wp * zp_delt(ji,jj) * r1_e1e2t(ji,jj) * zdt_m(ji,jj) ) )
+                  z1_alph1 = 1._wp / ( zalph1 + 1._wp )
+               ENDIF
                
                ! stress at T points (zkt/=0 if landfast)
@@ -437,5 +443,5 @@
          END DO
          !CALL lbc_lnk( 'icedyn_rhg_eap', zp_delt, 'T', 1. )
-         CALL lbc_lnk( 'icedyn_rhg_eap', stress12tmp, 'T', 1. )
+         CALL lbc_lnk_multi( 'icedyn_rhg_eap', stress12tmp, 'T', 1., rdg_conv, 'T', 1. )
 
          DO jj = 1, jpjm1
@@ -447,8 +453,8 @@
 
                ! alpha & beta for aEVP
-               !IF( ln_aEVP ) THEN
-               !   zalph1   = MAX( 50._wp, rpi * SQRT( 0.5_wp * zp_delt(ji,jj) * r1_e1e2t(ji,jj) * zdt_m(ji,jj) ) )
-               !   z1_alph1 = 1._wp / ( zalph1 + 1._wp )
-               !ENDIF
+               IF( ln_aEVP ) THEN
+                  zalph1   = MAX( 50._wp, rpi * SQRT( 0.5_wp * zp_delt(ji,jj) * r1_e1e2t(ji,jj) * zdt_m(ji,jj) ) )
+                  z1_alph1 = 1._wp / ( zalph1 + 1._wp )
+               ENDIF
                
                ! stress at F points (zkt/=0 if landfast)
@@ -828,4 +834,11 @@
 
          DEALLOCATE( zsig1 , zsig2 , zsig3 )
+      ENDIF
+
+      ! --- yieldcurve --- !
+      IF( iom_use('yield11') .OR. iom_use('yield12') .OR. iom_use('yield22')) THEN
+         CALL iom_put( 'yield11', yield11 * zmsk00 )
+         CALL iom_put( 'yield22', yield22 * zmsk00 )
+         CALL iom_put( 'yield12', yield12 * zmsk00 )
       ENDIF
 
Index: /NEMO/branches/2019/dev_r11842_SI3-10_EAP/tests/ICE_ADV2D/EXPREF/file_def_nemo-ice.xml
===================================================================
--- /NEMO/branches/2019/dev_r11842_SI3-10_EAP/tests/ICE_ADV2D/EXPREF/file_def_nemo-ice.xml	(revision 12260)
+++ /NEMO/branches/2019/dev_r11842_SI3-10_EAP/tests/ICE_ADV2D/EXPREF/file_def_nemo-ice.xml	(revision 12261)
@@ -23,6 +23,4 @@
         <field field_ref="icethic"          name="sithic_max" operation="maximum" />
         <field field_ref="icethic"          name="sithic_min" operation="minimum" />
-        <field field_ref="iceneg_pres"      name="sineg_pres" />
-        <field field_ref="iceneg_volu"      name="sineg_volu" />
         <field field_ref="fasticepres"      name="fasticepres" />
         <field field_ref="icevolu"          name="sivolu" />
Index: /NEMO/branches/2019/dev_r11842_SI3-10_EAP/tests/ICE_ADV2D/EXPREF/namelist_ice_cfg
===================================================================
--- /NEMO/branches/2019/dev_r11842_SI3-10_EAP/tests/ICE_ADV2D/EXPREF/namelist_ice_cfg	(revision 12260)
+++ /NEMO/branches/2019/dev_r11842_SI3-10_EAP/tests/ICE_ADV2D/EXPREF/namelist_ice_cfg	(revision 12261)
@@ -50,6 +50,6 @@
 &namdyn_adv     !   Ice advection
 !------------------------------------------------------------------------------
-   ln_adv_Pra       = .false.         !  Advection scheme (Prather)
-   ln_adv_UMx       = .true.          !  Advection scheme (Ultimate-Macho)
+   ln_adv_Pra       = .true.         !  Advection scheme (Prather)
+   ln_adv_UMx       = .false.          !  Advection scheme (Ultimate-Macho)
       nn_UMx        =   5             !     order of the scheme for UMx (1-5 ; 20=centered 2nd order)
 /
Index: /NEMO/branches/2019/dev_r11842_SI3-10_EAP/tests/ICE_ADV2D/MY_SRC/usrdef_nam.F90
===================================================================
--- /NEMO/branches/2019/dev_r11842_SI3-10_EAP/tests/ICE_ADV2D/MY_SRC/usrdef_nam.F90	(revision 12260)
+++ /NEMO/branches/2019/dev_r11842_SI3-10_EAP/tests/ICE_ADV2D/MY_SRC/usrdef_nam.F90	(revision 12261)
@@ -14,5 +14,5 @@
    !!   usr_def_hgr   : initialize the horizontal mesh 
    !!----------------------------------------------------------------------
-   USE dom_oce  , ONLY: nimpp , njmpp            ! i- & j-indices of the local domain
+   USE dom_oce  , ONLY: nimpp , njmpp , Agrif_Root           ! i- & j-indices of the local domain
    USE par_oce        ! ocean space and time domain
    USE phycst         ! physical constants
