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 6758 for branches/UKMO/dev_r5518_25hr_mean_assim_bkg/NEMOGCM/EXTERNAL/AGRIF/LIB/WorkWithAllocatelist.c – NEMO

Ignore:
Timestamp:
2016-06-29T17:49:04+02:00 (8 years ago)
Author:
kingr
Message:

Merged branches/UKMO/nemo_v3_6_STABLE_copy@6237

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/UKMO/dev_r5518_25hr_mean_assim_bkg/NEMOGCM/EXTERNAL/AGRIF/LIB/WorkWithAllocatelist.c

    r6757 r6758  
    4545/*                                                                            */ 
    4646/******************************************************************************/ 
    47 void Add_Allocate_Var_1(char *nom,char *nommodule) 
     47void Add_Allocate_Var_1(const char *nom, const char *nommodule) 
    4848{ 
    4949   listallocate *newvar; 
     
    5555      if ( !List_Allocate_Var ) 
    5656      { 
    57          newvar = (listallocate *)malloc(sizeof(listallocate)); 
     57         newvar = (listallocate *)calloc(1,sizeof(listallocate)); 
    5858         strcpy(newvar->a_nomvar,nom); 
     59         strcpy(newvar->a_subroutine,subroutinename); 
     60         strcpy(newvar->a_module,nommodule); 
    5961         Save_Length(nom,25); 
    60          strcpy(newvar->a_subroutine,subroutinename); 
    61          Save_Length(subroutinename,26); 
    62          strcpy(newvar->a_module,nommodule); 
    63          Save_Length(nommodule,27); 
    6462         newvar->suiv = NULL; 
    6563         List_Allocate_Var = newvar; 
     
    7169         while ( parcours->suiv && out == 0 ) 
    7270         { 
    73             if (  !strcasecmp(parcours->a_nomvar,nom) && 
    74                   !strcasecmp(parcours->a_subroutine,subroutinename) && 
    75                   !strcasecmp(parcours->a_module,nommodule) ) out = 1; 
     71            if (  !strcasecmp(parcours->a_nomvar, nom) && 
     72                  !strcasecmp(parcours->a_subroutine, subroutinename) && 
     73                  !strcasecmp(parcours->a_module, nommodule) ) out = 1; 
    7674            else 
    7775               parcours=parcours->suiv; 
     
    8583            { 
    8684               /* add the record                                              */ 
    87               newvar = (listallocate *)malloc(sizeof(listallocate)); 
    88               strcpy(newvar->a_nomvar,nom); 
     85              newvar = (listallocate *)calloc(1,sizeof(listallocate)); 
     86              strcpy(newvar->a_nomvar, nom); 
     87              strcpy(newvar->a_subroutine, subroutinename); 
     88              strcpy(newvar->a_module, nommodule); 
    8989              Save_Length(nom,25); 
    90               strcpy(newvar->a_subroutine,subroutinename); 
    91               Save_Length(subroutinename,26); 
    92               strcpy(newvar->a_module,nommodule); 
    93               Save_Length(nommodule,27); 
    9490              newvar->suiv = NULL; 
    9591              parcours->suiv = newvar; 
     
    108104/*                                                                            */ 
    109105/******************************************************************************/ 
    110 int IsVarAllocatable_0(char *ident) 
    111 { 
    112    listallocate *parcours; 
    113    int out; 
    114  
    115    out = 0 ; 
    116    if ( firstpass == 0 ) 
    117    { 
    118       parcours = List_Allocate_Var; 
    119       while ( parcours && out == 0 ) 
    120       { 
    121          if ( !strcasecmp(parcours->a_nomvar,ident)  ) out = 1 ; 
    122          else parcours=parcours->suiv; 
    123       } 
    124    } 
    125    return out; 
    126 } 
    127  
    128  
    129 /******************************************************************************/ 
    130 /*                          varisallocatable_0                                */ 
    131 /******************************************************************************/ 
    132 /* Firstpass 0                                                                */ 
    133 /******************************************************************************/ 
    134 /*                                                                            */ 
    135 /******************************************************************************/ 
    136 int varisallocatable_0(char *ident) 
    137 { 
    138    listallocate *newvaralloc; 
    139    int out; 
    140  
    141    out =0; 
    142    if (firstpass == 0 ) 
    143    { 
    144          newvaralloc = List_Allocate_Var; 
    145          while ( newvaralloc && out == 0 ) 
    146          { 
    147             if ( !strcasecmp(ident,newvaralloc->a_nomvar) )  out = 1; 
    148             else newvaralloc = newvaralloc->suiv; 
    149          } 
    150    } 
    151    return out; 
    152 } 
     106// int IsVarAllocatable_0(const char *ident) 
     107// { 
     108//    listallocate *parcours; 
     109//    int out; 
     110//  
     111//    out = 0 ; 
     112//    if ( firstpass == 0 ) 
     113//    { 
     114//       parcours = List_Allocate_Var; 
     115//       while ( parcours && out == 0 ) 
     116//       { 
     117//          if ( !strcasecmp(parcours->a_nomvar,ident)  ) out = 1 ; 
     118//          else parcours=parcours->suiv; 
     119//       } 
     120//    } 
     121//    return out; 
     122// } 
Note: See TracChangeset for help on using the changeset viewer.