source: trunk/LMDZ.VENUS/libf/phyvenus/turb_mod.F90 @ 3094

Last change on this file since 3094 was 2534, checked in by emillour, 4 years ago

Venus GCM:
Some cosmetics in routines, along with adding the possibility to read/write q2 from/to startphy.nc/restartsphy.nc (not really used, but in preparation of future commits).
VB+EM

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