module mocklayer_def implicit none private public :: mocklayer public :: mocklayer_new public :: mocklayer_print type MockLayer !parameters logical :: p_boolean real :: p_real end type contains !constructor for mock layers function mocklayer_new() type(MockLayer), pointer :: mocklayer_new allocate (mocklayer_new) !init values mocklayer_new%p_boolean=.false. mocklayer_new%p_real=0 end function !debug subroutine prints the contents of the mock subroutine mocklayer_print(mlp, depth) use model_util type(MockLayer), pointer, intent(in) :: mlp integer, intent(in), optional :: depth integer :: d = 0 !just quit if there is no mock if (.not.associated(mlp)) then call modelPrint(unit=6, depth=d, root=.true., name="MOCKLAYER (NULL)") return end if if(present(depth)) then d = depth end if call modelPrint(unit=6, depth=d, root=.true., name="MOCKLAYER") call modelPrint(unit=6, depth=d, name="p_boolean", value=mlp%p_boolean) call modelPrint(unit=6, depth=d, name="p_real", value=mlp%p_real) end subroutine end module !genric trick by using an include file module mocklayer_list use mocklayer_def, LIST_DATA => MockLayer implicit none include "list.inc" end module