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 663 for trunk/AGRIF/LIB/WorkWithAllocatelist.c – NEMO

Ignore:
Timestamp:
2007-05-25T18:00:33+02:00 (17 years ago)
Author:
opalod
Message:

RB: update CONV

File:
1 edited

Legend:

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

    r530 r663  
    33/*     CONV (converter) for Agrif (Adaptive Grid Refinement In Fortran)       */ 
    44/*                                                                            */ 
    5 /* Copyright or © or Copr. Laurent Debreu (Laurent.Debreu@imag.fr)            */ 
    6 /*                        Cyril Mazauric (Cyril.Mazauric@imag.fr)             */ 
     5/* Copyright or   or Copr. Laurent Debreu (Laurent.Debreu@imag.fr)            */ 
     6/*                        Cyril Mazauric (Cyril_Mazauric@yahoo.fr)            */ 
    77/* This software is governed by the CeCILL-C license under French law and     */ 
    88/* abiding by the rules of distribution of free software.  You can  use,      */ 
     
    3131/* knowledge of the CeCILL-C license and that you accept its terms.           */ 
    3232/******************************************************************************/ 
    33 /* version 1.0                                                                */ 
     33/* version 1.6                                                                */ 
    3434/******************************************************************************/ 
    3535#include <stdio.h> 
     
    3838#include "decl.h" 
    3939 
    40  
    4140/******************************************************************************/ 
    42 /*                            AddIdentToTheAllocateList_1                     */ 
     41/*                               Add_Allocate_Var_1                           */ 
    4342/******************************************************************************/ 
    4443/* Firstpass 1                                                                */ 
     
    4645/*                                                                            */ 
    4746/******************************************************************************/ 
    48 void AddIdentToTheAllocateList_1(char *nom) 
     47void Add_Allocate_Var_1(char *nom,char *nommodule) 
    4948{ 
    5049   listallocate *newvar; 
     
    5251   int out; 
    5352 
    54    if ( firstpass == 1 )  
     53   if ( firstpass == 1 ) 
    5554   { 
    56       if ( !AllocateList ) 
     55      if ( !List_Allocate_Var ) 
    5756      { 
    5857         newvar = (listallocate *)malloc(sizeof(listallocate)); 
    59          strcpy(newvar->nomvar,nom); 
    60          strcpy(newvar->subroutine,subroutinename); 
    61          strcpy(newvar->module,curmodulename); 
     58         strcpy(newvar->a_nomvar,nom); 
     59         strcpy(newvar->a_subroutine,subroutinename); 
     60         strcpy(newvar->a_module,nommodule); 
    6261         newvar->suiv = NULL; 
    63          AllocateList = newvar; 
     62         List_Allocate_Var = newvar; 
    6463      } 
    6564      else 
    6665      { 
    67          parcours = AllocateList; 
    68          out = 0 ;  
     66         parcours = List_Allocate_Var; 
     67         out = 0 ; 
    6968         while ( parcours->suiv && out == 0 ) 
    7069         { 
    71             if (  !strcasecmp(parcours->nomvar,nom) && 
    72                   !strcasecmp(parcours->subroutine,subroutinename) && 
    73                   !strcasecmp(parcours->module,curmodulename) ) out = 1; 
     70            if (  !strcasecmp(parcours->a_nomvar,nom) && 
     71                  !strcasecmp(parcours->a_subroutine,subroutinename) && 
     72                  !strcasecmp(parcours->a_module,nommodule) ) out = 1; 
    7473            else 
    75                parcours=parcours->suiv;                
     74               parcours=parcours->suiv; 
    7675         } 
    77          if ( out == 0 )  
     76         if ( out == 0 ) 
    7877         { 
    79             if (  !strcasecmp(parcours->nomvar,nom) && 
    80                   !strcasecmp(parcours->subroutine,subroutinename) && 
    81                   !strcasecmp(parcours->module,curmodulename) ) out = 1; 
     78            if (  !strcasecmp(parcours->a_nomvar,nom) && 
     79                  !strcasecmp(parcours->a_subroutine,subroutinename) && 
     80                  !strcasecmp(parcours->a_module,nommodule) ) out = 1; 
    8281            else 
    8382            { 
    8483               /* add the record                                              */ 
    8584              newvar = (listallocate *)malloc(sizeof(listallocate)); 
    86               strcpy(newvar->nomvar,nom); 
    87               strcpy(newvar->subroutine,subroutinename); 
    88               strcpy(newvar->module,curmodulename); 
     85              strcpy(newvar->a_nomvar,nom); 
     86              strcpy(newvar->a_subroutine,subroutinename); 
     87              strcpy(newvar->a_module,nommodule); 
    8988              newvar->suiv = NULL; 
    9089              parcours->suiv = newvar; 
     
    9594} 
    9695 
    97 /******************************************************************************/ 
    98 /*                            IsAllocateInThisSubroutine_0                    */ 
    99 /******************************************************************************/ 
    100 /* Firstpass 0                                                                */ 
    101 /******************************************************************************/ 
    102 /*                                                                            */ 
    103 /******************************************************************************/ 
    104 int IsAllocateInThisSubroutine_0() 
    105 { 
    106    listallocate *parcours; 
    107    int out; 
    108  
    109    out = 0 ;  
    110    if ( firstpass == 0 )  
    111    { 
    112       parcours = AllocateList; 
    113       while ( parcours && out == 0 ) 
    114       { 
    115          if ( !strcasecmp(parcours->subroutine,subroutinename)  ) 
    116          { 
    117             out = 1 ; 
    118          } 
    119          else parcours=parcours->suiv;                
    120       } 
    121    } 
    122    return out; 
    123 } 
    12496 
    12597/******************************************************************************/ 
     
    135107   int out; 
    136108 
    137    out = 0 ;  
    138    if ( firstpass == 0 )  
     109   out = 0 ; 
     110   if ( firstpass == 0 ) 
    139111   { 
    140       parcours = AllocateList; 
     112      parcours = List_Allocate_Var; 
    141113      while ( parcours && out == 0 ) 
    142114      { 
    143          if ( !strcasecmp(parcours->nomvar,ident)  ) out = 1 ; 
    144          else parcours=parcours->suiv;                
     115         if ( !strcasecmp(parcours->a_nomvar,ident)  ) out = 1 ; 
     116         else parcours=parcours->suiv; 
    145117      } 
    146118   } 
     
    158130int varisallocatable_0(char *ident) 
    159131{ 
    160    listvar *newvar; 
    161132   listallocate *newvaralloc; 
    162133   int out; 
     
    165136   if (firstpass == 0 ) 
    166137   { 
    167       newvar = globalvarofusefile; 
    168       while ( newvar && out == 0 ) 
    169       { 
    170          if ( !strcasecmp(ident,newvar->var->nomvar) &&  
    171               newvar->var->allocatable == 1 )  out = 1; 
    172          else newvar = newvar->suiv; 
    173       } 
    174       if ( out == 0 ) 
    175       { 
    176          newvar = globliste; 
    177          while ( newvar && out == 0 ) 
     138         newvaralloc = List_Allocate_Var; 
     139         while ( newvaralloc && out == 0 ) 
    178140         { 
    179             if ( !strcasecmp(ident,newvar->var->nomvar) &&  
    180                  newvar->var->allocatable == 1 )  out = 1; 
    181             else newvar = newvar->suiv; 
    182          }       
    183       } 
    184       if ( out == 0 ) 
    185       { 
    186          newvaralloc = AllocateList; 
    187          while ( newvar && out == 0 ) 
    188          { 
    189             if ( !strcasecmp(ident,newvaralloc->nomvar) &&  
    190                  !strcasecmp(newvaralloc->subroutine,subroutinename) 
    191                )  out = 1; 
     141            if ( !strcasecmp(ident,newvaralloc->a_nomvar) )  out = 1; 
    192142            else newvaralloc = newvaralloc->suiv; 
    193          }       
    194       } 
     143         } 
    195144   } 
    196145   return out; 
Note: See TracChangeset for help on using the changeset viewer.