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 788 for trunk/NEMO – NEMO

Changeset 788 for trunk/NEMO


Ignore:
Timestamp:
2008-01-11T17:38:14+01:00 (16 years ago)
Author:
rblod
Message:

Change averaging method in dynspg_ts, see ticket #48

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/NEMO/OPA_SRC/DYN/dynspg_ts.F90

    r746 r788  
    77   !!             " "  !  05-11  (V. Garnier, G. Madec)  optimization 
    88   !!             9.0  !  06-08  (S. Masson)  distributed restart using iom 
     9   !!             9.0  !  08-01  (R. Benshila)  change averaging method 
    910   !!--------------------------------------------------------------------- 
    1011#if defined key_dynspg_ts   ||   defined key_esopa 
     
    9293      !! * Local declarations 
    9394      INTEGER  ::  ji, jj, jk, jit             ! dummy loop indices 
    94       INTEGER  ::  icycle                      ! temporary scalar 
     95      INTEGER  ::  icycle, ibaro               ! temporary scalar 
    9596      REAL(wp) ::                           & 
    9697         zraur, zcoef, z2dt_e, z2dt_b, zfac25,   &  ! temporary scalars 
     
    295296      !---------------- 
    296297      ! Number of iteration of the barotropic loop 
    297       icycle = FLOOR( z2dt_b / rdtbt ) 
     298      ibaro = FLOOR( rdt / rdtbt ) 
     299      icycle = 3 /2 * ibaro  
    298300 
    299301      ! variables for the barotropic equations 
     
    304306      zun_e  (:,:) = un_b  (:,:) 
    305307      zvn_e  (:,:) = vn_b  (:,:) 
    306       zssha_b(:,:) = sshn  (:,:)       ! time averaged variables over all sub-timesteps 
    307       zua_b  (:,:) = un_b  (:,:)    
    308       zva_b  (:,:) = vn_b  (:,:) 
     308      zssha_b(:,:) = 0.e0 
     309      zua_b  (:,:) = 0.e0 
     310      zva_b  (:,:) = 0.e0 
    309311      IF( lk_vvl ) THEN 
    310312         zsshun_e(:,:)    = sshu (:,:)     ! (barotropic) sea surface height (now) at u-point 
     
    464466         ! temporal sum 
    465467         !------------- 
    466          zssha_b(:,:) = zssha_b(:,:) + ssha_e(:,:) 
    467          zua_b  (:,:) = zua_b  (:,:) + ua_e  (:,:) 
    468          zva_b  (:,:) = zva_b  (:,:) + va_e  (:,:)  
     468         IF( jit >= ibaro/2 ) THEN 
     469            zssha_b(:,:) = zssha_b(:,:) + ssha_e(:,:) 
     470            zua_b  (:,:) = zua_b  (:,:) + ua_e  (:,:) 
     471            zva_b  (:,:) = zva_b  (:,:) + va_e  (:,:)  
     472         ENDIF 
    469473 
    470474         ! Time filter and swap of dynamics arrays 
     
    530534 
    531535      ! Time average of after barotropic variables 
    532       zcoef =  1.e0 / (  FLOAT( icycle +1 ) ) 
     536      zcoef =  1.e0 / ( ibaro + 1 ) 
    533537      zssha_b(:,:) = zcoef * zssha_b(:,:)  
    534538      zua_b  (:,:) = zcoef *  zua_b (:,:)  
Note: See TracChangeset for help on using the changeset viewer.