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/OPA_SRC/TRA – NEMO

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

Improve the merge TRA-TRC, see ticket:701

Location:
branches/DEV_r2006_merge_TRA_TRC/NEMO/OPA_SRC/TRA
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/DEV_r2006_merge_TRA_TRC/NEMO/OPA_SRC/TRA/traadv_cen2.F90

    r2034 r2052  
    2020   !!                  area (set for orca 2 and 4 only) 
    2121   !!---------------------------------------------------------------------- 
    22    USE oce, ONLY: tsn  ! now ocean temperature and salinity 
     22   USE oce, ONLY: tn, sn  ! now ocean temperature and salinity 
    2323   USE dom_oce         ! ocean space and time domain 
    2424   USE eosbn2          ! equation of state 
     
    159159!!gm  not strickly exact : the freezing point should be computed at each ocean levels... 
    160160!!gm  not a big deal since cen2 is no more used in global ice-ocean simulations 
    161       ztfreez(:,:) = tfreez( tsn(:,:,1,jp_sal) ) 
     161      ztfreez(:,:) = tfreez( sn(:,:,1) ) 
    162162      DO jk = 1, jpk 
    163163         DO jj = 1, jpj 
    164164            DO ji = 1, jpi 
    165165               !                                        ! below ice covered area (if tn < "freezing"+0.1 ) 
    166                IF( tsn(ji,jj,jk,jp_tem) <= ztfreez(ji,jj) + 0.1 ) THEN   ;   zice = 1.e0 
     166               IF( tn(ji,jj,jk) <= ztfreez(ji,jj) + 0.1 ) THEN   ;   zice = 1.e0 
    167167               ELSE                                              ;   zice = 0.e0 
    168168               ENDIF 
  • branches/DEV_r2006_merge_TRA_TRC/NEMO/OPA_SRC/TRA/trasbc.F90

    r2024 r2052  
    200200                ENDIF   
    201201   
    202               ELSE IF( rnf(ji,jj) > 0.) THEN   ! for use in baltic when flow is out of domain, want no change in temp and sal   
     202              ELSE IF( rnf(ji,jj) < 0.) THEN   ! for use in baltic when flow is out of domain, want no change in temp and sal   
    203203   
    204204                IF( lk_vvl ) THEN   
  • branches/DEV_r2006_merge_TRA_TRC/NEMO/OPA_SRC/TRA/trazdf_imp.F90

    r2034 r2052  
    180180               END DO 
    181181            END DO 
     182            ! first recurrence:   Tk = Dk - Ik Sk-1 / Tk-1   (increasing k) 
     183            DO jj = 2, jpjm1 
     184               DO ji = fs_2, fs_jpim1 
     185                  zwt(ji,jj,1) = zwd(ji,jj,1) 
     186               END DO 
     187            END DO 
     188            DO jk = 2, jpkm1 
     189               DO jj = 2, jpjm1 
     190                  DO ji = fs_2, fs_jpim1 
     191                    zwt(ji,jj,jk) = zwd(ji,jj,jk) - zwi(ji,jj,jk) * zws(ji,jj,jk-1)  /zwt(ji,jj,jk-1) 
     192                  END DO 
     193               END DO 
     194            END DO 
    182195            ! 
    183196         ELSE IF( ( cdtype == 'TRA' .AND. jn == jp_sal ) .OR. ( cdtype == 'TRC' .AND. jn == 1 ) ) THEN 
     
    191204                           & * (  wslpi(ji,jj,jk) * wslpi(ji,jj,jk)   & 
    192205                           &    + wslpj(ji,jj,jk) * wslpj(ji,jj,jk)  ) 
    193                         zwt(ji,jj,jk) = fsavs(ji,jj,jk) + zavi              ! zwt=avt+zavi (total vertical mixing coef. on temperature) 
     206                        zwt(ji,jj,jk) = fsavs(ji,jj,jk) + zavi              ! zwt=avt+zavi (total vertical mixing coef. on salinity) 
    194207                     END DO 
    195208                  END DO 
     
    223236            END DO 
    224237            ! 
    225          END IF 
     238            ! first recurrence:   Tk = Dk - Ik Sk-1 / Tk-1   (increasing k) 
     239            DO jj = 2, jpjm1 
     240               DO ji = fs_2, fs_jpim1 
     241                  zwt(ji,jj,1) = zwd(ji,jj,1) 
     242               END DO 
     243            END DO 
     244            DO jk = 2, jpkm1 
     245               DO jj = 2, jpjm1 
     246                  DO ji = fs_2, fs_jpim1 
     247                    zwt(ji,jj,jk) = zwd(ji,jj,jk) - zwi(ji,jj,jk) * zws(ji,jj,jk-1)  /zwt(ji,jj,jk-1) 
     248                  END DO 
     249               END DO 
     250            END DO 
     251            ! 
     252         END IF  
    226253 
    227254         ! II.1. Vertical diffusion on tracer 
    228255         ! --------------------------- 
    229  
    230          !! Matrix inversion from the first level 
    231          !!---------------------------------------------------------------------- 
    232          !   solve m.x = y  where m is a tri diagonal matrix ( jpk*jpk ) 
    233          ! 
    234          !        ( zwd1 zws1   0    0    0  )( zwx1 ) ( zwy1 ) 
    235          !        ( zwi2 zwd2 zws2   0    0  )( zwx2 ) ( zwy2 ) 
    236          !        (  0   zwi3 zwd3 zws3   0  )( zwx3 )=( zwy3 ) 
    237          !        (        ...               )( ...  ) ( ...  ) 
    238          !        (  0    0    0   zwik zwdk )( zwxk ) ( zwyk ) 
    239          ! 
    240          !   m is decomposed in the product of an upper and lower triangular matrix 
    241          !   The 3 diagonal terms are in 2d arrays: zwd, zws, zwi 
    242          !   The second member is in 2d array zwy 
    243          !   The solution is in 2d array zwx 
    244          !   The 3d arry zwt is a work space array 
    245          !   zwy is used and then used as a work space array : its value is modified! 
    246           
    247          ! first recurrence:   Tk = Dk - Ik Sk-1 / Tk-1   (increasing k) 
    248          DO jj = 2, jpjm1 
    249             DO ji = fs_2, fs_jpim1 
    250                zwt(ji,jj,1) = zwd(ji,jj,1) 
    251             END DO 
    252          END DO 
    253          DO jk = 2, jpkm1 
    254             DO jj = 2, jpjm1 
    255                DO ji = fs_2, fs_jpim1 
    256                   zwt(ji,jj,jk) = zwd(ji,jj,jk) - zwi(ji,jj,jk) * zws(ji,jj,jk-1)  /zwt(ji,jj,jk-1) 
    257                END DO 
    258             END DO 
    259          END DO 
    260256          
    261257         ! second recurrence:    Zk = Yk - Ik / Tk-1  Zk-1 
Note: See TracChangeset for help on using the changeset viewer.