Changeset ff050cd in flexpart.git for src_parallel/readcommand.f90


Ignore:
Timestamp:
Aug 15, 2013, 3:23:48 PM (11 years ago)
Author:
Harald Sodemann <harald.sodemann@…>
Branches:
flexpart91_hasod
Children:
31113de
Parents:
7c1fd44
Message:

ADD: namelist input implemented for all common input files

git-svn-id: http://flexpart.flexpart.eu:8088/svn/FlexPart90/branches/flexpart91_hasod@10 ef8cc7e1-21b7-489e-abab-c1baa636049d

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src_parallel/readcommand.f90

    r3eed2e6 rff050cd  
    2727  !                                                                            *
    2828  !     Author: A. Stohl                                                       *
    29   !                                                                            *
    3029  !     18 May 1996                                                            *
     30  !     HSO, 14 August 2013
     31  !     Added optional namelist input
    3132  !                                                                            *
    3233  !*****************************************************************************
     
    8384  integer :: readerror
    8485
     86  ! declaration of namelist
    8587  namelist /command/ &
    8688    ldirect, &
     
    9698    iout, &
    9799    ipout, &
     100    lnetcdfout, &
    98101    lsubgrid, &
    99102    lconvection, &
     
    109112    linit_cond
    110113
    111   ! Presetting namelist command
     114  ! Presetting the namelist command
    112115  ldirect=0
    113   ibdate=20000101
     116  ibdate=0
    114117  ibtime=0
    115   iedate=20000102
     118  iedate=0
    116119  ietime=0
    117120  loutstep=10800
     
    124127  iout=3
    125128  ipout=0
     129  lnetcdfout=0
    126130  lsubgrid=1
    127131  lconvection=1
     
    141145  !**************************************************************************
    142146  open(unitcommand,file=path(1)(1:length(1))//'COMMAND',status='old', &
    143          form='formatted',iostat=readerror)
    144   ! If fail, check if file does not exist
    145   if (readerror.ne.0) then
    146 
    147     print*,'***ERROR: file COMMAND not found. Check your pathnames file.'
    148     stop
    149 
    150   endif
    151 
     147         err=999)
     148
     149  ! try namelist input
    152150  read(unitcommand,command,iostat=readerror)
    153   close(unitcommand)
    154151
    155152  ! If error in namelist format, try to open with old input code
    156153  ! Failsafe detection with ldirect initial value change
    157   if ((readerror.ne.0).or.(ldirect.ne.0)) then
    158 
    159     open(unitcommand,file=path(1)(1:length(1))//'COMMAND',status='old', &
    160          err=999)
     154  if ((readerror.ne.0).or.(ldirect.eq.0)) then
     155
     156    rewind(unitcommand)
    161157
    162158    ! Check the format of the COMMAND file (either in free format,
     
    346342  endif
    347343
    348 !  check for netcdf output switch
    349   lncdfout = .false.
     344!  check for netcdf output switch (use for non-namelist input only!)
    350345  if (iout.ge.8) then
    351      lncdfout = .true.
     346     lnetcdfout = 1
    352347     iout = iout - 8
    353348#ifndef NETCDF_OUTPUT
    354      print*,'ERROR: netcdf output not activated during compile time'
     349     print*,'ERROR: netcdf output not activated during compile time but used in COMMAND file!'
    355350#endif
    356351  endif
Note: See TracChangeset for help on using the changeset viewer.
hosted by ZAMG