ITM Grid Service Library: Fortran 90
|
00001 module itm_grid 00002 00003 !use itm_types , ITM_R8 => R8, ITM_R4 => R4 00004 use itm_assert 00005 use euitm_schemas ! IGNORE 00006 use itm_string 00007 00008 use itm_grid_common 00009 use itm_grid_access 00010 use itm_grid_structured 00011 use itm_grid_object 00012 use itm_grid_objectlist 00013 use itm_grid_subgrid 00014 00015 implicit none 00016 00017 contains 00018 00019 00020 !> Check a grid description for possible errors 00021 00022 subroutine gridSanityCheck( grid, doStop ) 00023 type(type_complexgrid), intent(in) :: grid 00024 logical, intent(in), optional :: doStop 00025 00026 ! integer 00027 integer :: is 00028 00029 ! disable immediate stopping in assertion module 00030 call assertSetStopMode( doStop = .false. ) 00031 00032 do is = 1, size( grid % spaces ) 00033 call assertSetMsgPrefix( "Space "// itmInt2str( is ) ) 00034 call gridSanityCheckSpace( grid % spaces( is ) ) 00035 end do 00036 00037 ! Output error message if any errors found, and stop (if requested) 00038 call assertStopOnFailed( "Grid contained errors", doStop ) 00039 00040 00041 ! reset assertion module 00042 call assertReset() 00043 00044 ! re-enable immediate stop for assertions 00045 call assertSetStopMode() 00046 00047 ! clear message prefix 00048 call assertSetMsgPrefix() 00049 00050 end subroutine gridSanityCheck 00051 00052 00053 !> Check a grid space description for possible errors 00054 00055 subroutine gridSanityCheckSpace( space ) 00056 type(type_complexgrid_space), intent(in) :: space 00057 00058 call assert( ( size( space % coordtype ) <= size( space % objects ) ), & 00059 & "coordtype, objects,have inconsistent size" ) 00060 00061 00062 end subroutine gridSanityCheckSpace 00063 00064 00065 end module itm_grid