copyright (C) 2001  MSC-RPN COMM  %%%MC2%%%
***s/r phytsk -- Takes care of the multitasking
*

      subroutine phytsk (kount,geobus,bus_o,nis,njs,nks) 2,2
      implicit none
*
      integer kount,nis,njs,nks
      real geobus(*),bus_o(*)
*
*AUTHOR   Robert Benoit / Michel Desgagne     Apr   1993
*
*REVISION
*001      B. Bilodeau (Feb 1999) - Entry bus
*
*LANGUAGE   Fortran 77
*
*OBJECT (phytsk)
*     This routine is taking care of the multitasking coordination.
*     All common must therefore be initializes before calling physlb.
*
*FILES
*
*ARGUMENTS
*    NAMES     I/O  TYPE  A/S        DESCRIPTION
*    geobus     I    R     A  Geophysical fields from the analysis
*    kount      I     I    S  timestep
*    nis        I     I    S  first horizontal dimension
*    njs        I     I    S  second horizontal dimension
*    nks        I     I    S  vertical dimension
*
*IMPLICIT
*
#include "lesbus.cdk"
#include "physcom.cdk"
#include "physnml.cdk"
#include "lcldim.cdk"
#include "lun.cdk"
#include "phymem.cdk"
#include "partopo.cdk"
#include "nbcpu.cdk"
*
*MODULES
*
**
      integer  open_db_file,close_db_file,rewind_db_file
      external open_db_file,close_db_file,rewind_db_file
*
      integer njdone,i,j,icpu,err,xnerr,id,mul,cnt
*
*----------------------------------------------------------------------
*
      njdone=0
*
      call serset('HEURE',kount*dt/3600.,1,xnerr)
*
      if (.not.incore) then
         xnerr = open_db_file   (un_gbusper)
         xnerr = rewind_db_file (un_gbusper)
      endif
*
!$omp parallel
!$omp do
      do icpu=1,npeOpenMP
      call physlb (icpu,njdone,kount,
     $          fu0,fv0,fsw0,ft0,fes0,fcl0,fum,fvm,ftm,fesm,fhtm,fclm,
     $          ttrad,tugwd,tvgwd,thudifv,ttdifv,tudifv,tvdifv,twdifv,
     $          thucond,ttcond,cltend,lebus,geobus,
     $          bus_o,prt,sfcpsm,area,nis,njs,nks)
      end do
!$omp enddo
!$omp end parallel
*
      if (.not.incore) then
         xnerr = close_db_file (un_gbusper)
      endif
*
*----------------------------------------------------------------------
      return
      end