Index: NEMO/branches/UKMO/NEMO_4.0.4_idealised_ovf/src/OCE/USR/usrdef_istate.F90
===================================================================
--- NEMO/branches/UKMO/NEMO_4.0.4_idealised_ovf/src/OCE/USR/usrdef_istate.F90	(revision 15156)
+++ NEMO/branches/UKMO/NEMO_4.0.4_idealised_ovf/src/OCE/USR/usrdef_istate.F90	(revision 15161)
@@ -52,5 +52,7 @@
       !
       INTEGER                                              ::   ji, jj, kk, num_pnt, ierr0, ierr1
-      INTEGER, ALLOCATABLE                 , DIMENSION(:)  ::   ovf_ji, ovf_jj ! arrays for overflow
+      INTEGER , DIMENSION(38)                              ::   dst_ji, dst_jj ! arrays for overflow
+      INTEGER , DIMENSION(164)                             ::   ifr_ji, ifr_jj ! arrays for overflow
+      INTEGER , ALLOCATABLE                , DIMENSION(:)  ::   ovf_ji, ovf_jj ! arrays for overflow
       !!----------------------------------------------------------------------
       !
@@ -68,8 +70,70 @@
       pts(:, :, :, jp_sal) = rn_sal_env
       !
-      SELECT CASE(nn_ovf_loc)
+      ! Denmark Strait idealised overflow
+      dst_ji = (/ &
+                  & 1041, 1041, 1041, 1042, 1039, 1040, 1041, 1042, &
+                  & 1039, 1040, 1041, 1042, 1043, 1041, 1042, 1043, &
+                  & 1044, 1042, 1043, 1044, 1045, 1043, 1044, 1045, &
+                  & 1046, 1043, 1044, 1045, 1046, 1047, 1048, 1043, &
+                  & 1044, 1045, 1046, 1047, 1044, 1045              &
+                  & /)
+
+      dst_jj = (/ &
+                  & 1012, 1013, 1014, 1014, 1015, 1015, 1015, 1015, &
+                  & 1016, 1016, 1016, 1016, 1016, 1017, 1017, 1017, &
+                  & 1017, 1018, 1018, 1018, 1018, 1019, 1019, 1019, &
+                  & 1019, 1020, 1020, 1020, 1020, 1020, 1020, 1021, &
+                  & 1021, 1021, 1021, 1021, 1022, 1022              &
+                  & /)
+
+      ! Iceland-Faroe Ridge idealised overflow
+      ifr_ji = (/ &
+                  & 1097, 1098, 1099, 1100, 1101, 1102, 1103, 1104, 1091, &
+                  & 1092, 1093, 1094, 1095, 1096, 1097, 1098, 1099, 1100, &
+                  & 1101, 1102, 1103, 1104, 1089, 1090, 1091, 1092, 1093, &
+                  & 1094, 1095, 1096, 1097, 1098, 1099, 1100, 1101, 1102, &
+                  & 1103, 1104, 1089, 1090, 1091, 1092, 1093, 1094, 1095, &
+                  & 1096, 1097, 1098, 1099, 1100, 1101, 1102, 1103, 1104, &
+                  & 1089, 1090, 1091, 1092, 1093, 1094, 1095, 1096, 1097, &
+                  & 1098, 1099, 1100, 1101, 1102, 1103, 1104, 1089, 1090, &
+                  & 1091, 1092, 1093, 1094, 1095, 1096, 1097, 1098, 1099, &
+                  & 1100, 1101, 1102, 1103, 1089, 1090, 1091, 1092, 1093, &
+                  & 1094, 1095, 1096, 1097, 1098, 1099, 1100, 1101, 1102, &
+                  & 1089, 1090, 1091, 1092, 1093, 1094, 1095, 1096, 1097, &
+                  & 1098, 1099, 1087, 1088, 1089, 1090, 1091, 1092, 1093, &
+                  & 1094, 1095, 1096, 1097, 1088, 1089, 1090, 1091, 1092, &
+                  & 1093, 1094, 1095, 1096, 1089, 1090, 1091, 1092, 1093, &
+                  & 1094, 1095, 1096, 1090, 1091, 1092, 1093, 1094, 1095, &
+                  & 1096, 1090, 1091, 1092, 1093, 1094, 1095, 1096, 1097, &
+                  & 1091, 1092, 1093, 1094, 1095, 1096, 1091, 1092, 1093, &
+                  & 1094, 1095                                            &
+                  & /)
+
+      ifr_jj = (/ &
+                  & 996 , 996 , 996 , 996 , 996 , 996 , 996 , 996 , 997 , &
+                  & 997 , 997 , 997 , 997 , 997 , 997 , 997 , 997 , 997 , &
+                  & 997 , 997 , 997 , 997 , 998 , 998 , 998 , 998 , 998 , &
+                  & 998 , 998 , 998 , 998 , 998 , 998 , 998 , 998 , 998 , &
+                  & 998 , 998 , 999 , 999 , 999 , 999 , 999 , 999 , 999 , &
+                  & 999 , 999 , 999 , 999 , 999 , 999 , 999 , 999 , 999 , &
+                  & 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, &
+                  & 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1001, 1001, &
+                  & 1001, 1001, 1001, 1001, 1001, 1001, 1001, 1001, 1001, &
+                  & 1001, 1001, 1001, 1001, 1002, 1002, 1002, 1002, 1002, &
+                  & 1002, 1002, 1002, 1002, 1002, 1002, 1002, 1002, 1002, &
+                  & 1003, 1003, 1003, 1003, 1003, 1003, 1003, 1003, 1003, &
+                  & 1003, 1003, 1004, 1004, 1004, 1004, 1004, 1004, 1004, &
+                  & 1004, 1004, 1004, 1004, 1005, 1005, 1005, 1005, 1005, &
+                  & 1005, 1005, 1005, 1005, 1006, 1006, 1006, 1006, 1006, &
+                  & 1006, 1006, 1006, 1007, 1007, 1007, 1007, 1007, 1007, &
+                  & 1007, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, &
+                  & 1009, 1009, 1009, 1009, 1009, 1009, 1010, 1010, 1010, &
+                  & 1010, 1010                                            &
+                  & /)
+
+       SELECT CASE(nn_ovf_loc)
 
          CASE(0) ! Denmark Strait
