20 use mo_kind,
only : i4, dp
21 use mo_string_utils,
only : num2str
23 use mo_netcdf,
only : ncdataset
53 integer(i4),
intent(in) :: idomain
55 logical,
pointer,
intent(in),
dimension(:, :) :: mask1
59 integer(i4) :: ii, nn, ncells
61 character(16),
dimension(3) :: dims
63 type(
outputvariable),
dimension(size(outputFlxState) * nSoilHorizons_mHM) :: tmpvars
65 ncells =
level1(idomain)%nCells
100 tmpvars(ii) =
outputvariable(out%nc,
"SWC_L" // trim(num2str(nn,
'(i2.2)')), &
110 tmpvars(ii) =
outputvariable(out%nc,
"SM_L" // trim(num2str(nn,
'(i2.2)')), &
225 out%nc,
"soil_infil_L" // trim(num2str(nn,
'(i2.2)')), &
236 out%nc,
"aET_L" // trim(num2str(nn,
'(i2.2)')), &
239 'actual Evapotranspiration from soil layer' // trim(num2str(nn)), &
257 tmpvars(ii)%nc,
"Average liquid water generated from solid to liquid phase change in the snow", &
261 allocate(out%vars(ii))
262 out%vars = tmpvars(1 : ii)
283 subroutine mhm_updatedataset(nc_mhm, sidx, eidx, L1_fSealed, L1_fNotSealed, L1_inter, L1_snowPack, L1_soilMoist, &
284 L1_soilMoistSat, L1_sealSTW, L1_unsatSTW, L1_satSTW, L1_neutrons, L1_pet, L1_aETSoil, &
285 L1_aETCanopy, L1_aETSealed, L1_total_runoff, L1_runoffSeal, L1_fastRunoff, L1_slowRunoff, &
286 L1_baseflow, L1_percol, L1_infilSoil, L1_preEffect, L1_melt)
292 integer(i4),
intent(in) :: sidx
293 integer(i4),
intent(in) :: eidx
294 real(dp),
intent(in),
dimension(:) :: L1_fSealed
295 real(dp),
intent(in),
dimension(:) :: L1_fNotSealed
296 real(dp),
intent(in),
dimension(:) :: L1_inter
297 real(dp),
intent(in),
dimension(:) :: L1_snowPack
298 real(dp),
intent(in),
dimension(:, :) :: L1_soilMoist
299 real(dp),
intent(in),
dimension(:, :) :: L1_soilMoistSat
300 real(dp),
intent(in),
dimension(:) :: L1_sealSTW
301 real(dp),
intent(in),
dimension(:) :: L1_unsatSTW
302 real(dp),
intent(in),
dimension(:) :: L1_satSTW
303 real(dp),
intent(in),
dimension(:) :: L1_neutrons
304 real(dp),
intent(in),
dimension(:) :: L1_pet
305 real(dp),
intent(in),
dimension(:, :) :: L1_aETSoil
306 real(dp),
intent(in),
dimension(:) :: L1_aETCanopy
307 real(dp),
intent(in),
dimension(:) :: L1_aETSealed
308 real(dp),
intent(in),
dimension(:) :: L1_total_runoff
309 real(dp),
intent(in),
dimension(:) :: L1_runoffSeal
310 real(dp),
intent(in),
dimension(:) :: L1_fastRunoff
311 real(dp),
intent(in),
dimension(:) :: L1_slowRunoff
312 real(dp),
intent(in),
dimension(:) :: L1_baseflow
313 real(dp),
intent(in),
dimension(:) :: L1_percol
314 real(dp),
intent(in),
dimension(:, :) :: L1_infilSoil
315 real(dp),
intent(in),
dimension(:) :: L1_preEffect
316 real(dp),
intent(in),
dimension(:) :: L1_melt
319 integer(i4) :: ii, nn
326 call vars(ii)%updateVariable(l1_inter(sidx : eidx))
331 call vars(ii)%updateVariable(l1_snowpack(sidx : eidx))
337 call vars(ii)%updateVariable(l1_soilmoist(sidx : eidx, nn))
344 call vars(ii)%updateVariable(l1_soilmoist(sidx : eidx, nn) / l1_soilmoistsat(sidx : eidx, nn))
350 call vars(ii)%updateVariable(sum(l1_soilmoist(sidx : eidx, :), dim = 2) / sum(l1_soilmoistsat(sidx : eidx, :), dim = 2))
355 call vars(ii)%updateVariable(l1_sealstw(sidx : eidx))
360 call vars(ii)%updateVariable(l1_unsatstw(sidx : eidx))
365 call vars(ii)%updateVariable(l1_satstw(sidx : eidx))
370 call vars(ii)%updateVariable(l1_neutrons(sidx : eidx))
375 call vars(ii)%updateVariable(l1_pet(sidx : eidx))
380 call vars(ii)%updateVariable(sum(l1_aetsoil(sidx : eidx, :), dim = 2) * l1_fnotsealed(sidx : eidx) &
381 + l1_aetcanopy(sidx : eidx) + l1_aetsealed(sidx : eidx) * l1_fsealed(sidx : eidx))
386 call vars(ii)%updateVariable(l1_total_runoff(sidx : eidx))
391 call vars(ii)%updateVariable(l1_runoffseal(sidx : eidx) * l1_fsealed(sidx : eidx))
396 call vars(ii)%updateVariable(l1_fastrunoff(sidx : eidx) * l1_fnotsealed(sidx : eidx))
401 call vars(ii)%updateVariable(l1_slowrunoff(sidx : eidx) * l1_fnotsealed(sidx : eidx))
406 call vars(ii)%updateVariable(l1_baseflow(sidx : eidx) * l1_fnotsealed(sidx : eidx))
411 call vars(ii)%updateVariable(l1_percol(sidx : eidx) * l1_fnotsealed(sidx : eidx))
417 call vars(ii)%updateVariable(l1_infilsoil(sidx : eidx, nn) * l1_fnotsealed(sidx : eidx))
424 call vars(ii)%updateVariable(l1_aetsoil(sidx : eidx, nn) * l1_fnotsealed(sidx : eidx))
430 call vars(ii)%updateVariable(l1_preeffect(sidx : eidx))
435 call vars(ii)%updateVariable(l1_melt(sidx : eidx))
456 integer(i4),
intent(in) :: idomain
467 fluxesunit =
'mm ' // trim(adjustl(num2str(nint(ntsteps)))) //
'h-1'
Provides constants commonly used by mHM, mRM and MPR.
real(dp), parameter, public nodata_dp
Provides structures needed by mHM, mRM and/or mpr.
integer(i4), public ntstepday
type(period), dimension(:), allocatable, public simper
integer(i4), public timestep
Provides structures needed by mHM, mRM and/or mpr.
integer(i4), public iflag_cordinate_sys
type(grid), dimension(:), allocatable, target, public level1
Provides file names and units for mHM.
character(len=*), parameter file_mhm_output
file containing mhm output
Main global variables for mHM.
logical, dimension(noutflxstate) outputflxstate
Define model outputs see "mhm_outputs.nml" dim1 = number of output variables to be written.
integer(i4) timestep_model_outputs
timestep for writing model outputs
integer(i4) output_deflate_level
deflate level in nc files
logical output_double_precision
output precision in nc files
integer(i4) output_time_reference
time reference point location in output nc files
Global variables for mpr only.
integer(i4), public nsoilhorizons_mhm
Creates NetCDF output for different fluxes and state variables of mHM.
character(16) function, dimension(3), public data_dims()
Output variable dimension names.
character(3) function, public data_dtype(double_precision)
Output variable dtype for single or double precision.
subroutine, public set_attributes(var, long_name, unit, double_precision, add_coords, standard_name, axis, bounds)
Write output variable attributes.
Creates NetCDF output for different fluxes and state variables of mHM.
type(outputdataset) function mhm_outputdataset(idomain, mask1)
Initialize mHM OutputDataset.
character(16) function fluxesunit(idomain)
Generate a unit string.
subroutine mhm_updatedataset(nc_mhm, sidx, eidx, l1_fsealed, l1_fnotsealed, l1_inter, l1_snowpack, l1_soilmoist, l1_soilmoistsat, l1_sealstw, l1_unsatstw, l1_satstw, l1_neutrons, l1_pet, l1_aetsoil, l1_aetcanopy, l1_aetsealed, l1_total_runoff, l1_runoffseal, l1_fastrunoff, l1_slowrunoff, l1_baseflow, l1_percol, l1_infilsoil, l1_preeffect, l1_melt)
Update all variables.