Changeset 801
- Timestamp:
- 11/27/15 11:03:05 (9 years ago)
- Location:
- XIOS/trunk/src/interface
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
XIOS/trunk/src/interface/c/icdate.cpp
r794 r801 53 53 } 54 54 55 cxios_date cxios_date_convert_from_string(const char* str, int str_size) 56 { 57 std::string date_str; 58 xios::CDate date; 59 60 if (cstr2string(str, str_size, date_str)) 61 date = xios::CDate::FromString(date_str, 62 getCalendar("cxios_date cxios_date_convert_from_string(const char* str, int str_size)")); 63 64 return { date.getYear(), date.getMonth(), date.getDay(), date.getHour(), date.getMinute(), date.getSecond() }; 65 } 66 55 67 cxios_date cxios_date_add_duration(cxios_date date_c, cxios_duration dur_c) 56 68 { -
XIOS/trunk/src/interface/c/icduration.cpp
r794 r801 13 13 if (!string_copy(dur.toString(), str, str_size)) 14 14 ERROR("void cxios_duration_convert_to_string(cxios_duration dur_c, char* str, int str_size)", << "Input string is too short"); 15 } 16 17 cxios_duration cxios_duration_convert_from_string(const char* str, int str_size) 18 { 19 std::string dur_str; 20 xios::CDuration dur; 21 22 if (cstr2string(str, str_size, dur_str)) 23 dur = xios::CDuration::FromString(dur_str); 24 25 return { dur.year, dur.month, dur.day, dur.hour, dur.minute, dur.second, dur.timestep }; 15 26 } 16 27 -
XIOS/trunk/src/interface/fortran/date_interface.F90
r794 r801 26 26 INTEGER(kind = C_INT), VALUE :: str_size 27 27 END SUBROUTINE cxios_date_convert_to_string 28 29 TYPE(txios(date)) FUNCTION cxios_date_convert_from_string(str, str_size) BIND(C) 30 USE ISO_C_BINDING 31 IMPORT :: txios(date) 32 CHARACTER(kind = C_CHAR), DIMENSION(*) :: str 33 INTEGER(kind = C_INT), VALUE :: str_size 34 END FUNCTION cxios_date_convert_from_string 28 35 29 36 TYPE(txios(date)) FUNCTION cxios_date_add_duration(date, dur) BIND(C) -
XIOS/trunk/src/interface/fortran/duration_interface.F90
r794 r801 17 17 INTEGER(kind = C_INT), VALUE :: str_size 18 18 END SUBROUTINE cxios_duration_convert_to_string 19 20 TYPE(txios(duration)) FUNCTION cxios_duration_convert_from_string(str, str_size) BIND(C) 21 USE ISO_C_BINDING 22 IMPORT :: txios(duration) 23 CHARACTER(kind = C_CHAR), DIMENSION(*) :: str 24 INTEGER(kind = C_INT), VALUE :: str_size 25 END FUNCTION cxios_duration_convert_from_string 19 26 20 27 TYPE(txios(duration)) FUNCTION cxios_duration_add(dur1, dur2) BIND(C) -
XIOS/trunk/src/interface/fortran/idate.F90
r794 r801 63 63 END SUBROUTINE xios(date_convert_to_string) 64 64 65 FUNCTION xios(date_convert_from_string)(str) RESULT(res) 66 USE DATE_INTERFACE, only : txios(date) 67 IMPLICIT NONE 68 CHARACTER(len = *), INTENT(IN) :: str 69 TYPE(txios(date)) :: res 70 71 res = cxios_date_convert_from_string(str, len(str)) 72 END FUNCTION xios(date_convert_from_string) 73 65 74 ! Addition: date + duration = date 66 75 -
XIOS/trunk/src/interface/fortran/iduration.F90
r794 r801 60 60 CALL cxios_duration_convert_to_string(dur, str, len(str)) 61 61 END SUBROUTINE xios(duration_convert_to_string) 62 63 FUNCTION xios(duration_convert_from_string)(str) RESULT(res) 64 USE DURATION_INTERFACE, only : txios(duration) 65 IMPLICIT NONE 66 CHARACTER(len = *), INTENT(IN) :: str 67 TYPE(txios(duration)) :: res 68 69 res = cxios_duration_convert_from_string(str, len(str)) 70 END FUNCTION xios(duration_convert_from_string) 62 71 63 72 ! Addition -
XIOS/trunk/src/interface/fortran/ixios.F90
r794 r801 23 23 USE iduration, ONLY: txios(duration), & 24 24 xios(year), xios(month), xios(day), xios(hour), xios(minute), xios(second), xios(timestep), & 25 xios(duration_convert_to_string), 25 xios(duration_convert_to_string), xios(duration_convert_from_string), & 26 26 xios(duration_add), xios(duration_sub), xios(duration_mult), xios(duration_neg), & 27 27 xios(duration_eq), xios(duration_neq), & 28 28 OPERATOR(+), OPERATOR(-), OPERATOR(*) 29 29 30 USE idate, ONLY : txios(date), &31 xios(date_convert_to_seconds), xios(date_convert_to_string), 32 xios(date_add_duration), xios(date_sub_duration), xios(date_sub), &33 xios(date_eq), xios(date_neq), xios(date_lt), xios(date_le), xios(date_gt), xios(date_ge), &34 xios(date_get_second_of_year), xios(date_get_day_of_year), xios(date_get_fraction_of_year), &35 xios(date_get_second_of_day), xios(date_get_fraction_of_day), &36 OPERATOR(+), OPERATOR(-), &37 OPERATOR(==), OPERATOR(/=), OPERATOR(<), OPERATOR(<=), OPERATOR(>), OPERATOR(>=), &30 USE idate, ONLY : txios(date), & 31 xios(date_convert_to_seconds), xios(date_convert_to_string), xios(date_convert_from_string), & 32 xios(date_add_duration), xios(date_sub_duration), xios(date_sub), & 33 xios(date_eq), xios(date_neq), xios(date_lt), xios(date_le), xios(date_gt), xios(date_ge), & 34 xios(date_get_second_of_year), xios(date_get_day_of_year), xios(date_get_fraction_of_year), & 35 xios(date_get_second_of_day), xios(date_get_fraction_of_day), & 36 OPERATOR(+), OPERATOR(-), & 37 OPERATOR(==), OPERATOR(/=), OPERATOR(<), OPERATOR(<=), OPERATOR(>), OPERATOR(>=), & 38 38 ASSIGNMENT(=) 39 39
Note: See TracChangeset
for help on using the changeset viewer.