Changeset 788 for trunk/LMDZ.MARS/util/zrecast.F90
- Timestamp:
- Sep 20, 2012, 1:26:25 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LMDZ.MARS/util/zrecast.F90
r777 r788 128 128 ! has to be computed; false if these are given 129 129 ! by the user 130 logical :: auto_mcd_levels ! Flag: specific case for MCD automatic above 131 ! local surface levels 130 132 !=============================================================================== 131 133 ! 1. Input parameters … … 549 551 text="dummy" ! dummy initialization 550 552 auto_vert_levels=.true. ! dummy initialization to get rid of compiler warning 551 do while ((trim(text).ne."yes").and.(trim(text).ne."no") )553 do while ((trim(text).ne."yes").and.(trim(text).ne."no").and.(trim(text).ne."mcd")) 552 554 write(*,*) "" 553 555 write(*,*) "Automatic generation of vertical levels distribution? (yes/no)" 554 556 write(*,*) "(yes: you only provide min, max and number of levels)" 555 557 write(*,*) "(no: you provide values for each level)" 558 write(*,*) "(mcd: special case for above local surface levels for MCD)" 556 559 read(*,'(a64)') text 557 560 if (trim(text).eq."yes") then 558 561 auto_vert_levels=.true. 559 else 562 auto_mcd_levels=.false. 563 elseif(trim(text).eq."no") then 560 564 auto_vert_levels=.false. 565 elseif(trim(text).eq."mcd") then 566 auto_vert_levels=.true. 567 auto_mcd_levels=.true. 561 568 endif 562 569 enddo … … 565 572 ! ask for # of points and end values for pressure or above areoid cases 566 573 write(*,*) "" 567 if ((ztype.le.2).or.(ztype.ge.4)) then 568 write(*,*) "Enter min and max of vertical coordinate (Pa or m)" 569 write(*,*) " (in that order and on the same line)" 570 if (ztype.eq.1) then ! pressure coordinate 571 read(*,*) pmin,pmax 572 else ! altitude coordinate 573 read(*,*) zamin,zamax 574 endif 575 endif ! of if ((ztype.le.2).or.(ztype.ge.4)) 574 write(*,*) "Enter min and max of vertical coordinate (Pa or m)" 575 write(*,*) " (in that order and on the same line)" 576 if (ztype.eq.1) then ! pressure coordinate 577 read(*,*) pmin,pmax 578 else ! altitude coordinate 579 read(*,*) zamin,zamax 580 endif 576 581 577 582 ! Build corresponding vertical coordinates … … 611 616 endif 612 617 else if (ztype.eq.3) then ! above local surface 613 ! set nblev to # of levels from input data files 614 nblev=altlength 615 allocate(zsurface(nblev),stat=ierr) 616 if (ierr.ne.0) then 617 write(*,*) "Error: Failed to allocate zsurface(nblev)" 618 write(*,*) " nblev=",nblev 619 stop 620 endif 621 ! build specific above local surface altitudes 622 call build_zs(nblev,have_sigma,sigma,aps,bps,zsurface) 618 if (auto_mcd_levels) then 619 ! set nblev to # of levels from input data files 620 nblev=altlength 621 allocate(zsurface(nblev),stat=ierr) 622 if (ierr.ne.0) then 623 write(*,*) "Error: Failed to allocate zsurface(nblev)" 624 write(*,*) " nblev=",nblev 625 stop 626 endif 627 ! build specific above local surface altitudes 628 call build_zs(nblev,have_sigma,sigma,aps,bps,zsurface) 629 else 630 write(*,*) "Number of levels along vertical coordinate?" 631 read(*,*) nblev 632 allocate(zsurface(nblev),stat=ierr) 633 if (ierr.ne.0) then 634 write(*,*) "Error: Failed to allocate zsurface(nblev)" 635 write(*,*) " nblev=",nblev 636 stop 637 endif 638 if (nblev.eq.1) then ! in case only one level is asked for 639 zsurface(nblev)=zamin 640 else 641 do i=1,nblev 642 zsurface(i)=zamin+(real(i)-1.0)*((zamax-zamin)/(real(nblev)-1.0)) 643 enddo 644 endif 645 endif ! of if (auto_mcd_levels) 623 646 else ! distance to center of planet 624 647 write(*,*) "Number of levels along vertical coordinate?"
Note: See TracChangeset
for help on using the changeset viewer.