Changeset 12949
 Timestamp:
 20200518T23:58:40+02:00 (4 months ago)
 Location:
 NEMO/branches/2020/r4.0HEAD_r12713_clem_dan_fixcpl/src/ICE
 Files:

 4 edited
Legend:
 Unmodified
 Added
 Removed

NEMO/branches/2020/r4.0HEAD_r12713_clem_dan_fixcpl/src/ICE/icecor.F90
r11536 r12949 81 81 DO jl = 1, jpl 82 82 WHERE( at_i(:,:) > rn_amax_2d(:,:) ) a_i(:,:,jl) = a_i(:,:,jl) * rn_amax_2d(:,:) / at_i(:,:) 83 END DO 84 83 END DO 84 ! ! 85 ! ! Rebin categories with thickness out of bounds ! 86 ! ! 87 IF ( jpl > 1 ) CALL ice_itd_reb( kt ) 88 ! 85 89 ! ! 86 90 IF ( nn_icesal == 2 ) THEN ! salinity must stay in bounds [Simin,Simax] ! … … 97 101 END DO 98 102 ENDIF 99 ! !100 ! ! Rebin categories with thickness out of bounds !101 ! !102 IF ( jpl > 1 ) CALL ice_itd_reb( kt )103 104 103 ! ! 105 104 CALL ice_var_zapsmall ! Zap small values ! 
NEMO/branches/2020/r4.0HEAD_r12713_clem_dan_fixcpl/src/ICE/icedyn_adv_pra.F90
r12832 r12949 82 82 REAL(wp), DIMENSION(:,:,:) , INTENT(inout) :: pa_ip ! melt pond fraction 83 83 REAL(wp), DIMENSION(:,:,:) , INTENT(inout) :: pv_ip ! melt pond volume 84 REAL(wp), DIMENSION(:,:,:) , INTENT(inout) :: pv_il ! melt pond lid thickness84 REAL(wp), DIMENSION(:,:,:) , INTENT(inout) :: pv_il ! melt pond lid thickness 85 85 REAL(wp), DIMENSION(:,:,:,:), INTENT(inout) :: pe_s ! snw heat content 86 86 REAL(wp), DIMENSION(:,:,:,:), INTENT(inout) :: pe_i ! ice heat content … … 92 92 REAL(wp), DIMENSION(jpi,jpj) :: zati1, zati2 93 93 REAL(wp), DIMENSION(jpi,jpj) :: zudy, zvdx 94 REAL(wp), DIMENSION(jpi,jpj,jpl) :: zhi_max, zhs_max, zhip_max 94 REAL(wp), DIMENSION(jpi,jpj,jpl) :: zhi_max, zhs_max, zhip_max, zs_i, zsi_max 95 REAL(wp), DIMENSION(jpi,jpj,nlay_i,jpl) :: ze_i, zei_max 96 REAL(wp), DIMENSION(jpi,jpj,nlay_s,jpl) :: ze_s, zes_max 95 97 REAL(wp), DIMENSION(jpi,jpj,jpl) :: zarea 96 98 REAL(wp), DIMENSION(jpi,jpj,jpl) :: z0ice, z0snw, z0ai, z0smi, z0oi … … 102 104 IF( kt == nit000 .AND. lwp ) WRITE(numout,*) ' ice_dyn_adv_pra: Prather advection scheme' 103 105 ! 104 !  Record max of the surrounding 9pts ice thick. (for call Hbig)  ! 106 !  Record max of the surrounding 9pts (for call Hbig)  ! 107 ! thickness and salinity 108 WHERE( pv_i(:,:,:) >= epsi10 ) ; zs_i(:,:,:) = psv_i(:,:,:) / pv_i(:,:,:) 109 ELSEWHERE ; zs_i(:,:,:) = 0._wp 110 END WHERE 105 111 DO jl = 1, jpl 106 112 DO jj = 2, jpjm1 … … 118 124 & ph_s (ji+1,jj+1,jl), ph_s (ji1,jj1,jl), & 119 125 & ph_s (ji+1,jj1,jl), ph_s (ji1,jj+1,jl) ) 126 zsi_max (ji,jj,jl) = MAX( epsi20, zs_i (ji,jj,jl), zs_i (ji+1,jj ,jl), zs_i (ji ,jj+1,jl), & 127 & zs_i (ji1,jj ,jl), zs_i (ji ,jj1,jl), & 128 & zs_i (ji+1,jj+1,jl), zs_i (ji1,jj1,jl), & 129 & zs_i (ji+1,jj1,jl), zs_i (ji1,jj+1,jl) ) 120 130 END DO 121 131 END DO 122 132 END DO 123 CALL lbc_lnk_multi( 'icedyn_adv_pra', zhi_max, 'T', 1., zhs_max, 'T', 1., zhip_max, 'T', 1. ) 133 CALL lbc_lnk_multi( 'icedyn_adv_pra', zhi_max, 'T', 1., zhs_max, 'T', 1., zhip_max, 'T', 1., zsi_max, 'T', 1. ) 134 ! 135 ! enthalpies 136 DO jk = 1, nlay_i 137 WHERE( pv_i(:,:,:) >= epsi10 ) ; ze_i(:,:,jk,:) = pe_i(:,:,jk,:) / pv_i(:,:,:) 138 ELSEWHERE ; ze_i(:,:,jk,:) = 0._wp 139 END WHERE 140 END DO 141 DO jk = 1, nlay_s 142 WHERE( pv_s(:,:,:) >= epsi10 ) ; ze_s(:,:,jk,:) = pe_s(:,:,jk,:) / pv_s(:,:,:) 143 ELSEWHERE ; ze_s(:,:,jk,:) = 0._wp 144 END WHERE 145 END DO 146 DO jl = 1, jpl 147 DO jk = 1, nlay_i 148 DO jj = 2, jpjm1 149 DO ji = fs_2, fs_jpim1 150 zei_max(ji,jj,jk,jl) = MAX( epsi20, ze_i(ji,jj,jk,jl), ze_i(ji+1,jj ,jk,jl), ze_i(ji ,jj+1,jk,jl), & 151 & ze_i(ji1,jj ,jk,jl), ze_i(ji ,jj1,jk,jl), & 152 & ze_i(ji+1,jj+1,jk,jl), ze_i(ji1,jj1,jk,jl), & 153 & ze_i(ji+1,jj1,jk,jl), ze_i(ji1,jj+1,jk,jl) ) 154 END DO 155 END DO 156 END DO 157 END DO 158 DO jl = 1, jpl 159 DO jk = 1, nlay_s 160 DO jj = 2, jpjm1 161 DO ji = fs_2, fs_jpim1 162 zes_max(ji,jj,jk,jl) = MAX( epsi20, ze_s(ji,jj,jk,jl), ze_s(ji+1,jj ,jk,jl), ze_s(ji ,jj+1,jk,jl), & 163 & ze_s(ji1,jj ,jk,jl), ze_s(ji ,jj1,jk,jl), & 164 & ze_s(ji+1,jj+1,jk,jl), ze_s(ji1,jj1,jk,jl), & 165 & ze_s(ji+1,jj1,jk,jl), ze_s(ji1,jj+1,jk,jl) ) 166 END DO 167 END DO 168 END DO 169 END DO 170 CALL lbc_lnk( 'icedyn_adv_pra', zei_max, 'T', 1. ) 171 CALL lbc_lnk( 'icedyn_adv_pra', zes_max, 'T', 1. ) 172 ! 124 173 ! 125 174 !  If ice drift is too fast, use subtime steps for advection (CFL test for stability)  ! … … 283 332 !  Make sure ice thickness is not too big  ! 284 333 ! (because ice thickness can be too large where ice concentration is very small) 285 CALL Hbig( zdt, zhi_max, zhs_max, zhip_max, pv_i, pv_s, pa_i, pa_ip, pv_ip, pe_s ) 334 CALL Hbig( zdt, zhi_max, zhs_max, zhip_max, zsi_max, zes_max, zei_max, & 335 & pv_i, pv_s, pa_i, pa_ip, pv_ip, psv_i, pe_s, pe_i ) 286 336 ! 287 337 !  Ensure snow load is not too big  ! … … 635 685 636 686 637 SUBROUTINE Hbig( pdt, phi_max, phs_max, phip_max, pv_i, pv_s, pa_i, pa_ip, pv_ip, pe_s ) 687 SUBROUTINE Hbig( pdt, phi_max, phs_max, phip_max, psi_max, pes_max, pei_max, & 688 & pv_i, pv_s, pa_i, pa_ip, pv_ip, psv_i, pe_s, pe_i ) 638 689 !! 639 690 !! *** ROUTINE Hbig *** … … 649 700 !! ** input : Max thickness of the surrounding 9points 650 701 !! 651 REAL(wp) , INTENT(in ) :: pdt ! tracer timestep 652 REAL(wp), DIMENSION(:,:,:) , INTENT(in ) :: phi_max, phs_max, phip_max ! max ice thick from surrounding 9pts 653 REAL(wp), DIMENSION(:,:,:) , INTENT(inout) :: pv_i, pv_s, pa_i, pa_ip, pv_ip 702 REAL(wp) , INTENT(in ) :: pdt ! tracer timestep 703 REAL(wp), DIMENSION(:,:,:) , INTENT(in ) :: phi_max, phs_max, phip_max, psi_max ! max ice thick from surrounding 9pts 704 REAL(wp), DIMENSION(:,:,:,:), INTENT(in ) :: pes_max 705 REAL(wp), DIMENSION(:,:,:,:), INTENT(in ) :: pei_max 706 REAL(wp), DIMENSION(:,:,:) , INTENT(inout) :: pv_i, pv_s, pa_i, pa_ip, pv_ip, psv_i 654 707 REAL(wp), DIMENSION(:,:,:,:), INTENT(inout) :: pe_s 655 ! 656 INTEGER :: ji, jj, jl ! dummy loop indices 657 REAL(wp) :: z1_dt, zhip, zhi, zhs, zfra 708 REAL(wp), DIMENSION(:,:,:,:), INTENT(inout) :: pe_i 709 ! 710 INTEGER :: ji, jj, jk, jl ! dummy loop indices 711 REAL(wp) :: z1_dt, zhip, zhi, zhs, zsi, zes, zei, zfra 658 712 !! 659 713 ! … … 661 715 ! 662 716 DO jl = 1, jpl 663 664 717 DO jj = 1, jpj 665 718 DO ji = 1, jpi … … 695 748 ENDIF 696 749 ! 750 ! !  check s_i  ! 751 ! if s_i is larger than the surrounding 9 pts => put salt excess in the ocean 752 zsi = psv_i(ji,jj,jl) / pv_i(ji,jj,jl) 753 IF( zsi > psi_max(ji,jj,jl) .AND. pa_i(ji,jj,jl) < 0.15 ) THEN 754 zfra = psi_max(ji,jj,jl) / zsi 755 sfx_res(ji,jj) = sfx_res(ji,jj) + psv_i(ji,jj,jl) * ( 1._wp  zfra ) * rhoi * z1_dt 756 psv_i(ji,jj,jl) = psv_i(ji,jj,jl) * zfra 757 ENDIF 758 ! 697 759 ENDIF 698 760 END DO 699 761 END DO 700 762 END DO 763 ! 764 ! !  check e_i/v_i  ! 765 DO jl = 1, jpl 766 DO jk = 1, nlay_i 767 DO jj = 1, jpj 768 DO ji = 1, jpi 769 IF ( pv_i(ji,jj,jl) > 0._wp ) THEN 770 ! if e_i/v_i is larger than the surrounding 9 pts => put the heat excess in the ocean 771 zei = pe_i(ji,jj,jk,jl) / pv_i(ji,jj,jl) 772 IF( zei > pei_max(ji,jj,jk,jl) .AND. pa_i(ji,jj,jl) < 0.15 ) THEN 773 zfra = pei_max(ji,jj,jk,jl) / zei 774 hfx_res(ji,jj) = hfx_res(ji,jj)  pe_i(ji,jj,jk,jl) * ( 1._wp  zfra ) * z1_dt ! W.m2 <0 775 pe_i(ji,jj,jk,jl) = pe_i(ji,jj,jk,jl) * zfra 776 ENDIF 777 ENDIF 778 END DO 779 END DO 780 END DO 781 END DO 782 ! !  check e_s/v_s  ! 783 DO jl = 1, jpl 784 DO jk = 1, nlay_s 785 DO jj = 1, jpj 786 DO ji = 1, jpi 787 IF ( pv_s(ji,jj,jl) > 0._wp ) THEN 788 ! if e_s/v_s is larger than the surrounding 9 pts => put the heat excess in the ocean 789 zes = pe_s(ji,jj,jk,jl) / pv_s(ji,jj,jl) 790 IF( zes > pes_max(ji,jj,jk,jl) .AND. pa_i(ji,jj,jl) < 0.15 ) THEN 791 zfra = pes_max(ji,jj,jk,jl) / zes 792 hfx_res(ji,jj) = hfx_res(ji,jj)  pe_s(ji,jj,jk,jl) * ( 1._wp  zfra ) * z1_dt ! W.m2 <0 793 pe_s(ji,jj,jk,jl) = pe_s(ji,jj,jk,jl) * zfra 794 ENDIF 795 ENDIF 796 END DO 797 END DO 798 END DO 799 END DO 701 800 ! 702 801 END SUBROUTINE Hbig 
NEMO/branches/2020/r4.0HEAD_r12713_clem_dan_fixcpl/src/ICE/icedyn_adv_umx.F90
r12832 r12949 93 93 REAL(wp) :: zamsk ! 1 if advection of concentration, 0 if advection of other tracers 94 94 REAL(wp) :: zdt, zvi_cen 95 REAL(wp), DIMENSION(1) :: zcflprv, zcflnow ! for global communication 96 REAL(wp), DIMENSION(jpi,jpj) :: zudy, zvdx, zcu_box, zcv_box 97 REAL(wp), DIMENSION(jpi,jpj) :: zati1, zati2 98 REAL(wp), DIMENSION(jpi,jpj,jpl) :: zu_cat, zv_cat 99 REAL(wp), DIMENSION(jpi,jpj,jpl) :: zua_ho, zva_ho, zua_ups, zva_ups 100 REAL(wp), DIMENSION(jpi,jpj,jpl) :: z1_ai , z1_aip, zhvar 101 REAL(wp), DIMENSION(jpi,jpj,jpl) :: zhi_max, zhs_max, zhip_max 95 REAL(wp), DIMENSION(1) :: zcflprv, zcflnow ! for global communication 96 REAL(wp), DIMENSION(jpi,jpj) :: zudy, zvdx, zcu_box, zcv_box 97 REAL(wp), DIMENSION(jpi,jpj) :: zati1, zati2 98 REAL(wp), DIMENSION(jpi,jpj,jpl) :: zu_cat, zv_cat 99 REAL(wp), DIMENSION(jpi,jpj,jpl) :: zua_ho, zva_ho, zua_ups, zva_ups 100 REAL(wp), DIMENSION(jpi,jpj,jpl) :: z1_ai , z1_aip, zhvar 101 REAL(wp), DIMENSION(jpi,jpj,jpl) :: zhi_max, zhs_max, zhip_max, zs_i, zsi_max 102 REAL(wp), DIMENSION(jpi,jpj,nlay_i,jpl) :: ze_i, zei_max 103 REAL(wp), DIMENSION(jpi,jpj,nlay_s,jpl) :: ze_s, zes_max 102 104 ! 103 105 REAL(wp), ALLOCATABLE, DIMENSION(:,:,:) :: zuv_ho, zvv_ho, zuv_ups, zvv_ups, z1_vi, z1_vs … … 106 108 IF( kt == nit000 .AND. lwp ) WRITE(numout,*) ' ice_dyn_adv_umx: UltimateMacho advection scheme' 107 109 ! 108 !  Record max of the surrounding 9pts ice thick. (for call Hbig)  ! 110 !  Record max of the surrounding 9pts (for call Hbig)  ! 111 ! thickness and salinity 112 WHERE( pv_i(:,:,:) >= epsi10 ) ; zs_i(:,:,:) = psv_i(:,:,:) / pv_i(:,:,:) 113 ELSEWHERE ; zs_i(:,:,:) = 0._wp 114 END WHERE 109 115 DO jl = 1, jpl 110 116 DO jj = 2, jpjm1 … … 122 128 & ph_s (ji+1,jj+1,jl), ph_s (ji1,jj1,jl), & 123 129 & ph_s (ji+1,jj1,jl), ph_s (ji1,jj+1,jl) ) 124 END DO 125 END DO 126 END DO 127 CALL lbc_lnk_multi( 'icedyn_adv_umx', zhi_max, 'T', 1., zhs_max, 'T', 1., zhip_max, 'T', 1. ) 130 zsi_max (ji,jj,jl) = MAX( epsi20, zs_i (ji,jj,jl), zs_i (ji+1,jj ,jl), zs_i (ji ,jj+1,jl), & 131 & zs_i (ji1,jj ,jl), zs_i (ji ,jj1,jl), & 132 & zs_i (ji+1,jj+1,jl), zs_i (ji1,jj1,jl), & 133 & zs_i (ji+1,jj1,jl), zs_i (ji1,jj+1,jl) ) 134 END DO 135 END DO 136 END DO 137 CALL lbc_lnk_multi( 'icedyn_adv_umx', zhi_max, 'T', 1., zhs_max, 'T', 1., zhip_max, 'T', 1., zsi_max, 'T', 1. ) 138 ! 139 ! enthalpies 140 DO jk = 1, nlay_i 141 WHERE( pv_i(:,:,:) >= epsi10 ) ; ze_i(:,:,jk,:) = pe_i(:,:,jk,:) / pv_i(:,:,:) 142 ELSEWHERE ; ze_i(:,:,jk,:) = 0._wp 143 END WHERE 144 END DO 145 DO jk = 1, nlay_s 146 WHERE( pv_s(:,:,:) >= epsi10 ) ; ze_s(:,:,jk,:) = pe_s(:,:,jk,:) / pv_s(:,:,:) 147 ELSEWHERE ; ze_s(:,:,jk,:) = 0._wp 148 END WHERE 149 END DO 150 DO jl = 1, jpl 151 DO jk = 1, nlay_i 152 DO jj = 2, jpjm1 153 DO ji = fs_2, fs_jpim1 154 zei_max(ji,jj,jk,jl) = MAX( epsi20, ze_i(ji,jj,jk,jl), ze_i(ji+1,jj ,jk,jl), ze_i(ji ,jj+1,jk,jl), & 155 & ze_i(ji1,jj ,jk,jl), ze_i(ji ,jj1,jk,jl), & 156 & ze_i(ji+1,jj+1,jk,jl), ze_i(ji1,jj1,jk,jl), & 157 & ze_i(ji+1,jj1,jk,jl), ze_i(ji1,jj+1,jk,jl) ) 158 END DO 159 END DO 160 END DO 161 END DO 162 DO jl = 1, jpl 163 DO jk = 1, nlay_s 164 DO jj = 2, jpjm1 165 DO ji = fs_2, fs_jpim1 166 zes_max(ji,jj,jk,jl) = MAX( epsi20, ze_s(ji,jj,jk,jl), ze_s(ji+1,jj ,jk,jl), ze_s(ji ,jj+1,jk,jl), & 167 & ze_s(ji1,jj ,jk,jl), ze_s(ji ,jj1,jk,jl), & 168 & ze_s(ji+1,jj+1,jk,jl), ze_s(ji1,jj1,jk,jl), & 169 & ze_s(ji+1,jj1,jk,jl), ze_s(ji1,jj+1,jk,jl) ) 170 END DO 171 END DO 172 END DO 173 END DO 174 CALL lbc_lnk( 'icedyn_adv_pra', zei_max, 'T', 1. ) 175 CALL lbc_lnk( 'icedyn_adv_pra', zes_max, 'T', 1. ) 128 176 ! 129 177 ! … … 362 410 !  Make sure ice thickness is not too big  ! 363 411 ! (because ice thickness can be too large where ice concentration is very small) 364 CALL Hbig( zdt, zhi_max, zhs_max, zhip_max, pv_i, pv_s, pa_i, pa_ip, pv_ip, pe_s ) 412 CALL Hbig( zdt, zhi_max, zhs_max, zhip_max, zsi_max, zes_max, zei_max, & 413 & pv_i, pv_s, pa_i, pa_ip, pv_ip, psv_i, pe_s, pe_i ) 365 414 ! 366 415 !  Ensure snow load is not too big  ! … … 1525 1574 1526 1575 1527 SUBROUTINE Hbig( pdt, phi_max, phs_max, phip_max, pv_i, pv_s, pa_i, pa_ip, pv_ip, pe_s ) 1576 SUBROUTINE Hbig( pdt, phi_max, phs_max, phip_max, psi_max, pes_max, pei_max, & 1577 & pv_i, pv_s, pa_i, pa_ip, pv_ip, psv_i, pe_s, pe_i ) 1528 1578 !! 1529 1579 !! *** ROUTINE Hbig *** … … 1539 1589 !! ** input : Max thickness of the surrounding 9points 1540 1590 !! 1541 REAL(wp) , INTENT(in ) :: pdt ! tracer timestep 1542 REAL(wp), DIMENSION(:,:,:) , INTENT(in ) :: phi_max, phs_max, phip_max ! max ice thick from surrounding 9pts 1543 REAL(wp), DIMENSION(:,:,:) , INTENT(inout) :: pv_i, pv_s, pa_i, pa_ip, pv_ip 1591 REAL(wp) , INTENT(in ) :: pdt ! tracer timestep 1592 REAL(wp), DIMENSION(:,:,:) , INTENT(in ) :: phi_max, phs_max, phip_max, psi_max ! max ice thick from surrounding 9pts 1593 REAL(wp), DIMENSION(:,:,:,:), INTENT(in ) :: pes_max 1594 REAL(wp), DIMENSION(:,:,:,:), INTENT(in ) :: pei_max 1595 REAL(wp), DIMENSION(:,:,:) , INTENT(inout) :: pv_i, pv_s, pa_i, pa_ip, pv_ip, psv_i 1544 1596 REAL(wp), DIMENSION(:,:,:,:), INTENT(inout) :: pe_s 1545 ! 1546 INTEGER :: ji, jj, jl ! dummy loop indices 1547 REAL(wp) :: z1_dt, zhip, zhi, zhs, zfra 1597 REAL(wp), DIMENSION(:,:,:,:), INTENT(inout) :: pe_i 1598 ! 1599 INTEGER :: ji, jj, jk, jl ! dummy loop indices 1600 REAL(wp) :: z1_dt, zhip, zhi, zhs, zsi, zes, zei, zfra 1548 1601 !! 1549 1602 ! … … 1551 1604 ! 1552 1605 DO jl = 1, jpl 1553 1554 1606 DO jj = 1, jpj 1555 1607 DO ji = 1, jpi … … 1585 1637 ENDIF 1586 1638 ! 1639 ! !  check s_i  ! 1640 ! if s_i is larger than the surrounding 9 pts => put salt excess in the ocean 1641 zsi = psv_i(ji,jj,jl) / pv_i(ji,jj,jl) 1642 IF( zsi > psi_max(ji,jj,jl) .AND. pa_i(ji,jj,jl) < 0.15 ) THEN 1643 zfra = psi_max(ji,jj,jl) / zsi 1644 sfx_res(ji,jj) = sfx_res(ji,jj) + psv_i(ji,jj,jl) * ( 1._wp  zfra ) * rhoi * z1_dt 1645 psv_i(ji,jj,jl) = psv_i(ji,jj,jl) * zfra 1646 ENDIF 1647 ! 1587 1648 ENDIF 1588 1649 END DO 1589 1650 END DO 1590 1651 END DO 1652 ! 1653 ! !  check e_i/v_i  ! 1654 DO jl = 1, jpl 1655 DO jk = 1, nlay_i 1656 DO jj = 1, jpj 1657 DO ji = 1, jpi 1658 IF ( pv_i(ji,jj,jl) > 0._wp ) THEN 1659 ! if e_i/v_i is larger than the surrounding 9 pts => put the heat excess in the ocean 1660 zei = pe_i(ji,jj,jk,jl) / pv_i(ji,jj,jl) 1661 IF( zei > pei_max(ji,jj,jk,jl) .AND. pa_i(ji,jj,jl) < 0.15 ) THEN 1662 zfra = pei_max(ji,jj,jk,jl) / zei 1663 hfx_res(ji,jj) = hfx_res(ji,jj)  pe_i(ji,jj,jk,jl) * ( 1._wp  zfra ) * z1_dt ! W.m2 <0 1664 pe_i(ji,jj,jk,jl) = pe_i(ji,jj,jk,jl) * zfra 1665 ENDIF 1666 ENDIF 1667 END DO 1668 END DO 1669 END DO 1670 END DO 1671 ! !  check e_s/v_s  ! 1672 DO jl = 1, jpl 1673 DO jk = 1, nlay_s 1674 DO jj = 1, jpj 1675 DO ji = 1, jpi 1676 IF ( pv_s(ji,jj,jl) > 0._wp ) THEN 1677 ! if e_s/v_s is larger than the surrounding 9 pts => put the heat excess in the ocean 1678 zes = pe_s(ji,jj,jk,jl) / pv_s(ji,jj,jl) 1679 IF( zes > pes_max(ji,jj,jk,jl) .AND. pa_i(ji,jj,jl) < 0.15 ) THEN 1680 zfra = pes_max(ji,jj,jk,jl) / zes 1681 hfx_res(ji,jj) = hfx_res(ji,jj)  pe_s(ji,jj,jk,jl) * ( 1._wp  zfra ) * z1_dt ! W.m2 <0 1682 pe_s(ji,jj,jk,jl) = pe_s(ji,jj,jk,jl) * zfra 1683 ENDIF 1684 ENDIF 1685 END DO 1686 END DO 1687 END DO 1688 END DO 1591 1689 ! 1592 1690 END SUBROUTINE Hbig 
NEMO/branches/2020/r4.0HEAD_r12713_clem_dan_fixcpl/src/ICE/icethd_sal.F90
r11536 r12949 55 55 !! > nn_icesal = 3 > Sice = S(z) [multiyear ice] 56 56 !! 57 LOGICAL, INTENT(in) :: ld_sal 57 LOGICAL, INTENT(in) :: ld_sal ! gravity drainage and flushing or not 58 58 ! 59 INTEGER :: ji, jk ! dummy loop indices 60 REAL(wp) :: iflush, igravdr ! local scalars 61 REAL(wp) :: zs_sni, zs_i_gd, zs_i_fl, zs_i_si, zs_i_bg ! local scalars 59 INTEGER :: ji ! dummy loop indices 60 REAL(wp) :: zs_sni, zds ! local scalars 62 61 REAL(wp) :: z1_time_gd, z1_time_fl 63 62 !! … … 68 67 CASE( 2 ) ! time varying salinity with linear profile ! 69 68 ! !! 70 z1_time_gd = 1._wp / rn_time_gd * rdt_ice71 z1_time_fl = 1._wp / rn_time_fl * rdt_ice69 z1_time_gd = rdt_ice / rn_time_gd 70 z1_time_fl = rdt_ice / rn_time_fl 72 71 ! 73 72 DO ji = 1, npti 74 73 ! 75 !76 ! Update ice salinity from snowice and bottom growth77 !78 74 IF( h_i_1d(ji) > 0._wp ) THEN 79 zs_sni = sss_1d(ji) * ( rhoi  rhos ) * r1_rhoi ! Salinity of snow ice 80 zs_i_si = ( zs_sni  s_i_1d(ji) ) * dh_snowice(ji) / h_i_1d(ji) ! snowice 81 zs_i_bg = ( s_i_new(ji)  s_i_1d(ji) ) * dh_i_bog (ji) / h_i_1d(ji) ! bottom growth 82 ! Update salinity (nb: salt flux already included in icethd_dh) 83 s_i_1d(ji) = s_i_1d(ji) + zs_i_bg + zs_i_si 75 ! 76 !  Update ice salinity from snowice and bottom growth  ! 77 zs_sni = sss_1d(ji) * ( rhoi  rhos ) * r1_rhoi ! salinity of snow ice 78 zds = ( zs_sni  s_i_1d(ji) ) * dh_snowice(ji) / h_i_1d(ji) ! snowice 79 zds = zds + ( s_i_new(ji)  s_i_1d(ji) ) * dh_i_bog (ji) / h_i_1d(ji) ! bottom growth 80 ! update salinity (nb: salt flux already included in icethd_dh) 81 s_i_1d(ji) = s_i_1d(ji) + zds 82 ! 83 !  Update ice salinity from brine drainage and flushing  ! 84 IF( ld_sal ) THEN 85 IF( t_su_1d(ji) >= rt0 ) THEN ! flushing (summer time) 86 zds =  MAX( s_i_1d(ji)  rn_sal_fl , 0._wp ) * z1_time_fl 87 ELSEIF( t_su_1d(ji) <= t_bo_1d(ji) ) THEN ! gravity drainage 88 zds =  MAX( s_i_1d(ji)  rn_sal_gd , 0._wp ) * z1_time_gd 89 ELSE 90 zds = 0._wp 91 ENDIF 92 ! update salinity 93 s_i_1d(ji) = s_i_1d(ji) + zds 94 ! salt flux 95 sfx_bri_1d(ji) = sfx_bri_1d(ji)  rhoi * a_i_1d(ji) * h_i_1d(ji) * zds * r1_rdtice 96 ENDIF 97 ! 98 !  salinity must stay inbounds  ! 99 zds = MAX( 0._wp, rn_simin  s_i_1d(ji) ) ! > 0 if s_i < simin 100 zds = zds + MIN( 0._wp, rn_simax  s_i_1d(ji) ) ! < 0 if s_i > simax 101 ! update salinity 102 s_i_1d(ji) = s_i_1d(ji) + zds 103 ! salt flux 104 sfx_res_1d(ji) = sfx_res_1d(ji)  rhoi * a_i_1d(ji) * h_i_1d(ji) * zds * r1_rdtice 105 ! 84 106 ENDIF 85 107 ! 86 IF( ld_sal ) THEN87 !88 ! Update ice salinity from brine drainage and flushing89 !90 iflush = MAX( 0._wp , SIGN( 1._wp , t_su_1d(ji)  rt0 ) ) ! =1 if summer91 igravdr = MAX( 0._wp , SIGN( 1._wp , t_bo_1d(ji)  t_su_1d(ji) ) ) ! =1 if t_su < t_bo92 93 zs_i_gd =  igravdr * MAX( s_i_1d(ji)  rn_sal_gd , 0._wp ) * z1_time_gd ! gravity drainage94 zs_i_fl =  iflush * MAX( s_i_1d(ji)  rn_sal_fl , 0._wp ) * z1_time_fl ! flushing95 96 ! Update salinity97 s_i_1d(ji) = s_i_1d(ji) + zs_i_fl + zs_i_gd98 99 ! Salt flux100 sfx_bri_1d(ji) = sfx_bri_1d(ji)  rhoi * a_i_1d(ji) * h_i_1d(ji) * ( zs_i_fl + zs_i_gd ) * r1_rdtice101 ENDIF102 108 END DO 103 109 !
Note: See TracChangeset
for help on using the changeset viewer.