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 2068 for branches/DEV_r1837_MLF/NEMO/OPA_SRC/DYN/sshwzv.F90 – NEMO

Ignore:
Timestamp:
2010-09-06T17:56:51+02:00 (14 years ago)
Author:
mlelod
Message:

ticket: #663 ensuring restartability and conservation

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/DEV_r1837_MLF/NEMO/OPA_SRC/DYN/sshwzv.F90

    r2005 r2068  
    104104            DO jj = 1, jpjm1 
    105105               DO ji = 1, jpim1      ! NO Vector Opt. 
    106                   sshf_b(ji,jj) = 0.5  * umask(ji,jj,1) * umask(ji,jj+1,1)                   & 
    107                      &                 / ( e1f(ji,jj  ) * e2f(ji,jj  ) )                     & 
    108                      &                 * ( e1u(ji,jj  ) * e2u(ji,jj  ) * sshu_b(ji,jj  )     & 
    109                      &                   + e1u(ji,jj+1) * e2u(ji,jj+1) * sshu_b(ji,jj+1) ) 
    110                END DO 
    111             END DO 
    112             DO jj = 1, jpjm1 
    113                DO ji = 1, jpim1      ! NO Vector Opt. 
    114106                  sshf_n(ji,jj) = 0.5  * umask(ji,jj,1) * umask(ji,jj+1,1)                   & 
    115107                       &               / ( e1f(ji,jj  ) * e2f(ji,jj  ) )                     & 
     
    118110               END DO 
    119111            END DO 
    120             CALL lbc_lnk( sshf_b, 'F', 1. )   ;   CALL lbc_lnk( sshf_n, 'F', 1. ) 
     112            CALL lbc_lnk( sshf_n, 'F', 1. ) 
    121113         ENDIF 
    122114         ! 
     
    157149      !                                           !   After Sea Surface Height   ! 
    158150      !                                           !------------------------------! 
    159       z1_rau0 = 0.5 / rau0 
    160       ! 
    161151      zhdiv(:,:) = 0.e0 
    162152      DO jk = 1, jpkm1                                 ! Horizontal divergence of barotropic transports 
     
    166156      ! In forward Euler time stepping case, the same formulation as in the leap-frog case can be used 
    167157      ! because emp_b field is initialized with the vlaues of emp field. Hence, 0.5 * ( emp + emp_b ) = emp 
    168       ssha(:,:) = (  sshb(:,:) - z2dt * ( z1_rau0 * ( emp_b(:,:) + emp(:,:) ) + zhdiv(:,:) )  ) * tmask(:,:,1) 
     158      IF( neuler == 0 .AND. kt == nit000 ) THEN 
     159         z1_rau0 = 1.e0 / rau0 
     160         ssha(:,:) = (  sshb(:,:) - z2dt * ( z1_rau0 *   emp(:,:)                + zhdiv(:,:) )  ) * tmask(:,:,1) 
     161      ELSE 
     162         z1_rau0 = 0.5 / rau0 
     163         ssha(:,:) = (  sshb(:,:) - z2dt * ( z1_rau0 * ( emp_b(:,:) + emp(:,:) ) + zhdiv(:,:) )  ) * tmask(:,:,1) 
     164      ENDIF 
    169165 
    170166#if defined key_obc 
     
    194190      !                                           !----------------------------------------! 
    195191      ! Needed for Robert-Asselin time filter and for Brown & Campana semi implicit hydrostatic presure gradient 
    196       fse3t_m(:,:,:) =          fse3t_b(:,:,:)   & 
    197          &             - 2.e0 * fse3t_n(:,:,:)   & 
    198          &             +        fse3t_a(:,:,:) 
     192      DO jk = 1, jpk 
     193         fse3t_d(:,:,jk) =          fse3t_b(:,:,jk)   & 
     194            &              - 2.e0 * fse3t_n(:,:,jk)   & 
     195            &              +        fse3t_a(:,:,jk) 
     196      ENDDO 
    199197      !                                           !------------------------------! 
    200198      !                                           !     Now Vertical Velocity    ! 
     
    251249      !! 
    252250      INTEGER  ::   ji, jj   ! dummy loop indices 
    253       REAL(wp) ::   zec      ! temporary scalare 
     251      REAL(wp) ::   zec      ! temporary scalar 
    254252      !!---------------------------------------------------------------------- 
    255253 
     
    281279            CALL lbc_lnk( sshf_n, 'F', 1. ) 
    282280         ELSE                                           ! Leap-Frog time-stepping: Asselin filter + swap 
     281            zec = atfp * rdt / rau0 
    283282            DO jj = 1, jpj 
    284283               DO ji = 1, jpi                                ! before <-- now filtered 
Note: See TracChangeset for help on using the changeset viewer.