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 1608 – NEMO

Changeset 1608


Ignore:
Timestamp:
2009-08-12T10:05:30+02:00 (15 years ago)
Author:
ctlod
Message:

nemo 3.1 LIM3 : remove useless akappa and alambd arrays, plus small cosmetic, see ticket: #400

Location:
trunk/NEMO/LIM_SRC_3
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/NEMO/LIM_SRC_3/dom_ice.F90

    r1152 r1608  
    22   !!====================================================================== 
    33   !!                   ***  MODULE  dom_ice  *** 
    4    !! LIM Sea Ice :   Domain  variables 
     4   !! LIM-3 Sea Ice :   Domain  variables 
    55   !!====================================================================== 
    6    !! History : 
    7    !!   2.0  !  03-08  (C. Ethe)  Free form and module 
    8    !!   3.0  !  03-08  (M. Vancoppenolle), Ice cats, salinity and EVP-C 
     6   !! History :  3.0  ! 2003-08  (M. Vancoppenolle)  LIM-3 
    97   !!---------------------------------------------------------------------- 
    10    !!   LIM 3.0, UCL-ASTR-LOCEAN-IPSL (2005) 
    11    !! $Id$ 
    12    !! This software is governed by the CeCILL licence see modipsl/doc/NEMO_CeCILL.txt 
    13    !!---------------------------------------------------------------------- 
    14    !! * Modules used 
    158   USE par_ice 
    169 
     
    1811   PRIVATE 
    1912 
    20    !! * Share module variables 
    21    LOGICAL, PUBLIC ::   &  !: 
    22       l_jeq = .TRUE.       !: Equator inside the domain flag 
     13   LOGICAL, PUBLIC ::   l_jeq = .TRUE.       !: Equator inside the domain flag 
    2314 
    24    INTEGER, PUBLIC ::   &  !: 
    25       njeq , njeqm1        !: j-index of the equator if it is inside the domain 
    26    !                    !  (otherwise = jpj+10 (SH) or -10 (SH) ) 
     15   INTEGER, PUBLIC ::   njeq , njeqm1        !: j-index of the equator if it is inside the domain 
    2716 
    28    REAL(wp), PUBLIC, DIMENSION(jpi,jpj) ::   &  !: 
    29       fs2cor ,          &  !: coriolis factor 
    30       fcor   ,          &  !: coriolis coefficient 
    31       covrai ,          &  !: sine of geographic latitude 
    32       area   ,          &  !: surface of grid cell  
    33       tms , tmi ,       &  !: temperature mask, mask for stress 
    34       tmu , tmv ,       &  !: mask at u-v velocity points 
    35       tmf 
     17   REAL(wp), PUBLIC, DIMENSION(jpi,jpj) ::   fs2cor     !: coriolis factor 
     18   REAL(wp), PUBLIC, DIMENSION(jpi,jpj) ::   fcor       !: coriolis coefficient 
     19   REAL(wp), PUBLIC, DIMENSION(jpi,jpj) ::   covrai     !: sine of geographic latitude 
     20   REAL(wp), PUBLIC, DIMENSION(jpi,jpj) ::   area       !: surface of grid cell  
     21   REAL(wp), PUBLIC, DIMENSION(jpi,jpj) ::   tms, tmi   !: temperature mask, mask for stress 
     22   REAL(wp), PUBLIC, DIMENSION(jpi,jpj) ::   tmu, tmv   !: mask at u and v velocity points 
     23   REAL(wp), PUBLIC, DIMENSION(jpi,jpj) ::   tmf        !: mask at f-point 
    3624 
    37    REAL(wp), PUBLIC, DIMENSION(jpi,jpj,2,2) ::   &  !: 
    38       wght   ,          &  !: weight of the 4 neighbours to compute averages 
    39       akappa ,          &  !: first group of metric coefficients 
    40       bkappa               !: third group of metric coefficients 
     25   REAL(wp), PUBLIC, DIMENSION(jpi,jpj,2,2) ::   wght     !: weight of the 4 neighbours to compute averages 
    4126 
    42    REAL(wp), PUBLIC, DIMENSION(jpi,jpj,2,2,2,2) ::   &  !: 
    43       alambd               !: second group of metric coefficients 
    44  
     27   !!---------------------------------------------------------------------- 
     28   !! NEMO/LIM 3.2, UCL-ASTR-LOCEAN-IPSL (2009) 
     29   !! $Id$ 
     30   !! Software governed by the CeCILL licence (modipsl/doc/NEMO_CeCILL.txt) 
    4531   !!====================================================================== 
    4632END MODULE dom_ice 
  • trunk/NEMO/LIM_SRC_3/limmsh.F90

    r1156 r1608  
    44   !! LIM ice model :   definition of the ice mesh parameters 
    55   !!====================================================================== 
     6   !! History :  3.2  !  2008-01 (NEMO team)  LIM-3: adaptation from LIM-2 
     7   !!---------------------------------------------------------------------- 
    68#if defined key_lim3 
    79   !!---------------------------------------------------------------------- 
     
    1012   !!   lim_msh   : definition of the ice mesh 
    1113   !!---------------------------------------------------------------------- 
    12    !! * Modules used 
    13    USE phycst 
    14    USE dom_oce 
    15    USE dom_ice 
    16    USE lbclnk 
    17    USE in_out_manager 
     14   USE phycst         ! physical constants 
     15   USE dom_oce        ! ocean domain 
     16   USE dom_ice        ! sea-ice domain 
     17   USE in_out_manager ! I/O manager 
     18   USE lbclnk         !  
    1819 
    1920   IMPLICIT NONE 
    2021   PRIVATE 
    2122 
    22    !! * Accessibility 
    23    PUBLIC lim_msh      ! routine called by ice_ini.F90 
     23   PUBLIC   lim_msh   ! routine called by ice_ini.F90 
    2424 
    2525   !!---------------------------------------------------------------------- 
    26    !!   LIM 3.0,  UCL-ASTR-LOCEAN-IPSL (2008)  
     26   !! NEMO/LIM 3.2,  UCL-ASTR-LOCEAN-IPSL (2009)  
    2727   !! $Id$ 
    28    !! This software is governed by the CeCILL licence see modipsl/doc/NEMO_CeCILL.txt  
     28   !! Software governed by the CeCILL licence (modipsl/doc/NEMO_CeCILL.txt) 
    2929   !!---------------------------------------------------------------------- 
    3030 
     
    4242      !!              - Initialization of the ice masks (tmsk, umsk) 
    4343      !!  
    44       !! ** Refer.  : Deleersnijder et al. Ocean Modelling 100, 7-10  
    45       !! 
    46       !! ** History : 
    47       !!         original    : 01-04 (LIM) 
    48       !!         addition    : 02-08 (C. Ethe, G. Madec) 
     44      !! Reference  : Deleersnijder et al. Ocean Modelling 100, 7-10  
    4945      !!---------------------------------------------------------------------  
    50       !! * Local variables 
    51       INTEGER :: ji, jj      ! dummy loop indices 
    52  
    53       REAL(wp), DIMENSION(jpi,jpj) ::  & 
    54          zd2d1 , zd1d2       ! Derivative of zh2 (resp. zh1) in the x direction 
    55       !                   ! (resp. y direction) (defined at the center) 
    56       REAL(wp) ::         & 
    57          zh1p  , zh2p   , &  ! Idem zh1, zh2 for the bottom left corner of the grid 
    58          zd2d1p, zd1d2p , &  ! Idem zd2d1, zd1d2 for the bottom left corner of the grid 
    59          zusden, zusden2     ! temporary scalars 
     46      INTEGER  ::   ji, jj   ! dummy loop indices 
     47      REAL(wp) ::   zusden   ! temporary scalar 
    6048      !!--------------------------------------------------------------------- 
    6149 
    6250      IF(lwp) THEN 
    6351         WRITE(numout,*) 
    64          WRITE(numout,*) 'lim_msh : LIM sea-ice model, mesh initialization' 
     52         WRITE(numout,*) 'lim_msh : LIM-3 sea-ice model, mesh initialization' 
    6553         WRITE(numout,*) '~~~~~~~' 
    6654      ENDIF 
    6755 
    68       !----------------------------------------------------------                           
    69       !    Initialization of local and some global (common) variables  
    70       !------------------------------------------------------------------  
    71  
    72       njeq   = INT( jpj / 2 )   !i bug mpp potentiel 
     56      !                           !==  coriolis factor & Equator position ==! 
     57      njeq   = INT( jpj / 2 )  
    7358      njeqm1 = njeq - 1  
    74  
    75       fcor(:,:) = 2. * omega * SIN( gphit(:,:) * rad )   !  coriolis factor 
    76  
     59      ! 
     60      fcor(:,:) = 2. * omega * SIN( gphit(:,:) * rad )   ! coriolis factor 
     61      ! 
    7762      IF( fcor(1,1) * fcor(1,nlcj) < 0.e0 ) THEN   ! local domain include both hemisphere 
    7863         l_jeq = .TRUE. 
     
    9176         IF(lwp ) WRITE(numout,*) '          the model domain is entirely in the northern hemisphere: njeq = ', njeq 
    9277      ENDIF 
    93  
     78      ! 
    9479      njeqm1 = njeq - 1 
    9580 
    9681 
    97       !   For each grid, definition of geometric tables  
    98       !------------------------------------------------------------------ 
    99  
    100       !------------------- 
    101       ! Conventions :    ! 
    102       !------------------- 
    103       !  indices 1 \ 2 <-> localisation in the 2 direction x \ y 
    104       !  3rd indice <-> localisation on the mesh : 
    105       !  0 = Centre ;  1 = corner W x(i-1/2) ; 2 = corner S y(j-1/2) ; 
    106       !  3 = corner SW x(i-1/2),y(j-1/2) 
    107       !------------------- 
    108       !!ibug ??? 
    109       akappa(:,:,:,:) = 0.e0 
     82      !                           !==  metric coefficients for sea ice dynamic  ==! 
    11083      wght(:,:,:,:) = 0.e0 
    111       alambd(:,:,:,:,:,:) = 0.e0 
    112       tmu(:,:) = 0.e0 
    113       tmv(:,:) = 0.0e0 ! CGrid EVP 
    114       !!i 
    115       ! metric coefficients for sea ice dynamic 
    116       !---------------------------------------- 
    117       !                                                       ! akappa 
    118       DO jj = 2, jpj 
    119          zd1d2(:,jj) = e1v(:,jj) - e1v(:,jj-1) 
    120       END DO 
    121       CALL lbc_lnk( zd1d2, 'T', -1. ) 
    122  
    123       DO ji = 2, jpi 
    124          zd2d1(ji,:) = e2u(ji,:) - e2u(ji-1,:) 
    125       END DO 
    126       CALL lbc_lnk( zd2d1, 'T', -1. ) 
    127  
    128       akappa(:,:,1,1) =        1.0 / ( 2.0 * e1t(:,:) ) 
    129       akappa(:,:,1,2) = zd1d2(:,:) / ( 4.0 * e1t(:,:) * e2t(:,:) ) 
    130       akappa(:,:,2,1) = zd2d1(:,:) / ( 4.0 * e1t(:,:) * e2t(:,:) ) 
    131       akappa(:,:,2,2) =        1.0 / ( 2.0 * e2t(:,:) ) 
    132  
    133       !                                                      ! weights (wght) 
     84!!gm  Optimisation :  wght to be defined at F-point, not I-point  and change in limrhg 
    13485      DO jj = 2, jpj 
    13586         DO ji = 2, jpi 
    136             zusden = 1. / (  ( e1t(ji,jj) + e1t(ji-1,jj  ) )   & 
    137                &           * ( e2t(ji,jj) + e2t(ji  ,jj-1) ) ) 
     87            zusden = 1.e0 / (  ( e1t(ji,jj) + e1t(ji-1,jj  ) )   & 
     88               &             * ( e2t(ji,jj) + e2t(ji  ,jj-1) ) ) 
    13889            wght(ji,jj,1,1) = zusden * e1t(ji  ,jj) * e2t(ji,jj  ) 
    13990            wght(ji,jj,1,2) = zusden * e1t(ji  ,jj) * e2t(ji,jj-1) 
     
    14697      CALL lbc_lnk( wght(:,:,2,1), 'I', 1. )      ! but it is never used 
    14798      CALL lbc_lnk( wght(:,:,2,2), 'I', 1. ) 
     99!!gm end 
    148100 
    149       ! Coefficients for divergence of the stress tensor 
    150       !------------------------------------------------- 
    151  
    152       DO jj = 2, jpj 
    153          DO ji = 2, jpi 
    154             zh1p  =  e1t(ji  ,jj  ) * wght(ji,jj,2,2)   & 
    155                &   + e1t(ji-1,jj  ) * wght(ji,jj,1,2)   & 
    156                &   + e1t(ji  ,jj-1) * wght(ji,jj,2,1)   & 
    157                &   + e1t(ji-1,jj-1) * wght(ji,jj,1,1) 
    158  
    159             zh2p  =  e2t(ji  ,jj  ) * wght(ji,jj,2,2)   & 
    160                &   + e2t(ji-1,jj  ) * wght(ji,jj,1,2)   & 
    161                &   + e2t(ji  ,jj-1) * wght(ji,jj,2,1)   & 
    162                &   + e2t(ji-1,jj-1) * wght(ji,jj,1,1) 
    163  
    164             zusden = 1.0 / MAX( zh1p * zh2p * 4.e0 , 1.e-20 ) 
    165             zusden2 = zusden * 2.0  
    166  
    167             zd1d2p = zusden * 0.5 * ( -e1t(ji-1,jj-1) + e1t(ji-1,jj  ) - e1t(ji,jj-1) + e1t(ji  ,jj)   ) 
    168             zd2d1p = zusden * 0.5 * (  e2t(ji  ,jj-1) - e2t(ji-1,jj-1) + e2t(ji,jj  ) - e2t(ji-1,jj)   ) 
    169  
    170             alambd(ji,jj,2,2,2,1) = zusden2 * e2t(ji  ,jj-1) 
    171             alambd(ji,jj,2,2,2,2) = zusden2 * e2t(ji  ,jj  ) 
    172             alambd(ji,jj,2,2,1,1) = zusden2 * e2t(ji-1,jj-1) 
    173             alambd(ji,jj,2,2,1,2) = zusden2 * e2t(ji-1,jj  ) 
    174  
    175             alambd(ji,jj,1,1,2,1) = zusden2 * e1t(ji  ,jj-1) 
    176             alambd(ji,jj,1,1,2,2) = zusden2 * e1t(ji  ,jj  ) 
    177             alambd(ji,jj,1,1,1,1) = zusden2 * e1t(ji-1,jj-1) 
    178             alambd(ji,jj,1,1,1,2) = zusden2 * e1t(ji-1,jj  ) 
    179  
    180             alambd(ji,jj,1,2,2,1) = zd1d2p 
    181             alambd(ji,jj,1,2,2,2) = zd1d2p 
    182             alambd(ji,jj,1,2,1,1) = zd1d2p 
    183             alambd(ji,jj,1,2,1,2) = zd1d2p 
    184  
    185             alambd(ji,jj,2,1,2,1) = zd2d1p 
    186             alambd(ji,jj,2,1,2,2) = zd2d1p 
    187             alambd(ji,jj,2,1,1,1) = zd2d1p 
    188             alambd(ji,jj,2,1,1,2) = zd2d1p 
     101      !                           !==  ice masks  ==! 
     102      tms(:,:) = tmask(:,:,1)             ! ice T-point  : use surface tmask 
     103      tmu(:,:) = umask(:,:,1)             ! ice U-point  : use surface umask  (C-grid EVP) 
     104      tmv(:,:) = vmask(:,:,1)             ! ice V-point  : use surface vmask  (C-grid EVP) 
     105      DO jj = 1, jpjm1                    ! ice F-point  : recompute fmask (due to nn_shlat) 
     106         DO ji = 1 , jpim1 
     107            tmf(ji,jj) =  tms(ji,jj) * tms(ji+1,jj) * tms(ji,jj+1) * tms(ji+1,jj+1) 
    189108         END DO 
    190109      END DO 
     110      CALL lbc_lnk( tmf(:,:), 'F', 1. )           ! lateral boundary conditions 
    191111 
    192       CALL lbc_lnk( alambd(:,:,2,2,2,1), 'I', 1. )      ! CAUTION: even with the lbc_lnk at ice U-V point 
    193       CALL lbc_lnk( alambd(:,:,2,2,2,2), 'I', 1. )      ! the value of wght at jpj is wrong 
    194       CALL lbc_lnk( alambd(:,:,2,2,1,1), 'I', 1. )      ! but it is never used 
    195       CALL lbc_lnk( alambd(:,:,2,2,1,2), 'I', 1. )      !  
    196  
    197       CALL lbc_lnk( alambd(:,:,1,1,2,1), 'I', 1. )      ! CAUTION: idem 
    198       CALL lbc_lnk( alambd(:,:,1,1,2,2), 'I', 1. )      !  
    199       CALL lbc_lnk( alambd(:,:,1,1,1,1), 'I', 1. )      ! 
    200       CALL lbc_lnk( alambd(:,:,1,1,1,2), 'I', 1. )      ! 
    201  
    202       CALL lbc_lnk( alambd(:,:,1,2,2,1), 'I', 1. )      ! CAUTION: idem 
    203       CALL lbc_lnk( alambd(:,:,1,2,2,2), 'I', 1. )      ! 
    204       CALL lbc_lnk( alambd(:,:,1,2,1,1), 'I', 1. )      ! 
    205       CALL lbc_lnk( alambd(:,:,1,2,1,2), 'I', 1. )      ! 
    206  
    207       CALL lbc_lnk( alambd(:,:,2,1,2,1), 'I', 1. )      ! CAUTION: idem 
    208       CALL lbc_lnk( alambd(:,:,2,1,2,2), 'I', 1. )      ! 
    209       CALL lbc_lnk( alambd(:,:,2,1,1,1), 'I', 1. )      ! 
    210       CALL lbc_lnk( alambd(:,:,2,1,1,2), 'I', 1. )      ! 
    211  
    212  
    213       ! Initialization of ice masks 
    214       !---------------------------- 
    215  
    216       tms(:,:) = tmask(:,:,1)      ! ice T-point  : use surface tmask 
    217  
    218       !      tmu(:,1) = 0.e0 
    219       !      tmu(1,:) = 0.e0 
    220       !      tmv(:,1) = 0.e0 
    221       !      tmv(1,:) = 0.e0 
    222  
    223       DO jj = 1, jpj - 1 
    224          DO ji = 1 , jpi - 1 
    225             tmu(ji,jj) =  tms(ji,jj) * tms(ji+1,jj) 
    226             tmv(ji,jj) =  tms(ji,jj) * tms(ji,jj+1) 
    227             tmf(ji,jj) =  tms(ji,jj) * tms(ji+1,jj) * tms(ji,jj+1) * & 
    228                tms(ji+1,jj+1) 
    229          END DO 
    230       END DO 
    231  
    232       !--lateral boundary conditions     
    233       CALL lbc_lnk( tmu(:,:), 'U', 1. ) 
    234       CALL lbc_lnk( tmv(:,:), 'V', 1. ) 
    235       CALL lbc_lnk( tmf(:,:), 'F', 1. ) 
    236  
    237       ! unmasked and masked area of T-grid cell 
     112      !                           !==  unmasked and masked area of T-grid cell 
    238113      area(:,:) = e1t(:,:) * e2t(:,:) 
    239  
     114      ! 
    240115   END SUBROUTINE lim_msh 
    241116 
  • trunk/NEMO/LIM_SRC_3/limthd.F90

    r1572 r1608  
    9898      ! 1) Initialization of diagnostic variables                                    ! 
    9999      !------------------------------------------------------------------------------! 
    100       zeps = 1.0e-10 
     100      zeps = 1.e-10 
    101101 
    102102      !-------------------- 
     
    478478      !! 
    479479      INTEGER  ::   ji,jk   ! loop indices 
    480       REAL(wp) ::   zdes    ! snow heat content increment (dummy) 
    481480      REAL(wp) ::   zeps    ! very small value (1.e-10) 
    482481      !!----------------------------------------------------------------------- 
    483482      eti(:,:) = 0.e0 
    484483      ets(:,:) = 0.e0 
    485       zeps     = 1.0e-10 
     484      zeps     = 1.e-10 
    486485 
    487486      DO jk = 1, nlay_i                ! total q over all layers, ice [J.m-2] 
  • trunk/NEMO/LIM_SRC_3/par_ice.F90

    r1471 r1608  
    22   !!====================================================================== 
    33   !!                       ***  MODULE par_ice   *** 
    4    !! Sea-Ice model : definition of the parameters 
     4   !! LIM-3 Sea Ice :   definition of parameters 
    55   !!====================================================================== 
     6   !! History :  3.0  ! 2003-08  (M. Vancoppenolle)  LIM-3 
    67   !!---------------------------------------------------------------------- 
    7    !!  LIM 3.0, UCL-LOCEAN-IPSL (2008) 
    8    !! $Id$ 
    9    !! Software governed by the CeCILL licence (modipsl/doc/NEMO_CeCILL.txt) 
    10    !!---------------------------------------------------------------------- 
    11    !! * Modules used 
    128   USE par_oce 
    139 
    1410   IMPLICIT NONE 
    15    PUBLIC               ! allows par_oce and par_kind to be known in ice modules 
     11   PUBLIC           
    1612 
    17    !ICE THERMODYNAMICS 
    18    INTEGER , PARAMETER ::      &  !: 
    19       jkmax    = 6 ,           &  !: maximum number of ice layers 
    20       nlay_s   = 1                !: number of snow layers 
     13   !                                             !!! ice thermodynamics 
     14   INTEGER, PUBLIC, PARAMETER ::   jkmax    = 6   !: maximum number of ice layers 
     15   INTEGER, PUBLIC, PARAMETER ::   nlay_s   = 1   !: number of snow layers 
    2116 
    22    !ICE MECHANICAL REDISTRIBUTION 
    23    INTEGER , PARAMETER ::      &  !: 
    24       jpl      = 5,            &  !: number of ice categories 
    25       jpm      = 1                !: number of ice types 
     17   !                                             !!! ice mechanical redistribution 
     18   INTEGER, PUBLIC, PARAMETER ::   jpl      = 5   !: number of ice categories 
     19   INTEGER, PUBLIC, PARAMETER ::   jpm      = 1   !: number of ice types 
    2620 
     21   !!---------------------------------------------------------------------- 
     22   !! NEMO/LIM 3.2, UCL-ASTR-LOCEAN-IPSL (2009) 
     23   !! $Id$ 
     24   !! Software governed by the CeCILL licence (modipsl/doc/NEMO_CeCILL.txt) 
    2725   !!====================================================================== 
    2826END MODULE par_ice 
Note: See TracChangeset for help on using the changeset viewer.