zdf_oce.F90 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. MODULE zdf_oce
  2. !!======================================================================
  3. !! *** MODULE zdf_oce ***
  4. !! Ocean physics : define vertical mixing variables
  5. !!=====================================================================
  6. !! history : 1.0 ! 2002-06 (G. Madec) Original code
  7. !! 3.2 ! 2009-07 (G.Madec) addition of avm
  8. !!----------------------------------------------------------------------
  9. USE par_oce ! ocean parameters
  10. USE in_out_manager ! I/O manager
  11. USE lib_mpp ! MPP library
  12. IMPLICIT NONE
  13. PRIVATE
  14. PUBLIC zdf_oce_alloc ! Called in nemogcm.F90
  15. #if defined key_zdfcst || defined key_esopa
  16. LOGICAL, PARAMETER, PUBLIC :: lk_zdfcst = .TRUE. !: constant vertical mixing flag
  17. #else
  18. LOGICAL, PARAMETER, PUBLIC :: lk_zdfcst = .FALSE. !: constant vertical mixing flag
  19. #endif
  20. ! !!* namelist namzdf: vertical diffusion *
  21. REAL(wp), PUBLIC :: rn_avm0 !: vertical eddy viscosity (m2/s)
  22. REAL(wp), PUBLIC :: rn_avt0 !: vertical eddy diffusivity (m2/s)
  23. INTEGER , PUBLIC :: nn_avb !: constant or profile background on avt (=0/1)
  24. INTEGER , PUBLIC :: nn_havtb !: horizontal shape or not for avtb (=0/1)
  25. LOGICAL , PUBLIC :: ln_zdfexp !: explicit vertical diffusion scheme flag
  26. INTEGER , PUBLIC :: nn_zdfexp !: number of sub-time step (explicit time stepping)
  27. LOGICAL , PUBLIC :: ln_zdfevd !: convection: enhanced vertical diffusion flag
  28. INTEGER , PUBLIC :: nn_evdm !: =0/1 flag to apply enhanced avm or not
  29. REAL(wp), PUBLIC :: rn_avevd !: vertical eddy coeff. for enhanced vert. diff. (m2/s)
  30. LOGICAL , PUBLIC :: ln_zdfnpc !: convection: non-penetrative convection flag
  31. INTEGER , PUBLIC :: nn_npc !: non penetrative convective scheme call frequency
  32. INTEGER , PUBLIC :: nn_npcp !: non penetrative convective scheme print frequency
  33. REAL(wp), PUBLIC, SAVE, ALLOCATABLE, DIMENSION(:) :: avmb , avtb !: background profile of avm and avt
  34. REAL(wp), PUBLIC, SAVE, ALLOCATABLE, DIMENSION(:,:) :: avtb_2d !: horizontal shape of background Kz profile
  35. REAL(wp), PUBLIC, SAVE, ALLOCATABLE, DIMENSION(:,:) :: bfrua, bfrva !: Bottom friction coefficients set in zdfbfr
  36. REAL(wp), PUBLIC, SAVE, ALLOCATABLE, DIMENSION(:,:) :: tfrua, tfrva !: top friction coefficients set in zdfbfr
  37. REAL(wp), PUBLIC, SAVE, ALLOCATABLE, DIMENSION(:,:,:) :: avmu , avmv !: vertical viscosity coef at uw- & vw-pts [m2/s]
  38. REAL(wp), PUBLIC, SAVE, ALLOCATABLE, DIMENSION(:,:,:) :: avm , avt !: vertical viscosity & diffusivity coef at w-pt [m2/s]
  39. REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: avt_k , avm_k ! not enhanced Kz
  40. REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: avmu_k, avmv_k ! not enhanced Kz
  41. REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: en !: now turbulent kinetic energy [m2/s2]
  42. !!----------------------------------------------------------------------
  43. !! NEMO/OPA 4.0 , NEMO Consortium (2011)
  44. !! $Id: zdf_oce.F90 4990 2014-12-15 16:42:49Z timgraham $
  45. !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt)
  46. !!----------------------------------------------------------------------
  47. CONTAINS
  48. INTEGER FUNCTION zdf_oce_alloc()
  49. !!----------------------------------------------------------------------
  50. !! *** FUNCTION zdf_oce_alloc ***
  51. !!----------------------------------------------------------------------
  52. !
  53. ALLOCATE(avmb(jpk) , bfrua(jpi,jpj) , &
  54. & avtb(jpk) , bfrva(jpi,jpj) , avtb_2d(jpi,jpj) , &
  55. & tfrua(jpi, jpj), tfrva(jpi, jpj) , &
  56. & avmu(jpi,jpj,jpk), avm(jpi,jpj,jpk) , &
  57. & avmv (jpi,jpj,jpk), avt (jpi,jpj,jpk) , &
  58. & avt_k (jpi,jpj,jpk), avm_k (jpi,jpj,jpk) , &
  59. & avmu_k(jpi,jpj,jpk), avmv_k(jpi,jpj,jpk) , &
  60. & en (jpi,jpj,jpk), STAT = zdf_oce_alloc )
  61. !
  62. IF( zdf_oce_alloc /= 0 ) CALL ctl_warn('zdf_oce_alloc: failed to allocate arrays')
  63. !
  64. END FUNCTION zdf_oce_alloc
  65. !!======================================================================
  66. END MODULE zdf_oce