Index: /trunk/CONFIG/GYRE/EXP00/namelist
===================================================================
--- /trunk/CONFIG/GYRE/EXP00/namelist	(revision 630)
+++ /trunk/CONFIG/GYRE/EXP00/namelist	(revision 631)
@@ -24,4 +24,5 @@
 !  nwrite     frequency of OUTPUT file
 !  nrunoff    = 0 no, 1 runoff, 2 runoff+river mouth ups adv
+!  ln_dimgnnn (F/T) 1 DIMG file - (for all proc/per proc)
 !
 !  CAUTION: for usual run scripts, logical value of
@@ -41,4 +42,5 @@
    nwrite     =      60 
    nrunoff    =       0
+   ln_dimgnnn = .FALSE.
 /
 !-----------------------------------------------------------------------
Index: /trunk/CONFIG/ORCA2_LIM/EXP00/namelist
===================================================================
--- /trunk/CONFIG/ORCA2_LIM/EXP00/namelist	(revision 630)
+++ /trunk/CONFIG/ORCA2_LIM/EXP00/namelist	(revision 631)
@@ -24,4 +24,5 @@
 !  nwrite     frequency of OUTPUT file
 !  nrunoff    = 0 no, 1 runoff, 2 runoff+river mouth ups adv
+!  ln_dimgnnn (F/T) 1 DIMG file - (for all proc/per proc)
 !
 !  CAUTION: for usual run scripts, logical value of
@@ -41,4 +42,5 @@
    nwrite     =    5475 
    nrunoff    =       2
+   ln_dimgnnn = .FALSE.
 /
 !-----------------------------------------------------------------------
Index: /trunk/NEMO/OPA_SRC/DIA/diadimg.F90
===================================================================
--- /trunk/NEMO/OPA_SRC/DIA/diadimg.F90	(revision 630)
+++ /trunk/NEMO/OPA_SRC/DIA/diadimg.F90	(revision 631)
@@ -64,5 +64,6 @@
     REAL(sp),DIMENSION(jpk)     :: z4dep       ! vertical level (sp)
 
-    CHARACTER(LEN=4) :: clver='@!01'
+    CHARACTER(LEN=80) :: clname                ! name of file in case of dimgnnn
+    CHARACTER(LEN=4) :: clver='@!01'           ! dimg string identifier
     !!---------------------------------------------------------------------------
 
@@ -101,30 +102,59 @@
     END SELECT
 
-    !! * Open file
-    OPEN (inum, FILE=cd_name, FORM='UNFORMATTED', ACCESS='DIRECT', RECL=irecl4 )
+    IF ( ln_dimgnnn  ) THEN
+       WRITE(clname,'(a,a,i3.3)') TRIM(cd_name),'.',narea
+       OPEN (inum, FILE=clname, FORM='UNFORMATTED', ACCESS='DIRECT', RECL=irecl4 )
+       WRITE(inum,REC=1 ) clver, cd_text, irecl4, &
+            &     jpi,jpj, klev, 1 , 1 ,            &
+            &     zwest, zsouth, zdx, zdy, zspval,  &
+            &     z4dep(1:klev),                    &
+            &     ztimm,                            &
+            &     narea, jpnij,jpiglo,jpjglo,jpizoom, jpjzoom,    &    ! extension to dimg for mpp output
+            &     nlcit,nlcjt, nldit, nldjt, nleit, nlejt, nimppt, njmppt  !
 
-    !! * Write header on record #1
-    IF(lwp) WRITE(inum,REC=1 ) clver, cd_text, irecl4, &
-         &     jpi,jpj, klev*jpnij, 1 , 1 ,            &
-         &     zwest, zsouth, zdx, zdy, zspval,  &
-         &     (z4dep(1:klev),jn=1,jpnij),       &
-         &     ztimm,                            &
-         &     narea, jpnij,jpiglo,jpjglo,jpizoom, jpjzoom,    &    ! extension to dimg for mpp output
-         &     nlcit,nlcjt, nldit, nldjt, nleit, nlejt, nimppt, njmppt  !
+       !! * Write klev levels
+       IF ( cd_type == 'I' ) THEN
 
-    !! * Write klev levels
-    IF ( cd_type == 'I' ) THEN
+          DO jk = 1, klev
+             irec =1 + jk
+             z42d(:,:) = ptab(:,:,ksubi(jk))
+             WRITE(inum,REC=irec)  z42d(:,:)
+          END DO
+       ELSE
+          DO jk = 1, klev
+             irec =1 + jk
+             z42d(:,:) = ptab(:,:,jk)
+             WRITE(inum,REC=irec)  z42d(:,:)
+          END DO
+       ENDIF
+    ELSE
+       !! Standard dimgproc (1 file per variable, all procs. write to this file )
+       !! * Open file
+       OPEN (inum, FILE=cd_name, FORM='UNFORMATTED', ACCESS='DIRECT', RECL=irecl4 )
 
