diff options
author | Roland Haas <roland.haas@physics.gatech.edu> | 2011-04-11 20:29:43 -0400 |
---|---|---|
committer | Barry Wardell <barry.wardell@gmail.com> | 2011-12-14 18:26:05 +0000 |
commit | 4d2ed46a6fe555937be7d2d8a55a5466f48e3b7b (patch) | |
tree | 54f0a4a56374d6c9a6b2fe7b30c79b83c9942269 /Carpet/LoopControl | |
parent | 4663edf9caa8edcfb6c8610c32b6c11c82a2a5ec (diff) |
LoopControl: change storage size calculation to work with Intel 11.1
it seems that ifort's INQUIRE statement returns the byte size of a record
divided by four. Maybe it is counting ints? This one uses pointer arithmetic
and will work unless Fortran pads the structures differently than C or if a
compiler allocates some temporaries when members of arrays are passed to
functions.
Diffstat (limited to 'Carpet/LoopControl')
-rw-r--r-- | Carpet/LoopControl/src/loopcontrol_get_type_sizes.F90 | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/Carpet/LoopControl/src/loopcontrol_get_type_sizes.F90 b/Carpet/LoopControl/src/loopcontrol_get_type_sizes.F90 index 39d5f179d..4ddb69cf2 100644 --- a/Carpet/LoopControl/src/loopcontrol_get_type_sizes.F90 +++ b/Carpet/LoopControl/src/loopcontrol_get_type_sizes.F90 @@ -1,18 +1,23 @@ +#include <cctk.h> +#include <cctk_Functions.h> + subroutine lc_get_fortran_type_sizes (sum_of_type_sizes) use loopcontrol_types implicit none + + DECLARE_CCTK_FUNCTIONS integer, intent(out) :: sum_of_type_sizes integer :: lc_control_size, lc_statmap_size - type(lc_control_t) :: lc_lc - type(lc_statmap_t) :: lc_lm + type(lc_control_t), dimension(2) :: lc_lc + type(lc_statmap_t), dimension(2) :: lc_lm - INQUIRE(IOLENGTH=lc_control_size) lc_lc - INQUIRE(IOLENGTH=lc_statmap_size) lc_lm + lc_control_size = CCTK_PointerTo(lc_lc(2)) - CCTK_PointerTo(lc_lc(1)) + lc_statmap_size = CCTK_PointerTo(lc_lm(2)) - CCTK_PointerTo(lc_lm(1)) sum_of_type_sizes = lc_control_size + lc_statmap_size |