Index: /NEMO/branches/2018/dev_r9956_ENHANCE05_ZAD_AIMP/src/OCE/DYN/dynzdf.F90
===================================================================
--- /NEMO/branches/2018/dev_r9956_ENHANCE05_ZAD_AIMP/src/OCE/DYN/dynzdf.F90	(revision 9978)
+++ /NEMO/branches/2018/dev_r9956_ENHANCE05_ZAD_AIMP/src/OCE/DYN/dynzdf.F90	(revision 9979)
@@ -173,6 +173,6 @@
                         zWu  = 0.25_wp * (   wi(ji,jj,jk  ) + wi(ji+1,jj,jk  )   &
                            &               + wi(ji,jj,jk+1) + wi(ji+1,jj,jk+1)   )
-                        zwi(ji,jj,jk) = - zdt * ( zzwi + MIN( zWu, 0._wp ) * z1_e3un )
-                        zws(ji,jj,jk) = - zdt * ( zzws - MAX( zWu, 0._wp ) * z1_e3un )
+                        zwi(ji,jj,jk) = - 1._wp * ( zzwi + MIN( zWu, 0._wp ) * z1_e3un )
+                        zws(ji,jj,jk) = - 1._wp * ( zzws - MAX( zWu, 0._wp ) * z1_e3un )
                         zwd(ji,jj,jk) = 1._wp + zdt * ( zzwi + zzws + ( - MAX( zWu, 0._wp ) + MIN( zWu, 0._wp ) ) * z1_e3un )
                      END DO
@@ -190,6 +190,6 @@
                         zWu  = 0.25_wp * (   wi(ji,jj,jk  ) + wi(ji+1,jj,jk  )   &
                            &               + wi(ji,jj,jk+1) + wi(ji+1,jj,jk+1)   )
-                        zwi(ji,jj,jk) = - zdt * ( zzwi + MIN( zWu, 0._wp ) * z1_e3un )
-                        zws(ji,jj,jk) = - zdt * ( zzws - MAX( zWu, 0._wp ) * z1_e3un )
+                        zwi(ji,jj,jk) = - 1._wp * ( zzwi + MIN( zWu, 0._wp ) * z1_e3un )
+                        zws(ji,jj,jk) = - 1._wp * ( zzws - MAX( zWu, 0._wp ) * z1_e3un )
                         zwd(ji,jj,jk) = 1._wp + zdt * ( zzwi + zzws + ( - MAX( zWu, 0._wp ) + MIN( zWu, 0._wp ) ) * z1_e3un )
                      END DO
@@ -212,5 +212,5 @@
                         zwi(ji,jj,jk) = - zdt * ( zzwi +  MIN( zWui, 0._wp ) ) 
                         zws(ji,jj,jk) = - zdt * ( zzws -  MAX( zWus, 0._wp ) )
-                        zwd(ji,jj,jk) = 1._wp + zdt * ( zzwi + zzws - MAX( zWui, 0._wp ) + MIN( zWus, 0._wp ) )
+                        zwd(ji,jj,jk) = 1._wp + zzwi + zzws - zdt * ( MAX( zWui, 0._wp ) - MIN( zWus, 0._wp ) )
                      END DO
                   END DO
@@ -227,5 +227,5 @@
                         zwi(ji,jj,jk) = - zdt * ( zzwi +  MIN( zWui, 0._wp ) ) 
                         zws(ji,jj,jk) = - zdt * ( zzws -  MAX( zWus, 0._wp ) )
-                        zwd(ji,jj,jk) = 1._wp + zdt * ( zzwi + zzws - MAX( zWui, 0._wp ) + MIN( zWus, 0._wp ) )
+                        zwd(ji,jj,jk) = 1._wp + zzwi + zzws - zdt * ( MAX( zWui, 0._wp ) - MIN( zWus, 0._wp ) )
                      END DO
                   END DO
@@ -240,11 +240,11 @@
                   DO ji = fs_2, fs_jpim1   ! vector opt.
                      ze3ua =  ( 1._wp - r_vvl ) * e3u_n(ji,jj,jk) + r_vvl * e3u_a(ji,jj,jk)   ! after scale factor at U-point
-                     zzwi = - zdt * ( avm(ji+1,jj,jk  ) + avm(ji,jj,jk  ) + akzu(ji,jj,jk  ) )   &
+                     zzwi = ( avm(ji+1,jj,jk  ) + avm(ji,jj,jk  ) + akzu(ji,jj,jk  ) )   &
                         &         / ( ze3ua * e3uw_a(ji,jj,jk  ) ) * wumask(ji,jj,jk  )
-                     zzws = - zdt * ( avm(ji+1,jj,jk+1) + avm(ji,jj,jk+1) + akzu(ji,jj,jk+1) )   &
+                     zzws = ( avm(ji+1,jj,jk+1) + avm(ji,jj,jk+1) + akzu(ji,jj,jk+1) )   &
                         &         / ( ze3ua * e3uw_a(ji,jj,jk+1) ) * wumask(ji,jj,jk+1)
-                     zwi(ji,jj,jk) = zzwi
-                     zws(ji,jj,jk) = zzws
-                     zwd(ji,jj,jk) = 1._wp - zzwi - zzws
+                     zwi(ji,jj,jk) = - zdt * zzwi
+                     zws(ji,jj,jk) = - zdt * zzws
+                     zwd(ji,jj,jk) = 1._wp + zzwi + zzws
                   END DO
                END DO
