Index: NEMO/branches/UKMO/NEMO_4.0.4_CO9_shelf_climate/src/OCE/DIA/diadct.F90
===================================================================
--- NEMO/branches/UKMO/NEMO_4.0.4_CO9_shelf_climate/src/OCE/DIA/diadct.F90	(revision 15384)
+++ NEMO/branches/UKMO/NEMO_4.0.4_CO9_shelf_climate/src/OCE/DIA/diadct.F90	(revision 15397)
@@ -84,4 +84,6 @@
   LOGICAL, PUBLIC ::   ln_diadct
 
+  CHARACTER(len=60), PUBLIC ::  diadct_endian
+
   ! JT
 
@@ -175,10 +177,14 @@
      !!
      !!---------------------------------------------------------------------
+
+     !
      NAMELIST/namdct/ln_diadct,ln_NOOS,nn_dct,ln_dct_h,ln_dct_ascii,nn_secdebug,ln_dct_calc_noos_day,ln_dct_calc_noos_hr,&
-             & nn_dct_iom_cont,ln_dct_day_25hr,ln_dct_verbose
+             & nn_dct_iom_cont,ln_dct_day_25hr,ln_dct_verbose,diadct_endian
      INTEGER           ::   ios,jsec        ! Local integer output status for namelist read
      CHARACTER(len=3)  ::   jsec_str        ! name of the jsec
      LOGICAL       ::   verbose     
      verbose = ln_dct_verbose!.false.
+
+     diadct_endian='BIG_ENDIAN'
 
      IF( ln_timing )   CALL timing_start('dia_dct_init')
@@ -649,5 +655,7 @@
      INTEGER :: jsec, jpt                                     ! dummy loop indices
      INTEGER                            :: ierr  ! error for allocate
-
+     !JT
+     INTEGER                            :: fsize, floc  ! exit section_ijglobal.diadct gracefully.
+     !JT
      INTEGER, DIMENSION(2) :: icoord 
      CHARACTER(len=160)    :: clname                          !filename
@@ -673,16 +681,34 @@
      
      IF ( verbose ) write(numout,*) 'dct low-level pre open: big endian :',nproc,narea
+
+
+     ! ok with Daleys set up (ifort?)
+     !OPEN(UNIT=107,FILE='section_ijglobal.diadct', FORM='UNFORMATTED', ACCESS='SEQUENTIAL', STATUS='OLD',convert='NATIVE')
+     !READ(107) isec
+     !CLOSE(107)
+     !IF( lwp .AND. verbose ) write(numout,*) 'diadct readsec: NATIVE, isec',isec
+
+     !ok with  Daleys set up (ifort?)
+     !OPEN(UNIT=107,FILE='section_ijglobal.diadct', FORM='UNFORMATTED', ACCESS='SEQUENTIAL', STATUS='OLD',convert='LITTLE_ENDIAN')
+     !READ(107) isec
+     !CLOSE(107)
+     !IF( lwp .AND. verbose ) write(numout,*) 'diadct readsec: LITTLE_ENDIAN, isec',isec
+
+
      OPEN(UNIT=107,FILE='section_ijglobal.diadct', FORM='UNFORMATTED', ACCESS='SEQUENTIAL', STATUS='OLD',convert='BIG_ENDIAN')
-     
-     !write(numout,*) 'dct low-level pre open: SWAP '
-     !OPEN(UNIT=107,FILE='section_ijglobal.diadct', FORM='UNFORMATTED', ACCESS='SEQUENTIAL', STATUS='OLD',convert='SWAP')
-     
-     !write(numout,*) 'dct low-level pre open: NATIVE '
-     !OPEN(UNIT=107,FILE='section_ijglobal.diadct', FORM='UNFORMATTED', ACCESS='SEQUENTIAL', STATUS='OLD',convert='NATIVE')
-     
      READ(107) isec
      CLOSE(107)
+     IF( lwp .AND. verbose ) write(numout,*) 'diadct readsec: BIG_ENDIAN, isec',isec
+
+     inquire(file='section_ijglobal.diadct',size=fsize)
      
      CALL ctl_opn( numdct_in, 'section_ijglobal.diadct', 'OLD', 'UNFORMATTED', 'SEQUENTIAL', -1, numout, .TRUE. )
