ROMS
Loading...
Searching...
No Matches
yaml_parser_mod::yaml_get Interface Reference

Public Member Functions

integer function yaml_get_i_struc (self, keystring, v)
 
integer function yaml_get_l_struc (self, keystring, v)
 
integer function yaml_get_r_struc (self, keystring, v)
 
integer function yaml_get_s_struc (self, keystring, v)
 
integer function yaml_get_ivar_0d (self, keystring, value)
 
integer function yaml_get_ivar_1d (self, keystring, value)
 
integer function yaml_get_lvar_0d (self, keystring, value)
 
integer function yaml_get_lvar_1d (self, keystring, value)
 
integer function yaml_get_rvar_0d (self, keystring, value)
 
integer function yaml_get_rvar_1d (self, keystring, value)
 
integer function yaml_get_svar_0d (self, keystring, value)
 
integer function yaml_get_svar_1d (self, keystring, value)
 

Detailed Description

Definition at line 233 of file yaml_parser.F.

Member Function/Subroutine Documentation

◆ yaml_get_i_struc()

integer function yaml_parser_mod::yaml_get::yaml_get_i_struc ( class (yaml_tree), intent(in) self,
character (len=*), intent(in) keystring,
type (yaml_ivec), dimension(:), intent(out), allocatable v )

Definition at line 1735 of file yaml_parser.F.

1736!
1737!***********************************************************************
1738! !
1739! It loads a vector set of integers in YAML block-list structure, !
1740! V(1:Nitems)%vector(1:Nvalues). If the dummy argument V structure !
1741! is allocated, it deallocates/allocates the required Nitems and !
1742! Nvalues dimensions. !
1743! !
1744! On Input: !
1745! !
1746! self YAML tree dictionary object (CLASS yaml_tree) !
1747! keystring YAML tree aggregated keys (string) !
1748! !
1749! On Output: !
1750! !
1751! V Vector of integers in block list (TYPE yaml_Ivec) !
1752! status Error code (integer) !
1753! !
1754!***********************************************************************
1755!
1756! Imported variable declarations.
1757!
1758 class(yaml_tree), intent(in) :: self
1759 character (len=*), intent(in) :: keystring
1760 TYPE (yaml_Ivec), allocatable, intent(out) :: V(:)
1761!
1762! Local variable declarations.
1763!
1764 TYPE (yaml_extract), allocatable :: S(:)
1765!
1766 integer :: LenStr, Nitems, Nvalues, i, n
1767 integer :: status
1768!
1769 character (len=Lmax) :: msg
1770
1771 character (len=*), parameter :: MyFile = &
1772 & __FILE__//", yaml_Get_i_struc"
1773!
1774!-----------------------------------------------------------------------
1775! Extract requested key-string values.
1776!-----------------------------------------------------------------------
1777!
1778 status=noerr
1779!
1780 IF (yaml_error(self%extract(keystring, s), &
1781 & noerr, __line__, myfile)) RETURN
1782!
1783! Allocate output structure.
1784!
1785 nitems=SIZE(s, dim=1)
1786 IF (ALLOCATED(v)) DEALLOCATE (v)
1787 ALLOCATE ( v(nitems) )
1788!
1789! Convert string vector values to integers.
1790!
1791 DO n=1,nitems
1792 IF (s(n)%has_vector) THEN
1793 nvalues=SIZE(s(n)%vector)
1794 ALLOCATE ( v(n)%vector(nvalues) )
1795 DO i=1,nvalues
1796 READ (s(n)%vector(i)%value, * ,iostat=status, iomsg=msg) &
1797 & v(n)%vector(i)
1798 IF (yaml_error(status, noerr, __line__, myfile)) THEN
1799 yaml_errflag=5
1800 IF (yaml_master) WRITE (yaml_stdout,10) trim(keystring), &
1801 & s(n)%vector(i)%value, &
1802 & trim(msg)
1803 RETURN
1804 END IF
1805 END DO
1806 END IF
1807 END DO
1808!
1809! Deallocate local extraction structure.
1810!
1811 IF (ALLOCATED(s)) DEALLOCATE (s)
1812!
1813 10 FORMAT (/,' YAML_GET_I_STRUC - Error while converting string to', &
1814 & ' integer, key: ',a,', value = ',a,/,20x,'ErrMsg: ',a)
1815!
1816 RETURN

References yaml_parser_mod::noerr, and yaml_parser_mod::yaml_error().

Here is the call graph for this function:

◆ yaml_get_ivar_0d()

integer function yaml_parser_mod::yaml_get::yaml_get_ivar_0d ( class (yaml_tree), intent(in) self,
character (len=*), intent(in) keystring,
integer, intent(out) value )

Definition at line 2061 of file yaml_parser.F.

