Index: /branches/UKMO/dev_r5518_GO6_package_FOAMv14_STOPACK/NEMOGCM/CONFIG/SHARED/field_def.xml
===================================================================
--- /branches/UKMO/dev_r5518_GO6_package_FOAMv14_STOPACK/NEMOGCM/CONFIG/SHARED/field_def.xml	(revision 11403)
+++ /branches/UKMO/dev_r5518_GO6_package_FOAMv14_STOPACK/NEMOGCM/CONFIG/SHARED/field_def.xml	(revision 11404)
@@ -125,4 +125,48 @@
          <field id="Age"        long_name="Sea Water Age Since Surface contact" standard_name="sea_water_age_since_surface_contact"  unit="yr" grid_ref="grid_T_3D"   />
          <field id="Age_e3t"    long_name="Age * e3t"                                 unit="yr * m"  > Age * e3t </field >
+
+         <!-- variables available with ln_stopack set to .true. -->         
+         <field id="sppt_ran" long_name="Random field for SPPT" standard_name="sppt_random_field" unit="0-1"     />
+         <field id="skeb_ran" long_name="Random field for SKEB" standard_name="skeb_random_field" unit="0-1"     />
+         <field id="spp_ran" long_name="Random field for SPP" standard_name="spp_random_field" unit="0-1"     />
+         <field id="sppt_ar1" long_name="Perturbation field for SPPT" standard_name="sppt_perturb_field" unit="0-1" grid_ref="grid_T_3D"/>
+         <field id="spp_ar1" long_name="Perturbation field for SPP" standard_name="spp_perturb_field" unit="0-1" />
+         <field id="skeb_ar1" long_name="Perturbation field for SKEB" standard_name="skeb_perturb_field" unit="0-1" />
+
+         <!-- The following ones only when ln_stopack_diags is TRUE -->
+
+         <field id="spp_par01" long_name="Sample parameter SPP" standard_name="spp_pert_paramter" unit="0-1"     />
+         <field id="spp_par02" long_name="Sample parameter SPP" standard_name="spp_pert_paramter" unit="0-1"     />
+         <field id="spp_par03" long_name="Sample parameter SPP" standard_name="spp_pert_paramter" unit="0-1"     />
+         <field id="spp_par04" long_name="Sample parameter SPP" standard_name="spp_pert_paramter" unit="0-1"     />
+         <field id="spp_par05" long_name="Sample parameter SPP" standard_name="spp_pert_paramter" unit="0-1"     />
+         <field id="spp_par06" long_name="Sample parameter SPP" standard_name="spp_pert_paramter" unit="0-1"     />
+         <field id="spp_par07" long_name="Sample parameter SPP" standard_name="spp_pert_paramter" unit="0-1"     />
+         <field id="spp_par08" long_name="Sample parameter SPP" standard_name="spp_pert_paramter" unit="0-1"     />
+         <field id="spp_par09" long_name="Sample parameter SPP" standard_name="spp_pert_paramter" unit="0-1"     />
+         <field id="spp_par10" long_name="Sample parameter SPP" standard_name="spp_pert_paramter" unit="0-1"     />
+         <field id="spp_par11" long_name="Sample parameter SPP" standard_name="spp_pert_paramter" unit="0-1"     />
+         <field id="spp_par12" long_name="Sample parameter SPP" standard_name="spp_pert_paramter" unit="0-1"     />
+         <field id="spp_par13" long_name="Sample parameter SPP" standard_name="spp_pert_paramter" unit="0-1"     />
+         <field id="spp_par14" long_name="Sample parameter SPP" standard_name="spp_pert_paramter" unit="0-1"     />
+         <field id="spp_par15" long_name="Sample parameter SPP" standard_name="spp_pert_paramter" unit="0-1"     />
+         <field id="spp_par16" long_name="Sample parameter SPP" standard_name="spp_pert_paramter" unit="0-1"     />
+         <field id="spp_par17" long_name="Sample parameter SPP" standard_name="spp_pert_paramter" unit="0-1"     />
+         <field id="spp_par18" long_name="Sample parameter SPP" standard_name="spp_pert_paramter" unit="0-1"     />
+         <field id="spp_par19" long_name="Sample parameter SPP" standard_name="spp_pert_paramter" unit="0-1"     />
+         <field id="spp_par20" long_name="Sample parameter SPP" standard_name="spp_pert_paramter" unit="0-1"     />
+         <field id="spp_par21" long_name="Sample parameter SPP" standard_name="spp_pert_paramter" unit="0-1"     />
+         <field id="spp_par22" long_name="Sample parameter SPP" standard_name="spp_pert_paramter" unit="0-1"     />
+         <field id="spp_par23" long_name="Sample parameter SPP" standard_name="spp_pert_paramter" unit="0-1"     />
+         <field id="spp_par24" long_name="Sample parameter SPP" standard_name="spp_pert_paramter" unit="0-1"     />
+         <field id="spp_par25" long_name="Sample parameter SPP" standard_name="spp_pert_paramter" unit="0-1"     />
+         <field id="spp_par26" long_name="Sample parameter SPP" standard_name="spp_pert_paramter" unit="0-1"     />
+         <field id="spp_par27" long_name="Sample parameter SPP" standard_name="spp_pert_paramter" unit="0-1"     />
+         <field id="spp_par28" long_name="Sample parameter SPP" standard_name="spp_pert_paramter" unit="0-1"     />
+         <field id="spp_par29" long_name="Sample parameter SPP" standard_name="spp_pert_paramter" unit="0-1"     />
+
+         <field id="ustar_skeb" long_name="Sea Water X Velocity Perturbation" standard_name="sea_water_x_velocity" unit="m/s" grid_ref="grid_U_3D" />
+         <field id="vstar_skeb" long_name="Sea Water Y Velocity Perturbation" standard_name="sea_water_y_velocity" unit="m/s" grid_ref="grid_V_3D" />
+
       </field_group>
 
