source: trunk/LMDZ.MARS/libf/phymars/turb_mod.F90 @ 2616

Last change on this file since 2616 was 2578, checked in by romain.vande, 3 years ago

First stage of implementing Open_MP in the physic.
So far it can initialyse physic and run with all routines at .FALSE.

File size: 1.5 KB
Line 
1module turb_mod
2
3  !! variables
4  REAL,SAVE,ALLOCATABLE :: q2(:,:)    ! Turbulent Kinetic Energy
5  REAL,allocatable,SAVE :: l0(:)
6  REAL,SAVE,ALLOCATABLE :: ustar(:)
7  REAL,SAVE,ALLOCATABLE :: wstar(:)
8  REAL,SAVE,ALLOCATABLE :: tstar(:)
9  REAL,SAVE,ALLOCATABLE :: hfmax_th(:)
10  REAL,SAVE,ALLOCATABLE :: zmax_th(:)
11  REAL,SAVE,ALLOCATABLE :: sensibFlux(:)
12  LOGICAL :: turb_resolved = .false.
13      ! this is a flag to say 'turbulence is resolved'
14      ! mostly for LES use. default is FALSE (for GCM and mesoscale)
15
16!$OMP THREADPRIVATE(q2, l0,ustar,wstar,tstar,hfmax_th,zmax_th,     &
17!$OMP                sensibFlux)
18
19contains
20
21  subroutine ini_turb_mod(ngrid,nlayer)
22 
23  implicit none
24  integer,intent(in) :: ngrid ! number of atmospheric columns
25  integer,intent(in) :: nlayer ! number of atmospheric layers
26
27    allocate(q2(ngrid,nlayer+1))
28    allocate(l0(ngrid))
29    allocate(wstar(ngrid))
30    allocate(ustar(ngrid))
31    allocate(tstar(ngrid))
32    allocate(hfmax_th(ngrid))
33    allocate(zmax_th(ngrid))
34    allocate(sensibFlux(ngrid))
35
36  end subroutine ini_turb_mod
37
38  subroutine end_turb_mod
39
40  implicit none
41
42    if (allocated(q2)) deallocate(q2)
43    if (allocated(l0)) deallocate(l0)
44    if (allocated(wstar)) deallocate(wstar)
45    if (allocated(ustar)) deallocate(ustar)
46    if (allocated(tstar)) deallocate(tstar)
47    if (allocated(hfmax_th)) deallocate(hfmax_th)
48    if (allocated(zmax_th)) deallocate(zmax_th)
49    if (allocated(sensibFlux)) deallocate(sensibFlux)
50
51  end subroutine end_turb_mod
52
53end module turb_mod
Note: See TracBrowser for help on using the repository browser.