MODFLOW 6  version 6.6.0.dev0
USGS Modular Hydrologic Model
idmloggermodule Module Reference

This module contains the Input Data Model Logger Module. More...

Data Types

interface  idm_log_var
 
interface  idm_export
 

Functions/Subroutines

subroutine, public idm_log_header (component, subcomponent, iout)
 @ brief log a header message More...
 
subroutine, public idm_log_close (component, subcomponent, iout)
 @ brief log the closing message More...
 
subroutine, public idm_log_period_header (component, iout)
 @ brief log a dynamic header message More...
 
subroutine, public idm_log_period_close (iout)
 @ brief log the period closing message More...
 
subroutine idm_log_var_ts (varname, mempath, iout, is_tas)
 @ brief log the period closing message More...
 
subroutine idm_log_var_logical (p_mem, varname, mempath, iout)
 Log type specific information logical. More...
 
subroutine idm_log_var_int (p_mem, varname, mempath, datatype, iout)
 Log type specific information integer. More...
 
subroutine idm_log_var_int1d (p_mem, varname, mempath, iout)
 Log type specific information int1d. More...
 
subroutine idm_log_var_int2d (p_mem, varname, mempath, iout)
 Log type specific information int2d. More...
 
subroutine idm_log_var_int3d (p_mem, varname, mempath, iout)
 Log type specific information int3d. More...
 
subroutine idm_log_var_dbl (p_mem, varname, mempath, iout)
 Log type specific information double. More...
 
subroutine idm_log_var_dbl1d (p_mem, varname, mempath, iout)
 Log type specific information dbl1d. More...
 
subroutine idm_log_var_dbl2d (p_mem, varname, mempath, iout)
 Log type specific information dbl2d. More...
 
subroutine idm_log_var_dbl3d (p_mem, varname, mempath, iout)
 Log type specific information dbl3d. More...
 
subroutine idm_log_var_str (p_mem, varname, mempath, iout)
 Log type specific information str. More...
 
subroutine idm_export_int1d (p_mem, varname, mempath, shapestr, iout)
 Create export file int1d. More...
 
subroutine idm_export_int2d (p_mem, varname, mempath, shapestr, iout)
 Create export file int2d. More...
 
subroutine idm_export_int3d (p_mem, varname, mempath, shapestr, iout)
 Create export file int3d. More...
 
subroutine idm_export_dbl1d (p_mem, varname, mempath, shapestr, iout)
 Create export file dbl1d. More...
 
subroutine idm_export_dbl2d (p_mem, varname, mempath, shapestr, iout)
 Create export file dbl2d. More...
 
subroutine idm_export_dbl3d (p_mem, varname, mempath, shapestr, iout)
 Create export file dbl3d. More...
 
integer(i4b) function distype_export_dim (distype, shapestr, is_layered)
 Set dis type export_dim. More...
 
integer(i4b) function create_export_file (varname, mempath, layer, iout)
 Create export file. More...
 

Detailed Description

This module contains the subroutines for logging messages to the list file as the input data model loads model input.

Function/Subroutine Documentation

◆ create_export_file()

integer(i4b) function idmloggermodule::create_export_file ( character(len=*), intent(in)  varname,
character(len=*), intent(in)  mempath,
integer(i4b), intent(in)  layer,
integer(i4b), intent(in)  iout 
)
private

Name formats where l=layer, a=auxiliary, p=period : <comp>-<subcomp>.varname.txt : <comp>-<subcomp>.varname.l<num>.txt : <comp>-<subcomp>.varname.p<num>.txt : <comp>-<subcomp>.varname.a<num>.p<num>.txt

Parameters
[in]varnamevariable name
[in]mempathvariable memory path

Definition at line 781 of file IdmLogger.f90.

783  use constantsmodule, only: lenvarname
785  use inputoutputmodule, only: upcase, lowcase
787  character(len=*), intent(in) :: varname !< variable name
788  character(len=*), intent(in) :: mempath !< variable memory path
789  integer(I4B), intent(in) :: layer
790  integer(I4B), intent(in) :: iout
791  integer(I4B) :: inunit
792  ! -- dummy
793  character(len=LENCOMPONENTNAME) :: comp, subcomp
794  character(len=LINELENGTH) :: filename, suffix
795  !
796  ! -- split the mempath
797  call split_mem_path(mempath, comp, subcomp)
798  call lowcase(comp)
799  call lowcase(subcomp)
800  !
801  ! -- build suffix
802  suffix = varname
803  call lowcase(suffix)
804  if (layer > 0) then
805  write (suffix, '(a,i0)') trim(suffix)//'.l', layer
806  end if
807  suffix = trim(suffix)//'.txt'
808  !
809  ! -- set filename
810  filename = trim(comp)//'-'//trim(subcomp)//'.'//trim(suffix)
811  !
812  ! -- silently create the array file
813  inunit = getunit()
814  call openfile(inunit, 0, filename, 'EXPORT', filstat_opt='REPLACE')
This module contains simulation constants.
Definition: Constants.f90:9
integer(i4b), parameter lenvarname
maximum length of a variable name
Definition: Constants.f90:17
integer(i4b) function, public getunit()
Get a free unit number.
subroutine, public lowcase(word)
Convert to lower case.
subroutine, public upcase(word)
Convert to upper case.
subroutine, public openfile(iu, iout, fname, ftype, fmtarg_opt, accarg_opt, filstat_opt, mode_opt)
Open a file.
Definition: InputOutput.f90:30
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)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ distype_export_dim()

