Changes in trunk/src/readageclasses.f90 [27:4]
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/readageclasses.f90
r27 r4 28 28 ! * 29 29 ! Author: A. Stohl * 30 ! * 30 31 ! 20 March 2000 * 31 ! HSO, 1 July 2014 *32 ! Added optional namelist input *33 32 ! * 34 33 !***************************************************************************** … … 47 46 integer :: i 48 47 49 ! namelist help variables50 integer :: readerror51 52 ! namelist declaration53 namelist /ageclass/ &54 nageclass, &55 lage56 57 nageclass=-1 ! preset to negative value to identify failed namelist input58 48 59 49 ! If age spectra calculation is switched off, set number of age classes … … 67 57 endif 68 58 59 69 60 ! If age spectra claculation is switched on, 70 61 ! open the AGECLASSSES file and read user options 71 62 !************************************************ 72 63 73 open(unitageclasses,file=path(1)(1:length(1))//'AGECLASSES',form='formatted',status='old',err=999) 64 open(unitageclasses,file=path(1)(1:length(1))//'AGECLASSES', & 65 status='old',err=999) 74 66 75 ! try to read in as a namelist 76 read(unitageclasses,ageclass,iostat=readerror) 77 close(unitageclasses) 67 do i=1,13 68 read(unitageclasses,*) 69 end do 70 read(unitageclasses,*) nageclass 78 71 79 if ((nageclass.lt.0).or.(readerror.ne.0)) then80 open(unitageclasses,file=path(1)(1:length(1))//'AGECLASSES',status='old',err=999)81 do i=1,1382 read(unitageclasses,*)83 end do84 read(unitageclasses,*) nageclass85 read(unitageclasses,*) lage(1)86 do i=2,nageclass87 read(unitageclasses,*) lage(i)88 end do89 close(unitageclasses)90 endif91 92 ! write ageclasses file in namelist format to output directory if requested93 if (nmlout.eqv..true.) then94 open(unitageclasses,file=path(2)(1:length(2))//'AGECLASSES.namelist',err=1000)95 write(unitageclasses,nml=ageclass)96 close(unitageclasses)97 endif98 72 99 73 if (nageclass.gt.maxageclass) then … … 106 80 endif 107 81 82 read(unitageclasses,*) lage(1) 108 83 if (lage(1).le.0) then 109 84 write(*,*) ' #### FLEXPART MODEL ERROR! AGE OF FIRST #### ' … … 114 89 115 90 do i=2,nageclass 91 read(unitageclasses,*) lage(i) 116 92 if (lage(i).le.lage(i-1)) then 117 93 write(*,*) ' #### FLEXPART MODEL ERROR! AGE CLASSES #### ' … … 129 105 stop 130 106 131 1000 write(*,*) ' #### FLEXPART MODEL ERROR! FILE "AGECLASSES" #### '132 write(*,*) ' #### CANNOT BE OPENED IN THE DIRECTORY #### '133 write(*,'(a)') path(2)(1:length(2))134 stop135 136 137 107 end subroutine readageclasses
Note: See TracChangeset
for help on using the changeset viewer.