ldfdyn_oce.F90 3.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. MODULE ldfdyn_oce
  2. !!======================================================================
  3. !! *** MODULE ldfdyn_oce ***
  4. !! Ocean physics: lateral momentum mixing coefficient defined in memory
  5. !!======================================================================
  6. !! History : 1.0 ! 2002-11 (G. Madec) F90: Free form and module
  7. !!----------------------------------------------------------------------
  8. USE par_oce ! ocean parameters
  9. USE in_out_manager ! I/O manager
  10. USE lib_mpp ! MPP library
  11. IMPLICIT NONE
  12. PUBLIC
  13. ! !!* Namelist namdyn_ldf : lateral mixing *
  14. LOGICAL , PUBLIC :: ln_dynldf_lap !: laplacian operator
  15. LOGICAL , PUBLIC :: ln_dynldf_bilap !: bilaplacian operator
  16. LOGICAL , PUBLIC :: ln_dynldf_level !: iso-level direction
  17. LOGICAL , PUBLIC :: ln_dynldf_hor !: horizontal (geopotential) direction
  18. LOGICAL , PUBLIC :: ln_dynldf_iso !: iso-neutral direction
  19. REAL(wp), PUBLIC :: rn_ahm_0_lap !: lateral laplacian eddy viscosity (m2/s)
  20. REAL(wp), PUBLIC :: rn_ahmb_0 !: lateral laplacian background eddy viscosity (m2/s)
  21. REAL(wp), PUBLIC :: rn_ahm_0_blp !: lateral bilaplacian eddy viscosity (m4/s)
  22. REAL(wp), PUBLIC :: ahm0, ahmb0, ahm0_blp !: OLD namelist names
  23. REAL(wp), PUBLIC :: rn_cmsmag_1 !: constant in laplacian Smagorinsky viscosity
  24. REAL(wp), PUBLIC :: rn_cmsmag_2 !: constant in bilaplacian Smagorinsky viscosity
  25. REAL(wp), PUBLIC :: rn_cmsh !: 1 or 0 , if 0 -use only shear for Smagorinsky viscosity
  26. REAL(wp), PUBLIC :: rn_ahm_m_blp !: upper limit for bilap abs(ahm) < min( dx^4/128rdt, rn_ahm_m_blp)
  27. REAL(wp), PUBLIC :: rn_ahm_m_lap !: upper limit for lap ahm < min(dx^2/16rdt, rn_ahm_m_lap)
  28. INTEGER , PUBLIC :: nkahm_smag = 0 !:
  29. ! !!! eddy coeff. at U-,V-,W-pts [m2/s]
  30. #if defined key_dynldf_c3d
  31. REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: ahm1, ahm2, ahm3, ahm4 !: ** 3D coefficients **
  32. #elif defined key_dynldf_c2d
  33. REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: ahm1, ahm2, ahm3, ahm4 !: ** 2D coefficients **
  34. #elif defined key_dynldf_c1d
  35. REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:) :: ahm1, ahm2, ahm3, ahm4 !: ** 2D coefficients **
  36. #else
  37. REAL(wp), PUBLIC :: ahm1, ahm2, ahm3, ahm4 !: ** 0D coefficients **
  38. #endif
  39. !!----------------------------------------------------------------------
  40. !! NEMO/OPA 4.0 , NEMO Consortium (2011)
  41. !! $Id: ldfdyn_oce.F90 4147 2013-11-04 11:51:55Z cetlod $
  42. !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt)
  43. !!----------------------------------------------------------------------
  44. CONTAINS
  45. INTEGER FUNCTION ldfdyn_oce_alloc()
  46. !!----------------------------------------------------------------------
  47. !! *** FUNCTION ldfdyn_oce_alloc ***
  48. !!----------------------------------------------------------------------
  49. ldfdyn_oce_alloc = 0
  50. #if defined key_dynldf_c3d
  51. ALLOCATE( ahm1(jpi,jpj,jpk) , ahm2(jpi,jpj,jpk) , ahm3(jpi,jpj,jpk) , ahm4(jpi,jpj,jpk) , STAT=ldfdyn_oce_alloc )
  52. #elif defined key_dynldf_c2d
  53. ALLOCATE( ahm1(jpi,jpj ) , ahm2(jpi,jpj ) , ahm3(jpi,jpj ) , ahm4(jpi,jpj ) , STAT=ldfdyn_oce_alloc )
  54. #elif defined key_dynldf_c1d
  55. ALLOCATE( ahm1( jpk) , ahm2( jpk) , ahm3( jpk) , ahm4( jpk) , STAT=ldfdyn_oce_alloc )
  56. #endif
  57. IF( ldfdyn_oce_alloc /= 0 ) CALL ctl_warn('ldfdyn_oce_alloc: failed to allocate arrays')
  58. !
  59. END FUNCTION ldfdyn_oce_alloc
  60. !!======================================================================
  61. END MODULE ldfdyn_oce