Ignore:
Timestamp:
03/30/21 17:11:36 (3 years ago)
Author:
ymipsl
Message:

remove attempt to visualize blitz array throw totalview API.
YM

Location:
XIOS/dev/dev_ym/XIOS_COUPLING/src
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • XIOS/dev/dev_ym/XIOS_COUPLING/src/array_new.cpp

    r2118 r2120  
    44{ 
    55 
    6 #define macrotyperank(_TYPE_,_RANK_)\ 
    7   template<> int CArray<_TYPE_,_RANK_>::TV_ttf_display_type( const CArray<_TYPE_,_RANK_>* array ) \ 
    8   {\ 
    9     return show_TV_ttf_display_type (array) ;\ 
    10   } 
    11  
    12 #define macrotype(_TYPE_)\ 
    13 macrotyperank(_TYPE_,1)\ 
    14 macrotyperank(_TYPE_,2)\ 
    15 macrotyperank(_TYPE_,3)\ 
    16 macrotyperank(_TYPE_,4)\ 
    17 macrotyperank(_TYPE_,5)\ 
    18 macrotyperank(_TYPE_,6)\ 
    19 macrotyperank(_TYPE_,7) 
    20  
    21 macrotype(double) 
    22 macrotype(int) 
    23 macrotype(bool) 
    24 macrotype(size_t) 
    25 macrotype(float) 
    26 macrotype(string) 
    27  
    28 #undef macrotyperank 
    29 #undef macrotype 
    306 
    317} 
  • XIOS/dev/dev_ym/XIOS_COUPLING/src/array_new.hpp

    r2118 r2120  
    77#include "buffer_out.hpp" 
    88#include "message.hpp" 
    9 #include "tv_data_display.h" 
    10 #ifdef __GNUC__ 
    11 #include <typeinfo> 
    12 #include <cxxabi.h> 
    13 #endif 
    149#include <cmath> 
    1510 
     
    2217  class CArray ; 
    2318 
    24  template <typename T_numtype,int N_rank> 
    25  int TV_ttf_display_type ( const CArray<T_numtype, N_rank>* array ) ; 
    2619} 
    27  
    28 template <typename T_numtype,int N_rank> 
    29 int TV_ttf_display_type ( const xios::CArray<T_numtype, N_rank>* array ) ; 
    3020 
    3121namespace xios 
     
    3626    private: 
    3727      bool initialized; 
    38       void inc_symbol(void) 
    39       { 
    40         TV_ttf_display_type(this); 
    41       } 
     28 
    4229    public: 
    4330      typedef typename Array<T_numtype,N_rank>::T_default_storage T_default_storage; 
     
    4633      template<typename T_expr> explicit CArray(_bz_ArrayExpr<T_expr> expr) 
    4734        : Array<T_numtype,N_rank>(expr) 
    48         , initialized(true) 
    49       { bool neverTrue ; neverTrue=false ; if(neverTrue) inc_symbol(); } 
     35        , initialized(true) {  } 
    5036 
    5137      CArray(GeneralArrayStorage<N_rank> storage = T_default_storage()) 
    5238        : Array<T_numtype,N_rank>(storage) 
    53         , initialized(false) 
    54       { bool neverTrue ; neverTrue=false ; if(neverTrue) inc_symbol();} 
     39        , initialized(false) { } 
    5540 
    5641      explicit CArray(int length0, GeneralArrayStorage<N_rank> storage = T_default_storage()) 
    5742        : Array<T_numtype,N_rank>(length0, storage) 
    58         , initialized(true) 
    59       {bool neverTrue ; neverTrue=false ; if(neverTrue) inc_symbol();} 
     43        , initialized(true) { } 
    6044 
    6145      CArray(int length0, int length1, GeneralArrayStorage<N_rank> storage = T_default_storage()) 
    6246        : Array<T_numtype,N_rank>(length0, length1, storage) 
    63         , initialized(true) 
    64       { bool neverTrue ; neverTrue=false ; if(neverTrue) inc_symbol();} 
     47        , initialized(true) { } 
    6548 
    6649      CArray(int length0, int length1, int length2, GeneralArrayStorage<N_rank> storage = T_default_storage()) 
    6750        : Array<T_numtype,N_rank>(length0, length1, length2, storage) 
    68         , initialized(true) 
    69       {bool neverTrue ; neverTrue=false ; if(neverTrue) inc_symbol();} 
     51        , initialized(true) { } 
    7052 
    7153      CArray(int length0, int length1, int length2, int length3, GeneralArrayStorage<N_rank> storage = T_default_storage()) 
    7254        : Array<T_numtype,N_rank>(length0, length1, length2, length3, storage) 
    73         , initialized(true) 
    74       {bool neverTrue ; neverTrue=false ; if(neverTrue) inc_symbol();} 
     55        , initialized(true) { } 
    7556 
    7657      CArray(int length0, int length1, int length2, int length3, int length4, GeneralArrayStorage<N_rank> storage = T_default_storage()) 
    7758        : Array<T_numtype,N_rank>(length0,length1, length2, length3, length4, storage) 
    78         , initialized(true) 
    79       {bool neverTrue ; neverTrue=false ; if(neverTrue) inc_symbol();} 
     59        , initialized(true) { } 
    8060 
    8161      CArray(int length0, int length1, int length2, int length3, int length4, int length5, GeneralArrayStorage<N_rank> storage = T_default_storage()) 
    8262        : Array<T_numtype,N_rank>(length0, length1, length2, length3, length4, length5, storage) 
    83         , initialized(true) 
    84       {bool neverTrue ; neverTrue=false ; if(neverTrue) inc_symbol();} 
     63        , initialized(true) { } 
    8564 
    8665      CArray(int length0, int length1, int length2, int length3, int length4, int length5, int length6, GeneralArrayStorage<N_rank> storage = T_default_storage()) 
    8766        : Array<T_numtype,N_rank>(length0, length1, length2, length3, length4, length5, length6, storage) 
    88         , initialized(true) 
    89       {bool neverTrue ; neverTrue=false ; if(neverTrue) inc_symbol();} 
     67        , initialized(true) { } 
    9068 
    9169      CArray(int length0, int length1, int length2, int length3, int length4, int length5, int length6, int length7, 
    9270             GeneralArrayStorage<N_rank> storage = T_default_storage()) 
    9371        : Array<T_numtype,N_rank>(length0, length1, length2, length3, length4, length5, length6, length7, storage) 
    94         , initialized(true) 
    95       {bool neverTrue ; neverTrue=false ; if(neverTrue) inc_symbol();} 
     72        , initialized(true) { } 
    9673 
    9774      CArray(int length0, int length1, int length2, int length3, int length4, int length5, int length6, 
    9875             int length7, int length8, GeneralArrayStorage<N_rank> storage = T_default_storage()) 
    9976       : Array<T_numtype,N_rank>(length0, length1, length2, length3, length4, length5, length6, length7, length8, storage) 
    100        , initialized(true) 
    101       {bool neverTrue ; neverTrue=false ; if(neverTrue) inc_symbol();} 
     77       , initialized(true) { } 
    10278 
    10379      CArray(int length0, int length1, int length2, int length3, int length4, 
    10480             int length5, int length6, int length7, int length8, int length9, GeneralArrayStorage<N_rank> storage = T_default_storage()) 
    10581        : Array<T_numtype,N_rank>(length0, length1, length2, length3, length4, length5, length6, length7, length8, length9, storage) 
    106         , initialized(true) 
    107       {bool neverTrue ; neverTrue=false ; if(neverTrue) inc_symbol();} 
     82        , initialized(true) { } 
    10883 
    10984      CArray(int length0, int length1, int length2, int length3, int length4, int length5, int length6, 
    11085             int length7, int length8, int length9, int length10, GeneralArrayStorage<N_rank> storage = T_default_storage()) 
    11186       : Array<T_numtype,N_rank>(length0, length1, length2, length3, length4, length5, length6, length7, length8, length9, length10, storage) 
    112        , initialized(true) 
    113       {bool neverTrue ; neverTrue=false ; if(neverTrue) inc_symbol();} 
     87       , initialized(true) { } 
    11488 
    11589      CArray(T_numtype* restrict dataFirst, TinyVector<int, N_rank> shape, GeneralArrayStorage<N_rank> storage = T_default_storage()) 
    11690        : Array<T_numtype,N_rank>(dataFirst, shape, storage) 
    117         , initialized(true) 
    118       {bool neverTrue ; neverTrue=false ; if(neverTrue) inc_symbol();} 
     91        , initialized(true) { } 
    11992 
    12093      CArray(T_numtype* restrict dataFirst, TinyVector<int, N_rank> shape, TinyVector<diffType, N_rank> stride, 
    12194             GeneralArrayStorage<N_rank> storage = T_default_storage()) 
    12295        : Array<T_numtype,N_rank>(dataFirst, shape, stride, storage) 
    123         , initialized(true) 
    124       {bool neverTrue ; neverTrue=false ; if(neverTrue) inc_symbol();} 
     96        , initialized(true) { } 
    12597 
    12698      CArray(T_numtype* restrict dataFirst, TinyVector<int, N_rank> shape, preexistingMemoryPolicy deletionPolicy, 
    12799            GeneralArrayStorage<N_rank> storage = T_default_storage()) 
    128100        : Array<T_numtype,N_rank>(dataFirst, shape, deletionPolicy, storage) 
    129         , initialized(true) 
    130       {bool neverTrue ; neverTrue=false ; if(neverTrue) inc_symbol();} 
     101        , initialized(true) { } 
    131102 
    132103      CArray(T_numtype* restrict dataFirst, TinyVector<int, N_rank> shape, TinyVector<diffType, N_rank> stride, 
    133104             preexistingMemoryPolicy deletionPolicy, GeneralArrayStorage<N_rank> storage = T_default_storage()) 
    134105        : Array<T_numtype,N_rank>(dataFirst, shape, stride, deletionPolicy, storage) 
    135         , initialized(true) 
    136       {bool neverTrue ; neverTrue=false ; if(neverTrue) inc_symbol();} 
     106        , initialized(true) { } 
    137107 
    138108      CArray(const TinyVector<int, N_rank>& extent, GeneralArrayStorage<N_rank> storage = T_default_storage()) 
    139109        : Array<T_numtype,N_rank>(extent, storage) 
    140         , initialized(true) 
    141       {bool neverTrue ; neverTrue=false ; if(neverTrue) inc_symbol();} 
     110        , initialized(true) { } 
    142111 
    143112      CArray(const TinyVector<int, N_rank>& lbounds, const TinyVector<int, N_rank>& extent, 
    144113             const GeneralArrayStorage<N_rank>& storage) 
    145114        : Array<T_numtype,N_rank>(lbounds, extent, storage) 
    146         , initialized(true) 
    147       {bool neverTrue ; neverTrue=false ; if(neverTrue) inc_symbol();} 
     115        , initialized(true) { } 
    148116 
    149117      CArray(Range r0, GeneralArrayStorage<N_rank> storage = T_default_storage()) 
    150118        : Array<T_numtype,N_rank>(r0, storage) 
    151         , initialized(true) 
    152       {bool neverTrue ; neverTrue=false ; if(neverTrue) inc_symbol();} 
     119        , initialized(true) { } 
    153120 
    154121      CArray(Range r0, Range r1, GeneralArrayStorage<N_rank> storage = T_default_storage()) 
    155122        : Array<T_numtype,N_rank>(r0, r1, storage) 
    156         , initialized(true) 
    157       {bool neverTrue ; neverTrue=false ; if(neverTrue) inc_symbol();} 
     123        , initialized(true) { } 
    158124 
    159125      CArray(Range r0, Range r1, Range r2, GeneralArrayStorage<N_rank> storage = T_default_storage()) 
    160126        : Array<T_numtype,N_rank>(r0, r1, r2, storage) 
    161         , initialized(true) 
    162       {bool neverTrue ; neverTrue=false ; if(neverTrue) inc_symbol();} 
     127        , initialized(true) { } 
    163128 
    164129      CArray(Range r0, Range r1, Range r2, Range r3, GeneralArrayStorage<N_rank> storage = T_default_storage()) 
    165130        : Array<T_numtype,N_rank>(r0, r1, r2, r3, storage) 
    166         , initialized(true) 
    167       {bool neverTrue ; neverTrue=false ; if(neverTrue) inc_symbol();} 
     131        , initialized(true) { } 
    168132 
    169133      CArray(Range r0, Range r1, Range r2, Range r3, Range r4, GeneralArrayStorage<N_rank> storage = T_default_storage()) 
    170134        : Array<T_numtype,N_rank>(r0, r1, r2, r3, r4, storage) 
    171         , initialized(true) 
    172       {bool neverTrue ; neverTrue=false ; if(neverTrue) inc_symbol();} 
     135        , initialized(true) { } 
    173136 
    174137      CArray(Range r0, Range r1, Range r2, Range r3, Range r4, Range r5, GeneralArrayStorage<N_rank> storage = T_default_storage()) 
    175138        : Array<T_numtype,N_rank>(r0, r1, r2, r3, r4, r5, storage) 
    176         , initialized(true) 
    177       {bool neverTrue ; neverTrue=false ; if(neverTrue) inc_symbol();} 
     139        , initialized(true) { } 
    178140 
    179141      CArray(Range r0, Range r1, Range r2, Range r3, Range r4, Range r5, Range r6, 
    180142             GeneralArrayStorage<N_rank> storage = T_default_storage()) 
    181143        : Array<T_numtype,N_rank>(r0, r1, r2, r3, r4, r5, r6, storage) 
    182         , initialized(true) 
    183       {bool neverTrue ; neverTrue=false ; if(neverTrue) inc_symbol();} 
     144        , initialized(true) { } 
    184145 
    185146      CArray(Range r0, Range r1, Range r2, Range r3, Range r4, Range r5, Range r6, Range r7, 
    186147             GeneralArrayStorage<N_rank> storage = T_default_storage()) 
    187148        : Array<T_numtype,N_rank>(r0, r1, r2, r3, r4, r5, r6, r7, storage) 
    188         , initialized(true) 
    189       {bool neverTrue ; neverTrue=false ; if(neverTrue) inc_symbol();} 
     149        , initialized(true) { } 
    190150 
    191151      CArray(Range r0, Range r1, Range r2, Range r3, Range r4, Range r5, 
    192152             Range r6, Range r7, Range r8, GeneralArrayStorage<N_rank> storage = T_default_storage()) 
    193153        : Array<T_numtype,N_rank>(r0, r1, r2, r3, r4, r5, r6, r7, r8, storage) 
    194         , initialized(true) 
    195       {bool neverTrue ; neverTrue=false ; if(neverTrue) inc_symbol();} 
     154        , initialized(true) { } 
    196155 
    197156      CArray(Range r0, Range r1, Range r2, Range r3, Range r4, Range r5, 
    198157             Range r6, Range r7, Range r8, Range r9, GeneralArrayStorage<N_rank> storage = T_default_storage()) 
    199158        : Array<T_numtype,N_rank>(r0, r1, r2, r3, r4, r5, r6, r7, r8, r9, storage) 
    200         , initialized(true) 
    201       {bool neverTrue ; neverTrue=false ; if(neverTrue) inc_symbol();} 
     159        , initialized(true) { } 
    202160 
    203161      CArray(Range r0, Range r1, Range r2, Range r3, Range r4, Range r5, Range r6, Range r7, 
    204162             Range r8, Range r9, Range r10, GeneralArrayStorage<N_rank> storage = T_default_storage()) 
    205163        : Array<T_numtype,N_rank>(r0, r1, r2, r3, r4, r5, r6, r7, r8, r9, r10, storage) 
    206         , initialized(true) 
    207       {bool neverTrue ; neverTrue=false ; if(neverTrue) inc_symbol();} 
     164        , initialized(true) {  } 
    208165 
    209166      CArray(const CArray<T_numtype, N_rank>& array) 
    210167        : Array<T_numtype,N_rank>(array) 
    211         , initialized(array.initialized) 
    212       {bool neverTrue ; neverTrue=false ; if(neverTrue) inc_symbol();} 
     168        , initialized(array.initialized) { } 
    213169 
    214170      CArray(const Array<T_numtype, N_rank>& array) 
    215171        : Array<T_numtype,N_rank>(array) 
    216         , initialized(true) 
    217       {bool neverTrue ; neverTrue=false ; if(neverTrue) inc_symbol();} 
     172        , initialized(true) { } 
    218173 
    219174      CArray(const TinyVector<int,N_rank-1>& shape, int lastExtent, const GeneralArrayStorage<N_rank>& storage) 
    220175        : Array<T_numtype,N_rank>(shape, lastExtent, storage) 
    221         , initialized(true) 
    222       {bool neverTrue ; neverTrue=false ; if(neverTrue) inc_symbol();} 
     176        , initialized(true) { } 
    223177 
    224178      CArray(Array<T_numtype, N_rank>& array, Range r0) 
    225179        : Array<T_numtype,N_rank>(array, r0) 
    226         , initialized(true) 
    227       {bool neverTrue ; neverTrue=false ; if(neverTrue) inc_symbol();} 
     180        , initialized(true) { } 
    228181 
    229182      CArray(Array<T_numtype, N_rank>& array, Range r0, Range r1) 
    230183        : Array<T_numtype,N_rank>(array, r0, r1) 
    231         , initialized(true) 
    232       {bool neverTrue ; neverTrue=false ; if(neverTrue) inc_symbol();} 
     184        , initialized(true) { } 
    233185 
    234186      CArray(Array<T_numtype, N_rank>& array, Range r0, Range r1, Range r2) 
    235187        : Array<T_numtype,N_rank>( array, r0, r1, r2) 
    236         , initialized(true) 
    237       {bool neverTrue ; neverTrue=false ; if(neverTrue) inc_symbol();} 
     188        , initialized(true) { } 
    238189 
    239190      CArray(Array<T_numtype, N_rank>& array, Range r0, Range r1, Range r2, Range r3) 
    240191        : Array<T_numtype,N_rank>(array, r0, r1, r2, r3) 
    241         , initialized(true) 
    242       {bool neverTrue ; neverTrue=false ; if(neverTrue) inc_symbol();} 
     192        , initialized(true) { } 
    243193 
    244194      CArray(Array<T_numtype, N_rank>& array, Range r0, Range r1, Range r2, 
    245195             Range r3, Range r4) 
    246196        : Array<T_numtype,N_rank>(array, r0, r1, r2, r3,  r4) 
    247         , initialized(true) 
    248       {bool neverTrue ; neverTrue=false ; if(neverTrue) inc_symbol();} 
     197        , initialized(true) {  } 
    249198 
    250199      CArray(Array<T_numtype, N_rank>& array, Range r0, Range r1, Range r2, 
    251200             Range r3, Range r4, Range r5) 
    252201        : Array<T_numtype,N_rank>( array, r0, r1, r2, r3, r4, r5) 
    253         , initialized(true) 
    254       {bool neverTrue ; neverTrue=false ; if(neverTrue) inc_symbol();} 
     202        , initialized(true) {  } 
    255203 
    256204      CArray(Array<T_numtype, N_rank>& array, Range r0, Range r1, Range r2, Range r3, 
    257205             Range r4, Range r5, Range r6) 
    258206        : Array<T_numtype,N_rank>( array, r0, r1, r2, r3, r4, r5, r6) 
    259         , initialized(true) 
    260       {bool neverTrue ; neverTrue=false ; if(neverTrue) inc_symbol();} 
     207        , initialized(true) {  } 
    261208 
    262209      CArray(Array<T_numtype, N_rank>& array, Range r0, Range r1, Range r2, Range r3, Range r4, 
    263210             Range r5, Range r6, Range r7) 
    264211        : Array<T_numtype,N_rank>(array, r0, r1, r2, r3, r4, r5, r6, r7) 
    265         , initialized(true) 
    266       {bool neverTrue ; neverTrue=false ; if(neverTrue) inc_symbol();} 
     212        , initialized(true) {  } 
    267213 
    268214      CArray(Array<T_numtype, N_rank>& array, Range r0, Range r1, Range r2, Range r3, Range r4, Range r5, 
    269215             Range r6, Range r7, Range r8) 
    270216        : Array<T_numtype,N_rank>(array, r0, r1, r2, r3, r4, r5, r6, r7, r8) 
    271         , initialized(true) 
    272       {bool neverTrue ; neverTrue=false ; if(neverTrue) inc_symbol();} 
     217        , initialized(true) {  } 
    273218 
    274219      CArray(Array<T_numtype, N_rank>& array, Range r0, Range r1, Range r2, Range r3, Range r4, Range r5, 
    275220             Range r6, Range r7, Range r8, Range r9) 
    276221        : Array<T_numtype,N_rank>(array, r0, r1, r2, r3, r4, r5, r6, r7, r8, r9) 
    277         , initialized(true) 
    278       {bool neverTrue ; neverTrue=false ; if(neverTrue) inc_symbol();} 
     222        , initialized(true) {  } 
    279223 
    280224      CArray(Array<T_numtype, N_rank>& array, Range r0, Range r1, Range r2, Range r3, Range r4, Range r5, Range r6, 
    281225             Range r7, Range r8, Range r9, Range r10) 
    282226        : Array<T_numtype,N_rank>(array, r0, r1, r2, r3, r4, r5, r6, r7, r8, r9, r10) 
    283         , initialized(true) 
    284       {bool neverTrue ; neverTrue=false ; if(neverTrue) inc_symbol();} 
     227        , initialized(true) {  } 
    285228 
    286229      CArray(Array<T_numtype, N_rank>& array, const RectDomain<N_rank>& subdomain) 
    287230        : Array<T_numtype,N_rank>(array, subdomain) 
    288         , initialized(true) 
    289       {bool neverTrue ; neverTrue=false ; if(neverTrue) inc_symbol();} 
     231        , initialized(true) {  } 
    290232 
    291233      CArray(Array<T_numtype, N_rank>& array, const StridedDomain<N_rank>& subdomain) 
    292234        : Array<T_numtype,N_rank>(array, subdomain) 
    293         , initialized(true) 
    294       {bool neverTrue ; neverTrue=false ; if(neverTrue) inc_symbol();} 
     235        , initialized(true) {  } 
    295236 
    296237      template<int N_rank2, typename R0, typename R1, typename R2, typename R3, typename R4, typename R5, 
     
    299240        : Array<T_numtype,N_rank>(array, r0,r1, r2, r3, r4, r5, r6, r7, r8, r9, r10) 
    300241        , initialized(true) 
    301       { bool neverTrue ; neverTrue=false ; if(neverTrue) inc_symbol(); } 
     242      {   } 
    302243 
    303244      virtual ~CArray() {} 
     
    569510      virtual std::vector<T_numtype> getVector(void) { return vector<T_numtype>(this->dataFirst(),this->dataFirst()+this->numElements()) ;} 
    570511      static size_t size(sizeType numElements) { return (N_rank + 1) * sizeof(int) + sizeof(size_t) + numElements * sizeof(T_numtype); } 
    571        
    572       static int show_TV_ttf_display_type ( const CArray<T_numtype,N_rank>* array ) 
    573       { 
    574         int status ; 
    575         if (array->isEmpty())  
    576         { 
    577           status = TV_ttf_add_row("State", TV_ttf_type_ascii_string,"(empty)") ; 
    578           if (status != TV_ttf_ec_ok) return TV_ttf_format_raw ; 
    579           else return TV_ttf_format_ok_elide ; 
    580         } 
    581         else  
    582         { 
    583           char tname[128] ; 
    584           char bname[128] = "value_type" ; 
    585 #ifdef __GNUC__ 
    586          size_t size = sizeof(bname) ; 
    587          abi::__cxa_demangle(typeid(T_numtype).name(), bname, &size, &status) ; 
    588          if (status !=0) return TV_ttf_format_raw ; 
    589 #endif 
    590           int dim = array->dimensions() ; 
    591           if (dim==1) snprintf (tname, sizeof(tname), "%s[%d]", bname, array->extent(0)); 
    592           if (dim==2) snprintf (tname, sizeof(tname), "%s[%d][%d]", bname, array->extent(1), array->extent(0)); 
    593           if (dim==3) snprintf (tname, sizeof(tname), "%s[%d][%d][%d]", bname, array->extent(2), array->extent(1), array->extent(3)); 
    594           if (dim==4) snprintf (tname, sizeof(tname), "%s[%d][%d][%d][%d]", bname, array->extent(0), array->extent(1), array->extent(2), array->extent(3)); 
    595           if (dim==5) snprintf (tname, sizeof(tname), "%s[%d][%d][%d][%d][%d]", bname, array->extent(4), array->extent(3), array->extent(2), array->extent(1) 
    596                                                                                       ,array->extent(0)); 
    597           if (dim==6) snprintf (tname, sizeof(tname), "%s[%d][%d][%d][%d][%d][%d]", bname, array->extent(5), array->extent(4), array->extent(3), array->extent(2) 
    598                                                                                       ,array->extent(1),array->extent(0)); 
    599           if (dim==7) snprintf (tname, sizeof(tname), "%s[%d][%d][%d][%d][%d][%d][%d]", bname, array->extent(6), array->extent(5), array->extent(4), array->extent(3) 
    600                                                                                       ,array->extent(2),array->extent(1),array->extent(0)); 
    601           status = TV_ttf_add_row("array_values", tname, array->dataFirst()) ; 
    602           if (status != TV_ttf_ec_ok) return TV_ttf_format_raw ; 
    603           else return TV_ttf_format_ok ; 
    604         } 
    605       } 
    606        
    607  
    608       static int TV_ttf_display_type ( const CArray<T_numtype,N_rank>* array ) 
    609       { 
    610         return show_TV_ttf_display_type (array) ; 
    611       } 
    612        
     512     
    613513      virtual CBaseType* clone(void) const { return new CArray(*this); } 
    614514 
     
    642542 
    643543  }; 
    644  
    645  
    646 #define macrotyperank(_TYPE_,_RANK_)\ 
    647   template<> int CArray<_TYPE_,_RANK_>::TV_ttf_display_type( const CArray<_TYPE_,_RANK_>* array ); 
    648  
    649 #define macrotype(_TYPE_)\ 
    650 macrotyperank(_TYPE_,1)\ 
    651 macrotyperank(_TYPE_,2)\ 
    652 macrotyperank(_TYPE_,3)\ 
    653 macrotyperank(_TYPE_,4)\ 
    654 macrotyperank(_TYPE_,5)\ 
    655 macrotyperank(_TYPE_,6)\ 
    656 macrotyperank(_TYPE_,7) 
    657  
    658 macrotype(double) 
    659 macrotype(int) 
    660 macrotype(bool) 
    661 macrotype(size_t) 
    662 macrotype(float) 
    663 macrotype(string) 
    664  
    665 #undef macrotyperank 
    666 #undef macrotype 
    667544 
    668545 
  • XIOS/dev/dev_ym/XIOS_COUPLING/src/attribute_array.hpp

    r2118 r2120  
    6565            virtual void generateFortranInterfaceGetDeclaration(ostream& oss,const string& className) ; 
    6666  
    67  static int show_TV_ttf_display_type ( const CAttributeArray<T_numtype,N_rank>* array ) 
    68       { 
    69         int status ; 
    70         if (array->isEmpty())  
    71         { 
    72           status = TV_ttf_add_row("State", TV_ttf_type_ascii_string,"(empty)") ; 
    73           if (status != TV_ttf_ec_ok) return TV_ttf_format_raw ; 
    74           else return TV_ttf_format_ok_elide ; 
    75         } 
    76         else  
    77         { 
    78           char tname[128] ; 
    79           char bname[128] = "value_type" ; 
    80 #ifdef __GNUC__ 
    81          size_t size = sizeof(bname) ; 
    82          abi::__cxa_demangle(typeid(T_numtype).name(), bname, &size, &status) ; 
    83          if (status !=0) return TV_ttf_format_raw ; 
    84 #endif 
    85           int dim = array->dimensions() ; 
    86           if (dim==1) snprintf (tname, sizeof(tname), "%s[%d]", bname, array->extent(0)); 
    87           if (dim==2) snprintf (tname, sizeof(tname), "%s[%d][%d]", bname, array->extent(1), array->extent(0)); 
    88           if (dim==3) snprintf (tname, sizeof(tname), "%s[%d][%d][%d]", bname, array->extent(2), array->extent(1), array->extent(3)); 
    89           if (dim==4) snprintf (tname, sizeof(tname), "%s[%d][%d][%d][%d]", bname, array->extent(0), array->extent(1), array->extent(2), array->extent(3)); 
    90           if (dim==5) snprintf (tname, sizeof(tname), "%s[%d][%d][%d][%d][%d]", bname, array->extent(4), array->extent(3), array->extent(2), array->extent(1) 
    91                                                                                       ,array->extent(0)); 
    92           if (dim==6) snprintf (tname, sizeof(tname), "%s[%d][%d][%d][%d][%d][%d]", bname, array->extent(5), array->extent(4), array->extent(3), array->extent(2) 
    93                                                                                       ,array->extent(1),array->extent(0)); 
    94           if (dim==7) snprintf (tname, sizeof(tname), "%s[%d][%d][%d][%d][%d][%d][%d]", bname, array->extent(6), array->extent(5), array->extent(4), array->extent(3) 
    95                                                                                       ,array->extent(2),array->extent(1),array->extent(0)); 
    96           status = TV_ttf_add_row("array_values", tname, array->dataFirst()) ; 
    97           if (status != TV_ttf_ec_ok) return TV_ttf_format_raw ; 
    98           else return TV_ttf_format_ok ; 
    99         } 
    100       } 
    101        
    102              
    103             static int TV_ttf_display_type ( const  CAttributeArray<T_numtype,N_rank>* array ) 
    104            { 
    105              return CAttributeArray<T_numtype,N_rank>::show_TV_ttf_display_type (array) ; 
    106            } 
    107  
    10867         private : 
    10968          bool isEqual_(const CAttributeArray& attr); 
     
    11776 
    11877 
    119 #define macrotyperank(_TYPE_,_RANK_)\ 
    120   template<> int CAttributeArray<_TYPE_,_RANK_>::TV_ttf_display_type(const CAttributeArray<_TYPE_,_RANK_>* array ); 
    121  
    122 #define macrotype(_TYPE_)\ 
    123 macrotyperank(_TYPE_,1)\ 
    124 macrotyperank(_TYPE_,2)\ 
    125 macrotyperank(_TYPE_,3)\ 
    126 macrotyperank(_TYPE_,4)\ 
    127 macrotyperank(_TYPE_,5)\ 
    128 macrotyperank(_TYPE_,6)\ 
    129 macrotyperank(_TYPE_,7) 
    130  
    131 macrotype(double) 
    132 macrotype(int) 
    133 macrotype(bool) 
    134 macrotype(size_t) 
    135 macrotype(float) 
    136 macrotype(string) 
    137  
    138 #undef macrotyperank 
    139 #undef macrotype 
    14078} // namespace xios 
    14179 
  • XIOS/dev/dev_ym/XIOS_COUPLING/src/attribute_array_decl.cpp

    r2118 r2120  
    2020  template class CAttributeArray<StdString,2> ; 
    2121 
    22 #define macrotyperank(_TYPE_,_RANK_)                                    \ 
    23   template<> int CAttributeArray<_TYPE_,_RANK_>::TV_ttf_display_type(const CAttributeArray<_TYPE_,_RANK_>* array ) \ 
    24   {\ 
    25     return CAttributeArray<_TYPE_,_RANK_>::show_TV_ttf_display_type (array) ;\ 
    26   } 
    27  
    28 #define macrotype(_TYPE_)\ 
    29 macrotyperank(_TYPE_,1)\ 
    30 macrotyperank(_TYPE_,2)\ 
    31 macrotyperank(_TYPE_,3)\ 
    32 macrotyperank(_TYPE_,4)\ 
    33 macrotyperank(_TYPE_,5)\ 
    34 macrotyperank(_TYPE_,6)\ 
    35 macrotyperank(_TYPE_,7) 
    36  
    37 macrotype(double) 
    38 macrotype(int) 
    39 macrotype(bool) 
    40 macrotype(size_t) 
    41 macrotype(float) 
    42 macrotype(string) 
    43  
    44 #undef macrotyperank 
    45 #undef macrotype 
    46  
    4722} 
  • XIOS/dev/dev_ym/XIOS_COUPLING/src/attribute_array_impl.hpp

    r1875 r2120  
    1414      CAttributeArray<T_numtype, N_rank>::CAttributeArray(const StdString & id) 
    1515         : CAttribute(id) 
    16       { bool alwaysFalse ; alwaysFalse=false ; if (alwaysFalse) TV_ttf_display_type(this); } 
     16      { } 
    1717 
    1818      template <typename T_numtype, int N_rank> 
     
    2020         : CAttribute(id) 
    2121      { 
    22          bool alwaysFalse ; alwaysFalse=false ; if (alwaysFalse) TV_ttf_display_type(this); 
    2322         this->setValue(value); 
    2423      } 
     
    2827         : CAttribute(id) 
    2928      { 
    30          bool alwaysFalse ; alwaysFalse=false ; if (alwaysFalse) TV_ttf_display_type(this); 
    3129         umap.insert(umap.end(), std::make_pair(id, this)); 
    3230      } 
     
    3735         : CAttribute(id) 
    3836      { 
    39          bool alwaysFalse ; alwaysFalse=false ; if (alwaysFalse) TV_ttf_display_type(this); 
    4037         this->setValue(value); 
    4138         umap.insert(umap.end(), std::make_pair(id, this)); 
  • XIOS/dev/dev_ym/XIOS_COUPLING/src/attribute_template.hpp

    r2118 r2120  
    1212#include "buffer_out.hpp" 
    1313#include "type.hpp" 
    14 #include "tv_data_display.h" 
    15  
    16 #ifdef __GNUC__ 
    17 #include <typeinfo> 
    18 #include <cxxabi.h> 
    19 #endif 
    2014 
    2115namespace xios 
     
    9791//            virtual void generateFortranInterfaceIsDefinedDeclaration(ostream& oss,const string& className) ; 
    9892 
    99            static int show_TV_ttf_display_type ( const CAttributeTemplate<T>* attr) 
    100            { 
    101              int status ; 
    102              if (attr->isEmpty())  
    103              { 
    104                status = TV_ttf_add_row("State", TV_ttf_type_ascii_string,"(empty)") ; 
    105                if (status != TV_ttf_ec_ok) return TV_ttf_format_raw ; 
    106                else return TV_ttf_format_ok_elide ; 
    107              } 
    108              else  
    109              { 
    110                char tname[128] ; 
    111                char bname[128] = "ValueType" ; 
    112 #ifdef __GNUC__ 
    113                size_t size = sizeof(bname) ; 
    114                abi::__cxa_demangle(typeid(T).name(), bname, &size, &status) ; 
    115                if (status !=0) return TV_ttf_format_raw ; 
    116 #endif 
    117                snprintf (tname, sizeof(tname), "%s", bname); 
    118                if (typeid(T)==typeid(string)) 
    119                  status = TV_ttf_add_row("values", TV_ttf_type_ascii_string, ((string*)(attr->ptrValue))->c_str() ); 
    120                else status = TV_ttf_add_row("values", tname, attr->ptrValue) ; 
    121                if (status != TV_ttf_ec_ok) return TV_ttf_format_raw ; 
    122                else return TV_ttf_format_ok_elide ; 
    123              } 
    124            } 
    125        
    126            static int TV_ttf_display_type ( const CAttributeTemplate<T>* attr ) 
    127            { 
    128              return show_TV_ttf_display_type (attr) ; 
    129            } 
    130  
    13193 
    13294         protected : 
     
    145107      }; // class CAttribute 
    146108 
    147 #define macrotype(_TYPE_)\ 
    148   template<> int CAttributeTemplate<_TYPE_>::TV_ttf_display_type( const CAttributeTemplate<_TYPE_>* attr ); 
    149  
    150 macrotype(double) 
    151 macrotype(int) 
    152 macrotype(bool) 
    153 macrotype(string) 
    154 //macrotype(CDate) 
    155 //macrotype(CDuration) 
    156 #undef macrotype 
    157109 
    158110   template <class T>  void FromBinary(StdIStream & is, T & obj); 
  • XIOS/dev/dev_ym/XIOS_COUPLING/src/attribute_template_decl.cpp

    r2118 r2120  
    1313  template class CAttributeTemplate<CDuration> ; 
    1414 
    15 #define macrotype(_TYPE_)                                               \ 
    16   template<> int CAttributeTemplate<_TYPE_>::TV_ttf_display_type( const CAttributeTemplate<_TYPE_>* attr ) \ 
    17   {\ 
    18     return show_TV_ttf_display_type (attr) ;\ 
    19   } 
    20  
    21 macrotype(double) 
    22 macrotype(int) 
    23 macrotype(bool) 
    24 macrotype(string) 
    25 //macrotype(CDate) 
    26 //macrotype(CDuration) 
    27 #undef macrotype 
    28  
    2915} 
  • XIOS/dev/dev_ym/XIOS_COUPLING/src/declare_attribute.hpp

    r1875 r2120  
    4343         using CAttributeArray<T_num, T_rank>::operator = ;       \ 
    4444         bool alwaysFalse=false;\ 
    45          name##_attr(void) : CAttributeArray<T_num, T_rank> (#name, *CAttributeMap::Current) {if (alwaysFalse) TV_ttf_display_type(this);} \ 
     45         name##_attr(void) : CAttributeArray<T_num, T_rank> (#name, *CAttributeMap::Current) {} \ 
    4646         virtual bool doSend() const { return helper(__VA_ARGS__); }   \ 
    4747         bool helper(bool returnTrue=true) const { return returnTrue; }   \ 
    48          static int TV_ttf_display_type ( const name##_attr* array )\ 
    49          {\ 
    50            cout<<"TV_ttf_display_type"<<endl ;\ 
    51            return CArray<T_num,T_rank>::TV_ttf_display_type((const CArray<T_num,T_rank>*)array) ;\ 
    52          }\ 
    5348         virtual ~name##_attr(void) {}                            \ 
    5449   } name; 
Note: See TracChangeset for help on using the changeset viewer.