2062!
2063!***********************************************************************
2064! !
2065! It gets scalar integer data from YAML dictionary object. !
2066! !
2067! On Input: !
2068! !
2069! self YAML tree dictionary object (CLASS yaml_tree) !
2070! keystring YAML tree aggregated keys (string) !
2071! !
2072! On Output: !
2073! !
2074! value YAML value (integer; scalar) !
2075! status Error code (integer) !
2076! !
2077!***********************************************************************
2078!
2079! Imported variable declarations.
2080!
2081 class(yaml_tree), intent(in) :: self
2082 character (len=*), intent(in) :: keystring
2083 integer, intent(out) :: value
2084!
2085! Local variable declarations.
2086!
2087 TYPE (yaml_extract), allocatable :: S(:)
2088!
2089 integer :: Nvalues, status
2090!
2091 character (len=Lmax) :: msg
2092
2093 character (len=*), parameter :: MyFile = &
2094 & __FILE__//", yaml_Get_ivar_0d"
2095!
2096!-----------------------------------------------------------------------
2097! Extract requested key-string value.
2098!-----------------------------------------------------------------------
2099!
2100 status=noerr
2101!
2102 IF (yaml_error(self%extract(keystring, s), &
2103 & noerr, __line__, myfile)) RETURN
2104!
2105! Make sure that extracted value is a scalar.
2106!
2107 nvalues=SIZE(s)
2108!
2109 IF (nvalues.gt.1) THEN
2110 status=7
2111 yaml_errflag=status
2112 IF (yaml_error(status, noerr, __line__, myfile)) THEN
2113 IF (yaml_master) WRITE (yaml_stdout,10) keystring, nvalues, &
2114 & self%filename
2115 RETURN
2116 END IF
2117!
2118! Convert string value to integer.
2119!
2120 ELSE
2121 READ (s(1)%value, *, iostat=status, iomsg=msg) value
2122 IF (yaml_error(status, noerr, __line__, myfile)) THEN
2123 yaml_errflag=5
2124 IF (yaml_master) WRITE (yaml_stdout,20) trim(keystring), &
2125 & s(1)%value, trim(msg)
2126 RETURN
2127 END IF
2128 END IF
2129!
2130! Deallocate.
2131!
2132 IF (ALLOCATED(s)) DEALLOCATE (s)
2133!
2134 10 FORMAT (/,' YAML_GET_IVAR_0D - Extracted value is not a scalar,', &
2135 & ' key-string: ',a,/,20x,'Nvalues = ',i0,/,20x,'File: ',a)
2136 20 FORMAT (/,' YAML_GET_IVAR_0D - Error while converting string to', &
2137 & ' integer, key: ',a,', value = ',a,/,20x,'ErrMsg: ',a)
2138!
2139 RETURN

References yaml_parser_mod::noerr, and yaml_parser_mod::yaml_error().

Here is the call graph for this function:

◆ yaml_get_ivar_1d()

integer function yaml_parser_mod::yaml_get::yaml_get_ivar_1d ( class (yaml_tree), intent(in) self,
character (len=*), intent(in) keystring,
integer, dimension(:), intent(out) value )

Definition at line 2142 of file yaml_parser.F.

2143!
2144!***********************************************************************
2145! !
2146! It gets 1D integer data from YAML dictionary object. !
2147! !
2148! On Input: !
2149! !
2150! self YAML tree dictionary object (CLASS yaml_tree) !
2151! keystring YAML tree aggregated keys (string) !
2152! !
2153! On Output: !
2154! !
2155! value YAML value (integer; 1D-array) !
2156! status Error code (integer) !
2157! !
2158!***********************************************************************
2159!
2160! Imported variable declarations.
2161!
2162 class(yaml_tree), intent(in) :: self
2163 character (len=*), intent(in) :: keystring
2164 integer, intent(out) :: value(:)
2165!
2166! Local variable declarations.
2167!
2168 TYPE (yaml_extract), allocatable :: S(:)
2169!
2170 integer :: Nvalues, i, status
2171!
2172 character (len=Lmax) :: msg
2173
2174 character (len=*), parameter :: MyFile = &
2175 & __FILE__//", yaml_Get_ivar_1d"
2176!
2177!-----------------------------------------------------------------------
2178! Extract requested key-string values.
2179!-----------------------------------------------------------------------
2180!
2181 status=noerr
2182!
2183 IF (yaml_error(self%extract(keystring, s), &
2184 & noerr, __line__, myfile)) RETURN
2185!
2186! Make sure that extracted value is a scalar.
2187!
2188 nvalues=SIZE(s, dim=1)
2189!
2190 IF (SIZE(value, dim=1).lt.nvalues) THEN
2191 status=7
2192 yaml_errflag=status
2193 IF (yaml_error(status, noerr, __line__, myfile)) THEN
2194 IF (yaml_master) WRITE (yaml_stdout,10) keystring, nvalues, &
2195 & SIZE(value, dim=1), &
2196 & self%filename
2197 RETURN
2198 END IF
2199 END IF
2200!
2201! Convert string values to integers.
2202!
2203 DO i=1,nvalues
2204 READ (s(i)%value, *, iostat=status, iomsg=msg) value(i)
2205 IF (yaml_error(status, noerr, __line__, myfile)) THEN
2206 yaml_errflag=5
2207 IF (yaml_master) WRITE (yaml_stdout,20) trim(keystring), &
2208 & s(i)%value, trim(msg)
2209 RETURN
2210 END IF
2211 END DO
2212!
2213! Deallocate.
2214!
2215 IF (ALLOCATED(s)) DEALLOCATE (s)
2216!
2217 10 FORMAT (/,' YAML_GET_IVAR_1D - Inconsistent number of values,', &
2218 & ' key-string: ',a,/,20x,'YAML size = ',i0, &
2219 & ', Variable size = ',i0,/,20x,'File: ',a)
2220 20 FORMAT (/,' YAML_GET_IVAR_1D - Error while converting string to', &
2221 & ' integer, key: ',a,', value = ',a,/,20x,'ErrMsg: ',a)
2222!
2223 RETURN

