Changeset 5051
- Timestamp:
- 2015-02-02T18:31:34+01:00 (9 years ago)
- Location:
- branches/2015/dev_r5044_CNRS_LIM3CLEAN/NEMOGCM/NEMO
- Files:
-
- 1 added
- 1 deleted
- 22 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2015/dev_r5044_CNRS_LIM3CLEAN/NEMOGCM/NEMO/LIM_SRC_3/ice.F90
r5048 r5051 18 18 PRIVATE 19 19 20 PUBLIC ice_alloc ! Called in iceini.F9020 PUBLIC ice_alloc ! Called in sbc_lim_init 21 21 22 22 !!====================================================================== … … 303 303 REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: dh_i_melt !: net melting (m) 304 304 305 ! temporary arrays for dummy version of the code306 REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: dh_i_surf2D, dh_i_bott2D, q_s307 308 305 !!-------------------------------------------------------------------------- 309 306 !! * Ice global state variables … … 362 359 REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:,:) :: e_i_b !: ice temperatures 363 360 REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: u_ice_b, v_ice_b !: ice velocity 364 365 366 !!-------------------------------------------------------------------------- 367 !! * Increment of global variables 368 !!-------------------------------------------------------------------------- 369 ! thd refers to changes induced by thermodynamics 370 ! trp '' '' '' advection (transport of ice) 371 REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: d_a_i_thd , d_a_i_trp !: icefractions 372 REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: d_v_s_thd , d_v_s_trp !: snow volume 373 REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: d_v_i_thd , d_v_i_trp !: ice volume 374 REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: d_smv_i_thd, d_smv_i_trp !: 375 REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: d_sm_i_fl , d_sm_i_gd !: 376 REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: d_sm_i_se , d_sm_i_si , d_sm_i_la !: 377 REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: d_oa_i_thd , d_oa_i_trp !: 378 379 REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:,:) :: d_e_s_thd , d_e_s_trp !: 380 REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:,:) :: d_e_i_thd , d_e_i_trp !: 381 REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: d_u_ice_dyn, d_v_ice_dyn !: ice velocity 382 361 383 362 !!-------------------------------------------------------------------------- 384 363 !! * Ice thickness distribution variables … … 390 369 !! * Ice Run 391 370 !!-------------------------------------------------------------------------- 392 ! !!: ** Namelist namicerun read in iceini**371 ! !!: ** Namelist namicerun read in sbc_lim_init ** 393 372 CHARACTER(len=32) , PUBLIC :: cn_icerst_in !: suffix of ice restart name (input) 394 373 CHARACTER(len=32) , PUBLIC :: cn_icerst_out !: suffix of ice restart name (output) … … 400 379 !! * Ice diagnostics 401 380 !!-------------------------------------------------------------------------- 402 !! Check if everything down here is necessary 403 LOGICAL , PUBLIC :: ln_limdiahsb !: flag for ice diag (T) or not (F) 404 LOGICAL , PUBLIC :: ln_limdiaout !: flag for ice diag (T) or not (F) 405 REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: dv_dt_thd !: thermodynamic growth rates 406 REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: diag_trp_vi !: transport of ice volume 407 REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: diag_trp_vs !: transport of snw volume 408 REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: diag_trp_ei !: transport of ice enthalpy (W/m2) 409 REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: diag_trp_es !: transport of snw enthalpy (W/m2) 381 ! Increment of global variables 382 ! thd refers to changes induced by thermodynamics 383 ! trp '' '' '' advection (transport of ice) 384 REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: d_a_i_thd , d_a_i_trp !: icefractions 385 REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: d_v_s_thd , d_v_s_trp !: snow volume 386 REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: d_v_i_thd , d_v_i_trp !: ice volume 387 REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: d_smv_i_thd, d_smv_i_trp !: 388 REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: d_oa_i_thd , d_oa_i_trp !: 389 390 REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:,:) :: d_e_s_thd , d_e_s_trp !: 391 REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:,:) :: d_e_i_thd , d_e_i_trp !: 392 REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: d_u_ice_dyn, d_v_ice_dyn !: ice velocity 393 394 LOGICAL , PUBLIC :: ln_limdiahsb !: flag for ice diag (T) or not (F) 395 LOGICAL , PUBLIC :: ln_limdiaout !: flag for ice diag (T) or not (F) 396 REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: diag_trp_vi !: transport of ice volume 397 REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: diag_trp_vs !: transport of snw volume 398 REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: diag_trp_ei !: transport of ice enthalpy (W/m2) 399 REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: diag_trp_es !: transport of snw enthalpy (W/m2) 410 400 ! 411 REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: diag_heat_dhc !: snw/ice heat content variation [W/m2]401 REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: diag_heat_dhc !: snw/ice heat content variation [W/m2] 412 402 ! 413 403 INTEGER , PUBLIC :: jiindx, jjindx !: indexes of the debugging point … … 502 492 ALLOCATE( d_a_i_thd(jpi,jpj,jpl) , d_a_i_trp (jpi,jpj,jpl) , d_v_s_thd (jpi,jpj,jpl) , d_v_s_trp (jpi,jpj,jpl) , & 503 493 & d_v_i_thd(jpi,jpj,jpl) , d_v_i_trp (jpi,jpj,jpl) , d_smv_i_thd(jpi,jpj,jpl) , d_smv_i_trp(jpi,jpj,jpl) , & 504 & d_sm_i_fl(jpi,jpj,jpl) , d_sm_i_gd (jpi,jpj,jpl) , d_sm_i_se (jpi,jpj,jpl) , d_sm_i_si (jpi,jpj,jpl) , & 505 & d_sm_i_la(jpi,jpj,jpl) , d_oa_i_thd(jpi,jpj,jpl) , d_oa_i_trp (jpi,jpj,jpl) , & 494 & d_oa_i_thd(jpi,jpj,jpl) , d_oa_i_trp (jpi,jpj,jpl) , & 506 495 & STAT=ierr(ii) ) 507 496 ii = ii + 1 … … 515 504 ! * Ice diagnostics 516 505 ii = ii + 1 517 ALLOCATE( dv_dt_thd(jpi,jpj,jpl), & 518 & diag_trp_vi(jpi,jpj), diag_trp_vs (jpi,jpj), diag_trp_ei(jpi,jpj), & 506 ALLOCATE( diag_trp_vi(jpi,jpj), diag_trp_vs (jpi,jpj), diag_trp_ei(jpi,jpj), & 519 507 & diag_trp_es(jpi,jpj), diag_heat_dhc(jpi,jpj), STAT=ierr(ii) ) 520 508 -
branches/2015/dev_r5044_CNRS_LIM3CLEAN/NEMOGCM/NEMO/LIM_SRC_3/limcat_1D.F90
r4333 r5051 28 28 USE lbclnk 29 29 USE timing ! Timing 30 USE wrk_nemo 30 31 31 32 IMPLICIT NONE … … 37 38 CONTAINS 38 39 39 SUBROUTINE lim_cat_1D( zhti,zhts,zai,zht_i,zht_s,za_i)40 SUBROUTINE lim_cat_1D( zhti, zhts, zai, zht_i, zht_s, za_i ) 40 41 !! Local variables 41 42 INTEGER :: ji, jk, jl ! dummy loop indices 42 INTEGER :: ijpij, i_fill, jl0 , ztest_1, ztest_2, ztest_3, ztest_4, ztests43 REAL(wp) :: zarg, zV, zconv 43 INTEGER :: ijpij, i_fill, jl0 44 REAL(wp) :: zarg, zV, zconv, zdh 44 45 REAL(wp), DIMENSION(:), INTENT(in) :: zhti, zhts, zai ! input ice/snow variables 45 46 REAL(wp), DIMENSION(:,:), INTENT(inout) :: zht_i, zht_s, za_i ! output ice/snow variables 46 REAL(wp) :: epsi06 = 1.0e-6 47 REAL(wp) :: zc1, zc2, zc3, zx1, zdh ! local scalars 48 REAL(wp), DIMENSION(0:jpl) :: zhi_max !:Boundary of ice thickness categories in thickness space 47 INTEGER , POINTER, DIMENSION(:) :: itest 49 48 50 49 IF( nn_timing == 1 ) CALL timing_start('limcat_1D') 50 51 CALL wrk_alloc( 4, itest ) 51 52 !-------------------------------------------------------------------- 52 53 ! initialisation of variables … … 66 67 ! cannot be filled, so we try to fill jpl-1 categories... 67 68 ! And so forth iteratively until the number of categories filled 68 ! fulfills ice volume concervation between input and output ( ztests=4)69 ! fulfills ice volume concervation between input and output (itest=4) 69 70 !-------------------------------------------------------------------------------------- 70 71 71 !- Thickness categories boundaries72 ! hi_max is calculated in iceini.F90 but since limcat_1D.F90 routine73 ! is called before (in bdydta.F90), one must recalculate it.74 ! Note clem: there may be a way of doing things cleaner75 !----------------------------------76 zhi_max(:) = 0._wp77 zc1 = 3._wp / REAL( jpl , wp ) ; zc2 = 10._wp * zc1 ; zc3 = 3._wp78 DO jl = 1, jpl79 zx1 = REAL( jl-1 , wp ) / REAL( jpl , wp )80 zhi_max(jl) = zhi_max(jl-1) + zc1 + zc2 * ( 1._wp + TANH( zc3 * ( zx1 - 1._wp ) ) )81 END DO82 83 72 ! ---------------------------------------- 84 73 ! distribution over the jpl ice categories … … 89 78 90 79 ! initialisation of tests 91 ztest_1 = 0 92 ztest_2 = 0 93 ztest_3 = 0 94 ztest_4 = 0 95 ztests = 0 80 itest(:) = 0 96 81 97 i_fill = jpl + 1 !====================================98 DO WHILE ( ( ztests/= 4 ) .AND. ( i_fill >= 2 ) ) ! iterative loop on i_fill categories99 ! iteration !====================================82 i_fill = jpl + 1 !==================================== 83 DO WHILE ( ( SUM( itest(:) ) /= 4 ) .AND. ( i_fill >= 2 ) ) ! iterative loop on i_fill categories 84 ! iteration !==================================== 100 85 i_fill = i_fill - 1 101 86 … … 108 93 zht_i(ji,1) = zhti(ji) 109 94 za_i (ji,1) = zai (ji) 110 ! *** case ice is thicker: fill categories >1 95 96 ! *** case ice is thicker: fill categories >1 111 97 ELSE 112 98 113 ! Fill ice thicknesses except the last one (i_fill) by (hmax-hmin)/299 ! Fill ice thicknesses except the last one (i_fill) by hmean 114 100 DO jl = 1, i_fill - 1 115 zht_i(ji,jl) = ( zhi_max(jl) + zhi_max(jl-1) ) * 0.5_wp101 zht_i(ji,jl) = hi_mean(jl) 116 102 END DO 117 103 … … 119 105 jl0 = i_fill 120 106 DO jl = 1, i_fill 121 IF ( ( zhti(ji) >= zhi_max(jl-1) ) .AND. ( zhti(ji) < zhi_max(jl) ) ) THEN107 IF ( ( zhti(ji) >= hi_max(jl-1) ) .AND. ( zhti(ji) < hi_max(jl) ) ) THEN 122 108 jl0 = jl 123 109 CYCLE … … 129 115 DO jl = 1, i_fill - 1 130 116 IF ( jl == jl0 ) CYCLE 131 zarg 117 zarg = ( zht_i(ji,jl) - zhti(ji) ) / ( zhti(ji) * 0.5_wp ) 132 118 za_i(ji,jl) = za_i (ji,jl0) * EXP(-zarg**2) 133 119 END DO … … 138 124 ! Ice thickness in the last (i_fill) category 139 125 zV = SUM( za_i(ji,1:i_fill-1) * zht_i(ji,1:i_fill-1) ) 140 zht_i(ji,i_fill) = ( zhti(ji) *zai(ji) -zV ) / za_i(ji,i_fill)126 zht_i(ji,i_fill) = ( zhti(ji) * zai(ji) - zV ) / za_i(ji,i_fill) 141 127 142 128 ENDIF ! case ice is thick or thin … … 147 133 ! Test 1: area conservation 148 134 zconv = ABS( zai(ji) - SUM( za_i(ji,1:jpl) ) ) 149 IF ( zconv < epsi06 ) ztest_1= 1135 IF ( zconv < epsi06 ) itest(1) = 1 150 136 151 137 ! Test 2: volume conservation 152 138 zconv = ABS( zhti(ji)*zai(ji) - SUM( za_i(ji,1:jpl)*zht_i(ji,1:jpl) ) ) 153 IF ( zconv < epsi06 ) ztest_2= 1139 IF ( zconv < epsi06 ) itest(2) = 1 154 140 155 141 ! Test 3: thickness of the last category is in-bounds ? 156 IF ( zht_i(ji,i_fill) >= zhi_max(i_fill-1) ) ztest_3= 1142 IF ( zht_i(ji,i_fill) >= hi_max(i_fill-1) ) itest(3) = 1 157 143 158 144 ! Test 4: positivity of ice concentrations 159 ztest_4= 1145 itest(4) = 1 160 146 DO jl = 1, i_fill 161 IF ( za_i(ji,jl) < 0._wp ) ztest_4 = 0 162 END DO 163 164 ztests = ztest_1 + ztest_2 + ztest_3 + ztest_4 147 IF ( za_i(ji,jl) < 0._wp ) itest(4) = 0 148 END DO 165 149 !============================ 166 150 END DO ! end iteration on categories 167 151 !============================ 168 ! Check if tests have passed (i.e. volume conservation...)169 !IF ( ztests /= 4 ) THEN170 ! WRITE(numout,*) ' !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! '171 ! WRITE(numout,*) ' !! ALERT categories distribution !!'172 ! WRITE(numout,*) ' !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! '173 ! WRITE(numout,*) ' *** ztests is not equal to 4 '174 ! WRITE(numout,*) ' *** ztest (1:4) = ', ztest_1, ztest_2, ztest_3, ztest_4175 ! WRITE(numout,*) 'i_fill=',i_fill176 ! WRITE(numout,*) 'zai(ji)=',zai(ji)177 ! WRITE(numout,*) 'za_i(ji,jpl)=',za_i(ji,:)178 !ENDIF179 180 152 ENDIF ! if zhti > 0 181 182 153 END DO ! i loop 183 154 … … 193 164 zdh = MAX( 0._wp, ( rhosn * zht_s(ji,jl) + ( rhoic - rau0 ) * zht_i(ji,jl) ) * r1_rau0 ) 194 165 ! recompute ht_i, ht_s avoiding out of bounds values 195 zht_i(ji,jl) = MIN( zhi_max(jl), zht_i(ji,jl) + zdh )166 zht_i(ji,jl) = MIN( hi_max(jl), zht_i(ji,jl) + zdh ) 196 167 zht_s(ji,jl) = MAX( 0._wp, zht_s(ji,jl) - zdh * rhoic / rhosn ) 197 168 ENDIF … … 199 170 ENDDO 200 171 172 CALL wrk_dealloc( 4, itest ) 173 ! 201 174 IF( nn_timing == 1 ) CALL timing_stop('limcat_1D') 202 175 -
branches/2015/dev_r5044_CNRS_LIM3CLEAN/NEMOGCM/NEMO/LIM_SRC_3/limdiahsb.F90
r4990 r5051 32 32 33 33 PUBLIC lim_diahsb ! routine called by ice_step.F90 34 !!PUBLIC lim_diahsb_init ! routine called by ice_init.F9035 !!PUBLIC lim_diahsb_rst ! routine called by ice_init.F9036 34 37 35 real(wp) :: frc_sal, frc_vol ! global forcing trends -
branches/2015/dev_r5044_CNRS_LIM3CLEAN/NEMOGCM/NEMO/LIM_SRC_3/limistate.F90
r4990 r5051 87 87 !! * Local variables 88 88 INTEGER :: ji, jj, jk, jl ! dummy loop indices 89 REAL(wp) :: epsi20,ztmelts, zdh89 REAL(wp) :: ztmelts, zdh 90 90 INTEGER :: i_hemis, i_fill, jl0 91 91 REAL(wp) :: ztest_1, ztest_2, ztest_3, ztest_4, ztests, zsigma, zarg, zA, zV, zA_cons, zV_cons, zconv … … 100 100 CALL wrk_alloc( jpl, 2, zh_i_ini, za_i_ini, zv_i_ini ) 101 101 CALL wrk_alloc( 2, zht_i_ini, zat_i_ini, zvt_i_ini, zht_s_ini, zsm_i_ini, ztm_i_ini ) 102 103 epsi20 = 1.e-20_wp104 102 105 103 IF(lwp) WRITE(numout,*) … … 197 195 !--- Ice thicknesses in the i_fill - 1 first categories 198 196 DO jl = 1, i_fill - 1 199 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) 200 198 END DO 201 199 202 200 !--- jl0: most likely index where cc will be maximum 203 201 DO jl = 1, jpl 204 IF ( ( zht_i_ini(i_hemis) .GT.hi_max(jl-1) ) .AND. &205 ( 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 206 204 jl0 = jl 207 205 ENDIF … … 267 265 268 266 ! Test 3: thickness of the last category is in-bounds ? 269 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 270 268 ztest_3 = 1 271 269 ELSE -
branches/2015/dev_r5044_CNRS_LIM3CLEAN/NEMOGCM/NEMO/LIM_SRC_3/limitd_me.F90
r4990 r5051 27 27 USE wrk_nemo ! work arrays 28 28 USE prtctl ! Print control 29 ! Check budget (Rousset) 29 30 30 USE iom ! I/O manager 31 31 USE lib_fortran ! glob_sum … … 40 40 PUBLIC lim_itd_me_icestrength 41 41 PUBLIC lim_itd_me_init 42 PUBLIC lim_itd_me_zapsmall 43 PUBLIC lim_itd_me_alloc ! called by iceini.F90 42 PUBLIC lim_itd_me_alloc ! called by sbc_lim_init 44 43 45 44 !----------------------------------------------------------------------- … … 375 374 !-----------------------------------------------------------------------------! 376 375 CALL lim_var_glo2eqv 377 CALL lim_ itd_me_zapsmall376 CALL lim_var_zapsmall 378 377 379 378 … … 632 631 633 632 ! ! Zero out categories with very small areas 634 CALL lim_ itd_me_zapsmall633 CALL lim_var_zapsmall 635 634 636 635 !------------------------------------------------------------------------------! … … 1375 1374 END SUBROUTINE lim_itd_me_init 1376 1375 1377 1378 SUBROUTINE lim_itd_me_zapsmall1379 !!-------------------------------------------------------------------1380 !! *** ROUTINE lim_itd_me_zapsmall ***1381 !!1382 !! ** Purpose : Remove too small sea ice areas and correct salt fluxes1383 !!1384 !! history :1385 !! author: William H. Lipscomb, LANL1386 !! Nov 2003: Modified by Julie Schramm to conserve volume and energy1387 !! Sept 2004: Modified by William Lipscomb; replaced normalize_state with1388 !! additions to local freshwater, salt, and heat fluxes1389 !! 9.0, LIM3.0 - 02-2006 (M. Vancoppenolle) original code1390 !!-------------------------------------------------------------------1391 INTEGER :: ji, jj, jl, jk ! dummy loop indices1392 INTEGER :: icells ! number of cells with ice to zap1393 1394 REAL(wp), POINTER, DIMENSION(:,:) :: zmask ! 2D workspace1395 REAL(wp) :: zmask_glo, zsal, zvi, zvs, zei, zes1396 !!gm REAL(wp) :: xtmp ! temporary variable1397 !!-------------------------------------------------------------------1398 1399 CALL wrk_alloc( jpi, jpj, zmask )1400 1401 ! to be sure that at_i is the sum of a_i(jl)1402 at_i(:,:) = SUM( a_i(:,:,:), dim=3 )1403 1404 DO jl = 1, jpl1405 !-----------------------------------------------------------------1406 ! Count categories to be zapped.1407 !-----------------------------------------------------------------1408 icells = 01409 zmask(:,:) = 0._wp1410 DO jj = 1, jpj1411 DO ji = 1, jpi1412 IF( a_i(ji,jj,jl) <= epsi10 .OR. v_i(ji,jj,jl) <= epsi10 .OR. at_i(ji,jj) <= epsi10 ) THEN1413 zmask(ji,jj) = 1._wp1414 ENDIF1415 END DO1416 END DO1417 !zmask_glo = glob_sum(zmask)1418 !IF( ln_nicep .AND. lwp ) WRITE(numout,*) zmask_glo, ' cells of ice zapped in the ocean '1419 1420 !-----------------------------------------------------------------1421 ! Zap ice energy and use ocean heat to melt ice1422 !-----------------------------------------------------------------1423 1424 DO jk = 1, nlay_i1425 DO jj = 1 , jpj1426 DO ji = 1 , jpi1427 zei = e_i(ji,jj,jk,jl)1428 e_i(ji,jj,jk,jl) = e_i(ji,jj,jk,jl) * ( 1._wp - zmask(ji,jj) )1429 t_i(ji,jj,jk,jl) = t_i(ji,jj,jk,jl) * ( 1._wp - zmask(ji,jj) ) + rtt * zmask(ji,jj)1430 ! update exchanges with ocean1431 hfx_res(ji,jj) = hfx_res(ji,jj) + ( e_i(ji,jj,jk,jl) - zei ) * unit_fac / area(ji,jj) * r1_rdtice ! W.m-2 <01432 END DO1433 END DO1434 END DO1435 1436 DO jj = 1 , jpj1437 DO ji = 1 , jpi1438 1439 zsal = smv_i(ji,jj,jl)1440 zvi = v_i(ji,jj,jl)1441 zvs = v_s(ji,jj,jl)1442 zes = e_s(ji,jj,1,jl)1443 !-----------------------------------------------------------------1444 ! Zap snow energy and use ocean heat to melt snow1445 !-----------------------------------------------------------------1446 ! xtmp = esnon(i,j,n) / dt ! < 01447 ! fhnet(i,j) = fhnet(i,j) + xtmp1448 ! fhnet_hist(i,j) = fhnet_hist(i,j) + xtmp1449 ! xtmp is greater than 01450 ! fluxes are positive to the ocean1451 ! here the flux has to be negative for the ocean1452 t_s(ji,jj,1,jl) = rtt * zmask(ji,jj) + t_s(ji,jj,1,jl) * ( 1._wp - zmask(ji,jj) )1453 1454 !-----------------------------------------------------------------1455 ! zap ice and snow volume, add water and salt to ocean1456 !-----------------------------------------------------------------1457 ato_i(ji,jj) = a_i (ji,jj,jl) * zmask(ji,jj) + ato_i(ji,jj)1458 a_i (ji,jj,jl) = a_i (ji,jj,jl) * ( 1._wp - zmask(ji,jj) )1459 v_i (ji,jj,jl) = v_i (ji,jj,jl) * ( 1._wp - zmask(ji,jj) )1460 v_s (ji,jj,jl) = v_s (ji,jj,jl) * ( 1._wp - zmask(ji,jj) )1461 t_su (ji,jj,jl) = t_su (ji,jj,jl) * ( 1._wp - zmask(ji,jj) ) + t_bo(ji,jj) * zmask(ji,jj)1462 oa_i (ji,jj,jl) = oa_i (ji,jj,jl) * ( 1._wp - zmask(ji,jj) )1463 smv_i(ji,jj,jl) = smv_i(ji,jj,jl) * ( 1._wp - zmask(ji,jj) )1464 e_s(ji,jj,1,jl) = e_s(ji,jj,1,jl) * ( 1._wp - zmask(ji,jj) )1465 ! additional condition1466 IF( v_s(ji,jj,jl) <= epsi10 ) THEN1467 v_s(ji,jj,jl) = 0._wp1468 e_s(ji,jj,1,jl) = 0._wp1469 ENDIF1470 ! update exchanges with ocean1471 sfx_res(ji,jj) = sfx_res(ji,jj) - ( smv_i(ji,jj,jl) - zsal ) * rhoic * r1_rdtice1472 wfx_res(ji,jj) = wfx_res(ji,jj) - ( v_i(ji,jj,jl) - zvi ) * rhoic * r1_rdtice1473 wfx_snw(ji,jj) = wfx_snw(ji,jj) - ( v_s(ji,jj,jl) - zvs ) * rhosn * r1_rdtice1474 hfx_res(ji,jj) = hfx_res(ji,jj) + ( e_s(ji,jj,1,jl) - zes ) * unit_fac / area(ji,jj) * r1_rdtice ! W.m-2 <01475 END DO1476 END DO1477 END DO ! jl1478 1479 ! to be sure that at_i is the sum of a_i(jl)1480 at_i(:,:) = SUM( a_i(:,:,:), dim=3 )1481 !1482 CALL wrk_dealloc( jpi, jpj, zmask )1483 !1484 END SUBROUTINE lim_itd_me_zapsmall1485 1486 1376 #else 1487 1377 !!---------------------------------------------------------------------- … … 1497 1387 SUBROUTINE lim_itd_me_init 1498 1388 END SUBROUTINE lim_itd_me_init 1499 SUBROUTINE lim_itd_me_zapsmall1500 END SUBROUTINE lim_itd_me_zapsmall1501 1389 #endif 1502 1390 !!====================================================================== -
branches/2015/dev_r5044_CNRS_LIM3CLEAN/NEMOGCM/NEMO/LIM_SRC_3/limitd_th.F90
r5048 r5051 954 954 zshiftflag = 0 955 955 956 !clem-change957 956 DO jj = 1, jpj 958 957 DO ji = 1, jpi … … 976 975 zdvice(:,:,jl) = 0._wp 977 976 ENDIF 978 !clem-change979 977 980 978 ! ! clem-change begin: why not doing that? -
branches/2015/dev_r5044_CNRS_LIM3CLEAN/NEMOGCM/NEMO/LIM_SRC_3/limmsh.F90
r4161 r5051 23 23 PRIVATE 24 24 25 PUBLIC lim_msh ! routine called by ice_ini.F9025 PUBLIC lim_msh ! routine called by sbcice_lim.F90 26 26 27 27 !!---------------------------------------------------------------------- -
branches/2015/dev_r5044_CNRS_LIM3CLEAN/NEMOGCM/NEMO/LIM_SRC_3/limrhg.F90
r5047 r5051 129 129 130 130 REAL(wp) :: zresm ! Maximal error on ice velocity 131 REAL(wp) :: zdummy ! dummy argument132 131 REAL(wp) :: zintb, zintn ! dummy argument 133 132 … … 636 635 !CDIR NOVERRCHK 637 636 DO ji = fs_2, fs_jpim1 638 zdummy = vt_i(ji,jj) 639 IF ( zdummy .LE. hminrhg ) THEN 637 IF ( vt_i(ji,jj) .LE. hminrhg ) THEN 640 638 u_ice(ji,jj) = u_oce(ji,jj) 641 639 v_ice(ji,jj) = v_oce(ji,jj) 642 ENDIF ! zdummy640 ENDIF 643 641 END DO 644 642 END DO … … 657 655 DO jj = k_j1+1, k_jpj-1 658 656 DO ji = fs_2, fs_jpim1 659 zdummy = vt_i(ji,jj) 660 IF ( zdummy .LE. hminrhg ) THEN 657 IF ( vt_i(ji,jj) .LE. hminrhg ) THEN 661 658 v_ice1(ji,jj) = 0.5*( (v_ice(ji,jj)+v_ice(ji,jj-1))*e1t(ji+1,jj) & 662 659 & +(v_ice(ji+1,jj)+v_ice(ji+1,jj-1))*e1t(ji,jj)) & … … 666 663 & +(u_ice(ji,jj+1)+u_ice(ji-1,jj+1))*e2t(ji,jj)) & 667 664 & /(e2t(ji,jj+1)+e2t(ji,jj)) * tmv(ji,jj) 668 ENDIF ! zdummy665 ENDIF 669 666 END DO 670 667 END DO … … 680 677 !- divu_i(:,:), zdt(:,:): divergence and tension at centre 681 678 !- zds(:,:): shear on northeast corner of grid cells 682 zdummy = vt_i(ji,jj) 683 IF ( zdummy .LE. hminrhg ) THEN 679 IF ( vt_i(ji,jj) .LE. hminrhg ) THEN 684 680 685 681 divu_i(ji,jj) = ( e2u(ji,jj)*u_ice(ji,jj) & … … 718 714 delta_i(ji,jj) = delta + creepl 719 715 720 ENDIF ! zdummy716 ENDIF 721 717 722 718 END DO !jj -
branches/2015/dev_r5044_CNRS_LIM3CLEAN/NEMOGCM/NEMO/LIM_SRC_3/limrst.F90
r4990 r5051 33 33 PUBLIC lim_rst_opn ! routine called by icestep.F90 34 34 PUBLIC lim_rst_write ! routine called by icestep.F90 35 PUBLIC lim_rst_read ! routine called by iceini.F9035 PUBLIC lim_rst_read ! routine called by sbc_lim_init 36 36 37 37 LOGICAL, PUBLIC :: lrst_ice !: logical to control the ice restart write … … 165 165 CALL iom_rstput( iter, nitrst, numriw, 'stress2_i' , stress2_i ) 166 166 CALL iom_rstput( iter, nitrst, numriw, 'stress12_i' , stress12_i ) 167 CALL iom_rstput( iter, nitrst, numriw, 'snwice_mass' , snwice_mass ) !clem modif168 CALL iom_rstput( iter, nitrst, numriw, 'snwice_mass_b', snwice_mass_b ) !clem modif167 CALL iom_rstput( iter, nitrst, numriw, 'snwice_mass' , snwice_mass ) 168 CALL iom_rstput( iter, nitrst, numriw, 'snwice_mass_b', snwice_mass_b ) 169 169 170 170 DO jl = 1, jpl … … 395 395 CALL iom_get( numrir, jpdom_autoglo, 'stress2_i' , stress2_i ) 396 396 CALL iom_get( numrir, jpdom_autoglo, 'stress12_i', stress12_i ) 397 CALL iom_get( numrir, jpdom_autoglo, 'snwice_mass' , snwice_mass ) !clem modif398 CALL iom_get( numrir, jpdom_autoglo, 'snwice_mass_b', snwice_mass_b ) !clem modif397 CALL iom_get( numrir, jpdom_autoglo, 'snwice_mass' , snwice_mass ) 398 CALL iom_get( numrir, jpdom_autoglo, 'snwice_mass_b', snwice_mass_b ) 399 399 400 400 DO jl = 1, jpl -
branches/2015/dev_r5044_CNRS_LIM3CLEAN/NEMOGCM/NEMO/LIM_SRC_3/limsbc.F90
r5020 r5051 40 40 USE prtctl ! Print control 41 41 USE lib_fortran ! Fortran utilities (allows no signed zero when 'key_nosignedzero' defined) 42 USE traqsr ! clem: add penetration of solar flux intothe calculation of heat budget42 USE traqsr ! add penetration of solar flux in the calculation of heat budget 43 43 USE iom 44 44 USE domvvl ! Variable volume … … 47 47 PRIVATE 48 48 49 PUBLIC lim_sbc_init ! called by ice_init49 PUBLIC lim_sbc_init ! called by sbc_lim_init 50 50 PUBLIC lim_sbc_flx ! called by sbc_ice_lim 51 51 PUBLIC lim_sbc_tau ! called by sbc_ice_lim … … 343 343 END WHERE 344 344 ENDIF 345 ! clem modif345 346 346 IF( .NOT. ln_rstart ) THEN 347 347 fraqsr_1lev(:,:) = 1._wp 348 348 ENDIF 349 349 ! 350 ! clem: snwice_mass in the restart file now351 350 IF( .NOT. ln_rstart ) THEN 352 351 ! ! embedded sea ice -
branches/2015/dev_r5044_CNRS_LIM3CLEAN/NEMOGCM/NEMO/LIM_SRC_3/limthd.F90
r5049 r5051 49 49 50 50 PUBLIC lim_thd ! called by limstp module 51 PUBLIC lim_thd_init ! called by iceini module51 PUBLIC lim_thd_init ! called by sbc_lim_init 52 52 53 53 !! * Substitutions … … 92 92 ! 93 93 REAL(wp) :: zvi_b, zsmv_b, zei_b, zfs_b, zfw_b, zft_b 94 REAL(wp) :: zda95 94 ! 96 95 REAL(wp), POINTER, DIMENSION(:,:) :: zqsr, zqns … … 363 362 !-------------------------------- 364 363 364 !--------------------------------------! 365 ! --- Ice/Snow Temperature profile --- ! 366 !--------------------------------------! 367 CALL lim_thd_dif( 1, nbpb ) 368 365 369 !---------------------------------! 366 ! Ice/Snow Temperature profile ! 367 !---------------------------------! 368 CALL lim_thd_dif( 1, nbpb ) 369 370 !---------------------------------! 371 ! Ice/Snow thicnkess ! 370 ! --- Ice/Snow thickness --- ! 372 371 !---------------------------------! 373 372 CALL lim_thd_dh( 1, nbpb ) … … 377 376 378 377 !---------------------------------! 379 ! --- Ice salinity --- !378 ! --- Ice salinity --- ! 380 379 !---------------------------------! 381 380 CALL lim_thd_sal( 1, nbpb ) 382 381 383 382 !---------------------------------! 384 ! --- temperature update --- !383 ! --- temperature update --- ! 385 384 !---------------------------------! 386 385 CALL lim_thd_temp( 1, nbpb ) 386 387 !------------------------------------! 388 ! --- lateral melting if monocat --- ! 389 !------------------------------------! 390 IF ( ( ( nn_monocat == 1 ) .OR. ( nn_monocat == 4 ) ) .AND. ( jpl == 1 ) ) THEN 391 CALL lim_thd_lam( 1, nbpb ) 392 END IF 387 393 388 394 !-------------------------------- … … 435 441 CALL tab_1d_2d( nbpb, hfx_err , npb, hfx_err_1d(1:nbpb) , jpi, jpj ) 436 442 CALL tab_1d_2d( nbpb, hfx_res , npb, hfx_res_1d(1:nbpb) , jpi, jpj ) 437 CALL tab_1d_2d( nbpb, hfx_err_rem , npb, hfx_err_rem_1d(1:nbpb) 438 439 IF ( ( ( nn_monocat .EQ. 1 ) .OR. ( nn_monocat .EQ.4 ) ) .AND. ( jpl == 1 ) ) THEN440 CALL tab_1d_2d( nbpb, dh_i_melt(:,:,jl) , npb, dh_i_melt_1d(1:nbpb) , jpi, jpj )441 ENDIF443 CALL tab_1d_2d( nbpb, hfx_err_rem , npb, hfx_err_rem_1d(1:nbpb), jpi, jpj ) 444 445 !clem IF ( ( ( nn_monocat == 1 ) .OR. ( nn_monocat == 4 ) ) .AND. ( jpl == 1 ) ) THEN 446 !clem CALL tab_1d_2d( nbpb, dh_i_melt(:,:,jl) , npb, dh_i_melt_1d(1:nbpb) , jpi, jpj ) 447 !clem ENDIF 442 448 ! 443 449 CALL tab_1d_2d( nbpb, qns_ice(:,:,jl), npb, qns_ice_1d(1:nbpb) , jpi, jpj) … … 477 483 !---------------------------------- 478 484 CALL lim_var_eqv2glo 479 480 !----------------------------------481 ! 5.X) Lateral melting482 !----------------------------------483 IF ( ( ( nn_monocat .EQ. 1 ) .OR. ( nn_monocat .EQ. 4 ) ) .AND. ( jpl == 1 ) ) THEN484 485 WRITE(numout,*) ' Lateral melting ON '486 487 ! select points where lateral melting occurs488 jl = 1489 490 nbplm = 0491 DO jj = 1, jpj492 DO ji = 1, jpi493 IF ( ( dh_i_melt(ji,jj,jl) .LT.-epsi10 ) .AND. &494 & ( ht_i(ji,jj,jl) - dh_i_melt(ji,jj,jl) .GT. epsi10 ) .AND. &495 & ( ht_i(ji,jj,jl) .GT. epsi10 ) ) THEN496 nbplm = nbplm + 1497 nplm(nbplm) = (jj - 1) * jpi + ji498 ENDIF499 END DO500 END DO501 502 IF( nbplm > 0 ) THEN ! If there is no net melting, do nothing503 504 ! Move to 1D arrays505 !-------------------------506 507 CALL tab_2d_1d( nbplm, a_i_1d (1:nbplm), a_i(:,:,jl) , jpi, jpj, nplm(1:nbplm) )508 CALL tab_2d_1d( nbplm, ht_i_1d (1:nbplm), ht_i(:,:,jl) , jpi, jpj, nplm(1:nbplm) )509 CALL tab_2d_1d( nbplm, dh_i_melt_1d(1:nbplm), dh_i_melt(:,:,jl) , jpi, jpj, nplm(1:nbplm) )510 511 ! Compute lateral melting (dA = A/2h dh )512 DO ji = 1, nbplm513 zda = a_i_1d(ji) * dh_i_melt_1d(ji) / ( 2._wp * ht_i_1d(ji) )514 a_i_1d(ji) = a_i_1d(ji) + zda515 END DO516 517 ! Move back to 2D arrays518 !-------------------------519 CALL tab_1d_2d( nbplm, a_i (:,:,jl) , nplm, a_i_1d (1:nbplm) , jpi, jpj )520 at_i(:,:) = a_i(:,:,jl)521 522 ENDIF523 524 ENDIF525 485 526 486 !-------------------------------------------- … … 602 562 END SUBROUTINE lim_thd_temp 603 563 564 SUBROUTINE lim_thd_lam( kideb, kiut ) 565 !!----------------------------------------------------------------------- 566 !! *** ROUTINE lim_thd_lam *** 567 !! 568 !! ** Purpose : Lateral melting in case monocategory 569 !! ( dA = A/2h dh ) 570 !!----------------------------------------------------------------------- 571 INTEGER, INTENT(in) :: kideb, kiut ! bounds for the spatial loop 572 INTEGER :: ji ! dummy loop indices 573 574 WRITE(numout,*) ' Lateral melting ON ' 575 DO ji = kideb, kiut 576 IF( ht_i_1d(ji) > epsi10 .AND. dh_i_melt_1d(ji) < 0._wp ) THEN 577 a_i_1d(ji) = MAX( 0._wp, a_i_1d(ji) + a_i_1d(ji) * dh_i_melt_1d(ji) / ( 2._wp * ht_i_1d(ji) ) ) 578 END IF 579 END DO 580 at_i_1d(:) = a_i_1d(:) 581 582 END SUBROUTINE lim_thd_lam 583 604 584 SUBROUTINE lim_thd_init 605 585 !!----------------------------------------------------------------------- -
branches/2015/dev_r5044_CNRS_LIM3CLEAN/NEMOGCM/NEMO/LIM_SRC_3/limthd_dh.F90
r5048 r5051 412 412 ENDIF 413 413 414 ! clem debug.Just to be sure that enthalpy at nlay_i+1 is null414 ! Just to be sure that enthalpy at nlay_i+1 is null 415 415 DO ji = kideb, kiut 416 416 q_i_1d(ji,nlay_i+1) = 0._wp … … 694 694 !------------------------------------------------------------- 695 695 ! 696 IF ( ( ( nn_monocat .EQ. 1 ) .OR. ( nn_monocat .EQ.4 ) ) .AND. ( jpl == 1 ) ) THEN696 IF ( ( ( nn_monocat == 1 ) .OR. ( nn_monocat == 4 ) ) .AND. ( jpl == 1 ) ) THEN 697 697 DO ji = kideb, kiut 698 698 dh_i_melt_1d(ji) = MIN( dh_i_surf(ji) + dh_i_bott(ji) + dh_snowice(ji), 0._wp ) -
branches/2015/dev_r5044_CNRS_LIM3CLEAN/NEMOGCM/NEMO/LIM_SRC_3/limthd_dif.F90
r5048 r5051 116 116 REAL(wp) :: zhsu 117 117 118 REAL(wp), POINTER, DIMENSION(:) :: ztfs ! ice melting point119 118 REAL(wp), POINTER, DIMENSION(:) :: ztsub ! old surface temperature (before the iterative procedure ) 120 119 REAL(wp), POINTER, DIMENSION(:) :: ztsubit ! surface temperature at previous iteration … … 170 169 ! 171 170 CALL wrk_alloc( jpij, numeqmin, numeqmax, isnow ) 172 CALL wrk_alloc( jpij, zt fs, ztsub, ztsubit, zh_i, zh_s, zfsw )171 CALL wrk_alloc( jpij, ztsub, ztsubit, zh_i, zh_s, zfsw ) 173 172 CALL wrk_alloc( jpij, zf, dzf, zerrit, zdifcase, zftrice, zihic, zghe ) 174 173 CALL wrk_alloc( jpij, nlay_i+1, ztcond_i, zradtr_i, zradab_i, zkappa_i, ztib, zeta_i, ztitemp, z_i, zspeche_i, kjstart=0) … … 189 188 ! 1) Initialization ! 190 189 !------------------------------------------------------------------------------! 191 ! clem clean: replace just ztfs by rtt192 190 DO ji = kideb , kiut 193 191 ! is there snow or not 194 192 isnow(ji)= NINT( 1._wp - MAX( 0._wp , SIGN(1._wp, - ht_s_1d(ji) ) ) ) 195 ! surface temperature of fusion196 ztfs(ji) = REAL( isnow(ji) ) * rtt + REAL( 1 - isnow(ji) ) * rtt197 193 ! layer thickness 198 194 zh_i(ji) = ht_i_1d(ji) / REAL( nlay_i ) … … 296 292 ztsub (ji) = t_su_1d(ji) ! temperature at the beg of iter pr. 297 293 ztsubit(ji) = t_su_1d(ji) ! temperature at the previous iter 298 t_su_1d (ji) = MIN( t_su_1d(ji), ztfs(ji) - ztsu_err )! necessary299 zerrit (ji) = 1000._wp 294 t_su_1d (ji) = MIN( t_su_1d(ji), rtt - ztsu_err ) ! necessary 295 zerrit (ji) = 1000._wp ! initial value of error 300 296 END DO 301 297 … … 723 719 isnow(ji) = NINT( 1.0 - MAX( 0.0 , SIGN( 1.0 , -ht_s_1d(ji) ) ) ) 724 720 ztsubit(ji) = t_su_1d(ji) 725 IF( t_su_1d(ji) < ztfs(ji)) &721 IF( t_su_1d(ji) < rtt ) & 726 722 t_su_1d(ji) = ( zindtbis(ji,numeqmin(ji)) - ztrid(ji,numeqmin(ji),3)* ( REAL( isnow(ji) )*t_s_1d(ji,1) & 727 723 & + REAL( 1 - isnow(ji) )*t_i_1d(ji,1) ) ) / zdiagbis(ji,numeqmin(ji)) … … 735 731 ! zerrit(ji) is a measure of error, it has to be under maxer_i_thd 736 732 DO ji = kideb , kiut 737 t_su_1d(ji) = MAX( MIN( t_su_1d(ji) , ztfs(ji)) , 190._wp )733 t_su_1d(ji) = MAX( MIN( t_su_1d(ji) , rtt ) , 190._wp ) 738 734 zerrit(ji) = ABS( t_su_1d(ji) - ztsubit(ji) ) 739 735 END DO … … 832 828 ! 833 829 CALL wrk_dealloc( jpij, numeqmin, numeqmax, isnow ) 834 CALL wrk_dealloc( jpij, zt fs, ztsub, ztsubit, zh_i, zh_s, zfsw )830 CALL wrk_dealloc( jpij, ztsub, ztsubit, zh_i, zh_s, zfsw ) 835 831 CALL wrk_dealloc( jpij, zf, dzf, zerrit, zdifcase, zftrice, zihic, zghe ) 836 832 CALL wrk_dealloc( jpij, nlay_i+1, ztcond_i, zradtr_i, zradab_i, zkappa_i, & -
branches/2015/dev_r5044_CNRS_LIM3CLEAN/NEMOGCM/NEMO/LIM_SRC_3/limthd_ent.F90
r4990 r5051 87 87 88 88 !-------------------------------------------------------------------------- 89 ! 1) Cumulative integral of old enthalpy * thic nkess and layers interfaces89 ! 1) Cumulative integral of old enthalpy * thickness and layers interfaces 90 90 !-------------------------------------------------------------------------- 91 91 zqh_cum0(:,0:nlay_i+2) = 0._wp -
branches/2015/dev_r5044_CNRS_LIM3CLEAN/NEMOGCM/NEMO/LIM_SRC_3/limthd_sal.F90
r5047 r5051 30 30 31 31 PUBLIC lim_thd_sal ! called by limthd module 32 PUBLIC lim_thd_sal_init ! called by iceini module32 PUBLIC lim_thd_sal_init ! called by sbc_lim_init 33 33 34 34 !!---------------------------------------------------------------------- -
branches/2015/dev_r5044_CNRS_LIM3CLEAN/NEMOGCM/NEMO/LIM_SRC_3/limtrp.F90
r5048 r5051 22 22 USE limadv ! ice advection 23 23 USE limhdf ! ice horizontal diffusion 24 USE limvar ! clem for ice thickness correction 25 ! 24 26 USE in_out_manager ! I/O manager 25 27 USE lbclnk ! lateral boundary conditions -- MPP exchanges … … 28 30 USE prtctl ! Print control 29 31 USE lib_fortran ! Fortran utilities (allows no signed zero when 'key_nosignedzero' defined) 30 USE limvar ! clem for ice thickness correction 31 USE timing ! Timing 32 USE timing ! Timing 32 33 USE limcons ! conservation tests 33 34 … … 35 36 PRIVATE 36 37 37 PUBLIC lim_trp ! called by ice_step 38 PUBLIC lim_trp ! called by sbcice_lim 39 40 INTEGER :: ncfl ! number of ice time step with CFL>1/2 38 41 39 42 !! * Substitution … … 60 63 INTEGER, INTENT(in) :: kt ! number of iteration 61 64 ! 62 INTEGER :: ji, jj, jk, jl, j n! dummy loop indices65 INTEGER :: ji, jj, jk, jl, jt ! dummy loop indices 63 66 INTEGER :: initad ! number of sub-timestep for the advection 64 67 REAL(wp) :: zcfl , zusnit ! - - 68 CHARACTER(len=80) :: cltmp 65 69 ! 66 REAL(wp), POINTER, DIMENSION(:,:) :: zui_u, zvi_v, zsm, zs0at, zs0ow 67 REAL(wp), POINTER, DIMENSION(:,:,:) :: zs0ice, zs0sn, zs0a, zs0c0 , zs0sm , zs0oi 70 REAL(wp), POINTER, DIMENSION(:,:) :: zsm, zs0at 71 REAL(wp), POINTER, DIMENSION(:,:,:) :: zs0ice, zs0sn, zs0a, zs0c0 , zs0sm , zs0oi, zzs0e 72 REAL(wp), POINTER, DIMENSION(:,:,:) :: zs0ow 68 73 REAL(wp), POINTER, DIMENSION(:,:,:,:) :: zs0e 69 REAL(wp), POINTER, DIMENSION(:,:,:) :: zviold, zvsold ! old ice volume...70 REAL(wp), POINTER, DIMENSION(:,:,:) :: z aiold, zhimax ! old ice concentration andthickness71 REAL(wp), POINTER, DIMENSION(:,:) :: z eiold, zesold ! oldenthalpies72 REAL(wp) :: zdv, z da, zvi, zvs, zsmv, zes, zei74 REAL(wp), POINTER, DIMENSION(:,:,:) :: zviold, zvsold ! old ice volume... 75 REAL(wp), POINTER, DIMENSION(:,:,:) :: zhimax ! old ice thickness 76 REAL(wp), POINTER, DIMENSION(:,:) :: zatold, zeiold, zesold ! old concentration, enthalpies 77 REAL(wp) :: zdv, zvi, zvs, zsmv, zes, zei 73 78 ! 74 REAL(wp) :: zvi_b, zsmv_b, zei_b, zfs_b, zfw_b, zft_b 79 REAL(wp) :: zvi_b, zsmv_b, zei_b, zfs_b, zfw_b, zft_b 75 80 !!--------------------------------------------------------------------- 76 81 IF( nn_timing == 1 ) CALL timing_start('limtrp') 77 82 78 CALL wrk_alloc( jpi, jpj, zui_u, zvi_v, zsm, zs0at, zs0ow, zeiold, zesold )79 CALL wrk_alloc( jpi, jpj, jpl, zs0ice, zs0sn, zs0a, zs0c0 , zs0sm , zs0oi)80 CALL wrk_alloc( jpi, jpj, nlay_i+1, jpl, zs0e)81 82 CALL wrk_alloc( jpi, jpj, jpl, zaiold, zhimax, zviold, zvsold ) ! clem83 CALL wrk_alloc( jpi,jpj, zsm, zs0at, zatold, zeiold, zesold ) 84 CALL wrk_alloc( jpi,jpj,jpl, zs0ice, zs0sn, zs0a, zs0c0 , zs0sm , zs0oi, zzs0e ) 85 CALL wrk_alloc( jpi,jpj,1, zs0ow ) 86 CALL wrk_alloc( jpi,jpj,nlay_i+1,jpl, zs0e ) 87 CALL wrk_alloc( jpi,jpj,jpl, zhimax, zviold, zvsold ) 83 88 84 89 IF( numit == nstart .AND. lwp ) THEN … … 88 93 ENDIF 89 94 WRITE(numout,*) '~~~~~~~~~~~~' 95 ncfl = 0 ! nb of time step with CFL > 1/2 90 96 ENDIF 97 98 zsm(:,:) = area(:,:) 91 99 92 zsm(:,:) = area(:,:)93 94 100 ! !-------------------------------------! 95 101 IF( ln_limdyn ) THEN ! Advection of sea ice properties ! … … 97 103 98 104 ! conservation test 99 IF( ln_limdiahsb ) CALL lim_cons_hsm(0, 'limtrp', zvi_b, zsmv_b, zei_b, zfw_b, zfs_b, zft_b)100 101 ! mass and salt flux init (clem)102 zviold(:,:,:) 103 zeiold(:,:) = SUM( SUM( e_i(:,:,1:nlay_i,:), dim=4 ), dim=3 )104 zesold(:,:) = SUM( SUM( e_s(:,:,1:nlay_s,:), dim=4 ), dim=3 )105 106 !--- Thickness correction init. (clem)-------------------------------105 IF( ln_limdiahsb ) CALL lim_cons_hsm(0, 'limtrp', zvi_b, zsmv_b, zei_b, zfw_b, zfs_b, zft_b) 106 107 ! mass and salt flux init 108 zviold(:,:,:) = v_i(:,:,:) 109 zeiold(:,:) = SUM( SUM( e_i(:,:,1:nlay_i,:), dim=4 ), dim=3 ) 110 zesold(:,:) = SUM( SUM( e_s(:,:,1:nlay_s,:), dim=4 ), dim=3 ) 111 112 !--- Thickness correction init. ------------------------------- 107 113 CALL lim_var_glo2eqv 108 za iold(:,:,:) = a_i(:,:,:)114 zatold(:,:) = SUM( a_i(:,:,:), dim=3 ) 109 115 !--------------------------------------------------------------------- 110 116 ! Record max of the surrounding ice thicknesses for correction in limupdate … … 125 131 END DO 126 132 127 !------------------------- 128 ! transported fields 129 !------------------------- 130 ! Snow vol, ice vol, salt and age contents, area 131 zs0ow(:,:) = ato_i(:,:) * area(:,:) ! Open water area 132 DO jl = 1, jpl 133 zs0sn (:,:,jl) = v_s (:,:,jl) * area(:,:) ! Snow volume 134 zs0ice(:,:,jl) = v_i (:,:,jl) * area(:,:) ! Ice volume 135 zs0a (:,:,jl) = a_i (:,:,jl) * area(:,:) ! Ice area 136 zs0sm (:,:,jl) = smv_i(:,:,jl) * area(:,:) ! Salt content 137 zs0oi (:,:,jl) = oa_i (:,:,jl) * area(:,:) ! Age content 138 zs0c0 (:,:,jl) = e_s (:,:,1,jl) ! Snow heat content 139 zs0e (:,:,:,jl) = e_i (:,:,:,jl) ! Ice heat content 140 END DO 141 142 !-------------------------- 143 ! Advection of Ice fields (Prather scheme) 144 !-------------------------- 133 !=============================! 134 !== Prather scheme ==! 135 !=============================! 136 145 137 ! If ice drift field is too fast, use an appropriate time step for advection. 146 ! CFL test for stability 147 zcfl = MAXVAL( ABS( u_ice(:,:) ) * rdt_ice / e1u(:,:) ) 138 zcfl = MAXVAL( ABS( u_ice(:,:) ) * rdt_ice / e1u(:,:) ) ! CFL test for stability 148 139 zcfl = MAX( zcfl, MAXVAL( ABS( v_ice(:,:) ) * rdt_ice / e2v(:,:) ) ) 149 140 IF(lk_mpp ) CALL mpp_max( zcfl ) … … 155 146 initad = 1 + NINT( MAX( 0._wp, SIGN( 1._wp, zcfl-0.5 ) ) ) 156 147 zusnit = 1.0 / REAL( initad ) 157 IF( zcfl > 0.5 .AND. lwp ) & 158 WRITE(numout,*) 'lim_trp : CFL violation at day ', nday, ', cfl = ', zcfl, & 159 & ': the ice time stepping is split in two' 148 IF( zcfl > 0.5_wp .AND. lwp ) ncfl = ncfl + 1 149 IF( numit == nlast .AND. lwp ) THEN 150 IF( ncfl > 0 ) THEN 151 WRITE(cltmp,'(i6.1)') ncfl 152 CALL ctl_stop('STOP',TRIM(cltmp) ) 153 CALL ctl_warn( 'lim_trp: ', TRIM(cltmp), 'advective ice time-step using a split in sub-time-step ') 154 ELSE 155 WRITE(numout,*) 'lim_trp : CFL criteria for ice advection is always smaller than 1/2 ' 156 ENDIF 157 ENDIF 158 159 !------------------------- 160 ! transported fields 161 !------------------------- 162 zs0ow(:,:,1) = ato_i(:,:) * area(:,:) ! Open water area 163 DO jl = 1, jpl 164 zs0sn (:,:,jl) = v_s (:,:,jl) * area(:,:) ! Snow volume 165 zs0ice(:,:,jl) = v_i (:,:,jl) * area(:,:) ! Ice volume 166 zs0a (:,:,jl) = a_i (:,:,jl) * area(:,:) ! Ice area 167 zs0sm (:,:,jl) = smv_i(:,:,jl) * area(:,:) ! Salt content 168 zs0oi (:,:,jl) = oa_i (:,:,jl) * area(:,:) ! Age content 169 zs0c0 (:,:,jl) = e_s (:,:,1,jl) ! Snow heat content 170 zs0e (:,:,:,jl) = e_i (:,:,:,jl) ! Ice heat content 171 END DO 172 160 173 161 174 IF( MOD( ( kt - 1) / nn_fsbc , 2 ) == 0 ) THEN !== odd ice time step: adv_x then adv_y ==! 162 DO j n = 1,initad163 CALL lim_adv_x( zusnit, u_ice, 1._wp , zsm, zs0ow (:,:), sxopw(:,:), & !--- ice open water area164 & sxxopw(:,:) , syopw(:,:), syyopw(:,:), sxyopw(:,:) )165 CALL lim_adv_y( zusnit, v_ice, 0._wp, zsm, zs0ow (:,: ), sxopw(:,:), &166 & sxxopw(:,:) , syopw(:,:), syyopw(:,:), sxyopw(:,:) )175 DO jt = 1, initad 176 CALL lim_adv_x( zusnit, u_ice, 1._wp, zsm, zs0ow (:,:,1), sxopw(:,:), & !--- ice open water area 177 & sxxopw(:,:) , syopw(:,:), syyopw(:,:), sxyopw(:,:) ) 178 CALL lim_adv_y( zusnit, v_ice, 0._wp, zsm, zs0ow (:,:,1), sxopw(:,:), & 179 & sxxopw(:,:) , syopw(:,:), syyopw(:,:), sxyopw(:,:) ) 167 180 DO jl = 1, jpl 168 CALL lim_adv_x( zusnit, u_ice, 1._wp 181 CALL lim_adv_x( zusnit, u_ice, 1._wp, zsm, zs0ice(:,:,jl), sxice(:,:,jl), & !--- ice volume --- 169 182 & sxxice(:,:,jl), syice(:,:,jl), syyice(:,:,jl), sxyice(:,:,jl) ) 170 183 CALL lim_adv_y( zusnit, v_ice, 0._wp, zsm, zs0ice(:,:,jl), sxice(:,:,jl), & 171 184 & sxxice(:,:,jl), syice(:,:,jl), syyice(:,:,jl), sxyice(:,:,jl) ) 172 CALL lim_adv_x( zusnit, u_ice, 1._wp 185 CALL lim_adv_x( zusnit, u_ice, 1._wp, zsm, zs0sn (:,:,jl), sxsn (:,:,jl), & !--- snow volume --- 173 186 & sxxsn (:,:,jl), sysn (:,:,jl), syysn (:,:,jl), sxysn (:,:,jl) ) 174 187 CALL lim_adv_y( zusnit, v_ice, 0._wp, zsm, zs0sn (:,:,jl), sxsn (:,:,jl), & 175 188 & sxxsn (:,:,jl), sysn (:,:,jl), syysn (:,:,jl), sxysn (:,:,jl) ) 176 CALL lim_adv_x( zusnit, u_ice, 1._wp 189 CALL lim_adv_x( zusnit, u_ice, 1._wp, zsm, zs0sm (:,:,jl), sxsal(:,:,jl), & !--- ice salinity --- 177 190 & sxxsal(:,:,jl), sysal(:,:,jl), syysal(:,:,jl), sxysal(:,:,jl) ) 178 191 CALL lim_adv_y( zusnit, v_ice, 0._wp, zsm, zs0sm (:,:,jl), sxsal(:,:,jl), & 179 192 & sxxsal(:,:,jl), sysal(:,:,jl), syysal(:,:,jl), sxysal(:,:,jl) ) 180 CALL lim_adv_x( zusnit, u_ice, 1._wp , zsm, zs0oi (:,:,jl), sxage(:,:,jl), &!--- ice age ---193 CALL lim_adv_x( zusnit, u_ice, 1._wp, zsm, zs0oi (:,:,jl), sxage(:,:,jl), & !--- ice age --- 181 194 & sxxage(:,:,jl), syage(:,:,jl), syyage(:,:,jl), sxyage(:,:,jl) ) 182 195 CALL lim_adv_y( zusnit, v_ice, 0._wp, zsm, zs0oi (:,:,jl), sxage(:,:,jl), & 183 196 & sxxage(:,:,jl), syage(:,:,jl), syyage(:,:,jl), sxyage(:,:,jl) ) 184 CALL lim_adv_x( zusnit, u_ice, 1._wp , zsm, zs0a (:,:,jl), sxa (:,:,jl), &!--- ice concentrations ---197 CALL lim_adv_x( zusnit, u_ice, 1._wp, zsm, zs0a (:,:,jl), sxa (:,:,jl), & !--- ice concentrations --- 185 198 & sxxa (:,:,jl), sya (:,:,jl), syya (:,:,jl), sxya (:,:,jl) ) 186 199 CALL lim_adv_y( zusnit, v_ice, 0._wp, zsm, zs0a (:,:,jl), sxa (:,:,jl), & 187 200 & sxxa (:,:,jl), sya (:,:,jl), syya (:,:,jl), sxya (:,:,jl) ) 188 CALL lim_adv_x( zusnit, u_ice, 1._wp , zsm, zs0c0 (:,:,jl), sxc0 (:,:,jl), &!--- snow heat contents ---201 CALL lim_adv_x( zusnit, u_ice, 1._wp, zsm, zs0c0 (:,:,jl), sxc0 (:,:,jl), & !--- snow heat contents --- 189 202 & sxxc0 (:,:,jl), syc0 (:,:,jl), syyc0 (:,:,jl), sxyc0 (:,:,jl) ) 190 203 CALL lim_adv_y( zusnit, v_ice, 0._wp, zsm, zs0c0 (:,:,jl), sxc0 (:,:,jl), & 191 204 & sxxc0 (:,:,jl), syc0 (:,:,jl), syyc0 (:,:,jl), sxyc0 (:,:,jl) ) 192 DO jk = 1, nlay_i !--- ice heat contents ---193 CALL lim_adv_x( zusnit, u_ice, 1._wp 205 DO jk = 1, nlay_i !--- ice heat contents --- 206 CALL lim_adv_x( zusnit, u_ice, 1._wp, zsm, zs0e(:,:,jk,jl), sxe (:,:,jk,jl), & 194 207 & sxxe(:,:,jk,jl), sye (:,:,jk,jl), & 195 208 & syye(:,:,jk,jl), sxye(:,:,jk,jl) ) … … 201 214 END DO 202 215 ELSE 203 DO j n= 1, initad204 CALL lim_adv_y( zusnit, v_ice, 1._wp , zsm, zs0ow (:,:), sxopw(:,:), & !--- ice open water area205 & sxxopw(:,:) , syopw(:,:), syyopw(:,:), sxyopw(:,:) )206 CALL lim_adv_x( zusnit, u_ice, 0._wp, zsm, zs0ow (:,: ), sxopw(:,:), &207 & sxxopw(:,:) , syopw(:,:), syyopw(:,:), sxyopw(:,:) )216 DO jt = 1, initad 217 CALL lim_adv_y( zusnit, v_ice, 1._wp, zsm, zs0ow (:,:,1), sxopw(:,:), & !--- ice open water area 218 & sxxopw(:,:) , syopw(:,:), syyopw(:,:), sxyopw(:,:) ) 219 CALL lim_adv_x( zusnit, u_ice, 0._wp, zsm, zs0ow (:,:,1), sxopw(:,:), & 220 & sxxopw(:,:) , syopw(:,:), syyopw(:,:), sxyopw(:,:) ) 208 221 DO jl = 1, jpl 209 CALL lim_adv_y( zusnit, v_ice, 1._wp 222 CALL lim_adv_y( zusnit, v_ice, 1._wp, zsm, zs0ice(:,:,jl), sxice(:,:,jl), & !--- ice volume --- 210 223 & sxxice(:,:,jl), syice(:,:,jl), syyice(:,:,jl), sxyice(:,:,jl) ) 211 224 CALL lim_adv_x( zusnit, u_ice, 0._wp, zsm, zs0ice(:,:,jl), sxice(:,:,jl), & 212 225 & sxxice(:,:,jl), syice(:,:,jl), syyice(:,:,jl), sxyice(:,:,jl) ) 213 CALL lim_adv_y( zusnit, v_ice, 1._wp 226 CALL lim_adv_y( zusnit, v_ice, 1._wp, zsm, zs0sn (:,:,jl), sxsn (:,:,jl), & !--- snow volume --- 214 227 & sxxsn (:,:,jl), sysn (:,:,jl), syysn (:,:,jl), sxysn (:,:,jl) ) 215 228 CALL lim_adv_x( zusnit, u_ice, 0._wp, zsm, zs0sn (:,:,jl), sxsn (:,:,jl), & 216 229 & sxxsn (:,:,jl), sysn (:,:,jl), syysn (:,:,jl), sxysn (:,:,jl) ) 217 CALL lim_adv_y( zusnit, v_ice, 1._wp 230 CALL lim_adv_y( zusnit, v_ice, 1._wp, zsm, zs0sm (:,:,jl), sxsal(:,:,jl), & !--- ice salinity --- 218 231 & sxxsal(:,:,jl), sysal(:,:,jl), syysal(:,:,jl), sxysal(:,:,jl) ) 219 232 CALL lim_adv_x( zusnit, u_ice, 0._wp, zsm, zs0sm (:,:,jl), sxsal(:,:,jl), & 220 233 & sxxsal(:,:,jl), sysal(:,:,jl), syysal(:,:,jl), sxysal(:,:,jl) ) 221 234 222 CALL lim_adv_y( zusnit, v_ice, 1._wp 235 CALL lim_adv_y( zusnit, v_ice, 1._wp, zsm, zs0oi (:,:,jl), sxage(:,:,jl), & !--- ice age --- 223 236 & sxxage(:,:,jl), syage(:,:,jl), syyage(:,:,jl), sxyage(:,:,jl) ) 224 237 CALL lim_adv_x( zusnit, u_ice, 0._wp, zsm, zs0oi (:,:,jl), sxage(:,:,jl), & 225 238 & sxxage(:,:,jl), syage(:,:,jl), syyage(:,:,jl), sxyage(:,:,jl) ) 226 CALL lim_adv_y( zusnit, v_ice, 1._wp 239 CALL lim_adv_y( zusnit, v_ice, 1._wp, zsm, zs0a (:,:,jl), sxa (:,:,jl), & !--- ice concentrations --- 227 240 & sxxa (:,:,jl), sya (:,:,jl), syya (:,:,jl), sxya (:,:,jl) ) 228 241 CALL lim_adv_x( zusnit, u_ice, 0._wp, zsm, zs0a (:,:,jl), sxa (:,:,jl), & 229 242 & sxxa (:,:,jl), sya (:,:,jl), syya (:,:,jl), sxya (:,:,jl) ) 230 CALL lim_adv_y( zusnit, v_ice, 1._wp 243 CALL lim_adv_y( zusnit, v_ice, 1._wp, zsm, zs0c0 (:,:,jl), sxc0 (:,:,jl), & !--- snow heat contents --- 231 244 & sxxc0 (:,:,jl), syc0 (:,:,jl), syyc0 (:,:,jl), sxyc0 (:,:,jl) ) 232 245 CALL lim_adv_x( zusnit, u_ice, 0._wp, zsm, zs0c0 (:,:,jl), sxc0 (:,:,jl), & 233 246 & sxxc0 (:,:,jl), syc0 (:,:,jl), syyc0 (:,:,jl), sxyc0 (:,:,jl) ) 234 247 DO jk = 1, nlay_i !--- ice heat contents --- 235 CALL lim_adv_y( zusnit, v_ice, 1._wp 248 CALL lim_adv_y( zusnit, v_ice, 1._wp, zsm, zs0e(:,:,jk,jl), sxe (:,:,jk,jl), & 236 249 & sxxe(:,:,jk,jl), sye (:,:,jk,jl), & 237 250 & syye(:,:,jk,jl), sxye(:,:,jk,jl) ) … … 247 260 ! Recover the properties from their contents 248 261 !------------------------------------------- 249 zs0ow(:,:) = zs0ow(:,:) / area(:,:) 250 DO jl = 1, jpl 251 zs0ice(:,:,jl) = zs0ice(:,:,jl) / area(:,:) 252 zs0sn (:,:,jl) = zs0sn (:,:,jl) / area(:,:) 253 zs0sm (:,:,jl) = zs0sm (:,:,jl) / area(:,:) 254 zs0oi (:,:,jl) = zs0oi (:,:,jl) / area(:,:) 255 zs0a (:,:,jl) = zs0a (:,:,jl) / area(:,:) 256 ! 262 ato_i(:,:) = zs0ow(:,:,1) / area(:,:) 263 DO jl = 1, jpl 264 v_i (:,:,jl) = zs0ice(:,:,jl) / area(:,:) 265 v_s (:,:,jl) = zs0sn (:,:,jl) / area(:,:) 266 smv_i(:,:,jl) = zs0sm (:,:,jl) / area(:,:) 267 oa_i (:,:,jl) = zs0oi (:,:,jl) / area(:,:) 268 a_i (:,:,jl) = zs0a (:,:,jl) / area(:,:) 269 e_s (:,:,1,jl) = zs0c0 (:,:,jl) 270 e_i (:,:,:,jl) = zs0e (:,:,:,jl) 271 END DO 272 273 at_i(:,:) = a_i(:,:,1) ! total ice fraction 274 DO jl = 2, jpl 275 at_i(:,:) = at_i(:,:) + a_i(:,:,jl) 257 276 END DO 258 277 … … 261 280 !------------------------------------------------------------------------------! 262 281 282 ! 263 283 !-------------------------------- 264 284 ! diffusion of open water area 265 285 !-------------------------------- 266 zs0at(:,:) = zs0a(:,:,1) ! total ice fraction267 DO jl = 2, jpl268 zs0at(:,:) = zs0at(:,:) + zs0a(:,:,jl)269 END DO270 !271 286 ! ! Masked eddy diffusivity coefficient at ocean U- and V-points 272 287 DO jj = 1, jpjm1 ! NB: has not to be defined on jpj line and jpi row 273 288 DO ji = 1 , fs_jpim1 ! vector opt. 274 pahu(ji,jj) = ( 1._wp - MAX( 0._wp, SIGN( 1._wp, - zs0at(ji ,jj) ) ) ) &275 & * ( 1._wp - MAX( 0._wp, SIGN( 1._wp, - zs0at(ji+1,jj) ) ) ) * ahiu(ji,jj)276 pahv(ji,jj) = ( 1._wp - MAX( 0._wp, SIGN( 1._wp, - zs0at(ji,jj ) ) ) ) &277 & * ( 1._wp - MAX( 0._wp, SIGN( 1._wp,- zs0at(ji,jj+1) ) ) ) * ahiv(ji,jj)289 pahu(ji,jj) = ( 1._wp - MAX( 0._wp, SIGN( 1._wp, -at_i(ji ,jj) ) ) ) & 290 & * ( 1._wp - MAX( 0._wp, SIGN( 1._wp, -at_i(ji+1,jj) ) ) ) * ahiu(ji,jj) 291 pahv(ji,jj) = ( 1._wp - MAX( 0._wp, SIGN( 1._wp, -at_i(ji,jj ) ) ) ) & 292 & * ( 1._wp - MAX( 0._wp, SIGN( 1._wp,- at_i(ji,jj+1) ) ) ) * ahiv(ji,jj) 278 293 END DO 279 294 END DO 280 295 ! 281 CALL lim_hdf( zs0ow(:,:) ) ! Diffusion296 CALL lim_hdf( ato_i (:,:) ) ! Diffusion 282 297 283 298 !------------------------------------ … … 288 303 DO jj = 1, jpjm1 ! NB: has not to be defined on jpj line and jpi row 289 304 DO ji = 1 , fs_jpim1 ! vector opt. 290 pahu(ji,jj) = ( 1._wp - MAX( 0._wp, SIGN( 1._wp, - zs0a(ji ,jj,jl) ) ) ) &291 & * ( 1._wp - MAX( 0._wp, SIGN( 1._wp, - zs0a(ji+1,jj,jl) ) ) ) * ahiu(ji,jj)292 pahv(ji,jj) = ( 1._wp - MAX( 0._wp, SIGN( 1._wp, - zs0a(ji,jj ,jl) ) ) ) &293 & * ( 1._wp - MAX( 0._wp, SIGN( 1._wp,- zs0a(ji,jj+1,jl) ) ) ) * ahiv(ji,jj)294 END DO 295 END DO 296 297 CALL lim_hdf( zs0ice (:,:,jl) )298 CALL lim_hdf( zs0sn (:,:,jl) )299 CALL lim_hdf( zs0sm (:,:,jl) )300 CALL lim_hdf( zs0oi (:,:,jl) )301 CALL lim_hdf( zs0a (:,:,jl) )302 CALL lim_hdf( zs0c0 (:,:,jl) )305 pahu(ji,jj) = ( 1._wp - MAX( 0._wp, SIGN( 1._wp, -a_i(ji ,jj,jl) ) ) ) & 306 & * ( 1._wp - MAX( 0._wp, SIGN( 1._wp, -a_i(ji+1,jj,jl) ) ) ) * ahiu(ji,jj) 307 pahv(ji,jj) = ( 1._wp - MAX( 0._wp, SIGN( 1._wp, -a_i(ji,jj ,jl) ) ) ) & 308 & * ( 1._wp - MAX( 0._wp, SIGN( 1._wp,- a_i(ji,jj+1,jl) ) ) ) * ahiv(ji,jj) 309 END DO 310 END DO 311 312 CALL lim_hdf( v_i (:,:, jl) ) 313 CALL lim_hdf( v_s (:,:, jl) ) 314 CALL lim_hdf( smv_i(:,:, jl) ) 315 CALL lim_hdf( oa_i (:,:, jl) ) 316 CALL lim_hdf( a_i (:,:, jl) ) 317 CALL lim_hdf( e_s (:,:,1,jl) ) 303 318 DO jk = 1, nlay_i 304 CALL lim_hdf( zs0e(:,:,jk,jl) )319 CALL lim_hdf( e_i(:,:,jk,jl) ) 305 320 END DO 306 321 END DO … … 310 325 !------------------------------------------------------------------------------! 311 326 327 !!gm & cr : MAX should not be active if adv scheme is positive ! 312 328 !-------------------------------------------------- 313 329 ! 5.1) Recover mean values over the grid squares. 314 330 !-------------------------------------------------- 315 zs0at(:,:) = 0._wp316 331 DO jl = 1, jpl 317 332 DO jj = 1, jpj 318 333 DO ji = 1, jpi 319 zs0sn (ji,jj,jl) = MAX( 0._wp, zs0sn (ji,jj,jl) ) 320 zs0ice(ji,jj,jl) = MAX( 0._wp, zs0ice(ji,jj,jl) ) 321 zs0sm (ji,jj,jl) = MAX( 0._wp, zs0sm (ji,jj,jl) ) 322 zs0oi (ji,jj,jl) = MAX( 0._wp, zs0oi (ji,jj,jl) ) 323 zs0a (ji,jj,jl) = MAX( 0._wp, zs0a (ji,jj,jl) ) 324 zs0c0 (ji,jj,jl) = MAX( 0._wp, zs0c0 (ji,jj,jl) ) 325 zs0at (ji,jj) = zs0at(ji,jj) + zs0a(ji,jj,jl) 326 END DO 327 END DO 328 END DO 329 330 !--------------------------------------------------------- 331 ! 5.2) Update and mask variables 332 !--------------------------------------------------------- 333 DO jl = 1, jpl 334 DO jj = 1, jpj 335 DO ji = 1, jpi 336 rswitch = MAX( 0._wp , SIGN( 1._wp, zs0a(ji,jj,jl) - epsi10 ) ) 337 338 zvi = zs0ice(ji,jj,jl) 339 zvs = zs0sn (ji,jj,jl) 340 zes = zs0c0 (ji,jj,jl) 341 zsmv = zs0sm (ji,jj,jl) 342 ! 343 ! Remove very small areas 344 v_s(ji,jj,jl) = rswitch * zs0sn (ji,jj,jl) 345 v_i(ji,jj,jl) = rswitch * zs0ice(ji,jj,jl) 346 a_i(ji,jj,jl) = rswitch * zs0a (ji,jj,jl) 347 e_s(ji,jj,1,jl) = rswitch * zs0c0 (ji,jj,jl) 348 ! Ice salinity and age 349 IF( num_sal == 2 ) THEN 350 smv_i(ji,jj,jl) = MAX( MIN( s_i_max * v_i(ji,jj,jl), zsmv ), s_i_min * v_i(ji,jj,jl) ) 351 ENDIF 352 oa_i(ji,jj,jl) = MAX( rswitch * zs0oi(ji,jj,jl) / MAX( a_i(ji,jj,jl), epsi10 ), 0._wp ) * a_i(ji,jj,jl) 353 354 ! Update fluxes 355 wfx_res(ji,jj) = wfx_res(ji,jj) - ( v_i(ji,jj,jl) - zvi ) * rhoic * r1_rdtice 356 wfx_snw(ji,jj) = wfx_snw(ji,jj) - ( v_s(ji,jj,jl) - zvs ) * rhosn * r1_rdtice 357 sfx_res(ji,jj) = sfx_res(ji,jj) - ( smv_i(ji,jj,jl) - zsmv ) * rhoic * r1_rdtice 358 hfx_res(ji,jj) = hfx_res(ji,jj) + ( e_s(ji,jj,1,jl) - zes ) * unit_fac / area(ji,jj) * r1_rdtice ! W.m-2 <0 359 END DO 360 END DO 361 END DO 362 334 v_s (ji,jj,jl) = MAX( 0._wp, v_s (ji,jj,jl) ) 335 v_i (ji,jj,jl) = MAX( 0._wp, v_i (ji,jj,jl) ) 336 smv_i(ji,jj,jl) = MAX( 0._wp, smv_i(ji,jj,jl) ) 337 oa_i (ji,jj,jl) = MAX( 0._wp, oa_i (ji,jj,jl) ) 338 a_i (ji,jj,jl) = MAX( 0._wp, a_i (ji,jj,jl) ) 339 e_s (ji,jj,1,jl) = MAX( 0._wp, e_s (ji,jj,1,jl) ) 340 END DO 341 END DO 342 END DO 363 343 DO jl = 1, jpl 364 344 DO jk = 1, nlay_i 365 345 DO jj = 1, jpj 366 346 DO ji = 1, jpi 367 rswitch = MAX( 0._wp , SIGN( 1._wp, zs0a(ji,jj,jl) - epsi10) )368 zei = zs0e(ji,jj,jk,jl)369 e_i(ji,jj,jk,jl) = rswitch * MAX( 0._wp, zs0e(ji,jj,jk,jl) )370 ! Update fluxes371 hfx_res(ji,jj) = hfx_res(ji,jj) + ( e_i(ji,jj,jk,jl) - zei ) * unit_fac / area(ji,jj) * r1_rdtice ! W.m-2 <0372 END DO !ji 373 END DO ! jj 374 END DO ! jk375 END DO ! jl376 377 !--- Thickness correction in case too high (clem)--------------------------------------------------------347 e_i(ji,jj,jk,jl) = MAX( 0._wp, e_i(ji,jj,jk,jl) ) 348 END DO 349 END DO 350 END DO 351 END DO 352 !!gm & cr 353 354 ! zap small areas 355 CALL lim_var_zapsmall 356 357 !--- Thickness correction in case too high -------------------------------------------------------- 378 358 CALL lim_var_glo2eqv 379 359 DO jl = 1, jpl … … 388 368 zei = SUM( e_i(ji,jj,1:nlay_i,jl) ) 389 369 zdv = v_i(ji,jj,jl) - zviold(ji,jj,jl) 390 !zda = a_i(ji,jj,jl) - zaiold(ji,jj,jl)391 370 392 371 rswitch = 1._wp 393 IF ( ( zdv > 0.0 .AND. ht_i(ji,jj,jl) > zhimax(ji,jj,jl) .AND. SUM( zaiold(ji,jj,1:jpl)) < 0.80 ) .OR. &372 IF ( ( zdv > 0.0 .AND. ht_i(ji,jj,jl) > zhimax(ji,jj,jl) .AND. zatold(ji,jj) < 0.80 ) .OR. & 394 373 & ( zdv < 0.0 .AND. ht_i(ji,jj,jl) > zhimax(ji,jj,jl) ) ) THEN 395 374 ht_i(ji,jj,jl) = MIN( zhimax(ji,jj,jl), hi_max(jl) ) … … 416 395 hfx_res(ji,jj) = hfx_res(ji,jj) + ( SUM( e_i(ji,jj,1:nlay_i,jl) ) - zei ) * unit_fac / area(ji,jj) * r1_rdtice ! W.m-2 <0 417 396 ENDIF 397 418 398 END DO 419 399 END DO … … 466 446 ! open water = 1 if at_i=0 467 447 rswitch = MAX( 0._wp , SIGN( 1._wp, - at_i(ji,jj) ) ) 468 ato_i(ji,jj) = rswitch + (1._wp - rswitch ) * zs0ow(ji,jj)448 ato_i(ji,jj) = rswitch + (1._wp - rswitch ) * ato_i(ji,jj) 469 449 END DO 470 450 END DO … … 507 487 ENDIF 508 488 ! 509 CALL wrk_dealloc( jpi, jpj, zui_u, zvi_v, zsm, zs0at, zs0ow, zeiold, zesold )510 CALL wrk_dealloc( jpi, jpj, jpl, zs0ice, zs0sn, zs0a, zs0c0 , zs0sm , zs0oi)511 CALL wrk_dealloc( jpi, jpj, nlay_i+1, jpl, zs0e)512 513 CALL wrk_dealloc( jpi, jpj, jpl, zviold, zvsold, zaiold, zhimax ) ! clem489 CALL wrk_dealloc( jpi,jpj, zsm, zs0at, zatold, zeiold, zesold ) 490 CALL wrk_dealloc( jpi,jpj,jpl, zs0ice, zs0sn, zs0a, zs0c0 , zs0sm , zs0oi, zzs0e ) 491 CALL wrk_dealloc( jpi,jpj,1, zs0ow ) 492 CALL wrk_dealloc( jpi,jpj,nlay_i+1,jpl, zs0e ) 493 CALL wrk_dealloc( jpi,jpj,jpl, zviold, zvsold, zhimax ) 514 494 ! 515 495 IF( nn_timing == 1 ) CALL timing_stop('limtrp') -
branches/2015/dev_r5044_CNRS_LIM3CLEAN/NEMOGCM/NEMO/LIM_SRC_3/limupdate1.F90
r4990 r5051 83 83 ! zap small values 84 84 !----------------- 85 CALL lim_ itd_me_zapsmall85 CALL lim_var_zapsmall 86 86 87 87 CALL lim_var_glo2eqv … … 124 124 ! zap small values 125 125 !----------------- 126 CALL lim_ itd_me_zapsmall126 CALL lim_var_zapsmall 127 127 128 128 !--------------------- … … 148 148 ! Diagnostics 149 149 ! ------------------------------------------------- 150 DO jl = 1, jpl 151 afx_dyn(:,:) = afx_dyn(:,:) + ( a_i(:,:,jl) - a_i_b(:,:,jl) ) * r1_rdtice 152 END DO 153 150 154 d_u_ice_dyn(:,:) = u_ice(:,:) - u_ice_b(:,:) 151 155 d_v_ice_dyn(:,:) = v_ice(:,:) - v_ice_b(:,:) -
branches/2015/dev_r5044_CNRS_LIM3CLEAN/NEMOGCM/NEMO/LIM_SRC_3/limupdate2.F90
r4990 r5051 78 78 ! zap small values 79 79 !----------------- 80 CALL lim_ itd_me_zapsmall81 80 CALL lim_var_agg( 1 ) 81 CALL lim_var_zapsmall 82 82 CALL lim_var_glo2eqv 83 83 … … 133 133 ! zap small values 134 134 !----------------- 135 CALL lim_ itd_me_zapsmall135 CALL lim_var_zapsmall 136 136 137 137 !--------------------- … … 176 176 v_ice(:,:) = v_ice(:,:) * tmv(:,:) 177 177 178 ! for outputs 179 CALL lim_var_glo2eqv ! equivalent variables (outputs) 180 CALL lim_var_agg(2) ! aggregate ice thickness categories 181 178 182 ! ------------------------------------------------- 179 183 ! Diagnostics 180 184 ! ------------------------------------------------- 185 DO jl = 1, jpl 186 afx_thd(:,:) = afx_thd(:,:) + ( a_i(:,:,jl) - a_i_b(:,:,jl) ) * r1_rdtice 187 END DO 188 afx_tot = afx_thd + afx_dyn 189 181 190 d_a_i_thd(:,:,:) = a_i(:,:,:) - a_i_b(:,:,:) 182 191 d_v_s_thd(:,:,:) = v_s(:,:,:) - v_s_b(:,:,:) … … 187 196 d_smv_i_thd(:,:,:) = 0._wp 188 197 IF( num_sal == 2 ) d_smv_i_thd(:,:,:) = smv_i(:,:,:) - smv_i_b(:,:,:) 189 ! diag only (clem)190 dv_dt_thd(:,:,:) = d_v_i_thd(:,:,:) * r1_rdtice * rday191 198 192 199 ! heat content variation (W.m-2) -
branches/2015/dev_r5044_CNRS_LIM3CLEAN/NEMOGCM/NEMO/LIM_SRC_3/limvar.F90
r5047 r5051 65 65 PUBLIC lim_var_bv ! 66 66 PUBLIC lim_var_salprof1d ! 67 PUBLIC lim_var_zapsmall 67 68 68 69 !!---------------------------------------------------------------------- … … 529 530 END SUBROUTINE lim_var_salprof1d 530 531 532 SUBROUTINE lim_var_zapsmall 533 !!------------------------------------------------------------------- 534 !! *** ROUTINE lim_var_zapsmall *** 535 !! 536 !! ** Purpose : Remove too small sea ice areas and correct salt fluxes 537 !! 538 !! history : LIM3.5 - 01-2014 (C. Rousset) original code 539 !!------------------------------------------------------------------- 540 INTEGER :: ji, jj, jl, jk ! dummy loop indices 541 542 REAL(wp) :: zsal, zvi, zvs, zei, zes 543 !!------------------------------------------------------------------- 544 545 DO jl = 1, jpl 546 547 !----------------------------------------------------------------- 548 ! Zap ice energy and use ocean heat to melt ice 549 !----------------------------------------------------------------- 550 DO jk = 1, nlay_i 551 DO jj = 1 , jpj 552 DO ji = 1 , jpi 553 rswitch = MAX( 0._wp , SIGN( 1._wp, a_i(ji,jj,jl) - epsi10 ) ) 554 zei = e_i(ji,jj,jk,jl) 555 e_i(ji,jj,jk,jl) = e_i(ji,jj,jk,jl) * rswitch 556 t_i(ji,jj,jk,jl) = t_i(ji,jj,jk,jl) * rswitch + rtt * ( 1._wp - rswitch ) 557 ! update exchanges with ocean 558 hfx_res(ji,jj) = hfx_res(ji,jj) + ( e_i(ji,jj,jk,jl) - zei ) * unit_fac / area(ji,jj) * r1_rdtice ! W.m-2 <0 559 END DO 560 END DO 561 END DO 562 563 DO jj = 1 , jpj 564 DO ji = 1 , jpi 565 rswitch = MAX( 0._wp , SIGN( 1._wp, a_i(ji,jj,jl) - epsi10 ) ) 566 567 zsal = smv_i(ji,jj, jl) 568 zvi = v_i (ji,jj, jl) 569 zvs = v_s (ji,jj, jl) 570 zes = e_s (ji,jj,1,jl) 571 !----------------------------------------------------------------- 572 ! Zap snow energy 573 !----------------------------------------------------------------- 574 t_s(ji,jj,1,jl) = t_s(ji,jj,1,jl) * rswitch + rtt * ( 1._wp - rswitch ) 575 e_s(ji,jj,1,jl) = e_s(ji,jj,1,jl) * rswitch 576 577 !----------------------------------------------------------------- 578 ! zap ice and snow volume, add water and salt to ocean 579 !----------------------------------------------------------------- 580 ato_i(ji,jj) = a_i (ji,jj,jl) * ( 1._wp - rswitch ) + ato_i(ji,jj) 581 a_i (ji,jj,jl) = a_i (ji,jj,jl) * rswitch 582 v_i (ji,jj,jl) = v_i (ji,jj,jl) * rswitch 583 v_s (ji,jj,jl) = v_s (ji,jj,jl) * rswitch 584 t_su (ji,jj,jl) = t_su (ji,jj,jl) * rswitch + t_bo(ji,jj) * ( 1._wp - rswitch ) 585 oa_i (ji,jj,jl) = oa_i (ji,jj,jl) * rswitch 586 smv_i(ji,jj,jl) = smv_i(ji,jj,jl) * rswitch 587 588 ! ice salinity must stay in bounds 589 IF( num_sal == 2 ) THEN 590 smv_i(ji,jj,jl) = MAX( MIN( s_i_max * v_i(ji,jj,jl), smv_i(ji,jj,jl) ), s_i_min * v_i(ji,jj,jl) ) 591 ENDIF 592 ! update exchanges with ocean 593 sfx_res(ji,jj) = sfx_res(ji,jj) - ( smv_i(ji,jj,jl) - zsal ) * rhoic * r1_rdtice 594 wfx_res(ji,jj) = wfx_res(ji,jj) - ( v_i(ji,jj,jl) - zvi ) * rhoic * r1_rdtice 595 wfx_snw(ji,jj) = wfx_snw(ji,jj) - ( v_s(ji,jj,jl) - zvs ) * rhosn * r1_rdtice 596 hfx_res(ji,jj) = hfx_res(ji,jj) + ( e_s(ji,jj,1,jl) - zes ) * unit_fac / area(ji,jj) * r1_rdtice ! W.m-2 <0 597 END DO 598 END DO 599 END DO ! jl 600 601 ! to be sure that at_i is the sum of a_i(jl) 602 at_i(:,:) = SUM( a_i(:,:,:), dim=3 ) 603 ! 604 END SUBROUTINE lim_var_zapsmall 605 531 606 #else 532 607 !!---------------------------------------------------------------------- … … 546 621 SUBROUTINE lim_var_salprof1d ! Emtpy routines 547 622 END SUBROUTINE lim_var_salprof1d 623 SUBROUTINE lim_var_zapsmall 624 END SUBROUTINE lim_var_zapsmall 548 625 #endif 549 626 -
branches/2015/dev_r5044_CNRS_LIM3CLEAN/NEMOGCM/NEMO/LIM_SRC_3/limwri.F90
r5048 r5051 212 212 CALL iom_put( "vfxspr" , wfx_spr * ztmp ) ! precip (snow) 213 213 214 CALL iom_put( "afxtot" , afx_tot 215 CALL iom_put( "afxdyn" , afx_dyn 216 CALL iom_put( "afxthd" , afx_thd 217 218 CALL iom_put ('hfxthd' , hfx_thd(:,:)) !219 CALL iom_put ('hfxdyn' , hfx_dyn(:,:)) !220 CALL iom_put ('hfxres' , hfx_res(:,:)) !221 CALL iom_put ('hfxout' , hfx_out(:,:)) !222 CALL iom_put ('hfxin' , hfx_in(:,:)) !223 CALL iom_put ('hfxsnw' , hfx_snw(:,:)) !224 CALL iom_put ('hfxsub' , hfx_sub(:,:)) !225 CALL iom_put ('hfxerr' , hfx_err(:,:)) !226 CALL iom_put ('hfxerr_rem' , hfx_err_rem(:,:)) !227 228 CALL iom_put ('hfxsum' , hfx_sum(:,:)) !229 CALL iom_put ('hfxbom' , hfx_bom(:,:)) !230 CALL iom_put ('hfxbog' , hfx_bog(:,:)) !231 CALL iom_put ('hfxdif' , hfx_dif(:,:)) !232 CALL iom_put ('hfxopw' , hfx_opw(:,:)) !233 CALL iom_put ('hfxtur' , fhtur(:,:) * at_i(:,:) )! turbulent heat flux at ice base234 CALL iom_put ('hfxdhc' , diag_heat_dhc(:,:) )! Heat content variation in snow and ice235 CALL iom_put ('hfxspr' , hfx_spr(:,:) )! Heat content of snow precip214 CALL iom_put( "afxtot" , afx_tot * rday ) ! concentration tendency (total) 215 CALL iom_put( "afxdyn" , afx_dyn * rday ) ! concentration tendency (dynamics) 216 CALL iom_put( "afxthd" , afx_thd * rday ) ! concentration tendency (thermo) 217 218 CALL iom_put ('hfxthd' , hfx_thd(:,:) ) ! 219 CALL iom_put ('hfxdyn' , hfx_dyn(:,:) ) ! 220 CALL iom_put ('hfxres' , hfx_res(:,:) ) ! 221 CALL iom_put ('hfxout' , hfx_out(:,:) ) ! 222 CALL iom_put ('hfxin' , hfx_in(:,:) ) ! 223 CALL iom_put ('hfxsnw' , hfx_snw(:,:) ) ! 224 CALL iom_put ('hfxsub' , hfx_sub(:,:) ) ! 225 CALL iom_put ('hfxerr' , hfx_err(:,:) ) ! 226 CALL iom_put ('hfxerr_rem' , hfx_err_rem(:,:) ) ! 227 228 CALL iom_put ('hfxsum' , hfx_sum(:,:) ) ! 229 CALL iom_put ('hfxbom' , hfx_bom(:,:) ) ! 230 CALL iom_put ('hfxbog' , hfx_bog(:,:) ) ! 231 CALL iom_put ('hfxdif' , hfx_dif(:,:) ) ! 232 CALL iom_put ('hfxopw' , hfx_opw(:,:) ) ! 233 CALL iom_put ('hfxtur' , fhtur(:,:) * at_i(:,:) ) ! turbulent heat flux at ice base 234 CALL iom_put ('hfxdhc' , diag_heat_dhc(:,:) ) ! Heat content variation in snow and ice 235 CALL iom_put ('hfxspr' , hfx_spr(:,:) ) ! Heat content of snow precip 236 236 237 237 !-------------------------------- -
branches/2015/dev_r5044_CNRS_LIM3CLEAN/NEMOGCM/NEMO/OPA_SRC/SBC/sbcice_lim.F90
r5048 r5051 19 19 !!---------------------------------------------------------------------- 20 20 !! sbc_ice_lim : sea-ice model time-stepping and update ocean sbc over ice-covered area 21 !! lim_ctl : alerts in case of ice model crash22 !! lim_prt_state : ice control print at a given grid point23 21 !!---------------------------------------------------------------------- 24 22 USE oce ! ocean dynamics and tracers … … 26 24 USE par_ice ! sea-ice parameters 27 25 USE ice ! LIM-3: ice variables 28 USE iceini ! LIM-3: ice initialisation26 USE thd_ice ! LIM-3: thermodynamical variables 29 27 USE dom_ice ! LIM-3: ice domain 30 28 … … 47 45 USE limwri ! Ice outputs 48 46 USE limrst ! Ice restarts 49 USE limupdate1 50 USE limupdate2 47 USE limupdate1 ! update of global variables 48 USE limupdate2 ! update of global variables 51 49 USE limvar ! Ice variables switch 50 51 USE limmsh ! LIM mesh 52 USE limistate ! LIM initial state 53 USE limthd_sal ! LIM ice thermodynamics: salinity 52 54 53 55 USE c1d ! 1D vertical configuration … … 60 62 USE prtctl ! Print control 61 63 USE lib_fortran ! 64 USE limctl 62 65 63 66 #if defined key_bdy … … 69 72 70 73 PUBLIC sbc_ice_lim ! routine called by sbcmod.F90 71 PUBLIC lim_prt_state74 PUBLIC sbc_lim_init ! routine called by sbcmod.F90 72 75 73 76 !! * Substitutions … … 114 117 IF( nn_timing == 1 ) CALL timing_start('sbc_ice_lim') 115 118 116 IF( kt == nit000 ) THEN117 IF(lwp) WRITE(numout,*)118 IF(lwp) WRITE(numout,*) 'sbc_ice_lim : update ocean surface boudary condition'119 IF(lwp) WRITE(numout,*) '~~~~~~~~~~~ via Louvain la Neuve Ice Model (LIM-3) time stepping'120 !121 CALL ice_init122 !123 IF( ln_nicep ) THEN ! control print at a given point124 jiindx = 15 ; jjindx = 44125 IF(lwp) WRITE(numout,*) ' The debugging point is : jiindx : ',jiindx, ' jjindx : ',jjindx126 ENDIF127 ENDIF128 129 119 ! !----------------------! 130 120 IF( MOD( kt-1, nn_fsbc ) == 0 ) THEN ! Ice time-step only ! … … 133 123 ! !----------------! 134 124 ! 135 u_oce(:,:) = ssu_m(:,:) * umask(:,:,1) 136 v_oce(:,:) = ssv_m(:,:) * vmask(:,:,1) 137 !138 t_bo(:,:) = ( eos_fzp( sss_m ) + rt0 ) * tmask(:,:,1) + rt0 * ( 1. - tmask(:,:,1) ) ! masked sea surface freezing temperature [Kelvin]139 ! ! (set to rt0 over land)140 ! ! Ice albedo141 CALL wrk_alloc( jpi,jpj,jpl, zalb_os, zalb_cs, zalb_ice )142 125 u_oce(:,:) = ssu_m(:,:) * umask(:,:,1) ! mean surface ocean current at ice velocity point 126 v_oce(:,:) = ssv_m(:,:) * vmask(:,:,1) ! (C-grid dynamics : U- & V-points as the ocean) 127 128 ! masked sea surface freezing temperature [Kelvin] (set to rt0 over land) 129 t_bo(:,:) = ( eos_fzp( sss_m ) + rt0 ) * tmask(:,:,1) + rt0 * ( 1._wp - tmask(:,:,1) ) 130 ! 131 ! Ice albedo 132 CALL wrk_alloc( jpi,jpj,jpl, zalb_os, zalb_cs, zalb_ice ) 143 133 CALL albedo_ice( t_su, ht_i, ht_s, zalb_cs, zalb_os ) ! cloud-sky and overcast-sky ice albedos 144 134 … … 153 143 END SELECT 154 144 155 ! ! Mask sea ice surface temperature145 ! Mask sea ice surface temperature (set to rt0 over land) 156 146 DO jl = 1, jpl 157 t_su(:,:,jl) = t_su(:,:,jl) + rt0 * ( 1.- tmask(:,:,1) )147 t_su(:,:,jl) = t_su(:,:,jl) * tmask(:,:,1) + rt0 * ( 1._wp - tmask(:,:,1) ) 158 148 END DO 159 149 … … 210 200 v_ice_b(:,:) = v_ice(:,:) 211 201 212 ! salt, heat and mass fluxes 213 sfx (:,:) = 0._wp ; 214 sfx_bri(:,:) = 0._wp ; 215 sfx_sni(:,:) = 0._wp ; sfx_opw(:,:) = 0._wp 216 sfx_bog(:,:) = 0._wp ; sfx_dyn(:,:) = 0._wp 217 sfx_bom(:,:) = 0._wp ; sfx_sum(:,:) = 0._wp 218 sfx_res(:,:) = 0._wp 219 220 wfx_snw(:,:) = 0._wp ; wfx_ice(:,:) = 0._wp 221 wfx_sni(:,:) = 0._wp ; wfx_opw(:,:) = 0._wp 222 wfx_bog(:,:) = 0._wp ; wfx_dyn(:,:) = 0._wp 223 wfx_bom(:,:) = 0._wp ; wfx_sum(:,:) = 0._wp 224 wfx_res(:,:) = 0._wp ; wfx_sub(:,:) = 0._wp 225 wfx_spr(:,:) = 0._wp ; 226 227 afx_tot(:,:) = at_i(:,:) ; afx_dyn(:,:) = 0._wp 228 afx_thd(:,:) = 0._wp 229 230 hfx_in (:,:) = 0._wp ; hfx_out(:,:) = 0._wp 231 hfx_thd(:,:) = 0._wp ; 232 hfx_snw(:,:) = 0._wp ; hfx_opw(:,:) = 0._wp 233 hfx_bog(:,:) = 0._wp ; hfx_dyn(:,:) = 0._wp 234 hfx_bom(:,:) = 0._wp ; hfx_sum(:,:) = 0._wp 235 hfx_res(:,:) = 0._wp ; hfx_sub(:,:) = 0._wp 236 hfx_spr(:,:) = 0._wp ; hfx_dif(:,:) = 0._wp 237 hfx_err(:,:) = 0._wp ; hfx_err_rem(:,:) = 0._wp 202 CALL sbc_lim_flx0 ! set diag of mass, heat and salt fluxes to 0 238 203 239 204 CALL lim_rst_opn( kt ) ! Open Ice restart file 240 205 ! 241 IF( ln_nicep ) CALL lim_prt _state( kt, jiindx, jjindx, 1, ' - Beginning the time step - ' ) ! control print206 IF( ln_nicep ) CALL lim_prt( kt, jiindx, jjindx, 1, ' - Beginning the time step - ' ) ! control print 242 207 ! ---------------------------------------------- 243 208 ! ice dynamics and transport (except in 1D case) … … 245 210 IF( .NOT. lk_c1d ) THEN 246 211 247 IF ( ln_limdyn ) afx_dyn(:,:) = at_i(:,:)248 249 212 CALL lim_dyn( kt ) ! Ice dynamics ( rheology/dynamics ) 250 213 CALL lim_trp( kt ) ! Ice transport ( Advection/diffusion ) 251 214 CALL lim_var_glo2eqv ! equivalent variables, requested for rafting 252 IF( ln_nicep ) CALL lim_prt_state( kt, jiindx, jjindx,-1, ' - ice dyn & trp - ' ) ! control print 253 IF( nn_monocat /= 2 ) CALL lim_itd_me ! Mechanical redistribution ! (ridging/rafting) 215 IF( ln_nicep ) CALL lim_prt( kt, jiindx, jjindx,-1, ' - ice dyn & trp - ' ) ! control print 216 IF( nn_monocat /= 2 ) & 217 & CALL lim_itd_me ! Mechanical redistribution ! (ridging/rafting) 254 218 CALL lim_var_agg( 1 ) 255 219 #if defined key_bdy … … 257 221 CALL lim_var_glo2eqv ! equivalent variables 258 222 CALL bdy_ice_lim( kt ) 259 CALL lim_ itd_me_zapsmall223 CALL lim_var_zapsmall 260 224 CALL lim_var_agg(1) 261 IF( ln_nicep ) CALL lim_prt _state( kt, jiindx, jjindx, 1, ' - ice thermo bdy - ' ) ! control print225 IF( ln_nicep ) CALL lim_prt( kt, jiindx, jjindx, 1, ' - ice thermo bdy - ' ) ! control print 262 226 #endif 263 227 CALL lim_update1 … … 273 237 oa_i_b (:,:,:) = oa_i (:,:,:) 274 238 smv_i_b(:,:,:) = smv_i(:,:,:) 275 276 IF ( ln_limdyn ) afx_dyn(:,:) = ( at_i(:,:) - afx_dyn(:,:) ) * r1_rdtice277 afx_thd(:,:) = at_i(:,:)278 239 279 240 ! ---------------------------------------------- … … 282 243 CALL lim_var_glo2eqv ! equivalent variables 283 244 CALL lim_var_agg(1) ! aggregate ice categories 245 284 246 ! previous lead fraction and ice volume for flux calculations 285 247 pfrld(:,:) = 1._wp - at_i(:,:) … … 301 263 zcoef = rdt_ice /rday ! Ice natural aging 302 264 oa_i(:,:,:) = oa_i(:,:,:) + a_i(:,:,:) * zcoef 303 IF( ln_nicep ) CALL lim_prt_state( kt, jiindx, jjindx, 1, ' - ice thermodyn. - ' ) ! control print 304 CALL lim_itd_th( kt ) ! Remap ice categories, lateral accretion ! 305 CALL lim_var_agg( 1 ) ! requested by limupdate 265 IF( ln_nicep ) CALL lim_prt( kt, jiindx, jjindx, 1, ' - ice thermodyn. - ' ) ! control print 266 CALL lim_itd_th( kt ) ! Remap ice categories, lateral accretion 306 267 CALL lim_update2 ! Global variables update 307 268 308 CALL lim_var_glo2eqv ! equivalent variables (outputs) 309 CALL lim_var_agg(2) ! aggregate ice thickness categories 310 IF( ln_nicep ) CALL lim_prt_state( kt, jiindx, jjindx, 2, ' - Final state - ' ) ! control print 269 IF( ln_nicep ) CALL lim_prt( kt, jiindx, jjindx, 2, ' - Final state - ' ) ! control print 311 270 ! 312 271 CALL lim_sbc_flx( kt ) ! Update surface ocean mass, heat and salt fluxes 313 272 ! 314 IF( ln_nicep ) CALL lim_prt_state( kt, jiindx, jjindx, 3, ' - Final state lim_sbc - ' ) ! control print 315 ! 316 ! ! Diagnostics and outputs 317 IF (ln_limdiaout) CALL lim_diahsb 318 319 afx_thd(:,:) = ( at_i(:,:) - afx_thd(:,:) ) * r1_rdtice 320 afx_tot(:,:) = ( at_i(:,:) - afx_tot(:,:) ) * r1_rdtice 273 IF( ln_nicep ) CALL lim_prt( kt, jiindx, jjindx, 3, ' - Final state lim_sbc - ' ) ! control print 274 ! 275 IF(ln_limdiaout) CALL lim_diahsb ! Diagnostics and outputs 321 276 322 277 CALL lim_wri( 1 ) ! Ice outputs … … 342 297 IF( ln_limdyn ) CALL lim_sbc_tau( kt, ub(:,:,1), vb(:,:,1) ) ! using before instantaneous surf. currents 343 298 !!gm remark, the ocean-ice stress is not saved in ice diag call above ..... find a solution!!! 344 345 299 ! 346 300 IF( nn_timing == 1 ) CALL timing_stop('sbc_ice_lim') … … 348 302 END SUBROUTINE sbc_ice_lim 349 303 304 305 SUBROUTINE sbc_lim_init 306 !!---------------------------------------------------------------------- 307 !! *** ROUTINE sbc_lim_init *** 308 !! 309 !! ** purpose : Allocate all the dynamic arrays of the LIM-3 modules 310 !!---------------------------------------------------------------------- 311 INTEGER :: ierr 312 !!---------------------------------------------------------------------- 313 IF(lwp) WRITE(numout,*) 314 IF(lwp) WRITE(numout,*) 'sbc_ice_lim : update ocean surface boudary condition' 315 IF(lwp) WRITE(numout,*) '~~~~~~~~~~~ via Louvain la Neuve Ice Model (LIM-3) time stepping' 316 ! 317 ! 318 ! ! Allocate the ice arrays 319 ierr = ice_alloc () ! ice variables 320 ierr = ierr + dom_ice_alloc () ! domain 321 ierr = ierr + sbc_ice_alloc () ! surface forcing 322 ierr = ierr + thd_ice_alloc () ! thermodynamics 323 ierr = ierr + lim_itd_me_alloc () ! ice thickness distribution - mechanics 324 ! 325 IF( lk_mpp ) CALL mpp_sum( ierr ) 326 IF( ierr /= 0 ) CALL ctl_stop('STOP', 'sbc_lim_init : unable to allocate ice arrays') 327 ! 328 ! ! adequation jpk versus ice/snow layers/categories 329 IF( jpl > jpk .OR. (nlay_i+1) > jpk .OR. nlay_s > jpk ) & 330 & CALL ctl_stop( 'STOP', & 331 & 'sbc_lim_init: the 3rd dimension of workspace arrays is too small.', & 332 & 'use more ocean levels or less ice/snow layers/categories.' ) 333 334 ! Open the reference and configuration namelist files and namelist output file 335 CALL ctl_opn( numnam_ice_ref, 'namelist_ice_ref', 'OLD', 'FORMATTED', 'SEQUENTIAL', -1, numout, lwp ) 336 CALL ctl_opn( numnam_ice_cfg, 'namelist_ice_cfg', 'OLD', 'FORMATTED', 'SEQUENTIAL', -1, numout, lwp ) 337 IF(lwm) CALL ctl_opn( numoni, 'output.namelist.ice', 'UNKNOWN', 'FORMATTED', 'SEQUENTIAL', -1, numout, lwp, 1 ) 338 ! 339 CALL ice_run ! set some ice run parameters 340 ! 341 CALL lim_thd_init ! set ice thermodynics parameters 342 ! 343 CALL lim_thd_sal_init ! set ice salinity parameters 344 ! 345 rdt_ice = nn_fsbc * rdttra(1) ! sea-ice timestep 346 r1_rdtice = 1._wp / rdt_ice ! sea-ice timestep inverse 347 ! 348 CALL lim_msh ! ice mesh initialization 349 ! 350 CALL lim_itd_init ! ice thickness distribution initialization 351 ! 352 CALL lim_itd_me_init ! ice thickness distribution initialization 353 ! ! Initial sea-ice state 354 IF( .NOT. ln_rstart ) THEN ! start from rest: sea-ice deduced from sst 355 numit = 0 356 numit = nit000 - 1 357 CALL lim_istate 358 CALL lim_var_agg(1) 359 CALL lim_var_glo2eqv 360 ELSE ! start from a restart file 361 CALL lim_rst_read 362 numit = nit000 - 1 363 CALL lim_var_agg(1) 364 CALL lim_var_glo2eqv 365 ENDIF 366 ! 367 CALL lim_sbc_init ! ice surface boundary condition 368 ! 369 fr_i(:,:) = at_i(:,:) ! initialisation of sea-ice fraction 370 tn_ice(:,:,:) = t_su(:,:,:) ! initialisation of surface temp for coupled simu 371 ! 372 nstart = numit + nn_fsbc 373 nitrun = nitend - nit000 + 1 374 nlast = numit + nitrun 375 ! 376 IF( nstock == 0 ) nstock = nlast + 1 377 ! 378 END SUBROUTINE sbc_lim_init 379 380 381 SUBROUTINE ice_run 382 !!------------------------------------------------------------------- 383 !! *** ROUTINE ice_run *** 384 !! 385 !! ** Purpose : Definition some run parameter for ice model 386 !! 387 !! ** Method : Read the namicerun namelist and check the parameter 388 !! values called at the first timestep (nit000) 389 !! 390 !! ** input : Namelist namicerun 391 !!------------------------------------------------------------------- 392 NAMELIST/namicerun/ cn_icerst_in, cn_icerst_out, ln_limdyn, amax, ln_nicep, ln_limdiahsb, ln_limdiaout 393 INTEGER :: ios ! Local integer output status for namelist read 394 !!------------------------------------------------------------------- 395 ! 396 REWIND( numnam_ice_ref ) ! Namelist namicerun in reference namelist : Parameters for ice 397 READ ( numnam_ice_ref, namicerun, IOSTAT = ios, ERR = 901) 398 901 IF( ios /= 0 ) CALL ctl_nam ( ios , 'namicerun in reference namelist', lwp ) 399 400 REWIND( numnam_ice_cfg ) ! Namelist namicerun in configuration namelist : Parameters for ice 401 READ ( numnam_ice_cfg, namicerun, IOSTAT = ios, ERR = 902 ) 402 902 IF( ios /= 0 ) CALL ctl_nam ( ios , 'namicerun in configuration namelist', lwp ) 403 IF(lwm) WRITE ( numoni, namicerun ) 404 ! 405 ! 406 IF(lwp) THEN ! control print 407 WRITE(numout,*) 408 WRITE(numout,*) 'ice_run : ice share parameters for dynamics/advection/thermo of sea-ice' 409 WRITE(numout,*) ' ~~~~~~' 410 WRITE(numout,*) ' switch for ice dynamics (1) or not (0) ln_limdyn = ', ln_limdyn 411 WRITE(numout,*) ' maximum ice concentration = ', amax 412 WRITE(numout,*) ' Several ice points in the ice or not in ocean.output = ', ln_nicep 413 WRITE(numout,*) ' Diagnose heat/salt budget or not ln_limdiahsb = ', ln_limdiahsb 414 WRITE(numout,*) ' Output heat/salt budget or not ln_limdiaout = ', ln_limdiaout 415 ENDIF 416 ! 417 !IF( lk_mpp .AND. ln_nicep ) THEN 418 ! ln_nicep = .FALSE. 419 ! CALL ctl_warn( 'ice_run : specific control print for LIM3 desactivated with MPI' ) 420 !ENDIF 421 IF( ln_nicep ) THEN ! control print at a given point 422 jiindx = 15 ; jjindx = 44 423 IF(lwp) WRITE(numout,*) ' The debugging point is : jiindx : ',jiindx, ' jjindx : ',jjindx 424 ENDIF 425 ! 426 END SUBROUTINE ice_run 427 428 429 SUBROUTINE lim_itd_init 430 !!------------------------------------------------------------------ 431 !! *** ROUTINE lim_itd_init *** 432 !! 433 !! ** Purpose : Initializes the ice thickness distribution 434 !! ** Method : ... 435 !! Note : hi_max(jpl) is here set up to a value close to 7 m for 436 !! limistate (only) and is changed to 99 m in sbc_lim_init 437 !!------------------------------------------------------------------ 438 INTEGER :: jl ! dummy loop index 439 REAL(wp) :: zc1, zc2, zc3, zx1 ! local scalars 440 REAL(wp) :: zhmax, znum, zden, zalpha ! 441 !!------------------------------------------------------------------ 442 443 IF(lwp) WRITE(numout,*) 444 IF(lwp) WRITE(numout,*) 'lim_itd_init : Initialization of ice thickness distribution ' 445 IF(lwp) WRITE(numout,*) '~~~~~~~~~~~~' 446 447 !------------------------------------------------------------------------------! 448 ! 1) Ice thickness distribution parameters initialization 449 !------------------------------------------------------------------------------! 450 IF(lwp) WRITE(numout,*) ' Number of ice categories jpl = ', jpl 451 452 !- Thickness categories boundaries 453 !---------------------------------- 454 ! Clem - je sais pas encore dans quelle namelist les mettre, ca depend des chgts liés à bdy 455 nn_hibnd = 2 ! thickness category boundaries: tanh function (1) h^(-alpha) (2) 456 rn_hibnd = 2.5 ! mean thickness of the domain (used to compute category boundaries, nn_hibnd = 2 only) 457 458 hi_max(:) = 0._wp 459 460 SELECT CASE ( nn_hibnd ) 461 !---------------------- 462 CASE (1) ! tanh function (CICE) 463 !---------------------- 464 zc1 = 3._wp / REAL( jpl, wp ) 465 zc2 = 10._wp * zc1 466 zc3 = 3._wp 467 468 DO jl = 1, jpl 469 zx1 = REAL( jl-1, wp ) / REAL( jpl, wp ) 470 hi_max(jl) = hi_max(jl-1) + zc1 + zc2 * (1._wp + TANH( zc3 * (zx1 - 1._wp ) ) ) 471 END DO 472 473 !---------------------- 474 CASE (2) ! h^(-alpha) function 475 !---------------------- 476 zalpha = 0.05 ! exponent of the transform function 477 478 zhmax = 3.*rn_hibnd 479 480 DO jl = 1, jpl 481 znum = jpl * ( zhmax+1 )**zalpha 482 zden = ( jpl - jl ) * ( zhmax+1 )**zalpha + jl 483 hi_max(jl) = ( znum / zden )**(1./zalpha) - 1 484 END DO 485 486 END SELECT 487 488 DO jl = 1, jpl 489 hi_mean(jl) = ( hi_max(jl) + hi_max(jl-1) ) * 0.5_wp 490 END DO 491 ! Set hi_max(jpl) to a big value to ensure that all ice is thinner than hi_max(jpl) 492 hi_max(jpl) = 99._wp 493 494 IF(lwp) WRITE(numout,*) ' Thickness category boundaries ' 495 IF(lwp) WRITE(numout,*) ' hi_max ', hi_max(0:jpl) 496 ! 497 END SUBROUTINE lim_itd_init 498 350 499 351 500 SUBROUTINE ice_lim_flx( ptn_ice, palb_ice, pqns_ice, pqsr_ice, & 352 501 & pdqn_ice, pqla_ice, pdql_ice, k_limflx ) 353 502 !!--------------------------------------------------------------------- … … 427 576 ! 428 577 END SUBROUTINE ice_lim_flx 429 430 431 SUBROUTINE lim_ctl( kt ) 432 !!----------------------------------------------------------------------- 433 !! *** ROUTINE lim_ctl *** 434 !! 435 !! ** Purpose : Alerts in case of model crash 436 !!------------------------------------------------------------------- 437 INTEGER, INTENT(in) :: kt ! ocean time step 438 INTEGER :: ji, jj, jk, jl ! dummy loop indices 439 INTEGER :: inb_altests ! number of alert tests (max 20) 440 INTEGER :: ialert_id ! number of the current alert 441 REAL(wp) :: ztmelts ! ice layer melting point 442 CHARACTER (len=30), DIMENSION(20) :: cl_alname ! name of alert 443 INTEGER , DIMENSION(20) :: inb_alp ! number of alerts positive 444 !!------------------------------------------------------------------- 445 446 inb_altests = 10 447 inb_alp(:) = 0 448 449 ! Alert if incompatible volume and concentration 450 ialert_id = 2 ! reference number of this alert 451 cl_alname(ialert_id) = ' Incompat vol and con ' ! name of the alert 452 453 DO jl = 1, jpl 454 DO jj = 1, jpj 455 DO ji = 1, jpi 456 IF( v_i(ji,jj,jl) /= 0._wp .AND. a_i(ji,jj,jl) == 0._wp ) THEN 457 !WRITE(numout,*) ' ALERTE 2 : Incompatible volume and concentration ' 458 !WRITE(numout,*) ' at_i ', at_i(ji,jj) 459 !WRITE(numout,*) ' Point - category', ji, jj, jl 460 !WRITE(numout,*) ' a_i *** a_i_b ', a_i (ji,jj,jl), a_i_b (ji,jj,jl) 461 !WRITE(numout,*) ' v_i *** v_i_b ', v_i (ji,jj,jl), v_i_b (ji,jj,jl) 462 !WRITE(numout,*) ' d_a_i_thd/trp ', d_a_i_thd(ji,jj,jl), d_a_i_trp(ji,jj,jl) 463 !WRITE(numout,*) ' d_v_i_thd/trp ', d_v_i_thd(ji,jj,jl), d_v_i_trp(ji,jj,jl) 464 inb_alp(ialert_id) = inb_alp(ialert_id) + 1 465 ENDIF 466 END DO 467 END DO 468 END DO 469 470 ! Alerte if very thick ice 471 ialert_id = 3 ! reference number of this alert 472 cl_alname(ialert_id) = ' Very thick ice ' ! name of the alert 473 jl = jpl 474 DO jj = 1, jpj 475 DO ji = 1, jpi 476 IF( ht_i(ji,jj,jl) > 50._wp ) THEN 477 !CALL lim_prt_state( kt, ji, jj, 2, ' ALERTE 3 : Very thick ice ' ) 478 inb_alp(ialert_id) = inb_alp(ialert_id) + 1 479 ENDIF 480 END DO 481 END DO 482 483 ! Alert if very fast ice 484 ialert_id = 4 ! reference number of this alert 485 cl_alname(ialert_id) = ' Very fast ice ' ! name of the alert 486 DO jj = 1, jpj 487 DO ji = 1, jpi 488 IF( MAX( ABS( u_ice(ji,jj) ), ABS( v_ice(ji,jj) ) ) > 1.5 .AND. & 489 & at_i(ji,jj) > 0._wp ) THEN 490 !CALL lim_prt_state( kt, ji, jj, 1, ' ALERTE 4 : Very fast ice ' ) 491 !WRITE(numout,*) ' ice strength : ', strength(ji,jj) 492 !WRITE(numout,*) ' oceanic stress utau : ', utau(ji,jj) 493 !WRITE(numout,*) ' oceanic stress vtau : ', vtau(ji,jj) 494 !WRITE(numout,*) ' sea-ice stress utau_ice : ', utau_ice(ji,jj) 495 !WRITE(numout,*) ' sea-ice stress vtau_ice : ', vtau_ice(ji,jj) 496 !WRITE(numout,*) ' oceanic speed u : ', u_oce(ji,jj) 497 !WRITE(numout,*) ' oceanic speed v : ', v_oce(ji,jj) 498 !WRITE(numout,*) ' sst : ', sst_m(ji,jj) 499 !WRITE(numout,*) ' sss : ', sss_m(ji,jj) 500 !WRITE(numout,*) 501 inb_alp(ialert_id) = inb_alp(ialert_id) + 1 502 ENDIF 503 END DO 504 END DO 505 506 ! Alert if there is ice on continents 507 ialert_id = 6 ! reference number of this alert 508 cl_alname(ialert_id) = ' Ice on continents ' ! name of the alert 509 DO jj = 1, jpj 510 DO ji = 1, jpi 511 IF( tms(ji,jj) <= 0._wp .AND. at_i(ji,jj) > 0._wp ) THEN 512 !CALL lim_prt_state( kt, ji, jj, 1, ' ALERTE 6 : Ice on continents ' ) 513 !WRITE(numout,*) ' masks s, u, v : ', tms(ji,jj), tmu(ji,jj), tmv(ji,jj) 514 !WRITE(numout,*) ' sst : ', sst_m(ji,jj) 515 !WRITE(numout,*) ' sss : ', sss_m(ji,jj) 516 !WRITE(numout,*) ' at_i(ji,jj) : ', at_i(ji,jj) 517 !WRITE(numout,*) ' v_ice(ji,jj) : ', v_ice(ji,jj) 518 !WRITE(numout,*) ' v_ice(ji,jj-1) : ', v_ice(ji,jj-1) 519 !WRITE(numout,*) ' u_ice(ji-1,jj) : ', u_ice(ji-1,jj) 520 !WRITE(numout,*) ' u_ice(ji,jj) : ', v_ice(ji,jj) 521 ! 522 inb_alp(ialert_id) = inb_alp(ialert_id) + 1 523 ENDIF 524 END DO 525 END DO 526 527 ! 528 ! ! Alert if very fresh ice 529 ialert_id = 7 ! reference number of this alert 530 cl_alname(ialert_id) = ' Very fresh ice ' ! name of the alert 531 DO jl = 1, jpl 532 DO jj = 1, jpj 533 DO ji = 1, jpi 534 IF( sm_i(ji,jj,jl) < 0.1 .AND. a_i(ji,jj,jl) > 0._wp ) THEN 535 ! CALL lim_prt_state(kt,ji,jj,1, ' ALERTE 7 : Very fresh ice ' ) 536 ! WRITE(numout,*) ' sst : ', sst_m(ji,jj) 537 ! WRITE(numout,*) ' sss : ', sss_m(ji,jj) 538 ! WRITE(numout,*) 539 inb_alp(ialert_id) = inb_alp(ialert_id) + 1 540 ENDIF 541 END DO 542 END DO 543 END DO 544 ! 545 546 ! ! Alert if too old ice 547 ialert_id = 9 ! reference number of this alert 548 cl_alname(ialert_id) = ' Very old ice ' ! name of the alert 549 DO jl = 1, jpl 550 DO jj = 1, jpj 551 DO ji = 1, jpi 552 IF ( ( ( ABS( o_i(ji,jj,jl) ) > rdt_ice ) .OR. & 553 ( ABS( o_i(ji,jj,jl) ) < 0._wp) ) .AND. & 554 ( a_i(ji,jj,jl) > 0._wp ) ) THEN 555 !CALL lim_prt_state( kt, ji, jj, 1, ' ALERTE 9 : Wrong ice age ') 556 inb_alp(ialert_id) = inb_alp(ialert_id) + 1 557 ENDIF 558 END DO 559 END DO 560 END DO 561 562 ! Alert on salt flux 563 ialert_id = 5 ! reference number of this alert 564 cl_alname(ialert_id) = ' High salt flux ' ! name of the alert 565 DO jj = 1, jpj 566 DO ji = 1, jpi 567 IF( ABS( sfx (ji,jj) ) .GT. 1.0e-2 ) THEN ! = 1 psu/day for 1m ocean depth 568 !CALL lim_prt_state( kt, ji, jj, 3, ' ALERTE 5 : High salt flux ' ) 569 !DO jl = 1, jpl 570 !WRITE(numout,*) ' Category no: ', jl 571 !WRITE(numout,*) ' a_i : ', a_i (ji,jj,jl) , ' a_i_b : ', a_i_b (ji,jj,jl) 572 !WRITE(numout,*) ' d_a_i_trp : ', d_a_i_trp(ji,jj,jl) , ' d_a_i_thd : ', d_a_i_thd(ji,jj,jl) 573 !WRITE(numout,*) ' v_i : ', v_i (ji,jj,jl) , ' v_i_b : ', v_i_b (ji,jj,jl) 574 !WRITE(numout,*) ' d_v_i_trp : ', d_v_i_trp(ji,jj,jl) , ' d_v_i_thd : ', d_v_i_thd(ji,jj,jl) 575 !WRITE(numout,*) ' ' 576 !END DO 577 inb_alp(ialert_id) = inb_alp(ialert_id) + 1 578 ENDIF 579 END DO 580 END DO 581 582 ! Alert if qns very big 583 ialert_id = 8 ! reference number of this alert 584 cl_alname(ialert_id) = ' fnsolar very big ' ! name of the alert 585 DO jj = 1, jpj 586 DO ji = 1, jpi 587 IF( ABS( qns(ji,jj) ) > 1500._wp .AND. at_i(ji,jj) > 0._wp ) THEN 588 ! 589 !WRITE(numout,*) ' ALERTE 8 : Very high non-solar heat flux' 590 !WRITE(numout,*) ' ji, jj : ', ji, jj 591 !WRITE(numout,*) ' qns : ', qns(ji,jj) 592 !WRITE(numout,*) ' sst : ', sst_m(ji,jj) 593 !WRITE(numout,*) ' sss : ', sss_m(ji,jj) 594 ! 595 !CALL lim_prt_state( kt, ji, jj, 2, ' ') 596 inb_alp(ialert_id) = inb_alp(ialert_id) + 1 597 ! 598 ENDIF 599 END DO 600 END DO 601 !+++++ 602 603 ! Alert if very warm ice 604 ialert_id = 10 ! reference number of this alert 605 cl_alname(ialert_id) = ' Very warm ice ' ! name of the alert 606 inb_alp(ialert_id) = 0 607 DO jl = 1, jpl 608 DO jk = 1, nlay_i 609 DO jj = 1, jpj 610 DO ji = 1, jpi 611 ztmelts = -tmut * s_i(ji,jj,jk,jl) + rtt 612 IF( t_i(ji,jj,jk,jl) >= ztmelts .AND. v_i(ji,jj,jl) > 1.e-10 & 613 & .AND. a_i(ji,jj,jl) > 0._wp ) THEN 614 !WRITE(numout,*) ' ALERTE 10 : Very warm ice' 615 !WRITE(numout,*) ' ji, jj, jk, jl : ', ji, jj, jk, jl 616 !WRITE(numout,*) ' t_i : ', t_i(ji,jj,jk,jl) 617 !WRITE(numout,*) ' e_i : ', e_i(ji,jj,jk,jl) 618 !WRITE(numout,*) ' s_i : ', s_i(ji,jj,jk,jl) 619 !WRITE(numout,*) ' ztmelts : ', ztmelts 620 inb_alp(ialert_id) = inb_alp(ialert_id) + 1 621 ENDIF 622 END DO 623 END DO 624 END DO 625 END DO 626 627 ! sum of the alerts on all processors 628 IF( lk_mpp ) THEN 629 DO ialert_id = 1, inb_altests 630 CALL mpp_sum(inb_alp(ialert_id)) 631 END DO 632 ENDIF 633 634 ! print alerts 635 IF( lwp ) THEN 636 ialert_id = 1 ! reference number of this alert 637 cl_alname(ialert_id) = ' NO alerte 1 ' ! name of the alert 638 WRITE(numout,*) ' time step ',kt 639 WRITE(numout,*) ' All alerts at the end of ice model ' 640 DO ialert_id = 1, inb_altests 641 WRITE(numout,*) ialert_id, cl_alname(ialert_id)//' : ', inb_alp(ialert_id), ' times ! ' 642 END DO 643 ENDIF 644 ! 645 END SUBROUTINE lim_ctl 646 647 648 SUBROUTINE lim_prt_state( kt, ki, kj, kn, cd1 ) 649 !!----------------------------------------------------------------------- 650 !! *** ROUTINE lim_prt_state *** 651 !! 652 !! ** Purpose : Writes global ice state on the (i,j) point 653 !! in ocean.ouput 654 !! 3 possibilities exist 655 !! n = 1/-1 -> simple ice state (plus Mechanical Check if -1) 656 !! n = 2 -> exhaustive state 657 !! n = 3 -> ice/ocean salt fluxes 658 !! 659 !! ** input : point coordinates (i,j) 660 !! n : number of the option 661 !!------------------------------------------------------------------- 662 INTEGER , INTENT(in) :: kt ! ocean time step 663 INTEGER , INTENT(in) :: ki, kj, kn ! ocean gridpoint indices 664 CHARACTER(len=*), INTENT(in) :: cd1 ! 665 !! 666 INTEGER :: jl, ji, jj 667 !!------------------------------------------------------------------- 668 669 DO ji = mi0(ki), mi1(ki) 670 DO jj = mj0(kj), mj1(kj) 671 672 WRITE(numout,*) ' time step ',kt,' ',cd1 ! print title 673 674 !---------------- 675 ! Simple state 676 !---------------- 677 678 IF ( kn == 1 .OR. kn == -1 ) THEN 679 WRITE(numout,*) ' lim_prt_state - Point : ',ji,jj 680 WRITE(numout,*) ' ~~~~~~~~~~~~~~ ' 681 WRITE(numout,*) ' Simple state ' 682 WRITE(numout,*) ' masks s,u,v : ', tms(ji,jj), tmu(ji,jj), tmv(ji,jj) 683 WRITE(numout,*) ' lat - long : ', gphit(ji,jj), glamt(ji,jj) 684 WRITE(numout,*) ' Time step : ', numit 685 WRITE(numout,*) ' - Ice drift ' 686 WRITE(numout,*) ' ~~~~~~~~~~~ ' 687 WRITE(numout,*) ' u_ice(i-1,j) : ', u_ice(ji-1,jj) 688 WRITE(numout,*) ' u_ice(i ,j) : ', u_ice(ji,jj) 689 WRITE(numout,*) ' v_ice(i ,j-1): ', v_ice(ji,jj-1) 690 WRITE(numout,*) ' v_ice(i ,j) : ', v_ice(ji,jj) 691 WRITE(numout,*) ' strength : ', strength(ji,jj) 692 WRITE(numout,*) 693 WRITE(numout,*) ' - Cell values ' 694 WRITE(numout,*) ' ~~~~~~~~~~~ ' 695 WRITE(numout,*) ' cell area : ', area(ji,jj) 696 WRITE(numout,*) ' at_i : ', at_i(ji,jj) 697 WRITE(numout,*) ' vt_i : ', vt_i(ji,jj) 698 WRITE(numout,*) ' vt_s : ', vt_s(ji,jj) 699 DO jl = 1, jpl 700 WRITE(numout,*) ' - Category (', jl,')' 701 WRITE(numout,*) ' a_i : ', a_i(ji,jj,jl) 702 WRITE(numout,*) ' ht_i : ', ht_i(ji,jj,jl) 703 WRITE(numout,*) ' ht_s : ', ht_s(ji,jj,jl) 704 WRITE(numout,*) ' v_i : ', v_i(ji,jj,jl) 705 WRITE(numout,*) ' v_s : ', v_s(ji,jj,jl) 706 WRITE(numout,*) ' e_s : ', e_s(ji,jj,1,jl)/1.0e9 707 WRITE(numout,*) ' e_i : ', e_i(ji,jj,1:nlay_i,jl)/1.0e9 708 WRITE(numout,*) ' t_su : ', t_su(ji,jj,jl) 709 WRITE(numout,*) ' t_snow : ', t_s(ji,jj,1,jl) 710 WRITE(numout,*) ' t_i : ', t_i(ji,jj,1:nlay_i,jl) 711 WRITE(numout,*) ' sm_i : ', sm_i(ji,jj,jl) 712 WRITE(numout,*) ' smv_i : ', smv_i(ji,jj,jl) 713 WRITE(numout,*) 714 END DO 715 ENDIF 716 IF( kn == -1 ) THEN 717 WRITE(numout,*) ' Mechanical Check ************** ' 718 WRITE(numout,*) ' Check what means ice divergence ' 719 WRITE(numout,*) ' Total ice concentration ', at_i (ji,jj) 720 WRITE(numout,*) ' Total lead fraction ', ato_i(ji,jj) 721 WRITE(numout,*) ' Sum of both ', ato_i(ji,jj) + at_i(ji,jj) 722 WRITE(numout,*) ' Sum of both minus 1 ', ato_i(ji,jj) + at_i(ji,jj) - 1.00 723 ENDIF 724 725 726 !-------------------- 727 ! Exhaustive state 728 !-------------------- 729 730 IF ( kn .EQ. 2 ) THEN 731 WRITE(numout,*) ' lim_prt_state - Point : ',ji,jj 732 WRITE(numout,*) ' ~~~~~~~~~~~~~~ ' 733 WRITE(numout,*) ' Exhaustive state ' 734 WRITE(numout,*) ' lat - long ', gphit(ji,jj), glamt(ji,jj) 735 WRITE(numout,*) ' Time step ', numit 736 WRITE(numout,*) 737 WRITE(numout,*) ' - Cell values ' 738 WRITE(numout,*) ' ~~~~~~~~~~~ ' 739 WRITE(numout,*) ' cell area : ', area(ji,jj) 740 WRITE(numout,*) ' at_i : ', at_i(ji,jj) 741 WRITE(numout,*) ' vt_i : ', vt_i(ji,jj) 742 WRITE(numout,*) ' vt_s : ', vt_s(ji,jj) 743 WRITE(numout,*) ' u_ice(i-1,j) : ', u_ice(ji-1,jj) 744 WRITE(numout,*) ' u_ice(i ,j) : ', u_ice(ji,jj) 745 WRITE(numout,*) ' v_ice(i ,j-1): ', v_ice(ji,jj-1) 746 WRITE(numout,*) ' v_ice(i ,j) : ', v_ice(ji,jj) 747 WRITE(numout,*) ' strength : ', strength(ji,jj) 748 WRITE(numout,*) ' d_u_ice_dyn : ', d_u_ice_dyn(ji,jj), ' d_v_ice_dyn : ', d_v_ice_dyn(ji,jj) 749 WRITE(numout,*) ' u_ice_b : ', u_ice_b(ji,jj) , ' v_ice_b : ', v_ice_b(ji,jj) 750 WRITE(numout,*) 751 752 DO jl = 1, jpl 753 WRITE(numout,*) ' - Category (',jl,')' 754 WRITE(numout,*) ' ~~~~~~~~ ' 755 WRITE(numout,*) ' ht_i : ', ht_i(ji,jj,jl) , ' ht_s : ', ht_s(ji,jj,jl) 756 WRITE(numout,*) ' t_i : ', t_i(ji,jj,1:nlay_i,jl) 757 WRITE(numout,*) ' t_su : ', t_su(ji,jj,jl) , ' t_s : ', t_s(ji,jj,1,jl) 758 WRITE(numout,*) ' sm_i : ', sm_i(ji,jj,jl) , ' o_i : ', o_i(ji,jj,jl) 759 WRITE(numout,*) ' a_i : ', a_i(ji,jj,jl) , ' a_i_b : ', a_i_b(ji,jj,jl) 760 WRITE(numout,*) ' d_a_i_trp : ', d_a_i_trp(ji,jj,jl) , ' d_a_i_thd : ', d_a_i_thd(ji,jj,jl) 761 WRITE(numout,*) ' v_i : ', v_i(ji,jj,jl) , ' v_i_b : ', v_i_b(ji,jj,jl) 762 WRITE(numout,*) ' d_v_i_trp : ', d_v_i_trp(ji,jj,jl) , ' d_v_i_thd : ', d_v_i_thd(ji,jj,jl) 763 WRITE(numout,*) ' v_s : ', v_s(ji,jj,jl) , ' v_s_b : ', v_s_b(ji,jj,jl) 764 WRITE(numout,*) ' d_v_s_trp : ', d_v_s_trp(ji,jj,jl) , ' d_v_s_thd : ', d_v_s_thd(ji,jj,jl) 765 WRITE(numout,*) ' e_i1 : ', e_i(ji,jj,1,jl)/1.0e9 , ' ei1 : ', e_i_b(ji,jj,1,jl)/1.0e9 766 WRITE(numout,*) ' de_i1_trp : ', d_e_i_trp(ji,jj,1,jl)/1.0e9, ' de_i1_thd : ', d_e_i_thd(ji,jj,1,jl)/1.0e9 767 WRITE(numout,*) ' e_i2 : ', e_i(ji,jj,2,jl)/1.0e9 , ' ei2_b : ', e_i_b(ji,jj,2,jl)/1.0e9 768 WRITE(numout,*) ' de_i2_trp : ', d_e_i_trp(ji,jj,2,jl)/1.0e9, ' de_i2_thd : ', d_e_i_thd(ji,jj,2,jl)/1.0e9 769 WRITE(numout,*) ' e_snow : ', e_s(ji,jj,1,jl) , ' e_snow_b : ', e_s_b(ji,jj,1,jl) 770 WRITE(numout,*) ' d_e_s_trp : ', d_e_s_trp(ji,jj,1,jl) , ' d_e_s_thd : ', d_e_s_thd(ji,jj,1,jl) 771 WRITE(numout,*) ' smv_i : ', smv_i(ji,jj,jl) , ' smv_i_b : ', smv_i_b(ji,jj,jl) 772 WRITE(numout,*) ' d_smv_i_trp: ', d_smv_i_trp(ji,jj,jl) , ' d_smv_i_thd: ', d_smv_i_thd(ji,jj,jl) 773 WRITE(numout,*) ' oa_i : ', oa_i(ji,jj,jl) , ' oa_i_b : ', oa_i_b(ji,jj,jl) 774 WRITE(numout,*) ' d_oa_i_trp : ', d_oa_i_trp(ji,jj,jl) , ' d_oa_i_thd : ', d_oa_i_thd(ji,jj,jl) 775 END DO !jl 776 777 WRITE(numout,*) 778 WRITE(numout,*) ' - Heat / FW fluxes ' 779 WRITE(numout,*) ' ~~~~~~~~~~~~~~~~ ' 780 WRITE(numout,*) ' - Heat fluxes in and out the ice ***' 781 WRITE(numout,*) ' qsr_ini : ', pfrld(ji,jj) * qsr(ji,jj) + SUM( a_i_b(ji,jj,:) * qsr_ice(ji,jj,:) ) 782 WRITE(numout,*) ' qns_ini : ', pfrld(ji,jj) * qns(ji,jj) + SUM( a_i_b(ji,jj,:) * qns_ice(ji,jj,:) ) 783 WRITE(numout,*) 784 WRITE(numout,*) 785 WRITE(numout,*) ' sst : ', sst_m(ji,jj) 786 WRITE(numout,*) ' sss : ', sss_m(ji,jj) 787 WRITE(numout,*) 788 WRITE(numout,*) ' - Stresses ' 789 WRITE(numout,*) ' ~~~~~~~~ ' 790 WRITE(numout,*) ' utau_ice : ', utau_ice(ji,jj) 791 WRITE(numout,*) ' vtau_ice : ', vtau_ice(ji,jj) 792 WRITE(numout,*) ' utau : ', utau (ji,jj) 793 WRITE(numout,*) ' vtau : ', vtau (ji,jj) 794 WRITE(numout,*) ' oc. vel. u : ', u_oce (ji,jj) 795 WRITE(numout,*) ' oc. vel. v : ', v_oce (ji,jj) 796 ENDIF 797 798 !--------------------- 799 ! Salt / heat fluxes 800 !--------------------- 801 802 IF ( kn .EQ. 3 ) THEN 803 WRITE(numout,*) ' lim_prt_state - Point : ',ji,jj 804 WRITE(numout,*) ' ~~~~~~~~~~~~~~ ' 805 WRITE(numout,*) ' - Salt / Heat Fluxes ' 806 WRITE(numout,*) ' ~~~~~~~~~~~~~~~~ ' 807 WRITE(numout,*) ' lat - long ', gphit(ji,jj), glamt(ji,jj) 808 WRITE(numout,*) ' Time step ', numit 809 WRITE(numout,*) 810 WRITE(numout,*) ' - Heat fluxes at bottom interface ***' 811 WRITE(numout,*) ' qsr : ', qsr(ji,jj) 812 WRITE(numout,*) ' qns : ', qns(ji,jj) 813 WRITE(numout,*) 814 WRITE(numout,*) ' hfx_mass : ', hfx_thd(ji,jj) + hfx_dyn(ji,jj) + hfx_snw(ji,jj) + hfx_res(ji,jj) 815 WRITE(numout,*) ' hfx_in : ', hfx_in(ji,jj) 816 WRITE(numout,*) ' hfx_out : ', hfx_out(ji,jj) 817 WRITE(numout,*) ' dhc : ', diag_heat_dhc(ji,jj) 818 WRITE(numout,*) 819 WRITE(numout,*) ' hfx_dyn : ', hfx_dyn(ji,jj) 820 WRITE(numout,*) ' hfx_thd : ', hfx_thd(ji,jj) 821 WRITE(numout,*) ' hfx_res : ', hfx_res(ji,jj) 822 WRITE(numout,*) ' fhtur : ', fhtur(ji,jj) 823 WRITE(numout,*) ' qlead : ', qlead(ji,jj) * r1_rdtice 824 WRITE(numout,*) 825 WRITE(numout,*) ' - Salt fluxes at bottom interface ***' 826 WRITE(numout,*) ' emp : ', emp (ji,jj) 827 WRITE(numout,*) ' sfx : ', sfx (ji,jj) 828 WRITE(numout,*) ' sfx_res : ', sfx_res(ji,jj) 829 WRITE(numout,*) ' sfx_bri : ', sfx_bri(ji,jj) 830 WRITE(numout,*) ' sfx_dyn : ', sfx_dyn(ji,jj) 831 WRITE(numout,*) 832 WRITE(numout,*) ' - Momentum fluxes ' 833 WRITE(numout,*) ' utau : ', utau(ji,jj) 834 WRITE(numout,*) ' vtau : ', vtau(ji,jj) 835 ENDIF 836 WRITE(numout,*) ' ' 837 ! 838 END DO 839 END DO 840 ! 841 END SUBROUTINE lim_prt_state 842 843 578 579 SUBROUTINE sbc_lim_flx0 580 !!---------------------------------------------------------------------- 581 !! *** ROUTINE sbc_lim_flx0 *** 582 !! 583 !! ** purpose : set ice-ocean and ice-atm. fluxes to zeros at the beggining 584 !! of the time step 585 !!---------------------------------------------------------------------- 586 sfx (:,:) = 0._wp ; 587 sfx_bri(:,:) = 0._wp ; 588 sfx_sni(:,:) = 0._wp ; sfx_opw(:,:) = 0._wp 589 sfx_bog(:,:) = 0._wp ; sfx_dyn(:,:) = 0._wp 590 sfx_bom(:,:) = 0._wp ; sfx_sum(:,:) = 0._wp 591 sfx_res(:,:) = 0._wp 592 593 wfx_snw(:,:) = 0._wp ; wfx_ice(:,:) = 0._wp 594 wfx_sni(:,:) = 0._wp ; wfx_opw(:,:) = 0._wp 595 wfx_bog(:,:) = 0._wp ; wfx_dyn(:,:) = 0._wp 596 wfx_bom(:,:) = 0._wp ; wfx_sum(:,:) = 0._wp 597 wfx_res(:,:) = 0._wp ; wfx_sub(:,:) = 0._wp 598 wfx_spr(:,:) = 0._wp ; 599 600 hfx_in (:,:) = 0._wp ; hfx_out(:,:) = 0._wp 601 hfx_thd(:,:) = 0._wp ; 602 hfx_snw(:,:) = 0._wp ; hfx_opw(:,:) = 0._wp 603 hfx_bog(:,:) = 0._wp ; hfx_dyn(:,:) = 0._wp 604 hfx_bom(:,:) = 0._wp ; hfx_sum(:,:) = 0._wp 605 hfx_res(:,:) = 0._wp ; hfx_sub(:,:) = 0._wp 606 hfx_spr(:,:) = 0._wp ; hfx_dif(:,:) = 0._wp 607 hfx_err(:,:) = 0._wp ; hfx_err_rem(:,:) = 0._wp 608 609 afx_tot(:,:) = 0._wp ; 610 afx_dyn(:,:) = 0._wp ; afx_thd(:,:) = 0._wp 611 612 END SUBROUTINE sbc_lim_flx0 613 844 614 FUNCTION fice_cell_ave ( ptab ) 845 615 !!-------------------------------------------------------------------------- -
branches/2015/dev_r5044_CNRS_LIM3CLEAN/NEMOGCM/NEMO/OPA_SRC/SBC/sbcmod.F90
r4990 r5051 271 271 IF( ln_ssr ) CALL sbc_ssr_init ! Sea-Surface Restoring initialisation 272 272 ! 273 IF( nn_ice == 3 ) CALL sbc_lim_init ! LIM3 initialisation 274 273 275 IF( nn_ice == 4 ) CALL cice_sbc_init( nsbc ) ! CICE initialisation 274 276 !
Note: See TracChangeset
for help on using the changeset viewer.