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 1384 – NEMO

Changeset 1384


Ignore:
Timestamp:
2009-04-06T15:53:51+02:00 (15 years ago)
Author:
rblod
Message:

Update sshnxt for fixed volume case, to avoid useless computation

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/dev_004_VVL/NEMO/OPA_SRC/DYN/wzvmod.F90

    r1382 r1384  
    200200      ! ------------------------------- 
    201201 
    202  
    203      IF( neuler == 0 .AND. kt == nit000 ) THEN   ! Euler time stepping 
    204          DO jj = 1, jpj 
    205             DO ji = 1, jpi 
    206                ! before <-- now 
    207                sshb  (ji,jj) = sshn(ji,jj)  
    208                sshu_b(ji,jj) = sshu_n(ji,jj)  
    209                sshv_b(ji,jj) = sshv_n(ji,jj) 
    210                sshf_b(ji,jj) = sshf_n(ji,jj) 
    211                ! now <-- after 
    212                sshn  (ji,jj) = ssha  (ji,jj) 
    213                sshu_n(ji,jj) = sshu_a(ji,jj) 
    214                sshv_n(ji,jj) = sshv_a(ji,jj) 
    215                sshf_n(ji,jj) = sshf_a(ji,jj) 
     202      IF( lk_vvl ) THEN      ! Variable volume levels :   ssh at t-, u-, v, f-points 
     203         !                   ! ---------------------- ! 
     204         IF( neuler == 0 .AND. kt == nit000 ) THEN      ! Euler time-stepping at first time-step : no filter 
     205            sshn  (:,:) = ssha  (:,:)                        ! now <-- after  (before already = now) 
     206            sshu_n(:,:) = sshu_a(:,:) 
     207            sshv_n(:,:) = sshv_a(:,:) 
     208            sshf_n(:,:) = sshf_a(:,:) 
     209         ELSE                                           ! Leap-Frog time-stepping: Asselin filter + swap 
     210            DO jj = 1, jpj 
     211               DO ji = 1, jpi                                ! before <-- now filtered 
     212                  sshb  (ji,jj) = sshn(ji,jj)   + atfp * ( sshb  (ji,jj) - 2 * sshn  (ji,jj) + ssha  (ji,jj) ) 
     213                  sshu_b(ji,jj) = sshu_n(ji,jj) + atfp * ( sshu_b(ji,jj) - 2 * sshu_n(ji,jj) + sshu_a(ji,jj) ) 
     214                  sshv_b(ji,jj) = sshv_n(ji,jj) + atfp * ( sshv_b(ji,jj) - 2 * sshv_n(ji,jj) + sshv_a(ji,jj) ) 
     215                  sshf_b(ji,jj) = sshf_n(ji,jj) + atfp * ( sshf_b(ji,jj) - 2 * sshf_n(ji,jj) + sshf_a(ji,jj) ) 
     216                  sshn  (ji,jj) = ssha  (ji,jj)              ! now <-- after 
     217                  sshu_n(ji,jj) = sshu_a(ji,jj) 
     218                  sshv_n(ji,jj) = sshv_a(ji,jj) 
     219                  sshf_n(ji,jj) = sshf_a(ji,jj) 
     220               END DO 
    216221            END DO 
    217          END DO 
    218      ELSE                                         ! Leap-frog time stepping 
    219          DO jj = 1, jpj 
    220             DO ji = 1, jpi 
    221                ! before <-- now filtered 
    222                sshb  (ji,jj) = sshn(ji,jj)   + atfp * ( sshb  (ji,jj) - 2 * sshn  (ji,jj) + ssha  (ji,jj) )    !& 
    223                sshu_b(ji,jj) = sshu_n(ji,jj) + atfp * ( sshu_b(ji,jj) - 2 * sshu_n(ji,jj) + sshu_a(ji,jj) )    !& 
    224                sshv_b(ji,jj) = sshv_n(ji,jj) + atfp * ( sshv_b(ji,jj) - 2 * sshv_n(ji,jj) + sshv_a(ji,jj) )    !& 
    225                sshf_b(ji,jj) = sshf_n(ji,jj) + atfp * ( sshf_b(ji,jj) - 2 * sshf_n(ji,jj) + sshf_a(ji,jj) )    !& 
    226                ! now <-- after 
    227                sshn  (ji,jj) = ssha  (ji,jj) 
    228                sshu_n(ji,jj) = sshu_a(ji,jj) 
    229                sshv_n(ji,jj) = sshv_a(ji,jj) 
    230                sshf_n(ji,jj) = sshf_a(ji,jj) 
     222         ENDIF 
     223         ! 
     224      ELSE                   ! fixed levels :   ssh at t-point only 
     225         !                   ! ------------ ! 
     226         IF( neuler == 0 .AND. kt == nit000 ) THEN      ! Euler time-stepping at first time-step : no filter 
     227            sshn(:,:) = ssha(:,:)                            ! now <-- after  (before already = now) 
     228            ! 
     229         ELSE                                           ! Leap-Frog time-stepping: Asselin filter + swap 
     230            DO jj = 1, jpj 
     231               DO ji = 1, jpi                                ! before <-- now filtered 
     232                  sshb(ji,jj) = sshn(ji,jj) + atfp * ( sshb(ji,jj) - 2 * sshn(ji,jj) + ssha(ji,jj) )     
     233                  sshn(ji,jj) = ssha(ji,jj)                  ! now <-- after 
     234               END DO 
    231235            END DO 
    232          END DO 
    233       ENDIF 
     236         ENDIF 
     237         ! 
     238      ENDIF 
     239 
    234240 
    235241      IF(ln_ctl)   CALL prt_ctl(tab2d_1=sshb    , clinfo1=' sshb  - : ', mask1=tmask, ovlap=1 ) 
Note: See TracChangeset for help on using the changeset viewer.