Ignore:
Timestamp:
01/23/19 10:31:44 (5 years ago)
Author:
yushan
Message:

dev on ADA. add flag switch _usingEP/_usingMPI

File:
1 edited

Legend:

Unmodified
Added
Removed
  • XIOS/dev/branch_openmp/src/interface/c/icdate.cpp

    r1545 r1642  
    3535{ 
    3636  long long int cxios_date_convert_to_seconds(cxios_date date_c) 
     37  TRY 
    3738  { 
    3839    xios::CDate date = xios::CDate(getCalendar("long long int cxios_date_convert_to_seconds(cxios_date date_c)"), 
     
    4142    return date; 
    4243  } 
     44  CATCH_DUMP_STACK 
    4345 
    4446  void cxios_date_convert_to_string(cxios_date date_c, char* str, int str_size) 
     47  TRY 
    4548  { 
    4649    xios::CDate date = xios::CDate(getCalendar("void cxios_date_convert_to_string(cxios_date date_c, char* str, int str_size)"), 
     
    5154      ERROR("void cxios_date_convert_to_string(cxios_date date_c, char* str, int str_size)", << "Input string is too short"); 
    5255  } 
     56  CATCH_DUMP_STACK 
    5357 
    5458  cxios_date cxios_date_convert_from_string(const char* str, int str_size) 
     59  TRY 
    5560  { 
    5661    std::string date_str; 
     
    6368    return { date.getYear(), date.getMonth(), date.getDay(), date.getHour(), date.getMinute(), date.getSecond() }; 
    6469  } 
     70  CATCH_DUMP_STACK 
    6571 
    6672  cxios_date cxios_date_add_duration(cxios_date date_c, cxios_duration dur_c) 
     73  TRY 
    6774  { 
    6875    xios::CDate date = xios::CDate(getCalendar("cxios_date cxios_date_add_duration(cxios_date date_c, cxios_duration dur_c)"), 
    6976                                   date_c.year, date_c.month, date_c.day, 
    7077                                   date_c.hour, date_c.minute, date_c.second); 
    71  
    7278    xios::CDuration dur( dur_c.year, dur_c.month, dur_c.day, dur_c.hour, dur_c.minute, dur_c.second, dur_c.timestep ); 
    7379    xios::CDate res = date + dur; 
    7480    return { res.getYear(), res.getMonth(), res.getDay(), res.getHour(), res.getMinute(), res.getSecond() }; 
    7581  } 
     82  CATCH_DUMP_STACK 
    7683 
    7784  cxios_date cxios_date_sub_duration(cxios_date date_c, cxios_duration dur_c) 
     85  TRY 
    7886  { 
    7987    xios::CDate date = xios::CDate(getCalendar("cxios_date cxios_date_sub_duration(cxios_date date_c, cxios_duration dur_c)"), 
     
    8593    return { res.getYear(), res.getMonth(), res.getDay(), res.getHour(), res.getMinute(), res.getSecond() }; 
    8694  } 
     95  CATCH_DUMP_STACK 
    8796 
    8897  cxios_duration cxios_date_sub(cxios_date date1_c, cxios_date date2_c) 
     98  TRY 
    8999  { 
    90100    xios::CDate date1 = xios::CDate(getCalendar("cxios_duration cxios_date_sub(cxios_date date1_c, cxios_date date2_c)"), 
     
    97107    return { res.year, res.month, res.day, res.hour, res.minute, res.second, res.timestep }; 
    98108  } 
     109  CATCH_DUMP_STACK 
    99110 
    100111  bool cxios_date_eq(cxios_date date1_c, cxios_date date2_c) 
     112  TRY 
    101113  { 
    102114    xios::CDate date1 = xios::CDate(getCalendar("bool cxios_date_eq(cxios_date date1_c, cxios_date date2_c)"), 
     
    108120    return (date1 == date2); 
    109121  } 
     122  CATCH_DUMP_STACK 
    110123 
    111124  bool cxios_date_neq(cxios_date date1_c, cxios_date date2_c) 
     125  TRY 
    112126  { 
    113127    xios::CDate date1 = xios::CDate(getCalendar("bool cxios_date_eq(cxios_date date1_c, cxios_date date2_c)"), 
     
    119133    return (date1 != date2); 
    120134  } 
     135  CATCH_DUMP_STACK 
    121136 
    122137  bool cxios_date_lt(cxios_date date1_c, cxios_date date2_c) 
     138  TRY 
    123139  { 
    124140    xios::CDate date1 = xios::CDate(getCalendar("bool cxios_date_eq(cxios_date date1_c, cxios_date date2_c)"), 
     
    130146    return (date1 < date2); 
    131147  } 
     148  CATCH_DUMP_STACK 
    132149 
    133150  bool cxios_date_le(cxios_date date1_c, cxios_date date2_c) 
     151  TRY 
    134152  { 
    135153    xios::CDate date1 = xios::CDate(getCalendar("bool cxios_date_eq(cxios_date date1_c, cxios_date date2_c)"), 
     
    141159    return (date1 <= date2); 
    142160  } 
     161  CATCH_DUMP_STACK 
    143162 
    144163  bool cxios_date_gt(cxios_date date1_c, cxios_date date2_c) 
     164  TRY 
    145165  { 
    146166    xios::CDate date1 = xios::CDate(getCalendar("bool cxios_date_eq(cxios_date date1_c, cxios_date date2_c)"), 
     
    152172    return (date1 > date2); 
    153173  } 
     174  CATCH_DUMP_STACK 
    154175 
    155176  bool cxios_date_ge(cxios_date date1_c, cxios_date date2_c) 
     177  TRY 
    156178  { 
    157179    xios::CDate date1 = xios::CDate(getCalendar("bool cxios_date_eq(cxios_date date1_c, cxios_date date2_c)"), 
     
    163185    return (date1 >= date2); 
    164186  } 
     187  CATCH_DUMP_STACK 
    165188 
    166189  int cxios_date_get_second_of_year(cxios_date date_c) 
     190  TRY 
    167191  { 
    168192    xios::CDate date = xios::CDate(getCalendar("int cxios_date_get_second_of_year(cxios_date date_c)"), 
     
    171195    return date.getSecondOfYear(); 
    172196  } 
     197  CATCH_DUMP_STACK 
    173198 
    174199  double cxios_date_get_day_of_year(cxios_date date_c) 
     200  TRY 
    175201  { 
    176202    xios::CDate date = xios::CDate(getCalendar("int cxios_date_get_day_of_year(cxios_date date_c)"), 
     
    179205    return date.getDayOfYear(); 
    180206  } 
     207  CATCH_DUMP_STACK 
    181208 
    182209  double cxios_date_get_fraction_of_year(cxios_date date_c) 
     210  TRY 
    183211  { 
    184212    xios::CDate date = xios::CDate(getCalendar("int cxios_date_get_fraction_of_year(cxios_date date_c)"), 
     
    187215    return date.getFractionOfYear(); 
    188216  } 
     217  CATCH_DUMP_STACK 
    189218 
    190219  int cxios_date_get_second_of_day(cxios_date date_c) 
     220  TRY 
    191221  { 
    192222    xios::CDate date = xios::CDate(getCalendar("int cxios_date_get_second_of_day(cxios_date date_c)"), 
     
    195225    return date.getSecondOfDay(); 
    196226  } 
     227  CATCH_DUMP_STACK 
    197228 
    198229  double cxios_date_get_fraction_of_day(cxios_date date_c) 
     230  TRY 
    199231  { 
    200232    xios::CDate date = xios::CDate(getCalendar("int cxios_date_get_fraction_of_day(cxios_date date_c)"), 
     
    203235    return date.getFractionOfDay(); 
    204236  } 
     237  CATCH_DUMP_STACK 
    205238} // extern "C" 
Note: See TracChangeset for help on using the changeset viewer.