-
Notifications
You must be signed in to change notification settings - Fork 2
/
mods.for
1410 lines (1196 loc) · 40.4 KB
/
mods.for
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 %P%
* file $RCSfile: mods.for,v $ v_$Revision: 87172 $
SUBROUTINE ADJST (B, GOOGE, SHIFTS, G, NX, A, LAWORK, LNWORK,
& IUO, IUO2)
********************************************************************************
* ADJUSTMENT ROUTINE
********************************************************************************
IMPLICIT DOUBLE PRECISION (A-H, O-Z)
IMPLICIT INTEGER (I-N)
CHARACTER*26 TBUF
CHARACTER*99 SCCSID
LOGICAL LSS, LUP, LMSL, LABS, LADJ, LUPI
** v 4.30vf
LOGICAL CONVRG, VFCVRG,VFCGPS
LOGICAL LBB, LGF, LCS, LVD, LVA, LVZ, LVS, LVR, LVG,
& LVC, LIS, LPS, LPG, LDR, LOS, LAP, LDF, LVX, LGV
DIMENSION B(*), GOOGE(*), SHIFTS(*), G(*), NX(*), A(*)
COMMON /OPRINT/ CRIT, LBB, LGF, LCS, LVD, LVA, LVZ, LVS, LVR, LVG,
& LVC, LIS, LPS, LPG, LDR, LOS, LAP, LDF, LVX, LGV
COMMON /STRUCT/ NSTA, NAUX, NUNK, IDIM, NSTAS, NOBS, NCON, NZ,NGRT
COMMON /OPT/ AX, E2, DMSL, DGH, VM, VP, CTOL, ITMAX, IMODE,
& LMSL, LSS, LUP, LABS, LADJ, LUPI
COMMON /NUMVFS/ NVFTOT, NVFREE
COMMON/UNITS/ LUNIT
LOGICAL NLMODE,NLSCL
COMMON /NLOPT/ NLMODE,NLSCL,NLUN1,NLUN2,NLUN3,NLUN4,NLUN5
***10-24-03
common /opt2/ itmax2
******
** 2/7/2003 ** override input covariance matrix by scaling horizontal and vertical components
** v 4.32vf
LOGICAL IVCGPS,VSlogic
COMMON/VCREC/SIGH,SIGU, VFHOR,VFUP, IVCGPS
CHARACTER*13 VSPROJ
PARAMETER (MAXPRJ=2500)
COMMON/VSREC/SIGHS(MAXPRJ),SIGUS(MAXPRJ),ISETHU,VSPROJ(MAXPRJ),
& VSlogic
**v6.3
parameter (MXSSN = 9999)
LOGICAL overwrite_const_coord_in_newbb
character CC_records*80
COMMON/MM6/overwrite_const_coord_in_newbb
COMMON/MM6_array/CC_records(MXSSN)
**So far for v6.3
C
EXTERNAL SECOND
DATA ITYPE / 1 /
C SCCSID='$Id: mods.for 87172 2016-01-21 15:33:05Z jarir.saleh $ 20$Date: 2007/11/30 13:11:56 $ NGS'
*
*** GET STATION CONNECTION MATRIX FOR USE IN COMPUTING LOCAL ACCURACIES
*
IF(NLMODE) CALL NLLIST(B, G, NX, LNWORK)
*** GET MINUTES ELAPSED SINCE START OF PROGRAM
CALL SYSTIM (ITYPE, TBUF, DIFM, DIFM0)
CALL LINE (2)
WRITE (LUNIT,55) DIFM0
55 FORMAT (/, ' MINUTES SINCE START OF PROGRAM IS', F7.1)
*** READ DATA AND FORM OBS EQS AND CONNECTION MATRIX
*** REORDER FOR MINIMUM PROFILE
c Mike Potterfield 2/10/06
c Open a new scratch file IUO3 for reject codes for each vector
c This scratch file is written in SECGPS and NEWGRP and
c read in OBSSUM and RGPS. These are the only uses for it.
IUO3 = 10
OPEN (IUO3, FORM='UNFORMATTED', STATUS='SCRATCH')
REWIND IUO3
ENDFILE IUO3
REWIND IUO3
CALL SECOND (IUO, B, G, NX, LNWORK, IUO3)
*** INITIALIZE SHIFTS
IF (IMODE .NE. 0) THEN
IF (LPS) THEN
DO 30 I = 1, NSTA
I1 = IUNSHF(I, 1)
I2 = IUNSHF(I, 2)
I3 = IUNSHF(I, 3)
SHIFTS(I1) = 0.D0
SHIFTS(I2) = 0.D0
SHIFTS(I3) = 0.D0
30 CONTINUE
ENDIF
*** LIST THE OBSERVATIONAL SUMMARY
c Mike Potterfield 2/10/06
c Add the new scratch file IUO3 to OBSSUM
REWIND IUO3
CALL OBSSUM (IUO, G,IUO3)
REWIND IUO3
CALL SYSTIM (ITYPE, TBUF, DIFM, DIFM0)
CALL LINE (2)
WRITE (LUNIT,65) DIFM0
65 FORMAT (/, ' TOTAL MINUTES TO COMMENCMENT OF ADJUSTMENT', F7.1)
*** FORM NORMALS AND SOLVE
CALL HEAD
CALL LINE (2)
WRITE (LUNIT,2)
2 FORMAT ('0', 11('*'), ' COMMENCING ADJUSTMENT ', 11('*') )
ENDIF
ITER = 0
100 CALL NORMAL (IUO, ITER, B, A, G, NX, LAWORK, GOOGE)
*** UPDATE UNKNOWNS AND TEST CONVERGENCE
IF (IMODE .EQ. 0) THEN
** v 4.30vf
C CALL FINAL (IUO, A, NX, B, SHIFTS, GOOGE, G, SIGUWT, IUO3)
ELSEIF ( CONVRG(A, NX, B, SHIFTS, SIGUWT, ITER) ) THEN
CALL SYSTIM (ITYPE, TBUF, DIFM, DIFM0)
CALL LINE (2)
WRITE (LUNIT,75) ITER, DIFM
75 FORMAT (/, ' MINUTES NEEDED FOR ITERATION', I3, ' =', F7.1)
CALL LINE (2)
WRITE (LUNIT,3)
3 FORMAT ('0*********** ADJUSTMENT CONVERGED *************')
** v 4.30vf
********modified 4/8/2003
* IF (NVFREE .LE. 0) THEN
* CALL FINAL (IUO, A, NX, B, SHIFTS, GOOGE, G, SIGUWT)
* ELSE
IF (LUPI) THEN
CALL UPAFIL (B, ITER)
CALL UPDAT (B)
ENDIF
* ENDIF
***********************************
ELSE
CALL SYSTIM (ITYPE, TBUF, DIFM, DIFM0)
CALL LINE (2)
WRITE (LUNIT,75) ITER, DIFM
IF (ITER .GE. ITMAX) THEN
CALL LINE (2)
WRITE (LUNIT,1)
1 FORMAT ('0SLOWLY CONVERGING SOLUTION')
IF (LDR) THEN
CALL FINAL (IUO, A, NX, B, SHIFTS, GOOGE, G, SIGUWT,
& IUO3)
CALL ABORT2
ELSE
CALL ABORT2
ENDIF
ELSE
IF (LUPI) THEN
CALL UPAFIL (B, ITER)
CALL UPDAT (B)
ENDIF
CALL FORMOB (IUO, IUO2, B, G)
ITER = ITER + 1
GO TO 100
ENDIF
ENDIF
*** VARIANCE FACTOR ITERATION
*** VFCVRG REFORMS OBS. EQS., COMPUTES INVERSE, AND TESTS V.F. CONVERGE
IF (NVFREE .GT. 0) THEN
200 IF (VFCVRG(IUO, IUO2, B, G, A, NX, GOOGE) ) THEN
CALL SYSTIM (ITYPE, TBUF, DIFM, DIFM0)
CALL LINE (2)
WRITE (LUNIT,75) ITER, DIFM
CALL LINE (2)
WRITE (LUNIT,5)
5 FORMAT ('0***** VARIANCE FACTOR ADJUSTMENT CONVERGED *******')
** v 4.30vf
C CALL FINAL (IUO, A, NX, B, SHIFTS, GOOGE, G, SIGUWT)
******************
ELSEIF (ITER .GE. ITMAX) THEN
CALL SYSTIM (ITYPE, TBUF, DIFM, DIFM0)
CALL LINE (2)
WRITE (LUNIT,75) ITER, DIFM
CALL LINE (2)
WRITE (LUNIT,4)
4 FORMAT ('0SLOWLY CONVERGING VARIANCE FACTOR SOLUTION ',
& 50('*') )
IF (LDR) THEN
CALL FINAL (IUO, A, NX, B, SHIFTS, GOOGE, G, SIGUWT,
& IUO3)
CALL ABORT2
ELSE
CALL ABORT2
ENDIF
ELSE
CALL SYSTIM (ITYPE, TBUF, DIFM, DIFM0)
CALL LINE (2)
WRITE (LUNIT,75) ITER, DIFM
IF (LUPI) THEN
CALL UPAFIL (B, ITER)
CALL UPDAT (B)
ENDIF
CALL NORMAL (IUO, ITER, B, A, G, NX, LAWORK, GOOGE)
ITER = ITER + 1
IF ( CONVRG(A, NX, B, SHIFTS, SIGUWT, ITER) ) THEN
CONTINUE
ENDIF
GO TO 200
ENDIF
ENDIF
** v 4.30vf
****ADDED 4/07/2003
*
IF (IVCGPS ) THEN
300 IF (VFCGPS(IUO, IUO2, B, G, A, NX, GOOGE) ) THEN
CALL LINE (2)
WRITE (LUNIT,305)
305 FORMAT ('0***** GPS HORIZONTAL/VERTICAL VARIANCE FACTOR',
& ' ADJUSTMENT CONVERGED *******')
C CALL FINAL (IUO, A, NX, B, SHIFTS, GOOGE, G, SIGUWT)
*** 10-24-03
* ELSEIF (ITER .GE. ITMAX) THEN
ELSEIF (ITER .GE. itmax2) THEN
**********
CALL SYSTIM (ITYPE, TBUF, DIFM, DIFM0)
CALL LINE (2)
WRITE (LUNIT,75) ITER, DIFM
CALL LINE (2)
WRITE (LUNIT,304)
304 FORMAT ('0SOLUTION FOR GPS HORIZONTAL/VERTICAL VARIANCE FACTORS ',
& 'HAS NOT CONVERGED AFTER MAXIMUM ITERATIONS. ABORTING*******')
IF (LDR) THEN
CALL FINAL (IUO, A, NX, B, SHIFTS, GOOGE, G, SIGUWT, IUO3)
CALL ABORT2
ELSE
CALL ABORT2
ENDIF
ELSE
IF (LUPI) THEN
C
CALL UPAFIL (B, ITER)
CALL UPDAT (B)
ENDIF
C
C UPDATE GPS COVARIANCE MATRICES
ITER = ITER + 1
CALL UPCOV(IUO, IUO2, B, G, A)
CALL NORMAL (IUO, ITER, B, A, G, NX, LAWORK, GOOGE)
IF ( CONVRG(A, NX, B, SHIFTS, SIGUWT, ITER) ) THEN
CONTINUE
ENDIF
CALL SYSTIM (ITYPE, TBUF, DIFM, DIFM0)
CALL LINE (2)
WRITE (LUNIT,75) ITER, DIFM
GO TO 300
ENDIF
ENDIF
C
CALL FINAL (IUO, A, NX, B, SHIFTS, GOOGE, G, SIGUWT, IUO3)
**v 4.30vf - end insert 4/07/03********
c Mike Potterfield 2/13/06
c Now nuke IUO3, it's no longer being used
CLOSE (IUO3)
RETURN
END
C---------------------------------------------------------------------------------------------------
SUBROUTINE AFIL (A)
********************************************************************************
* ROUTINE TO PROCESS THE A FILE
********************************************************************************
IMPLICIT DOUBLE PRECISION (A-H, O-Z)
IMPLICIT INTEGER (I-N)
CHARACTER*80 ACARD
CHARACTER*80 BBOOK, AFILE, GFILE, DFILE, BBNAM
CHARACTER*7 ADJFIL, NAFILE
CHARACTER*2 CC12
LOGICAL FATAL
DIMENSION A(*)
COMMON /NAME/ BBOOK, AFILE, GFILE, DFILE, BBNAM, ADJFIL, NAFILE
COMMON/UNITS/ LUNIT
*** INITIALIZE DEFAULTS
CALL AFINIT
FATAL = .FALSE.
*** HEADING
CALL LINE (3)
WRITE (LUNIT,1)
1 FORMAT ('0', 32('*'), ' A-FILE CONTENTS ', 32('*')/)
*** OPEN ADJUSTMENT FILE (IUNIT=11)
***v 4.28k
**** IF (AFILE .EQ. 'NOAFILE') GOTO 200
IUNIT = 11
OPEN (IUNIT,ERR=200,STATUS='OLD',FILE=AFILE,IOSTAT=IOS)
*** READ A FILE -- PROCESS RECORDS WITHOUT SSN FIELDS
10 READ (IUNIT,11,END=100) ACARD
11 FORMAT (A80)
READ (ACARD,14) CC12
14 FORMAT (A2)
CALL LINE (1)
WRITE (LUNIT,12) ACARD
12 FORMAT (5X, A80)
IF (CC12 .EQ. 'AA') THEN
CALL AFAA (ACARD)
ELSEIF (CC12 .EQ. 'BB') THEN
CALL AFBB (ACARD)
ELSEIF (CC12 .EQ. 'DD') THEN
CALL AFDD (ACARD)
ELSEIF (CC12 .EQ. 'EE') THEN
CALL AFEE (ACARD)
ELSEIF (CC12 .EQ. 'GG') THEN
CALL AFGG (ACARD)
ELSEIF (CC12 .EQ. 'HD') THEN
CALL AFHD (ACARD)
ELSEIF (CC12 .EQ. 'II') THEN
CALL AFII (ACARD)
ELSEIF (CC12 .EQ. 'MM') THEN
CALL AFMM (ACARD)
*************************************
** v 4.16
* ELSEIF (CC12 .EQ. 'NL') THEN
* CONTINUE
** v 4.26
ELSEIF (CC12 .EQ. 'NL') THEN
CALL AFNL (ACARD)
*************************************
ELSEIF (CC12 .EQ. 'PP') THEN
CALL AFPP (ACARD)
ELSEIF (CC12 .EQ. 'RR') THEN
CALL AFRR (ACARD, FATAL)
ELSEIF (CC12 .EQ. 'SS') THEN
CALL AFSS (ACARD, A, FATAL)
ELSEIF (CC12 .EQ. 'VV') THEN
CALL AFVV (ACARD)
** v 4.30vf
*** added feb 10, 2003
ELSEIF(CC12 .EQ.'VS') THEN
CALL AFVS (ACARD)
*** end insert 2/10/2003
ELSEIF (CC12 .NE. 'CC' .AND. CC12 .NE. 'HC' .AND.
& CC12 .NE. 'QQ' .AND. CC12 .NE. 'CA' .AND.
& CC12 .NE. 'CD' .AND. CC12 .NE. 'CZ' .AND.
& CC12 .NE. 'CH' .AND. CC12 .NE. ' ' .AND.
& CC12 .NE. '**' .AND. CC12 .NE. 'CP') THEN
CALL LINE (3)
WRITE (LUNIT,13) CC12
13 FORMAT ('0*** ILLEGAL ADJUSTMENT FILE FORMAT TYPE -- ', A2/)
ENDIF
GO TO 10
*** END OF A FILE PROCESSING
100 CLOSE (IUNIT)
CALL EFINIT
CALL LINE (2)
WRITE (LUNIT,101)
101 FORMAT ('0', 33('*'), ' END OF A-FILE ', 33('*') )
IF (FATAL) then
CALL ABORT2
endif
RETURN
*** A FILE NOT PRESENT
200 CALL EFINIT
CALL LINE (3)
***v 4.28k
*** WRITE (LUNIT,201) IOS
*** 201 FORMAT ('0', 30('*'), ' NO A-FILE -- ALL DEFAULTS ACTIVE ',
*** & 30('*'), I10/)
write(lunit,201)
201 format ('0', 33('*'), ' A-FILE NOT FOUND--FATAL ERROR')
call abort2
RETURN
END
SUBROUTINE AFINIT
********************************************************************************
* INITIALIZE THE DEFAULTS
********************************************************************************
IMPLICIT DOUBLE PRECISION (A-H, O-Z)
IMPLICIT INTEGER (I-N)
PARAMETER ( MXSSN = 9999 )
LOGICAL LDIR, LANG, LZEN, LDIS, LAZI, LGPS, LDOP
COMMON /BYPASS/ LDIR, LANG, LZEN, LDIS, LAZI, LGPS, LDOP
LOGICAL L2HLF, LEHT
COMMON /DUAL/ N2HLF, I2HLF(MXSSN), L2HLF, LEHT
LOGICAL LBB, LGF, LCS, LVD, LVA, LVZ, LVS, LVR, LVG,
& LVC, LIS, LPS, LPG, LDR, LOS, LAP, LDF, LVX, LGV
COMMON /OPRINT/ CRIT, LBB, LGF, LCS, LVD, LVA, LVZ, LVS, LVR, LVG,
& LVC, LIS, LPS, LPG, LDR, LOS, LAP, LDF, LVX, LGV
*v 4.29
COMMON /OPRIN2/ CRIT2
LOGICAL LMSL, LSS, LUP, LABS, LADJ, LUPI
COMMON /OPT/ AX, E2, DMSL, DGH, VM, VP, CTOL, ITMAX, IMODE,
& LMSL, LSS, LUP, LABS, LADJ, LUPI
LOGICAL NLMODE,NLSCL
COMMON /NLOPT/ NLMODE,NLSCL,NLUN1,NLUN2,NLUN3,NLUN4,NLUN5
LOGICAL LEB, LLB, LEG, LLG, LED, LLD
COMMON /PECHO/ LEB, LLB, LEG, LLG, LED, LLD
COMMON /STRUCT/ NSTA, NAUX, NUNK, IDIM, NSTAS, NOBS, NCON, NZ,NGRT
COMMON /YEARS/ ICBEG,IYBEG,ICEND,IYEND
** v 4.32vf
LOGICAL IVCGPS,VSlogic
COMMON/VCREC/SIGH,SIGU, VFHOR,VFUP, IVCGPS
CHARACTER*13 VSPROJ
PARAMETER (MAXPRJ=2500)
COMMON/VSREC/SIGHS(MAXPRJ), SIGUS(MAXPRJ), ISETHU, VSPROJ(MAXPRJ),
& VSlogic
***10-24-03
common /opt2/ itmax2
*******
LDIR = .FALSE.
LANG = .FALSE.
LZEN = .FALSE.
LDIS = .FALSE.
LAZI = .FALSE.
LGPS = .FALSE.
LDOP = .FALSE.
L2HLF = .FALSE.
LEHT = .FALSE.
CRIT = 0.D0
CRIT2 = 0.D0
LBB = .TRUE.
LGF = .TRUE.
LCS = .TRUE.
LVD = .TRUE.
LVA = .TRUE.
LVZ = .TRUE.
LVS = .TRUE.
LVR = .TRUE.
LVG = .TRUE.
LVC = .TRUE.
LIS = .TRUE.
LPS = .TRUE.
LPG = .TRUE.
LDR = .FALSE.
LOS = .TRUE.
LAP = .TRUE.
LDF = .TRUE.
LVX = .TRUE.
LGV = .TRUE.
AX = 6378137.D0
E2 = 6.6943800229034156D-3
DMSL = 0.D0
DGH = 0.D0
VM = 300.D0
VP = 30.0
CTOL = 0.003D0
ITMAX = 5
IMODE = 1
LMSL = .TRUE.
LSS = .FALSE.
LUP = .FALSE.
LABS = .FALSE.
LADJ = .FALSE.
LUPI = .FALSE.
LEB = .FALSE.
LLB = .FALSE.
LEG = .FALSE.
LLG = .FALSE.
LED = .FALSE.
LLD = .FALSE.
NLMODE = .FALSE.
NLSCL = .FALSE.
NSTA = 0
NAUX = 0
NUNK = 0
IDIM = 3
NSTAS = 0
NOBS = 0
NCON = 0
NZ = 0
NGRT = 0
ICBEG = 0
IYBEG = 0
ICEND = 0
IYEND = 0
** v 4.32vf
ISETHU=0
IVCGPS=.FALSE.
SIGH=1.0
SIGU=1.0
*************
***10-24-03
itmax2 = 5
*****
CALL NEWPRM
CALL NEWGRT
CALL NEWIVF
RETURN
END
SUBROUTINE AFPRNT
********************************************************************************
* ECHO THE ADJUSTMENT OPTIONS
********************************************************************************
IMPLICIT DOUBLE PRECISION (A-H, O-Z)
IMPLICIT INTEGER (I-N)
PARAMETER ( MXSSN = 9999 )
CHARACTER*80 BBOOK, AFILE, GFILE, DFILE, BBNAM
CHARACTER*7 ADJFIL, NAFILE
LOGICAL LDIR, LANG, LZEN, LDIS, LAZI, LGPS, LDOP
LOGICAL LBB, LGF, LCS, LVD, LVA, LVZ, LVS, LVR, LVG,
& LVC, LIS, LPS, LPG, LDR, LOS, LAP, LDF, LVX, LGV
LOGICAL LSS, LUP, LMSL, LABS, LADJ, LUPI
LOGICAL L2HLF, LEHT
LOGICAL LEB, LLB, LEG, LLG, LED, LLD
COMMON /PECHO/ LEB, LLB, LEG, LLG, LED, LLD
COMMON /OPRINT/ CRIT, LBB, LGF, LCS, LVD, LVA, LVZ, LVS, LVR, LVG,
& LVC, LIS, LPS, LPG, LDR, LOS, LAP, LDF, LVX, LGV
* v 4.29
COMMON /OPRIN2/ CRIT2
COMMON /OPT/ AX, E2, DMSL, DGH, VM, VP, CTOL, ITMAX, IMODE,
& LMSL, LSS, LUP, LABS, LADJ, LUPI
COMMON /NAME/ BBOOK, AFILE, GFILE, DFILE, BBNAM, ADJFIL, NAFILE
LOGICAL NLMODE,NLSCL
COMMON /NLOPT/ NLMODE,NLSCL,NLUN1,NLUN2,NLUN3,NLUN4,NLUN5
COMMON /STRUCT/ NSTA, NAUX, NUNK, IDIM, NSTAS, NOBS, NCON, NZ,NGRT
COMMON /BYPASS/ LDIR, LANG, LZEN, LDIS, LAZI, LGPS, LDOP
COMMON /DUAL/ N2HLF, I2HLF(MXSSN), L2HLF, LEHT
COMMON/UNITS/ LUNIT
** v 4.32vf , 6.1
LOGICAL IVCGPS,VSlogic
CHARACTER*13 VSPROJ
COMMON/VCREC/SIGH,SIGU, VFHOR,VFUP, IVCGPS
** v 6.3
LOGICAL overwrite_const_coord_in_newbb
COMMON/MM6/overwrite_const_coord_in_newbb
PARAMETER (MAXPRJ=2500)
COMMON/VSREC/SIGHS(MAXPRJ), SIGUS(MAXPRJ), ISETHU, VSPROJ(MAXPRJ),
& VSlogic
CALL HEAD
CALL LINE (46)
WRITE (LUNIT,7777)
7777 FORMAT (' ***************** ADJUSTMENT FILE OPTIONS **********'/)
WRITE (LUNIT,1) AX
1 FORMAT (' ELLIPSOID SEMI-MAJOR AXIS = ', F12.3, ' METERS')
WRITE (LUNIT,2) E2
2 FORMAT (' ECCENTRICITY SQUARED = ', F20.18)
WRITE (LUNIT,3) DMSL
** v 4.29f
* 3 FORMAT (' DEFAULT MEAN SEA LEVEL = ', F8.3, ' METERS')
3 FORMAT (' DEFAULT ORTHOMETRIC HEIGHT = ', F8.3, ' METERS')
**************************
WRITE (LUNIT,4) DGH
4 FORMAT (' DEFAULT GEOID HEIGHT = ', F8.3, ' METERS')
IF (LMSL) THEN
WRITE (LUNIT,55)
** v 4.29f
* 55 FORMAT (' ADJUST ORTHOMETRIC ELEVATIONS')
55 FORMAT (' ADJUST ORTHOMETRIC HEIGHTS')
**********************
ELSE
WRITE (LUNIT,5)
5 FORMAT (' ADJUST GEOID HEIGHTS')
ENDIF
IF (LSS) THEN
WRITE (LUNIT,155)
155 FORMAT (' SCALE SIGMAS BY A-POSTERIORI SIGMA OF UNIT WEIGHT')
ELSE
WRITE (LUNIT,156)
156 FORMAT (' DO NOT SCALE SIGMAS BY A-POSTERIORI SIGMA')
ENDIF
IF (LABS) THEN
WRITE (LUNIT,153)
153 FORMAT (' ABORT IF SINGULARITIES')
ELSE
WRITE (LUNIT,154)
154 FORMAT (' DO NOT ABORT IF SINGULARITIES')
ENDIF
IF (LUP) THEN
WRITE (LUNIT,157) BBNAM
* 157 FORMAT (' UPDATE *80* RECORDS INTO NEW BBOOK FILENAME--', A40)
157 FORMAT (' UPDATE *80* RECORDS INTO NEW BBOOK FILENAME--', A80)
ELSE
WRITE (LUNIT,158)
158 FORMAT (' DO NOT UPDATE *80* RECORDS')
ENDIF
**v6.3
if (overwrite_const_coord_in_newbb) then
WRITE (LUNIT,159)
159 FORMAT (
&' UPDATE OUTPUT BLUE BOOK WITH CONSTRAINED VALUES FROM A-FILE')
else
WRITE (LUNIT,160)
160 FORMAT (
&" DO NOT UPDATE OUTPUT B-BOOK WITH CONSTRAINED VALUES FROM A-FILE"
&)
endif
**So far for v6.3
IF (LADJ) THEN
WRITE (LUNIT,200) ADJFIL
200 FORMAT (' CREATE ADJUSTED POSITIONS FILE WITH FILENAME--', A7)
ELSE
WRITE (LUNIT,201)
201 FORMAT (' DO NOT CREATE ADJUSTED POSITIONS FILE')
ENDIF
IF (LUPI) THEN
** v 4.28
* WRITE (LUNIT,167) BBNAM, NAFILE
WRITE (LUNIT,167) NAFILE, BBNAM
* 167 FORMAT (' UPDATE BLUE BOOK AND ADJUSTMENT FILE AT THE END OF',
* & ' EACH ITERATION INTO FILES ', A7, ' AND ', A7)
* 167 FORMAT (' UPDATE ADJUSTMENT AND BLUE BOOK FILES AT THE END OF',
* & ' EACH ITERATION INTO FILES ', A7, ' AND ', A40)
167 FORMAT (' UPDATE ADJUSTMENT AND BLUE BOOK FILES AT THE END OF',
& ' EACH ITERATION INTO FILES ', A7, ' AND ', A80)
************
ELSE
WRITE (LUNIT,168)
168 FORMAT (' DO NOT UPDATE BLUE BOOK AND ADJUSTMENT FILE AT THE',
& ' END OF EACH ITERATION')
ENDIF
IF ( .NOT. L2HLF) THEN
WRITE (LUNIT,6) IDIM
6 FORMAT (' COMPUTE A', I2, '-DIMENSIONAL ADJUSTMENT')
ELSE
WRITE (LUNIT,61)
61 FORMAT (' COMPUTE A 2.5-DIMENSIONAL ADJUSTMENT')
*** BIGADJUST ONLY
* IF (LEHT) THEN
* WRITE (LUNIT,62)
* 62 FORMAT (' OBTAIN ELLIPSOID HEIGHTS FROM EXTENDED *80* RECORDS')
* ELSE
* WRITE (LUNIT,63)
* 63 FORMAT (' OBTAIN ELLIPSOID HEIGHTS FROM ORTHOMETRIC AND GEOID',
* & ' HEIGHTS')
* ENDIF
ENDIF
WRITE (LUNIT,7) ITMAX
7 FORMAT (' COMPUTE NO MORE THAN', I5, ' ITERATIONS')
IF (LDR) THEN
WRITE (LUNIT,127)
127 FORMAT (' DISPLAY STATISTICS IF SOLUTION SLOWLY CONVERGES')
ELSE
WRITE (LUNIT,128)
128 FORMAT (' DO NOT DISPLAY STATISTICS IF SOLUTION SLOWLY',
& ' CONVERGES')
ENDIF
WRITE (LUNIT,8) VM
8 FORMAT (' ABORT IF MISCLOSURE EXCEEDS', G8.1, ' SIGMA')
WRITE (LUNIT,81) VP
81 FORMAT (' PRINT WHEN MISCLOSURES EXCEED', G8.1, ' SIGMA')
WRITE (LUNIT,9) CTOL
9 FORMAT (' CONVERGE IF RMS SUM OF SHIFTS BELOW', F8.3, ' METERS')
IF (IMODE .EQ. 0) THEN
WRITE (LUNIT,90)
90 FORMAT (' PERFORM A SIMULATION ***************************')
ELSEIF (IMODE .EQ. 1) THEN
WRITE (LUNIT,91)
91 FORMAT (' COMPUTE QUASI-NORMALIZED RESIDUALS--NO INVERSE')
ELSEIF (IMODE .EQ. 2) THEN
WRITE (LUNIT,92)
92 FORMAT (' COMPUTE QUASI-NORMALIZED RESIDUALS--COMPUTE INVERSE')
ELSEIF (IMODE .EQ. 3) THEN
WRITE (LUNIT,93)
93 FORMAT (' COMPUTE NORMALIZED RESIDUALS AND INVERSE')
ENDIF
IF (NLMODE ) THEN
WRITE(LUNIT,97)
97 FORMAT (' COMPUTE NETWORK AND LOCAL ACCURACIES')
IF ( IMODE .LE. 1) WRITE (LUNIT, 98)
98 FORMAT (' THE ABOVE OPTION WILL BE IGNORED - IT REQUIRES ',
1 'THAT THE MODE INDICATOR ON THE MM RECORD BE GREATER THAN 1')
IF(NLSCL) THEN
WRITE(LUNIT,99)
ELSE
WRITE(LUNIT,100)
99 FORMAT(' NETWORK AND LOCAL ACCURACIES WILL BE SCALED')
100 FORMAT(' NETWORK AND LOCAL ACCURACIES WILL NOT BE SCALED')
ENDIF
ENDIF
IF (LBB .AND. (.NOT. LEB) .AND. (.NOT. LLB)) WRITE (LUNIT,103)
103 FORMAT (' ECHO BLUE BOOK FILE')
IF (LEB) WRITE (LUNIT,171)
171 FORMAT (' ECHO BLUE BOOK OBSERVATIONS ONLY')
IF (LLB) WRITE (LUNIT,172)
172 FORMAT (' ECHO LARGE BLUE BOOK MISCLOSURES ONLY')
IF ( .NOT. LBB) WRITE (LUNIT,104)
104 FORMAT (' DO NOT ECHO BLUE BOOK FILE')
IF (LDIR) WRITE (LUNIT,181)
181 FORMAT (' BYPASS ALL HORIZONTAL DIRECTIONS')
IF (LANG) WRITE (LUNIT,182)
182 FORMAT (' BYPASS ALL HORIZONTAL ANGLES')
IF (LZEN) WRITE (LUNIT,183)
183 FORMAT (' BYPASS ALL ZENITH DISTANCES')
IF (LDIS) WRITE (LUNIT,184)
184 FORMAT (' BYPASS ALL DISTANCES')
IF (LAZI) WRITE (LUNIT,185)
185 FORMAT (' BYPASS ALL ASTRONOMIC AZIMUTHS')
IF (LGF .AND. ( .NOT. LGPS) ) THEN
WRITE (LUNIT,101)
101 FORMAT (' ECHO GPS DATA TRANSFER FILE')
IF (LEG) WRITE (LUNIT,173)
173 FORMAT (' ECHO G-FORMAT OBSERVATIONS ONLY')
IF (LLG) WRITE (LUNIT,174)
174 FORMAT (' ECHO LARGE G-FORMAT MISCLOSURES ONLY')
ELSE
WRITE (LUNIT,102)
102 FORMAT (' DO NOT ECHO GPS DATA TRANSFER FILE')
ENDIF
IF (LGPS) WRITE (LUNIT,186)
186 FORMAT (' BYPASS ALL GPS DATA')
IF (LDF .AND. ( .NOT. LDOP) ) THEN
c WRITE (LUNIT,191)
191 FORMAT (' ECHO DOPPLER DATA TRANSFER FILE')
IF (LED) WRITE (LUNIT,193)
193 FORMAT (' ECHO D-FORMAT OBSERVATIONS ONLY')
IF (LLD) WRITE (LUNIT,194)
194 FORMAT (' ECHO LARGE D-FORMAT MISCLOSURES ONLY')
ELSE
c WRITE (LUNIT,192)
192 FORMAT (' DO NOT ECHO DOPPLER DATA TRANSFER FILE')
ENDIF
c IF (LDOP) WRITE (LUNIT,196)
c 196 FORMAT (' BYPASS ALL DOPPLER DATA')
IF (LCS) THEN
WRITE (LUNIT,111)
111 FORMAT (' DISPLAY CONSTRAINTS')
ELSE
WRITE (LUNIT,112)
112 FORMAT (' DO NOT DISPLAY CONSTRAINTS')
ENDIF
* v 4.29
WRITE (LUNIT,131) CRIT2
131 FORMAT (' DISPLAY ALL GPS RESIDUALS GREATER OR EQUAL TO ',
*F4.1,' MM')
* v 4.29
WRITE (LUNIT,1310) CRIT
1310 FORMAT (' DISPLAY ALL NON-GPS RESIDUALS/SD GREATER OR EQUAL TO ',
*F4.1,' SIGMA')
IF (LVD) THEN
IF ( .NOT. LDIR) THEN
WRITE (LUNIT,113)
113 FORMAT (' DISPLAY DIRECTION RESIDUALS')
ELSE
WRITE (LUNIT,114)
114 FORMAT (' DO NOT DISPLAY DIRECTION RESIDUALS')
ENDIF
ENDIF
IF (LVA) THEN
IF ( .NOT. LANG) THEN
WRITE (LUNIT,115)
115 FORMAT (' DISPLAY ANGLE RESIDUALS')
ELSE
WRITE (LUNIT,116)
116 FORMAT (' DO NOT DISPLAY ANGLE RESIDUALS')
ENDIF
ENDIF
IF (LVZ) THEN
IF ( .NOT. LZEN) THEN
WRITE (LUNIT,117)
117 FORMAT (' DISPLAY ZENITH DISTANCE RESIDUALS')
ELSE
WRITE (LUNIT,118)
118 FORMAT (' DO NOT DISPLAY ZENITH DISTANCE RESIDUALS')
ENDIF
ENDIF
IF (LVS) THEN
IF ( .NOT. LDIS) THEN
WRITE (LUNIT,119)
119 FORMAT (' DISPLAY DISTANCE RESIDUALS')
ELSE
WRITE (LUNIT,120)
120 FORMAT (' DO NOT DISPLAY DISTANCE RESIDUALS')
ENDIF
ENDIF
IF (LVR) THEN
IF ( .NOT. LAZI) THEN
WRITE (LUNIT,121)
121 FORMAT (' DISPLAY ASTRO-AZIMUTH RESIDUALS')
ELSE
WRITE (LUNIT,122)
122 FORMAT (' DO NOT DISPLAY ASTRO-AZIMUTH RESIDUALS')
ENDIF
ENDIF
IF (LVG) THEN
IF ( .NOT. LGPS) THEN
WRITE (LUNIT,123)
123 FORMAT (' DISPLAY GPS RESIDUALS')
ELSE
WRITE (LUNIT,124)
124 FORMAT (' DO NOT DISPLAY GPS RESIDUALS')
ENDIF
ENDIF
IF (LVX) THEN
IF ( .NOT. LDOP) THEN
WRITE (LUNIT,197)
197 FORMAT (' DISPLAY DOPPLER RESIDUALS')
ELSE
c WRITE (LUNIT,198)
198 FORMAT (' DO NOT DISPLAY DOPPLER RESIDUALS')
ENDIF
ENDIF
IF (LVC) THEN
WRITE (LUNIT,125)
125 FORMAT (' DISPLAY CONSTRAINED RESIDUALS')
ELSE
WRITE (LUNIT,126)
126 FORMAT (' DO NOT DISPLAY CONSTRAINED RESIDUALS')
ENDIF
IF (LIS) THEN
WRITE (LUNIT,129)
129 FORMAT (' DISPLAY RESIDUALS GROUPED AROUND INTERSECTION STAS')
ENDIF
IF (LPS) THEN
WRITE (LUNIT,107)
107 FORMAT (' DISPLAY POSITION SHIFTS')
ELSE
WRITE (LUNIT,108)
108 FORMAT (' DO NOT DISPLAY POSITION SHIFTS')
ENDIF
IF (LPG) THEN
WRITE (LUNIT,109)
109 FORMAT (' DISPLAY POSITION GOOGE NUMBERS')
ELSE
WRITE (LUNIT,110)
110 FORMAT (' DO NOT DISPLAY POSITION GOOGE NUMBERS')
ENDIF
IF ( .NOT. LOS) WRITE (LUNIT,301)
301 FORMAT (' DISPLAY ONLY AN ABBREVIATED OBSERVATIONAL SUMMARY')
IF ( .NOT. LAP) WRITE (LUNIT,302)
302 FORMAT (' DO NOT DISPLAY THE ADJUSTED POSITIONS')
** v 4.32vf
*** inserted 2/10/3003
IF(ISETHU.GT.0) THEN
WRITE(LUNIT,310)
310 FORMAT(' GPS SESSION COVARIANCE MATRICES INPUT IN THE G-FILE',
&' WILL BE SCALED AS FOLLOWS:'/
&' PROJECT HORIZONTAL UP')
DO 312 I=1,ISETHU
WRITE(LUNIT,311) VSPROJ(I), SIGHS(I), SIGUS(I)
311 FORMAT(1X,A13,2F7.3)
312 CONTINUE
WRITE(LUNIT,313)
313 FORMAT()
ENDIF
IF(IVCGPS) WRITE(LUNIT,315)
315 FORMAT(' VARIANCE FACTORS FOR GPS HORIZONTAL AND VERTICAL ',
& 'COMPONENTS WILL BE COMPUTED')
*** end insert
RETURN
END
SUBROUTINE FINAL (IUO,A,NX,B,SHIFTS,GOOGE,G,SIGUWT,IUO3)
********************************************************************************
* LIST THE ADJUSTMENT RESULTS
********************************************************************************
IMPLICIT DOUBLE PRECISION (A-H,O-Z)
IMPLICIT INTEGER (I-N)
PARAMETER ( MXFOT = 3500, MXSSN = 9999 )
CHARACTER*26 TBUF
LOGICAL INVERT,GETA
LOGICAL LBB, LGF, LCS, LVD, LVA, LVZ, LVS, LVR, LVG,
& LVC, LIS, LPS, LPG, LDR, LOS, LAP, LDF, LVX, LGV
LOGICAL LSS, LUP, LMSL, LABS, LADJ, LUPI
LOGICAL L2HLF, LEHT
DIMENSION A(*),NX(*),B(*),SHIFTS(*),GOOGE(*),G(*)
COMMON /OPT/ AX, E2, DMSL, DGH, VM, VP, CTOL, ITMAX, IMODE,
& LMSL, LSS, LUP, LABS, LADJ, LUPI
COMMON /OPRINT/ CRIT, LBB, LGF, LCS, LVD, LVA, LVZ, LVS, LVR, LVG,
& LVC, LIS, LPS, LPG, LDR, LOS, LAP, LDF, LVX, LGV
COMMON /STRUCT/ NSTA, NAUX, NUNK, IDIM, NSTAS, NOBS, NCON, NZ,NGRT
COMMON /NUMVFS/ NVFTOT, NVFREE
COMMON /STATCT/ N84, N85, N86, NDIR, NANG, NGPS, NZD, NDS, NAZ,
& NQQ, NREJ, NGPSR, NDOP
COMMON /FOURTH/ NFOT, NFOTS(MXFOT)
COMMON /DUAL/ N2HLF, I2HLF(MXSSN), L2HLF, LEHT
LOGICAL NLMODE,NLSCL
COMMON /NLOPT/ NLMODE,NLSCL,NLUN1,NLUN2,NLUN3,NLUN4,NLUN5
COMMON/UNITS/ LUNIT
** v 4.32vf
LOGICAL IVCGPS,VSlogic
COMMON/VCREC/SIGH,SIGU, VFHOR,VFUP, IVCGPS
CHARACTER*13 VSPROJ
PARAMETER (MAXPRJ=2500)
COMMON/VSREC/SIGHS(MAXPRJ), SIGUS(MAXPRJ), ISETHU, VSPROJ(MAXPRJ),
& VSlogic
**v6.3
integer*4 CC_counter
LOGICAL overwrite_const_coord_in_newbb
character CC_records*80
COMMON/MM6/overwrite_const_coord_in_newbb
COMMON/MM6_array/CC_records(MXSSN)
**So far for v6.3
****
DATA ITYPE / 1 /
*** COMPLETE THE COMPUTATION OF THE GOOGE NUMBERS, IF VARIANCE
*** FACTORS THEN THE GOOGE NUMBS ALREADY COMPUTED IN SUBR. VFCVRG
** v 4.30vf
IF (NVFREE .EQ. 0 .AND. .NOT.IVCGPS) THEN
******