gtool5 Fortran 90/95 Library 1.0.0-rc5
日本語
Loading...
Searching...
No Matches
dc_url::urlsplit Interface Reference

Public Member Functions

subroutine url_split_c (fullname, file, var, attr, iorange)

Detailed Description

Definition at line 77 of file dc_url.f90.

Member Function/Subroutine Documentation

◆ url_split_c()

subroutine dc_url::urlsplit::url_split_c ( character(len = *), intent(in) fullname,
character(len = *), intent(out), optional file,
character(len = *), intent(out), optional var,
character(len = *), intent(out), optional attr,
character(len = *), intent(out), optional iorange )

Split variable URL to components

Splits the variable URL given in fullname into filename file, variable name var, attribute name attr, and I/O range specification iorange and returns them. Components that are not found are assigned empty strings.

Parameters
[in]fullnameVariable URL
[out]fileFilename (optional)
[out]varVariable name (optional)
[out]attrAttribute name (optional)
[out]iorangeI/O range specification (optional)

Definition at line 403 of file dc_url.f90.

404 use dc_types, only: string
405 character(len = *), intent(in):: fullname
406 character(len = *), intent(out), optional:: file, var, attr, iorange
407 character(len = STRING):: varpart
408 integer:: atmark, colon, comma
409 character(len = *), parameter:: VARNAME_SET &
410 = "0123456789eEdD+-=^,.:_" &
411 // "ABCDEFGHIJKLMNOPQRSTUVWXYZ" &
412 // "abcdefghijklmnopqrstuvwxyz"
413 continue
414 ! まず URL と変数属性指定 (? または @ 以降) を分離する。
415 ! URL は @ を含みうるため、最後の @ 以降に対して変数属性
416 ! として許されない文字(典型的には '/')が含まれていたら
417 ! 当該 @ は URL の一部とみなす。
418 atmark = index(fullname, gt_question)
419 if (atmark == 0) then
420 atmark = index(fullname, gt_atmark, back=.true.)
421 if (atmark /= 0) then
422 if (verify(trim(fullname(atmark+1: )), varname_set) /= 0) then
423 atmark = 0
424 endif
425 endif
426 endif
427 if (atmark == 0) then
428 ! 変数属性指定はなかった。
429 if (present(file)) file = fullname
430 if (present(var)) var = ''
431 if (present(attr)) attr = ''
432 if (present(iorange)) iorange = ''
433 return
434 endif
435 varpart = fullname(atmark+1: )
436 ! 変数属性指定があった。
437 if (present(file)) file = fullname(1: atmark - 1)
438 ! 範囲指定を探索する。
439 comma = index(varpart, gt_comma)
440 if (comma /= 0) then
441 ! 範囲指定がみつかった。
442 if (present(var)) var = varpart(1: comma - 1)
443 if (present(attr)) attr = ''
444 if (present(iorange)) iorange = varpart(comma + 1: )
445 return
446 endif
447 if (present(iorange)) iorange = ''
448 ! 範囲指定がなかったので、属性名の検索をする。
449 colon = index(varpart, gt_colon)
450 if (colon == 0) then
451 if (present(var)) var = varpart
452 if (present(attr)) attr = ''
453 varpart = ''
454 return
455 endif
456 if (present(var)) var = varpart(1: colon - 1)
457 if (present(attr)) attr = varpart(colon + 1: )
458 varpart = ''
Provides kind type parameter values.
Definition dc_types.f90:55
integer, parameter, public string
Character length for string
Definition dc_types.f90:137

References dc_url::gt_atmark, dc_url::gt_colon, dc_url::gt_comma, dc_url::gt_question, and dc_types::string.


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