14 USE mo_kind,
ONLY : i4, dp
57 use mo_optimization_types,
only: optidata
58 use mo_message,
only : message
60 use mo_string_utils,
only : num2str
61 use mo_timer,
only : timer_get, timer_start, &
67 integer(i4),
intent(in) :: idomain
70 integer(i4),
intent(in) :: domainid
73 type(optidata),
intent(inout) :: l1_optiobs
79 integer(i4) :: nrows1, ncols1
82 logical,
dimension(:, :),
allocatable :: mask1
85 integer(i4) :: ncells1
88 real(dp),
dimension(:, :, :),
allocatable :: l1_data
91 logical,
dimension(:, :, :),
allocatable :: l1_mask
93 integer(i4) :: ntimesteps_l1_opti
96 nrows1 =
level1(idomain)%nrows
97 ncols1 =
level1(idomain)%ncols
98 ncells1 =
level1(idomain)%ncells
99 mask1 =
level1(idomain)%mask
102 call message(
' Reading', trim(l1_optiobs%varname) ,
'for domain: ', trim(adjustl(num2str(domainid))),
' ...')
104 call read_nc(l1_optiobs%dir, nrows1, ncols1, trim(l1_optiobs%varname), mask1, l1_data, &
105 target_period =
evalper(idomain), nctimestep = l1_optiobs%timeStepInput, nocheck = .true., maskout = l1_mask)
108 ntimesteps_l1_opti =
size(l1_data, 3)
109 allocate(l1_optiobs%dataObs(ncells1, ntimesteps_l1_opti))
110 allocate(l1_optiobs%maskObs(ncells1, ntimesteps_l1_opti))
111 do t = 1, ntimesteps_l1_opti
112 l1_optiobs%dataObs(:, t) = pack(l1_data(:, :, t), mask = mask1(:, :))
113 l1_optiobs%maskObs(:, t) = pack(l1_mask(:, :, t), mask = mask1(:, :))
120 call message(
' in ', trim(num2str(timer_get(1),
'(F9.3)')),
' seconds.')
Provides structures needed by mHM, mRM and/or mpr.
type(period), dimension(:), allocatable, public evalper
Provides structures needed by mHM, mRM and/or mpr.
type(grid), dimension(:), allocatable, target, public level1
Reads forcing input data.
subroutine, public read_nc(folder, nrows, ncols, varname, mask, data, target_period, lower, upper, nctimestep, filename, nocheck, maskout, is_meteo, bound_error, ntstepforcingday)
Reads forcing input in NetCDF file format.
Read optional data for mHM calibration.
subroutine, public readoptidataobs(idomain, domainid, l1_optiobs)
Read evapotranspiration data from NetCDF file for calibration.