+
+     !ok with  Daleys set up (ifort?)
+     !CLOSE(numdct_in)
+     !
+     !!OPEN(UNIT=numdct_in,FILE='section_ijglobal.diadct', FORM='UNFORMATTED', ACCESS='SEQUENTIAL', STATUS='OLD',convert='BIG_ENDIAN')
+     !
+     !OPEN(UNIT=numdct_in,FILE='section_ijglobal.diadct', FORM='UNFORMATTED', ACCESS='SEQUENTIAL', STATUS='OLD',convert=TRIM(diadct_endian))
  
      !---------------
@@ -711,7 +737,22 @@
         secs(jsec)%nb_point       = 0
 
-        !read section's number / name / computing choices / classes / slopeSection / points number
-        !-----------------------------------------------------------------------------------------
-        
+
+!        ! ok with Daleys set up (ifort?)
+!        !read section's number / name / computing choices / classes / slopeSection / points number
+!        !-----------------------------------------------------------------------------------------
+!        !JT
+!        CALL FTELL(numdct_in, floc)
+!        
+!        IF( lwp .AND. verbose ) write(numout,*) 'diadct readsec: section_ijglobal.diadct size and location',fsize, floc
+!        !JT
+!        IF (floc .GE. fsize) THEN
+! 
+!            IF( lwp .AND. verbose )THEN
+!               write(numout,*) 'diadct readsec: End of section_ijglobal.diadct: Exiting Gracefully'
+!               write(numout,*) 'diadct readsec: section_ijglobal.diadct: size and location',fsize, floc
+!            ENDIF            
+!            EXIT 
+!        ENDIF
+
         READ(numdct_in,iostat=iost) isec
         IF (iost .NE. 0 ) then
@@ -1999,5 +2040,5 @@
      CHARACTER(len=3)      :: noos_sect_name             ! Classname 
      CHARACTER(len=25)      :: noos_var_sect_name
-     REAL(wp), ALLOCATABLE, DIMENSION(:,:,:) ::   noos_iom_dummy
+     REAL(wp), ALLOCATABLE, DIMENSION(:) ::   noos_iom_dummy
      INTEGER               :: IERR
      
@@ -2047,5 +2088,5 @@
      IF ( nn_dct_iom_cont  .eq. 1) THEN
          max_iom_val = 1.e10
-         ALLOCATE( noos_iom_dummy(jpi,jpj,3),  STAT= ierr )
+         ALLOCATE( noos_iom_dummy(3),  STAT= ierr )
             IF( ierr /= 0 )   CALL ctl_stop( 'dia_dct_wri_NOOS: failed to allocate noos_iom_dummy array' )
      ENDIF
@@ -2088,5 +2129,5 @@
          noos_var_sect_name = "noos_" // trim(noos_sect_name) // '_trans'
          IF (iom_use(noos_var_sect_name)) THEN
-             noos_iom_dummy(:,:,:) = 0.
+             noos_iom_dummy(:) = 0.
              tmp_iom_output(:) = 0.
              
@@ -2113,21 +2154,21 @@
              if ( tmp_iom_output(3) .ne.  tmp_iom_output(3) ) tmp_iom_output(1) =  max_iom_val*2
              
-             noos_iom_dummy(:,:,1) = tmp_iom_output(1)
-             noos_iom_dummy(:,:,2) = tmp_iom_output(2)
-             noos_iom_dummy(:,:,3) = tmp_iom_output(3)
+             noos_iom_dummy(1) = tmp_iom_output(1)
+             noos_iom_dummy(2) = tmp_iom_output(2)
+             noos_iom_dummy(3) = tmp_iom_output(3)
              
-             !noos_iom_dummy(:,:,1) = (zsumclasses( 1)+zsumclasses( 2))
-             !noos_iom_dummy(:,:,2) = zsumclasses( 1)
-             !noos_iom_dummy(:,:,3) = zsumclasses( 2)
+             !noos_iom_dummy(1) = (zsumclasses( 1)+zsumclasses( 2))
+             !noos_iom_dummy(2) = zsumclasses( 1)
+             !noos_iom_dummy(3) = zsumclasses( 2)
              
              
              
              if ( lwp .AND. verbose ) WRITE(numout,*) 'dia_dct_wri_NOOS iom_put: ', kt,ksec, noos_var_sect_name