@@ -255,9 +255,9 @@
                   DO ji = fs_2, fs_jpim1   ! vector opt.
                      ze3ua =  ( 1._wp - r_vvl ) * e3u_n(ji,jj,jk) + r_vvl * e3u_a(ji,jj,jk)   ! after scale factor at U-point
-                     zzwi = - zdt * ( avm(ji+1,jj,jk  ) + avm(ji,jj,jk  ) ) / ( ze3ua * e3uw_a(ji,jj,jk  ) ) * wumask(ji,jj,jk  )
-                     zzws = - zdt * ( avm(ji+1,jj,jk+1) + avm(ji,jj,jk+1) ) / ( ze3ua * e3uw_a(ji,jj,jk+1) ) * wumask(ji,jj,jk+1)
-                     zwi(ji,jj,jk) = zzwi
-                     zws(ji,jj,jk) = zzws
-                     zwd(ji,jj,jk) = 1._wp - zzwi - zzws
+                     zzwi = ( avm(ji+1,jj,jk  ) + avm(ji,jj,jk  ) ) / ( ze3ua * e3uw_a(ji,jj,jk  ) ) * wumask(ji,jj,jk  )
+                     zzws = ( avm(ji+1,jj,jk+1) + avm(ji,jj,jk+1) ) / ( ze3ua * e3uw_a(ji,jj,jk+1) ) * wumask(ji,jj,jk+1)
+                     zwi(ji,jj,jk) = - zdt * zzwi
+                     zws(ji,jj,jk) = - zdt * zzws
+                     zwd(ji,jj,jk) = 1._wp + zzwi + zzws
                   END DO
                END DO
@@ -368,6 +368,6 @@
                         zWv  = 0.25_wp * (   wi(ji,jj,jk  ) + wi(ji,jj+1,jk  )   &
                            &               + wi(ji,jj,jk+1) + wi(ji,jj+1,jk+1)   )
-                        zwi(ji,jj,jk) = - zdt * ( zzwi + MIN( zWv, 0._wp ) * z1_e3vn )
-                        zws(ji,jj,jk) = - zdt * ( zzws - MAX( zWv, 0._wp ) * z1_e3vn )
+                        zwi(ji,jj,jk) = - 1._wp * ( zzwi + MIN( zWv, 0._wp ) * z1_e3vn )
+                        zws(ji,jj,jk) = - 1._wp * ( zzws - MAX( zWv, 0._wp ) * z1_e3vn )
                         zwd(ji,jj,jk) = 1._wp + zdt * ( zzwi + zzws + ( - MAX( zWv, 0._wp ) + MIN( zWv, 0._wp ) ) * z1_e3vn )
                      END DO
@@ -385,6 +385,6 @@
                         zWv  = 0.25_wp * (   wi(ji,jj,jk  ) + wi(ji,jj+1,jk  )   &
                            &               + wi(ji,jj,jk+1) + wi(ji,jj+1,jk+1)   )
-                        zwi(ji,jj,jk) = - zdt * ( zzwi + MIN( zWv, 0._wp ) * z1_e3vn )
-                        zws(ji,jj,jk) = - zdt * ( zzws - MAX( zWv, 0._wp ) * z1_e3vn )
+                        zwi(ji,jj,jk) = - 1._wp * ( zzwi + MIN( zWv, 0._wp ) * z1_e3vn )
+                        zws(ji,jj,jk) = - 1._wp * ( zzws - MAX( zWv, 0._wp ) * z1_e3vn )
                         zwd(ji,jj,jk) = 1._wp + zdt * ( zzwi + zzws + ( - MAX( zWv, 0._wp ) + MIN( zWv, 0._wp ) ) * z1_e3vn )
                      END DO
@@ -405,6 +405,6 @@
                         zWvi = 0.5_wp * ( wi(ji,jj,jk  ) + wi(ji,jj+1,jk  ) )
                         zWvs = 0.5_wp * ( wi(ji,jj,jk+1) + wi(ji,jj+1,jk+1) )
-                        zwi(ji,jj,jk) = - zdt * ( zzwi +  MIN( zWvi, 0._wp ) ) 
-                        zws(ji,jj,jk) = - zdt * ( zzws -  MAX( zWvs, 0._wp ) )
+                        zwi(ji,jj,jk) = - 1._wp * ( zzwi +  MIN( zWvi, 0._wp ) ) 
+                        zws(ji,jj,jk) = - 1._wp * ( zzws -  MAX( zWvs, 0._wp ) )
                         zwd(ji,jj,jk) = 1._wp + zdt * ( zzwi + zzws - MAX( zWvi, 0._wp ) + MIN( zWvs, 0._wp ) )
                      END DO
@@ -420,6 +420,6 @@
                         zWvi = 0.5_wp * ( wi(ji,jj,jk  ) + wi(ji,jj+1,jk  ) )
                         zWvs = 0.5_wp * ( wi(ji,jj,jk+1) + wi(ji,jj+1,jk+1) )
-                        zwi(ji,jj,jk) = - zdt * ( zzwi +  MIN( zWvi, 0._wp ) ) 
-                        zws(ji,jj,jk) = - zdt * ( zzws -  MAX( zWvs, 0._wp ) )
+                        zwi(ji,jj,jk) = - 1._wp * ( zzwi +  MIN( zWvi, 0._wp ) ) 
+                        zws(ji,jj,jk) = - 1._wp * ( zzws -  MAX( zWvs, 0._wp ) )
                         zwd(ji,jj,jk) = 1._wp + zdt * ( zzwi + zzws - MAX( zWvi, 0._wp ) + MIN( zWvs, 0._wp ) )
                      END DO
