private subroutine schema_add_external_group(this, name)
Register a group name the schema knows exists but does NOT
validate (its body is skipped silently).
Type Bound
nml_schema_t
Arguments
| Type |
Intent | Optional | Attributes |
|
Name |
|
|
class(nml_schema_t),
|
intent(inout) |
|
|
:: |
this |
|
|
character(len=*),
|
intent(in) |
|
|
:: |
name |
|
Variables
| Type |
Visibility | Attributes |
|
Name |
| Initial | |
|
integer,
|
private |
|
:: |
i |
|
|
|
|
integer,
|
private |
|
:: |
n |
|
|
|
|
integer,
|
private |
|
:: |
newlen |
|
|
|
|
character(len=:),
|
private, |
allocatable
|
:: |
tmp(:) |
|
|
|
Source Code
subroutine schema_add_external_group(this, name)
!! Register a group name the schema knows exists but does NOT
!! validate (its body is skipped silently).
class(nml_schema_t), intent(inout) :: this
character(len=*), intent(in) :: name
character(len=:), allocatable :: tmp(:)
integer :: n, newlen, i
if (.not. allocated(this%external_names)) allocate (character(len=0) :: this%external_names(0))
n = size(this%external_names)
newlen = max(len(this%external_names), len(name))
allocate (character(len=newlen) :: tmp(n + 1))
do i = 1, n
tmp(i) = this%external_names(i)
end do
tmp(n + 1) = name
call move_alloc(tmp, this%external_names)
end subroutine schema_add_external_group