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/DYN/dynspg_ts.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/DYN/dynspg_ts.F90

    r14064 r14219  
    7575   REAL(wp),SAVE :: rDt_e       ! Barotropic time step 
    7676   ! 
    77    REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:)   ::   wgtbtp1, wgtbtp2   ! 1st & 2nd weights used in time filtering of barotropic fields 
     77   REAL(dp), ALLOCATABLE, SAVE, DIMENSION(:)   :: wgtbtp1   ! 1st  
     78   REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:)   :: wgtbtp2   ! & 2nd weights used in time filtering of barotropic fields 
    7879   REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:) ::   zwz                ! ff_f/h at F points 
    7980   REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:) ::   ftnw, ftne         ! triad of coriolis parameter 
     
    8889#  include "do_loop_substitute.h90" 
    8990#  include "domzgr_substitute.h90" 
     91#  include "single_precision_substitute.h90" 
    9092   !!---------------------------------------------------------------------- 
    9193   !! NEMO/OCE 4.0 , NEMO Consortium (2018) 
     
    144146      INTEGER                             , INTENT( in )  ::  kt                  ! ocean time-step index 
    145147      INTEGER                             , INTENT( in )  ::  Kbb, Kmm, Krhs, Kaa ! ocean time level indices 
    146       REAL(wp), DIMENSION(jpi,jpj,jpk,jpt), INTENT(inout) ::  puu, pvv            ! ocean velocities and RHS of momentum equation 
    147       REAL(wp), DIMENSION(jpi,jpj,jpt)    , INTENT(inout) ::  pssh, puu_b, pvv_b  ! SSH and barotropic velocities at main time levels 
     148      REAL(dp), DIMENSION(jpi,jpj,jpk,jpt), INTENT(inout) ::  puu, pvv            ! ocean velocities and RHS of momentum equation 
     149      REAL(dp), DIMENSION(jpi,jpj,jpt)    , INTENT(inout) ::  pssh                 ! SSH 
     150      REAL(wp), DIMENSION(jpi,jpj,jpt)    , INTENT(inout) ::  puu_b, pvv_b         ! barotropic velocities at main time levels 
    148151      ! 
    149152      INTEGER  ::   ji, jj, jk, jn        ! dummy loop indices 
     
    152155      INTEGER  ::   noffset               ! local integers  : time offset for bdy update 
    153156      REAL(wp) ::   r1_Dt_b, z1_hu, z1_hv          ! local scalars 
    154       REAL(wp) ::   za0, za1, za2, za3              !   -      - 
     157      REAL(dp)  :: za1 
     158      REAL(wp) ::   za0, za2, za3              !   -      - 
    155159      REAL(wp) ::   zztmp, zldg               !   -      - 
    156       REAL(wp) ::   zhu_bck, zhv_bck, zhdiv         !   -      - 
     160      REAL(dp)  :: zhdiv 
     161      REAL(wp) ::   zhu_bck, zhv_bck         !   -      - 
    157162      REAL(wp) ::   zun_save, zvn_save              !   -      - 
    158       REAL(wp), DIMENSION(jpi,jpj) :: zu_trd, zu_frc, zu_spg, zssh_frc 
     163      REAL(dp), DIMENSION(jpi,jpj)  :: zssh_frc 
     164      REAL(wp), DIMENSION(jpi,jpj) :: zu_trd, zu_frc, zu_spg 
    159165      REAL(wp), DIMENSION(jpi,jpj) :: zv_trd, zv_frc, zv_spg 
    160166      REAL(wp), DIMENSION(jpi,jpj) :: zsshu_a, zhup2_e, zhtp2_e 
     
    274280      !                                   !=  Add bottom stress contribution from baroclinic velocities  =! 
    275281      !                                   !  -----------------------------------------------------------  ! 
    276       CALL dyn_drg_init( Kbb, Kmm, puu, pvv, puu_b ,pvv_b, zu_frc, zv_frc,  zCdU_u, zCdU_v )      ! also provide the barotropic drag coefficients 
     282      CALL dyn_drg_init( Kbb, Kmm, CASTWP(puu), CASTWP(pvv), puu_b ,pvv_b, zu_frc, zv_frc,  zCdU_u, zCdU_v )      ! also provide the barotropic drag coefficients 
    277283      ! 
    278284      !                                   !=  Add atmospheric pressure forcing  =! 
     
    520526         END_2D 
    521527         ! 
     528#if defined key_single 
     529         CALL lbc_lnk      ( 'dynspg_ts', ssha_e, 'T', 1._wp ) 
     530         CALL lbc_lnk_multi( 'dynspg_ts', zhU, 'U', -1._wp,  zhV, 'V', -1._wp ) 
     531#else 
    522532         CALL lbc_lnk_multi( 'dynspg_ts', ssha_e, 'T', 1._wp,  zhU, 'U', -1._wp,  zhV, 'V', -1._wp ) 
     533#endif 
    523534         ! 
    524535         ! Duplicate sea level across open boundaries (this is only cosmetic if linssh=T) 
     
    680691         ENDIF 
    681692         !                                                 ! open boundaries 
    682          IF( ln_bdy )   CALL bdy_dyn2d( jn, ua_e, va_e, un_e, vn_e, hur_e, hvr_e, ssha_e ) 
     693         IF( ln_bdy )   CALL bdy_dyn2d( jn, ua_e, va_e, un_e, vn_e, hur_e, hvr_e, CASTWP(ssha_e) ) 
    683694#if defined key_agrif                                                            
    684695         IF( .NOT.Agrif_Root() )  CALL agrif_dyn_ts( jn )  ! Agrif 
     
    840851      LOGICAL, INTENT(in) ::   ll_fw      ! forward time splitting =.true. 
    841852      INTEGER, INTENT(inout) :: jpit      ! cycle length     
    842       REAL(wp), DIMENSION(3*nn_e), INTENT(inout) ::   zwgt1, & ! Primary weights 
    843                                                          zwgt2    ! Secondary weights 
     853      REAL(dp), DIMENSION(3*nn_e), INTENT(inout) ::   zwgt1    ! Primary weights 
     854      REAL(wp), DIMENSION(3*nn_e), INTENT(inout) ::   zwgt2    ! Secondary weights 
    844855       
    845856      INTEGER ::  jic, jn, ji                      ! temporary integers 
    846       REAL(wp) :: za1, za2 
     857      REAL(dp)  :: za1 
     858      REAL(wp) :: za2 
    847859      !!---------------------------------------------------------------------- 
    848860 
     
    14411453      INTEGER ,INTENT(in   ) ::   jn                   ! index of sub time step 
    14421454      LOGICAL ,INTENT(in   ) ::   ll_init              ! 
    1443       REAL(wp),INTENT(  out) ::   za0, za1, za2, za3   ! Half-step back interpolation coefficient 
     1455      REAL(dp),INTENT(  out)  :: za1 
     1456      REAL(wp),INTENT(  out) ::   za0, za2, za3   ! Half-step back interpolation coefficient 
    14441457      ! 
    14451458      REAL(wp) ::   zepsilon, zgamma                   !   -      - 
Note: See TracChangeset for help on using the changeset viewer.