Index: /branches/UKMO/dev_r5518_GO6_package_FOAMv14_STOPACK/NEMOGCM/NEMO/OPA_SRC/DYN/dynldf.F90
===================================================================
--- /branches/UKMO/dev_r5518_GO6_package_FOAMv14_STOPACK/NEMOGCM/NEMO/OPA_SRC/DYN/dynldf.F90	(revision 11403)
+++ /branches/UKMO/dev_r5518_GO6_package_FOAMv14_STOPACK/NEMOGCM/NEMO/OPA_SRC/DYN/dynldf.F90	(revision 11404)
@@ -77,5 +77,6 @@
 
 #if defined key_dynldf_c3d
-         IF( kt .eq. nit000 .and. (nn_spp_ahm1+nn_spp_ahm2) .gt. 0 ) THEN
+         IF( kt == nit000 .AND. ln_stopack .AND. &
+            & ( (nn_spp_ahm1+nn_spp_ahm2) > 0 ) ) THEN
              ALLOCATE ( ahm10(jpi,jpj,jpk), ahm20(jpi,jpj,jpk) )
              ALLOCATE ( ahm30(jpi,jpj,jpk), ahm40(jpi,jpj,jpk) )
@@ -87,5 +88,6 @@
 #endif
 #if defined key_dynldf_c2d
-         IF( kt .eq. nit000 .and. (nn_spp_ahm1+nn_spp_ahm2) .gt. 0 ) THEN
+         IF( kt == nit000 .AND. ln_stopack .AND. &
+            & ( (nn_spp_ahm1+nn_spp_ahm2) > 0 ) ) THEN
              ALLOCATE ( ahm10(jpi,jpj), ahm20(jpi,jpj) )
              ALLOCATE ( ahm30(jpi,jpj), ahm40(jpi,jpj) )
@@ -98,23 +100,25 @@
 
 #if defined key_traldf_c3d || defined key_traldf_c2d
-         IF( nn_spp_ahm1 .GT. 0) THEN
-           IF( ln_dynldf_lap ) THEN
-             ahm1 = ahm10
-             CALL spp_ahm(kt,ahm1,nn_spp_ahm1,rn_ahm1_sd,jk_spp_ahm1)
-           ENDIF
-           IF( ln_dynldf_bilap ) THEN
-             ahm3 = ahm30
-             CALL spp_ahm(kt,ahm3,nn_spp_ahm1,rn_ahm1_sd,jk_spp_ahm3)
-           ENDIF
-         ENDIF
-         IF( nn_spp_ahm2 .GT. 0) THEN
-           IF( ln_dynldf_lap ) THEN
-             ahm2 = ahm20
-             CALL spp_ahm(kt,ahm2,nn_spp_ahm2,rn_ahm2_sd,jk_spp_ahm2)
-           ENDIF
-           IF( ln_dynldf_bilap ) THEN
-             ahm4 = ahm40
-             CALL spp_ahm(kt,ahm4,nn_spp_ahm2,rn_ahm2_sd,jk_spp_ahm4)
-           ENDIF
+         IF( ln_stopack ) THEN
+            IF( nn_spp_ahm1 > 0 ) THEN
+               IF( ln_dynldf_lap ) THEN
+                  ahm1 = ahm10
+                  CALL spp_ahm(kt,ahm1,nn_spp_ahm1,rn_ahm1_sd,jk_spp_ahm1)
+               ENDIF
+               IF( ln_dynldf_bilap ) THEN
+                  ahm3 = ahm30
+                  CALL spp_ahm(kt,ahm3,nn_spp_ahm1,rn_ahm1_sd,jk_spp_ahm3)
+               ENDIF
+            ENDIF
+            IF( nn_spp_ahm2 > 0 ) THEN
+               IF( ln_dynldf_lap ) THEN
+               ahm2 = ahm20
+               CALL spp_ahm(kt,ahm2,nn_spp_ahm2,rn_ahm2_sd,jk_spp_ahm2)
+               ENDIF
+               IF( ln_dynldf_bilap ) THEN
+                  ahm4 = ahm40
+                  CALL spp_ahm(kt,ahm4,nn_spp_ahm2,rn_ahm2_sd,jk_spp_ahm4)
+               ENDIF
+            ENDIF
          ENDIF
 #endif
Index: /branches/UKMO/dev_r5518_GO6_package_FOAMv14_STOPACK/NEMOGCM/NEMO/OPA_SRC/SBC/albedo.F90
===================================================================
--- /branches/UKMO/dev_r5518_GO6_package_FOAMv14_STOPACK/NEMOGCM/NEMO/OPA_SRC/SBC/albedo.F90	(revision 11403)
+++ /branches/UKMO/dev_r5518_GO6_package_FOAMv14_STOPACK/NEMOGCM/NEMO/OPA_SRC/SBC/albedo.F90	(revision 11404)
@@ -156,5 +156,6 @@
             END DO
             
