Ignore:
Timestamp:
Apr 20, 2022, 6:35:42 PM (2 years ago)
Author:
Laurent Fairhead
Message:

Modifications to code to start using openacc directives
LF

File:
1 edited

Legend:

Unmodified
Added
Removed
  • LMDZ6/branches/Portage_acc/libf/dynphy_lonlat/phylmd/iniphysiq_mod.F90

    r4127 r4132  
    4848  USE ioipsl_getin_p_mod, ONLY: getin_p
    4949  USE slab_heat_transp_mod, ONLY: ini_slab_transp_geom
    50   IMPLICIT NONE
     50#ifdef _OPENACC
     51    USE openacc
     52#endif
     53    IMPLICIT NONE
    5154
    5255  ! =======================================================================
     
    97100#endif
    98101
     102#ifdef _OPENACC
     103    INTEGER :: numdev
     104
     105    !$acc init
     106
     107    ! get the number of NVIDIA devices on this node
     108    numdev = acc_get_num_devices(ACC_DEVICE_NVIDIA)
     109    PRINT *, 'init_physics : number of available GPU devices', numdev
     110    IF (numdev < 1) STOP "Error: there are no devices available on this host. ABORTING"
     111    CALL acc_init(ACC_DEVICE_NVIDIA)
     112    numdev = acc_get_device_num(ACC_DEVICE_NVIDIA)
     113    PRINT *, 'init_physics : GPU device id = ', numdev
     114#endif
     115
     116
     117
     118
     119
    99120  ! --> initialize physics distribution, global fields and geometry
    100121  ! (i.e. things in phy_common or dynphy_lonlat)
Note: See TracChangeset for help on using the changeset viewer.