Index: branches/UKMO/dev_1d_bugfixes/NEMOGCM/NEMO/OPA_SRC/step.F90
===================================================================
--- branches/UKMO/dev_1d_bugfixes/NEMOGCM/NEMO/OPA_SRC/step.F90	(revision 12892)
+++ branches/UKMO/dev_1d_bugfixes/NEMOGCM/NEMO/OPA_SRC/step.F90	(revision 13088)
@@ -110,5 +110,5 @@
       IF( lk_tide    )   CALL sbc_tide( kstp )
       IF( lk_bdy     )  THEN
-         IF( ln_apr_dyn) CALL sbc_apr( kstp )   ! bdy_dta needs ssh_ib 
+         IF( ln_apr_dyn) CALL sbc_apr( kstp )   ! bdy_dta needs ssh_ib
                          CALL bdy_dta ( kstp, time_offset=+1 )   ! update dynamic & tracer data at open boundaries
       ENDIF
@@ -118,5 +118,5 @@
          CALL lbc_lnk( tsb(:,:,:,tind), 'T', 1. )
       END DO
-      
+
       IF( ln_stopack )   CALL stopack_pert( kstp )
                          CALL sbc    ( kstp )         ! Sea Boundary Condition (including sea-ice)
@@ -153,8 +153,14 @@
       ENDIF
       IF( ln_rnf_mouth ) THEN                         ! increase diffusivity at rivers mouths
+#if defined key_traldf_c2d || key_traldf_c3d
          IF ( ln_stopack .AND. ( nn_spp_arnf > 0 ) ) THEN
               rn_avt_rnf0 = rn_avt_rnf
               CALL spp_gen( kstp, rn_avt_rnf0,nn_spp_arnf,rn_arnf_sd,jk_spp_arnf )
          ENDIF
+#else
+         IF ( ln_stopack .AND. ( nn_spp_arnf > 0 ) ) &
+            & CALL ctl_stop( 'stp: parameter perturbation will only work with '// &
+                             'key_traldf_c2d or key_traldf_c3d')
+#endif
          DO jk = 2, nkrnf   ;   avt(:,:,jk) = avt(:,:,jk) + 2.e0 * rn_avt_rnf0(:,:) * rnfmsk(:,:) * tmask(:,:,jk)   ;   END DO
       ENDIF
@@ -204,8 +210,8 @@
       !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
                          CALL ssh_nxt       ( kstp )  ! after ssh (includes call to div_cur)
-      IF( lk_vvl     )   CALL dom_vvl_sf_nxt( kstp )  ! after vertical scale factors 
-                         CALL wzv           ( kstp )  ! now cross-level velocity 
-
-      IF( lk_dynspg_ts ) THEN 
+      IF( lk_vvl     )   CALL dom_vvl_sf_nxt( kstp )  ! after vertical scale factors
+                         CALL wzv           ( kstp )  ! now cross-level velocity
+
+      IF( lk_dynspg_ts ) THEN
           ! In case the time splitting case, update almost all momentum trends here:
           ! Note that the computation of vertical velocity above, hence "after" sea level
@@ -244,5 +250,5 @@
                                   CALL div_cur( kstp )         ! Horizontal divergence & Relative vorticity (2nd call in time-split case)
           IF( lk_vvl     )        CALL dom_vvl_sf_nxt( kstp, kcall=2 )  ! after vertical scale factors (update depth average component)
-                                  CALL wzv           ( kstp )  ! now cross-level velocity 
+                                  CALL wzv           ( kstp )  ! now cross-level velocity
       ENDIF
 
@@ -320,5 +326,5 @@
                &             CALL zps_hde    ( kstp, jpts, tsn, gtsu, gtsv,  &    ! Partial steps: before horizontal gradient
                &                                           rhd, gru , grv    )  ! of t, s, rd at the last ocean level
-         IF( ln_zps .AND.       ln_isfcav)                                   & 
+         IF( ln_zps .AND.       ln_isfcav)                                   &
                &             CALL zps_hde_isf( kstp, jpts, tsn, gtsu, gtsv,  &    ! Partial steps for top cell (ISF)
                &                                           rhd, gru , grv , aru , arv , gzu , gzv , ge3ru , ge3rv ,   &
@@ -334,5 +340,5 @@
                                 & CALL zps_hde    ( kstp, jpts, tsn, gtsu, gtsv,  &    ! Partial steps: before horizontal gradient
                                 &                   rhd, gru , grv    )  ! of t, s, rd at the last ocean level
-                                IF( ln_zps .AND.       ln_isfcav)                                   & 
+                                IF( ln_zps .AND.       ln_isfcav)                                   &
                                 & CALL zps_hde_isf( kstp, jpts, tsn, gtsu, gtsv,  &    ! Partial steps for top cell (ISF)
                                 &                   rhd, gru , grv , aru , arv , gzu , gzv , ge3ru , ge3rv ,   &
@@ -349,8 +355,8 @@
                                ua(:,:,:) = ua_sv(:,:,:)
                                va(:,:,:) = va_sv(:,:,:)
-                                                             ! Revert now divergence and rotational to previously computed ones 
+                                                             ! Revert now divergence and rotational to previously computed ones
                                                              !(needed because of the time swap in div_cur, at the beginning of each time step)
                                hdivn(:,:,:) = hdivb(:,:,:)
-                               rotn(:,:,:)  = rotb(:,:,:) 
+                               rotn(:,:,:)  = rotb(:,:,:)
 
                                CALL dyn_bfr( kstp )         ! bottom friction
@@ -398,6 +404,6 @@
       !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
       ! AGRIF
-      !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<      
-                               CALL Agrif_Integrate_ChildGrids( stp )  
+      !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
+                               CALL Agrif_Integrate_ChildGrids( stp )
 
       IF ( Agrif_NbStepint().EQ.0 ) THEN
@@ -431,12 +437,12 @@
       !
 #if defined key_iomput
-      IF( kstp == nitend .OR. indic < 0 ) THEN 
+      IF( kstp == nitend .OR. indic < 0 ) THEN
                       CALL iom_context_finalize(      cxios_context          ) ! needed for XIOS+AGRIF
-         IF( ln_crs ) CALL iom_context_finalize( trim(cxios_context)//"_crs" ) ! 
+         IF( ln_crs ) CALL iom_context_finalize( trim(cxios_context)//"_crs" ) !
       ENDIF
 #endif
       !
       IF( nn_timing == 1 .AND.  kstp == nit000  )   CALL timing_reset
-      !     
+      !
       !
    END SUBROUTINE stp