References yaml_parser_mod::noerr, and yaml_parser_mod::yaml_error().

Here is the call graph for this function:

◆ yaml_get_l_struc()

integer function yaml_parser_mod::yaml_get::yaml_get_l_struc ( class (yaml_tree), intent(in) self,
character (len=*), intent(in) keystring,
type (yaml_lvec), dimension(:), intent(out), allocatable v )

Definition at line 1819 of file yaml_parser.F.

1820!
1821!***********************************************************************
1822! !
1823! It loads a vector set of logicals in YAML block-list structure, !
1824! V(1:Nitems)%vector(1:Nvalues). If the dummy argument V structure !
1825! is allocated, it deallocates/allocates the required Nitems and !
1826! Nvalues dimensions. !
1827! !
1828! On Input: !
1829! !
1830! self YAML tree dictionary object (CLASS yaml_tree) !
1831! keystring YAML tree aggregated keys (string) !
1832! !
1833! On Output: !
1834! !
1835! V Vector of logicals in block list (TYPE yaml_Lvec) !
1836! status Error code (integer) !
1837! !
1838!***********************************************************************
1839!
1840! Imported variable declarations.
1841!
1842 class(yaml_tree), intent(in) :: self
1843 character (len=*), intent(in) :: keystring
1844 TYPE (yaml_Lvec), allocatable, intent(out) :: V(:)
1845!
1846! Local variable declarations.
1847!
1848 TYPE (yaml_extract), allocatable :: S(:)
1849!
1850 integer :: Nitems, Nvalues, n, i
1851 integer :: status
1852!
1853 character (len=*), parameter :: MyFile = &
1854 & __FILE__//", yaml_Get_l_struc"
1855!
1856!-----------------------------------------------------------------------
1857! Extract requested key-string values.
1858!-----------------------------------------------------------------------
1859!
1860 status=noerr
1861!
1862 IF (yaml_error(self%extract(keystring, s), &
1863 & noerr, __line__, myfile)) RETURN
1864!
1865! Allocate output structure.
1866!
1867 nitems=SIZE(s, dim=1)
1868 IF (ALLOCATED(v)) DEALLOCATE (v)
1869 ALLOCATE ( v(nitems) )
1870!
1871! Convert string vector values to logicals.
1872!
1873 DO n=1,nitems
1874 IF (s(n)%has_vector) THEN
1875 nvalues=SIZE(s(n)%vector)
1876 ALLOCATE ( v(n)%vector(nvalues) )
1877 DO i=1,nvalues
1878 IF (yaml_uppercase(s(n)%vector(i)%value(1:1)).eq.'T') THEN
1879 v(n)%vector(i)=.true.
1880 ELSE
1881 v(n)%vector(i)=.false.
1882 END IF
1883 END DO
1884 END IF
1885 END DO
1886!
1887! Deallocate local extraction structure.
1888!
1889 IF (ALLOCATED(s)) DEALLOCATE (s)
1890!
1891 RETURN

References yaml_parser_mod::noerr, yaml_parser_mod::yaml_error(), and yaml_parser_mod::yaml_uppercase().

Here is the call graph for this function:

◆ yaml_get_lvar_0d()

integer function yaml_parser_mod::yaml_get::yaml_get_lvar_0d ( class (yaml_tree), intent(in) self,
character (len=*), intent(in) keystring,
logical, intent(out) value )

Definition at line 2226 of file yaml_parser.F.

