Changeset 4262 for palm/trunk


Ignore:
Timestamp:
Oct 14, 2019 7:45:46 AM (22 months ago)
Author:
schwenkel
Message:

Added BIND attribute and C datatypes

File:
1 edited

Legend:

Unmodified
Added
Removed
  • palm/trunk/UTIL/read_prt_data.f90

    r2978 r4262  
    2525! -----------------
    2626! $Id: read_prt_data.f90 2696 2017-12-14 17:12:51Z kanani $
     27! Added BIND attribute and C datatypes
     28!
     29! 2696 2017-12-14 17:12:51Z kanani
    2730! Adapted for changed particle attributes
    2831!
     
    4750!------------------------------------------------------------------------------!
    4851
     52    USE, INTRINSIC ::  ISO_C_BINDING
     53
    4954    IMPLICIT NONE
    5055
     
    6166    INTEGER, DIMENSION(:,:,:), ALLOCATABLE ::  prt_count
    6267
    63     TYPE particle_type
    64         SEQUENCE
    65         REAL(KIND=8)     ::  aux1          !< auxiliary multi-purpose feature
    66         REAL(KIND=8)     ::  aux2          !< auxiliary multi-purpose feature
    67         REAL(KIND=8)     ::  radius        !< radius of particle
    68         REAL(KIND=8)     ::  age           !< age of particle
    69         REAL(KIND=8)     ::  age_m         !<
    70         REAL(KIND=8)     ::  dt_sum        !<
    71         REAL(KIND=8)     ::  e_m           !< interpolated sgs tke
    72         REAL(KIND=8)     ::  origin_x      !< origin x-position of particle (changed cyclic bc)
    73         REAL(KIND=8)     ::  origin_y      !< origin y-position of particle (changed cyclic bc)
    74         REAL(KIND=8)     ::  origin_z      !< origin z-position of particle (changed cyclic bc)
    75         REAL(KIND=8)     ::  rvar1         !<
    76         REAL(KIND=8)     ::  rvar2         !<
    77         REAL(KIND=8)     ::  rvar3         !<
    78         REAL(KIND=8)     ::  speed_x       !< speed of particle in x
    79         REAL(KIND=8)     ::  speed_y       !< speed of particle in y
    80         REAL(KIND=8)     ::  speed_z       !< speed of particle in z
    81         REAL(KIND=8)     ::  weight_factor !< weighting factor
    82         REAL(KIND=8)     ::  x             !< x-position
    83         REAL(KIND=8)     ::  y             !< y-position
    84         REAL(KIND=8)     ::  z             !< z-position
    85         INTEGER(KIND=4) ::  class         !< radius class needed for collision
    86         INTEGER(KIND=4) ::  group         !< number of particle group
    87         INTEGER(KIND=8) ::  id            !< particle ID (64 bit integer)
    88         LOGICAL         ::  particle_mask !< if this parameter is set to false the particle will be deleted
    89         INTEGER(KIND=4) ::  block_nr      !< number for sorting (removable?)
     68!
     69!-- WARNING: For compatibility of derived types, the BIND attribute is required, and interoperable C
     70!-- datatypes must be used. These type are hard wired here! So changes in working precision (wp, iwp)
     71!-- will not affect the particle_type!
     72!-- The main reason for introducing the interoperable datatypes was to avoid compiler warnings of
     73!-- the gfortran compiler.
     74!-- The BIND attribite is required because of C_F_POINTER usage in the pmc particle interface.
     75    TYPE, BIND(C) ::  particle_type
     76        REAL(C_DOUBLE) ::  aux1          !< auxiliary multi-purpose feature
     77        REAL(C_DOUBLE) ::  aux2          !< auxiliary multi-purpose feature
     78        REAL(C_DOUBLE) ::  radius        !< radius of particle
     79        REAL(C_DOUBLE) ::  age           !< age of particle
     80        REAL(C_DOUBLE) ::  age_m         !<
     81        REAL(C_DOUBLE) ::  dt_sum        !<
     82        REAL(C_DOUBLE) ::  e_m           !< interpolated sgs tke
     83        REAL(C_DOUBLE) ::  origin_x      !< origin x-position of particle (changed cyclic bc)
     84        REAL(C_DOUBLE) ::  origin_y      !< origin y-position of particle (changed cyclic bc)
     85        REAL(C_DOUBLE) ::  origin_z      !< origin z-position of particle (changed cyclic bc)
     86        REAL(C_DOUBLE) ::  rvar1         !<
     87        REAL(C_DOUBLE) ::  rvar2         !<
     88        REAL(C_DOUBLE) ::  rvar3         !<
     89        REAL(C_DOUBLE) ::  speed_x       !< speed of particle in x
     90        REAL(C_DOUBLE) ::  speed_y       !< speed of particle in y
     91        REAL(C_DOUBLE) ::  speed_z       !< speed of particle in z
     92        REAL(C_DOUBLE) ::  weight_factor !< weighting factor
     93        REAL(C_DOUBLE) ::  x             !< x-position
     94        REAL(C_DOUBLE) ::  y             !< y-position
     95        REAL(C_DOUBLE) ::  z             !< z-position
     96        INTEGER(C_INT) ::  class         !< radius class needed for collision
     97        INTEGER(C_INT) ::  group         !< number of particle group
     98        INTEGER(C_LONG_LONG) ::  id            !< particle ID (64 bit integer)
     99        LOGICAL(C_BOOL) ::  particle_mask !< if this parameter is set to false the particle will be deleted
     100        INTEGER(C_INT) ::  block_nr      !< number for sorting (removable?)
    90101    END TYPE particle_type
     102
    91103
    92104
Note: See TracChangeset for help on using the changeset viewer.