| 1 | module turb_mod |
|---|
| 2 | |
|---|
| 3 | !! variables |
|---|
| 4 | REAL,SAVE,ALLOCATABLE :: q2(:,:) ! Turbulent Kinetic Energy |
|---|
| 5 | !$OMP THREADPRIVATE(q2) |
|---|
| 6 | REAL,SAVE,ALLOCATABLE :: sens(:) |
|---|
| 7 | !$OMP THREADPRIVATE(sens) |
|---|
| 8 | REAL,allocatable,SAVE :: l0(:) ! Characteristic mixing length |
|---|
| 9 | !$OMP THREADPRIVATE(l0) |
|---|
| 10 | REAL,SAVE,ALLOCATABLE :: yustar(:) |
|---|
| 11 | !$OMP THREADPRIVATE(yustar) |
|---|
| 12 | REAL,SAVE,ALLOCATABLE :: wstar(:) |
|---|
| 13 | !$OMP THREADPRIVATE(wstar) |
|---|
| 14 | REAL,SAVE,ALLOCATABLE :: tstar(:) |
|---|
| 15 | !$OMP THREADPRIVATE(tstar) |
|---|
| 16 | REAL,SAVE,ALLOCATABLE :: hfmax_th(:) |
|---|
| 17 | !$OMP THREADPRIVATE(hfmax_th) |
|---|
| 18 | REAL,SAVE,ALLOCATABLE :: zmax_th(:) |
|---|
| 19 | !$OMP THREADPRIVATE(zmax_th) |
|---|
| 20 | ! REAL,SAVE,ALLOCATABLE :: sensibFlux(:) |
|---|
| 21 | LOGICAL :: turb_resolved = .false. |
|---|
| 22 | ! this is a flag to say 'turbulence is resolved' |
|---|
| 23 | ! mostly for LES use. default is FALSE (for GCM and mesoscale) |
|---|
| 24 | !$OMP THREADPRIVATE(turb_resolved) |
|---|
| 25 | |
|---|
| 26 | contains |
|---|
| 27 | |
|---|
| 28 | subroutine ini_turb_mod(ngrid,nlayer) |
|---|
| 29 | |
|---|
| 30 | implicit none |
|---|
| 31 | integer,intent(in) :: ngrid ! number of atmospheric columns |
|---|
| 32 | integer,intent(in) :: nlayer ! number of atmospheric layers |
|---|
| 33 | |
|---|
| 34 | allocate(q2(ngrid,nlayer+1)) |
|---|
| 35 | allocate(sens(ngrid)) |
|---|
| 36 | allocate(l0(ngrid)) |
|---|
| 37 | allocate(wstar(ngrid)) |
|---|
| 38 | allocate(yustar(ngrid)) |
|---|
| 39 | allocate(tstar(ngrid)) |
|---|
| 40 | allocate(hfmax_th(ngrid)) |
|---|
| 41 | allocate(zmax_th(ngrid)) |
|---|
| 42 | ! allocate(sensibFlux(ngrid)) |
|---|
| 43 | |
|---|
| 44 | end subroutine ini_turb_mod |
|---|
| 45 | |
|---|
| 46 | subroutine end_turb_mod |
|---|
| 47 | |
|---|
| 48 | implicit none |
|---|
| 49 | |
|---|
| 50 | if (allocated(q2)) deallocate(q2) |
|---|
| 51 | if (allocated(sens)) deallocate(sens) |
|---|
| 52 | if (allocated(l0)) deallocate(l0) |
|---|
| 53 | if (allocated(wstar)) deallocate(wstar) |
|---|
| 54 | if (allocated(yustar)) deallocate(yustar) |
|---|
| 55 | if (allocated(tstar)) deallocate(tstar) |
|---|
| 56 | if (allocated(hfmax_th)) deallocate(hfmax_th) |
|---|
| 57 | if (allocated(zmax_th)) deallocate(zmax_th) |
|---|
| 58 | ! if (allocated(sensibFlux)) deallocate(sensibFlux) |
|---|
| 59 | |
|---|
| 60 | end subroutine end_turb_mod |
|---|
| 61 | |
|---|
| 62 | |
|---|
| 63 | end module turb_mod |
|---|