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.
Changeset 774 for trunk/AGRIF/LIB/UtilListe.c – NEMO

Ignore:
Timestamp:
2007-12-18T17:45:53+01:00 (16 years ago)
Author:
rblod
Message:

Update Agrif, see ticket:#39

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/AGRIF/LIB/UtilListe.c

    r663 r774  
    3131/* knowledge of the CeCILL-C license and that you accept its terms.           */ 
    3232/******************************************************************************/ 
    33 /* version 1.6                                                                */ 
     33/* version 1.7                                                                */ 
    3434/******************************************************************************/ 
    3535#include <stdio.h> 
     
    116116{ 
    117117   if (!strcasecmp(type,"character") && strcasecmp(CharacterSize,"") ) 
    118                             strcpy(curvar->v_dimchar,CharacterSize); 
     118   { 
     119      strcpy(curvar->v_dimchar,CharacterSize); 
     120      Save_Length(CharacterSize,5); 
     121   } 
    119122 
    120123  /* On donne la precision de la variable si elle a ete donnee                */ 
     
    123126  /*                                                                          */ 
    124127  strcpy(curvar->v_vallengspec,""); 
    125   if ( strcasecmp(vallengspec,"") ) strcpy(curvar->v_vallengspec,vallengspec); 
     128  if ( strcasecmp(vallengspec,"") ) 
     129  { 
     130     strcpy(curvar->v_vallengspec,vallengspec); 
     131     Save_Length(vallengspec,8); 
     132  } 
    126133 
    127134  strcpy(curvar->v_precision,""); 
    128   if ( strcasecmp(NamePrecision,"") ) strcpy(curvar->v_precision,NamePrecision); 
     135  if ( strcasecmp(NamePrecision,"") ) 
     136  { 
     137     strcpy(curvar->v_precision,NamePrecision); 
     138     Save_Length(NamePrecision,12); 
     139  } 
    129140  /* Si cette variable a ete declaree dans un module on met curvar->module=1  */ 
    130141  if ( inmoduledeclare == 1 || SaveDeclare == 1) 
     
    134145   /* Puis on donne le nom du module dans curvar->v_modulename                */ 
    135146   strcpy(curvar->v_modulename,curmodulename); 
     147   Save_Length(curmodulename,6); 
    136148   /* Si cette variable a ete initialisee                                     */ 
    137    if (InitialValueGiven == 1 ) strcpy(curvar->v_initialvalue,InitValue); 
     149   if (InitialValueGiven == 1 ) 
     150   { 
     151      strcpy(curvar->v_initialvalue,InitValue); 
     152      Save_Length(InitValue,14); 
     153   } 
    138154   /* Si cette variable est declaree en save                                  */ 
    139155   if (SaveDeclare == 1 ) curvar->v_save = 1; 
     
    141157   if (Allocatabledeclare == 1 ) curvar->v_allocatable=1; 
    142158   /* if INTENT spec has been given                                           */ 
    143    if ( strcasecmp(IntentSpec,"") ) strcpy(curvar->v_IntentSpec,IntentSpec); 
     159   if ( strcasecmp(IntentSpec,"") ) 
     160   { 
     161      strcpy(curvar->v_IntentSpec,IntentSpec); 
     162      Save_Length(IntentSpec,13); 
     163   } 
    144164} 
    145165 
     
    190210      tmpvar->v_pointedvar=parcours->var->v_pointedvar; 
    191211      strcpy(tmpvar->v_commoninfile,mainfile); 
     212      Save_Length(mainfile,10); 
    192213      strcpy(tmpvar->v_subroutinename,parcours->var->v_subroutinename); 
    193214      tmpvar->v_dimensiongiven=parcours->var->v_dimensiongiven; 
     
    277298      v=parcours_var->var; 
    278299      strcpy(v->v_dimchar,(lin->dim).last); 
     300      Save_Length((lin->dim).last,5); 
    279301      parcours_var=parcours_var->suiv; 
    280302   } 
     
    316338  variable *var; 
    317339  listdim *dims; 
    318   char ligne[LONGNOM]; 
    319   char listdimension[LONGNOM]; 
     340  char ligne[LONG_C]; 
     341  char listdimension[LONG_C]; 
    320342 
    321343   var=(variable *) malloc(sizeof(variable)); 
     
    324346   /*                                                                         */ 
    325347   strcpy(var->v_nomvar,nom); 
     348   Save_Length(nom,4); 
    326349   /*                                                                         */ 
    327350   strcpy(listdimension,""); 
    328351   strcpy(var->v_modulename,curmodulename); 
     352   Save_Length(curmodulename,6); 
    329353   strcpy(var->v_commoninfile,mainfile); 
     354   Save_Length(mainfile,10); 
    330355   strcpy(var->v_subroutinename,subroutinename); 
     356   Save_Length(subroutinename,11); 
    331357   /*                                                                         */ 
    332358   if ( strcasecmp(nameinttypename,"") ) 
    333                                  strcpy(var->v_nameinttypename,nameinttypename); 
     359   { 
     360      strcpy(var->v_nameinttypename,nameinttypename); 
     361      Save_Length(nameinttypename,9); 
     362   } 
    334363   if ( optionaldeclare     == 1 ) var->v_optionaldeclare = 1; 
    335364   if ( pointerdeclare      == 1 ) var->v_pointerdeclare = 1; 
     
    361390   } 
    362391   strcpy(var->v_readedlistdimension,listdimension); 
     392   Save_Length(listdimension,15); 
    363393   /*                                                                         */ 
    364394   var->v_nbdim=num_dims(d); 
     
    428458      v=newvar->var; 
    429459      strcpy(v->v_typevar,nom); 
     460      Save_Length(nom,3); 
    430461      newvar=newvar->suiv; 
    431462   } 
Note: See TracChangeset for help on using the changeset viewer.