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 6060 for branches/2015/dev_merge_2015/NEMOGCM/NEMO/OPA_SRC/SBC/sbcice_lim.F90 – NEMO

Ignore:
Timestamp:
2015-12-16T10:25:22+01:00 (8 years ago)
Author:
timgraham
Message:

Merged dev_r5836_noc2_VVL_BY_DEFAULT into branch

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2015/dev_merge_2015/NEMOGCM/NEMO/OPA_SRC/SBC/sbcice_lim.F90

    r5541 r6060  
    2525   USE thd_ice         ! LIM-3: thermodynamical variables 
    2626   USE dom_ice         ! LIM-3: ice domain 
    27  
     27   ! 
    2828   USE sbc_oce         ! Surface boundary condition: ocean fields 
    2929   USE sbc_ice         ! Surface boundary condition: ice   fields 
     
    3232   USE sbccpl          ! Surface boundary condition: coupled interface 
    3333   USE albedo          ! ocean & ice albedo 
    34  
     34   ! 
    3535   USE phycst          ! Define parameters for the routines 
    3636   USE eosbn2          ! equation of state 
     
    4747   USE limupdate2      ! update of global variables 
    4848   USE limvar          ! Ice variables switch 
    49  
     49   USE limctl          !  
    5050   USE limmsh          ! LIM mesh 
    5151   USE limistate       ! LIM initial state 
    5252   USE limthd_sal      ! LIM ice thermodynamics: salinity 
    53  
     53   ! 
    5454   USE c1d             ! 1D vertical configuration 
     55   USE in_out_manager  ! I/O manager 
     56   USE iom             ! I/O manager library 
     57   USE prtctl          ! Print control 
     58   USE lib_fortran     !  
    5559   USE lbclnk          ! lateral boundary condition - MPP link 
    5660   USE lib_mpp         ! MPP library 
    5761   USE wrk_nemo        ! work arrays 
    5862   USE timing          ! Timing 
    59    USE iom             ! I/O manager library 
    60    USE in_out_manager  ! I/O manager 
    61    USE prtctl          ! Print control 
    62    USE lib_fortran     !  
    63    USE limctl 
    6463 
    6564#if defined key_bdy  
     
    7473    
    7574   !! * Substitutions 
    76 #  include "domzgr_substitute.h90" 
    7775#  include "vectopt_loop_substitute.h90" 
    7876   !!---------------------------------------------------------------------- 
     
    8280   !!---------------------------------------------------------------------- 
    8381CONTAINS 
    84  
    85    !!====================================================================== 
    8682 
    8783   SUBROUTINE sbc_ice_lim( kt, kblk ) 
     
    270266      IF(lwp) WRITE(numout,*) '~~~~~~~~~~~   via Louvain la Neuve Ice Model (LIM-3) time stepping' 
    271267      ! 
    272                                        ! Open the reference and configuration namelist files and namelist output file  
     268      !                                ! Open the reference and configuration namelist files and namelist output file  
    273269      CALL ctl_opn( numnam_ice_ref, 'namelist_ice_ref',    'OLD',     'FORMATTED', 'SEQUENTIAL', -1, numout, lwp )  
    274270      CALL ctl_opn( numnam_ice_cfg, 'namelist_ice_cfg',    'OLD',     'FORMATTED', 'SEQUENTIAL', -1, numout, lwp ) 
    275271      IF(lwm) CALL ctl_opn( numoni, 'output.namelist.ice', 'UNKNOWN', 'FORMATTED', 'SEQUENTIAL', -1, numout, lwp, 1 ) 
    276  
     272      ! 
    277273      CALL ice_run                     ! set some ice run parameters 
    278274      ! 
     
    348344      REWIND( numnam_ice_ref )              ! Namelist namicerun in reference namelist : Parameters for ice 
    349345      READ  ( numnam_ice_ref, namicerun, IOSTAT = ios, ERR = 901) 
    350 901   IF( ios /= 0 ) CALL ctl_nam ( ios , 'namicerun in reference namelist', lwp ) 
    351  
     346901   IF( ios /= 0 )   CALL ctl_nam ( ios , 'namicerun in reference namelist', lwp ) 
     347      ! 
    352348      REWIND( numnam_ice_cfg )              ! Namelist namicerun in configuration namelist : Parameters for ice 
    353349      READ  ( numnam_ice_cfg, namicerun, IOSTAT = ios, ERR = 902 ) 
    354 902   IF( ios /= 0 ) CALL ctl_nam ( ios , 'namicerun in configuration namelist', lwp ) 
    355       IF(lwm) WRITE ( numoni, namicerun ) 
    356       ! 
     350902   IF( ios /= 0 )   CALL ctl_nam ( ios , 'namicerun in configuration namelist', lwp ) 
     351      IF(lwm) WRITE( numoni, namicerun ) 
    357352      ! 
    358353      IF(lwp) THEN                        ! control print 
     
    405400      REWIND( numnam_ice_ref )              ! Namelist namiceitd in reference namelist : Parameters for ice 
    406401      READ  ( numnam_ice_ref, namiceitd, IOSTAT = ios, ERR = 903) 
    407 903   IF( ios /= 0 ) CALL ctl_nam ( ios , 'namiceitd in reference namelist', lwp ) 
    408  
     402903   IF( ios /= 0 )   CALL ctl_nam ( ios , 'namiceitd in reference namelist', lwp ) 
     403      ! 
    409404      REWIND( numnam_ice_cfg )              ! Namelist namiceitd in configuration namelist : Parameters for ice 
    410405      READ  ( numnam_ice_cfg, namiceitd, IOSTAT = ios, ERR = 904 ) 
    411 904   IF( ios /= 0 ) CALL ctl_nam ( ios , 'namiceitd in configuration namelist', lwp ) 
    412       IF(lwm) WRITE ( numoni, namiceitd ) 
    413       ! 
     406904   IF( ios /= 0 )   CALL ctl_nam ( ios , 'namiceitd in configuration namelist', lwp ) 
     407      IF(lwm) WRITE( numoni, namiceitd ) 
    414408      ! 
    415409      IF(lwp) THEN                        ! control print 
     
    417411         WRITE(numout,*) 'ice_itd : ice cat distribution' 
    418412         WRITE(numout,*) ' ~~~~~~' 
    419          WRITE(numout,*) '   shape of ice categories distribution                          nn_catbnd = ', nn_catbnd 
    420          WRITE(numout,*) '   mean ice thickness in the domain (only active if nn_catbnd=2) rn_himean = ', rn_himean 
     413         WRITE(numout,*) '   shape of ice categories distribution                     nn_catbnd = ', nn_catbnd 
     414         WRITE(numout,*) '   mean ice thickness in the domain (used if nn_catbnd=2)  rn_himean = ', rn_himean 
    421415      ENDIF 
    422  
     416      ! 
    423417      !---------------------------------- 
    424418      !- Thickness categories boundaries  
     
    427421      IF(lwp) WRITE(numout,*) 'lim_itd_init : Initialization of ice cat distribution ' 
    428422      IF(lwp) WRITE(numout,*) '~~~~~~~~~~~~' 
    429  
     423      ! 
    430424      hi_max(:) = 0._wp 
    431  
    432       SELECT CASE ( nn_catbnd  )        
    433                                    !---------------------- 
    434          CASE (1)                  ! tanh function (CICE) 
    435                                    !---------------------- 
     425      ! 
     426      SELECT CASE ( nn_catbnd  )    ! type of ice categories distribution 
     427      ! 
     428      CASE (1)                            !==  tanh function (CICE)  ==! 
    436429         zc1 =  3._wp / REAL( jpl, wp ) 
    437430         zc2 = 10._wp * zc1 
    438431         zc3 =  3._wp 
    439  
    440432         DO jl = 1, jpl 
    441433            zx1 = REAL( jl-1, wp ) / REAL( jpl, wp ) 
    442434            hi_max(jl) = hi_max(jl-1) + zc1 + zc2 * (1._wp + TANH( zc3 * (zx1 - 1._wp ) ) ) 
    443435         END DO 
    444  
    445                                    !---------------------- 
    446          CASE (2)                  ! h^(-alpha) function 
    447                                    !---------------------- 
    448          zalpha = 0.05             ! exponent of the transform function 
    449  
    450          zhmax  = 3.*rn_himean 
    451  
     436         ! 
     437      CASE (2)                            !==  h^(-alpha) function  ==! 
     438         zalpha = 0.05_wp 
     439         zhmax  = 3._wp * rn_himean 
    452440         DO jl = 1, jpl  
    453441            znum = jpl * ( zhmax+1 )**zalpha 
    454             zden = ( jpl - jl ) * ( zhmax+1 )**zalpha + jl 
     442            zden = REAL( jpl-jl , wp ) * ( zhmax + 1._wp )**zalpha + REAL( jl , wp ) 
    455443            hi_max(jl) = ( znum / zden )**(1./zalpha) - 1 
    456444         END DO 
    457  
     445         ! 
    458446      END SELECT 
    459  
    460       DO jl = 1, jpl 
     447      ! 
     448      DO jl = 1, jpl                ! mean thickness by category 
    461449         hi_mean(jl) = ( hi_max(jl) + hi_max(jl-1) ) * 0.5_wp 
    462450      END DO 
    463  
    464       ! Set hi_max(jpl) to a big value to ensure that all ice is thinner than hi_max(jpl) 
    465       hi_max(jpl) = 99._wp 
    466  
     451      ! 
     452      hi_max(jpl) = 99._wp          ! set to a big value to ensure that all ice is thinner than hi_max(jpl) 
     453      ! 
    467454      IF(lwp) WRITE(numout,*) ' Thickness category boundaries ' 
    468455      IF(lwp) WRITE(numout,*) ' hi_max ', hi_max(0:jpl) 
     
    471458 
    472459    
    473    SUBROUTINE ice_lim_flx( ptn_ice, palb_ice, pqns_ice, pqsr_ice, pdqn_ice, pevap_ice, pdevap_ice, k_limflx ) 
     460   SUBROUTINE ice_lim_flx( ptn_ice , palb_ice, pqns_ice ,    & 
     461      &                    pqsr_ice, pdqn_ice, pevap_ice, pdevap_ice, k_limflx ) 
    474462      !!--------------------------------------------------------------------- 
    475463      !!                  ***  ROUTINE ice_lim_flx  *** 
     
    483471      !!--------------------------------------------------------------------- 
    484472      INTEGER                   , INTENT(in   ) ::   k_limflx   ! =-1 do nothing; =0 average ;  
    485                                                                 ! =1 average and redistribute ; =2 redistribute 
     473      !                                                         ! =1 average and redistribute ; =2 redistribute 
    486474      REAL(wp), DIMENSION(:,:,:), INTENT(in   ) ::   ptn_ice    ! ice surface temperature  
    487475      REAL(wp), DIMENSION(:,:,:), INTENT(in   ) ::   palb_ice   ! ice albedo 
     
    503491      REAL(wp), POINTER, DIMENSION(:,:) :: z_devap_m ! Mean d(evap)/dT over all categories 
    504492      !!---------------------------------------------------------------------- 
    505  
     493      ! 
    506494      IF( nn_timing == 1 )  CALL timing_start('ice_lim_flx') 
    507       ! 
    508495      ! 
    509496      SELECT CASE( k_limflx )                              !==  averaged on all ice categories  ==! 
     
    529516         CALL wrk_dealloc( jpi,jpj, z_qsr_m, z_qns_m, z_evap_m, z_dqn_m, z_devap_m) 
    530517      END SELECT 
    531  
     518      ! 
    532519      SELECT CASE( k_limflx )                              !==  redistribution on all ice categories  ==! 
    533520      CASE( 1 , 2 ) 
     
    548535      ! 
    549536   END SUBROUTINE ice_lim_flx 
     537 
    550538 
    551539   SUBROUTINE sbc_lim_bef 
     
    564552      u_ice_b(:,:)     = u_ice(:,:) 
    565553      v_ice_b(:,:)     = v_ice(:,:) 
    566        
     554      !       
    567555   END SUBROUTINE sbc_lim_bef 
     556 
    568557 
    569558   SUBROUTINE sbc_lim_diag0 
     
    580569      sfx_bom(:,:) = 0._wp   ;   sfx_sum(:,:) = 0._wp 
    581570      sfx_res(:,:) = 0._wp 
    582        
     571      ! 
    583572      wfx_snw(:,:) = 0._wp   ;   wfx_ice(:,:) = 0._wp 
    584573      wfx_sni(:,:) = 0._wp   ;   wfx_opw(:,:) = 0._wp 
     
    587576      wfx_res(:,:) = 0._wp   ;   wfx_sub(:,:) = 0._wp 
    588577      wfx_spr(:,:) = 0._wp   ;    
    589        
     578      ! 
    590579      hfx_thd(:,:) = 0._wp   ;    
    591580      hfx_snw(:,:) = 0._wp   ;   hfx_opw(:,:) = 0._wp 
     
    596585      hfx_err(:,:) = 0._wp   ;   hfx_err_rem(:,:) = 0._wp 
    597586      hfx_err_dif(:,:) = 0._wp   ; 
    598  
     587      ! 
    599588      afx_tot(:,:) = 0._wp   ; 
    600589      afx_dyn(:,:) = 0._wp   ;   afx_thd(:,:) = 0._wp 
    601  
     590      ! 
    602591      diag_heat(:,:) = 0._wp ;   diag_smvi(:,:) = 0._wp ; 
    603592      diag_vice(:,:) = 0._wp ;   diag_vsnw(:,:) = 0._wp ; 
    604        
     593      ! 
    605594   END SUBROUTINE sbc_lim_diag0 
    606595 
     
    634623   END FUNCTION fice_ice_ave 
    635624 
    636  
    637625#else 
    638626   !!---------------------------------------------------------------------- 
Note: See TracChangeset for help on using the changeset viewer.