Changeset 414a5e5 in flexpart.git for src/FLEXPART.f90


Ignore:
Timestamp:
Mar 1, 2015, 4:26:40 PM (5 years ago)
Author:
Ignacio Pisso <Ignacio.Pisso@…>
Branches:
master, FPv9.3.1, FPv9.3.1b_testing, FPv9.3.2, dev, fp9.3.1-20161214-nc4, grib2nc4_repair, release-10, univie
Children:
4ba50e6
Parents:
6470a47
git-author:
Ignacio Pisso <Ignacio.Pisso@…> (03/01/15 16:12:39)
git-committer:
Ignacio Pisso <Ignacio.Pisso@…> (03/01/15 16:26:40)
Message:

add verbose message to FLEXPART.f90

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/FLEXPART.f90

    rb4d29ce r414a5e5  
    5050  integer :: idummy = -320
    5151  character(len=256) :: inline_options  !pathfile, flexversion, arg2
    52 
     52  integer :: index_v
    5353
    5454  ! Generate a large number of random numbers
     
    6161
    6262  ! FLEXPART version string
    63   flexversion='Version 9.2 beta (2014-07-01)'
    64   verbosity=0
    65 
     63  ! flexversion='Version 9.2 beta (2014-07-01)'
     64  flexversion='Version 9.2.0.1 (2015-01-27)'
     65  ! default inlide options
     66  inline_options='none'
     67  !verbosity flags  defined in com_mod.f90
     68 
    6669  ! Read the pathnames where input/output files are stored
    6770  !*******************************************************
    6871
    69   inline_options='none'
    7072  select case (iargc())
    71   case (2)
     73  case (2) !2 parameters: pathfile and inline options
    7274    call getarg(1,arg1)
    7375    pathfile=arg1
    7476    call getarg(2,arg2)
    7577    inline_options=arg2
    76   case (1)
     78  case (1) !1 parameter pathfiel or inline options
    7779    call getarg(1,arg1)
    7880    pathfile=arg1
     
    8183      inline_options=arg1
    8284    endif
    83   case (0)
     85  case (0) !default behavior
    8486    write(pathfile,'(a11)') './pathnames'
    8587  end select
     
    8991  print*,'Welcome to FLEXPART ', trim(flexversion)
    9092  print*,'FLEXPART is free software released under the GNU General Public License.'
     93
     94  ! inline options allow to fine tune the verbosity during run time
     95  ! e.g.: show compilation parameters or input variables, time execution     
     96  if (inline_options(1:1).eq.'-') then
     97   ! if (index(inline_options,'v').gt.0) then
     98   !    print*, 'verbose mode'
     99   !    verbosity=1
     100   !    index_v=index(inline_options,'v')
     101   !    if (inline_options(index_v+1:index_v+1).eq.'2') then
     102   !    verbosity=2
     103   !    endif         
     104   ! endif   
    91105 
    92   if (inline_options(1:1).eq.'-') then
    93     if (trim(inline_options).eq.'-v'.or.trim(inline_options).eq.'-v1') then
    94        print*, 'Verbose mode 1: display detailed information during run'
     106    !if (trim(inline_options).eq.'-v'.or.trim(inline_options).eq.'-v1') then
     107    if (index(inline_options,'v').gt.0) then
     108       index_v=index(inline_options,'v')
     109       print*, 'Verbose mode: display  additional information during run'
    95110       verbosity=1
    96     endif
    97     if (trim(inline_options).eq.'-v2') then
    98        print*, 'Verbose mode 2: display more detailed information during run'
     111       if (inline_options(index_v+1:index_v+1).eq.'2') then
    99112       verbosity=2
    100     endif
    101     if (trim(inline_options).eq.'-i') then
    102        print*, 'Info mode: provide detailed run specific information and stop'
     113       endif
     114       print*, 'verbosity level=', verbosity !inline_options(index_v+1:index_v+1)
     115             
     116    endif
     117    !iif (trim(inline_options).eq.'-v2') then
     118    !   print*, 'Verbose mode 2: display more detailed information during run'
     119    !   verbosity=2
     120    !endif
     121
     122    if (index(inline_options,'i').gt.0) then   
     123    !if (trim(inline_options).eq.'-i') then
     124       index_v=index(inline_options,'i')
     125       print*, 'Info mode: provide run specific information and stop'
    103126       verbosity=1
    104127       info_flag=1
    105     endif
    106     if (trim(inline_options).eq.'-i2') then
    107        print*, 'Info mode: provide more detailed run specific information and stop'
    108        verbosity=2
    109        info_flag=1
    110     endif
     128       !if (trim(inline_options).eq.'-i2') then
     129       if (inline_options(index_v+1:index_v+1).eq.'2') then
     130           print*, 'Including input files'
     131       !   verbosity=1
     132       info_flag=2
     133       endif
     134    endif
     135    !if (trim(inline_options).eq.'-i2') then
     136    !   print*, 'Info mode: provide more detailed run specific information and stop'
     137    !   verbosity=1
     138    !   info_flag=2
     139    !endif
     140    if (index(inline_options,'t').gt.0) then
     141       time_flag=1
     142       print*, 'timing execution: not implemented'
     143       !stop
     144    endif
     145    if (index(inline_options,'d').gt.0) then
     146       debug_flag=1
     147       print*, 'debug: not implemented'
     148       print*, 'debug_flag=', debug_flag
     149       !stop
     150    endif
    111151  endif
    112152           
    113153  if (verbosity.gt.0) then
     154    print*, 'FLEXPART>******************************'
     155    print*, 'FLEXPART>* verbosity level:', verbosity
     156    print*, 'FLEXPART>* info only:      ', info_flag
     157    print*, 'FLEXPART>* time execution: ', time_flag
     158    print*, 'FLEXPART>******************************'
     159   
     160    print*, 'FLEXPART> parameters from par_mod'   
     161    print*, 'FLEXPART> nxmax=  ', nxmax
     162    print*, 'FLEXPART> nymax=  ', nymax
     163    print*, 'FLEXPART> nuvzmax=', nuvzmax
     164    print*, 'FLEXPART> nwzmax= ', nwzmax
     165    print*, 'FLEXPART> nzmax=  ', nzmax
     166    print*, 'FLEXPART> nxshift=', nxshift
     167    print*, 'FLEXPART> maxpart=', maxpart
     168    print*, 'FLEXPART> maxspec=', maxspec
     169
     170    if (info_flag.eq.1) stop
    114171    write(*,*) 'call readpaths'
    115172  endif
    116173  call readpaths(pathfile)
    117174 
    118   if (verbosity.gt.1) then !show clock info
    119      !print*,'length(4)',length(4)
     175  !if (time_flag.gt.1) then !show clock info
    120176     !count=0,count_rate=1000
    121      CALL SYSTEM_CLOCK(count_clock0, count_rate, count_max)
     177  CALL SYSTEM_CLOCK(count_clock0, count_rate, count_max)
    122178     !WRITE(*,*) 'SYSTEM_CLOCK',count, count_rate, count_max
    123179     !WRITE(*,*) 'SYSTEM_CLOCK, count_clock0', count_clock0
    124180     !WRITE(*,*) 'SYSTEM_CLOCK, count_rate', count_rate
    125181     !WRITE(*,*) 'SYSTEM_CLOCK, count_max', count_max
    126   endif
     182  !endif
    127183
    128184  ! Read the user specifications for the current model run
     
    134190  call readcommand
    135191  if (verbosity.gt.0) then
    136     write(*,*) '    ldirect=', ldirect
    137     write(*,*) '    ibdate,ibtime=',ibdate,ibtime
     192    write(*,*) '    ldirect      =', ldirect
     193    write(*,*) '    ibdate,ibtime=', ibdate,ibtime
    138194    write(*,*) '    iedate,ietime=', iedate,ietime
    139     if (verbosity.gt.1) then   
     195  endif
     196    if (time_flag.gt.0) then   
    140197      CALL SYSTEM_CLOCK(count_clock, count_rate, count_max)
    141198      write(*,*) 'SYSTEM_CLOCK',(count_clock - count_clock0)/real(count_rate) !, count_rate, count_max
    142199    endif     
    143   endif
    144200
    145201  ! Read the age classes to be used
     
    150206  call readageclasses
    151207
    152   if (verbosity.gt.1) then   
     208  if (time_flag.gt.1) then   
    153209    CALL SYSTEM_CLOCK(count_clock, count_rate, count_max)
    154210    write(*,*) 'SYSTEM_CLOCK',(count_clock - count_clock0)/real(count_rate) !, count_rate, count_max
     
    168224 
    169225  if (verbosity.gt.0) then
    170      write(*,*) 'call gridcheck'
    171   endif
    172 
     226     write(*,*) 'FLEXPART> call gridcheck'
     227  endif
    173228  call gridcheck
    174229
    175   if (verbosity.gt.1) then   
     230  if (time_flag.gt.0) then   
    176231    CALL SYSTEM_CLOCK(count_clock, count_rate, count_max)
    177232    write(*,*) 'SYSTEM_CLOCK',(count_clock - count_clock0)/real(count_rate) !, count_rate, count_max
     
    187242
    188243  if (verbosity.gt.0) then
    189     write(*,*) 'call readoutgrid'
     244    write(*,*) 'FLEXPART> call readoutgrid'
    190245  endif
    191246
     
    195250    call readoutgrid_nest
    196251    if (verbosity.gt.0) then
    197       write(*,*) '# readoutgrid_nest'
     252      write(*,*) 'FLEXPART> readoutgrid_nest'
    198253    endif
    199254  endif
     
    203258
    204259  if (verbosity.eq.1) then
    205      print*,'call readreceptors'
     260     print*,'FLEXPART> call readreceptors'
    206261  endif
    207262  call readreceptors
     
    217272
    218273  if (verbosity.gt.0) then
    219     print*,'call readlanduse'
     274    print*,'FLEXPART> call readlanduse'
    220275  endif
    221276  call readlanduse
     
    225280
    226281  if (verbosity.gt.0) then
    227     print*,'call assignland'
     282    print*,'FLEXPART> call assignland'
    228283  endif
    229284  call assignland
     
    233288
    234289  if (verbosity.gt.0) then
    235     print*,'call readreleases'
     290    print*,'FLEXPART> call readreleases'
    236291  endif
    237292  call readreleases
     
    273328  else
    274329    if (verbosity.gt.0) then
    275       print*,'numpart=0, numparticlecount=0'
     330      print*,'set numpart=0, numparticlecount=0'
    276331    endif   
    277332    numpart=0
     
    308363
    309364  call writeheader
    310   ! FLEXPART 9.2 ticket ?? write header in ASCII format
     365  ! write header in ASCII format
    311366  call writeheader_txt
    312367  !if (nested_output.eq.1) call writeheader_nest
     
    357412  !********************************
    358413
    359   if (verbosity.gt.0) then
    360      if (verbosity.gt.1) then   
    361        CALL SYSTEM_CLOCK(count_clock, count_rate, count_max)
    362        write(*,*) 'SYSTEM_CLOCK',(count_clock - count_clock0)/real(count_rate) !, count_rate, count_max
    363      endif
    364      if (info_flag.eq.1) then
    365        print*, 'info only mode (stop)'   
    366        stop
    367      endif
     414  if (time_flag.gt.0) then   
     415    CALL SYSTEM_CLOCK(count_clock, count_rate, count_max)
     416    write(*,*) 'SYSTEM_CLOCK',(count_clock - count_clock0)/real(count_rate) !, count_rate, count_max
     417  endif
     418  if (info_flag.eq.2) then
     419    print*, 'info only mode (stop before call timemanager)'
     420    stop
     421  endif
     422  if (verbosity.gt.0) then
    368423     print*,'call timemanager'
    369424  endif
Note: See TracChangeset for help on using the changeset viewer.
hosted by ZAMG