module turb_mod !! variables REAL,SAVE,ALLOCATABLE :: q2(:,:) ! Turbulent Kinetic Energy !$OMP THREADPRIVATE(q2) REAL,SAVE,ALLOCATABLE :: sens(:) !$OMP THREADPRIVATE(sens) REAL,allocatable,SAVE :: l0(:) ! Characteristic mixing length !$OMP THREADPRIVATE(l0) REAL,SAVE,ALLOCATABLE :: yustar(:) !$OMP THREADPRIVATE(yustar) REAL,SAVE,ALLOCATABLE :: wstar(:) !$OMP THREADPRIVATE(wstar) REAL,SAVE,ALLOCATABLE :: tstar(:) !$OMP THREADPRIVATE(tstar) REAL,SAVE,ALLOCATABLE :: hfmax_th(:) !$OMP THREADPRIVATE(hfmax_th) REAL,SAVE,ALLOCATABLE :: zmax_th(:) !$OMP THREADPRIVATE(zmax_th) ! REAL,SAVE,ALLOCATABLE :: sensibFlux(:) LOGICAL :: turb_resolved = .false. ! this is a flag to say 'turbulence is resolved' ! mostly for LES use. default is FALSE (for GCM and mesoscale) !$OMP THREADPRIVATE(turb_resolved) contains subroutine ini_turb_mod(ngrid,nlayer) implicit none integer,intent(in) :: ngrid ! number of atmospheric columns integer,intent(in) :: nlayer ! number of atmospheric layers allocate(q2(ngrid,nlayer+1)) allocate(sens(ngrid)) allocate(l0(ngrid)) allocate(wstar(ngrid)) allocate(yustar(ngrid)) allocate(tstar(ngrid)) allocate(hfmax_th(ngrid)) allocate(zmax_th(ngrid)) ! allocate(sensibFlux(ngrid)) end subroutine ini_turb_mod subroutine end_turb_mod implicit none if (allocated(q2)) deallocate(q2) if (allocated(sens)) deallocate(sens) if (allocated(l0)) deallocate(l0) if (allocated(wstar)) deallocate(wstar) if (allocated(yustar)) deallocate(yustar) if (allocated(tstar)) deallocate(tstar) if (allocated(hfmax_th)) deallocate(hfmax_th) if (allocated(zmax_th)) deallocate(zmax_th) ! if (allocated(sensibFlux)) deallocate(sensibFlux) end subroutine end_turb_mod end module turb_mod