diff --git a/src/gsi/correlated_obsmod.F90 b/src/gsi/correlated_obsmod.F90 index bda2c1eea..94834bde1 100644 --- a/src/gsi/correlated_obsmod.F90 +++ b/src/gsi/correlated_obsmod.F90 @@ -410,8 +410,8 @@ subroutine set_(instrument,fname,mask,method,kreq,kmut,ErrorCov) if (iuse_rad(ii)>0) then coun=coun+1 endif + nctotf=nctotf+1 endif - nctotf=nctotf+1 enddo ! if no data available, turn off Correlated Error if (coun==0) then @@ -462,7 +462,6 @@ subroutine set_(instrument,fname,mask,method,kreq,kmut,ErrorCov) do ii=1,ErrorCov%nch_active indR=0 do jj=couns,nch_active -! if (indxR(jj)==ErrorCov%indxR(ii)) then if (indxR(jj)==indxRf(ii)) then indR=jj couns=jj+1 @@ -484,7 +483,6 @@ subroutine set_(instrument,fname,mask,method,kreq,kmut,ErrorCov) do ii=1,nch_active indR=0 do jj=couns,ErrorCov%nch_active -! if (ErrorCov%indxR(jj)==indxR(ii)) then if (indxRf(jj)==indxR(ii)) then indR=jj couns=jj+1 diff --git a/util/Correlated_Obs/cov_calc.f90 b/util/Correlated_Obs/cov_calc.f90 index bb377edba..3482f0fcf 100644 --- a/util/Correlated_Obs/cov_calc.f90 +++ b/util/Correlated_Obs/cov_calc.f90 @@ -332,18 +332,12 @@ program cov_calc deallocate(Rcovbig,divbig,ges_avebig1,ges_avebig2) deallocate(n_pair_hl, obs_pairs_hl) end if -reclen=kind(Rcov(1,1)) -open(22,file='Rcov_iasicland',form='unformatted') -read(22) nch_active, nctot, reclen -read(22) indR -read(22) Rcov -close(22) !output reclen=kind(Rcov(1,1)) open(26,file=trim(cov_file),form='unformatted') write(26) nch_active, nctot, reclen -write(26) indRf -write(26) Rcov +write(26) indRf(1:nch_active) +write(26) Rcov(1:nch_active,1:nch_active) close(26) if (out_wave) then @@ -361,8 +355,6 @@ program cov_calc write(25,rec=1) Rcorr close(25) end if -!KAB -print *, indRf deallocate(Rcov,chaninfo,errout) deallocate(indR,indRf) deallocate(divider) diff --git a/util/Correlated_Obs/readsatobs.f90 b/util/Correlated_Obs/readsatobs.f90 index a6316684a..2bf67942e 100644 --- a/util/Correlated_Obs/readsatobs.f90 +++ b/util/Correlated_Obs/readsatobs.f90 @@ -113,7 +113,7 @@ subroutine get_chaninfo_nc(filename,chan_choice) character(len=9), intent(in) :: filename integer(i_kind), intent(in):: chan_choice integer(i_kind) iunit, nobs, i,j - integer(i_kind), dimension(:), allocatable ::Use_Flag,chind,shind + integer(i_kind), dimension(:), allocatable ::Use_Flag,chind,schind real(r_double), dimension(:), allocatable:: Waves,Inv_Errors real(r_kind), dimension(:), allocatable:: Wave,Inv_Error @@ -122,13 +122,13 @@ subroutine get_chaninfo_nc(filename,chan_choice) nobs = nc_diag_read_get_dim(iunit,'nobs') if (nobs <= 0) call nc_diag_read_close(filename) nctot = nc_diag_read_get_dim(iunit,'nchans') - allocate(Use_Flag(nctot),chind(nobs),shind(nctot),Wave(nctot),Inv_Error(nctot)) + allocate(Use_Flag(nctot),chind(nobs),schind(nctot),Wave(nctot),Inv_Error(nctot)) allocate(Waves(nctot),Inv_Errors(nctot)) call nc_diag_read_get_var(iunit, 'use_flag', Use_Flag) call nc_diag_read_get_var(iunit, 'Channel_Index', chind) call nc_diag_read_get_var(iunit, 'wavenumber', Waves) call nc_diag_read_get_var(iunit, 'error_variance', Inv_Errors) - call nc_diag_read_get_var(iunit, 'sensor_chan', shind) + call nc_diag_read_get_var(iunit, 'sensor_chan', schind) Wave=real(Waves,r_kind) Inv_Error=real(Inv_Errors,r_kind) call nc_diag_read_close(filename) @@ -144,13 +144,12 @@ subroutine get_chaninfo_nc(filename,chan_choice) allocate(indRf(nch_active),indR(nch_active),chaninfo(nch_active),errout(nch_active)) i=0 do j=1,nctot -print *, 'chan ', shind(j) if (chan_choice==full_chan) then - indRf(j)=shind(j)!j + indRf(j)=schind(j) indR(j)=j else if (Use_Flag(chind(j))>0) then i=i+1 - indRf(i)=shind(j)!j + indRf(i)=schind(j) indR(i)=j end if end do @@ -158,7 +157,7 @@ subroutine get_chaninfo_nc(filename,chan_choice) chaninfo(j)=Wave(chind(indR(j))) errout(j)=Inv_Error(chind(indR(j))) end do - deallocate(Use_flag,chind,Wave,Inv_Error,Waves,Inv_Errors) + deallocate(Use_flag,chind,schind,Wave,Inv_Error,Waves,Inv_Errors) end subroutine get_chaninfo_nc ! read radiance data