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 1111 for trunk/NEMO/OPA_SRC/TRA/tranpc.F90 – NEMO

Ignore:
Timestamp:
2008-06-13T16:35:46+02:00 (16 years ago)
Author:
ctlod
Message:

trunk: remove a small bug related to the non-penetrative convective adjustment scheme, see ticket: #203

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/NEMO/OPA_SRC/TRA/tranpc.F90

    r719 r1111  
    1111   !!                                       suppression of common work arrays 
    1212   !!            8.5  !  02-06  (G. Madec)  free form F90 
     13   !!            9.0  !  08-06  (G. Madec)  applied on ta, sa and called before tranxt in step.F90 
    1314   !!---------------------------------------------------------------------- 
    1415 
     
    3839   !!---------------------------------------------------------------------- 
    3940   !!   OPA 9.0 , LOCEAN-IPSL (2005)  
    40    !! $Header$  
     41   !! $Id:$  
    4142   !! Software governed by the CeCILL licence (modipsl/doc/NEMO_CeCILL.txt) 
    4243   !!---------------------------------------------------------------------- 
     
    4950      !! 
    5051      !! ** Purpose :   Non penetrative convective adjustment scheme. solve  
    51       !!      the static instability of the water column (now, after the swap)  
     52      !!      the static instability of the water column on after fields 
    5253      !!      while conserving heat and salt contents. 
    5354      !! 
     
    5758      !!      l_trdtra=T: the trend associated with this algorithm is saved. 
    5859      !! 
    59       !! ** Action  : - (tn,sn) after the application od the npc scheme 
     60      !! ** Action  : - (ta,sa) after the application od the npc scheme 
    6061      !!              - save the associated trends (ttrd,strd) ('key_trdtra') 
    6162      !! 
     
    8485         inpci = 0 
    8586 
    86          CALL eos( tn, sn, rhd, zrhop )         ! Potential density 
    87  
    88  
    89          IF( l_trdtra )   THEN                  ! Save tn and sn trends 
    90             ztrdt(:,:,:) = tn(:,:,:)  
    91             ztrds(:,:,:) = sn(:,:,:)  
     87         CALL eos( ta, sa, rhd, zrhop )         ! Potential density 
     88 
     89 
     90         IF( l_trdtra )   THEN                  ! Save ta and sa trends 
     91            ztrdt(:,:,:) = ta(:,:,:)  
     92            ztrds(:,:,:) = sa(:,:,:)  
    9293         ENDIF 
    9394 
     
    160161                        ! 
    161162                        ze3tot= fse3t(ji,jj,ikup) 
    162                         zta   = tn   (ji,jj,ikup) 
    163                         zsa   = sn   (ji,jj,ikup) 
     163                        zta   = ta   (ji,jj,ikup) 
     164                        zsa   = sa   (ji,jj,ikup) 
    164165                        zraua = zrhop(ji,jj,ikup) 
    165166                        ! 
     
    171172                           ze3dwn =  fse3t(ji,jj,jkdown) 
    172173                           ze3tot =  ze3tot + ze3dwn 
    173                            zta   = ( zta*(ze3tot-ze3dwn) + tn(ji,jj,jkdown)*ze3dwn )/ze3tot 
    174                            zsa   = ( zsa*(ze3tot-ze3dwn) + sn(ji,jj,jkdown)*ze3dwn )/ze3tot 
     174                           zta   = ( zta*(ze3tot-ze3dwn) + ta(ji,jj,jkdown)*ze3dwn )/ze3tot 
     175                           zsa   = ( zsa*(ze3tot-ze3dwn) + sa(ji,jj,jkdown)*ze3dwn )/ze3tot 
    175176                           zraua = ( zraua*(ze3tot-ze3dwn) + zrhop(ji,jj,jkdown)*ze3dwn )/ze3tot 
    176177                           inpci = inpci+1 
     
    180181                        ! 
    181182                        DO jkp = ikup, ikdown-1 
    182                            tn(ji,jj,jkp) = zta 
    183                            sn(ji,jj,jkp) = zsa 
     183                           ta(ji,jj,jkp) = zta 
     184                           sa(ji,jj,jkp) = zsa 
    184185                           zrhop(ji,jj,jkp) = zraua 
    185186                        END DO 
    186187                        IF (ikdown == ikbot-1 .AND. zraua >= zrhop(ji,jj,ikdown) ) THEN 
    187                            tn(ji,jj,ikdown) = zta 
    188                            sn(ji,jj,ikdown) = zsa 
     188                           ta(ji,jj,ikdown) = zta 
     189                           sa(ji,jj,ikdown) = zsa 
    189190                           zrhop(ji,jj,ikdown) = zraua 
    190191                        ENDIF 
     
    200201         !  
    201202         IF( l_trdtra )   THEN         ! save the Non penetrative mixing trends for diagnostic 
    202             ztrdt(:,:,:) = tn(:,:,:) - ztrdt(:,:,:) 
    203             ztrds(:,:,:) = sn(:,:,:) - ztrds(:,:,:) 
     203            ztrdt(:,:,:) = ta(:,:,:) - ztrdt(:,:,:) 
     204            ztrds(:,:,:) = sa(:,:,:) - ztrds(:,:,:) 
    204205            CALL trd_mod(ztrdt, ztrds, jptra_trd_npc, 'TRA', kt) 
    205206         ENDIF 
    206207       
    207          ! Lateral boundary conditions on ( tn, sn )   ( Unchanged sign) 
     208         ! Lateral boundary conditions on ( ta, sa )   ( Unchanged sign) 
    208209         ! ------------------------------============ 
    209          CALL lbc_lnk( tn, 'T', 1. ) 
    210          CALL lbc_lnk( sn, 'T', 1. ) 
     210         CALL lbc_lnk( ta, 'T', 1. ) 
     211         CALL lbc_lnk( sa, 'T', 1. ) 
    211212       
    212213 
Note: See TracChangeset for help on using the changeset viewer.