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

This module contains the ModelExportModule. More...

Data Types

type  exportmodeltype
 export model type More...
 

Functions/Subroutines

logical(lgp) function, public nc_export_active ()
 is netcdf export configured for any model More...
 
subroutine, public modelexports_create (iout)
 create export container variable for all local models More...
 
subroutine, public modelexports_post_prepare ()
 export model list post prepare step More...
 
subroutine, public modelexports_post_step ()
 export model list post step More...
 
subroutine, public modelexports_destroy ()
 destroy export model list More...
 
subroutine init (this, loaders, disenum, iout)
 initialize model export container variable More...
 
subroutine post_prepare (this)
 model export container post prepare step actions More...
 
subroutine post_step (this)
 model export container post step actions More...
 
subroutine destroy (this)
 destroy model export container More...
 
subroutine add_export_model (export_model)
 add model export object to list More...
 
class(exportmodeltype) function, pointer, public get_export_model (idx)
 get model export object by index More...
 

Variables

type(listtype), public export_models
 

Detailed Description

This modeule defines the local list of model exports. It is not dependent on netcdf or other external libraries.

Function/Subroutine Documentation

◆ add_export_model()

subroutine modelexportmodule::add_export_model ( type(exportmodeltype), intent(inout), pointer  export_model)
private

Definition at line 250 of file ModelExport.f90.

251  ! -- dummy variables
252  type(ExportModelType), pointer, intent(inout) :: export_model
253  ! -- local variables
254  class(*), pointer :: obj
255  !
256  obj => export_model
257  call export_models%Add(obj)
Here is the caller graph for this function:

◆ destroy()

subroutine modelexportmodule::destroy ( class(exportmodeltype), intent(inout)  this)
private

Definition at line 237 of file ModelExport.f90.

238  class(ExportModelType), intent(inout) :: this
239  !
240  if (associated(this%nc_export)) then
241  call this%nc_export%destroy()
242  deallocate (this%nc_export)
243  nullify (this%nc_export)
244  end if

◆ get_export_model()

class(exportmodeltype) function, pointer, public modelexportmodule::get_export_model ( integer(i4b), intent(in)  idx)
Parameters
[in]idxpackage number

Definition at line 263 of file ModelExport.f90.

264  ! -- dummy variables
265  integer(I4B), intent(in) :: idx !< package number
266  ! -- local variables
267  class(ExportModelType), pointer :: res
268  class(*), pointer :: obj
269  !
270  ! -- initialize res
271  nullify (res)
272  !
273  ! -- get the object from the list
274  obj => export_models%GetItem(idx)
275  if (associated(obj)) then
276  select type (obj)
277  class is (exportmodeltype)
278  res => obj
279  end select
280  end if
Here is the caller graph for this function:

◆ init()

subroutine modelexportmodule::init ( class(exportmodeltype), intent(inout)  this,
type(modeldynamicpkgstype), intent(in), pointer  loaders,
integer(i4b), intent(in)  disenum,
integer(i4b), intent(in)  iout 
)
private

Definition at line 194 of file ModelExport.f90.

196  class(ExportModelType), intent(inout) :: this
197  type(ModelDynamicPkgsType), pointer, intent(in) :: loaders
198  integer(I4B), intent(in) :: disenum
199  integer(I4B), intent(in) :: iout
200  !
201  this%loaders => loaders
202  this%modelname = loaders%modelname
203  this%modeltype = loaders%modeltype
204  this%modelfname = loaders%modelfname
205  this%nctype = netcdf_undef
206  this%disenum = disenum
207  this%iout = iout
208  !
209  nullify (this%nc_export)
This module contains the NCModelExportModule.
Definition: NCModel.f90:8
@, public netcdf_undef
undefined netcdf export type
Definition: NCModel.f90:31

◆ modelexports_create()

subroutine, public modelexportmodule::modelexports_create ( integer(i4b), intent(in)  iout)

Definition at line 74 of file ModelExport.f90.

82  integer(I4B), intent(in) :: iout
83  type(ModelDynamicPkgsType), pointer :: model_dynamic_input
84  type(ExportModelType), pointer :: export_model
85  character(len=LENMEMPATH) :: modelnam_mempath, model_mempath
86  integer(I4B), pointer :: disenum
87  character(len=LINELENGTH) :: exportstr
88  integer(I4B) :: n
89  logical(LGP) :: found
90  !
91  do n = 1, model_dynamic_pkgs%Count()
92  !
93  ! -- allocate and initialize
94  allocate (export_model)
95  !
96  ! -- set pointer to dynamic input model instance
97  model_dynamic_input => getdynamicmodelfromlist(model_dynamic_pkgs, n)
98  !
99  ! --set input mempaths
100  modelnam_mempath = &
101  create_mem_path(component=model_dynamic_input%modelname, &
102  subcomponent='NAM', context=idm_context)
103  model_mempath = create_mem_path(component=model_dynamic_input%modelname, &
104  context=idm_context)
105  ! -- set pointer to dis enum type
106  call mem_setptr(disenum, 'DISENUM', model_mempath)
107  !
108  ! -- initialize model
109  call export_model%init(model_dynamic_input, disenum, iout)
110  !
111  ! -- update EXPORT_NETCDF string if provided
112  call mem_set_value(exportstr, 'EXPORT_NETCDF', modelnam_mempath, found)
113  if (found) then
114  if (exportstr == 'STRUCTURED') then
115  export_model%nctype = netcdf_structured
116  else
117  ! -- mesh export is default
118  export_model%nctype = netcdf_ugrid
119  end if
120  end if
121  !
122  ! -- add model to list
123  call add_export_model(export_model)
124  end do
This module contains the InputLoadTypeModule.
class(modeldynamicpkgstype) function, pointer, public getdynamicmodelfromlist(list, idx)
get model dynamic packages object from list
type(listtype), public model_dynamic_pkgs
character(len=lenmempath) function create_mem_path(component, subcomponent, context)
returns the path to the memory object
@, public netcdf_structured
netcdf structrured export
Definition: NCModel.f90:33
@, public netcdf_ugrid
netcdf mesh export
Definition: NCModel.f90:32
This module contains simulation variables.
Definition: SimVariables.f90:9
character(len=linelength) idm_context
Here is the call graph for this function:
Here is the caller graph for this function:

◆ modelexports_destroy()

subroutine, public modelexportmodule::modelexports_destroy

Definition at line 169 of file ModelExport.f90.

170  ! -- local variables
171  class(*), pointer :: obj
172  class(ExportModelType), pointer :: export_model
173  integer(I4B) :: n
174  !
175  do n = 1, export_models%Count()
176  obj => export_models%GetItem(n)
177  if (associated(obj)) then
178  select type (obj)
179  class is (exportmodeltype)
180  export_model => obj
181  call export_model%destroy()
182  deallocate (export_model)
183  nullify (export_model)
184  end select
185  end if
186  end do
187  !
188  call export_models%clear()
Here is the caller graph for this function:

◆ modelexports_post_prepare()

subroutine, public modelexportmodule::modelexports_post_prepare

Definition at line 129 of file ModelExport.f90.

130  ! -- local variables
131  class(*), pointer :: obj
132  class(ExportModelType), pointer :: export_model
133  integer(I4B) :: n
134  !
135  do n = 1, export_models%Count()
136  obj => export_models%GetItem(n)
137  if (associated(obj)) then
138  select type (obj)
139  class is (exportmodeltype)
140  export_model => obj
141  call export_model%post_prepare()
142  end select
143  end if
144  end do
Here is the caller graph for this function:

◆ modelexports_post_step()

subroutine, public modelexportmodule::modelexports_post_step

Definition at line 149 of file ModelExport.f90.

150  ! -- local variables
151  class(*), pointer :: obj
152  class(ExportModelType), pointer :: export_model
153  integer(I4B) :: n
154  !
155  do n = 1, export_models%Count()
156  obj => export_models%GetItem(n)
157  if (associated(obj)) then
158  select type (obj)
159  class is (exportmodeltype)
160  export_model => obj
161  call export_model%post_step()
162  end select
163  end if
164  end do
Here is the caller graph for this function:

◆ nc_export_active()

logical(lgp) function, public modelexportmodule::nc_export_active

Definition at line 56 of file ModelExport.f90.

58  logical(LGP) :: active
59  integer(I4B) :: n
60  type(ExportModelType), pointer :: export_model
61  active = .false.
62  !
63  do n = 1, export_models%Count()
64  export_model => get_export_model(n)
65  if (export_model%nctype /= netcdf_undef) then
66  active = .true.
67  exit
68  end if
69  end do
Here is the call graph for this function:
Here is the caller graph for this function:

◆ post_prepare()

subroutine modelexportmodule::post_prepare ( class(exportmodeltype), intent(inout)  this)

Definition at line 215 of file ModelExport.f90.

216  class(ExportModelType), intent(inout) :: this
217  !
218  if (associated(this%nc_export)) then
219  call this%nc_export%export_input()
220  end if

◆ post_step()

subroutine modelexportmodule::post_step ( class(exportmodeltype), intent(inout)  this)
private

Definition at line 226 of file ModelExport.f90.

227  class(ExportModelType), intent(inout) :: this
228  !
229  if (associated(this%nc_export)) then
230  call this%nc_export%step()
231  end if

Variable Documentation

◆ export_models

type(listtype), public modelexportmodule::export_models

Definition at line 28 of file ModelExport.f90.

28  type(ListType) :: export_models