-            num_pnt = 17
+            num_pnt = SIZE(dst_ji)
             ALLOCATE( ovf_ji(num_pnt), STAT=ierr0 )
             ALLOCATE( ovf_jj(num_pnt), STAT=ierr1 )
@@ -77,20 +141,29 @@
                CALL ctl_stop( 'dta_tsd : unable to allocate T & S data arrays' );   RETURN
             ENDIF
-            ovf_ji = (/ &
-                        &       1045, 1046, &
-                        & 1044, 1045, 1046, &
-                        & 1043, 1044, 1045, &
-                        & 1042, 1043, 1044, &
-                        & 1041, 1042, 1043, &
-                        & 1040, 1041, 1042  &
-                        & /)
-            ovf_jj = (/ &
-                        &       1020, 1020, &
-                        & 1019, 1019, 1019, &
-                        & 1018, 1018, 1018, &
-                        & 1017, 1017, 1017, &
-                        & 1016, 1016, 1016, &
-                        & 1015, 1015, 1015  &
-                        & /)
+            ovf_ji(:) = dst_ji(:) 
+            ovf_jj(:) = dst_jj(:)
+
+         CASE(1) ! Iceland-Faroe Ridge
+            num_pnt = SIZE(ifr_ji)
+            ALLOCATE( ovf_ji(num_pnt), STAT=ierr0 )
+            ALLOCATE( ovf_jj(num_pnt), STAT=ierr1 )
+            IF( ierr0 + ierr1 > 0 ) THEN
+               CALL ctl_stop( 'dta_tsd : unable to allocate T & S data arrays');   RETURN
+            ENDIF
+            ovf_ji(:) = ifr_ji(:)
+            ovf_jj(:) = ifr_jj(:)
+
+         CASE(2) ! Both
+            num_pnt = SIZE(dst_ji) + SIZE(ifr_ji)
+            ALLOCATE( ovf_ji(num_pnt), STAT=ierr0 )
+            ALLOCATE( ovf_jj(num_pnt), STAT=ierr1 )
+            IF( ierr0 + ierr1 > 0 ) THEN
+               CALL ctl_stop( 'dta_tsd : unable to allocate T & S data arrays'); RETURN
+            ENDIF
+            ovf_ji(1              : SIZE(dst_ji)) = dst_ji(:)
+            ovf_ji(SIZE(dst_ji)+1 : num_pnt     ) = ifr_ji(:)
+            ovf_jj(1              : SIZE(dst_jj)) = dst_jj(:)
+            ovf_jj(SIZE(dst_jj)+1 : num_pnt     ) = ifr_jj(:)
+ 
       END SELECT
       !
