!     !!!!!!!!!!!!!!!
      subroutine downscaling(u500,v500,t500,t850,t1000,z500,z1000,&
                         msl_si,msl_lr,q700,lon_hr,lat_hr,prec_hr,&
                         pathsig,sigdim,nanx,neni,&
                         ngridd,nlat,nlon,ic,nlatt,nlont,id,slat,slon,&
                         rlat,rlon,slatt,slont,nd)

!     !!!!!!!!!!!!!!!
!*       0.   DECLARATIONS
!             ------------
!
! MODULES with constants and functions
use mod_csts
use mod_funcs

implicit none

CHARACTER(LEN=100),SAVE :: datapath="/lustre/utmp/cle/ERAIN/"
CHARACTER(LEN=100),SAVE :: obspath="/lustre/utmp/cle/REJ5/"
CHARACTER(LEN=100),SAVE :: trainpath="/lustre/utmp/cle/train/"
!!!!!!!!!!!!!!!!!!!!!!!!
! INPUT ARGUMENTS
!!!!!!!!!!!!!!!!!!!!!!!!
!***********************************************
! DOMAIN variables 
!************************************************
! sinoptic grid
integer, intent(in) :: nlat
integer, intent(in) :: nlon
integer, intent(in) :: ic
!-----------------------------------------------
! low resolution grid
integer, intent(in) :: nlatt
integer, intent(in) :: nlont
integer, intent(in) :: id
!------------------------------------------------
double precision, intent(in) :: slat
double precision, intent(in) :: slon
double precision, intent(in) :: rlat
double precision, intent(in) :: rlon
!------------------------------------------------
double precision, intent(in) :: slatt
double precision, intent(in) :: slont
!------------------------------------------------
!!!!!!!!!!!!!!!!!!!!!!!!
! TIME variables
integer, intent(in) :: nd
!------------------------------------------------

call ptos_ref_4(ic,x,y,xcand,ycand,Vdmin,Vref)

call down_prec(ic,id,nd,nm,nlat,nlon,nlatt,nlont,slat,slon,rlat,rlon,&
                     slatt,slont,trainpath,obspath,datapath)
END

