dom_ice_2.F90 4.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. MODULE dom_ice_2
  2. !!======================================================================
  3. !! *** MODULE dom_ice ***
  4. !! LIM 2.0 Sea Ice : Domain variables
  5. !!======================================================================
  6. !! History : 2.0 ! 03-08 (C. Ethe) Free form and module
  7. !! 3.3 ! 2009-05 (G.Garric, C. Bricaud) addition of lim2_evp case
  8. !!----------------------------------------------------------------------
  9. #if defined key_lim2
  10. !!----------------------------------------------------------------------
  11. !! 'key_lim2' LIM2 sea-ice model
  12. !!----------------------------------------------------------------------
  13. !! NEMO/LIM2 3.3 , UCL - NEMO Consortium (2010)
  14. !! $Id: dom_ice_2.F90 3764 2013-01-23 14:33:04Z smasson $
  15. !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt)
  16. !!----------------------------------------------------------------------
  17. USE par_ice_2 ! LIM parameters
  18. IMPLICIT NONE
  19. PRIVATE
  20. PUBLIC dom_ice_alloc_2 ! Called from nemogcm.F90
  21. LOGICAL, PUBLIC :: l_jeq = .TRUE. !: Equator inside the domain flag
  22. INTEGER, PUBLIC :: njeq , njeqm1 !: j-index of the equator if it is inside the domain
  23. ! ! (otherwise = jpj+10 (SH) or -10 (SH) )
  24. REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: fs2cor , fcor !: coriolis factor and coeficient
  25. REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: covrai !: sine of geographic latitude
  26. REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: area !: surface of grid cell
  27. REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: tms , tmu !: temperature and velocity points masks
  28. REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:,:) :: wght !: weight of the 4 neighbours to compute averages
  29. REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: tmv !: y-velocity mask used for evp rheology
  30. REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:,:) :: akappa , bkappa !: first and third group of metric coefficients
  31. REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:,:,:,:) :: alambd !: second group of metric coefficients
  32. REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: tmf !: F-points masks
  33. REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: tmi !: ice mask: =1 if ice thick > 0
  34. !!----------------------------------------------------------------------
  35. CONTAINS
  36. INTEGER FUNCTION dom_ice_alloc_2()
  37. !!----------------------------------------------------------------------
  38. USE lib_mpp, ONLY: ctl_warn ! MPP library
  39. INTEGER :: ierr(2)
  40. !!----------------------------------------------------------------------
  41. ierr(:) = 0
  42. !
  43. ALLOCATE( fs2cor(jpi,jpj) , fcor(jpi,jpj) , &
  44. & covrai(jpi,jpj) , area(jpi,jpj) , tms(jpi,jpj) , tmu(jpi,jpj) , &
  45. & wght (jpi,jpj,2,2) , STAT=ierr(1) )
  46. !
  47. ALLOCATE( &
  48. #if defined key_lim2_vp
  49. & akappa(jpi,jpj,2,2) , bkappa(jpi,jpj,2,2), &
  50. & alambd(jpi,jpj,2,2,2,2) , &
  51. #else
  52. & tmv(jpi,jpj) , tmf(jpi,jpj) , tmi(jpi,jpj) , &
  53. #endif
  54. & STAT=ierr(2) )
  55. !
  56. dom_ice_alloc_2 = MAXVAL(ierr)
  57. IF( dom_ice_alloc_2 /= 0 ) CALL ctl_warn('dom_ice_alloc_2: failed to allocate arrays')
  58. !
  59. END FUNCTION dom_ice_alloc_2
  60. #else
  61. !!----------------------------------------------------------------------
  62. !! Default option Empty module NO LIM-2 sea-ice model
  63. !!----------------------------------------------------------------------
  64. #endif
  65. !!======================================================================
  66. END MODULE dom_ice_2