limistate.F90 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521
  1. MODULE limistate
  2. !!======================================================================
  3. !! *** MODULE limistate ***
  4. !! Initialisation of diagnostics ice variables
  5. !!======================================================================
  6. !! History : 2.0 ! 2004-01 (C. Ethe, G. Madec) Original code
  7. !! 4.0 ! 2011-02 (G. Madec) dynamical allocation
  8. !! - ! 2014 (C. Rousset) add N/S initializations
  9. !!----------------------------------------------------------------------
  10. #if defined key_lim3
  11. !!----------------------------------------------------------------------
  12. !! 'key_lim3' : LIM3 sea-ice model
  13. !!----------------------------------------------------------------------
  14. !! lim_istate : Initialisation of diagnostics ice variables
  15. !! lim_istate_init : initialization of ice state and namelist read
  16. !!----------------------------------------------------------------------
  17. USE phycst ! physical constant
  18. USE oce ! dynamics and tracers variables
  19. USE dom_oce ! ocean domain
  20. USE sbc_oce ! Surface boundary condition: ocean fields
  21. USE sbc_ice ! Surface boundary condition: ice fields
  22. USE eosbn2 ! equation of state
  23. USE ice ! sea-ice variables
  24. USE par_oce ! ocean parameters
  25. USE dom_ice ! sea-ice domain
  26. USE limvar ! lim_var_salprof
  27. USE in_out_manager ! I/O manager
  28. USE lib_mpp ! MPP library
  29. USE lib_fortran ! Fortran utilities (allows no signed zero when 'key_nosignedzero' defined)
  30. USE wrk_nemo ! work arrays
  31. IMPLICIT NONE
  32. PRIVATE
  33. PUBLIC lim_istate ! routine called by lim_init.F90
  34. ! !!** init namelist (namiceini) **
  35. REAL(wp) :: rn_thres_sst ! threshold water temperature for initial sea ice
  36. REAL(wp) :: rn_hts_ini_n ! initial snow thickness in the north
  37. REAL(wp) :: rn_hts_ini_s ! initial snow thickness in the south
  38. REAL(wp) :: rn_hti_ini_n ! initial ice thickness in the north
  39. REAL(wp) :: rn_hti_ini_s ! initial ice thickness in the south
  40. REAL(wp) :: rn_ati_ini_n ! initial leads area in the north
  41. REAL(wp) :: rn_ati_ini_s ! initial leads area in the south
  42. REAL(wp) :: rn_smi_ini_n ! initial salinity
  43. REAL(wp) :: rn_smi_ini_s ! initial salinity
  44. REAL(wp) :: rn_tmi_ini_n ! initial temperature
  45. REAL(wp) :: rn_tmi_ini_s ! initial temperature
  46. LOGICAL :: ln_iceini ! initialization or not
  47. !!----------------------------------------------------------------------
  48. !! LIM 3.0, UCL-LOCEAN-IPSL (2008)
  49. !! $Id: limistate.F90 8156 2017-06-08 16:13:32Z vancop $
  50. !! Software governed by the CeCILL licence (modipsl/doc/NEMO_CeCILL.txt)
  51. !!----------------------------------------------------------------------
  52. CONTAINS
  53. SUBROUTINE lim_istate
  54. !!-------------------------------------------------------------------
  55. !! *** ROUTINE lim_istate ***
  56. !!
  57. !! ** Purpose : defined the sea-ice initial state
  58. !!
  59. !! ** Method :
  60. !! This routine will put some ice where ocean
  61. !! is at the freezing point, then fill in ice
  62. !! state variables using prescribed initial
  63. !! values in the namelist
  64. !!
  65. !! ** Steps :
  66. !! 1) Read namelist
  67. !! 2) Basal temperature; ice and hemisphere masks
  68. !! 3) Fill in the ice thickness distribution using gaussian
  69. !! 4) Fill in space-dependent arrays for state variables
  70. !! 5) Diagnostic arrays
  71. !! 6) Lateral boundary conditions
  72. !!
  73. !! ** Notes : o_i, t_su, t_s, t_i, s_i must be filled everywhere, even
  74. !! where there is no ice (clem: I do not know why, is it mandatory?)
  75. !!
  76. !! History :
  77. !! 2.0 ! 01-04 (C. Ethe, G. Madec) Original code
  78. !! 3.0 ! 2007 (M. Vancoppenolle) Rewrite for ice cats
  79. !! 4.0 ! 09-11 (M. Vancoppenolle) Enhanced version for ice cats
  80. !!--------------------------------------------------------------------
  81. !! * Local variables
  82. INTEGER :: ji, jj, jk, jl ! dummy loop indices
  83. REAL(wp) :: ztmelts, zdh
  84. INTEGER :: i_hemis, i_fill, jl0
  85. REAL(wp) :: ztest_1, ztest_2, ztest_3, ztest_4, ztests, zsigma, zarg, zA, zV, zA_cons, zV_cons, zconv
  86. REAL(wp), POINTER, DIMENSION(:) :: zht_i_ini, zat_i_ini, zvt_i_ini, zht_s_ini, zsm_i_ini, ztm_i_ini
  87. REAL(wp), POINTER, DIMENSION(:,:) :: zh_i_ini, za_i_ini, zv_i_ini
  88. REAL(wp), POINTER, DIMENSION(:,:) :: zswitch ! ice indicator
  89. INTEGER, POINTER, DIMENSION(:,:) :: zhemis ! hemispheric index
  90. !--------------------------------------------------------------------
  91. CALL wrk_alloc( jpi, jpj, zswitch )
  92. CALL wrk_alloc( jpi, jpj, zhemis )
  93. CALL wrk_alloc( jpl, 2, zh_i_ini, za_i_ini, zv_i_ini )
  94. CALL wrk_alloc( 2, zht_i_ini, zat_i_ini, zvt_i_ini, zht_s_ini, zsm_i_ini, ztm_i_ini )
  95. IF(lwp) WRITE(numout,*)
  96. IF(lwp) WRITE(numout,*) 'lim_istate : Ice initialization '
  97. IF(lwp) WRITE(numout,*) '~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ '
  98. !--------------------------------------------------------------------
  99. ! 1) Read namelist
  100. !--------------------------------------------------------------------
  101. CALL lim_istate_init ! reading the initials parameters of the ice
  102. ! surface temperature
  103. DO jl = 1, jpl ! loop over categories
  104. t_su (:,:,jl) = rt0 * tmask(:,:,1)
  105. tn_ice(:,:,jl) = rt0 * tmask(:,:,1)
  106. END DO
  107. ! basal temperature (considered at freezing point)
  108. CALL eos_fzp( sss_m(:,:), t_bo(:,:) )
  109. t_bo(:,:) = ( t_bo(:,:) + rt0 ) * tmask(:,:,1)
  110. IF( ln_iceini ) THEN
  111. !--------------------------------------------------------------------
  112. ! 2) Basal temperature, ice mask and hemispheric index
  113. !--------------------------------------------------------------------
  114. DO jj = 1, jpj ! ice if sst <= t-freez + ttest
  115. DO ji = 1, jpi
  116. IF( ( sst_m(ji,jj) - ( t_bo(ji,jj) - rt0 ) ) * tmask(ji,jj,1) >= rn_thres_sst ) THEN
  117. zswitch(ji,jj) = 0._wp * tmask(ji,jj,1) ! no ice
  118. ELSE
  119. zswitch(ji,jj) = 1._wp * tmask(ji,jj,1) ! ice
  120. ENDIF
  121. END DO
  122. END DO
  123. ! Hemispheric index
  124. DO jj = 1, jpj
  125. DO ji = 1, jpi
  126. IF( fcor(ji,jj) >= 0._wp ) THEN
  127. zhemis(ji,jj) = 1 ! Northern hemisphere
  128. ELSE
  129. zhemis(ji,jj) = 2 ! Southern hemisphere
  130. ENDIF
  131. END DO
  132. END DO
  133. !--------------------------------------------------------------------
  134. ! 3) Initialization of sea ice state variables
  135. !--------------------------------------------------------------------
  136. !-----------------------------
  137. ! 3.1) Hemisphere-dependent arrays
  138. !-----------------------------
  139. ! assign initial thickness, concentration, snow depth and salinity to an hemisphere-dependent array
  140. zht_i_ini(1) = rn_hti_ini_n ; zht_i_ini(2) = rn_hti_ini_s ! ice thickness
  141. zht_s_ini(1) = rn_hts_ini_n ; zht_s_ini(2) = rn_hts_ini_s ! snow depth
  142. zat_i_ini(1) = rn_ati_ini_n ; zat_i_ini(2) = rn_ati_ini_s ! ice concentration
  143. zsm_i_ini(1) = rn_smi_ini_n ; zsm_i_ini(2) = rn_smi_ini_s ! bulk ice salinity
  144. ztm_i_ini(1) = rn_tmi_ini_n ; ztm_i_ini(2) = rn_tmi_ini_s ! temperature (ice and snow)
  145. zvt_i_ini(:) = zht_i_ini(:) * zat_i_ini(:) ! ice volume
  146. !---------------------------------------------------------------------
  147. ! 3.2) Distribute ice concentration and thickness into the categories
  148. !---------------------------------------------------------------------
  149. ! a gaussian distribution for ice concentration is used
  150. ! then we check whether the distribution fullfills
  151. ! volume and area conservation, positivity and ice categories bounds
  152. DO i_hemis = 1, 2
  153. ztest_1 = 0 ; ztest_2 = 0 ; ztest_3 = 0 ; ztest_4 = 0
  154. ! note for the great nemo engineers:
  155. ! only very few of the WRITE statements are necessary for the reference version
  156. ! they were one day useful, but now i personally doubt of their
  157. ! potential for bringing anything useful
  158. DO i_fill = jpl, 1, -1
  159. IF ( ( ztest_1 + ztest_2 + ztest_3 + ztest_4 ) .NE. 4 ) THEN
  160. !----------------------------
  161. ! fill the i_fill categories
  162. !----------------------------
  163. ! *** 1 category to fill
  164. IF ( i_fill .EQ. 1 ) THEN
  165. zh_i_ini(1,i_hemis) = zht_i_ini(i_hemis)
  166. za_i_ini(1,i_hemis) = zat_i_ini(i_hemis)
  167. zh_i_ini(2:jpl,i_hemis) = 0._wp
  168. za_i_ini(2:jpl,i_hemis) = 0._wp
  169. ELSE
  170. ! *** >1 categores to fill
  171. !--- Ice thicknesses in the i_fill - 1 first categories
  172. DO jl = 1, i_fill - 1
  173. zh_i_ini(jl,i_hemis) = hi_mean(jl)
  174. END DO
  175. !--- jl0: most likely index where cc will be maximum
  176. DO jl = 1, jpl
  177. IF ( ( zht_i_ini(i_hemis) > hi_max(jl-1) ) .AND. &
  178. & ( zht_i_ini(i_hemis) <= hi_max(jl) ) ) THEN
  179. jl0 = jl
  180. ENDIF
  181. END DO
  182. jl0 = MIN(jl0, i_fill)
  183. !--- Concentrations
  184. za_i_ini(jl0,i_hemis) = zat_i_ini(i_hemis) / SQRT(REAL(jpl))
  185. DO jl = 1, i_fill - 1
  186. IF ( jl .NE. jl0 ) THEN
  187. zsigma = 0.5 * zht_i_ini(i_hemis)
  188. zarg = ( zh_i_ini(jl,i_hemis) - zht_i_ini(i_hemis) ) / zsigma
  189. za_i_ini(jl,i_hemis) = za_i_ini(jl0,i_hemis) * EXP(-zarg**2)
  190. ENDIF
  191. END DO
  192. zA = 0. ! sum of the areas in the jpl categories
  193. DO jl = 1, i_fill - 1
  194. zA = zA + za_i_ini(jl,i_hemis)
  195. END DO
  196. za_i_ini(i_fill,i_hemis) = zat_i_ini(i_hemis) - zA ! ice conc in the last category
  197. IF ( i_fill .LT. jpl ) za_i_ini(i_fill+1:jpl, i_hemis) = 0._wp
  198. !--- Ice thickness in the last category
  199. zV = 0. ! sum of the volumes of the N-1 categories
  200. DO jl = 1, i_fill - 1
  201. zV = zV + za_i_ini(jl,i_hemis)*zh_i_ini(jl,i_hemis)
  202. END DO
  203. zh_i_ini(i_fill,i_hemis) = ( zvt_i_ini(i_hemis) - zV ) / za_i_ini(i_fill,i_hemis)
  204. IF ( i_fill .LT. jpl ) zh_i_ini(i_fill+1:jpl, i_hemis) = 0._wp
  205. !--- volumes
  206. zv_i_ini(:,i_hemis) = za_i_ini(:,i_hemis) * zh_i_ini(:,i_hemis)
  207. IF ( i_fill .LT. jpl ) zv_i_ini(i_fill+1:jpl, i_hemis) = 0._wp
  208. ENDIF ! i_fill
  209. !---------------------
  210. ! Compatibility tests
  211. !---------------------
  212. ! Test 1: area conservation
  213. zA_cons = SUM(za_i_ini(:,i_hemis)) ; zconv = ABS(zat_i_ini(i_hemis) - zA_cons )
  214. IF ( zconv .LT. 1.0e-6 ) THEN
  215. ztest_1 = 1
  216. ELSE
  217. ztest_1 = 0
  218. ENDIF
  219. ! Test 2: volume conservation
  220. zV_cons = SUM(zv_i_ini(:,i_hemis))
  221. zconv = ABS(zvt_i_ini(i_hemis) - zV_cons)
  222. IF ( zconv .LT. 1.0e-6 ) THEN
  223. ztest_2 = 1
  224. ELSE
  225. ztest_2 = 0
  226. ENDIF
  227. ! Test 3: thickness of the last category is in-bounds ?
  228. IF ( zh_i_ini(i_fill, i_hemis) > hi_max(i_fill-1) ) THEN
  229. ztest_3 = 1
  230. ELSE
  231. ztest_3 = 0
  232. ENDIF
  233. ! Test 4: positivity of ice concentrations
  234. ztest_4 = 1
  235. DO jl = 1, jpl
  236. IF ( za_i_ini(jl,i_hemis) .LT. 0._wp ) THEN
  237. ztest_4 = 0
  238. ENDIF
  239. END DO
  240. ENDIF ! ztest_1 + ztest_2 + ztest_3 + ztest_4
  241. ztests = ztest_1 + ztest_2 + ztest_3 + ztest_4
  242. END DO ! i_fill
  243. IF(lwp) THEN
  244. WRITE(numout,*) ' ztests : ', ztests
  245. IF ( ztests .NE. 4 ) THEN
  246. WRITE(numout,*)
  247. WRITE(numout,*) ' !!!! ALERT !!! '
  248. WRITE(numout,*) ' !!!! Something is wrong in the LIM3 initialization procedure '
  249. WRITE(numout,*)
  250. WRITE(numout,*) ' *** ztests is not equal to 4 '
  251. WRITE(numout,*) ' *** ztest_i (i=1,4) = ', ztest_1, ztest_2, ztest_3, ztest_4
  252. WRITE(numout,*) ' zat_i_ini : ', zat_i_ini(i_hemis)
  253. WRITE(numout,*) ' zht_i_ini : ', zht_i_ini(i_hemis)
  254. ENDIF ! ztests .NE. 4
  255. ENDIF
  256. END DO ! i_hemis
  257. !---------------------------------------------------------------------
  258. ! 3.3) Space-dependent arrays for ice state variables
  259. !---------------------------------------------------------------------
  260. ! Ice concentration, thickness and volume, ice salinity, ice age, surface temperature
  261. DO jl = 1, jpl ! loop over categories
  262. DO jj = 1, jpj
  263. DO ji = 1, jpi
  264. a_i(ji,jj,jl) = zswitch(ji,jj) * za_i_ini (jl,zhemis(ji,jj)) ! concentration
  265. ht_i(ji,jj,jl) = zswitch(ji,jj) * zh_i_ini(jl,zhemis(ji,jj)) ! ice thickness
  266. ht_s(ji,jj,jl) = ht_i(ji,jj,jl) * ( zht_s_ini( zhemis(ji,jj) ) / zht_i_ini( zhemis(ji,jj) ) ) ! snow depth
  267. sm_i(ji,jj,jl) = zswitch(ji,jj) * zsm_i_ini(zhemis(ji,jj)) ! salinity
  268. o_i(ji,jj,jl) = zswitch(ji,jj) * 0._wp ! age (0 day)
  269. t_su(ji,jj,jl) = zswitch(ji,jj) * ztm_i_ini(zhemis(ji,jj)) + ( 1._wp - zswitch(ji,jj) ) * rt0 ! surf temp
  270. ! This case below should not be used if (ht_s/ht_i) is ok in namelist
  271. ! In case snow load is in excess that would lead to transformation from snow to ice
  272. ! Then, transfer the snow excess into the ice (different from limthd_dh)
  273. zdh = MAX( 0._wp, ( rhosn * ht_s(ji,jj,jl) + ( rhoic - rau0 ) * ht_i(ji,jj,jl) ) * r1_rau0 )
  274. ! recompute ht_i, ht_s avoiding out of bounds values
  275. ht_i(ji,jj,jl) = MIN( hi_max(jl), ht_i(ji,jj,jl) + zdh )
  276. ht_s(ji,jj,jl) = MAX( 0._wp, ht_s(ji,jj,jl) - zdh * rhoic * r1_rhosn )
  277. ! ice volume, salt content, age content
  278. v_i(ji,jj,jl) = ht_i(ji,jj,jl) * a_i(ji,jj,jl) ! ice volume
  279. v_s(ji,jj,jl) = ht_s(ji,jj,jl) * a_i(ji,jj,jl) ! snow volume
  280. smv_i(ji,jj,jl) = MIN( sm_i(ji,jj,jl) , sss_m(ji,jj) ) * v_i(ji,jj,jl) ! salt content
  281. oa_i(ji,jj,jl) = o_i(ji,jj,jl) * a_i(ji,jj,jl) ! age content
  282. END DO
  283. END DO
  284. END DO
  285. ! for constant salinity in time
  286. IF( nn_icesal == 1 .OR. nn_icesal == 3 ) THEN
  287. CALL lim_var_salprof
  288. smv_i = sm_i * v_i
  289. ENDIF
  290. ! Snow temperature and heat content
  291. DO jk = 1, nlay_s
  292. DO jl = 1, jpl ! loop over categories
  293. DO jj = 1, jpj
  294. DO ji = 1, jpi
  295. t_s(ji,jj,jk,jl) = zswitch(ji,jj) * ztm_i_ini(zhemis(ji,jj)) + ( 1._wp - zswitch(ji,jj) ) * rt0
  296. ! Snow energy of melting
  297. e_s(ji,jj,jk,jl) = zswitch(ji,jj) * rhosn * ( cpic * ( rt0 - t_s(ji,jj,jk,jl) ) + lfus )
  298. ! Mutliply by volume, and divide by number of layers to get heat content in J/m2
  299. e_s(ji,jj,jk,jl) = e_s(ji,jj,jk,jl) * v_s(ji,jj,jl) * r1_nlay_s
  300. END DO
  301. END DO
  302. END DO
  303. END DO
  304. ! Ice salinity, temperature and heat content
  305. DO jk = 1, nlay_i
  306. DO jl = 1, jpl ! loop over categories
  307. DO jj = 1, jpj
  308. DO ji = 1, jpi
  309. t_i(ji,jj,jk,jl) = zswitch(ji,jj) * ztm_i_ini(zhemis(ji,jj)) + ( 1._wp - zswitch(ji,jj) ) * rt0
  310. s_i(ji,jj,jk,jl) = zswitch(ji,jj) * zsm_i_ini(zhemis(ji,jj)) !+ ( 1._wp - zswitch(ji,jj) ) * rn_simin
  311. ztmelts = - tmut * s_i(ji,jj,jk,jl) + rt0 !Melting temperature in K
  312. ! heat content per unit volume
  313. e_i(ji,jj,jk,jl) = zswitch(ji,jj) * rhoic * ( cpic * ( ztmelts - t_i(ji,jj,jk,jl) ) &
  314. + lfus * ( 1._wp - (ztmelts-rt0) / MIN((t_i(ji,jj,jk,jl)-rt0),-epsi20) ) &
  315. - rcp * ( ztmelts - rt0 ) )
  316. ! Mutliply by ice volume, and divide by number of layers to get heat content in J/m2
  317. e_i(ji,jj,jk,jl) = e_i(ji,jj,jk,jl) * v_i(ji,jj,jl) * r1_nlay_i
  318. END DO
  319. END DO
  320. END DO
  321. END DO
  322. tn_ice (:,:,:) = t_su (:,:,:)
  323. ELSE
  324. ! if ln_iceini=false
  325. a_i (:,:,:) = 0._wp
  326. v_i (:,:,:) = 0._wp
  327. v_s (:,:,:) = 0._wp
  328. smv_i(:,:,:) = 0._wp
  329. oa_i (:,:,:) = 0._wp
  330. ht_i (:,:,:) = 0._wp
  331. ht_s (:,:,:) = 0._wp
  332. sm_i (:,:,:) = 0._wp
  333. o_i (:,:,:) = 0._wp
  334. e_i(:,:,:,:) = 0._wp
  335. e_s(:,:,:,:) = 0._wp
  336. DO jl = 1, jpl
  337. DO jk = 1, nlay_i
  338. t_i(:,:,jk,jl) = rt0 * tmask(:,:,1)
  339. END DO
  340. DO jk = 1, nlay_s
  341. t_s(:,:,jk,jl) = rt0 * tmask(:,:,1)
  342. END DO
  343. END DO
  344. ENDIF ! ln_iceini
  345. at_i (:,:) = 0.0_wp
  346. DO jl = 1, jpl
  347. at_i (:,:) = at_i (:,:) + a_i (:,:,jl)
  348. END DO
  349. !
  350. !--------------------------------------------------------------------
  351. ! 4) Global ice variables for output diagnostics |
  352. !--------------------------------------------------------------------
  353. u_ice (:,:) = 0._wp
  354. v_ice (:,:) = 0._wp
  355. stress1_i(:,:) = 0._wp
  356. stress2_i(:,:) = 0._wp
  357. stress12_i(:,:) = 0._wp
  358. !--------------------------------------------------------------------
  359. ! 5) Moments for advection
  360. !--------------------------------------------------------------------
  361. sxopw (:,:) = 0._wp
  362. syopw (:,:) = 0._wp
  363. sxxopw(:,:) = 0._wp
  364. syyopw(:,:) = 0._wp
  365. sxyopw(:,:) = 0._wp
  366. sxice (:,:,:) = 0._wp ; sxsn (:,:,:) = 0._wp ; sxa (:,:,:) = 0._wp
  367. syice (:,:,:) = 0._wp ; sysn (:,:,:) = 0._wp ; sya (:,:,:) = 0._wp
  368. sxxice(:,:,:) = 0._wp ; sxxsn(:,:,:) = 0._wp ; sxxa (:,:,:) = 0._wp
  369. syyice(:,:,:) = 0._wp ; syysn(:,:,:) = 0._wp ; syya (:,:,:) = 0._wp
  370. sxyice(:,:,:) = 0._wp ; sxysn(:,:,:) = 0._wp ; sxya (:,:,:) = 0._wp
  371. sxc0 (:,:,:) = 0._wp ; sxe (:,:,:,:)= 0._wp
  372. syc0 (:,:,:) = 0._wp ; sye (:,:,:,:)= 0._wp
  373. sxxc0 (:,:,:) = 0._wp ; sxxe (:,:,:,:)= 0._wp
  374. syyc0 (:,:,:) = 0._wp ; syye (:,:,:,:)= 0._wp
  375. sxyc0 (:,:,:) = 0._wp ; sxye (:,:,:,:)= 0._wp
  376. sxsal (:,:,:) = 0._wp
  377. sysal (:,:,:) = 0._wp
  378. sxxsal (:,:,:) = 0._wp
  379. syysal (:,:,:) = 0._wp
  380. sxysal (:,:,:) = 0._wp
  381. sxage (:,:,:) = 0._wp
  382. syage (:,:,:) = 0._wp
  383. sxxage (:,:,:) = 0._wp
  384. syyage (:,:,:) = 0._wp
  385. sxyage (:,:,:) = 0._wp
  386. CALL wrk_dealloc( jpi, jpj, zswitch )
  387. CALL wrk_dealloc( jpi, jpj, zhemis )
  388. CALL wrk_dealloc( jpl, 2, zh_i_ini, za_i_ini, zv_i_ini )
  389. CALL wrk_dealloc( 2, zht_i_ini, zat_i_ini, zvt_i_ini, zht_s_ini, zsm_i_ini, ztm_i_ini )
  390. END SUBROUTINE lim_istate
  391. SUBROUTINE lim_istate_init
  392. !!-------------------------------------------------------------------
  393. !! *** ROUTINE lim_istate_init ***
  394. !!
  395. !! ** Purpose : Definition of initial state of the ice
  396. !!
  397. !! ** Method : Read the namiceini namelist and check the parameter
  398. !! values called at the first timestep (nit000)
  399. !!
  400. !! ** input :
  401. !! Namelist namiceini
  402. !!
  403. !! history :
  404. !! 8.5 ! 03-08 (C. Ethe) original code
  405. !! 8.5 ! 07-11 (M. Vancoppenolle) rewritten initialization
  406. !!-----------------------------------------------------------------------------
  407. NAMELIST/namiceini/ ln_iceini, rn_thres_sst, rn_hts_ini_n, rn_hts_ini_s, rn_hti_ini_n, rn_hti_ini_s, &
  408. & rn_ati_ini_n, rn_ati_ini_s, rn_smi_ini_n, rn_smi_ini_s, rn_tmi_ini_n, rn_tmi_ini_s
  409. INTEGER :: ios ! Local integer output status for namelist read
  410. !!-----------------------------------------------------------------------------
  411. !
  412. REWIND( numnam_ice_ref ) ! Namelist namiceini in reference namelist : Ice initial state
  413. READ ( numnam_ice_ref, namiceini, IOSTAT = ios, ERR = 901)
  414. 901 IF( ios /= 0 ) CALL ctl_nam ( ios , 'namiceini in reference namelist', lwp )
  415. REWIND( numnam_ice_cfg ) ! Namelist namiceini in configuration namelist : Ice initial state
  416. READ ( numnam_ice_cfg, namiceini, IOSTAT = ios, ERR = 902 )
  417. 902 IF( ios /= 0 ) CALL ctl_nam ( ios , 'namiceini in configuration namelist', lwp )
  418. IF(lwm) WRITE ( numoni, namiceini )
  419. ! Define the initial parameters
  420. ! -------------------------
  421. IF(lwp) THEN
  422. WRITE(numout,*)
  423. WRITE(numout,*) 'lim_istate_init : ice parameters inititialisation '
  424. WRITE(numout,*) '~~~~~~~~~~~~~~~'
  425. WRITE(numout,*) ' initialization with ice (T) or not (F) ln_iceini = ', ln_iceini
  426. WRITE(numout,*) ' threshold water temp. for initial sea-ice rn_thres_sst = ', rn_thres_sst
  427. WRITE(numout,*) ' initial snow thickness in the north rn_hts_ini_n = ', rn_hts_ini_n
  428. WRITE(numout,*) ' initial snow thickness in the south rn_hts_ini_s = ', rn_hts_ini_s
  429. WRITE(numout,*) ' initial ice thickness in the north rn_hti_ini_n = ', rn_hti_ini_n
  430. WRITE(numout,*) ' initial ice thickness in the south rn_hti_ini_s = ', rn_hti_ini_s
  431. WRITE(numout,*) ' initial ice concentr. in the north rn_ati_ini_n = ', rn_ati_ini_n
  432. WRITE(numout,*) ' initial ice concentr. in the north rn_ati_ini_s = ', rn_ati_ini_s
  433. WRITE(numout,*) ' initial ice salinity in the north rn_smi_ini_n = ', rn_smi_ini_n
  434. WRITE(numout,*) ' initial ice salinity in the south rn_smi_ini_s = ', rn_smi_ini_s
  435. WRITE(numout,*) ' initial ice/snw temp in the north rn_tmi_ini_n = ', rn_tmi_ini_n
  436. WRITE(numout,*) ' initial ice/snw temp in the south rn_tmi_ini_s = ', rn_tmi_ini_s
  437. ENDIF
  438. END SUBROUTINE lim_istate_init
  439. #else
  440. !!----------------------------------------------------------------------
  441. !! Default option : Empty module NO LIM sea-ice model
  442. !!----------------------------------------------------------------------
  443. CONTAINS
  444. SUBROUTINE lim_istate ! Empty routine
  445. END SUBROUTINE lim_istate
  446. #endif
  447. !!======================================================================
  448. END MODULE limistate