-             CALL iom_put( noos_var_sect_name,  noos_iom_dummy )
+             CALL iom_put( noos_var_sect_name,  noos_iom_dummy(:) )
          ENDIF
 
          noos_var_sect_name =  "noos_" // trim(noos_sect_name) // '_heat'
          IF (iom_use(noos_var_sect_name)) THEN
-             noos_iom_dummy(:,:,:) = 0.
+             noos_iom_dummy(:) = 0.
              tmp_iom_output(:) = 0.
              
@@ -2154,19 +2195,19 @@
              if ( tmp_iom_output(3) .ne.  tmp_iom_output(3) ) tmp_iom_output(1) =  max_iom_val*2
              
-             noos_iom_dummy(:,:,1) = tmp_iom_output(1)
-             noos_iom_dummy(:,:,2) = tmp_iom_output(2)
-             noos_iom_dummy(:,:,3) = tmp_iom_output(3)
+             noos_iom_dummy(1) = tmp_iom_output(1)
+             noos_iom_dummy(2) = tmp_iom_output(2)
+             noos_iom_dummy(3) = tmp_iom_output(3)
              
-             !noos_iom_dummy(:,:,1) = (zsumclasses( 7)+zsumclasses( 8))
-             !noos_iom_dummy(:,:,2) = zsumclasses( 7)
-             !noos_iom_dummy(:,:,3) = zsumclasses( 8)
+             !noos_iom_dummy(1) = (zsumclasses( 7)+zsumclasses( 8))
+             !noos_iom_dummy(2) = zsumclasses( 7)
+             !noos_iom_dummy(3) = zsumclasses( 8)
              
              if ( lwp .AND. verbose ) WRITE(numout,*) 'dia_dct_wri_NOOS iom_put: ', kt,ksec, noos_var_sect_name
-             CALL iom_put(noos_var_sect_name,  noos_iom_dummy )  
+             CALL iom_put(noos_var_sect_name,  noos_iom_dummy(:) )  
          ENDIF
 
          noos_var_sect_name = "noos_" // trim(noos_sect_name) // '_salt'
          IF (iom_use(noos_var_sect_name)) THEN
-             noos_iom_dummy(:,:,:) = 0.
+             noos_iom_dummy(:) = 0.
              tmp_iom_output(:) = 0.
              
@@ -2194,15 +2235,15 @@
              if ( tmp_iom_output(3) .ne.  tmp_iom_output(3) ) tmp_iom_output(1) =  max_iom_val*2
              
-             noos_iom_dummy(:,:,1) = tmp_iom_output(1)
-             noos_iom_dummy(:,:,2) = tmp_iom_output(2)
-             noos_iom_dummy(:,:,3) = tmp_iom_output(3)
+             noos_iom_dummy(1) = tmp_iom_output(1)
+             noos_iom_dummy(2) = tmp_iom_output(2)
+             noos_iom_dummy(3) = tmp_iom_output(3)
              
-             !noos_iom_dummy(:,:,1) = (zsumclasses( 9)+zsumclasses( 10))
-             !noos_iom_dummy(:,:,2) = zsumclasses( 9)
-             !noos_iom_dummy(:,:,3) = zsumclasses( 10)
+             !noos_iom_dummy(1) = (zsumclasses( 9)+zsumclasses( 10))
+             !noos_iom_dummy(2) = zsumclasses( 9)
+             !noos_iom_dummy(3) = zsumclasses( 10)
              
              if ( lwp .AND. verbose ) WRITE(numout,*) 'dia_dct_wri_NOOS iom_put: ', kt,ksec, noos_var_sect_name
-             CALL iom_put(noos_var_sect_name,  noos_iom_dummy )
-             noos_iom_dummy(:,:,:) = 0.         
+             CALL iom_put(noos_var_sect_name,  noos_iom_dummy(:) )
+             noos_iom_dummy(:) = 0.         
              tmp_iom_output(:) = 0.
         ENDIF
@@ -2323,5 +2364,5 @@
      CHARACTER(len=3)      :: noos_sect_name             ! Classname 
      CHARACTER(len=25)      :: noos_var_sect_name
-     REAL(wp), ALLOCATABLE, DIMENSION(:,:,:) ::   noos_iom_dummy
+     REAL(wp), ALLOCATABLE, DIMENSION(:) ::   noos_iom_dummy
      INTEGER               :: IERR
      
