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 2052 for branches/DEV_r2006_merge_TRA_TRC/NEMO/TOP_SRC/TRP/trcsbc.F90 – NEMO

Ignore:
Timestamp:
2010-08-13T11:15:17+02:00 (14 years ago)
Author:
cetlod
Message:

Improve the merge TRA-TRC, see ticket:701

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/DEV_r2006_merge_TRA_TRC/NEMO/TOP_SRC/TRP/trcsbc.F90

    r2030 r2052  
    6666      INTEGER  ::   ji, jj, jn           ! dummy loop indices 
    6767      REAL(wp) ::   ztra, zsrau, zse3t   ! temporary scalars 
     68      REAL(wp), DIMENSION(jpi,jpj) ::   zemps  ! surface freshwater flux 
    6869      REAL(wp), DIMENSION(:,:,:), ALLOCATABLE ::   ztrtrd 
    6970      CHARACTER (len=22) :: charout 
     
    7677      ENDIF 
    7778 
     79 
    7880      IF( l_trdtrc ) ALLOCATE( ztrtrd(jpi,jpj,jpk) ) 
    7981 
     82#if ! defined key_offline 
     83      ! Concentration dilution effect on tracer due to evaporation, precipitation, and river runoff 
     84      IF( lk_vvl ) THEN   ;   zemps(:,:) = emps(:,:) - emp(:,:)   ! volume variable 
     85      ELSE                ;   zemps(:,:) = emps(:,:) - rnf(:,:)   ! linear free surface  
     86      ENDIF  
     87#else 
     88      ! emps in dynamical files contains emps - rnf 
     89      IF( lk_vvl ) THEN   ;   zemps(:,:) = 0.         ! No concentration/dilution effect  
     90      ELSE                ;   zemps(:,:) = emps(:,:)  ! emps -rnf  
     91      ENDIF 
     92#endif 
    8093      ! 0. initialization 
    8194      zsrau = 1. / rau0 
     
    8598 
    8699      DO jn = 1, jptra 
    87          ! 1. Concentration dillution effect on tra 
     100         ! 
    88101         IF( l_trdtrc ) ztrtrd(:,:,:) = tra(:,:,:,jn)  ! save trends 
    89102 
    90103         DO jj = 2, jpj 
    91104            DO ji = fs_2, fs_jpim1   ! vector opt. 
    92 #if ! defined key_zco 
     105#if ! defined key_zco  
    93106               zse3t = 1. / fse3t(ji,jj,1) 
    94107#endif 
    95                IF( lk_vvl ) THEN   ;   ztra = 0.e0                         ! No concent./dilut. effect 
    96                ELSE                ;   ztra = emps(ji,jj) * zsrau * trn(ji,jj,1,jn) * zse3t * tmask(ji,jj,1)  
    97                ENDIF 
     108               ! add the trend to the general tracer trend 
     109               ztra = zemps(ji,jj) *  zsrau * trn(ji,jj,1,jn) * zse3t 
    98110               tra(ji,jj,1,jn) = tra(ji,jj,1,jn) + ztra 
    99111            END DO 
     
    107119      END DO                                                     ! tracer loop 
    108120      !                                                          ! =========== 
     121      IF( l_trdtrc ) DEALLOCATE( ztrtrd ) 
    109122 
    110       IF( l_trdtrc ) DEALLOCATE( ztrtrd ) 
    111123      IF( ln_ctl )   THEN 
    112124         WRITE(charout, FMT="('sbc ')") ;  CALL prt_ctl_trc_info(charout) 
Note: See TracChangeset for help on using the changeset viewer.