integer(i4b) function idmloggermodule::distype_export_dim ( integer(i4b), intent(in), pointer  distype,
character(len=*), intent(in)  shapestr,
logical(lgp), intent(inout)  is_layered 
)

Set the dimension of the export

Parameters
[in]shapestrdfn shape string
[in,out]is_layereddoes this data represent layers

Definition at line 727 of file IdmLogger.f90.

729  integer(I4B), pointer, intent(in) :: distype
730  character(len=*), intent(in) :: shapestr !< dfn shape string
731  logical(LGP), intent(inout) :: is_layered !< does this data represent layers
732  integer(I4B) :: export_dim
733  !
734  ! -- initialize is_layered to false
735  is_layered = .false.
736  !
737  select case (distype)
738  case (dis)
739  if (shapestr == 'NODES') then
740  export_dim = 3
741  is_layered = .true.
742  else if (shapestr == 'NCOL NROW NLAY') then
743  export_dim = 3
744  is_layered = .true.
745  else
746  export_dim = 1
747  end if
748  case (disv)
749  if (shapestr == 'NODES') then
750  export_dim = 2
751  is_layered = .true.
752  else if (shapestr == 'NCPL NLAY') then
753  export_dim = 2
754  is_layered = .true.
755  else
756  export_dim = 1
757  end if
758  case (dis2d)
759  if (shapestr == 'NODES') then
760  export_dim = 2
761  else if (shapestr == 'NCOL NROW') then
762  export_dim = 2
763  else
764  export_dim = 1
765  end if
766  case (disu, disv1d)
767  export_dim = 1
768  case default
769  export_dim = 0
770  end select
Here is the caller graph for this function:

◆ idm_export_dbl1d()

subroutine idmloggermodule::idm_export_dbl1d ( real(dp), dimension(:), intent(in), contiguous  p_mem,
character(len=*), intent(in)  varname,
character(len=*), intent(in)  mempath,
character(len=*), intent(in)  shapestr,
integer(i4b), intent(in)  iout 
)

export layered dbl1d parameters with NODES shape

Parameters
[in]p_mem1d dbl array
[in]varnamevariable name
[in]mempathvariable memory path
[in]shapestrdfn shape string

Definition at line 534 of file IdmLogger.f90.

537  real(DP), dimension(:), contiguous, intent(in) :: p_mem !< 1d dbl array
538  character(len=*), intent(in) :: varname !< variable name
539  character(len=*), intent(in) :: mempath !< variable memory path
540  character(len=*), intent(in) :: shapestr !< dfn shape string
541  integer(I4B), intent(in) :: iout
542  ! -- dummy
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
553  !
554  ! -- set pointer to DISENUM and MODEL_SHAPE
555  call split_mem_path(mempath, comp, subcomp)
556  input_mempath = create_mem_path(component=comp, context=idm_context)
557  call mem_setptr(distype, 'DISENUM', input_mempath)
558  call mem_setptr(model_shape, 'MODEL_SHAPE', input_mempath)
559  !
560  ! -- set export_dim
561  export_dim = distype_export_dim(distype, shapestr, is_layered)
562  !
563  ! -- create export file(s)
564  select case (export_dim)
565  case (3)
566  ! -- set reshape array
567  dis3d_shape(1) = model_shape(3)
568  dis3d_shape(2) = model_shape(2)
569  ! -- allocate and reshape
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)
574  ! -- write export files 3D array
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, &
578  dis3d_shape(1))
579  end do
580  close (inunit)
581  end do
582  ! -- cleanup
583  deallocate (dbl3d)
584  case (2)
585  ! -- set reshape array
586  dis2d_shape(1) = model_shape(2)
587  dis2d_shape(2) = model_shape(1)
588  ! -- allocate and reshape
589  allocate (dbl2d(dis2d_shape(1), dis2d_shape(2)))
590  dbl2d = reshape(p_mem, dis2d_shape)
591  if (is_layered) then
592  ! -- write layered export files 2D array
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))
596  close (inunit)
597  end do
598  else
599  ! -- write export file 2D array
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))
603  end do
604  close (inunit)
605  end if
606  ! -- cleanup
607  deallocate (dbl2d)
608  case (1)
609  ! -- write export file 1D array
610  inunit = create_export_file(varname, mempath, 0, iout)
611  write (inunit, '(*(G0.10, " "))') p_mem
612  close (inunit)
613  case default
614  write (errmsg, '(a,i0)') 'EXPORT unsupported dbl1d export_dim=', &
615  export_dim
616  call store_error(errmsg, .true.)
617  end select

◆ idm_export_dbl2d()

subroutine idmloggermodule::idm_export_dbl2d ( real(dp), dimension(:, :), intent(in), contiguous  p_mem,
character(len=*), intent(in)  varname,
character(len=*), intent(in)  mempath,
character(len=*), intent(in)  shapestr,
integer(i4b), intent(in)  iout 
)
Parameters
[in]p_mem2d dbl array
[in]varnamevariable name
[in]mempathvariable memory path
[in]shapestrdfn shape string

Definition at line 622 of file IdmLogger.f90.

625  real(DP), dimension(:, :), contiguous, intent(in) :: p_mem !< 2d dbl array
626  character(len=*), intent(in) :: varname !< variable name
627  character(len=*), intent(in) :: mempath !< variable memory path
628  character(len=*), intent(in) :: shapestr !< dfn shape string
629  integer(I4B), intent(in) :: iout
630  ! -- dummy
631  integer(I4B), dimension(:), pointer, contiguous :: model_shape
632  integer(I4B), pointer :: distype
633  character(LENMEMPATH) :: input_mempath
634  character(LENCOMPONENTNAME) :: comp, subcomp
635  integer(I4B) :: i, j, inunit, export_dim
636  logical(LGP) :: is_layered
637  !
638  ! -- set pointer to DISENUM
639  call split_mem_path(mempath, comp, subcomp)
640  input_mempath = create_mem_path(component=comp, context=idm_context)
641  call mem_setptr(distype, 'DISENUM', input_mempath)
642  call mem_setptr(model_shape, 'MODEL_SHAPE', input_mempath)
643  !
644  ! -- set export_dim
645  export_dim = distype_export_dim(distype, shapestr, is_layered)
646  !
647  select case (export_dim)
648  case (1)
649  ! -- write export file 1D array
650  inunit = create_export_file(varname, mempath, 0, iout)
651  do i = 1, size(p_mem, dim=2)
652  write (inunit, '(*(G0.10, " "))') (p_mem(j, i), j=1, size(p_mem, dim=1))
653  end do
654  close (inunit)
655  case (2)
656  if (is_layered) then
657  ! -- write layered export files 2D array
658  do i = 1, size(p_mem, dim=2)
659  inunit = create_export_file(varname, mempath, i, iout)
660  write (inunit, '(*(G0.10, " "))') (p_mem(j, i), j=1, size(p_mem, dim=1))
661  close (inunit)
662  end do
663  else
664  ! -- write export file 2D array
665  inunit = create_export_file(varname, mempath, 0, iout)
666  do i = 1, size(p_mem, dim=2)
667  write (inunit, '(*(G0.10, " "))') (p_mem(j, i), j=1, size(p_mem, dim=1))
668  end do
669  close (inunit)
670  end if
671  case default
672  write (errmsg, '(a,i0)') 'EXPORT unsupported dbl2d export_dim=', &
673  export_dim
674  call store_error(errmsg, .true.)
675  end select

◆ idm_export_dbl3d()

subroutine idmloggermodule::idm_export_dbl3d ( real(dp), dimension(:, :, :), intent(in), contiguous  p_mem,
character(len=*), intent(in)  varname,
character(len=*), intent(in)  mempath,
character(len=*), intent(in)  shapestr,
integer(i4b), intent(in)  iout 
)
Parameters
[in]p_mem2d dbl array
[in]varnamevariable name
[in]mempathvariable memory path
[in]shapestrdfn shape string

Definition at line 680 of file IdmLogger.f90.

683  real(DP), dimension(:, :, :), contiguous, intent(in) :: p_mem !< 2d dbl array
684  character(len=*), intent(in) :: varname !< variable name
685  character(len=*), intent(in) :: mempath !< variable memory path
686  character(len=*), intent(in) :: shapestr !< dfn shape string
687  integer(I4B), intent(in) :: iout
688  ! -- dummy
689  integer(I4B), dimension(:), pointer, contiguous :: model_shape
690  integer(I4B), pointer :: distype
691  character(LENMEMPATH) :: input_mempath
692  character(LENCOMPONENTNAME) :: comp, subcomp
693  integer(I4B) :: i, j, k, inunit, export_dim
694  logical(LGP) :: is_layered
695  !
696  ! -- set pointer to DISENUM
697  call split_mem_path(mempath, comp, subcomp)
698  input_mempath = create_mem_path(component=comp, context=idm_context)
699  call mem_setptr(distype, 'DISENUM', input_mempath)
700  call mem_setptr(model_shape, 'MODEL_SHAPE', input_mempath)
701  !
702  ! -- set export_dim
703  export_dim = distype_export_dim(distype, shapestr, is_layered)
704  !
705  select case (export_dim)
706  case (3)
707  ! -- write export files 3D array
708  do k = 1, size(p_mem, dim=3)
709  inunit = create_export_file(varname, mempath, k, iout)
710  do i = 1, size(p_mem, dim=2)
711  write (inunit, '(*(G0.10, " "))') (p_mem(j, i, k), j=1, &
712  size(p_mem, dim=1))
713  end do
714  close (inunit)
715  end do
716  case default
717  write (errmsg, '(a,i0)') 'EXPORT unsupported dbl3d export_dim=', &
718  export_dim
719  call store_error(errmsg, .true.)
720  end select

◆ idm_export_int1d()

subroutine idmloggermodule::idm_export_int1d ( integer(i4b), dimension(:), intent(in), contiguous  p_mem,
character(len=*), intent(in)  varname,
character(len=*), intent(in)  mempath,
character(len=*), intent(in)  shapestr,
integer(i4b), intent(in)  iout 
)
private

