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

Ignore:
Timestamp:
2008-09-24T15:05:20+02:00 (16 years ago)
Author:
rblod
Message:

Adapt Agrif to the new SBC and correct several bugs for agrif (restart writing and reading), see ticket #133
Note : this fix does not work yet on NEC computerq (sxf90/360)

File:
1 edited

Legend:

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

    r774 r1200  
    250250 
    251251  pointtmplist = List_CouplePointed_Var; 
    252  
    253252  while ( pointtmplist ) 
    254253  { 
     
    312311                        strcpy(var1->v_nameinttypename,var2->v_nameinttypename); 
    313312   else strcpy(var2->v_nameinttypename,var1->v_nameinttypename); 
    314  
     313           
    315314   if ( !strcasecmp(var1->v_commoninfile,"") ) 
    316315                              strcpy(var1->v_commoninfile,var2->v_commoninfile); 
     
    425424      } 
    426425      /* if variable has been found                                           */ 
     426       
    427427      if ( out == 1 ) CopyRecord(parcours->var,parcours1->var); 
     428       
    428429      /* looking in List_Dimension_Var                                        */ 
    429430      if (out == 0 ) 
     
    447448        } 
    448449        /* if variable has been found                                         */ 
     450         
    449451        if ( out == 1 ) 
    450452        { 
     
    522524   listvar *parcours1; 
    523525   int out; 
    524  
    525526   parcours = list_to_modify; 
    526527   while( parcours ) 
     
    558559   listvar *parcours1; 
    559560   int out; 
    560  
     561    
    561562   parcours = list_to_modify; 
    562563   while( parcours ) 
    563564   { 
    564565      /* looking in List_Global_Var                                           */ 
     566       
     567      out = 0; 
     568      if (list_to_modify != List_SubroutineDeclaration_Var) { 
    565569      parcours1 = List_Global_Var; 
    566       out = 0; 
    567570      while ( parcours1 && out == 0 ) 
    568571      { 
     
    574577         else parcours1 = parcours1->suiv; 
    575578      } 
     579      } 
     580           
    576581      /* if variable has been found                                           */ 
    577       if ( out == 1 ) CopyRecord(parcours->var,parcours1->var); 
     582      if ( out == 1 ) { 
     583      CopyRecord(parcours->var,parcours1->var); 
     584      } 
    578585      /* looking in List_SubroutineDeclaration_Var                            */ 
    579586      else 
     
    592599            else parcours1 = parcours1->suiv; 
    593600         } 
     601              
    594602         /* if variable has been found                                        */ 
    595          if ( out == 1 ) CopyRecord(parcours->var,parcours1->var); 
     603         if ( out == 1 ) { 
     604         CopyRecord(parcours->var,parcours1->var); 
     605         } 
    596606         else 
    597607         { 
     
    610620            } 
    611621            /* if variable has been found                                     */ 
    612             if ( out == 1 ) CopyRecord(parcours->var,parcours1->var); 
     622            if ( out == 1 ) CopyRecord(parcours->var,parcours1->var);        
    613623         } 
    614624      } 
    615625      parcours = parcours->suiv; 
    616626   } 
     627    
    617628} 
    618629 
     
    823834void UpdateListDeclarationWithDimensionList() 
    824835{ 
    825  
    826836   List_SubroutineDeclaration_Var = AddListvarToListvar(List_Dimension_Var, 
    827837                                              List_SubroutineDeclaration_Var,1); 
    828  
    829838} 
    830839 
     
    843852   listvar *parcoursprec; 
    844853   int remove; 
    845  
     854     
     855         
    846856   parcoursprec = (listvar *)NULL; 
    847857   parcours = List_UsedInSubroutine_Var; 
     
    952962   listvar *parcoursprec; 
    953963   int out ; 
    954  
     964            
    955965   parcoursprec = (listvar *)NULL; 
    956966   parcours = List_SubroutineDeclaration_Var; 
     
    10031013      } 
    10041014   } 
     1015        
    10051016} 
    10061017 
     
    10791090   Clean_List_UsedInSubroutine_Var(); 
    10801091   Clean_List_SubroutineDeclaration_Var(); 
    1081  
     1092    
    10821093   newvar = (listvar *)NULL; 
    10831094/*   newvar = List_Common_Var;*/ 
     
    11041115{ 
    11051116   listvar *newvar; 
    1106  
     1117         
    11071118   Update_List_Subroutine_Var(List_SubroutineArgument_Var); 
     1119 
     1120 
     1121        
    11081122   Update_List_Subroutine_Var(List_FunctionType_Var); 
    11091123   Update_List_Var(List_Parameter_Var); 
     
    11161130   Update_List_Var(List_UsedInSubroutine_Var); 
    11171131   Update_List_From_Common_Var(List_UsedInSubroutine_Var); 
     1132   Update_List_From_Common_Var(List_SubroutineDeclaration_Var); 
    11181133   Update_NotGridDepend_Var(List_NotGridDepend_Var); 
    1119  
     1134     
    11201135   newvar =(listvar * )NULL; 
    11211136/*   newvar = List_Common_Var;*/ 
     
    11861201      parcours = parcours -> suiv ; 
    11871202   } 
     1203        
    11881204} 
    11891205 
     
    12551271      parcours = parcours->suiv; 
    12561272   } 
     1273        
    12571274} 
    12581275 
     
    15741591              !strcasecmp(parcours->var->v_subroutinename,"")            && 
    15751592              parcours->var->v_VariableIsParameter == 0                  && 
    1576               parcours->var->v_allocatable == 0                          && 
     1593              (parcours->var->v_allocatable == 0  || !strcasecmp(parcours->var->v_typevar,"type"))      && 
    15771594              parcours->var->v_notgrid == 0                              && 
    15781595              ( parcours->var->v_nbdim != 0 || 
     
    17191736   while ( parcours4 ) 
    17201737   { 
    1721       if ( parcours4->var->v_allocatable == 1 ) 
     1738      if ( parcours4->var->v_allocatable == 1 && strcasecmp(parcours4->var->v_typevar,"type")) 
    17221739      { 
    17231740         Add_SubroutineWhereAgrifUsed_1(parcours4->var->v_subroutinename, 
Note: See TracChangeset for help on using the changeset viewer.