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

Ignore:
Timestamp:
2006-10-17T17:36:11+02:00 (18 years ago)
Author:
opalod
Message:

RB: update of the conv for IOM and NEC MPI library

File:
1 edited

Legend:

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

    r396 r530  
    33/*     CONV (converter) for Agrif (Adaptive Grid Refinement In Fortran)       */ 
    44/*                                                                            */ 
    5 /*     Copyright (C) 2005 Laurent Debreu (Laurent.Debreu@imag.fr)             */ 
     5/* Copyright or © or Copr. Laurent Debreu (Laurent.Debreu@imag.fr)            */ 
    66/*                        Cyril Mazauric (Cyril.Mazauric@imag.fr)             */ 
    7 /*                                                                            */ 
    8 /*     This program is free software; you can redistribute it and/or modify   */ 
    9 /*    it                                                                      */ 
    10 /*                                                                            */ 
    11 /*    This program is distributed in the hope that it will be useful,         */ 
    12 /*     but WITHOUT ANY WARRANTY; without even the implied warranty of         */ 
    13 /*     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the          */ 
    14 /*    GNU General Public License for more details.                            */ 
    15 /*                                                                            */ 
     7/* This software is governed by the CeCILL-C license under French law and     */ 
     8/* abiding by the rules of distribution of free software.  You can  use,      */ 
     9/* modify and/ or redistribute the software under the terms of the CeCILL-C   */ 
     10/* license as circulated by CEA, CNRS and INRIA at the following URL          */ 
     11/* "http://www.cecill.info".                                                  */ 
     12/*                                                                            */ 
     13/* As a counterpart to the access to the source code and  rights to copy,     */ 
     14/* modify and redistribute granted by the license, users are provided only    */ 
     15/* with a limited warranty  and the software's author,  the holder of the     */ 
     16/* economic rights,  and the successive licensors  have only  limited         */ 
     17/* liability.                                                                 */ 
     18/*                                                                            */ 
     19/* In this respect, the user's attention is drawn to the risks associated     */ 
     20/* with loading,  using,  modifying and/or developing or reproducing the      */ 
     21/* software by the user in light of its specific status of free software,     */ 
     22/* that may mean  that it is complicated to manipulate,  and  that  also      */ 
     23/* therefore means  that it is reserved for developers  and  experienced      */ 
     24/* professionals having in-depth computer knowledge. Users are therefore      */ 
     25/* encouraged to load and test the software's suitability as regards their    */ 
     26/* requirements in conditions enabling the security of their systems and/or   */ 
     27/* data to be ensured and,  more generally, to use and operate it in the      */ 
     28/* same conditions as regards security.                                       */ 
     29/*                                                                            */ 
     30/* The fact that you are presently reading this means that you have had       */ 
     31/* knowledge of the CeCILL-C license and that you accept its terms.           */ 
     32/******************************************************************************/ 
     33/* version 1.0                                                                */ 
    1634/******************************************************************************/ 
    1735#include <stdio.h> 
     
    2139 
    2240/******************************************************************************/ 
    23 /*                      COM_1_AddCommonvartolist                              */ 
     41/*                           Addtolistvarcommon                               */ 
    2442/******************************************************************************/ 
    2543/*  This subroutines is used to add the variable defined in common in the     */ 
     
    2846/*                                                                            */ 
    2947/******************************************************************************/ 
    30 void COM_1_AddCommonvartolist() 
     48void Addtolistvarcommon() 
    3149{ 
    3250   listvarcommon *newvar; 
     
    3755   strcpy(newvar->subroutinename,subroutinename); 
    3856   newvar->positioninblock= positioninblock; 
    39  
    4057   newvar->suiv = NULL; 
    4158 
     
    5269 
    5370/******************************************************************************/ 
    54 /*                     Addtolistnom                                           */ 
     71/*                           Addtolistnom                                     */ 
    5572/******************************************************************************/ 
    5673/* This subroutine is used to add a variable to the list                      */ 
     
    6481   int out; 
    6582 
    66    if ( !listin ) 
    67    { 
    68       newnom=(listnom *) malloc (sizeof (listnom)); 
    69       strcpy(newnom->nom,nom); 
    70       newnom->suiv = NULL; 
    71       listin = newnom; 
    72    } 
     83   newnom=(listnom *) malloc (sizeof (listnom)); 
     84   strcpy(newnom->nom,nom); 
     85   newnom->suiv = NULL; 
     86 
     87   if ( !listin ) listin = newnom; 
    7388   else 
    7489   { 
     
    8297      if ( out == 0 )  
    8398      { 
    84           newnom=(listnom *) malloc (sizeof (listnom)); 
    85           strcpy(newnom->nom,nom); 
    8699          newnom->suiv = listin; 
    87100          listin = newnom; 
    88101      } 
     102      else 
     103      { 
     104         free(newnom); 
     105      } 
    89106   } 
    90107   return listin; 
     
    92109 
    93110/******************************************************************************/ 
    94 /*                           Add_listname                                     */ 
     111/*                           Addtolistname                                     */ 
    95112/******************************************************************************/ 
    96113/* This subroutine is used to add a        variable to the list               */ 
     
    104121/*                                                                            */ 
    105122/******************************************************************************/ 
    106 listname *Add_listname(char *nom,listname *input) 
     123listname *Addtolistname(char *nom,listname *input) 
    107124{ 
    108125   listname *newnom; 
     
    135152   } 
    136153   return input; 
    137 } 
    138  
    139 /******************************************************************************/ 
    140 /*                     Add_ModuleTo_listofmodules                             */ 
    141 /******************************************************************************/ 
    142 /* This subroutine is used to add a        variable to the list               */ 
    143 /******************************************************************************/ 
    144 /*        _______     _______     _______     _______     _______             */ 
    145 /*       +      +    +      +    +      +    +      +    +      +             */ 
    146 /*       + NEW  +--->+ glob +--->+ glob +--->+ glob +--->+ glob +             */ 
    147 /*       +______+    +______+    +______+    +______+    +______+             */ 
    148 /*                                                                            */ 
    149 /*                                                                            */ 
    150 /*                                                                            */ 
    151 /******************************************************************************/ 
    152 void Add_ModuleTo_listofmodules(char *nom) 
    153 { 
    154    listnom *newnom; 
    155  
    156    newnom=(listnom *) malloc (sizeof (listnom)); 
    157    strcpy(newnom->nom,nom); 
    158    newnom->suiv = listofmodules; 
    159    listofmodules = newnom;    
    160154} 
    161155 
     
    187181 
    188182/******************************************************************************/ 
    189 /*                         AddNameToListNamelist                              */ 
     183/*                       AddNameToListNamelist_1                              */ 
    190184/******************************************************************************/ 
    191185/* This subroutine is used to add a listvar l at the end of a listvar         */ 
     
    199193/*                                                                            */ 
    200194/******************************************************************************/ 
    201 void AddNameToListNamelist(char * name) 
     195void AddNameToListNamelist_1(char * name) 
    202196{ 
    203197   listnamelist *newvar; 
    204  
    205    if ( strcasecmp(name,"") ) 
    206    { 
    207       newvar =(listnamelist*)malloc(sizeof(listnamelist)); 
    208       strcpy(newvar->name,name); 
    209       newvar->suiv = listenamelist; 
    210       listenamelist = newvar; 
     198    
     199   if ( firstpass == 1 ) 
     200   { 
     201      if ( strcasecmp(name,"") ) 
     202      { 
     203         newvar =(listnamelist*)malloc(sizeof(listnamelist)); 
     204         strcpy(newvar->name,name); 
     205         newvar->suiv = listenamelist; 
     206         listenamelist = newvar; 
     207      } 
    211208   } 
    212209} 
     
    263260 
    264261/******************************************************************************/ 
    265 /*                     Add_ModuleTo_Modulelist                                */ 
     262/*                   Add_ModuleTo_Modulelist_1                                */ 
    266263/******************************************************************************/ 
    267264/* This subroutine is used to add a        variable to the list               */ 
     
    275272/*                                                                            */ 
    276273/******************************************************************************/ 
    277 void Add_ModuleTo_Modulelist(char *nom) 
     274void Add_ModuleTo_Modulelist_1(char *nom) 
    278275{ 
    279276   listnom *newnom; 
    280277 
    281    newnom=(listnom *) malloc (sizeof (listnom)); 
    282    strcpy(newnom->nom,nom); 
    283    newnom->suiv = modulelist; 
    284    modulelist = newnom;    
    285 } 
    286  
    287 /******************************************************************************/ 
    288 /*                 OPTI_1_completelistvarpointtovar                           */ 
     278   if ( firstpass == 1 ) 
     279   { 
     280      newnom=(listnom *) malloc (sizeof (listnom)); 
     281      strcpy(newnom->nom,nom); 
     282      newnom->suiv = modulelist; 
     283      modulelist = newnom;    
     284   } 
     285} 
     286 
     287/******************************************************************************/ 
     288/*                 completelistvarpointtovar_1                                */ 
    289289/******************************************************************************/ 
    290290/* Firstpass 1                                                                */ 
     
    293293/*                                                                            */ 
    294294/******************************************************************************/ 
    295 void OPTI_1_completelistvarpointtovar(char *namemodule,listcouple *couple) 
     295void completelistvarpointtovar_1(char *namemodule,listcouple *couple) 
    296296{ 
    297297   listvarpointtovar *pointtmp; 
     
    318318 
    319319/******************************************************************************/ 
    320 /*                        Addincludetothelist                                 */ 
     320/*                      Addincludetothelist_1                                 */ 
    321321/******************************************************************************/ 
    322322/* This subroutine is used to add a record to a list of struct                */ 
     
    333333/*                                                                            */ 
    334334/******************************************************************************/ 
    335 void Addincludetothelist(char *name) 
     335void Addincludetothelist_1(char *name) 
    336336{ 
    337337  listusemodule *newinclude; 
    338338 
     339  if ( firstpass == 1 ) 
     340  { 
    339341  newinclude =(listusemodule *)malloc(sizeof(listusemodule)); 
    340342  strcpy(newinclude->usemodule,name); 
     
    350352    newinclude->suiv = listofincludebysubroutine; 
    351353    listofincludebysubroutine = newinclude; 
     354  } 
    352355  } 
    353356} 
Note: See TracChangeset for help on using the changeset viewer.