Page 1 Source Listing REFORMAT 2021-01-25 17:16 REFORMAT.f 1 program reformat 2 CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC 3 C Program will convert rfc24-uniq-early 4 C to usa-dlyprcp-$YYMMDD 5 C Convert from IBMSP 6 C 7 C PROGRAM HISTORY LOG: 8 C 03-03-12 YUEJIAN ZHUL 9 CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC 10 c 11 c parameter (len=9824) 12 parameter (len=51485) 13 dimension lat(len),lon(len) 14 dimension rlat(len),rlon(len) 15 dimension prcp (20000) 16 character*8 gageid(20000) 17 character*8 statid(len),cymd 18 character*80 fname1,fname2,fname3 19 namelist /namin/iymd,fname1,fname2,fname3 20 cccccc 21 read (5,namin) 22 write(6,namin) 23 C read *, iymd 24 C write (cymd,1004) iymd 25 iunit=10 26 junit=11 27 kunit=51 28 jndex=0 29 index=0 30 icnt=0 31 jcnt=0 32 C fname1='/nfsuser/g01/wx20yz/jif_cqpf/data/ingest_nwsli.uniq' 33 C fname2(1:21)='/com/ingest/prod/shf.' 34 C fname3(1:29)='/ptmp/wx20yz/cvt/usa-dlyprcp-' 35 C fname2(22:29)=cymd 36 C fname2(30:46)='/rfc24-uniq-early' 37 C fname3(30:37)=cymd 38 open(unit=iunit,file=fname1,status='OLD',form='FORMATTED', 39 & iostat=ios10) 40 print *, 'INPUT REFERENCE STATION LIST FILE: ', fname1 41 open(unit=junit,file=fname2,status='OLD',form='FORMATTED', 42 & iostat=ios11) 43 print *, 'INPUT RFC 24 HOURS PRECIPITATION: ', fname2 44 open(unit=kunit,file=fname3,status='NEW',form='FORMATTED', 45 & iostat=ios51) 46 print *, 'OUTPUT RFC 24 HOURS PRECIPITATION: ', fname3 47 48 if(ios10.ne.0) print *, 'failure to open file =', fname1 49 if(ios11.ne.0) print *, 'failure to open file =', fname2 50 if(ios51.ne.0) print *, 'failure to open file =', fname3 51 52 do iii = 1, len 53 read(iunit,1001,err=102,end=101) statid(iii),rlat(iii),rlon(iii) 54 C print *, rlat(iii),rlon(iii),statid(iii) 55 enddo 56 101 continue 57 1000 continue Page 2 Source Listing REFORMAT 2021-01-25 17:16 REFORMAT.f 58 icnt = icnt + 1 59 read(junit,1002,err=103,end=104) gageid(icnt),prcp(icnt) 60 C print *, gageid(icnt),prcp(icnt) 61 goto 1000 62 104 continue 63 print *, "total record read in ",icnt 64 write (51,1005) iymd 65 call sort(prcp,gageid,icnt) 66 ijk=1200 67 do iii = icnt, 1, -1 68 do jjj = 1, len 69 if (statid(jjj).eq.gageid(iii)) then 70 c rlat(jjj) = float(lat(jjj))/100.00 71 c rlon(jjj) = float(lon(jjj))/100.00 72 jcnt = jcnt + 1 73 write (51,1003) rlat(jjj),rlon(jjj),prcp(iii),gageid(iii),ijk 74 goto 105 75 endif 76 enddo 77 105 continue 78 enddo 79 print *, "total record write out",jcnt 80 stop 81 1001 format(a8,f7.2,f7.2) 82 1002 format(a8,40x,f8.2) 83 C1002 format(17x,a8,4x,f8.2) 84 1003 format(f6.2,f8.2,f7.2,1x,a8,i6) 85 1004 format(i8) 86 1005 format(' 24-hr precip reports ending 12Z on ',i8) 87 102 print *, ' error to read file ',iunit 88 103 print *, ' error to read file ',junit 89 106 stop 90 end Page 3 Source Listing REFORMAT 2021-01-25 17:16 Entry Points REFORMAT.f ENTRY POINTS Name MAIN__ SYMBOL CROSS REFERENCE Name Object Declared Type Bytes Dimen Elements Attributes References 1000 Label 57 61 1001 Label 81 53 1002 Label 82 59 1003 Label 84 73 1004 Label 85 1005 Label 86 64 101 Label 56 53 102 Label 87 53 103 Label 88 59 104 Label 62 59 105 Label 77 74 106 Label 89 CYMD Local 17 CHAR 8 scalar FNAME1 Local 18 CHAR 80 scalar 19,38,40,48 FNAME2 Local 18 CHAR 80 scalar 19,41,43,49 FNAME3 Local 18 CHAR 80 scalar 19,44,46,50 GAGEID Local 16 CHAR 8 1 20000 59,65,69,73 ICNT Local 30 I(4) 4 scalar 30,58,59,63,65,67 III Local 52 I(4) 4 scalar 52,53,67,69,73 IJK Local 66 I(4) 4 scalar 66,73 INDEX Local 29 I(4) 4 scalar 29 IOS10 Local 39 I(4) 4 scalar 39,48 IOS11 Local 42 I(4) 4 scalar 42,49 IOS51 Local 45 I(4) 4 scalar 45,50 IUNIT Local 25 I(4) 4 scalar 25,38,53,87 IYMD Local 19 I(4) 4 scalar 19,64 JCNT Local 31 I(4) 4 scalar 31,72,79 JJJ Local 68 I(4) 4 scalar 68,69,73 JNDEX Local 28 I(4) 4 scalar 28 JUNIT Local 26 I(4) 4 scalar 26,41,59,88 KUNIT Local 27 I(4) 4 scalar 27,44 LAT Local 13 I(4) 4 1 51485 LEN Param 12 I(4) 4 scalar 13,14,17,52,68 LON Local 13 I(4) 4 1 51485 NAMIN Local 19 scalar 21,22 PRCP Local 15 R(4) 4 1 20000 59,65,73 REFORMAT Prog 1 RLAT Local 14 R(4) 4 1 51485 53,73 RLON Local 14 R(4) 4 1 51485 53,73 SORT Subr 65 65 STATID Local 17 CHAR 8 1 51485 53,69 Page 4 Source Listing REFORMAT 2021-01-25 17:16 REFORMAT.f 91 C===================================================== SORT.FOR 92 SUBROUTINE SORT(X,C,N) 93 C*********************************************************************** 94 C* FORTRAN CODE WRITTEN FOR INCLUSION IN IBM RESEARCH REPORT RC20525, * 95 C* 'FORTRAN ROUTINES FOR USE WITH THE METHOD OF L-MOMENTS, VERSION 3' * 96 C*********************************************************************** 97 C 98 C SORTS THE ARRAY X INTO ASCENDING ORDER 99 C 100 C PARAMETERS OF ROUTINE: 101 C X *IN/OUT* ARRAY OF LENGTH N. CONTAINS THE NUMBERS TO BE SORTED. 102 C ON EXIT, CONTAINS THE SORTED NUMBERS. 103 C N * INPUT* NUMBER OF ELEMENTS TO BE SORTED 104 C 105 C METHOD USED IS SHELL SORT WITH SEQUENCE OF INCREMENTS AS IN 106 C D.F.KNUTH (1969) 'THE ART OF COMPUTER PROGRAMMING', VOL.3, P.95 107 C 108 DIMENSION X(N) 109 CHARACTER*8 C(N),CTMP 110 IF(N.LE.1)RETURN 111 J=4 112 DO 10 I=1,100 113 J=3*J+1 114 IF(J.GE.N)GOTO 20 115 10 CONTINUE 116 20 CONTINUE 117 M=(J/3) 118 DO 60 MM=1,100 119 M=M/3 120 IF(M.EQ.0)RETURN 121 DO 50 I=M+1,N 122 TEST=X(I) 123 CTMP=C(I) 124 J=I 125 DO 30 JJ=1,100 126 J=J-M 127 IF(J.LE.0)GOTO 40 128 IF(TEST.GE.X(J))GOTO 40 129 X(J+M)=X(J) 130 C(J+M)=C(J) 131 30 CONTINUE 132 40 CONTINUE 133 X(J+M)=TEST 134 C(J+M)=CTMP 135 50 CONTINUE 136 60 CONTINUE 137 END Page 5 Source Listing SORT 2021-01-25 17:16 Entry Points REFORMAT.f ENTRY POINTS Name sort_ SYMBOL CROSS REFERENCE Name Object Declared Type Bytes Dimen Elements Attributes References 10 Label 115 112 20 Label 116 114 30 Label 131 125 40 Label 132 127,128 50 Label 135 121 60 Label 136 118 C Dummy 92 CHAR 8 1 0 ARG,INOUT 123,130,134 CTMP Local 109 CHAR 8 scalar 123,134 I Local 112 I(4) 4 scalar 112,121,122,123,124 J Local 111 I(4) 4 scalar 111,113,114,117,124,126,127,128,12 9,130,133,134 JJ Local 125 I(4) 4 scalar 125 M Local 117 I(4) 4 scalar 117,119,120,121,126,129,130,133,13 4 MM Local 118 I(4) 4 scalar 118 N Dummy 92 I(4) 4 scalar ARG,INOUT 108,109,110,114,121 SORT Subr 92 TEST Local 122 R(4) 4 scalar 122,128,133 X Dummy 92 R(4) 4 1 0 ARG,INOUT 122,128,129,133 Page 6 Source Listing SORT 2021-01-25 17:16 REFORMAT.f 138 Page 7 Source Listing SORT 2021-01-25 17:16 Subprograms/Common Blocks REFORMAT.f SUBPROGRAMS/COMMON BLOCKS Name Object Declared Type Bytes Dimen Elements Attributes References REFORMAT Prog 1 SORT Subr 92 COMPILER OPTIONS BEING USED -align noall -align nonone -align nocommons -align nodcommons -align noqcommons -align nozcommons -align records -align nosequence -align norec1byte -align norec2byte -align norec4byte -align norec8byte -align norec16byte -align norec32byte -align norec64byte -align noarray8byte -align noarray16byte -align noarray32byte -align noarray64byte -align noarray128byte -align noarray256byte -altparam -assume accuracy_sensitive -assume nobscc -assume nobuffered_io -assume nobuffered_stdout -assume byterecl -assume nocontiguous_assumed_shape -assume nocontiguous_pointer -assume nocc_omp -assume nocstring -assume nodummy_aliases -assume nofpe_summary -assume noieee_fpe_flags -assume nominus0 -assume noold_boz -assume old_complex_align -assume old_unit_star -assume old_ldout_format -assume noold_logical_assign -assume noold_logical_ldio -assume old_maxminloc -assume old_xor -assume noprotect_allocates -assume protect_constants -assume noprotect_parens -assume split_common -assume source_include -assume nostd_intent_in -assume std_minus0_rounding -assume nostd_mod_proc_name -assume std_value -assume realloc_lhs -assume underscore -assume no2underscores no -auto -auto_scalar no -bintext -ccdefault default -check noarg_temp_created -check noassume -check nobounds -check nocontiguous -check noformat -check nooutput_conversion -check nooverflow -check nopointers -check noshape -check nostack -check nouninitialized -coarray-num-procs 0 no -coarray-config-file -convert big_endian -cross_reference -D __INTEL_COMPILER=1800 -D __INTEL_COMPILER_UPDATE=1 -D __unix__ -D __unix -D __linux__ -D __linux -D __gnu_linux__ -D unix -D linux -D __ELF__ -D __x86_64 -D __x86_64__ -D __amd64 -D __amd64__ -D __INTEL_COMPILER_BUILD_DATE=20171018 -D __INTEL_OFFLOAD -D __i686 -D __i686__ Page 8 Source Listing SORT 2021-01-25 17:16 REFORMAT.f -D __pentiumpro -D __pentiumpro__ -D __pentium4 -D __pentium4__ -D __tune_pentium4__ -D __SSE2__ -D __SSE2_MATH__ -D __SSE__ -D __SSE_MATH__ -D __MMX__ -double_size 64 no -d_lines no -Qdyncom -error_limit 30 no -f66 no -f77rtl no -fast -fpscomp nofilesfromcmd -fpscomp nogeneral -fpscomp noioformat -fpscomp noldio_spacing -fpscomp nologicals -fixed no -fpconstant -fpe3 -fprm nearest no -ftz -fp_model noprecise -fp_model fast -fp_model nostrict -fp_model nosource -fp_model nodouble -fp_model noextended -fp_model novery_fast -fp_model noexcept -fp_model nono_except -heap_arrays 0 no -threadprivate_compat -g0 -iface nomixed_str_len_arg -iface nono_mixed_str_len_arg -init noarrays -init nohuge -init noinfinity -init nominus_huge -init nominus_infinity -init nominus_tiny -init nonan -init nosnan -init notiny -init nozero no -intconstant -integer_size 32 no -mixed_str_len_arg no -module -names lowercase no -noinclude -offload-build=host -O2 no -pad_source -real_size 32 no -recursive -reentrancy threaded no -sharable_localsaves -vec=simd -show nofullpath -show noinclude -show map -show options no -syntax_only no -threadcom no -U no -vms -w noall -w nonone -w alignments -w nodeclarations -w general -w noignore_bounds -w noignore_loc -w nointerfaces -w notruncated_source -w uncalled -w uninitialized -w nounused -w usage no -wrap-margins -includepath : /usrx/local/prod/intel/2018UP01/compilers_and_libraries/linux/tbb/include/,/usr/local/include/, .f,./.f,/usrx/local/prod/intel/2018UP01/compilers_and_libraries/linux/ipp/include/.f,/usrx/local/prod/intel/2018UP01/compilers_and_libraries/linux/mkl/include/.f, /usrx/local/prod/intel/2018UP01/compilers_and_libraries/linux/pstl/include/.f,/usrx/local/prod/intel/2018UP01/compilers_and_libraries/linux/tbb/include/.f, /usrx/local/prod/intel/2018UP01/compilers_and_libraries/linux/daal/include/.f,/gpfs/dell1/usrx/local/prod/intel/2018UP01/compilers_and_libraries_2018.1.163/linux/compiler/include/intel64/.f, /gpfs/dell1/usrx/local/prod/intel/2018UP01/compilers_and_libraries_2018.1.163/linux/compiler/include/icc/.f, /gpfs/dell1/usrx/local/prod/intel/2018UP01/compilers_and_libraries_2018.1.163/linux/compiler/include/.f, /usr/local/include/.f,/usr/lib/gcc/x86_64-redhat-linux/4.8.5/include/.f,/usr/include/.f,/usr/include/.f, /usr/include/.f -list filename : REFORMAT.lst -o filename : none COMPILER: Intel(R) Fortran 18.0-1599