ROMS
Loading...
Searching...
No Matches
yaml_parser_mod Module Reference

Data Types

type  yaml_extract
 
interface  yaml_get
 
type  yaml_ivec
 
type  yaml_lvec
 
type  yaml_pair
 
type  yaml_rvec
 
type  yaml_svec
 
type  yaml_tree
 

Functions/Subroutines

integer function, public yaml_initialize (self, filename, report)
 
subroutine yaml_tree_create (self)
 
subroutine yaml_tree_destroy (self)
 
subroutine yaml_tree_dump (self)
 
integer function yaml_tree_extract (self, keystring, s)
 
subroutine yaml_tree_fill (self)
 
subroutine yaml_tree_fill_aliases (self, nalias, nanchor)
 
logical function yaml_tree_has (self, keystring)
 
integer function yaml_tree_read_line (self, nblanks, line, key, value, anchor, lswitch)
 
integer function, public yaml_assignstring (outstring, inpstring, lstr)
 
integer function, private yaml_countkeys (string, token)
 
logical function, public yaml_error (flag, noerr, line, routine)
 
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)
 
character(len=len(sinp)) function, private yaml_lowercase (sinp)
 
character(len=len(sinp)) function, private yaml_uppercase (sinp)
 
subroutine, private yaml_valuetype (value, lswitch)
 

Variables

logical, parameter ldebugyaml = .FALSE.
 
integer, parameter ldim = 8
 
integer, parameter lkey = 254
 
integer, parameter lmax = 2048
 
integer, parameter noerr = 0
 
integer, parameter iunit = 222
 
character(len=55), dimension(7) yaml_errmsg = (/ ' YAML_PARSER - Blows up ................ yaml_ErrFlag: ', ' YAML_PARSER - Input error ............. yaml_ErrFlag: ', ' YAML_PARSER - Output error ............ yaml_ErrFlag: ', ' YAML_PARSER - I/O error ............... yaml_ErrFlag: ', ' YAML_PARSER - Configuration error ..... yaml_ErrFlag: ', ' YAML_PARSER - Partition error ......... yaml_ErrFlag: ', ' YAML_PARSER - Illegal input parameter . yaml_ErrFlag: ' /)
 

Function/Subroutine Documentation

◆ yaml_assignstring()

integer function, public yaml_parser_mod::yaml_assignstring ( character (len=:), intent(inout), allocatable outstring,
character (len=*), intent(in) inpstring,
integer, intent(out) lstr )

Definition at line 1587 of file yaml_parser.F.

1589!
1590!=======================================================================
1591! !
1592! It assigns allocatable strings. It allocates/reallocates output !
1593! string variable. !
1594! !
1595! On Input: !
1596! !
1597! InpString String to be assigned (character) !
1598! !
1599! On Output: !
1600! !
1601! OutString Assigned allocatable string (character) !
1602! Lstr Length allocated string (integer) !
1603! ErrFlag Error flag (integer) !
1604! !
1605!=======================================================================
1606!
1607! Imported variable declarations.
1608!
1609 character (len=:), allocatable, intent(inout) :: OutString
1610 character (len=*), intent(in) :: InpString
1611 integer, intent(out) :: Lstr
1612!
1613! Local variable declarations.
1614!
1615 integer :: ErrFlag
1616!
1617!-----------------------------------------------------------------------
1618! Allocate output string to the size of input string.
1619!-----------------------------------------------------------------------
1620!
1621 errflag = -1
1622!
1623 lstr=len_trim(inpstring)
1624 IF (.not.allocated(outstring)) THEN
1625 allocate ( character(LEN=Lstr) :: OutString, STAT=errflag)
1626 ELSE
1627 deallocate (outstring)
1628 allocate ( character(LEN=Lstr) :: OutString, STAT=errflag)
1629 END IF
1630!
1631! Assign requested value.
1632!
1633 outstring = inpstring
1634!
1635 RETURN

Referenced by yaml_initialize(), yaml_tree_extract(), yaml_tree_fill(), yaml_tree_fill_aliases(), and yaml_tree_has().

Here is the caller graph for this function:

◆ yaml_countkeys()

integer function, private yaml_parser_mod::yaml_countkeys ( character (len=*), intent(in) string,
character (len=*), intent(in) token )
private

Definition at line 1638 of file yaml_parser.F.

1639!
1640!=======================================================================
1641! !
1642! It counts the number of concatenated key separated by the specified !
1643! token during processing extraction from YAML object. The same task !
1644! can be done elegantly as: !
1645! !
1646! nkeys=COUNT((/ (string(i:i), i=1,Lstr) /) == token) + 1 !
1647! !
1648! But compiliers like 'gfortran' cannot handle such abstraction. !
1649! !
1650! On Input: !
1651! !
1652! string Aggregated YAML keys (string) !
1653! token Key separator (string) !
1654! !
1655! On Output: !
1656! !
1657! nkeys Number of aggregated keys (integer) !
1658! !
1659!=======================================================================
1660!
1661! Imported variable declarations.
1662!
1663 character (len=*), intent(in) :: string
1664 character (len=*), intent(in) :: token
1665!
1666! Local variable declarations.
1667!
1668 integer :: nkeys
1669 integer :: Lstr, i
1670!
1671!-----------------------------------------------------------------------
1672! Count number of concatenated keys in input string.
1673!-----------------------------------------------------------------------
1674!
1675 nkeys=1
1676 lstr=len_trim(string)
1677 DO i=1,lstr
1678 IF (string(i:i).eq.token) THEN
1679 nkeys=nkeys+1
1680 END IF
1681 END DO
1682!
1683 RETURN

Referenced by yaml_tree_extract(), and yaml_tree_has().

Here is the caller graph for this function:

◆ yaml_error()

logical function, public yaml_parser_mod::yaml_error ( integer, intent(in) flag,
integer, intent(in) noerr,
integer, intent(in) line,
character (len=*), intent(in) routine )

Definition at line 1686 of file yaml_parser.F.

1687!
1688!=======================================================================
1689! !
1690! It checks YAML execution flag against no-error code and issue a !
1691! message if they are not equal. !
1692! !
1693! On Input: !
1694! !
1695! flag YAML execution flag (integer) !
1696! NoErr No Error code (integer) !
1697! line Calling model routine line (integer) !
1698! routine Calling model routine (string) !
1699! !
1700! On Output: !
1701! !
1702! foundit The value of the result is TRUE/FALSE if the !
1703! execution flag is in error. !
1704! !
1705!=======================================================================
1706!
1707! Imported variable declarations.
1708!
1709 integer, intent(in) :: flag, NoErr, line
1710
1711 character (len=*), intent(in) :: routine
1712!
1713! Local variable declarations.
1714!
1715 logical :: foundit
1716!
1717!-----------------------------------------------------------------------
1718! Scan array for requested string.
1719!-----------------------------------------------------------------------
1720!
1721 foundit=.false.
1722 IF (flag.ne.noerr) THEN
1723 foundit=.true.
1724 IF (yaml_master) THEN
1725 WRITE (yaml_stdout,10) flag, line, trim(routine)
1726 10 FORMAT (' Found Error: ', i2.2, t20, 'Line: ', i0, &
1727 & t35, 'Source: ', a)
1728 END IF
1729 FLUSH (yaml_stdout)
1730 END IF
1731
1732 RETURN

References noerr.

Referenced by cmeps_roms_mod::roms_create(), yaml_parser_mod::yaml_get::yaml_get_i_struc(), yaml_parser_mod::yaml_get::yaml_get_ivar_0d(), yaml_parser_mod::yaml_get::yaml_get_ivar_1d(), yaml_parser_mod::yaml_get::yaml_get_l_struc(), yaml_parser_mod::yaml_get::yaml_get_lvar_0d(), yaml_parser_mod::yaml_get::yaml_get_lvar_1d(), yaml_parser_mod::yaml_get::yaml_get_r_struc(), yaml_parser_mod::yaml_get::yaml_get_rvar_0d(), yaml_parser_mod::yaml_get::yaml_get_rvar_1d(), yaml_parser_mod::yaml_get::yaml_get_s_struc(), yaml_parser_mod::yaml_get::yaml_get_svar_0d(), yaml_parser_mod::yaml_get::yaml_get_svar_1d(), yaml_initialize(), yaml_tree_create(), yaml_tree_extract(), yaml_tree_fill(), yaml_tree_fill_aliases(), yaml_tree_has(), and yaml_tree_read_line().

