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

Last change on this file since 3400 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
RevLine 
[1224]1module turb_mod
2
3  !! variables
4  REAL,SAVE,ALLOCATABLE :: q2(:,:)    ! Turbulent Kinetic Energy
5  REAL,allocatable,SAVE :: l0(:)
[1236]6  REAL,SAVE,ALLOCATABLE :: ustar(:)
[1224]7  REAL,SAVE,ALLOCATABLE :: wstar(:)
[1242]8  REAL,SAVE,ALLOCATABLE :: tstar(:)
[1224]9  REAL,SAVE,ALLOCATABLE :: hfmax_th(:)
[1236]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)
[1224]15
[2578]16!$OMP THREADPRIVATE(q2, l0,ustar,wstar,tstar,hfmax_th,zmax_th,     &
17!$OMP                sensibFlux)
18
[1224]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))
[1236]30    allocate(ustar(ngrid))
[1242]31    allocate(tstar(ngrid))
[1224]32    allocate(hfmax_th(ngrid))
[1236]33    allocate(zmax_th(ngrid))
34    allocate(sensibFlux(ngrid))
35
[1224]36  end subroutine ini_turb_mod
37
[1770]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
[1224]53end module turb_mod
Note: See TracBrowser for help on using the repository browser.