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.
WorkWithlistmoduleinfile.c in trunk/AGRIF/LIB – NEMO

source: trunk/AGRIF/LIB/WorkWithlistmoduleinfile.c @ 530

Last change on this file since 530 was 530, checked in by opalod, 18 years ago

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

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 7.8 KB
Line 
1/******************************************************************************/
2/*                                                                            */
3/*     CONV (converter) for Agrif (Adaptive Grid Refinement In Fortran)       */
4/*                                                                            */
5/* Copyright or © or Copr. Laurent Debreu (Laurent.Debreu@imag.fr)            */
6/*                        Cyril Mazauric (Cyril.Mazauric@imag.fr)             */
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                                                                */
34/******************************************************************************/
35#include <stdio.h>
36#include <stdlib.h>
37#include <string.h>
38#include "decl.h"
39
40/******************************************************************************/
41/*                       FillInlistmodule_1                                   */
42/******************************************************************************/
43/*                                                                            */
44/******************************************************************************/
45void FillInlistmodule_1()
46{
47   listmodule *tmplist;
48   
49   
50   if (firstpass == 1) 
51   {   
52      tmplist = (listmodule *)malloc(sizeof(listmodule));
53      strcpy(tmplist->module,curmodulename);
54      tmplist->AllocShouldMade = 0;
55      tmplist->Alloc = 0;
56      /*         */
57      if ( !listmoduleinfile)
58      {
59         listmoduleinfile = tmplist; 
60         tmplist->suiv = NULL;
61      }
62      else
63      {
64         tmplist->suiv = listmoduleinfile;
65         listmoduleinfile = tmplist;     
66      }
67   }
68}
69
70
71/******************************************************************************/
72/*                    AllocShouldMadeTo0InModule_1                            */
73/******************************************************************************/
74/*                                                                            */
75/******************************************************************************/
76void AllocShouldMadeTo0InModule_1()
77{
78   listmodule *tmplist;
79   
80   
81   if (firstpass == 1 && listmoduleinfile ) 
82   {
83      tmplist=listmoduleinfile;
84      /* we should find the module in the listmoduleinfile                    */
85      while ( strcasecmp(tmplist->module,curmodulename) ) tmplist=tmplist->suiv;
86      /* and turn the flag to 0                                               */
87      tmplist->AllocShouldMade = 0 ;
88   }
89}
90
91
92/******************************************************************************/
93/*                    AllocShouldMadeTo1InModule_1                            */
94/******************************************************************************/
95/*                                                                            */
96/******************************************************************************/
97void AllocShouldMadeTo1InModule_1()
98{
99   listmodule *tmplist;
100   
101   
102   if (firstpass == 1 && listmoduleinfile ) 
103   {
104      tmplist=listmoduleinfile;
105      /* we should find the module in the listmoduleinfile                    */
106      while ( strcasecmp(tmplist->module,curmodulename) ) tmplist=tmplist->suiv;
107      /* and turn the flag to 0                                               */
108      tmplist->AllocShouldMade = 1 ;
109   }
110}
111
112/******************************************************************************/
113/*                         AllocTo1InModule_1                                 */
114/******************************************************************************/
115/*                                                                            */
116/******************************************************************************/
117void AllocTo1InModule_1()
118{
119   listmodule *tmplist;
120   
121   
122   if (firstpass == 1 && listmoduleinfile ) 
123   {
124      tmplist=listmoduleinfile;
125      /* we should find the module in the listmoduleinfile                    */
126      while ( strcasecmp(tmplist->module,curmodulename) ) tmplist=tmplist->suiv;
127      /* and turn the flag to 0                                               */
128      tmplist->Alloc = 1 ;
129   }
130}
131
132/******************************************************************************/
133/*                           AllocShouldMadeInModule                          */
134/******************************************************************************/
135/*                                                                            */
136/******************************************************************************/
137int AllocShouldMadeInModule()
138{
139   listmodule *tmplist;
140   
141   
142   if ( listmoduleinfile ) 
143   {
144      tmplist=listmoduleinfile;
145      /* we should find the module in the listmoduleinfile                    */
146      while ( strcasecmp(tmplist->module,curmodulename) ) tmplist=tmplist->suiv;
147      /* and turn the flag to 0                                               */
148      return tmplist->AllocShouldMade;
149   }
150   else
151   {
152      return 0;
153   }
154}
155
156/******************************************************************************/
157/*                                AllocInModule                               */
158/******************************************************************************/
159/*                                                                            */
160/******************************************************************************/
161int AllocInModule()
162{
163   listmodule *tmplist;
164   
165   
166   if ( listmoduleinfile ) 
167   {
168      tmplist=listmoduleinfile;
169      /* we should find the module in the listmoduleinfile                    */
170      while ( strcasecmp(tmplist->module,curmodulename) ) tmplist=tmplist->suiv;
171      /* and turn the flag to 0                                               */
172      return tmplist->Alloc;
173   }
174   else
175   {
176      return 0;
177   }
178}
Note: See TracBrowser for help on using the repository browser.