Changeset 1978


Ignore:
Timestamp:
11/12/20 12:06:26 (3 years ago)
Author:
ymipsl
Message:

Add get_current_context functionnality with string id, in fortran interface.

YM

Location:
XIOS/trunk/src/interface
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • XIOS/trunk/src/interface/c/iccontext.cpp

    r1622 r1978  
    6868   CATCH_DUMP_STACK 
    6969 
     70   void cxios_context_get_id(XContextPtr context, char * _id, int _id_len) 
     71   TRY 
     72   { 
     73      string_copy(context->getId(),_id,_id_len); 
     74   } 
     75   CATCH_DUMP_STACK 
     76    
    7077   void cxios_context_set_current(XContextPtr context, bool withswap) 
    7178   TRY 
  • XIOS/trunk/src/interface/fortran/context_interface.f90

    r545 r1978  
    1616      END SUBROUTINE cxios_context_get_current 
    1717 
     18      SUBROUTINE cxios_context_get_id(context, idt, idt_size) BIND(C) 
     19         import C_CHAR, C_INTPTR_T, C_INT 
     20         INTEGER (kind = C_INTPTR_T) :: context 
     21         CHARACTER(kind = C_CHAR)    , DIMENSION(*) :: idt 
     22         INTEGER  (kind = C_INT)     , VALUE        :: idt_size 
     23     END SUBROUTINE cxios_context_get_id 
     24 
    1825      SUBROUTINE cxios_context_set_current(context, withswap) BIND(C) 
    1926         import C_BOOL, C_INT, C_INTPTR_T 
  • XIOS/trunk/src/interface/fortran/icontext.F90

    r947 r1978  
    1717   END INTERFACE xios(set_current_context) 
    1818 
     19   INTERFACE xios(get_current_context) 
     20      MODULE PROCEDURE xios(get_current_context_hdl), xios(get_current_context_id) 
     21   END INTERFACE xios(get_current_context) 
     22 
    1923   CONTAINS ! Fonctions disponibles pour les utilisateurs. 
    2024 
     
    2731   END SUBROUTINE xios(get_context_handle) 
    2832 
    29    SUBROUTINE xios(get_current_context)(context) 
     33   SUBROUTINE xios(get_current_context_hdl)(context) 
    3034      IMPLICIT NONE 
    3135 
    32       TYPE(txios(context)), INTENT(IN) :: context 
     36      TYPE(txios(context)), INTENT(OUT) :: context 
    3337 
    3438      CALL cxios_context_get_current(context%daddr) 
    3539 
    36    END SUBROUTINE xios(get_current_context) 
     40   END SUBROUTINE xios(get_current_context_hdl) 
    3741 
     42   SUBROUTINE xios(get_current_context_id)(idt) 
     43      IMPLICIT NONE 
     44      CHARACTER(len = *) , INTENT(OUT) :: idt 
     45      TYPE(txios(context)) :: context 
     46 
     47      CALL cxios_context_get_current(context%daddr) 
     48      CALL cxios_context_get_id(context%daddr, idt, len(idt)) 
     49 
     50   END SUBROUTINE xios(get_current_context_id) 
     51    
    3852   SUBROUTINE xios(set_current_context_hdl)(context, withswap) 
    3953      IMPLICIT NONE 
Note: See TracChangeset for help on using the changeset viewer.