subroutine scalefe (pscale)

!*** *SCALEAE*

!   Purpose.
!   --------
!      To multiply the variances of background
!      error in yomfceb by 'pscale'.

!   Interface.
!   ----------

!      CALL SCALEFE (PSCALE)

!   Externals.
!   ----------
!      SC2RDG
!      SC2WRG

!   Reference.
!   ----------

!   Author.
!   -------
!      Mike Fisher *ECMWF*

!   Modifications.
!   --------------
!      Original   98-06-23
!        M.Hamrud      01-Oct-2003 CY28 Cleaning
!        M.Hamrud      10-Jan-2004 CY28R1 Cleaning

!-----------------------------------------------------------------------

USE PARKIND1  ,ONLY : JPIM     ,JPRB
USE YOMHOOK   ,ONLY : LHOOK,   DR_HOOK
USE YOMDIM   , ONLY : NPROMA
USE YOMGEM   , ONLY : NGPTOT
USE YOMJG    , ONLY : NOFCEF
USE YOMFCEB  , ONLY : FCEBUF

IMPLICIT NONE

! * DUMMY:
REAL(KIND=JPRB)   ,INTENT(IN)    :: PSCALE 
REAL(KIND=JPRB) :: zfce(NPROMA,NOFCEF)

INTEGER(KIND=JPIM) :: iendc, istc, jk, jkglo, jf
REAL(KIND=JPRB) :: ZHOOK_HANDLE

#include "sc2rdg.intfb.h"
#include "sc2wrg.intfb.h"

!-----------------------------------------------------------------------

IF (LHOOK) CALL DR_HOOK('SCALEFE',0,ZHOOK_HANDLE)
do jkglo=1,NGPTOT,NPROMA
  istc=1
  iendc=min(NPROMA,NGPTOT-jkglo+1)
  call SC2RDG (FCEBUF,jkglo,istc,iendc,zfce)
  do jf=1,NOFCEF
    do jk=istc,iendc
      zfce(jk,jf)=pscale*zfce(jk,jf)
    enddo
  enddo
  call SC2WRG (FCEBUF,jkglo,istc,iendc,zfce)
enddo

IF (LHOOK) CALL DR_HOOK('SCALEFE',1,ZHOOK_HANDLE)
end subroutine scalefe
