Changeset 7884


Ignore:
Timestamp:
2017-04-10T13:22:46+02:00 (3 years ago)
Author:
glong
Message:

Merged key_dynspg_ts check with dia_vrt_zdf checks to remove duplicate code

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/UKMO/GO6_dyn_vrt_diag/NEMOGCM/NEMO/OPA_SRC/DYN/dynzdf_imp.F90

    r7875 r7884  
    262262      END DO 
    263263 
    264 #if ! defined key_dynspg_ts 
    265264      ! Normalization to obtain the general momentum trend ua 
    266       DO jk = 1, jpkm1 
    267          DO jj = 2, jpjm1    
    268             DO ji = fs_2, fs_jpim1   ! vector opt. 
    269                ua(ji,jj,jk) = ( ua(ji,jj,jk) - ub(ji,jj,jk) ) * z1_p2dt 
    270             END DO 
    271          END DO 
    272       END DO 
    273 #endif 
    274  
    275       ! TODO merge with above if possible 
    276       ! Calculate the values in preparation to calculate dia_vor_int & dia_vor_mn if required 
    277       IF ( ( id_dia_vrt_zdf_int == 1 ) .or. ( id_dia_vrt_zdf_mean == 1 ) ) THEN 
     265      IF ( ( .NOT. lk_dynspg_ts ) .OR.  
     266              ( ( id_dia_vrt_zdf_int == 1 ) .OR. ( id_dia_vrt_zdf_mean == 1 ) ) ) THEN 
    278267          DO jk = 1, jpkm1 
    279268             DO jj = 2, jpjm1    
     
    283272             END DO 
    284273          END DO 
     274          IF ( .NOT. lk_dynspg_ts ) THEN 
     275             ua(:,:,:) = zua(:,:,:) 
     276          END IF 
    285277      END IF 
    286278 
     
    376368 
    377369      ! Normalization to obtain the general momentum trend va 
    378 #if ! defined key_dynspg_ts 
    379       DO jk = 1, jpkm1 
    380          DO jj = 2, jpjm1    
    381             DO ji = fs_2, fs_jpim1   ! vector opt. 
    382                va(ji,jj,jk) = ( va(ji,jj,jk) - vb(ji,jj,jk) ) * z1_p2dt 
    383             END DO 
    384          END DO 
    385       END DO 
    386 #endif 
    387  
    388       ! TODO merge with above if possible 
    389       ! Calculate dia_vor_int & dia_vor_mn if required 
    390       IF ( ( id_dia_vrt_zdf_int == 1 ) .or. ( id_dia_vrt_zdf_mean == 1 ) ) THEN 
     370      IF ( ( .NOT lk_dynspg_ts ) .OR. 
     371           ( ( id_dia_vrt_zdf_int == 1 ) .OR. ( id_dia_vrt_zdf_mean == 1 ) ) ) THEN 
    391372          DO jk = 1, jpkm1 
    392373             DO jj = 2, jpjm1    
     
    396377             END DO 
    397378          END DO 
    398  
    399           CALL dyn_vrt_dia_3d(zua, zva, id_dia_vrt_zdf_int, id_dia_vrt_zdf_mean) 
     379          IF ( ( id_dia_vrt_zdf_int == 1 ) .OR. (id_dia_vrt_zdf_mean == 1) ) THEN 
     380              CALL dyn_vrt_dia_3d(zua, zva, id_dia_vrt_zdf_int, id_dia_vrt_zdf_mean) 
     381          END IF 
     382          IF ( .NOT lk_dynspg_ts ) THEN 
     383             va(:,:,:) = zva(:,:,:) 
     384          END IF 
    400385      END IF 
    401386 
Note: See TracChangeset for help on using the changeset viewer.