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 1998 for branches/DEV_R1821_Rivers/NEMO/OPA_SRC/TRA/trasbc.F90 – NEMO

Ignore:
Timestamp:
2010-07-08T17:12:21+02:00 (14 years ago)
Author:
acc
Message:

ticket #465_Rivers tidied code and added namelist changes in preparation for mid-year merge

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/DEV_R1821_Rivers/NEMO/OPA_SRC/TRA/trasbc.F90

    r1938 r1998  
    107107      INTEGER  ::   ji, jj, jk           ! dummy loop indices   
    108108      REAL(wp) ::   zta, zsa             ! temporary scalars, adjustment to temperature and salinity   
    109       REAL(wp) ::   azta, azsa           ! temporary scalars, calculations of automatic change to temp & sal due to vvl (done elsewhere)   
     109      REAL(wp) ::   zata, zasa           ! temporary scalars, calculations of automatic change to temp & sal due to vvl (done elsewhere)   
    110110      REAL(wp) ::   zsrau, zse3t, zdep   ! temporary scalars, 1/density, 1/height of box, 1/height of effected water column   
    111       REAL(wp) ::   dheat, dsalt          ! total change of temperature and salinity   
    112       REAL(wp) ::   tot_sal1, tot_tmp1   
     111      REAL(wp) ::   zdheat, zdsalt       ! total change of temperature and salinity   
    113112      !!---------------------------------------------------------------------- 
    114113 
     
    131130      IF( .NOT.ln_traqsr )   qsr(:,:) = 0.e0   ! no solar radiation penetration 
    132131 
    133       ! Concentration dillution effect on (t,s) due to evapouration, precipitation and qns, but not river runoff   
     132      ! Concentration dilution effect on (t,s) due to evapouration, precipitation and qns, but not river runoff   
    134133      DO jj = 2, jpj 
    135134         DO ji = fs_2, fs_jpim1   ! vector opt. 
     
    150149      END DO 
    151150 
    152       IF ( ln_rnf ) THEN   
     151      IF ( ln_rnf .AND. ln_rnf_att ) THEN   
    153152      ! Concentration / dilution effect on (t,s) due to river runoff   
    154153        DO jj=1,jpj   
     
    167166                  !!!indirect flux, concentration or dilution effect   
    168167                  !!!force a dilution effect in all levels;   
    169                   dheat=0.0   
    170                   dsalt=0.0   
     168                  zdheat=0.0   
     169                  zdsalt=0.0   
    171170                  DO jk=1, rnf_mod_dep(ji,jj)   
    172171                    zta = -tn(ji,jj,jk) * rnf(ji,jj) * zsrau * zdep   
     
    174173                    ta(ji,jj,jk)=ta(ji,jj,jk)+zta   
    175174                    sa(ji,jj,jk)=sa(ji,jj,jk)+zsa   
    176                     dheat=dheat+zta*fse3t(ji,jj,jk)   
    177                     dsalt=dsalt+zsa*fse3t(ji,jj,jk)   
     175                    zdheat=zdheat+zta*fse3t(ji,jj,jk)   
     176                    zdsalt=zdsalt+zsa*fse3t(ji,jj,jk)   
    178177                  ENDDO   
    179178                  !!!negate this total change in heat and salt content from top level   
    180                   zta=-dheat*zse3t   
    181                   zsa=-dsalt*zse3t   
     179                  zta=-zdheat*zse3t   
     180                  zsa=-zdsalt*zse3t   
    182181                  ta(ji,jj,1)=ta(ji,jj,1)+zta   
    183182                  sa(ji,jj,1)=sa(ji,jj,1)+zsa   
     
    205204                IF( lk_vvl) THEN   
    206205                  !calculate automatic adjustment to sal and temp due to dilution/concentraion effect    
    207                   azta = -tn(ji,jj,1) * rnf(ji,jj) * zsrau * zse3t   
    208                   azsa = -sn(ji,jj,1) * rnf(ji,jj) * zsrau * zse3t   
    209                   !!!negate this change in sal and temp    
    210                   ta(ji,jj,1)=ta(ji,jj,1)-azta   
    211                   sa(ji,jj,1)=sa(ji,jj,1)-azsa   
     206                  zata = tn(ji,jj,1) * rnf(ji,jj) * zsrau * zse3t   
     207                  zasa = sn(ji,jj,1) * rnf(ji,jj) * zsrau * zse3t   
     208                  ta(ji,jj,1)=ta(ji,jj,1) + zata   
     209                  sa(ji,jj,1)=sa(ji,jj,1) + zasa   
    212210                ENDIF   
    213211   
     
    216214           ENDDO   
    217215        ENDDO   
    218         
     216 
     217      ELSE IF( ln_rnf ) THEN 
     218 
     219      ! Concentration dilution effect on (t,s) due to runoff without temperatue, salinity and depth attributes 
     220        DO jj = 2, jpj 
     221           DO ji = fs_2, fs_jpim1   ! vector opt. 
     222#if ! defined key_zco 
     223              zse3t = 1. / fse3t(ji,jj,1) 
     224#endif 
     225              IF( lk_vvl) THEN 
     226                 zta =  rnf(ji,jj) * zsrau * tn(ji,jj,1) * zse3t       ! & cooling/heating effect of runoff 
     227                 zsa = 0.e0                                            ! No salinity concent./dilut. effect 
     228              ELSE 
     229                 zta =  0.0                                            ! temperature : heat flux  
     230                 zsa =  - rnf(ji,jj) * zsrau * sn(ji,jj,1) * zse3t     ! salinity :  concent./dilut. effect 
     231              ENDIF 
     232              ta(ji,jj,1) = ta(ji,jj,1) + zta                          ! add the trend to the general tracer trend 
     233              sa(ji,jj,1) = sa(ji,jj,1) + zsa 
     234           END DO 
     235        END DO 
     236  
    219237      ENDIF   
    220238 
Note: See TracChangeset for help on using the changeset viewer.