diff --git a/LICENSE b/LICENSE index f8d9cd7c04..0b9c351371 100644 --- a/LICENSE +++ b/LICENSE @@ -1,4 +1,4 @@ -Copyright (c) 2011-2013 Massachusetts Institute of Technology +Copyright (c) 2011-2014 Massachusetts Institute of Technology Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in diff --git a/docs/source/conf.py b/docs/source/conf.py index 24c26bcd87..7fb6226318 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -39,7 +39,7 @@ master_doc = 'index' # General information about the project. project = u'OpenMC' -copyright = u'2011-2013, Massachusetts Institute of Technology' +copyright = u'2011-2014, Massachusetts Institute of Technology' # The version info for the project you're documenting, acts as replacement for # |version| and |release|, also used in various other places throughout the diff --git a/docs/source/license.rst b/docs/source/license.rst index a7d7f29760..e7f4b3a69d 100644 --- a/docs/source/license.rst +++ b/docs/source/license.rst @@ -4,7 +4,7 @@ License Agreement ================= -Copyright © 2011-2013 Massachusetts Institute of Technology +Copyright © 2011-2014 Massachusetts Institute of Technology Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in diff --git a/man/man1/openmc.1 b/man/man1/openmc.1 index cac8d59087..db91d7a8f0 100644 --- a/man/man1/openmc.1 +++ b/man/man1/openmc.1 @@ -46,7 +46,7 @@ to locate ACE format cross section libraries if the user has not specified the tag in .I settings.xml\fP. .SH LICENSE -Copyright \(co 2011-2013 Massachusetts Institute of Technology. +Copyright \(co 2011-2014 Massachusetts Institute of Technology. .PP Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index ce8dfdd2c9..281d7362eb 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -58,7 +58,6 @@ if(CMAKE_Fortran_COMPILER_ID STREQUAL "GNU") if(openmp) set(f90flags "-fopenmp ${f90flags}") set(ldflags "-fopenmp ${ldflags}") - add_definitions(-DOPENMP) endif() elseif(CMAKE_Fortran_COMPILER_ID STREQUAL "Intel") @@ -78,7 +77,6 @@ elseif(CMAKE_Fortran_COMPILER_ID STREQUAL "Intel") if(openmp) set(f90flags "-openmp ${f90flags}") set(ldflags "-openmp ${ldflags}") - add_definitions(-DOPENMP) endif() elseif(CMAKE_Fortran_COMPILER_ID STREQUAL "PGI") @@ -112,7 +110,7 @@ elseif(CMAKE_Fortran_COMPILER_ID STREQUAL "XL") set(f90flags "-O3 ${f90flags}") endif() if(openmp) - set(f90flags "-qsmp=omp -WF,-DOPENMP ${f90flags}") + set(f90flags "-qsmp=omp ${f90flags}") set(ldflags "-qsmp=omp ${ldflags}") endif() diff --git a/src/output.F90 b/src/output.F90 index 3e31ad7183..ee0a8391c2 100644 --- a/src/output.F90 +++ b/src/output.F90 @@ -50,7 +50,7 @@ contains ! Write version information write(UNIT=OUTPUT_UNIT, FMT=*) & - ' Copyright: 2011-2013 Massachusetts Institute of Technology' + ' Copyright: 2011-2014 Massachusetts Institute of Technology' write(UNIT=OUTPUT_UNIT, FMT=*) & ' License: http://mit-crpg.github.io/openmc/license.html' write(UNIT=OUTPUT_UNIT, FMT='(6X,"Version:",8X,I1,".",I1,".",I1)') & diff --git a/src/xml/dom/FoX_dom.F90 b/src/xml/dom/FoX_dom.F90 index 6e1ac36a7b..4e2fc1e9cc 100644 --- a/src/xml/dom/FoX_dom.F90 +++ b/src/xml/dom/FoX_dom.F90 @@ -74,6 +74,7 @@ module FoX_dom public :: createAttribute public :: createEntityReference public :: getElementsByTagName + public :: getChildrenByTagName public :: getElementById public :: importNode diff --git a/src/xml/dom/m_dom_dom.F90 b/src/xml/dom/m_dom_dom.F90 index 01f6265b07..ec5b788d9b 100644 --- a/src/xml/dom/m_dom_dom.F90 +++ b/src/xml/dom/m_dom_dom.F90 @@ -349,6 +349,7 @@ module m_dom_dom public :: createEntityReference public :: createEmptyEntityReference public :: getElementsByTagName + public :: getChildrenByTagName public :: importNode public :: createElementNS public :: createAttributeNS @@ -6908,6 +6909,166 @@ endif end function getElementsByTagName + function getChildrenByTagName(doc, tagName, name, ex)result(list) + type(DOMException), intent(out), optional :: ex + type(Node), pointer :: doc + character(len=*), intent(in), optional :: tagName, name + type(NodeList), pointer :: list + + type(NodeListPtr), pointer :: nll(:), temp_nll(:) + type(Node), pointer :: arg, this, treeroot + logical :: doneChildren, doneAttributes, allElements + integer :: i, i_tree + + if (.not.associated(doc)) then + if (getFoX_checks().or.FoX_NODE_IS_NULL<200) then + call throw_exception(FoX_NODE_IS_NULL, "getElementsByTagName", ex) + if (present(ex)) then + if (inException(ex)) then + return + endif + endif +endif + + endif + + if (doc%nodeType==DOCUMENT_NODE) then + if (present(name).or..not.present(tagName)) then + if (getFoX_checks().or.FoX_INVALID_NODE<200) then + call throw_exception(FoX_INVALID_NODE, "getElementsByTagName", ex) + if (present(ex)) then + if (inException(ex)) then + return + endif + endif +endif + + endif + elseif (doc%nodeType==ELEMENT_NODE) then + if (present(name).or..not.present(tagName)) then + if (getFoX_checks().or.FoX_INVALID_NODE<200) then + call throw_exception(FoX_INVALID_NODE, "getElementsByTagName", ex) + if (present(ex)) then + if (inException(ex)) then + return + endif + endif +endif + + endif + else + if (getFoX_checks().or.FoX_INVALID_NODE<200) then + call throw_exception(FoX_INVALID_NODE, "getElementsByTagName", ex) + if (present(ex)) then + if (inException(ex)) then + return + endif + endif +endif + + endif + + if (doc%nodeType==DOCUMENT_NODE) then + arg => getDocumentElement(doc) + else + arg => doc + endif + + allocate(list) + allocate(list%nodes(0)) + list%element => doc + if (present(name)) list%nodeName => vs_str_alloc(name) + if (present(tagName)) list%nodeName => vs_str_alloc(tagName) + + allElements = (str_vs(list%nodeName)=="*") + + if (doc%nodeType==DOCUMENT_NODE) then + nll => doc%docExtras%nodelists + elseif (doc%nodeType==ELEMENT_NODE) then + nll => doc%ownerDocument%docExtras%nodelists + endif + allocate(temp_nll(size(nll)+1)) + do i = 1, size(nll) + temp_nll(i)%this => nll(i)%this + enddo + temp_nll(i)%this => list + deallocate(nll) + if (doc%nodeType==DOCUMENT_NODE) then + doc%docExtras%nodelists => temp_nll + elseif (doc%nodeType==ELEMENT_NODE) then + doc%ownerDocument%docExtras%nodelists => temp_nll + endif + + treeroot => arg + + i_tree = 0 + doneChildren = .false. + doneAttributes = .false. + this => treeroot + do + if (.not.doneChildren.and..not.(getNodeType(this)==ELEMENT_NODE.and.doneAttributes)) then + if (this%nodeType==ELEMENT_NODE) then + if ((allElements .or. str_vs(this%nodeName)==tagName) & + .and..not.(getNodeType(doc)==ELEMENT_NODE.and.associated(this, arg))) & + call append(list, this) + doneAttributes = .true. + endif + + else + if (getNodeType(this)==ELEMENT_NODE.and..not.doneChildren) then + doneAttributes = .true. + else + + endif + endif + + + if (.not.doneChildren) then + if (getNodeType(this)==ELEMENT_NODE.and..not.doneAttributes) then + if (getLength(getAttributes(this))>0) then + this => item(getAttributes(this), 0) + else + doneAttributes = .true. + endif + elseif (hasChildNodes(this) .and. .not. associated(getParentNode(this), treeroot)) then + this => getFirstChild(this) + doneChildren = .false. + doneAttributes = .false. + else + doneChildren = .true. + doneAttributes = .false. + endif + + else ! if doneChildren + + if (associated(this, treeroot)) exit + if (getNodeType(this)==ATTRIBUTE_NODE) then + if (i_tree item(getAttributes(getOwnerElement(this)), i_tree) + doneChildren = .false. + else + i_tree= 0 + this => getOwnerElement(this) + doneAttributes = .true. + doneChildren = .false. + endif + elseif (associated(getNextSibling(this))) then + + this => getNextSibling(this) + doneChildren = .false. + doneAttributes = .false. + else + this => getParentNode(this) + endif + endif + + enddo + + + + end function getChildrenByTagName + function importNode(doc , arg, deep , ex)result(np) type(DOMException), intent(out), optional :: ex type(Node), pointer :: doc diff --git a/src/xml_interface.F90 b/src/xml_interface.F90 index 4752c08734..870b4288be 100644 --- a/src/xml_interface.F90 +++ b/src/xml_interface.F90 @@ -72,7 +72,7 @@ contains ! node name. This should only be used for checking a single occurance of a ! sub-element node. To check for sub-element nodes that repeat, use ! get_node_list and get_list_size. This is to minimize number of calls -! to getElementsByTagName. +! to getChildrenByTagName. !=============================================================================== function check_for_node(ptr, node_name) result(found) @@ -94,7 +94,7 @@ contains if (associated(temp_ptr)) return ! Check for a sub-element - elem_list => getElementsByTagName(ptr, trim(node_name)) + elem_list => getChildrenByTagName(ptr, trim(node_name)) ! Get the length of the list if (getLength(elem_list) == 0) then @@ -124,7 +124,7 @@ contains found_ = .false. ! Check for a sub-element - elem_list => getElementsByTagName(in_ptr, trim(node_name)) + elem_list => getChildrenByTagName(in_ptr, trim(node_name)) ! Get the length of the list if (getLength(elem_list) == 0) return @@ -149,7 +149,7 @@ contains type(NodeList), pointer, intent(out) :: out_ptr ! Check for a sub-element - out_ptr => getElementsByTagName(in_ptr, trim(node_name)) + out_ptr => getChildrenByTagName(in_ptr, trim(node_name)) end subroutine get_node_list @@ -525,7 +525,7 @@ contains if (associated(out_ptr)) return ! Check for a sub-element - elem_list => getElementsByTagName(in_ptr, trim(node_name)) + elem_list => getChildrenByTagName(in_ptr, trim(node_name)) ! Get the length of the list if (getLength(elem_list) == 0) then