New URL for NEMO forge!   http://forge.nemo-ocean.eu

Since March 2022 along with NEMO 4.2 release, the code development moved to a self-hosted GitLab.
This present forge is now archived and remained online for history.
icontext.F90 in vendors/XIOS/current/src/interface/fortran – NEMO

source: vendors/XIOS/current/src/interface/fortran/icontext.F90 @ 3408

Last change on this file since 3408 was 3408, checked in by rblod, 12 years ago

importing initial XIOS vendor drop

  • Property svn:keywords set to Id
File size: 1.4 KB
Line 
1#include "xios_fortran_prefix.hpp"
2
3MODULE ICONTEXT
4   USE, INTRINSIC :: ISO_C_BINDING
5   USE CONTEXT_INTERFACE
6!   USE icontext_attr
7   USE IDATE
8
9   
10   TYPE txios(context)
11      INTEGER(kind = C_INTPTR_T) :: daddr
12   END TYPE txios(context)
13     
14   
15   CONTAINS ! Fonctions disponibles pour les utilisateurs.
16   
17   SUBROUTINE xios(get_context_handle)(idt,ret)
18      IMPLICIT NONE
19      CHARACTER(len = *)  , INTENT(IN)  :: idt     
20      TYPE(txios(context)), INTENT(OUT):: ret
21
22      CALL cxios_context_handle_create(ret%daddr, idt, len(idt))           
23   END SUBROUTINE xios(get_context_handle)
24   
25   SUBROUTINE xios(set_current_context)(context, withswap)
26      IMPLICIT NONE
27
28      TYPE(txios(context))          , INTENT(IN) :: context
29      LOGICAL             , OPTIONAL, INTENT(IN) :: withswap
30      LOGICAL (kind = 1)                       :: wswap
31
32      IF (PRESENT(withswap)) THEN
33         wswap = withswap
34      ELSE
35         wswap = .FALSE.
36      END IF
37      CALL cxios_context_set_current(context%daddr, wswap)
38
39   END SUBROUTINE xios(set_current_context)
40 
41   LOGICAL FUNCTION xios(is_valid_context)(idt)
42      IMPLICIT NONE
43      CHARACTER(len  = *)    , INTENT(IN) :: idt
44      LOGICAL  (kind = 1)                 :: val
45
46      CALL cxios_context_valid_id(val, idt, len(idt));
47      xios(is_valid_context) = val
48
49   END FUNCTION  xios(is_valid_context)
50
51   
52END MODULE ICONTEXT
Note: See TracBrowser for help on using the repository browser.