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/IOM/iom.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/IOM/iom.F90

    r14072 r14219  
    9898   !! * Substitutions 
    9999#  include "do_loop_substitute.h90" 
     100#  include "single_precision_substitute.h90" 
    100101   !!---------------------------------------------------------------------- 
    101102   !! NEMO/OCE 4.0 , NEMO Consortium (2018) 
     
    169170      IF(.NOT.llrst_context) CALL set_scalar 
    170171      ! 
    171       IF( cdname == cxios_context ) THEN 
    172          CALL set_grid( "T", glamt, gphit, .FALSE., .FALSE. ) 
     172      IF( TRIM(cdname) == TRIM(cxios_context) ) THEN   
     173         CALL set_grid( "T", CASTWP(glamt), CASTWP(gphit), .FALSE., .FALSE. ) 
    173174         CALL set_grid( "U", glamu, gphiu, .FALSE., .FALSE. ) 
    174175         CALL set_grid( "V", glamv, gphiv, .FALSE., .FALSE. ) 
    175          CALL set_grid( "W", glamt, gphit, .FALSE., .FALSE. ) 
    176          CALL set_grid( "F", glamf, gphif, .FALSE., .FALSE. ) 
    177          CALL set_grid_znl( gphit ) 
     176         CALL set_grid( "W", CASTWP(glamt), CASTWP(gphit), .FALSE., .FALSE. ) 
     177         CALL set_grid( "F", CASTWP(glamf), CASTWP(gphif), .FALSE., .FALSE. ) 
     178         CALL set_grid_znl( CASTWP(gphit) ) 
    178179         ! 
    179180         IF( ln_cfmeta ) THEN   ! Add additional grid metadata 
     
    181182            CALL iom_set_domain_attr("grid_U", area = real( e1e2u(Nis0:Nie0, Njs0:Nje0), dp)) 
    182183            CALL iom_set_domain_attr("grid_V", area = real( e1e2v(Nis0:Nie0, Njs0:Nje0), dp)) 
    183             CALL iom_set_domain_attr("grid_W", area = REAL( e1e2t(Nis0:Nie0, Njs0:Nje0), dp)) 
     184            CALL iom_set_domain_attr("grid_W", area = real( e1e2t(Nis0:Nie0, Njs0:Nje0), dp)) 
    184185            CALL iom_set_domain_attr("grid_F", area = real( e1e2f(Nis0:Nie0, Njs0:Nje0), dp)) 
    185             CALL set_grid_bounds( "T", glamf, gphif, glamt, gphit ) 
     186            CALL set_grid_bounds( "T", CASTWP(glamf), CASTWP(gphif), CASTWP(glamt), CASTWP(gphit) ) 
    186187            CALL set_grid_bounds( "U", glamv, gphiv, glamu, gphiu ) 
    187188            CALL set_grid_bounds( "V", glamu, gphiu, glamv, gphiv ) 
    188             CALL set_grid_bounds( "W", glamf, gphif, glamt, gphit ) 
    189             CALL set_grid_bounds( "F", glamt, gphit, glamf, gphif ) 
     189            CALL set_grid_bounds( "W", CASTWP(glamf), CASTWP(gphif), CASTWP(glamt), CASTWP(gphit) ) 
     190            CALL set_grid_bounds( "F", CASTWP(glamt), CASTWP(gphit), CASTWP(glamf), CASTWP(gphif) ) 
    190191         ENDIF 
    191192      ENDIF 
     
    603604      CALL xios_get_handle("domain_definition",domaingroup_hdl) 
    604605      CALL xios_add_child(domaingroup_hdl, domain_hdl, "grid_N") 
    605       CALL set_grid("N", glamt, gphit, .TRUE., ld_rstr) 
     606      CALL set_grid("N", CASTWP(glamt), CASTWP(gphit), .TRUE., ld_rstr) 
    606607 
    607608      CALL xios_get_handle("axis_definition",axisgroup_hdl) 
     
    10601061      INTEGER         , INTENT(in   )              , OPTIONAL ::   ktime     ! record number 
    10611062      CHARACTER(len=1), INTENT(in   )              , OPTIONAL ::   cd_type   ! nature of grid-points (T, U, V, F, W) 
    1062       REAL(dp)        , INTENT(in   )              , OPTIONAL ::   psgn      ! -1.(1.): (not) change sign across the north fold 
     1063      REAL(wp)        , INTENT(in   )              , OPTIONAL ::   psgn      ! -1.(1.): (not) change sign across the north fold 
    10631064      INTEGER         , INTENT(in   )              , OPTIONAL ::   kfill     ! value of kfillmode in lbc_lbk 
    10641065      INTEGER         , INTENT(in   ), DIMENSION(2), OPTIONAL ::   kstart    ! start axis position of the reading 
     
    10841085      INTEGER         , INTENT(in   )              , OPTIONAL ::   ktime     ! record number 
    10851086      CHARACTER(len=1), INTENT(in   )              , OPTIONAL ::   cd_type   ! nature of grid-points (T, U, V, F, W) 
    1086       REAL(dp)        , INTENT(in   )              , OPTIONAL ::   psgn      ! -1.(1.): (not) change sign across the north fold 
     1087      REAL(wp)        , INTENT(in   )              , OPTIONAL ::   psgn      ! -1.(1.): (not) change sign across the north fold 
    10871088      INTEGER         , INTENT(in   )              , OPTIONAL ::   kfill     ! value of kfillmode in lbc_lbk 
    10881089      INTEGER         , INTENT(in   ), DIMENSION(2), OPTIONAL ::   kstart    ! start axis position of the reading 
     
    11041105      INTEGER         , INTENT(in   )              , OPTIONAL ::   ktime     ! record number 
    11051106      CHARACTER(len=1), INTENT(in   )              , OPTIONAL ::   cd_type   ! nature of grid-points (T, U, V, F, W) 
    1106       REAL(dp)        , INTENT(in   )              , OPTIONAL ::   psgn      ! -1.(1.) : (not) change sign across the north fold 
     1107      REAL(wp)        , INTENT(in   )              , OPTIONAL ::   psgn      ! -1.(1.) : (not) change sign across the north fold 
    11071108      INTEGER         , INTENT(in   )              , OPTIONAL ::   kfill     ! value of kfillmode in lbc_lbk 
    11081109      INTEGER         , INTENT(in   ), DIMENSION(3), OPTIONAL ::   kstart    ! start axis position of the reading 
     
    11281129      INTEGER         , INTENT(in   )              , OPTIONAL ::   ktime     ! record number 
    11291130      CHARACTER(len=1), INTENT(in   )              , OPTIONAL ::   cd_type   ! nature of grid-points (T, U, V, F, W) 
    1130       REAL(dp)        , INTENT(in   )              , OPTIONAL ::   psgn      ! -1.(1.) : (not) change sign across the north fold 
     1131      REAL(wp)        , INTENT(in   )              , OPTIONAL ::   psgn      ! -1.(1.) : (not) change sign across the north fold 
    11311132      INTEGER         , INTENT(in   )              , OPTIONAL ::   kfill     ! value of kfillmode in lbc_lbk 
    11321133      INTEGER         , INTENT(in   ), DIMENSION(3), OPTIONAL ::   kstart    ! start axis position of the reading 
     
    11611162      INTEGER                    , INTENT(in   ), OPTIONAL ::   ktime     ! record number 
    11621163      CHARACTER(len=1)           , INTENT(in   ), OPTIONAL ::   cd_type   ! nature of grid-points (T, U, V, F, W) 
    1163       REAL(dp)                   , INTENT(in   ), OPTIONAL ::   psgn      ! -1.(1.) : (not) change sign across the north fold 
     1164      REAL(wp)                   , INTENT(in   ), OPTIONAL ::   psgn      ! -1.(1.) : (not) change sign across the north fold 
    11641165      INTEGER                    , INTENT(in   ), OPTIONAL ::   kfill     ! value of kfillmode in lbc_lbk 
    11651166      INTEGER , DIMENSION(:)     , INTENT(in   ), OPTIONAL ::   kstart    ! start position of the reading in each axis 
     
    26642665      !! ** Purpose :   send back the date corresponding to the given julian day 
    26652666      !!---------------------------------------------------------------------- 
    2666       REAL(wp), INTENT(in   )           ::   pjday    ! julian day 
     2667      REAL(dp), INTENT(in   )           ::   pjday    ! julian day 
    26672668      LOGICAL , INTENT(in   ), OPTIONAL ::   ld24     ! true to force 24:00 instead of 00:00 
    26682669      LOGICAL , INTENT(in   ), OPTIONAL ::   ldfull   ! true to get the compleate date: yyyymmdd_hh:mm:ss 
     
    26712672      CHARACTER(LEN=50) ::   clfmt                         !  format used to write the date 
    26722673      INTEGER           ::   iyear, imonth, iday, ihour, iminute, isec 
    2673       REAL(wp)          ::   zsec 
     2674      REAL(dp)          ::   zsec 
    26742675      LOGICAL           ::   ll24, llfull 
    26752676      !!---------------------------------------------------------------------- 
Note: See TracChangeset for help on using the changeset viewer.