[1901] | 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 | |
---|
[6043] | 40 | void Save_Length(const char *nom, int whichone) |
---|
[1901] | 41 | { |
---|
[6043] | 42 | size_t len_nom = strlen(nom); |
---|
| 43 | |
---|
| 44 | if ( whichone == 1 && len_nom > length_last ) |
---|
[1901] | 45 | { |
---|
[6043] | 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); |
---|
[1901] | 49 | } |
---|
[6043] | 50 | if ( whichone == 2 && len_nom > length_first ) |
---|
[1901] | 51 | { |
---|
[6043] | 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); |
---|
[1901] | 55 | } |
---|
[6043] | 56 | if ( whichone == 8 && len_nom > length_v_vallengspec ) |
---|
[1901] | 57 | { |
---|
[6043] | 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); |
---|
[1901] | 61 | } |
---|
[6043] | 62 | if ( whichone == 12 && len_nom > length_v_precision ) |
---|
[1901] | 63 | { |
---|
[6043] | 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); |
---|
[1901] | 67 | } |
---|
[6043] | 68 | if ( whichone == 13 && len_nom > length_v_IntentSpec ) |
---|
[1901] | 69 | { |
---|
[6043] | 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); |
---|
[1901] | 73 | } |
---|
[6043] | 74 | if ( whichone == 14 && len_nom > length_v_initialvalue ) |
---|
[1901] | 75 | { |
---|
[6043] | 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); |
---|
[1901] | 79 | } |
---|
[6043] | 80 | if ( whichone == 15 && len_nom > length_v_readedlistdimension ) |
---|
[1901] | 81 | { |
---|
[6043] | 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); |
---|
[1901] | 85 | } |
---|
[6043] | 86 | if ( whichone == 25 && len_nom > length_a_nomvar ) |
---|
[1901] | 87 | { |
---|
[6043] | 88 | length_a_nomvar = len_nom; |
---|
[1901] | 89 | if ( length_a_nomvar > LONG_C ) |
---|
[6043] | 90 | printf("WARNING 25 : The value of LONG_C (defined in decl.h) should be upgrated to %lu\n", length_a_nomvar+100); |
---|
[1901] | 91 | } |
---|
[6043] | 92 | if ( whichone == 39 && len_nom > length_toprintglob ) |
---|
[1901] | 93 | { |
---|
[6043] | 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); |
---|
[1901] | 97 | } |
---|
[6043] | 98 | if ( whichone == 40 && len_nom > length_tmpvargridname ) |
---|
[1901] | 99 | { |
---|
[6043] | 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); |
---|
[1901] | 103 | } |
---|
[6043] | 104 | if ( whichone == 41 && len_nom > length_ligne_Subloop ) |
---|
[1901] | 105 | { |
---|
[6043] | 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); |
---|
[1901] | 109 | } |
---|
[6043] | 110 | if ( whichone == 43 && len_nom > length_toprint_utilagrif ) |
---|
[1901] | 111 | { |
---|
[6043] | 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); |
---|
[1901] | 115 | } |
---|
[6043] | 116 | if ( whichone == 44 && len_nom > length_toprinttmp_utilchar ) |
---|
[1901] | 117 | { |
---|
[6043] | 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); |
---|
[1901] | 121 | } |
---|
[6043] | 122 | if ( whichone == 45 && len_nom > length_ligne_writedecl ) |
---|
[1901] | 123 | { |
---|
[6043] | 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); |
---|
[1901] | 127 | } |
---|
[6043] | 128 | if ( whichone == 46 && len_nom > length_newname_toamr ) |
---|
[1901] | 129 | { |
---|
[6043] | 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); |
---|
[1901] | 133 | } |
---|
[6043] | 134 | if ( whichone == 47 && len_nom > length_newname_writedecl ) |
---|
[1901] | 135 | { |
---|
[6043] | 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); |
---|
[1901] | 139 | } |
---|
[6043] | 140 | if ( whichone == 48 && len_nom > length_ligne_toamr ) |
---|
[1901] | 141 | { |
---|
[6043] | 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); |
---|
[1901] | 145 | } |
---|
[6043] | 146 | if ( whichone == 49 && len_nom > length_tmpligne_writedecl ) |
---|
[1901] | 147 | { |
---|
[6043] | 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); |
---|
[1901] | 151 | } |
---|
| 152 | } |
---|
| 153 | |
---|
| 154 | void Save_Length_int(int val, int whichone) |
---|
| 155 | { |
---|
[6043] | 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; |
---|
[1901] | 160 | } |
---|