-            IF ( nn_spp_icealb > 0 ) CALL spp_gen( 1, pa_ice_cs(:,:,jl), nn_spp_icealb, rn_icealb_sd, jk_spp_alb, jl )
+            IF ( ln_stopack .AND. nn_spp_icealb > 0 ) &
+               & CALL spp_gen( 1, pa_ice_cs(:,:,jl), nn_spp_icealb, rn_icealb_sd, jk_spp_alb, jl )
                         
          END DO
@@ -214,5 +215,6 @@
             END DO
             
-            IF ( nn_spp_icealb > 0 ) CALL spp_gen( 1, pa_ice_os(:,:,jl), nn_spp_icealb, rn_icealb_sd, jk_spp_alb, jl )
+            IF ( ln_stopack .AND. nn_spp_icealb > 0 ) &
+               & CALL spp_gen( 1, pa_ice_os(:,:,jl), nn_spp_icealb, rn_icealb_sd, jk_spp_alb, jl )
             
          END DO
Index: /branches/UKMO/dev_r5518_GO6_package_FOAMv14_STOPACK/NEMOGCM/NEMO/OPA_SRC/SBC/sbcblk_core.F90
===================================================================
--- /branches/UKMO/dev_r5518_GO6_package_FOAMv14_STOPACK/NEMOGCM/NEMO/OPA_SRC/SBC/sbcblk_core.F90	(revision 11403)
+++ /branches/UKMO/dev_r5518_GO6_package_FOAMv14_STOPACK/NEMOGCM/NEMO/OPA_SRC/SBC/sbcblk_core.F90	(revision 11404)
@@ -205,6 +205,6 @@
       ENDIF
 
-      IF( nn_spp_relw > 0 ) THEN
-         rn_vfac0 = rn_vfac
+      IF( ln_stopack .AND. nn_spp_relw > 0 ) THEN
+         rn_vfac0(:,:) = rn_vfac
          CALL spp_gen(kt, rn_vfac0, nn_spp_relw, rn_relw_sd, jk_spp_relw )
       ENDIF
@@ -661,5 +661,5 @@
       DO jl = 1, jpl
          qevap_ice(:,:,jl) = 0._wp ! should be -evap_ice(:,:,jl)*( ( Tice - rt0 ) * cpic * tmask(:,:,1) )
-                                   ! But we do not have Tice => consider it at 0°C => evap=0 
+                                   ! But we do not have Tice => consider it at 0 degC => evap=0 
       END DO
 
Index: /branches/UKMO/dev_r5518_GO6_package_FOAMv14_STOPACK/NEMOGCM/NEMO/OPA_SRC/SBC/sbcssr.F90
===================================================================
--- /branches/UKMO/dev_r5518_GO6_package_FOAMv14_STOPACK/NEMOGCM/NEMO/OPA_SRC/SBC/sbcssr.F90	(revision 11403)
+++ /branches/UKMO/dev_r5518_GO6_package_FOAMv14_STOPACK/NEMOGCM/NEMO/OPA_SRC/SBC/sbcssr.F90	(revision 11404)
@@ -99,7 +99,8 @@
 
                CALL wrk_alloc( jpi, jpj, rn_dqdt_s)
-               rn_dqdt_s=rn_dqdt
-
-               IF( nn_spp_dqdt > 0 ) CALL spp_gen(kt, rn_dqdt_s,nn_spp_dqdt,rn_dqdt_sd,jk_spp_dqdt )
+               rn_dqdt_s(:,:) = rn_dqdt
+
+               IF( ln_stopack .AND. nn_spp_dqdt > 0 ) &
+                  & CALL spp_gen(kt, rn_dqdt_s,nn_spp_dqdt,rn_dqdt_sd,jk_spp_dqdt )
                DO jj = 1, jpj
                   DO ji = 1, jpi
@@ -115,6 +116,7 @@
             IF( nn_sssr == 1 ) THEN                                   !* Salinity damping term (salt flux only (sfx))
                CALL wrk_alloc( jpi, jpj, zsrp)
-               zsrp = rn_deds
-               IF( nn_spp_dedt > 0 ) CALL spp_gen(kt, zsrp, nn_spp_dedt, rn_dedt_sd, jk_spp_deds )
+               zsrp(:,:) = rn_deds
+               IF( ln_stopack .AND. nn_spp_dedt > 0 ) &
+                  & CALL spp_gen(kt, zsrp, nn_spp_dedt, rn_dedt_sd, jk_spp_deds )
 !CDIR COLLAPSE
                DO jj = 1, jpj
