Hi I have prepared two programs (fortran) that will generate ferret scripts which in turn will extract the desired data. I am attaching those alongwith. The description is provided below: argoext.f : This program generates a ferret script. You are required to put names of all the argo data files (yyyymmdd_prof.nc form) in a single file "list1" . This can be done using the command ls *_prof.nc > list1 So when you do "vi list1" it should be like this.. yyyymmdd_prof.nc yyyym'm'd'd'_prof.nc ...... ...... and so on ( as many as you have) Now compile argoext,f and run. This will generate a run script "ext1.jnl" Before executing this script in ferret, make a directory "ASC" in the place where you executed argoext Now run "ext1.jnl" using ferret -script ext1.jnl This will extract T/S profiles and locations of each profile in separate files in folder ASC , also it will extract the quality flags for pressure , temp and salinity in separate files in ASC folder Now there is second program "mer_flag.f" which will apply all the quality flags related to pressure , temperature and salinity and the write all the profiles in a single file in the following format Year Month Date Lat Lon Pressure Temp. Salinity Before running this just list all the files "yyyymmdd.dat" from ASC folder in "list". This can be done by using the following command in the ASC folder ls ????????.dat > list The list file should be like this yyyymmdd.dat yyyymmdd.dat ,................... so on Now copy this list file in the folder where you have your programs and then compile mer_flag.f and execute Th final output file will be "Argoyyyymmdd.dat". Any further queries or if i missed something and errors will be welcomed. Regards Neeraj Agarwal Scientist -SD MOG/RESA Space Applications Center ISRO, Ahmedabad -INDIA --- On Fri, 8/29/08, golla nageswararao <nag_ocean005@xxxxxxxxxxx> wrote: From: golla nageswararao <nag_ocean005@xxxxxxxxxxx> |
CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC C C A program that reads the ASCII files (for individual Argo profiles (T/S) C generated from ext.jnl and then applies the given quality flags and C writes each profile in a single file in the following format C C Year Month Day Latitude Longitude Pressure Temperature and salinity C C Coded By Neeraj Agarwal C MOG/SAC, C e-mail: neeraj@xxxxxxxxxxxxxxx, dabloo_99@xxxxxxxxx CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC character*50 infile character*1,allocatable::pflag(:),tflag(:),sflag(:) integer ilev(10000) real juld open(1,file='list',status='old') 1 format(a) 100 read(1,1,end=99)infile open(18,file='Argo'//trim(infile),status='unknown') open(3,file='ASC/'//trim(infile),status='old') open(2,file='ASC/'//infile(1:8)//'pos.dat' 1 ,status='old') open(8,file='ASC/'//infile(1:8)//'pqc.dat' 1 ,status='old') open(9,file='ASC/'//infile(1:8)//'tqc.dat' 1 ,status='old') open(10,file='ASC/'//infile(1:8)//'sqc.dat' 1 ,status='old') nn=0 102 read(2,*,end=101) nn=nn+1 goto 102 101 continue n=0 104 read(3,*,end=103) n=n+1 goto 104 103 continue nlev=n/nn 23 format(i4.4) 24 format(i2.2) 25 format(i2.2) rewind(2) rewind(3) read(infile(1:4),23)iyr read(infile(5:6),24)im read(infile(7:8),25)id ilev=0 do i=1,nn do j=1,nlev read(3,*)pres,temp,sal if(temp.lt.900)then ilev(i)=ilev(i)+1 endif enddo enddo rewind(3) do i =1,nn write(18,*)'****************Profile Number = 1',i,'******************' write(*,*)'****************Profile Number = 1',i,'******************' allocate (pflag(ilev(i))) allocate (tflag(ilev(i))) allocate (sflag(ilev(i))) read(2,*)juld,ala,alo read(8,7)(pflag(k),k=1,ilev(i)) read(9,7)(tflag(k),k=1,ilev(i)) read(10,7)(sflag(k),k=1,ilev(i)) do j =1,nlev read(3,*)pres,temp,sal if(temp.lt.900.and.pflag(j).eq. 1 '1'.and.tflag(j).eq.'1'.and. 1 sflag(j).eq.'1') 1 write(18,8)id,im,iyr, 1 ala,alo,pres,temp,sal enddo deallocate (pflag,tflag,sflag) enddo close(2) close(3) close(18) goto 100 7 format(10000a) 5 format(a,i20,i5,i5) 99 continue 8 format(3i6,5f12.3) end
CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC C C A program that generates a ferret script for extraction of ARGO floats C C The date and location are stored in a separate file (yyyymmddpos.dat), C T/S profiles in separate file (yyyymmdd.dat) and quality flags for C pressure, temperature and salinity in separate files C C Once executed it generates "ext.jnl" which on running in ferret creates C the above output in "ASC" folder (needs to be created) C C Coded by : Neeraj Agarwal C MOG/RESA C e-mail: neeraj@xxxxxxxxxxxxxxx, dabloo_99@xxxxxxxxx C CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC character*50 infile,infile1 open(1,file='list1',status='old') open(2,file='ext1.jnl',status='unknown') 1 format(a) 2 format(a,a,a) 3 format(a,a,a) 100 read(1,1,end=99)infile write(2,2)'use "'//trim(infile)//'"' write(2,3)'save/file="ASC/',trim(infile(1:8))//'pos.dat"', 1'/format=(f15.0,2f10.3)/noheader/clobber juld,latitude,longitude' write(2,3)'save/file="ASC/',trim(infile(1:8))//'.dat"', 1'/format=(f15.0,2f10.3)/noheader/clobber pres,temp,psal' write(2,3)'save/file="ASC/',trim(infile(1:8))//'pqc.dat"', 1'/format=(a)/noheader/clobber pres_qc' write(2,3)'save/file="ASC/',trim(infile(1:8))//'tqc.dat"', 1'/format=(a)/noheader/clobber temp_qc' write(2,3)'save/file="ASC/',trim(infile(1:8))//'sqc.dat"', 1'/format=(a)/noheader/clobber psal_qc' write(2,1)'can da/all' goto 100 99 continue end