2227!
2228!***********************************************************************
2229! !
2230! It gets scalar logical data from YAML disctionary object. !
2231! !
2232! On Input: !
2233! !
2234! self YAML tree dictionary object (CLASS yaml_tree) !
2235! keystring YAML tree aggregated keys (string) !
2236! !
2237! On Output: !
2238! !
2239! value YAML value (logical; scalar) !
2240! !
2241!***********************************************************************
2242!
2243! Imported variable declarations.
2244!
2245 class(yaml_tree), intent(in) :: self
2246 character (len=*), intent(in) :: keystring
2247 logical, intent(out) :: value
2248!
2249! Local variable declarations.
2250!
2251 TYPE (yaml_extract), allocatable :: S(:)
2252!
2253 integer :: Nvalues, status
2254!
2255 character (len=*), parameter :: MyFile = &
2256 & __FILE__//", yaml_Get_lvar_0d"
2257!
2258!-----------------------------------------------------------------------
2259! Extract requested key-string value.
2260!-----------------------------------------------------------------------
2261!
2262 status=noerr
2263!
2264 IF (yaml_error(self%extract(keystring, s), &
2265 & noerr, __line__, myfile)) RETURN
2266!
2267! Make sure that extracted value is a scalar.
2268!
2269 nvalues=SIZE(s)
2270!
2271 IF (nvalues.gt.1) THEN
2272 status=7
2273 yaml_errflag=status
2274 IF (yaml_error(status, noerr, __line__, myfile)) THEN
2275 IF (yaml_master) WRITE (yaml_stdout,10) keystring, nvalues, &
2276 & self%filename
2277 RETURN
2278 END IF
2279!
2280! Convert string value to logical.
2281!
2282 ELSE
2283 IF (yaml_uppercase(s(1)%value(1:1)).eq.'T') THEN
2284 value=.true.
2285 ELSE
2286 value=.false.
2287 END IF
2288 END IF
2289!
2290! Deallocate.
2291!
2292 IF (ALLOCATED(s)) DEALLOCATE (s)
2293!
2294 10 FORMAT (/,' YAML_GET_LVAR_0D - Extracted value is not a scalar,', &
2295 & ' key-string: ',a,/,20x,'Nvalues = ',i0,/,20x,'File: ',a)
2296!
2297 RETURN

References yaml_parser_mod::noerr, yaml_parser_mod::yaml_error(), and yaml_parser_mod::yaml_uppercase().

Here is the call graph for this function:

◆ yaml_get_lvar_1d()

integer function yaml_parser_mod::yaml_get::yaml_get_lvar_1d ( class (yaml_tree), intent(in) self,
character (len=*), intent(in) keystring,
logical, dimension(:), intent(out) value )

Definition at line 2300 of file yaml_parser.F.

2301!
2302!***********************************************************************
2303! !
2304! It gets 1D logical data from YAML dictionary object. !
2305! !
2306! On Input: !
2307! !
2308! self YAML tree dictionary object (CLASS yaml_tree) !
2309! keystring YAML tree aggregated keys (string) !
2310! !
2311! On Output: !
2312! !
2313! value YAML value (logical; 1D-array) !
2314! status Error code (integer) !
2315! !
2316!***********************************************************************
2317!
2318! Imported variable declarations.
2319!
2320 class(yaml_tree), intent(in) :: self
2321 character (len=*), intent(in) :: keystring
2322 logical, intent(out) :: value(:)
2323!
2324! Local variable declarations.
2325!
2326 TYPE (yaml_extract), allocatable :: S(:)
2327!
2328 integer :: Nvalues, i, status
2329!
2330 character (len=*), parameter :: MyFile = &
2331 & __FILE__//", yaml_Get_lvar_1d"
2332!
2333!-----------------------------------------------------------------------
2334! Extract requested key-string values.
2335!-----------------------------------------------------------------------
2336!
2337 status=noerr
2338!
2339 IF (yaml_error(self%extract(keystring, s), &
2340 & noerr, __line__, myfile)) RETURN
2341!
2342! Make sure that extracted value is a scalar.
2343!
2344 nvalues=SIZE(s, dim=1)
2345!
2346 IF (SIZE(value, dim=1).lt.nvalues) THEN
2347 yaml_errflag=7
2348 status=yaml_errflag
2349 IF (yaml_error(yaml_errflag, noerr, __line__, myfile)) THEN
2350 IF (yaml_master) WRITE (yaml_stdout,10) keystring, nvalues, &
2351 & SIZE(value, dim=1), &
2352 & self%filename
2353 RETURN
2354 END IF
2355 END IF
2356!
2357! Convert string values to logicals.
2358!
2359 DO i=1,nvalues
2360 IF (yaml_uppercase(s(i)%value(1:1)).eq.'T') THEN
2361 value(i)=.true.
2362 ELSE
2363 value(i)=.false.
2364 END IF
2365 END DO
2366!
2367! Deallocate.
2368!
2369 IF (ALLOCATED(s)) DEALLOCATE (s)
2370!
2371 10 FORMAT (/,' YAML_GET_LVAR_1D - Inconsistent number of values,', &
2372 & ' key-string: ',a,/,20x,'YAML size = ',i0, &
2373 & ', Variable size = ',i0,/,20x,'File: ',a)
2374!
2375 RETURN

