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 10008 for NEMO/branches/2018/dev_r9956_ENHANCE05_ZAD_AIMP/src/OCE/TRA/trazdf.F90 – NEMO

Ignore:
Timestamp:
2018-07-26T17:58:13+02:00 (6 years ago)
Author:
acc
Message:

Branch: dev_r9956_ENHANCE05_ZAD_AIMP. Fix bug in trazdf.F90 to get closer to maintaining constant salinity in a simple GYRE test with uniform salinity. Also tidy dynzdf.F90 so results are the same with wi=0 and ln_zad_Aimp=T/F. See ticket #2042

File:
1 edited

Legend:

Unmodified
Added
Removed
  • NEMO/branches/2018/dev_r9956_ENHANCE05_ZAD_AIMP/src/OCE/TRA/trazdf.F90

    r9976 r10008  
    136136      ! 
    137137      INTEGER  ::  ji, jj, jk, jn   ! dummy loop indices 
    138       REAL(wp) ::  zrhs            ! local scalars 
     138      REAL(wp) ::  zrhs, zzwi, zzws ! local scalars 
    139139      REAL(wp), DIMENSION(jpi,jpj,jpk) ::  zwi, zwt, zwd, zws 
    140140      !!--------------------------------------------------------------------- 
     
    180180               DO jk = 1, jpkm1 
    181181                  DO jj = 2, jpjm1 
    182                      DO ji = fs_2, fs_jpim1   ! vector opt. 
    183                         zwi(ji,jj,jk) = - p2dt * ( zwt(ji,jj,jk  ) / e3w_n(ji,jj,jk  )  + MIN( wi(ji,jj,jk  ) , 0._wp ) ) 
    184                         zws(ji,jj,jk) = - p2dt * ( zwt(ji,jj,jk+1) / e3w_n(ji,jj,jk+1)  - MAX( wi(ji,jj,jk+1) , 0._wp ) ) 
    185                         zwd(ji,jj,jk) = e3t_a(ji,jj,jk) - zwi(ji,jj,jk) - zws(ji,jj,jk)   & 
    186                            &                   - p2dt * ( MAX( wi(ji,jj,jk  ) , 0._wp ) - MIN( wi(ji,jj,jk+1) , 0._wp ) ) 
     182                     DO ji = fs_2, fs_jpim1   ! vector opt. (ensure same order of calculation as below if wi=0.) 
     183                        zzwi = - p2dt * zwt(ji,jj,jk  ) / e3w_n(ji,jj,jk  ) 
     184                        zzws = - p2dt * zwt(ji,jj,jk+1) / e3w_n(ji,jj,jk+1) 
     185                        zwd(ji,jj,jk) = e3t_a(ji,jj,jk) - zzwi - zzws   & 
     186                           &                 - p2dt * ( MAX( wi(ji,jj,jk  ) , 0._wp ) - MIN( wi(ji,jj,jk+1) , 0._wp ) ) 
     187                        zwi(ji,jj,jk) = zzwi - p2dt *   MIN( wi(ji,jj,jk  ) , 0._wp ) 
     188                        zws(ji,jj,jk) = zzws + p2dt *   MAX( wi(ji,jj,jk+1) , 0._wp ) 
    187189                    END DO 
    188190                  END DO 
Note: See TracChangeset for help on using the changeset viewer.