limthd.F90 37 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689
  1. MODULE limthd
  2. !!======================================================================
  3. !! *** MODULE limthd ***
  4. !! LIM-3 : ice thermodynamic
  5. !!======================================================================
  6. !! History : LIM ! 2000-01 (M.A. Morales Maqueda, H. Goosse, T. Fichefet) LIM-1
  7. !! 2.0 ! 2002-07 (C. Ethe, G. Madec) LIM-2 (F90 rewriting)
  8. !! 3.0 ! 2005-11 (M. Vancoppenolle) LIM-3 : Multi-layer thermodynamics + salinity variations
  9. !! - ! 2007-04 (M. Vancoppenolle) add lim_thd_glohec, lim_thd_con_dh and lim_thd_con_dif
  10. !! 3.2 ! 2009-07 (M. Vancoppenolle, Y. Aksenov, G. Madec) bug correction in wfx_snw
  11. !! 3.3 ! 2010-11 (G. Madec) corrected snow melting heat (due to factor betas)
  12. !! 4.0 ! 2011-02 (G. Madec) dynamical allocation
  13. !! - ! 2012-05 (C. Rousset) add penetration solar flux
  14. !!----------------------------------------------------------------------
  15. #if defined key_lim3
  16. !!----------------------------------------------------------------------
  17. !! 'key_lim3' LIM3 sea-ice model
  18. !!----------------------------------------------------------------------
  19. !! lim_thd : thermodynamic of sea ice
  20. !! lim_thd_init : initialisation of sea-ice thermodynamic
  21. !!----------------------------------------------------------------------
  22. USE phycst ! physical constants
  23. USE dom_oce ! ocean space and time domain variables
  24. USE ice ! LIM: sea-ice variables
  25. USE sbc_oce ! Surface boundary condition: ocean fields
  26. USE sbc_ice ! Surface boundary condition: ice fields
  27. USE thd_ice ! LIM thermodynamic sea-ice variables
  28. USE dom_ice ! LIM sea-ice domain
  29. USE limthd_dif ! LIM: thermodynamics, vertical diffusion
  30. USE limthd_dh ! LIM: thermodynamics, ice and snow thickness variation
  31. USE limthd_sal ! LIM: thermodynamics, ice salinity
  32. USE limthd_ent ! LIM: thermodynamics, ice enthalpy redistribution
  33. USE limthd_lac ! LIM-3 lateral accretion
  34. USE limitd_th ! remapping thickness distribution
  35. USE limtab ! LIM: 1D <==> 2D transformation
  36. USE limvar ! LIM: sea-ice variables
  37. USE lbclnk ! lateral boundary condition - MPP links
  38. USE lib_mpp ! MPP library
  39. USE wrk_nemo ! work arrays
  40. USE in_out_manager ! I/O manager
  41. USE prtctl ! Print control
  42. USE lib_fortran ! Fortran utilities (allows no signed zero when 'key_nosignedzero' defined)
  43. USE timing ! Timing
  44. USE limcons ! conservation tests
  45. USE limctl
  46. IMPLICIT NONE
  47. PRIVATE
  48. PUBLIC lim_thd ! called by limstp module
  49. PUBLIC lim_thd_init ! called by sbc_lim_init
  50. !! * Substitutions
  51. # include "domzgr_substitute.h90"
  52. # include "vectopt_loop_substitute.h90"
  53. !!----------------------------------------------------------------------
  54. !! NEMO/LIM3 3.3 , UCL - NEMO Consortium (2010)
  55. !! $Id: limthd.F90 4990 2014-12-15 16:42:49Z timgraham $
  56. !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt)
  57. !!----------------------------------------------------------------------
  58. CONTAINS
  59. SUBROUTINE lim_thd( kt )
  60. !!-------------------------------------------------------------------
  61. !! *** ROUTINE lim_thd ***
  62. !!
  63. !! ** Purpose : This routine manages ice thermodynamics
  64. !!
  65. !! ** Action : - Initialisation of some variables
  66. !! - Some preliminary computation (oceanic heat flux
  67. !! at the ice base, snow acc.,heat budget of the leads)
  68. !! - selection of the icy points and put them in an array
  69. !! - call lim_thd_dif for vertical heat diffusion
  70. !! - call lim_thd_dh for vertical ice growth and melt
  71. !! - call lim_thd_ent for enthalpy remapping
  72. !! - call lim_thd_sal for ice desalination
  73. !! - call lim_thd_temp to retrieve temperature from ice enthalpy
  74. !! - back to the geographic grid
  75. !!
  76. !! ** References :
  77. !!---------------------------------------------------------------------
  78. INTEGER, INTENT(in) :: kt ! number of iteration
  79. !!
  80. INTEGER :: ji, jj, jk, jl ! dummy loop indices
  81. INTEGER :: nbpb ! nb of icy pts for vertical thermo calculations
  82. INTEGER :: ii, ij ! temporary dummy loop index
  83. REAL(wp) :: zfric_u, zqld, zqfr
  84. REAL(wp) :: zvi_b, zsmv_b, zei_b, zfs_b, zfw_b, zft_b
  85. REAL(wp), PARAMETER :: zfric_umin = 0._wp ! lower bound for the friction velocity (cice value=5.e-04)
  86. REAL(wp), PARAMETER :: zch = 0.0057_wp ! heat transfer coefficient
  87. !
  88. !!-------------------------------------------------------------------
  89. IF( nn_timing == 1 ) CALL timing_start('limthd')
  90. ! conservation test
  91. IF( ln_limdiahsb ) CALL lim_cons_hsm(0, 'limthd', zvi_b, zsmv_b, zei_b, zfw_b, zfs_b, zft_b)
  92. CALL lim_var_glo2eqv
  93. !------------------------------------------------------------------------!
  94. ! 1) Initialization of some variables !
  95. !------------------------------------------------------------------------!
  96. ftr_ice(:,:,:) = 0._wp ! part of solar radiation transmitted through the ice
  97. !--------------------
  98. ! 1.2) Heat content
  99. !--------------------
  100. ! Change the units of heat content; from J/m2 to J/m3
  101. DO jl = 1, jpl
  102. DO jk = 1, nlay_i
  103. DO jj = 1, jpj
  104. DO ji = 1, jpi
  105. !0 if no ice and 1 if yes
  106. rswitch = MAX( 0._wp , SIGN( 1._wp , v_i(ji,jj,jl) - epsi20 ) )
  107. !Energy of melting q(S,T) [J.m-3]
  108. e_i(ji,jj,jk,jl) = rswitch * e_i(ji,jj,jk,jl) / MAX( v_i(ji,jj,jl) , epsi20 ) * REAL( nlay_i )
  109. END DO
  110. END DO
  111. END DO
  112. DO jk = 1, nlay_s
  113. DO jj = 1, jpj
  114. DO ji = 1, jpi
  115. !0 if no ice and 1 if yes
  116. rswitch = MAX( 0._wp , SIGN( 1._wp , v_s(ji,jj,jl) - epsi20 ) )
  117. !Energy of melting q(S,T) [J.m-3]
  118. e_s(ji,jj,jk,jl) = rswitch * e_s(ji,jj,jk,jl) / MAX( v_s(ji,jj,jl) , epsi20 ) * REAL( nlay_s )
  119. END DO
  120. END DO
  121. END DO
  122. END DO
  123. ! 2) Partial computation of forcing for the thermodynamic sea ice model. !
  124. !-----------------------------------------------------------------------------!
  125. DO jj = 1, jpj
  126. DO ji = 1, jpi
  127. rswitch = tmask(ji,jj,1) * MAX( 0._wp , SIGN( 1._wp , at_i(ji,jj) - epsi10 ) ) ! 0 if no ice
  128. !
  129. ! ! solar irradiance transmission at the mixed layer bottom and used in the lead heat budget
  130. ! ! practically no "direct lateral ablation"
  131. !
  132. ! ! net downward heat flux from the ice to the ocean, expressed as a function of ocean
  133. ! ! temperature and turbulent mixing (McPhee, 1992)
  134. !
  135. ! --- Energy received in the lead, zqld is defined everywhere (J.m-2) --- !
  136. zqld = tmask(ji,jj,1) * rdt_ice * &
  137. & ( pfrld(ji,jj) * qsr_oce(ji,jj) * frq_m(ji,jj) + pfrld(ji,jj) * qns_oce(ji,jj) + qemp_oce(ji,jj) )
  138. ! --- Energy needed to bring ocean surface layer until its freezing (<0, J.m-2) --- !
  139. zqfr = tmask(ji,jj,1) * rau0 * rcp * fse3t_m(ji,jj) * ( t_bo(ji,jj) - ( sst_m(ji,jj) + rt0 ) )
  140. ! --- Energy from the turbulent oceanic heat flux (W/m2) --- !
  141. zfric_u = MAX( SQRT( ust2s(ji,jj) ), zfric_umin )
  142. fhtur(ji,jj) = MAX( 0._wp, rswitch * rau0 * rcp * zch * zfric_u * ( ( sst_m(ji,jj) + rt0 ) - t_bo(ji,jj) ) ) ! W.m-2
  143. fhtur(ji,jj) = rswitch * MIN( fhtur(ji,jj), - zqfr * r1_rdtice / MAX( at_i(ji,jj), epsi10 ) )
  144. ! upper bound for fhtur: the heat retrieved from the ocean must be smaller than the heat necessary to reach
  145. ! the freezing point, so that we do not have SST < T_freeze
  146. ! This implies: - ( fhtur(ji,jj) * at_i(ji,jj) * rtdice ) - zqfr >= 0
  147. !-- Energy Budget of the leads (J.m-2). Must be < 0 to form ice
  148. qlead(ji,jj) = MIN( 0._wp , zqld - ( fhtur(ji,jj) * at_i(ji,jj) * rdt_ice ) - zqfr )
  149. ! If there is ice and leads are warming, then transfer energy from the lead budget and use it for bottom melting
  150. IF( zqld > 0._wp ) THEN
  151. fhld (ji,jj) = rswitch * zqld * r1_rdtice / MAX( at_i(ji,jj), epsi10 ) ! divided by at_i since this is (re)multiplied by a_i in limthd_dh.F90
  152. qlead(ji,jj) = 0._wp
  153. ELSE
  154. fhld (ji,jj) = 0._wp
  155. ENDIF
  156. !
  157. ! -----------------------------------------
  158. ! Net heat flux on top of ice-ocean [W.m-2]
  159. ! -----------------------------------------
  160. hfx_in(ji,jj) = qns_tot(ji,jj) + qsr_tot(ji,jj)
  161. ! -----------------------------------------------------------------------------
  162. ! Net heat flux on top of the ocean after ice thermo (1st step) [W.m-2]
  163. ! -----------------------------------------------------------------------------
  164. ! First step here : non solar + precip - qlead - qturb
  165. ! Second step in limthd_dh : heat remaining if total melt (zq_rema)
  166. ! Third step in limsbc : heat from ice-ocean mass exchange (zf_mass) + solar
  167. hfx_out(ji,jj) = pfrld(ji,jj) * qns_oce(ji,jj) + qemp_oce(ji,jj) & ! Non solar heat flux received by the ocean
  168. & - qlead(ji,jj) * r1_rdtice & ! heat flux taken from the ocean where there is open water ice formation
  169. & - at_i(ji,jj) * fhtur(ji,jj) & ! heat flux taken by turbulence
  170. & - at_i(ji,jj) * fhld(ji,jj) ! heat flux taken during bottom growth/melt
  171. ! (fhld should be 0 while bott growth)
  172. END DO
  173. END DO
  174. !------------------------------------------------------------------------------!
  175. ! 3) Select icy points and fulfill arrays for the vectorial grid.
  176. !------------------------------------------------------------------------------!
  177. DO jl = 1, jpl !loop over ice categories
  178. IF( kt == nit000 .AND. lwp ) THEN
  179. WRITE(numout,*) ' lim_thd : transfer to 1D vectors. Category no : ', jl
  180. WRITE(numout,*) ' ~~~~~~~~'
  181. ENDIF
  182. nbpb = 0
  183. DO jj = 1, jpj
  184. DO ji = 1, jpi
  185. IF ( a_i(ji,jj,jl) > epsi10 ) THEN
  186. nbpb = nbpb + 1
  187. npb(nbpb) = (jj - 1) * jpi + ji
  188. ENDIF
  189. END DO
  190. END DO
  191. ! debug point to follow
  192. jiindex_1d = 0
  193. IF( ln_icectl ) THEN
  194. DO ji = mi0(iiceprt), mi1(iiceprt)
  195. DO jj = mj0(jiceprt), mj1(jiceprt)
  196. jiindex_1d = (jj - 1) * jpi + ji
  197. WRITE(numout,*) ' lim_thd : Category no : ', jl
  198. END DO
  199. END DO
  200. ENDIF
  201. !------------------------------------------------------------------------------!
  202. ! 4) Thermodynamic computation
  203. !------------------------------------------------------------------------------!
  204. IF( lk_mpp ) CALL mpp_ini_ice( nbpb , numout )
  205. IF( nbpb > 0 ) THEN ! If there is no ice, do nothing.
  206. !-------------------------!
  207. ! --- Move to 1D arrays ---
  208. !-------------------------!
  209. CALL lim_thd_1d2d( nbpb, jl, 1 )
  210. !--------------------------------------!
  211. ! --- Ice/Snow Temperature profile --- !
  212. !--------------------------------------!
  213. CALL lim_thd_dif( 1, nbpb )
  214. !---------------------------------!
  215. ! --- Ice/Snow thickness --- !
  216. !---------------------------------!
  217. CALL lim_thd_dh( 1, nbpb )
  218. ! --- Ice enthalpy remapping --- !
  219. CALL lim_thd_ent( 1, nbpb, q_i_1d(1:nbpb,:) )
  220. !---------------------------------!
  221. ! --- Ice salinity --- !
  222. !---------------------------------!
  223. CALL lim_thd_sal( 1, nbpb )
  224. !---------------------------------!
  225. ! --- temperature update --- !
  226. !---------------------------------!
  227. CALL lim_thd_temp( 1, nbpb )
  228. !------------------------------------!
  229. ! --- lateral melting if monocat --- !
  230. !------------------------------------!
  231. IF ( ( nn_monocat == 1 .OR. nn_monocat == 4 ) .AND. jpl == 1 ) THEN
  232. CALL lim_thd_lam( 1, nbpb )
  233. END IF
  234. !-------------------------!
  235. ! --- Move to 2D arrays ---
  236. !-------------------------!
  237. CALL lim_thd_1d2d( nbpb, jl, 2 )
  238. !
  239. IF( lk_mpp ) CALL mpp_comm_free( ncomm_ice ) !RB necessary ??
  240. ENDIF
  241. !
  242. END DO !jl
  243. !------------------------------------------------------------------------------!
  244. ! 5) Global variables, diagnostics
  245. !------------------------------------------------------------------------------!
  246. !------------------------
  247. ! Ice heat content
  248. !------------------------
  249. ! Enthalpies are global variables we have to readjust the units (heat content in J/m2)
  250. DO jl = 1, jpl
  251. DO jk = 1, nlay_i
  252. e_i(:,:,jk,jl) = e_i(:,:,jk,jl) * a_i(:,:,jl) * ht_i(:,:,jl) * r1_nlay_i
  253. END DO
  254. END DO
  255. !------------------------
  256. ! Snow heat content
  257. !------------------------
  258. ! Enthalpies are global variables we have to readjust the units (heat content in J/m2)
  259. DO jl = 1, jpl
  260. DO jk = 1, nlay_s
  261. e_s(:,:,jk,jl) = e_s(:,:,jk,jl) * a_i(:,:,jl) * ht_s(:,:,jl) * r1_nlay_s
  262. END DO
  263. END DO
  264. !----------------------------------
  265. ! Change thickness to volume
  266. !----------------------------------
  267. v_i(:,:,:) = ht_i(:,:,:) * a_i(:,:,:)
  268. v_s(:,:,:) = ht_s(:,:,:) * a_i(:,:,:)
  269. smv_i(:,:,:) = sm_i(:,:,:) * v_i(:,:,:)
  270. ! update ice age (in case a_i changed, i.e. becomes 0 or lateral melting in monocat)
  271. DO jl = 1, jpl
  272. DO jj = 1, jpj
  273. DO ji = 1, jpi
  274. rswitch = MAX( 0._wp , SIGN( 1._wp, a_i_b(ji,jj,jl) - epsi10 ) )
  275. oa_i(ji,jj,jl) = rswitch * oa_i(ji,jj,jl) * a_i(ji,jj,jl) / MAX( a_i_b(ji,jj,jl), epsi10 )
  276. END DO
  277. END DO
  278. END DO
  279. CALL lim_var_zapsmall
  280. !--------------------------------------------
  281. ! Diagnostic thermodynamic growth rates
  282. !--------------------------------------------
  283. IF( ln_icectl ) CALL lim_prt( kt, iiceprt, jiceprt, 1, ' - ice thermodyn. - ' ) ! control print
  284. IF(ln_ctl) THEN ! Control print
  285. CALL prt_ctl_info(' ')
  286. CALL prt_ctl_info(' - Cell values : ')
  287. CALL prt_ctl_info(' ~~~~~~~~~~~~~ ')
  288. CALL prt_ctl(tab2d_1=e12t , clinfo1=' lim_thd : cell area :')
  289. CALL prt_ctl(tab2d_1=at_i , clinfo1=' lim_thd : at_i :')
  290. CALL prt_ctl(tab2d_1=vt_i , clinfo1=' lim_thd : vt_i :')
  291. CALL prt_ctl(tab2d_1=vt_s , clinfo1=' lim_thd : vt_s :')
  292. DO jl = 1, jpl
  293. CALL prt_ctl_info(' ')
  294. CALL prt_ctl_info(' - Category : ', ivar1=jl)
  295. CALL prt_ctl_info(' ~~~~~~~~~~')
  296. CALL prt_ctl(tab2d_1=a_i (:,:,jl) , clinfo1= ' lim_thd : a_i : ')
  297. CALL prt_ctl(tab2d_1=ht_i (:,:,jl) , clinfo1= ' lim_thd : ht_i : ')
  298. CALL prt_ctl(tab2d_1=ht_s (:,:,jl) , clinfo1= ' lim_thd : ht_s : ')
  299. CALL prt_ctl(tab2d_1=v_i (:,:,jl) , clinfo1= ' lim_thd : v_i : ')
  300. CALL prt_ctl(tab2d_1=v_s (:,:,jl) , clinfo1= ' lim_thd : v_s : ')
  301. CALL prt_ctl(tab2d_1=e_s (:,:,1,jl) , clinfo1= ' lim_thd : e_s : ')
  302. CALL prt_ctl(tab2d_1=t_su (:,:,jl) , clinfo1= ' lim_thd : t_su : ')
  303. CALL prt_ctl(tab2d_1=t_s (:,:,1,jl) , clinfo1= ' lim_thd : t_snow : ')
  304. CALL prt_ctl(tab2d_1=sm_i (:,:,jl) , clinfo1= ' lim_thd : sm_i : ')
  305. CALL prt_ctl(tab2d_1=smv_i (:,:,jl) , clinfo1= ' lim_thd : smv_i : ')
  306. DO jk = 1, nlay_i
  307. CALL prt_ctl_info(' ')
  308. CALL prt_ctl_info(' - Layer : ', ivar1=jk)
  309. CALL prt_ctl_info(' ~~~~~~~')
  310. CALL prt_ctl(tab2d_1=t_i(:,:,jk,jl) , clinfo1= ' lim_thd : t_i : ')
  311. CALL prt_ctl(tab2d_1=e_i(:,:,jk,jl) , clinfo1= ' lim_thd : e_i : ')
  312. END DO
  313. END DO
  314. ENDIF
  315. !
  316. !
  317. IF( ln_limdiahsb ) CALL lim_cons_hsm(1, 'limthd', zvi_b, zsmv_b, zei_b, zfw_b, zfs_b, zft_b)
  318. !------------------------------------------------------------------------------|
  319. ! 6) Transport of ice between thickness categories. |
  320. !------------------------------------------------------------------------------|
  321. ! Given thermodynamic growth rates, transport ice between thickness categories.
  322. IF( ln_limdiahsb ) CALL lim_cons_hsm(0, 'limitd_th_rem', zvi_b, zsmv_b, zei_b, zfw_b, zfs_b, zft_b)
  323. IF( jpl > 1 ) CALL lim_itd_th_rem( 1, jpl, kt )
  324. IF( ln_limdiahsb ) CALL lim_cons_hsm(1, 'limitd_th_rem', zvi_b, zsmv_b, zei_b, zfw_b, zfs_b, zft_b)
  325. !------------------------------------------------------------------------------|
  326. ! 7) Add frazil ice growing in leads.
  327. !------------------------------------------------------------------------------|
  328. IF( ln_limdiahsb ) CALL lim_cons_hsm(0, 'limthd_lac', zvi_b, zsmv_b, zei_b, zfw_b, zfs_b, zft_b)
  329. CALL lim_thd_lac
  330. IF( ln_limdiahsb ) CALL lim_cons_hsm(1, 'limthd_lac', zvi_b, zsmv_b, zei_b, zfw_b, zfs_b, zft_b)
  331. ! Control print
  332. IF(ln_ctl) THEN
  333. CALL lim_var_glo2eqv
  334. CALL prt_ctl_info(' ')
  335. CALL prt_ctl_info(' - Cell values : ')
  336. CALL prt_ctl_info(' ~~~~~~~~~~~~~ ')
  337. CALL prt_ctl(tab2d_1=e12t , clinfo1=' lim_itd_th : cell area :')
  338. CALL prt_ctl(tab2d_1=at_i , clinfo1=' lim_itd_th : at_i :')
  339. CALL prt_ctl(tab2d_1=vt_i , clinfo1=' lim_itd_th : vt_i :')
  340. CALL prt_ctl(tab2d_1=vt_s , clinfo1=' lim_itd_th : vt_s :')
  341. DO jl = 1, jpl
  342. CALL prt_ctl_info(' ')
  343. CALL prt_ctl_info(' - Category : ', ivar1=jl)
  344. CALL prt_ctl_info(' ~~~~~~~~~~')
  345. CALL prt_ctl(tab2d_1=a_i (:,:,jl) , clinfo1= ' lim_itd_th : a_i : ')
  346. CALL prt_ctl(tab2d_1=ht_i (:,:,jl) , clinfo1= ' lim_itd_th : ht_i : ')
  347. CALL prt_ctl(tab2d_1=ht_s (:,:,jl) , clinfo1= ' lim_itd_th : ht_s : ')
  348. CALL prt_ctl(tab2d_1=v_i (:,:,jl) , clinfo1= ' lim_itd_th : v_i : ')
  349. CALL prt_ctl(tab2d_1=v_s (:,:,jl) , clinfo1= ' lim_itd_th : v_s : ')
  350. CALL prt_ctl(tab2d_1=e_s (:,:,1,jl) , clinfo1= ' lim_itd_th : e_s : ')
  351. CALL prt_ctl(tab2d_1=t_su (:,:,jl) , clinfo1= ' lim_itd_th : t_su : ')
  352. CALL prt_ctl(tab2d_1=t_s (:,:,1,jl) , clinfo1= ' lim_itd_th : t_snow : ')
  353. CALL prt_ctl(tab2d_1=sm_i (:,:,jl) , clinfo1= ' lim_itd_th : sm_i : ')
  354. CALL prt_ctl(tab2d_1=smv_i (:,:,jl) , clinfo1= ' lim_itd_th : smv_i : ')
  355. DO jk = 1, nlay_i
  356. CALL prt_ctl_info(' ')
  357. CALL prt_ctl_info(' - Layer : ', ivar1=jk)
  358. CALL prt_ctl_info(' ~~~~~~~')
  359. CALL prt_ctl(tab2d_1=t_i(:,:,jk,jl) , clinfo1= ' lim_itd_th : t_i : ')
  360. CALL prt_ctl(tab2d_1=e_i(:,:,jk,jl) , clinfo1= ' lim_itd_th : e_i : ')
  361. END DO
  362. END DO
  363. ENDIF
  364. !
  365. IF( nn_timing == 1 ) CALL timing_stop('limthd')
  366. END SUBROUTINE lim_thd
  367. SUBROUTINE lim_thd_temp( kideb, kiut )
  368. !!-----------------------------------------------------------------------
  369. !! *** ROUTINE lim_thd_temp ***
  370. !!
  371. !! ** Purpose : Computes sea ice temperature (Kelvin) from enthalpy
  372. !!
  373. !! ** Method : Formula (Bitz and Lipscomb, 1999)
  374. !!-------------------------------------------------------------------
  375. INTEGER, INTENT(in) :: kideb, kiut ! bounds for the spatial loop
  376. !!
  377. INTEGER :: ji, jk ! dummy loop indices
  378. REAL(wp) :: ztmelts, zaaa, zbbb, zccc, zdiscrim ! local scalar
  379. !!-------------------------------------------------------------------
  380. ! Recover ice temperature
  381. DO jk = 1, nlay_i
  382. DO ji = kideb, kiut
  383. ztmelts = -tmut * s_i_1d(ji,jk) + rt0
  384. ! Conversion q(S,T) -> T (second order equation)
  385. zaaa = cpic
  386. zbbb = ( rcp - cpic ) * ( ztmelts - rt0 ) + q_i_1d(ji,jk) * r1_rhoic - lfus
  387. zccc = lfus * ( ztmelts - rt0 )
  388. zdiscrim = SQRT( MAX( zbbb * zbbb - 4._wp * zaaa * zccc, 0._wp ) )
  389. t_i_1d(ji,jk) = rt0 - ( zbbb + zdiscrim ) / ( 2._wp * zaaa )
  390. ! mask temperature
  391. rswitch = 1._wp - MAX( 0._wp , SIGN( 1._wp , - ht_i_1d(ji) ) )
  392. t_i_1d(ji,jk) = rswitch * t_i_1d(ji,jk) + ( 1._wp - rswitch ) * rt0
  393. END DO
  394. END DO
  395. END SUBROUTINE lim_thd_temp
  396. SUBROUTINE lim_thd_lam( kideb, kiut )
  397. !!-----------------------------------------------------------------------
  398. !! *** ROUTINE lim_thd_lam ***
  399. !!
  400. !! ** Purpose : Lateral melting in case monocategory
  401. !! ( dA = A/2h dh )
  402. !!-----------------------------------------------------------------------
  403. INTEGER, INTENT(in) :: kideb, kiut ! bounds for the spatial loop
  404. INTEGER :: ji ! dummy loop indices
  405. REAL(wp) :: zhi_bef ! ice thickness before thermo
  406. REAL(wp) :: zdh_mel, zda_mel ! net melting
  407. REAL(wp) :: zvi, zvs ! ice/snow volumes
  408. DO ji = kideb, kiut
  409. zdh_mel = MIN( 0._wp, dh_i_surf(ji) + dh_i_bott(ji) + dh_snowice(ji) + dh_i_sub(ji) )
  410. IF( zdh_mel < 0._wp .AND. a_i_1d(ji) > 0._wp ) THEN
  411. zvi = a_i_1d(ji) * ht_i_1d(ji)
  412. zvs = a_i_1d(ji) * ht_s_1d(ji)
  413. ! lateral melting = concentration change
  414. zhi_bef = ht_i_1d(ji) - zdh_mel
  415. rswitch = MAX( 0._wp , SIGN( 1._wp , zhi_bef - epsi20 ) )
  416. zda_mel = rswitch * a_i_1d(ji) * zdh_mel / ( 2._wp * MAX( zhi_bef, epsi20 ) )
  417. a_i_1d(ji) = MAX( epsi20, a_i_1d(ji) + zda_mel )
  418. ! adjust thickness
  419. ht_i_1d(ji) = zvi / a_i_1d(ji)
  420. ht_s_1d(ji) = zvs / a_i_1d(ji)
  421. ! retrieve total concentration
  422. at_i_1d(ji) = a_i_1d(ji)
  423. END IF
  424. END DO
  425. END SUBROUTINE lim_thd_lam
  426. SUBROUTINE lim_thd_1d2d( nbpb, jl, kn )
  427. !!-----------------------------------------------------------------------
  428. !! *** ROUTINE lim_thd_1d2d ***
  429. !!
  430. !! ** Purpose : move arrays from 1d to 2d and the reverse
  431. !!-----------------------------------------------------------------------
  432. INTEGER, INTENT(in) :: kn ! 1= from 2D to 1D
  433. ! 2= from 1D to 2D
  434. INTEGER, INTENT(in) :: nbpb ! size of 1D arrays
  435. INTEGER, INTENT(in) :: jl ! ice cat
  436. INTEGER :: jk ! dummy loop indices
  437. SELECT CASE( kn )
  438. CASE( 1 )
  439. CALL tab_2d_1d( nbpb, at_i_1d (1:nbpb), at_i , jpi, jpj, npb(1:nbpb) )
  440. CALL tab_2d_1d( nbpb, a_i_1d (1:nbpb), a_i(:,:,jl) , jpi, jpj, npb(1:nbpb) )
  441. CALL tab_2d_1d( nbpb, ht_i_1d (1:nbpb), ht_i(:,:,jl) , jpi, jpj, npb(1:nbpb) )
  442. CALL tab_2d_1d( nbpb, ht_s_1d (1:nbpb), ht_s(:,:,jl) , jpi, jpj, npb(1:nbpb) )
  443. CALL tab_2d_1d( nbpb, t_su_1d (1:nbpb), t_su(:,:,jl) , jpi, jpj, npb(1:nbpb) )
  444. CALL tab_2d_1d( nbpb, sm_i_1d (1:nbpb), sm_i(:,:,jl) , jpi, jpj, npb(1:nbpb) )
  445. DO jk = 1, nlay_s
  446. CALL tab_2d_1d( nbpb, t_s_1d(1:nbpb,jk), t_s(:,:,jk,jl) , jpi, jpj, npb(1:nbpb) )
  447. CALL tab_2d_1d( nbpb, q_s_1d(1:nbpb,jk), e_s(:,:,jk,jl) , jpi, jpj, npb(1:nbpb) )
  448. END DO
  449. DO jk = 1, nlay_i
  450. CALL tab_2d_1d( nbpb, t_i_1d(1:nbpb,jk), t_i(:,:,jk,jl) , jpi, jpj, npb(1:nbpb) )
  451. CALL tab_2d_1d( nbpb, q_i_1d(1:nbpb,jk), e_i(:,:,jk,jl) , jpi, jpj, npb(1:nbpb) )
  452. CALL tab_2d_1d( nbpb, s_i_1d(1:nbpb,jk), s_i(:,:,jk,jl) , jpi, jpj, npb(1:nbpb) )
  453. END DO
  454. CALL tab_2d_1d( nbpb, qprec_ice_1d(1:nbpb), qprec_ice(:,:) , jpi, jpj, npb(1:nbpb) )
  455. CALL tab_2d_1d( nbpb, qevap_ice_1d(1:nbpb), qevap_ice(:,:,jl) , jpi, jpj, npb(1:nbpb) )
  456. CALL tab_2d_1d( nbpb, qsr_ice_1d (1:nbpb), qsr_ice(:,:,jl) , jpi, jpj, npb(1:nbpb) )
  457. CALL tab_2d_1d( nbpb, fr1_i0_1d (1:nbpb), fr1_i0 , jpi, jpj, npb(1:nbpb) )
  458. CALL tab_2d_1d( nbpb, fr2_i0_1d (1:nbpb), fr2_i0 , jpi, jpj, npb(1:nbpb) )
  459. CALL tab_2d_1d( nbpb, qns_ice_1d (1:nbpb), qns_ice(:,:,jl) , jpi, jpj, npb(1:nbpb) )
  460. CALL tab_2d_1d( nbpb, ftr_ice_1d (1:nbpb), ftr_ice(:,:,jl) , jpi, jpj, npb(1:nbpb) )
  461. CALL tab_2d_1d( nbpb, evap_ice_1d (1:nbpb), evap_ice(:,:,jl), jpi, jpj, npb(1:nbpb) )
  462. CALL tab_2d_1d( nbpb, dqns_ice_1d(1:nbpb), dqns_ice(:,:,jl), jpi, jpj, npb(1:nbpb) )
  463. CALL tab_2d_1d( nbpb, t_bo_1d (1:nbpb), t_bo , jpi, jpj, npb(1:nbpb) )
  464. CALL tab_2d_1d( nbpb, sprecip_1d (1:nbpb), sprecip , jpi, jpj, npb(1:nbpb) )
  465. CALL tab_2d_1d( nbpb, fhtur_1d (1:nbpb), fhtur , jpi, jpj, npb(1:nbpb) )
  466. CALL tab_2d_1d( nbpb, qlead_1d (1:nbpb), qlead , jpi, jpj, npb(1:nbpb) )
  467. CALL tab_2d_1d( nbpb, fhld_1d (1:nbpb), fhld , jpi, jpj, npb(1:nbpb) )
  468. CALL tab_2d_1d( nbpb, wfx_snw_1d (1:nbpb), wfx_snw , jpi, jpj, npb(1:nbpb) )
  469. CALL tab_2d_1d( nbpb, wfx_sub_1d (1:nbpb), wfx_sub , jpi, jpj, npb(1:nbpb) )
  470. CALL tab_2d_1d( nbpb, wfx_bog_1d (1:nbpb), wfx_bog , jpi, jpj, npb(1:nbpb) )
  471. CALL tab_2d_1d( nbpb, wfx_bom_1d (1:nbpb), wfx_bom , jpi, jpj, npb(1:nbpb) )
  472. CALL tab_2d_1d( nbpb, wfx_sum_1d (1:nbpb), wfx_sum , jpi, jpj, npb(1:nbpb) )
  473. CALL tab_2d_1d( nbpb, wfx_sni_1d (1:nbpb), wfx_sni , jpi, jpj, npb(1:nbpb) )
  474. CALL tab_2d_1d( nbpb, wfx_res_1d (1:nbpb), wfx_res , jpi, jpj, npb(1:nbpb) )
  475. CALL tab_2d_1d( nbpb, wfx_spr_1d (1:nbpb), wfx_spr , jpi, jpj, npb(1:nbpb) )
  476. CALL tab_2d_1d( nbpb, sfx_bog_1d (1:nbpb), sfx_bog , jpi, jpj, npb(1:nbpb) )
  477. CALL tab_2d_1d( nbpb, sfx_bom_1d (1:nbpb), sfx_bom , jpi, jpj, npb(1:nbpb) )
  478. CALL tab_2d_1d( nbpb, sfx_sum_1d (1:nbpb), sfx_sum , jpi, jpj, npb(1:nbpb) )
  479. CALL tab_2d_1d( nbpb, sfx_sni_1d (1:nbpb), sfx_sni , jpi, jpj, npb(1:nbpb) )
  480. CALL tab_2d_1d( nbpb, sfx_bri_1d (1:nbpb), sfx_bri , jpi, jpj, npb(1:nbpb) )
  481. CALL tab_2d_1d( nbpb, sfx_res_1d (1:nbpb), sfx_res , jpi, jpj, npb(1:nbpb) )
  482. CALL tab_2d_1d( nbpb, sfx_sub_1d (1:nbpb), sfx_sub , jpi, jpj,npb(1:nbpb) )
  483. CALL tab_2d_1d( nbpb, hfx_thd_1d (1:nbpb), hfx_thd , jpi, jpj, npb(1:nbpb) )
  484. CALL tab_2d_1d( nbpb, hfx_spr_1d (1:nbpb), hfx_spr , jpi, jpj, npb(1:nbpb) )
  485. CALL tab_2d_1d( nbpb, hfx_sum_1d (1:nbpb), hfx_sum , jpi, jpj, npb(1:nbpb) )
  486. CALL tab_2d_1d( nbpb, hfx_bom_1d (1:nbpb), hfx_bom , jpi, jpj, npb(1:nbpb) )
  487. CALL tab_2d_1d( nbpb, hfx_bog_1d (1:nbpb), hfx_bog , jpi, jpj, npb(1:nbpb) )
  488. CALL tab_2d_1d( nbpb, hfx_dif_1d (1:nbpb), hfx_dif , jpi, jpj, npb(1:nbpb) )
  489. CALL tab_2d_1d( nbpb, hfx_opw_1d (1:nbpb), hfx_opw , jpi, jpj, npb(1:nbpb) )
  490. CALL tab_2d_1d( nbpb, hfx_snw_1d (1:nbpb), hfx_snw , jpi, jpj, npb(1:nbpb) )
  491. CALL tab_2d_1d( nbpb, hfx_sub_1d (1:nbpb), hfx_sub , jpi, jpj, npb(1:nbpb) )
  492. CALL tab_2d_1d( nbpb, hfx_err_1d (1:nbpb), hfx_err , jpi, jpj, npb(1:nbpb) )
  493. CALL tab_2d_1d( nbpb, hfx_res_1d (1:nbpb), hfx_res , jpi, jpj, npb(1:nbpb) )
  494. CALL tab_2d_1d( nbpb, hfx_err_dif_1d (1:nbpb), hfx_err_dif , jpi, jpj, npb(1:nbpb) )
  495. CALL tab_2d_1d( nbpb, hfx_err_rem_1d (1:nbpb), hfx_err_rem , jpi, jpj, npb(1:nbpb) )
  496. CASE( 2 )
  497. CALL tab_1d_2d( nbpb, at_i , npb, at_i_1d (1:nbpb) , jpi, jpj )
  498. CALL tab_1d_2d( nbpb, ht_i(:,:,jl) , npb, ht_i_1d (1:nbpb) , jpi, jpj )
  499. CALL tab_1d_2d( nbpb, ht_s(:,:,jl) , npb, ht_s_1d (1:nbpb) , jpi, jpj )
  500. CALL tab_1d_2d( nbpb, a_i (:,:,jl) , npb, a_i_1d (1:nbpb) , jpi, jpj )
  501. CALL tab_1d_2d( nbpb, t_su(:,:,jl) , npb, t_su_1d (1:nbpb) , jpi, jpj )
  502. CALL tab_1d_2d( nbpb, sm_i(:,:,jl) , npb, sm_i_1d (1:nbpb) , jpi, jpj )
  503. DO jk = 1, nlay_s
  504. CALL tab_1d_2d( nbpb, t_s(:,:,jk,jl), npb, t_s_1d (1:nbpb,jk), jpi, jpj)
  505. CALL tab_1d_2d( nbpb, e_s(:,:,jk,jl), npb, q_s_1d (1:nbpb,jk), jpi, jpj)
  506. END DO
  507. DO jk = 1, nlay_i
  508. CALL tab_1d_2d( nbpb, t_i(:,:,jk,jl), npb, t_i_1d (1:nbpb,jk), jpi, jpj)
  509. CALL tab_1d_2d( nbpb, e_i(:,:,jk,jl), npb, q_i_1d (1:nbpb,jk), jpi, jpj)
  510. CALL tab_1d_2d( nbpb, s_i(:,:,jk,jl), npb, s_i_1d (1:nbpb,jk), jpi, jpj)
  511. END DO
  512. CALL tab_1d_2d( nbpb, qlead , npb, qlead_1d (1:nbpb) , jpi, jpj )
  513. CALL tab_1d_2d( nbpb, wfx_snw , npb, wfx_snw_1d(1:nbpb) , jpi, jpj )
  514. CALL tab_1d_2d( nbpb, wfx_sub , npb, wfx_sub_1d(1:nbpb) , jpi, jpj )
  515. CALL tab_1d_2d( nbpb, wfx_bog , npb, wfx_bog_1d(1:nbpb) , jpi, jpj )
  516. CALL tab_1d_2d( nbpb, wfx_bom , npb, wfx_bom_1d(1:nbpb) , jpi, jpj )
  517. CALL tab_1d_2d( nbpb, wfx_sum , npb, wfx_sum_1d(1:nbpb) , jpi, jpj )
  518. CALL tab_1d_2d( nbpb, wfx_sni , npb, wfx_sni_1d(1:nbpb) , jpi, jpj )
  519. CALL tab_1d_2d( nbpb, wfx_res , npb, wfx_res_1d(1:nbpb) , jpi, jpj )
  520. CALL tab_1d_2d( nbpb, wfx_spr , npb, wfx_spr_1d(1:nbpb) , jpi, jpj )
  521. CALL tab_1d_2d( nbpb, sfx_bog , npb, sfx_bog_1d(1:nbpb) , jpi, jpj )
  522. CALL tab_1d_2d( nbpb, sfx_bom , npb, sfx_bom_1d(1:nbpb) , jpi, jpj )
  523. CALL tab_1d_2d( nbpb, sfx_sum , npb, sfx_sum_1d(1:nbpb) , jpi, jpj )
  524. CALL tab_1d_2d( nbpb, sfx_sni , npb, sfx_sni_1d(1:nbpb) , jpi, jpj )
  525. CALL tab_1d_2d( nbpb, sfx_res , npb, sfx_res_1d(1:nbpb) , jpi, jpj )
  526. CALL tab_1d_2d( nbpb, sfx_bri , npb, sfx_bri_1d(1:nbpb) , jpi, jpj )
  527. CALL tab_1d_2d( nbpb, sfx_sub , npb, sfx_sub_1d(1:nbpb) , jpi, jpj )
  528. CALL tab_1d_2d( nbpb, hfx_thd , npb, hfx_thd_1d(1:nbpb) , jpi, jpj )
  529. CALL tab_1d_2d( nbpb, hfx_spr , npb, hfx_spr_1d(1:nbpb) , jpi, jpj )
  530. CALL tab_1d_2d( nbpb, hfx_sum , npb, hfx_sum_1d(1:nbpb) , jpi, jpj )
  531. CALL tab_1d_2d( nbpb, hfx_bom , npb, hfx_bom_1d(1:nbpb) , jpi, jpj )
  532. CALL tab_1d_2d( nbpb, hfx_bog , npb, hfx_bog_1d(1:nbpb) , jpi, jpj )
  533. CALL tab_1d_2d( nbpb, hfx_dif , npb, hfx_dif_1d(1:nbpb) , jpi, jpj )
  534. CALL tab_1d_2d( nbpb, hfx_opw , npb, hfx_opw_1d(1:nbpb) , jpi, jpj )
  535. CALL tab_1d_2d( nbpb, hfx_snw , npb, hfx_snw_1d(1:nbpb) , jpi, jpj )
  536. CALL tab_1d_2d( nbpb, hfx_sub , npb, hfx_sub_1d(1:nbpb) , jpi, jpj )
  537. CALL tab_1d_2d( nbpb, hfx_err , npb, hfx_err_1d(1:nbpb) , jpi, jpj )
  538. CALL tab_1d_2d( nbpb, hfx_res , npb, hfx_res_1d(1:nbpb) , jpi, jpj )
  539. CALL tab_1d_2d( nbpb, hfx_err_rem , npb, hfx_err_rem_1d(1:nbpb), jpi, jpj )
  540. CALL tab_1d_2d( nbpb, hfx_err_dif , npb, hfx_err_dif_1d(1:nbpb), jpi, jpj )
  541. !
  542. CALL tab_1d_2d( nbpb, qns_ice(:,:,jl), npb, qns_ice_1d(1:nbpb) , jpi, jpj)
  543. CALL tab_1d_2d( nbpb, ftr_ice(:,:,jl), npb, ftr_ice_1d(1:nbpb) , jpi, jpj )
  544. END SELECT
  545. END SUBROUTINE lim_thd_1d2d
  546. SUBROUTINE lim_thd_init
  547. !!-----------------------------------------------------------------------
  548. !! *** ROUTINE lim_thd_init ***
  549. !!
  550. !! ** Purpose : Physical constants and parameters linked to the ice
  551. !! thermodynamics
  552. !!
  553. !! ** Method : Read the namicethd namelist and check the ice-thermo
  554. !! parameter values called at the first timestep (nit000)
  555. !!
  556. !! ** input : Namelist namicether
  557. !!-------------------------------------------------------------------
  558. INTEGER :: ios ! Local integer output status for namelist read
  559. NAMELIST/namicethd/ rn_hnewice, ln_frazil, rn_maxfrazb, rn_vfrazb, rn_Cfrazb, &
  560. & rn_himin, rn_betas, rn_kappa_i, nn_conv_dif, rn_terr_dif, nn_ice_thcon, &
  561. & rn_cdsn, nn_monocat, ln_it_qnsice
  562. !!-------------------------------------------------------------------
  563. !
  564. IF(lwp) THEN
  565. WRITE(numout,*)
  566. WRITE(numout,*) 'lim_thd : Ice Thermodynamics'
  567. WRITE(numout,*) '~~~~~~~'
  568. ENDIF
  569. !
  570. REWIND( numnam_ice_ref ) ! Namelist namicethd in reference namelist : Ice thermodynamics
  571. READ ( numnam_ice_ref, namicethd, IOSTAT = ios, ERR = 901)
  572. 901 IF( ios /= 0 ) CALL ctl_nam ( ios , 'namicethd in reference namelist', lwp )
  573. REWIND( numnam_ice_cfg ) ! Namelist namicethd in configuration namelist : Ice thermodynamics
  574. READ ( numnam_ice_cfg, namicethd, IOSTAT = ios, ERR = 902 )
  575. 902 IF( ios /= 0 ) CALL ctl_nam ( ios , 'namicethd in configuration namelist', lwp )
  576. IF(lwm) WRITE ( numoni, namicethd )
  577. !
  578. IF ( ( jpl > 1 ) .AND. ( nn_monocat == 1 ) ) THEN
  579. nn_monocat = 0
  580. IF(lwp) WRITE(numout, *) ' nn_monocat must be 0 in multi-category case '
  581. ENDIF
  582. !
  583. IF(lwp) THEN ! control print
  584. WRITE(numout,*)
  585. WRITE(numout,*)' Namelist of ice parameters for ice thermodynamic computation '
  586. WRITE(numout,*)' ice thick. for lateral accretion rn_hnewice = ', rn_hnewice
  587. WRITE(numout,*)' Frazil ice thickness as a function of wind or not ln_frazil = ', ln_frazil
  588. WRITE(numout,*)' Maximum proportion of frazil ice collecting at bottom rn_maxfrazb = ', rn_maxfrazb
  589. WRITE(numout,*)' Thresold relative drift speed for collection of frazil rn_vfrazb = ', rn_vfrazb
  590. WRITE(numout,*)' Squeezing coefficient for collection of frazil rn_Cfrazb = ', rn_Cfrazb
  591. WRITE(numout,*)' minimum ice thickness rn_himin = ', rn_himin
  592. WRITE(numout,*)' numerical carac. of the scheme for diffusion in ice '
  593. WRITE(numout,*)' coefficient for ice-lead partition of snowfall rn_betas = ', rn_betas
  594. WRITE(numout,*)' extinction radiation parameter in sea ice rn_kappa_i = ', rn_kappa_i
  595. WRITE(numout,*)' maximal n. of iter. for heat diffusion computation nn_conv_dif = ', nn_conv_dif
  596. WRITE(numout,*)' maximal err. on T for heat diffusion computation rn_terr_dif = ', rn_terr_dif
  597. WRITE(numout,*)' switch for comp. of thermal conductivity in the ice nn_ice_thcon = ', nn_ice_thcon
  598. WRITE(numout,*)' thermal conductivity of the snow rn_cdsn = ', rn_cdsn
  599. WRITE(numout,*)' check heat conservation in the ice/snow con_i = ', con_i
  600. WRITE(numout,*)' virtual ITD mono-category parameterizations (1) or not nn_monocat = ', nn_monocat
  601. WRITE(numout,*)' iterate the surface non-solar flux (T) or not (F) ln_it_qnsice = ', ln_it_qnsice
  602. ENDIF
  603. !
  604. END SUBROUTINE lim_thd_init
  605. #else
  606. !!----------------------------------------------------------------------
  607. !! Default option Dummy module NO LIM3 sea-ice model
  608. !!----------------------------------------------------------------------
  609. #endif
  610. !!======================================================================
  611. END MODULE limthd