Commit 151589be authored by Ignacio Pisso's avatar Ignacio Pisso
Browse files

update already added readheader*

parent 2b1b54e3
......@@ -13,17 +13,31 @@
real xpoint(maxpoint),ypoint(maxpoint),zpoint1(maxpoint)
real zpoint2(maxpoint),xmass(maxpoint,maxspec)
real oro(nxmax,nymax),area(nxmax,nymax)
logical debug
debug=.FALSE.
open(10,file=filename,form='unformatted',status='old')
read(10) ibdate,ibtime
if (debug) then
write(*,*) ibdate,ibtime
endif
read(10) loutstep,loutaver,loutsample
read(10) outlon0,outlat0,numxgrid,numygrid,dxout,dyout
if (debug) then
write(*,*) outlon0,outlat0,numxgrid,numygrid,dxout,dyout
endif
read(10) numzgrid,(outheight(i),i=1,numzgrid)
read(10) jjjjmmdd,ihmmss
if (debug) then
write(*,*) jjjjmmdd,ihmss
endif
read(10) nspec
nspec=nspec/3
do 8 n=1,nspec
......@@ -46,15 +60,19 @@
read(10) method
read(10) nageclass,(lage(i),i=1,nageclass)
lage(0)=0
write(*,*) (lage(i),i=0,nageclass)
if (debug) then
write(*,*) (lage(i),i=0,nageclass)
endif
do 130 ix=1,numxgrid
130 read(10) (oro(ix,jy),jy=1,numygrid)
close(10)
if (debug) then
write(*,*) (outheight(i),i=1,numzgrid)
endif
if (loutstep.lt.0) nspec=numpoint
......
subroutine readheader10f(filename,nxmax,numxgrid,nymax,numygrid, &
nzmax,numzgrid,outlon0,outlat0,dxout,dyout,outheight,ibdate, &
subroutine readheader10f(filename, &
nxmax,numxgrid,nymax,numygrid,nzmax,numzgrid, &
outlon0,outlat0,dxout,dyout,outheight,ibdate, &
ibtime,loutstep,maxspec,nspec,maxageclass,nageclass,lage, &
ireleasestart,ireleaseend,maxpoint,numpoint,xpoint,ypoint, &
zpoint1,zpoint2,heightnn,area)
......@@ -16,52 +17,115 @@
real :: oro(nxmax,nymax),area(nxmax,nymax)
character(len=256) :: pathfile, flexversion
integer :: verbosity
verbosity=1
if (verbosity.gt.0) then
print*,'subroutine readheader10f'
print*,'! Open header output file: ', filename
endif
if (verbosity.gt.0) then
print*,'intent in:'
print*,'nxmax=', nxmax
print*,'nymax=', nymax
print*,'nzmax=', nzmax
endif
open(10,file=filename,form='unformatted',status='old')
! 76
print*,'ibdate,ibtime fwd. iedate,ietime bwd'
if (verbosity.gt.0) then
print*,'! Open header output file: '
print*, '**********************************************'
print*, filename
endif
read(10) ibdate,ibtime, flexversion
if (verbosity.gt.0) then
write(*,*) '! Write the header information'
print*, '**********************************************'
print*,'(ibdate,ibtime if fwd. -- iedate,ietime if bwd.)'
write(*,*) 'date,time=',ibdate,ibtime
print*, 'flexversion=',flexversion
print*,'finfo on output interval, averaging time, sampling time'
endif
! 85
read(10) loutstep,loutaver,loutsample
if (verbosity.gt.0) then
print*,' info on output interval, averaging time, sampling time'
print*, '**********************************************'
print*,'loutstep, aver, sample=',loutstep,loutaver,loutsample
endif
print*, 'information on output grid setup'
!87
read(10) outlon0,outlat0,numxgrid,numygrid,dxout,dyout
if (verbosity.gt.0) then
print*, 'information on output grid setup'
print*, '**********************************************'
write(*,*) 'outlon0,outlat0,numxgrid,numygrid,dxout,dyout'
write(*,*) outlon0,outlat0,numxgrid,numygrid,dxout,dyout
endif
read(10) numzgrid,(outheight(i),i=1,numzgrid)
if (verbosity.gt.0) then
write(*,*) 'numzgrid=', numzgrid
write(*,*) 'outheight=', outheight
! write(*,*) 'outheight=', outheight
print*,'outheight='
do i=1,numzgrid
print*, i, outheight(i)
end do
endif
read(10) jjjjmmdd,ihmmss
if (verbosity.gt.0) then
write(*,*) 'jjjjmmdd,ihmmss=',jjjjmmdd,ihmss
endif
! Write number of species, and name for each species (+extra name for depositions)
! Indicate the dimension of the fields (i.e., 1 for deposition fields, numzgrid for
! concentration fields
!*****************************************************************************
if (verbosity.gt.0) then
print*, 'information on species'
print*, '**********************************************'
endif
! 102 3*nspec,maxpointspec_act implicit?
read(10) nspec, maxpointspec_act
if (verbosity.gt.0) then
print*,'3*nspec,maxpointspec_act=',nspec,maxpointspec_act
endif
nspec=nspec/3
do 8 n=1,nspec
read(10) numzgrid,species(n)
if (verbosity.gt.0) then
print*,'numzgrid,species(n)',numzgrid,species(n)
endif
read(10) numzgrid,species(n)
if (verbosity.gt.0) then
print*,'numzgrid,species(n)',numzgrid,species(n)
endif
read(10) numzgrid,species(n)
if (verbosity.gt.0) then
print*,'numzgrid,species(n)',numzgrid,species(n)
endif
8 END DO
if (verbosity.gt.0) then
print*, 'information on release points:'
print*, '**********************************************'
endif
read(10) numpoint !l113
if (verbosity.gt.0) then
print*,'numpoint=',numpoint
endif
do 13 i=1,numpoint
read(10) ireleasestart(i),ireleaseend(i)
......@@ -73,42 +137,72 @@
read(10)
read(10) xmass(i,j)
13 END DO
if (verbosity.gt.0) then
print*,'! Write information on some model switches'
print*, '**********************************************'
endif
read(10) method,lsubgrid,lconvection,ind_source,ind_receptor
if (verbosity.gt.0) then
print*,'method,lsubgrid,lconvection,ind_source,ind_receptor'
print*,method,lsubgrid,lconvection,ind_source,ind_receptor
endif
print*,'!Write age class information'
! Write age class information
!****************************
read(10) nageclass,(lage(i),i=1,nageclass)
lage(0)=0
if (verbosity.gt.0) then
print*,'!Write age class information'
print*, '**********************************************'
endif
if (verbosity.gt.0) then
print*,'nageclass=',nageclass
write(*,*) 'lage(0:nageclass)=', (lage(i),i=0,nageclass)
endif
! Write topography to output file
!********************************
print*,'!Write topography to output file'
do 130 ix=1,numxgrid
read(10) (oro(ix,jy),jy=1,numygrid)
130 END DO
if (verbosity.gt.0) then
print*,'!Write topography to output file'
print*, '**********************************************'
print*,'(oro(ix,jy)'
print*,'numxgrid,numygrid=',numxgrid,numygrid
print*,'nxmax,nymax=',nxmax,nymax
endif
close(10)
! rite(*,*) (outheight(i),i=1,numzgrid)
! f (loutstep.lt.0) nspec=numpoint
if (verbosity.gt.0) then
print*,' !if (loutstep < 0) nspec=numpoint'
print*,'outheight(0)=0. ???'
print*,'c Calculate height, which is outheight plus topography'
endif
! Calculate height, which is outheight plus topography
!*****************************************************
if (verbosity.gt.0) then
print*,'Calculate height, which is outheight plus topography'
print*, '**********************************************'
endif
do 150 ix=1,numxgrid
do 150 jy=1,numygrid
if (ltopo == 1) then
......@@ -124,7 +218,9 @@
endif
150 END DO
if (verbosity.gt.0) then
print*,'C Determine area of each output grid box'
endif
! Determine area of each output grid box
!***************************************
......@@ -151,6 +247,7 @@
do 140 ix=1,numxgrid
area(ix,jy)=gridarea
140 END DO
if (verbosity.gt.0) then
print*,'end subroutine readheader10f'
endif
end subroutine readheader10f
......@@ -45,20 +45,22 @@
len=index(dirname,' ')-1
call getarg(2,grid_magnitude)
case (1)
call getarg(1,grid_magnitude)
call getarg(1,dirname)
len=index(dirname,' ')-1
!call getarg(1,grid_magnitude)
case (0)
grid_magnitude='time'
end select
print*, 'grid_magnitude=', grid_magnitude
if ( .NOT. dirnameisarg) then
! if ( .NOT. dirnameisarg) then
! !******************
! print*, " Read CONTROL file "
!******************
print*, " Read CONTROL file "
!******************
open(15,file='dirlist')
200 read(15,'(a)',end=199) dirname
len=index(dirname,' ')-1
endif
! open(15,file='dirlist')
! 200 read(15,'(a)',end=199) dirname
! len=index(dirname,' ')-1
! endif
! do 50 mother_or_nest=1,2
do 50 mother_or_nest=1,1
......@@ -93,20 +95,64 @@
print*,'! Write topography to output file'
print*,'filename,nxmax,numxgrid,nymax,numygrid,nzmax='
print*,filename,nxmax,numxgrid,nymax,numygrid,nzmax
! rint*,'numzgrid,outlon0,outlat0,dxout,dyout,outheight,ibdate,ibtime'
! rint*,numzgrid,outlon0,outlat0,dxout,dyout,outheight,ibdate,ibtime
print*,''
print*,'filename'
print*,
print*,'nxmax,numxgrid,nymax,numygrid='
print*,filename,nxmax,numxgrid,nymax,numygrid
print*,'nzmax, numzgrid='
print*,nzmax,numzgrid
print*,'outlon0,outlat0,dxout,dyout,'
print*,outlon0,outlat0,dxout,dyout
print*,' outheight='
do i=1,numzgrid
print*, i, outheight(i)
end do
print*, 'ibdate,ibtime, loutstep'
print*, ibdate,ibtime, loutstep
! ,,,ireleasestart, &
! ireleaseend,maxpoint,numpoint,xpoint,ypoint,zpoint1,zpoint2, &
! heightnn,area)
print*,'maxspec,nspec'
print*,maxspec,nspec
! rint*,
print*,''
print*,'maxageclass,nageclass'
print*, maxageclass,nageclass
! rint*,
print*,''
print*,'lage'
print*, lage
print*,'ireleasestart, ireleaseend,'
print*, ireleasestart, ireleaseend
print*,'maxpoint,numpoint'
print*, maxpoint,numpoint
print*,'xpoint,ypoint'
print*, xpoint,ypoint
print*,'zpoint1,zpoint2'
print*, zpoint1,zpoint2
print*,'heightnn'
print*, size(heightnn)
! print*,'xpoint,ypoint,zpoint1,zpoint2,'
! print*, xpoint,ypoint,zpoint1,zpoint2
! rint*,
write(*,*) 'nspec',nspec
julstart=juldate(ibdate,ibtime)
do 30 k=1,nspec
print*, 'k', k
jul=julstart+dble(float(ireleaseend(k))/86400.)
call caldate(jul,ireldate(k),ireltime(k))
print*,'ireldate',ireldate(k)
......@@ -114,15 +160,16 @@
30 END DO
! print*, 'about to exit'
! exit
50 END DO
if ( .NOT. dirnameisarg) then
goto 200 !read(15, dirlist
199 close(15) !dirlist
endif
! if ( .NOT. dirnameisarg) then
! goto 200 !read(15, dirlist
! 199 close(15) !dirlist
! endif
! ax_max_grid=max(max_max_grid,max_grid)
! um_sum_grid=sum_sum_grid+sum_grid
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment