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/DOM/domutl.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/DOM/domutl.F90

    r14072 r14219  
    2222 
    2323   INTERFACE is_tile 
    24       MODULE PROCEDURE is_tile_2d, is_tile_3d, is_tile_4d 
     24      MODULE PROCEDURE is_tile_2d_sp, is_tile_3d_sp, is_tile_4d_sp 
     25      MODULE PROCEDURE is_tile_2d_dp, is_tile_3d_dp, is_tile_4d_dp 
    2526   END INTERFACE is_tile 
    2627 
     
    108109      ! 
    109110      puniq(:,:) = ztstref(:,:)                    ! default definition 
    110       CALL lbc_lnk( 'domwri', puniq, cdgrd, 1. )   ! apply boundary conditions 
     111      CALL lbc_lnk( 'domwri', puniq, cdgrd, 1._wp )   ! apply boundary conditions 
    111112      lluniq(:,:,1) = puniq(:,:) == ztstref(:,:)   ! check which values have not been changed 
    112113      ! 
     
    116117 
    117118 
    118    FUNCTION is_tile_2d( pt ) 
     119   FUNCTION is_tile_2d_sp( pt ) 
    119120      !! 
    120       REAL(wp), DIMENSION(:,:), INTENT(in) ::   pt 
    121       INTEGER :: is_tile_2d 
     121      REAL(sp), DIMENSION(:,:), INTENT(in) ::   pt 
     122      INTEGER :: is_tile_2d_sp 
    122123      !! 
    123124      IF( ln_tile .AND. (SIZE(pt, 1) < jpi .OR. SIZE(pt, 2) < jpj) ) THEN 
    124          is_tile_2d = 1 
     125         is_tile_2d_sp = 1 
    125126      ELSE 
    126          is_tile_2d = 0 
     127         is_tile_2d_sp = 0 
    127128      ENDIF 
    128    END FUNCTION is_tile_2d 
     129   END FUNCTION is_tile_2d_sp 
    129130 
    130131 
    131    FUNCTION is_tile_3d( pt ) 
     132   FUNCTION is_tile_3d_sp( pt ) 
    132133      !! 
    133       REAL(wp), DIMENSION(:,:,:), INTENT(in) ::   pt 
    134       INTEGER :: is_tile_3d 
     134      REAL(sp), DIMENSION(:,:,:), INTENT(in) ::   pt 
     135      INTEGER :: is_tile_3d_sp 
    135136      !! 
    136137      IF( ln_tile .AND. (SIZE(pt, 1) < jpi .OR. SIZE(pt, 2) < jpj) ) THEN 
    137          is_tile_3d = 1 
     138         is_tile_3d_sp = 1 
    138139      ELSE 
    139          is_tile_3d = 0 
     140         is_tile_3d_sp = 0 
    140141      ENDIF 
    141    END FUNCTION is_tile_3d 
     142   END FUNCTION is_tile_3d_sp 
    142143 
    143144 
    144    FUNCTION is_tile_4d( pt ) 
     145   FUNCTION is_tile_4d_sp( pt ) 
    145146      !! 
    146       REAL(wp), DIMENSION(:,:,:,:), INTENT(in) ::   pt 
    147       INTEGER :: is_tile_4d 
     147      REAL(sp), DIMENSION(:,:,:,:), INTENT(in) ::   pt 
     148      INTEGER :: is_tile_4d_sp 
    148149      !! 
    149150      IF( ln_tile .AND. (SIZE(pt, 1) < jpi .OR. SIZE(pt, 2) < jpj) ) THEN 
    150          is_tile_4d = 1 
     151         is_tile_4d_sp = 1 
    151152      ELSE 
    152          is_tile_4d = 0 
     153         is_tile_4d_sp = 0 
    153154      ENDIF 
    154    END FUNCTION is_tile_4d 
     155   END FUNCTION is_tile_4d_sp 
     156 
     157   FUNCTION is_tile_2d_dp( pt ) 
     158      !! 
     159      REAL(dp), DIMENSION(:,:), INTENT(in) ::   pt 
     160      INTEGER :: is_tile_2d_dp 
     161      !! 
     162      IF( ln_tile .AND. (SIZE(pt, 1) < jpi .OR. SIZE(pt, 2) < jpj) ) THEN 
     163         is_tile_2d_dp = 1 
     164      ELSE 
     165         is_tile_2d_dp = 0 
     166      ENDIF 
     167   END FUNCTION is_tile_2d_dp 
     168 
     169 
     170   FUNCTION is_tile_3d_dp( pt ) 
     171      !! 
     172      REAL(dp), DIMENSION(:,:,:), INTENT(in) ::   pt 
     173      INTEGER :: is_tile_3d_dp 
     174      !! 
     175      IF( ln_tile .AND. (SIZE(pt, 1) < jpi .OR. SIZE(pt, 2) < jpj) ) THEN 
     176         is_tile_3d_dp = 1 
     177      ELSE 
     178         is_tile_3d_dp = 0 
     179      ENDIF 
     180   END FUNCTION is_tile_3d_dp 
     181 
     182 
     183   FUNCTION is_tile_4d_dp( pt ) 
     184      !! 
     185      REAL(dp), DIMENSION(:,:,:,:), INTENT(in) ::   pt 
     186      INTEGER :: is_tile_4d_dp 
     187      !! 
     188      IF( ln_tile .AND. (SIZE(pt, 1) < jpi .OR. SIZE(pt, 2) < jpj) ) THEN 
     189         is_tile_4d_dp = 1 
     190      ELSE 
     191         is_tile_4d_dp = 0 
     192      ENDIF 
     193   END FUNCTION is_tile_4d_dp 
     194 
    155195 
    156196   !!====================================================================== 
Note: See TracChangeset for help on using the changeset viewer.