References yaml_parser_mod::noerr, yaml_parser_mod::yaml_error(), and yaml_parser_mod::yaml_uppercase().

Here is the call graph for this function:

◆ yaml_get_r_struc()

integer function yaml_parser_mod::yaml_get::yaml_get_r_struc ( class (yaml_tree), intent(in) self,
character (len=*), intent(in) keystring,
type (yaml_rvec), dimension(:), intent(out), allocatable v )

Definition at line 1894 of file yaml_parser.F.

1895!
1896!***********************************************************************
1897! !
1898! It loads a vector set of real values in YAML block-list structure, !
1899! V(1:Nitems)%vector(1:Nvalues). If the dummy argument V structure !
1900! is allocated, it deallocates/allocates the required Nitems and !
1901! Nvalues dimensions. !
1902! !
1903! On Input: !
1904! !
1905! self YAML tree dictionary object (CLASS yaml_tree) !
1906! keystring YAML tree aggregated keys (string) !
1907! !
1908! On Output: !
1909! !
1910! V Vector of reals in block list (TYPE yaml_Rvec) !
1911! status Error code (integer) !
1912! !
1913!***********************************************************************
1914!
1915! Imported variable declarations.
1916!
1917 class(yaml_tree), intent(in) :: self
1918 character (len=*), intent(in) :: keystring
1919 TYPE (yaml_Rvec), allocatable, intent(out) :: V(:)
1920!
1921! Local variable declarations.
1922!
1923 TYPE (yaml_extract), allocatable :: S(:)
1924!
1925 integer :: Nitems, Nvalues, i, n
1926 integer :: status
1927!
1928 character (len=Lmax) :: msg
1929
1930 character (len=*), parameter :: MyFile = &
1931 & __FILE__//", yaml_Get_r_struc"
1932!
1933!-----------------------------------------------------------------------
1934! Extract requested key-string values.
1935!-----------------------------------------------------------------------
1936!
1937 status=noerr
1938!
1939 IF (yaml_error(self%extract(keystring, s), &
1940 & noerr, __line__, myfile)) RETURN
1941!
1942! Allocate output structure.
1943!
1944 nitems=SIZE(s, dim=1)
1945 IF (ALLOCATED(v)) DEALLOCATE (v)
1946 ALLOCATE ( v(nitems) )
1947!
1948! Convert string vector values to floating-point.
1949!
1950 DO n=1,nitems
1951 IF (s(n)%has_vector) THEN
1952 nvalues=SIZE(s(n)%vector)
1953 ALLOCATE ( v(n)%vector(nvalues) )
1954 DO i=1,nvalues
1955 READ (s(n)%vector(i)%value, * ,iostat=status, iomsg=msg) &
1956 & v(n)%vector(i)
1957 IF (yaml_error(status, noerr, __line__, myfile)) THEN
1958 yaml_errflag=5
1959 IF (yaml_master) WRITE (yaml_stdout,10) trim(keystring), &
1960 & s(n)%vector(i)%value, &
1961 & trim(msg)
1962 RETURN
1963 END IF
1964 END DO
1965 ELSE
1966 READ (s(n)%value, * ,iostat=status, iomsg=msg) &
1967 & v(n)%vector(i)
1968 IF (yaml_error(status, noerr, __line__, myfile)) THEN
1969 yaml_errflag=5
1970 IF (yaml_master) WRITE (yaml_stdout,10) trim(keystring), &
1971 & s(n)%value, &
1972 & trim(msg)
1973 RETURN
1974 END IF
1975 END IF
1976 END DO
1977!
1978! Deallocate local extraction structure.
1979!
1980 IF (ALLOCATED(s)) DEALLOCATE (s)
1981!
1982 10 FORMAT (/,' YAML_GET_R_STRUC - Error while converting string to', &
1983 & ' real, key: ',a,', value = ',a,/,20x,'ErrMsg: ',a)
1984!
1985 RETURN

References yaml_parser_mod::noerr, and yaml_parser_mod::yaml_error().

Here is the call graph for this function:

◆ yaml_get_rvar_0d()

integer function yaml_parser_mod::yaml_get::yaml_get_rvar_0d ( class (yaml_tree), intent(in) self,
character (len=*), intent(in) keystring,
real (kind_real), intent(out) value )

Definition at line 2378 of file yaml_parser.F.

