Ignore:
Timestamp:
Jul 3, 2014, 2:55:50 PM (8 years ago)
Author:
hasod
Message:
  • Implemented optional namelist input for COMMAND, RELEASES, SPECIES, AGECLASSES,OUTGRID,OUTGRID_NEST,RECEPTORS
  • Implemented com_mod switch nmlout to write input files as namelist to the output directory (.true. by default)
  • Proposed updated startup and runtime output (may change back to previous info if desired)
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/readoutgrid_nest.f90

    r4 r27  
    5353  real,parameter :: eps=1.e-4
    5454
     55  integer :: readerror
    5556
     57  ! declare namelist
     58  namelist /outgridn/ &
     59    outlon0n,outlat0n, &
     60    numxgridn,numygridn, &
     61    dxoutn,dyoutn
     62
     63  ! helps identifying failed namelist input
     64  dxoutn=-1.0
    5665
    5766  ! Open the OUTGRID file and read output grid specifications
    5867  !**********************************************************
    5968
    60   open(unitoutgrid,file=path(1)(1:length(1))//'OUTGRID_NEST', &
    61        status='old',err=999)
     69  open(unitoutgrid,file=path(1)(1:length(1))//'OUTGRID_NEST',form='formatted',status='old',err=999)
    6270
     71  ! try namelist input
     72  read(unitoutgrid,outgridn,iostat=readerror)
     73  close(unitoutgrid)
    6374
    64   call skplin(5,unitoutgrid)
     75  if ((dxoutn.le.0).or.(readerror.ne.0)) then
    6576
     77    open(unitoutgrid,file=path(1)(1:length(1))//'OUTGRID_NEST',status='old',err=999)
     78    call skplin(5,unitoutgrid)
    6679
    67   ! 1.  Read horizontal grid specifications
    68   !****************************************
     80    ! 1.  Read horizontal grid specifications
     81    !****************************************
    6982
    70   call skplin(3,unitoutgrid)
    71   read(unitoutgrid,'(4x,f11.4)') outlon0n
    72   call skplin(3,unitoutgrid)
    73   read(unitoutgrid,'(4x,f11.4)') outlat0n
    74   call skplin(3,unitoutgrid)
    75   read(unitoutgrid,'(4x,i5)') numxgridn
    76   call skplin(3,unitoutgrid)
    77   read(unitoutgrid,'(4x,i5)') numygridn
    78   call skplin(3,unitoutgrid)
    79   read(unitoutgrid,'(4x,f12.5)') dxoutn
    80   call skplin(3,unitoutgrid)
    81   read(unitoutgrid,'(4x,f12.5)') dyoutn
     83    call skplin(3,unitoutgrid)
     84    read(unitoutgrid,'(4x,f11.4)') outlon0n
     85    call skplin(3,unitoutgrid)
     86    read(unitoutgrid,'(4x,f11.4)') outlat0n
     87    call skplin(3,unitoutgrid)
     88    read(unitoutgrid,'(4x,i5)') numxgridn
     89    call skplin(3,unitoutgrid)
     90    read(unitoutgrid,'(4x,i5)') numygridn
     91    call skplin(3,unitoutgrid)
     92    read(unitoutgrid,'(4x,f12.5)') dxoutn
     93    call skplin(3,unitoutgrid)
     94    read(unitoutgrid,'(4x,f12.5)') dyoutn
    8295
     96    close(unitoutgrid)
     97  endif
    8398
    84     allocate(orooutn(0:numxgridn-1,0:numygridn-1) &
    85          ,stat=stat)
    86     if (stat.ne.0) write(*,*)'ERROR: could not allocate outh'
    87     allocate(arean(0:numxgridn-1,0:numygridn-1) &
    88          ,stat=stat)
    89     if (stat.ne.0) write(*,*)'ERROR: could not allocate outh'
    90     allocate(volumen(0:numxgridn-1,0:numygridn-1,numzgrid) &
    91          ,stat=stat)
    92     if (stat.ne.0) write(*,*)'ERROR: could not allocate outh'
     99  ! write outgrid_nest file in namelist format to output directory if requested
     100  if (nmlout.eqv..true.) then
     101    open(unitoutgrid,file=path(2)(1:length(2))//'OUTGRID_NEST.namelist',err=1000)
     102    write(unitoutgrid,nml=outgridn)
     103    close(unitoutgrid)
     104  endif
     105
     106  allocate(orooutn(0:numxgridn-1,0:numygridn-1),stat=stat)
     107  if (stat.ne.0) write(*,*)'ERROR: could not allocate orooutn'
     108  allocate(arean(0:numxgridn-1,0:numygridn-1),stat=stat)
     109  if (stat.ne.0) write(*,*)'ERROR: could not allocate arean'
     110  allocate(volumen(0:numxgridn-1,0:numygridn-1,numzgrid),stat=stat)
     111  if (stat.ne.0) write(*,*)'ERROR: could not allocate volumen'
    93112
    94113  ! Check validity of output grid (shall be within model domain)
     
    110129  xoutshiftn=xlon0-outlon0n
    111130  youtshiftn=ylat0-outlat0n
    112   close(unitoutgrid)
    113131  return
    114132
     133999 write(*,*) ' #### FLEXPART MODEL ERROR! FILE "OUTGRID"    #### '
     134  write(*,*) ' #### CANNOT BE OPENED IN THE DIRECTORY       #### '
     135  write(*,'(a)') path(1)(1:length(1))
     136  stop
    115137
    116 999   write(*,*) ' #### FLEXPART MODEL ERROR! FILE OUTGRID_NEST #### '
     1381000 write(*,*) ' #### FLEXPART MODEL ERROR! FILE "OUTGRID"    #### '
    117139  write(*,*) ' #### CANNOT BE OPENED IN THE DIRECTORY       #### '
    118   write(*,*) ' #### xxx/flexpart/options                    #### '
     140  write(*,'(a)') path(2)(1:length(2))
    119141  stop
    120142
Note: See TracChangeset for help on using the changeset viewer.
hosted by ZAMG