New URL for NEMO forge!   http://forge.nemo-ocean.eu

Since March 2022 along with NEMO 4.2 release, the code development moved to a self-hosted GitLab.
This present forge is now archived and remained online for history.
Changeset 15412 for NEMO/branches/UKMO/NEMO_4.0.4_FOAM_IAU_SI3_SIC – NEMO

Ignore:
Timestamp:
2021-10-20T11:44:33+02:00 (3 years ago)
Author:
dcarneir
Message:

Final tested version of the SIC IAU code in GO8

Location:
NEMO/branches/UKMO/NEMO_4.0.4_FOAM_IAU_SI3_SIC/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • NEMO/branches/UKMO/NEMO_4.0.4_FOAM_IAU_SI3_SIC/src/ICE/ice.F90

    r14075 r15412  
    234234   REAL(wp), PUBLIC ::   rswitch          !: switch for the presence of ice (1) or not (0) 
    235235   REAL(wp), PUBLIC ::   rdiag_v, rdiag_s, rdiag_t, rdiag_fv, rdiag_fs, rdiag_ft   !: conservation diagnostics 
     236   REAL(wp), PUBLIC, PARAMETER ::   epsi02 = 1.e-02_wp  !: small number  
     237   REAL(wp), PUBLIC, PARAMETER ::   epsi03 = 1.e-03_wp  !: small number  
    236238   REAL(wp), PUBLIC, PARAMETER ::   epsi06 = 1.e-06_wp  !: small number  
    237239   REAL(wp), PUBLIC, PARAMETER ::   epsi10 = 1.e-10_wp  !: small number  
  • NEMO/branches/UKMO/NEMO_4.0.4_FOAM_IAU_SI3_SIC/src/OCE/ASM/asminc.F90

    r15252 r15412  
    3838   USE phycst         ! physical constants 
    3939   USE ice1D          ! sea-ice: thermodynamics variables 
    40    USE icetab         ! sea-ice: 2D <==> 1D 
    41    USE icethd_do 
     40   USE icetab         ! sea-ice: 3D <==> 2D, 2D <==> 1D 
    4241   USE ice 
    43    USE icevar   , ONLY : ice_var_zapsmall 
    4442#endif 
    4543   ! 
     
    9694#if defined key_si3 
    9795   REAL(wp), DIMENSION(:,:,:), ALLOCATABLE ::   a_i_bkginc          ! Increment to the background sea ice conc categories 
    98 #endif 
    99    REAL(wp) :: zhi_damin = 0.45_wp !: ice thickness for new sea ice from da increment 
    100    INTEGER  :: nhi_damin          !: thickness category corresponding to zhi_damin 
    101    LOGICAL, PUBLIC, DIMENSION(:,:,:), ALLOCATABLE :: incr_newice !: mask .TRUE.=DA positive ice increment to open water 
     96   LOGICAL, PUBLIC, DIMENSION(:,:,:), ALLOCATABLE :: incr_newice    ! Mask .TRUE.=DA positive ice increment to open water 
     97   REAL(wp) :: zhi_damin                                            ! Ice thickness for new sea ice from DA increment 
     98#endif 
    10299#if defined key_cice && defined key_asminc 
    103100   REAL(wp), DIMENSION(:,:), ALLOCATABLE ::   ndaice_da             ! ice increment tendency into CICE 
     
    123120      !! ** Action  :  
    124121      !!---------------------------------------------------------------------- 
    125       INTEGER :: ji, jj, jk, jt  ! dummy loop indices 
    126       INTEGER :: imid, inum      ! local integers 
    127       INTEGER :: ios             ! Local integer output status for namelist read 
    128       INTEGER :: iiauper         ! Number of time steps in the IAU period 
    129       INTEGER :: icycper         ! Number of time steps in the cycle 
     122      INTEGER :: ji, jj, jk, jt, jl  ! dummy loop indices 
     123      INTEGER :: imid, inum          ! local integers 
     124      INTEGER :: ios                 ! Local integer output status for namelist read 
     125      INTEGER :: iiauper             ! Number of time steps in the IAU period 
     126      INTEGER :: icycper             ! Number of time steps in the cycle 
    130127      REAL(KIND=dp) :: ditend_date     ! Date YYYYMMDD.HHMMSS of final time step 
    131128      REAL(KIND=dp) :: ditbkg_date     ! Date YYYYMMDD.HHMMSS of background time step for Jb term 
     
    144141      REAL(wp) :: zremaining_increment 
    145142 
    146 #if defined key_si3 
    147       REAL(wp) :: zopenwater_lim 
    148       INTEGER  ::  jl 
    149 #endif 
    150143      !! 
    151144      NAMELIST/nam_asminc/ ln_bkgwri,                                      & 
    152145         &                 ln_trainc, ln_dyninc, ln_sshinc,                & 
    153          &                 ln_seaiceinc, ln_asmdin, ln_asmiau,                           & 
     146         &                 ln_seaiceinc, ln_asmdin, ln_asmiau,             & 
    154147         &                 nitbkg, nitdin, nitiaustr, nitiaufin, niaufn,   & 
    155          &                 ln_salfix, salfixmin, nn_divdmp 
     148         &                 ln_salfix, salfixmin, nn_divdmp, zhi_damin 
    156149      !!---------------------------------------------------------------------- 
    157150 
     
    161154      ln_seaiceinc   = .FALSE. 
    162155      ln_temnofreeze = .FALSE. 
    163       zhi_damin = 0.45_wp 
    164       zopenwater_lim = 1.0e-2_wp 
    165156 
    166157      REWIND( numnam_ref )              ! Namelist nam_asminc in reference namelist : Assimilation increment 
     
    192183         WRITE(numout,*) '      Logical switch for ensuring that the sa > salfixmin      ln_salfix = ', ln_salfix 
    193184         WRITE(numout,*) '      Minimum salinity after applying the increments           salfixmin = ', salfixmin 
    194          WRITE(numout,*) '      Minimum ice thickness for new ice from da                zhi_damin = ', zhi_damin 
    195          WRITE(numout,*) '      Limit for open water detection for ice da           zopenwater_lim = ', zopenwater_lim 
     185         WRITE(numout,*) '      Minimum ice thickness for new ice from DA                zhi_damin = ', zhi_damin 
    196186      ENDIF 
    197187 
     
    348338#if defined key_si3 
    349339      ALLOCATE( a_i_bkginc   (jpi,jpj,jpl) )   ;   a_i_bkginc   (:,:,:) = 0._wp 
    350       ALLOCATE( incr_newice(jpi,jpj,jpl) )   ;   incr_newice(:,:,:) = .FALSE. 
     340      ALLOCATE( incr_newice(jpi,jpj,jpl) )     ;   incr_newice(:,:,:) = .FALSE. 
    351341#endif 
    352342#if defined key_asminc 
     
    422412            ! Set missing increments to 0.0 rather than 1e+20 
    423413            ! to allow for differences in masks 
    424             WHERE( ABS( seaice_bkginc(:,:) ) > 1.0e+10 ) seaice_bkginc(:,:) = 0.0 
     414            ! very small increments are also set to zero 
     415            WHERE( ABS( seaice_bkginc(:,:) ) > 1.0e+10 .OR. & 
     416              &    ABS( seaice_bkginc(:,:) ) < epsi03 ) seaice_bkginc(:,:) = 0.0_wp 
    425417             
    426418            IF (lwp) THEN 
     
    429421               WRITE(numout,*) '~~~~~~~~~~~~' 
    430422            END IF 
     423 
    431424            !single category increment for sea ice conc 
    432425            !convert single category increment to multi category 
    433426            a_i_bkginc = 0.0_wp 
    434             at_i = SUM(a_i(:,:,:), DIM=3) 
    435  
    436             ! Calculate which category corresponds to zhi_damin 
    437             ! find which category to fill 
    438             DO jl = 1, jpl 
    439                IF( zhi_damin > hi_max(jl-1) .AND. zhi_damin <= hi_max(jl) ) THEN 
    440                   nhi_damin = jl 
    441                END IF 
    442             END DO 
    443  
    444             IF (lwp) THEN 
    445                WRITE(numout,*) 
    446                WRITE(numout,*) 'asm_inc_init : Converting seaice_bkginc to a_i_bkginc using Peterson splitting' 
    447                WRITE(numout,*) '~~~~~~~~~~~~' 
    448             END IF 
     427            at_i = SUM( a_i(:,:,:), DIM=3 ) 
     428 
     429            ! ensure zhi_damin lies within 1st category 
     430            IF ( zhi_damin > hi_max(1) ) zhi_damin = hi_max(1) - epsi02 
     431             
    449432            DO jj = 1, jpj 
    450433               DO ji = 1, jpi 
    451434                  IF ( seaice_bkginc(ji,jj) > 0.0_wp) THEN 
    452                      !Positive ice concentration increments are always  
     435                     !positive ice concentration increments are always  
    453436                     !added to the thinnest category of ice 
    454                      a_i_bkginc(ji,jj,nhi_damin) = seaice_bkginc(ji,jj) 
     437                     a_i_bkginc(ji,jj,1) = seaice_bkginc(ji,jj) 
    455438                  ELSE 
    456439                     !negative increments are first removed from the thinnest 
     
    460443                     DO jl = 1, jpl 
    461444                        ! assign as much increment as possible to current category 
    462                         a_i_bkginc(ji,jj,jl) = -min(a_i(ji,jj,jl), -zremaining_increment) 
     445                        a_i_bkginc(ji,jj,jl) = -MIN( a_i(ji,jj,jl), -zremaining_increment ) 
    463446                        ! update remaining amount of increment 
    464447                        zremaining_increment = zremaining_increment - a_i_bkginc(ji,jj,jl) 
     
    467450               END DO 
    468451            END DO 
     452            ! find model points where DA new ice should be added to open water 
    469453            DO jl = 1,jpl 
    470                WHERE (at_i(:,:) < zopenwater_lim .AND. seaice_bkginc(:,:) > 0.0_wp) 
     454               WHERE ( at_i(:,:) < epsi02 .AND. seaice_bkginc(:,:) > 0.0_wp ) 
    471455                  incr_newice(:,:,jl) = .TRUE. 
    472456               END WHERE 
     
    898882      ! 
    899883      INTEGER  ::   it, jl 
    900       REAL(wp) ::   zincwgt   ! IAU weight for current time step 
     884      REAL(wp) ::   zincwgt                            ! IAU weight for current time step 
    901885#if defined key_si3 
    902       REAL(wp), DIMENSION(jpi,jpj,jpl) :: da_i    ! change in ice concentration 
    903       REAL(wp), DIMENSION(jpi,jpj,jpl) :: dv_i    ! change in ice volume 
    904       REAL(wp), DIMENSION(jpi,jpj,jpl) :: z1_a_i  ! inverse of old ice concentration 
    905       REAL(wp), DIMENSION(jpi,jpj,jpl) :: z1_v_i  ! inverse of old ice volume 
    906       REAL(wp) :: rn_hinew_save 
    907       LOGICAL, SAVE :: initial_step=.TRUE. 
    908       REAL(wp), DIMENSION(jpi,jpj) :: at_i_bkginc ! sum of conc increment over categories 
     886      LOGICAL, SAVE :: logical_newice = .TRUE.         ! Flag to add new ice from DA to open water 
     887      REAL(wp), DIMENSION(jpi,jpj,jpl) :: da_i         ! change in ice concentration 
     888      REAL(wp), DIMENSION(jpi,jpj,jpl) :: dv_i         ! change in ice volume 
     889      REAL(wp), DIMENSION(jpi,jpj,jpl) :: z1_a_i       ! inverse of old ice concentration 
     890      REAL(wp), DIMENSION(jpi,jpj,jpl) :: z1_v_i       ! inverse of old ice volume 
     891      REAL(wp), DIMENSION(jpi,jpj)     :: zhi_damin_2D ! array with DA thickness for incr_newice 
    909892#endif 
    910893      !!---------------------------------------------------------------------- 
     
    929912            ! 
    930913#if defined key_si3 
     914            ! ensure zhi_damin lies within 1st category 
     915            IF ( zhi_damin > hi_max(1) ) zhi_damin = hi_max(1) - epsi02 
     916 
     917            ! compute the inverse of key sea ice variables 
     918            ! to be used later in the code  
    931919            WHERE( a_i(:,:,:) > epsi10 ) 
    932                z1_a_i(:,:,:) = 1.0_wp/a_i(:,:,:) 
    933                z1_v_i(:,:,:) = 1.0_wp/v_i(:,:,:) 
     920               z1_a_i(:,:,:) = 1.0_wp / a_i(:,:,:) 
     921               z1_v_i(:,:,:) = 1.0_wp / v_i(:,:,:) 
    934922            ELSEWHERE 
    935923               z1_a_i(:,:,:) = 0.0_wp 
     
    937925            END WHERE 
    938926 
    939             ! add positive concentration increments with zhi_damin to regions where ice 
     927            ! add positive concentration increments to regions where ice 
    940928            ! is already present and bound them to 1 
    941             ! ice volume is added based on the sea ice conc increment and assigned thickness 
     929            ! ice volume is added based on zhi_damin 
    942930            WHERE ( .NOT. incr_newice .AND. a_i_bkginc(:,:,:) > 0.0_wp ) 
    943                a_i(:,:,:) = a_i(:,:,:) + MIN(1.0_wp - a_i(:,:,:), a_i_bkginc(:,:,:) * zincwgt) 
    944                v_i(:,:,:) = v_i(:,:,:) + MIN(1.0_wp - a_i(:,:,:), a_i_bkginc(:,:,:) * zincwgt) * zhi_damin 
     931               a_i(:,:,:) = a_i(:,:,:) + MIN( 1.0_wp - a_i(:,:,:), a_i_bkginc(:,:,:) * zincwgt ) 
     932               v_i(:,:,:) = v_i(:,:,:) + MIN( 1.0_wp - a_i(:,:,:), a_i_bkginc(:,:,:) * zincwgt ) * zhi_damin 
    945933            END WHERE 
    946934 
     
    949937            ! in this case ice volume is changed based on the current thickness 
    950938            WHERE ( .NOT. incr_newice .AND. a_i_bkginc(:,:,:) < 0.0_wp ) 
    951                a_i(:,:,:) = MAX(a_i(:,:,:) + a_i_bkginc(:,:,:) * zincwgt, 0.0_wp) 
     939               a_i(:,:,:) = MAX( a_i(:,:,:) + a_i_bkginc(:,:,:) * zincwgt, 0.0_wp ) 
    952940               v_i(:,:,:) = a_i(:,:,:) * h_i(:,:,:) 
    953941            END WHERE 
    954              
    955             ! compute change in ice concentration (new / old) 
     942            
     943            ! compute changes in ice concentration and volume 
    956944            WHERE ( incr_newice ) 
    957945               da_i(:,:,:) = 1.0_wp 
     
    962950            END WHERE 
    963951 
    964             ! compute heat balance that adds specified ice thickness 
    965             ! to open water 
    966             IF (initial_step) THEN 
    967                IF(lwp) THEN 
    968                   WRITE(numout,*) 
    969                   WRITE(numout,*) 'seaice_asm_inc : sea ice conc IAU at time step = ', kt,' compute heat balance qlead' 
    970                   WRITE(numout,*) '~~~~~~~~~~~~' 
    971                ENDIF 
    972  
    973                ! compute qlead to ensure thickness of zhi_damin  
    974                ! for the new ice concentration values 
    975                WHERE (ANY(incr_newice, DIM=3)) 
    976                   ht_i_new(:,:) = zhi_damin 
     952            ! initialise thermodynamics of new ice being added to open water 
     953            ! just do it once since next IAU steps assume that new ice has  
     954            ! already been added in 
     955            IF ( kt == nitiaustr_r .AND. logical_newice ) THEN 
     956 
     957               ! assign zhi_damin to ice forming in open water 
     958               WHERE ( ANY( incr_newice, DIM=3 ) ) 
     959                  zhi_damin_2D(:,:) = zhi_damin 
    977960               ELSEWHERE 
    978                   ht_i_new(:,:) = 0.0_wp 
    979                ENDWHERE 
    980  
    981                ! ensure all categories of new ice are zero 
     961                  zhi_damin_2D(:,:) = 0.0_wp 
     962               END WHERE 
     963 
     964               ! add ice concentration and volume 
     965               ! ensure the other prognostic variables are set to zero  
    982966               WHERE ( incr_newice ) 
    983                   v_i (:,:,:) = 0.0_wp 
     967                  a_i(:,:,:) = MIN( 1.0_wp, a_i_bkginc(:,:,:) * zincwgt ) 
     968                  v_i(:,:,:) = MIN( 1.0_wp, a_i_bkginc(:,:,:) * zincwgt ) * zhi_damin 
    984969                  v_s (:,:,:) = 0.0_wp 
    985                   sv_i(:,:,:) = 0.0_wp 
    986970                  a_ip(:,:,:) = 0.0_wp 
    987971                  v_ip(:,:,:) = 0.0_wp 
     972                  sv_i(:,:,:) = 0.0_wp 
    988973               END WHERE 
    989974               DO jl = 1, nlay_i 
     
    998983               END DO 
    999984 
    1000                qlead = 0.0_wp 
    1001                at_i_bkginc(:,:) = SUM( a_i_bkginc(:,:,:), DIM=3 ) 
    1002  
    1003                call seaice_asm_qlead(ht_i_new, at_i_bkginc, qlead) 
    1004                
    1005                ! Call ice_thd_do to create the new ice from open water 
    1006                rn_hinew_save  = rn_hinew 
    1007                rn_hinew = zhi_damin 
    1008                call ice_thd_do 
    1009                rn_hinew = rn_hinew_save 
    1010  
    1011                initial_step = .FALSE. 
     985               ! Initialisation of the salt content and ice enthalpy 
     986               ! set flag of new ice to false after this 
     987               call init_new_ice_thd( zhi_damin_2D ) 
     988               incr_newice(:,:,:) = .FALSE. 
    1012989            END IF 
    1013990 
    1014             ! maintain equivalent values for prognostic variables 
    1015             v_s  (:,:,:) = v_s (:,:,:) * da_i(:,:,:)        ! snow volume 
     991            ! maintain equivalent values for key prognostic variables 
     992            v_s(:,:,:) = v_s(:,:,:) * da_i(:,:,:) 
    1016993            DO jl = 1, nlay_s 
    1017                e_s(:,:,jl,:) = e_s(:,:,jl,:) * da_i(:,:,:)  ! snow entalphy 
     994               e_s(:,:,jl,:) = e_s(:,:,jl,:) * da_i(:,:,:) 
    1018995            END DO 
    1019             ! Passive microwave cannot detect ice ponds 
    1020             ! However it should be valid to reduce pond  
    1021             ! area/volume when ice is removed (da_i < 1) 
    1022             WHERE ( da_i < 1 ) 
    1023                   a_ip (:,:,:) = a_ip(:,:,:) * da_i(:,:,:)  ! pond concentration 
    1024                   v_ip (:,:,:) = v_ip(:,:,:) * da_i(:,:,:)  ! pond volume 
    1025             END WHERE 
     996            a_ip (:,:,:) = a_ip(:,:,:) * da_i(:,:,:) 
     997            v_ip (:,:,:) = v_ip(:,:,:) * da_i(:,:,:) 
    1026998  
    1027999            ! ice volume dependent variables 
    1028             sv_i (:,:,:) = sv_i(:,:,:) * dv_i(:,:,:)        ! ice salt content 
     1000            sv_i (:,:,:) = sv_i(:,:,:) * dv_i(:,:,:) 
    10291001            DO jl = 1, nlay_i 
    1030                e_i(:,:,jl,:) = e_i(:,:,jl,:) * dv_i(:,:,:)  ! ice entalphy 
     1002               e_i(:,:,jl,:) = e_i(:,:,jl,:) * dv_i(:,:,:) 
    10311003            END DO 
    1032  
    1033             call ice_var_zapsmall()  
    1034  
    1035             ! 
    1036             ! seaice salinity balancing (to add) 
    1037 #endif 
    1038             ! 
     1004#endif 
     1005 
    10391006#if defined key_cice && defined key_asminc 
    10401007            ! Sea-ice : CICE case. Pass ice increment tendency into CICE 
     
    10441011            IF ( kt == nitiaufin_r ) THEN 
    10451012               DEALLOCATE( seaice_bkginc ) 
     1013#if defined key_si3 
     1014               DEALLOCATE( incr_newice ) 
     1015               DEALLOCATE( a_i_bkginc ) 
     1016#endif 
    10461017            ENDIF 
    10471018            ! 
     
    10861057      ! 
    10871058   END SUBROUTINE seaice_asm_inc 
    1088     
    1089    SUBROUTINE seaice_asm_qlead(ht_i_new, at_i_new, qlead_new) 
    1090       !!---------------------------------------------------------------------- 
    1091       !!                  ***  ROUTINE seaice_asm_qlead  *** 
    1092       !! 
    1093       !! ** Purpose :   Compute the value of qlead that will correspond to new ice of  
    1094       !!                thickness ht_i_new concentration of at_i_new 
    1095       !! 
    1096       !! ** Method  :   Based on symbolic inversion of the icethd_do routine 
    1097       !! 
    1098       !! ** Action  :   return qlead_new 
    1099       !!---------------------------------------------------------------------- 
    1100       REAL(wp), DIMENSION(:,:), INTENT(in)    ::   ht_i_new  ! total thickness of new ice 
    1101       REAL(wp), DIMENSION(:,:), INTENT(in)    ::   at_i_new  ! total concentration of new ice 
    1102       REAL(wp), DIMENSION(:,:), INTENT(inout) ::   qlead_new ! output flux? value 
    1103  
    1104       INTEGER :: jj, ji 
    1105  
    1106       REAL(wp), DIMENSION(jpij) ::   at_i_new_1d ! 1d version of at_i_new 
    1107       REAL(wp), DIMENSION(jpij) ::   zs_newice   ! salinity of accreted ice 
    1108       REAL(wp), DIMENSION(jpij) ::   zh_newice   ! thickness of accreted ice 
     1059 
     1060 
     1061   SUBROUTINE init_new_ice_thd( hi_new ) 
     1062      !!---------------------------------------------------------------------- 
     1063      !!                  ***  ROUTINE init_new_ice_thd  *** 
     1064      !! 
     1065      !! ** Purpose :   Initialise thermodynamics of new ice  
     1066      !!                forming at 1st category with thickness hi_new 
     1067      !! 
     1068      !! ** Method  :   Apply SI3 thermodynamic equations to initialise 
     1069      !!                thermodynamic of new ice 
     1070      !! 
     1071      !! ** Action  :   update thermodynamic variables 
     1072      !!---------------------------------------------------------------------- 
     1073      REAL(wp), DIMENSION(jpi,jpj), INTENT(in)    ::   hi_new  ! total thickness of new ice 
     1074 
     1075      INTEGER :: jj, ji, jk, jl 
     1076      REAL(wp) ::   ztmelts   ! melting point 
     1077 
     1078      REAL(wp), DIMENSION(jpij) ::   zh_newice   ! 1d version of hi_new 
     1079      REAL(wp), DIMENSION(jpij) ::   zs_newice   ! salinity of new ice 
    11091080      !!---------------------------------------------------------------------- 
    11101081 
     
    11131084      DO jj = 1, jpj 
    11141085         DO ji = 1, jpi 
    1115             IF ( ht_i_new(ji,jj) > 0._wp ) THEN 
     1086            IF ( hi_new(ji,jj) > 0._wp ) THEN 
    11161087               npti = npti + 1 
    11171088               nptidx( npti ) = (jj - 1) * jpi + ji 
     
    11221093      ! Move from 2-D to 1-D vectors 
    11231094      IF ( npti > 0 ) THEN 
    1124          CALL tab_2d_1d( npti, nptidx(1:npti), at_i_new_1d(1:npti), at_i_new   ) 
    1125          CALL tab_2d_1d( npti, nptidx(1:npti), zh_newice (1:npti) , ht_i_new   ) 
    1126          CALL tab_2d_1d( npti, nptidx(1:npti), sss_1d    (1:npti) , sss_m      ) 
    1127          CALL tab_2d_1d( npti, nptidx(1:npti), qlead_1d  (1:npti) , qlead_new  ) 
    1128          CALL tab_2d_1d( npti, nptidx(1:npti), t_bo_1d   (1:npti) , t_bo       ) 
    1129  
     1095         CALL tab_3d_2d( npti, nptidx(1:npti), sv_i_2d(1:npti,1:jpl), sv_i(:,:,:) ) 
     1096         CALL tab_3d_2d( npti, nptidx(1:npti), v_i_2d (1:npti,1:jpl), v_i (:,:,:) ) 
     1097         CALL tab_2d_1d( npti, nptidx(1:npti), zh_newice (1:npti) , hi_new        ) 
     1098         CALL tab_2d_1d( npti, nptidx(1:npti), sss_1d    (1:npti) , sss_m         ) 
     1099         CALL tab_2d_1d( npti, nptidx(1:npti), t_bo_1d   (1:npti) , t_bo          ) 
     1100         DO jk = 1, nlay_i 
     1101            CALL tab_2d_1d( npti, nptidx(1:npti), e_i_1d(1:npti,jk), e_i(:,:,jk,1) ) 
     1102         END DO 
    11301103 
    11311104         ! --- Salinity of new ice --- !  
     
    11411114         END SELECT 
    11421115 
    1143  
     1116         ! --- Update ice salt content --- ! 
    11441117         DO ji = 1, npti 
    1145             qlead_1d(ji) = at_i_new_1d(ji)*zh_newice(ji)*(-r1_rhoi*rLfus*rTmlt*rhoi*zs_newice(ji) + & 
    1146                & r1_rhoi*rhoi*(-rLfus - rTmlt*rcp*zs_newice(ji) + rTmlt*rcpi*zs_newice(ji) - & 
    1147                & rcpi*rt0 + rcpi*t_bo_1d(ji))* & 
    1148                & min(-epsi10, -rt0 + t_bo_1d(ji)) + & 
    1149                & rcp*(rt0 - t_bo_1d(ji))*min(-epsi10, -rt0 + t_bo_1d(ji))) / & 
    1150                & (r1_rhoi*min(-epsi10, -rt0 + t_bo_1d(ji))) 
     1118            sv_i_2d(ji,1) = sv_i_2d(ji,1) + zs_newice(ji) * ( v_i_2d(ji,1) ) 
    11511119         END DO 
    1152          CALL tab_1d_2d( npti, nptidx(1:npti), qlead_1d(1:npti), qlead_new ) 
    1153       ENDIF ! npti > 0 
    1154     END SUBROUTINE seaice_asm_qlead 
     1120 
     1121         ! --- Heat content of new ice --- ! 
     1122         ! We assume that new ice is formed at the seawater freezing point 
     1123         DO ji = 1, npti 
     1124               ztmelts       = - rTmlt * zs_newice(ji)                  ! Melting point (C) 
     1125               e_i_1d(ji,:)  =   rhoi * (  rcpi  * ( ztmelts - ( t_bo_1d(ji) - rt0 ) )                     & 
     1126                  &                      + rLfus * ( 1.0 - ztmelts / MIN( t_bo_1d(ji) - rt0, -epsi10 ) )   & 
     1127                  &                      - rcp   *         ztmelts ) 
     1128         END DO 
     1129 
     1130         ! Change units for e_i 
     1131         DO jk = 1, nlay_i 
     1132            e_i_1d(1:npti,jk) = e_i_1d(1:npti,jk) * v_i_2d(1:npti,1) * r1_nlay_i  
     1133         END DO 
     1134 
     1135         ! Reforming full thermodynamic variables 
     1136         CALL tab_2d_3d( npti, nptidx(1:npti), sv_i_2d(1:npti,1:jpl), sv_i(:,:,:) ) 
     1137         DO jk = 1, nlay_i 
     1138               CALL tab_1d_2d( npti, nptidx(1:npti), e_i_1d(1:npti,jk), e_i(:,:,jk,1) ) 
     1139         END DO 
     1140      END IF 
     1141 
     1142   END SUBROUTINE init_new_ice_thd 
     1143 
    11551144 
    11561145   !!====================================================================== 
Note: See TracChangeset for help on using the changeset viewer.