2379!
2380!***********************************************************************
2381! !
2382! It gets scalar floating-point data from YAML dictionary object. !
2383! !
2384! On Input: !
2385! !
2386! self YAML tree dictionary object (CLASS yaml_tree) !
2387! keystring YAML tree aggregated keys (string) !
2388! !
2389! On Output: !
2390! !
2391! value YAML value (real; scalar) !
2392! status Error code (integer) !
2393! !
2394!***********************************************************************
2395!
2396! Imported variable declarations.
2397!
2398 class(yaml_tree), intent(in) :: self
2399 character (len=*), intent(in) :: keystring
2400 real (kind_real), intent(out) :: value
2401!
2402! Local variable declarations.
2403!
2404 TYPE (yaml_extract), allocatable :: S(:)
2405!
2406 integer :: Nvalues, ie, status
2407!
2408 character (len=Lmax) :: msg
2409
2410 character (len=*), parameter :: MyFile = &
2411 & __FILE__//", yaml_Get_rvar_0d"
2412!
2413!-----------------------------------------------------------------------
2414! Extract requested key-string value.
2415!-----------------------------------------------------------------------
2416!
2417 status=noerr
2418!
2419 IF (yaml_error(self%extract(keystring, s), &
2420 & noerr, __line__, myfile)) RETURN
2421!
2422! Make sure that extracted value is a scalar.
2423!
2424 nvalues=SIZE(s)
2425!
2426 IF (nvalues.gt.1) THEN
2427 yaml_errflag=7
2428 status=yaml_errflag
2429 IF (yaml_error(yaml_errflag, noerr, __line__, myfile)) THEN
2430 IF (yaml_master) WRITE (yaml_stdout,10) keystring, nvalues, &
2431 & self%filename
2432 RETURN
2433 END IF
2434!
2435! Convert string value to real.
2436!
2437 ELSE
2438 s(1)%value=adjustl(s(1)%value)
2439 ie=len_trim(s(1)%value)
2440 READ (s(1)%value(1:ie), *, iostat=status, iomsg=msg) value
2441 IF (yaml_error(status, noerr, __line__, myfile)) THEN
2442 yaml_errflag=5
2443 IF (yaml_master) WRITE (yaml_stdout,20) trim(keystring), &
2444 & s(1)%value, trim(msg)
2445 RETURN
2446 END IF
2447 END IF
2448!
2449! Deallocate.
2450!
2451 IF (ALLOCATED(s)) DEALLOCATE (s)
2452!
2453 10 FORMAT (/,' YAML_GET_RVAR_0D - Extracted value is not a scalar,', &
2454 & ' key-string: ',a,/,20x,'Nvalues = ',i0,/,20x,'File: ',a)
2455 20 FORMAT (/,' YAML_GET_RVAR_0D - Error while converting string to', &
2456 & ' integer, key: ',a,', value = ',a,/,20x,'ErrMsg: ',a)
2457!
2458 RETURN

References yaml_parser_mod::noerr, and yaml_parser_mod::yaml_error().

Here is the call graph for this function:

◆ yaml_get_rvar_1d()

integer function yaml_parser_mod::yaml_get::yaml_get_rvar_1d ( class (yaml_tree), intent(in) self,
character (len=*), intent(in) keystring,
real (kind_real), dimension(:), intent(out) value )

Definition at line 2461 of file yaml_parser.F.

2462!
2463!***********************************************************************
2464! !
2465! It gets 1D floating-point data from YAML dictionary object. !
2466! !
2467! On Input: !
2468! !
2469! self YAML tree dictionary object (CLASS yaml_tree) !
2470! keystring YAML tree aggregated keys (string) !
2471! !
2472! On Output: !
2473! !
2474! value YAML value (real; 1D-array) !
2475! status Error code (integer) !
2476! !
2477!***********************************************************************
2478!
2479! Imported variable declarations.
2480!
2481 class(yaml_tree), intent(in) :: self
2482 character (len=*), intent(in) :: keystring
2483 real (kind_real), intent(out) :: value(:)
2484!
2485! Local variable declarations.
2486!
2487 TYPE (yaml_extract), allocatable :: S(:)
2488!
2489 integer :: Nvalues, i, ie, status
2490!
2491 character (len=Lmax) :: msg
2492
2493 character (len=*), parameter :: MyFile = &
2494 & __FILE__//", yaml_Get_rvar_1d"
2495!
2496!-----------------------------------------------------------------------
2497! Extract requested key-string values.
2498!-----------------------------------------------------------------------
2499!
2500 status=noerr
2501!
2502 IF (yaml_error(self%extract(keystring, s), &
2503 & noerr, __line__, myfile)) RETURN
2504!
2505! Make sure that extracted value is a scalar.
2506!
2507 nvalues=SIZE(s, dim=1)
2508!
2509 IF (SIZE(value, dim=1).lt.nvalues) THEN
2510 yaml_errflag=7
2511 status=yaml_errflag
2512 IF (yaml_error(yaml_errflag, noerr, __line__, myfile)) THEN
2513 IF (yaml_master) WRITE (yaml_stdout,10) keystring, nvalues, &
2514 & SIZE(value, dim=1), &
2515 & self%filename
2516 RETURN
2517 END IF
2518 END IF
2519!
2520! Convert string values to reals.
2521!
2522 DO i=1,nvalues
2523 s(i)%value=adjustl(s(i)%value)
2524 ie=len_trim(s(i)%value)
2525 READ (s(i)%value(1:ie), *, iostat=status, iomsg=msg) value(i)
2526 IF (yaml_error(status, noerr, __line__, myfile)) THEN
2527 yaml_errflag=5
2528 IF (yaml_master) WRITE (yaml_stdout,20) trim(keystring), &
2529 & s(i)%value, trim(msg)
2530 RETURN
2531 END IF
2532 END DO
2533!
2534! Deallocate.
2535!
2536 IF (ALLOCATED(s)) DEALLOCATE (s)
2537!
2538 10 FORMAT (/,' YAML_GET_RVAR_1D - Inconsistent number of values,', &
2539 & ' key-string: ',a,/,20x,'YAML size = ',i0, &
2540 & ', Variable size = ',i0,/,20x,'File: ',a)
2541 20 FORMAT (/,' YAML_GET_RVAR_1D - Error while converting string to', &
2542 & ' real, key: ',a,', value = ',a,/,20x,'ErrMsg: ',a)
2543!
2544 RETURN

