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 branches/UKMO/dev_r6393_CO6_package_trunk/NEMOGCM/EXTERNAL/AGRIF/LIB – NEMO

source: branches/UKMO/dev_r6393_CO6_package_trunk/NEMOGCM/EXTERNAL/AGRIF/LIB/WorkWithlistmoduleinfile.c @ 7019

Last change on this file since 7019 was 7019, checked in by deazer, 7 years ago

Cleared svn keywords

File size: 8.1 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@yahoo.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.7                                                                */
34/******************************************************************************/
35#include <stdio.h>
36#include <stdlib.h>
37#include <string.h>
38#include "decl.h"
39
40void Save_Length(const char *nom, int whichone)
41{
42    size_t len_nom = strlen(nom);
43   
44   if ( whichone == 1  && len_nom > length_last )
45   {
46      length_last = len_nom;
47      if ( length_last > LONG_M )
48            printf("WARNING 1 : The value of LONG_M (defined in decl.h) should be upgrated to %lu\n", length_last+100);
49   }
50   if ( whichone == 2  && len_nom > length_first )
51   {
52      length_first = len_nom;
53      if ( length_first > LONG_M )
54           printf("WARNING 2 : The value of LONG_M (defined in decl.h) should be upgrated to %lu\n", length_first+100);
55   }
56   if ( whichone == 8  && len_nom > length_v_vallengspec )
57   {
58      length_v_vallengspec = len_nom;
59      if ( length_v_vallengspec > LONG_M )
60           printf("WARNING 8 : The value of LONG_M (defined in decl.h) should be upgrated to %lu\n", length_v_vallengspec+100);
61   }
62   if ( whichone == 12 && len_nom > length_v_precision )
63   {
64      length_v_precision = len_nom;
65      if ( length_v_precision > LONG_M )
66           printf("WARNING 12 : The value of LONG_M (defined in decl.h) should be upgrated to %lu\n", length_v_precision+100);
67   }
68   if ( whichone == 13 && len_nom > length_v_IntentSpec )
69   {
70      length_v_IntentSpec = len_nom;
71      if ( length_v_IntentSpec > LONG_M )
72           printf("WARNING 13 : The value of LONG_M (defined in decl.h) should be upgrated to %lu\n", length_v_IntentSpec+100);
73   }
74   if ( whichone == 14 && len_nom > length_v_initialvalue )
75   {
76      length_v_initialvalue = len_nom;
77      if ( length_v_initialvalue > LONG_M )
78           printf("WARNING 14 : The value of LONG_M (defined in decl.h) should be upgrated to %lu\n", length_v_initialvalue+100);
79   }
80   if ( whichone == 15 && len_nom > length_v_readedlistdimension )
81   {
82      length_v_readedlistdimension = len_nom;
83      if ( length_v_readedlistdimension > LONG_M )
84           printf("WARNING 15 : The value of LONG_M (defined in decl.h) should be upgrated to %lu\n", length_v_readedlistdimension+100);
85   }
86   if ( whichone == 25 && len_nom > length_a_nomvar )
87   {
88      length_a_nomvar = len_nom;
89      if ( length_a_nomvar > LONG_C )
90           printf("WARNING 25 : The value of LONG_C (defined in decl.h) should be upgrated to %lu\n", length_a_nomvar+100);
91   }
92   if ( whichone == 39 && len_nom > length_toprintglob )
93   {
94      length_toprintglob = len_nom;
95      if ( length_toprintglob > LONG_M )
96           printf("WARNING 39 : The value of LONG_M (defined in decl.h) should be upgrated to %lu\n", length_toprintglob+100);
97   }
98   if ( whichone == 40 && len_nom > length_tmpvargridname )
99   {
100      length_tmpvargridname = len_nom;
101      if ( length_tmpvargridname > LONG_M )
102           printf("WARNING 40 : The value of LONG_M (defined in decl.h) should be upgrated to %lu\n", length_tmpvargridname+100);
103   }
104   if ( whichone == 41 && len_nom > length_ligne_Subloop )
105   {
106       length_ligne_Subloop = len_nom;
107      if ( length_ligne_Subloop > LONG_M )
108           printf("WARNING 41 : The value of LONG_M (defined in decl.h) should be upgrated to %lu\n",length_ligne_Subloop+100);
109   }
110   if ( whichone == 43 && len_nom > length_toprint_utilagrif )
111   {
112      length_toprint_utilagrif = len_nom;
113      if ( length_toprint_utilagrif > LONG_M )
114           printf("WARNING 43 : The value of LONG_M (defined in decl.h) should be upgrated to %lu\n", length_toprint_utilagrif+100);
115   }
116   if ( whichone == 44 && len_nom > length_toprinttmp_utilchar )
117   {
118      length_toprinttmp_utilchar = len_nom;
119      if ( length_toprinttmp_utilchar > LONG_M)
120           printf("WARNING 44 : The value of LONG_M (defined in decl.h) should be upgrated to %lu\n", length_toprinttmp_utilchar+100);
121   }
122   if ( whichone == 45 && len_nom > length_ligne_writedecl )
123   {
124      length_ligne_writedecl = len_nom;
125      if ( length_ligne_writedecl > LONG_M )
126           printf("WARNING 45 : The value of LONG_M (defined in decl.h) should be upgrated to %lu\n", length_ligne_writedecl+100);
127   }
128   if ( whichone == 46 && len_nom > length_newname_toamr )
129   {
130      length_newname_toamr = len_nom;
131      if ( length_newname_toamr > LONG_C )
132           printf("WARNING 46 : The value of LONG_C (defined in decl.h) should be upgrated to %lu\n", length_newname_toamr+100);
133   }
134   if ( whichone == 47 && len_nom > length_newname_writedecl )
135   {
136      length_newname_writedecl = len_nom;
137      if ( length_newname_writedecl > LONG_M )
138           printf("WARNING 47 : The value of LONG_M (defined in decl.h) should be upgrated to %lu\n", length_newname_writedecl +100);
139   }
140   if ( whichone == 48 && len_nom > length_ligne_toamr )
141   {
142      length_ligne_toamr = len_nom;
143      if ( length_ligne_toamr > LONG_M )
144           printf("WARNING 48 : The value of LONG_M (defined in decl.h) should be upgrated to %lu\n", length_ligne_toamr +100);
145   }
146   if ( whichone == 49 && len_nom > length_tmpligne_writedecl )
147   {
148      length_tmpligne_writedecl = len_nom;
149      if ( length_tmpligne_writedecl > LONG_M )
150           printf("WARNING 49 : The value of LONG_M (defined in decl.h) should be upgrated to %lu\n", length_tmpligne_writedecl+100);
151   }
152}
153
154void Save_Length_int(int val, int whichone)
155{
156   if ( whichone == 1 && val > value_char_size )    value_char_size  = val;
157   if ( whichone == 2 && val > value_char_size1 )   value_char_size1 = val;
158   if ( whichone == 3 && val > value_char_size2 )   value_char_size2 = val;
159   if ( whichone == 4 && val > value_char_size3 )   value_char_size3 = val;
160}
Note: See TracBrowser for help on using the repository browser.