Here is the caller graph for this function:

◆ yaml_get_i_struc()

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

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

◆ yaml_get_ivar_0d()

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

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

◆ yaml_get_ivar_1d()

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

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

◆ yaml_get_l_struc()

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

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

◆ yaml_get_lvar_0d()

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

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

◆ yaml_get_lvar_1d()

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

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

◆ yaml_get_r_struc()

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

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

◆ yaml_get_rvar_0d()

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

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

◆ yaml_get_rvar_1d()

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

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

◆ yaml_get_s_struc()

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

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

◆ yaml_get_svar_0d()

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

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

◆ yaml_get_svar_1d()

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

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

◆ yaml_initialize()

integer function, public yaml_parser_mod::yaml_initialize ( class (yaml_tree), intent(inout) self,
character (len=*), intent(in) filename,
logical, intent(in), optional report )

Definition at line 286 of file yaml_parser.F.

287!
288!***********************************************************************
289! !
290! It creates a YAML tree dictionary object. First, it reads the YAML !
291! file to determine the indentation policy and length of list oject !
292! (TYPE yaml_tree). !
293! !
294! After the object is allocated, the Fortran unit is rewinded and the !
295! YAML file is read again to populate the keyword values. !
296! !
297! On Input: !
298! !
299! self YAML tree dictionary object (CLASS yaml_tree) !
300! filename YAML filename (string) !
301! report Switch to dump to standard output (logical, OPTIONAL) !
302! !
303! On Ouptut: !
304! !
305! self Allocated and populated YAML object. !
306! status Error flag (integer) !
307! !
308!***********************************************************************
309!
310! Imported variable declarations.
311!
312 class(yaml_tree), intent(inout) :: self
313 character (len=*), intent(in ) :: filename
314 logical, optional, intent(in ) :: report
315!
316! Local variable declarations.
317!
318 logical :: Ldump
319!
320 integer :: LenStr, status
321!
322 character (len=*), parameter :: MyFile = &
323 & __FILE__//", yaml_initialize"
324!
325!-----------------------------------------------------------------------
326! Initialize YAML object.
327!-----------------------------------------------------------------------
328!
329 status=noerr
330!
331! Set switch to print the processed YAML key/value pairs to standard
332! ouput.
333!
334 IF (PRESENT(report)) THEN
335 ldump = report
336 ELSE
337 ldump = .false.
338 END IF
339!
340! Set YAML file path and name.
341!
342 IF (yaml_error(yaml_assignstring(self%filename, &
343 & filename, lenstr), &
344 & noerr, __line__, myfile)) THEN
345 status=yaml_errflag
346 RETURN
347 END IF
348!
349! Create and populate YAML object.
350!
351 IF (self%IsCreated) CALL self%destroy ()
352!
353 CALL self%create ()
354 IF (yaml_error(yaml_errflag, noerr, __line__, myfile)) THEN
355 status=yaml_errflag
356 RETURN
357 END IF
358!
359! Report YAML tree dictionary, for debugging.
360!
361 IF (ldump) CALL self%dump ()
362!
363 RETURN

References noerr, yaml_assignstring(), and yaml_error().

Referenced by get_metadata_mod::cmeps_metadata(), get_metadata_mod::coupling_metadata(), and cmeps_roms_mod::roms_create().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ yaml_lowercase()

character (len=len(sinp)) function, private yaml_parser_mod::yaml_lowercase ( character(len=*), intent(in) sinp)
private

Definition at line 2692 of file yaml_parser.F.

2693!
2694!=======================================================================
2695! !
2696! It converts all string elements to lowercase. !
2697! !
2698! Reference: !
2699! !
2700! Cooper Redwine, 1995: "Upgrading to Fortran 90", Springer- !
2701! Verlag, New York, pp 416. !
2702! !
2703!=======================================================================
2704!
2705! Imported variable declarations.
2706!
2707 character(len=*), intent(in) :: Sinp
2708!
2709! Local variable definitions.
2710!
2711 integer :: Lstr, i, j
2712
2713 character (len=LEN(Sinp)) :: Sout
2714
2715 character (len=26), parameter :: L = 'abcdefghijklmnopqrstuvwxyz'
2716 character (len=26), parameter :: U = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
2717!
2718!-----------------------------------------------------------------------
2719! Convert input string to lowercase.
2720!-----------------------------------------------------------------------
2721!
2722 lstr=len(sinp)
2723 sout=sinp
2724 DO i=1,lstr
2725 j=index(u, sout(i:i))
2726 IF (j.ne.0) THEN
2727 sout(i:i)=l(j:j)
2728 END IF
2729 END DO
2730!
2731 RETURN

◆ yaml_tree_create()

subroutine yaml_parser_mod::yaml_tree_create ( class (yaml_tree), intent(inout) self)
private

Definition at line 366 of file yaml_parser.F.

367!
368!***********************************************************************
369! !
370! It creates a YAML tree dictionary object. First, it reads the YAML !
371! file to determine the dimensions of parent and children structures. !
372! After the structures are allocate, the Fortran unit is rewinded and !
373! YAML file is read again to populate the keyword values. !
374! !
375! On Input: !
376! !
377! self YAML tree dictionary object (CLASS yaml_tree) !
378! !
379! On Ouptut: !
380! !
381! self Allocated and populated YAML object. !
382! !
383!***********************************************************************
384!
385! Imported variable declarations.
386!
387 class(yaml_tree), intent(inout) :: self
388!
389! Local variable declarations.
390!
391 logical :: FirstPass, Lswitch(Ldim)
392!
393 integer :: Nblanks, Nbranches, Npairs
394 integer :: i, io_err, status
395!
396 character (len=Lkey) :: anchor, io_errmsg, key
397 character (len=Lmax) :: line, value
398!
399 character (len=*), parameter :: MyFile = &
400 & __FILE__//", yaml_tree_create"
401!
402!-----------------------------------------------------------------------
403! Open YAML file for reading.
404!-----------------------------------------------------------------------
405!
406 OPEN (unit=iunit, file=self%filename, form='formatted', &
407 & status='old', iostat=io_err, iomsg=io_errmsg)
408 IF (io_err.ne.0) THEN
409 yaml_errflag=5
410 IF (yaml_error(yaml_errflag, noerr, __line__, myfile)) THEN
411 IF (yaml_master) WRITE (yaml_stdout,10) self%filename, &
412 & trim(io_errmsg)
413 RETURN
414 END IF
415 END IF
416!
417! Determine the total number of YAML key/value pairs.
418!
419 nblanks = 0
420 nbranches = 0
421 npairs = 0
422!
423 firstpass = .true.
424!
425 yaml_line : DO WHILE (.true.)
426!
427 status=self%read_line(nblanks, line, key, value, anchor, &
428 & lswitch)
429!
430 SELECT CASE (status)
431 CASE (-1) ! error condition during reading
432 yaml_errflag=5
433 IF (yaml_error(yaml_errflag, noerr, __line__, myfile)) THEN
434 IF (yaml_master) WRITE (yaml_stdout,20) self%filename, &
435 & trim(line)
436 RETURN
437 END IF
438 CASE (0) ! end-of-file
439 EXIT
440 CASE (1) ! blank or comment line, move to the next line
441 cycle
442 CASE (2) ! processed viable line
443 npairs=npairs+1
444 END SELECT
445!
446! If no leading blanks, advance YAML tree branch counter.
447!
448 IF (nblanks.eq.0) THEN
449 nbranches = nbranches+1 ! hierarchy start
450 END IF
451!
452! On first pass, establish indentation policy: number of blanks.
453!
454 IF (firstpass.and.(nblanks.gt.0)) THEN
455 firstpass=.false.
456 self%indent=nblanks
457 END IF
458!
459! Check for consitent identation policy. Some YAML validators impose
460! a two-blank spacing policy.
461!
462 IF (nblanks.gt.0) THEN
463 IF (mod(nblanks, self%indent).ne.0) THEN
464 yaml_errflag=2
465 IF (yaml_error(yaml_errflag, noerr, __line__, myfile)) THEN
466 IF (yaml_master) WRITE (yaml_stdout,30) nblanks, &
467 & self%indent
468 RETURN
469 END IF
470 END IF
471 END IF
472
473 END DO yaml_line
474!
475! Rewind unit since we need to reprocess the file again to load the
476! data into the allocated "self%list(1:Npairs)" container.
477!
478 rewind(iunit)
479!
480!-----------------------------------------------------------------------
481! Allocate YAML dictionary container.
482!-----------------------------------------------------------------------
483!
484! Set number of main branches and number of key/values in YAML 'list'.
485!
486 self%Nbranches=nbranches
487 self%Npairs=npairs
488!
489! Allocate YAML key/value pair list (TYPE 'yaml_pair') object.
490!
491 IF (.not.self%IsCreated) THEN
492 ALLOCATE ( self%list(npairs) )
493 self%IsCreated=.true.
494 END IF
495!
496!-----------------------------------------------------------------------
497! Re-read YAML file again and populate dictionary.
498!-----------------------------------------------------------------------
499!
500 CALL self%fill ()
501!
502 10 FORMAT (/,' YAML_TREE_CREATE - Unable to open input YAML file: ', &
503 & a,/,20x,'ERROR: ',a)
504 20 FORMAT (/,' YAML_TREE_CREATE - Error while reading YAML file: ', &
505 & a,/,20x,'LINE: ',a)
506 30 FORMAT (/,' YAML_TREE_CREATE - Inconsistent indentation, ', &
507 & 'self%indent = ',i0,', nblanks = ',i0)
508 40 FORMAT (/,' YAML_TREE_CREATE - Inconsistent indentation, ', &
509 & 'nblanks = ',i0,', indent blank policy = ',i0,/,20x, &
510 & 'Number of nested collections = ',i0, &
511 & ' is greater than 3',/,20x,'Line: ',a)
512 50 FORMAT (/,' YAML_TREE_CREATE - Cannot find branches in YAML ', &
513 & 'file: ',a)
514!
515 RETURN