@@ -131,6 +133,7 @@
             ELSEIF( nn_sssr == 2 ) THEN                               !* Salinity damping term (volume flux (emp) and associated heat flux (qns)
                CALL wrk_alloc( jpi, jpj, zsrp)
-               zsrp = rn_deds
-               IF( nn_spp_dedt > 0 ) CALL spp_gen(kt, zsrp, nn_spp_dedt, rn_dedt_sd, jk_spp_deds )
+               zsrp(:,:) = rn_deds
+               IF( ln_stopack .AND. nn_spp_dedt > 0 ) &
+                  & CALL spp_gen(kt, zsrp, nn_spp_dedt, rn_dedt_sd, jk_spp_deds )
                zerp_bnd = rn_sssr_bnd / rday                          !       -              -    
 !CDIR COLLAPSE
Index: /branches/UKMO/dev_r5518_GO6_package_FOAMv14_STOPACK/NEMOGCM/NEMO/OPA_SRC/STO/stopack.F90
===================================================================
--- /branches/UKMO/dev_r5518_GO6_package_FOAMv14_STOPACK/NEMOGCM/NEMO/OPA_SRC/STO/stopack.F90	(revision 11403)
+++ /branches/UKMO/dev_r5518_GO6_package_FOAMv14_STOPACK/NEMOGCM/NEMO/OPA_SRC/STO/stopack.F90	(revision 11404)
@@ -2247,5 +2247,5 @@
           CALL lbc_lnk(dpsiu,'T',1._wp)
 #ifdef key_iomput
-          CALL iom_put( "bsft" , dpsiu )
+          !CALL iom_put( "bsft" , dpsiu )
 #endif
       ENDIF
@@ -2253,5 +2253,5 @@
           CALL lbc_lnk(dpsiv,'T',1._wp)
 #ifdef key_iomput
-          CALL iom_put( "bsftv" , dpsiv )
+          !CALL iom_put( "bsftv" , dpsiv )
 #endif
       ENDIF
Index: /branches/UKMO/dev_r5518_GO6_package_FOAMv14_STOPACK/NEMOGCM/NEMO/OPA_SRC/TRA/trabbc.F90
===================================================================
--- /branches/UKMO/dev_r5518_GO6_package_FOAMv14_STOPACK/NEMOGCM/NEMO/OPA_SRC/TRA/trabbc.F90	(revision 11403)
+++ /branches/UKMO/dev_r5518_GO6_package_FOAMv14_STOPACK/NEMOGCM/NEMO/OPA_SRC/TRA/trabbc.F90	(revision 11404)
@@ -92,7 +92,7 @@
       !                             !  Add the geothermal heat flux trend on temperature
 
-      IF( nn_spp_geot .GT. 0) THEN
-          qgh_trd1 = qgh_trd0
-          CALL spp_gen(kt, qgh_trd0, nn_spp_geot, rn_geot_sd, jk_spp_geot)
+      IF( ln_stopack .AND. nn_spp_geot > 0) THEN
+          qgh_trd1(:,:) = qgh_trd0(:,:)
+          CALL spp_gen(kt, qgh_trd1, nn_spp_geot, rn_geot_sd, jk_spp_geot)
       ENDIF
       DO jj = 2, jpjm1
@@ -200,5 +200,5 @@
             !
          END SELECT
-         qgh_trd1 = qgh_trd0
+         qgh_trd1(:,:) = qgh_trd0(:,:)
          !
       ELSE
Index: /branches/UKMO/dev_r5518_GO6_package_FOAMv14_STOPACK/NEMOGCM/NEMO/OPA_SRC/TRA/trabbl.F90
===================================================================
--- /branches/UKMO/dev_r5518_GO6_package_FOAMv14_STOPACK/NEMOGCM/NEMO/OPA_SRC/TRA/trabbl.F90	(revision 11403)
+++ /branches/UKMO/dev_r5518_GO6_package_FOAMv14_STOPACK/NEMOGCM/NEMO/OPA_SRC/TRA/trabbl.F90	(revision 11404)
@@ -198,10 +198,10 @@
       ALLOCATE(zptb(1:jpi, 1:jpj))
       !
-      ahu_bbl_1 = ahu_bbl
-      IF( nn_spp_ahubbl .GT. 0 ) THEN
+      ahu_bbl_1(:,:) = ahu_bbl(:,:)
+      IF( ln_stopack .AND. nn_spp_ahubbl > 0 ) THEN
           CALL spp_gen(1 , ahu_bbl_1, nn_spp_ahubbl, rn_ahubbl_sd, jk_spp_ahubbl )
       ENDIF
-      ahv_bbl_1 = ahv_bbl
-      IF( nn_spp_ahvbbl .GT. 0 ) THEN
+      ahv_bbl_1(:,:) = ahv_bbl(:,:)
+      IF( ln_stopack .AND. nn_spp_ahvbbl > 0 ) THEN
           CALL spp_gen(1 , ahv_bbl_1, nn_spp_ahvbbl, rn_ahvbbl_sd, jk_spp_ahvbbl )
       ENDIF
Index: /branches/UKMO/dev_r5518_GO6_package_FOAMv14_STOPACK/NEMOGCM/NEMO/OPA_SRC/TRA/traldf.F90
===================================================================
--- /branches/UKMO/dev_r5518_GO6_package_FOAMv14_STOPACK/NEMOGCM/NEMO/OPA_SRC/TRA/traldf.F90	(revision 11403)
+++ /branches/UKMO/dev_r5518_GO6_package_FOAMv14_STOPACK/NEMOGCM/NEMO/OPA_SRC/TRA/traldf.F90	(revision 11404)
@@ -84,5 +84,7 @@
 
 #if defined key_traldf_c3d
-         IF( kt .eq. nit000 .and. (nn_spp_ahtu+nn_spp_ahtv+nn_spp_ahtw+nn_spp_ahtt) .gt. 0 ) THEN
+         IF( ( kt == nit000 ) .AND. &
+            & ln_stopack .AND. &
+            & (nn_spp_ahtu+nn_spp_ahtv+nn_spp_ahtw+nn_spp_ahtt) > 0 ) THEN
              ALLOCATE ( ahtu0(jpi,jpj,jpk), ahtv0(jpi,jpj,jpk) )
              ALLOCATE ( ahtt0(jpi,jpj,jpk), ahtw0(jpi,jpj,jpk) )
@@ -94,5 +96,7 @@
 #endif
 #if defined key_traldf_c2d
-         IF( kt .eq. nit000 .and. (nn_spp_ahtu+nn_spp_ahtv+nn_spp_ahtw+nn_spp_ahtt) .gt. 0 ) THEN
+         IF( ( kt == nit000 ) .AND. &
+            & ln_stopack .AND. &
+            & (nn_spp_ahtu+nn_spp_ahtv+nn_spp_ahtw+nn_spp_ahtt) > 0 ) THEN
              ALLOCATE ( ahtu0(jpi,jpj), ahtv0(jpi,jpj) )
              ALLOCATE ( ahtt0(jpi,jpj), ahtw0(jpi,jpj) )
@@ -104,17 +108,17 @@
 #endif
 #if defined key_traldf_c3d || defined key_traldf_c2d
-         IF( nn_spp_ahtu .GT. 0) THEN
+         IF( ln_stopack .AND. ( nn_spp_ahtu > 0 ) ) THEN
              ahtu = ahtu0
              CALL spp_aht(kt,ahtu,nn_spp_ahtu,rn_ahtu_sd,jk_spp_ahtu)
          ENDIF
-         IF( nn_spp_ahtv .GT. 0) THEN
+         IF( ln_stopack .AND. ( nn_spp_ahtv > 0 ) ) THEN
              ahtv = ahtv0
              CALL spp_aht(kt,ahtv,nn_spp_ahtv,rn_ahtv_sd,jk_spp_ahtv)
          ENDIF
-         IF( nn_spp_ahtw .GT. 0) THEN
+         IF( ln_stopack .AND. ( nn_spp_ahtw > 0 ) ) THEN
              ahtw = ahtw0
              CALL spp_aht(kt,ahtw,nn_spp_ahtw,rn_ahtw_sd,jk_spp_ahtw)
          ENDIF
-         IF( nn_spp_ahtt .GT. 0) THEN
+         IF( ln_stopack .AND. ( nn_spp_ahtt > 0 ) ) THEN
              ahtt = ahtt0
              CALL spp_aht(kt,ahtt,nn_spp_ahtt,rn_ahtt_sd,jk_spp_ahtt)
Index: /branches/UKMO/dev_r5518_GO6_package_FOAMv14_STOPACK/NEMOGCM/NEMO/OPA_SRC/TRA/traqsr.F90
===================================================================
--- /branches/UKMO/dev_r5518_GO6_package_FOAMv14_STOPACK/NEMOGCM/NEMO/OPA_SRC/TRA/traqsr.F90	(revision 11403)
+++ /branches/UKMO/dev_r5518_GO6_package_FOAMv14_STOPACK/NEMOGCM/NEMO/OPA_SRC/TRA/traqsr.F90	(revision 11404)
@@ -184,5 +184,5 @@
          !
          ! 
-         IF( nn_spp_qsi0 > 0 ) THEN
+         IF( ln_stopack .AND. ( nn_spp_qsi0 > 0 ) ) THEN
              xsi0r = rn_si0
              CALL spp_gen(kt, xsi0r, nn_spp_qsi0, rn_qsi0_sd, jk_spp_qsi0 )
@@ -317,5 +317,5 @@
             !                                             ! ------------------------- !
             !
-            IF( lk_vvl .OR. nn_spp_qsi0 > 0 ) THEN        !* variable volume
+            IF( lk_vvl .OR. ( ln_stopack .AND. ( nn_spp_qsi0 > 0 ) ) ) THEN        !* variable volume
 
                zz0   =        rn_abs   * r1_rau0_rcp
Index: /branches/UKMO/dev_r5518_GO6_package_FOAMv14_STOPACK/NEMOGCM/NEMO/OPA_SRC/TRD/trddyn.F90
===================================================================
--- /branches/UKMO/dev_r5518_GO6_package_FOAMv14_STOPACK/NEMOGCM/NEMO/OPA_SRC/TRD/trddyn.F90	(revision 11403)
+++ /branches/UKMO/dev_r5518_GO6_package_FOAMv14_STOPACK/NEMOGCM/NEMO/OPA_SRC/TRD/trddyn.F90	(revision 11404)
@@ -69,5 +69,6 @@
       !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
       IF( ln_dyn_trd )   CALL trd_dyn_iom( putrd, pvtrd, ktrd, kt )
-      IF( ln_dyn_trd .AND. ln_sppt_dyn ) CALL dyn_sppt_collect( putrd, pvtrd, ktrd, kt )
+      IF( ln_dyn_trd .AND. ln_stopack .AND. ln_sppt_dyn ) &
+         & CALL dyn_sppt_collect( putrd, pvtrd, ktrd, kt )
          
       !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
Index: /branches/UKMO/dev_r5518_GO6_package_FOAMv14_STOPACK/NEMOGCM/NEMO/OPA_SRC/TRD/trdtra.F90
===================================================================
--- /branches/UKMO/dev_r5518_GO6_package_FOAMv14_STOPACK/NEMOGCM/NEMO/OPA_SRC/TRD/trdtra.F90	(revision 11403)
+++ /branches/UKMO/dev_r5518_GO6_package_FOAMv14_STOPACK/NEMOGCM/NEMO/OPA_SRC/TRD/trdtra.F90	(revision 11404)
@@ -250,5 +250,6 @@
       !                   ! 3D output of tracers trends using IOM interface
       IF( ln_tra_trd )   CALL trd_tra_iom ( ptrdx, ptrdy, ktrd, kt )
-      IF( ln_tra_trd .AND. ln_sppt_tra )  CALL tra_sppt_collect( ptrdx, ptrdy, ktrd, kt )
+      IF( ln_tra_trd .AND. ln_stopack .AND. ln_sppt_tra )  &
+         & CALL tra_sppt_collect( ptrdx, ptrdy, ktrd, kt )
 
       !  Integral Constraints Properties for tracers trends                                       !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
Index: /branches/UKMO/dev_r5518_GO6_package_FOAMv14_STOPACK/NEMOGCM/NEMO/OPA_SRC/ZDF/zdfbfr.F90
===================================================================
--- /branches/UKMO/dev_r5518_GO6_package_FOAMv14_STOPACK/NEMOGCM/NEMO/OPA_SRC/ZDF/zdfbfr.F90	(revision 11403)
+++ /branches/UKMO/dev_r5518_GO6_package_FOAMv14_STOPACK/NEMOGCM/NEMO/OPA_SRC/ZDF/zdfbfr.F90	(revision 11404)
@@ -108,5 +108,5 @@
       ENDIF
       ! 
-      IF( nn_spp_bfr > 0 ) THEN
+      IF( ln_stopack .AND. ( nn_spp_bfr > 0 ) ) THEN
          bfrcoef2d = bfrcoef2d0
          CALL spp_gen(kt, bfrcoef2d, nn_spp_bfr, rn_bfr_sd, jk_spp_bfr)
Index: /branches/UKMO/dev_r5518_GO6_package_FOAMv14_STOPACK/NEMOGCM/NEMO/OPA_SRC/ZDF/zdfevd.F90
===================================================================
--- /branches/UKMO/dev_r5518_GO6_package_FOAMv14_STOPACK/NEMOGCM/NEMO/OPA_SRC/ZDF/zdfevd.F90	(revision 11403)
+++ /branches/UKMO/dev_r5518_GO6_package_FOAMv14_STOPACK/NEMOGCM/NEMO/OPA_SRC/ZDF/zdfevd.F90	(revision 11404)
@@ -77,5 +77,5 @@
       zavt_evd(:,:,:) = avt(:,:,:)           ! set avt prior to evd application
 
-      IF(nn_spp_aevd.GT.0) THEN
+      IF( ln_stopack .AND. ( nn_spp_aevd > 0 ) ) THEN
          rn_avevd0(:,:) = rn_avevd
          CALL spp_gen(kt, rn_avevd0, nn_spp_aevd, rn_aevd_sd, jk_spp_aevd)
Index: /branches/UKMO/dev_r5518_GO6_package_FOAMv14_STOPACK/NEMOGCM/NEMO/OPA_SRC/ZDF/zdfgls.F90
===================================================================
--- /branches/UKMO/dev_r5518_GO6_package_FOAMv14_STOPACK/NEMOGCM/NEMO/OPA_SRC/ZDF/zdfgls.F90	(revision 11403)
+++ /branches/UKMO/dev_r5518_GO6_package_FOAMv14_STOPACK/NEMOGCM/NEMO/OPA_SRC/ZDF/zdfgls.F90	(revision 11404)
@@ -807,6 +807,8 @@
             END DO
          END DO
-         IF(nn_spp_avt > 0 ) CALL spp_gen(kt,avt(:,:,jk),nn_spp_avt,rn_avt_sd,jk)
-         IF(nn_spp_avm > 0 ) CALL spp_gen(kt,avm(:,:,jk),nn_spp_avm,rn_avm_sd,jk)
+         IF( ln_stopack) THEN
+            IF( nn_spp_avt > 0 ) CALL spp_gen(kt,avt(:,:,jk),nn_spp_avt,rn_avt_sd,jk)
+            IF( nn_spp_avm > 0 ) CALL spp_gen(kt,avm(:,:,jk),nn_spp_avm,rn_avm_sd,jk)
+         ENDIF 
       END DO
       !
Index: /branches/UKMO/dev_r5518_GO6_package_FOAMv14_STOPACK/NEMOGCM/NEMO/OPA_SRC/ZDF/zdftke.F90
===================================================================
--- /branches/UKMO/dev_r5518_GO6_package_FOAMv14_STOPACK/NEMOGCM/NEMO/OPA_SRC/ZDF/zdftke.F90	(revision 11403)
+++ /branches/UKMO/dev_r5518_GO6_package_FOAMv14_STOPACK/NEMOGCM/NEMO/OPA_SRC/ZDF/zdftke.F90	(revision 11404)
@@ -186,23 +186,25 @@
       ENDIF
       !
-      IF( nn_spp_tkelc > 0 ) THEN
-          rn_lc0 = rn_lc
-          CALL spp_gen(kt,rn_lc0,nn_spp_tkelc,rn_tkelc_sd,    jk_spp_tkelc )
-      ENDIF
-      IF( nn_spp_tkedf > 0 ) THEN
-          rn_ediff0 = rn_ediff
-          CALL spp_gen(kt,rn_ediff0,nn_spp_tkedf,rn_tkedf_sd, jk_spp_tkedf )
-      ENDIF
-      IF( nn_spp_tkeds > 0 ) THEN
-          rn_ediss0 = rn_ediss
-          CALL spp_gen(kt,rn_ediss0,nn_spp_tkeds,rn_tkeds_sd, jk_spp_tkeds )
-      ENDIF
-      IF( nn_spp_tkebb > 0 ) THEN
-          rn_ebb0 = rn_ebb
-          CALL spp_gen(kt,rn_ebb0,nn_spp_tkebb,rn_tkebb_sd,   jk_spp_tkebb )
-      ENDIF
-      IF( nn_spp_tkefr > 0 ) THEN
-          rn_efr0 = rn_efr
-          CALL spp_gen(kt,rn_efr0,nn_spp_tkefr,rn_tkefr_sd,   jk_spp_tkefr )
+      IF( ln_stopack) THEN
+         IF( nn_spp_tkelc > 0 ) THEN
+             rn_lc0 = rn_lc
+             CALL spp_gen(kt,rn_lc0,nn_spp_tkelc,rn_tkelc_sd,    jk_spp_tkelc )
+         ENDIF
+         IF( nn_spp_tkedf > 0 ) THEN
+             rn_ediff0 = rn_ediff
+             CALL spp_gen(kt,rn_ediff0,nn_spp_tkedf,rn_tkedf_sd, jk_spp_tkedf )
+         ENDIF
+         IF( nn_spp_tkeds > 0 ) THEN
+             rn_ediss0 = rn_ediss
+             CALL spp_gen(kt,rn_ediss0,nn_spp_tkeds,rn_tkeds_sd, jk_spp_tkeds )
+         ENDIF
+         IF( nn_spp_tkebb > 0 ) THEN
+             rn_ebb0 = rn_ebb
+             CALL spp_gen(kt,rn_ebb0,nn_spp_tkebb,rn_tkebb_sd,   jk_spp_tkebb )
+        ENDIF
+         IF( nn_spp_tkefr > 0 ) THEN
+             rn_efr0 = rn_efr
+             CALL spp_gen(kt,rn_efr0,nn_spp_tkefr,rn_tkefr_sd,   jk_spp_tkefr )
+         ENDIF
       ENDIF
       !
@@ -736,6 +738,8 @@
             END DO
          END DO
-         IF(nn_spp_avt > 0 ) CALL spp_gen(1 ,avt(:,:,jk),nn_spp_avt,rn_avt_sd, jk_spp_avt, jk)
-         IF(nn_spp_avm > 0 ) CALL spp_gen(1 ,avm(:,:,jk),nn_spp_avm,rn_avm_sd, jk_spp_avm, jk)
+         IF( ln_stopack) THEN
+            IF(nn_spp_avt > 0 ) CALL spp_gen(1 ,avt(:,:,jk),nn_spp_avt,rn_avt_sd, jk_spp_avt, jk)
+            IF(nn_spp_avm > 0 ) CALL spp_gen(1 ,avm(:,:,jk),nn_spp_avm,rn_avm_sd, jk_spp_avm, jk)
+         ENDIF
       END DO
       CALL lbc_lnk( avm, 'W', 1. )      ! Lateral boundary conditions (sign unchanged)
Index: /branches/UKMO/dev_r5518_GO6_package_FOAMv14_STOPACK/NEMOGCM/NEMO/OPA_SRC/step.F90
===================================================================
--- /branches/UKMO/dev_r5518_GO6_package_FOAMv14_STOPACK/NEMOGCM/NEMO/OPA_SRC/step.F90	(revision 11403)
+++ /branches/UKMO/dev_r5518_GO6_package_FOAMv14_STOPACK/NEMOGCM/NEMO/OPA_SRC/step.F90	(revision 11404)
@@ -127,7 +127,7 @@
       !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
 
-      IF( ln_sto_eos )   CALL sto_par( kstp )          ! Stochastic parameters
-      IF( ln_sto_eos )   CALL sto_pts( tsn  )          ! Random T/S fluctuations
-      IF( ln_skeb  )     CALL skeb_comp( kstp )
+      IF( ln_sto_eos )                 CALL sto_par( kstp )   ! Stochastic parameters
+      IF( ln_sto_eos )                 CALL sto_pts( tsn  )   ! Random T/S fluctuations
+      IF( ln_stopack .AND. ln_skeb  )  CALL skeb_comp( kstp ) ! Stochastic Energy Backscatter
 
       !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
@@ -153,5 +153,5 @@
       ENDIF
       IF( ln_rnf_mouth ) THEN                         ! increase diffusivity at rivers mouths
-         IF ( nn_spp_arnf .GT. 0 ) THEN
+         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 )
@@ -226,5 +226,6 @@
           IF(  lk_asminc .AND. ln_asmiau .AND. &
              & ln_dyninc       )  CALL dyn_asm_inc   ( kstp )   ! apply dynamics assimilation increment
