Commit df864e50 authored by Ignacio Pisso's avatar Ignacio Pisso
Browse files

printgrid.f90 modified, built and test run in njord

parent 224b5d6a
......@@ -26,7 +26,8 @@
character(250) :: filegrid
logical :: sp_zer
logical :: debug=.FALSE.
real :: sizegrid_m
real :: sum_grid, sum_sum_grid
real :: max_grid, max_max_grid
......@@ -44,8 +45,19 @@
grid_magnitude='pptv'
dirnameisarg= .FALSE.
print*, iargc()
if (debug) then
print*, 'iargc', iargc()
endif
select case (iargc())
case (3)
debug=.TRUE.
dirnameisarg= .TRUE.
call getarg(1,dirname)
len=index(dirname,' ')-1
call getarg(2,grid_magnitude)
case (2)
dirnameisarg= .TRUE.
call getarg(1,dirname)
......@@ -56,8 +68,10 @@
case (0)
grid_magnitude='time'
end select
if (debug) then
print*, grid_magnitude
endif
if ( .NOT. dirnameisarg) then
!******************
print*, " Read CONTROL file "
......@@ -84,27 +98,32 @@
loutstep,maxspec,nspec,maxageclass,nageclass,lage,ireleasestart, &
ireleaseend,maxpoint,numpoint,xpoint,ypoint,zpoint1,zpoint2, &
heightnn,area)
!write(*,*) 'nspec',nspec
write(*,*) 'simulation starts ', ibdate,ibtime
write(*,*) 'releases:'
if (debug) then
!write(*,*) 'nspec',nspec
write(*,*) 'simulation starts ', ibdate,ibtime
write(*,*) 'releases:'
endif
julstart=juldate(ibdate,ibtime)
do 30 k=1,nspec
jul=julstart+dble(float(ireleaseend(k))/86400.)
call caldate(jul,ireldate(k),ireltime(k))
! print*,'ireldate',ireldate(k)
! print*,'ireltime',ireltime(k)
if (debug) then
print*, k, 'ireldate, ireltime',ireldate(k), ireltime(k)
endif
call caldate(julstart+dble(float(ireleasestart(k))/86400.) &
,irelds,irelts)
if (debug) then
print*, k,irelds,irelts
print*, k,xpoint(k),ypoint(k),zpoint1(k),zpoint2(k)
!print*, k,irelds,irelts
endif
30 END DO
! rint*, 'init sizegrid_m=', sizegrid_m !=0
......@@ -117,7 +136,10 @@
!******************************************
! Loop about all times, given in file dates
!******************************************
print*,'> open dates'
if (debug) then
print*,'> open dates'
endif
open(20,file=dirname(1:len)//'dates',form='formatted', &
status='old')
it=0
......@@ -125,9 +147,11 @@
write(aday,'(i8.8)') inday
write(atime,'(i6.6)') intime
it=it+1
if (debug) then
! print*, 'it, aday, atime', it, aday, atime
print*, 'i, day, time', it, inday, intime
endif
if (mother_or_nest == 1) then
......@@ -162,13 +186,18 @@
sum_grid=sum(grid)
max_grid=maxval(grid)
print*, 'max, sum ', max_grid, sum_grid
if (debug) then
print*, 'max, sum ', max_grid, sum_grid
endif
max_max_grid=max(max_max_grid,max_grid)
sum_sum_grid=sum_sum_grid+sum_grid
! print*, 'max_max_grid,max_grid', max_max_grid, max_grid
print*, 'max_max_grid,sum_sum_grid', max_max_grid, sum_sum_grid
print*,
if (debug) then
print*, 'max_max_grid,sum_sum_grid', max_max_grid, sum_sum_grid
print*,
endif
! print*, 'sum_grid=',sum_grid !sum(grid)
! print*, 'max_grid=', max_grid ! maxval(grid)
! print*, 'part total', it, aday, atime
......@@ -241,9 +270,11 @@
goto 100 !read dates
99 close(20)
if (0 == 1) then
! relic
! Dump time-integrated footprint
!*******************************
if (0 == 1) then
if (mother_or_nest == 1) then
fileout=dirname(1:len)//'footprint_total'//'_001'
else
......@@ -304,10 +335,15 @@
! ax_max_grid=max(max_max_grid,max_grid)
! um_sum_grid=sum_sum_grid+sum_grid
if (debug) then
print*, 'for all times'
print*, 'sum sum(grid)=', sum_sum_grid
print*, 'max maxval(grid)=', max_max_grid
endif
!if (debug) then
print*, 'max:', max_max_grid, 'sum:', sum_sum_grid
! print*, 'sum_sum_grid_out=',sum_sum_grid
! print*, 'max_max_grid_out=',max_max_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