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/CRS/crsini.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/CRS/crsini.F90

    r13237 r14219  
    3030   !! * Substitutions 
    3131#  include "domzgr_substitute.h90" 
     32#  include "single_precision_substitute.h90" 
    3233   !!---------------------------------------------------------------------- 
    3334   !! NEMO/OCE 4.0 , NEMO Consortium (2018) 
     
    127128     !       
    128129     IF ( nresty /= 0 .AND. nrestx /= 0 ) THEN 
    129         CALL crs_dom_coordinates( gphit, glamt, 'T', gphit_crs, glamt_crs )  
     130        CALL crs_dom_coordinates( CASTWP(gphit), CASTWP(glamt), 'T', gphit_crs, glamt_crs )  
    130131        CALL crs_dom_coordinates( gphiu, glamu, 'U', gphiu_crs, glamu_crs )        
    131132        CALL crs_dom_coordinates( gphiv, glamv, 'V', gphiv_crs, glamv_crs )  
    132         CALL crs_dom_coordinates( gphif, glamf, 'F', gphif_crs, glamf_crs )  
     133        CALL crs_dom_coordinates( CASTWP(gphif), CASTWP(glamf), 'F', gphif_crs, glamf_crs )  
    133134     ELSEIF ( nresty /= 0 .AND. nrestx == 0 ) THEN 
    134135        CALL crs_dom_coordinates( gphiu, glamu, 'T', gphit_crs, glamt_crs ) 
    135136        CALL crs_dom_coordinates( gphiu, glamu, 'U', gphiu_crs, glamu_crs ) 
    136         CALL crs_dom_coordinates( gphif, glamf, 'V', gphiv_crs, glamv_crs ) 
    137         CALL crs_dom_coordinates( gphif, glamf, 'F', gphif_crs, glamf_crs ) 
     137        CALL crs_dom_coordinates( CASTWP(gphif), CASTWP(glamf), 'V', gphiv_crs, glamv_crs ) 
     138        CALL crs_dom_coordinates( CASTWP(gphif), CASTWP(glamf), 'F', gphif_crs, glamf_crs ) 
    138139     ELSEIF ( nresty == 0 .AND. nrestx /= 0 ) THEN 
    139140        CALL crs_dom_coordinates( gphiv, glamv, 'T', gphit_crs, glamt_crs ) 
    140         CALL crs_dom_coordinates( gphif, glamf, 'U', gphiu_crs, glamu_crs ) 
     141        CALL crs_dom_coordinates( CASTWP(gphif), CASTWP(glamf), 'U', gphiu_crs, glamu_crs ) 
    141142        CALL crs_dom_coordinates( gphiv, glamv, 'V', gphiv_crs, glamv_crs ) 
    142         CALL crs_dom_coordinates( gphif, glamf, 'F', gphif_crs, glamf_crs ) 
     143        CALL crs_dom_coordinates( CASTWP(gphif), CASTWP(glamf), 'F', gphif_crs, glamf_crs ) 
    143144     ELSE  
    144         CALL crs_dom_coordinates( gphif, glamf, 'T', gphit_crs, glamt_crs ) 
    145         CALL crs_dom_coordinates( gphif, glamf, 'U', gphiu_crs, glamu_crs ) 
    146         CALL crs_dom_coordinates( gphif, glamf, 'V', gphiv_crs, glamv_crs ) 
    147         CALL crs_dom_coordinates( gphif, glamf, 'F', gphif_crs, glamf_crs ) 
     145        CALL crs_dom_coordinates(CASTWP(gphif),CASTWP(glamf), 'T', gphit_crs, glamt_crs ) 
     146        CALL crs_dom_coordinates(CASTWP(gphif),CASTWP(glamf), 'U', gphiu_crs, glamu_crs ) 
     147        CALL crs_dom_coordinates(CASTWP(gphif),CASTWP(glamf), 'V', gphiv_crs, glamv_crs ) 
     148        CALL crs_dom_coordinates(CASTWP(gphif),CASTWP(glamf), 'F', gphif_crs, glamf_crs ) 
    148149     ENDIF 
    149150 
     
    153154     !      3.c.1 Horizontal scale factors 
    154155 
    155      CALL crs_dom_hgr( e1t, e2t, 'T', e1t_crs, e2t_crs ) 
    156      CALL crs_dom_hgr( e1u, e2u, 'U', e1u_crs, e2u_crs ) 
    157      CALL crs_dom_hgr( e1v, e2v, 'V', e1v_crs, e2v_crs ) 
    158      CALL crs_dom_hgr( e1f, e2f, 'F', e1f_crs, e2f_crs ) 
     156     CALL crs_dom_hgr( CASTWP(e1t), CASTWP(e2t), 'T', e1t_crs, e2t_crs ) 
     157     CALL crs_dom_hgr( CASTWP(e1u), e2u, 'U', e1u_crs, e2u_crs ) 
     158     CALL crs_dom_hgr( e1v, CASTWP(e2v), 'V', e1v_crs, e2v_crs ) 
     159     CALL crs_dom_hgr( CASTWP(e1f), CASTWP(e2f), 'F', e1f_crs, e2f_crs ) 
    159160 
    160161     e1e2t_crs(:,:) = e1t_crs(:,:) * e2t_crs(:,:) 
     
    184185 
    185186     !    3.d.2   Surfaces  
    186      CALL crs_dom_sfc( tmask, 'W', e1e2w_crs, e1e2w_msk, p_e1=e1t, p_e2=e2t  ) 
     187     CALL crs_dom_sfc( tmask, 'W', e1e2w_crs, e1e2w_msk, p_e1=CASTWP(e1t), p_e2=CASTWP(e2t)  ) 
    187188     CALL crs_dom_sfc( umask, 'U', e2e3u_crs, e2e3u_msk, p_e2=e2u, p_e3=ze3u ) 
    188189     CALL crs_dom_sfc( vmask, 'V', e1e3v_crs, e1e3v_msk, p_e1=e1v, p_e3=ze3v ) 
     
    193194     !    3.d.3   Vertical scale factors 
    194195     ! 
    195      CALL crs_dom_e3( e1t, e2t, ze3t, e1e2w_crs, 'T', tmask, e3t_crs, e3t_max_crs) 
    196      CALL crs_dom_e3( e1u, e2u, ze3u, e2e3u_crs, 'U', umask, e3u_crs, e3u_max_crs) 
    197      CALL crs_dom_e3( e1v, e2v, ze3v, e1e3v_crs, 'V', vmask, e3v_crs, e3v_max_crs) 
    198      CALL crs_dom_e3( e1t, e2t, ze3w, e1e2w_crs, 'W', tmask, e3w_crs, e3w_max_crs) 
     196     CALL crs_dom_e3( CASTWP(e1t), CASTWP(e2t), ze3t, e1e2w_crs, 'T', tmask, e3t_crs, e3t_max_crs) 
     197     CALL crs_dom_e3( CASTWP(e1u), e2u, ze3u, e2e3u_crs, 'U', umask, e3u_crs, e3u_max_crs) 
     198     CALL crs_dom_e3( e1v, CASTWP(e2v), ze3v, e1e3v_crs, 'V', vmask, e3v_crs, e3v_max_crs) 
     199     CALL crs_dom_e3( CASTWP(e1t), CASTWP(e2t), ze3w, e1e2w_crs, 'W', tmask, e3w_crs, e3w_max_crs) 
    199200 
    200201     ! Replace 0 by e3t_0 or e3w_0 
     
    219220     !--------------------------------------------------------- 
    220221     ! 4.a. Ocean volume or area unmasked and masked 
    221      CALL crs_dom_facvol( tmask, 'T', e1t, e2t, ze3t, ocean_volume_crs_t, facvol_t ) 
     222     CALL crs_dom_facvol( tmask, 'T', CASTWP(e1t), CASTWP(e2t), ze3t, ocean_volume_crs_t, facvol_t ) 
    222223     ! 
    223224     bt_crs(:,:,:) = ocean_volume_crs_t(:,:,:) * facvol_t(:,:,:) 
     
    226227     WHERE( bt_crs /= 0._wp ) r1_bt_crs(:,:,:) = 1._wp / bt_crs(:,:,:) 
    227228 
    228      CALL crs_dom_facvol( tmask, 'W', e1t, e2t, ze3w, ocean_volume_crs_w, facvol_w ) 
     229     CALL crs_dom_facvol( tmask, 'W', CASTWP(e1t), CASTWP(e2t), ze3w, ocean_volume_crs_w, facvol_w ) 
    229230     ! 
    230231     !--------------------------------------------------------- 
Note: See TracChangeset for help on using the changeset viewer.