Changes between Version 2 and Version 3 of user/nicolasmartin/CommitMessage
- Timestamp:
- 2019-10-10T11:45:03+02:00 (5 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
user/nicolasmartin/CommitMessage
v2 v3 2 2 These changes enable sufficient support for allocatable, zero-dimension character variables defined using the: 3 3 4 {{{ #!f4 {{{ 5 5 CHARACTER(LEN=:), ALLOCATABLE :: cstr 6 6 }}} … … 10 10 1. Adding : as a valid length identifier at line 1028 in fortran.y (and then rebuilding fortran.c and main.c via make -f Makefile.lex) 11 11 2. Adding a carrayu entry to Agrif_Variable_c type in AGRIF_FILES/modtypes.F90 where carrayu is declared as: 12 {{{#! f12 {{{#!c++ 13 13 character(:) , allocatable :: carrayu 14 14 }}} 15 15 3. Ensuring correct deallocation of carrayu in AGRIF_FILES/modsauv.F90 and AGRIF_FILES/modutil.F90 16 16 4. Substituting carrayu in place of carray0 declarations when character length matches : for zero-dimension variables. This occurs twice in LIB/toamr.c, e.g: 17 {{{ #!f17 {{{ 18 18 if (!strcasecmp(var->v_dimchar ,":") && var->v_nbdim == 0 ) 19 19 { … … 24 24 }}} 25 25 Any such character variables must be allocated by the user. Typically this is done with lines such as: 26 {{{ #!f26 {{{ 27 27 IF ( .NOT. ALLOCATED(cdnambuff) ) ALLOCATE( CHARACTER(LEN=kleng) :: cdnambuff ) 28 28 }}} 29 29 making AGRIF accept the CHARACTER(LEN=kleng) :: construct within the ALLOCATE statement was beyond my skills. Fortunately, for the current purpose, this 30 30 isn't necessary since such allocations only occur within utility routines in which the appropriate tabvar has been passed down. So: 31 {{{ #!f31 {{{ 32 32 !$AGRIF_DO_NOT_TREAT 33 33 IF ( .NOT. ALLOCATED(cdnambuff) ) ALLOCATE( CHARACTER(LEN=kleng) :: cdnambuff )