96 integer,
parameter ::
kind_real = selected_real_kind(12,300)
97 integer,
parameter ::
dp = selected_real_kind(12,300)
116 logical :: has_anchor
118 logical :: is_sequence
120 logical :: is_logical
121 logical :: is_integer
127 integer :: left_padding
129 character (len=:),
allocatable :: line
130 character (len=:),
allocatable :: key
131 character (len=:),
allocatable ::
value
132 character (len=:),
allocatable :: anchor
140 logical :: iscreated = .false.
146 character (len=:),
allocatable :: filename
207 integer,
allocatable :: vector(:)
211 logical,
allocatable :: vector(:)
219 character (len=:),
allocatable ::
value
231 logical :: has_vector
262 logical :: debug_write
264 real(
dp) :: add_offset
267 character (len=:),
allocatable :: connected_to
268 character (len=:),
allocatable :: data_netcdf_vname
269 character (len=:),
allocatable :: data_netcdf_tname
270 character (len=:),
allocatable :: destination_grid
271 character (len=:),
allocatable :: destination_units
272 character (len=:),
allocatable :: extrapolate_method
273 character (len=:),
allocatable :: long_name
274 character (len=:),
allocatable :: map_norm
275 character (len=:),
allocatable :: map_type
276 character (len=:),
allocatable :: regrid_method
277 character (len=:),
allocatable :: source_units
278 character (len=:),
allocatable :: source_grid
279 character (len=:),
allocatable :: short_name
280 character (len=:),
allocatable :: standard_name
348 integer,
parameter ::
lkey = 254
349 integer,
parameter ::
lmax = 2048
354 & (/
' YAML_PARSER - Blows up ................ yaml_ErrFlag: ', &
355 &
' YAML_PARSER - Input error ............. yaml_ErrFlag: ', &
356 &
' YAML_PARSER - Output error ............ yaml_ErrFlag: ', &
357 &
' YAML_PARSER - I/O error ............... yaml_ErrFlag: ', &
358 &
' YAML_PARSER - Configuration error ..... yaml_ErrFlag: ', &
359 &
' YAML_PARSER - Partition error ......... yaml_ErrFlag: ', &
360 &
' YAML_PARSER - Illegal input parameter . yaml_ErrFlag: ' /)
393 character (len=*),
intent(in ) :: filename
394 logical,
optional,
intent(in ) :: report
400 integer :: lenstr, status
402 character (len=*),
parameter :: myfile = &
403 & __FILE__//
", yaml_initialize"
414 IF (
PRESENT(report))
THEN
423 & filename, lenstr), &
424 &
noerr, __line__, myfile))
THEN
431 IF (self%IsCreated)
CALL self%destroy ()
441 IF (ldump)
CALL self%dump ()
471 logical :: FirstPass, Lswitch(Ldim)
473 integer :: Nblanks, Nbranches, Npairs
474 integer :: i, io_err, status
476 character (len=Lkey) :: anchor, io_errmsg, key
477 character (len=Lmax) :: line, value
479 character (len=*),
parameter :: MyFile = &
480 & __FILE__//
", yaml_tree_create"
486 OPEN (unit=
iunit, file=self%filename, form=
'formatted', &
487 & status=
'old', iostat=io_err, iomsg=io_errmsg)
488 IF (io_err.ne.0)
THEN
505 yaml_line :
DO WHILE (.true.)
507 status=self%read_line(nblanks, line, key,
value, anchor, &
528 IF (nblanks.eq.0)
THEN
529 nbranches = nbranches+1
534 IF (firstpass.and.(nblanks.gt.0))
THEN
542 IF (nblanks.gt.0)
THEN
543 IF (mod(nblanks, self%indent).ne.0)
THEN
566 self%Nbranches=nbranches
571 IF (.not.self%IsCreated)
THEN
572 ALLOCATE ( self%list(npairs) )
573 self%IsCreated=.true.
582 10
FORMAT (/,
' YAML_TREE_CREATE - Unable to open input YAML file: ', &
583 & a,/,20x,
'ERROR: ',a)
584 20
FORMAT (/,
' YAML_TREE_CREATE - Error while reading YAML file: ', &
585 & a,/,20x,
'LINE: ',a)
586 30
FORMAT (/,
' YAML_TREE_CREATE - Inconsistent indentation, ', &
587 &
'self%indent = ',i0,
', nblanks = ',i0)
588 40
FORMAT (/,
' YAML_TREE_CREATE - Inconsistent indentation, ', &
589 &
'nblanks = ',i0,
', indent blank policy = ',i0,/,20x, &
590 &
'Number of nested collections = ',i0, &
591 &
' is greater than 3',/,20x,
'Line: ',a)
592 50
FORMAT (/,
' YAML_TREE_CREATE - Cannot find branches in YAML ', &
624 INQUIRE (unit=
iunit, opened=lopened)
633 IF (
ASSOCIATED(self%list))
THEN
634 self%IsCreated=.false.
635 DEALLOCATE (self%list)
660 integer :: Lstr, Nblanks, i, indent, padding
662 character (len=Lkey) :: key
663 character (len=Lmax) :: string, value
674 padding=self%list(i)%left_padding
675 nblanks=indent*padding
677 IF (
ALLOCATED(self%list(i)%value))
THEN
678 value=self%list(i)%value
683 IF (self%list(i)%is_block)
THEN
685 IF (self%list(i)%is_sequence)
THEN
686 WRITE (string,20) i, repeat(char(32),nblanks),
'- ', &
687 & trim(key),
': [', trim(
value),
']'
689 WRITE (string,30) i, repeat(char(32),nblanks),
'- ', &
690 & trim(key),
': ', trim(
value)
693 WRITE (string,40) i, repeat(char(32),nblanks),
'- ', &
698 IF (self%list(i)%is_sequence)
THEN
699 WRITE (string,30) i, repeat(char(32),nblanks), &
700 & trim(key),
': [', trim(
value),
']'
702 WRITE (string,40) i, repeat(char(32),nblanks), &
703 & trim(key),
': ', trim(
value)
706 WRITE (string,50) i, repeat(char(32),nblanks), &
714 10
FORMAT (/,
"YAML Tree Dictinary, file: '",a,
"'",/, &
715 &
'==========================',/)
716 20
FORMAT (
'L=',i4.4,1x,
'% ',6a)
717 30
FORMAT (
'L=',i4.4,1x,
'% ',5a)
718 40
FORMAT (
'L=',i4.4,1x,
'% ',4a)
719 50
FORMAT (
'L=',i4.4,1x,
'% ',3a)
747 character (len=*),
intent(in) :: keystring
756 integer :: i, ib, ic, ie, ik, ipair, is, j, li, pid
757 integer :: lstr, lenstr, nkeys, npairs, nvalues
758 integer :: icomma, idot
761 integer,
allocatable :: p(:)
763 character (len=:),
allocatable :: kstring
764 character (len=:),
allocatable :: vstring
766 character (len=*),
parameter :: myfile = &
767 & __FILE__//
", yaml_tree_extract"
777 lstr=len_trim(keystring)
779 & keystring, lenstr), &
780 &
noerr, __line__, myfile))
RETURN
786 ALLOCATE ( k(nkeys) )
792 idot=index(kstring,char(46),back=.false.)
800 & kstring(is:ie), lenstr), &
801 &
noerr, __line__, myfile))
RETURN
802 IF (idot.gt.0) kstring(is:ie+1) = repeat(char(32), ie-is+2)
803 kstring=trim(adjustl(kstring))
821 lstr=len_trim(self%list(i)%key)
822 IF ((self%list(i)%key).eq.(k(ik)%value))
THEN
825 print
'(2(a,i0,2a))',
'key ',ik,
' = ', trim(k(ik)%value), &
826 &
', YAML list ',i,
' = ', &
827 & trim(self%list(i)%key)
830 pid=self%list(i)%parent_id
831 IF (self%list(i)%is_block.or.self%list(pid)%is_block)
THEN
834 IF (ik.eq.nkeys)
THEN
846 IF (blockflow.and.(self%list(i)%left_padding.eq.0))
THEN
854 IF (npairs.ne.0)
THEN
855 IF (.not.
ALLOCATED(p))
ALLOCATE ( p(npairs) )
872 IF ((self%list(i)%key).eq.(k(ik)%value))
THEN
873 IF (ik.eq.nkeys)
THEN
880 IF ((ic.gt.0).and.(self%list(i)%left_padding.eq.0))
THEN
898 & self%list(ipair)%value, &
900 &
noerr, __line__, myfile))
RETURN
922 IF (self%list(ipair)%is_sequence)
THEN
923 lstr=len_trim(vstring)
924 nvalues=count((/(vstring(j:j), j=1,lstr)/) == char(44)) + 1
926 IF (.not.
ALLOCATED(s))
THEN
927 ALLOCATE ( s(npairs) )
929 ALLOCATE ( s(i)%vector(nvalues) )
930 s(i)%has_vector=.true.
934 icomma=index(vstring,char(44),back=.false.)
936 IF (icomma.eq.0)
THEN
944 &
noerr, __line__, myfile))
RETURN
947 print
'(3a,2(i0,a),a)',
'keystring = ',trim(keystring), &
948 &
', S(', i,
')%vector(', j,
') = ', &
949 & trim(s(i)%vector(j)%value)
952 IF (icomma.gt.0) vstring(is:ie+1)=repeat(char(32),ie-is+2)
953 vstring=trim(adjustl(vstring))
960 IF (.not.
ALLOCATED(s))
THEN
961 ALLOCATE ( s(npairs) )
963 s(i)%has_vector=.false.
966 & vstring, lenstr), &
967 &
noerr, __line__, myfile))
RETURN
970 print
'(a,i0,4a)',
'keystring ',i,
' = ', trim(keystring), &
971 &
', value = ', trim(s(i)%value)
981 IF (self%list(ipair)%is_sequence)
THEN
982 lstr=len_trim(vstring)
983 nvalues=count((/(vstring(j:j), j=1,lstr)/) == char(44)) + 1
985 ALLOCATE ( s(nvalues) )
986 s(i)%has_vector=.false.
990 icomma=index(vstring,char(44),back=.false.)
992 IF (icomma.eq.0)
THEN
1000 &
noerr, __line__, myfile))
RETURN
1001 IF (icomma.gt.0) vstring(is:ie+1)=repeat(char(32),ie-is+2)
1002 vstring=trim(adjustl(vstring))
1005 print
'(a,i0,4a)',
'keystring ',j,
' = ', &
1006 & trim(keystring), &
1007 &
', value = ', trim(s(j)%value)
1016 s(1)%has_vector=.false.
1019 & vstring, lenstr), &
1020 &
noerr, __line__, myfile))
RETURN
1023 print
'(4a)',
'keystring = ', trim(keystring), &
1024 &
', value = ', trim(s(1)%value)
1034 IF (
ALLOCATED(k))
DEALLOCATE (k)
1035 IF (
ALLOCATED(p))
DEALLOCATE (p)
1036 IF (
ALLOCATED(kstring))
DEALLOCATE (kstring)
1037 IF (
ALLOCATED(vstring))
DEALLOCATE (vstring)
1039 10
FORMAT (/,
" YAML_TREE_EXTRACT - Cannot find key-string: '",a, &
1040 &
"'",/,21x,
'File: ',a)
1041 20
FORMAT (/,
" YAML_TREE_EXTRACT - Not supported key-string: '",a, &
1042 &
"'",/,21x,
'nested sub-blocking in a leading blocking ', &
1043 &
'list',/,21x,
'File: ',a)
1068 logical :: Lswitch(Ldim)
1070 integer :: Nblanks, LenStr, left_padding, new_parent, old_parent
1071 integer :: i, ibranch, icount, ic_alias, ic_anchor, status
1073 character (len=Lkey) :: anchor, key
1074 character (len=Lmax) :: line, value
1076 character (len=*),
parameter :: MyFile = &
1077 & __FILE__//
", yaml_tree_fill"
1090 yaml_line :
DO WHILE (.true.)
1092 status=self%read_line(nblanks, line, key,
value, anchor, &
1095 SELECT CASE (status)
1113 IF (nblanks.eq.0)
THEN
1121 self%list(icount)%has_alias = lswitch(1)
1122 self%list(icount)%has_anchor = lswitch(2)
1123 self%list(icount)%is_block = lswitch(3)
1124 self%list(icount)%is_sequence = lswitch(4)
1125 self%list(icount)%is_logical = lswitch(5)
1126 self%list(icount)%is_integer = lswitch(6)
1127 self%list(icount)%is_real = lswitch(7)
1128 self%list(icount)%is_string = lswitch(8)
1130 IF (lswitch(1)) ic_alias=ic_alias+1
1131 IF (lswitch(2)) ic_anchor=ic_anchor+1
1135 left_padding=nblanks/self%indent
1136 self%list(icount)%left_padding=left_padding
1140 IF (nblanks.gt.0)
THEN
1141 IF (left_padding.gt.self%list(icount-1)%left_padding)
THEN
1142 new_parent=old_parent
1146 self%list(icount)%id=icount
1147 self%list(icount)%parent_id=new_parent
1155 &
noerr, __line__, myfile))
RETURN
1159 &
noerr, __line__, myfile))
RETURN
1161 IF (len_trim(
value).gt.0)
THEN
1164 &
noerr, __line__, myfile))
RETURN
1167 IF (lswitch(2).and.len_trim(anchor).gt.0)
THEN
1169 & anchor, lenstr), &
1170 &
noerr, __line__, myfile))
RETURN
1180 IF ((ic_alias.gt.0).and.(ic_anchor.gt.0))
THEN
1181 CALL self%fill_aliases (ic_alias, ic_anchor)
1188 10
FORMAT (/,
' YAML_TREE_FILL - Error while reading YAML file: ', &
1189 & a,/,18x,
'LINE: ',a)
1212 integer,
intent(in) :: Nalias
1213 integer,
intent(in) :: Nanchor
1217 logical :: Lswitch(Ldim)
1219 integer :: Ialias, LenStr, i, j, ic
1221 character (len=Lkey),
dimension(Nanchor) :: AnchorKey, AnchorVal
1222 character (len=Lmax) :: AliasVal
1224 character (len=*),
parameter :: MyFile = &
1225 & __FILE__//
", yaml_tree_fill_aliases"
1233 IF (self%list(i)%has_anchor)
THEN
1235 anchorkey(ic)=self%list(i)%anchor
1236 anchorval(ic)=self%list(i)%value
1248 IF (self%list(j)%has_alias)
THEN
1249 aliasval=self%list(j)%value
1250 ialias=index(aliasval,char(42),back=.false.)
1251 IF (ialias.gt.0)
THEN
1252 aliasval(ialias:ialias)=char(32)
1253 aliasval=trim(adjustl(aliasval))
1259 IF (trim(aliasval).eq.trim(anchorkey(i)))
THEN
1260 DEALLOCATE (self%list(j)%value)
1262 & trim(anchorval(i)), &
1264 &
noerr, __line__, myfile))
RETURN
1268 self%list(j)%is_logical = lswitch(5)
1269 self%list(j)%is_integer = lswitch(6)
1270 self%list(j)%is_real = lswitch(7)
1271 self%list(j)%is_string = lswitch(8)
1302 character (len=*),
intent(in ) :: keystring
1310 integer :: lstr, lenstr
1311 integer :: i, idot, ie, is, j, nkeys
1313 character (len=:),
allocatable :: kstring
1315 character (len=*),
parameter :: myfile = &
1316 & __FILE__//
", yaml_tree_has"
1326 lstr=len_trim(keystring)
1328 & keystring, lenstr), &
1329 &
noerr, __line__, myfile))
RETURN
1335 IF (nkeys.eq.1)
THEN
1336 DO i=1,
SIZE(self%list)
1337 IF (self%list(i)%key.eq.kstring)
THEN
1342 DEALLOCATE (kstring)
1348 ALLOCATE ( k(nkeys) )
1354 idot=index(kstring,char(46),back=.false.)
1357 ie=len_trim(kstring)
1362 & kstring(is:ie), lenstr), &
1363 &
noerr, __line__, myfile))
RETURN
1364 IF (idot.gt.0) kstring(is:ie+1) = repeat(char(32), ie-is+2)
1365 kstring=trim(adjustl(kstring))
1374 DO i=is,
SIZE(self%list)
1375 IF (self%list(i)%key.eq.k(j)%value)
THEN
1381 IF (.not.foundit)
EXIT
1383 DEALLOCATE (k, kstring)
1390 & anchor, Lswitch) &
1431 logical,
intent(out) :: lswitch(:)
1433 integer,
intent(out) :: nblanks
1435 character (len=*),
intent(out) :: line
1436 character (len=*),
intent(out) :: key
1437 character (len=*),
intent(out) :: value
1438 character (len=*),
intent(out) :: anchor
1442 logical :: lbracket, rbracket
1444 integer :: ialias, ianchor, iblank, icolon, idash, ihash, ispace
1445 integer :: ibracketl, ibracketr
1446 integer :: lstr, lstrnext, lstrval, i, j, k
1449 character (len=Lmax) :: linecopy, next_line
1451 character (len=*),
parameter :: myfile = &
1452 & __FILE__//
", yaml_tree_read_line"
1471 anchor(i:i)=char(32)
1480 READ (
iunit,
'(a)',err=10,
END=20) line
1486 DO i=1,len_trim(line)
1492 linecopy=trim(adjustl(line))
1497 IF ((lstr.gt.0).and.(linecopy(1:1).ne.char(35)))
THEN
1498 ihash=index(line,char(35),back=.false.)
1499 IF (ihash.gt.0)
THEN
1501 line=trim(line(1:lstr))
1517 icolon=index(line,char(58),back=.false.)
1518 IF (icolon.eq.0)
THEN
1527 idash =index(line,char(45),back=.false.)
1528 IF ((idash.gt.0).and.(idash.lt.icolon))
THEN
1529 iblank=index(line(1:idash),char(32),back=.true.)
1531 iblank=index(line(1:icolon),char(32),back=.true.)
1532 IF (iblank.gt.0)
THEN
1534 IF ((65.le.ichar(line(1:1))).and. &
1535 & (ichar(line(1:1)).le.122))
THEN
1537 ELSE IF ((65.le.ichar(line(k:k))).and. &
1538 & (ichar(line(k:k)).le.122))
THEN
1539 iblank=index(line(1:k),char(32),back=.true.)
1550 IF ((idash.gt.0).and.(idash.lt.icolon))
THEN
1551 key=trim(adjustl(line(idash+1:icolon-1)))
1553 key=trim(adjustl(line(1:icolon-1)))
1555 value=trim(adjustl(line(icolon+1:lstr)))
1559 ialias=index(
value,char(42),back=.false.)
1560 IF (ialias.gt.0)
THEN
1564 ianchor=index(
value,char(38),back=.false.)
1565 IF (ianchor.gt.0)
THEN
1566 ispace=index(value(ianchor+1:),char(32),back=.false.)
1567 anchor=value(ianchor+1:ispace)
1569 value(ianchor:ispace)=repeat(char(32),ispace-ianchor+1)
1570 value=trim(adjustl(
value))
1573 IF ((idash.gt.0).and.(idash.lt.icolon))
THEN
1577 ibracketl=index(
value,char(91),back=.false.)
1578 IF (ibracketl.gt.0)
THEN
1580 value(ibracketl:ibracketl)=char(32)
1581 value=trim(adjustl(
value))
1584 ibracketr=index(
value,char(93),back=.false.)
1585 IF (ibracketr.gt.0)
THEN
1587 value(ibracketr:ibracketr)=char(32)
1588 value=trim(adjustl(
value))
1596 IF (.not.rbracket.and.lbracket)
THEN
1597 DO WHILE (.not.rbracket)
1598 READ (
iunit,
'(a)',err=10,
END=20) next_line
1602 DO i=1,len_trim(next_line)
1603 j=ichar(next_line(i:i))
1605 next_line(i:i)=char(32)
1608 next_line=trim(adjustl(next_line))
1613 ihash=index(next_line,char(35),back=.false.)
1614 lstrnext=len_trim(next_line)
1615 IF ((lstrnext.gt.0).and.(ihash.gt.0))
THEN
1617 next_line=trim(next_line(1:lstrnext))
1618 lstrnext=len_trim(next_line)
1624 lstrval=len_trim(
value)
1625 line=line(1:lstr)//char(32)//next_line(1:lstrnext)
1626 value=value(1:lstrval)//char(32)//next_line(1:lstrnext)
1628 ibracketr=index(
value,char(93),back=.false.)
1629 IF (ibracketr.gt.0)
THEN
1631 value(ibracketr:ibracketr)=char(32)
1632 value=trim(adjustl(
value))
1636 IF (lbracket.and.rbracket) lswitch(4)=.true.
1652 30
FORMAT (/,
' YAML_TREE_READ_LINE - Unable to find colon token ', &
1653 &
'after key word',/,23x,
'LINE: ',a)
1679 character (len=:),
allocatable,
intent(inout) :: outstring
1680 character (len=*),
intent(in) :: inpstring
1681 integer,
intent(out) :: lstr
1693 lstr=len_trim(inpstring)
1694 IF (.not.
allocated(outstring))
THEN
1695 allocate (
character(LEN=Lstr) :: outstring, stat=errflag)
1697 deallocate (outstring)
1698 allocate (
character(LEN=Lstr) :: outstring, stat=errflag)
1703 outstring = inpstring
1733 character (len=*),
intent(in) :: string
1734 character (len=*),
intent(in) :: token
1746 lstr=len_trim(string)
1748 IF (string(i:i).eq.token)
THEN
1756 FUNCTION yaml_error (flag, NoErr, line, routine)
RESULT (foundit)
1779 integer,
intent(in) :: flag,
noerr, line
1781 character (len=*),
intent(in) :: routine
1792 IF (flag.ne.
noerr)
THEN
1796 10
FORMAT (
' Found Error: ', i2.2, t20,
'Line: ', i0, &
1797 & t35,
'Source: ', a)
1829 character (len=*),
intent(in) :: keystring
1830 TYPE (
yaml_ivec),
allocatable,
intent(out) :: v(:)
1836 integer :: lenstr, nitems, nvalues, i, n
1839 character (len=Lmax) :: msg
1841 character (len=*),
parameter :: myfile = &
1842 & __FILE__//
", yaml_Get_i_struc"
1851 &
noerr, __line__, myfile))
RETURN
1855 nitems=
SIZE(s, dim=1)
1856 IF (
ALLOCATED(v))
DEALLOCATE (v)
1857 ALLOCATE ( v(nitems) )
1862 IF (s(n)%has_vector)
THEN
1863 nvalues=
SIZE(s(n)%vector)
1864 ALLOCATE ( v(n)%vector(nvalues) )
1866 READ (s(n)%vector(i)%value, * ,iostat=status, iomsg=msg) &
1871 & s(n)%vector(i)%value, &
1881 IF (
ALLOCATED(s))
DEALLOCATE (s)
1883 10
FORMAT (/,
' YAML_GET_I_STRUC - Error while converting string to', &
1884 &
' integer, key: ',a,
', value = ',a,/,20x,
'ErrMsg: ',a)
1913 character (len=*),
intent(in) :: keystring
1914 TYPE (
yaml_lvec),
allocatable,
intent(out) :: v(:)
1920 integer :: nitems, nvalues, n, i
1923 character (len=*),
parameter :: myfile = &
1924 & __FILE__//
", yaml_Get_l_struc"
1933 &
noerr, __line__, myfile))
RETURN
1937 nitems=
SIZE(s, dim=1)
1938 IF (
ALLOCATED(v))
DEALLOCATE (v)
1939 ALLOCATE ( v(nitems) )
1944 IF (s(n)%has_vector)
THEN
1945 nvalues=
SIZE(s(n)%vector)
1946 ALLOCATE ( v(n)%vector(nvalues) )
1949 v(n)%vector(i)=.true.
1951 v(n)%vector(i)=.false.
1959 IF (
ALLOCATED(s))
DEALLOCATE (s)
1988 character (len=*),
intent(in) :: keystring
1989 TYPE (
yaml_rvec),
allocatable,
intent(out) :: v(:)
1995 integer :: nitems, nvalues, i, n
1998 character (len=Lmax) :: msg
2000 character (len=*),
parameter :: myfile = &
2001 & __FILE__//
", yaml_Get_r_struc"
2010 &
noerr, __line__, myfile))
RETURN
2014 nitems=
SIZE(s, dim=1)
2015 IF (
ALLOCATED(v))
DEALLOCATE (v)
2016 ALLOCATE ( v(nitems) )
2021 IF (s(n)%has_vector)
THEN
2022 nvalues=
SIZE(s(n)%vector)
2023 ALLOCATE ( v(n)%vector(nvalues) )
2025 READ (s(n)%vector(i)%value, * ,iostat=status, iomsg=msg) &
2030 & s(n)%vector(i)%value, &
2036 READ (s(n)%value, * ,iostat=status, iomsg=msg) &
2050 IF (
ALLOCATED(s))
DEALLOCATE (s)
2052 10
FORMAT (/,
' YAML_GET_R_STRUC - Error while converting string to', &
2053 &
' real, key: ',a,
', value = ',a,/,20x,
'ErrMsg: ',a)
2082 character (len=*),
intent(in) :: keystring
2083 TYPE (
yaml_svec),
allocatable,
intent(out) :: v(:)
2089 integer :: nitems, nvalues, n, i
2092 character (len=*),
parameter :: myfile = &
2093 & __FILE__//
", yaml_Get_s_struc"
2102 &
noerr, __line__, myfile))
RETURN
2106 nitems=
SIZE(s, dim=1)
2107 IF (
ALLOCATED(v))
DEALLOCATE (v)
2108 ALLOCATE ( v(nitems) )
2113 IF (s(n)%has_vector)
THEN
2114 nvalues=
SIZE(s(n)%vector)
2115 ALLOCATE ( v(n)%vector(nvalues) )
2117 v(n)%vector(i)%value=s(n)%vector(i)%value
2120 v(n)%value=s(n)%value
2126 IF (
ALLOCATED(s))
DEALLOCATE (s)
2152 character (len=*),
intent(in) :: keystring
2153 integer,
intent(out) :: value
2159 integer :: nvalues, status
2161 character (len=Lmax) :: msg
2163 character (len=*),
parameter :: myfile = &
2164 & __FILE__//
", yaml_Get_ivar_0d"
2173 &
noerr, __line__, myfile))
RETURN
2179 IF (nvalues.gt.1)
THEN
2191 READ (s(1)%value, *, iostat=status, iomsg=msg)
value
2195 & s(1)%value, trim(msg)
2202 IF (
ALLOCATED(s))
DEALLOCATE (s)
2204 10
FORMAT (/,
' YAML_GET_IVAR_0D - Extracted value is not a scalar,', &
2205 &
' key-string: ',a,/,20x,
'Nvalues = ',i0,/,20x,
'File: ',a)
2206 20
FORMAT (/,
' YAML_GET_IVAR_0D - Error while converting string to', &
2207 &
' integer, key: ',a,
', value = ',a,/,20x,
'ErrMsg: ',a)
2233 character (len=*),
intent(in) :: keystring
2234 integer,
intent(out) ::
value(:)
2240 integer :: nvalues, i, status
2242 character (len=Lmax) :: msg
2244 character (len=*),
parameter :: myfile = &
2245 & __FILE__//
", yaml_Get_ivar_1d"
2254 &
noerr, __line__, myfile))
RETURN
2258 nvalues=
SIZE(s, dim=1)
2260 IF (
SIZE(
value, dim=1).lt.nvalues)
THEN
2265 &
SIZE(
value, dim=1), &
2274 READ (s(i)%value, *, iostat=status, iomsg=msg) value(i)
2278 & s(i)%value, trim(msg)
2285 IF (
ALLOCATED(s))
DEALLOCATE (s)
2287 10
FORMAT (/,
' YAML_GET_IVAR_1D - Inconsistent number of values,', &
2288 &
' key-string: ',a,/,20x,
'YAML size = ',i0, &
2289 &
', Variable size = ',i0,/,20x,
'File: ',a)
2290 20
FORMAT (/,
' YAML_GET_IVAR_1D - Error while converting string to', &
2291 &
' integer, key: ',a,
', value = ',a,/,20x,
'ErrMsg: ',a)
2316 character (len=*),
intent(in) :: keystring
2317 logical,
intent(out) :: value
2323 integer :: nvalues, status
2325 character (len=*),
parameter :: myfile = &
2326 & __FILE__//
", yaml_Get_lvar_0d"
2335 &
noerr, __line__, myfile))
RETURN
2341 IF (nvalues.gt.1)
THEN
2362 IF (
ALLOCATED(s))
DEALLOCATE (s)
2364 10
FORMAT (/,
' YAML_GET_LVAR_0D - Extracted value is not a scalar,', &
2365 &
' key-string: ',a,/,20x,
'Nvalues = ',i0,/,20x,
'File: ',a)
2391 character (len=*),
intent(in) :: keystring
2392 logical,
intent(out) ::
value(:)
2398 integer :: nvalues, i, status
2400 character (len=*),
parameter :: myfile = &
2401 & __FILE__//
", yaml_Get_lvar_1d"
2410 &
noerr, __line__, myfile))
RETURN
2414 nvalues=
SIZE(s, dim=1)
2416 IF (
SIZE(
value, dim=1).lt.nvalues)
THEN
2421 &
SIZE(
value, dim=1), &
2439 IF (
ALLOCATED(s))
DEALLOCATE (s)
2441 10
FORMAT (/,
' YAML_GET_LVAR_1D - Inconsistent number of values,', &
2442 &
' key-string: ',a,/,20x,
'YAML size = ',i0, &
2443 &
', Variable size = ',i0,/,20x,
'File: ',a)
2469 character (len=*),
intent(in) :: keystring
2476 integer :: nvalues, ie, status
2478 character (len=Lmax) :: msg
2480 character (len=*),
parameter :: myfile = &
2481 & __FILE__//
", yaml_Get_rvar_0d"
2490 &
noerr, __line__, myfile))
RETURN
2496 IF (nvalues.gt.1)
THEN
2508 s(1)%value=adjustl(s(1)%value)
2509 ie=len_trim(s(1)%value)
2510 READ (s(1)%value(1:ie), *, iostat=status, iomsg=msg)
value
2514 & s(1)%value, trim(msg)
2521 IF (
ALLOCATED(s))
DEALLOCATE (s)
2523 10
FORMAT (/,
' YAML_GET_RVAR_0D - Extracted value is not a scalar,', &
2524 &
' key-string: ',a,/,20x,
'Nvalues = ',i0,/,20x,
'File: ',a)
2525 20
FORMAT (/,
' YAML_GET_RVAR_0D - Error while converting string to', &
2526 &
' integer, key: ',a,
', value = ',a,/,20x,
'ErrMsg: ',a)
2552 character (len=*),
intent(in) :: keystring
2553 real (
kind_real),
intent(out) ::
value(:)
2559 integer :: nvalues, i, ie, status
2561 character (len=Lmax) :: msg
2563 character (len=*),
parameter :: myfile = &
2564 & __FILE__//
", yaml_Get_rvar_1d"
2573 &
noerr, __line__, myfile))
RETURN
2577 nvalues=
SIZE(s, dim=1)
2579 IF (
SIZE(
value, dim=1).lt.nvalues)
THEN
2584 &
SIZE(
value, dim=1), &
2593 s(i)%value=adjustl(s(i)%value)
2594 ie=len_trim(s(i)%value)
2595 READ (s(i)%value(1:ie), *, iostat=status, iomsg=msg) value(i)
2599 & s(i)%value, trim(msg)
2606 IF (
ALLOCATED(s))
DEALLOCATE (s)
2608 10
FORMAT (/,
' YAML_GET_RVAR_1D - Inconsistent number of values,', &
2609 &
' key-string: ',a,/,20x,
'YAML size = ',i0, &
2610 &
', Variable size = ',i0,/,20x,
'File: ',a)
2611 20
FORMAT (/,
' YAML_GET_RVAR_1D - Error while converting string to', &
2612 &
' real, key: ',a,
', value = ',a,/,20x,
'ErrMsg: ',a)
2638 character (len=*),
intent(in ) :: keystring
2639 character (len=*),
intent(out) :: value
2645 integer :: nvalues, status
2647 character (len=*),
parameter :: myfile = &
2648 & __FILE__//
", yaml_Get_lvar_0d"
2657 &
noerr, __line__, myfile))
RETURN
2663 IF (nvalues.gt.1)
THEN
2680 IF (
ALLOCATED(s))
DEALLOCATE (s)
2682 10
FORMAT (/,
' YAML_GET_SVAR_0D - Extracted value is not a scalar,', &
2683 &
' key-string: ',a,/,20x,
'Nvalues = ',i0,/,20x,
'File: ',a)
2709 character (len=*),
intent(in ) :: keystring
2710 character (len=*),
intent(out) ::
value(:)
2716 integer :: nvalues, i, status
2718 character (len=*),
parameter :: myfile = &
2719 & __FILE__//
", yaml_Get_lvar_1d"
2728 &
noerr, __line__, myfile))
RETURN
2732 nvalues=
SIZE(s, dim=1)
2734 IF (
SIZE(
value, dim=1).lt.nvalues)
THEN
2739 &
SIZE(
value, dim=1), &
2753 IF (
ALLOCATED(s))
DEALLOCATE (s)
2755 10
FORMAT (/,
' YAML_GET_SVAR_1D - Inconsistent number of values,', &
2756 &
' key-string: ',a,/,20x,
'YAML size = ',i0, &
2757 &
', Variable size = ',i0,/,20x,
'File: ',a)
2777 character(len=*),
intent(in) :: sinp
2781 integer :: lstr, i, j
2783 character (len=LEN(Sinp)) :: sout
2785 character (len=26),
parameter :: l =
'abcdefghijklmnopqrstuvwxyz'
2786 character (len=26),
parameter :: u =
'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
2795 j=index(u, sout(i:i))
2819 character (len=*),
intent(in) :: sinp
2823 integer :: lstr, i, j
2825 character (len=LEN(Sinp)) :: sout
2827 character (len=26),
parameter :: l =
'abcdefghijklmnopqrstuvwxyz'
2828 character (len=26),
parameter :: u =
'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
2837 j=index(l, sout(i:i))
2874 logical,
intent(inout) :: lswitch(:)
2876 character (len=*),
intent(inout) :: value
2880 integer :: lstr, schar
2881 integer :: colon, dot, exponent, letter, numeric, precision
2882 integer :: i, multiple
2900 lstr=len_trim(
value)
2903 schar=ichar(value(i:i))
2908 IF (((48.le.schar).and.(schar.le.57)).or. &
2909 & (schar.eq.43).or.(schar.eq.45)) numeric=numeric+1
2914 IF (schar.eq.46) dot=dot+1
2919 IF ((schar.eq.69).or.(schar.eq.101)) precision=precision+1
2923 IF ((schar.eq.69).or.(schar.eq.101)) exponent=exponent+1
2928 IF (lswitch(4)) multiple=multiple+1
2934 IF (schar.eq.58) colon=colon+1
2938 IF (((65.le.schar).and.(schar.le.90)).or. &
2939 & (schar.eq.97).or.(schar.eq.122)) letter=letter+1
2944 IF ((numeric.gt.0).and.(colon.eq.0))
THEN
2945 IF ((dot.gt.0).or.(exponent.gt.0).or.(precision.gt.0))
THEN
2951 IF ((
value.eq.
'true').or.(
value.eq.
'false').or. &
2952 & (
value.eq.
'TRUE').or.(
value.eq.
'FALSE'))
THEN
2954 ELSE IF (letter.gt.0)
THEN
2969 character (len=*),
intent(in) :: yaml_file
2973 character (len=*),
parameter :: myfile = &
2974 & __FILE__//
', process_yaml'
2983 &
noerror, __line__, myfile))
THEN
2984 WRITE (6,10) trim(yaml_file)
2985 10
FORMAT (/,
' PROCESS_YAML - Unable to create YAML object for:', &
2986 & /,13x,
'FileName = ',a)
2992 IF (yml%has(
'export').and.yml%has(
'import'))
THEN
2999 ELSE IF (.not.yml%has(
'svn_repository').and. &
3000 & yml%has(
'metadata'))
THEN
3005 ELSE IF (yml%has(
'svn_repository').and. &
3006 & yml%has(
'metadata'))
THEN
3041 character (len=*),
intent(in ) :: filename
3042 character (len=*),
intent(in ) :: key
3047 integer :: i, lenstr
3049 character (len=*),
parameter :: myfile = &
3050 & __FILE__//
", cmeps_metadata"
3058 IF (.not.
ASSOCIATED(self%list))
THEN
3061 &
noerror, __line__, myfile))
THEN
3071 &
noerror, __line__, myfile))
RETURN
3076 &
noerror, __line__, myfile))
RETURN
3080 &
noerror, __line__, myfile))
RETURN
3084 &
noerror, __line__, myfile))
RETURN
3088 &
noerror, __line__, myfile))
RETURN
3092 &
noerror, __line__, myfile))
RETURN
3096 &
noerror, __line__, myfile))
RETURN
3100 &
noerror, __line__, myfile))
RETURN
3104 &
noerror, __line__, myfile))
RETURN
3108 &
noerror, __line__, myfile))
RETURN
3112 &
noerror, __line__, myfile))
RETURN
3114 IF (.not.
allocated(
yreal1))
THEN
3119 &
noerror, __line__, myfile))
RETURN
3121 IF (.not.
allocated(
yreal2))
THEN
3126 &
noerror, __line__, myfile))
RETURN
3127 IF (.not.
allocated(
yreal1))
THEN
3136 &
noerror, __line__, myfile))
RETURN
3140 IF (.not.
allocated(s))
allocate ( s(
nentries) )
3144 s(i)%add_offset =
yreal1(i)
3149 &
noerror, __line__, myfile))
RETURN
3153 &
noerror, __line__, myfile))
RETURN
3157 &
noerror, __line__, myfile))
RETURN
3162 &
noerror, __line__, myfile))
RETURN
3167 &
noerror, __line__, myfile))
RETURN
3171 &
noerror, __line__, myfile))
RETURN
3175 &
noerror, __line__, myfile))
RETURN
3179 &
noerror, __line__, myfile))
RETURN
3183 &
noerror, __line__, myfile))
RETURN
3187 &
noerror, __line__, myfile))
RETURN
3189 s(i)%connected=.false.
3191 s(i)%connected=.true.
3196 &
noerror, __line__, myfile))
RETURN
3200 &
noerror, __line__, myfile))
RETURN
3223 WRITE (
stdout,
'(/,3a,/,3a)') &
3224 &
"Coupling Metadata Dictionary, key: '", trim(key),
"',", &
3225 & repeat(
'=',28),
' File: ', trim(filename)
3227 WRITE (
stdout,
'(/,a,a)')
' - standard_name: ', &
3228 & trim(s(i)%standard_name)
3229 WRITE (
stdout,
'(a,a)')
' long_name: ', &
3230 & trim(s(i)%long_name)
3231 WRITE (
stdout,
'(a,a)')
' short_name: ', &
3232 & trim(s(i)%short_name)
3233 WRITE (
stdout,
'(a,a)')
' data_netcdf_variable: ', &
3234 & trim(s(i)%data_netcdf_vname)
3235 WRITE (
stdout,
'(a,a)')
' data_netcdf_time: ', &
3236 & trim(s(i)%data_netcdf_tname)
3237 WRITE (
stdout,
'(a,a)')
' source_units: ', &
3238 & trim(s(i)%source_units)
3239 WRITE (
stdout,
'(a,a)')
' destination_units: ', &
3240 & trim(s(i)%destination_units)
3241 WRITE (
stdout,
'(a,a)')
' source_grid: ', &
3242 & trim(s(i)%source_grid)
3243 WRITE (
stdout,
'(a,a)')
' destination_grid: ', &
3244 & trim(s(i)%destination_grid)
3245 WRITE (
stdout,
'(a,1p,e15.8)')
' add_offset: ', &
3247 WRITE (
stdout,
'(a,1p,e15.8)')
' scale: ', &
3249 WRITE (
stdout,
'(a,l1)')
' debug_write: ', &
3251 WRITE (
stdout,
'(a,l1)')
' connected: ', &
3253 WRITE (
stdout,
'(a,a)')
' connected_to: ', &
3254 & trim(s(i)%connected_to)
3255 WRITE (
stdout,
'(a,a)')
' map_type: ', &
3256 & trim(s(i)%map_type)
3257 WRITE (
stdout,
'(a,a)')
' map_norm: ', &
3258 & trim(s(i)%map_norm)
3263 10
FORMAT (/,
' CMEPS_METADATA - Unable to create YAML object for', &
3264 &
' ROMS/CMEPS configuration metadata file: ',/,21x,a,/, &
3265 & 21x,
'Default file is located in source directory.')
3292 character (len=*),
intent(in) :: filename
3301 character (len=*),
parameter :: myfile = &
3302 & __FILE__//
", coupling_metadata"
3316 &
noerror, __line__, myfile))
RETURN
3321 &
noerror, __line__, myfile))
RETURN
3325 &
noerror, __line__, myfile))
RETURN
3329 &
noerror, __line__, myfile))
RETURN
3333 &
noerror, __line__, myfile))
RETURN
3337 &
noerror, __line__, myfile))
RETURN
3341 &
noerror, __line__, myfile))
RETURN
3345 &
noerror, __line__, myfile))
RETURN
3349 &
noerror, __line__, myfile))
RETURN
3353 &
noerror, __line__, myfile))
RETURN
3357 &
noerror, __line__, myfile))
RETURN
3363 &
noerror, __line__, myfile))
RETURN
3369 &
noerror, __line__, myfile))
RETURN
3375 &
noerror, __line__, myfile))
RETURN
3381 IF (.not.
allocated(s))
allocate ( s(
nentries) )
3385 s(i)%add_offset =
yreal1(i)
3390 &
noerror, __line__, myfile))
RETURN
3394 &
noerror, __line__, myfile))
RETURN
3398 &
noerror, __line__, myfile))
RETURN
3403 &
noerror, __line__, myfile))
RETURN
3408 &
noerror, __line__, myfile))
RETURN
3412 &
noerror, __line__, myfile))
RETURN
3416 &
noerror, __line__, myfile))
RETURN
3420 &
noerror, __line__, myfile))
RETURN
3424 &
noerror, __line__, myfile))
RETURN
3428 &
noerror, __line__, myfile))
RETURN
3430 s(i)%connected=.false.
3432 s(i)%connected=.true.
3437 &
noerror, __line__, myfile))
RETURN
3441 &
noerror, __line__, myfile))
RETURN
3465 WRITE (
stdout,
'(/,2a,/,a)') &
3466 &
'Coupling Metadata Dictionary, File: ', &
3467 & trim(filename), repeat(
'=',28)
3469 WRITE (
stdout,
'(/,a,a)')
' - standard_name: ', &
3470 & trim(s(i)%standard_name)
3471 WRITE (
stdout,
'(a,a)')
' long_name: ', &
3472 & trim(s(i)%long_name)
3473 WRITE (
stdout,
'(a,a)')
' short_name: ', &
3474 & trim(s(i)%short_name)
3475 WRITE (
stdout,
'(a,a)')
' data_netcdf_variable: ', &
3476 & trim(s(i)%data_netcdf_vname)
3477 WRITE (
stdout,
'(a,a)')
' data_netcdf_time: ', &
3478 & trim(s(i)%data_netcdf_tname)
3479 WRITE (
stdout,
'(a,a)')
' source_units: ', &
3480 & trim(s(i)%source_units)
3481 WRITE (
stdout,
'(a,a)')
' destination_units: ', &
3482 & trim(s(i)%destination_units)
3483 WRITE (
stdout,
'(a,a)')
' source_grid: ', &
3484 & trim(s(i)%source_grid)
3485 WRITE (
stdout,
'(a,a)')
' destination_grid: ', &
3486 & trim(s(i)%destination_grid)
3487 WRITE (
stdout,
'(a,1p,e15.8)')
' add_offset: ', &
3489 WRITE (
stdout,
'(a,1p,e15.8)')
' scale: ', &
3491 WRITE (
stdout,
'(a,l1)')
' debug_write: ', &
3493 WRITE (
stdout,
'(a,l1)')
' connected: ', &
3495 WRITE (
stdout,
'(a,a)')
' connected_to: ', &
3496 & trim(s(i)%connected_to)
3497 WRITE (
stdout,
'(a,a)')
' regrid_method: ', &
3498 & trim(s(i)%regrid_method)
3499 WRITE (
stdout,
'(a,a)')
' extrapolate_method: ', &
3500 & trim(s(i)%extrapolate_method)
3507 10
FORMAT (/,
' COUPLING_METADATA - Unable to create YAML object', &
3508 &
' for ROMS I/O metadata file: ',/,21x,a,/, &
3509 & 21x,
'Default file is located in source directory.')
3561 character (len=*),
intent(in) :: filename
3563 TYPE (yaml_tree),
intent(inout) :: YML
3569 real (dp) :: offset, scale
3571 character (len=160) :: Vinfo(8)
3573 character (len=*),
parameter :: MyFile = &
3574 & __FILE__//
", io_metadata"
3584 &
noerror, __line__, myfile))
RETURN
3589 &
noerror, __line__, myfile))
RETURN
3593 &
noerror, __line__, myfile))
RETURN
3597 &
noerror, __line__, myfile))
RETURN
3601 &
noerror, __line__, myfile))
RETURN
3605 &
noerror, __line__, myfile))
RETURN
3609 &
noerror, __line__, myfile))
RETURN
3613 &
noerror, __line__, myfile))
RETURN
3619 &
noerror, __line__, myfile))
RETURN
3625 &
noerror, __line__, myfile))
RETURN
3634 WRITE (
stdout,
'(/,2a,/,a)') &
3635 &
'ROMS I/O Metadata Dictionary, File: ', &
3636 & trim(filename), repeat(
'=',28)
3640 DO i=1,len(vinfo(1))
3641 vinfo(j)(i:i)=char(32)
3656 WRITE (
stdout,
'(/,a,a)')
' - variable: ', &
3658 WRITE (
stdout,
'(a,a)')
' standard_name: ', &
3660 WRITE (
stdout,
'(a,a)')
' long_name: ', &
3662 WRITE (
stdout,
'(a,a)')
' units: ', &
3664 WRITE (
stdout,
'(a,a)')
' field: ', &
3666 WRITE (
stdout,
'(a,a)')
' time: ', &
3668 WRITE (
stdout,
'(a,a)')
' index_code: ', &
3670 WRITE (
stdout,
'(a,a)')
' type: ', &
3672 WRITE (
stdout,
'(a,1p,e15.8)')
' add_offset: ', &
3674 WRITE (
stdout,
'(a,1p,e15.8)')
' scale: ', &
3713 character (len=120) :: yaml_file
3715 character (len=*),
parameter :: myfile = &
3716 & __FILE__//
', read_yaml'
3722 10
FORMAT (/,
' Enter YAML filename: ',$)
3723 READ(5,
'(a)',err=20) yaml_file
type(yaml_svec), dimension(:), allocatable ystring8
logical function yaml_tree_has(self, keystring)
integer function, private yaml_countkeys(string, token)
integer function yaml_get_s_struc(self, keystring, v)
integer function, public yaml_initialize(self, filename, report)
integer function yaml_tree_read_line(self, nblanks, line, key, value, anchor, lswitch)
type(yaml_svec), dimension(:), allocatable ystring4
subroutine yaml_tree_fill_aliases(self, nalias, nanchor)
subroutine io_metadata(yml, filename)
logical, dimension(:), allocatable ylogical1
integer function yaml_get_ivar_0d(self, keystring, value)
integer function yaml_tree_extract(self, keystring, s)
character(len=len(sinp)) function, private yaml_uppercase(sinp)
type(yaml_svec), dimension(:), allocatable ystring6
type(yaml_svec), dimension(:), allocatable ystring12
logical, parameter ldebugyaml
integer function, public yaml_assignstring(outstring, inpstring, lstr)
integer function yaml_get_lvar_1d(self, keystring, value)
subroutine yaml_tree_destroy(self)
subroutine yaml_tree_fill(self)
real(kind_real), dimension(:), allocatable yreal1
type(yaml_svec), dimension(:), allocatable ystring9
character(len=55), dimension(7) yaml_errmsg
type(yaml_svec), dimension(:), allocatable ystring7
type(yaml_svec), dimension(:), allocatable ystring3
integer function yaml_get_rvar_0d(self, keystring, value)
integer function yaml_get_i_struc(self, keystring, v)
subroutine, public process_yaml(yaml_file)
subroutine yaml_tree_dump(self)
integer function yaml_get_svar_0d(self, keystring, value)
integer function yaml_get_rvar_1d(self, keystring, value)
integer, parameter noerror
integer function yaml_get_l_struc(self, keystring, v)
integer, parameter kind_real
subroutine, public coupling_metadata(yml, filename, s)
integer, parameter stdout
logical function, public yaml_error(flag, noerr, line, routine)
type(yaml_svec), dimension(:), allocatable ystring2
integer function yaml_get_svar_1d(self, keystring, value)
integer, parameter yaml_stdout
subroutine, private yaml_valuetype(value, lswitch)
subroutine, public cmeps_metadata(self, filename, key, s)
subroutine yaml_tree_create(self)
type(yaml_svec), dimension(:), allocatable ystring1
type(yaml_svec), dimension(:), allocatable ystring11
type(yaml_svec), dimension(:), allocatable ystring5
integer function yaml_get_r_struc(self, keystring, v)
type(yaml_svec), dimension(:), allocatable ystring10
real(kind_real), dimension(:), allocatable yreal2
character(len=len(sinp)) function, private yaml_lowercase(sinp)
integer function yaml_get_lvar_0d(self, keystring, value)
integer function yaml_get_ivar_1d(self, keystring, value)