So, is there a better way to code this ?
C CHECK THE COMMANDS WHICH SHOULD HAVE EQUAL SIGN
C 10 - no equal sign required
C 11 - equal sign required
C
LEQUL=.TRUE.
IF (ICEP .GT. 100) GO TO 1002
C ICEP = 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
GO TO( 10, 11, 11, 10, 10, 11, 11, 11, 10, 11, 10, 11, 11, 10, 10,
C ICEP = 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
* 10, 10, 11, 11, 11, 10, 10, 10, 10, 11, 10, 11, 11, 11, 11,
C ICEP = 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45
* 11, 10, 11, 11, 11, 11, 11, 11, 11, 11, 10, 10, 10, 10, 11,
C ICEP = 46 47 48 79 50
* 10, 11, 11, 11, 11,
C ICEP = 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65
* 10, 10, 11, 11, 10, 11, 11, 10, 11, 11, 10, 11, 10, 11, 11,
C ICEP = 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80
* 11, 10, 10, 11, 10, 11, 11, 10, 11, 11, 11, 11, 11, 11, 11,
C ICEP 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95
* 11, 11, 10, 10, 11, 11, 11, 11, 11, 10, 10, 10, 10, 11, 11,
C ICEP 96 97 98 99 100
* 11, 10, 10, 11, 11), icep
1002 IF (ICEP .GT. 200) GO TO 1004
NN = ICEP - 100
C ICEP = 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115
GO TO( 11, 10, 10, 10, 11, 11, 11, 10, 10, 10, 10, 10, 10, 10, 10,
C ICEP 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130
* 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10,
C ICEP 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145
* 11, 11, 11, 10, 10, 10, 10, 10, 10, 10, 10, 11, 11, 11, 11,
C ICEP 146 147 148 149 150
* 11, 10, 11, 11, 11,
C ICEP = 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165
* 10, 11, 11, 11, 11, 11, 11, 11, 11, 10, 11, 11, 11, 10, 11,
C ICEP 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180
* 11, 10, 10, 10, 10, 10, 10, 10, 11, 10, 11, 11, 11, 10, 11,
C ICEP 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195
* 11, 11, 11, 11, 10, 10, 10, 10, 10, 10, 11, 11, 11, 10, 11,
C 196 197 198 199 200
* 11, 11, 11, 11, 10), NN
1004 IF (ICEP .GT. 300) goto 1006
NN = ICEP - 200
C ICEP = 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215
GO TO( 11, 10, 11, 11, 11, 11, 10, 11, 11, 11, 10, 10, 11, 11, 10,
C 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230
* 11, 11, 11, 11, 10, 10, 10, 10, 11, 10, 10, 10, 10, 11, 11,
C 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245
* 11, 11, 11, 11, 11, 10, 11, 10, 10, 10, 11, 11, 11, 11, 10,
C 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260
* 11, 11, 11, 10, 11, 11, 10, 10, 10, 11, 11, 11, 11, 11, 11,
C 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275
* 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 10, 11,
C 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290
* 10, 11, 10, 10, 10, 10, 10, 11, 11, 10, 11, 11, 11, 10, 11,
C 291 292 293 294 295 296 297 298 299 300
* 11, 11, 11, 10, 10, 10, 10, 10, 10, 10), NN
1006 IF (ICEP .GT. gen_maxcep) GO TO 1111
NN = ICEP - 300
C 301 302 303 304 305 306 307 308 309 310
GO TO ( 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,
C 311 312 313 314 315 316 317 318 319 320
* 11, 11, 11, 11, 11, 10, 10, 10, 10, 10,
C 321 322 323 324 325 326 327 328 329 330
* 10, 10, 10, 10, 10, 10, 10, 10, 11, 11,
C 331 332 333 334 335 336 337 338 339 340
* 10, 10, 11, 11, 11, 11, 10, 10, 10, 10,
C 341 342 343 344 345 346 347 348 349 350
* 11, 11, 11, 11, 10, 11, 11, 11, 10, 10 ), NN
Thanks,
Lynn
So, is there a better way to code this ?
C CHECK THE COMMANDS WHICH SHOULD HAVE EQUAL SIGN
C 10 - no equal sign required
C 11 - equal sign required
C
LEQUL=.TRUE.
IF (ICEP .GT. 100) GO TO 1002
C ICEP = 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
GO TO( 10, 11, 11, 10, 10, 11, 11, 11, 10, 11, 10, 11, 11, 10, 10,
C ICEP = 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
* 10, 10, 11, 11, 11, 10, 10, 10, 10, 11, 10, 11, 11, 11, 11,
C ICEP = 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45
* 11, 10, 11, 11, 11, 11, 11, 11, 11, 11, 10, 10, 10, 10, 11,
C ICEP = 46 47 48 79 50
* 10, 11, 11, 11, 11,
C ICEP = 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65
* 10, 10, 11, 11, 10, 11, 11, 10, 11, 11, 10, 11, 10, 11, 11,
C ICEP = 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80
* 11, 10, 10, 11, 10, 11, 11, 10, 11, 11, 11, 11, 11, 11, 11,
C ICEP 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95
* 11, 11, 10, 10, 11, 11, 11, 11, 11, 10, 10, 10, 10, 11, 11,
C ICEP 96 97 98 99 100
* 11, 10, 10, 11, 11), icep
1002 IF (ICEP .GT. 200) GO TO 1004
NN = ICEP - 100
C ICEP = 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115
GO TO( 11, 10, 10, 10, 11, 11, 11, 10, 10, 10, 10, 10, 10, 10, 10,
C ICEP 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130
* 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10,
C ICEP 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145
* 11, 11, 11, 10, 10, 10, 10, 10, 10, 10, 10, 11, 11, 11, 11,
C ICEP 146 147 148 149 150
* 11, 10, 11, 11, 11,
C ICEP = 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165
* 10, 11, 11, 11, 11, 11, 11, 11, 11, 10, 11, 11, 11, 10, 11,
C ICEP 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180
* 11, 10, 10, 10, 10, 10, 10, 10, 11, 10, 11, 11, 11, 10, 11,
C ICEP 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195
* 11, 11, 11, 11, 10, 10, 10, 10, 10, 10, 11, 11, 11, 10, 11,
C 196 197 198 199 200
* 11, 11, 11, 11, 10), NN
1004 IF (ICEP .GT. 300) goto 1006
NN = ICEP - 200
C ICEP = 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215
GO TO( 11, 10, 11, 11, 11, 11, 10, 11, 11, 11, 10, 10, 11, 11, 10,
C 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230
* 11, 11, 11, 11, 10, 10, 10, 10, 11, 10, 10, 10, 10, 11, 11,
C 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245
* 11, 11, 11, 11, 11, 10, 11, 10, 10, 10, 11, 11, 11, 11, 10,
C 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260
* 11, 11, 11, 10, 11, 11, 10, 10, 10, 11, 11, 11, 11, 11, 11,
C 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275
* 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 10, 11,
C 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290
* 10, 11, 10, 10, 10, 10, 10, 11, 11, 10, 11, 11, 11, 10, 11,
C 291 292 293 294 295 296 297 298 299 300
* 11, 11, 11, 10, 10, 10, 10, 10, 10, 10), NN
1006 IF (ICEP .GT. gen_maxcep) GO TO 1111
NN = ICEP - 300
C 301 302 303 304 305 306 307 308 309 310
GO TO ( 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,
C 311 312 313 314 315 316 317 318 319 320
* 11, 11, 11, 11, 11, 10, 10, 10, 10, 10,
C 321 322 323 324 325 326 327 328 329 330
* 10, 10, 10, 10, 10, 10, 10, 10, 11, 11,
C 331 332 333 334 335 336 337 338 339 340
* 10, 10, 11, 11, 11, 11, 10, 10, 10, 10,
C 341 342 343 344 345 346 347 348 349 350
* 11, 11, 11, 11, 10, 11, 11, 11, 10, 10 ), NN
Thanks,
Lynn
C CHECK THE COMMANDS WHICH SHOULD HAVE EQUAL SIGN
C 10 - no equal sign required
C 11 - equal sign required
integer needs(350)
data needs/
C ICEP = 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
* 10, 11, 11, 10, 10, 11, 11, 11, 10, 11, 10, 11, 11, 10, 10,
C ICEP = 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
* 10, 10, 11, 11, 11, 10, 10, 10, 10, 11, 10, 11, 11, 11, 11,
C ICEP = 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45
* 11, 10, 11, 11, 11, 11, 11, 11, 11, 11, 10, 10, 10, 10, 11,
C ICEP = 46 47 48 79 50
* 10, 11, 11, 11, 11,
C ICEP = 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65
* 10, 10, 11, 11, 10, 11, 11, 10, 11, 11, 10, 11, 10, 11, 11,
C ICEP = 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80
* 11, 10, 10, 11, 10, 11, 11, 10, 11, 11, 11, 11, 11, 11, 11,
C ICEP 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95
* 11, 11, 10, 10, 11, 11, 11, 11, 11, 10, 10, 10, 10, 11, 11,
C ICEP 96 97 98 99 100
* 11, 10, 10, 11, 11,
C ICEP = 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115
* 11, 10, 10, 10, 11, 11, 11, 10, 10, 10, 10, 10, 10, 10, 10,
C ICEP 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130
* 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10,
C ICEP 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145
* 11, 11, 11, 10, 10, 10, 10, 10, 10, 10, 10, 11, 11, 11, 11,
C ICEP 146 147 148 149 150
* 11, 10, 11, 11, 11,
C ICEP = 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165
* 10, 11, 11, 11, 11, 11, 11, 11, 11, 10, 11, 11, 11, 10, 11,
C ICEP 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180
* 11, 10, 10, 10, 10, 10, 10, 10, 11, 10, 11, 11, 11, 10, 11,
C ICEP 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195
* 11, 11, 11, 11, 10, 10, 10, 10, 10, 10, 11, 11, 11, 10, 11,
C 196 197 198 199 200
* 11, 11, 11, 11, 10,
C ICEP = 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215
* 11, 10, 11, 11, 11, 11, 10, 11, 11, 11, 10, 10, 11, 11, 10,
C 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230
* 11, 11, 11, 11, 10, 10, 10, 10, 11, 10, 10, 10, 10, 11, 11,
C 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245
* 11, 11, 11, 11, 11, 10, 11, 10, 10, 10, 11, 11, 11, 11, 10,
C 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260
* 11, 11, 11, 10, 11, 11, 10, 10, 10, 11, 11, 11, 11, 11, 11,
C 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275
* 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 10, 11,
C 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290
* 10, 11, 10, 10, 10, 10, 10, 11, 11, 10, 11, 11, 11, 10, 11,
C 291 292 293 294 295 296 297 298 299 300
* 11, 11, 11, 10, 10, 10, 10, 10, 10, 10,
C 301 302 303 304 305 306 307 308 309 310
* 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,
C 311 312 313 314 315 316 317 318 319 320
* 11, 11, 11, 11, 11, 10, 10, 10, 10, 10,
C 321 322 323 324 325 326 327 328 329 330
* 10, 10, 10, 10, 10, 10, 10, 10, 11, 11,
C 331 332 333 334 335 336 337 338 339 340
* 10, 10, 11, 11, 11, 11, 10, 10, 10, 10,
C 341 342 343 344 345 346 347 348 349 350
* 11, 11, 11, 11, 10, 11, 11, 11, 10, 10 /
On 6/12/2022 9:06 PM, gah4 wrote:
C CHECK THE COMMANDS WHICH SHOULD HAVE EQUAL SIGN
C 10 - no equal sign required
C 11 - equal sign required
integer needs(350)Does regular Fortran allow 35 lines of continuation lines in a data
data needs/
C ICEP = 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
* 10, 11, 11, 10, 10, 11, 11, 11, 10, 11, 10, 11, 11, 10, 10,
C ICEP = 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
* 10, 10, 11, 11, 11, 10, 10, 10, 10, 11, 10, 11, 11, 11, 11,
C ICEP = 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45
* 11, 10, 11, 11, 11, 11, 11, 11, 11, 11, 10, 10, 10, 10, 11,
C ICEP = 46 47 48 79 50
* 10, 11, 11, 11, 11,
C ICEP = 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65
* 10, 10, 11, 11, 10, 11, 11, 10, 11, 11, 10, 11, 10, 11, 11,
C ICEP = 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80
* 11, 10, 10, 11, 10, 11, 11, 10, 11, 11, 11, 11, 11, 11, 11,
C ICEP 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95
* 11, 11, 10, 10, 11, 11, 11, 11, 11, 10, 10, 10, 10, 11, 11,
C ICEP 96 97 98 99 100
* 11, 10, 10, 11, 11,
C ICEP = 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115
* 11, 10, 10, 10, 11, 11, 11, 10, 10, 10, 10, 10, 10, 10, 10,
C ICEP 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130
* 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10,
C ICEP 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145
* 11, 11, 11, 10, 10, 10, 10, 10, 10, 10, 10, 11, 11, 11, 11,
C ICEP 146 147 148 149 150
* 11, 10, 11, 11, 11,
C ICEP = 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165
* 10, 11, 11, 11, 11, 11, 11, 11, 11, 10, 11, 11, 11, 10, 11,
C ICEP 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180
* 11, 10, 10, 10, 10, 10, 10, 10, 11, 10, 11, 11, 11, 10, 11,
C ICEP 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195
* 11, 11, 11, 11, 10, 10, 10, 10, 10, 10, 11, 11, 11, 10, 11,
C 196 197 198 199 200
* 11, 11, 11, 11, 10,
C ICEP = 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215
* 11, 10, 11, 11, 11, 11, 10, 11, 11, 11, 10, 10, 11, 11, 10,
C 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230
* 11, 11, 11, 11, 10, 10, 10, 10, 11, 10, 10, 10, 10, 11, 11,
C 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245
* 11, 11, 11, 11, 11, 10, 11, 10, 10, 10, 11, 11, 11, 11, 10,
C 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260
* 11, 11, 11, 10, 11, 11, 10, 10, 10, 11, 11, 11, 11, 11, 11,
C 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275
* 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 10, 11,
C 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290
* 10, 11, 10, 10, 10, 10, 10, 11, 11, 10, 11, 11, 11, 10, 11,
C 291 292 293 294 295 296 297 298 299 300
* 11, 11, 11, 10, 10, 10, 10, 10, 10, 10,
C 301 302 303 304 305 306 307 308 309 310
* 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,
C 311 312 313 314 315 316 317 318 319 320
* 11, 11, 11, 11, 11, 10, 10, 10, 10, 10,
C 321 322 323 324 325 326 327 328 329 330
* 10, 10, 10, 10, 10, 10, 10, 10, 11, 11,
C 331 332 333 334 335 336 337 338 339 340
* 10, 10, 11, 11, 11, 11, 10, 10, 10, 10,
C 341 342 343 344 345 346 347 348 349 350
* 11, 11, 11, 11, 10, 11, 11, 11, 10, 10 /
statement ?
Thanks,
Lynn
On Tuesday, June 14, 2022 at 8:23:22 AM UTC+12, Lynn McGuire wrote:
On 6/12/2022 9:06 PM, gah4 wrote:
C CHECK THE COMMANDS WHICH SHOULD HAVE EQUAL SIGNDoes regular Fortran allow 35 lines of continuation lines in a data
C 10 - no equal sign required
C 11 - equal sign required
integer needs(350)
data needs/
C ICEP = 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
* 10, 11, 11, 10, 10, 11, 11, 11, 10, 11, 10, 11, 11, 10, 10,
C ICEP = 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
* 10, 10, 11, 11, 11, 10, 10, 10, 10, 11, 10, 11, 11, 11, 11,
C ICEP = 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45
* 11, 10, 11, 11, 11, 11, 11, 11, 11, 11, 10, 10, 10, 10, 11,
C ICEP = 46 47 48 79 50
* 10, 11, 11, 11, 11,
C ICEP = 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65
* 10, 10, 11, 11, 10, 11, 11, 10, 11, 11, 10, 11, 10, 11, 11,
C ICEP = 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80
* 11, 10, 10, 11, 10, 11, 11, 10, 11, 11, 11, 11, 11, 11, 11,
C ICEP 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95
* 11, 11, 10, 10, 11, 11, 11, 11, 11, 10, 10, 10, 10, 11, 11,
C ICEP 96 97 98 99 100
* 11, 10, 10, 11, 11,
C ICEP = 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115
* 11, 10, 10, 10, 11, 11, 11, 10, 10, 10, 10, 10, 10, 10, 10,
C ICEP 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130
* 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10,
C ICEP 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145
* 11, 11, 11, 10, 10, 10, 10, 10, 10, 10, 10, 11, 11, 11, 11,
C ICEP 146 147 148 149 150
* 11, 10, 11, 11, 11,
C ICEP = 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165
* 10, 11, 11, 11, 11, 11, 11, 11, 11, 10, 11, 11, 11, 10, 11,
C ICEP 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180
* 11, 10, 10, 10, 10, 10, 10, 10, 11, 10, 11, 11, 11, 10, 11,
C ICEP 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195
* 11, 11, 11, 11, 10, 10, 10, 10, 10, 10, 11, 11, 11, 10, 11,
C 196 197 198 199 200
* 11, 11, 11, 11, 10,
C ICEP = 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215
* 11, 10, 11, 11, 11, 11, 10, 11, 11, 11, 10, 10, 11, 11, 10,
C 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230
* 11, 11, 11, 11, 10, 10, 10, 10, 11, 10, 10, 10, 10, 11, 11,
C 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245
* 11, 11, 11, 11, 11, 10, 11, 10, 10, 10, 11, 11, 11, 11, 10,
C 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260
* 11, 11, 11, 10, 11, 11, 10, 10, 10, 11, 11, 11, 11, 11, 11,
C 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275
* 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 10, 11,
C 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290
* 10, 11, 10, 10, 10, 10, 10, 11, 11, 10, 11, 11, 11, 10, 11,
C 291 292 293 294 295 296 297 298 299 300
* 11, 11, 11, 10, 10, 10, 10, 10, 10, 10,
C 301 302 303 304 305 306 307 308 309 310
* 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,
C 311 312 313 314 315 316 317 318 319 320
* 11, 11, 11, 11, 11, 10, 10, 10, 10, 10,
C 321 322 323 324 325 326 327 328 329 330
* 10, 10, 10, 10, 10, 10, 10, 10, 11, 11,
C 331 332 333 334 335 336 337 338 339 340
* 10, 10, 11, 11, 11, 11, 10, 10, 10, 10,
C 341 342 343 344 345 346 347 348 349 350
* 11, 11, 11, 11, 10, 11, 11, 11, 10, 10 /
statement ?
Thanks,
Lynn
Depends on what you mean by regular Fortran. In f2003 and later the limit is 255, but in f95 it's 39 in free form, 19 in fixed form.
On 6/12/2022 9:06 PM, gah4 wrote:
C CHECK THE COMMANDS WHICH SHOULD HAVE EQUAL SIGN
C 10 - no equal sign required
C 11 - equal sign required
integer needs(350)
data needs/
C ICEP = 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
* 10, 11, 11, 10, 10, 11, 11, 11, 10, 11, 10, 11, 11, 10, 10,
* 11, 11, 11, 11, 10, 11, 11, 11, 10, 10 /\Does regular Fortran allow 35 lines of continuation lines in a data
statement ?
Depends on what you mean by regular Fortran. In f2003 and later the limit is 255, but in f95 it's 39 in free form, 19 in fixed form.I meant Standard Fortran.
On Monday, June 13, 2022 at 4:29:18 PM UTC-7, Lynn McGuire wrote:
(snip)
Depends on what you mean by regular Fortran. In f2003 and later the limit is 255, but in f95 it's 39 in free form, 19 in fixed form.I meant Standard Fortran.
66, 77, 90, 95, 2008, 2013, or 2018?
There is a famous quote:
"The nice thing about standards is that we have so many to choose from."
F77 apparently allowed 19 continuation lines. Open Watcom Fortran 77 is extended to allow up to 61 continuation lines.
On Tuesday, June 14, 2022 at 12:34:32 PM UTC-7, Lynn McGuire wrote:
(snip)
F77 apparently allowed 19 continuation lines. Open Watcom Fortran 77 is
extended to allow up to 61 continuation lines.
When I wrote above about how many lines of computed GOTO, I had forgotten that you split that one up.
You could split up the DATA with EQUIVALENCE and two or three or four arrays.
I thought that was a good way, as it keeps your comments (which don't count for continuation lines), but also the numbers. So no transcribing mistakes. (Not that you ever do that.)
And yes the Watcom compiler is my favorite Fortran 77 compiler.
(Well, maybe VS Fortran, but I don't have one of those.)
On Tuesday, June 14, 2022 at 12:34:32 PM UTC-7, Lynn McGuire wrote:
(snip)
F77 apparently allowed 19 continuation lines. Open Watcom Fortran 77 is
extended to allow up to 61 continuation lines.
When I wrote above about how many lines of computed GOTO, I had forgotten that you split that one up.
You could split up the DATA with EQUIVALENCE and two or three or four arrays.
I thought that was a good way, as it keeps your comments (which don't count for continuation lines), but also the numbers. So no transcribing mistakes. (Not that you ever do that.)
And yes the Watcom compiler is my favorite Fortran 77 compiler.
(Well, maybe VS Fortran, but I don't have one of those.)
On Tuesday, June 14, 2022 at 12:34:32 PM UTC-7, Lynn McGuire wrote:
(snip)
F77 apparently allowed 19 continuation lines. Open Watcom Fortran 77 is
extended to allow up to 61 continuation lines.
When I wrote above about how many lines of computed GOTO, I had forgotten that you split that one up.
You could split up the DATA with EQUIVALENCE and two or three or four arrays.
I thought that was a good way, as it keeps your comments (which don't count for continuation lines), but also the numbers. So no transcribing mistakes. (Not that you ever do that.)
And yes the Watcom compiler is my favorite Fortran 77 compiler.
(Well, maybe VS Fortran, but I don't have one of those.)
I also have this computed goto that is going be even harder:
IF (ICEP .EQ. -1) GO TO 562
IF (ICEP .GT. 100) GO TO 283
C ICEP 1 2 3 4 5 6 7 8 9 10
GO TO (900 ,510 ,510 ,580 ,564 ,900 ,636 ,518 ,564 ,514 ,
C ICEP 11 12 13 14 15 16 17 18 19 20
* 564 ,530 ,677 ,580 ,564 ,564 ,580 ,668 ,900 ,668 ,
C 21 22 23 24 25 26 27 28 29 30
* 564 ,580 ,900 ,580 ,562 ,564 ,620 ,513 ,510 ,900 ,
C 31 32 33 34 35 36 37 38 39 40
* 900 ,562 ,514 ,514 ,668 ,514 ,520 ,550 ,604 ,615 ,
On Tuesday, June 14, 2022 at 3:18:15 PM UTC-7, Lynn McGuire wrote:
(snip)
I also have this computed goto that is going be even harder:
IF (ICEP .EQ. -1) GO TO 562
IF (ICEP .GT. 100) GO TO 283
C ICEP 1 2 3 4 5 6 7 8 9 10
GO TO (900 ,510 ,510 ,580 ,564 ,900 ,636 ,518 ,564 ,514 ,
C ICEP 11 12 13 14 15 16 17 18 19 20
* 564 ,530 ,677 ,580 ,564 ,564 ,580 ,668 ,900 ,668 ,
C 21 22 23 24 25 26 27 28 29 30
* 564 ,580 ,900 ,580 ,562 ,564 ,620 ,513 ,510 ,900 ,
C 31 32 33 34 35 36 37 38 39 40
* 900 ,562 ,514 ,514 ,668 ,514 ,520 ,550 ,604 ,615 ,
(snip)
OK, this one has 190 different places to go.
Are these places more complicated than assigning some value,
or something else that can be done using lookup table data?
This is sort of close to the point that you could use a look up
table and 190 way computed GOTO statement. I might suggest
that when it is less than about 1/3 of the choices.
Using AWK:
/^[^C]/ {
gsub("[^0-9]"," ")
if(NF<4) next
for(i=1; i<=NF; i++) x[$i]++
}
END {
j=l=0
for(k in x) j++
for(k in x) l += x[k]
print j,"of",l
}
So, is there a better way to code this ?
So, is there a better way to code this ?.
C CHECK THE COMMANDS WHICH SHOULD HAVE EQUAL SIGN
C 10 - no equal sign required
C 11 - equal sign required
C
LEQUL=.TRUE.
IF (ICEP .GT. 100) GO TO 1002
C ICEP = 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
GO TO( 10, 11, 11, 10, 10, 11, 11, 11, 10, 11, 10, 11, 11, 10, 10,
C ICEP = 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
* 10, 10, 11, 11, 11, 10, 10, 10, 10, 11, 10, 11, 11, 11, 11,
C ICEP = 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45
* 11, 10, 11, 11, 11, 11, 11, 11, 11, 11, 10, 10, 10, 10, 11,
C ICEP = 46 47 48 79 50
* 10, 11, 11, 11, 11,
C ICEP = 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65
* 10, 10, 11, 11, 10, 11, 11, 10, 11, 11, 10, 11, 10, 11, 11,
C ICEP = 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80
* 11, 10, 10, 11, 10, 11, 11, 10, 11, 11, 11, 11, 11, 11, 11,
C ICEP 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95
* 11, 11, 10, 10, 11, 11, 11, 11, 11, 10, 10, 10, 10, 11, 11,
C ICEP 96 97 98 99 100
* 11, 10, 10, 11, 11), icep
1002 IF (ICEP .GT. 200) GO TO 1004
NN = ICEP - 100
C ICEP = 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115
GO TO( 11, 10, 10, 10, 11, 11, 11, 10, 10, 10, 10, 10, 10, 10, 10,
C ICEP 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130
* 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10,
C ICEP 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145
* 11, 11, 11, 10, 10, 10, 10, 10, 10, 10, 10, 11, 11, 11, 11,
C ICEP 146 147 148 149 150
* 11, 10, 11, 11, 11,
C ICEP = 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165
* 10, 11, 11, 11, 11, 11, 11, 11, 11, 10, 11, 11, 11, 10, 11,
C ICEP 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180
* 11, 10, 10, 10, 10, 10, 10, 10, 11, 10, 11, 11, 11, 10, 11,
C ICEP 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195
* 11, 11, 11, 11, 10, 10, 10, 10, 10, 10, 11, 11, 11, 10, 11,
C 196 197 198 199 200
* 11, 11, 11, 11, 10), NN
1004 IF (ICEP .GT. 300) goto 1006
NN = ICEP - 200
C ICEP = 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215
GO TO( 11, 10, 11, 11, 11, 11, 10, 11, 11, 11, 10, 10, 11, 11, 10,
C 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230
* 11, 11, 11, 11, 10, 10, 10, 10, 11, 10, 10, 10, 10, 11, 11,
C 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245
* 11, 11, 11, 11, 11, 10, 11, 10, 10, 10, 11, 11, 11, 11, 10,
C 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260
* 11, 11, 11, 10, 11, 11, 10, 10, 10, 11, 11, 11, 11, 11, 11,
C 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275
* 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 10, 11,
C 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290
* 10, 11, 10, 10, 10, 10, 10, 11, 11, 10, 11, 11, 11, 10, 11,
C 291 292 293 294 295 296 297 298 299 300
* 11, 11, 11, 10, 10, 10, 10, 10, 10, 10), NN
1006 IF (ICEP .GT. gen_maxcep) GO TO 1111
NN = ICEP - 300
C 301 302 303 304 305 306 307 308 309 310
GO TO ( 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,
C 311 312 313 314 315 316 317 318 319 320
* 11, 11, 11, 11, 11, 10, 10, 10, 10, 10,
C 321 322 323 324 325 326 327 328 329 330
* 10, 10, 10, 10, 10, 10, 10, 10, 11, 11,
C 331 332 333 334 335 336 337 338 339 340
* 10, 10, 11, 11, 11, 11, 10, 10, 10, 10,
C 341 342 343 344 345 346 347 348 349 350
* 11, 11, 11, 11, 10, 11, 11, 11, 10, 10 ), NN
Well, for the first one for maintainability (and not wanting to even mention ASSIGN statements) and primarily for human intelligibility I might go with a way that worked even pre-f90;. It would probably be more efficient if populated with logicals butthis format has a few advantages when a human has to manually
maintain the information.
program testit
implicit none
integer :: nn
integer,parameter :: EQUALS(*)=[&
+1, -2, -3, +4, +5, -6, -7, -8, +9, -10, &
+11, -12, -13, +14, +15, +16, +17, -18, -19, -20, &
+21, +22, +23, +24, -25, +26, -27, -28, -29, -30, &
-31, +32, -33, -34, -35, -36, -37, -38, -39, -40, &
+41, +42, +43, +44, -45, +46, -47, -48, -49, -50, &
+51, +52, -53, -54, +55, -56, -57, +58, -59, -60, &
+61, -62, +63, -64, -65, -66, +67, +68, -69, +70, &
-71, -72, +73, -74, -75, -76, -77, -78, -79, -80, &
-81, -82, +83, +84, -85, -86, -87, -88, -89, +90, &
+91, +92, +93, -94, -95, -96, +97, +98, -99, -100, &
-101, +102, +103, +104, -105, -106, -107, +108, +109, +110, &
+111, +112, +113, +114, +115, +116, +117, +118, +119, +120, &
+121, +122, +123, +124, +125, +126, +127, +128, +129, +130, &
-131, -132, -133, +134, +135, +136, +137, +138, +139, +140, &
+141, -142, -143, -144, -145, -146, +147, -148, -149, -150, &
+151, -152, -153, -154, -155, -156, -157, -158, -159, +160, &
-161, -162, -163, +164, -165, -166, +167, +168, +169, +170, &
+171, +172, +173, -174, +175, -176, -177, -178, +179, -180, &
-181, -182, -183, -184, +185, +186, +187, +188, +189, +190, &
-191, -192, -193, +194, -195, -196, -197, -198, -199, +200, &
-201, +202, -203, -204, -205, -206, +207, -208, -209, -210, &
+211, +212, -213, -214, +215, -216, -217, -218, -219, +220, &
+221, +222, +223, -224, +225, +226, +227, +228, -229, -230, &
-231, -232, -233, -234, -235, +236, -237, +238, +239, +240, &
-241, -242, -243, -244, +245, -246, -247, -248, +249, -250, &
-251, +252, +253, +254, -255, -256, -257, -258, -259, -260, &
-261, -262, -263, -264, -265, -266, -267, -268, -269, -270, &
-271, -272, -273, +274, -275, +276, -277, +278, +279, +280, &
+281, +282, -283, -284, +285, -286, -287, -288, +289, -290, &
-291, -292, -293, +294, +295, +296, +297, +298, +299, +300, &
-301, -302, -303, -304, -305, -306, -307, -308, -309, -310, &
-311, -312, -313, -314, -315, +316, +317, +318, +319, +320, &
+321, +322, +323, +324, +325, +326, +327, +328, -329, -330, &
+331, +332, -333, -334, -335, -336, +337, +338, +339, +340, &
-341, -342, -343, -344, +345, -346, -347, -348, +349, +350]
! CHECK THE COMMANDS WHICH SHOULD HAVE EQUAL SIGN
! + no equal sign required
! - equal sign required
write(*,*)size(equals)==350
do nn=1,size(equals)
if(equals(nn)>0)then
write(*,*)nn,'equal sign required'
else
write(*,*)nn,'equal sign not required'
endif
enddo
end program testit
On Thursday, June 16, 2022 at 2:33:44 PM UTC+10, John wrote:this format has a few advantages when a human has to manually
Well, for the first one for maintainability (and not wanting to even mention ASSIGN statements) and primarily for human intelligibility I might go with a way that worked even pre-f90;. It would probably be more efficient if populated with logicals but
maintain the information.
GO TO LAB(NN);
is still simpler in PL/I.
.
program testit
implicit none
integer :: nn
integer,parameter :: EQUALS(*)=[&
+1, -2, -3, +4, +5, -6, -7, -8, +9, -10, &
+11, -12, -13, +14, +15, +16, +17, -18, -19, -20, &
+21, +22, +23, +24, -25, +26, -27, -28, -29, -30, &
-31, +32, -33, -34, -35, -36, -37, -38, -39, -40, &
+41, +42, +43, +44, -45, +46, -47, -48, -49, -50, &
+51, +52, -53, -54, +55, -56, -57, +58, -59, -60, &
+61, -62, +63, -64, -65, -66, +67, +68, -69, +70, &
-71, -72, +73, -74, -75, -76, -77, -78, -79, -80, &
-81, -82, +83, +84, -85, -86, -87, -88, -89, +90, &
+91, +92, +93, -94, -95, -96, +97, +98, -99, -100, &
-101, +102, +103, +104, -105, -106, -107, +108, +109, +110, &
+111, +112, +113, +114, +115, +116, +117, +118, +119, +120, &
+121, +122, +123, +124, +125, +126, +127, +128, +129, +130, &
-131, -132, -133, +134, +135, +136, +137, +138, +139, +140, &
+141, -142, -143, -144, -145, -146, +147, -148, -149, -150, &
+151, -152, -153, -154, -155, -156, -157, -158, -159, +160, &
-161, -162, -163, +164, -165, -166, +167, +168, +169, +170, &
+171, +172, +173, -174, +175, -176, -177, -178, +179, -180, &
-181, -182, -183, -184, +185, +186, +187, +188, +189, +190, &
-191, -192, -193, +194, -195, -196, -197, -198, -199, +200, &
-201, +202, -203, -204, -205, -206, +207, -208, -209, -210, &
+211, +212, -213, -214, +215, -216, -217, -218, -219, +220, &
+221, +222, +223, -224, +225, +226, +227, +228, -229, -230, &
-231, -232, -233, -234, -235, +236, -237, +238, +239, +240, &
-241, -242, -243, -244, +245, -246, -247, -248, +249, -250, &
-251, +252, +253, +254, -255, -256, -257, -258, -259, -260, &
-261, -262, -263, -264, -265, -266, -267, -268, -269, -270, &
-271, -272, -273, +274, -275, +276, -277, +278, +279, +280, &
+281, +282, -283, -284, +285, -286, -287, -288, +289, -290, &
-291, -292, -293, +294, +295, +296, +297, +298, +299, +300, &
-301, -302, -303, -304, -305, -306, -307, -308, -309, -310, &
-311, -312, -313, -314, -315, +316, +317, +318, +319, +320, &
+321, +322, +323, +324, +325, +326, +327, +328, -329, -330, &
+331, +332, -333, -334, -335, -336, +337, +338, +339, +340, &
-341, -342, -343, -344, +345, -346, -347, -348, +349, +350]
! CHECK THE COMMANDS WHICH SHOULD HAVE EQUAL SIGN
! + no equal sign required
! - equal sign required
write(*,*)size(equals)==350
do nn=1,size(equals)
if(equals(nn)>0)then
write(*,*)nn,'equal sign required'
else
write(*,*)nn,'equal sign not required'
endif
enddo
end program testit
C CHECK THE COMMANDS WHICH SHOULD HAVE EQUAL SIGN
C 10 - no equal sign required
C 11 - equal sign required
integer needs(350)
data needs/
C ICEP = 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
* 10, 11, 11, 10, 10, 11, 11, 11, 10, 11, 10, 11, 11, 10, 10,
C ICEP = 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
* 10, 10, 11, 11, 11, 10, 10, 10, 10, 11, 10, 11, 11, 11, 11,
C ICEP = 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45
* 11, 10, 11, 11, 11, 11, 11, 11, 11, 11, 10, 10, 10, 10, 11,
C ICEP = 46 47 48 79 50
* 10, 11, 11, 11, 11,
C ICEP = 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65
* 10, 10, 11, 11, 10, 11, 11, 10, 11, 11, 10, 11, 10, 11, 11,
C ICEP = 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80
* 11, 10, 10, 11, 10, 11, 11, 10, 11, 11, 11, 11, 11, 11, 11,
C ICEP 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95
* 11, 11, 10, 10, 11, 11, 11, 11, 11, 10, 10, 10, 10, 11, 11,
C ICEP 96 97 98 99 100
* 11, 10, 10, 11, 11,
C ICEP = 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115
* 11, 10, 10, 10, 11, 11, 11, 10, 10, 10, 10, 10, 10, 10, 10,
C ICEP 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130
* 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10,
C ICEP 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145
* 11, 11, 11, 10, 10, 10, 10, 10, 10, 10, 10, 11, 11, 11, 11,
C ICEP 146 147 148 149 150
* 11, 10, 11, 11, 11,
C ICEP = 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165
* 10, 11, 11, 11, 11, 11, 11, 11, 11, 10, 11, 11, 11, 10, 11,
C ICEP 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180
* 11, 10, 10, 10, 10, 10, 10, 10, 11, 10, 11, 11, 11, 10, 11,
C ICEP 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195
* 11, 11, 11, 11, 10, 10, 10, 10, 10, 10, 11, 11, 11, 10, 11,
C 196 197 198 199 200
* 11, 11, 11, 11, 10,
C ICEP = 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215
* 11, 10, 11, 11, 11, 11, 10, 11, 11, 11, 10, 10, 11, 11, 10,
C 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230
* 11, 11, 11, 11, 10, 10, 10, 10, 11, 10, 10, 10, 10, 11, 11,
C 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245
* 11, 11, 11, 11, 11, 10, 11, 10, 10, 10, 11, 11, 11, 11, 10,
C 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260
* 11, 11, 11, 10, 11, 11, 10, 10, 10, 11, 11, 11, 11, 11, 11,
C 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275
* 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 10, 11,
C 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290
* 10, 11, 10, 10, 10, 10, 10, 11, 11, 10, 11, 11, 11, 10, 11,
C 291 292 293 294 295 296 297 298 299 300
* 11, 11, 11, 10, 10, 10, 10, 10, 10, 10,
C 301 302 303 304 305 306 307 308 309 310
* 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,
C 311 312 313 314 315 316 317 318 319 320
* 11, 11, 11, 11, 11, 10, 10, 10, 10, 10,
C 321 322 323 324 325 326 327 328 329 330
* 10, 10, 10, 10, 10, 10, 10, 10, 11, 11,
C 331 332 333 334 335 336 337 338 339 340
* 10, 10, 11, 11, 11, 11, 10, 10, 10, 10,
C 341 342 343 344 345 346 347 348 349 350
* 11, 11, 11, 11, 10, 11, 11, 11, 10, 10 /
On 6/13/2022 7:19 PM, gah4 wrote:.
On Monday, June 13, 2022 at 4:29:18 PM UTC-7, Lynn McGuire wrote:
(snip)
Depends on what you mean by regular Fortran. In f2003 and later the limit is 255, but in f95 it's 39 in free form, 19 in fixed form.I meant Standard Fortran.
66, 77, 90, 95, 2008, 2013, or 2018?
There is a famous quote:
"The nice thing about standards is that we have so many to choose from."Heh.
F77 apparently allowed 19 continuation lines.
Open Watcom Fortran 77 is.
extended to allow up to 61 continuation lines.
On 6/17/2022 2:43 AM, Robin Vowels wrote:but this format has a few advantages when a human has to manually
On Thursday, June 16, 2022 at 2:33:44 PM UTC+10, John wrote:
Well, for the first one for maintainability (and not wanting to even mention ASSIGN statements) and primarily for human intelligibility I might go with a way that worked even pre-f90;. It would probably be more efficient if populated with logicals
.maintain the information.
GO TO LAB(NN);
is still simpler in PL/I.
.
program testit
implicit none
integer :: nn
integer,parameter :: EQUALS(*)=[&
+1, -2, -3, +4, +5, -6, -7, -8, +9, -10, &
+11, -12, -13, +14, +15, +16, +17, -18, -19, -20, &
+21, +22, +23, +24, -25, +26, -27, -28, -29, -30, &
-31, +32, -33, -34, -35, -36, -37, -38, -39, -40, &
+41, +42, +43, +44, -45, +46, -47, -48, -49, -50, &
+51, +52, -53, -54, +55, -56, -57, +58, -59, -60, &
+61, -62, +63, -64, -65, -66, +67, +68, -69, +70, &
-71, -72, +73, -74, -75, -76, -77, -78, -79, -80, &
-81, -82, +83, +84, -85, -86, -87, -88, -89, +90, &
+91, +92, +93, -94, -95, -96, +97, +98, -99, -100, &
-101, +102, +103, +104, -105, -106, -107, +108, +109, +110, &
+111, +112, +113, +114, +115, +116, +117, +118, +119, +120, &
+121, +122, +123, +124, +125, +126, +127, +128, +129, +130, &
-131, -132, -133, +134, +135, +136, +137, +138, +139, +140, &
+141, -142, -143, -144, -145, -146, +147, -148, -149, -150, &
+151, -152, -153, -154, -155, -156, -157, -158, -159, +160, &
-161, -162, -163, +164, -165, -166, +167, +168, +169, +170, &
+171, +172, +173, -174, +175, -176, -177, -178, +179, -180, &
-181, -182, -183, -184, +185, +186, +187, +188, +189, +190, &
-191, -192, -193, +194, -195, -196, -197, -198, -199, +200, &
-201, +202, -203, -204, -205, -206, +207, -208, -209, -210, &
+211, +212, -213, -214, +215, -216, -217, -218, -219, +220, &
+221, +222, +223, -224, +225, +226, +227, +228, -229, -230, &
-231, -232, -233, -234, -235, +236, -237, +238, +239, +240, &
-241, -242, -243, -244, +245, -246, -247, -248, +249, -250, &
-251, +252, +253, +254, -255, -256, -257, -258, -259, -260, &
-261, -262, -263, -264, -265, -266, -267, -268, -269, -270, &
-271, -272, -273, +274, -275, +276, -277, +278, +279, +280, &
+281, +282, -283, -284, +285, -286, -287, -288, +289, -290, &
-291, -292, -293, +294, +295, +296, +297, +298, +299, +300, &
-301, -302, -303, -304, -305, -306, -307, -308, -309, -310, &
-311, -312, -313, -314, -315, +316, +317, +318, +319, +320, &
+321, +322, +323, +324, +325, +326, +327, +328, -329, -330, &
+331, +332, -333, -334, -335, -336, +337, +338, +339, +340, &
-341, -342, -343, -344, +345, -346, -347, -348, +349, +350]
! CHECK THE COMMANDS WHICH SHOULD HAVE EQUAL SIGN
! + no equal sign required
! - equal sign required
write(*,*)size(equals)==350
do nn=1,size(equals)
if(equals(nn)>0)then
write(*,*)nn,'equal sign required'
else
write(*,*)nn,'equal sign not required'
endif
enddo
end program testit
So ? We are not talking about PL/I..
Well, for the first one for maintainability (and not wanting to even
mention ASSIGN statements) and primarily for human intelligibility I
might go with a way that worked even pre-f90;.
John wrote:
Well, for the first one for maintainability (and not wanting to even
mention ASSIGN statements) and primarily for human intelligibility I
might go with a way that worked even pre-f90;.
I don't think we were told enough about the context of all this. If
this bit of code is gone through often in a single execution, it may
well be worth doing some initialisation computations that can sort out
both maintainability and readability as well as overall speed of
execution. One could start with several lists of items of different
types, such as could be extended easily as necessary, and then go
through these lists automatically (once-only) to construct sufficient cross-referencing etc. so that you can readily know what needs to be
done whenever a decision is needed.
On Sunday, June 19, 2022 at 6:05:16 AM UTC+10, Lynn McGuire wrote:but this format has a few advantages when a human has to manually
On 6/17/2022 2:43 AM, Robin Vowels wrote:
On Thursday, June 16, 2022 at 2:33:44 PM UTC+10, John wrote:
Well, for the first one for maintainability (and not wanting to even mention ASSIGN statements) and primarily for human intelligibility I might go with a way that worked even pre-f90;. It would probably be more efficient if populated with logicals
.maintain the information.
GO TO LAB(NN);
is still simpler in PL/I.
.
program testit
implicit none
integer :: nn
integer,parameter :: EQUALS(*)=[&
+1, -2, -3, +4, +5, -6, -7, -8, +9, -10, &
+11, -12, -13, +14, +15, +16, +17, -18, -19, -20, &
+21, +22, +23, +24, -25, +26, -27, -28, -29, -30, &
-31, +32, -33, -34, -35, -36, -37, -38, -39, -40, &
+41, +42, +43, +44, -45, +46, -47, -48, -49, -50, &
+51, +52, -53, -54, +55, -56, -57, +58, -59, -60, &
+61, -62, +63, -64, -65, -66, +67, +68, -69, +70, &
-71, -72, +73, -74, -75, -76, -77, -78, -79, -80, &
-81, -82, +83, +84, -85, -86, -87, -88, -89, +90, &
+91, +92, +93, -94, -95, -96, +97, +98, -99, -100, &
-101, +102, +103, +104, -105, -106, -107, +108, +109, +110, &
+111, +112, +113, +114, +115, +116, +117, +118, +119, +120, &
+121, +122, +123, +124, +125, +126, +127, +128, +129, +130, &
-131, -132, -133, +134, +135, +136, +137, +138, +139, +140, &
+141, -142, -143, -144, -145, -146, +147, -148, -149, -150, &
+151, -152, -153, -154, -155, -156, -157, -158, -159, +160, &
-161, -162, -163, +164, -165, -166, +167, +168, +169, +170, &
+171, +172, +173, -174, +175, -176, -177, -178, +179, -180, &
-181, -182, -183, -184, +185, +186, +187, +188, +189, +190, &
-191, -192, -193, +194, -195, -196, -197, -198, -199, +200, &
-201, +202, -203, -204, -205, -206, +207, -208, -209, -210, &
+211, +212, -213, -214, +215, -216, -217, -218, -219, +220, &
+221, +222, +223, -224, +225, +226, +227, +228, -229, -230, &
-231, -232, -233, -234, -235, +236, -237, +238, +239, +240, &
-241, -242, -243, -244, +245, -246, -247, -248, +249, -250, &
-251, +252, +253, +254, -255, -256, -257, -258, -259, -260, &
-261, -262, -263, -264, -265, -266, -267, -268, -269, -270, &
-271, -272, -273, +274, -275, +276, -277, +278, +279, +280, &
+281, +282, -283, -284, +285, -286, -287, -288, +289, -290, &
-291, -292, -293, +294, +295, +296, +297, +298, +299, +300, &
-301, -302, -303, -304, -305, -306, -307, -308, -309, -310, &
-311, -312, -313, -314, -315, +316, +317, +318, +319, +320, &
+321, +322, +323, +324, +325, +326, +327, +328, -329, -330, &
+331, +332, -333, -334, -335, -336, +337, +338, +339, +340, &
-341, -342, -343, -344, +345, -346, -347, -348, +349, +350]
! CHECK THE COMMANDS WHICH SHOULD HAVE EQUAL SIGN
! + no equal sign required
! - equal sign required
write(*,*)size(equals)==350
do nn=1,size(equals)
if(equals(nn)>0)then
write(*,*)nn,'equal sign required'
else
write(*,*)nn,'equal sign not required'
endif
enddo
end program testit
So ? We are not talking about PL/I..
Several languages have already been discussed in this thread, including PL/I. .
PL/I can considerably shorten F77 code.
This instance, where a trivial PL/I statement can replace some 30-40 lines of F77,
might be worthy of further examination.
In this case, the software program is 850,000 lines of F77, C and C++.
90% currently F77. Adding anything PL/1 is simply not an option.
One of my favorite things about C++ is that I can declare variables all
over the place. With an average of 2,000 lines of code per subroutine,
it would be nice to locate the variable declarations at their usage.
Lynn McGuire <lynnmcguire5@gmail.com> wrote:
One of my favorite things about C++ is that I can declare variables all
over the place. With an average of 2,000 lines of code per subroutine,
it would be nice to locate the variable declarations at their usage.
I did that once with some C ... and it then ran about
ten times slower :-/
#Paul
Lynn McGuire <lynnmc...@gmail.com> wrote:
One of my favorite things about C++ is that I can declare variables all over the place. With an average of 2,000 lines of code per subroutine,
it would be nice to locate the variable declarations at their usage.
I did that once with some C ... and it then ran about
ten times slower :-/
On Tuesday, July 12, 2022 at 10:54:05 AM UTC-7, p.ki...@ic.ac.uk wrote:
Lynn McGuire <lynnmc...@gmail.com> wrote:
One of my favorite things about C++ is that I can declare variables all
over the place. With an average of 2,000 lines of code per subroutine,
it would be nice to locate the variable declarations at their usage.
I did that once with some C ... and it then ran about
ten times slower :-/
As well as I know it for C, I am less sure for C++, the allocation is the same, independent of where the declarations are. It should not change
run time behavior.
I suppose that some optimizers might work different, depending on
such declarations, though that shouldn't actually happen.
Automatic variables are allocated on function entry.
Lynn McGuire <lynnmc...@gmail.com> wrote:Declaring variables where used was one of my favourite things about Algol 68, long before C++ was invented. The block construct lets you do it in Fortran too.
One of my favorite things about C++ is that I can declare variables all over the place. With an average of 2,000 lines of code per subroutine,I did that once with some C ... and it then ran about
it would be nice to locate the variable declarations at their usage.
ten times slower :-/
#Paul
Declaring variables where used was one of my favourite things about Algol 68, long before C++ was invented. The block construct lets you do it in Fortran too.
Declaring variables where used was one of my favourite things about Algol 68, long before C++ was invented. The block construct lets you do it in Fortran too.
On 7/12/22 4:15 PM, jfh wrote:
Declaring variables where used was one of my favourite things about
Algol 68, long before C++ was invented. The block construct lets you
do it in Fortran too.
How exactly does this work in fortran. If you have a block with local variables, are they allocated afresh when the block is entered and deallocated upon block exit, or are they just allocated once? What if
the block is within a loop?
On Tuesday, July 12, 2022 at 2:15:13 PM UTC-7, jfh wrote:.
(snip)
Declaring variables where used was one of my favourite things about Algol 68, long before C++ was invented. The block construct lets you do it in Fortran too.Different question.
Blocks in ALGOL, BEGIN blocks in PL/I,
and some others in other languages, allow for allocation of automatic variables..
(PL/I has DO blocks which are only for grouping, and not allocation or scoping.)
On 7/12/22 4:15 PM, jfh wrote:
Declaring variables where used was one of my favourite things about Algol 68, long before C++ was invented. The block construct lets you do it in Fortran too.
How exactly does this work in fortran. If you have a block with local variables, are they allocated afresh when the block is entered and deallocated upon block exit, or are they just allocated once? What if
the block is within a loop?
On 7/13/2022 11:51 AM, Thomas Koenig wrote:
Ron Shepard <nospam@nowhere.org> schrieb:
On 7/12/22 4:15 PM, jfh wrote:
Declaring variables where used was one of my favourite things about Algol 68, long before C++ was invented. The block construct lets you do it in Fortran too.
How exactly does this work in fortran. If you have a block with local
variables, are they allocated afresh when the block is entered and
deallocated upon block exit, or are they just allocated once? What if
the block is within a loop?
The compiler will look at the lifetime of the variable and allocate
it on the stack or in a register accordingly. A modern compiler
will, when optimizing, reuse stack slots if possible, with or
without help from the programmer through BLOCK statements.
Compilers have gotten quite good :-)
Also, the intermediate form that compilers use these days,
single static assignment, makes this optimization necessary.
Basically, any assignment to any variable creates a new
variable, so something like
i = 42
j = 2
i = i + j
j = j + i
will be translated to
i_1 = 42
j_1 = 2
i_2 = i_1 + j_1
j_2 = j_1 + i_2
and the compiler will determine that i_1 is no longer
in use, and will drop it.
Anything I learned in my C-64 Basic days about re-using
variables to save space, I had to unlearn :-)
Yup, we are memory pigs nowadays. I only start to worry about variables being too large when I declare double precision arrays of more than a
million members. It is just not worth my time to optimize the usage.
And the old memory optimizations in our code are a total pain now.
Ron Shepard <nospam@nowhere.org> schrieb:
On 7/12/22 4:15 PM, jfh wrote:
Declaring variables where used was one of my favourite things about Algol 68, long before C++ was invented. The block construct lets you do it in Fortran too.
How exactly does this work in fortran. If you have a block with local
variables, are they allocated afresh when the block is entered and
deallocated upon block exit, or are they just allocated once? What if
the block is within a loop?
The compiler will look at the lifetime of the variable and allocate
it on the stack or in a register accordingly. A modern compiler
will, when optimizing, reuse stack slots if possible, with or
without help from the programmer through BLOCK statements.
Compilers have gotten quite good :-)
Also, the intermediate form that compilers use these days,
single static assignment, makes this optimization necessary.
Basically, any assignment to any variable creates a new
variable, so something like
i = 42
j = 2
i = i + j
j = j + i
will be translated to
i_1 = 42
j_1 = 2
i_2 = i_1 + j_1
j_2 = j_1 + i_2
and the compiler will determine that i_1 is no longer
in use, and will drop it.
Anything I learned in my C-64 Basic days about re-using
variables to save space, I had to unlearn :-)
On 7/12/22 4:15 PM, jfh wrote:
Declaring variables where used was one of my favourite thingsabout Algol 68, long before C++ was invented. The block construct
lets you do it in Fortran too.
How exactly does this work in fortran. If you have a block with local variables, are they allocated afresh when the block is entered and deallocated upon block exit, or are they just allocated once? What if
the block is within a loop?
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 159 |
Nodes: | 16 (0 / 16) |
Uptime: | 98:31:17 |
Calls: | 3,209 |
Files: | 10,563 |
Messages: | 3,009,579 |