-          IF( ln_sppt_dyn )       CALL dyn_sppt_apply( kstp, 0 )
+          IF( ln_stopack .AND. ln_sppt_dyn ) &
+             &                    CALL dyn_sppt_apply( kstp, 0 )
           IF( ln_neptsimp )       CALL dyn_nept_cor  ( kstp )   ! subtract Neptune velocities (simplified)
           IF( lk_bdy           )  CALL bdy_dyn3d_dmp ( kstp )   ! bdy damping trends
@@ -274,5 +275,6 @@
                              tsa(:,:,:,:) = 0.e0            ! set tracer trends to zero
 
-      IF( ln_sppt_tra )      CALL tra_sppt_apply ( kstp, 0 )
+      IF( ln_stopack .AND. ln_sppt_tra ) &
+         &                   CALL tra_sppt_apply ( kstp, 0 )
       IF( lk_asminc .AND. ln_asmiau .AND. &
         & ln_trainc      )   CALL tra_asm_inc( kstp )       ! apply tracer assimilation increment
@@ -293,5 +295,6 @@
       IF(.NOT. Agrif_Root()) CALL Agrif_Sponge_tra          ! tracers sponge
 #endif
-      IF( ln_sppt_tra )      CALL tra_sppt_apply ( kstp, 1 )
+      IF( ln_stopack .AND. ln_sppt_tra ) &
+         &                   CALL tra_sppt_apply ( kstp, 1 )
                              CALL tra_zdf    ( kstp )       ! vertical mixing and after tracer fields
 
