533 real(DP),
dimension(:),
contiguous,
intent(in) :: p_mem
534 character(len=*),
intent(in) :: varname
535 character(len=*),
intent(in) :: mempath
536 character(len=*),
intent(in) :: shapestr
537 integer(I4B),
intent(in) :: iout
538 integer(I4B),
dimension(:),
pointer,
contiguous :: model_shape
539 real(DP),
dimension(:, :, :),
pointer,
contiguous :: dbl3d
540 real(DP),
dimension(:, :),
pointer,
contiguous :: dbl2d
541 integer(I4B),
dimension(3) :: dis3d_shape
542 integer(I4B),
dimension(2) :: dis2d_shape
543 integer(I4B),
pointer :: distype
544 character(LENMEMPATH) :: input_mempath
545 character(LENCOMPONENTNAME) :: comp, subcomp
546 integer(I4B) :: i, j, k, inunit, export_dim
547 logical(LGP) :: is_layered
552 call mem_setptr(distype,
'DISENUM', input_mempath)
553 call mem_setptr(model_shape,
'MODEL_SHAPE', input_mempath)
556 export_dim = distype_export_dim(distype, shapestr, is_layered)
559 select case (export_dim)
562 dis3d_shape(1) = model_shape(3)
563 dis3d_shape(2) = model_shape(2)
565 dis3d_shape(3) = model_shape(1)
566 allocate (dbl3d(dis3d_shape(1), dis3d_shape(2), dis3d_shape(3)))
567 dbl3d = reshape(p_mem, dis3d_shape)
568 do k = 1, dis3d_shape(3)
570 inunit = create_export_file(varname, mempath, k, iout)
571 do i = 1, model_shape(2)
572 write (inunit,
'(*(G0.10, " "))') (dbl3d(j, i, k), j=1, &
581 dis2d_shape(1) = model_shape(2)
582 dis2d_shape(2) = model_shape(1)
584 allocate (dbl2d(dis2d_shape(1), dis2d_shape(2)))
585 dbl2d = reshape(p_mem, dis2d_shape)
588 do i = 1, dis2d_shape(2)
589 inunit = create_export_file(varname, mempath, i, iout)
590 write (inunit,
'(*(G0.10, " "))') (dbl2d(j, i), j=1, dis2d_shape(1))
595 inunit = create_export_file(varname, mempath, 0, iout)
596 do i = 1, dis2d_shape(2)
597 write (inunit,
'(*(G0.10, " "))') (dbl2d(j, i), j=1, dis2d_shape(1))
605 inunit = create_export_file(varname, mempath, 0, iout)
606 write (inunit,
'(*(G0.10, " "))') p_mem
609 write (errmsg,
'(a,i0)')
'EXPORT unsupported dbl1d export_dim=', &
611 call store_error(errmsg, .true.)
character(len=lenmempath) function create_mem_path(component, subcomponent, context)
returns the path to the memory object
subroutine split_mem_path(mem_path, component, subcomponent)
Split the memory path into component(s)