Changeset 789 for trunk/LMDZ.GENERIC
- Timestamp:
- Sep 20, 2012, 3:34:10 PM (12 years ago)
- Location:
- trunk/LMDZ.GENERIC
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LMDZ.GENERIC/README
r787 r789 830 830 ... to be conservative I kept this behaviour and highlighted it with an array nueffrad_dummy 831 831 ... I added a comment because someone might want to change this 832 833 == 20/09/2012 == AS 834 A more robust way to count lines in setspi and setspv. 835 bandlen.txt file is no longer used. This was causing problems with MPI computations. -
trunk/LMDZ.GENERIC/libf/phystd/setspi.F90
r716 r789 46 46 47 47 real*8 :: lastband(2), plancksum 48 49 !! used to count lines 50 integer :: nb=-1 !because first line is not an actual value 51 integer :: ierr=0 48 52 49 53 logical forceEC, planckcheck … … 87 91 call abort 88 92 endif 89 90 ! check that the file contains the right number of bands 91 call system('wc -l '//file_path//' > bandlen.txt') 92 open(131,file='bandlen.txt', form='formatted') 93 read(131,*) file_entries 93 94 ! check that the file contains the right number of bands 95 open(131,file=file_path,form='formatted') 96 do while (ierr==0) 97 read(131,*,iostat=ierr) file_entries 98 if (ierr==0) nb=nb+1 99 enddo 94 100 close(131) 95 call system('rm -f bandlen.txt') 96 97 if(file_entries-1.ne.L_NSPECTI) then 98 write(*,*) 'setspi: L_NSPECTI = ',L_NSPECTI, 'in the model, but there are ' 99 write(*,*) file_entries-1,'entries in ', & 100 TRIM(file_path),', exiting.' 101 write(*,*) 'setspi: L_NSPECTI = ',L_NSPECTI, 'in the model ' 102 write(*,*) ' there are ',nb, 'entries in ',TRIM(file_path) 103 if(nb.ne.L_NSPECTI) then 104 write(*,*) 'MISMATCH !! I stop here' 101 105 call abort 102 106 endif -
trunk/LMDZ.GENERIC/libf/phystd/setspv.F90
r716 r789 46 46 real*8 sum 47 47 48 !! used to count lines 49 integer :: nb=-1 !because first line is not an actual value 50 integer :: ierr=0 51 48 52 !======================================================================= 49 53 ! Set up spectral bands - wavenumber [cm^(-1)]. Go from smaller to … … 65 69 call abort 66 70 endif 67 68 ! check that the file contains the right number of bands 69 call system('wc -l '//file_path//' > bandlen.txt') 70 open(131,file='bandlen.txt', form='formatted') 71 read(131,*) file_entries 71 72 ! check that the file contains the right number of bands 73 open(131,file=file_path,form='formatted') 74 do while (ierr==0) 75 read(131,*,iostat=ierr) file_entries 76 if (ierr==0) nb=nb+1 77 enddo 72 78 close(131) 73 call system('rm -f bandlen.txt') 74 75 if(file_entries-1.ne.L_NSPECTV) then 76 write(*,*) 'setspv: L_NSPECTV = ',L_NSPECTV, 'in the model, but there are ' 77 write(*,*) file_entries-1,'entries in ', & 78 TRIM(file_path),', exiting.' 79 write(*,*) 'setspv: L_NSPECTV = ',L_NSPECTV, 'in the model ' 80 write(*,*) ' there are ',nb, 'entries in ',TRIM(file_path) 81 if(nb.ne.L_NSPECTV) then 82 write(*,*) 'MISMATCH !! I stop here' 79 83 call abort 80 84 endif
Note: See TracChangeset
for help on using the changeset viewer.