@@ -299,5 +302,6 @@
          IF( ln_zdfnpc   )   CALL tra_npc( kstp )                ! update after fields by non-penetrative convection
                              CALL tra_nxt( kstp )                ! tracer fields at next time step
-         IF( ln_sppt_tra )   CALL tra_sppt_apply ( kstp, 2 )
+         IF( ln_stopack .AND. ln_sppt_tra ) &
+            &                CALL tra_sppt_apply ( kstp, 2 )
                              CALL eos    ( tsa, rhd, rhop, fsdept_n(:,:,:) )  ! Time-filtered in situ density for hpg computation
             IF( ln_zps .AND. .NOT. ln_isfcav)                                &
@@ -323,5 +327,5 @@
                              CALL tra_nxt( kstp )                ! tracer fields at next time step
          IF( ln_bias )       CALL dyn_bias( kstp )
-         IF( ln_sppt_tra )   THEN
+         IF( ln_stopack .AND. ln_sppt_tra )   THEN
                                 CALL tra_sppt_apply ( kstp, 2 )
                                 CALL eos    ( tsn, rhd, rhop, fsdept_n(:,:,:) )  ! now in situ density for hpg computation
@@ -350,5 +354,6 @@
 
                                CALL dyn_bfr( kstp )         ! bottom friction
