-
Notifications
You must be signed in to change notification settings - Fork 2
/
prts.f
1309 lines (1278 loc) · 46.8 KB
/
prts.f
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
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
C->>> ------------------------------------------------> ems_wr_rg_da <<<
c Report the ranging data
c
subroutine ems_wr_rg_da(
& rl_nm, st, pr_act, scl, co,
& co_rg_up_co_v, co_rg_lo_co_v,
& co_rg_up_ob_v, co_rg_lo_ob_v,
& co_rg_up_act_v, co_rg_lo_act_v,
& co_rg_up_en_vr, co_rg_lo_en_vr,
& co_rg_up_lv_vr, co_rg_lo_lv_vr,
& bd_rg_up_bd_v, bd_rg_lo_bd_v,
& bd_rg_up_ob_v, bd_rg_lo_ob_v,
& bd_rg_up_en_vr, bd_rg_lo_en_vr,
& bd_rg_up_lv_vr, bd_rg_lo_lv_vr)
implicit none
include 'EMSV.INC'
include 'EMSPM.INC'
include 'EMSFI.INC'
include 'PRTS.INC'
include 'ICTVR.INC'
include 'EMSMSG.INC'
integer st(0:mx_n_c+n_r)
double precision rl_nm(ml_nm_n_rl, 0:mx_n_c+n_r)
double precision pr_act(0:mx_n_c+n_r)
double precision scl(0:mx_n_c+n_r)
double precision co(0:n_c)
double precision co_rg_up_co_v(0:n_c)
double precision co_rg_lo_co_v(0:n_c)
double precision co_rg_up_ob_v(0:n_c)
double precision co_rg_lo_ob_v(0:n_c)
double precision co_rg_up_act_v(0:n_c)
double precision co_rg_lo_act_v(0:n_c)
integer co_rg_up_en_vr(0:n_c)
integer co_rg_lo_en_vr(0:n_c)
integer co_rg_up_lv_vr(0:n_c)
integer co_rg_lo_lv_vr(0:n_c)
double precision bd_rg_up_bd_v(0:mx_n_c+n_r)
double precision bd_rg_lo_bd_v(0:mx_n_c+n_r)
double precision bd_rg_up_ob_v(0:mx_n_c+n_r)
double precision bd_rg_lo_ob_v(0:mx_n_c+n_r)
integer bd_rg_up_en_vr(0:mx_n_c+n_r)
integer bd_rg_lo_en_vr(0:mx_n_c+n_r)
integer bd_rg_up_lv_vr(0:mx_n_c+n_r)
integer bd_rg_lo_lv_vr(0:mx_n_c+n_r)
integer ix_n, vr_ix, vr_n, te_vr_n, ems_vr_ty
double precision rl_up_en_vr_nm(ml_nm_mx_n_rl)
double precision rl_up_lv_vr_nm(ml_nm_mx_n_rl)
double precision rl_lo_en_vr_nm(ml_nm_mx_n_rl)
double precision rl_lo_lv_vr_nm(ml_nm_mx_n_rl)
double precision co_v, pr_act_v
double precision up_rg_v, up_ob_rg_v, lo_rg_v, lo_ob_rg_v
double precision up_act_v, lo_act_v
logical nw_pg
if (iand(ml_da_st_msk, ml_da_st_rg_da) .eq. 0) goto 7000
c
c Start by writing out rows:
c Start a new page
c The dual activities may have had their sign changed and are
c written out with a sign change.
c
nw_pg = .true.
ems_vr_ty = ems_vr_ty_c
do 10, ix_n = 1, n_c
vr_ix = ix_n
vr_n = ix_n
if (nw_pg)
& call ems_wr_prts_hdr(prts_hdr_ty_co_rg_da, ems_vr_ty)
co_v = co(vr_n)
up_rg_v = co_rg_up_co_v(vr_n)
up_ob_rg_v = co_rg_up_ob_v(vr_n)
up_act_v = co_rg_up_act_v(vr_n)
lo_rg_v = co_rg_lo_co_v(vr_n)
lo_ob_rg_v = co_rg_lo_ob_v(vr_n)
lo_act_v = co_rg_lo_act_v(vr_n)
c if (iand(ml_da_st_msk, ml_da_st_scl_ml_sol) .ne. 0) then
c up_rg_v = up_rg_v*scl(vr_n)
c lo_rg_v = lo_rg_v*scl(vr_n)
c endif
te_vr_n = co_rg_up_en_vr(vr_n)
if (te_vr_n .ge. 0) then
call ems_cp_rl_nm(rl_nm(1, te_vr_n), rl_up_en_vr_nm)
else
call ems_cp_rl_nm(rl_nm(1, mx_n_c-te_vr_n), rl_up_en_vr_nm)
endif
te_vr_n = co_rg_up_lv_vr(vr_n)
if (te_vr_n .ge. 0) then
call ems_cp_rl_nm(rl_nm(1, te_vr_n), rl_up_lv_vr_nm)
else
call ems_cp_rl_nm(rl_nm(1, mx_n_c-te_vr_n), rl_up_lv_vr_nm)
endif
te_vr_n = co_rg_lo_en_vr(vr_n)
if (te_vr_n .ge. 0) then
call ems_cp_rl_nm(rl_nm(1, te_vr_n), rl_lo_en_vr_nm)
else
call ems_cp_rl_nm(rl_nm(1, mx_n_c-te_vr_n), rl_lo_en_vr_nm)
endif
te_vr_n = co_rg_lo_lv_vr(vr_n)
if (te_vr_n .ge. 0) then
call ems_cp_rl_nm(rl_nm(1, te_vr_n), rl_lo_lv_vr_nm)
else
call ems_cp_rl_nm(rl_nm(1, mx_n_c-te_vr_n), rl_lo_lv_vr_nm)
endif
call ems_wr_1_co_rg_da(vr_ix,
& rl_nm(1, vr_n), st(vr_n), co_v,
& up_rg_v, up_ob_rg_v, up_act_v,
& rl_up_en_vr_nm, rl_up_lv_vr_nm,
& lo_rg_v, lo_ob_rg_v, lo_act_v,
& rl_lo_en_vr_nm, rl_lo_lv_vr_nm,
& ems_vr_ty)
nw_pg = ems_msg_pg_li_n .eq. n_pg_li-1
10 continue
nw_pg = .true.
ems_vr_ty = ems_vr_ty_r
do 20, ix_n = 1, n_r + n_c
if (ix_n .eq. n_r+1) then
c
c Switch to writing out columns:
c Start a new page
c
nw_pg = .true.
ems_vr_ty = ems_vr_ty_c
endif
if (ix_n .le. n_r) then
vr_ix = ix_n
vr_n = ix_n + mx_n_c
else
vr_ix = ix_n - n_r
vr_n = vr_ix
endif
if (nw_pg)
& call ems_wr_prts_hdr(prts_hdr_ty_bd_rg_da, ems_vr_ty)
pr_act_v = pr_act(vr_n)
up_rg_v = bd_rg_up_bd_v(vr_n)
up_ob_rg_v = bd_rg_up_ob_v(vr_n)
lo_rg_v = bd_rg_lo_bd_v(vr_n)
lo_ob_rg_v = bd_rg_lo_ob_v(vr_n)
if (iand(ml_da_st_msk, ml_da_st_scl_ml_sol) .ne. 0) then
pr_act_v = pr_act_v/scl(vr_n)
c up_rg_v = up_rg_v/scl(vr_n)
c lo_rg_v = lo_rg_v/scl(vr_n)
endif
te_vr_n = bd_rg_up_en_vr(vr_n)
if (te_vr_n .ge. 0) then
call ems_cp_rl_nm(rl_nm(1, te_vr_n), rl_up_en_vr_nm)
else
call ems_cp_rl_nm(rl_nm(1, mx_n_c-te_vr_n), rl_up_en_vr_nm)
endif
te_vr_n = bd_rg_up_lv_vr(vr_n)
if (te_vr_n .ge. 0) then
call ems_cp_rl_nm(rl_nm(1, te_vr_n), rl_up_lv_vr_nm)
else
call ems_cp_rl_nm(rl_nm(1, mx_n_c-te_vr_n), rl_up_lv_vr_nm)
endif
te_vr_n = bd_rg_lo_en_vr(vr_n)
if (te_vr_n .ge. 0) then
call ems_cp_rl_nm(rl_nm(1, te_vr_n), rl_lo_en_vr_nm)
else
call ems_cp_rl_nm(rl_nm(1, mx_n_c-te_vr_n), rl_lo_en_vr_nm)
endif
te_vr_n = bd_rg_lo_lv_vr(vr_n)
if (te_vr_n .ge. 0) then
call ems_cp_rl_nm(rl_nm(1, te_vr_n), rl_lo_lv_vr_nm)
else
call ems_cp_rl_nm(rl_nm(1, mx_n_c-te_vr_n), rl_lo_lv_vr_nm)
endif
call ems_wr_1_rg_da(vr_ix,
& rl_nm(1, vr_n), st(vr_n), pr_act_v,
& up_rg_v, up_ob_rg_v, rl_up_en_vr_nm, rl_up_lv_vr_nm,
& lo_rg_v, lo_ob_rg_v, rl_lo_en_vr_nm, rl_lo_lv_vr_nm,
& ems_vr_ty)
nw_pg = ems_msg_pg_li_n .eq. n_pg_li-1
20 continue
7000 continue
return
end
C->>> -------------------------------------------> ems_wr_1_co_rg_da <<<
c Writes the cost range data for a particular variable.
c
subroutine ems_wr_1_co_rg_da(ix,
& rl_vr_nm, vr_st, v,
& up_rg, up_ob_rg, up_act_v, rl_up_en_vr_nm, rl_up_lv_vr_nm,
& lo_rg, lo_ob_rg, lo_act_v, rl_lo_en_vr_nm, rl_lo_lv_vr_nm,
& ems_vr_ty)
implicit none
include 'EMSV.INC'
include 'EMSPM.INC'
include 'EMSFI.INC'
include 'PRTS.INC'
include 'ICTVR.INC'
include 'EMSMSG.INC'
integer ix, vr_st, ems_vr_ty
double precision rl_vr_nm(ml_nm_n_rl), v
double precision up_rg, up_ob_rg, up_act_v
double precision lo_rg, lo_ob_rg, lo_act_v
double precision rl_up_en_vr_nm(ml_nm_n_rl)
double precision rl_up_lv_vr_nm(ml_nm_n_rl)
double precision rl_lo_en_vr_nm(ml_nm_n_rl)
double precision rl_lo_lv_vr_nm(ml_nm_n_rl)
character*(ml_nm_mx_n_ch) mu_ch_vr_nm
character*(ml_nm_mx_n_ch) mu_ch_en_vr_nm
character*(ml_nm_mx_n_ch) mu_ch_lv_vr_nm
character*20 ems_wr_rl_t_ch20
character*4 ems_wr_st_t_ch4
integer t_ch_n
call ems_rl_t_ch(ml_nm_n_ch, rl_vr_nm, mu_ch_vr_nm)
t_ch_n = 0
call ems_rl_t_ch(ml_nm_n_ch, rl_up_en_vr_nm, mu_ch_en_vr_nm)
call ems_rl_t_ch(ml_nm_n_ch, rl_up_lv_vr_nm, mu_ch_lv_vr_nm)
vr_li(t_ch_n+1:t_ch_n+2+ml_nm_n_ch) =
& ' '//mu_ch_vr_nm(1:ml_nm_n_ch)
t_ch_n = t_ch_n + 2+ml_nm_n_ch
vr_li(t_ch_n+1:t_ch_n+6) = ' '//ems_wr_st_t_ch4(vr_st)
t_ch_n = t_ch_n + 6
vr_li(t_ch_n+1:t_ch_n+prts_rl_fld_ln) =
& ' '//ems_wr_rl_t_ch20(v)
t_ch_n = t_ch_n + prts_rl_fld_ln
c
vr_li(t_ch_n+1:t_ch_n+prts_rl_fld_ln) =
& ' '//ems_wr_rl_t_ch20(up_rg)
t_ch_n = t_ch_n + prts_rl_fld_ln
c
vr_li(t_ch_n+1:t_ch_n+prts_rl_fld_ln) =
& ' '//ems_wr_rl_t_ch20(up_ob_rg)
t_ch_n = t_ch_n + prts_rl_fld_ln
c
vr_li(t_ch_n+1:t_ch_n+prts_rl_fld_ln) =
& ' '//ems_wr_rl_t_ch20(up_act_v)
t_ch_n = t_ch_n + prts_rl_fld_ln
c
vr_li(t_ch_n+1:t_ch_n+2+ml_nm_n_ch) =
& ' '//mu_ch_en_vr_nm(1:ml_nm_n_ch)
t_ch_n = t_ch_n + 2+ml_nm_n_ch
c
vr_li(t_ch_n+1:t_ch_n+2+ml_nm_n_ch) =
& ' '//mu_ch_lv_vr_nm(1:ml_nm_n_ch)
t_ch_n = t_ch_n + 2+ml_nm_n_ch
if (ems_msg_no_prt_fm .ge. 1) write(ems_li, 9000)
& ix, vr_li(1:t_ch_n)
call ems_msg_wr_li(64)
t_ch_n = 0
call ems_rl_t_ch(ml_nm_n_ch, rl_lo_en_vr_nm, mu_ch_en_vr_nm)
call ems_rl_t_ch(ml_nm_n_ch, rl_lo_lv_vr_nm, mu_ch_lv_vr_nm)
vr_li(t_ch_n+1:t_ch_n+2+ml_nm_n_ch) = ' '
t_ch_n = t_ch_n + 2+ml_nm_n_ch
vr_li(t_ch_n+1:t_ch_n+6) = ' '
t_ch_n = t_ch_n + 6
vr_li(t_ch_n+1:t_ch_n+prts_rl_fld_ln) =
& ' '
t_ch_n = t_ch_n + prts_rl_fld_ln
c
vr_li(t_ch_n+1:t_ch_n+prts_rl_fld_ln) =
& ' '//ems_wr_rl_t_ch20(lo_rg)
t_ch_n = t_ch_n + prts_rl_fld_ln
c
vr_li(t_ch_n+1:t_ch_n+prts_rl_fld_ln) =
& ' '//ems_wr_rl_t_ch20(lo_ob_rg)
t_ch_n = t_ch_n + prts_rl_fld_ln
c
vr_li(t_ch_n+1:t_ch_n+prts_rl_fld_ln) =
& ' '//ems_wr_rl_t_ch20(lo_act_v)
t_ch_n = t_ch_n + prts_rl_fld_ln
c
vr_li(t_ch_n+1:t_ch_n+2+ml_nm_n_ch) =
& ' '//mu_ch_en_vr_nm(1:ml_nm_n_ch)
t_ch_n = t_ch_n + 2+ml_nm_n_ch
c
vr_li(t_ch_n+1:t_ch_n+2+ml_nm_n_ch) =
& ' '//mu_ch_lv_vr_nm(1:ml_nm_n_ch)
t_ch_n = t_ch_n + 2+ml_nm_n_ch
if (ems_msg_no_prt_fm .ge. 1) write(ems_li, 9001)vr_li(1:t_ch_n)
call ems_msg_wr_li(64)
return
9000 format(1x, i7, a)
9001 format(1x, 7x, a)
end
C->>> ----------------------------------------------> ems_wr_1_rg_da <<<
c Writes the range data for a particular variable.
c
subroutine ems_wr_1_rg_da(ix,
& rl_vr_nm, vr_st, v,
& up_rg, up_ob_rg, rl_up_en_vr_nm, rl_up_lv_vr_nm,
& lo_rg, lo_ob_rg, rl_lo_en_vr_nm, rl_lo_lv_vr_nm,
& ems_vr_ty)
implicit none
include 'EMSV.INC'
include 'EMSPM.INC'
include 'EMSFI.INC'
include 'PRTS.INC'
include 'ICTVR.INC'
include 'EMSMSG.INC'
integer ix, vr_st, ems_vr_ty
double precision rl_vr_nm(ml_nm_n_rl)
double precision v, up_rg, up_ob_rg, lo_rg, lo_ob_rg
double precision rl_up_en_vr_nm(ml_nm_n_rl)
double precision rl_up_lv_vr_nm(ml_nm_n_rl)
double precision rl_lo_en_vr_nm(ml_nm_n_rl)
double precision rl_lo_lv_vr_nm(ml_nm_n_rl)
character*(ml_nm_mx_n_ch) mu_ch_vr_nm
character*(ml_nm_mx_n_ch) mu_ch_en_vr_nm
character*(ml_nm_mx_n_ch) mu_ch_lv_vr_nm
character*20 ems_wr_rl_t_ch20
character*4 ems_wr_st_t_ch4
integer t_ch_n
call ems_rl_t_ch(ml_nm_n_ch, rl_vr_nm, mu_ch_vr_nm)
t_ch_n = 0
call ems_rl_t_ch(ml_nm_n_ch, rl_up_en_vr_nm, mu_ch_en_vr_nm)
call ems_rl_t_ch(ml_nm_n_ch, rl_up_lv_vr_nm, mu_ch_lv_vr_nm)
vr_li(t_ch_n+1:t_ch_n+2+ml_nm_n_ch) =
& ' '//mu_ch_vr_nm(1:ml_nm_n_ch)
t_ch_n = t_ch_n + 2+ml_nm_n_ch
vr_li(t_ch_n+1:t_ch_n+6) = ' '//ems_wr_st_t_ch4(vr_st)
t_ch_n = t_ch_n + 6
vr_li(t_ch_n+1:t_ch_n+prts_rl_fld_ln) =
& ' '//ems_wr_rl_t_ch20(v)
t_ch_n = t_ch_n + prts_rl_fld_ln
c
vr_li(t_ch_n+1:t_ch_n+prts_rl_fld_ln) =
& ' '//ems_wr_rl_t_ch20(up_rg)
t_ch_n = t_ch_n + prts_rl_fld_ln
c
vr_li(t_ch_n+1:t_ch_n+prts_rl_fld_ln) =
& ' '//ems_wr_rl_t_ch20(up_ob_rg)
t_ch_n = t_ch_n + prts_rl_fld_ln
c
vr_li(t_ch_n+1:t_ch_n+2+ml_nm_n_ch) =
& ' '//mu_ch_en_vr_nm(1:ml_nm_n_ch)
t_ch_n = t_ch_n + 2+ml_nm_n_ch
c
vr_li(t_ch_n+1:t_ch_n+2+ml_nm_n_ch) =
& ' '//mu_ch_lv_vr_nm(1:ml_nm_n_ch)
t_ch_n = t_ch_n + 2+ml_nm_n_ch
if (ems_msg_no_prt_fm .ge. 1) write(ems_li, 9000)
& ix, vr_li(1:t_ch_n)
call ems_msg_wr_li(64)
t_ch_n = 0
call ems_rl_t_ch(ml_nm_n_ch, rl_lo_en_vr_nm, mu_ch_en_vr_nm)
call ems_rl_t_ch(ml_nm_n_ch, rl_lo_lv_vr_nm, mu_ch_lv_vr_nm)
vr_li(t_ch_n+1:t_ch_n+2+ml_nm_n_ch) = ' '
t_ch_n = t_ch_n + 2+ml_nm_n_ch
vr_li(t_ch_n+1:t_ch_n+6) = ' '
t_ch_n = t_ch_n + 6
vr_li(t_ch_n+1:t_ch_n+prts_rl_fld_ln) =
& ' '
t_ch_n = t_ch_n + prts_rl_fld_ln
c
vr_li(t_ch_n+1:t_ch_n+prts_rl_fld_ln) =
& ' '//ems_wr_rl_t_ch20(lo_rg)
t_ch_n = t_ch_n + prts_rl_fld_ln
c
vr_li(t_ch_n+1:t_ch_n+prts_rl_fld_ln) =
& ' '//ems_wr_rl_t_ch20(lo_ob_rg)
t_ch_n = t_ch_n + prts_rl_fld_ln
c
vr_li(t_ch_n+1:t_ch_n+2+ml_nm_n_ch) =
& ' '//mu_ch_en_vr_nm(1:ml_nm_n_ch)
t_ch_n = t_ch_n + 2+ml_nm_n_ch
c
vr_li(t_ch_n+1:t_ch_n+2+ml_nm_n_ch) =
& ' '//mu_ch_lv_vr_nm(1:ml_nm_n_ch)
t_ch_n = t_ch_n + 2+ml_nm_n_ch
if (ems_msg_no_prt_fm .ge. 1) write(ems_li, 9001)vr_li(1:t_ch_n)
call ems_msg_wr_li(64)
return
9000 format(1x, i7, a)
9001 format(1x, 7x, a)
end
C->>> ---------------------------------------------------> ems_lp_rs <<<
c Writes out data from the LP solver.
c
subroutine ems_lp_rs(ds, is)
implicit none
include 'EMSV.INC'
include 'EMSPM.INC'
include 'EMSMMGR.INC'
include 'EMSMEM.INC'
include 'EMSP.INC'
include 'EMSFI.INC'
include 'PRTS.INC'
include 'ICTVR.INC'
double precision ds(0:ds_n_en_m1)
integer is(0:is_n_en_m1)
integer p_c_nm
if (wr_ml_da_msk .eq. 0) goto 7000
if (iand(wr_ml_da_msk, wr_ml_da_ml_z_bt) .ne. 0) call ems_wr_ml_z
if (iand(wr_ml_da_msk, wr_ml_da_sol_st_bt) .ne. 0)
& call ems_wr_sol_st
if (iand(ml_da_st_msk, ml_da_st_ld) .eq. 0) goto 7000
if (ml_nm_n_ch .eq. 8) then
p_c_nm = p_nm
else
p_c_nm = p_lng_nm
endif
if (wr_ml_da_msk .ge. wr_ml_da_nm_bt) then
call ems_wr_al_vr_st(
& ds(p_c_nm), is(p_st), ds(p_pr_act), ds(p_du_act),
& ds(p_lbc), ds(p_ubc), ds(p_scl))
endif
CM IF (emsol_xa .EQ. 1) THEN
C? if (iand(ml_da_st_msk, ml_da_st_alt_lp) .ne. 0) then
C?c if (iand(ml_da_st_msk, ml_da_st_bp_vr) .ne. 0 .and.
C?c & (wr_ml_st_msk .eq. wr_ml_st_al .or.
C?c & iand(wr_ml_st_msk, wr_ml_st_bp_bt) .ne. 0)) then
C? if (iand(ml_da_st_msk, ml_da_st_bp_vr) .ne. 0 .and.
C? & iand(wr_ml_st_msk, wr_ml_st_bp_bt) .ne. 0) then
C? call ems_wr_al_bp_vr_st(
C? & ds(p_c_nm), is(p_st), ds(p_pr_act), ds(p_du_act),
C? & ds(p_lbc), ds(p_cbp), ds(p_ubc), ds(p_scl))
C? endif
C? if (iand(ml_da_st_msk, ml_da_st_pwl_vr) .ne. 0 .and.
C? & (wr_ml_st_msk .eq. wr_ml_st_al .or.
C? & iand(wr_ml_st_msk, wr_ml_st_pwl_bt) .ne. 0)) then
C? call ems_wr_al_pwl_vr_st(
C? & ds(p_c_nm), is(p_st), ds(p_pr_act), ds(p_du_act),
C? & ds(p_scl),
C? & is(p_pwl_vr_ls),
C? & ds(p_pwl_vr_rf_pr_act_v),
C? & ds(p_pwl_vr_rf_ob_fn_v),
C? & ds(p_pwl_vr_da_v),
C? & is(p_pwl_vr_da_sa),
C? & is(p_pwl_vr_cu_sn),
C? & is(p_pwl_vr_ix))
C? endif
C? endif
CM ENDIF
7000 continue
return
end
C->>> -------------------------------------------------> ems_wr_ml_z <<<
subroutine ems_wr_ml_z
implicit none
include 'EMSV.INC'
include 'EMSPM.INC'
include 'CHCTVR.INC'
include 'EMSFI.INC'
include 'PRTS.INC'
include 'ICTVR.INC'
include 'EMSMSG.INC'
if (iand(ml_da_st_msk, ml_da_st_ld) .eq. 0) then
if (ems_msg_no_prt_fm .ge. 1) write(ems_li, 9000)
call ems_msg_wr_li(warn_msg_n)
else
if (ems_msg_no_prt_fm .ge. 1) write(ems_li, 9100)ch_ml_nm
call ems_msg_wr_li(8)
if (ems_msg_no_prt_fm .ge. 1) write(ems_li, 9110)
& n_r, n_c, n_a_el
call ems_msg_wr_li(16)
if (iand(ml_da_st_msk, ml_da_st_alt_lp) .ne. 0) then
if (iand(ml_da_st_msk, ml_da_st_bp_vr) .ne. 0) then
if (ems_msg_no_prt_fm .ge. 1) write(ems_li, 9120)n_bp_vr
call ems_msg_wr_li(info_msg_n)
endif
if (iand(ml_da_st_msk, ml_da_st_pwl_vr) .ne. 0) then
if (ems_msg_no_prt_fm .ge. 1) write(ems_li, 9130)
& n_pwl_vr, n_pwl_vr_da_en
call ems_msg_wr_li(info_msg_n)
endif
endif
endif
return
9000 format('No model has been loaded')
9100 format('Description of problem ', a8)
9110 format(' Matrix has ', i7, ' rows, ', i7,
& ' columns and ', i9, ' entries ')
9120 format(' Problem has ', i7, ' breakpoint variables')
9130 format(' Problem has ', i7,
& ' piecewise linear variables with ', i7, ' data entries')
end
C->>> -----------------------------------------------> ems_wr_sol_st <<<
subroutine ems_wr_sol_st
implicit none
include 'EMSV.INC'
include 'EMSPM.INC'
include 'ICTVR.INC'
include 'RLCTVR.INC'
include 'EMSMSG.INC'
character*24 ems_wr_prob_st_t_ch24
if (iand(ml_da_st_msk, ml_da_st_ld) .eq. 0) goto 7000
if (ems_msg_no_prt_fm .ge. 1) write(ems_li, 9200)
call ems_msg_wr_li(9)
if (ems_msg_no_prt_fm .ge. 1) write(ems_li, 9210)n_si_it,
& ob_fn_v, ems_wr_prob_st_t_ch24(prob_st)
call ems_msg_wr_li(1)
if (prob_st .ne. prob_st_unknown) then
if (n_pr_ifs .gt. 0) then
if (ems_msg_no_prt_fm .ge. 1) write(ems_li, 9300)
& n_pr_ifs, su_pr_ifs
call ems_msg_wr_li(3)
end if
if (n_du_ifs .gt. 0) then
if (ems_msg_no_prt_fm .ge. 1) write(ems_li, 9310)
& n_du_ifs, su_du_ifs
call ems_msg_wr_li(4)
end if
endif
7000 continue
return
9200 format('Problem Status ')
9210 format('Iteration number: ', i7,
& ' Objective value: ', g15.8, 2x, a)
9300 format('Number of primal infeasibilities: ', i7,
& ' Sum of primal infeasibilities: ', g11.4)
9310 format('Number of dual infeasibilities: ', i7,
& ' Sum of dual infeasibilities: ', g11.4)
end
C->>> ---------------------------------------> ems_wr_prob_st_t_ch24 <<<
c Determines a character string according to the value of prob_st
c
character*24 function ems_wr_prob_st_t_ch24(prob_st)
implicit none
include 'EMSV.INC'
include 'EMSPM.INC'
integer prob_st
if (prob_st .eq. prob_st_unknown) then
ems_wr_prob_st_t_ch24 = 'Unknown status'
else if (prob_st .eq. prob_st_op) then
ems_wr_prob_st_t_ch24 = 'Optimal'
else if (prob_st .eq. prob_st_ifs) then
ems_wr_prob_st_t_ch24 = 'infeasible'
else if (prob_st .eq. prob_st_unbd) then
ems_wr_prob_st_t_ch24 = 'Unbounded problem'
else if (prob_st .eq. prob_st_mx_n_it) then
ems_wr_prob_st_t_ch24 = 'Iteration limit exceeded'
else if (prob_st .eq. prob_st_no_sol) then
ems_wr_prob_st_t_ch24 = 'No solution'
else if (prob_st .eq. prob_st_mx_n_sol) then
ems_wr_prob_st_t_ch24 = 'Subroblem limit exceeded'
else if (prob_st .eq. prob_st_no_po) then
ems_wr_prob_st_t_ch24 = 'Out of space'
else
ems_wr_prob_st_t_ch24 = 'Unknown problem status'
end if
return
end
C->>> ---------------------------------------------> ems_wr_al_vr_st <<<
c Writes primal/dual activity and lower/upper bound data for each
c row and column---except for any BP or PWL variables.
c
subroutine ems_wr_al_vr_st(rl_nm, st, pr_act, du_act, lb, ub, scl)
implicit none
include 'EMSV.INC'
include 'EMSPM.INC'
include 'EMSFI.INC'
include 'PRTS.INC'
include 'ICTVR.INC'
include 'EMSMSG.INC'
integer st(0:mx_n_c+n_r)
double precision rl_nm(ml_nm_n_rl, 0:mx_n_c+n_r)
double precision pr_act(0:mx_n_c+n_r), du_act(0:mx_n_c+n_r)
double precision lb(0:mx_n_c+n_r), ub(0:mx_n_c+n_r)
double precision scl(0:mx_n_c+n_r)
double precision pr_act_v, du_act_v, lb_v, ub_v
integer ix_n, vr_ix, vr_n, ems_vr_ty
integer du_act_sgn, wr_du_act_sgn
logical nw_pg
logical ml_pr_act
logical ml_du_act
logical scl_ml_sol
if (iand(ml_da_st_msk, ml_da_st_ld) .eq. 0) goto 7000
c
c Start by writing out rows:
c Start a new page
c The dual activities may have had their sign changed and are
c written out with a sign change.
c
nw_pg = .true.
ml_pr_act = iand(ml_da_st_msk, ml_da_st_bc_pr_act) .ne. 0
ml_du_act = iand(ml_da_st_msk, ml_da_st_non_bc_du_act) .ne. 0
scl_ml_sol = iand(ml_da_st_msk, ml_da_st_scl_ml_sol) .ne. 0
ems_vr_ty = ems_vr_ty_r
du_act_sgn = r_du_act_sgn
wr_du_act_sgn = -1
c
c If the model does not have primal and/or dual activities then the
c undefined value is passed and a blank is printed.
c
pr_act_v = undn
du_act_v = undn
do 10, ix_n = 1, n_r + n_c
if (ix_n .eq. n_r+1) then
c
c Switch to writing out columns:
c Start a new page
c The dual activities have not had their sign changed and are not
c written out with a sign change.
c
nw_pg = .true.
ems_vr_ty = ems_vr_ty_c
du_act_sgn = 1
wr_du_act_sgn = 1
endif
if (ix_n .le. n_r) then
vr_ix = ix_n
vr_n = ix_n + mx_n_c
else
vr_ix = ix_n - n_r
vr_n = vr_ix
endif
c
c Extract the primal and dual activities, correcting any sign change
c for the dual activity, and then scaling them both (if necessary).
c
if (ml_pr_act) then
pr_act_v = pr_act(vr_n)
if (scl_ml_sol) pr_act_v = pr_act_v/scl(vr_n)
endif
if (ml_du_act) then
du_act_v = du_act_sgn*du_act(vr_n)
if (scl_ml_sol) du_act_v = du_act_v*scl(vr_n)
c
c Possibly change the sign of the dual activity to be written.
c
du_act_v = wr_du_act_sgn*du_act_v
endif
if (wr_ml_st_msk .eq. wr_ml_st_al .or.
& iand(wr_ml_st_msk, wr_ml_st_r_bt) .ne. 0 .or.
& (iand(wr_ml_st_msk, wr_ml_st_nz_bt) .ne. 0 .and.
& du_act_v .ne. zero) .or.
& (iand(wr_ml_st_msk, wr_ml_st_ifs_bt) .ne. 0 .and.
& iand(st(vr_n), ifs_bt) .ne. 0)) then
if (nw_pg)
& call ems_wr_prts_hdr(prts_hdr_ty_std_vr, ems_vr_ty)
lb_v = lb(vr_n)
ub_v = ub(vr_n)
if (iand(st(vr_n), su_non_std_vr_bt) .eq. bp_vr_msk) then
lb_v = -inf
ub_v = inf
endif
call ems_wr_1_vr_st(vr_ix,
& rl_nm(1, vr_n), st(vr_n), pr_act_v, du_act_v,
& lb_v, ub_v, ems_vr_ty)
nw_pg = ems_msg_pg_li_n .eq. n_pg_li-1
endif
10 continue
7000 continue
return
end
C->>> ---------------------------------------------> ems_wr_prts_hdr <<<
c Writes the header for printing solution, costs, range data etc.
c
subroutine ems_wr_prts_hdr(prts_hdr_ty, ems_vr_ty)
implicit none
include 'EMSV.INC'
include 'EMSMMGR.INC'
include 'EMSPM.INC'
include 'EMSMEM.INC'
include 'EMSFI.INC'
include 'PRTS.INC'
include 'ICTVR.INC'
include 'EMSMSG.INC'
integer prts_hdr_ty, ems_vr_ty
character*50 ch50
integer t_ch_n
logical nm
integer r_sn_n_ch, c_sn_n_ch
integer bp_vr_txt_n_ch, pwl_vr_txt_n_ch
integer co_rg_txt_n_ch, r_bd_rg_txt_n_ch, c_bd_rg_txt_n_ch
save r_sn_n_ch, c_sn_n_ch
save bp_vr_txt_n_ch, pwl_vr_txt_n_ch
save co_rg_txt_n_ch, r_bd_rg_txt_n_ch, c_bd_rg_txt_n_ch
data r_sn_n_ch/16/c_sn_n_ch/19/
data bp_vr_txt_n_ch/22/pwl_vr_txt_n_ch/28/
data co_rg_txt_n_ch/33/r_bd_rg_txt_n_ch/25/c_bd_rg_txt_n_ch/28/
ems_msg_pg_n = ems_msg_pg_n + 1
ems_msg_pg_li_n = 0
c
c Construct the first line
c
t_ch_n = 0
if (
& prts_hdr_ty .eq. prts_hdr_ty_std_vr .or.
& prts_hdr_ty .eq. prts_hdr_ty_bp_vr .or.
& prts_hdr_ty .eq. prts_hdr_ty_pwl_vr .or.
& prts_hdr_ty .eq. prts_hdr_ty_std_co_da .or.
& prts_hdr_ty .eq. prts_hdr_ty_bp_da
& ) then
if (ems_vr_ty .eq. ems_vr_ty_r) then
ch50(t_ch_n+1:r_sn_n_ch) = ' Rows Section'
t_ch_n = t_ch_n + r_sn_n_ch
else
ch50(t_ch_n+1:c_sn_n_ch) = ' Columns Section'
t_ch_n = t_ch_n + c_sn_n_ch
endif
if (
& prts_hdr_ty .eq. prts_hdr_ty_std_vr .or.
& prts_hdr_ty .eq. prts_hdr_ty_std_co_da
& ) then
else if (
& prts_hdr_ty .eq. prts_hdr_ty_bp_vr .or.
& prts_hdr_ty .eq. prts_hdr_ty_bp_da
& ) then
ch50(t_ch_n+1:t_ch_n+bp_vr_txt_n_ch) =
& ': Breakpoint Variables'
t_ch_n = t_ch_n + bp_vr_txt_n_ch
else if (
& prts_hdr_ty .eq. prts_hdr_ty_pwl_vr
& ) then
ch50(t_ch_n+1:t_ch_n+pwl_vr_txt_n_ch) =
& ': Piecewise Linear Variables'
t_ch_n = t_ch_n + pwl_vr_txt_n_ch
endif
else if (prts_hdr_ty .eq. prts_hdr_ty_co_rg_da) then
ch50(t_ch_n+1:t_ch_n+co_rg_txt_n_ch) =
& 'Sensitivity to Objective Function'
t_ch_n = t_ch_n + co_rg_txt_n_ch
else if (prts_hdr_ty .eq. prts_hdr_ty_bd_rg_da) then
if (ems_vr_ty .eq. ems_vr_ty_r) then
ch50(t_ch_n+1:t_ch_n+r_bd_rg_txt_n_ch) =
& 'Sensitivity to Row Bounds'
t_ch_n = t_ch_n + r_bd_rg_txt_n_ch
else
ch50(t_ch_n+1:t_ch_n+c_bd_rg_txt_n_ch) =
& 'Sensitivity to Column Bounds'
t_ch_n = t_ch_n + c_bd_rg_txt_n_ch
endif
endif
ch50(t_ch_n+1:50) =
& ' '
if (ems_msg_no_prt_fm .ge. 1) write(ems_li, 9000)
& ch50, ems_msg_pg_n
call ems_msg_wr_li(info_msg_n)
c
c Now construct the second line
c
nm = iand(wr_ml_da_msk, wr_ml_da_nm_bt) .ne. 0
t_ch_n = 0
if (
& prts_hdr_ty .eq. prts_hdr_ty_std_vr .or.
& prts_hdr_ty .eq. prts_hdr_ty_bp_vr .or.
& prts_hdr_ty .eq. prts_hdr_ty_pwl_vr) then
if (iand(wr_ml_da_msk, wr_ml_da_fu_li) .eq.
& wr_ml_da_fu_li) then
if (prts_hdr_ty .eq. prts_hdr_ty_std_vr) then
vr_li(t_ch_n+1:t_ch_n+fu_vr_li_ln+ml_nm_n_ch-8) =
& mu_ch_prts_c_hd_nm(1:2+ml_nm_n_ch)
& //ch6_prts_c_hd_st
& //ch22_prts_c_hd_pr_act
& //ch22_prts_c_hd_du_act
& //ch22_prts_c_hd_lb
& //ch22_prts_c_hd_ub
t_ch_n = t_ch_n + fu_vr_li_ln+ml_nm_n_ch-8
else if (prts_hdr_ty .eq. prts_hdr_ty_bp_vr) then
vr_li(t_ch_n+1:t_ch_n+fu_vr_li_ln+ml_nm_n_ch-8) =
& mu_ch_prts_c_hd_nm(1:2+ml_nm_n_ch)
& //ch6_prts_c_hd_st
& //ch22_prts_c_hd_pr_act
& //ch22_prts_c_hd_lo_du_act
& //ch22_prts_c_hd_bp
& //ch22_prts_c_hd_up_du_act
t_ch_n = t_ch_n + fu_vr_li_ln+ml_nm_n_ch-8
else
vr_li(t_ch_n+1:t_ch_n+fu_vr_li_ln+ml_nm_n_ch-8-6) =
& mu_ch_prts_c_hd_nm(1:2+ml_nm_n_ch)
& //ch6_prts_c_hd_st
& //ch22_prts_c_hd_pr_act
& //ch22_prts_c_hd_lo_du_act
& //ch22_prts_c_hd_up_du_act
& //ch22_prts_c_hd_lo_bp
& //ch22_prts_c_hd_up_bp
c & //ch6_prts_c_hd_sn
t_ch_n = t_ch_n + fu_vr_li_ln+ml_nm_n_ch-8 - 6
endif
go to 100
end if
if (iand(wr_ml_da_msk, wr_ml_da_nm_bt) .ne. 0) then
vr_li(t_ch_n+1:t_ch_n+2+ml_nm_n_ch) =
& mu_ch_prts_c_hd_nm(1:2+ml_nm_n_ch)
t_ch_n = t_ch_n + 2+ml_nm_n_ch
end if
if (iand(wr_ml_da_msk, wr_ml_da_st_bt) .ne. 0) then
vr_li(t_ch_n+1:t_ch_n+6) = ch6_prts_c_hd_st
t_ch_n = t_ch_n + 6
end if
if (iand(wr_ml_da_msk, wr_ml_da_pr_act_bt) .ne. 0) then
vr_li(t_ch_n+1:t_ch_n+prts_rl_fld_ln) =
& ch22_prts_c_hd_pr_act
t_ch_n = t_ch_n + prts_rl_fld_ln
end if
if (prts_hdr_ty .eq. prts_hdr_ty_std_vr) then
if (iand(wr_ml_da_msk, wr_ml_da_du_act_bt) .ne. 0) then
vr_li(t_ch_n+1:t_ch_n+prts_rl_fld_ln) =
& ch22_prts_c_hd_du_act
t_ch_n = t_ch_n + prts_rl_fld_ln
end if
if (iand(wr_ml_da_msk, wr_ml_da_lb_bt) .ne. 0) then
vr_li(t_ch_n+1:t_ch_n+prts_rl_fld_ln) =
& ch22_prts_c_hd_lb
t_ch_n = t_ch_n + prts_rl_fld_ln
end if
if (iand(wr_ml_da_msk, wr_ml_da_ub_bt) .ne. 0) then
vr_li(t_ch_n+1:t_ch_n+prts_rl_fld_ln) =
& ch22_prts_c_hd_ub
t_ch_n = t_ch_n + prts_rl_fld_ln
end if
else if (prts_hdr_ty .eq. prts_hdr_ty_bp_vr) then
vr_li(t_ch_n+1:t_ch_n+3*prts_rl_fld_ln) =
& ch22_prts_c_hd_lo_du_act
& //ch22_prts_c_hd_bp
& //ch22_prts_c_hd_up_du_act
t_ch_n = t_ch_n + 3*prts_rl_fld_ln
else
vr_li(t_ch_n+1:t_ch_n+4*prts_rl_fld_ln) =
& ch22_prts_c_hd_lo_du_act
& //ch22_prts_c_hd_up_du_act
& //ch22_prts_c_hd_lo_bp
& //ch22_prts_c_hd_up_bp
t_ch_n = t_ch_n + 4*prts_rl_fld_ln
c vr_li(t_ch_n+1:t_ch_n+5) = ch6_prts_c_hd_sn
c t_ch_n = t_ch_n + 6
endif
else if (prts_hdr_ty .eq. prts_hdr_ty_std_co_da) then
if (nm) then
vr_li(t_ch_n+1:t_ch_n+2+ml_nm_n_ch) =
& mu_ch_prts_c_hd_nm(1:2+ml_nm_n_ch)
t_ch_n = t_ch_n + 2+ml_nm_n_ch
endif
vr_li(t_ch_n+1:t_ch_n+prts_rl_fld_ln) = ch22_prts_c_hd_co
t_ch_n = t_ch_n + prts_rl_fld_ln
else if (prts_hdr_ty .eq. prts_hdr_ty_bp_da) then
if (nm) then
vr_li(t_ch_n+1:t_ch_n+2+ml_nm_n_ch) =
& mu_ch_prts_c_hd_nm(1:2+ml_nm_n_ch)
t_ch_n = t_ch_n + 2+ml_nm_n_ch
endif
vr_li(t_ch_n+1:t_ch_n+3*prts_rl_fld_ln) =
& ch22_prts_c_hd_lo_co
& //ch22_prts_c_hd_bp
& //ch22_prts_c_hd_up_co
t_ch_n = t_ch_n + 3*prts_rl_fld_ln
else if (prts_hdr_ty .eq. prts_hdr_ty_co_rg_da) then
vr_li(t_ch_n+1:
& t_ch_n+2+ml_nm_n_ch+6+4*prts_rl_fld_ln+2*(2+ml_nm_n_ch)) =
& mu_ch_prts_c_hd_nm(1:2+ml_nm_n_ch)
& //ch6_prts_c_hd_st
& //ch22_prts_c_hd_og_ob
& //ch22_prts_c_hd_rg
& //ch22_prts_c_hd_ob_rg
& //ch22_prts_c_hd_pr_act
& //mu_ch_prts_c_hd_en_nm(1:2+ml_nm_n_ch)
& //mu_ch_prts_c_hd_lv_nm(1:2+ml_nm_n_ch)
t_ch_n =
& t_ch_n + 2+ml_nm_n_ch+6+4*prts_rl_fld_ln+2*(2+ml_nm_n_ch)
else if (prts_hdr_ty .eq. prts_hdr_ty_bd_rg_da) then
vr_li(t_ch_n+1:
& t_ch_n+2+ml_nm_n_ch+6+3*prts_rl_fld_ln+2*(2+ml_nm_n_ch)) =
& mu_ch_prts_c_hd_nm(1:2+ml_nm_n_ch)
& //ch6_prts_c_hd_st
& //ch22_prts_c_hd_v
& //ch22_prts_c_hd_rg
& //ch22_prts_c_hd_ob_rg
& //mu_ch_prts_c_hd_en_nm(1:2+ml_nm_n_ch)
& //mu_ch_prts_c_hd_lv_nm(1:2+ml_nm_n_ch)
t_ch_n = t_ch_n +
& 2+ml_nm_n_ch+6+3*prts_rl_fld_ln+2*(2+ml_nm_n_ch)
endif
100 continue
if (ems_msg_no_prt_fm .ge. 1) write(ems_li, 9010)vr_li(1:t_ch_n)
call ems_msg_wr_li(info_msg_n)
return
9000 format(a50, 1x, 'Page ', i4)
9010 format(1x, 7x, a)
end
C->>> ----------------------------------------------> ems_wr_1_vr_st <<<
c Writes the status for a particular variable.
c
subroutine ems_wr_1_vr_st(ix, rl_nm,
& vr_st, pr_act, du_act, lb, ub, ems_vr_ty)
implicit none
include 'EMSV.INC'
include 'EMSPM.INC'
include 'EMSFI.INC'
include 'PRTS.INC'
include 'ICTVR.INC'
include 'EMSMSG.INC'
integer ix, vr_st, ems_vr_ty
double precision rl_nm(ml_nm_n_rl), pr_act, du_act, lb, ub
character*20 ems_wr_rl_t_ch20
character*4 ems_wr_st_t_ch4
character*(ml_nm_mx_n_ch) mu_ch_vr_nm
integer vr_li_ln
if (iand(wr_ml_da_msk, wr_ml_da_fu_li) .eq. wr_ml_da_fu_li) then
call ems_rl_t_ch(ml_nm_n_ch, rl_nm, mu_ch_vr_nm)
vr_li(1:fu_vr_li_ln+ml_nm_n_ch-8) =
& ' '//mu_ch_vr_nm(1:ml_nm_n_ch)
& //' '//ems_wr_st_t_ch4(vr_st)
& //' '//ems_wr_rl_t_ch20(pr_act)
& //' '//ems_wr_rl_t_ch20(du_act)
& //' '//ems_wr_rl_t_ch20(lb)
& //' '//ems_wr_rl_t_ch20(ub)
vr_li_ln = fu_vr_li_ln + ml_nm_n_ch-8
go to 100
end if
vr_li_ln = 0
if (iand(wr_ml_da_msk, wr_ml_da_nm_bt) .ne. 0) then
call ems_rl_t_ch(ml_nm_n_ch, rl_nm, mu_ch_vr_nm)
vr_li(vr_li_ln+1:vr_li_ln+2+ml_nm_n_ch) =
& ' '//mu_ch_vr_nm(1:ml_nm_n_ch)
vr_li_ln = vr_li_ln + 2+ml_nm_n_ch
end if
if (iand(wr_ml_da_msk, wr_ml_da_st_bt) .ne. 0) then
vr_li(vr_li_ln+1:vr_li_ln+5) = ' '//ems_wr_st_t_ch4(vr_st)
vr_li_ln = vr_li_ln + 6
end if
if (iand(wr_ml_da_msk, wr_ml_da_pr_act_bt) .ne. 0) then
vr_li(vr_li_ln+1:vr_li_ln+prts_rl_fld_ln) =
& ' '//ems_wr_rl_t_ch20(pr_act)
vr_li_ln = vr_li_ln + prts_rl_fld_ln
end if
if (iand(wr_ml_da_msk, wr_ml_da_du_act_bt) .ne. 0) then
vr_li(vr_li_ln+1:vr_li_ln+prts_rl_fld_ln) =
& ' '//ems_wr_rl_t_ch20(du_act)
vr_li_ln = vr_li_ln + prts_rl_fld_ln
end if
if (iand(wr_ml_da_msk, wr_ml_da_lb_bt) .ne. 0) then
vr_li(vr_li_ln+1:vr_li_ln+prts_rl_fld_ln) =
& ' '//ems_wr_rl_t_ch20(lb)
vr_li_ln = vr_li_ln + prts_rl_fld_ln
end if
if (iand(wr_ml_da_msk, wr_ml_da_ub_bt) .ne. 0) then
vr_li(vr_li_ln+1:vr_li_ln+prts_rl_fld_ln) =
& ' '//ems_wr_rl_t_ch20(ub)
vr_li_ln = vr_li_ln + prts_rl_fld_ln
end if
100 continue
if (ems_vr_ty .eq. ems_vr_ty_r) then
if (ems_msg_no_prt_fm .ge. 1) write(ems_li, 9000)
& ix, vr_li(1:vr_li_ln)
call ems_msg_wr_li(62)
else if (ems_vr_ty .eq. ems_vr_ty_c) then
if (ems_msg_no_prt_fm .ge. 1) write(ems_li, 9000)
& ix, vr_li(1:vr_li_ln)
call ems_msg_wr_li(64)
end if
return
9000 format(1x, i7, a)
end
C->>> ---------------------------------------------> ems_wr_st_t_ch4 <<<
c Determines a character*4 string for a given status bit mask.
c
character*4 function ems_wr_st_t_ch4(vr_st)
implicit none
include 'EMSV.INC'
include 'EMSPM.INC'
include 'EMSFI.INC'
include 'PRTS.INC'
integer vr_st
character*4 ch4
if (iand(vr_st, ifs_bt) .ne. 0) then
ch4 = ch4_prts_st_ifs
else if (iand(vr_st, bc_bt) .ne. 0) then
ch4 = ch4_prts_st_bc
else if (iand(vr_st, alt_bt) .ne. 0) then
if (iand(vr_st, bp_bt) .ne. 0) then
ch4 = ch4_prts_st_bp
else
c
c ?? Can't distinguish at LB/UB from at BP for PWL
c
ch4 = ch4_prts_st_pwl
endif
else if (iand(vr_st, up_dn) .eq. up_dn) then
ch4 = ch4_prts_st_fr
else if (iand(vr_st, up_bt) .ne. 0) then
ch4 = ch4_prts_st_at_lb
else if (iand(vr_st, dn_bt) .ne. 0) then
ch4 = ch4_prts_st_at_ub
else
ch4 = ch4_prts_st_fx
end if
ems_wr_st_t_ch4 = ch4
return
end
C->>> ---------------------------------------------> ems_ca_wr_lp_co <<<
c Calls the routine which writes out the LP costs.
c
subroutine ems_ca_wr_lp_co(ds, is)
implicit none
include 'EMSV.INC'
include 'EMSPM.INC'