- Timestamp:
- 2017-09-18T16:54:04+02:00 (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2017/dev_r8183_ICEMODEL/NEMOGCM/NEMO/LIM_SRC_3/icevar.F90
r8522 r8534 2 2 !!====================================================================== 3 3 !! *** MODULE icevar *** 4 !! 4 !! sea-ice: Different sets of ice model variables 5 5 !! how to switch from one to another 6 6 !! … … 36 36 #if defined key_lim3 37 37 !!---------------------------------------------------------------------- 38 !! 'key_lim3' LIM3sea-ice model38 !! 'key_lim3' ESIM sea-ice model 39 39 !!---------------------------------------------------------------------- 40 40 !! ice_var_agg : integrate variables over layers and categories … … 47 47 !! ice_var_itd : convert 1-cat to multiple cat 48 48 !!---------------------------------------------------------------------- 49 USE par_oce ! ocean parameters49 USE dom_oce ! ocean space and time domain 50 50 USE phycst ! physical constants (ocean directory) 51 51 USE sbc_oce , ONLY : sss_m 52 USE ice ! icevariables53 USE ice1D ! ice variables (thermodynamics)52 USE ice ! sea-ice: variables 53 USE ice1D ! sea-ice: thermodynamics variables 54 54 ! 55 55 USE in_out_manager ! I/O manager 56 56 USE lib_mpp ! MPP library 57 USE lib_fortran ! Fortran utilities (allows no signed zero when 'key_nosignedzero' defined)57 USE lib_fortran ! fortran utilities (glob_sum + no signed zero) 58 58 59 59 IMPLICIT NONE … … 77 77 78 78 SUBROUTINE ice_var_agg( kn ) 79 !!------------------------------------------------------------------ 79 !!------------------------------------------------------------------- 80 80 !! *** ROUTINE ice_var_agg *** 81 81 !! 82 82 !! ** Purpose : aggregates ice-thickness-category variables to 83 83 !! all-ice variables, i.e. it turns VGLO into VAGG 84 !!------------------------------------------------------------------ 84 !!------------------------------------------------------------------- 85 85 INTEGER, INTENT( in ) :: kn ! =1 state variables only 86 86 ! ! >1 state variables + others … … 88 88 INTEGER :: ji, jj, jk, jl ! dummy loop indices 89 89 REAL(wp), ALLOCATABLE, DIMENSION(:,:) :: z1_at_i, z1_vt_i 90 !!------------------------------------------------------------------ 90 !!------------------------------------------------------------------- 91 91 ! 92 92 ! ! integrated values … … 143 143 144 144 SUBROUTINE ice_var_glo2eqv 145 !!------------------------------------------------------------------ 145 !!------------------------------------------------------------------- 146 146 !! *** ROUTINE ice_var_glo2eqv *** 147 147 !! 148 148 !! ** Purpose : computes equivalent variables as function of 149 149 !! global variables, i.e. it turns VGLO into VEQV 150 !!------------------------------------------------------------------ 150 !!------------------------------------------------------------------- 151 151 INTEGER :: ji, jj, jk, jl ! dummy loop indices 152 152 REAL(wp) :: ze_i ! local scalars … … 155 155 REAL(wp) :: zlay_i, zlay_s ! - - 156 156 REAL(wp), DIMENSION(jpi,jpj,jpl) :: z1_a_i, z1_v_i 157 !!------------------------------------------------------------------ 157 !!------------------------------------------------------------------- 158 158 159 159 !!gm Question 2: It is possible to define existence of sea-ice in a common way between … … 242 242 243 243 SUBROUTINE ice_var_eqv2glo 244 !!------------------------------------------------------------------ 244 !!------------------------------------------------------------------- 245 245 !! *** ROUTINE ice_var_eqv2glo *** 246 246 !! 247 247 !! ** Purpose : computes global variables as function of 248 248 !! equivalent variables, i.e. it turns VEQV into VGLO 249 !!------------------------------------------------------------------ 249 !!------------------------------------------------------------------- 250 250 ! 251 251 v_i (:,:,:) = ht_i(:,:,:) * a_i(:,:,:) … … 257 257 258 258 SUBROUTINE ice_var_salprof 259 !!------------------------------------------------------------------ 259 !!------------------------------------------------------------------- 260 260 !! *** ROUTINE ice_var_salprof *** 261 261 !! … … 270 270 !! 271 271 !! ** References : Vancoppenolle et al., 2007 272 !!------------------------------------------------------------------ 272 !!------------------------------------------------------------------- 273 273 INTEGER :: ji, jj, jk, jl ! dummy loop index 274 274 REAL(wp) :: zsal, z1_dS … … 277 277 REAL(wp), PARAMETER :: zsi0 = 3.5_wp 278 278 REAL(wp), PARAMETER :: zsi1 = 4.5_wp 279 !!------------------------------------------------------------------ 279 !!------------------------------------------------------------------- 280 280 281 281 !!gm Question: Remove the option 3 ? How many years since it last use ? … … 355 355 356 356 SUBROUTINE ice_var_bv 357 !!------------------------------------------------------------------ 357 !!------------------------------------------------------------------- 358 358 !! *** ROUTINE ice_var_bv *** 359 359 !! … … 363 363 !! 364 364 !! References : Vancoppenolle et al., JGR, 2007 365 !!------------------------------------------------------------------ 365 !!------------------------------------------------------------------- 366 366 INTEGER :: ji, jj, jk, jl ! dummy loop indices 367 !!------------------------------------------------------------------ 367 !!------------------------------------------------------------------- 368 368 ! 369 369 !!gm I prefere to use WHERE / ELSEWHERE to set it to zero only where needed <<<=== to be done … … 398 398 REAL(wp), PARAMETER :: zsi0 = 3.5_wp 399 399 REAL(wp), PARAMETER :: zsi1 = 4.5_wp 400 !!------------------------------------------------------------------- --400 !!------------------------------------------------------------------- 401 401 ! 402 402 SELECT CASE ( nn_icesal ) … … 543 543 544 544 SUBROUTINE ice_var_itd( zhti, zhts, zai, zht_i, zht_s, za_i ) 545 !!------------------------------------------------------------------ 545 !!------------------------------------------------------------------- 546 546 !! *** ROUTINE ice_var_itd *** 547 547 !! … … 579 579 INTEGER , DIMENSION(4) :: itest 580 580 !!------------------------------------------------------------------- 581 582 !-------------------------------------------------------------------- 583 ! initialisation of variables 584 !-------------------------------------------------------------------- 581 ! 582 ! ---------------------------------------- 583 ! distribution over the jpl ice categories 584 ! ---------------------------------------- 585 ! a gaussian distribution for ice concentration is used 586 ! then we check whether the distribution fullfills 587 ! volume and area conservation, positivity and ice categories bounds 585 588 ijpij = SIZE( zhti , 1 ) 586 589 zht_i(1:ijpij,1:jpl) = 0._wp … … 588 591 za_i (1:ijpij,1:jpl) = 0._wp 589 592 590 ! ----------------------------------------591 ! distribution over the jpl ice categories592 ! ----------------------------------------593 593 DO ji = 1, ijpij 594 594 … … 604 604 END DO 605 605 606 ! initialisation of tests 607 itest(:) = 0 608 609 i_fill = jpl + 1 !==================================== 610 DO WHILE ( ( SUM( itest(:) ) /= 4 ) .AND. ( i_fill >= 2 ) ) ! iterative loop on i_fill categories 611 ! iteration !==================================== 606 itest(:) = 0 607 i_fill = jpl + 1 !------------------------------------ 608 DO WHILE ( ( SUM( itest(:) ) /= 4 ) .AND. ( i_fill >= 2 ) ) ! iterative loop on i_fill categories 609 ! !------------------------------------ 612 610 i_fill = i_fill - 1 613 614 ! initialisation of ice variables for each try 611 ! 615 612 zht_i(ji,1:jpl) = 0._wp 616 613 za_i (ji,1:jpl) = 0._wp 617 614 itest(:) = 0 618 615 619 ! *** case very thin ice: fill only category 1 620 IF ( i_fill == 1 ) THEN 616 IF ( i_fill == 1 ) THEN !-- case very thin ice: fill only category 1 621 617 zht_i(ji,1) = zhti(ji) 622 618 za_i (ji,1) = zai (ji) 623 624 ! *** case ice is thicker: fill categories >1 625 ELSE 626 627 ! Fill ice thicknesses in the (i_fill-1) cat by hmean 619 ELSE !-- case ice is thicker: fill categories >1 620 ! thickness 628 621 DO jl = 1, i_fill - 1 629 622 zht_i(ji,jl) = hi_mean(jl) 630 623 END DO 631 624 632 ! Concentrations in the (i_fill-1) categories625 ! concentration 633 626 za_i(ji,jl0) = zai(ji) / SQRT(REAL(jpl)) 634 627 DO jl = 1, i_fill - 1 … … 639 632 END DO 640 633 641 ! Concentration in the last (i_fill)category634 ! last category 642 635 za_i(ji,i_fill) = zai(ji) - SUM( za_i(ji,1:i_fill-1) ) 643 644 ! Ice thickness in the last (i_fill) category645 636 zV = SUM( za_i(ji,1:i_fill-1) * zht_i(ji,1:i_fill-1) ) 646 637 zht_i(ji,i_fill) = ( zhti(ji) * zai(ji) - zV ) / MAX( za_i(ji,i_fill), epsi10 ) … … 659 650 ENDIF 660 651 661 ENDIF ! case ice is thick or thin652 ENDIF 662 653 663 !---------------------664 654 ! Compatibility tests 665 !--------------------- 666 ! Test 1: area conservation 667 zconv = ABS( zai(ji) - SUM( za_i(ji,1:jpl) ) ) 668 IF ( zconv < epsi06 ) itest(1) = 1 655 zconv = ABS( zai(ji) - SUM( za_i(ji,1:jpl) ) ) 656 IF ( zconv < epsi06 ) itest(1) = 1 ! Test 1: area conservation 669 657 670 ! Test 2: volume conservation671 658 zconv = ABS( zhti(ji)*zai(ji) - SUM( za_i(ji,1:jpl)*zht_i(ji,1:jpl) ) ) 672 IF ( zconv < epsi06 ) itest(2) = 1 659 IF ( zconv < epsi06 ) itest(2) = 1 ! Test 2: volume conservation 673 660 674 ! Test 3: thickness of the last category is in-bounds ? 675 IF ( zht_i(ji,i_fill) >= hi_max(i_fill-1) ) itest(3) = 1 661 IF ( zht_i(ji,i_fill) >= hi_max(i_fill-1) ) itest(3) = 1 ! Test 3: thickness of the last category is in-bounds ? 676 662 677 ! Test 4: positivity of ice concentrations678 663 itest(4) = 1 679 664 DO jl = 1, i_fill 680 IF ( za_i(ji,jl) < 0._wp ) itest(4) = 0 665 IF ( za_i(ji,jl) < 0._wp ) itest(4) = 0 ! Test 4: positivity of ice concentrations 681 666 END DO 682 ! ! ============================667 ! !---------------------------- 683 668 END DO ! end iteration on categories 684 ! !============================ 685 ENDIF ! if zhti > 0 686 END DO ! i loop 687 688 ! ------------------------------------------------ 689 ! Adding Snow in each category where za_i is not 0 690 ! ------------------------------------------------ 669 ! !---------------------------- 670 ENDIF 671 END DO 672 673 ! Add Snow in each category where za_i is not 0 691 674 DO jl = 1, jpl 692 675 DO ji = 1, ijpij … … 707 690 #else 708 691 !!---------------------------------------------------------------------- 709 !! Default option Dummy module NO LIM3sea-ice model692 !! Default option Dummy module NO ESIM sea-ice model 710 693 !!---------------------------------------------------------------------- 711 694 #endif
Note: See TracChangeset
for help on using the changeset viewer.