Changes from branches/petra/src/readcommand.f90 at r36 to trunk/src/readcommand.f90 at r30
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/readcommand.f90
r36 r30 1 1 !********************************************************************** 2 ! Copyright 1998 -2015*2 ! Copyright 1998,1999,2000,2001,2002,2005,2007,2008,2009,2010 * 3 3 ! Andreas Stohl, Petra Seibert, A. Frank, Gerhard Wotawa, * 4 4 ! Caroline Forster, Sabine Eckhardt, John Burkhart, Harald Sodemann * … … 29 29 ! * 30 30 ! 18 May 1996 * 31 ! 32 ! HSO, 1 July 2014: Added optional namelist input 33 ! PS 2/2015: add ldep_incr as optional command input 34 ! make new parameters (last 3) optional for bwd compatibility 31 ! HSO, 1 July 2014 * 32 ! Added optional namelist input * 35 33 ! * 36 34 !***************************************************************************** … … 71 69 ! mdomainfill 1 use domain-filling option, 0 not, 2 use strat. O3 * 72 70 ! * 73 ! ldep_incr .true. for incremental,74 ! .false. for accumulated deposition output (DEFAULT)75 71 ! Constants: * 76 72 ! unitcommand unit connected to file COMMAND * … … 83 79 implicit none 84 80 85 real 86 character 81 real(kind=dp) :: juldate 82 character(len=50) :: line 87 83 logical :: old 88 integer :: ireaderror, icmdstat84 integer :: readerror 89 85 90 86 namelist /command/ & … … 114 110 linit_cond, & 115 111 lnetcdfout, & 116 surf_only, & 117 ldep_incr 118 119 ! Set default values for namelist command 120 ldirect = 0 121 ibdate = 20000101 122 ibtime = 0 123 iedate = 20000102 124 ietime = 0 125 loutstep = 10800 126 loutaver = 10800 127 loutsample = 900 128 itsplit = 999999999 129 lsynctime = 900 130 ctl = -5.0 131 ifine = 4 132 iout = 3 133 ipout = 0 134 lsubgrid = 1 135 lconvection = 1 136 lagespectra = 0 137 ipin = 1 138 ioutputforeachrelease = 1 139 iflux = 1 140 mdomainfill = 0 141 ind_source = 1 142 ind_receptor = 1 143 mquasilag = 0 144 nested_output = 0 145 linit_cond = 0 146 lnetcdfout = 0 147 surf_only = 0 148 ldep_incr = .false. 112 surf_only 113 114 ! Presetting namelist command 115 ldirect=0 116 ibdate=20000101 117 ibtime=0 118 iedate=20000102 119 ietime=0 120 loutstep=10800 121 loutaver=10800 122 loutsample=900 123 itsplit=999999999 124 lsynctime=900 125 ctl=-5.0 126 ifine=4 127 iout=3 128 ipout=0 129 lsubgrid=1 130 lconvection=1 131 lagespectra=0 132 ipin=1 133 ioutputforeachrelease=1 134 iflux=1 135 mdomainfill=0 136 ind_source=1 137 ind_receptor=1 138 mquasilag=0 139 nested_output=0 140 linit_cond=0 141 lnetcdfout=0 142 surf_only=0 149 143 150 144 ! Open the command file and read user options … … 154 148 155 149 ! try namelist input (default) 156 read(unitcommand,command,iostat= ireaderror)150 read(unitcommand,command,iostat=readerror) 157 151 close(unitcommand) 158 152 159 153 ! distinguish namelist from fixed text input 160 if ((ireaderror .ne. 0) .or. (ldirect .eq. 0)) then 161 162 ! parse as text file format 154 if ((readerror.ne.0).or.(ldirect.eq.0)) then ! parse as text file format 163 155 164 156 open(unitcommand,file=path(1)(1:length(1))//'COMMAND',status='old', err=999) … … 233 225 read(unitcommand,*) nested_output 234 226 if (old) call skplin(3,unitcommand) 235 read(unitcommand,*,iostat=icmdstat) linit_cond 236 if (icmdstat .gt. 0) & 237 print*, 'readcommand: linit_cond not read properly',icmdstat,linit_cond 238 if (old) call skplin(3,unitcommand) 239 read(unitcommand,*,iostat=icmdstat) surf_only 240 if (icmdstat .gt. 0) & 241 print*, 'readcommand: linit_cond not read properly',icmdstat,surf_only 242 if (old) call skplin(3,unitcommand) 243 read(unitcommand,*,iostat=icmdstat) ldep_incr 244 if (icmdstat .gt. 0) & 245 print*, 'readcommand: linit_cond not read properly',icmdstat, ldep_incr 227 read(unitcommand,*) linit_cond 228 if (old) call skplin(3,unitcommand) 229 read(unitcommand,*) surf_only 246 230 close(unitcommand) 247 231 … … 249 233 250 234 ! write command file in namelist format to output directory if requested 251 if (nmlout .eqv..true.) then235 if (nmlout.eqv..true.) then 252 236 open(unitcommand,file=path(2)(1:length(2))//'COMMAND.namelist',err=1000) 253 237 write(unitcommand,nml=command) … … 260 244 !*************************************************************** 261 245 262 if (ctl .ge.0.1) then246 if (ctl.ge.0.1) then 263 247 turbswitch=.true. 264 248 else … … 324 308 !************************************************************************ 325 309 326 if (ldirect .eq.1) linit_cond=0327 if ((linit_cond .lt. 0) .or. (linit_cond .gt.2)) then310 if (ldirect.eq.1) linit_cond=0 311 if ((linit_cond.lt.0).or.(linit_cond.gt.2)) then 328 312 write(*,*) ' #### FLEXPART MODEL ERROR! INVALID OPTION #### ' 329 313 write(*,*) ' #### FOR LINIT_COND IN FILE "COMMAND". #### ' … … 334 318 !****************** 335 319 336 if (iedate .lt.ibdate) then320 if (iedate.lt.ibdate) then 337 321 write(*,*) ' #### FLEXPART MODEL ERROR! BEGINNING DATE #### ' 338 322 write(*,*) ' #### IS LARGER THAN ENDING DATE. CHANGE #### ' … … 340 324 write(*,*) ' #### "COMMAND". #### ' 341 325 stop 342 else if (iedate .eq.ibdate) then343 if (ietime .lt.ibtime) then326 else if (iedate.eq.ibdate) then 327 if (ietime.lt.ibtime) then 344 328 write(*,*) ' #### FLEXPART MODEL ERROR! BEGINNING TIME #### ' 345 329 write(*,*) ' #### IS LARGER THAN ENDING TIME. CHANGE #### ' … … 354 338 !************************************ 355 339 356 if (ctl .gt.0.) then340 if (ctl.gt.0.) then 357 341 method=1 358 342 mintime=minstep … … 363 347 364 348 ! check for netcdf output switch (use for non-namelist input only!) 365 if (iout .ge.8) then349 if (iout.ge.8) then 366 350 lnetcdfout = 1 367 351 iout = iout - 8 … … 376 360 !********************************************************************** 377 361 378 if ((iout .lt. 1) .or. (iout .gt.5)) then362 if ((iout.lt.1).or.(iout.gt.5)) then 379 363 write(*,*) ' #### FLEXPART MODEL ERROR! FILE COMMAND: #### ' 380 364 write(*,*) ' #### IOUT MUST BE 1, 2, 3, 4, OR 5 FOR #### ' … … 385 369 386 370 !AF check consistency between units and volume mixing ratio 387 if ( ((iout .eq. 2) .or. (iout .eq. 3)) .and.&388 (ind_source .gt. 1 .or. ind_receptor .gt.1) ) then371 if ( ((iout.eq.2).or.(iout.eq.3)).and. & 372 (ind_source.gt.1 .or.ind_receptor.gt.1) ) then 389 373 write(*,*) ' #### FLEXPART MODEL ERROR! FILE COMMAND: #### ' 390 374 write(*,*) ' #### VOLUME MIXING RATIO ONLY SUPPORTED #### ' … … 397 381 !***************************************************************************** 398 382 399 if ((ioutputforeachrelease .eq. 1) .and. (mquasilag .eq.1)) then383 if ((ioutputforeachrelease.eq.1).and.(mquasilag.eq.1)) then 400 384 write(*,*) '#### FLEXPART MODEL ERROR! FILE COMMAND: ####' 401 385 write(*,*) '#### OUTPUTFOREACHRELEASE AND QUASILAGRANGIAN####' … … 408 392 !***************************************************************************** 409 393 410 if ((ldirect .lt. 0) .and. (mquasilag .eq.1)) then394 if ((ldirect.lt.0).and.(mquasilag.eq.1)) then 411 395 write(*,*) '#### FLEXPART MODEL ERROR! FILE COMMAND: ####' 412 396 write(*,*) '#### FOR BACKWARD RUNS, QUASILAGRANGIAN MODE ####' … … 420 404 !***************************************************************************** 421 405 422 if ((ldirect .lt. 0) .and. (ioutputforeachrelease .eq.0)) then406 if ((ldirect.lt.0).and.(ioutputforeachrelease.eq.0)) then 423 407 write(*,*) '#### FLEXPART MODEL ERROR! FILE COMMAND: ####' 424 408 write(*,*) '#### FOR BACKWARD RUNS, IOUTPUTFOREACHRLEASE ####' … … 432 416 !***************************************************************************** 433 417 434 if ((mdomainfill .eq. 1) .and. (ioutputforeachrelease .eq.1)) then418 if ((mdomainfill.eq.1).and.(ioutputforeachrelease.eq.1)) then 435 419 write(*,*) '#### FLEXPART MODEL ERROR! FILE COMMAND: ####' 436 420 write(*,*) '#### FOR DOMAIN FILLING RUNS OUTPUT FOR ####' … … 445 429 !***************************************************************************** 446 430 447 if (ldirect .lt.0) then448 if ((iout .eq. 2) .or. (iout .eq.3)) then431 if (ldirect.lt.0) then 432 if ((iout.eq.2).or.(iout.eq.3)) then 449 433 write(*,*) '#### FLEXPART MODEL ERROR! FILE COMMAND: ####' 450 434 write(*,*) '#### FOR BACKWARD RUNS, IOUT MUST BE 1,4,OR 5####' … … 458 442 !***************************************************************************** 459 443 460 if (mdomainfill .ge.1) then461 if ((iout .eq. 4) .or. (iout .eq.5)) then444 if (mdomainfill.ge.1) then 445 if ((iout.eq.4).or.(iout.eq.5)) then 462 446 write(*,*) '#### FLEXPART MODEL ERROR! FILE COMMAND: ####' 463 447 write(*,*) '#### FOR DOMAIN-FILLING TRAJECTORY OPTION, ####' … … 472 456 !**************************************************************** 473 457 474 if ((ipout .ne. 0) .and. (ipout .ne. 1) .and. (ipout .ne.2)) then458 if ((ipout.ne.0).and.(ipout.ne.1).and.(ipout.ne.2)) then 475 459 write(*,*) ' #### FLEXPART MODEL ERROR! FILE COMMAND: #### ' 476 460 write(*,*) ' #### IPOUT MUST BE 1, 2 OR 3! #### ' … … 478 462 endif 479 463 480 if(lsubgrid .ne. 1 .and. verbosity .eq.0) then464 if(lsubgrid.ne.1.and.verbosity.eq.0) then 481 465 write(*,*) ' ---------------- ' 482 466 write(*,*) ' INFORMATION: SUBGRIDSCALE TERRAIN EFFECT IS' … … 489 473 !*********************************************************** 490 474 491 if ((lconvection .ne. 0) .and. (lconvection .ne.1)) then475 if ((lconvection.ne.0).and.(lconvection.ne.1)) then 492 476 write(*,*) ' #### FLEXPART MODEL ERROR! FILE COMMAND: #### ' 493 477 write(*,*) ' #### LCONVECTION MUST BE SET TO EITHER 1 OR 0#### ' … … 499 483 !************************************************************* 500 484 501 if (lsynctime .gt.(idiffnorm/2)) then485 if (lsynctime.gt.(idiffnorm/2)) then 502 486 write(*,*) ' #### FLEXPART MODEL ERROR! SYNCHRONISATION #### ' 503 487 write(*,*) ' #### TIME IS TOO LONG. MAKE IT SHORTER. #### ' … … 510 494 !***************************************************************************** 511 495 512 if (loutaver .eq.0) then496 if (loutaver.eq.0) then 513 497 write(*,*) ' #### FLEXPART MODEL ERROR! TIME AVERAGE OF #### ' 514 498 write(*,*) ' #### CONCENTRATION FIELD OUTPUT MUST NOT BE #### ' … … 518 502 endif 519 503 520 if (loutaver .gt.loutstep) then504 if (loutaver.gt.loutstep) then 521 505 write(*,*) ' #### FLEXPART MODEL ERROR! TIME AVERAGE OF #### ' 522 506 write(*,*) ' #### CONCENTRATION FIELD OUTPUT MUST NOT BE #### ' … … 526 510 endif 527 511 528 if (loutsample .gt.loutaver) then512 if (loutsample.gt.loutaver) then 529 513 write(*,*) ' #### FLEXPART MODEL ERROR! SAMPLING TIME OF #### ' 530 514 write(*,*) ' #### CONCENTRATION FIELD OUTPUT MUST NOT BE #### ' … … 534 518 endif 535 519 536 if (mod(loutaver,lsynctime) .ne.0) then520 if (mod(loutaver,lsynctime).ne.0) then 537 521 write(*,*) ' #### FLEXPART MODEL ERROR! AVERAGING TIME OF #### ' 538 522 write(*,*) ' #### CONCENTRATION FIELD MUST BE A MULTIPLE #### ' … … 541 525 endif 542 526 543 if ((loutaver/lsynctime) .lt.2) then527 if ((loutaver/lsynctime).lt.2) then 544 528 write(*,*) ' #### FLEXPART MODEL ERROR! AVERAGING TIME OF #### ' 545 529 write(*,*) ' #### CONCENTRATION FIELD MUST BE AT LEAST #### ' … … 548 532 endif 549 533 550 if (mod(loutstep,lsynctime) .ne.0) then534 if (mod(loutstep,lsynctime).ne.0) then 551 535 write(*,*) ' #### FLEXPART MODEL ERROR! INTERVAL BETWEEN #### ' 552 536 write(*,*) ' #### CONCENTRATION FIELDS MUST BE A MULTIPLE #### ' … … 555 539 endif 556 540 557 if ((loutstep/lsynctime) .lt.2) then541 if ((loutstep/lsynctime).lt.2) then 558 542 write(*,*) ' #### FLEXPART MODEL ERROR! INTERVAL BETWEEN #### ' 559 543 write(*,*) ' #### CONCENTRATION FIELDS MUST BE AT LEAST #### ' … … 562 546 endif 563 547 564 if (mod(loutsample,lsynctime) .ne.0) then548 if (mod(loutsample,lsynctime).ne.0) then 565 549 write(*,*) ' #### FLEXPART MODEL ERROR! SAMPLING TIME OF #### ' 566 550 write(*,*) ' #### CONCENTRATION FIELD MUST BE A MULTIPLE #### ' … … 569 553 endif 570 554 571 if (itsplit .lt.loutaver) then555 if (itsplit.lt.loutaver) then 572 556 write(*,*) ' #### FLEXPART MODEL ERROR! SPLITTING TIME FOR#### ' 573 557 write(*,*) ' #### PARTICLES IS TOO SHORT. PLEASE INCREASE #### ' … … 576 560 endif 577 561 578 if ((mquasilag .eq. 1) .and. (iout .ge.4)) then562 if ((mquasilag.eq.1).and.(iout.ge.4)) then 579 563 write(*,*) ' #### FLEXPART MODEL ERROR! CONFLICTING #### ' 580 564 write(*,*) ' #### OPTIONS: IF MQUASILAG=1, PLUME #### ' … … 587 571 588 572 outstep=real(abs(loutstep)) 589 if (ldirect .eq.1) then573 if (ldirect.eq.1) then 590 574 bdate=juldate(ibdate,ibtime) 591 575 edate=juldate(iedate,ietime) 592 576 ideltas=nint((edate-bdate)*86400.) 593 else if (ldirect .eq.-1) then577 else if (ldirect.eq.-1) then 594 578 loutaver=-1*loutaver 595 579 loutstep=-1*loutstep
Note: See TracChangeset
for help on using the changeset viewer.