limdyn_2.F90 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295
  1. MODULE limdyn_2
  2. !!======================================================================
  3. !! *** MODULE limdyn_2 ***
  4. !! Sea-Ice dynamics :
  5. !!======================================================================
  6. !! History : 1.0 ! 2001-04 (LIM) Original code
  7. !! 2.0 ! 2002-08 (C. Ethe, G. Madec) F90, mpp
  8. !! 2.0 ! 2003-08 (C. Ethe) add lim_dyn_init
  9. !! 2.0 ! 2006-07 (G. Madec) Surface module
  10. !! 3.3 ! 2009-05 (G. Garric, C. Bricaud) addition of the lim2_evp case
  11. !!---------------------------------------------------------------------
  12. #if defined key_lim2
  13. !!----------------------------------------------------------------------
  14. !! 'key_lim2' : LIM 2.0 sea-ice model
  15. !!----------------------------------------------------------------------
  16. !! lim_dyn_2 : computes ice velocities
  17. !! lim_dyn_init_2 : initialization and namelist read
  18. !!----------------------------------------------------------------------
  19. USE dom_oce ! ocean space and time domain
  20. USE sbc_oce ! ocean surface boundary condition
  21. USE phycst ! physical constant
  22. USE ice_2 ! LIM-2: ice variables
  23. USE sbc_ice ! Surface boundary condition: sea-ice fields
  24. USE dom_ice_2 ! LIM-2: ice domain
  25. USE limistate_2 ! LIM-2: initial state
  26. USE limrhg_2 ! LIM-2: VP ice rheology
  27. USE limrhg ! LIM : EVP ice rheology
  28. USE lbclnk ! lateral boundary condition - MPP link
  29. USE lib_mpp ! MPP library
  30. USE wrk_nemo ! work arrays
  31. USE in_out_manager ! I/O manager
  32. USE prtctl ! Print control
  33. USE lib_fortran ! Fortran utilities (allows no signed zero when 'key_nosignedzero' defined)
  34. IMPLICIT NONE
  35. PRIVATE
  36. PUBLIC lim_dyn_2 ! routine called by sbc_ice_lim
  37. !! * Substitutions
  38. # include "vectopt_loop_substitute.h90"
  39. !!----------------------------------------------------------------------
  40. !! NEMO/LIM2 3.3 , UCL - NEMO Consortium (2010)
  41. !! $Id: limdyn_2.F90 4624 2014-04-28 12:09:03Z acc $
  42. !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt)
  43. !!----------------------------------------------------------------------
  44. CONTAINS
  45. SUBROUTINE lim_dyn_2( kt )
  46. !!-------------------------------------------------------------------
  47. !! *** ROUTINE lim_dyn_2 ***
  48. !!
  49. !! ** Purpose : compute ice velocity and ocean-ice friction velocity
  50. !!
  51. !! ** Method :
  52. !!
  53. !! ** Action : - Initialisation
  54. !! - Call of the dynamic routine for each hemisphere
  55. !! - computation of the friction velocity at the sea-ice base
  56. !! - treatment of the case if no ice dynamic
  57. !!---------------------------------------------------------------------
  58. INTEGER, INTENT(in) :: kt ! number of iteration
  59. !!
  60. INTEGER :: ji, jj ! dummy loop indices
  61. INTEGER :: i_j1, i_jpj ! Starting/ending j-indices for rheology
  62. REAL(wp) :: zcoef ! temporary scalar
  63. REAL(wp), POINTER, DIMENSION(: ) :: zind ! i-averaged indicator of sea-ice
  64. REAL(wp), POINTER, DIMENSION(: ) :: zmsk ! i-averaged of tmask
  65. REAL(wp), POINTER, DIMENSION(:,:) :: zu_io, zv_io ! ice-ocean velocity
  66. !!---------------------------------------------------------------------
  67. CALL wrk_alloc( jpi, jpj, zu_io, zv_io )
  68. CALL wrk_alloc( jpj, zind , zmsk )
  69. IF( kt == nit000 ) CALL lim_dyn_init_2 ! Initialization (first time-step only)
  70. IF( ln_limdyn ) THEN
  71. !
  72. ! Mean ice and snow thicknesses.
  73. hsnm(:,:) = ( 1.0 - frld(:,:) ) * hsnif(:,:)
  74. hicm(:,:) = ( 1.0 - frld(:,:) ) * hicif(:,:)
  75. !
  76. ! ! Rheology (ice dynamics)
  77. ! ! ========
  78. ! Define the j-limits where ice rheology is computed
  79. ! ---------------------------------------------------
  80. IF( lk_mpp .OR. lk_mpp_rep ) THEN ! mpp: compute over the whole domain
  81. i_j1 = 1
  82. i_jpj = jpj
  83. IF(ln_ctl) CALL prt_ctl_info( 'lim_dyn : i_j1 = ', ivar1=i_j1, clinfo2=' ij_jpj = ', ivar2=i_jpj )
  84. IF( lk_lim2_vp ) THEN ; CALL lim_rhg_2( i_j1, i_jpj ) ! VP rheology
  85. ELSE ; CALL lim_rhg ( i_j1, i_jpj ) ! EVP rheology
  86. ENDIF
  87. !
  88. ELSE ! optimization of the computational area
  89. !
  90. DO jj = 1, jpj
  91. zind(jj) = SUM( frld (:,jj ) ) ! = REAL(jpj) if ocean everywhere on a j-line
  92. zmsk(jj) = SUM( tmask(:,jj,1) ) ! = 0 if land everywhere on a j-line
  93. END DO
  94. !
  95. IF( l_jeq ) THEN ! local domain include both hemisphere
  96. ! ! Rheology is computed in each hemisphere
  97. ! ! only over the ice cover latitude strip
  98. ! Northern hemisphere
  99. i_j1 = njeq
  100. i_jpj = jpj
  101. DO WHILE ( i_j1 <= jpj .AND. zind(i_j1) == FLOAT(jpi) .AND. zmsk(i_j1) /=0 )
  102. i_j1 = i_j1 + 1
  103. END DO
  104. IF( lk_lim2_vp ) THEN ! VP rheology
  105. i_j1 = MAX( 1, i_j1-1 )
  106. CALL lim_rhg_2( i_j1, i_jpj )
  107. ELSE ! EVP rheology
  108. i_j1 = MAX( 1, i_j1-2 )
  109. CALL lim_rhg( i_j1, i_jpj )
  110. ENDIF
  111. IF(ln_ctl) WRITE(numout,*) 'lim_dyn : NH i_j1 = ', i_j1, 'ij_jpj = ', i_jpj
  112. !
  113. ! Southern hemisphere
  114. i_j1 = 1
  115. i_jpj = njeq
  116. DO WHILE ( i_jpj >= 1 .AND. zind(i_jpj) == FLOAT(jpi) .AND. zmsk(i_jpj) /=0 )
  117. i_jpj = i_jpj - 1
  118. END DO
  119. IF( lk_lim2_vp ) THEN ! VP rheology
  120. i_jpj = MIN( jpj, i_jpj+2 )
  121. CALL lim_rhg_2( i_j1, i_jpj )
  122. ELSE ! EVP rheology
  123. i_jpj = MIN( jpj, i_jpj+1 )
  124. CALL lim_rhg( i_j1, i_jpj )
  125. ENDIF
  126. IF(ln_ctl) WRITE(numout,*) 'lim_dyn : SH i_j1 = ', i_j1, 'ij_jpj = ', i_jpj
  127. !
  128. ELSE ! local domain extends over one hemisphere only
  129. ! ! Rheology is computed only over the ice cover
  130. ! ! latitude strip
  131. i_j1 = 1
  132. DO WHILE ( i_j1 <= jpj .AND. zind(i_j1) == FLOAT(jpi) .AND. zmsk(i_j1) /=0 )
  133. i_j1 = i_j1 + 1
  134. END DO
  135. i_j1 = MAX( 1, i_j1-1 )
  136. i_jpj = jpj
  137. DO WHILE ( i_jpj >= 1 .AND. zind(i_jpj) == FLOAT(jpi) .AND. zmsk(i_jpj) /=0 )
  138. i_jpj = i_jpj - 1
  139. END DO
  140. i_jpj = MIN( jpj, i_jpj+2 )
  141. !
  142. IF( lk_lim2_vp ) THEN ! VP rheology
  143. i_jpj = MIN( jpj, i_jpj+2 )
  144. CALL lim_rhg_2( i_j1, i_jpj ) ! VP rheology
  145. ELSE ! EVP rheology
  146. i_j1 = MAX( 1 , i_j1-2 )
  147. i_jpj = MIN( jpj, i_jpj+1 )
  148. CALL lim_rhg ( i_j1, i_jpj ) ! EVP rheology
  149. ENDIF
  150. IF(ln_ctl) WRITE(numout,*) 'lim_dyn : one hemisphere: i_j1 = ', i_j1, ' ij_jpj = ', i_jpj
  151. !
  152. ENDIF
  153. !
  154. ENDIF
  155. IF(ln_ctl) CALL prt_ctl(tab2d_1=u_ice , clinfo1=' lim_dyn : u_ice :', tab2d_2=v_ice , clinfo2=' v_ice :')
  156. ! computation of friction velocity
  157. ! --------------------------------
  158. SELECT CASE( cp_ice_msh ) ! ice-ocean relative velocity at u- & v-pts
  159. CASE( 'C' ) ! EVP : C-grid ice dynamics
  160. zu_io(:,:) = u_ice(:,:) - ssu_m(:,:) ! ice-ocean & ice velocity at ocean velocity points
  161. zv_io(:,:) = v_ice(:,:) - ssv_m(:,:)
  162. CASE( 'I' ) ! VP : B-grid ice dynamics (I-point)
  163. DO jj = 1, jpjm1 ! u_ice v_ice at I-point ; ssu_m, ssv_m at U- & V-points
  164. DO ji = 1, jpim1 ! NO vector opt. !
  165. zu_io(ji,jj) = 0.5_wp * ( u_ice(ji+1,jj+1) + u_ice(ji+1,jj ) ) - ssu_m(ji,jj)
  166. zv_io(ji,jj) = 0.5_wp * ( v_ice(ji+1,jj+1) + v_ice(ji ,jj+1) ) - ssv_m(ji,jj)
  167. END DO
  168. END DO
  169. END SELECT
  170. ! frictional velocity at T-point
  171. zcoef = 0.5_wp * cw
  172. DO jj = 2, jpjm1
  173. DO ji = 2, jpim1 ! NO vector opt. because of zu_io
  174. ust2s(ji,jj) = zcoef * ( zu_io(ji,jj) * zu_io(ji,jj) + zu_io(ji-1,jj) * zu_io(ji-1,jj) &
  175. & + zv_io(ji,jj) * zv_io(ji,jj) + zv_io(ji,jj-1) * zv_io(ji,jj-1) ) * tms(ji,jj)
  176. END DO
  177. END DO
  178. !
  179. ELSE ! no ice dynamics : transmit directly the atmospheric stress to the ocean
  180. !
  181. zcoef = SQRT( 0.5 ) / rau0
  182. DO jj = 2, jpjm1
  183. DO ji = fs_2, fs_jpim1 ! vector opt.
  184. ust2s(ji,jj) = zcoef * SQRT( utau(ji,jj) * utau(ji,jj) + utau(ji-1,jj) * utau(ji-1,jj) &
  185. & + vtau(ji,jj) * vtau(ji,jj) + vtau(ji,jj-1) * vtau(ji,jj-1) ) * tms(ji,jj)
  186. END DO
  187. END DO
  188. !
  189. ENDIF
  190. !
  191. CALL lbc_lnk( ust2s, 'T', 1. ) ! T-point
  192. !
  193. IF(ln_ctl) CALL prt_ctl(tab2d_1=ust2s , clinfo1=' lim_dyn : ust2s :')
  194. !
  195. CALL wrk_dealloc( jpi, jpj, zu_io, zv_io )
  196. CALL wrk_dealloc( jpj, zind , zmsk )
  197. !
  198. END SUBROUTINE lim_dyn_2
  199. SUBROUTINE lim_dyn_init_2
  200. !!-------------------------------------------------------------------
  201. !! *** ROUTINE lim_dyn_init_2 ***
  202. !!
  203. !! ** Purpose : Physical constants and parameters linked to the ice
  204. !! dynamics
  205. !!
  206. !! ** Method : Read the namicedyn namelist and check the ice-dynamic
  207. !! parameter values
  208. !!
  209. !! ** input : Namelist namicedyn
  210. !!-------------------------------------------------------------------
  211. INTEGER :: ios ! Local integer output status for namelist read
  212. NAMELIST/namicedyn/ epsd, alpha, &
  213. & dm, nbiter, nbitdr, om, resl, cw, angvg, pstar, &
  214. & c_rhg, etamn, rn_creepl, rn_ecc, ahi0, &
  215. & nn_nevp, telast, alphaevp
  216. !!-------------------------------------------------------------------
  217. REWIND( numnam_ice_ref ) ! Namelist namicedyn in reference namelist : Ice dynamics
  218. READ ( numnam_ice_ref, namicedyn, IOSTAT = ios, ERR = 901)
  219. 901 IF( ios /= 0 ) CALL ctl_nam ( ios , 'namicedyn in reference namelist', lwp )
  220. REWIND( numnam_ice_cfg ) ! Namelist namicedyn in configuration namelist : Ice dynamics
  221. READ ( numnam_ice_cfg, namicedyn, IOSTAT = ios, ERR = 902 )
  222. 902 IF( ios /= 0 ) CALL ctl_nam ( ios , 'namicedyn in configuration namelist', lwp )
  223. IF(lwm) WRITE ( numoni, namicedyn )
  224. IF(lwp) THEN ! Control print
  225. WRITE(numout,*)
  226. WRITE(numout,*) 'lim_dyn_init_2: ice parameters for ice dynamics '
  227. WRITE(numout,*) '~~~~~~~~~~~~~~'
  228. WRITE(numout,*) ' tolerance parameter epsd = ', epsd
  229. WRITE(numout,*) ' coefficient for semi-implicit coriolis alpha = ', alpha
  230. WRITE(numout,*) ' diffusion constant for dynamics dm = ', dm
  231. WRITE(numout,*) ' number of sub-time steps for relaxation nbiter = ', nbiter
  232. WRITE(numout,*) ' maximum number of iterations for relaxation nbitdr = ', nbitdr
  233. WRITE(numout,*) ' relaxation constant om = ', om
  234. WRITE(numout,*) ' maximum value for the residual of relaxation resl = ', resl
  235. WRITE(numout,*) ' drag coefficient for oceanic stress cw = ', cw
  236. WRITE(numout,*) ' turning angle for oceanic stress angvg = ', angvg, ' degrees'
  237. WRITE(numout,*) ' first bulk-rheology parameter pstar = ', pstar
  238. WRITE(numout,*) ' second bulk-rhelogy parameter c_rhg = ', c_rhg
  239. WRITE(numout,*) ' minimun value for viscosity etamn = ', etamn
  240. WRITE(numout,*) ' creep limit rn_creepl = ', rn_creepl
  241. WRITE(numout,*) ' eccentricity of the elliptical yield curve rn_ecc = ', rn_ecc
  242. WRITE(numout,*) ' horizontal diffusivity coeff. for sea-ice ahi0 = ', ahi0
  243. WRITE(numout,*) ' number of iterations for subcycling nn_nevp= ', nn_nevp
  244. WRITE(numout,*) ' timescale for elastic waves telast = ', telast
  245. WRITE(numout,*) ' coefficient for the solution of int. stresses alphaevp = ', alphaevp
  246. ENDIF
  247. !
  248. IF( angvg /= 0._wp .AND. .NOT.lk_lim2_vp ) THEN
  249. CALL ctl_warn( 'lim_dyn_init_2: turning angle for oceanic stress not properly coded for EVP ', &
  250. & '(see limsbc_2 module). We force angvg = 0._wp' )
  251. angvg = 0._wp
  252. ENDIF
  253. ! Initialization
  254. usecc2 = 1.0 / ( rn_ecc * rn_ecc )
  255. rhoco = rau0 * cw
  256. angvg = angvg * rad ! convert angvg from degree to radian
  257. sangvg = SIN( angvg )
  258. cangvg = COS( angvg )
  259. pstarh = pstar / 2.0
  260. !
  261. ahiu(:,:) = ahi0 * umask(:,:,1) ! Ice eddy Diffusivity coefficients.
  262. ahiv(:,:) = ahi0 * vmask(:,:,1)
  263. !
  264. END SUBROUTINE lim_dyn_init_2
  265. #else
  266. !!----------------------------------------------------------------------
  267. !! Default option Empty module NO LIM 2.0 sea-ice model
  268. !!----------------------------------------------------------------------
  269. CONTAINS
  270. SUBROUTINE lim_dyn_2 ! Empty routine
  271. END SUBROUTINE lim_dyn_2
  272. #endif
  273. !!======================================================================
  274. END MODULE limdyn_2