export layered int1d parameter files

Parameters
[in]p_mem1d integer array
[in]varnamevariable name
[in]mempathvariable memory path
[in]shapestrdfn shape string

Definition at line 341 of file IdmLogger.f90.

344  integer(I4B), dimension(:), contiguous, intent(in) :: p_mem !< 1d integer array
345  character(len=*), intent(in) :: varname !< variable name
346  character(len=*), intent(in) :: mempath !< variable memory path
347  character(len=*), intent(in) :: shapestr !< dfn shape string
348  integer(I4B), intent(in) :: iout
349  ! -- dummy
350  integer(I4B), dimension(:), pointer, contiguous :: model_shape
351  integer(I4B), dimension(:, :, :), pointer, contiguous :: int3d
352  integer(I4B), dimension(:, :), pointer, contiguous :: int2d
353  integer(I4B), dimension(3) :: dis3d_shape
354  integer(I4B), dimension(2) :: dis2d_shape
355  integer(I4B), pointer :: distype
356  character(LENMEMPATH) :: input_mempath
357  character(LENCOMPONENTNAME) :: comp, subcomp
358  integer(I4B) :: i, j, k, inunit, export_dim
359  logical(LGP) :: is_layered
360  !
361  ! -- set pointer to DISENUM and MODEL_SHAPE
362  call split_mem_path(mempath, comp, subcomp)
363  input_mempath = create_mem_path(component=comp, context=idm_context)
364  call mem_setptr(distype, 'DISENUM', input_mempath)
365  call mem_setptr(model_shape, 'MODEL_SHAPE', input_mempath)
366  !
367  ! -- set export_dim
368  export_dim = distype_export_dim(distype, shapestr, is_layered)
369  !
370  ! -- create export file(s)
371  select case (export_dim)
372  case (3)
373  ! -- set reshape array
374  dis3d_shape(1) = model_shape(3)
375  dis3d_shape(2) = model_shape(2)
376  dis3d_shape(3) = model_shape(1)
377  ! -- allocate and reshape
378  allocate (int3d(dis3d_shape(1), dis3d_shape(2), dis3d_shape(3)))
379  int3d = reshape(p_mem, dis3d_shape)
380  ! -- write export files 3D array
381  do k = 1, dis3d_shape(3)
382  inunit = create_export_file(varname, mempath, k, iout)
383  do i = 1, model_shape(2)
384  write (inunit, '(*(i0, " "))') (int3d(j, i, k), j=1, &
385  dis3d_shape(1))
386  end do
387  close (inunit)
388  end do
389  ! -- cleanup
390  deallocate (int3d)
391  case (2)
392  ! -- set reshape array
393  dis2d_shape(1) = model_shape(2)
394  dis2d_shape(2) = model_shape(1)
395  ! -- allocate and reshape
396  allocate (int2d(dis2d_shape(1), dis2d_shape(2)))
397  int2d = reshape(p_mem, dis2d_shape)
398  if (is_layered) then
399  ! -- write layered export files 2D array
400  do i = 1, dis2d_shape(2)
401  inunit = create_export_file(varname, mempath, i, iout)
402  write (inunit, '(*(i0, " "))') (int2d(j, i), j=1, dis2d_shape(1))
403  close (inunit)
404  end do
405  else
406  ! -- write export file 2D array
407  inunit = create_export_file(varname, mempath, 0, iout)
408  do i = 1, dis2d_shape(2)
409  write (inunit, '(*(i0, " "))') (int2d(j, i), j=1, dis2d_shape(1))
410  end do
411  close (inunit)
412  end if
413  ! -- cleanup
414  deallocate (int2d)
415  case (1)
416  ! -- write export file 1D array
417  inunit = create_export_file(varname, mempath, 0, iout)
418  write (inunit, '(*(i0, " "))') p_mem
419  close (inunit)
420  case default
421  write (errmsg, '(a,i0)') 'EXPORT unsupported int1d export_dim=', &
422  export_dim
423  call store_error(errmsg, .true.)
424  end select

◆ idm_export_int2d()

subroutine idmloggermodule::idm_export_int2d ( integer(i4b), dimension(:, :), intent(in), contiguous  p_mem,
character(len=*), intent(in)  varname,
character(len=*), intent(in)  mempath,
character(len=*), intent(in)  shapestr,
integer(i4b), intent(in)  iout 
)
Parameters
[in]p_mem2d dbl array
[in]varnamevariable name
[in]mempathvariable memory path
[in]shapestrdfn shape string

Definition at line 429 of file IdmLogger.f90.

