537 real(DP),
dimension(:),
contiguous,
intent(in) :: p_mem
538 character(len=*),
intent(in) :: varname
539 character(len=*),
intent(in) :: mempath
540 character(len=*),
intent(in) :: shapestr
541 integer(I4B),
intent(in) :: iout
543 integer(I4B),
dimension(:),
pointer,
contiguous :: model_shape
544 real(DP),
dimension(:, :, :),
pointer,
contiguous :: dbl3d
545 real(DP),
dimension(:, :),
pointer,
contiguous :: dbl2d
546 integer(I4B),
dimension(3) :: dis3d_shape
547 integer(I4B),
dimension(2) :: dis2d_shape
548 integer(I4B),
pointer :: distype
549 character(LENMEMPATH) :: input_mempath
550 character(LENCOMPONENTNAME) :: comp, subcomp
551 integer(I4B) :: i, j, k, inunit, export_dim
552 logical(LGP) :: is_layered
557 call mem_setptr(distype,
'DISENUM', input_mempath)
558 call mem_setptr(model_shape,
'MODEL_SHAPE', input_mempath)
561 export_dim = distype_export_dim(distype, shapestr, is_layered)
564 select case (export_dim)
567 dis3d_shape(1) = model_shape(3)
568 dis3d_shape(2) = model_shape(2)
570 dis3d_shape(3) = model_shape(1)
571 allocate (dbl3d(dis3d_shape(1), dis3d_shape(2), dis3d_shape(3)))
572 dbl3d = reshape(p_mem, dis3d_shape)
573 do k = 1, dis3d_shape(3)
575 inunit = create_export_file(varname, mempath, k, iout)
576 do i = 1, model_shape(2)
577 write (inunit,
'(*(G0.10, " "))') (dbl3d(j, i, k), j=1, &
586 dis2d_shape(1) = model_shape(2)
587 dis2d_shape(2) = model_shape(1)
589 allocate (dbl2d(dis2d_shape(1), dis2d_shape(2)))
590 dbl2d = reshape(p_mem, dis2d_shape)
593 do i = 1, dis2d_shape(2)
594 inunit = create_export_file(varname, mempath, i, iout)
595 write (inunit,
'(*(G0.10, " "))') (dbl2d(j, i), j=1, dis2d_shape(1))
600 inunit = create_export_file(varname, mempath, 0, iout)
601 do i = 1, dis2d_shape(2)
602 write (inunit,
'(*(G0.10, " "))') (dbl2d(j, i), j=1, dis2d_shape(1))
610 inunit = create_export_file(varname, mempath, 0, iout)
611 write (inunit,
'(*(G0.10, " "))') p_mem
614 write (errmsg,
'(a,i0)')
'EXPORT unsupported dbl1d export_dim=', &
616 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)