@@ -2369,10 +2410,10 @@
      !IF ( nn_dct_iom_cont .EQ. 2 ) THEN
      max_iom_val = 1.e10
-     ALLOCATE( noos_iom_dummy(jpi,jpj,3),  STAT= ierr )
+     ALLOCATE( noos_iom_dummy(3),  STAT= ierr )
         IF( ierr /= 0 )   CALL ctl_stop( 'dia_dct_wri_NOOS: failed to allocate noos_iom_dummy array' )
 
      noos_var_sect_name = "noos_" // trim(noos_sect_name) // '_trans'
      IF (iom_use(noos_var_sect_name)) THEN
-         noos_iom_dummy(:,:,:) = 0.
+         noos_iom_dummy(:) = 0.
          tmp_iom_output(:) = 0.
          
@@ -2399,21 +2440,21 @@
          if ( tmp_iom_output(3) .ne.  tmp_iom_output(3) ) tmp_iom_output(1) =  max_iom_val*2
          
-         noos_iom_dummy(:,:,1) = tmp_iom_output(1)
-         noos_iom_dummy(:,:,2) = tmp_iom_output(2)
-         noos_iom_dummy(:,:,3) = tmp_iom_output(3)
+         noos_iom_dummy(1) = tmp_iom_output(1)
+         noos_iom_dummy(2) = tmp_iom_output(2)
+         noos_iom_dummy(3) = tmp_iom_output(3)
          
-         !noos_iom_dummy(:,:,1) = (zsumclasses( 1)+zsumclasses( 2))
-         !noos_iom_dummy(:,:,2) = zsumclasses( 1)
-         !noos_iom_dummy(:,:,3) = zsumclasses( 2)
+         !noos_iom_dummy(1) = (zsumclasses( 1)+zsumclasses( 2))
+         !noos_iom_dummy(2) = zsumclasses( 1)
+         !noos_iom_dummy(3) = zsumclasses( 2)
          
          
          
          if ( lwp .AND. verbose ) WRITE(numout,*) 'dia_dct_wri_NOOS iom_put: ', kt,ksec, noos_var_sect_name,tmp_iom_output(1)
-         CALL iom_put( noos_var_sect_name,  noos_iom_dummy  )
+         CALL iom_put( noos_var_sect_name,  noos_iom_dummy(:)  )
      ENDIF
 
      noos_var_sect_name =  "noos_" // trim(noos_sect_name) // '_heat'
      IF (iom_use(noos_var_sect_name)) THEN
-         noos_iom_dummy(:,:,:) = 0.
+         noos_iom_dummy(:) = 0.
          tmp_iom_output(:) = 0.
          
@@ -2440,19 +2481,19 @@
          if ( tmp_iom_output(3) .ne.  tmp_iom_output(3) ) tmp_iom_output(1) =  max_iom_val*2
          
-         noos_iom_dummy(:,:,1) = tmp_iom_output(1)
-         noos_iom_dummy(:,:,2) = tmp_iom_output(2)
-         noos_iom_dummy(:,:,3) = tmp_iom_output(3)
+         noos_iom_dummy(1) = tmp_iom_output(1)
+         noos_iom_dummy(2) = tmp_iom_output(2)
+         noos_iom_dummy(3) = tmp_iom_output(3)
          
-         !noos_iom_dummy(:,:,1) = (zsumclasses( 7)+zsumclasses( 8))
-         !noos_iom_dummy(:,:,2) = zsumclasses( 7)
-         !noos_iom_dummy(:,:,3) = zsumclasses( 8)
+         !noos_iom_dummy(1) = (zsumclasses( 7)+zsumclasses( 8))
+         !noos_iom_dummy(2) = zsumclasses( 7)
+         !noos_iom_dummy(3) = zsumclasses( 8)
          
          if ( lwp .AND. verbose ) WRITE(numout,*) 'dia_dct_wri_NOOS iom_put: ', kt,ksec, noos_var_sect_name,tmp_iom_output(1)
-         CALL iom_put(noos_var_sect_name,  noos_iom_dummy )  
+         CALL iom_put(noos_var_sect_name,  noos_iom_dummy(:) )  
      ENDIF
 
      noos_var_sect_name = "noos_" // trim(noos_sect_name) // '_salt'
      IF (iom_use(noos_var_sect_name)) THEN