References iunit, noerr, and yaml_error().

Here is the call graph for this function:

◆ yaml_tree_destroy()

subroutine yaml_parser_mod::yaml_tree_destroy ( class (yaml_tree), intent(inout) self)
private

Definition at line 518 of file yaml_parser.F.

519!
520!***********************************************************************
521! !
522! It deallocates/destroys the YAML dictionary object. !
523! !
524! Arguments: !
525! !
526! self YAML tree dictionary object (CLASS yaml_tree) !
527! !
528!***********************************************************************
529!
530! Imported variable declarations.
531!
532 class(yaml_tree), intent(inout) :: self
533!
534! Local variable declarations.
535!
536 logical :: Lopened
537!
538!-----------------------------------------------------------------------
539! Deallocate YAML dictionary object.
540!-----------------------------------------------------------------------
541!
542! If applicable, close YAML Fortran unit.
543!
544 INQUIRE (unit=iunit, opened=lopened)
545 IF (lopened) THEN
546 CLOSE (iunit)
547 END IF
548!
549! Recall that Fortran 2003 standard allows deallocating just the
550! parent object to deallocate all array variables within its scope
551! automatically.
552!
553 IF (ASSOCIATED(self%list)) THEN
554 self%IsCreated=.false.
555 DEALLOCATE (self%list)
556 END IF
557!
558 RETURN

References iunit.

◆ yaml_tree_dump()

subroutine yaml_parser_mod::yaml_tree_dump ( class (yaml_tree), intent(in) self)
private

Definition at line 561 of file yaml_parser.F.

562!
563!***********************************************************************
564! !
565! It prints the YAML dictionary to standard output for debugging !
566! purposes. !
567! !
568! Arguments: !
569! !
570! self YAML tree dictionary object (CLASS yaml_tree) !
571! !
572!***********************************************************************
573!
574! Imported variable declarations.
575!
576 class(yaml_tree), intent(in) :: self
577!
578! Local variable declarations.
579!
580 integer :: Lstr, Nblanks, i, indent, padding
581!
582 character (len=Lkey) :: key
583 character (len=Lmax) :: string, value
584!
585!-----------------------------------------------------------------------
586! Report the contents of the YAML tree directory.
587!-----------------------------------------------------------------------
588!
589 IF (yaml_master) THEN
590 WRITE (yaml_stdout,10) self%filename
591 indent=self%indent
592!
593 DO i=1,self%Npairs
594 padding=self%list(i)%left_padding
595 nblanks=indent*padding
596 key=self%list(i)%key
597 IF (ALLOCATED(self%list(i)%value)) THEN
598 value=self%list(i)%value
599 lstr=len_trim(value)
600 ELSE
601 lstr=0
602 END IF
603 IF (self%list(i)%is_block) THEN
604 IF (lstr.gt.0) THEN
605 IF (self%list(i)%is_sequence) THEN
606 WRITE (string,20) i, repeat(char(32),nblanks), '- ', &
607 & trim(key), ': [', trim(value), ']'
608 ELSE
609 WRITE (string,30) i, repeat(char(32),nblanks), '- ', &
610 & trim(key), ': ', trim(value)
611 END IF
612 ELSE
613 WRITE (string,40) i, repeat(char(32),nblanks), '- ', &
614 & trim(key), ':'
615 END IF
616 ELSE
617 IF (lstr.gt.0) THEN
618 IF (self%list(i)%is_sequence) THEN
619 WRITE (string,30) i, repeat(char(32),nblanks), &
620 & trim(key), ': [', trim(value), ']'
621 ELSE
622 WRITE (string,40) i, repeat(char(32),nblanks), &
623 & trim(key), ': ', trim(value)
624 END IF
625 ELSE
626 WRITE (string,50) i, repeat(char(32),nblanks), &
627 & trim(key), ':'
628 END IF
629 END IF
630 WRITE (yaml_stdout,60) trim(string)
631 END DO
632 END IF
633!
634 10 FORMAT (/,"YAML Tree Dictinary, file: '",a,"'",/, &
635 & '==========================',/)
636 20 FORMAT ('L=',i4.4,1x,'% ',6a)
637 30 FORMAT ('L=',i4.4,1x,'% ',5a)
638 40 FORMAT ('L=',i4.4,1x,'% ',4a)
639 50 FORMAT ('L=',i4.4,1x,'% ',3a)
640 60 FORMAT (a)
641!
642 RETURN

◆ yaml_tree_extract()

integer function yaml_parser_mod::yaml_tree_extract ( class (yaml_tree), intent(in) self,
character (len=*), intent(in) keystring,
type (yaml_extract), dimension(:), intent(inout), allocatable s )
private

Definition at line 645 of file yaml_parser.F.

