limupdate1.F90 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215
  1. MODULE limupdate1
  2. !!======================================================================
  3. !! *** MODULE limupdate1 ***
  4. !! LIM-3 : Update of sea-ice global variables at the end of the time step
  5. !!======================================================================
  6. !! History : 3.0 ! 2006-04 (M. Vancoppenolle) Original code
  7. !! 3.5 ! 2014-06 (C. Rousset) Complete rewriting/cleaning
  8. !!----------------------------------------------------------------------
  9. #if defined key_lim3
  10. !!----------------------------------------------------------------------
  11. !! 'key_lim3' LIM3 sea-ice model
  12. !!----------------------------------------------------------------------
  13. !! lim_update1 : computes update of sea-ice global variables from trend terms
  14. !!----------------------------------------------------------------------
  15. USE sbc_oce ! Surface boundary condition: ocean fields
  16. USE sbc_ice ! Surface boundary condition: ice fields
  17. USE dom_ice
  18. USE dom_oce
  19. USE phycst ! physical constants
  20. USE ice
  21. USE thd_ice ! LIM thermodynamic sea-ice variables
  22. USE limitd_th
  23. USE limvar
  24. USE prtctl ! Print control
  25. USE wrk_nemo ! work arrays
  26. USE timing ! Timing
  27. USE limcons ! conservation tests
  28. USE lib_mpp ! MPP library
  29. USE lib_fortran ! Fortran utilities (allows no signed zero when 'key_nosignedzero' defined)
  30. USE in_out_manager ! I/O manager
  31. IMPLICIT NONE
  32. PRIVATE
  33. PUBLIC lim_update1
  34. !! * Substitutions
  35. # include "vectopt_loop_substitute.h90"
  36. !!----------------------------------------------------------------------
  37. !! NEMO/LIM3 4.0 , UCL - NEMO Consortium (2011)
  38. !! $Id: limupdate1.F90 8169 2017-06-14 08:04:06Z vancop $
  39. !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt)
  40. !!----------------------------------------------------------------------
  41. CONTAINS
  42. SUBROUTINE lim_update1( kt )
  43. !!-------------------------------------------------------------------
  44. !! *** ROUTINE lim_update1 ***
  45. !!
  46. !! ** Purpose : Computes update of sea-ice global variables at
  47. !! the end of the dynamics.
  48. !!
  49. !!---------------------------------------------------------------------
  50. INTEGER, INTENT(in) :: kt ! number of iteration
  51. INTEGER :: ji, jj, jk, jl ! dummy loop indices
  52. REAL(wp) :: zsal
  53. REAL(wp) :: zvi_b, zsmv_b, zei_b, zfs_b, zfw_b, zft_b
  54. !!-------------------------------------------------------------------
  55. IF( nn_timing == 1 ) CALL timing_start('limupdate1')
  56. IF( ln_limdyn ) THEN
  57. IF( kt == nit000 .AND. lwp ) THEN
  58. WRITE(numout,*) ' lim_update1 '
  59. WRITE(numout,*) ' ~~~~~~~~~~~ '
  60. ENDIF
  61. ! conservation test
  62. IF( ln_limdiahsb ) CALL lim_cons_hsm(0, 'limupdate1', zvi_b, zsmv_b, zei_b, zfw_b, zfs_b, zft_b)
  63. !----------------------------------------------------
  64. ! ice concentration should not exceed amax
  65. !-----------------------------------------------------
  66. at_i(:,:) = 0._wp
  67. DO jl = 1, jpl
  68. at_i(:,:) = a_i(:,:,jl) + at_i(:,:)
  69. END DO
  70. DO jl = 1, jpl
  71. DO jj = 1, jpj
  72. DO ji = 1, jpi
  73. IF( at_i(ji,jj) > rn_amax_2d(ji,jj) .AND. a_i(ji,jj,jl) > 0._wp ) THEN
  74. a_i (ji,jj,jl) = a_i (ji,jj,jl) * ( 1._wp - ( 1._wp - rn_amax_2d(ji,jj) / at_i(ji,jj) ) )
  75. ENDIF
  76. END DO
  77. END DO
  78. END DO
  79. !---------------------
  80. ! Ice salinity bounds
  81. !---------------------
  82. IF ( nn_icesal == 2 ) THEN
  83. DO jl = 1, jpl
  84. DO jj = 1, jpj
  85. DO ji = 1, jpi
  86. zsal = smv_i(ji,jj,jl)
  87. ! salinity stays in bounds
  88. rswitch = 1._wp - MAX( 0._wp, SIGN( 1._wp, - v_i(ji,jj,jl) ) )
  89. smv_i(ji,jj,jl) = rswitch * MAX( MIN( rn_simax * v_i(ji,jj,jl), smv_i(ji,jj,jl) ), rn_simin * v_i(ji,jj,jl) )
  90. ! associated salt flux
  91. sfx_res(ji,jj) = sfx_res(ji,jj) - ( smv_i(ji,jj,jl) - zsal ) * rhoic * r1_rdtice
  92. END DO
  93. END DO
  94. END DO
  95. ENDIF
  96. !----------------------------------------------------
  97. ! Rebin categories with thickness out of bounds
  98. !----------------------------------------------------
  99. IF ( jpl > 1 ) CALL lim_itd_th_reb(1, jpl)
  100. !-----------------
  101. ! zap small values
  102. !-----------------
  103. CALL lim_var_zapsmall
  104. ! -------------------------------------------------
  105. ! Diagnostics
  106. ! -------------------------------------------------
  107. DO jl = 1, jpl
  108. afx_dyn(:,:) = afx_dyn(:,:) + ( a_i(:,:,jl) - a_i_b(:,:,jl) ) * r1_rdtice
  109. END DO
  110. DO jj = 1, jpj
  111. DO ji = 1, jpi
  112. ! heat content variation (W.m-2)
  113. diag_heat(ji,jj) = - ( SUM( e_i(ji,jj,1:nlay_i,:) - e_i_b(ji,jj,1:nlay_i,:) ) + &
  114. & SUM( e_s(ji,jj,1:nlay_s,:) - e_s_b(ji,jj,1:nlay_s,:) ) &
  115. & ) * r1_rdtice
  116. ! salt, volume
  117. diag_smvi(ji,jj) = SUM( smv_i(ji,jj,:) - smv_i_b(ji,jj,:) ) * rhoic * r1_rdtice
  118. diag_vice(ji,jj) = SUM( v_i (ji,jj,:) - v_i_b (ji,jj,:) ) * rhoic * r1_rdtice
  119. diag_vsnw(ji,jj) = SUM( v_s (ji,jj,:) - v_s_b (ji,jj,:) ) * rhosn * r1_rdtice
  120. END DO
  121. END DO
  122. ! conservation test
  123. IF( ln_limdiahsb ) CALL lim_cons_hsm(1, 'limupdate1', zvi_b, zsmv_b, zei_b, zfw_b, zfs_b, zft_b)
  124. ! -------------------------------------------------
  125. ! control prints
  126. ! -------------------------------------------------
  127. IF(ln_ctl) THEN ! Control print
  128. CALL prt_ctl_info(' ')
  129. CALL prt_ctl_info(' - Cell values : ')
  130. CALL prt_ctl_info(' ~~~~~~~~~~~~~ ')
  131. CALL prt_ctl(tab2d_1=e12t , clinfo1=' lim_update1 : cell area :')
  132. CALL prt_ctl(tab2d_1=at_i , clinfo1=' lim_update1 : at_i :')
  133. CALL prt_ctl(tab2d_1=vt_i , clinfo1=' lim_update1 : vt_i :')
  134. CALL prt_ctl(tab2d_1=vt_s , clinfo1=' lim_update1 : vt_s :')
  135. CALL prt_ctl(tab2d_1=strength , clinfo1=' lim_update1 : strength :')
  136. CALL prt_ctl(tab2d_1=u_ice , clinfo1=' lim_update1 : u_ice :', tab2d_2=v_ice , clinfo2=' v_ice :')
  137. CALL prt_ctl(tab2d_1=u_ice_b , clinfo1=' lim_update1 : u_ice_b :', tab2d_2=v_ice_b , clinfo2=' v_ice_b :')
  138. DO jl = 1, jpl
  139. CALL prt_ctl_info(' ')
  140. CALL prt_ctl_info(' - Category : ', ivar1=jl)
  141. CALL prt_ctl_info(' ~~~~~~~~~~')
  142. CALL prt_ctl(tab2d_1=ht_i (:,:,jl) , clinfo1= ' lim_update1 : ht_i : ')
  143. CALL prt_ctl(tab2d_1=ht_s (:,:,jl) , clinfo1= ' lim_update1 : ht_s : ')
  144. CALL prt_ctl(tab2d_1=t_su (:,:,jl) , clinfo1= ' lim_update1 : t_su : ')
  145. CALL prt_ctl(tab2d_1=t_s (:,:,1,jl) , clinfo1= ' lim_update1 : t_snow : ')
  146. CALL prt_ctl(tab2d_1=sm_i (:,:,jl) , clinfo1= ' lim_update1 : sm_i : ')
  147. CALL prt_ctl(tab2d_1=o_i (:,:,jl) , clinfo1= ' lim_update1 : o_i : ')
  148. CALL prt_ctl(tab2d_1=a_i (:,:,jl) , clinfo1= ' lim_update1 : a_i : ')
  149. CALL prt_ctl(tab2d_1=a_i_b (:,:,jl) , clinfo1= ' lim_update1 : a_i_b : ')
  150. CALL prt_ctl(tab2d_1=v_i (:,:,jl) , clinfo1= ' lim_update1 : v_i : ')
  151. CALL prt_ctl(tab2d_1=v_i_b (:,:,jl) , clinfo1= ' lim_update1 : v_i_b : ')
  152. CALL prt_ctl(tab2d_1=v_s (:,:,jl) , clinfo1= ' lim_update1 : v_s : ')
  153. CALL prt_ctl(tab2d_1=v_s_b (:,:,jl) , clinfo1= ' lim_update1 : v_s_b : ')
  154. CALL prt_ctl(tab2d_1=e_i (:,:,1,jl) , clinfo1= ' lim_update1 : e_i1 : ')
  155. CALL prt_ctl(tab2d_1=e_i_b (:,:,1,jl) , clinfo1= ' lim_update1 : e_i1_b : ')
  156. CALL prt_ctl(tab2d_1=e_i (:,:,2,jl) , clinfo1= ' lim_update1 : e_i2 : ')
  157. CALL prt_ctl(tab2d_1=e_i_b (:,:,2,jl) , clinfo1= ' lim_update1 : e_i2_b : ')
  158. CALL prt_ctl(tab2d_1=e_s (:,:,1,jl) , clinfo1= ' lim_update1 : e_snow : ')
  159. CALL prt_ctl(tab2d_1=e_s_b (:,:,1,jl) , clinfo1= ' lim_update1 : e_snow_b : ')
  160. CALL prt_ctl(tab2d_1=smv_i (:,:,jl) , clinfo1= ' lim_update1 : smv_i : ')
  161. CALL prt_ctl(tab2d_1=smv_i_b (:,:,jl) , clinfo1= ' lim_update1 : smv_i_b : ')
  162. CALL prt_ctl(tab2d_1=oa_i (:,:,jl) , clinfo1= ' lim_update1 : oa_i : ')
  163. CALL prt_ctl(tab2d_1=oa_i_b (:,:,jl) , clinfo1= ' lim_update1 : oa_i_b : ')
  164. DO jk = 1, nlay_i
  165. CALL prt_ctl_info(' - Layer : ', ivar1=jk)
  166. CALL prt_ctl(tab2d_1=t_i(:,:,jk,jl) , clinfo1= ' lim_update1 : t_i : ')
  167. END DO
  168. END DO
  169. CALL prt_ctl_info(' ')
  170. CALL prt_ctl_info(' - Heat / FW fluxes : ')
  171. CALL prt_ctl_info(' ~~~~~~~~~~~~~~~~~~ ')
  172. CALL prt_ctl(tab2d_1=sst_m , clinfo1= ' lim_update1 : sst : ', tab2d_2=sss_m , clinfo2= ' sss : ')
  173. CALL prt_ctl_info(' ')
  174. CALL prt_ctl_info(' - Stresses : ')
  175. CALL prt_ctl_info(' ~~~~~~~~~~ ')
  176. CALL prt_ctl(tab2d_1=utau , clinfo1= ' lim_update1 : utau : ', tab2d_2=vtau , clinfo2= ' vtau : ')
  177. CALL prt_ctl(tab2d_1=utau_ice , clinfo1= ' lim_update1 : utau_ice : ', tab2d_2=vtau_ice , clinfo2= ' vtau_ice : ')
  178. CALL prt_ctl(tab2d_1=u_oce , clinfo1= ' lim_update1 : u_oce : ', tab2d_2=v_oce , clinfo2= ' v_oce : ')
  179. ENDIF
  180. ENDIF ! ln_limdyn
  181. IF( nn_timing == 1 ) CALL timing_stop('limupdate1')
  182. END SUBROUTINE lim_update1
  183. #else
  184. !!----------------------------------------------------------------------
  185. !! Default option Empty Module No sea-ice model
  186. !!----------------------------------------------------------------------
  187. CONTAINS
  188. SUBROUTINE lim_update1 ! Empty routine
  189. END SUBROUTINE lim_update1
  190. #endif
  191. END MODULE limupdate1