-         noos_iom_dummy(:,:,:) = 0.
+         noos_iom_dummy(:) = 0.
          tmp_iom_output(:) = 0.
          
@@ -2480,15 +2521,15 @@
          if ( tmp_iom_output(3) .ne.  tmp_iom_output(3) ) tmp_iom_output(1) =  max_iom_val*2
          
-         noos_iom_dummy(:,:,1) = tmp_iom_output(1)
-         noos_iom_dummy(:,:,2) = tmp_iom_output(2)
-         noos_iom_dummy(:,:,3) = tmp_iom_output(3)
+         noos_iom_dummy(1) = tmp_iom_output(1)
+         noos_iom_dummy(2) = tmp_iom_output(2)
+         noos_iom_dummy(3) = tmp_iom_output(3)
          
-         !noos_iom_dummy(:,:,1) = (zsumclasses( 9)+zsumclasses( 10))
-         !noos_iom_dummy(:,:,2) = zsumclasses( 9)
-         !noos_iom_dummy(:,:,3) = zsumclasses( 10)
+         !noos_iom_dummy(1) = (zsumclasses( 9)+zsumclasses( 10))
+         !noos_iom_dummy(2) = zsumclasses( 9)
+         !noos_iom_dummy(3) = zsumclasses( 10)
          
          if ( lwp .AND. verbose ) WRITE(numout,*) 'dia_dct_wri_NOOS iom_put: ', kt,ksec, noos_var_sect_name,tmp_iom_output(1)
-         CALL iom_put(noos_var_sect_name,  noos_iom_dummy  )
-         noos_iom_dummy(:,:,:) = 0.         
+         CALL iom_put(noos_var_sect_name,  noos_iom_dummy(:)  )
+         noos_iom_dummy(:) = 0.         
          tmp_iom_output(:) = 0.
     ENDIF
@@ -2531,5 +2572,5 @@
      CHARACTER(len=3)      :: noos_sect_name             ! Classname 
      CHARACTER(len=25)      :: noos_var_sect_name
-     REAL(wp), ALLOCATABLE, DIMENSION(:,:,:) ::   noos_iom_dummy
+     REAL(wp), ALLOCATABLE, DIMENSION(:) ::   noos_iom_dummy
      INTEGER               :: IERR
      LOGICAL       ::   verbose     
@@ -2551,5 +2592,5 @@
      write (noos_sect_name, "(I03)")  ksec
      
-     ALLOCATE( noos_iom_dummy(jpi,jpj,3),  STAT= ierr )
+     ALLOCATE( noos_iom_dummy(3),  STAT= ierr )
         IF( ierr /= 0 )   CALL ctl_stop( 'dia_dct_wri_NOOS_h: failed to allocate noos_iom_dummy array' )
 
Index: NEMO/branches/UKMO/NEMO_4.0.4_CO9_shelf_climate/src/OCE/DIA/diaregmean.F90
===================================================================
--- NEMO/branches/UKMO/NEMO_4.0.4_CO9_shelf_climate/src/OCE/DIA/diaregmean.F90	(revision 15384)
+++ NEMO/branches/UKMO/NEMO_4.0.4_CO9_shelf_climate/src/OCE/DIA/diaregmean.F90	(revision 15397)
@@ -916,5 +916,5 @@
       REAL(wp), DIMENSION(jpi, jpj) :: internal_infield    ! Internal data field
       REAL(wp), ALLOCATABLE, DIMENSION(:) ::   zrmet_ave,zrmet_tot,zrmet_var,zrmet_cnt,zrmet_mask_id,zrmet_reg_id  ,zrmet_min,zrmet_max
-      REAL(wp), ALLOCATABLE, DIMENSION(:,:,:) ::   zrmet_out
+      REAL(wp), ALLOCATABLE, DIMENSION(:) ::   zrmet_out
       REAL(wp), ALLOCATABLE,   DIMENSION(:) ::   ave_mat,tot_mat,num_mat,var_mat,ssq_mat,cnt_mat,reg_id_mat,mask_id_mat    !: region_mask
       !REAL(wp), ALLOCATABLE,   DIMENSION(:) ::   min_mat,max_mat   !: region_mask
@@ -957,5 +957,5 @@
         IF( ierr /= 0 )   CALL ctl_stop( 'dia_wri_region_mean: failed to allocate zrmet_max array' )
       