432  integer(I4B), dimension(:, :), contiguous, intent(in) :: p_mem !< 2d dbl array
433  character(len=*), intent(in) :: varname !< variable name
434  character(len=*), intent(in) :: mempath !< variable memory path
435  character(len=*), intent(in) :: shapestr !< dfn shape string
436  integer(I4B), intent(in) :: iout
437  ! -- dummy
438  integer(I4B), dimension(:), pointer, contiguous :: model_shape
439  integer(I4B), pointer :: distype
440  character(LENMEMPATH) :: input_mempath
441  character(LENCOMPONENTNAME) :: comp, subcomp
442  integer(I4B) :: i, j, inunit, export_dim
443  logical(LGP) :: is_layered
444  !
445  ! -- set pointer to DISENUM
446  call split_mem_path(mempath, comp, subcomp)
447  input_mempath = create_mem_path(component=comp, context=idm_context)
448  call mem_setptr(distype, 'DISENUM', input_mempath)
449  call mem_setptr(model_shape, 'MODEL_SHAPE', input_mempath)
450  !
451  ! -- set export_dim
452  export_dim = distype_export_dim(distype, shapestr, is_layered)
453  !
454  select case (export_dim)
455  case (1)
456  ! -- write export file 1D array
457  inunit = create_export_file(varname, mempath, 0, iout)
458  do i = 1, size(p_mem, dim=2)
459  write (inunit, '(*(i0, " "))') (p_mem(j, i), j=1, size(p_mem, dim=1))
460  end do
461  close (inunit)
462  case (2)
463  if (is_layered) then
464  ! -- write layered export files 2D array
465  do i = 1, size(p_mem, dim=2)
466  inunit = create_export_file(varname, mempath, i, iout)
467  write (inunit, '(*(i0, " "))') (p_mem(j, i), j=1, size(p_mem, dim=1))
468  close (inunit)
469  end do
470  else
471  ! -- write export file 2D array
472  inunit = create_export_file(varname, mempath, 0, iout)
473  do i = 1, size(p_mem, dim=2)
474  write (inunit, '(*(i0, " "))') (p_mem(j, i), j=1, size(p_mem, dim=1))
475  end do
476  close (inunit)
477  end if
478  case default
479  write (errmsg, '(a,i0)') 'EXPORT unsupported int2d export_dim=', &
480  export_dim
481  call store_error(errmsg, .true.)
482  end select

◆ idm_export_int3d()

subroutine idmloggermodule::idm_export_int3d ( integer(i4b), dimension(:, :, :), intent(in), contiguous  p_mem,
character(len=*), intent(in)  varname,
character(len=*), intent(in)  mempath,
character(len=*), intent(in)  shapestr,
integer(i4b), intent(in)  iout 
)
Parameters
[in]p_mem2d dbl array
[in]varnamevariable name
[in]mempathvariable memory path
[in]shapestrdfn shape string

Definition at line 487 of file IdmLogger.f90.

490  integer(I4B), dimension(:, :, :), contiguous, intent(in) :: p_mem !< 2d dbl array
491  character(len=*), intent(in) :: varname !< variable name
492  character(len=*), intent(in) :: mempath !< variable memory path
493  character(len=*), intent(in) :: shapestr !< dfn shape string
494  integer(I4B), intent(in) :: iout
495  ! -- dummy
496  integer(I4B), dimension(:), pointer, contiguous :: model_shape
497  integer(I4B), pointer :: distype
498  character(LENMEMPATH) :: input_mempath
499  character(LENCOMPONENTNAME) :: comp, subcomp
500  integer(I4B) :: i, j, k, inunit, export_dim
501  logical(LGP) :: is_layered
502  !
503  ! -- set pointer to DISENUM
504  call split_mem_path(mempath, comp, subcomp)
505  input_mempath = create_mem_path(component=comp, context=idm_context)
506  call mem_setptr(distype, 'DISENUM', input_mempath)
507  call mem_setptr(model_shape, 'MODEL_SHAPE', input_mempath)
508  !
509  ! -- set export_dim
510  export_dim = distype_export_dim(distype, shapestr, is_layered)
511  !
512  select case (export_dim)
513  case (3)
514  ! -- write export files 3D array
515  do k = 1, size(p_mem, dim=3)
516  inunit = create_export_file(varname, mempath, k, iout)
517  do i = 1, size(p_mem, dim=2)
518  write (inunit, '(*(i0, " "))') (p_mem(j, i, k), j=1, size(p_mem, dim=1))
519  end do
520  close (inunit)
521  end do
522  case default
523  write (errmsg, '(a,i0)') 'EXPORT unsupported int3d export_dim=', &
524  export_dim
525  call store_error(errmsg, .true.)
526  end select

◆ idm_log_close()

subroutine, public idmloggermodule::idm_log_close ( character(len=*), intent(in)  component,
character(len=*), intent(in)  subcomponent,
integer(i4b), intent(in)  iout 
)
Parameters
[in]componentcomponent name
[in]subcomponentsubcomponent name

Definition at line 56 of file IdmLogger.f90.

57  character(len=*), intent(in) :: component !< component name
58  character(len=*), intent(in) :: subcomponent !< subcomponent name
59  integer(I4B), intent(in) :: iout
60 
61  if (iparamlog > 0 .and. iout > 0) then
62  write (iout, '(1x,a)') 'Loading input complete...'
63  end if
Here is the caller graph for this function:

◆ idm_log_header()

subroutine, public idmloggermodule::idm_log_header ( character(len=*), intent(in)  component,
character(len=*), intent(in)  subcomponent,
integer(i4b), intent(in)  iout 
)
Parameters
[in]componentcomponent name
[in]subcomponentsubcomponent name

Definition at line 43 of file IdmLogger.f90.

