Ignore:
Timestamp:
04/13/18 16:25:46 (3 years ago)
Author:
yushan
Message:

Branch EP merged with Dev_cmip6 @r1481

File:
1 edited

Legend:

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

    r801 r1482  
    77  void cxios_duration_convert_to_string(cxios_duration dur_c, char* str, int str_size) 
    88  { 
    9     xios::CDuration dur = { dur_c.year, dur_c.month, dur_c.day, 
    10                             dur_c.hour, dur_c.minute, dur_c.second, 
    11                             dur_c.timestep }; 
    12  
     9    xios::CDuration dur( dur_c.year, dur_c.month, dur_c.day, dur_c.hour, dur_c.minute, dur_c.second, dur_c.timestep ); 
    1310    if (!string_copy(dur.toString(), str, str_size)) 
    1411      ERROR("void cxios_duration_convert_to_string(cxios_duration dur_c, char* str, int str_size)", << "Input string is too short"); 
     
    2825  cxios_duration cxios_duration_add(cxios_duration dur1_c, cxios_duration dur2_c) 
    2926  { 
    30     xios::CDuration dur1 = { dur1_c.year, dur1_c.month, dur1_c.day, 
    31                              dur1_c.hour, dur1_c.minute, dur1_c.second, 
    32                              dur1_c.timestep }; 
    33     xios::CDuration dur2 = { dur2_c.year, dur2_c.month, dur2_c.day, 
    34                              dur2_c.hour, dur2_c.minute, dur2_c.second, 
    35                              dur2_c.timestep }; 
     27    xios::CDuration dur1( dur1_c.year, dur1_c.month, dur1_c.day, dur1_c.hour, dur1_c.minute, dur1_c.second, dur1_c.timestep ); 
     28    xios::CDuration dur2( dur2_c.year, dur2_c.month, dur2_c.day, dur2_c.hour, dur2_c.minute, dur2_c.second, dur2_c.timestep ); 
    3629    xios::CDuration res = dur1 + dur2; 
    3730    return { res.year, res.month, res.day, res.hour, res.minute, res.second, res.timestep }; 
     
    4033  cxios_duration cxios_duration_sub(cxios_duration dur1_c, cxios_duration dur2_c) 
    4134  { 
    42     xios::CDuration dur1 = { dur1_c.year, dur1_c.month, dur1_c.day, 
    43                              dur1_c.hour, dur1_c.minute, dur1_c.second, 
    44                              dur1_c.timestep }; 
    45     xios::CDuration dur2 = { dur2_c.year, dur2_c.month, dur2_c.day, 
    46                              dur2_c.hour, dur2_c.minute, dur2_c.second, 
    47                              dur2_c.timestep }; 
     35    xios::CDuration dur1( dur1_c.year, dur1_c.month, dur1_c.day, dur1_c.hour, dur1_c.minute, dur1_c.second, dur1_c.timestep ); 
     36    xios::CDuration dur2( dur2_c.year, dur2_c.month, dur2_c.day, dur2_c.hour, dur2_c.minute, dur2_c.second, dur2_c.timestep ); 
    4837    xios::CDuration res = dur1 - dur2; 
    4938    return { res.year, res.month, res.day, res.hour, res.minute, res.second, res.timestep }; 
     
    5241  cxios_duration cxios_duration_mult(double val, cxios_duration dur_c) 
    5342  { 
    54     xios::CDuration dur = { dur_c.year, dur_c.month, dur_c.day, 
    55                             dur_c.hour, dur_c.minute, dur_c.second, 
    56                             dur_c.timestep }; 
     43    xios::CDuration dur( dur_c.year, dur_c.month, dur_c.day, dur_c.hour, dur_c.minute, dur_c.second, dur_c.timestep ); 
    5744    xios::CDuration res = val * dur; 
    5845    return { res.year, res.month, res.day, res.hour, res.minute, res.second, res.timestep }; 
     
    6148  cxios_duration cxios_duration_neg(cxios_duration dur_c) 
    6249  { 
    63     xios::CDuration dur = { dur_c.year, dur_c.month, dur_c.day, 
    64                             dur_c.hour, dur_c.minute, dur_c.second, 
    65                             dur_c.timestep }; 
     50    xios::CDuration dur( dur_c.year, dur_c.month, dur_c.day, dur_c.hour, dur_c.minute, dur_c.second, dur_c.timestep ); 
    6651    xios::CDuration res = -dur; 
    6752    return { res.year, res.month, res.day, res.hour, res.minute, res.second, res.timestep }; 
     
    7055  bool cxios_duration_eq(cxios_duration dur1_c, cxios_duration dur2_c) 
    7156  { 
    72     xios::CDuration dur1 = { dur1_c.year, dur1_c.month, dur1_c.day, 
    73                              dur1_c.hour, dur1_c.minute, dur1_c.second, 
    74                              dur1_c.timestep }; 
    75     xios::CDuration dur2 = { dur2_c.year, dur2_c.month, dur2_c.day, 
    76                              dur2_c.hour, dur2_c.minute, dur2_c.second, 
    77                              dur2_c.timestep }; 
     57    xios::CDuration dur1( dur1_c.year, dur1_c.month, dur1_c.day, dur1_c.hour, dur1_c.minute, dur1_c.second, dur1_c.timestep ); 
     58    xios::CDuration dur2( dur2_c.year, dur2_c.month, dur2_c.day, dur2_c.hour, dur2_c.minute, dur2_c.second, dur2_c.timestep ); 
    7859    return (dur1 == dur2); 
    7960  } 
     
    8162  bool cxios_duration_neq(cxios_duration dur1_c, cxios_duration dur2_c) 
    8263  { 
    83     xios::CDuration dur1 = { dur1_c.year, dur1_c.month, dur1_c.day, 
    84                              dur1_c.hour, dur1_c.minute, dur1_c.second, 
    85                              dur1_c.timestep }; 
    86     xios::CDuration dur2 = { dur2_c.year, dur2_c.month, dur2_c.day, 
    87                              dur2_c.hour, dur2_c.minute, dur2_c.second, 
    88                              dur2_c.timestep }; 
     64    xios::CDuration dur1( dur1_c.year, dur1_c.month, dur1_c.day, dur1_c.hour, dur1_c.minute, dur1_c.second, dur1_c.timestep ); 
     65    xios::CDuration dur2( dur2_c.year, dur2_c.month, dur2_c.day, dur2_c.hour, dur2_c.minute, dur2_c.second, dur2_c.timestep ); 
    8966    return (dur1 != dur2); 
    9067  } 
Note: See TracChangeset for help on using the changeset viewer.