!-------------------------------------- LICENCE BEGIN ------------------------------------
!Environment Canada - Atmospheric Science and Technology License/Disclaimer,
!                     version 3; Last Modified: May 7, 2008.
!This is free but copyrighted software; you can use/redistribute/modify it under the terms
!of the Environment Canada - Atmospheric Science and Technology License/Disclaimer
!version 3 or (at your option) any later version that should be found at:
!http://collaboration.cmc.ec.gc.ca/science/rpn.comm/license.html
!
!This software is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
!without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
!See the above mentioned License/Disclaimer for more details.
!You should have received a copy of the License/Disclaimer along with this software;
!if not, you can write to: EC-RPN COMM Group, 2121 TransCanada, suite 500, Dorval (Quebec),
!CANADA, H9P 1J3; or send e-mail to service.rpn@ec.gc.ca
!-------------------------------------- LICENCE END --------------------------------------
!

      subroutine sym_hemis(ldhemis) 2
#if defined (DOC)
*
*Author  : L. Fillion - ARMA/EC - 18 Jun 2010. - Symmetrize GD w.r.t equator. Keep NH info.
*Revision: 
*
*
*    -------------------
**    Purpose: to estimate the forecast error correlation from an
*     .        ensemble of forecast differences; e.g. 12-24h valid at the same time; i.e. the NMC method.
*Arguments
*     kulstat  =
*     koutfile =
#endif
      IMPLICIT NONE
*implicits
#include "taglam4d.cdk"
#include "pardim.cdk"
#include "comdim.cdk"
#include "comlun.cdk"
#include "comgd0.cdk"
*
      character*2 ldhemis
      integer ji,jj,jk1
      logical ldhelm,ldfplane,ldtb_psi,ldcoriol_one
      INTEGER KULSTAT, koutfile
!
      INTEGER myid,numthd,omp_get_thread_num,omp_get_num_threads
      INTEGER FNOM, FSTOUV, FSTFRM, FCLOS, FSTPRM, FSTINF, FSTINL
!
!!
!
      if(ldhemis.eq.'NH') then
        do jj = 1,nj/2-1
          do ji = 1, ni
            do jk1 = 1, nflev
              ut0(ji,jk1,nj-jj+1) = ut0(ji,jk1,jj)
              vt0(ji,jk1,nj-jj+1) = vt0(ji,jk1,jj)
              tt0(ji,jk1,nj-jj+1) = tt0(ji,jk1,jj)
              q0(ji,jk1,nj-jj+1) = q0(ji,jk1,jj)
            enddo
            gps0(ji,1,nj-jj+1) = gps0(ji,1,jj)
            gtg0(ji,1,nj-jj+1) = gtg0(ji,1,jj)
          enddo
        enddo
      else if(ldhemis.eq.'SH') then
        do jj = 1,nj/2-1
          do ji = 1, ni
            do jk1 = 1, nflev
              ut0(ji,jk1,jj) = ut0(ji,jk1,nj-jj+1)
              vt0(ji,jk1,jj) = vt0(ji,jk1,nj-jj+1)
              tt0(ji,jk1,jj) = tt0(ji,jk1,nj-jj+1)
              q0(ji,jk1,jj) = q0(ji,jk1,nj-jj+1)
            enddo
            gps0(ji,1,jj) = gps0(ji,1,nj-jj+1)
            gtg0(ji,1,jj) = gtg0(ji,1,nj-jj+1)
          enddo
        enddo
      endif
!
      write(nulout,*) 'sym_hemis: END'
!
      return
      end