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 3211 for branches/2011/DEV_r2739_STFC_dCSE/NEMOGCM/NEMO/OPA_SRC/DIA/diaptr.F90 – NEMO

Ignore:
Timestamp:
2011-12-11T16:00:26+01:00 (13 years ago)
Author:
spickles2
Message:

Stephen Pickles, 11 Dec 2011

Commit to bring the rest of the DCSE NEMO development branch
in line with the latest development version. This includes
array index re-ordering of all OPA_SRC/.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2011/DEV_r2739_STFC_dCSE/NEMOGCM/NEMO/OPA_SRC/DIA/diaptr.F90

    r2715 r3211  
    8080   INTEGER, ALLOCATABLE, SAVE, DIMENSION(:) :: ndex_h, ndex_h_atl_30, ndex_h_pac_30, ndex_h_ind_30, ndex_h_ipc_30 
    8181 
     82   !! * Control permutation of array indices 
     83#  include "oce_ftrans.h90" 
     84#  include "dom_oce_ftrans.h90" 
     85#  include "ldftra_oce_ftrans.h90" 
     86 
    8287   !! * Substitutions 
    8388#  include "domzgr_substitute.h90" 
     
    138143      !! ** Action  : - p_fval: i-k-mean poleward flux of pva 
    139144      !!---------------------------------------------------------------------- 
    140       REAL(wp) , INTENT(in), DIMENSION(jpi,jpj,jpk) ::   pva   ! mask flux array at V-point 
     145!FTRANS pva :I :I :z 
     146!! DCSE_NEMO: work around deficiency in ftrans 
     147!     REAL(wp) , INTENT(in), DIMENSION(jpi,jpj,jpk) ::   pva   ! mask flux array at V-point 
     148      REAL(wp) , INTENT(in)    ::   pva(jpi,jpj,jpk)           ! mask flux array at V-point 
    141149      !! 
    142150      INTEGER                  ::   ji, jj, jk   ! dummy loop arguments 
     
    149157      ijpj = jpj 
    150158      p_fval(:) = 0._wp 
     159#if defined key_z_first 
     160      DO jj = 2, jpjm1 
     161         DO ji = 2, jpim1 
     162            DO jk = 1, jpkm1 
     163#else 
    151164      DO jk = 1, jpkm1 
    152165         DO jj = 2, jpjm1 
    153166            DO ji = fs_2, fs_jpim1   ! Vector opt. 
     167#endif 
    154168               p_fval(jj) = p_fval(jj) + pva(ji,jj,jk) * tmask_i(ji,jj)  
    155169            END DO 
     
    162176   END FUNCTION ptr_vj_3d 
    163177 
     178!FTRANS CLEAR 
     179   !! * Re-instate directives to control permutation of array indices 
     180#  include "oce_ftrans.h90" 
     181#  include "dom_oce_ftrans.h90" 
     182#  include "ldftra_oce_ftrans.h90" 
    164183 
    165184   FUNCTION ptr_vj_2d( pva )   RESULT ( p_fval ) 
     
    215234      !! 
    216235      IMPLICIT none 
    217       REAL(wp) , INTENT(in), DIMENSION(jpi,jpj,jpk)           ::   pva    ! mask flux array at V-point 
     236!FTRANS pva :I :I :z 
     237!! DCSE_NEMO: work around a deficiency in ftrans 
     238!     REAL(wp) , INTENT(in), DIMENSION(jpi,jpj,jpk)           ::   pva    ! mask flux array at V-point 
     239      REAL(wp) , INTENT(in)             ::   pva(jpi,jpj,jpk)             ! mask flux array at V-point 
    218240      REAL(wp) , INTENT(in), DIMENSION(jpi,jpj)    , OPTIONAL ::   pmsk   ! Optional 2D basin mask 
    219241      !! 
     
    236258 
    237259      p_fval(:,:) = 0._wp 
     260 
    238261      ! 
    239262      IF( PRESENT( pmsk ) ) THEN  
     
    270293   END FUNCTION ptr_vjk 
    271294 
     295!FTRANS CLEAR 
     296   !! * Re-instate directives to control permutation of array indices 
     297#  include "oce_ftrans.h90" 
     298#  include "dom_oce_ftrans.h90" 
     299#  include "ldftra_oce_ftrans.h90" 
    272300 
    273301   FUNCTION ptr_tjk( pta, pmsk )   RESULT ( p_fval ) 
     
    286314#endif 
    287315      !! 
    288       REAL(wp) , INTENT(in), DIMENSION(jpi,jpj,jpk) ::   pta    ! tracer flux array at T-point 
     316!FTRANS pta :I :I :z 
     317!! DCSE_NEMO: work around a deficiency in ftrans 
     318!     REAL(wp) , INTENT(in), DIMENSION(jpi,jpj,jpk) ::   pta    ! tracer flux array at T-point 
     319      REAL(wp) , INTENT(in)             :: pta(jpi,jpj,jpk)     ! tracer flux array at T-point 
    289320      REAL(wp) , INTENT(in), DIMENSION(jpi,jpj)     ::   pmsk   ! Optional 2D basin mask 
    290321      !! 
     
    307338 
    308339      p_fval(:,:) = 0._wp 
     340#if defined key_z_first 
     341      DO jj = 2, jpjm1 
     342         DO ji =  nldi, nlei 
     343            DO jk = 1, jpkm1 
     344#else 
    309345      DO jk = 1, jpkm1 
    310346         DO jj = 2, jpjm1 
    311347            DO ji =  nldi, nlei   ! No vector optimisation here. Better use a mask ? 
     348#endif 
    312349               p_fval(jj,jk) = p_fval(jj,jk) + pta(ji,jj,jk) * e1t(ji,jj) * fse3t(ji,jj,jk) * pmsk(ji,jj) 
    313350            END DO 
     
    328365   END FUNCTION ptr_tjk 
    329366 
     367!FTRANS CLEAR 
     368   !! * Re-instate directives to control permutation of array indices 
     369#  include "oce_ftrans.h90" 
     370#  include "dom_oce_ftrans.h90" 
     371#  include "ldftra_oce_ftrans.h90" 
    330372 
    331373   SUBROUTINE dia_ptr( kt ) 
     
    334376      !!---------------------------------------------------------------------- 
    335377      USE oce,     vt  =>   ua   ! use ua as workspace 
    336       USE oce,     vs  =>   ua   ! use ua as workspace 
     378!! DCSE_NEMO: see ticket 873 
     379      USE oce,     vs  =>   va   ! use va as workspace 
     380!! DCSE_NEMO: ua, va are re-named, so need additional directives 
     381!FTRANS vt vs :I :I :z 
    337382      IMPLICIT none 
    338383      !! 
     
    370415            !                                ! local heat & salt transports at T-points  ( tn*mj[vn+v_eiv] ) 
    371416            vt(:,:,jpk) = 0._wp   ;   vs(:,:,jpk) = 0._wp 
     417 
    372418            DO jk= 1, jpkm1 
    373419               DO jj = 2, jpj 
     
    434480   END SUBROUTINE dia_ptr 
    435481 
     482!FTRANS CLEAR 
     483   !! * Re-instate directives to control permutation of array indices 
     484#  include "oce_ftrans.h90" 
     485#  include "dom_oce_ftrans.h90" 
     486#  include "ldftra_oce_ftrans.h90" 
    436487 
    437488   SUBROUTINE dia_ptr_init 
     
    489540         btmsk(:,:,5) = MAX ( btmsk(:,:,3), btmsk(:,:,4) )          ! Indo-Pacific basin 
    490541         WHERE( gphit(:,:) < -30._wp)   ;   btm30(:,:) = 0._wp      ! mask out Southern Ocean 
     542#if defined key_z_first 
     543         ELSE WHERE                     ;   btm30(:,:) = tmask_1(:,:) 
     544#else 
    491545         ELSE WHERE                     ;   btm30(:,:) = tmask(:,:,1) 
     546#endif 
    492547         END WHERE 
    493548      ENDIF 
Note: See TracChangeset for help on using the changeset viewer.