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 2528 for trunk/NEMOGCM/NEMO/LIM_SRC_3/limthd.F90 – NEMO

Ignore:
Timestamp:
2010-12-27T18:33:53+01:00 (13 years ago)
Author:
rblod
Message:

Update NEMOGCM from branch nemo_v3_3_beta

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/NEMOGCM/NEMO/LIM_SRC_3/limthd.F90

    r2477 r2528  
    77   !!            2.0  ! 2002-07 (C. Ethe, G. Madec)  LIM-2 (F90 rewriting) 
    88   !!            3.0  ! 2005-11 (M. Vancoppenolle)  LIM-3 : Multi-layer thermodynamics + salinity variations 
    9    !!             -   ! 2007-04 (M. Vancoppenolle) add lim_thd_glohec and lim_thd_con_dif 
     9   !!             -   ! 2007-04 (M. Vancoppenolle) add lim_thd_glohec, lim_thd_con_dh and lim_thd_con_dif 
    1010   !!            3.2  ! 2009-07 (M. Vancoppenolle, Y. Aksenov, G. Madec) bug correction in rdmsnif 
     11   !!            3.3  ! 2010-11 (G. Madec) corrected snow melting heat (due to factor betas) 
    1112   !!---------------------------------------------------------------------- 
    1213#if defined key_lim3 
     
    1415   !!   'key_lim3'                                      LIM3 sea-ice model 
    1516   !!---------------------------------------------------------------------- 
    16    !!   lim_thd      : thermodynamic of sea ice 
     17   !!   lim_thd        : thermodynamic of sea ice 
     18   !!   lim_thd_init   : initialisation of sea-ice thermodynamic 
    1719   !!---------------------------------------------------------------------- 
    1820   USE phycst          ! physical constants 
    1921   USE dom_oce         ! ocean space and time domain variables 
    20    USE ice             ! LIM sea-ice variables 
    21    USE par_ice 
     22   USE ice             ! LIM: sea-ice variables 
     23   USE par_ice         ! LIM: sea-ice parameters 
    2224   USE sbc_oce         ! Surface boundary condition: ocean fields 
    2325   USE sbc_ice         ! Surface boundary condition: ice fields 
    2426   USE thd_ice         ! LIM thermodynamic sea-ice variables 
    2527   USE dom_ice         ! LIM sea-ice domain 
    26    USE domvvl 
    27    USE limthd_dif 
    28    USE limthd_dh 
    29    USE limthd_sal 
    30    USE limthd_ent 
    31    USE limtab 
    32    USE limvar 
     28   USE domvvl          ! domain: variable volume level 
     29   USE limthd_dif      ! LIM: thermodynamics, vertical diffusion 
     30   USE limthd_dh       ! LIM: thermodynamics, ice and snow thickness variation 
     31   USE limthd_sal      ! LIM: thermodynamics, ice salinity 
     32   USE limthd_ent      ! LIM: thermodynamics, ice enthalpy redistribution 
     33   USE limtab          ! LIM: 1D <==> 2D transformation 
     34   USE limvar          ! LIM: sea-ice variables 
     35   USE lbclnk          ! lateral boundary condition - MPP links 
     36   USE lib_mpp         ! MPP library 
    3337   USE in_out_manager  ! I/O manager 
    3438   USE prtctl          ! Print control 
    35    USE lbclnk 
    36    USE lib_mpp 
    3739 
    3840   IMPLICIT NONE 
    3941   PRIVATE 
    4042 
    41    PUBLIC   lim_thd    ! called by lim_step 
    42  
    43    REAL(wp) ::   epsi20 = 1e-20   ! constant values 
    44    REAL(wp) ::   epsi16 = 1e-16   ! 
    45    REAL(wp) ::   epsi06 = 1e-06   ! 
    46    REAL(wp) ::   epsi04 = 1e-04   ! 
    47    REAL(wp) ::   zzero  = 0.e0    ! 
    48    REAL(wp) ::   zone   = 1.e0    ! 
     43   PUBLIC   lim_thd        ! called by limstp module 
     44   PUBLIC   lim_thd_init   ! called by iceini module 
     45 
     46   REAL(wp) ::   epsi20 = 1e-20_wp   ! constant values 
     47   REAL(wp) ::   epsi16 = 1e-16_wp   ! 
     48   REAL(wp) ::   epsi06 = 1e-06_wp   ! 
     49   REAL(wp) ::   epsi04 = 1e-04_wp   ! 
     50   REAL(wp) ::   zzero  = 0._wp      ! 
     51   REAL(wp) ::   zone   = 1._wp      ! 
    4952 
    5053   !! * Substitutions 
     
    5255#  include "vectopt_loop_substitute.h90" 
    5356   !!---------------------------------------------------------------------- 
    54    !! NEMO/LIM  3.2 ,  UCL-LOCEAN-IPSL (2009)  
     57   !! NEMO/LIM3 3.3 , UCL - NEMO Consortium (2010) 
    5558   !! $Id$ 
    56    !! Software governed by the CeCILL licence (modipsl/doc/NEMO_CeCILL.txt) 
     59   !! Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt) 
    5760   !!---------------------------------------------------------------------- 
    58  
    5961CONTAINS 
    6062 
     
    8486      REAL(wp) ::   zfric_umax = 2e-02    ! upper bound for the friction velocity 
    8587      REAL(wp) ::   zinda, zindb, zthsnice, zfric_u    ! temporary scalar 
    86       REAL(wp) ::   zfntlat, zpareff                   !    -         - 
     88      REAL(wp) ::   zfntlat, zpareff   !    -         - 
    8789      REAL(wp) ::   zeps, zareamin, zcoef 
    8890      REAL(wp), DIMENSION(jpi,jpj) ::   zqlbsbq   ! link with lead energy budget qldif 
    8991      !!------------------------------------------------------------------- 
    90  
    9192       
    9293      !------------------------------------------------------------------------------! 
     
    99100      !-------------------- 
    100101      ! Change the units of heat content; from global units to J.m3 
    101  
    102102      DO jl = 1, jpl 
    103103         DO jk = 1, nlay_i 
     
    166166            pfrld(ji,jj)   = 1.0 - at_i(ji,jj) 
    167167            zinda          = 1.0 - MAX( zzero , SIGN( zone , - ( 1.0 - pfrld(ji,jj) ) ) ) 
    168  
     168            ! 
    169169            !           !  solar irradiance transmission at the mixed layer bottom and used in the lead heat budget 
    170170            !           !  practically no "direct lateral ablation" 
     
    181181            qdtcn(ji,jj)  = zindb * fdtcn(ji,jj) * (1.0 - at_i(ji,jj)) * rdt_ice 
    182182            !                        
    183  
    184             ! still need to be updated : fdtcn !!!! 
    185             !           !-- Lead heat budget (part 1, next one is in limthd_dh 
    186             !           !-- qldif -- (or qldif_1d in 1d routines) 
    187             qldif(ji,jj) =  tms(ji,jj) * rdt_ice  * (                             &  
    188                &   pfrld(ji,jj)        * (  qsr(ji,jj)                            &   ! solar heat  
    189                &                            + qns(ji,jj)                          &   ! non solar heat  
    190                &                            + fdtcn(ji,jj)                        &   ! turbulent ice-ocean heat  
    191                &                            + fsbbq(ji,jj) * ( 1.0 - zindb )  )   &   ! residual heat from previous step  
     183            !           !-- Lead heat budget, qldif (part 1, next one is in limthd_dh)  
     184            !           !   caution: exponent betas used as more snow can fallinto leads 
     185            qldif(ji,jj) =  tms(ji,jj) * rdt_ice  * (                             & 
     186               &   pfrld(ji,jj)        * (  qsr(ji,jj)                            &   ! solar heat 
     187               &                            + qns(ji,jj)                          &   ! non solar heat 
     188               &                            + fdtcn(ji,jj)                        &   ! turbulent ice-ocean heat 
     189               &                            + fsbbq(ji,jj) * ( 1.0 - zindb )  )   &   ! residual heat from previous step 
    192190               & - pfrld(ji,jj)**betas * sprecip(ji,jj) * lfus                    )   ! latent heat of sprecip melting 
    193              
     191            ! 
    194192            ! Positive heat budget is used for bottom ablation 
    195193            zfntlat        = 1.0 - MAX( zzero , SIGN( zone ,  - qldif(ji,jj) ) ) 
     
    198196            != 0 if ice and positive heat budget and 1 if one of those two is false 
    199197            zqlbsbq(ji,jj) = qldif(ji,jj) * ( 1.0 - zpareff ) / MAX( at_i(ji,jj) * rdt_ice , epsi16 ) 
    200  
     198            ! 
    201199            ! Heat budget of the lead, energy transferred from ice to ocean 
    202200            qldif  (ji,jj) = zpareff * qldif(ji,jj) 
    203201            qdtcn  (ji,jj) = zpareff * qdtcn(ji,jj) 
    204  
     202            ! 
    205203            ! Energy needed to bring ocean surface layer until its freezing (qcmif, limflx) 
    206204            qcmif  (ji,jj) =  rau0 * rcp * fse3t(ji,jj,1) * ( t_bo(ji,jj) - (sst_m(ji,jj) + rt0) ) * ( 1. - zinda ) 
    207  
     205            ! 
    208206            ! oceanic heat flux (limthd_dh) 
    209207            fbif   (ji,jj) = zindb * (  fsbbq(ji,jj) / MAX( at_i(ji,jj) , epsi20 ) + fdtcn(ji,jj) ) 
     
    223221         ENDIF 
    224222 
    225          zareamin = 1.0e-10 
     223         zareamin = 1.e-10 
    226224         nbpb = 0 
    227225         DO jj = 1, jpj 
     
    359357            CALL tab_1d_2d( nbpb, rdvonif, npb, dvnbq_1d  (1:nbpb), jpi, jpj )  
    360358            CALL tab_1d_2d( nbpb, fseqv  , npb, fseqv_1d  (1:nbpb), jpi, jpj ) 
    361  
     359            ! 
    362360            IF( num_sal == 2 ) THEN 
    363361               CALL tab_1d_2d( nbpb, fsbri, npb, fsbri_1d(1:nbpb), jpi, jpj ) 
    364362               CALL tab_1d_2d( nbpb, fhbri, npb, fhbri_1d(1:nbpb), jpi, jpj ) 
    365363            ENDIF 
    366  
     364            ! 
    367365            !+++++ 
    368366            !temporary stuff for a dummy version 
     
    375373            CALL tab_1d_2d( nbpb, qns_ice(:,:,jl), npb, qnsr_ice_1d(1:nbpb), jpi, jpj) 
    376374            !+++++ 
    377  
     375            ! 
    378376            IF( lk_mpp )   CALL mpp_comm_free( ncomm_ice ) !RB necessary ?? 
    379377         ENDIF 
     
    388386      ! 5.1) Ice heat content               
    389387      !------------------------ 
    390  
    391388      ! Enthalpies are global variables we have to readjust the units 
    392389      zcoef = 1.e0 / ( unit_fac * REAL(nlay_i) ) 
     
    401398      ! 5.2) Snow heat content               
    402399      !------------------------ 
    403  
    404400      ! Enthalpies are global variables we have to readjust the units 
    405401      zcoef = 1.e0 / ( unit_fac * REAL(nlay_s) ) 
     
    424420      IF( con_i )   fbif(:,:) = fbif(:,:) + zqlbsbq(:,:) 
    425421 
    426       IF(ln_ctl) THEN   ! Control print 
     422      IF(ln_ctl) THEN            ! Control print 
    427423         CALL prt_ctl_info(' ') 
    428424         CALL prt_ctl_info(' - Cell values : ') 
     
    454450            END DO 
    455451         END DO 
    456  
    457452      ENDIF 
    458  
     453      ! 
    459454   END SUBROUTINE lim_thd 
    460455 
     
    524519      END DO 
    525520      ! layer by layer 
    526       dq_i_layer(:,:)    = q_i_layer_fin(:,:) - q_i_layer_in(:,:) 
     521      dq_i_layer(:,:) = q_i_layer_fin(:,:) - q_i_layer_in(:,:) 
    527522 
    528523      !---------------------------------------- 
    529524      ! Atmospheric heat flux, ice heat budget 
    530525      !---------------------------------------- 
    531  
    532       DO ji = kideb, kiut 
    533          zji = MOD( npb(ji) - 1, jpi ) + 1 
    534          zjj = ( npb(ji) - 1 ) / jpi + 1 
    535  
    536          fatm(ji,jl) = qnsr_ice_1d(ji) + (1.0-i0(ji))*qsr_ice_1d(ji) 
    537  
    538          sum_fluxq(ji,jl) = fc_su(ji) - fc_bo_i(ji) + qsr_ice_1d(ji)*i0(ji) - fstroc(zji,zjj,jl) 
     526      DO ji = kideb, kiut 
     527         zji = MOD( npb(ji) - 1 , jpi ) + 1 
     528         zjj =    ( npb(ji) - 1 ) / jpi + 1 
     529         fatm     (ji,jl) = qnsr_ice_1d(ji) + ( 1._wp - i0(ji) ) * qsr_ice_1d(ji) 
     530         sum_fluxq(ji,jl) = fc_su(ji) - fc_bo_i(ji) + qsr_ice_1d(ji) * i0(ji) - fstroc(zji,zjj,jl) 
    539531      END DO 
    540532 
     
    542534      ! Conservation error 
    543535      !-------------------- 
    544  
    545536      DO ji = kideb, kiut 
    546537         cons_error(ji,jl) = ABS( dq_i(ji,jl) / rdt_ice + sum_fluxq(ji,jl) ) 
    547538      END DO 
    548539 
    549       numce = 0 
     540      numce  = 0 
    550541      meance = 0.0 
    551542      DO ji = kideb, kiut 
     
    554545            meance = meance + cons_error(ji,jl) 
    555546         ENDIF 
    556       ENDDO 
    557       IF (numce .GT. 0 ) meance = meance / numce 
     547      END DO 
     548      IF( numce .GT. 0 ) meance = meance / numce 
    558549 
    559550      WRITE(numout,*) ' Maximum tolerated conservation error : ', max_cons_err 
     
    565556      ! Surface error due to imbalance between Fatm and Fcsu 
    566557      !------------------------------------------------------- 
    567       numce  = 0.0 
     558      numce  = 0 
    568559      meance = 0.0 
    569560 
    570561      DO ji = kideb, kiut 
    571562         surf_error(ji,jl) = ABS ( fatm(ji,jl) - fc_su(ji) ) 
    572          IF ( ( t_su_b(ji) .LT. rtt ) .AND. ( surf_error(ji,jl) .GT. & 
    573             max_surf_err ) ) THEN 
     563         IF( ( t_su_b(ji) .LT. rtt ) .AND. ( surf_error(ji,jl) .GT. max_surf_err ) ) THEN 
    574564            numce = numce + 1  
    575565            meance = meance + surf_error(ji,jl) 
    576566         ENDIF 
    577567      ENDDO 
    578       IF (numce .GT. 0 ) meance = meance / numce 
     568      IF( numce .GT. 0 ) meance = meance / numce 
    579569 
    580570      WRITE(numout,*) ' Maximum tolerated surface error : ', max_surf_err 
     
    590580      ! Write ice state in case of big errors 
    591581      !--------------------------------------- 
    592  
    593582      DO ji = kideb, kiut 
    594583         IF ( ( ( t_su_b(ji) .LT. rtt ) .AND. ( surf_error(ji,jl) .GT. max_surf_err ) ) .OR. & 
     
    596585            zji                 = MOD( npb(ji) - 1, jpi ) + 1 
    597586            zjj                 = ( npb(ji) - 1 ) / jpi + 1 
    598  
     587            ! 
    599588            WRITE(numout,*) ' alerte 1     ' 
    600589            WRITE(numout,*) ' Untolerated conservation / surface error after ' 
     
    612601            !        WRITE(numout,*) ' qt_i_fin  : ', qt_i_fin(ji,jl) 
    613602            !        WRITE(numout,*) ' qt_s_fin  : ', qt_s_fin(ji,jl) 
    614             !        WRITE(numout,*) ' qt        : ', qt_i_fin(ji,jl) + & 
    615             !                                         qt_s_fin(ji,jl) 
     603            !        WRITE(numout,*) ' qt        : ', qt_i_fin(ji,jl) + qt_s_fin(ji,jl) 
    616604            WRITE(numout,*) ' ht_i       : ', ht_i_b(ji) 
    617605            WRITE(numout,*) ' ht_s       : ', ht_s_b(ji) 
     
    640628            WRITE(numout,*) 
    641629            WRITE(numout,*) ' Layer by layer ... ' 
    642             WRITE(numout,*) ' dq_snow : ', ( qt_s_fin(ji,jl) - & 
    643                qt_s_in(ji,jl) )  &  
    644                / rdt_ice 
    645             WRITE(numout,*) ' dfc_snow  : ', fc_s(ji,1) -      & 
    646                fc_s(ji,0) 
     630            WRITE(numout,*) ' dq_snow : ', ( qt_s_fin(ji,jl) - qt_s_in(ji,jl) ) / rdt_ice 
     631            WRITE(numout,*) ' dfc_snow  : ', fc_s(ji,1) - fc_s(ji,0) 
    647632            DO jk = 1, nlay_i 
    648633               WRITE(numout,*) ' layer  : ', jk 
    649634               WRITE(numout,*) ' dq_ice : ', dq_i_layer(ji,jk) / rdt_ice   
    650635               WRITE(numout,*) ' radab  : ', radab(ji,jk) 
    651                WRITE(numout,*) ' dfc_i  : ', fc_i(ji,jk) -               & 
    652                   fc_i(ji,jk-1) 
    653                WRITE(numout,*) ' tot f  : ', fc_i(ji,jk) -               & 
    654                   fc_i(ji,jk-1) - radab(ji,jk) 
     636               WRITE(numout,*) ' dfc_i  : ', fc_i(ji,jk) - fc_i(ji,jk-1) 
     637               WRITE(numout,*) ' tot f  : ', fc_i(ji,jk) - fc_i(ji,jk-1) - radab(ji,jk) 
    655638            END DO 
    656639 
     
    662645 
    663646 
    664    SUBROUTINE lim_thd_con_dh(kideb,kiut,jl) 
     647   SUBROUTINE lim_thd_con_dh( kideb, kiut, jl ) 
    665648      !!----------------------------------------------------------------------- 
    666649      !!                   ***  ROUTINE lim_thd_con_dh  ***  
    667650      !!                  
    668651      !! ** Purpose :   Test energy conservation after enthalpy redistr. 
    669       !! 
    670       !! history : 
    671       !!  9.9  ! 07-04 (M.Vancoppenolle) original code 
    672652      !!----------------------------------------------------------------------- 
    673653      INTEGER, INTENT(in) ::        & 
     
    745725      ! Write ice state in case of big errors 
    746726      !--------------------------------------- 
    747  
    748727      DO ji = kideb, kiut 
    749728         IF ( cons_error(ji,jl) .GT. max_cons_err  ) THEN 
    750729            zji                 = MOD( npb(ji) - 1, jpi ) + 1 
    751730            zjj                 = ( npb(ji) - 1 ) / jpi + 1 
    752  
     731            ! 
    753732            WRITE(numout,*) ' alerte 1 - category : ', jl 
    754733            WRITE(numout,*) ' Untolerated conservation error after limthd_ent ' 
     
    771750            WRITE(numout,*) ' qt_s_in    : ', qt_s_in(ji,jl) / rdt_ice 
    772751            WRITE(numout,*) ' qt_i_in    : ', qt_i_in(ji,jl) / rdt_ice 
    773             WRITE(numout,*) ' qt_in      : ', ( qt_i_in(ji,jl) + & 
    774                qt_s_in(ji,jl) ) / rdt_ice 
     752            WRITE(numout,*) ' qt_in      : ', ( qt_i_in(ji,jl) + qt_s_in(ji,jl) ) / rdt_ice 
    775753            WRITE(numout,*) ' qt_s_fin   : ', qt_s_fin(ji,jl) / rdt_ice 
    776754            WRITE(numout,*) ' qt_i_fin   : ', qt_i_fin(ji,jl) / rdt_ice 
    777             WRITE(numout,*) ' qt_fin     : ', ( qt_i_fin(ji,jl) + & 
    778                qt_s_fin(ji,jl) ) / rdt_ice 
     755            WRITE(numout,*) ' qt_fin     : ', ( qt_i_fin(ji,jl) + qt_s_fin(ji,jl) ) / rdt_ice 
    779756            WRITE(numout,*) ' * ' 
    780757            WRITE(numout,*) ' Ice variables --- : ' 
     
    785762            WRITE(numout,*) ' dh_i_surf : ', dh_i_surf(ji) 
    786763            WRITE(numout,*) ' dh_i_bott : ', dh_i_bott(ji) 
    787  
    788764         ENDIF 
    789765         ! 
     
    800776      !! 
    801777      !! ** Method  :   Formula (Bitz and Lipscomb, 1999) 
    802       !! 
    803778      !!------------------------------------------------------------------- 
    804779      INTEGER, INTENT(in) ::   kideb, kiut   ! bounds for the spatial loop 
     
    827802 
    828803   SUBROUTINE lim_thd_init 
    829  
    830804      !!----------------------------------------------------------------------- 
    831805      !!                   ***  ROUTINE lim_thd_init ***  
     
    838812      !! 
    839813      !! ** input   :   Namelist namicether 
    840        !!------------------------------------------------------------------- 
     814      !!------------------------------------------------------------------- 
    841815      NAMELIST/namicethd/ hmelt , hiccrit, fraz_swi, maxfrazb, vfrazb, Cfrazb,   & 
    842816         &                hicmin, hiclim, amax  ,                                & 
     
    845819         &                kappa_i, nconv_i_thd, maxer_i_thd, thcon_i_swi 
    846820      !!------------------------------------------------------------------- 
    847  
     821      ! 
    848822      IF(lwp) THEN 
    849823         WRITE(numout,*) 
     
    851825         WRITE(numout,*) '~~~~~~~' 
    852826      ENDIF 
    853  
     827      ! 
    854828      REWIND( numnam_ice )                  ! read Namelist numnam_ice 
    855829      READ  ( numnam_ice , namicethd ) 
    856        
     830      ! 
    857831      IF(lwp) THEN                          ! control print 
    858832         WRITE(numout,*) 
     
    892866#else 
    893867   !!---------------------------------------------------------------------- 
    894    !!   Default option                               NO  LIM3 sea-ice model 
     868   !!   Default option         Dummy module          NO  LIM3 sea-ice model 
    895869   !!---------------------------------------------------------------------- 
    896 CONTAINS 
    897    SUBROUTINE lim_thd         ! Empty routine 
    898    END SUBROUTINE lim_thd 
    899    SUBROUTINE lim_thd_con_dif 
    900    END SUBROUTINE lim_thd_con_dif 
    901870#endif 
    902871 
Note: See TracChangeset for help on using the changeset viewer.