-       DO jk = 1, klev
-          irec =1 + klev * (narea -1) + jk
-          z42d(:,:) = ptab(:,:,ksubi(jk))
-          WRITE(inum,REC=irec)  z42d(:,:)
-       END DO
-    ELSE
-       DO jk = 1, klev
-          irec =1 + klev * (narea -1) + jk
-          z42d(:,:) = ptab(:,:,jk)
-          WRITE(inum,REC=irec)  z42d(:,:)
-       END DO
+       !! * Write header on record #1
+       IF(lwp) WRITE(inum,REC=1 ) clver, cd_text, irecl4, &
+            &     jpi,jpj, klev*jpnij, 1 , 1 ,            &
+            &     zwest, zsouth, zdx, zdy, zspval,  &
+            &     (z4dep(1:klev),jn=1,jpnij),       &
+            &     ztimm,                            &
+            &     narea, jpnij,jpiglo,jpjglo,jpizoom, jpjzoom,    &    ! extension to dimg for mpp output
+            &     nlcit,nlcjt, nldit, nldjt, nleit, nlejt, nimppt, njmppt  !
+
+       !! * Write klev levels
+       IF ( cd_type == 'I' ) THEN
+
+          DO jk = 1, klev
+             irec =1 + klev * (narea -1) + jk
+             z42d(:,:) = ptab(:,:,ksubi(jk))
+             WRITE(inum,REC=irec)  z42d(:,:)
+          END DO
+       ELSE
+          DO jk = 1, klev
+             irec =1 + klev * (narea -1) + jk
+             z42d(:,:) = ptab(:,:,jk)
+             WRITE(inum,REC=irec)  z42d(:,:)
+          END DO
+       ENDIF
     ENDIF
 
Index: /trunk/NEMO/OPA_SRC/DOM/domain.F90
===================================================================
--- /trunk/NEMO/OPA_SRC/DOM/domain.F90	(revision 630)
+++ /trunk/NEMO/OPA_SRC/DOM/domain.F90	(revision 631)
@@ -107,5 +107,5 @@
       hur(:,:) = fse3u(:,:,1)             ! Lower bound : thickness of the first model level
       hvr(:,:) = fse3v(:,:,1)
-      
+
       DO jk = 2, jpk                      ! Sum of the vertical scale factors
          hur(:,:) = hur(:,:) + fse3u(:,:,jk) * umask(:,:,jk)
@@ -144,5 +144,5 @@
       NAMELIST/namrun/ no    , cexper   , ln_rstart , nrstdt , nit000,         &
          &             nitend, ndate0   , nleapy   , ninist , nstock,          &
-         &             nwrite, nrunoff
+         &             nwrite, nrunoff  , ln_dimgnnn
 
       NAMELIST/namdom/ ntopo , e3zps_min, e3zps_rat, ngrid  , nmsh  ,   &
@@ -176,4 +176,5 @@
          WRITE(numout,*) '           frequency of output file        nwrite    = ', nwrite
          WRITE(numout,*) '           runoff option                   nrunoff   = ', nrunoff
+         WRITE(numout,*) '           multi file dimgout           ln_dimgnnn   = ', ln_dimgnnn
       ENDIF
 
Index: /trunk/NEMO/OPA_SRC/IOM/in_out_manager.F90
===================================================================
--- /trunk/NEMO/OPA_SRC/IOM/in_out_manager.F90	(revision 630)
+++ /trunk/NEMO/OPA_SRC/IOM/in_out_manager.F90	(revision 631)
@@ -33,4 +33,6 @@
    INTEGER            ::   nleapy     = 0         !: Leap year calendar flag (0/1 or 30)
    INTEGER            ::   ninist     = 0         !: initial state output flag (0/1)
+   LOGICAL            ::   ln_dimgnnn = .FALSE.   !: type of dimgout. (F): 1 file for all proc
+                                                  !:                  (T): 1 file per proc
    !!----------------------------------------------------------------------
    !! was in restart but moved here because of the OFF line... better solution should be found...
@@ -72,5 +74,5 @@
    !!                          Run control  
    !!----------------------------------------------------------------------
-   
+
    INTEGER            ::   nstop = 0                !: error flag (=number of reason for a premature stop run)
    INTEGER            ::   nwarn = 0                !: warning flag (=number of warning found during the run)
@@ -168,5 +170,5 @@
         getunit = -1
      ENDIF
-     
+
    END FUNCTION getunit
 