646!
647!***********************************************************************
648! !
649! It extracts YAML value(s) from processing key-string. The key !
650! string may be a set of keys aggregated with a period, CHAR(46). !
651! !
652! On Input: !
653! !
654! self YAML tree dictionary object (CLASS yaml_tree) !
655! keystring Aggregated YAML keys (string) !
656! !
657! On Output: !
658! !
659! S Separated YAML key/pair value (TYPE yaml_extract) !
660! nkeys Number of extracted keys (integer) !
661! !
662!***********************************************************************
663!
664! Imported variable declarations.
665!
666 class(yaml_tree), intent(in) :: self
667 character (len=*), intent(in) :: keystring
668 TYPE (yaml_extract), allocatable, intent(inout) :: S(:)
669!
670! Local variable declarations.
671!
672 TYPE (yaml_extract), allocatable :: K(:)
673!
674 logical :: BlockFlow
675!
676 integer :: i, ib, ic, ie, ik, ipair, is, j, li, pID
677 integer :: Lstr, LenStr, nkeys, npairs, nvalues
678 integer :: icomma, idot
679 integer :: status
680!
681 integer, allocatable :: P(:) ! pair index
682!
683 character (len=:), allocatable :: Kstring ! key string
684 character (len=:), allocatable :: Vstring ! value string
685!
686 character (len=*), parameter :: MyFile = &
687 & __FILE__//", yaml_tree_extract"
688!
689!-----------------------------------------------------------------------
690! Extract YAML key(s) from key-string.
691!-----------------------------------------------------------------------
692!
693 status=noerr
694!
695! Count the number keys in key-string, separated by period.
696!
697 lstr=len_trim(keystring)
698 IF (yaml_error(yaml_assignstring(kstring, &
699 & keystring, lenstr), &
700 & noerr, __line__, myfile)) RETURN
701!
702 nkeys=yaml_countkeys(kstring, char(46))
703!
704! Allocate key structure.
705!
706 ALLOCATE ( k(nkeys) )
707!
708! Extract keys.
709!
710 is=1
711 DO i=1,nkeys
712 idot=index(kstring,char(46),back=.false.)
713 ie=idot
714 IF (idot.eq.0) THEN
715 ie=len_trim(kstring)
716 ELSE
717 ie=ie-1
718 END IF
719 IF (yaml_error(yaml_assignstring(k(i)%value, &
720 & kstring(is:ie), lenstr), &
721 & noerr, __line__, myfile)) RETURN
722 IF (idot.gt.0) kstring(is:ie+1) = repeat(char(32), ie-is+2)
723 kstring=trim(adjustl(kstring))
724 END DO
725!
726!-----------------------------------------------------------------------
727! Determine the number of YAML tree pairs to process and assoicated
728! list array element.
729!-----------------------------------------------------------------------
730!
731! Check if key-string is a blocking list where any of the members has
732! a leading hyphen as indentation. If blocking, all the pairs with the
733! same key-string are extracted.
734!
735 blockflow=.false. ! Switch to process all block membert
736 ib=0 ! block list(s) counter
737 ic=0 ! key/value pair counter
738 ik=1 ! key counter to avoid double DO-loops
739!
740 DO i=1,self%Npairs
741 lstr=len_trim(self%list(i)%key)
742 IF ((self%list(i)%key).eq.(k(ik)%value)) THEN
743
744 IF (yaml_master.and.ldebugyaml) THEN
745 print '(2(a,i0,2a))', 'key ',ik,' = ', trim(k(ik)%value), &
746 & ', YAML list ',i,' = ', &
747 & trim(self%list(i)%key)
748 END IF
749
750 pid=self%list(i)%parent_id
751 IF (self%list(i)%is_block.or.self%list(pid)%is_block) THEN
752 ib=ib+1 ! advance block counter
753 END IF
754 IF (ik.eq.nkeys) THEN
755 ic=ic+1 ! advance pair counter
756 IF (ib.eq.0) THEN
757 li=i ! list index to extract
758 EXIT ! no blocking list found
759 ELSE
760 blockflow=.true.
761 END IF
762 ELSE
763 ik=ik+1 ! advance key counter
764 END IF
765 END IF
766 IF (blockflow.and.(self%list(i)%left_padding.eq.0)) THEN
767 EXIT ! processed all blocks
768 END IF
769 END DO
770 npairs=ic ! pairs to process
771!
772! Allocate pair index array, P.
773!
774 IF (npairs.ne.0) THEN
775 IF (.not.ALLOCATED(p)) ALLOCATE ( p(npairs) )
776 ELSE
777 yaml_errflag=7
778 status=yaml_errflag
779 IF (yaml_error(yaml_errflag, noerr, __line__, myfile)) THEN
780 IF (yaml_master) WRITE (yaml_stdout,10) keystring, &
781 & self%filename
782 RETURN
783 END IF
784 END IF
785!
786! Set pair element(s) to extract.
787!
788 IF (blockflow) THEN
789 ic=0
790 ik=1
791 DO i=1,self%Npairs
792 IF ((self%list(i)%key).eq.(k(ik)%value)) THEN
793 IF (ik.eq.nkeys) THEN
794 ic=ic+1
795 p(ic)=i ! multiple pair index
796 ELSE
797 ik=ik+1
798 END IF
799 END IF
800 IF ((ic.gt.0).and.(self%list(i)%left_padding.eq.0)) THEN
801 EXIT ! processed all blocks
802 END IF
803 END DO
804 ELSE
805 p(1)=li ! single pair index
806 END IF
807!
808!-----------------------------------------------------------------------
809! Extract pair(s) value(s).
810!-----------------------------------------------------------------------
811!
812 DO i=1,npairs
813 ipair=p(i)
814!
815! Get key-string value.
816!
817 IF (yaml_error(yaml_assignstring(vstring, &
818 & self%list(ipair)%value, &
819 & lenstr), &
820 & noerr, __line__, myfile)) RETURN
821!
822!-----------------------------------------------------------------------
823! Extract/load keys-tring value(s). In a sequence, values are separated
824! by commas.
825!-----------------------------------------------------------------------
826!
827! Extract pair from a blocking list. Currently, scalar value are
828! allowed. Nested blocking is not supported since it is complicated
829! to process. For example, the following nested blocking lists are
830! not supported.
831!
832! branch:
833! - blocklist1: value
834! blocklist1_key1: value
835! - blocklist1A: value ! not supported
836!
837 IF (blockflow) THEN
838!
839! Process a block list pair with vector values (flow sequence):
840! S(i)%vector(1)%value to S(i)%vector(nvalues)%value
841!
842 IF (self%list(ipair)%is_sequence) THEN
843 lstr=len_trim(vstring)
844 nvalues=yaml_countkeys(vstring, char(44))
845!
846 IF (.not.ALLOCATED(s)) THEN
847 ALLOCATE ( s(npairs) ) ! main structure
848 END IF
849 IF (i.eq.1) THEN
850 s(1:npairs)%has_vector=.true.
851 END IF
852 ALLOCATE ( s(i)%vector(nvalues) ) ! sub-structure
853!
854 is=1
855 DO j=1,nvalues
856 icomma=index(vstring,char(44),back=.false.)
857 ie=icomma
858 IF (icomma.eq.0) THEN
859 ie=len_trim(vstring)
860 ELSE
861 ie=ie-1
862 END IF
863 IF (yaml_error(yaml_assignstring(s(i)%vector(j)%value, &
864 & vstring(is:ie), &
865 & lenstr), &
866 & noerr, __line__, myfile)) RETURN
867
868 IF (yaml_master.and.ldebugyaml) THEN
869 print '(3a,2(i0,a),a)', 'keystring = ',trim(keystring), &
870 & ', S(', i, ')%vector(', j, ') = ', &
871 & trim(s(i)%vector(j)%value)
872 END IF
873
874 IF (icomma.gt.0) vstring(is:ie+1)=repeat(char(32),ie-is+2)
875 vstring=trim(adjustl(vstring))
876 END DO
877!
878! Process a block list pair with a scalar value, S(i)%value
879!
880 ELSE
881!
882 IF (.not.ALLOCATED(s)) THEN
883 ALLOCATE ( s(npairs) )
884 END IF
885 IF (i.eq.1) THEN
886 s(1:npairs)%has_vector=.false.
887 END IF
888!
889 IF (yaml_error(yaml_assignstring(s(i)%value, &
890 & vstring, lenstr), &
891 & noerr, __line__, myfile)) RETURN
892
893 IF (yaml_master.and.ldebugyaml) THEN
894 print '(a,i0,4a)', 'keystring ',i,' = ', trim(keystring), &
895 & ', value = ', trim(s(i)%value)
896 END IF
897 END IF
898!
899! Otherwise, process a non-block list.
900!
901 ELSE
902!
903! Process a flow sequence: S(1)%value to S(nvalues)%value.
904!
905 IF (self%list(ipair)%is_sequence) THEN
906 lstr=len_trim(vstring)
907 nvalues=yaml_countkeys(vstring, char(44))
908!
909 IF (.not.ALLOCATED(s)) THEN
910 ALLOCATE ( s(nvalues) )
911 END IF
912 IF (i.eq.1) THEN
913 s(1:nvalues)%has_vector=.false.
914 END IF
915!
916 is=1
917 DO j=1,nvalues
918 icomma=index(vstring,char(44),back=.false.)
919 ie=icomma
920 IF (icomma.eq.0) THEN
921 ie=len_trim(vstring)
922 ELSE
923 ie=ie-1
924 END IF
925 IF (yaml_error(yaml_assignstring(s(j)%value, &
926 & vstring(is:ie), &
927 & lenstr), &
928 & noerr, __line__, myfile)) RETURN
929 IF (icomma.gt.0) vstring(is:ie+1)=repeat(char(32),ie-is+2)
930 vstring=trim(adjustl(vstring))
931
932 IF (yaml_master.and.ldebugyaml) THEN
933 print '(a,i0,4a)', 'keystring ',j,' = ', &
934 & trim(keystring), &
935 & ', value = ', trim(s(j)%value)
936 END IF
937 END DO
938!
939! Process a single scalar value, S(1)%value.
940!
941 ELSE
942!
943 IF (.not.ALLOCATED(s)) THEN
944 allocate ( s(1) )
945 END IF
946 s(1)%has_vector=.false.
947!
948 IF (yaml_error(yaml_assignstring(s(1)%value, &
949 & vstring, lenstr), &
950 & noerr, __line__, myfile)) RETURN
951
952 IF (yaml_master.and.ldebugyaml) THEN
953 print '(4a)', 'keystring = ', trim(keystring), &
954 & ', value = ', trim(s(1)%value)
955 END IF
956 END IF
957 END IF
958 END DO
959!
960!-----------------------------------------------------------------------
961! Deallocate local variables.
962!-----------------------------------------------------------------------
963!
964 IF (ALLOCATED(k)) DEALLOCATE (k)
965 IF (ALLOCATED(p)) DEALLOCATE (p)
966 IF (ALLOCATED(kstring)) DEALLOCATE (kstring)
967 IF (ALLOCATED(vstring)) DEALLOCATE (vstring)
968!
969 10 FORMAT (/," YAML_TREE_EXTRACT - Cannot find key-string: '",a, &
970 & "'",/,21x,'File: ',a)
971 20 FORMAT (/," YAML_TREE_EXTRACT - Not supported key-string: '",a, &
972 & "'",/,21x,'nested sub-blocking in a leading blocking ', &
973 & 'list',/,21x,'File: ',a)
974!
975 RETURN

