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 14219 for NEMO/branches/2020/dev_r14116_HPC-04_mcastril_Mixed_Precision_implementation_final/src/OCE/TRD/trdtra.F90 – NEMO

Ignore:
Timestamp:
2020-12-18T18:52:57+01:00 (4 years ago)
Author:
mcastril
Message:

Add Mixed Precision support by Oriol Tintó

File:
1 edited

Legend:

Unmodified
Added
Removed
  • NEMO/branches/2020/dev_r14116_HPC-04_mcastril_Mixed_Precision_implementation_final/src/OCE/TRD/trdtra.F90

    r14200 r14219  
    3737   PUBLIC   trd_tra   ! called by all tra_... modules 
    3838 
    39    REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:,:) ::   trdtx, trdty, trdt   ! use to store the temperature trends 
     39   REAL(dp), ALLOCATABLE, SAVE, DIMENSION(:,:,:) ::   trdtx, trdty, trdt   ! use to store the temperature trends 
    4040   REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:,:) ::   avt_evd  ! store avt_evd to calculate EVD trend 
    4141 
     
    4343#  include "do_loop_substitute.h90" 
    4444#  include "domzgr_substitute.h90" 
     45#  include "single_precision_substitute.h90" 
    4546   !!---------------------------------------------------------------------- 
    4647   !! NEMO/OCE 4.0 , NEMO Consortium (2018) 
     
    8586      INTEGER ::   jk    ! loop indices 
    8687      INTEGER ::   i01   ! 0 or 1 
    87       REAL(wp),        DIMENSION(jpi,jpj,jpk) ::   ztrds             ! 3D workspace 
    88       REAL(wp), ALLOCATABLE, DIMENSION(:,:,:) ::   zwt, zws, ztrdt   ! 3D workspace 
     88      REAL(dp),        DIMENSION(jpi,jpj,jpk) ::   ztrds             ! 3D workspace 
     89      REAL(dp), ALLOCATABLE, DIMENSION(:,:,:)  :: ztrdt 
     90      REAL(wp), ALLOCATABLE, DIMENSION(:,:,:) ::   zwt, zws   ! 3D workspace 
    8991      !!---------------------------------------------------------------------- 
    9092      !       
     
    204206      REAL(wp), DIMENSION(jpi,jpj,jpk), INTENT(in   ) ::   pt      ! now or before tracer  
    205207      CHARACTER(len=1)                , INTENT(in   ) ::   cdir    ! X/Y/Z direction 
    206       REAL(wp), DIMENSION(jpi,jpj,jpk), INTENT(  out) ::   ptrd    ! advective trend in one direction 
     208      REAL(dp), DIMENSION(jpi,jpj,jpk), INTENT(  out) ::   ptrd    ! advective trend in one direction 
    207209      INTEGER,  INTENT(in)                            ::   Kmm     ! time level index 
    208210      ! 
     
    239241      !!                mixed layer budget. 
    240242      !!---------------------------------------------------------------------- 
    241       REAL(wp), DIMENSION(:,:,:), INTENT(inout) ::   ptrdx   ! Temperature or U trend  
    242       REAL(wp), DIMENSION(:,:,:), INTENT(inout) ::   ptrdy   ! Salinity    or V trend 
     243      REAL(dp), DIMENSION(:,:,:), INTENT(inout) ::   ptrdx   ! Temperature or U trend  
     244      REAL(dp), DIMENSION(:,:,:), INTENT(inout) ::   ptrdy   ! Salinity    or V trend 
    243245      INTEGER                   , INTENT(in   ) ::   ktrd    ! tracer trend index 
    244246      INTEGER                   , INTENT(in   ) ::   kt      ! time step 
     
    253255 
    254256      !                   ! Potential ENergy trends 
    255       IF( ln_PE_trd  )   CALL trd_pen( ptrdx, ptrdy, ktrd, kt, rDt, Kmm ) 
     257      IF( ln_PE_trd  )   CALL trd_pen( CASTWP(ptrdx), CASTWP(ptrdy), ktrd, kt, rDt, Kmm ) 
    256258 
    257259      !                   ! Mixed layer trends for active tracers 
     
    269271 
    270272         SELECT CASE ( ktrd ) 
    271          CASE ( jptra_xad )        ;   CALL trd_mxl_zint( ptrdx, ptrdy, jpmxl_xad, '3D' )   ! zonal    advection 
    272          CASE ( jptra_yad )        ;   CALL trd_mxl_zint( ptrdx, ptrdy, jpmxl_yad, '3D' )   ! merid.   advection 
    273          CASE ( jptra_zad )        ;   CALL trd_mxl_zint( ptrdx, ptrdy, jpmxl_zad, '3D' )   ! vertical advection 
    274          CASE ( jptra_ldf )        ;   CALL trd_mxl_zint( ptrdx, ptrdy, jpmxl_ldf, '3D' )   ! lateral  diffusion 
    275          CASE ( jptra_bbl )        ;   CALL trd_mxl_zint( ptrdx, ptrdy, jpmxl_bbl, '3D' )   ! bottom boundary layer 
     273         CASE ( jptra_xad )        ;   CALL trd_mxl_zint( CASTWP(ptrdx), CASTWP(ptrdy), jpmxl_xad, '3D' ) 
     274         CASE ( jptra_yad )        ;   CALL trd_mxl_zint( CASTWP(ptrdx), CASTWP(ptrdy), jpmxl_yad, '3D' ) 
     275         CASE ( jptra_zad )        ;   CALL trd_mxl_zint( CASTWP(ptrdx), CASTWP(ptrdy), jpmxl_zad, '3D' ) 
     276         CASE ( jptra_ldf )        ;   CALL trd_mxl_zint( CASTWP(ptrdx), CASTWP(ptrdy), jpmxl_ldf, '3D' ) 
     277         CASE ( jptra_bbl )        ;   CALL trd_mxl_zint( CASTWP(ptrdx), CASTWP(ptrdy), jpmxl_bbl, '3D' ) 
    276278         CASE ( jptra_zdf ) 
    277             IF( ln_traldf_iso ) THEN ; CALL trd_mxl_zint( ptrdx, ptrdy, jpmxl_ldf, '3D' )   ! lateral  diffusion (K_z) 
    278             ELSE                   ;   CALL trd_mxl_zint( ptrdx, ptrdy, jpmxl_zdf, '3D' )   ! vertical diffusion (K_z) 
     279            IF( ln_traldf_iso ) THEN ; CALL trd_mxl_zint( CASTWP(ptrdx), CASTWP(ptrdy), jpmxl_ldf, '3D' ) 
     280            ELSE                   ;   CALL trd_mxl_zint( CASTWP(ptrdx), CASTWP(ptrdy), jpmxl_zdf, '3D' ) 
    279281            ENDIF 
    280          CASE ( jptra_dmp )        ;   CALL trd_mxl_zint( ptrdx, ptrdy, jpmxl_dmp, '3D' )   ! internal 3D restoring (tradmp) 
    281          CASE ( jptra_qsr )        ;   CALL trd_mxl_zint( ptrdx, ptrdy, jpmxl_for, '3D' )   ! air-sea : penetrative sol radiat 
     282         CASE ( jptra_dmp )        ;   CALL trd_mxl_zint( CASTWP(ptrdx), CASTWP(ptrdy), jpmxl_dmp, '3D' ) 
     283         CASE ( jptra_qsr )        ;   CALL trd_mxl_zint( CASTWP(ptrdx), CASTWP(ptrdy), jpmxl_for, '3D' ) 
    282284         CASE ( jptra_nsr )        ;   ptrdx(:,:,2:jpk) = 0._wp   ;   ptrdy(:,:,2:jpk) = 0._wp 
    283                                        CALL trd_mxl_zint( ptrdx, ptrdy, jpmxl_for, '2D' )   ! air-sea : non penetr sol radiation 
    284          CASE ( jptra_bbc )        ;   CALL trd_mxl_zint( ptrdx, ptrdy, jpmxl_bbc, '3D' )   ! bottom bound cond (geoth flux) 
    285          CASE ( jptra_npc )        ;   CALL trd_mxl_zint( ptrdx, ptrdy, jpmxl_npc, '3D' )   ! non penetr convect adjustment 
    286          CASE ( jptra_atf )        ;   CALL trd_mxl_zint( ptrdx, ptrdy, jpmxl_atf, '3D' )   ! asselin time filter (last trend) 
     285                                       CALL trd_mxl_zint( CASTWP(ptrdx), CASTWP(ptrdy), jpmxl_for, '2D' ) 
     286         CASE ( jptra_bbc )        ;   CALL trd_mxl_zint( CASTWP(ptrdx), CASTWP(ptrdy), jpmxl_bbc, '3D' ) 
     287         CASE ( jptra_npc )        ;   CALL trd_mxl_zint( CASTWP(ptrdx), CASTWP(ptrdy), jpmxl_npc, '3D' ) 
     288         CASE ( jptra_atf )        ;   CALL trd_mxl_zint( CASTWP(ptrdx), CASTWP(ptrdy), jpmxl_atf, '3D' ) 
    287289                                   ! 
    288290                                       CALL trd_mxl( kt, rDt )                             ! trends: Mixed-layer (output) 
     
    300302      !! ** Purpose :   output 3D tracer trends using IOM 
    301303      !!---------------------------------------------------------------------- 
    302       REAL(wp), DIMENSION(:,:,:), INTENT(inout) ::   ptrdx   ! Temperature or U trend  
    303       REAL(wp), DIMENSION(:,:,:), INTENT(inout) ::   ptrdy   ! Salinity    or V trend 
     304      REAL(dp), DIMENSION(:,:,:), INTENT(inout) ::   ptrdx   ! Temperature or U trend  
     305      REAL(dp), DIMENSION(:,:,:), INTENT(inout) ::   ptrdy   ! Salinity    or V trend 
    304306      INTEGER                   , INTENT(in   ) ::   ktrd    ! tracer trend index 
    305307      INTEGER                   , INTENT(in   ) ::   kt      ! time step 
Note: See TracChangeset for help on using the changeset viewer.