limmsh.F90 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  1. MODULE limmsh
  2. !!======================================================================
  3. !! *** MODULE limmsh ***
  4. !! LIM ice model : definition of the ice mesh parameters
  5. !!======================================================================
  6. !! History : 3.2 ! 2008-01 (NEMO team) LIM-3: adaptation from LIM-2
  7. !!----------------------------------------------------------------------
  8. #if defined key_lim3
  9. !!----------------------------------------------------------------------
  10. !! 'key_lim3' LIM3 sea-ice model
  11. !!----------------------------------------------------------------------
  12. !! lim_msh : definition of the ice mesh
  13. !!----------------------------------------------------------------------
  14. USE phycst ! physical constants
  15. USE dom_oce ! ocean domain
  16. USE dom_ice ! sea-ice domain
  17. USE in_out_manager ! I/O manager
  18. USE lbclnk ! lateral boundary condition - MPP exchanges
  19. USE lib_mpp ! MPP library
  20. USE lib_fortran ! Fortran utilities (allows no signed zero when 'key_nosignedzero' defined)
  21. IMPLICIT NONE
  22. PRIVATE
  23. PUBLIC lim_msh ! routine called by sbcice_lim.F90
  24. !!----------------------------------------------------------------------
  25. !! NEMO/LIM3 4.0 , UCL - NEMO Consortium (2011)
  26. !! $Id: limmsh.F90 4161 2013-11-07 10:01:27Z cetlod $
  27. !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt)
  28. !!----------------------------------------------------------------------
  29. CONTAINS
  30. SUBROUTINE lim_msh
  31. !!-------------------------------------------------------------------
  32. !! *** ROUTINE lim_msh ***
  33. !!
  34. !! ** Purpose : Definition of the charact. of the numerical grid
  35. !!
  36. !! ** Action : - Initialisation of some variables
  37. !! - Definition of some constants linked with the grid
  38. !! - Definition of the metric coef. for the sea/ice
  39. !!
  40. !! Reference : Deleersnijder et al. Ocean Modelling 100, 7-10
  41. !!---------------------------------------------------------------------
  42. INTEGER :: ji, jj ! dummy loop indices
  43. REAL(wp) :: zusden ! local scalar
  44. !!---------------------------------------------------------------------
  45. IF(lwp) THEN
  46. WRITE(numout,*)
  47. WRITE(numout,*) 'lim_msh : LIM-3 sea-ice model, mesh initialization'
  48. WRITE(numout,*) '~~~~~~~'
  49. ENDIF
  50. IF( jphgr_msh == 2 .OR. jphgr_msh == 3 .OR. jphgr_msh == 5 ) &
  51. & CALL ctl_stop(' Coriolis parameter in LIM not set for f- or beta-plane')
  52. ! !== coriolis factor & Equator position ==!
  53. njeq = INT( jpj / 2 )
  54. njeqm1 = njeq - 1
  55. !
  56. fcor(:,:) = 2. * omega * SIN( gphit(:,:) * rad ) ! coriolis factor
  57. !
  58. IF( fcor(1,1) * fcor(1,nlcj) < 0.e0 ) THEN ! local domain include both hemisphere
  59. l_jeq = .TRUE.
  60. njeq = 1
  61. DO WHILE ( njeq <= jpj .AND. fcor(1,njeq) < 0.e0 )
  62. njeq = njeq + 1
  63. END DO
  64. IF(lwp ) WRITE(numout,*) ' the equator is inside the domain at about njeq = ', njeq
  65. ELSEIF( fcor(1,1) < 0.e0 ) THEN
  66. l_jeq = .FALSE.
  67. njeq = jpj
  68. IF(lwp ) WRITE(numout,*) ' the model domain is entirely in the southern hemisphere: njeq = ', njeq
  69. ELSE
  70. l_jeq = .FALSE.
  71. njeq = 2
  72. IF(lwp ) WRITE(numout,*) ' the model domain is entirely in the northern hemisphere: njeq = ', njeq
  73. ENDIF
  74. !
  75. njeqm1 = njeq - 1
  76. ! !== metric coefficients for sea ice dynamic ==!
  77. wght(:,:,:,:) = 0.e0
  78. !!gm Optimisation : wght to be defined at F-point, not I-point and change in limrhg
  79. DO jj = 2, jpj
  80. DO ji = 2, jpi
  81. zusden = 1.e0 / ( ( e1t(ji,jj) + e1t(ji-1,jj ) ) &
  82. & * ( e2t(ji,jj) + e2t(ji ,jj-1) ) )
  83. wght(ji,jj,1,1) = zusden * e1t(ji ,jj) * e2t(ji,jj )
  84. wght(ji,jj,1,2) = zusden * e1t(ji ,jj) * e2t(ji,jj-1)
  85. wght(ji,jj,2,1) = zusden * e1t(ji-1,jj) * e2t(ji,jj )
  86. wght(ji,jj,2,2) = zusden * e1t(ji-1,jj) * e2t(ji,jj-1)
  87. END DO
  88. END DO
  89. CALL lbc_lnk( wght(:,:,1,1), 'I', 1. ) ! CAUTION: even with the lbc_lnk at ice U-V-point
  90. CALL lbc_lnk( wght(:,:,1,2), 'I', 1. ) ! the value of wght at jpj is wrong
  91. CALL lbc_lnk( wght(:,:,2,1), 'I', 1. ) ! but it is never used
  92. CALL lbc_lnk( wght(:,:,2,2), 'I', 1. )
  93. !!gm end
  94. !
  95. END SUBROUTINE lim_msh
  96. #else
  97. !!----------------------------------------------------------------------
  98. !! Default option Dummy Module NO LIM sea-ice model
  99. !!----------------------------------------------------------------------
  100. CONTAINS
  101. SUBROUTINE lim_msh ! Dummy routine
  102. END SUBROUTINE lim_msh
  103. #endif
  104. !!======================================================================
  105. END MODULE limmsh