-      ALLOCATE( zrmet_out(jpi,jpj,n_regions_output),  STAT= ierr )
+      ALLOCATE( zrmet_out(n_regions_output),  STAT= ierr )
         IF( ierr /= 0 )   CALL ctl_stop( 'dia_wri_region_mean: failed to allocate zrmet_reg_id array' )
 
@@ -1152,19 +1152,20 @@
 
               ENDIF
+          ENDIF
               
-              DO jm = 1,nreg
-                  zrmet_ave(    reg_ind_cnt) =     ave_mat(jm)
-                  zrmet_tot(    reg_ind_cnt) =     tot_mat(jm)
-                  zrmet_var(    reg_ind_cnt) =     var_mat(jm)
-                  zrmet_cnt(    reg_ind_cnt) =     cnt_mat(jm)
-                  !zrmet_min(    reg_ind_cnt) =     min_mat(jm)
-                  !zrmet_max(    reg_ind_cnt) =     max_mat(jm)
-                  zrmet_reg_id( reg_ind_cnt) =  reg_id_mat(jm)
-                  zrmet_mask_id(reg_ind_cnt) = mask_id_mat(jm)
-                
-                  reg_ind_cnt = reg_ind_cnt + 1 
-              END DO
-          
-          ENDIF
+          ! JT Fixed, was not meant to be inside the lwp if block
+          DO jm = 1,nreg
+              zrmet_ave(    reg_ind_cnt) =     ave_mat(jm)
+              zrmet_tot(    reg_ind_cnt) =     tot_mat(jm)
+              zrmet_var(    reg_ind_cnt) =     var_mat(jm)
+              zrmet_cnt(    reg_ind_cnt) =     cnt_mat(jm)
+              !zrmet_min(    reg_ind_cnt) =     min_mat(jm)
+              !zrmet_max(    reg_ind_cnt) =     max_mat(jm)
+              zrmet_reg_id( reg_ind_cnt) =  reg_id_mat(jm)
+              zrmet_mask_id(reg_ind_cnt) = mask_id_mat(jm)
+            
+              reg_ind_cnt = reg_ind_cnt + 1 
+          END DO
+      
         
           IF(lwp .AND. verbose) WRITE(numout,*) 'dia_regmean about to deallocated arrays for ',kt,maskno
@@ -1186,5 +1187,5 @@
       IF ( ln_diaregmean_nc ) THEN
       
-          zrmet_out(:,:,:) = 0
+          zrmet_out(:) = 0
           zrmet_val = 0
           tmp_name_iom = ''
@@ -1199,9 +1200,9 @@
     !            if (zrmet_val .GT. 1e16) zrmet_val = 1e16
                 if (zrmet_val .NE. zrmet_val) zrmet_val = 1e20
-                zrmet_out(:,:,jm) = zrmet_val
+                zrmet_out(jm) = zrmet_val
               END DO      
-              IF(lwp .AND. verbose) WRITE(numout,*) 'dia_regmean iom_put tmp_name_iom : ',trim(tmp_name_iom), zrmet_out(1,1,1)
-              CALL iom_put(trim(tmp_name_iom), zrmet_out ) !zrmet_out(1,1,:) ) )
-              zrmet_out(:,:,:) = 0
+              IF(lwp .AND. verbose) WRITE(numout,*) 'dia_regmean iom_put tmp_name_iom : ',trim(tmp_name_iom), zrmet_out(1)
+              CALL iom_put(trim(tmp_name_iom), zrmet_out(:) ) 
+              zrmet_out(:) = 0
               zrmet_val = 0
               tmp_name_iom = ''
@@ -1215,9 +1216,9 @@
     !            if (zrmet_val .GT. 1e16) zrmet_val = 1e16
                 if (zrmet_val .NE. zrmet_val) zrmet_val = 1e20
-                zrmet_out(:,:,jm) = zrmet_val
+                zrmet_out(jm) = zrmet_val
               END DO
-              IF(lwp .AND. verbose) WRITE(numout,*) 'dia_regmean iom_put tmp_name_iom : ',trim(tmp_name_iom), zrmet_out(1,1,1)
-              CALL iom_put( trim(tmp_name_iom), zrmet_out ) !zrmet_out(1,1,:) ) )
-              zrmet_out(:,:,:) = 0
+              IF(lwp .AND. verbose) WRITE(numout,*) 'dia_regmean iom_put tmp_name_iom : ',trim(tmp_name_iom), zrmet_out(1)
+              CALL iom_put( trim(tmp_name_iom), zrmet_out(:) ) 
+              zrmet_out(:) = 0
               zrmet_val = 0
               tmp_name_iom = ''
