schema_write_doc_all Subroutine

private subroutine schema_write_doc_all(this, path)

Write every group and key as valid namelist with aligned docs.

Type Bound

nml_schema_t

Arguments

Type IntentOptional Attributes Name
class(nml_schema_t), intent(in) :: this
character(len=*), intent(in) :: path

Calls

proc~~schema_write_doc_all~~CallsGraph proc~schema_write_doc_all nml_schema_t%schema_write_doc_all proc~write_key_line write_key_line proc~schema_write_doc_all->proc~write_key_line default_string default_string proc~write_key_line->default_string is_default is_default proc~write_key_line->is_default value_string value_string proc~write_key_line->value_string

Variables

Type Visibility Attributes Name Initial
logical, private :: dummy
integer, private :: ig
integer, private :: ik
integer, private :: u

Source Code

   subroutine schema_write_doc_all(this, path)
      !! Write every group and key as valid namelist with aligned docs.
      class(nml_schema_t), intent(in) :: this
      character(len=*), intent(in) :: path
      integer :: u, ig, ik
      logical :: dummy

      open (newunit=u, file=path, status="replace", action="write")
      do ig = 1, size(this%groups)
         write (u, "(A)") "&"//this%groups(ig)%name//"_nml"
         if (allocated(this%groups(ig)%keys)) then
            do ik = 1, size(this%groups(ig)%keys)
               dummy = .false.
               call write_key_line(u, this%groups(ig)%keys(ik), .false., dummy)
            end do
         end if
         write (u, "(A)") "/"
      end do
      close (u)
   end subroutine schema_write_doc_all