44  character(len=*), intent(in) :: component !< component name
45  character(len=*), intent(in) :: subcomponent !< subcomponent name
46  integer(I4B), intent(in) :: iout
47 
48  if (iparamlog > 0 .and. iout > 0) then
49  write (iout, '(1x,a)') 'Loading input for '//trim(component)//&
50  &'/'//trim(subcomponent)
51  end if
Here is the caller graph for this function:

◆ idm_log_period_close()

subroutine, public idmloggermodule::idm_log_period_close ( integer(i4b), intent(in)  iout)

Definition at line 81 of file IdmLogger.f90.

82  use tdismodule, only: kstp
83  integer(I4B), intent(in) :: iout
84 
85  if (iparamlog > 0 .and. iout > 0 .and. kstp == 1) then
86  !backspace iout
87  write (iout, '(1x,a,/)') 'IDP component dynamic load complete...'
88  end if
integer(i4b), pointer, public kstp
current time step number
Definition: tdis.f90:24
Here is the caller graph for this function:

◆ idm_log_period_header()

subroutine, public idmloggermodule::idm_log_period_header ( character(len=*), intent(in)  component,
integer(i4b), intent(in)  iout 
)
Parameters
[in]componentcomponent name

Definition at line 68 of file IdmLogger.f90.

69  use tdismodule, only: kper, kstp
70  character(len=*), intent(in) :: component !< component name
71  integer(I4B), intent(in) :: iout
72 
73  if (iparamlog > 0 .and. iout > 0 .and. kstp == 1) then
74  write (iout, '(/1x,a,i0,a)') 'IDP PERIOD ', kper, &
75  ' load for component: '//trim(component)
76  end if
integer(i4b), pointer, public kper
current stress period number
Definition: tdis.f90:23
Here is the caller graph for this function:

◆ idm_log_var_dbl()

subroutine idmloggermodule::idm_log_var_dbl ( real(dp), intent(in)  p_mem,
character(len=*), intent(in)  varname,
character(len=*), intent(in)  mempath,
integer(i4b), intent(in)  iout 
)
private
Parameters
[in]p_memdbl scalar
[in]varnamevariable name
[in]mempathvariable memory path

Definition at line 228 of file IdmLogger.f90.

229  real(DP), intent(in) :: p_mem !< dbl scalar
230  character(len=*), intent(in) :: varname !< variable name
231  character(len=*), intent(in) :: mempath !< variable memory path
232  integer(I4B), intent(in) :: iout
233  character(len=LINELENGTH) :: description
234 
235  if (iparamlog > 0 .and. iout > 0) then
236  description = 'Double detected'
237  write (iout, '(3x, a, ": ", a, " = ", G0)') &
238  trim(description), trim(varname), p_mem
239  end if

◆ idm_log_var_dbl1d()

subroutine idmloggermodule::idm_log_var_dbl1d ( real(dp), dimension(:), intent(in), contiguous  p_mem,
character(len=*), intent(in)  varname,
character(len=*), intent(in)  mempath,
integer(i4b), intent(in)  iout 
)
private
Parameters
[in]p_mem1d real array
[in]varnamevariable name
[in]mempathvariable memory path

Definition at line 244 of file IdmLogger.f90.

245  real(DP), dimension(:), contiguous, intent(in) :: p_mem !< 1d real array
246  character(len=*), intent(in) :: varname !< variable name
247  character(len=*), intent(in) :: mempath !< variable memory path
248  integer(I4B), intent(in) :: iout
249  real(DP) :: min_val, max_val
250  character(len=LINELENGTH) :: description
251 
252  if (iparamlog > 0 .and. iout > 0) then
253  min_val = minval(p_mem)
254  max_val = maxval(p_mem)
255  if (min_val == max_val) then
256  description = 'Double precision 1D constant array detected'
257  write (iout, '(3x, a, ": ", a, " = ", G0)') &
258  trim(description), trim(varname), min_val
259  else
260  description = 'Double precision 1D array detected'
261  write (iout, '(3x, a, ": ", a, a, G0, a, G0)') &
262  trim(description), trim(varname), &
263  ' ranges from ', min_val, ' to ', max_val
264  end if
265  end if

◆ idm_log_var_dbl2d()

subroutine idmloggermodule::idm_log_var_dbl2d ( real(dp), dimension(:, :), intent(in), contiguous  p_mem,
character(len=*), intent(in)  varname,
character(len=*), intent(in)  mempath,
integer(i4b), intent(in)  iout 
)
private
Parameters
[in]p_mem2d dbl array
[in]varnamevariable name
[in]mempathvariable memory path

Definition at line 270 of file IdmLogger.f90.

271  real(DP), dimension(:, :), contiguous, intent(in) :: p_mem !< 2d dbl array
272  character(len=*), intent(in) :: varname !< variable name
273  character(len=*), intent(in) :: mempath !< variable memory path
274  integer(I4B), intent(in) :: iout
275  real(DP) :: min_val, max_val
276  character(len=LINELENGTH) :: description
277 
278  if (iparamlog > 0 .and. iout > 0) then
279  min_val = minval(p_mem)
280  max_val = maxval(p_mem)
281  if (min_val == max_val) then
282  description = 'Double precision 2D constant array detected'
283  write (iout, '(3x, a, ": ", a, " = ", G0)') &
284  trim(description), trim(varname), min_val
285  else
286  description = 'Double precision 2D array detected'
287  write (iout, '(3x, a, ": ", a, a, G0, a, G0)') &
288  trim(description), trim(varname), &
289  ' ranges from ', min_val, ' to ', max_val
290  end if
291  end if