References yaml_parser_mod::noerr, and yaml_parser_mod::yaml_error().

Here is the call graph for this function:

◆ yaml_get_s_struc()

integer function yaml_parser_mod::yaml_get::yaml_get_s_struc ( class (yaml_tree), intent(in) self,
character (len=*), intent(in) keystring,
type (yaml_svec), dimension(:), intent(out), allocatable v )

Definition at line 1988 of file yaml_parser.F.

1989!
1990!***********************************************************************
1991! !
1992! It loads a vector set of strings in YAML block-list structure, !
1993! V(1:Nitems)%vector(1:Nvalues)%value. If the dummy argument V !
1994! structure is allocated, it deallocates/allocates the required !
1995! Nitems and Nvalues dimensions. !
1996! !
1997! On Input: !
1998! !
1999! self YAML tree dictionary object (CLASS yaml_tree) !
2000! keystring YAML tree aggregated keys (string) !
2001! !
2002! On Output: !
2003! !
2004! V Vector of strings in block list (TYPE yaml_Svec) !
2005! status Error code (integer) !
2006! !
2007!***********************************************************************
2008!
2009! Imported variable declarations.
2010!
2011 class(yaml_tree), intent(in) :: self
2012 character (len=*), intent(in) :: keystring
2013 TYPE (yaml_Svec), allocatable, intent(out) :: V(:)
2014!
2015! Local variable declarations.
2016!
2017 TYPE (yaml_extract), allocatable :: S(:)
2018!
2019 integer :: Nitems, Nvalues, n, i
2020 integer :: status
2021!
2022 character (len=*), parameter :: MyFile = &
2023 & __FILE__//", yaml_Get_s_struc"
2024!
2025!-----------------------------------------------------------------------
2026! Extract requested key-string values.
2027!-----------------------------------------------------------------------
2028!
2029 status=noerr
2030!
2031 IF (yaml_error(self%extract(keystring, s), &
2032 & noerr, __line__, myfile)) RETURN
2033!
2034! Allocate output structure.
2035!
2036 nitems=SIZE(s, dim=1)
2037 IF (ALLOCATED(v)) DEALLOCATE (v)
2038 ALLOCATE ( v(nitems) )
2039!
2040! Load string vector values to output structure.
2041!
2042 DO n=1,nitems
2043 IF (s(n)%has_vector) THEN
2044 nvalues=SIZE(s(n)%vector)
2045 ALLOCATE ( v(n)%vector(nvalues) )
2046 DO i=1,nvalues
2047 v(n)%vector(i)%value=s(n)%vector(i)%value
2048 END DO
2049 ELSE
2050 v(n)%value=s(n)%value
2051 END IF
2052 END DO
2053!
2054! Deallocate local extraction structure.
2055!
2056 IF (ALLOCATED(s)) DEALLOCATE (s)
2057!
2058 RETURN

References yaml_parser_mod::noerr, and yaml_parser_mod::yaml_error().

Here is the call graph for this function:

◆ yaml_get_svar_0d()

integer function yaml_parser_mod::yaml_get::yaml_get_svar_0d ( class (yaml_tree), intent(in) self,
character (len=*), intent(in) keystring,
character (len=*), intent(out) value )

Definition at line 2547 of file yaml_parser.F.

