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 4672 for branches/2013/dev_r4028_CNRS_LIM3/NEMOGCM/NEMO/LIM_SRC_3/limthd.F90 – NEMO

Ignore:
Timestamp:
2014-06-17T17:06:59+02:00 (10 years ago)
Author:
clem
Message:
 
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2013/dev_r4028_CNRS_LIM3/NEMOGCM/NEMO/LIM_SRC_3/limthd.F90

    r4659 r4672  
    9191      REAL(wp) :: zinda, zindb, zareamin  
    9292      REAL(wp) :: zfric_u, zqld, zqfr 
    93       REAL(wp), POINTER, DIMENSION(:) :: zdq, zq_ini, zhfx, zqfx 
    94       REAL(wp)                        :: zhfx_err, ztest 
    9593      ! 
    9694      REAL(wp) :: zvi_b, zsmv_b, zei_b, zfs_b, zfw_b, zft_b  
    9795      !!------------------------------------------------------------------- 
    9896      IF( nn_timing == 1 )  CALL timing_start('limthd') 
    99  
    100       CALL wrk_alloc( jpij, zdq, zq_ini, zhfx, zqfx ) 
    101     
    102       ! init debug 
    103       zdq(:) = 0._wp ; zq_ini(:) = 0._wp ; zhfx(:) = 0._wp ; zqfx(:) = 0._wp       
    10497 
    10598      ! conservation test 
     
    333326            ! 4.3) Thermodynamic processes 
    334327            !-------------------------------- 
    335             ! --- diag error on heat diffusion - PART 1 --- ! 
    336             DO ji = 1, nbpb 
    337                zq_ini(ji) = ( SUM( q_i_b(ji,1:nlay_i) ) * ht_i_b(ji) / REAL( nlay_i ) +  & 
    338                   &           SUM( q_s_b(ji,1:nlay_s) ) * ht_s_b(ji) / REAL( nlay_s ) )  
    339             END DO 
    340328 
    341329            !---------------------------------! 
    342330            ! Ice/Snow Temperature profile    ! 
    343331            !---------------------------------! 
    344             CALL lim_thd_dif( 1, nbpb, jl ) 
    345  
    346             ! --- computes sea ice energy of melting compulsory for limthd_dh --- ! 
    347             CALL lim_thd_enmelt( 1, nbpb ) 
    348  
    349             DO ji = 1, nbpb 
    350               ! --- diag error on heat diffusion - PART 2 --- ! 
    351                zdq(ji)        = - zq_ini(ji) + ( SUM( q_i_b(ji,1:nlay_i) ) * ht_i_b(ji) / REAL( nlay_i ) +  & 
    352                   &                              SUM( q_s_b(ji,1:nlay_s) ) * ht_s_b(ji) / REAL( nlay_s ) ) 
    353                zhfx_err       = ( fc_su(ji) + i0(ji) * qsr_ice_1d(ji) - ftr_ice_1d(ji) - fc_bo_i(ji) + zdq(ji) * r1_rdtice )  
    354                hfx_err_1d(ji) = hfx_err_1d(ji) + zhfx_err * a_i_b(ji) 
    355                ! --- correction of qns_ice and surface conduction flux --- ! 
    356                qns_ice_1d(ji) = qns_ice_1d(ji) - zhfx_err  
    357                fc_su     (ji) = fc_su     (ji) - zhfx_err  
    358                ! --- Heat flux at the ice surface in W.m-2 --- ! 
    359                ii = MOD( npb(ji) - 1, jpi ) + 1 ; ij = ( npb(ji) - 1 ) / jpi + 1 
    360                hfx_in (ii,ij) = hfx_in (ii,ij) + a_i_b(ji) * ( qsr_ice_1d(ji) + qns_ice_1d(ji) ) 
    361             END DO 
     332            CALL lim_thd_dif( 1, nbpb ) 
    362333 
    363334            !---------------------------------! 
    364335            ! Ice/Snow thicnkess              ! 
    365336            !---------------------------------! 
    366             ! --- diag error on heat remapping - PART 1 --- ! 
    367             DO ji = 1, nbpb 
    368                zq_ini(ji) = ( SUM( q_i_b(ji,1:nlay_i) ) * ht_i_b(ji) / REAL( nlay_i ) + & 
    369                   &           SUM( q_s_b(ji,1:nlay_s) ) * ht_s_b(ji) / REAL( nlay_s ) )  
    370             END DO 
    371  
    372             CALL lim_thd_dh( 1, nbpb, jl )     
     337            CALL lim_thd_dh( 1, nbpb )     
    373338 
    374339            ! --- Ice enthalpy remapping --- ! 
    375             CALL lim_thd_ent( 1, nbpb, jl, q_i_b(1:nbpb,:) )  
    376             !                                 
    377             ! --- diag error on heat remapping - PART 2 --- ! 
    378             DO ji = 1, nbpb 
    379                zdq(ji)        = - ( zq_ini(ji) + dq_i(ji) + dq_s(ji) )   & 
    380                   &             + ( SUM( q_i_b(ji,1:nlay_i) ) * ht_i_b(ji) / REAL( nlay_i ) +  & 
    381                   &                 SUM( q_s_b(ji,1:nlay_s) ) * ht_s_b(ji) / REAL( nlay_s ) ) 
    382                hfx_err_rem_1d(ji) = hfx_err_rem_1d(ji) + zdq(ji) * a_i_b(ji) * r1_rdtice 
    383             END DO 
    384  
     340            CALL lim_thd_ent( 1, nbpb, q_i_b(1:nbpb,:) )  
     341                                             
    385342            !---------------------------------! 
    386343            ! --- Ice salinity --- ! 
     
    528485      IF( ln_limdiahsb ) CALL lim_cons_hsm(1, 'limthd', zvi_b, zsmv_b, zei_b, zfw_b, zfs_b, zft_b) 
    529486      ! 
    530       CALL wrk_dealloc( jpij, zdq, zq_ini, zhfx, zqfx ) 
    531  
    532487      IF( nn_timing == 1 )  CALL timing_stop('limthd') 
    533    END SUBROUTINE lim_thd 
    534  
    535   
    536    SUBROUTINE lim_thd_enmelt( kideb, kiut ) 
    537       !!----------------------------------------------------------------------- 
    538       !!                   ***  ROUTINE lim_thd_enmelt ***  
    539       !!                  
    540       !! ** Purpose :   Computes sea ice energy of melting q_i (J.m-3) from temperature 
    541       !! 
    542       !! ** Method  :   Formula (Bitz and Lipscomb, 1999) 
    543       !!------------------------------------------------------------------- 
    544       INTEGER, INTENT(in) ::   kideb, kiut   ! bounds for the spatial loop 
    545       !! 
    546       INTEGER  ::   ji, jk   ! dummy loop indices 
    547       REAL(wp) ::   ztmelts, zindb  ! local scalar  
    548       !!------------------------------------------------------------------- 
    549       ! 
    550       DO jk = 1, nlay_i             ! Sea ice energy of melting 
    551          DO ji = kideb, kiut 
    552             ztmelts      = - tmut  * s_i_b(ji,jk) + rtt  
    553             zindb        = MAX( 0._wp , SIGN( 1._wp , -(t_i_b(ji,jk) - rtt) - epsi10 ) ) 
    554             q_i_b(ji,jk) = rhoic * ( cpic * ( ztmelts - t_i_b(ji,jk) )                                             & 
    555                &                   + lfus * ( 1.0 - zindb * ( ztmelts-rtt ) / MIN( t_i_b(ji,jk)-rtt, -epsi10 ) )   & 
    556                &                   - rcp  *                 ( ztmelts-rtt )  )  
    557          END DO 
    558       END DO 
    559       DO jk = 1, nlay_s             ! Snow energy of melting 
    560          DO ji = kideb, kiut 
    561             q_s_b(ji,jk) = rhosn * ( cpic * ( rtt - t_s_b(ji,jk) ) + lfus ) 
    562          END DO 
    563       END DO 
    564       ! 
    565    END SUBROUTINE lim_thd_enmelt 
     488   END SUBROUTINE lim_thd  
    566489 
    567490   SUBROUTINE lim_thd_temp( kideb, kiut ) 
Note: See TracChangeset for help on using the changeset viewer.