libsim Versione 7.2.1
|
◆ qc_compute_normalizeddensityindex()
Definizione alla linea 1888 del file modqccli.F90. 1889 do indtimerange=1,size(this%v7d%timerange)
1890 do indlevel=1,size(this%v7d%level) ! all stations, all times, all networks
1891 if (.NOT.(lnorm)) then
1892 do i=1,narea
1893
1894 !this%v7d%voldatir(indana, indtime, indlevel, indtimerange, inddativarr, indnetwork)
1895
1896 !create mask only with valid time
1897 mask = spread(spread((this%v7d%time == cyclicdt ),1,size(this%v7d%ana)),3,size(this%v7d%network))
1898 !delete in mask different area
1899 do j=1, size(mask,1)
1900 if (areav(j) /= area(i)) mask(j,:,:) =.false.
1901 end do
1902
1903 if (this%height2level) then
1904 allocate (maskplus(size(this%v7d%ana),size(this%v7d%time),size(this%v7d%network)))
1905 do k=1,cli_nlevel
1906#ifdef DEBUG
1907 CALL l4f_category_log(this%category, l4f_debug, 'k has value '//t2c(k))
1908#endif
1909
1910 do iana=1,size(mask,1)
1911 if (iclv(iana) /= k) maskplus(iana,:,:) =.false.
1912 if (iclv(iana) == k) maskplus(iana,:,:) = mask(iana,:,:)
1913 enddo
1914
1915 call sub_ndi(mymask=maskplus)
1916
1917 enddo
1918 deallocate(maskplus)
1919
1920 else
1921
1922 k=1
1923 call sub_ndi(mymask=mask)
1924
1925 endif
1926
1927 end do
1928
1929 else
1930
1931 mask = spread(spread((this%v7d%time == cyclicdt ),1,size(this%v7d%ana)),3,size(this%v7d%network))
1932
1933 k=1
1934 i=1
1935 call sub_ndi(mymask=mask)
1936
1937 endif
1938
1939 end do
1940 end do
1941end do
1942
1943deallocate (ndi,limbins,mask)
1944if (.NOT.(lnorm)) deallocate(area)
1945
1946contains
1947
1948subroutine sub_ndi(mymask)
1949
1950logical :: mymask(:,:,:)
1951
1952 ! we want more than 30% data present and a number of data bigger than 100 (default)
1953if &
1954 ( c_e(lpresentperc) .and. ((float(count &
1955 (mymask .and. c_e(this%v7d%voldatir(:,:, indlevel, indtimerange, inddativarr,:)))&
1956 ) / &
1957 float(count(mymask))) < lpresentperc)) &
1958 return
1959
1960if &
1961 ( c_e(lpresentnumb) .and. (count &
1962 (mymask .and. c_e(this%v7d%voldatir(:,:, indlevel, indtimerange, inddativarr,:))) < lpresentnumb)&
1963 ) &
1964 return
1965
1966!print*,"compute"
1967!print*,"-------------------------------------------------------------"
1968
1969call normalizeddensityindex (&
1970 pack(this%v7d%voldatir(:,:, indlevel, indtimerange, inddativarr,:), &
1971 mask=mymask), &
1972 perc_vals, ndi, limbins)
1973
1974do j=1,size(perc_vals)-1
1975 indana=(k-1)*(size(perc_vals)-1)*narea + (j-1)*narea + i
1976 this%clima%voldatir(indana, indtime, indlevel, indtimerange, inddativarr, indnetwork)=&
1977 limbins(j)
1978 this%clima%voldatiattrr(indana, indtime, indlevel, indtimerange, inddativarr, indnetwork,indattr)=&
1979 ndi(j)*100
1980end do
1981
1982end subroutine sub_ndi
1983
1984
1985end SUBROUTINE qc_compute_normalizeddensityindex
1986
1988
1989
1992
|