dynspg_oce.F90 3.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. MODULE dynspg_oce
  2. !!======================================================================
  3. !! *** MODULE dynspg_oce ***
  4. !!
  5. !! Ocean dynamics: Define in memory some surface pressure gradient variables
  6. !!======================================================================
  7. !! History : 1.0 ! 2005-12 (C. Talandier, G. Madec) Original code
  8. !! 3.2 ! 2009-07 (R. Benshila) Suppression of rigid-lid option
  9. !!----------------------------------------------------------------------
  10. USE par_oce ! ocean parameters
  11. USE lib_mpp ! MPP library
  12. IMPLICIT NONE
  13. PUBLIC
  14. PUBLIC dynspg_oce_alloc ! called in dynspg.F90
  15. ! !!! Surface pressure gradient logicals
  16. #if defined key_dynspg_exp || defined key_esopa
  17. LOGICAL, PUBLIC, PARAMETER :: lk_dynspg_exp = .TRUE. !: Explicit free surface flag
  18. #else
  19. LOGICAL, PUBLIC, PARAMETER :: lk_dynspg_exp = .FALSE. !: Explicit free surface flag
  20. #endif
  21. #if defined key_dynspg_ts || defined key_esopa
  22. LOGICAL, PUBLIC, PARAMETER :: lk_dynspg_ts = .TRUE. !: Free surface with time splitting flag
  23. #else
  24. LOGICAL, PUBLIC, PARAMETER :: lk_dynspg_ts = .FALSE. !: Free surface with time splitting flag
  25. #endif
  26. #if defined key_dynspg_flt || defined key_esopa
  27. LOGICAL, PUBLIC, PARAMETER :: lk_dynspg_flt = .TRUE. !: Filtered free surface cst volume flag
  28. #else
  29. LOGICAL, PUBLIC, PARAMETER :: lk_dynspg_flt = .FALSE. !: Filtered free surface cst volume flag
  30. #endif
  31. ! !!! Time splitting scheme (key_dynspg_ts)
  32. REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: sshn_e, ssha_e ! sea surface heigth (now, after)
  33. REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: ua_e , va_e ! barotropic velocities (after)
  34. REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: hu_e , hv_e ! now ocean depth ( = Ho+sshn_e )
  35. REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: hur_e , hvr_e ! inverse of hu_e and hv_e
  36. REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: un_adv, vn_adv ! Advection vel. at "now" barocl. step
  37. REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: ub2_b, vb2_b ! Half step fluxes (ln_bt_fw=T)
  38. #if defined key_agrif
  39. REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: ub2_i_b, vb2_i_b! Half step time integrated fluxes
  40. #endif
  41. !!----------------------------------------------------------------------
  42. !! NEMO/OPA 4.0 , NEMO Consortium (2011)
  43. !! $Id: dynspg_oce.F90 4486 2014-02-05 11:23:56Z jchanut $
  44. !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt)
  45. !!----------------------------------------------------------------------
  46. CONTAINS
  47. INTEGER FUNCTION dynspg_oce_alloc()
  48. !!----------------------------------------------------------------------
  49. !! *** routine dynspg_oce_alloc ***
  50. !!----------------------------------------------------------------------
  51. ALLOCATE( sshn_e(jpi,jpj) , ua_e(jpi,jpj) , hu_e(jpi,jpj) , hur_e(jpi,jpj) , &
  52. & ssha_e(jpi,jpj) , va_e(jpi,jpj) , hv_e(jpi,jpj) , hvr_e(jpi,jpj) , &
  53. & ub2_b(jpi,jpj) , vb2_b(jpi,jpj) , &
  54. #if defined key_agrif
  55. & ub2_i_b(jpi,jpj), vb2_i_b(jpi,jpj) , &
  56. #endif
  57. & un_adv(jpi,jpj) , vn_adv(jpi,jpj) , STAT = dynspg_oce_alloc )
  58. !
  59. IF( lk_mpp ) CALL mpp_sum ( dynspg_oce_alloc )
  60. IF( dynspg_oce_alloc /= 0 ) CALL ctl_warn('dynspg_oce_alloc: failed to allocate arrays')
  61. !
  62. END FUNCTION dynspg_oce_alloc
  63. !!======================================================================
  64. END MODULE dynspg_oce