C**************************************************************************** C Version: 0.3 C Last Changed: Mario Monteiro, 2005-11 C This is the main program where the type of conversion is selected and C all the relevant subroutines are called. C**************************************************************************** program modconv c implicit double precision (b-h,o-z) implicit integer (i-n) character afilein*80,afileout*80 character aheaderin*80 parameter (npt=5000,ncol=40,ndat=200,nop=17) dimension aheaderin(10),ioptions(nop) dimension ndimin(ndat),nparin(ndat),xin(ncol,npt) dimension xdata1in(ndat),xdata2in(ndat),xdata3in(ndat) c data ioptions/12,13,14,15,23,24,25,26,32,34,35,36,45,54,62,64,65/ c call ref_data c write (6,1000) 1000 format ('*********************> PROGRAM MODCONV (V0.3) ', * '<*********************',/) c write (6,1001) 1001 format (' Formats:',/, * ' [1] GONG [2] FGONG [3] OSC [4] AMDL ' * '[5] FAMDL [6] SROX',/,/ * ' The conversions available are:',/,/, * ' [12] GONG -|FGONG [23] FGONG -|OSC ', * '[32] OSC -|FGONG',/, * ' [13] |OSC [24] |AMDL ', * '[34] |AMDL',/, * ' [14] |AMDL [25] |FAMDL ', * '[35] |FAMDL',/, * ' [15] |FAMDL [26] |SROX ', * '[36] |SROX'/,/, * ' [45] AMDL -|FAMDL [62] SROX -|FGONG',/, * ' [54] FAMDL -|AMDL [64] |AMDL'/, * ' [65] |FAMDL',/) c c------- Selecting the type of conversion: 1005 write (6,1010) 1010 format (' _____________________________________',/, * ' Please select the type of conversion: ', * ' [Enter "0" to exit]') 1020 read (*,*,err=1024) itype if (itype.eq.0) goto 1200 itest=0 do 10 i=1,nop if (itype.eq.ioptions(i)) itest=1 10 continue if (itest.ge.1) goto 1028 1024 write (*,1025) 1025 format (' ERROR: Invalid option!',/,' Please try again:') goto 1020 1028 continue c c------- Setting the file for the input: write (*,1033) 1033 format (' ___________',/, * ' Input file? ', * ' [Enter "stop" to exit]') 1035 read (*,1030) afilein 1030 format (a80) if (afilein(1:4).eq.'stop') goto 1200 c c------- Reading in the data: if (itype.ge.12.and.itype.le.15) then c --> GONG: 1 call read_gong (afilein,xin,ndimin,nparin, * xdata1in,xdata2in,xdata3in,aheaderin) else if (itype.ge.23.and.itype.le.26) then c --> FGONG: 2 call read_fgong (afilein,xin,ndimin,xdata1in,aheaderin) else if (itype.ge.32.and.itype.le.36) then c --> OSC: 3 call read_osc (afilein,xin,ndimin,xdata1in,aheaderin) else if (itype.eq.45) then c --> AMDL: 4 call read_amdl (afilein,xin,ndimin,xdata1in) else if (itype.eq.54) then c --> FADML: 5 call read_famdl (afilein,xin,ndimin,xdata1in) else if (itype.ge.62.and.itype.le.65) then c --> SROX: 6 call read_srox (afilein,xin,ndimin,xdata1in) endif if (afilein(1:5).eq.'error') goto 1035 c c------- Setting the file for the output: write (*,1073) 1073 format (' _______________________________',/, * ' Output file? (Default is "mod") ', * ' [Enter "stop" to exit]') 1070 read (*,1030) afileout if (afileout(1:2).eq.' ') afileout='mod' if (afileout(1:4).eq.'stop') goto 1200 c c------- Converting and writing out the data: if (itype.eq.12) then c c --- From GONG to FGONG/OSC/AMDL/FAMDL: call gong_fgong (afileout,xin,ndimin,nparin, * xdata1in,xdata2in,xdata3in,aheaderin) else if (itype.eq.13) then call gong_osc (afileout,xin,ndimin,nparin, * xdata1in,xdata2in,xdata3in,aheaderin) else if (itype.eq.14.or.itype.eq.15) then call gong_amdl (itype,afileout,xin,ndimin,nparin, * xdata1in,xdata2in,xdata3in,aheaderin) c c --- From FGONG to OSC/AMDL/FAMDL/SROX: else if (itype.eq.23) then call fgong_osc (afileout,xin,ndimin,xdata1in,aheaderin) else if (itype.eq.24.or.itype.eq.25) then call fgong_amdl (itype,afileout,xin,ndimin,xdata1in,aheaderin) else if (itype.eq.26) then call fgong_srox (afileout,xin,ndimin,xdata1in) c c --- From OSC to FGONG/AMDL/FAMDL/SROX: else if (itype.eq.32) then call osc_fgong (afileout,xin,ndimin,xdata1in,aheaderin) else if (itype.eq.34.or.itype.eq.35) then call osc_amdl (itype,afileout,xin,ndimin,xdata1in) else if (itype.eq.36) then call osc_srox (afileout,xin,ndimin,xdata1in) c c --- From AMDL/FAMDL to FAMDL/AMDL: else if (itype.eq.45) then call write_famdl (afileout,xin,ndimin,xdata1in) else if (itype.eq.54) then call write_amdl (afileout,xin,ndimin,xdata1in) c c --- From SROX to FGONG/AMDL/FAMDL: else if (itype.eq.62) then call srox_fgong (afilein,afileout,xin,ndimin,xdata1in,aheaderin) else if (itype.eq.64.or.itype.eq.65) then call srox_amdl (itype,afileout,xin,ndimin,xdata1in) endif c 1200 write (6,1000) end c***************************************************************************