◆ idm_log_var_dbl3d()

subroutine idmloggermodule::idm_log_var_dbl3d ( real(dp), dimension(:, :, :), intent(in), contiguous  p_mem,
character(len=*), intent(in)  varname,
character(len=*), intent(in)  mempath,
integer(i4b), intent(in)  iout 
)
private
Parameters
[in]p_mem3d dbl array
[in]varnamevariable name
[in]mempathvariable memory path

Definition at line 296 of file IdmLogger.f90.

297  real(DP), dimension(:, :, :), contiguous, intent(in) :: p_mem !< 3d dbl array
298  character(len=*), intent(in) :: varname !< variable name
299  character(len=*), intent(in) :: mempath !< variable memory path
300  integer(I4B), intent(in) :: iout
301  real(DP) :: min_val, max_val
302  character(len=LINELENGTH) :: description
303 
304  if (iparamlog > 0 .and. iout > 0) then
305  min_val = minval(p_mem)
306  max_val = maxval(p_mem)
307  if (min_val == max_val) then
308  description = 'Double precision 3D constant array detected'
309  write (iout, '(3x, a, ": ", a, " = ", G0)') &
310  trim(description), trim(varname), min_val
311  else
312  description = 'Double precision 3D array detected'
313  write (iout, '(3x, a, ": ", a, a, G0, a, G0)') &
314  trim(description), trim(varname), &
315  ' ranges from ', min_val, ' to ', max_val
316  end if
317  end if

◆ idm_log_var_int()

subroutine idmloggermodule::idm_log_var_int ( integer(i4b), intent(in)  p_mem,
character(len=*), intent(in)  varname,
character(len=*), intent(in)  mempath,
character(len=*), intent(in)  datatype,
integer(i4b), intent(in)  iout 
)
private
Parameters
[in]p_memint scalar
[in]varnamevariable name
[in]mempathvariable memory path
[in]datatypevariable data type

Definition at line 128 of file IdmLogger.f90.

129  integer(I4B), intent(in) :: p_mem !< int scalar
130  character(len=*), intent(in) :: varname !< variable name
131  character(len=*), intent(in) :: mempath !< variable memory path
132  character(len=*), intent(in) :: datatype !< variable data type
133  integer(I4B), intent(in) :: iout
134  character(len=LINELENGTH) :: description
135 
136  if (iparamlog > 0 .and. iout > 0) then
137  if (datatype == 'KEYWORD') then
138  description = 'Keyword detected'
139  write (iout, '(3x, a, ": ", a)') trim(description), trim(varname)
140  else
141  description = 'Integer detected'
142  write (iout, '(3x, a, ": ", a, " = ", i0)') &
143  trim(description), trim(varname), p_mem
144  end if
145  end if

◆ idm_log_var_int1d()

subroutine idmloggermodule::idm_log_var_int1d ( integer(i4b), dimension(:), intent(in), contiguous  p_mem,
character(len=*), intent(in)  varname,
character(len=*), intent(in)  mempath,
integer(i4b), intent(in)  iout 
)
private
Parameters
[in]p_mem1d int array
[in]varnamevariable name
[in]mempathvariable memory path

Definition at line 150 of file IdmLogger.f90.

151  integer(I4B), dimension(:), contiguous, intent(in) :: p_mem !< 1d int array
152  character(len=*), intent(in) :: varname !< variable name
153  character(len=*), intent(in) :: mempath !< variable memory path
154  integer(I4B), intent(in) :: iout
155  integer(I4B) :: min_val, max_val
156  character(len=LINELENGTH) :: description
157 
158  if (iparamlog > 0 .and. iout > 0) then
159  min_val = minval(p_mem)
160  max_val = maxval(p_mem)
161  if (min_val == max_val) then
162  description = 'Integer 1D constant array detected'
163  write (iout, '(3x, a, ": ", a, " = ", i0)') &
164  trim(description), trim(varname), min_val
165  else
166  description = 'Integer 1D array detected'
167  write (iout, '(3x, a, ": ", a, a, i0, a, i0)') &
168  trim(description), trim(varname), &
169  ' ranges from ', min_val, ' to ', max_val
170  end if
171  end if

◆ idm_log_var_int2d()

subroutine idmloggermodule::idm_log_var_int2d ( integer(i4b), dimension(:, :), intent(in), contiguous  p_mem,
character(len=*), intent(in)  varname,
character(len=*), intent(in)  mempath,
integer(i4b), intent(in)  iout 
)
private
Parameters
[in]p_mem2d int array
[in]varnamevariable name
[in]mempathvariable memory path

Definition at line 176 of file IdmLogger.f90.

