- Timestamp:
- 2015-07-10T13:28:53+02:00 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2014/dev_r4765_CNRS_agrif/NEMOGCM/NEMO/LIM_SRC_3/limistate.F90
r4793 r5581 6 6 !! History : 2.0 ! 2004-01 (C. Ethe, G. Madec) Original code 7 7 !! 4.0 ! 2011-02 (G. Madec) dynamical allocation 8 !! - ! 201 2 (C. Rousset) add par_oce (for jp_sal)...bug?8 !! - ! 2014 (C. Rousset) add N/S initializations 9 9 !!---------------------------------------------------------------------- 10 10 #if defined key_lim3 … … 22 22 USE eosbn2 ! equation of state 23 23 USE ice ! sea-ice variables 24 USE par_ice ! ice parameters25 24 USE par_oce ! ocean parameters 26 25 USE dom_ice ! sea-ice domain … … 29 28 USE lib_fortran ! Fortran utilities (allows no signed zero when 'key_nosignedzero' defined) 30 29 USE wrk_nemo ! work arrays 31 USE cpl_oasis3, ONLY : lk_cpl32 30 33 31 IMPLICIT NONE … … 36 34 PUBLIC lim_istate ! routine called by lim_init.F90 37 35 38 !! * Module variables39 36 ! !!** init namelist (namiceini) ** 40 REAL(wp) :: thres_sst ! threshold water temperature for initial sea ice41 REAL(wp) :: hts_ini_n ! initial snow thickness in the north42 REAL(wp) :: hts_ini_s ! initial snow thickness in the south43 REAL(wp) :: hti_ini_n ! initial ice thickness in the north44 REAL(wp) :: hti_ini_s ! initial ice thickness in the south45 REAL(wp) :: ati_ini_n ! initial leads area in the north46 REAL(wp) :: ati_ini_s ! initial leads area in the south47 REAL(wp) :: smi_ini_n ! initial salinity48 REAL(wp) :: smi_ini_s ! initial salinity49 REAL(wp) :: tmi_ini_n ! initial temperature50 REAL(wp) :: tmi_ini_s ! initial temperature51 52 LOGICAL :: ln_ limini ! initialization or not37 REAL(wp) :: rn_thres_sst ! threshold water temperature for initial sea ice 38 REAL(wp) :: rn_hts_ini_n ! initial snow thickness in the north 39 REAL(wp) :: rn_hts_ini_s ! initial snow thickness in the south 40 REAL(wp) :: rn_hti_ini_n ! initial ice thickness in the north 41 REAL(wp) :: rn_hti_ini_s ! initial ice thickness in the south 42 REAL(wp) :: rn_ati_ini_n ! initial leads area in the north 43 REAL(wp) :: rn_ati_ini_s ! initial leads area in the south 44 REAL(wp) :: rn_smi_ini_n ! initial salinity 45 REAL(wp) :: rn_smi_ini_s ! initial salinity 46 REAL(wp) :: rn_tmi_ini_n ! initial temperature 47 REAL(wp) :: rn_tmi_ini_s ! initial temperature 48 49 LOGICAL :: ln_iceini ! initialization or not 53 50 !!---------------------------------------------------------------------- 54 51 !! LIM 3.0, UCL-LOCEAN-IPSL (2008) … … 56 53 !! Software governed by the CeCILL licence (modipsl/doc/NEMO_CeCILL.txt) 57 54 !!---------------------------------------------------------------------- 58 59 55 CONTAINS 60 56 … … 80 76 !! 81 77 !! ** Notes : o_i, t_su, t_s, t_i, s_i must be filled everywhere, even 82 !! where there is no ice (clem: I do not know why but it is mandatory)78 !! where there is no ice (clem: I do not know why, is it mandatory?) 83 79 !! 84 80 !! History : … … 90 86 !! * Local variables 91 87 INTEGER :: ji, jj, jk, jl ! dummy loop indices 92 REAL(wp) :: epsi20,ztmelts, zdh88 REAL(wp) :: ztmelts, zdh 93 89 INTEGER :: i_hemis, i_fill, jl0 94 90 REAL(wp) :: ztest_1, ztest_2, ztest_3, ztest_4, ztests, zsigma, zarg, zA, zV, zA_cons, zV_cons, zconv … … 104 100 CALL wrk_alloc( 2, zht_i_ini, zat_i_ini, zvt_i_ini, zht_s_ini, zsm_i_ini, ztm_i_ini ) 105 101 106 epsi20 = 1.e-20_wp107 108 102 IF(lwp) WRITE(numout,*) 109 103 IF(lwp) WRITE(numout,*) 'lim_istate : Ice initialization ' … … 116 110 CALL lim_istate_init ! reading the initials parameters of the ice 117 111 118 # if defined key_coupled119 albege(:,:) = 0.8 * tms(:,:)120 # endif121 122 112 ! surface temperature 123 113 DO jl = 1, jpl ! loop over categories 124 t_su (:,:,jl) = rtt * tms(:,:) 125 tn_ice(:,:,jl) = rtt * tms(:,:) 126 END DO 127 ! Basal temperature is set to the freezing point of seawater in Kelvin 128 t_bo(:,:) = ( tfreez( tsn(:,:,1,jp_sal) ) + rt0 ) * tms(:,:) 129 130 IF( ln_limini ) THEN 114 t_su (:,:,jl) = rt0 * tmask(:,:,1) 115 tn_ice(:,:,jl) = rt0 * tmask(:,:,1) 116 END DO 117 118 ! basal temperature (considered at freezing point) 119 CALL eos_fzp( sss_m(:,:), t_bo(:,:) ) 120 t_bo(:,:) = ( t_bo(:,:) + rt0 ) * tmask(:,:,1) 121 122 IF( ln_iceini ) THEN 131 123 132 124 !-------------------------------------------------------------------- 133 125 ! 2) Basal temperature, ice mask and hemispheric index 134 126 !-------------------------------------------------------------------- 135 ! ice if sst <= t-freez + thres_sst 136 DO jj = 1, jpj 127 128 DO jj = 1, jpj ! ice if sst <= t-freez + ttest 137 129 DO ji = 1, jpi 138 IF( ( tsn(ji,jj,1,jp_tem) - ( t_bo(ji,jj) - rt0 ) ) * tms(ji,jj) >=thres_sst ) THEN139 zswitch(ji,jj) = 0._wp * tm s(ji,jj) ! no ice130 IF( ( sst_m(ji,jj) - ( t_bo(ji,jj) - rt0 ) ) * tmask(ji,jj,1) >= rn_thres_sst ) THEN 131 zswitch(ji,jj) = 0._wp * tmask(ji,jj,1) ! no ice 140 132 ELSE 141 zswitch(ji,jj) = 1._wp * tm s(ji,jj) ! ice133 zswitch(ji,jj) = 1._wp * tmask(ji,jj,1) ! ice 142 134 ENDIF 143 135 END DO … … 146 138 147 139 ! Hemispheric index 148 ! MV 2011 new initialization149 140 DO jj = 1, jpj 150 141 DO ji = 1, jpi … … 156 147 END DO 157 148 END DO 158 ! END MV 2011 new initialization159 149 160 150 !-------------------------------------------------------------------- … … 166 156 !----------------------------- 167 157 ! assign initial thickness, concentration, snow depth and salinity to an hemisphere-dependent array 168 zht_i_ini(1) = hti_ini_n ; zht_i_ini(2) =hti_ini_s ! ice thickness169 zht_s_ini(1) = hts_ini_n ; zht_s_ini(2) =hts_ini_s ! snow depth170 zat_i_ini(1) = ati_ini_n ; zat_i_ini(2) =ati_ini_s ! ice concentration171 zsm_i_ini(1) = smi_ini_n ; zsm_i_ini(2) =smi_ini_s ! bulk ice salinity172 ztm_i_ini(1) = tmi_ini_n ; ztm_i_ini(2) =tmi_ini_s ! temperature (ice and snow)158 zht_i_ini(1) = rn_hti_ini_n ; zht_i_ini(2) = rn_hti_ini_s ! ice thickness 159 zht_s_ini(1) = rn_hts_ini_n ; zht_s_ini(2) = rn_hts_ini_s ! snow depth 160 zat_i_ini(1) = rn_ati_ini_n ; zat_i_ini(2) = rn_ati_ini_s ! ice concentration 161 zsm_i_ini(1) = rn_smi_ini_n ; zsm_i_ini(2) = rn_smi_ini_s ! bulk ice salinity 162 ztm_i_ini(1) = rn_tmi_ini_n ; ztm_i_ini(2) = rn_tmi_ini_s ! temperature (ice and snow) 173 163 174 164 zvt_i_ini(:) = zht_i_ini(:) * zat_i_ini(:) ! ice volume … … 205 195 !--- Ice thicknesses in the i_fill - 1 first categories 206 196 DO jl = 1, i_fill - 1 207 zh_i_ini(jl,i_hemis) = 0.5 * ( hi_max(jl) + hi_max(jl-1))197 zh_i_ini(jl,i_hemis) = hi_mean(jl) 208 198 END DO 209 199 210 200 !--- jl0: most likely index where cc will be maximum 211 201 DO jl = 1, jpl 212 IF ( ( zht_i_ini(i_hemis) .GT.hi_max(jl-1) ) .AND. &213 ( zht_i_ini(i_hemis) .LE.hi_max(jl) ) ) THEN202 IF ( ( zht_i_ini(i_hemis) > hi_max(jl-1) ) .AND. & 203 & ( zht_i_ini(i_hemis) <= hi_max(jl) ) ) THEN 214 204 jl0 = jl 215 205 ENDIF … … 275 265 276 266 ! Test 3: thickness of the last category is in-bounds ? 277 IF ( zh_i_ini(i_fill, i_hemis) .GT.hi_max(i_fill-1) ) THEN267 IF ( zh_i_ini(i_fill, i_hemis) > hi_max(i_fill-1) ) THEN 278 268 ztest_3 = 1 279 269 ELSE … … 325 315 DO ji = 1, jpi 326 316 a_i(ji,jj,jl) = zswitch(ji,jj) * za_i_ini (jl,zhemis(ji,jj)) ! concentration 327 ht_i(ji,jj,jl) = zswitch(ji,jj) * zh_i_ini(jl,zhemis(ji,jj)) ! ice thickness317 ht_i(ji,jj,jl) = zswitch(ji,jj) * zh_i_ini(jl,zhemis(ji,jj)) ! ice thickness 328 318 ht_s(ji,jj,jl) = ht_i(ji,jj,jl) * ( zht_s_ini( zhemis(ji,jj) ) / zht_i_ini( zhemis(ji,jj) ) ) ! snow depth 329 sm_i(ji,jj,jl) = zswitch(ji,jj) * zsm_i_ini(zhemis(ji,jj)) !+ ( 1._wp - zswitch(ji,jj) ) * s_i_min! salinity330 o_i(ji,jj,jl) = zswitch(ji,jj) * 1._wp + ( 1._wp - zswitch(ji,jj) ) ! age331 t_su(ji,jj,jl) = zswitch(ji,jj) * ztm_i_ini(zhemis(ji,jj)) + ( 1._wp - zswitch(ji,jj) ) * rt t! surf temp319 sm_i(ji,jj,jl) = zswitch(ji,jj) * zsm_i_ini(zhemis(ji,jj)) ! salinity 320 o_i(ji,jj,jl) = zswitch(ji,jj) * 1._wp ! age (1 day) 321 t_su(ji,jj,jl) = zswitch(ji,jj) * ztm_i_ini(zhemis(ji,jj)) + ( 1._wp - zswitch(ji,jj) ) * rt0 ! surf temp 332 322 333 323 ! This case below should not be used if (ht_s/ht_i) is ok in namelist … … 337 327 ! recompute ht_i, ht_s avoiding out of bounds values 338 328 ht_i(ji,jj,jl) = MIN( hi_max(jl), ht_i(ji,jj,jl) + zdh ) 339 ht_s(ji,jj,jl) = MAX( 0._wp, ht_s(ji,jj,jl) - zdh * rhoic /rhosn )329 ht_s(ji,jj,jl) = MAX( 0._wp, ht_s(ji,jj,jl) - zdh * rhoic * r1_rhosn ) 340 330 341 331 ! ice volume, salt content, age content … … 344 334 smv_i(ji,jj,jl) = MIN( sm_i(ji,jj,jl) , sss_m(ji,jj) ) * v_i(ji,jj,jl) ! salt content 345 335 oa_i(ji,jj,jl) = o_i(ji,jj,jl) * a_i(ji,jj,jl) ! age content 346 END DO ! ji347 END DO ! jj348 END DO ! jl336 END DO 337 END DO 338 END DO 349 339 350 340 ! Snow temperature and heat content … … 353 343 DO jj = 1, jpj 354 344 DO ji = 1, jpi 355 t_s(ji,jj,jk,jl) = zswitch(ji,jj) * ztm_i_ini(zhemis(ji,jj)) + ( 1._wp - zswitch(ji,jj) ) * rt t345 t_s(ji,jj,jk,jl) = zswitch(ji,jj) * ztm_i_ini(zhemis(ji,jj)) + ( 1._wp - zswitch(ji,jj) ) * rt0 356 346 ! Snow energy of melting 357 e_s(ji,jj,jk,jl) = zswitch(ji,jj) * rhosn * ( cpic * ( rtt - t_s(ji,jj,jk,jl) ) + lfus ) 358 ! Change dimensions 359 e_s(ji,jj,jk,jl) = e_s(ji,jj,jk,jl) / unit_fac 360 ! Multiply by volume, so that heat content in Joules 361 e_s(ji,jj,jk,jl) = e_s(ji,jj,jk,jl) * area(ji,jj) * v_s(ji,jj,jl) / nlay_s 362 END DO ! ji 363 END DO ! jj 364 END DO ! jl 365 END DO ! jk 347 e_s(ji,jj,jk,jl) = zswitch(ji,jj) * rhosn * ( cpic * ( rt0 - t_s(ji,jj,jk,jl) ) + lfus ) 348 349 ! Mutliply by volume, and divide by number of layers to get heat content in J/m2 350 e_s(ji,jj,jk,jl) = e_s(ji,jj,jk,jl) * v_s(ji,jj,jl) * r1_nlay_s 351 END DO 352 END DO 353 END DO 354 END DO 366 355 367 356 ! Ice salinity, temperature and heat content … … 370 359 DO jj = 1, jpj 371 360 DO ji = 1, jpi 372 t_i(ji,jj,jk,jl) = zswitch(ji,jj) * ztm_i_ini(zhemis(ji,jj)) + ( 1._wp - zswitch(ji,jj) ) * rt t373 s_i(ji,jj,jk,jl) = zswitch(ji,jj) * zsm_i_ini(zhemis(ji,jj)) !+ ( 1._wp - zswitch(ji,jj) ) * s_i_min374 ztmelts = - tmut * s_i(ji,jj,jk,jl) + rt t!Melting temperature in K361 t_i(ji,jj,jk,jl) = zswitch(ji,jj) * ztm_i_ini(zhemis(ji,jj)) + ( 1._wp - zswitch(ji,jj) ) * rt0 362 s_i(ji,jj,jk,jl) = zswitch(ji,jj) * zsm_i_ini(zhemis(ji,jj)) !+ ( 1._wp - zswitch(ji,jj) ) * rn_simin 363 ztmelts = - tmut * s_i(ji,jj,jk,jl) + rt0 !Melting temperature in K 375 364 376 365 ! heat content per unit volume 377 366 e_i(ji,jj,jk,jl) = zswitch(ji,jj) * rhoic * ( cpic * ( ztmelts - t_i(ji,jj,jk,jl) ) & 378 + lfus * ( 1._wp - (ztmelts-rtt) / MIN((t_i(ji,jj,jk,jl)-rtt),-epsi20) ) & 379 - rcp * ( ztmelts - rtt ) ) 380 381 ! Correct dimensions to avoid big values 382 e_i(ji,jj,jk,jl) = e_i(ji,jj,jk,jl) / unit_fac 383 384 ! Mutliply by ice volume, and divide by number of layers to get heat content in J 385 e_i(ji,jj,jk,jl) = e_i(ji,jj,jk,jl) * area(ji,jj) * v_i(ji,jj,jl) / nlay_i 386 END DO ! ji 387 END DO ! jj 388 END DO ! jl 389 END DO ! jk 367 + lfus * ( 1._wp - (ztmelts-rt0) / MIN((t_i(ji,jj,jk,jl)-rt0),-epsi20) ) & 368 - rcp * ( ztmelts - rt0 ) ) 369 370 ! Mutliply by ice volume, and divide by number of layers to get heat content in J/m2 371 e_i(ji,jj,jk,jl) = e_i(ji,jj,jk,jl) * v_i(ji,jj,jl) * r1_nlay_i 372 END DO 373 END DO 374 END DO 375 END DO 390 376 391 377 tn_ice (:,:,:) = t_su (:,:,:) 392 378 393 379 ELSE 394 ! if ln_ limini=false380 ! if ln_iceini=false 395 381 a_i (:,:,:) = 0._wp 396 382 v_i (:,:,:) = 0._wp … … 408 394 DO jl = 1, jpl 409 395 DO jk = 1, nlay_i 410 t_i(:,:,jk,jl) = rt t * tms(:,:)396 t_i(:,:,jk,jl) = rt0 * tmask(:,:,1) 411 397 END DO 412 398 DO jk = 1, nlay_s 413 t_s(:,:,jk,jl) = rt t * tms(:,:)399 t_s(:,:,jk,jl) = rt0 * tmask(:,:,1) 414 400 END DO 415 401 END DO 416 402 417 ENDIF ! ln_ limini403 ENDIF ! ln_iceini 418 404 419 405 at_i (:,:) = 0.0_wp … … 489 475 !! 8.5 ! 07-11 (M. Vancoppenolle) rewritten initialization 490 476 !!----------------------------------------------------------------------------- 491 NAMELIST/namiceini/ ln_ limini, thres_sst, hts_ini_n, hts_ini_s, hti_ini_n,hti_ini_s, &492 & ati_ini_n, ati_ini_s, smi_ini_n, smi_ini_s, tmi_ini_n,tmi_ini_s477 NAMELIST/namiceini/ ln_iceini, rn_thres_sst, rn_hts_ini_n, rn_hts_ini_s, rn_hti_ini_n, rn_hti_ini_s, & 478 & rn_ati_ini_n, rn_ati_ini_s, rn_smi_ini_n, rn_smi_ini_s, rn_tmi_ini_n, rn_tmi_ini_s 493 479 INTEGER :: ios ! Local integer output status for namelist read 494 480 !!----------------------------------------------------------------------------- … … 510 496 WRITE(numout,*) 'lim_istate_init : ice parameters inititialisation ' 511 497 WRITE(numout,*) '~~~~~~~~~~~~~~~' 512 WRITE(numout,*) ' initialization with ice (T) or not (F) ln_ limini = ', ln_limini513 WRITE(numout,*) ' threshold water temp. for initial sea-ice thres_sst = ',thres_sst514 WRITE(numout,*) ' initial snow thickness in the north hts_ini_n = ',hts_ini_n515 WRITE(numout,*) ' initial snow thickness in the south hts_ini_s = ',hts_ini_s516 WRITE(numout,*) ' initial ice thickness in the north hti_ini_n = ',hti_ini_n517 WRITE(numout,*) ' initial ice thickness in the south hti_ini_s = ',hti_ini_s518 WRITE(numout,*) ' initial ice concentr. in the north ati_ini_n = ',ati_ini_n519 WRITE(numout,*) ' initial ice concentr. in the north ati_ini_s = ',ati_ini_s520 WRITE(numout,*) ' initial ice salinity in the north smi_ini_n = ',smi_ini_n521 WRITE(numout,*) ' initial ice salinity in the south smi_ini_s = ',smi_ini_s522 WRITE(numout,*) ' initial ice/snw temp in the north tmi_ini_n = ',tmi_ini_n523 WRITE(numout,*) ' initial ice/snw temp in the south tmi_ini_s = ',tmi_ini_s498 WRITE(numout,*) ' initialization with ice (T) or not (F) ln_iceini = ', ln_iceini 499 WRITE(numout,*) ' threshold water temp. for initial sea-ice rn_thres_sst = ', rn_thres_sst 500 WRITE(numout,*) ' initial snow thickness in the north rn_hts_ini_n = ', rn_hts_ini_n 501 WRITE(numout,*) ' initial snow thickness in the south rn_hts_ini_s = ', rn_hts_ini_s 502 WRITE(numout,*) ' initial ice thickness in the north rn_hti_ini_n = ', rn_hti_ini_n 503 WRITE(numout,*) ' initial ice thickness in the south rn_hti_ini_s = ', rn_hti_ini_s 504 WRITE(numout,*) ' initial ice concentr. in the north rn_ati_ini_n = ', rn_ati_ini_n 505 WRITE(numout,*) ' initial ice concentr. in the north rn_ati_ini_s = ', rn_ati_ini_s 506 WRITE(numout,*) ' initial ice salinity in the north rn_smi_ini_n = ', rn_smi_ini_n 507 WRITE(numout,*) ' initial ice salinity in the south rn_smi_ini_s = ', rn_smi_ini_s 508 WRITE(numout,*) ' initial ice/snw temp in the north rn_tmi_ini_n = ', rn_tmi_ini_n 509 WRITE(numout,*) ' initial ice/snw temp in the south rn_tmi_ini_s = ', rn_tmi_ini_s 524 510 ENDIF 525 511
Note: See TracChangeset
for help on using the changeset viewer.