-            IF( ln_sppt_dyn )  CALL dyn_sppt_apply ( kstp, 1 )
+            IF( ln_stopack .AND. ln_sppt_dyn ) &
+               &               CALL dyn_sppt_apply ( kstp, 1 )
                                CALL dyn_zdf( kstp )         ! vertical diffusion
       ELSE
@@ -358,5 +363,6 @@
         IF(  lk_asminc .AND. ln_asmiau .AND. &
            & ln_dyninc      )  CALL dyn_asm_inc( kstp )     ! apply dynamics assimilation increment
-        IF( ln_sppt_dyn )      CALL dyn_sppt_apply ( kstp, 0 )
+        IF( ln_stopack .AND. ln_sppt_dyn ) &
+           &                   CALL dyn_sppt_apply ( kstp, 0 )
         IF( ln_bkgwri )        CALL asm_bkg_wri( kstp )     ! output background fields
         IF( ln_neptsimp )      CALL dyn_nept_cor( kstp )    ! subtract Neptune velocities (simplified)
@@ -371,11 +377,14 @@
                                CALL dyn_hpg( kstp )         ! horizontal gradient of Hydrostatic pressure
                                CALL dyn_bfr( kstp )         ! bottom friction
-            IF( ln_sppt_dyn )  CALL dyn_sppt_apply ( kstp, 1 )
+            IF( ln_stopack .AND. ln_sppt_dyn ) &
+               &               CALL dyn_sppt_apply ( kstp, 1 )
                                CALL dyn_zdf( kstp )         ! vertical diffusion
                                CALL dyn_spg( kstp, indic )  ! surface pressure gradient
       ENDIF
                                CALL dyn_nxt( kstp )         ! lateral velocity at next time step
-            IF( ln_sppt_dyn )  CALL dyn_sppt_apply ( kstp, 2 )
-            IF( ln_skeb )      CALL skeb_apply ( kstp )
+            IF( ln_stopack .AND. ln_sppt_dyn ) &
+               &               CALL dyn_sppt_apply ( kstp, 2 )
+            IF( ln_stopack .AND. ln_skeb ) &
+               &               CALL skeb_apply ( kstp )
 
                                CALL ssh_swp( kstp )         ! swap of sea surface height
