[1224] | 1 | module 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 | |
---|
| 16 | contains |
---|
| 17 | |
---|
| 18 | subroutine ini_turb_mod(ngrid,nlayer) |
---|
| 19 | |
---|
| 20 | implicit none |
---|
| 21 | integer,intent(in) :: ngrid ! number of atmospheric columns |
---|
| 22 | integer,intent(in) :: nlayer ! number of atmospheric layers |
---|
| 23 | |
---|
| 24 | allocate(q2(ngrid,nlayer+1)) |
---|
| 25 | allocate(l0(ngrid)) |
---|
| 26 | allocate(wstar(ngrid)) |
---|
[1236] | 27 | allocate(ustar(ngrid)) |
---|
[1242] | 28 | allocate(tstar(ngrid)) |
---|
[1224] | 29 | allocate(hfmax_th(ngrid)) |
---|
[1236] | 30 | allocate(zmax_th(ngrid)) |
---|
| 31 | allocate(sensibFlux(ngrid)) |
---|
| 32 | |
---|
[1224] | 33 | end subroutine ini_turb_mod |
---|
| 34 | |
---|
[1770] | 35 | subroutine end_turb_mod |
---|
| 36 | |
---|
| 37 | implicit none |
---|
| 38 | |
---|
| 39 | if (allocated(q2)) deallocate(q2) |
---|
| 40 | if (allocated(l0)) deallocate(l0) |
---|
| 41 | if (allocated(wstar)) deallocate(wstar) |
---|
| 42 | if (allocated(ustar)) deallocate(ustar) |
---|
| 43 | if (allocated(tstar)) deallocate(tstar) |
---|
| 44 | if (allocated(hfmax_th)) deallocate(hfmax_th) |
---|
| 45 | if (allocated(zmax_th)) deallocate(zmax_th) |
---|
| 46 | if (allocated(sensibFlux)) deallocate(sensibFlux) |
---|
| 47 | |
---|
| 48 | end subroutine end_turb_mod |
---|
| 49 | |
---|
[1224] | 50 | end module turb_mod |
---|