2548!
2549!***********************************************************************
2550! !
2551! It gets scalar string data from YAML dictionary object. !
2552! !
2553! On Input: !
2554! !
2555! self YAML tree dictionary object (CLASS yaml_tree) !
2556! keystring YAML tree aggregated keys (string) !
2557! !
2558! On Output: !
2559! !
2560! value YAML value (string; scalar) !
2561! status Error code (integer) !
2562! !
2563!***********************************************************************
2564!
2565! Imported variable declarations.
2566!
2567 class(yaml_tree), intent(in ) :: self
2568 character (len=*), intent(in ) :: keystring
2569 character (len=*), intent(out) :: value
2570!
2571! Local variable declarations.
2572!
2573 TYPE (yaml_extract), allocatable :: S(:)
2574!
2575 integer :: Nvalues, status
2576!
2577 character (len=*), parameter :: MyFile = &
2578 & __FILE__//", yaml_Get_lvar_0d"
2579!
2580!-----------------------------------------------------------------------
2581! Extract requested key-string value.
2582!-----------------------------------------------------------------------
2583!
2584 status=noerr
2585!
2586 IF (yaml_error(self%extract(keystring, s), &
2587 & noerr, __line__, myfile)) RETURN
2588!
2589! Make sure that extracted value is a scalar.
2590!
2591 nvalues=SIZE(s)
2592!
2593 IF (nvalues.gt.1) THEN
2594 yaml_errflag=7
2595 status=yaml_errflag
2596 IF (yaml_error(yaml_errflag, noerr, __line__, myfile)) THEN
2597 IF (yaml_master) WRITE (yaml_stdout,10) keystring, nvalues, &
2598 & self%filename
2599 RETURN
2600 END IF
2601!
2602! Load string value.
2603!
2604 ELSE
2605 value=s(1)%value
2606 END IF
2607!
2608! Deallocate.
2609!
2610 IF (ALLOCATED(s)) DEALLOCATE (s)
2611!
2612 10 FORMAT (/,' YAML_GET_SVAR_0D - Extracted value is not a scalar,', &
2613 & ' key-string: ',a,/,20x,'Nvalues = ',i0,/,20x,'File: ',a)
2614!
2615 RETURN

References yaml_parser_mod::noerr, and yaml_parser_mod::yaml_error().

Here is the call graph for this function:

◆ yaml_get_svar_1d()

integer function yaml_parser_mod::yaml_get::yaml_get_svar_1d ( class (yaml_tree), intent(in) self,
character (len=*), intent(in) keystring,
character (len=*), dimension(:), intent(out) value )

Definition at line 2618 of file yaml_parser.F.

2619!
2620!***********************************************************************
2621! !
2622! It gets 1D string data from YAML dictionary object. !
2623! !
2624! On Input: !
2625! !
2626! self YAML tree dictionary object (CLASS yaml_tree) !
2627! keystring YAML tree aggregated keys (string) !
2628! !
2629! On Output: !
2630! !
2631! value YAML value (string; 1D-array) !
2632! status Error code (integer) !
2633! !
2634!***********************************************************************
2635!
2636! Imported variable declarations.
2637!
2638 class(yaml_tree), intent(in ) :: self
2639 character (len=*), intent(in ) :: keystring
2640 character (len=*), intent(out) :: value(:)
2641!
2642! Local variable declarations.
2643!
2644 TYPE (yaml_extract), allocatable :: S(:)
2645!
2646 integer :: Nvalues, i, status
2647!
2648 character (len=*), parameter :: MyFile = &
2649 & __FILE__//", yaml_Get_lvar_1d"
2650!
2651!-----------------------------------------------------------------------
2652! Extract requested key-string values.
2653!-----------------------------------------------------------------------
2654!
2655 status=noerr
2656!
2657 IF (yaml_error(self%extract(keystring, s), &
2658 & noerr, __line__, myfile)) RETURN
2659!
2660! Make sure that extracted value is a scalar.
2661!
2662 nvalues=SIZE(s, dim=1)
2663!
2664 IF (SIZE(value, dim=1).lt.nvalues) THEN
2665 yaml_errflag=7
2666 status=yaml_errflag
2667 IF (yaml_error(yaml_errflag, noerr, __line__, myfile)) THEN
2668 IF (yaml_master) WRITE (yaml_stdout,10) keystring, nvalues, &
2669 & SIZE(value, dim=1), &
2670 & self%filename
2671 RETURN
2672 END IF
2673 END IF
2674!
2675! Load string values.
2676!
2677 DO i=1,nvalues
2678 value(i)=s(i)%value
2679 END DO
2680!
2681! Deallocate.
2682!
2683 IF (ALLOCATED(s)) DEALLOCATE (s)
2684!
2685 10 FORMAT (/,' YAML_GET_SVAR_1D - Inconsistent number of values,', &
2686 & ' key-string: ',a,/,20x,'YAML size = ',i0, &
2687 & ', Variable size = ',i0,/,20x,'File: ',a)
2688!
2689 RETURN

References yaml_parser_mod::noerr, and yaml_parser_mod::yaml_error().

Here is the call graph for this function:

The documentation for this interface was generated from the following file: