Ignore:
Timestamp:
06/19/13 10:09:36 (8 years ago)
Author:
ymipsl
Message:

Add possibility to make inheritance of attributes and reference before closing the context definition.
New fortran fonction : xios_solve inheritance()
After this call, the value of attribute have the inherited value of their parent.

YM

File:
1 edited

Legend:

Unmodified
Added
Removed
  • XIOS/trunk/src/interface/c_attr/iccontext_attr.cpp

    r432 r445  
    3030  { 
    3131     CTimer::get("XIOS").resume(); 
    32     if(!string_copy(context_hdl->calendar_type.getValue(),calendar_type , calendar_type_size)) 
     32    if(!string_copy(context_hdl->calendar_type.getInheritedValue(),calendar_type , calendar_type_size)) 
    3333      ERROR("void cxios_get_context_calendar_type(context_Ptr context_hdl, char * calendar_type, int calendar_type_size)", <<"Input string is to short"); 
    3434     CTimer::get("XIOS").suspend(); 
     
    3838  { 
    3939     CTimer::get("XIOS").resume(); 
    40     return !context_hdl->calendar_type.isEmpty(); 
     40    return context_hdl->calendar_type.hasInheritedValue(); 
    4141     CTimer::get("XIOS").suspend(); 
    4242  } 
     
    5757  { 
    5858     CTimer::get("XIOS").resume(); 
    59     if(!string_copy(context_hdl->output_dir.getValue(),output_dir , output_dir_size)) 
     59    if(!string_copy(context_hdl->output_dir.getInheritedValue(),output_dir , output_dir_size)) 
    6060      ERROR("void cxios_get_context_output_dir(context_Ptr context_hdl, char * output_dir, int output_dir_size)", <<"Input string is to short"); 
    6161     CTimer::get("XIOS").suspend(); 
     
    6565  { 
    6666     CTimer::get("XIOS").resume(); 
    67     return !context_hdl->output_dir.isEmpty(); 
     67    return context_hdl->output_dir.hasInheritedValue(); 
    6868     CTimer::get("XIOS").suspend(); 
    6969  } 
     
    8484  { 
    8585     CTimer::get("XIOS").resume(); 
    86     if(!string_copy(context_hdl->start_date.getValue(),start_date , start_date_size)) 
     86    if(!string_copy(context_hdl->start_date.getInheritedValue(),start_date , start_date_size)) 
    8787      ERROR("void cxios_get_context_start_date(context_Ptr context_hdl, char * start_date, int start_date_size)", <<"Input string is to short"); 
    8888     CTimer::get("XIOS").suspend(); 
     
    9292  { 
    9393     CTimer::get("XIOS").resume(); 
    94     return !context_hdl->start_date.isEmpty(); 
     94    return context_hdl->start_date.hasInheritedValue(); 
    9595     CTimer::get("XIOS").suspend(); 
    9696  } 
     
    111111  { 
    112112     CTimer::get("XIOS").resume(); 
    113     if(!string_copy(context_hdl->time_origin.getValue(),time_origin , time_origin_size)) 
     113    if(!string_copy(context_hdl->time_origin.getInheritedValue(),time_origin , time_origin_size)) 
    114114      ERROR("void cxios_get_context_time_origin(context_Ptr context_hdl, char * time_origin, int time_origin_size)", <<"Input string is to short"); 
    115115     CTimer::get("XIOS").suspend(); 
     
    119119  { 
    120120     CTimer::get("XIOS").resume(); 
    121     return !context_hdl->time_origin.isEmpty(); 
     121    return context_hdl->time_origin.hasInheritedValue(); 
    122122     CTimer::get("XIOS").suspend(); 
    123123  } 
     
    138138  { 
    139139     CTimer::get("XIOS").resume(); 
    140     if(!string_copy(context_hdl->timestep.getValue(),timestep , timestep_size)) 
     140    if(!string_copy(context_hdl->timestep.getInheritedValue(),timestep , timestep_size)) 
    141141      ERROR("void cxios_get_context_timestep(context_Ptr context_hdl, char * timestep, int timestep_size)", <<"Input string is to short"); 
    142142     CTimer::get("XIOS").suspend(); 
     
    146146  { 
    147147     CTimer::get("XIOS").resume(); 
    148     return !context_hdl->timestep.isEmpty(); 
     148    return context_hdl->timestep.hasInheritedValue(); 
    149149     CTimer::get("XIOS").suspend(); 
    150150  } 
Note: See TracChangeset for help on using the changeset viewer.