@@ -1231,9 +1232,9 @@
     !            if (zrmet_val .GT. 1e16) zrmet_val = 1e16
                 if (zrmet_val .NE. zrmet_val) zrmet_val = 1e20
-                zrmet_out(:,:,jm) = zrmet_val
+                zrmet_out(jm) = zrmet_val
               END DO
-              IF(lwp .AND. verbose) WRITE(numout,*) 'dia_regmean iom_put tmp_name_iom : ',trim(tmp_name_iom), zrmet_out(1,1,1)
-              CALL iom_put( trim(tmp_name_iom), zrmet_out ) !zrmet_out(1,1,:) ) )
-              zrmet_out(:,:,:) = 0
+              IF(lwp .AND. verbose) WRITE(numout,*) 'dia_regmean iom_put tmp_name_iom : ',trim(tmp_name_iom), zrmet_out(1)
+              CALL iom_put( trim(tmp_name_iom), zrmet_out(:) )
+              zrmet_out(:) = 0
               zrmet_val = 0
               tmp_name_iom = ''
@@ -1247,9 +1248,9 @@
     !            if (zrmet_val .GT. 1e16) zrmet_val = 1e16
                 if (zrmet_val .NE. zrmet_val) zrmet_val = 1e20
-                zrmet_out(:,:,jm) = zrmet_val
+                zrmet_out(jm) = zrmet_val
               END DO
-              IF(lwp .AND. verbose) WRITE(numout,*) 'dia_regmean iom_put tmp_name_iom : ',trim(tmp_name_iom), zrmet_out(1,1,1)
-              CALL iom_put( trim(tmp_name_iom), zrmet_out ) !zrmet_out(1,1,:) ) )
-              zrmet_out(:,:,:) = 0
+              IF(lwp .AND. verbose) WRITE(numout,*) 'dia_regmean iom_put tmp_name_iom : ',trim(tmp_name_iom), zrmet_out(1)
+              CALL iom_put( trim(tmp_name_iom), zrmet_out(:) )
+              zrmet_out(:) = 0
               zrmet_val = 0
               tmp_name_iom = ''
@@ -1263,9 +1264,9 @@
     !            if (zrmet_val .GT. 1e16) zrmet_val = 1e16
                 if (zrmet_val .NE. zrmet_val) zrmet_val = 1e20
-                zrmet_out(:,:,jm) = zrmet_val
+                zrmet_out(jm) = zrmet_val
               END DO
-              IF(lwp .AND. verbose) WRITE(numout,*) 'dia_regmean iom_put tmp_name_iom : ',trim(tmp_name_iom), zrmet_out(1,1,1)
-              CALL iom_put( trim(tmp_name_iom), zrmet_out ) !zrmet_out(1,1,:) ) )
-              zrmet_out(:,:,:) = 0
+              IF(lwp .AND. verbose) WRITE(numout,*) 'dia_regmean iom_put tmp_name_iom : ',trim(tmp_name_iom), zrmet_out(1)
+              CALL iom_put( trim(tmp_name_iom), zrmet_out(:) ) 
+              zrmet_out(:) = 0
               zrmet_val = 0
               tmp_name_iom = ''
@@ -1279,9 +1280,9 @@
     !            if (zrmet_val .GT. 1e16) zrmet_val = 1e16
                 if (zrmet_val .NE. zrmet_val) zrmet_val = 1e20
-                zrmet_out(:,:,jm) = zrmet_val
+                zrmet_out(jm) = zrmet_val
               END DO
               IF(lwp .AND. verbose) WRITE(numout,*) 'dia_regmean iom_put tmp_name_iom : ',trim(tmp_name_iom)          
-              CALL iom_put( trim(tmp_name_iom), zrmet_out ) !zrmet_out(1,1,:) ) )
-              zrmet_out(:,:,:) = 0
+              CALL iom_put( trim(tmp_name_iom), zrmet_out(:) )
+              zrmet_out(:) = 0
               zrmet_val = 0
               tmp_name_iom = ''