References ldebugyaml, noerr, yaml_assignstring(), yaml_countkeys(), and yaml_error().

Here is the call graph for this function:

◆ yaml_tree_fill()

subroutine yaml_parser_mod::yaml_tree_fill ( class (yaml_tree), intent(inout) self)
private

Definition at line 978 of file yaml_parser.F.

979!
980!***********************************************************************
981! !
982! It reads YAML file and fills structure with the key/value pairs. !
983! Both the key and value pairs are strings. The numercal convertions !
984! are done elsewhere when needed. !
985! !
986! Arguments: !
987! !
988! self YAML tree dictionary object (CLASS yaml_tree) !
989! !
990!***********************************************************************
991!
992! Imported variable declarations.
993!
994 class(yaml_tree), intent(inout) :: self
995!
996! Local variable declarations.
997!
998 logical :: Lswitch(Ldim)
999!
1000 integer :: Nblanks, LenStr, left_padding, new_parent, old_parent
1001 integer :: i, ibranch, icount, ic_alias, ic_anchor, status
1002!
1003 character (len=Lkey) :: anchor, key
1004 character (len=Lmax) :: line, value
1005!
1006 character (len=*), parameter :: MyFile = &
1007 & __FILE__//", yaml_tree_fill"
1008!
1009!-----------------------------------------------------------------------
1010! Read and populate YAML structure.
1011!-----------------------------------------------------------------------
1012!
1013 ibranch=0
1014 icount=0
1015 ic_alias=0
1016 ic_anchor=0
1017 new_parent=0
1018 old_parent=0
1019!
1020 yaml_line : DO WHILE (.true.)
1021!
1022 status=self%read_line(nblanks, line, key, value, anchor, &
1023 & lswitch)
1024!
1025 SELECT CASE (status)
1026 CASE (-1) ! error condition during reading
1027 yaml_errflag=4
1028 IF (yaml_error(yaml_errflag, noerr, __line__, myfile)) THEN
1029 IF (yaml_master) WRITE (yaml_stdout,10) self%filename, &
1030 & trim(line)
1031 RETURN
1032 END IF
1033 CASE (0) ! end-of-file
1034 EXIT
1035 CASE (1) ! blank or comment line, move to the next line
1036 cycle
1037 CASE (2) ! processed viable line
1038 icount=icount+1
1039 END SELECT
1040!
1041! Determine structure indices according to the nested levels counters.
1042!
1043 IF (nblanks.eq.0) THEN
1044 ibranch=ibranch+1
1045 new_parent=icount
1046 old_parent=icount
1047 END IF
1048!
1049! Load YAML pair switch identifiers.
1050!
1051 self%list(icount)%has_alias = lswitch(1)
1052 self%list(icount)%has_anchor = lswitch(2)
1053 self%list(icount)%is_block = lswitch(3)
1054 self%list(icount)%is_sequence = lswitch(4)
1055 self%list(icount)%is_logical = lswitch(5)
1056 self%list(icount)%is_integer = lswitch(6)
1057 self%list(icount)%is_real = lswitch(7)
1058 self%list(icount)%is_string = lswitch(8)
1059!
1060 IF (lswitch(1)) ic_alias=ic_alias+1
1061 IF (lswitch(2)) ic_anchor=ic_anchor+1
1062!
1063! Set left-padding indentation level: 0, 1, 2, ...
1064!
1065 left_padding=nblanks/self%indent
1066 self%list(icount)%left_padding=left_padding
1067!
1068! Load key/value ID and parent ID.
1069!
1070 IF (nblanks.gt.0) THEN
1071 IF (left_padding.gt.self%list(icount-1)%left_padding) THEN
1072 new_parent=old_parent
1073 old_parent=icount
1074 END IF
1075 END IF
1076 self%list(icount)%id=icount
1077 self%list(icount)%parent_id=new_parent
1078!
1079! Allocate and load line, key, and value strings. If applicable, loal
1080! anchor value. Notice that it is possible to have keyword without
1081! value in the main branches.
1082!
1083 IF (yaml_error(yaml_assignstring(self%list(icount)%line, &
1084 & line, lenstr), &
1085 & noerr, __line__, myfile)) RETURN
1086!
1087 IF (yaml_error(yaml_assignstring(self%list(icount)%key, &
1088 & key, lenstr), &
1089 & noerr, __line__, myfile)) RETURN
1090!
1091 IF (len_trim(value).gt.0) THEN
1092 IF (yaml_error(yaml_assignstring(self%list(icount)%value, &
1093 & value, lenstr), &
1094 & noerr, __line__, myfile)) RETURN
1095 END IF
1096!
1097 IF (lswitch(2).and.len_trim(anchor).gt.0) THEN
1098 IF (yaml_error(yaml_assignstring(self%list(icount)%anchor, &
1099 & anchor, lenstr), &
1100 & noerr, __line__, myfile)) RETURN
1101 END IF
1102!
1103 END DO yaml_line
1104!
1105! Substitute 'Alias' with 'Anchor' values. Notice that Anchors and
1106! Aliases let you identify an item with an 'anchor' in a YAML pair,
1107! and then refer to that item with an alias later in the same tile.
1108! It is done to avoid repetitions and errors.
1109!
1110 IF ((ic_alias.gt.0).and.(ic_anchor.gt.0)) THEN
1111 CALL self%fill_aliases (ic_alias, ic_anchor)
1112 END IF
1113!
1114! Close YAML file.
1115!
1116 CLOSE (iunit)
1117!
1118 10 FORMAT (/,' YAML_TREE_FILL - Error while reading YAML file: ', &
1119 & a,/,18x,'LINE: ',a)
1120!
1121 RETURN

References iunit, noerr, yaml_assignstring(), and yaml_error().

Here is the call graph for this function:

◆ yaml_tree_fill_aliases()

subroutine yaml_parser_mod::yaml_tree_fill_aliases ( class (yaml_tree), intent(inout) self,
integer, intent(in) nalias,
integer, intent(in) nanchor )
private

Definition at line 1124 of file yaml_parser.F.

