Ignore:
Timestamp:
12/11/14 14:32:37 (10 years ago)
Author:
rlacroix
Message:

Add a new attribute type for durations and use it for the context's timestep.

Note that the "xios_time" type and the "xios_set_timestep" procedure have been removed from the Fortran interface. Instead, the "xios_duration" type and the "xios_get_context_attr"/"xios_set_context_attr" procedures should now be used to get/set the timestep.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • XIOS/trunk/src/interface/fortran/idate.F90

    r532 r537  
    1010   END TYPE txios(date) 
    1111 
    12    TYPE txios(time) 
    13       REAL(kind = 8) :: year=0, month=0, day=0, hour=0, minute=0, second=0 
    14    END TYPE txios(time)    
     12   TYPE, BIND(C) :: txios(duration) 
     13      REAL(kind = C_DOUBLE) :: year=0, month=0, day=0, hour=0, minute=0, second=0, timestep=0 
     14   END TYPE txios(duration) 
    1515 
    1616   INTERFACE ! Ne pas appeler directement/Interface FORTRAN 2003 <-> C99 
    17     
    18       SUBROUTINE cxios_set_timestep(ts_year, ts_month, ts_day, ts_hour, ts_minute, ts_second) BIND(C) 
    19          IMPORT C_DOUBLE 
    20          REAL (kind = C_DOUBLE), VALUE :: ts_year, ts_month , ts_day   , & 
    21                                           ts_hour, ts_minute, ts_second 
    22       END SUBROUTINE cxios_set_timestep 
    2317 
    2418      SUBROUTINE cxios_update_calendar(step) BIND(C) 
     
    2620         INTEGER (kind = C_INT), VALUE :: step 
    2721      END SUBROUTINE cxios_update_calendar 
    28        
     22 
    2923   END INTERFACE 
    3024    
    3125   CONTAINS ! Fonctions disponibles pour les utilisateurs. 
    3226 
    33  
    34    SUBROUTINE xios(set_timestep)(timestep) 
    35       IMPLICIT NONE 
    36       TYPE(txios(time)), INTENT(IN):: timestep 
    37  
    38       CALL cxios_set_timestep(timestep%year, timestep%month , timestep%day, & 
    39                              timestep%hour, timestep%minute, timestep%second) 
    40  
    41    END SUBROUTINE xios(set_timestep) 
    42  
    43  
    44     
    4527   SUBROUTINE xios(update_calendar)(step) 
    4628     IMPLICIT NONE 
     
    5234      END IF 
    5335      CALL cxios_update_calendar(step) 
    54        
    5536   END SUBROUTINE xios(update_calendar) 
    5637 
    57     
    5838END MODULE IDATE 
Note: See TracChangeset for help on using the changeset viewer.