177  integer(I4B), dimension(:, :), contiguous, intent(in) :: p_mem !< 2d int array
178  character(len=*), intent(in) :: varname !< variable name
179  character(len=*), intent(in) :: mempath !< variable memory path
180  integer(I4B), intent(in) :: iout
181  integer(I4B) :: min_val, max_val
182  character(len=LINELENGTH) :: description
183 
184  if (iparamlog > 0 .and. iout > 0) then
185  min_val = minval(p_mem)
186  max_val = maxval(p_mem)
187  if (min_val == max_val) then
188  description = 'Integer 2D constant array detected'
189  write (iout, '(3x, a, ": ", a, " = ", i0)') &
190  trim(description), trim(varname), min_val
191  else
192  description = 'Integer 2D array detected'
193  write (iout, '(3x, a, ": ", a, a, i0, a, i0)') &
194  trim(description), trim(varname), &
195  ' ranges from ', min_val, ' to ', max_val
196  end if
197  end if

◆ idm_log_var_int3d()

subroutine idmloggermodule::idm_log_var_int3d ( integer(i4b), dimension(:, :, :), intent(in), contiguous  p_mem,
character(len=*), intent(in)  varname,
character(len=*), intent(in)  mempath,
integer(i4b), intent(in)  iout 
)
private
Parameters
[in]p_mem3d int array
[in]varnamevariable name
[in]mempathvariable memory path

Definition at line 202 of file IdmLogger.f90.

203  integer(I4B), dimension(:, :, :), contiguous, intent(in) :: p_mem !< 3d int array
204  character(len=*), intent(in) :: varname !< variable name
205  character(len=*), intent(in) :: mempath !< variable memory path
206  integer(I4B), intent(in) :: iout
207  integer(I4B) :: min_val, max_val
208  character(len=LINELENGTH) :: description
209 
210  if (iparamlog > 0 .and. iout > 0) then
211  min_val = minval(p_mem)
212  max_val = maxval(p_mem)
213  if (min_val == max_val) then
214  description = 'Integer 3D constant array detected'
215  write (iout, '(3x, a, ": ", a, " = ", i0)') &
216  trim(description), trim(varname), min_val
217  else
218  description = 'Integer 3D array detected'
219  write (iout, '(3x, a, ": ", a, a, i0, a, i0)') &
220  trim(description), trim(varname), &
221  ' ranges from ', min_val, ' to ', max_val
222  end if
223  end if

◆ idm_log_var_logical()

subroutine idmloggermodule::idm_log_var_logical ( logical(lgp), intent(in)  p_mem,
character(len=*), intent(in)  varname,
character(len=*), intent(in)  mempath,
integer(i4b), intent(in)  iout 
)
private
Parameters
[in]p_memlogical scalar
[in]varnamevariable name
[in]mempathvariable memory path

Definition at line 112 of file IdmLogger.f90.

113  logical(LGP), intent(in) :: p_mem !< logical scalar
114  character(len=*), intent(in) :: varname !< variable name
115  character(len=*), intent(in) :: mempath !< variable memory path
116  integer(I4B), intent(in) :: iout
117  character(len=LINELENGTH) :: description
118 
119  if (iparamlog > 0 .and. iout > 0) then
120  description = 'Logical detected'
121  write (iout, '(3x, a, ": ", a, " = ", l1)') &
122  trim(description), trim(varname), p_mem
123  end if

◆ idm_log_var_str()

subroutine idmloggermodule::idm_log_var_str ( character(len=*), intent(in)  p_mem,
character(len=*), intent(in)  varname,
character(len=*), intent(in)  mempath,
integer(i4b), intent(in)  iout 
)
private
Parameters
[in]p_mempointer to str scalar
[in]varnamevariable name
[in]mempathvariable memory path

Definition at line 322 of file IdmLogger.f90.

323  character(len=*), intent(in) :: p_mem !< pointer to str scalar
324  character(len=*), intent(in) :: varname !< variable name
325  character(len=*), intent(in) :: mempath !< variable memory path
326  integer(I4B), intent(in) :: iout
327  character(len=LINELENGTH) :: description
328 
329  if (iparamlog > 0 .and. iout > 0) then
330  description = 'String detected'
331  write (iout, '(3x, a, ": ", a, " = ", a)') &
332  trim(description), trim(varname), trim(p_mem)
333  end if

◆ idm_log_var_ts()

subroutine idmloggermodule::idm_log_var_ts ( character(len=*), intent(in)  varname,
character(len=*), intent(in)  mempath,
integer(i4b), intent(in)  iout,
logical(lgp), intent(in)  is_tas 
)
Parameters
[in]varnamevariable name
[in]mempathvariable memory path

Definition at line 93 of file IdmLogger.f90.

94  character(len=*), intent(in) :: varname !< variable name
95  character(len=*), intent(in) :: mempath !< variable memory path
96  integer(I4B), intent(in) :: iout
97  logical(LGP), intent(in) :: is_tas
98 
99  if (iparamlog > 0 .and. iout > 0) then
100  if (is_tas) then
101  write (iout, '(3x, a, ": ", a)') &
102  'Time-array-series controlled dynamic variable detected', trim(varname)
103  else
104  write (iout, '(3x, a, ": ", a)') &
105  'Time-series controlled dynamic variable detected', trim(varname)
106  end if
107  end if