1125!
1126!***********************************************************************
1127! !
1128! It replaces the Aliases items with its respective Anchors values in !
1129! YAML dictionary. !
1130! !
1131! Arguments: !
1132! !
1133! self YAML tree dictionary object (CLASS yaml_tree) !
1134! Nalias Number of Aliases items in YAML file (integer) !
1135! Nanchors Number of Anchors in YAML file (integer) !
1136! !
1137!***********************************************************************
1138!
1139! Imported variable declarations.
1140!
1141 class(yaml_tree), intent(inout) :: self
1142 integer, intent(in) :: Nalias
1143 integer, intent(in) :: Nanchor
1144!
1145! Local variable declarations.
1146!
1147 logical :: Lswitch(Ldim)
1148!
1149 integer :: Ialias, LenStr, i, j, ic
1150!
1151 character (len=Lkey), dimension(Nanchor) :: AnchorKey, AnchorVal
1152 character (len=Lmax) :: AliasVal
1153!
1154 character (len=*), parameter :: MyFile = &
1155 & __FILE__//", yaml_tree_fill_aliases"
1156!
1157!-----------------------------------------------------------------------
1158! Extract Anchors keyword and value.
1159!-----------------------------------------------------------------------
1160!
1161 ic=0
1162 DO i=1,self%Npairs
1163 IF (self%list(i)%has_anchor) THEN
1164 ic=ic+1
1165 anchorkey(ic)=self%list(i)%anchor
1166 anchorval(ic)=self%list(i)%value
1167 END IF
1168 END DO
1169!
1170!-----------------------------------------------------------------------
1171! Replace Aliases with associate Anchors values.
1172!-----------------------------------------------------------------------
1173!
1174 DO j=1,self%Npairs
1175!
1176! Get Aliases keyword.
1177!
1178 IF (self%list(j)%has_alias) THEN
1179 aliasval=self%list(j)%value
1180 ialias=index(aliasval,char(42),back=.false.) ! alias '*'
1181 IF (ialias.gt.0) THEN
1182 aliasval(ialias:ialias)=char(32) ! blank
1183 aliasval=trim(adjustl(aliasval))
1184 END IF
1185!
1186! Replace Aliases with anchor values and update value type.
1187!
1188 DO i=1,ic
1189 IF (trim(aliasval).eq.trim(anchorkey(i))) THEN
1190 DEALLOCATE (self%list(j)%value)
1191 IF (yaml_error(yaml_assignstring(self%list(j)%value, &
1192 & trim(anchorval(i)), &
1193 & lenstr), &
1194 & noerr, __line__, myfile)) RETURN
1195!
1196 lswitch=.false.
1197 CALL yaml_valuetype (self%list(j)%value, lswitch)
1198 self%list(j)%is_logical = lswitch(5)
1199 self%list(j)%is_integer = lswitch(6)
1200 self%list(j)%is_real = lswitch(7)
1201 self%list(j)%is_string = lswitch(8)
1202 END IF
1203 END DO
1204 END IF
1205 END DO
1206!
1207 RETURN

References noerr, yaml_assignstring(), yaml_error(), and yaml_valuetype().

Here is the call graph for this function:

◆ yaml_tree_has()

logical function yaml_parser_mod::yaml_tree_has ( class (yaml_tree), intent(inout) self,
character (len=*), intent(in) keystring )
private

Definition at line 1210 of file yaml_parser.F.

1211!
1212!***********************************************************************
1213! !
1214! It checks if YAML dictionary has requested key string. !
1215! !
1216! On Input: !
1217! !
1218! self YAML tree dictionary object (CLASS yaml_tree) !
1219! !
1220! keystring Requested YAML key-string (string) !
1221! !
1222! On Output: !
1223! !
1224! FoundIt Switch indicating if the key string was found or not !
1225! in the YAML dictionary. !
1226! !
1227!***********************************************************************
1228!
1229! Imported variable declarations.
1230!
1231 class(yaml_tree), intent(inout) :: self
1232 character (len=*), intent(in ) :: keystring
1233!
1234! Local variable declarations.
1235!
1236 TYPE (yaml_extract), allocatable :: K(:)
1237!
1238 logical :: foundit
1239!
1240 integer :: Lstr, LenStr
1241 integer :: i, idot, ie, is, j, nkeys
1242!
1243 character (len=:), allocatable :: Kstring
1244
1245 character (len=*), parameter :: MyFile = &
1246 & __FILE__//", yaml_tree_has"
1247!
1248!-----------------------------------------------------------------------
1249! Check if requested key-string is available in YAML dictionary
1250!-----------------------------------------------------------------------
1251!
1252 foundit=.false.
1253!
1254! Count number of keys in key-string, separated by period, CHAR(46).
1255!
1256 lstr=len_trim(keystring)
1257 IF (yaml_error(yaml_assignstring(kstring, &
1258 & keystring, lenstr), &
1259 & noerr, __line__, myfile)) RETURN
1260!
1261 nkeys=yaml_countkeys(kstring, char(46))
1262!
1263! Check single key.
1264!
1265 IF (nkeys.eq.1) THEN
1266 DO i=1,SIZE(self%list)
1267 IF (self%list(i)%key.eq.kstring) THEN
1268 foundit=.true.
1269 EXIT
1270 END IF
1271 END DO
1272 DEALLOCATE (kstring)
1273 RETURN
1274!
1275! Otherwise, check for compound key separated by period.
1276!
1277 ELSE
1278 ALLOCATE ( k(nkeys) )
1279!
1280! Extract keys.
1281!
1282 is=1
1283 DO j=1,nkeys
1284 idot=index(kstring,char(46),back=.false.)
1285 ie=idot
1286 IF (idot.eq.0) THEN
1287 ie=len_trim(kstring)
1288 ELSE
1289 ie=ie-1
1290 END IF
1291 IF (yaml_error(yaml_assignstring(k(j)%value, &
1292 & kstring(is:ie), lenstr), &
1293 & noerr, __line__, myfile)) RETURN
1294 IF (idot.gt.0) kstring(is:ie+1) = repeat(char(32), ie-is+2)
1295 kstring=trim(adjustl(kstring))
1296 END DO
1297!
1298! Check for compound key: val1.val2 ...
1299! (It fails if any of the compound keys is not found)
1300!
1301 is=1
1302 DO j=1,nkeys
1303 foundit=.false.
1304 DO i=is,SIZE(self%list)
1305 IF (self%list(i)%key.eq.k(j)%value) THEN
1306 foundit=.true.
1307 is=i+1
1308 EXIT
1309 END IF
1310 END DO
1311 IF (.not.foundit) EXIT
1312 END DO
1313 DEALLOCATE (k, kstring)
1314 RETURN
1315 END IF
1316!

References noerr, yaml_assignstring(), yaml_countkeys(), and yaml_error().

Here is the call graph for this function:

◆ yaml_tree_read_line()

integer function yaml_parser_mod::yaml_tree_read_line ( class (yaml_tree), intent(inout) self,
integer, intent(out) nblanks,
character (len=*), intent(out) line,
character (len=*), intent(out) key,
character (len=*), intent(out) value,
character (len=*), intent(out) anchor,
logical, dimension(:), intent(out) lswitch )
private

Definition at line 1319 of file yaml_parser.F.

1322!
1323!***********************************************************************
1324! !
1325! It reads a single text line from current YAML file. It uses the !
1326! ASCII character set extensively. !
1327! !
1328! On Input: !
1329! !
1330! self YAML tree dictionary object (CLASS yaml_tree) !
1331! !
1332! On Output: !
1333! !
1334! Nblanks YAML leading blanks identation (integer) !
1335! !
1336! line Current YAML file line (string) !
1337! !
1338! key YAML line keyword (string) !
1339! !
1340! value YAML line keyword value (string) !
1341! !
1342! anchor YAML value ancher keyword (string) !
1343! !
1344! Lswitch YAML key/value switches (logical, vector) !
1345! !
1346! Lswitch(1) = T/F, value has an alias '*' token !
1347! Lswitch(2) = T/F, value has an anchor '&' token !
1348! Lswitch(3) = T/F, key/value starts a block '-' !
1349! Lswitch(4) = T/F, value has sequence '[...]' tokens !
1350! Lswitch(5) = T/F, logical value(s) !
1351! Lswitch(6) = T/F, integer value(s) !
1352! Lswitch(7) = T/F, floating-point value(s) !
1353! Lswitch(8) = T/F, string value(s) !
1354! !
1355!***********************************************************************
1356!
1357! Imported variable declarations.
1358!
1359 class(yaml_tree), intent(inout) :: self
1360!
1361 logical, intent(out) :: Lswitch(:)
1362!
1363 integer, intent(out) :: Nblanks
1364!
1365 character (len=*), intent(out) :: line
1366 character (len=*), intent(out) :: key
1367 character (len=*), intent(out) :: value
1368 character (len=*), intent(out) :: anchor
1369!
1370! Local variable declarations.
1371!
1372 logical :: Lbracket, Rbracket
1373!
1374 integer :: Ialias, Ianchor, Iblank, Icolon, Idash, Ihash, Ispace
1375 integer :: IbracketL, IbracketR
1376 integer :: Lstr, LstrNext, LstrVal, i, j, k
1377 integer :: status
1378!
1379 character (len=Lmax) :: linecopy, next_line
1380
1381 character (len=*), parameter :: MyFile = &
1382 & __FILE__//", yaml_tree_read_line"
1383!
1384!-----------------------------------------------------------------------
1385! Read a single YAML file line
1386!-----------------------------------------------------------------------
1387!
1388! Initialize.
1389!
1390 status=-1 ! error condition
1391!
1392 DO i=1,len(key)
1393 key(i:i)=char(32)
1394 END DO
1395
1396 DO i=1,len(value)
1397 value(i:i)=char(32)
1398 END DO
1399
1400 DO i=1,len(anchor)
1401 anchor(i:i)=char(32)
1402 END DO
1403!
1404 lswitch=.false.
1405 lbracket=.false.
1406 rbracket=.false.
1407!
1408! Read in next YAML file line.
1409!
1410 READ (iunit,'(a)',err=10,END=20) line
1411!
1412! Replace illegal control characters with a blank space CHAR(32)
1413!
1414 lstr=len_trim(line)
1415
1416 DO i=1,len_trim(line)
1417 j=ichar(line(i:i))
1418 IF (j.lt.32) THEN
1419 line(i:i)=char(32)
1420 END IF
1421 END DO
1422 linecopy=trim(adjustl(line))
1423!
1424! Get length of "line". Remove comment after the KEYWORD, if any.
1425! In YAML, a comment starts with a hash (#), CHAR(35).
1426!
1427 IF ((lstr.gt.0).and.(linecopy(1:1).ne.char(35))) THEN
1428 ihash=index(line,char(35),back=.false.)
1429 IF (ihash.gt.0) THEN
1430 lstr=ihash-1
1431 line=trim(line(1:lstr)) ! remove trailing comment
1432 lstr=len_trim(line)
1433 END IF
1434 status=2 ! viable line
1435 ELSE
1436 status=1 ! blank or commented line,
1437 RETURN ! move to the next line
1438 END IF
1439!
1440! Find colon sign CHAR(58) and determine the number of leading blank
1441! spaces. YAML uses indentations with one or more spaces to describe
1442! nested collections (lists, mappings). YAML also uses dash plus space,
1443! '- ', as enumerator of block lists.
1444!
1445! It checks if the KEYWORD is a multi-word separated by space.
1446!
1447 icolon=index(line,char(58),back=.false.)
1448 IF (icolon.eq.0) THEN
1449 status=-1
1450 yaml_errflag=2
1451 IF (yaml_master) THEN
1452 WRITE (yaml_stdout,30) trim(line)
1453 END IF
1454 IF (yaml_error(yaml_errflag, noerr, __line__, myfile)) RETURN
1455 END IF
1456!
1457 idash =index(line,char(45),back=.false.)
1458 IF ((idash.gt.0).and.(idash.lt.icolon)) THEN
1459 iblank=index(line(1:idash),char(32),back=.true.)
1460 ELSE
1461 iblank=index(line(1:icolon),char(32),back=.true.)
1462 IF (iblank.gt.0) THEN
1463 k=iblank-1
1464 IF ((65.le.ichar(line(1:1))).and. &
1465 & (ichar(line(1:1)).le.122)) THEN ! multi-word branch key
1466 iblank=0
1467 ELSE IF ((65.le.ichar(line(k:k))).and. &
1468 & (ichar(line(k:k)).le.122)) THEN ! multi-word pair key
1469 iblank=index(line(1:k),char(32),back=.true.)
1470 END IF
1471 END IF
1472 END IF
1473!
1474! Set number of YAML line leading blacks.
1475!
1476 nblanks=iblank
1477!
1478! Extract key and value pair and return.
1479!
1480 IF ((idash.gt.0).and.(idash.lt.icolon)) THEN
1481 key=trim(adjustl(line(idash+1:icolon-1)))
1482 ELSE
1483 key=trim(adjustl(line(1:icolon-1)))
1484 END IF
1485 value=trim(adjustl(line(icolon+1:lstr)))
1486!
1487! Check for special YAML tokens in value string and replace with blank.
1488!
1489 ialias=index(value,char(42),back=.false.) ! alias '*'
1490 IF (ialias.gt.0) THEN
1491 lswitch(1)=.true.
1492 END IF
1493!
1494 ianchor=index(value,char(38),back=.false.) ! anchor '&'
1495 IF (ianchor.gt.0) THEN
1496 ispace=index(value(ianchor+1:),char(32),back=.false.)
1497 anchor=value(ianchor+1:ispace) ! anchor value
1498 lswitch(2)=.true.
1499 value(ianchor:ispace)=repeat(char(32),ispace-ianchor+1)
1500 value=trim(adjustl(value))
1501 END IF
1502!
1503 IF ((idash.gt.0).and.(idash.lt.icolon)) THEN
1504 lswitch(3)=.true. ! block pair '- '
1505 END IF
1506!
1507 ibracketl=index(value,char(91),back=.false.) ! left bracket '['
1508 IF (ibracketl.gt.0) THEN
1509 lbracket=.true.
1510 value(ibracketl:ibracketl)=char(32)
1511 value=trim(adjustl(value))
1512 END IF
1513!
1514 ibracketr=index(value,char(93),back=.false.) ! right bracket ']'
1515 IF (ibracketr.gt.0) THEN
1516 rbracket=.true.
1517 value(ibracketr:ibracketr)=char(32)
1518 value=trim(adjustl(value))
1519 END IF
1520!
1521!-----------------------------------------------------------------------
1522! If right square bracket is not found, the key values are broken into
1523! multiple lines. Process the necessary lines.
1524!-----------------------------------------------------------------------
1525!
1526 IF (.not.rbracket.and.lbracket) THEN
1527 DO WHILE (.not.rbracket)
1528 READ (iunit,'(a)',err=10,END=20) next_line
1529!
1530! Replace illegal control characters with a blank space CHAR(32)
1531!
1532 DO i=1,len_trim(next_line)
1533 j=ichar(next_line(i:i))
1534 IF (j.lt.32) THEN
1535 next_line(i:i)=char(32)
1536 END IF
1537 END DO
1538 next_line=trim(adjustl(next_line))
1539!
1540! If applicable, remove trailing comments starting with a hash (#),
1541! CHAR(35).
1542!
1543 ihash=index(next_line,char(35),back=.false.)
1544 lstrnext=len_trim(next_line)
1545 IF ((lstrnext.gt.0).and.(ihash.gt.0)) THEN
1546 lstrnext=ihash-1
1547 next_line=trim(next_line(1:lstrnext))
1548 lstrnext=len_trim(next_line)
1549 END IF
1550!
1551! Aggregate new 'next_line' to previous 'line' and 'value'.
1552!
1553 lstr=len_trim(line)
1554 lstrval=len_trim(value)
1555 line=line(1:lstr)//char(32)//next_line(1:lstrnext)
1556 value=value(1:lstrval)//char(32)//next_line(1:lstrnext)
1557!
1558 ibracketr=index(value,char(93),back=.false.)
1559 IF (ibracketr.gt.0) THEN
1560 rbracket=.true.
1561 value(ibracketr:ibracketr)=char(32)
1562 value=trim(adjustl(value))
1563 END IF
1564 END DO
1565 END IF
1566 IF (lbracket.and.rbracket) lswitch(4)=.true.
1567!
1568!-----------------------------------------------------------------------
1569! Determine value representation: logical (boolean), numerical
1570! (integer/reals), or string(s). Others can be added as needed.
1571!-----------------------------------------------------------------------
1572!
1573 CALL yaml_valuetype (value, lswitch)
1574!
1575 RETURN
1576!
1577! Read flow control determines the status flag.
1578!
1579 10 status=-1 ! error during reading
1580 20 status=0 ! end-of-file encoutered
1581!
1582 30 FORMAT (/,' YAML_TREE_READ_LINE - Unable to find colon token ', &
1583 & 'after key word',/,23x,'LINE: ',a)
1584

References mod_iounits::err, iunit, noerr, yaml_error(), and yaml_valuetype().

Here is the call graph for this function:

◆ yaml_uppercase()

character (len=len(sinp)) function, private yaml_parser_mod::yaml_uppercase ( character (len=*), intent(in) sinp)
private

Definition at line 2734 of file yaml_parser.F.

2735!
2736!=======================================================================
2737! !
2738! It converts all string elements to uppercase. !
2739! !
2740! Reference: !
2741! !
2742! Cooper Redwine, 1995: "Upgrading to Fortran 90", Springer- !
2743! Verlag, New York, pp 416. !
2744! !
2745!=======================================================================
2746!
2747! Imported variable declarations.
2748!
2749 character (len=*), intent(in) :: Sinp
2750!
2751! Local variable definitions.
2752!
2753 integer :: Lstr, i, j
2754!
2755 character (len=LEN(Sinp)) :: Sout
2756!
2757 character (len=26), parameter :: L = 'abcdefghijklmnopqrstuvwxyz'
2758 character (len=26), parameter :: U = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
2759!
2760!-----------------------------------------------------------------------
2761! Convert input string to uppercase.
2762!-----------------------------------------------------------------------
2763!
2764 lstr=len(sinp)
2765 sout=sinp
2766 DO i=1,lstr
2767 j=index(l, sout(i:i))
2768 IF (j.ne.0) THEN
2769 sout(i:i)=u(j:j)
2770 END IF
2771 END DO
2772!
2773 RETURN

Referenced by yaml_parser_mod::yaml_get::yaml_get_l_struc(), yaml_parser_mod::yaml_get::yaml_get_lvar_0d(), and yaml_parser_mod::yaml_get::yaml_get_lvar_1d().

Here is the caller graph for this function:

◆ yaml_valuetype()

subroutine, private yaml_parser_mod::yaml_valuetype ( character (len=*), intent(inout) value,
logical, dimension(:), intent(inout) lswitch )
private

Definition at line 2776 of file yaml_parser.F.

2777!
2778!***********************************************************************
2779! !
2780! It determines the YAML value type as logical, integer, real, or !
2781! string. !
2782! !
2783! On Input: !
2784! !
2785! self YAML pair value (string) !
2786! !
2787! On Output: !
2788! !
2789! Lswitch YAML key/value switches (logical, vector) !
2790! !
2791! Lswitch(1) = T/F, value has an alias '*' token !
2792! Lswitch(2) = T/F, value has an anchor '&' token !
2793! Lswitch(3) = T/F, key/value starts a block '-' !
2794! Lswitch(4) = T/F, value has sequence '[...]' tokens !
2795! Lswitch(5) = T/F, logical value(s) !
2796! Lswitch(6) = T/F, integer value(s) !
2797! Lswitch(7) = T/F, floating-point value(s) !
2798! Lswitch(8) = T/F, string value(s) !
2799! !
2800!***********************************************************************
2801!
2802! Imported variable declarations.
2803!
2804 logical, intent(inout) :: Lswitch(:)
2805!
2806 character (len=*), intent(inout) :: value
2807!
2808! Local variable declarations.
2809!
2810 integer :: Lstr, Schar
2811 integer :: colon, dot, exponent, letter, numeric, precision
2812 integer :: i, multiple
2813!
2814!-----------------------------------------------------------------------
2815! Set keyword value type.
2816!-----------------------------------------------------------------------
2817!
2818! Initialize.
2819!
2820 colon=0
2821 dot=0
2822 exponent=0
2823 letter=0
2824 multiple=0
2825 numeric=0
2826 precision=0
2827!
2828! Check input value string.
2829!
2830 lstr=len_trim(value)
2831 IF (lstr.gt.0) THEN
2832 DO i=1,lstr
2833 schar=ichar(value(i:i))
2834!
2835! Check for numbers, plus, and minus signs. For example, value=-1.0E+37
2836! is a floating-point numerical value.
2837!
2838 IF (((48.le.schar).and.(schar.le.57)).or. &
2839 & (schar.eq.43).or.(schar.eq.45)) numeric=numeric+1
2840!
2841! Check for dot/period, CHAR(46). If period is not found in a numerical
2842! expression, identify value as an integer.
2843!
2844 IF (schar.eq.46) dot=dot+1
2845!
2846! Check for precision character: D=ICHAR(68) and d=ICHAR(100). For
2847! example, value=0.0d0 and others in the future.
2848!
2849 IF ((schar.eq.69).or.(schar.eq.101)) precision=precision+1
2850!
2851! Check for exponent character: E=CHAR(69) and e=CHAR(101).
2852!
2853 IF ((schar.eq.69).or.(schar.eq.101)) exponent=exponent+1
2854!
2855! Check for multiple values separate by comma, CHAR(44), in a sequence
2856! of values: [val1, val2, ..., valN].
2857!
2858 IF (lswitch(4)) multiple=multiple+1
2859!
2860! Check for colon, CHAR(58). We can have value=2020-01-01T00:00:00Z,
2861! which has numbers, hyphen, and letters. It is the colon that makes
2862! it a string variable (https://www.myroms.org).
2863!
2864 IF (schar.eq.58) colon=colon+1
2865!
2866! English uppercase and lowercase alphabet.
2867!
2868 IF (((65.le.schar).and.(schar.le.90)).or. &
2869 & (schar.eq.97).or.(schar.eq.122)) letter=letter+1
2870 END DO
2871!
2872! Set integer or floating-point type.
2873!
2874 IF ((numeric.gt.0).and.(colon.eq.0)) THEN
2875 IF ((dot.gt.0).or.(exponent.gt.0).or.(precision.gt.0)) THEN
2876 lswitch(7)=.true. ! floating-point
2877 ELSE
2878 lswitch(6)=.true. ! integer
2879 END IF
2880 ELSE
2881 IF ((value.eq.'true').or.(value.eq.'false').or. &
2882 & (value.eq.'TRUE').or.(value.eq.'FALSE')) THEN
2883 lswitch(5)=.true. ! logical
2884 ELSE IF (letter.gt.0) THEN
2885 lswitch(8)=.true. ! string
2886 END IF
2887 END IF
2888 END IF
2889!
2890 RETURN

Referenced by yaml_tree_fill_aliases(), and yaml_tree_read_line().

Here is the caller graph for this function:

Variable Documentation

◆ iunit

integer, parameter yaml_parser_mod::iunit = 222
private

Definition at line 271 of file yaml_parser.F.

271 integer, parameter :: iunit = 222 ! Fortan unit for reading

Referenced by get_metadata_mod::coupling_metadata(), yaml_tree_create(), yaml_tree_destroy(), yaml_tree_fill(), and yaml_tree_read_line().

◆ ldebugyaml

logical, parameter yaml_parser_mod::ldebugyaml = .FALSE.
private

Definition at line 265 of file yaml_parser.F.

265 logical, parameter :: LdebugYAML = .false. ! debugging switch

Referenced by yaml_tree_extract().

◆ ldim

integer, parameter yaml_parser_mod::ldim = 8
private

Definition at line 267 of file yaml_parser.F.

267 integer, parameter :: Ldim = 8 ! logical Lswitch dimension

◆ lkey

integer, parameter yaml_parser_mod::lkey = 254
private

Definition at line 268 of file yaml_parser.F.

268 integer, parameter :: Lkey = 254 ! Maximum characters per keyword

◆ lmax

integer, parameter yaml_parser_mod::lmax = 2048
private

Definition at line 269 of file yaml_parser.F.

269 integer, parameter :: Lmax = 2048 ! Maximum characters per line

◆ noerr

◆ yaml_errmsg

character (len=55), dimension(7) yaml_parser_mod::yaml_errmsg = (/ ' YAML_PARSER - Blows up ................ yaml_ErrFlag: ', ' YAML_PARSER - Input error ............. yaml_ErrFlag: ', ' YAML_PARSER - Output error ............ yaml_ErrFlag: ', ' YAML_PARSER - I/O error ............... yaml_ErrFlag: ', ' YAML_PARSER - Configuration error ..... yaml_ErrFlag: ', ' YAML_PARSER - Partition error ......... yaml_ErrFlag: ', ' YAML_PARSER - Illegal input parameter . yaml_ErrFlag: ' /)
private

Definition at line 273 of file yaml_parser.F.

273 character (len=55), dimension(7) :: yaml_ErrMsg = &
274 & (/ ' YAML_PARSER - Blows up ................ yaml_ErrFlag: ', &
275 & ' YAML_PARSER - Input error ............. yaml_ErrFlag: ', &
276 & ' YAML_PARSER - Output error ............ yaml_ErrFlag: ', &
277 & ' YAML_PARSER - I/O error ............... yaml_ErrFlag: ', &
278 & ' YAML_PARSER - Configuration error ..... yaml_ErrFlag: ', &
279 & ' YAML_PARSER - Partition error ......... yaml_ErrFlag: ', &
280 & ' YAML_PARSER - Illegal input parameter . yaml_ErrFlag: ' /)