diff --git a/build/makefile b/build/makefile index b20c9bfac41a1c3e702011b919b912b2ebcddb52..94e0ae83833e9a61693b125b9f8cc8feb243d08a 100644 --- a/build/makefile +++ b/build/makefile @@ -17,16 +17,16 @@ # gfortran compiler flags ifeq "$(FC)" "gfortran" # Production runs -FLAGS_NOAH = -O3 -ffree-form -ffree-line-length-none -fmax-errors=0 -fPIC -FLAGS_COMM = -O3 -ffree-line-length-none -fmax-errors=0 -fPIC -FLAGS_SUMMA = -O3 -ffree-line-length-none -fmax-errors=0 -fPIC -FLAGS_ACTORS = -O3 +# FLAGS_NOAH = -O3 -ffree-form -ffree-line-length-none -fmax-errors=0 -fPIC +# FLAGS_COMM = -O3 -ffree-line-length-none -fmax-errors=0 -fPIC +# FLAGS_SUMMA = -O3 -ffree-line-length-none -fmax-errors=0 -fPIC +# FLAGS_ACTORS = -O3 # # Debug runs -# FLAGS_NOAH = -p -g -O0 -ffree-form -ffree-line-length-none -fmax-errors=0 -fbacktrace -Wno-unused -Wno-unused-dummy-argument -fPIC -# FLAGS_COMM = -p -g -O0 -Wall -ffree-line-length-none -fmax-errors=0 -fbacktrace -fcheck=bounds -fPIC -# FLAGS_SUMMA = -p -g -O0 -Wall -ffree-line-length-none -fmax-errors=0 -fbacktrace -fcheck=bounds -fPIC -# FLAGS_ACTORS = -g -O0 -Wall +FLAGS_NOAH = -p -g -O0 -ffree-form -ffree-line-length-none -fmax-errors=0 -fbacktrace -Wno-unused -Wno-unused-dummy-argument -fPIC +FLAGS_COMM = -p -g -O0 -Wall -ffree-line-length-none -fmax-errors=0 -fbacktrace -fcheck=bounds -fPIC +FLAGS_SUMMA = -p -g -O0 -Wall -ffree-line-length-none -fmax-errors=0 -fbacktrace -fcheck=bounds -fPIC +FLAGS_ACTORS = -g -O0 -Wall endif # ifort compiler flags diff --git a/build/source/actors/JobActor.h b/build/source/actors/JobActor.h index 25832cb50fc5158a44fe91e206470d3d52c68b2e..ac00049d41d0b0e3e9183a86f8e2ddc5ebb7fcc4 100644 --- a/build/source/actors/JobActor.h +++ b/build/source/actors/JobActor.h @@ -101,6 +101,7 @@ behavior job_actor(stateful_actor<job_state>* self, int startGRU, int numGRU, }, [=](file_access_actor_done, double readDuration, double writeDuration) { + int err = 0; if (debug) { aout(self) << "\n********************************\n"; aout(self) << "Outputing Timing Info for HRUs\n"; @@ -128,7 +129,7 @@ behavior job_actor(stateful_actor<job_state>* self, int startGRU, int numGRU, aout(self) << "\nWriting Duration:\n"; aout(self) << " " << writeDuration << " Seconds\n\n"; - + cleanUpJobActor(&err); // Tell Parent we are done self->send(self->state.parent, done_job_v, self->state.numGRUFailed); self->quit(); diff --git a/build/source/driver/summaActors_init.f90 b/build/source/driver/summaActors_init.f90 index 35a7f2347e5835ac144e6dbcfcdd1b328b06c90f..b9b26e5910381435d22743c01fbf59741767c915 100755 --- a/build/source/driver/summaActors_init.f90 +++ b/build/source/driver/summaActors_init.f90 @@ -163,7 +163,7 @@ contains if(err/=0)then; message=trim(message)//trim(cmessage); return; endif end do ! looping through time structures - ! copy the time variables set up by the file_access_actor + ! copy the time variables set up by the job_actor startTime_hru%var(:) = startTime%var(:) finishTime_hru%var(:) = finshTime%var(:) refTime_hru%var(:) = refTime%var(:) @@ -212,36 +212,29 @@ contains ! ***************************************************************************** ! *** allocate space for output statistics data structures ! ***************************************************************************** - ! loop through data structures do iStruct=1,size(structInfo) - - ! allocate space - select case(trim(structInfo(iStruct)%structName)) - case('forc'); call allocLocal(statForc_meta(:)%var_info,forcStat,nSnow,nSoil,err,cmessage); ! model forcing data - case('prog'); call allocLocal(statProg_meta(:)%var_info,progStat,nSnow,nSoil,err,cmessage); ! model prognostic - case('diag'); call allocLocal(statDiag_meta(:)%var_info,diagStat,nSnow,nSoil,err,cmessage); ! model diagnostic - case('flux'); call allocLocal(statFlux_meta(:)%var_info,fluxStat,nSnow,nSoil,err,cmessage); ! model fluxes - case('indx'); call allocLocal(statIndx_meta(:)%var_info,indxStat,nSnow,nSoil,err,cmessage); ! index vars - case('bvar'); call allocLocal(statBvar_meta(:)%var_info,bvarStat,nSnow=0,nSoil=0,err=err,message=cmessage); ! basin-average variables - case default; cycle - end select - - ! check errors - if(err/=0)then - message=trim(message)//trim(cmessage)//'[statistics for = '//trim(structInfo(iStruct)%structName)//']' - return - endif - + ! allocate space + select case(trim(structInfo(iStruct)%structName)) + case('forc'); call allocLocal(statForc_meta(:)%var_info,forcStat,nSnow,nSoil,err,cmessage); ! model forcing data + case('prog'); call allocLocal(statProg_meta(:)%var_info,progStat,nSnow,nSoil,err,cmessage); ! model prognostic + case('diag'); call allocLocal(statDiag_meta(:)%var_info,diagStat,nSnow,nSoil,err,cmessage); ! model diagnostic + case('flux'); call allocLocal(statFlux_meta(:)%var_info,fluxStat,nSnow,nSoil,err,cmessage); ! model fluxes + case('indx'); call allocLocal(statIndx_meta(:)%var_info,indxStat,nSnow,nSoil,err,cmessage); ! index vars + case('bvar'); call allocLocal(statBvar_meta(:)%var_info,bvarStat,nSnow=0,nSoil=0,err=err,message=cmessage); ! basin-average variables + case default; cycle + end select + ! check errors + if(err/=0)then + message=trim(message)//trim(cmessage)//'[statistics for = '//trim(structInfo(iStruct)%structName)//']' + return + endif end do ! iStruct ! identify the end of the initialization call date_and_time(values=endInit) - ! aggregate the elapsed time for the initialization - ! elapsedInit = elapsedSec(startInit, endInit) - - ! end association to info in data structures + ! end association to info in data structures end associate end subroutine summa4chm_initialize diff --git a/build/source/dshare/globalData.f90 b/build/source/dshare/globalData.f90 index 5b268932d51fe607c61ea7eeb18f88db522c01f8..e29a40ff2507b45ba89b2ff868c79a87c67e87e1 100755 --- a/build/source/dshare/globalData.f90 +++ b/build/source/dshare/globalData.f90 @@ -23,134 +23,134 @@ ! ---------------------------------------------------------------------------------------------------------------- MODULE globalData - ! data types - USE nrtype - USE netcdf - USE,intrinsic :: ieee_arithmetic ! IEEE arithmetic - USE data_types,only:gru2hru_map ! mapping between the GRUs and HRUs - USE data_types,only:hru2gru_map ! mapping between the GRUs and HRUs - USE data_types,only:model_options ! the model decision structure - USE data_types,only:file_info ! metadata for model forcing datafile - USE data_types,only:par_info ! default parameter values and parameter bounds - USE data_types,only:var_info ! metadata for variables in each model structure - USE data_types,only:flux2state ! extended metadata to define flux-to-state mapping - USE data_types,only:extended_info ! extended metadata for variables in each model structure - USE data_types,only:struct_info ! summary information on all data structures - USE data_types,only:var_i ! vector of integers - USE data_types,only:var_dlength - USE data_types,only:var_dlength_array - USE data_types,only:var_forc - USE data_types,only:dlength - USE data_types,only:ilength - USE data_types,only:summa_output_type ! master summa data type - - ! number of variables in each data structure - USE var_lookup,only:maxvarTime ! time: maximum number variables - USE var_lookup,only:maxvarForc ! forcing data: maximum number variables - USE var_lookup,only:maxvarAttr ! attributes: maximum number variables - USE var_lookup,only:maxvarType ! type index: maximum number variables - USE var_lookup,only:maxvarId ! IDs index: maximum number variables - USE var_lookup,only:maxvarProg ! prognostic variables: maximum number variables - USE var_lookup,only:maxvarDiag ! diagnostic variables: maximum number variables - USE var_lookup,only:maxvarFlux ! model fluxes: maximum number variables - USE var_lookup,only:maxvarDeriv ! model derivatives: maximum number variables - USE var_lookup,only:maxvarIndx ! model indices: maximum number variables - USE var_lookup,only:maxvarMpar ! model parameters: maximum number variables - USE var_lookup,only:maxvarBvar ! basin-average variables: maximum number variables - USE var_lookup,only:maxvarBpar ! basin-average parameters: maximum number variables - USE var_lookup,only:maxvarDecisions ! maximum number of decisions - USE var_lookup,only:maxvarFreq ! maximum number of output files - implicit none - private - - ! ---------------------------------------------------------------------------------------------------------------- - ! * part 1: parameters that are fixed across multiple instantiations - ! ---------------------------------------------------------------------------------------------------------------- - - ! define missing values ! master summa data type - - ! define missing values - real(rkind),parameter,public :: quadMissing = nr_quadMissing ! (from nrtype) missing quadruple precision number - real(rkind),parameter,public :: realMissing = nr_realMissing ! (from nrtype) missing double precision number - integer(i4b),parameter,public :: integerMissing = nr_integerMissing ! (from nrtype) missing integer - - ! define run modes - integer(i4b),parameter,public :: iRunModeFull=1 ! named variable defining running mode as full run (all GRUs) - integer(i4b),parameter,public :: iRunModeGRU=2 ! named variable defining running mode as GRU-parallelization run (GRU subset) - integer(i4b),parameter,public :: iRunModeHRU=3 ! named variable defining running mode as single-HRU run (ONE HRU) - - - ! define progress modes - integer(i4b),parameter,public :: ixProgress_im=1000 ! named variable to print progress once per month - integer(i4b),parameter,public :: ixProgress_id=1001 ! named variable to print progress once per day - integer(i4b),parameter,public :: ixProgress_ih=1002 ! named variable to print progress once per hour - integer(i4b),parameter,public :: ixProgress_never=1003 ! named variable to print progress never - integer(i4b),parameter,public :: ixProgress_it=1004 ! named variable to print progress every timestep - - ! define restart frequency - integer(i4b),parameter,public :: ixRestart_iy=1000 ! named variable to print a re-start file once per year - integer(i4b),parameter,public :: ixRestart_im=1001 ! named variable to print a re-start file once per month - integer(i4b),parameter,public :: ixRestart_id=1002 ! named variable to print a re-start file once per day - integer(i4b),parameter,public :: ixRestart_end=1003 ! named variable to print a re-start file at the end of a run - integer(i4b),parameter,public :: ixRestart_never=1004 ! named variable to print a re-start file never - - ! define output file frequency - integer(i4b),parameter,public :: noNewFiles=1001 ! no new output files - integer(i4b),parameter,public :: newFileEveryOct1=1002 ! create a new file on Oct 1 every year (start of the USA water year) -! =======------- - type(var_dlength),pointer,public :: fluxStructLateralFlow(:) ! model fluxes - - ! define named variables for "yes" and "no" - integer(i4b),parameter,public :: no=0 ! .false. - integer(i4b),parameter,public :: yes=1 ! .true. - - ! define named variables to describe the domain type - integer(i4b),parameter,public :: iname_cas =1000 ! named variable to denote a canopy air space state variable - integer(i4b),parameter,public :: iname_veg =1001 ! named variable to denote a vegetation state variable - integer(i4b),parameter,public :: iname_soil=1002 ! named variable to denote a soil layer - integer(i4b),parameter,public :: iname_snow=1003 ! named variable to denote a snow layer - integer(i4b),parameter,public :: iname_aquifer=1004 ! named variable to denote a snow layer - - ! define named variables to describe the state variable type - integer(i4b),parameter,public :: iname_nrgCanair=2001 ! named variable defining the energy of the canopy air space - integer(i4b),parameter,public :: iname_nrgCanopy=2002 ! named variable defining the energy of the vegetation canopy - integer(i4b),parameter,public :: iname_watCanopy=2003 ! named variable defining the mass of total water on the vegetation canopy - integer(i4b),parameter,public :: iname_liqCanopy=2004 ! named variable defining the mass of liquid water on the vegetation canopy - integer(i4b),parameter,public :: iname_nrgLayer=3001 ! named variable defining the energy state variable for snow+soil layers - integer(i4b),parameter,public :: iname_watLayer=3002 ! named variable defining the total water state variable for snow+soil layers - integer(i4b),parameter,public :: iname_liqLayer=3003 ! named variable defining the liquid water state variable for snow+soil layers - integer(i4b),parameter,public :: iname_matLayer=3004 ! named variable defining the matric head state variable for soil layers - integer(i4b),parameter,public :: iname_lmpLayer=3005 ! named variable defining the liquid matric potential state variable for soil layers - integer(i4b),parameter,public :: iname_watAquifer=3006 ! named variable defining the water storage in the aquifer - - ! define named variables to describe the form and structure of the band-diagonal matrices used in the numerical solver - ! NOTE: This indexing scheme provides the matrix structure expected by lapack. Specifically, lapack requires kl extra rows for additional storage. - ! Consequently, all indices are offset by kl and the total number of bands for storage is 2*kl+ku+1 instead of kl+ku+1. - integer(i4b),parameter,public :: nRHS=1 ! number of unknown variables on the RHS of the linear system A.X=B - integer(i4b),parameter,public :: ku=3 ! number of super-diagonal bands - integer(i4b),parameter,public :: kl=4 ! number of sub-diagonal bands - integer(i4b),parameter,public :: ixDiag=kl+ku+1 ! index for the diagonal band - integer(i4b),parameter,public :: nBands=2*kl+ku+1 ! length of the leading dimension of the band diagonal matrix - - ! define named variables for the type of matrix used in the numerical solution. - integer(i4b),parameter,public :: ixFullMatrix=1001 ! named variable for the full Jacobian matrix - integer(i4b),parameter,public :: ixBandMatrix=1002 ! named variable for the band diagonal matrix - - ! define indices describing the first and last layers of the Jacobian to print (for debugging) - integer(i4b),parameter,public :: iJac1=16 ! first layer of the Jacobian to print - integer(i4b),parameter,public :: iJac2=20 ! last layer of the Jacobian to print - - ! define limit checks - real(rkind),parameter,public :: verySmall=tiny(1.0_dp) ! a very small number - real(rkind),parameter,public :: veryBig=1.e+20_dp ! a very big number - - ! define algorithmic control parameters - real(rkind),parameter,public :: dx = 1.e-8_dp ! finite difference increment - - ! define summary information on all data structures - integer(i4b),parameter :: nStruct=13 ! number of data structures - type(struct_info),parameter,public,dimension(nStruct) :: structInfo=(/& - struct_info('time', 'TIME' , maxvarTime ), & ! the time data structure + ! data types + USE nrtype + USE netcdf + USE,intrinsic :: ieee_arithmetic ! IEEE arithmetic + USE data_types,only:gru2hru_map ! mapping between the GRUs and HRUs + USE data_types,only:hru2gru_map ! mapping between the GRUs and HRUs + USE data_types,only:model_options ! the model decision structure + USE data_types,only:file_info ! metadata for model forcing datafile + USE data_types,only:par_info ! default parameter values and parameter bounds + USE data_types,only:var_info ! metadata for variables in each model structure + USE data_types,only:flux2state ! extended metadata to define flux-to-state mapping + USE data_types,only:extended_info ! extended metadata for variables in each model structure + USE data_types,only:struct_info ! summary information on all data structures + USE data_types,only:var_i ! vector of integers + USE data_types,only:var_dlength + USE data_types,only:var_dlength_array + USE data_types,only:var_forc + USE data_types,only:dlength + USE data_types,only:ilength + USE data_types,only:summa_output_type ! master summa data type + + ! number of variables in each data structure + USE var_lookup,only:maxvarTime ! time: maximum number variables + USE var_lookup,only:maxvarForc ! forcing data: maximum number variables + USE var_lookup,only:maxvarAttr ! attributes: maximum number variables + USE var_lookup,only:maxvarType ! type index: maximum number variables + USE var_lookup,only:maxvarId ! IDs index: maximum number variables + USE var_lookup,only:maxvarProg ! prognostic variables: maximum number variables + USE var_lookup,only:maxvarDiag ! diagnostic variables: maximum number variables + USE var_lookup,only:maxvarFlux ! model fluxes: maximum number variables + USE var_lookup,only:maxvarDeriv ! model derivatives: maximum number variables + USE var_lookup,only:maxvarIndx ! model indices: maximum number variables + USE var_lookup,only:maxvarMpar ! model parameters: maximum number variables + USE var_lookup,only:maxvarBvar ! basin-average variables: maximum number variables + USE var_lookup,only:maxvarBpar ! basin-average parameters: maximum number variables + USE var_lookup,only:maxvarDecisions ! maximum number of decisions + USE var_lookup,only:maxvarFreq ! maximum number of output files + implicit none + private + + ! ---------------------------------------------------------------------------------------------------------------- + ! * part 1: parameters that are fixed across multiple instantiations + ! ---------------------------------------------------------------------------------------------------------------- + + ! define missing values ! master summa data type + + ! define missing values + real(rkind),parameter,public :: quadMissing = nr_quadMissing ! (from nrtype) missing quadruple precision number + real(rkind),parameter,public :: realMissing = nr_realMissing ! (from nrtype) missing double precision number + integer(i4b),parameter,public :: integerMissing = nr_integerMissing ! (from nrtype) missing integer + + ! define run modes + integer(i4b),parameter,public :: iRunModeFull=1 ! named variable defining running mode as full run (all GRUs) + integer(i4b),parameter,public :: iRunModeGRU=2 ! named variable defining running mode as GRU-parallelization run (GRU subset) + integer(i4b),parameter,public :: iRunModeHRU=3 ! named variable defining running mode as single-HRU run (ONE HRU) + + + ! define progress modes + integer(i4b),parameter,public :: ixProgress_im=1000 ! named variable to print progress once per month + integer(i4b),parameter,public :: ixProgress_id=1001 ! named variable to print progress once per day + integer(i4b),parameter,public :: ixProgress_ih=1002 ! named variable to print progress once per hour + integer(i4b),parameter,public :: ixProgress_never=1003 ! named variable to print progress never + integer(i4b),parameter,public :: ixProgress_it=1004 ! named variable to print progress every timestep + + ! define restart frequency + integer(i4b),parameter,public :: ixRestart_iy=1000 ! named variable to print a re-start file once per year + integer(i4b),parameter,public :: ixRestart_im=1001 ! named variable to print a re-start file once per month + integer(i4b),parameter,public :: ixRestart_id=1002 ! named variable to print a re-start file once per day + integer(i4b),parameter,public :: ixRestart_end=1003 ! named variable to print a re-start file at the end of a run + integer(i4b),parameter,public :: ixRestart_never=1004 ! named variable to print a re-start file never + + ! define output file frequency + integer(i4b),parameter,public :: noNewFiles=1001 ! no new output files + integer(i4b),parameter,public :: newFileEveryOct1=1002 ! create a new file on Oct 1 every year (start of the USA water year) + ! =======------- + type(var_dlength),pointer,public :: fluxStructLateralFlow(:) ! model fluxes + + ! define named variables for "yes" and "no" + integer(i4b),parameter,public :: no=0 ! .false. + integer(i4b),parameter,public :: yes=1 ! .true. + + ! define named variables to describe the domain type + integer(i4b),parameter,public :: iname_cas =1000 ! named variable to denote a canopy air space state variable + integer(i4b),parameter,public :: iname_veg =1001 ! named variable to denote a vegetation state variable + integer(i4b),parameter,public :: iname_soil=1002 ! named variable to denote a soil layer + integer(i4b),parameter,public :: iname_snow=1003 ! named variable to denote a snow layer + integer(i4b),parameter,public :: iname_aquifer=1004 ! named variable to denote a snow layer + + ! define named variables to describe the state variable type + integer(i4b),parameter,public :: iname_nrgCanair=2001 ! named variable defining the energy of the canopy air space + integer(i4b),parameter,public :: iname_nrgCanopy=2002 ! named variable defining the energy of the vegetation canopy + integer(i4b),parameter,public :: iname_watCanopy=2003 ! named variable defining the mass of total water on the vegetation canopy + integer(i4b),parameter,public :: iname_liqCanopy=2004 ! named variable defining the mass of liquid water on the vegetation canopy + integer(i4b),parameter,public :: iname_nrgLayer=3001 ! named variable defining the energy state variable for snow+soil layers + integer(i4b),parameter,public :: iname_watLayer=3002 ! named variable defining the total water state variable for snow+soil layers + integer(i4b),parameter,public :: iname_liqLayer=3003 ! named variable defining the liquid water state variable for snow+soil layers + integer(i4b),parameter,public :: iname_matLayer=3004 ! named variable defining the matric head state variable for soil layers + integer(i4b),parameter,public :: iname_lmpLayer=3005 ! named variable defining the liquid matric potential state variable for soil layers + integer(i4b),parameter,public :: iname_watAquifer=3006 ! named variable defining the water storage in the aquifer + + ! define named variables to describe the form and structure of the band-diagonal matrices used in the numerical solver + ! NOTE: This indexing scheme provides the matrix structure expected by lapack. Specifically, lapack requires kl extra rows for additional storage. + ! Consequently, all indices are offset by kl and the total number of bands for storage is 2*kl+ku+1 instead of kl+ku+1. + integer(i4b),parameter,public :: nRHS=1 ! number of unknown variables on the RHS of the linear system A.X=B + integer(i4b),parameter,public :: ku=3 ! number of super-diagonal bands + integer(i4b),parameter,public :: kl=4 ! number of sub-diagonal bands + integer(i4b),parameter,public :: ixDiag=kl+ku+1 ! index for the diagonal band + integer(i4b),parameter,public :: nBands=2*kl+ku+1 ! length of the leading dimension of the band diagonal matrix + + ! define named variables for the type of matrix used in the numerical solution. + integer(i4b),parameter,public :: ixFullMatrix=1001 ! named variable for the full Jacobian matrix + integer(i4b),parameter,public :: ixBandMatrix=1002 ! named variable for the band diagonal matrix + + ! define indices describing the first and last layers of the Jacobian to print (for debugging) + integer(i4b),parameter,public :: iJac1=16 ! first layer of the Jacobian to print + integer(i4b),parameter,public :: iJac2=20 ! last layer of the Jacobian to print + + ! define limit checks + real(rkind),parameter,public :: verySmall=tiny(1.0_dp) ! a very small number + real(rkind),parameter,public :: veryBig=1.e+20_dp ! a very big number + + ! define algorithmic control parameters + real(rkind),parameter,public :: dx = 1.e-8_dp ! finite difference increment + + ! define summary information on all data structures + integer(i4b),parameter :: nStruct=13 ! number of data structures + type(struct_info),parameter,public,dimension(nStruct) :: structInfo=(/& + struct_info('time', 'TIME' , maxvarTime ), & ! the time data structure struct_info('forc', 'FORCE', maxvarForc ), & ! the forcing data structure struct_info('attr', 'ATTR' , maxvarAttr ), & ! the attribute data structure struct_info('type', 'TYPE' , maxvarType ), & ! the type data structure @@ -164,117 +164,117 @@ MODULE globalData struct_info('flux', 'FLUX' , maxvarFlux ), & ! the flux data structure struct_info('deriv', 'DERIV', maxvarDeriv) /) ! the model derivative data structure - ! fixed model decisions - logical(lgt) , parameter, public :: overwriteRSMIN=.false. ! flag to overwrite RSMIN - integer(i4b) , parameter, public :: maxSoilLayers=10000 ! Maximum Number of Soil Layers - - ! ---------------------------------------------------------------------------------------------------------------- - ! * part 2: globally constant variables/structures that require initialization - ! ---------------------------------------------------------------------------------------------------------------- - - ! define Indian bread (NaN) - real(rkind),save,public :: dNaN - - ! define default parameter values and parameter bounds - type(par_info),save,public :: localParFallback(maxvarMpar) ! local column default parameters - type(par_info),save,public :: basinParFallback(maxvarBpar) ! basin-average default parameters - - ! define vectors of metadata - type(var_info),save,public :: time_meta(maxvarTime) ! model time information - type(var_info),save,public :: forc_meta(maxvarForc) ! model forcing data - type(var_info),save,public :: attr_meta(maxvarAttr) ! local attributes - type(var_info),save,public :: type_meta(maxvarType) ! local classification of veg, soil, etc. - type(var_info),save,public :: id_meta(maxvarId) ! local classification of veg, soil, etc. - type(var_info),save,public :: mpar_meta(maxvarMpar) ! local model parameters for each HRU - type(var_info),save,public :: indx_meta(maxvarIndx) ! local model indices for each HRU - type(var_info),save,public :: prog_meta(maxvarProg) ! local state variables for each HRU - type(var_info),save,public :: diag_meta(maxvarDiag) ! local diagnostic variables for each HRU - type(var_info),save,public :: flux_meta(maxvarFlux) ! local model fluxes for each HRU - type(var_info),save,public :: deriv_meta(maxvarDeriv) ! local model derivatives for each HRU - type(var_info),save,public :: bpar_meta(maxvarBpar) ! basin parameters for aggregated processes - type(var_info),save,public :: bvar_meta(maxvarBvar) ! basin variables for aggregated processes - - ! ancillary metadata structures - type(flux2state), save,public :: flux2state_orig(maxvarFlux) ! named variables for the states affected by each flux (original) - type(flux2state), save,public :: flux2state_liq(maxvarFlux) ! named variables for the states affected by each flux (liquid water) - type(extended_info),save,public,allocatable :: averageFlux_meta(:) ! timestep-average model fluxes - - ! mapping from original to child structures - integer(i4b),save,public,allocatable :: forcChild_map(:) ! index of the child data structure: stats forc - integer(i4b),save,public,allocatable :: progChild_map(:) ! index of the child data structure: stats prog - integer(i4b),save,public,allocatable :: diagChild_map(:) ! index of the child data structure: stats diag - integer(i4b),save,public,allocatable :: fluxChild_map(:) ! index of the child data structure: stats flux - integer(i4b),save,public,allocatable :: indxChild_map(:) ! index of the child data structure: stats indx - integer(i4b),save,public,allocatable :: bvarChild_map(:) ! index of the child data structure: stats bvar - - ! child metadata structures - type(extended_info),save,public,allocatable :: statForc_meta(:) ! child metadata for stats - type(extended_info),save,public,allocatable :: statProg_meta(:) ! child metadata for stats - type(extended_info),save,public,allocatable :: statDiag_meta(:) ! child metadata for stats - type(extended_info),save,public,allocatable :: statFlux_meta(:) ! child metadata for stats - type(extended_info),save,public,allocatable :: statIndx_meta(:) ! child metadata for stats - type(extended_info),save,public,allocatable :: statBvar_meta(:) ! child metadata for stats - - ! ---------------------------------------------------------------------------------------------------------------- - ! * part 3: run time variables - ! ---------------------------------------------------------------------------------------------------------------- - - ! define the model decisions - type(model_options),save,public :: model_decisions(maxvarDecisions) ! the model decision structure - - ! define index variables describing the indices of the first and last HRUs in the forcing file - integer(i4b),save,public :: ixHRUfile_min ! minimum index - integer(i4b),save,public :: ixHRUfile_max ! maximum index - - ! define mapping structures - type(gru2hru_map),allocatable,save,public :: gru_struc(:) ! gru2hru map - type(hru2gru_map),allocatable,save,public :: index_map(:) ! hru2gru map - - ! define variables used for the vegetation phenology - real(rkind),dimension(12),save,public :: greenVegFrac_monthly ! fraction of green vegetation in each month (0-1) - - ! define the model output file - character(len=256),save,public :: fileout='' ! output filename - character(len=256),save,public :: output_fileSuffix='' ! suffix for the output file - - ! define controls on model output - type(ilength),allocatable,save,public :: outputTimeStep(:) ! timestep in output files - logical(lgt),dimension(maxvarFreq),save,public :: finalizeStats=.false. ! flags to reset statistics - integer(i4b),save,public :: maxLayers ! maximum number of layers - integer(i4b),save,public :: maxSnowLayers ! maximum number of snow layers - - ! define control variables - integer(i4b),save,public :: startGRU ! index of the starting GRU for parallelization run - integer(i4b),save,public :: checkHRU ! index of the HRU for a single HRU run - integer(i4b),save,public :: iRunMode ! define the current running mode - integer(i4b),save,public :: nThreads=1 ! number of threads - integer(i4b),save,public :: ixProgress=ixProgress_id ! define frequency to write progress - integer(i4b),save,public :: ixRestart=ixRestart_never ! define frequency to write restart files - integer(i4b),save,public :: newOutputFile=noNewFiles ! define option for new output files - - ! define common variables - integer(i4b),save,public :: numtim ! number of time steps - integer(i4b),save,public :: nHRUrun ! number of HRUs in the run domain - integer(i4b),save,public :: nGRUrun ! number of GRUs in the run domain - real(rkind),save,public :: data_step ! length of the time_step - real(rkind),save,public :: dJulianStart ! julian day of start time of simulation - real(rkind),save,public :: dJulianFinsh ! julian day of end time of simulation - real(rkind),save,public :: refJulday ! reference time in fractional julian days - real(rkind),save,public :: refJulday_data ! reference time in fractional julian days (data files) - integer(i4b),save,public :: nHRUfile ! number of HRUs in the file - integer(i4b),save,public :: urbanVegCategory ! vegetation category for urban areas - logical(lgt),save,public :: doJacobian=.false. ! flag to compute the Jacobian - logical(lgt),save,public :: globalPrintFlag=.false. ! flag to compute the Jacobian - integer(i4b),save,public :: chunksize=1024 ! chunk size for the netcdf read/write - integer(i4b),save,public :: outputPrecision=nf90_double ! variable type - - ! define result from the time calls - integer(i4b),dimension(8),save,public :: startInit,endInit ! date/time for the start and end of the initialization - integer(i4b),dimension(8),save,public :: startSetup,endSetup ! date/time for the start and end of the parameter setup - integer(i4b),dimension(8),save,public :: startRestart,endRestart ! date/time for the start and end to read restart data - integer(i4b),dimension(8),save,public :: startRead,endRead ! date/time for the start and end of the data read - integer(i4b),dimension(8),save,public :: startWrite,endWrite ! date/time for the start and end of the stats/write - integer(i4b),dimension(8),save,public :: startPhysics,endPhysics ! date/time for the start and end of the physics + ! fixed model decisions + logical(lgt) , parameter, public :: overwriteRSMIN=.false. ! flag to overwrite RSMIN + integer(i4b) , parameter, public :: maxSoilLayers=10000 ! Maximum Number of Soil Layers + + ! ---------------------------------------------------------------------------------------------------------------- + ! * part 2: globally constant variables/structures that require initialization + ! ---------------------------------------------------------------------------------------------------------------- + + ! define Indian bread (NaN) + real(rkind),save,public :: dNaN + + ! define default parameter values and parameter bounds + type(par_info),save,public :: localParFallback(maxvarMpar) ! local column default parameters + type(par_info),save,public :: basinParFallback(maxvarBpar) ! basin-average default parameters + + ! define vectors of metadata + type(var_info),save,public :: time_meta(maxvarTime) ! model time information + type(var_info),save,public :: forc_meta(maxvarForc) ! model forcing data + type(var_info),save,public :: attr_meta(maxvarAttr) ! local attributes + type(var_info),save,public :: type_meta(maxvarType) ! local classification of veg, soil, etc. + type(var_info),save,public :: id_meta(maxvarId) ! local classification of veg, soil, etc. + type(var_info),save,public :: mpar_meta(maxvarMpar) ! local model parameters for each HRU + type(var_info),save,public :: indx_meta(maxvarIndx) ! local model indices for each HRU + type(var_info),save,public :: prog_meta(maxvarProg) ! local state variables for each HRU + type(var_info),save,public :: diag_meta(maxvarDiag) ! local diagnostic variables for each HRU + type(var_info),save,public :: flux_meta(maxvarFlux) ! local model fluxes for each HRU + type(var_info),save,public :: deriv_meta(maxvarDeriv) ! local model derivatives for each HRU + type(var_info),save,public :: bpar_meta(maxvarBpar) ! basin parameters for aggregated processes + type(var_info),save,public :: bvar_meta(maxvarBvar) ! basin variables for aggregated processes + + ! ancillary metadata structures + type(flux2state), save,public :: flux2state_orig(maxvarFlux) ! named variables for the states affected by each flux (original) + type(flux2state), save,public :: flux2state_liq(maxvarFlux) ! named variables for the states affected by each flux (liquid water) + type(extended_info),save,public,allocatable :: averageFlux_meta(:) ! timestep-average model fluxes + + ! mapping from original to child structures + integer(i4b),save,public,allocatable :: forcChild_map(:) ! index of the child data structure: stats forc + integer(i4b),save,public,allocatable :: progChild_map(:) ! index of the child data structure: stats prog + integer(i4b),save,public,allocatable :: diagChild_map(:) ! index of the child data structure: stats diag + integer(i4b),save,public,allocatable :: fluxChild_map(:) ! index of the child data structure: stats flux + integer(i4b),save,public,allocatable :: indxChild_map(:) ! index of the child data structure: stats indx + integer(i4b),save,public,allocatable :: bvarChild_map(:) ! index of the child data structure: stats bvar + + ! child metadata structures + type(extended_info),save,public,allocatable :: statForc_meta(:) ! child metadata for stats + type(extended_info),save,public,allocatable :: statProg_meta(:) ! child metadata for stats + type(extended_info),save,public,allocatable :: statDiag_meta(:) ! child metadata for stats + type(extended_info),save,public,allocatable :: statFlux_meta(:) ! child metadata for stats + type(extended_info),save,public,allocatable :: statIndx_meta(:) ! child metadata for stats + type(extended_info),save,public,allocatable :: statBvar_meta(:) ! child metadata for stats + + ! ---------------------------------------------------------------------------------------------------------------- + ! * part 3: run time variables + ! ---------------------------------------------------------------------------------------------------------------- + + ! define the model decisions + type(model_options),save,public :: model_decisions(maxvarDecisions) ! the model decision structure + + ! define index variables describing the indices of the first and last HRUs in the forcing file + integer(i4b),save,public :: ixHRUfile_min ! minimum index + integer(i4b),save,public :: ixHRUfile_max ! maximum index + + ! define mapping structures + type(gru2hru_map),allocatable,save,public :: gru_struc(:) ! gru2hru map + type(hru2gru_map),allocatable,save,public :: index_map(:) ! hru2gru map + + ! define variables used for the vegetation phenology + real(rkind),dimension(12),save,public :: greenVegFrac_monthly ! fraction of green vegetation in each month (0-1) + + ! define the model output file + character(len=256),save,public :: fileout='' ! output filename + character(len=256),save,public :: output_fileSuffix='' ! suffix for the output file + + ! define controls on model output + type(ilength),allocatable,save,public :: outputTimeStep(:) ! timestep in output files + logical(lgt),dimension(maxvarFreq),save,public :: finalizeStats=.false. ! flags to reset statistics + integer(i4b),save,public :: maxLayers ! maximum number of layers + integer(i4b),save,public :: maxSnowLayers ! maximum number of snow layers + + ! define control variables + integer(i4b),save,public :: startGRU ! index of the starting GRU for parallelization run + integer(i4b),save,public :: checkHRU ! index of the HRU for a single HRU run + integer(i4b),save,public :: iRunMode ! define the current running mode + integer(i4b),save,public :: nThreads=1 ! number of threads + integer(i4b),save,public :: ixProgress=ixProgress_id ! define frequency to write progress + integer(i4b),save,public :: ixRestart=ixRestart_never ! define frequency to write restart files + integer(i4b),save,public :: newOutputFile=noNewFiles ! define option for new output files + + ! define common variables + integer(i4b),save,public :: numtim ! number of time steps + integer(i4b),save,public :: nHRUrun ! number of HRUs in the run domain + integer(i4b),save,public :: nGRUrun ! number of GRUs in the run domain + real(rkind),save,public :: data_step ! length of the time_step + real(rkind),save,public :: dJulianStart ! julian day of start time of simulation + real(rkind),save,public :: dJulianFinsh ! julian day of end time of simulation + real(rkind),save,public :: refJulday ! reference time in fractional julian days + real(rkind),save,public :: refJulday_data ! reference time in fractional julian days (data files) + integer(i4b),save,public :: nHRUfile ! number of HRUs in the file + integer(i4b),save,public :: urbanVegCategory ! vegetation category for urban areas + logical(lgt),save,public :: doJacobian=.false. ! flag to compute the Jacobian + logical(lgt),save,public :: globalPrintFlag=.false. ! flag to compute the Jacobian + integer(i4b),save,public :: chunksize=1024 ! chunk size for the netcdf read/write + integer(i4b),save,public :: outputPrecision=nf90_double ! variable type + + ! define result from the time calls + integer(i4b),dimension(8),save,public :: startInit,endInit ! date/time for the start and end of the initialization + integer(i4b),dimension(8),save,public :: startSetup,endSetup ! date/time for the start and end of the parameter setup + integer(i4b),dimension(8),save,public :: startRestart,endRestart ! date/time for the start and end to read restart data + integer(i4b),dimension(8),save,public :: startRead,endRead ! date/time for the start and end of the data read + integer(i4b),dimension(8),save,public :: startWrite,endWrite ! date/time for the start and end of the stats/write + integer(i4b),dimension(8),save,public :: startPhysics,endPhysics ! date/time for the start and end of the physics @@ -293,28 +293,28 @@ MODULE globalData type(var_i),save,public :: oldTime ! time for the previous model time step - ! output file information - logical(lgt),dimension(maxvarFreq),save,public :: outFreq ! true if the output frequency is desired - integer(i4b),dimension(maxvarFreq),save,public :: ncid ! netcdf output file id + ! output file information + logical(lgt),dimension(maxvarFreq),save,public :: outFreq ! true if the output frequency is desired + integer(i4b),dimension(maxvarFreq),save,public :: ncid ! netcdf output file id - ! look-up values for the choice of the time zone information (formerly in modelDecisions module) - integer(i4b),parameter,public :: ncTime=1 ! time zone information from NetCDF file (timeOffset = longitude/15. - ncTimeOffset) - integer(i4b),parameter,public :: utcTime=2 ! all times in UTC (timeOffset = longitude/15. hours) - integer(i4b),parameter,public :: localTime=3 ! all times local (timeOffset = 0) + ! look-up values for the choice of the time zone information (formerly in modelDecisions module) + integer(i4b),parameter,public :: ncTime=1 ! time zone information from NetCDF file (timeOffset = longitude/15. - ncTimeOffset) + integer(i4b),parameter,public :: utcTime=2 ! all times in UTC (timeOffset = longitude/15. hours) + integer(i4b),parameter,public :: localTime=3 ! all times local (timeOffset = 0) - !!!!!!!!!!!!!!!!!!GLOBAL DATA STRUCTURES THAT ARE MANAGED BY FILEACCESSACTOR !!!!!!!!!!!!!!!!!!!!!!!!!!!!! - type(var_forc),allocatable,save,public :: forcingDataStruct(:) ! forcingDataStruct(:)%var(:)%dataFromFile(:,:) - type(dlength),allocatable,save,public :: vecTime(:) - type(summa_output_type),allocatable,save,public :: outputStructure(:) ! summa_OutputStructure(iFile)%struc%var(:)%dat(nTimeSteps) - !!!!!!!!!!!!!!!!!!GLOBAL DATA STRUCTURES THAT ARE MANAGED BY FILEACCESSACTOR !!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !!!!!!!!!!!!!!!!!!GLOBAL DATA STRUCTURES THAT ARE MANAGED BY FILEACCESSACTOR !!!!!!!!!!!!!!!!!!!!!!!!!!!!! + type(var_forc),allocatable,save,public :: forcingDataStruct(:) ! forcingDataStruct(:)%var(:)%dataFromFile(:,:) + type(dlength),allocatable,save,public :: vecTime(:) + type(summa_output_type),allocatable,save,public :: outputStructure(:) ! summa_OutputStructure(iFile)%struc%var(:)%dat(nTimeSteps) + !!!!!!!!!!!!!!!!!!GLOBAL DATA STRUCTURES THAT ARE MANAGED BY FILEACCESSACTOR !!!!!!!!!!!!!!!!!!!!!!!!!!!!! - ! define fixed dimensions - integer(i4b),parameter,public :: nBand=2 ! number of spectral bands - integer(i4b),parameter,public :: nTimeDelay=2000 ! number of hours in the time delay histogram (default: ~1 season = 24*365/4) + ! define fixed dimensions + integer(i4b),parameter,public :: nBand=2 ! number of spectral bands + integer(i4b),parameter,public :: nTimeDelay=2000 ! number of hours in the time delay histogram (default: ~1 season = 24*365/4) - character(len=1024),public,save :: fname ! temporary filename + character(len=1024),public,save :: fname ! temporary filename END MODULE globalData diff --git a/build/source/dshare/popMetadat.f90 b/build/source/dshare/popMetadat.f90 index 76775ef2363daf07ffafa28d4c2f69709749ee3a..cec88e3ff6837115d4fa9834452595d86dd3de2a 100755 --- a/build/source/dshare/popMetadat.f90 +++ b/build/source/dshare/popMetadat.f90 @@ -15,1002 +15,1001 @@ private public::popMetadat contains - subroutine popMetadat(err,message) - ! data structures - USE data_types, only: var_info ! data type for metadata structure - USE globalData, only: time_meta ! data structure for time metadata - USE globalData, only: forc_meta ! data structure for forcing metadata - USE globalData, only: type_meta ! data structure for categorical metadata - USE globalData, only: id_meta ! data structure for hru and gru ID metadata - USE globalData, only: attr_meta ! data structure for attribute metadata - USE globalData, only: mpar_meta ! data structure for local parameter metadata - USE globalData, only: bpar_meta ! data structure for basin parameter metadata - USE globalData, only: bvar_meta ! data structure for basin model variable metadata - USE globalData, only: indx_meta ! data structure for index metadata - USE globalData, only: prog_meta ! data structure for local prognostic (state) variables - USE globalData, only: diag_meta ! data structure for local diagnostic variables - USE globalData, only: flux_meta ! data structure for local flux variables - USE globalData, only: deriv_meta ! data structure for local flux derivatives - ! structures of named variables - USE var_lookup, only: iLookTIME ! named variables for time data structure - USE var_lookup, only: iLookFORCE ! named variables for forcing data structure - USE var_lookup, only: iLookTYPE ! named variables for categorical attribute data structure - USE var_lookup, only: iLookID ! named variables for hru and gru ID metadata - USE var_lookup, only: iLookATTR ! named variables for real valued attribute data structure - USE var_lookup, only: iLookPARAM ! named variables for local parameter data structure - USE var_lookup, only: iLookBPAR ! named variables for basin parameter data structure - USE var_lookup, only: iLookBVAR ! named variables for basin model variable data structure - USE var_lookup, only: iLookINDEX ! named variables for index variable data structure - USE var_lookup, only: iLookPROG ! named variables for local state variables - USE var_lookup, only: iLookDIAG ! named variables for local diagnostic variables - USE var_lookup, only: iLookFLUX ! named variables for local flux variables - USE var_lookup, only: iLookDERIV ! named variables for local flux derivatives - USE var_lookup, only: maxvarFreq ! number of output frequencies - USE var_lookup, only: maxvarStat ! number of statistics - USE get_ixName_module,only:get_ixVarType ! to turn vartype strings to integers - implicit none - ! dummy variables - integer(i4b),intent(out) :: err ! error code - character(*),intent(out) :: message ! error message - ! internals - character(256) :: cmessage ! error message - integer,dimension(maxVarFreq) :: iMissVec ! vector of missing integers - ! initialize error control - err=0; message='popMetadat/' - - ! init arrays for structure constructors - iMissVec(:) = integerMissing - ! ----- - ! * model time structures... - ! -------------------------- - time_meta(iLookTIME%iyyy) = var_info('iyyy' , 'year' , '-', get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - time_meta(iLookTIME%im) = var_info('im' , 'month' , '-', get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - time_meta(iLookTIME%id) = var_info('id' , 'day' , '-', get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - time_meta(iLookTIME%ih) = var_info('ih' , 'hour' , '-', get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - time_meta(iLookTIME%imin) = var_info('imin' , 'minute' , '-', get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - time_meta(iLookTIME%ih_tz) = var_info('ih_tz' , 'hour for time zone offset' , '-', get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - time_meta(iLookTIME%imin_tz) = var_info('imin_tz', 'minute for time zone offset', '-', get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - - ! ----- - ! * model forcing data... - ! ----------------------- - forc_meta(iLookFORCE%time) = var_info('time' , 'time since time reference' , 'seconds since 1990-1-1 0:0:0.0 -0:00', get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - forc_meta(iLookFORCE%pptrate) = var_info('pptrate' , 'precipitation rate' , 'kg m-2 s-1' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - forc_meta(iLookFORCE%SWRadAtm) = var_info('SWRadAtm', 'downward shortwave radiation at the upper boundary', 'W m-2' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - forc_meta(iLookFORCE%LWRadAtm) = var_info('LWRadAtm', 'downward longwave radiation at the upper boundary' , 'W m-2' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - forc_meta(iLookFORCE%airtemp) = var_info('airtemp' , 'air temperature at the measurement height' , 'K' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - forc_meta(iLookFORCE%windspd) = var_info('windspd' , 'wind speed at the measurement height' , 'm s-1' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - forc_meta(iLookFORCE%airpres) = var_info('airpres' , 'air pressure at the the measurement height' , 'Pa' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - forc_meta(iLookFORCE%spechum) = var_info('spechum' , 'specific humidity at the measurement height' , 'g g-1' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - - ! ----- - ! * categorical data... - ! --------------------- - type_meta(iLookTYPE%vegTypeIndex) = var_info('vegTypeIndex' , 'index defining vegetation type' , '-', get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - type_meta(iLookTYPE%soilTypeIndex) = var_info('soilTypeIndex' , 'index defining soil type' , '-', get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - type_meta(iLookTYPE%slopeTypeIndex) = var_info('slopeTypeIndex', 'index defining slope' , '-', get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - type_meta(iLookTYPE%downHRUindex) = var_info('downHRUindex' , 'index of downslope HRU (0 = basin outlet)' , '-', get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - type_meta(iLookTYPE%downkHRU) = var_info('downkHRU' , 'real index of downslope HRU' , '-', get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - ! ----- - ! * hru and gru ID data... - ! --------------------- - id_meta(iLookID%hruId) = var_info('hruId' , 'ID defining the hydrologic response unit' , '-', get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - - ! ----- - ! * site characteristics... - ! ------------------------- - attr_meta(iLookATTR%latitude) = var_info('latitude' , 'latitude' , 'degrees north', get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - attr_meta(iLookATTR%longitude) = var_info('longitude' , 'longitude' , 'degrees east' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - attr_meta(iLookATTR%elevation) = var_info('elevation' , 'elevation' , 'm' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - attr_meta(iLookATTR%tan_slope) = var_info('tan_slope' , 'tan water table slope (tan local ground surface slope)', '-' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - attr_meta(iLookATTR%contourLength) = var_info('contourLength' , 'length of contour at downslope edge of HRU' , 'm' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - attr_meta(iLookATTR%HRUarea) = var_info('HRUarea' , 'area of each HRU' , 'm2' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - attr_meta(iLookATTR%mHeight) = var_info('mHeight' , 'measurement height above bare ground' , 'm' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - attr_meta(iLookATTR%aspect) = var_info('aspect' , 'mean azimuth of HRU in degrees East of North (0)' , 'degrees' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - ! ----- - ! * local parameter data... - ! ------------------------- - ! boundary conditions - mpar_meta(iLookPARAM%upperBoundHead) = var_info('upperBoundHead' , 'matric head at the upper boundary' , 'm' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - mpar_meta(iLookPARAM%lowerBoundHead) = var_info('lowerBoundHead' , 'matric head at the lower boundary' , 'm' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - mpar_meta(iLookPARAM%upperBoundTheta) = var_info('upperBoundTheta' , 'volumetric liquid water content at the upper boundary' , '-' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - mpar_meta(iLookPARAM%lowerBoundTheta) = var_info('lowerBoundTheta' , 'volumetric liquid water content at the lower boundary' , '-' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - mpar_meta(iLookPARAM%upperBoundTemp) = var_info('upperBoundTemp' , 'temperature of the upper boundary' , 'K' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - mpar_meta(iLookPARAM%lowerBoundTemp) = var_info('lowerBoundTemp' , 'temperature of the lower boundary' , 'K' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - ! precipitation partitioning - mpar_meta(iLookPARAM%tempCritRain) = var_info('tempCritRain' , 'critical temperature where precipitation is rain' , 'K' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - mpar_meta(iLookPARAM%tempRangeTimestep) = var_info('tempRangeTimestep' , 'temperature range over the time step' , 'K' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - mpar_meta(iLookPARAM%frozenPrecipMultip) = var_info('frozenPrecipMultip' , 'frozen precipitation multiplier' , '-' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - ! snow properties - mpar_meta(iLookPARAM%snowfrz_scale) = var_info('snowfrz_scale' , 'scaling parameter for the freezing curve for snow' , 'K-1' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - mpar_meta(iLookPARAM%fixedThermalCond_snow) = var_info('fixedThermalCond_snow' , 'temporally constant thermal conductivity for snow' , 'W m-1 K-1' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - ! snow albedo - mpar_meta(iLookPARAM%albedoMax) = var_info('albedoMax' , 'maximum snow albedo (single spectral band)' , '-' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - mpar_meta(iLookPARAM%albedoMinWinter) = var_info('albedoMinWinter' , 'minimum snow albedo during winter (single spectral band)' , '-' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - mpar_meta(iLookPARAM%albedoMinSpring) = var_info('albedoMinSpring' , 'minimum snow albedo during spring (single spectral band)' , '-' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - mpar_meta(iLookPARAM%albedoMaxVisible) = var_info('albedoMaxVisible' , 'maximum snow albedo in the visible part of the spectrum' , '-' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - mpar_meta(iLookPARAM%albedoMinVisible) = var_info('albedoMinVisible' , 'minimum snow albedo in the visible part of the spectrum' , '-' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - mpar_meta(iLookPARAM%albedoMaxNearIR) = var_info('albedoMaxNearIR' , 'maximum snow albedo in the near infra-red part of the spectrum' , '-' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - mpar_meta(iLookPARAM%albedoMinNearIR) = var_info('albedoMinNearIR' , 'minimum snow albedo in the near infra-red part of the spectrum' , '-' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - mpar_meta(iLookPARAM%albedoDecayRate) = var_info('albedoDecayRate' , 'albedo decay rate' , 's' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - mpar_meta(iLookPARAM%albedoSootLoad) = var_info('albedoSootLoad' , 'soot load factor' , '-' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - mpar_meta(iLookPARAM%albedoRefresh) = var_info('albedoRefresh' , 'critical mass necessary for albedo refreshment' , 'kg m-2' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - ! radiation transfer - mpar_meta(iLookPARAM%radExt_snow) = var_info('radExt_snow' , 'extinction coefficient for radiation penetration into snowpack' , 'm-1' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - mpar_meta(iLookPARAM%directScale) = var_info('directScale' , 'scaling factor for fractional driect radiaion parameterization' , '-' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - mpar_meta(iLookPARAM%Frad_direct) = var_info('Frad_direct' , 'fraction direct solar radiation' , '-' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - mpar_meta(iLookPARAM%Frad_vis) = var_info('Frad_vis' , 'fraction radiation in visible part of spectrum' , '-' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - ! new snow density - mpar_meta(iLookPARAM%newSnowDenMin) = var_info('newSnowDenMin' , 'minimum new snow density' , 'kg m-3' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - mpar_meta(iLookPARAM%newSnowDenMult) = var_info('newSnowDenMult' , 'multiplier for new snow density' , 'kg m-3' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - mpar_meta(iLookPARAM%newSnowDenScal) = var_info('newSnowDenScal' , 'scaling factor for new snow density' , 'K' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - mpar_meta(iLookPARAM%constSnowDen) = var_info('constSnowDen' , 'Constant new snow density' , 'kg m-3' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - mpar_meta(iLookPARAM%newSnowDenAdd) = var_info('newSnowDenAdd' , 'Pahaut 1976, additive factor for new snow density' , 'kg m-3' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - mpar_meta(iLookPARAM%newSnowDenMultTemp) = var_info('newSnowDenMultTemp' , 'Pahaut 1976, multiplier for new snow density for air temperature' , 'kg m-3 K-1' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - mpar_meta(iLookPARAM%newSnowDenMultWind) = var_info('newSnowDenMultWind' , 'Pahaut 1976, multiplier for new snow density for wind speed' , 'kg m-7/2 s-1/2' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - mpar_meta(iLookPARAM%newSnowDenMultAnd) = var_info('newSnowDenMultAnd' , 'Anderson 1976, multiplier for new snow density (Anderson func)' , 'K-1' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - mpar_meta(iLookPARAM%newSnowDenBase) = var_info('newSnowDenBase' , 'Anderson 1976, base value that is rasied to the (3/2) power' , 'K' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - ! snow compaction - mpar_meta(iLookPARAM%densScalGrowth) = var_info('densScalGrowth' , 'density scaling factor for grain growth' , 'kg-1 m3' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - mpar_meta(iLookPARAM%tempScalGrowth) = var_info('tempScalGrowth' , 'temperature scaling factor for grain growth' , 'K-1' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - mpar_meta(iLookPARAM%grainGrowthRate) = var_info('grainGrowthRate' , 'rate of grain growth' , 's-1' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - mpar_meta(iLookPARAM%densScalOvrbdn) = var_info('densScalOvrbdn' , 'density scaling factor for overburden pressure' , 'kg-1 m3' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - mpar_meta(iLookPARAM%tempScalOvrbdn) = var_info('tempScalOvrbdn' , 'temperature scaling factor for overburden pressure' , 'K-1' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - mpar_meta(iLookPARAM%baseViscosity ) = var_info('baseViscosity ' , 'viscosity coefficient at T=T_frz and snow density=0' , 'kg s m-2' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - ! water flow through snow - mpar_meta(iLookPARAM%Fcapil) = var_info('Fcapil' , 'capillary retention (fraction of total pore volume)' , '-' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - mpar_meta(iLookPARAM%k_snow) = var_info('k_snow' , 'hydraulic conductivity of snow' , 'm s-1' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - mpar_meta(iLookPARAM%mw_exp) = var_info('mw_exp' , 'exponent for meltwater flow' , '-' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - ! turbulent heat fluxes - mpar_meta(iLookPARAM%z0Snow) = var_info('z0Snow' , 'roughness length of snow' , 'm' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - mpar_meta(iLookPARAM%z0Soil) = var_info('z0Soil' , 'roughness length of bare soil below the canopy' , 'm' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - mpar_meta(iLookPARAM%z0Canopy) = var_info('z0Canopy' , 'roughness length of the canopy' , 'm' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - mpar_meta(iLookPARAM%zpdFraction) = var_info('zpdFraction' , 'zero plane displacement / canopy height' , '-' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - mpar_meta(iLookPARAM%critRichNumber) = var_info('critRichNumber' , 'critical value for the bulk Richardson number' , '-' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - mpar_meta(iLookPARAM%Louis79_bparam) = var_info('Louis79_bparam' , 'parameter in Louis (1979) stability function' , '-' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - mpar_meta(iLookPARAM%Louis79_cStar) = var_info('Louis79_cStar' , 'parameter in Louis (1979) stability function' , '-' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - mpar_meta(iLookPARAM%Mahrt87_eScale) = var_info('Mahrt87_eScale' , 'exponential scaling factor in the Mahrt (1987) stability function', '-' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - mpar_meta(iLookPARAM%leafExchangeCoeff) = var_info('leafExchangeCoeff' , 'turbulent exchange coeff between canopy surface and canopy air' , 'm s-(1/2)' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - mpar_meta(iLookPARAM%windReductionParam) = var_info('windReductionParam' , 'canopy wind reduction parameter' , '-' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - ! stomatal conductance - mpar_meta(iLookPARAM%Kc25) = var_info('Kc25' , 'Michaelis-Menten constant for CO2 at 25 degrees C' , 'umol mol-1' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - mpar_meta(iLookPARAM%Ko25) = var_info('Ko25' , 'Michaelis-Menten constant for O2 at 25 degrees C' , 'mol mol-1' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - mpar_meta(iLookPARAM%Kc_qFac) = var_info('Kc_qFac' , 'factor in the q10 function defining temperature controls on Kc' , '-' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - mpar_meta(iLookPARAM%Ko_qFac) = var_info('Ko_qFac' , 'factor in the q10 function defining temperature controls on Ko' , '-' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - mpar_meta(iLookPARAM%kc_Ha) = var_info('kc_Ha' , 'activation energy for the Michaelis-Menten constant for CO2' , 'J mol-1' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - mpar_meta(iLookPARAM%ko_Ha) = var_info('ko_Ha' , 'activation energy for the Michaelis-Menten constant for O2' , 'J mol-1' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - mpar_meta(iLookPARAM%vcmax25_canopyTop) = var_info('vcmax25_canopyTop' , 'potential carboxylation rate at 25 degrees C at the canopy top' , 'umol co2 m-2 s-1', get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - mpar_meta(iLookPARAM%vcmax_qFac) = var_info('vcmax_qFac' , 'factor in the q10 function defining temperature controls on vcmax', '-' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - mpar_meta(iLookPARAM%vcmax_Ha) = var_info('vcmax_Ha' , 'activation energy in the vcmax function' , 'J mol-1' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - mpar_meta(iLookPARAM%vcmax_Hd) = var_info('vcmax_Hd' , 'deactivation energy in the vcmax function' , 'J mol-1' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - mpar_meta(iLookPARAM%vcmax_Sv) = var_info('vcmax_Sv' , 'entropy term in the vcmax function' , 'J mol-1 K-1' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - mpar_meta(iLookPARAM%vcmax_Kn) = var_info('vcmax_Kn' , 'foliage nitrogen decay coefficient' , '-' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - mpar_meta(iLookPARAM%jmax25_scale) = var_info('jmax25_scale' , 'scaling factor to relate jmax25 to vcmax25' , '-' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - mpar_meta(iLookPARAM%jmax_Ha) = var_info('jmax_Ha' , 'activation energy in the jmax function' , 'J mol-1' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - mpar_meta(iLookPARAM%jmax_Hd) = var_info('jmax_Hd' , 'deactivation energy in the jmax function' , 'J mol-1' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - mpar_meta(iLookPARAM%jmax_Sv) = var_info('jmax_Sv' , 'entropy term in the jmax function' , 'J mol-1 K-1' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - mpar_meta(iLookPARAM%fractionJ) = var_info('fractionJ' , 'fraction of light lost by other than the chloroplast lamellae' , '-' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - mpar_meta(iLookPARAM%quantamYield) = var_info('quantamYield' , 'quantam yield' , 'mol e mol-1 q' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - mpar_meta(iLookPARAM%vpScaleFactor) = var_info('vpScaleFactor' , 'vapor pressure scaling factor in stomatal conductance function' , 'Pa' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - mpar_meta(iLookPARAM%cond2photo_slope) = var_info('cond2photo_slope' , 'slope of conductance-photosynthesis relationship' , '-' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - mpar_meta(iLookPARAM%minStomatalConductance)= var_info('minStomatalConductance', 'minimum stomatal conductance' , 'umol H2O m-2 s-1', get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - ! vegetation properties - mpar_meta(iLookPARAM%winterSAI) = var_info('winterSAI' , 'stem area index prior to the start of the growing season' , 'm2 m-2' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - mpar_meta(iLookPARAM%summerLAI) = var_info('summerLAI' , 'maximum leaf area index at the peak of the growing season' , 'm2 m-2' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - mpar_meta(iLookPARAM%rootScaleFactor1) = var_info('rootScaleFactor1' , '1st scaling factor (a) in Y = 1 - 0.5*( exp(-aZ) + exp(-bZ) )' , 'm-1' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - mpar_meta(iLookPARAM%rootScaleFactor2) = var_info('rootScaleFactor2' , '2nd scaling factor (b) in Y = 1 - 0.5*( exp(-aZ) + exp(-bZ) )' , 'm-1' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - mpar_meta(iLookPARAM%rootingDepth) = var_info('rootingDepth' , 'rooting depth' , 'm' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - mpar_meta(iLookPARAM%rootDistExp) = var_info('rootDistExp' , 'exponent for the vertical distribution of root density' , '-' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - mpar_meta(iLookPARAM%plantWiltPsi) = var_info('plantWiltPsi' , 'matric head at wilting point' , 'm' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - mpar_meta(iLookPARAM%soilStressParam) = var_info('soilStressParam' , 'parameter in the exponential soil stress function' , '-' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - mpar_meta(iLookPARAM%critSoilWilting) = var_info('critSoilWilting' , 'critical vol. liq. water content when plants are wilting' , '-' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - mpar_meta(iLookPARAM%critSoilTranspire) = var_info('critSoilTranspire' , 'critical vol. liq. water content when transpiration is limited' , '-' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - mpar_meta(iLookPARAM%critAquiferTranspire) = var_info('critAquiferTranspire' , 'critical aquifer storage value when transpiration is limited' , 'm' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - mpar_meta(iLookPARAM%minStomatalResistance) = var_info('minStomatalResistance' , 'minimum stomatal resistance' , 's m-1' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - mpar_meta(iLookPARAM%leafDimension) = var_info('leafDimension' , 'characteristic leaf dimension' , 'm' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - mpar_meta(iLookPARAM%heightCanopyTop) = var_info('heightCanopyTop' , 'height of top of the vegetation canopy above ground surface' , 'm' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - mpar_meta(iLookPARAM%heightCanopyBottom) = var_info('heightCanopyBottom' , 'height of bottom of the vegetation canopy above ground surface' , 'm' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - mpar_meta(iLookPARAM%specificHeatVeg) = var_info('specificHeatVeg' , 'specific heat of vegetation' , 'J kg-1 K-1' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - mpar_meta(iLookPARAM%maxMassVegetation) = var_info('maxMassVegetation' , 'maximum mass of vegetation (full foliage)' , 'kg m-2' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - mpar_meta(iLookPARAM%throughfallScaleSnow) = var_info('throughfallScaleSnow' , 'scaling factor for throughfall (snow)' , '-' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - mpar_meta(iLookPARAM%throughfallScaleRain) = var_info('throughfallScaleRain' , 'scaling factor for throughfall (rain)' , '-' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - mpar_meta(iLookPARAM%refInterceptCapSnow) = var_info('refInterceptCapSnow' , 'reference canopy interception capacity per unit leaf area (snow)' , 'kg m-2' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - mpar_meta(iLookPARAM%refInterceptCapRain) = var_info('refInterceptCapRain' , 'canopy interception capacity per unit leaf area (rain)' , 'kg m-2' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - mpar_meta(iLookPARAM%snowUnloadingCoeff) = var_info('snowUnloadingCoeff' , 'time constant for unloading of snow from the forest canopy' , 's-1' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - mpar_meta(iLookPARAM%canopyDrainageCoeff) = var_info('canopyDrainageCoeff' , 'time constant for drainage of liquid water from the forest canopy', 's-1' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - mpar_meta(iLookPARAM%ratioDrip2Unloading) = var_info('ratioDrip2Unloading' , 'ratio of canopy drip to unloading of snow from the forest canopy' , '-' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - mpar_meta(iLookPARAM%canopyWettingFactor) = var_info('canopyWettingFactor' , 'maximum wetted fraction of the canopy' , '-' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - mpar_meta(iLookPARAM%canopyWettingExp) = var_info('canopyWettingExp' , 'exponent in canopy wetting function' , '-' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - mpar_meta(iLookPARAM%minTempUnloading) = var_info('minTempUnloading' , 'min temp for unloading in windySnow' , 'K' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - mpar_meta(iLookPARAM%rateTempUnloading) = var_info('rateTempUnloading' , 'how quickly to unload due to temperature' , 'K s' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - mpar_meta(iLookPARAM%minWindUnloading) = var_info('minWindUnloading' , 'min wind speed for unloading in windySnow' , 'm s-1' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - mpar_meta(iLookPARAM%rateWindUnloading) = var_info('rateWindUnloading' , 'how quickly to unload due to wind' , 'm' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - ! soil properties - mpar_meta(iLookPARAM%soil_dens_intr) = var_info('soil_dens_intr' , 'intrinsic soil density' , 'kg m-3' , get_ixVarType('parSoil'), iMissVec, iMissVec, .false.) - mpar_meta(iLookPARAM%thCond_soil) = var_info('thCond_soil' , 'thermal conductivity of soil (includes quartz and other minerals)', 'W m-1 K-1' , get_ixVarType('parSoil'), iMissVec, iMissVec, .false.) - mpar_meta(iLookPARAM%frac_sand) = var_info('frac_sand' , 'fraction of sand' , '-' , get_ixVarType('parSoil'), iMissVec, iMissVec, .false.) - mpar_meta(iLookPARAM%frac_silt) = var_info('frac_silt' , 'fraction of silt' , '-' , get_ixVarType('parSoil'), iMissVec, iMissVec, .false.) - mpar_meta(iLookPARAM%frac_clay) = var_info('frac_clay' , 'fraction of clay' , '-' , get_ixVarType('parSoil'), iMissVec, iMissVec, .false.) - mpar_meta(iLookPARAM%theta_sat) = var_info('theta_sat' , 'soil porosity' , '-' , get_ixVarType('parSoil'), iMissVec, iMissVec, .false.) - mpar_meta(iLookPARAM%theta_res) = var_info('theta_res' , 'volumetric residual water content' , '-' , get_ixVarType('parSoil'), iMissVec, iMissVec, .false.) - mpar_meta(iLookPARAM%vGn_alpha) = var_info('vGn_alpha' , 'van Genuchten "alpha" parameter' , 'm-1' , get_ixVarType('parSoil'), iMissVec, iMissVec, .false.) - mpar_meta(iLookPARAM%vGn_n) = var_info('vGn_n' , 'van Genuchten "n" parameter' , '-' , get_ixVarType('parSoil'), iMissVec, iMissVec, .false.) - mpar_meta(iLookPARAM%k_soil) = var_info('k_soil' , 'saturated hydraulic conductivity' , 'm s-1' , get_ixVarType('parSoil'), iMissVec, iMissVec, .false.) - mpar_meta(iLookPARAM%k_macropore) = var_info('k_macropore' , 'saturated hydraulic conductivity for macropores' , 'm s-1' , get_ixVarType('parSoil'), iMissVec, iMissVec, .false.) - ! scalar soil properties - mpar_meta(iLookPARAM%fieldCapacity) = var_info('fieldCapacity' , 'soil field capacity (vol liq water content when baseflow begins)' , '-' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - mpar_meta(iLookPARAM%wettingFrontSuction) = var_info('wettingFrontSuction' , 'Green-Ampt wetting front suction' , 'm' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - mpar_meta(iLookPARAM%theta_mp) = var_info('theta_mp' , 'volumetric liquid water content when macropore flow begins' , '-' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - mpar_meta(iLookPARAM%mpExp) = var_info('mpExp' , 'empirical exponent in macropore flow equation' , '-' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - mpar_meta(iLookPARAM%kAnisotropic) = var_info('kAnisotropic' , 'anisotropy factor for lateral hydraulic conductivity' , '-' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - mpar_meta(iLookPARAM%zScale_TOPMODEL) = var_info('zScale_TOPMODEL' , 'TOPMODEL scaling factor used in lower boundary condition for soil', 'm' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - mpar_meta(iLookPARAM%compactedDepth) = var_info('compactedDepth' , 'depth where k_soil reaches the compacted value given by CH78' , 'm' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - mpar_meta(iLookPARAM%aquiferBaseflowRate) = var_info('aquiferBaseflowRate' , 'baseflow rate when aquifer storage = aquiferScaleFactor' , 'm s-1' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - mpar_meta(iLookPARAM%aquiferScaleFactor) = var_info('aquiferScaleFactor' , 'scaling factor for aquifer storage in the big bucket' , 'm' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - mpar_meta(iLookPARAM%aquiferBaseflowExp) = var_info('aquiferBaseflowExp' , 'baseflow exponent' , '-' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - mpar_meta(iLookPARAM%qSurfScale) = var_info('qSurfScale' , 'scaling factor in the surface runoff parameterization' , '-' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - mpar_meta(iLookPARAM%specificYield) = var_info('specificYield' , 'specific yield' , '-' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - mpar_meta(iLookPARAM%specificStorage) = var_info('specificStorage' , 'specific storage coefficient' , 'm-1' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - mpar_meta(iLookPARAM%f_impede) = var_info('f_impede' , 'ice impedence factor' , '-' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - mpar_meta(iLookPARAM%soilIceScale) = var_info('soilIceScale' , 'scaling factor for depth of soil ice, used to get frozen fraction', 'm' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - mpar_meta(iLookPARAM%soilIceCV) = var_info('soilIceCV' , 'CV of depth of soil ice, used to get frozen fraction' , '-' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - ! algorithmic control parameters - mpar_meta(iLookPARAM%minwind) = var_info('minwind' , 'minimum wind speed' , 'm s-1' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - mpar_meta(iLookPARAM%minstep) = var_info('minstep' , 'minimum length of the time step' , 's' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - mpar_meta(iLookPARAM%maxstep) = var_info('maxstep' , 'maximum length of the time step' , 's' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - mpar_meta(iLookPARAM%wimplicit) = var_info('wimplicit' , 'weight assigned to the start-of-step fluxes (alpha)' , '-' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - mpar_meta(iLookPARAM%maxiter) = var_info('maxiter' , 'maximum number of iterations' , '-' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - mpar_meta(iLookPARAM%relConvTol_liquid) = var_info('relConvTol_liquid' , 'relative convergence tolerance for vol frac liq water' , '-' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - mpar_meta(iLookPARAM%absConvTol_liquid) = var_info('absConvTol_liquid' , 'absolute convergence tolerance for vol frac liq water' , '-' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - mpar_meta(iLookPARAM%relConvTol_matric) = var_info('relConvTol_matric' , 'relative convergence tolerance for matric head' , '-' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - mpar_meta(iLookPARAM%absConvTol_matric) = var_info('absConvTol_matric' , 'absolute convergence tolerance for matric head' , 'm' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - mpar_meta(iLookPARAM%relConvTol_energy) = var_info('relConvTol_energy' , 'relative convergence tolerance for energy' , '-' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - mpar_meta(iLookPARAM%absConvTol_energy) = var_info('absConvTol_energy' , 'absolute convergence tolerance for energy' , 'J m-3' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - mpar_meta(iLookPARAM%relConvTol_aquifr) = var_info('relConvTol_aquifr' , 'relative convergence tolerance for aquifer storage' , '-' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - mpar_meta(iLookPARAM%absConvTol_aquifr) = var_info('absConvTol_aquifr' , 'absolute convergence tolerance for aquifer storage' , 'm' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - mpar_meta(iLookPARAM%zmin) = var_info('zmin' , 'minimum layer depth' , 'm' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - mpar_meta(iLookPARAM%zmax) = var_info('zmax' , 'maximum layer depth' , 'm' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - mpar_meta(iLookPARAM%zminLayer1) = var_info('zminLayer1' , 'minimum layer depth for the 1st (top) layer' , 'm' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - mpar_meta(iLookPARAM%zminLayer2) = var_info('zminLayer2' , 'minimum layer depth for the 2nd layer' , 'm' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - mpar_meta(iLookPARAM%zminLayer3) = var_info('zminLayer3' , 'minimum layer depth for the 3rd layer' , 'm' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - mpar_meta(iLookPARAM%zminLayer4) = var_info('zminLayer4' , 'minimum layer depth for the 4th layer' , 'm' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - mpar_meta(iLookPARAM%zminLayer5) = var_info('zminLayer5' , 'minimum layer depth for the 5th (bottom) layer' , 'm' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - mpar_meta(iLookPARAM%zmaxLayer1_lower) = var_info('zmaxLayer1_lower' , 'maximum layer depth for the 1st (top) layer when only 1 layer' , 'm' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - mpar_meta(iLookPARAM%zmaxLayer2_lower) = var_info('zmaxLayer2_lower' , 'maximum layer depth for the 2nd layer when only 2 layers' , 'm' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - mpar_meta(iLookPARAM%zmaxLayer3_lower) = var_info('zmaxLayer3_lower' , 'maximum layer depth for the 3rd layer when only 3 layers' , 'm' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - mpar_meta(iLookPARAM%zmaxLayer4_lower) = var_info('zmaxLayer4_lower' , 'maximum layer depth for the 4th layer when only 4 layers' , 'm' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - mpar_meta(iLookPARAM%zmaxLayer1_upper) = var_info('zmaxLayer1_upper' , 'maximum layer depth for the 1st (top) layer when > 1 layer' , 'm' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - mpar_meta(iLookPARAM%zmaxLayer2_upper) = var_info('zmaxLayer2_upper' , 'maximum layer depth for the 2nd layer when > 2 layers' , 'm' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - mpar_meta(iLookPARAM%zmaxLayer3_upper) = var_info('zmaxLayer3_upper' , 'maximum layer depth for the 3rd layer when > 3 layers' , 'm' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - mpar_meta(iLookPARAM%zmaxLayer4_upper) = var_info('zmaxLayer4_upper' , 'maximum layer depth for the 4th layer when > 4 layers' , 'm' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - - ! ----- - ! * basin parameter data... - ! ------------------------- - bpar_meta(iLookBPAR%basin__aquiferHydCond) = var_info('basin__aquiferHydCond' , 'hydraulic conductivity of the aquifer' , 'm s-1', get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - bpar_meta(iLookBPAR%basin__aquiferScaleFactor) = var_info('basin__aquiferScaleFactor', 'scaling factor for aquifer storage in the big bucket' , 'm' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - bpar_meta(iLookBPAR%basin__aquiferBaseflowExp) = var_info('basin__aquiferBaseflowExp', 'baseflow exponent for the big bucket' , '-' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - bpar_meta(iLookBPAR%routingGammaShape) = var_info('routingGammaShape' , 'shape parameter in Gamma distribution used for sub-grid routing', '-' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - bpar_meta(iLookBPAR%routingGammaScale) = var_info('routingGammaScale' , 'scale parameter in Gamma distribution used for sub-grid routing', 's' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - - ! ----- - ! * local model prognostic (state) variables... - ! --------------------------------------------- - ! define variables for time stepping - prog_meta(iLookPROG%dt_init) = var_info('dt_init' , 'length of initial time step at start of next data interval' , 's' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - ! state variables for vegetation - prog_meta(iLookPROG%scalarCanopyIce) = var_info('scalarCanopyIce' , 'mass of ice on the vegetation canopy' , 'kg m-2' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - prog_meta(iLookPROG%scalarCanopyLiq) = var_info('scalarCanopyLiq' , 'mass of liquid water on the vegetation canopy' , 'kg m-2' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - prog_meta(iLookPROG%scalarCanopyWat) = var_info('scalarCanopyWat' , 'mass of total water on the vegetation canopy' , 'kg m-2' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - prog_meta(iLookPROG%scalarCanairTemp) = var_info('scalarCanairTemp' , 'temperature of the canopy air space' , 'K' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - prog_meta(iLookPROG%scalarCanopyTemp) = var_info('scalarCanopyTemp' , 'temperature of the vegetation canopy' , 'K' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - ! state variables for snow - prog_meta(iLookPROG%spectralSnowAlbedoDiffuse) = var_info('spectralSnowAlbedoDiffuse' , 'diffuse snow albedo for individual spectral bands' , '-' , get_ixVarType('wLength'), iMissVec, iMissVec, .false.) - prog_meta(iLookPROG%scalarSnowAlbedo) = var_info('scalarSnowAlbedo' , 'snow albedo for the entire spectral band' , '-' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - prog_meta(iLookPROG%scalarSnowDepth) = var_info('scalarSnowDepth' , 'total snow depth' , 'm' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - prog_meta(iLookPROG%scalarSWE) = var_info('scalarSWE' , 'snow water equivalent' , 'kg m-2' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - prog_meta(iLookPROG%scalarSfcMeltPond) = var_info('scalarSfcMeltPond' , 'ponded water caused by melt of the "snow without a layer"' , 'kg m-2' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - ! define state variables for the snow+soil domain - prog_meta(iLookPROG%mLayerTemp) = var_info('mLayerTemp' , 'temperature of each layer' , 'K' , get_ixVarType('midToto'), iMissVec, iMissVec, .false.) - prog_meta(iLookPROG%mLayerVolFracIce) = var_info('mLayerVolFracIce' , 'volumetric fraction of ice in each layer' , '-' , get_ixVarType('midToto'), iMissVec, iMissVec, .false.) - prog_meta(iLookPROG%mLayerVolFracLiq) = var_info('mLayerVolFracLiq' , 'volumetric fraction of liquid water in each layer' , '-' , get_ixVarType('midToto'), iMissVec, iMissVec, .false.) - prog_meta(iLookPROG%mLayerVolFracWat) = var_info('mLayerVolFracWat' , 'volumetric fraction of total water in each layer' , '-' , get_ixVarType('midToto'), iMissVec, iMissVec, .false.) - prog_meta(iLookPROG%mLayerMatricHead) = var_info('mLayerMatricHead' , 'matric head of water in the soil' , 'm' , get_ixVarType('midSoil'), iMissVec, iMissVec, .false.) - ! other state variables - prog_meta(iLookPROG%scalarAquiferStorage) = var_info('scalarAquiferStorage' , 'water required to bring aquifer to the bottom of the soil profile', 'm' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - prog_meta(iLookPROG%scalarSurfaceTemp) = var_info('scalarSurfaceTemp' , 'surface temperature (just a copy of the upper-layer temperature)' , 'K' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - ! define coordinate variables - prog_meta(iLookPROG%mLayerDepth) = var_info('mLayerDepth' , 'depth of each layer' , 'm' , get_ixVarType('midToto'), iMissVec, iMissVec, .false.) - prog_meta(iLookPROG%mLayerHeight) = var_info('mLayerHeight' , 'height of the layer mid-point (top of soil = 0)' , 'm' , get_ixVarType('midToto'), iMissVec, iMissVec, .false.) - prog_meta(iLookPROG%iLayerHeight) = var_info('iLayerHeight' , 'height of the layer interface (top of soil = 0)' , 'm' , get_ixVarType('ifcToto'), iMissVec, iMissVec, .false.) - - ! ----- - ! * local model diagnostic variables... - ! ------------------------------------- - ! local properties - diag_meta(iLookDIAG%scalarCanopyDepth) = var_info('scalarCanopyDepth' , 'canopy depth' , 'm' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - diag_meta(iLookDIAG%scalarGreenVegFraction) = var_info('scalarGreenVegFraction' , 'green vegetation fraction (used to compute LAI)' , '-' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - diag_meta(iLookDIAG%scalarBulkVolHeatCapVeg) = var_info('scalarBulkVolHeatCapVeg' , 'bulk volumetric heat capacity of vegetation' , 'J m-3 K-1' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - diag_meta(iLookDIAG%scalarCanopyEmissivity) = var_info('scalarCanopyEmissivity' , 'effective canopy emissivity' , '-' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - diag_meta(iLookDIAG%scalarRootZoneTemp) = var_info('scalarRootZoneTemp' , 'average temperature of the root zone' , 'K' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - diag_meta(iLookDIAG%scalarLAI) = var_info('scalarLAI' , 'one-sided leaf area index' , 'm2 m-2' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - diag_meta(iLookDIAG%scalarSAI) = var_info('scalarSAI' , 'one-sided stem area index' , 'm2 m-2' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - diag_meta(iLookDIAG%scalarExposedLAI) = var_info('scalarExposedLAI' , 'exposed leaf area index (after burial by snow)' , 'm2 m-2' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - diag_meta(iLookDIAG%scalarExposedSAI) = var_info('scalarExposedSAI' , 'exposed stem area index (after burial by snow)' , 'm2 m-2' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - diag_meta(iLookDIAG%scalarAdjMeasHeight) = var_info('scalarAdjMeasHeight' , 'adjusted measurement height for cases snowDepth>mHeight' , 'm' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - diag_meta(iLookDIAG%scalarCanopyIceMax) = var_info('scalarCanopyIceMax' , 'maximum interception storage capacity for ice' , 'kg m-2' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - diag_meta(iLookDIAG%scalarCanopyLiqMax) = var_info('scalarCanopyLiqMax' , 'maximum interception storage capacity for liquid water' , 'kg m-2' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - diag_meta(iLookDIAG%scalarGrowingSeasonIndex) = var_info('scalarGrowingSeasonIndex' , 'growing season index (0=off, 1=on)' , '-' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - diag_meta(iLookDIAG%scalarVolHtCap_air) = var_info('scalarVolHtCap_air' , 'volumetric heat capacity air' , 'J m-3 K-1' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - diag_meta(iLookDIAG%scalarVolHtCap_ice) = var_info('scalarVolHtCap_ice' , 'volumetric heat capacity ice' , 'J m-3 K-1' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - diag_meta(iLookDIAG%scalarVolHtCap_soil) = var_info('scalarVolHtCap_soil' , 'volumetric heat capacity dry soil' , 'J m-3 K-1' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - diag_meta(iLookDIAG%scalarVolHtCap_water) = var_info('scalarVolHtCap_water' , 'volumetric heat capacity liquid wat' , 'J m-3 K-1' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - diag_meta(iLookDIAG%mLayerVolHtCapBulk) = var_info('mLayerVolHtCapBulk' , 'volumetric heat capacity in each layer' , 'J m-3 K-1' , get_ixVarType('midToto'), iMissVec, iMissVec, .false.) - diag_meta(iLookDIAG%scalarLambda_drysoil) = var_info('scalarLambda_drysoil' , 'thermal conductivity of dry soil' , 'W m-1' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - diag_meta(iLookDIAG%scalarLambda_wetsoil) = var_info('scalarLambda_wetsoil' , 'thermal conductivity of wet soil' , 'W m-1' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - diag_meta(iLookDIAG%mLayerThermalC) = var_info('mLayerThermalC' , 'thermal conductivity at the mid-point of each layer' , 'W m-1 K-1' , get_ixVarType('midToto'), iMissVec, iMissVec, .false.) - diag_meta(iLookDIAG%iLayerThermalC) = var_info('iLayerThermalC' , 'thermal conductivity at the interface of each layer' , 'W m-1 K-1' , get_ixVarType('ifcToto'), iMissVec, iMissVec, .false.) - ! forcing - diag_meta(iLookDIAG%scalarVPair) = var_info('scalarVPair' , 'vapor pressure of the air above the vegetation canopy' , 'Pa' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - diag_meta(iLookDIAG%scalarVP_CanopyAir) = var_info('scalarVP_CanopyAir' , 'vapor pressure of the canopy air space' , 'Pa' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - diag_meta(iLookDIAG%scalarTwetbulb) = var_info('scalarTwetbulb' , 'wet bulb temperature' , 'K' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - diag_meta(iLookDIAG%scalarSnowfallTemp) = var_info('scalarSnowfallTemp' , 'temperature of fresh snow' , 'K' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - diag_meta(iLookDIAG%scalarNewSnowDensity) = var_info('scalarNewSnowDensity' , 'density of fresh snow' , 'kg m-3' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - diag_meta(iLookDIAG%scalarO2air) = var_info('scalarO2air' , 'atmospheric o2 concentration' , 'Pa' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - diag_meta(iLookDIAG%scalarCO2air) = var_info('scalarCO2air' , 'atmospheric co2 concentration' , 'Pa' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - ! shortwave radiation - diag_meta(iLookDIAG%scalarCosZenith) = var_info('scalarCosZenith' , 'cosine of the solar zenith angle' , '-' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - diag_meta(iLookDIAG%scalarFractionDirect) = var_info('scalarFractionDirect' , 'fraction of direct radiation (0-1)' , '-' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - diag_meta(iLookDIAG%scalarCanopySunlitFraction) = var_info('scalarCanopySunlitFraction' , 'sunlit fraction of canopy' , '-' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - diag_meta(iLookDIAG%scalarCanopySunlitLAI) = var_info('scalarCanopySunlitLAI' , 'sunlit leaf area' , '-' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - diag_meta(iLookDIAG%scalarCanopyShadedLAI) = var_info('scalarCanopyShadedLAI' , 'shaded leaf area' , '-' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - diag_meta(iLookDIAG%spectralAlbGndDirect) = var_info('spectralAlbGndDirect' , 'direct albedo of underlying surface for each spectral band' , '-' , get_ixVarType('wLength'), iMissVec, iMissVec, .false.) - diag_meta(iLookDIAG%spectralAlbGndDiffuse) = var_info('spectralAlbGndDiffuse' , 'diffuse albedo of underlying surface for each spectral band' , '-' , get_ixVarType('wLength'), iMissVec, iMissVec, .false.) - diag_meta(iLookDIAG%scalarGroundAlbedo) = var_info('scalarGroundAlbedo' , 'albedo of the ground surface' , '-' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - ! turbulent heat transfer - diag_meta(iLookDIAG%scalarLatHeatSubVapCanopy) = var_info('scalarLatHeatSubVapCanopy' , 'latent heat of sublimation/vaporization used for veg canopy' , 'J kg-1' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - diag_meta(iLookDIAG%scalarLatHeatSubVapGround) = var_info('scalarLatHeatSubVapGround' , 'latent heat of sublimation/vaporization used for ground surface' , 'J kg-1' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - diag_meta(iLookDIAG%scalarSatVP_CanopyTemp) = var_info('scalarSatVP_CanopyTemp' , 'saturation vapor pressure at the temperature of vegetation canopy', 'Pa' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - diag_meta(iLookDIAG%scalarSatVP_GroundTemp) = var_info('scalarSatVP_GroundTemp' , 'saturation vapor pressure at the temperature of the ground' , 'Pa' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - diag_meta(iLookDIAG%scalarZ0Canopy) = var_info('scalarZ0Canopy' , 'roughness length of the canopy' , 'm' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - diag_meta(iLookDIAG%scalarWindReductionFactor) = var_info('scalarWindReductionFactor' , 'canopy wind reduction factor' , '-' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - diag_meta(iLookDIAG%scalarZeroPlaneDisplacement) = var_info('scalarZeroPlaneDisplacement' , 'zero plane displacement' , 'm' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - diag_meta(iLookDIAG%scalarRiBulkCanopy) = var_info('scalarRiBulkCanopy' , 'bulk Richardson number for the canopy' , '-' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - diag_meta(iLookDIAG%scalarRiBulkGround) = var_info('scalarRiBulkGround' , 'bulk Richardson number for the ground surface' , '-' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - diag_meta(iLookDIAG%scalarCanopyStabilityCorrection) = var_info('scalarCanopyStabilityCorrection', 'stability correction for the canopy' , '-' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - diag_meta(iLookDIAG%scalarGroundStabilityCorrection) = var_info('scalarGroundStabilityCorrection', 'stability correction for the ground surface' , '-' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - ! evapotranspiration - diag_meta(iLookDIAG%scalarIntercellularCO2Sunlit) = var_info('scalarIntercellularCO2Sunlit' , 'carbon dioxide partial pressure of leaf interior (sunlit leaves)' , 'Pa' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - diag_meta(iLookDIAG%scalarIntercellularCO2Shaded) = var_info('scalarIntercellularCO2Shaded' , 'carbon dioxide partial pressure of leaf interior (shaded leaves)' , 'Pa' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - diag_meta(iLookDIAG%scalarTranspireLim) = var_info('scalarTranspireLim' , 'aggregate soil moisture and aquifer control on transpiration' , '-' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - diag_meta(iLookDIAG%scalarTranspireLimAqfr) = var_info('scalarTranspireLimAqfr' , 'aquifer storage control on transpiration' , '-' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - diag_meta(iLookDIAG%scalarFoliageNitrogenFactor) = var_info('scalarFoliageNitrogenFactor' , 'foliage nitrogen concentration (1=saturated)' , '-' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - diag_meta(iLookDIAG%scalarSoilRelHumidity) = var_info('scalarSoilRelHumidity' , 'relative humidity in the soil pores in the upper-most soil layer' , '-' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - diag_meta(iLookDIAG%mLayerTranspireLim) = var_info('mLayerTranspireLim' , 'soil moist & veg limit on transpiration for each layer' , '-' , get_ixVarType('midSoil'), iMissVec, iMissVec, .false.) - diag_meta(iLookDIAG%mLayerRootDensity) = var_info('mLayerRootDensity' , 'fraction of roots in each soil layer' , '-' , get_ixVarType('midSoil'), iMissVec, iMissVec, .false.) - diag_meta(iLookDIAG%scalarAquiferRootFrac) = var_info('scalarAquiferRootFrac' , 'fraction of roots below the soil profile (in the aquifer)' , '-' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - ! canopy hydrology - diag_meta(iLookDIAG%scalarFracLiqVeg) = var_info('scalarFracLiqVeg' , 'fraction of liquid water on vegetation' , '-' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - diag_meta(iLookDIAG%scalarCanopyWetFraction) = var_info('scalarCanopyWetFraction' , 'fraction canopy that is wet' , '-' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - ! snow hydrology - diag_meta(iLookDIAG%scalarSnowAge) = var_info('scalarSnowAge' , 'non-dimensional snow age' , '-' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - diag_meta(iLookDIAG%scalarGroundSnowFraction) = var_info('scalarGroundSnowFraction' , 'fraction ground that is covered with snow' , '-' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - diag_meta(iLookDIAG%spectralSnowAlbedoDirect) = var_info('spectralSnowAlbedoDirect' , 'direct snow albedo for individual spectral bands' , '-' , get_ixVarType('wLength'), iMissVec, iMissVec, .false.) - diag_meta(iLookDIAG%mLayerFracLiqSnow) = var_info('mLayerFracLiqSnow' , 'fraction of liquid water in each snow layer' , '-' , get_ixVarType('midSnow'), iMissVec, iMissVec, .false.) - diag_meta(iLookDIAG%mLayerThetaResid) = var_info('mLayerThetaResid' , 'residual volumetric water content in each snow layer' , '-' , get_ixVarType('midSnow'), iMissVec, iMissVec, .false.) - diag_meta(iLookDIAG%mLayerPoreSpace) = var_info('mLayerPoreSpace' , 'total pore space in each snow layer' , '-' , get_ixVarType('midSnow'), iMissVec, iMissVec, .false.) - diag_meta(iLookDIAG%mLayerMeltFreeze) = var_info('mLayerMeltFreeze' , 'ice content change from melt/freeze in each layer' , 'kg m-3' , get_ixVarType('midToto'), iMissVec, iMissVec, .false.) - ! soil hydrology - diag_meta(iLookDIAG%scalarInfilArea) = var_info('scalarInfilArea' , 'fraction of unfrozen area where water can infiltrate' , '-' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - diag_meta(iLookDIAG%scalarFrozenArea) = var_info('scalarFrozenArea' , 'fraction of area that is considered impermeable due to soil ice' , '-' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - diag_meta(iLookDIAG%scalarSoilControl) = var_info('scalarSoilControl' , 'soil control on infiltration (1=controlling; 0=not)' , '-' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - diag_meta(iLookDIAG%mLayerVolFracAir) = var_info('mLayerVolFracAir' , 'volumetric fraction of air in each layer' , '-' , get_ixVarType('midToto'), iMissVec, iMissVec, .false.) - diag_meta(iLookDIAG%mLayerTcrit) = var_info('mLayerTcrit' , 'critical soil temperature above which all water is unfrozen' , 'K' , get_ixVarType('midSoil'), iMissVec, iMissVec, .false.) - diag_meta(iLookDIAG%mLayerCompress) = var_info('mLayerCompress' , 'change in volumetric water content due to compression of soil' , '-' , get_ixVarType('midSoil'), iMissVec, iMissVec, .false.) - diag_meta(iLookDIAG%scalarSoilCompress) = var_info('scalarSoilCompress' , 'change in total soil storage due to compression of soil matrix' , 'kg m-2' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - diag_meta(iLookDIAG%mLayerMatricHeadLiq) = var_info('mLayerMatricHeadLiq' , 'matric potential of liquid water' , 'm' , get_ixVarType('midSoil'), iMissVec, iMissVec, .false.) - ! mass balance check - diag_meta(iLookDIAG%scalarSoilWatBalError) = var_info('scalarSoilWatBalError' , 'error in the total soil water balance' , 'kg m-2' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - diag_meta(iLookDIAG%scalarAquiferBalError) = var_info('scalarAquiferBalError' , 'error in the aquifer water balance' , 'kg m-2' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - diag_meta(iLookDIAG%scalarTotalSoilLiq) = var_info('scalarTotalSoilLiq' , 'total mass of liquid water in the soil' , 'kg m-2' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - diag_meta(iLookDIAG%scalarTotalSoilIce) = var_info('scalarTotalSoilIce' , 'total mass of ice in the soil' , 'kg m-2' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - diag_meta(iLookDIAG%scalarTotalSoilWat) = var_info('scalarTotalSoilWat' , 'total mass of water in the soil' , 'kg m-2' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - ! variable shortcuts - diag_meta(iLookDIAG%scalarVGn_m) = var_info('scalarVGn_m' , 'van Genuchten "m" parameter' , '-' , get_ixVarType('midSoil'), iMissVec, iMissVec, .false.) - diag_meta(iLookDIAG%scalarKappa) = var_info('scalarKappa' , 'constant in the freezing curve function' , 'm K-1' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - diag_meta(iLookDIAG%scalarVolLatHt_fus) = var_info('scalarVolLatHt_fus' , 'volumetric latent heat of fusion' , 'J m-3' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - ! number of function evaluations - diag_meta(iLookDIAG%numFluxCalls) = var_info('numFluxCalls' , 'number of flux calls' , '-' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - - ! ----- - ! * local model fluxes... - ! ----------------------- - ! net energy and mass fluxes for the vegetation domain - flux_meta(iLookFLUX%scalarCanairNetNrgFlux) = var_info('scalarCanairNetNrgFlux' , 'net energy flux for the canopy air space' , 'W m-2' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - flux_meta(iLookFLUX%scalarCanopyNetNrgFlux) = var_info('scalarCanopyNetNrgFlux' , 'net energy flux for the vegetation canopy' , 'W m-2' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - flux_meta(iLookFLUX%scalarGroundNetNrgFlux) = var_info('scalarGroundNetNrgFlux' , 'net energy flux for the ground surface' , 'W m-2' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - flux_meta(iLookFLUX%scalarCanopyNetLiqFlux) = var_info('scalarCanopyNetLiqFlux' , 'net liquid water flux for the vegetation canopy' , 'kg m-2 s-1' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - ! forcing - flux_meta(iLookFLUX%scalarRainfall) = var_info('scalarRainfall' , 'computed rainfall rate' , 'kg m-2 s-1' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - flux_meta(iLookFLUX%scalarSnowfall) = var_info('scalarSnowfall' , 'computed snowfall rate' , 'kg m-2 s-1' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - ! shortwave radiation - flux_meta(iLookFLUX%spectralIncomingDirect) = var_info('spectralIncomingDirect' , 'incoming direct solar radiation in each wave band' , 'W m-2' , get_ixVarType('wLength'), iMissVec, iMissVec, .false.) - flux_meta(iLookFLUX%spectralIncomingDiffuse) = var_info('spectralIncomingDiffuse' , 'incoming diffuse solar radiation in each wave band' , 'W m-2' , get_ixVarType('wLength'), iMissVec, iMissVec, .false.) - flux_meta(iLookFLUX%scalarCanopySunlitPAR) = var_info('scalarCanopySunlitPAR' , 'average absorbed par for sunlit leaves' , 'W m-2' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - flux_meta(iLookFLUX%scalarCanopyShadedPAR) = var_info('scalarCanopyShadedPAR' , 'average absorbed par for shaded leaves' , 'W m-2' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - flux_meta(iLookFLUX%spectralBelowCanopyDirect) = var_info('spectralBelowCanopyDirect' , 'downward direct flux below veg layer for each spectral band' , 'W m-2' , get_ixVarType('wLength'), iMissVec, iMissVec, .false.) - flux_meta(iLookFLUX%spectralBelowCanopyDiffuse) = var_info('spectralBelowCanopyDiffuse' , 'downward diffuse flux below veg layer for each spectral band' , 'W m-2' , get_ixVarType('wLength'), iMissVec, iMissVec, .false.) - flux_meta(iLookFLUX%scalarBelowCanopySolar) = var_info('scalarBelowCanopySolar' , 'solar radiation transmitted below the canopy' , 'W m-2' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - flux_meta(iLookFLUX%scalarCanopyAbsorbedSolar) = var_info('scalarCanopyAbsorbedSolar' , 'solar radiation absorbed by canopy' , 'W m-2' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - flux_meta(iLookFLUX%scalarGroundAbsorbedSolar) = var_info('scalarGroundAbsorbedSolar' , 'solar radiation absorbed by ground' , 'W m-2' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - ! longwave radiation - flux_meta(iLookFLUX%scalarLWRadCanopy) = var_info('scalarLWRadCanopy' , 'longwave radiation emitted from the canopy' , 'W m-2' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - flux_meta(iLookFLUX%scalarLWRadGround) = var_info('scalarLWRadGround' , 'longwave radiation emitted at the ground surface' , 'W m-2' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - flux_meta(iLookFLUX%scalarLWRadUbound2Canopy) = var_info('scalarLWRadUbound2Canopy' , 'downward atmospheric longwave radiation absorbed by the canopy' , 'W m-2' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - flux_meta(iLookFLUX%scalarLWRadUbound2Ground) = var_info('scalarLWRadUbound2Ground' , 'downward atmospheric longwave radiation absorbed by the ground' , 'W m-2' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - flux_meta(iLookFLUX%scalarLWRadUbound2Ubound) = var_info('scalarLWRadUbound2Ubound' , 'atmospheric radiation refl by ground + lost thru upper boundary' , 'W m-2' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - flux_meta(iLookFLUX%scalarLWRadCanopy2Ubound) = var_info('scalarLWRadCanopy2Ubound' , 'longwave radiation emitted from canopy lost thru upper boundary' , 'W m-2' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - flux_meta(iLookFLUX%scalarLWRadCanopy2Ground) = var_info('scalarLWRadCanopy2Ground' , 'longwave radiation emitted from canopy absorbed by the ground' , 'W m-2' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - flux_meta(iLookFLUX%scalarLWRadCanopy2Canopy) = var_info('scalarLWRadCanopy2Canopy' , 'canopy longwave reflected from ground and absorbed by the canopy' , 'W m-2' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - flux_meta(iLookFLUX%scalarLWRadGround2Ubound) = var_info('scalarLWRadGround2Ubound' , 'longwave radiation emitted from ground lost thru upper boundary' , 'W m-2' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - flux_meta(iLookFLUX%scalarLWRadGround2Canopy) = var_info('scalarLWRadGround2Canopy' , 'longwave radiation emitted from ground and absorbed by the canopy', 'W m-2' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - flux_meta(iLookFLUX%scalarLWNetCanopy) = var_info('scalarLWNetCanopy' , 'net longwave radiation at the canopy' , 'W m-2' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - flux_meta(iLookFLUX%scalarLWNetGround) = var_info('scalarLWNetGround' , 'net longwave radiation at the ground surface' , 'W m-2' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - flux_meta(iLookFLUX%scalarLWNetUbound) = var_info('scalarLWNetUbound' , 'net longwave radiation at the upper atmospheric boundary' , 'W m-2' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - ! turbulent heat transfer - flux_meta(iLookFLUX%scalarEddyDiffusCanopyTop) = var_info('scalarEddyDiffusCanopyTop' , 'eddy diffusivity for heat at the top of the canopy' , 'm2 s-1' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - flux_meta(iLookFLUX%scalarFrictionVelocity) = var_info('scalarFrictionVelocity' , 'friction velocity (canopy momentum sink)' , 'm s-1' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - flux_meta(iLookFLUX%scalarWindspdCanopyTop) = var_info('scalarWindspdCanopyTop' , 'windspeed at the top of the canopy' , 'm s-1' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - flux_meta(iLookFLUX%scalarWindspdCanopyBottom) = var_info('scalarWindspdCanopyBottom' , 'windspeed at the height of the bottom of the canopy' , 'm s-1' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - flux_meta(iLookFLUX%scalarGroundResistance) = var_info('scalarGroundResistance' , 'below canopy aerodynamic resistance' , 's m-1' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - flux_meta(iLookFLUX%scalarCanopyResistance) = var_info('scalarCanopyResistance' , 'above canopy aerodynamic resistance' , 's m-1' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - flux_meta(iLookFLUX%scalarLeafResistance) = var_info('scalarLeafResistance' , 'mean leaf boundary layer resistance per unit leaf area' , 's m-1' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - flux_meta(iLookFLUX%scalarSoilResistance) = var_info('scalarSoilResistance' , 'soil surface resistance' , 's m-1' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - flux_meta(iLookFLUX%scalarSenHeatTotal) = var_info('scalarSenHeatTotal' , 'sensible heat from the canopy air space to the atmosphere' , 'W m-2' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - flux_meta(iLookFLUX%scalarSenHeatCanopy) = var_info('scalarSenHeatCanopy' , 'sensible heat from the canopy to the canopy air space' , 'W m-2' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - flux_meta(iLookFLUX%scalarSenHeatGround) = var_info('scalarSenHeatGround' , 'sensible heat from the ground (below canopy or non-vegetated)' , 'W m-2' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - flux_meta(iLookFLUX%scalarLatHeatTotal) = var_info('scalarLatHeatTotal' , 'latent heat from the canopy air space to the atmosphere' , 'W m-2' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - flux_meta(iLookFLUX%scalarLatHeatCanopyEvap) = var_info('scalarLatHeatCanopyEvap' , 'evaporation latent heat from the canopy to the canopy air space' , 'W m-2' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - flux_meta(iLookFLUX%scalarLatHeatCanopyTrans) = var_info('scalarLatHeatCanopyTrans' , 'transpiration latent heat from the canopy to the canopy air space', 'W m-2' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - flux_meta(iLookFLUX%scalarLatHeatGround) = var_info('scalarLatHeatGround' , 'latent heat from the ground (below canopy or non-vegetated)' , 'W m-2' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - flux_meta(iLookFLUX%scalarCanopyAdvectiveHeatFlux) = var_info('scalarCanopyAdvectiveHeatFlux' , 'heat advected to the canopy with precipitation (snow + rain)' , 'W m-2' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - flux_meta(iLookFLUX%scalarGroundAdvectiveHeatFlux) = var_info('scalarGroundAdvectiveHeatFlux' , 'heat advected to the ground with throughfall + unloading/drainage', 'W m-2' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - flux_meta(iLookFLUX%scalarCanopySublimation) = var_info('scalarCanopySublimation' , 'canopy sublimation/frost' , 'kg m-2 s-1' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - flux_meta(iLookFLUX%scalarSnowSublimation) = var_info('scalarSnowSublimation' , 'snow sublimation/frost (below canopy or non-vegetated)' , 'kg m-2 s-1' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - ! liquid water fluxes associated with evapotranspiration - flux_meta(iLookFLUX%scalarStomResistSunlit) = var_info('scalarStomResistSunlit' , 'stomatal resistance for sunlit leaves' , 's m-1' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - flux_meta(iLookFLUX%scalarStomResistShaded) = var_info('scalarStomResistShaded' , 'stomatal resistance for shaded leaves' , 's m-1' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - flux_meta(iLookFLUX%scalarPhotosynthesisSunlit) = var_info('scalarPhotosynthesisSunlit' , 'sunlit photosynthesis' , 'umolco2 m-2 s-1' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - flux_meta(iLookFLUX%scalarPhotosynthesisShaded) = var_info('scalarPhotosynthesisShaded' , 'shaded photosynthesis' , 'umolco2 m-2 s-1' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - flux_meta(iLookFLUX%scalarCanopyTranspiration) = var_info('scalarCanopyTranspiration' , 'canopy transpiration' , 'kg m-2 s-1' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - flux_meta(iLookFLUX%scalarCanopyEvaporation) = var_info('scalarCanopyEvaporation' , 'canopy evaporation/condensation' , 'kg m-2 s-1' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - flux_meta(iLookFLUX%scalarGroundEvaporation) = var_info('scalarGroundEvaporation' , 'ground evaporation/condensation (below canopy or non-vegetated)' , 'kg m-2 s-1' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - flux_meta(iLookFLUX%mLayerTranspire) = var_info('mLayerTranspire' , 'transpiration loss from each soil layer' , 'm s-1' , get_ixVarType('midSoil'), iMissVec, iMissVec, .false.) - ! liquid and solid water fluxes through the canopy - flux_meta(iLookFLUX%scalarThroughfallSnow) = var_info('scalarThroughfallSnow' , 'snow that reaches the ground without ever touching the canopy' , 'kg m-2 s-1' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - flux_meta(iLookFLUX%scalarThroughfallRain) = var_info('scalarThroughfallRain' , 'rain that reaches the ground without ever touching the canopy' , 'kg m-2 s-1' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - flux_meta(iLookFLUX%scalarCanopySnowUnloading) = var_info('scalarCanopySnowUnloading' , 'unloading of snow from the vegetation canopy' , 'kg m-2 s-1' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - flux_meta(iLookFLUX%scalarCanopyLiqDrainage) = var_info('scalarCanopyLiqDrainage' , 'drainage of liquid water from the vegetation canopy' , 'kg m-2 s-1' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - flux_meta(iLookFLUX%scalarCanopyMeltFreeze) = var_info('scalarCanopyMeltFreeze' , 'melt/freeze of water stored in the canopy' , 'kg m-2 s-1' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - ! energy fluxes and for the snow and soil domains - flux_meta(iLookFLUX%iLayerConductiveFlux) = var_info('iLayerConductiveFlux' , 'conductive energy flux at layer interfaces' , 'W m-2' , get_ixVarType('ifcToto'), iMissVec, iMissVec, .false.) - flux_meta(iLookFLUX%iLayerAdvectiveFlux) = var_info('iLayerAdvectiveFlux' , 'advective energy flux at layer interfaces' , 'W m-2' , get_ixVarType('ifcToto'), iMissVec, iMissVec, .false.) - flux_meta(iLookFLUX%iLayerNrgFlux) = var_info('iLayerNrgFlux' , 'energy flux at layer interfaces' , 'W m-2' , get_ixVarType('ifcToto'), iMissVec, iMissVec, .false.) - flux_meta(iLookFLUX%mLayerNrgFlux) = var_info('mLayerNrgFlux' , 'net energy flux for each layer within the snow+soil domain' , 'J m-3 s-1' , get_ixVarType('midToto'), iMissVec, iMissVec, .false.) - ! liquid water fluxes for the snow domain - flux_meta(iLookFLUX%scalarSnowDrainage) = var_info('scalarSnowDrainage' , 'drainage from the bottom of the snow profile' , 'm s-1' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - flux_meta(iLookFLUX%iLayerLiqFluxSnow) = var_info('iLayerLiqFluxSnow' , 'liquid flux at snow layer interfaces' , 'm s-1' , get_ixVarType('ifcSnow'), iMissVec, iMissVec, .false.) - flux_meta(iLookFLUX%mLayerLiqFluxSnow) = var_info('mLayerLiqFluxSnow' , 'net liquid water flux for each snow layer' , 's-1' , get_ixVarType('midSnow'), iMissVec, iMissVec, .false.) - ! liquid water fluxes for the soil domain - flux_meta(iLookFLUX%scalarRainPlusMelt) = var_info('scalarRainPlusMelt' , 'rain plus melt, used as input to soil before surface runoff' , 'm s-1' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - flux_meta(iLookFLUX%scalarMaxInfilRate) = var_info('scalarMaxInfilRate' , 'maximum infiltration rate' , 'm s-1' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - flux_meta(iLookFLUX%scalarInfiltration) = var_info('scalarInfiltration' , 'infiltration of water into the soil profile' , 'm s-1' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - flux_meta(iLookFLUX%scalarExfiltration) = var_info('scalarExfiltration' , 'exfiltration of water from the top of the soil profile' , 'm s-1' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - flux_meta(iLookFLUX%scalarSurfaceRunoff) = var_info('scalarSurfaceRunoff' , 'surface runoff' , 'm s-1' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - flux_meta(iLookFLUX%mLayerSatHydCondMP) = var_info('mLayerSatHydCondMP' , 'saturated hydraulic conductivity of macropores in each layer' , 'm s-1' , get_ixVarType('midSoil'), iMissVec, iMissVec, .false.) - flux_meta(iLookFLUX%mLayerSatHydCond) = var_info('mLayerSatHydCond' , 'saturated hydraulic conductivity in each layer' , 'm s-1' , get_ixVarType('midSoil'), iMissVec, iMissVec, .false.) - flux_meta(iLookFLUX%iLayerSatHydCond) = var_info('iLayerSatHydCond' , 'saturated hydraulic conductivity in each layer interface' , 'm s-1' , get_ixVarType('ifcSoil'), iMissVec, iMissVec, .false.) - flux_meta(iLookFLUX%mLayerHydCond) = var_info('mLayerHydCond' , 'hydraulic conductivity in each layer' , 'm s-1' , get_ixVarType('midSoil'), iMissVec, iMissVec, .false.) - flux_meta(iLookFLUX%iLayerLiqFluxSoil) = var_info('iLayerLiqFluxSoil' , 'liquid flux at soil layer interfaces' , 'm s-1' , get_ixVarType('ifcSoil'), iMissVec, iMissVec, .false.) - flux_meta(iLookFLUX%mLayerLiqFluxSoil) = var_info('mLayerLiqFluxSoil' , 'net liquid water flux for each soil layer' , 's-1' , get_ixVarType('midSoil'), iMissVec, iMissVec, .false.) - flux_meta(iLookFLUX%mLayerBaseflow) = var_info('mLayerBaseflow' , 'baseflow from each soil layer' , 'm s-1' , get_ixVarType('midSoil'), iMissVec, iMissVec, .false.) - flux_meta(iLookFLUX%mLayerColumnInflow) = var_info('mLayerColumnInflow' , 'total inflow to each layer in a given soil column' , 'm3 s-1' , get_ixVarType('midSoil'), iMissVec, iMissVec, .false.) - flux_meta(iLookFLUX%mLayerColumnOutflow) = var_info('mLayerColumnOutflow' , 'total outflow from each layer in a given soil column' , 'm3 s-1' , get_ixVarType('midSoil'), iMissVec, iMissVec, .false.) - flux_meta(iLookFLUX%scalarSoilBaseflow) = var_info('scalarSoilBaseflow' , 'total baseflow from the soil profile' , 'm s-1' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - flux_meta(iLookFLUX%scalarSoilDrainage) = var_info('scalarSoilDrainage' , 'drainage from the bottom of the soil profile' , 'm s-1' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - flux_meta(iLookFLUX%scalarAquiferRecharge) = var_info('scalarAquiferRecharge' , 'recharge to the aquifer' , 'm s-1' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - flux_meta(iLookFLUX%scalarAquiferTranspire) = var_info('scalarAquiferTranspire' , 'transpiration loss from the aquifer' , 'm s-1' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - flux_meta(iLookFLUX%scalarAquiferBaseflow) = var_info('scalarAquiferBaseflow' , 'baseflow from the aquifer' , 'm s-1' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - ! derived variables - flux_meta(iLookFLUX%scalarTotalET) = var_info('scalarTotalET' , 'total ET' , 'kg m-2 s-1' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - flux_meta(iLookFLUX%scalarTotalRunoff) = var_info('scalarTotalRunoff' , 'total runoff' , 'm s-1' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - flux_meta(iLookFLUX%scalarNetRadiation) = var_info('scalarNetRadiation' , 'net radiation' , 'W m-2' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - - ! ----- - ! * local flux derivatives... - ! --------------------------- - ! derivatives in net vegetation energy fluxes w.r.t. relevant state variables - deriv_meta(iLookDERIV%dCanairNetFlux_dCanairTemp) = var_info('dCanairNetFlux_dCanairTemp' , 'derivative in net canopy air space flux w.r.t. canopy air temperature', 'W m-2 K-1' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - deriv_meta(iLookDERIV%dCanairNetFlux_dCanopyTemp) = var_info('dCanairNetFlux_dCanopyTemp' , 'derivative in net canopy air space flux w.r.t. canopy temperature' , 'W m-2 K-1' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - deriv_meta(iLookDERIV%dCanairNetFlux_dGroundTemp) = var_info('dCanairNetFlux_dGroundTemp' , 'derivative in net canopy air space flux w.r.t. ground temperature' , 'W m-2 K-1' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - deriv_meta(iLookDERIV%dCanopyNetFlux_dCanairTemp) = var_info('dCanopyNetFlux_dCanairTemp' , 'derivative in net canopy flux w.r.t. canopy air temperature' , 'W m-2 K-1' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - deriv_meta(iLookDERIV%dCanopyNetFlux_dCanopyTemp) = var_info('dCanopyNetFlux_dCanopyTemp' , 'derivative in net canopy flux w.r.t. canopy temperature' , 'W m-2 K-1' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - deriv_meta(iLookDERIV%dCanopyNetFlux_dGroundTemp) = var_info('dCanopyNetFlux_dGroundTemp' , 'derivative in net canopy flux w.r.t. ground temperature' , 'W m-2 K-1' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - deriv_meta(iLookDERIV%dCanopyNetFlux_dCanLiq) = var_info('dCanopyNetFlux_dCanLiq' , 'derivative in net canopy fluxes w.r.t. canopy liquid water content' , 'J kg-1 s-1' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - deriv_meta(iLookDERIV%dGroundNetFlux_dCanairTemp) = var_info('dGroundNetFlux_dCanairTemp' , 'derivative in net ground flux w.r.t. canopy air temperature' , 'W m-2 K-1' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - deriv_meta(iLookDERIV%dGroundNetFlux_dCanopyTemp) = var_info('dGroundNetFlux_dCanopyTemp' , 'derivative in net ground flux w.r.t. canopy temperature' , 'W m-2 K-1' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - deriv_meta(iLookDERIV%dGroundNetFlux_dGroundTemp) = var_info('dGroundNetFlux_dGroundTemp' , 'derivative in net ground flux w.r.t. ground temperature' , 'W m-2 K-1' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - deriv_meta(iLookDERIV%dGroundNetFlux_dCanLiq) = var_info('dGroundNetFlux_dCanLiq' , 'derivative in net ground fluxes w.r.t. canopy liquid water content' , 'J kg-1 s-1' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - ! derivatives in evaporative fluxes w.r.t. relevant state variables - deriv_meta(iLookDERIV%dCanopyEvaporation_dTCanair) = var_info('dCanopyEvaporation_dTCanair' , 'derivative in canopy evaporation w.r.t. canopy air temperature' , 'kg m-2 s-1 K-1' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - deriv_meta(iLookDERIV%dCanopyEvaporation_dTCanopy) = var_info('dCanopyEvaporation_dTCanopy' , 'derivative in canopy evaporation w.r.t. canopy temperature' , 'kg m-2 s-1 K-1' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - deriv_meta(iLookDERIV%dCanopyEvaporation_dTGround) = var_info('dCanopyEvaporation_dTGround' , 'derivative in canopy evaporation w.r.t. ground temperature' , 'kg m-2 s-1 K-1' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - deriv_meta(iLookDERIV%dCanopyEvaporation_dCanLiq) = var_info('dCanopyEvaporation_dCanLiq' , 'derivative in canopy evaporation w.r.t. canopy liquid water content' , 's-1' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - deriv_meta(iLookDERIV%dGroundEvaporation_dTCanair) = var_info('dGroundEvaporation_dTCanair' , 'derivative in ground evaporation w.r.t. canopy air temperature' , 'kg m-2 s-1 K-1' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - deriv_meta(iLookDERIV%dGroundEvaporation_dTCanopy) = var_info('dGroundEvaporation_dTCanopy' , 'derivative in ground evaporation w.r.t. canopy temperature' , 'kg m-2 s-1 K-1' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - deriv_meta(iLookDERIV%dGroundEvaporation_dTGround) = var_info('dGroundEvaporation_dTGround' , 'derivative in ground evaporation w.r.t. ground temperature' , 'kg m-2 s-1 K-1' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - deriv_meta(iLookDERIV%dGroundEvaporation_dCanLiq) = var_info('dGroundEvaporation_dCanLiq' , 'derivative in ground evaporation w.r.t. canopy liquid water content' , 's-1' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - ! derivatives in canopy water w.r.t canopy temperature - deriv_meta(iLookDERIV%dTheta_dTkCanopy) = var_info('dTheta_dTkCanopy' , 'derivative of volumetric liquid water content w.r.t. temperature' , 'K-1' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - deriv_meta(iLookDERIV%dCanLiq_dTcanopy) = var_info('dCanLiq_dTcanopy' , 'derivative of canopy liquid storage w.r.t. temperature' , 'kg m-2 K-1' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - ! derivatives in canopy liquid fluxes w.r.t. canopy water - deriv_meta(iLookDERIV%scalarCanopyLiqDeriv) = var_info('scalarCanopyLiqDeriv' , 'derivative in (throughfall + drainage) w.r.t. canopy liquid water' , 's-1' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - deriv_meta(iLookDERIV%scalarThroughfallRainDeriv) = var_info('scalarThroughfallRainDeriv' , 'derivative in throughfall w.r.t. canopy liquid water' , 's-1' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - deriv_meta(iLookDERIV%scalarCanopyLiqDrainageDeriv) = var_info('scalarCanopyLiqDrainageDeriv' , 'derivative in canopy drainage w.r.t. canopy liquid water' , 's-1' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - ! derivatives in energy fluxes at the interface of snow+soil layers w.r.t. temperature in layers above and below - deriv_meta(iLookDERIV%dNrgFlux_dTempAbove) = var_info('dNrgFlux_dTempAbove' , 'derivatives in the flux w.r.t. temperature in the layer above' , 'J m-2 s-1 K-1' , get_ixVarType('ifcToto'), iMissVec, iMissVec, .false.) - deriv_meta(iLookDERIV%dNrgFlux_dTempBelow) = var_info('dNrgFlux_dTempBelow' , 'derivatives in the flux w.r.t. temperature in the layer below' , 'J m-2 s-1 K-1' , get_ixVarType('ifcToto'), iMissVec, iMissVec, .false.) - ! derivative in liquid water fluxes at the interface of snow layers w.r.t. volumetric liquid water content in the layer above - deriv_meta(iLookDERIV%iLayerLiqFluxSnowDeriv) = var_info('iLayerLiqFluxSnowDeriv' , 'derivative in vertical liquid water flux at layer interfaces' , 'm s-1' , get_ixVarType('ifcSnow'), iMissVec, iMissVec, .false.) - ! derivative in liquid water fluxes for the soil domain w.r.t hydrology state variables - deriv_meta(iLookDERIV%dVolTot_dPsi0) = var_info('dVolTot_dPsi0' , 'derivative in total water content w.r.t. total water matric potential', 'm-1' , get_ixVarType('midSoil'), iMissVec, iMissVec, .false.) - deriv_meta(iLookDERIV%dCompress_dPsi) = var_info('dCompress_dPsi' , 'derivative in compressibility w.r.t matric head' , 'm-1' , get_ixVarType('midSoil'), iMissVec, iMissVec, .false.) - deriv_meta(iLookDERIV%mLayerdTheta_dPsi) = var_info('mLayerdTheta_dPsi' , 'derivative in the soil water characteristic w.r.t. psi' , 'm-1' , get_ixVarType('midSoil'), iMissVec, iMissVec, .false.) - deriv_meta(iLookDERIV%mLayerdPsi_dTheta) = var_info('mLayerdPsi_dTheta' , 'derivative in the soil water characteristic w.r.t. theta' , 'm' , get_ixVarType('midSoil'), iMissVec, iMissVec, .false.) - deriv_meta(iLookDERIV%dq_dHydStateAbove) = var_info('dq_dHydStateAbove' , 'change in flux at layer interfaces w.r.t. states in the layer above' , 'unknown' , get_ixVarType('ifcSoil'), iMissVec, iMissVec, .false.) - deriv_meta(iLookDERIV%dq_dHydStateBelow) = var_info('dq_dHydStateBelow' , 'change in flux at layer interfaces w.r.t. states in the layer below' , 'unknown' , get_ixVarType('ifcSoil'), iMissVec, iMissVec, .false.) - ! derivative in baseflow flux w.r.t. aquifer storage - deriv_meta(iLookDERIV%dBaseflow_dAquifer) = var_info('dBaseflow_dAquifer' , 'derivative in baseflow flux w.r.t. aquifer storage' , 's-1' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - ! derivative in liquid water fluxes for the soil domain w.r.t energy state variables - deriv_meta(iLookDERIV%dq_dNrgStateAbove) = var_info('dq_dNrgStateAbove' , 'change in flux at layer interfaces w.r.t. states in the layer above' , 'unknown' , get_ixVarType('ifcSoil'), iMissVec, iMissVec, .false.) - deriv_meta(iLookDERIV%dq_dNrgStateBelow) = var_info('dq_dNrgStateBelow' , 'change in flux at layer interfaces w.r.t. states in the layer below' , 'unknown' , get_ixVarType('ifcSoil'), iMissVec, iMissVec, .false.) - deriv_meta(iLookDERIV%mLayerdTheta_dTk) = var_info('mLayerdTheta_dTk' , 'derivative of volumetric liquid water content w.r.t. temperature' , 'K-1' , get_ixVarType('midToto'), iMissVec, iMissVec, .false.) - deriv_meta(iLookDERIV%dPsiLiq_dTemp) = var_info('dPsiLiq_dTemp' , 'derivative in the liquid water matric potential w.r.t. temperature' , 'm K-1' , get_ixVarType('midSoil'), iMissVec, iMissVec, .false.) - deriv_meta(iLookDERIV%dPsiLiq_dPsi0) = var_info('dPsiLiq_dPsi0' , 'derivative in liquid matric potential w.r.t. total matric potential' , '-' , get_ixVarType('midSoil'), iMissVec, iMissVec, .false.) - - ! ----- - ! * basin-wide runoff and aquifer fluxes... - ! ----------------------------------------- - bvar_meta(iLookBVAR%basin__TotalArea) = var_info('basin__TotalArea' , 'total basin area' , 'm2' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - bvar_meta(iLookBVAR%basin__SurfaceRunoff) = var_info('basin__SurfaceRunoff' , 'surface runoff' , 'm s-1' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - bvar_meta(iLookBVAR%basin__ColumnOutflow) = var_info('basin__ColumnOutflow' , 'outflow from all "outlet" HRUs (with no downstream HRU)', 'm3 s-1', get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - bvar_meta(iLookBVAR%basin__AquiferStorage) = var_info('basin__AquiferStorage' , 'aquifer storage' , 'm' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - bvar_meta(iLookBVAR%basin__AquiferRecharge) = var_info('basin__AquiferRecharge' , 'recharge to the aquifer' , 'm s-1' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - bvar_meta(iLookBVAR%basin__AquiferBaseflow) = var_info('basin__AquiferBaseflow' , 'baseflow from the aquifer' , 'm s-1' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - bvar_meta(iLookBVAR%basin__AquiferTranspire) = var_info('basin__AquiferTranspire', 'transpiration loss from the aquifer' , 'm s-1' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - bvar_meta(iLookBVAR%basin__SoilDrainage) = var_info('basin__SoilDrainage' , 'soil drainage' , 'm s-1' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - bvar_meta(iLookBVAR%routingRunoffFuture) = var_info('routingRunoffFuture' , 'runoff in future time steps' , 'm s-1' , get_ixVarType('routing'), iMissVec, iMissVec, .false.) - bvar_meta(iLookBVAR%routingFractionFuture) = var_info('routingFractionFuture' , 'fraction of runoff in future time steps' , '-' , get_ixVarType('routing'), iMissVec, iMissVec, .false.) - bvar_meta(iLookBVAR%averageInstantRunoff) = var_info('averageInstantRunoff' , 'instantaneous runoff' , 'm s-1' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - bvar_meta(iLookBVAR%averageRoutedRunoff) = var_info('averageRoutedRunoff' , 'routed runoff' , 'm s-1' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - - ! ----- - ! * model indices... - ! ------------------ - - ! number of model layers, and layer indices - indx_meta(iLookINDEX%nSnow) = var_info('nSnow' , 'number of snow layers' , '-', get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - indx_meta(iLookINDEX%nSoil) = var_info('nSoil' , 'number of soil layers' , '-', get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - indx_meta(iLookINDEX%nLayers) = var_info('nLayers' , 'total number of layers' , '-', get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - indx_meta(iLookINDEX%layerType) = var_info('layerType' , 'index defining type of layer (snow or soil)' , '-', get_ixVarType('midToto'), iMissVec, iMissVec, .false.) - ! number of state variables of different type - indx_meta(iLookINDEX%nCasNrg) = var_info('nCasNrg' , 'number of energy state variables for the canopy air space' , '-', get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - indx_meta(iLookINDEX%nVegNrg) = var_info('nVegNrg' , 'number of energy state variables for the vegetation canopy' , '-', get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - indx_meta(iLookINDEX%nVegMass) = var_info('nVegMass' , 'number of hydrology states for vegetation (mass of water)' , '-', get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - indx_meta(iLookINDEX%nVegState) = var_info('nVegState' , 'number of vegetation state variables' , '-', get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - indx_meta(iLookINDEX%nNrgState) = var_info('nNrgState' , 'number of energy state variables' , '-', get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - indx_meta(iLookINDEX%nWatState) = var_info('nWatState' , 'number of "total water" states (vol. total water content)' , '-', get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - indx_meta(iLookINDEX%nMatState) = var_info('nMatState' , 'number of matric head state variables' , '-', get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - indx_meta(iLookINDEX%nMassState) = var_info('nMassState' , 'number of hydrology state variables (mass of water)' , '-', get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - indx_meta(iLookINDEX%nState) = var_info('nState' , 'total number of model state variables' , '-', get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - ! number of state variables within different domains in the snow+soil system - indx_meta(iLookINDEX%nSnowSoilNrg) = var_info('nSnowSoilNrg' , 'number of energy states in the snow+soil domain' , '-', get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - indx_meta(iLookINDEX%nSnowOnlyNrg) = var_info('nSnowOnlyNrg' , 'number of energy states in the snow domain' , '-', get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - indx_meta(iLookINDEX%nSoilOnlyNrg) = var_info('nSoilOnlyNrg' , 'number of energy states in the soil domain' , '-', get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - indx_meta(iLookINDEX%nSnowSoilHyd) = var_info('nSnowSoilHyd' , 'number of hydrology states in the snow+soil domain' , '-', get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - indx_meta(iLookINDEX%nSnowOnlyHyd) = var_info('nSnowOnlyHyd' , 'number of hydrology states in the snow domain' , '-', get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - indx_meta(iLookINDEX%nSoilOnlyHyd) = var_info('nSoilOnlyHyd' , 'number of hydrology states in the soil domain' , '-', get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - ! type of model state variables - indx_meta(iLookINDEX%ixControlVolume) = var_info('ixControlVolume' , 'index of the control volume for different domains (veg, snow, soil)' , '-', get_ixVarType('unknown'), iMissVec, iMissVec, .false.) - indx_meta(iLookINDEX%ixDomainType) = var_info('ixDomainType' , 'index of the type of domain (iname_veg, iname_snow, iname_soil)' , '-', get_ixVarType('unknown'), iMissVec, iMissVec, .false.) - indx_meta(iLookINDEX%ixStateType) = var_info('ixStateType' , 'index of the type of every state variable (iname_nrgCanair, ...)' , '-', get_ixVarType('unknown'), iMissVec, iMissVec, .false.) - indx_meta(iLookINDEX%ixHydType) = var_info('ixHydType' , 'index of the type of hydrology states in snow+soil domain' , '-', get_ixVarType('midToto'), iMissVec, iMissVec, .false.) - ! type of model state variables (state subset) - indx_meta(iLookINDEX%ixDomainType_subset) = var_info('ixDomainType_subset' , '[state subset] id of domain for desired model state variables' , '-', get_ixVarType('unknown'), iMissVec, iMissVec, .false.) - indx_meta(iLookINDEX%ixStateType_subset) = var_info('ixStateType_subset' , '[state subset] type of desired model state variables' , '-', get_ixVarType('unknown'), iMissVec, iMissVec, .false.) - ! mapping between state subset and the full state vector - indx_meta(iLookINDEX%ixMapFull2Subset) = var_info('ixMapFull2Subset' , 'list of indices of the state subset in the full state vector' , '-', get_ixVarType('unknown'), iMissVec, iMissVec, .false.) - indx_meta(iLookINDEX%ixMapSubset2Full) = var_info('ixMapSubset2Full' , 'list of indices of the full state vector in the state subset' , '-', get_ixVarType('unknown'), iMissVec, iMissVec, .false.) - ! indices of model specific state variables - indx_meta(iLookINDEX%ixCasNrg) = var_info('ixCasNrg' , 'index of canopy air space energy state variable' , '-', get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - indx_meta(iLookINDEX%ixVegNrg) = var_info('ixVegNrg' , 'index of canopy energy state variable' , '-', get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - indx_meta(iLookINDEX%ixVegHyd) = var_info('ixVegHyd' , 'index of canopy hydrology state variable (mass)' , '-', get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - indx_meta(iLookINDEX%ixTopNrg) = var_info('ixTopNrg' , 'index of upper-most energy state in the snow+soil subdomain' , '-', get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - indx_meta(iLookINDEX%ixTopHyd) = var_info('ixTopHyd' , 'index of upper-most hydrology state in the snow+soil subdomain' , '-', get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - indx_meta(iLookINDEX%ixAqWat) = var_info('ixAqWat' , 'index of storage of water in the aquifer' , '-', get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - ! vectors of indices for specific state types - indx_meta(iLookINDEX%ixNrgOnly) = var_info('ixNrgOnly' , 'indices IN THE STATE SUBSET for energy states' , '-', get_ixVarType('unknown'), iMissVec, iMissVec, .false.) - indx_meta(iLookINDEX%ixHydOnly) = var_info('ixHydOnly' , 'indices IN THE STATE SUBSET for hydrology states in the snow+soil domain', '-', get_ixVarType('unknown'), iMissVec, iMissVec, .false.) - indx_meta(iLookINDEX%ixMatOnly) = var_info('ixMatOnly' , 'indices IN THE STATE SUBSET for matric head state variables' , '-', get_ixVarType('unknown'), iMissVec, iMissVec, .false.) - indx_meta(iLookINDEX%ixMassOnly) = var_info('ixMassOnly' , 'indices IN THE STATE SUBSET for hydrology states (mass of water)' , '-', get_ixVarType('unknown'), iMissVec, iMissVec, .false.) - ! vectors of indices for specific state types within specific sub-domains - indx_meta(iLookINDEX%ixSnowSoilNrg) = var_info('ixSnowSoilNrg' , 'indices IN THE STATE SUBSET for energy states in the snow+soil domain' , '-', get_ixVarType('midToto'), iMissVec, iMissVec, .false.) - indx_meta(iLookINDEX%ixSnowOnlyNrg) = var_info('ixSnowOnlyNrg' , 'indices IN THE STATE SUBSET for energy states in the snow domain' , '-', get_ixVarType('midSnow'), iMissVec, iMissVec, .false.) - indx_meta(iLookINDEX%ixSoilOnlyNrg) = var_info('ixSoilOnlyNrg' , 'indices IN THE STATE SUBSET for energy states in the soil domain' , '-', get_ixVarType('midSoil'), iMissVec, iMissVec, .false.) - indx_meta(iLookINDEX%ixSnowSoilHyd) = var_info('ixSnowSoilHyd' , 'indices IN THE STATE SUBSET for hydrology states in the snow+soil domain', '-', get_ixVarType('midToto'), iMissVec, iMissVec, .false.) - indx_meta(iLookINDEX%ixSnowOnlyHyd) = var_info('ixSnowOnlyHyd' , 'indices IN THE STATE SUBSET for hydrology states in the snow domain' , '-', get_ixVarType('midSnow'), iMissVec, iMissVec, .false.) - indx_meta(iLookINDEX%ixSoilOnlyHyd) = var_info('ixSoilOnlyHyd' , 'indices IN THE STATE SUBSET for hydrology states in the soil domain' , '-', get_ixVarType('midSoil'), iMissVec, iMissVec, .false.) - ! vectors of indices for specfic state types within specific sub-domains - indx_meta(iLookINDEX%ixNrgCanair) = var_info('ixNrgCanair' , 'indices IN THE FULL VECTOR for energy states in canopy air space domain' , '-', get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - indx_meta(iLookINDEX%ixNrgCanopy) = var_info('ixNrgCanopy' , 'indices IN THE FULL VECTOR for energy states in the canopy domain' , '-', get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - indx_meta(iLookINDEX%ixHydCanopy) = var_info('ixHydCanopy' , 'indices IN THE FULL VECTOR for hydrology states in the canopy domain' , '-', get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - indx_meta(iLookINDEX%ixNrgLayer) = var_info('ixNrgLayer' , 'indices IN THE FULL VECTOR for energy states in the snow+soil domain' , '-', get_ixVarType('midToto'), iMissVec, iMissVec, .false.) - indx_meta(iLookINDEX%ixHydLayer) = var_info('ixHydLayer' , 'indices IN THE FULL VECTOR for hydrology states in the snow+soil domain' , '-', get_ixVarType('midToto'), iMissVec, iMissVec, .false.) - indx_meta(iLookINDEX%ixWatAquifer) = var_info('ixWatAquifer' , 'indices IN THE FULL VECTOR for storage of water in the aquifer' , '-', get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - ! vectors of indices for specific state types IN SPECIFIC SUB-DOMAINS - indx_meta(iLookINDEX%ixVolFracWat) = var_info('ixVolFracWat' , 'indices IN THE SNOW+SOIL VECTOR for hyd states' , '-', get_ixVarType('unknown'), iMissVec, iMissVec, .false.) - indx_meta(iLookINDEX%ixMatricHead) = var_info('ixMatricHead' , 'indices IN THE SOIL VECTOR for hyd states' , '-', get_ixVarType('unknown'), iMissVec, iMissVec, .false.) - ! indices within state vectors - indx_meta(iLookINDEX%ixAllState) = var_info('ixAllState' , 'list of indices for all model state variables' , '-', get_ixVarType('unknown'), iMissVec, iMissVec, .false.) - indx_meta(iLookINDEX%ixSoilState) = var_info('ixSoilState' , 'list of indices for all soil layers' , '-', get_ixVarType('midSoil'), iMissVec, iMissVec, .false.) - indx_meta(iLookINDEX%ixLayerState) = var_info('ixLayerState' , 'list of indices for all model layers' , '-', get_ixVarType('midToto'), iMissVec, iMissVec, .false.) - indx_meta(iLookINDEX%ixLayerActive) = var_info('ixLayerActive' , 'list of indices for active model layers (inactive=integerMissing)' , '-', get_ixVarType('midToto'), iMissVec, iMissVec, .false.) - ! number of trials - indx_meta(iLookINDEX%numberFluxCalc) = var_info('numberFluxCalc' , 'number of flux calculations' , '-', get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - indx_meta(iLookINDEX%numberStateSplit) = var_info('numberStateSplit' , 'number of state splitting solutions' , '-', get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - indx_meta(iLookINDEX%numberDomainSplitNrg) = var_info('numberDomainSplitNrg' , 'number of domain splitting solutions for energy' , '-', get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - indx_meta(iLookINDEX%numberDomainSplitMass) = var_info('numberDomainSplitMass', 'number of domain splitting solutions for mass' , '-', get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - indx_meta(iLookINDEX%numberScalarSolutions) = var_info('numberScalarSolutions', 'number of scalar solutions' , '-', get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) - - - ! read file to define model output (modifies metadata structures) - call read_output_file(err,cmessage) - if (err.ne.0) message=trim(message)//trim(cmessage) - - end subroutine popMetadat - - ! ------------------------------------------------ - ! subroutine to populate write commands from file input - ! ------------------------------------------------ - subroutine read_output_file(err,message) - USE netcdf - ! to get name of output control file from user - USE summaActors_FileManager,only:SETTINGS_PATH ! path for metadata files - USE summaActors_FileManager,only:OUTPUT_CONTROL ! file with output controls - - ! some dimensional parameters - USE globalData, only:outFreq ! output frequencies - USE var_lookup, only:maxvarFreq ! maximum # of output files - USE var_lookup, only:maxvarStat ! maximum # of statistics - - ! metadata structures - USE globalData, only: time_meta ! data structure for time metadata - USE globalData, only: forc_meta ! data structure for forcing metadata - USE globalData, only: type_meta ! data structure for categorical metadata - USE globalData, only: attr_meta ! data structure for attribute metadata - USE globalData, only: mpar_meta ! data structure for local parameter metadata - USE globalData, only: bpar_meta ! data structure for basin parameter metadata - USE globalData, only: bvar_meta ! data structure for basin model variable metadata - USE globalData, only: indx_meta ! data structure for index metadata - USE globalData, only: prog_meta ! data structure for local prognostic (state) variables - USE globalData, only: diag_meta ! data structure for local diagnostic variables - USE globalData, only: flux_meta ! data structure for local flux variables - USE globalData, only: deriv_meta ! data structure for local flux derivatives - USE globalData, only: outputPrecision ! data structure for output precision - - ! structures of named variables - USE var_lookup, only: iLookTYPE ! named variables for categorical data - USE var_lookup, only: iLookID ! named variables for hru and gru ID metadata - USE var_lookup, only: iLookFORCE ! named variables for forcing data structure - USE var_lookup, only: iLookINDEX ! named variables for index variable data structure - USE var_lookup, only: iLookSTAT ! named variables for statitics variable data structure - USE var_lookup, only: iLookFREQ ! named variables for model output frequencies - - ! identify indices within structures - USE get_ixName_module,only:get_ixUnknown ! identify index in any structure - USE get_ixname_module,only:get_ixFreq ! identify index of model output frequency - USE get_ixname_module,only:get_ixStat ! identify index in ststistics structure - USE get_ixname_module,only:get_statName ! identify statistics name from the index - - ! modules to read ASCII data - USE ascii_util_module,only:file_open ! open file - USE ascii_util_module,only:linewidth ! match character number for one line - USE ascii_util_module,only:get_vlines ! get a vector of non-comment lines - USE ascii_util_module,only:split_line ! split a line into words - implicit none - - ! dummy variables - integer(i4b),intent(out) :: err ! error code - character(*),intent(out) :: message ! error message - - ! define file format - integer(i4b),parameter :: noStatsDesired=1001 ! no statistic desired (temporally constant variables) - integer(i4b),parameter :: provideStatName=1002 ! provide the name of the desired statistic - integer(i4b),parameter :: provideStatFlags=1003 ! provide flags defining the desired statistic - integer(i4b) :: fileFormat ! the file format - - ! define statistics flags - logical(lgt),dimension(maxvarStat) :: statFlag ! vector of statistics flags - character(len=32) :: statName ! name of desired statistic - integer(i4b) :: iStat ! index of statistics vector - - ! define frequency of model output - character(len=64) :: freqName ! name of desired output frequency - integer(i4b) :: iFreq ! index of frequency vector - - ! general local variables - character(LEN=256) :: cmessage ! error message of downwind routine - character(LEN=256) :: outfile ! full path of model output file - integer(i4b) :: unt ! file unit - character(LEN=linewidth),allocatable :: charlines(:) ! vector of character strings - character(LEN=64),allocatable :: lineWords(:) ! vector to parse textline - integer(i4b) :: nWords ! number of words in line - character(LEN=128) :: varName ! variable name - character(LEN=5) :: structName ! name of structure - integer(i4b) :: vLine ! index for loop through variables - integer(i4b) :: vDex ! index into type lists - - ! initialize error control - err=0; message='read_output_file/' - - ! ********************************************************************************************** - ! (1) open file and read variable data - ! ********************************************************************************************** - outfile = trim(SETTINGS_PATH)//trim(OUTPUT_CONTROL) ! build filename - print *, outfile - call file_open(trim(outfile),unt,err,cmessage) ! open file - if(err/=0)then; message=trim(message)//trim(cmessage); return; end if - - ! ********************************************************************************************** - ! (2) read variable data (continue reading from previous point in the file) - ! ********************************************************************************************** - ! read the rest of the lines - call get_vlines(unt,charLines,err,cmessage) ! get a list of character strings from non-comment lines - if(err/=0)then; message=trim(message)//trim(cmessage); return; end if - close(unt) ! close the file - - ! ********************************************************************************************** - ! (3) loop to parse individual file lines - ! ********************************************************************************************** - - ! initialize output frequency - outFreq(:) = .false. - - ! loop through the lines in the file - do vLine = 1,size(charLines) - - ! parse the current line - call split_line(charLines(vLine),lineWords,err,cmessage) +subroutine popMetadat(err,message) + ! data structures + USE data_types, only: var_info ! data type for metadata structure + USE globalData, only: time_meta ! data structure for time metadata + USE globalData, only: forc_meta ! data structure for forcing metadata + USE globalData, only: type_meta ! data structure for categorical metadata + USE globalData, only: id_meta ! data structure for hru and gru ID metadata + USE globalData, only: attr_meta ! data structure for attribute metadata + USE globalData, only: mpar_meta ! data structure for local parameter metadata + USE globalData, only: bpar_meta ! data structure for basin parameter metadata + USE globalData, only: bvar_meta ! data structure for basin model variable metadata + USE globalData, only: indx_meta ! data structure for index metadata + USE globalData, only: prog_meta ! data structure for local prognostic (state) variables + USE globalData, only: diag_meta ! data structure for local diagnostic variables + USE globalData, only: flux_meta ! data structure for local flux variables + USE globalData, only: deriv_meta ! data structure for local flux derivatives + ! structures of named variables + USE var_lookup, only: iLookTIME ! named variables for time data structure + USE var_lookup, only: iLookFORCE ! named variables for forcing data structure + USE var_lookup, only: iLookTYPE ! named variables for categorical attribute data structure + USE var_lookup, only: iLookID ! named variables for hru and gru ID metadata + USE var_lookup, only: iLookATTR ! named variables for real valued attribute data structure + USE var_lookup, only: iLookPARAM ! named variables for local parameter data structure + USE var_lookup, only: iLookBPAR ! named variables for basin parameter data structure + USE var_lookup, only: iLookBVAR ! named variables for basin model variable data structure + USE var_lookup, only: iLookINDEX ! named variables for index variable data structure + USE var_lookup, only: iLookPROG ! named variables for local state variables + USE var_lookup, only: iLookDIAG ! named variables for local diagnostic variables + USE var_lookup, only: iLookFLUX ! named variables for local flux variables + USE var_lookup, only: iLookDERIV ! named variables for local flux derivatives + USE var_lookup, only: maxvarFreq ! number of output frequencies + USE var_lookup, only: maxvarStat ! number of statistics + USE get_ixName_module,only:get_ixVarType ! to turn vartype strings to integers + implicit none + ! dummy variables + integer(i4b),intent(out) :: err ! error code + character(*),intent(out) :: message ! error message + ! internals + character(256) :: cmessage ! error message + integer,dimension(maxVarFreq) :: iMissVec ! vector of missing integers + ! initialize error control + err=0; message='popMetadat/' + + ! init arrays for structure constructors + iMissVec(:) = integerMissing + ! ----- + ! * model time structures... + ! -------------------------- + time_meta(iLookTIME%iyyy) = var_info('iyyy' , 'year' , '-', get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + time_meta(iLookTIME%im) = var_info('im' , 'month' , '-', get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + time_meta(iLookTIME%id) = var_info('id' , 'day' , '-', get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + time_meta(iLookTIME%ih) = var_info('ih' , 'hour' , '-', get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + time_meta(iLookTIME%imin) = var_info('imin' , 'minute' , '-', get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + time_meta(iLookTIME%ih_tz) = var_info('ih_tz' , 'hour for time zone offset' , '-', get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + time_meta(iLookTIME%imin_tz) = var_info('imin_tz', 'minute for time zone offset', '-', get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + + ! ----- + ! * model forcing data... + ! ----------------------- + forc_meta(iLookFORCE%time) = var_info('time' , 'time since time reference' , 'seconds since 1990-1-1 0:0:0.0 -0:00', get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + forc_meta(iLookFORCE%pptrate) = var_info('pptrate' , 'precipitation rate' , 'kg m-2 s-1' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + forc_meta(iLookFORCE%SWRadAtm) = var_info('SWRadAtm', 'downward shortwave radiation at the upper boundary', 'W m-2' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + forc_meta(iLookFORCE%LWRadAtm) = var_info('LWRadAtm', 'downward longwave radiation at the upper boundary' , 'W m-2' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + forc_meta(iLookFORCE%airtemp) = var_info('airtemp' , 'air temperature at the measurement height' , 'K' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + forc_meta(iLookFORCE%windspd) = var_info('windspd' , 'wind speed at the measurement height' , 'm s-1' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + forc_meta(iLookFORCE%airpres) = var_info('airpres' , 'air pressure at the the measurement height' , 'Pa' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + forc_meta(iLookFORCE%spechum) = var_info('spechum' , 'specific humidity at the measurement height' , 'g g-1' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + + ! ----- + ! * categorical data... + ! --------------------- + type_meta(iLookTYPE%vegTypeIndex) = var_info('vegTypeIndex' , 'index defining vegetation type' , '-', get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + type_meta(iLookTYPE%soilTypeIndex) = var_info('soilTypeIndex' , 'index defining soil type' , '-', get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + type_meta(iLookTYPE%slopeTypeIndex) = var_info('slopeTypeIndex', 'index defining slope' , '-', get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + type_meta(iLookTYPE%downHRUindex) = var_info('downHRUindex' , 'index of downslope HRU (0 = basin outlet)' , '-', get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + type_meta(iLookTYPE%downkHRU) = var_info('downkHRU' , 'real index of downslope HRU' , '-', get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + ! ----- + ! * hru and gru ID data... + ! --------------------- + id_meta(iLookID%hruId) = var_info('hruId' , 'ID defining the hydrologic response unit' , '-', get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + + ! ----- + ! * site characteristics... + ! ------------------------- + attr_meta(iLookATTR%latitude) = var_info('latitude' , 'latitude' , 'degrees north', get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + attr_meta(iLookATTR%longitude) = var_info('longitude' , 'longitude' , 'degrees east' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + attr_meta(iLookATTR%elevation) = var_info('elevation' , 'elevation' , 'm' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + attr_meta(iLookATTR%tan_slope) = var_info('tan_slope' , 'tan water table slope (tan local ground surface slope)', '-' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + attr_meta(iLookATTR%contourLength) = var_info('contourLength' , 'length of contour at downslope edge of HRU' , 'm' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + attr_meta(iLookATTR%HRUarea) = var_info('HRUarea' , 'area of each HRU' , 'm2' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + attr_meta(iLookATTR%mHeight) = var_info('mHeight' , 'measurement height above bare ground' , 'm' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + attr_meta(iLookATTR%aspect) = var_info('aspect' , 'mean azimuth of HRU in degrees East of North (0)' , 'degrees' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + ! ----- + ! * local parameter data... + ! ------------------------- + ! boundary conditions + mpar_meta(iLookPARAM%upperBoundHead) = var_info('upperBoundHead' , 'matric head at the upper boundary' , 'm' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + mpar_meta(iLookPARAM%lowerBoundHead) = var_info('lowerBoundHead' , 'matric head at the lower boundary' , 'm' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + mpar_meta(iLookPARAM%upperBoundTheta) = var_info('upperBoundTheta' , 'volumetric liquid water content at the upper boundary' , '-' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + mpar_meta(iLookPARAM%lowerBoundTheta) = var_info('lowerBoundTheta' , 'volumetric liquid water content at the lower boundary' , '-' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + mpar_meta(iLookPARAM%upperBoundTemp) = var_info('upperBoundTemp' , 'temperature of the upper boundary' , 'K' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + mpar_meta(iLookPARAM%lowerBoundTemp) = var_info('lowerBoundTemp' , 'temperature of the lower boundary' , 'K' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + ! precipitation partitioning + mpar_meta(iLookPARAM%tempCritRain) = var_info('tempCritRain' , 'critical temperature where precipitation is rain' , 'K' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + mpar_meta(iLookPARAM%tempRangeTimestep) = var_info('tempRangeTimestep' , 'temperature range over the time step' , 'K' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + mpar_meta(iLookPARAM%frozenPrecipMultip) = var_info('frozenPrecipMultip' , 'frozen precipitation multiplier' , '-' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + ! snow properties + mpar_meta(iLookPARAM%snowfrz_scale) = var_info('snowfrz_scale' , 'scaling parameter for the freezing curve for snow' , 'K-1' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + mpar_meta(iLookPARAM%fixedThermalCond_snow) = var_info('fixedThermalCond_snow' , 'temporally constant thermal conductivity for snow' , 'W m-1 K-1' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + ! snow albedo + mpar_meta(iLookPARAM%albedoMax) = var_info('albedoMax' , 'maximum snow albedo (single spectral band)' , '-' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + mpar_meta(iLookPARAM%albedoMinWinter) = var_info('albedoMinWinter' , 'minimum snow albedo during winter (single spectral band)' , '-' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + mpar_meta(iLookPARAM%albedoMinSpring) = var_info('albedoMinSpring' , 'minimum snow albedo during spring (single spectral band)' , '-' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + mpar_meta(iLookPARAM%albedoMaxVisible) = var_info('albedoMaxVisible' , 'maximum snow albedo in the visible part of the spectrum' , '-' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + mpar_meta(iLookPARAM%albedoMinVisible) = var_info('albedoMinVisible' , 'minimum snow albedo in the visible part of the spectrum' , '-' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + mpar_meta(iLookPARAM%albedoMaxNearIR) = var_info('albedoMaxNearIR' , 'maximum snow albedo in the near infra-red part of the spectrum' , '-' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + mpar_meta(iLookPARAM%albedoMinNearIR) = var_info('albedoMinNearIR' , 'minimum snow albedo in the near infra-red part of the spectrum' , '-' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + mpar_meta(iLookPARAM%albedoDecayRate) = var_info('albedoDecayRate' , 'albedo decay rate' , 's' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + mpar_meta(iLookPARAM%albedoSootLoad) = var_info('albedoSootLoad' , 'soot load factor' , '-' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + mpar_meta(iLookPARAM%albedoRefresh) = var_info('albedoRefresh' , 'critical mass necessary for albedo refreshment' , 'kg m-2' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + ! radiation transfer + mpar_meta(iLookPARAM%radExt_snow) = var_info('radExt_snow' , 'extinction coefficient for radiation penetration into snowpack' , 'm-1' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + mpar_meta(iLookPARAM%directScale) = var_info('directScale' , 'scaling factor for fractional driect radiaion parameterization' , '-' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + mpar_meta(iLookPARAM%Frad_direct) = var_info('Frad_direct' , 'fraction direct solar radiation' , '-' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + mpar_meta(iLookPARAM%Frad_vis) = var_info('Frad_vis' , 'fraction radiation in visible part of spectrum' , '-' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + ! new snow density + mpar_meta(iLookPARAM%newSnowDenMin) = var_info('newSnowDenMin' , 'minimum new snow density' , 'kg m-3' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + mpar_meta(iLookPARAM%newSnowDenMult) = var_info('newSnowDenMult' , 'multiplier for new snow density' , 'kg m-3' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + mpar_meta(iLookPARAM%newSnowDenScal) = var_info('newSnowDenScal' , 'scaling factor for new snow density' , 'K' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + mpar_meta(iLookPARAM%constSnowDen) = var_info('constSnowDen' , 'Constant new snow density' , 'kg m-3' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + mpar_meta(iLookPARAM%newSnowDenAdd) = var_info('newSnowDenAdd' , 'Pahaut 1976, additive factor for new snow density' , 'kg m-3' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + mpar_meta(iLookPARAM%newSnowDenMultTemp) = var_info('newSnowDenMultTemp' , 'Pahaut 1976, multiplier for new snow density for air temperature' , 'kg m-3 K-1' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + mpar_meta(iLookPARAM%newSnowDenMultWind) = var_info('newSnowDenMultWind' , 'Pahaut 1976, multiplier for new snow density for wind speed' , 'kg m-7/2 s-1/2' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + mpar_meta(iLookPARAM%newSnowDenMultAnd) = var_info('newSnowDenMultAnd' , 'Anderson 1976, multiplier for new snow density (Anderson func)' , 'K-1' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + mpar_meta(iLookPARAM%newSnowDenBase) = var_info('newSnowDenBase' , 'Anderson 1976, base value that is rasied to the (3/2) power' , 'K' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + ! snow compaction + mpar_meta(iLookPARAM%densScalGrowth) = var_info('densScalGrowth' , 'density scaling factor for grain growth' , 'kg-1 m3' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + mpar_meta(iLookPARAM%tempScalGrowth) = var_info('tempScalGrowth' , 'temperature scaling factor for grain growth' , 'K-1' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + mpar_meta(iLookPARAM%grainGrowthRate) = var_info('grainGrowthRate' , 'rate of grain growth' , 's-1' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + mpar_meta(iLookPARAM%densScalOvrbdn) = var_info('densScalOvrbdn' , 'density scaling factor for overburden pressure' , 'kg-1 m3' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + mpar_meta(iLookPARAM%tempScalOvrbdn) = var_info('tempScalOvrbdn' , 'temperature scaling factor for overburden pressure' , 'K-1' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + mpar_meta(iLookPARAM%baseViscosity ) = var_info('baseViscosity ' , 'viscosity coefficient at T=T_frz and snow density=0' , 'kg s m-2' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + ! water flow through snow + mpar_meta(iLookPARAM%Fcapil) = var_info('Fcapil' , 'capillary retention (fraction of total pore volume)' , '-' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + mpar_meta(iLookPARAM%k_snow) = var_info('k_snow' , 'hydraulic conductivity of snow' , 'm s-1' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + mpar_meta(iLookPARAM%mw_exp) = var_info('mw_exp' , 'exponent for meltwater flow' , '-' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + ! turbulent heat fluxes + mpar_meta(iLookPARAM%z0Snow) = var_info('z0Snow' , 'roughness length of snow' , 'm' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + mpar_meta(iLookPARAM%z0Soil) = var_info('z0Soil' , 'roughness length of bare soil below the canopy' , 'm' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + mpar_meta(iLookPARAM%z0Canopy) = var_info('z0Canopy' , 'roughness length of the canopy' , 'm' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + mpar_meta(iLookPARAM%zpdFraction) = var_info('zpdFraction' , 'zero plane displacement / canopy height' , '-' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + mpar_meta(iLookPARAM%critRichNumber) = var_info('critRichNumber' , 'critical value for the bulk Richardson number' , '-' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + mpar_meta(iLookPARAM%Louis79_bparam) = var_info('Louis79_bparam' , 'parameter in Louis (1979) stability function' , '-' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + mpar_meta(iLookPARAM%Louis79_cStar) = var_info('Louis79_cStar' , 'parameter in Louis (1979) stability function' , '-' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + mpar_meta(iLookPARAM%Mahrt87_eScale) = var_info('Mahrt87_eScale' , 'exponential scaling factor in the Mahrt (1987) stability function', '-' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + mpar_meta(iLookPARAM%leafExchangeCoeff) = var_info('leafExchangeCoeff' , 'turbulent exchange coeff between canopy surface and canopy air' , 'm s-(1/2)' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + mpar_meta(iLookPARAM%windReductionParam) = var_info('windReductionParam' , 'canopy wind reduction parameter' , '-' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + ! stomatal conductance + mpar_meta(iLookPARAM%Kc25) = var_info('Kc25' , 'Michaelis-Menten constant for CO2 at 25 degrees C' , 'umol mol-1' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + mpar_meta(iLookPARAM%Ko25) = var_info('Ko25' , 'Michaelis-Menten constant for O2 at 25 degrees C' , 'mol mol-1' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + mpar_meta(iLookPARAM%Kc_qFac) = var_info('Kc_qFac' , 'factor in the q10 function defining temperature controls on Kc' , '-' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + mpar_meta(iLookPARAM%Ko_qFac) = var_info('Ko_qFac' , 'factor in the q10 function defining temperature controls on Ko' , '-' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + mpar_meta(iLookPARAM%kc_Ha) = var_info('kc_Ha' , 'activation energy for the Michaelis-Menten constant for CO2' , 'J mol-1' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + mpar_meta(iLookPARAM%ko_Ha) = var_info('ko_Ha' , 'activation energy for the Michaelis-Menten constant for O2' , 'J mol-1' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + mpar_meta(iLookPARAM%vcmax25_canopyTop) = var_info('vcmax25_canopyTop' , 'potential carboxylation rate at 25 degrees C at the canopy top' , 'umol co2 m-2 s-1', get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + mpar_meta(iLookPARAM%vcmax_qFac) = var_info('vcmax_qFac' , 'factor in the q10 function defining temperature controls on vcmax', '-' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + mpar_meta(iLookPARAM%vcmax_Ha) = var_info('vcmax_Ha' , 'activation energy in the vcmax function' , 'J mol-1' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + mpar_meta(iLookPARAM%vcmax_Hd) = var_info('vcmax_Hd' , 'deactivation energy in the vcmax function' , 'J mol-1' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + mpar_meta(iLookPARAM%vcmax_Sv) = var_info('vcmax_Sv' , 'entropy term in the vcmax function' , 'J mol-1 K-1' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + mpar_meta(iLookPARAM%vcmax_Kn) = var_info('vcmax_Kn' , 'foliage nitrogen decay coefficient' , '-' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + mpar_meta(iLookPARAM%jmax25_scale) = var_info('jmax25_scale' , 'scaling factor to relate jmax25 to vcmax25' , '-' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + mpar_meta(iLookPARAM%jmax_Ha) = var_info('jmax_Ha' , 'activation energy in the jmax function' , 'J mol-1' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + mpar_meta(iLookPARAM%jmax_Hd) = var_info('jmax_Hd' , 'deactivation energy in the jmax function' , 'J mol-1' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + mpar_meta(iLookPARAM%jmax_Sv) = var_info('jmax_Sv' , 'entropy term in the jmax function' , 'J mol-1 K-1' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + mpar_meta(iLookPARAM%fractionJ) = var_info('fractionJ' , 'fraction of light lost by other than the chloroplast lamellae' , '-' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + mpar_meta(iLookPARAM%quantamYield) = var_info('quantamYield' , 'quantam yield' , 'mol e mol-1 q' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + mpar_meta(iLookPARAM%vpScaleFactor) = var_info('vpScaleFactor' , 'vapor pressure scaling factor in stomatal conductance function' , 'Pa' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + mpar_meta(iLookPARAM%cond2photo_slope) = var_info('cond2photo_slope' , 'slope of conductance-photosynthesis relationship' , '-' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + mpar_meta(iLookPARAM%minStomatalConductance)= var_info('minStomatalConductance', 'minimum stomatal conductance' , 'umol H2O m-2 s-1', get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + ! vegetation properties + mpar_meta(iLookPARAM%winterSAI) = var_info('winterSAI' , 'stem area index prior to the start of the growing season' , 'm2 m-2' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + mpar_meta(iLookPARAM%summerLAI) = var_info('summerLAI' , 'maximum leaf area index at the peak of the growing season' , 'm2 m-2' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + mpar_meta(iLookPARAM%rootScaleFactor1) = var_info('rootScaleFactor1' , '1st scaling factor (a) in Y = 1 - 0.5*( exp(-aZ) + exp(-bZ) )' , 'm-1' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + mpar_meta(iLookPARAM%rootScaleFactor2) = var_info('rootScaleFactor2' , '2nd scaling factor (b) in Y = 1 - 0.5*( exp(-aZ) + exp(-bZ) )' , 'm-1' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + mpar_meta(iLookPARAM%rootingDepth) = var_info('rootingDepth' , 'rooting depth' , 'm' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + mpar_meta(iLookPARAM%rootDistExp) = var_info('rootDistExp' , 'exponent for the vertical distribution of root density' , '-' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + mpar_meta(iLookPARAM%plantWiltPsi) = var_info('plantWiltPsi' , 'matric head at wilting point' , 'm' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + mpar_meta(iLookPARAM%soilStressParam) = var_info('soilStressParam' , 'parameter in the exponential soil stress function' , '-' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + mpar_meta(iLookPARAM%critSoilWilting) = var_info('critSoilWilting' , 'critical vol. liq. water content when plants are wilting' , '-' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + mpar_meta(iLookPARAM%critSoilTranspire) = var_info('critSoilTranspire' , 'critical vol. liq. water content when transpiration is limited' , '-' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + mpar_meta(iLookPARAM%critAquiferTranspire) = var_info('critAquiferTranspire' , 'critical aquifer storage value when transpiration is limited' , 'm' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + mpar_meta(iLookPARAM%minStomatalResistance) = var_info('minStomatalResistance' , 'minimum stomatal resistance' , 's m-1' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + mpar_meta(iLookPARAM%leafDimension) = var_info('leafDimension' , 'characteristic leaf dimension' , 'm' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + mpar_meta(iLookPARAM%heightCanopyTop) = var_info('heightCanopyTop' , 'height of top of the vegetation canopy above ground surface' , 'm' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + mpar_meta(iLookPARAM%heightCanopyBottom) = var_info('heightCanopyBottom' , 'height of bottom of the vegetation canopy above ground surface' , 'm' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + mpar_meta(iLookPARAM%specificHeatVeg) = var_info('specificHeatVeg' , 'specific heat of vegetation' , 'J kg-1 K-1' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + mpar_meta(iLookPARAM%maxMassVegetation) = var_info('maxMassVegetation' , 'maximum mass of vegetation (full foliage)' , 'kg m-2' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + mpar_meta(iLookPARAM%throughfallScaleSnow) = var_info('throughfallScaleSnow' , 'scaling factor for throughfall (snow)' , '-' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + mpar_meta(iLookPARAM%throughfallScaleRain) = var_info('throughfallScaleRain' , 'scaling factor for throughfall (rain)' , '-' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + mpar_meta(iLookPARAM%refInterceptCapSnow) = var_info('refInterceptCapSnow' , 'reference canopy interception capacity per unit leaf area (snow)' , 'kg m-2' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + mpar_meta(iLookPARAM%refInterceptCapRain) = var_info('refInterceptCapRain' , 'canopy interception capacity per unit leaf area (rain)' , 'kg m-2' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + mpar_meta(iLookPARAM%snowUnloadingCoeff) = var_info('snowUnloadingCoeff' , 'time constant for unloading of snow from the forest canopy' , 's-1' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + mpar_meta(iLookPARAM%canopyDrainageCoeff) = var_info('canopyDrainageCoeff' , 'time constant for drainage of liquid water from the forest canopy', 's-1' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + mpar_meta(iLookPARAM%ratioDrip2Unloading) = var_info('ratioDrip2Unloading' , 'ratio of canopy drip to unloading of snow from the forest canopy' , '-' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + mpar_meta(iLookPARAM%canopyWettingFactor) = var_info('canopyWettingFactor' , 'maximum wetted fraction of the canopy' , '-' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + mpar_meta(iLookPARAM%canopyWettingExp) = var_info('canopyWettingExp' , 'exponent in canopy wetting function' , '-' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + mpar_meta(iLookPARAM%minTempUnloading) = var_info('minTempUnloading' , 'min temp for unloading in windySnow' , 'K' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + mpar_meta(iLookPARAM%rateTempUnloading) = var_info('rateTempUnloading' , 'how quickly to unload due to temperature' , 'K s' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + mpar_meta(iLookPARAM%minWindUnloading) = var_info('minWindUnloading' , 'min wind speed for unloading in windySnow' , 'm s-1' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + mpar_meta(iLookPARAM%rateWindUnloading) = var_info('rateWindUnloading' , 'how quickly to unload due to wind' , 'm' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + ! soil properties + mpar_meta(iLookPARAM%soil_dens_intr) = var_info('soil_dens_intr' , 'intrinsic soil density' , 'kg m-3' , get_ixVarType('parSoil'), iMissVec, iMissVec, .false.) + mpar_meta(iLookPARAM%thCond_soil) = var_info('thCond_soil' , 'thermal conductivity of soil (includes quartz and other minerals)', 'W m-1 K-1' , get_ixVarType('parSoil'), iMissVec, iMissVec, .false.) + mpar_meta(iLookPARAM%frac_sand) = var_info('frac_sand' , 'fraction of sand' , '-' , get_ixVarType('parSoil'), iMissVec, iMissVec, .false.) + mpar_meta(iLookPARAM%frac_silt) = var_info('frac_silt' , 'fraction of silt' , '-' , get_ixVarType('parSoil'), iMissVec, iMissVec, .false.) + mpar_meta(iLookPARAM%frac_clay) = var_info('frac_clay' , 'fraction of clay' , '-' , get_ixVarType('parSoil'), iMissVec, iMissVec, .false.) + mpar_meta(iLookPARAM%theta_sat) = var_info('theta_sat' , 'soil porosity' , '-' , get_ixVarType('parSoil'), iMissVec, iMissVec, .false.) + mpar_meta(iLookPARAM%theta_res) = var_info('theta_res' , 'volumetric residual water content' , '-' , get_ixVarType('parSoil'), iMissVec, iMissVec, .false.) + mpar_meta(iLookPARAM%vGn_alpha) = var_info('vGn_alpha' , 'van Genuchten "alpha" parameter' , 'm-1' , get_ixVarType('parSoil'), iMissVec, iMissVec, .false.) + mpar_meta(iLookPARAM%vGn_n) = var_info('vGn_n' , 'van Genuchten "n" parameter' , '-' , get_ixVarType('parSoil'), iMissVec, iMissVec, .false.) + mpar_meta(iLookPARAM%k_soil) = var_info('k_soil' , 'saturated hydraulic conductivity' , 'm s-1' , get_ixVarType('parSoil'), iMissVec, iMissVec, .false.) + mpar_meta(iLookPARAM%k_macropore) = var_info('k_macropore' , 'saturated hydraulic conductivity for macropores' , 'm s-1' , get_ixVarType('parSoil'), iMissVec, iMissVec, .false.) + ! scalar soil properties + mpar_meta(iLookPARAM%fieldCapacity) = var_info('fieldCapacity' , 'soil field capacity (vol liq water content when baseflow begins)' , '-' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + mpar_meta(iLookPARAM%wettingFrontSuction) = var_info('wettingFrontSuction' , 'Green-Ampt wetting front suction' , 'm' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + mpar_meta(iLookPARAM%theta_mp) = var_info('theta_mp' , 'volumetric liquid water content when macropore flow begins' , '-' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + mpar_meta(iLookPARAM%mpExp) = var_info('mpExp' , 'empirical exponent in macropore flow equation' , '-' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + mpar_meta(iLookPARAM%kAnisotropic) = var_info('kAnisotropic' , 'anisotropy factor for lateral hydraulic conductivity' , '-' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + mpar_meta(iLookPARAM%zScale_TOPMODEL) = var_info('zScale_TOPMODEL' , 'TOPMODEL scaling factor used in lower boundary condition for soil', 'm' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + mpar_meta(iLookPARAM%compactedDepth) = var_info('compactedDepth' , 'depth where k_soil reaches the compacted value given by CH78' , 'm' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + mpar_meta(iLookPARAM%aquiferBaseflowRate) = var_info('aquiferBaseflowRate' , 'baseflow rate when aquifer storage = aquiferScaleFactor' , 'm s-1' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + mpar_meta(iLookPARAM%aquiferScaleFactor) = var_info('aquiferScaleFactor' , 'scaling factor for aquifer storage in the big bucket' , 'm' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + mpar_meta(iLookPARAM%aquiferBaseflowExp) = var_info('aquiferBaseflowExp' , 'baseflow exponent' , '-' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + mpar_meta(iLookPARAM%qSurfScale) = var_info('qSurfScale' , 'scaling factor in the surface runoff parameterization' , '-' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + mpar_meta(iLookPARAM%specificYield) = var_info('specificYield' , 'specific yield' , '-' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + mpar_meta(iLookPARAM%specificStorage) = var_info('specificStorage' , 'specific storage coefficient' , 'm-1' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + mpar_meta(iLookPARAM%f_impede) = var_info('f_impede' , 'ice impedence factor' , '-' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + mpar_meta(iLookPARAM%soilIceScale) = var_info('soilIceScale' , 'scaling factor for depth of soil ice, used to get frozen fraction', 'm' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + mpar_meta(iLookPARAM%soilIceCV) = var_info('soilIceCV' , 'CV of depth of soil ice, used to get frozen fraction' , '-' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + ! algorithmic control parameters + mpar_meta(iLookPARAM%minwind) = var_info('minwind' , 'minimum wind speed' , 'm s-1' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + mpar_meta(iLookPARAM%minstep) = var_info('minstep' , 'minimum length of the time step' , 's' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + mpar_meta(iLookPARAM%maxstep) = var_info('maxstep' , 'maximum length of the time step' , 's' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + mpar_meta(iLookPARAM%wimplicit) = var_info('wimplicit' , 'weight assigned to the start-of-step fluxes (alpha)' , '-' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + mpar_meta(iLookPARAM%maxiter) = var_info('maxiter' , 'maximum number of iterations' , '-' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + mpar_meta(iLookPARAM%relConvTol_liquid) = var_info('relConvTol_liquid' , 'relative convergence tolerance for vol frac liq water' , '-' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + mpar_meta(iLookPARAM%absConvTol_liquid) = var_info('absConvTol_liquid' , 'absolute convergence tolerance for vol frac liq water' , '-' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + mpar_meta(iLookPARAM%relConvTol_matric) = var_info('relConvTol_matric' , 'relative convergence tolerance for matric head' , '-' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + mpar_meta(iLookPARAM%absConvTol_matric) = var_info('absConvTol_matric' , 'absolute convergence tolerance for matric head' , 'm' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + mpar_meta(iLookPARAM%relConvTol_energy) = var_info('relConvTol_energy' , 'relative convergence tolerance for energy' , '-' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + mpar_meta(iLookPARAM%absConvTol_energy) = var_info('absConvTol_energy' , 'absolute convergence tolerance for energy' , 'J m-3' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + mpar_meta(iLookPARAM%relConvTol_aquifr) = var_info('relConvTol_aquifr' , 'relative convergence tolerance for aquifer storage' , '-' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + mpar_meta(iLookPARAM%absConvTol_aquifr) = var_info('absConvTol_aquifr' , 'absolute convergence tolerance for aquifer storage' , 'm' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + mpar_meta(iLookPARAM%zmin) = var_info('zmin' , 'minimum layer depth' , 'm' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + mpar_meta(iLookPARAM%zmax) = var_info('zmax' , 'maximum layer depth' , 'm' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + mpar_meta(iLookPARAM%zminLayer1) = var_info('zminLayer1' , 'minimum layer depth for the 1st (top) layer' , 'm' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + mpar_meta(iLookPARAM%zminLayer2) = var_info('zminLayer2' , 'minimum layer depth for the 2nd layer' , 'm' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + mpar_meta(iLookPARAM%zminLayer3) = var_info('zminLayer3' , 'minimum layer depth for the 3rd layer' , 'm' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + mpar_meta(iLookPARAM%zminLayer4) = var_info('zminLayer4' , 'minimum layer depth for the 4th layer' , 'm' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + mpar_meta(iLookPARAM%zminLayer5) = var_info('zminLayer5' , 'minimum layer depth for the 5th (bottom) layer' , 'm' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + mpar_meta(iLookPARAM%zmaxLayer1_lower) = var_info('zmaxLayer1_lower' , 'maximum layer depth for the 1st (top) layer when only 1 layer' , 'm' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + mpar_meta(iLookPARAM%zmaxLayer2_lower) = var_info('zmaxLayer2_lower' , 'maximum layer depth for the 2nd layer when only 2 layers' , 'm' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + mpar_meta(iLookPARAM%zmaxLayer3_lower) = var_info('zmaxLayer3_lower' , 'maximum layer depth for the 3rd layer when only 3 layers' , 'm' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + mpar_meta(iLookPARAM%zmaxLayer4_lower) = var_info('zmaxLayer4_lower' , 'maximum layer depth for the 4th layer when only 4 layers' , 'm' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + mpar_meta(iLookPARAM%zmaxLayer1_upper) = var_info('zmaxLayer1_upper' , 'maximum layer depth for the 1st (top) layer when > 1 layer' , 'm' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + mpar_meta(iLookPARAM%zmaxLayer2_upper) = var_info('zmaxLayer2_upper' , 'maximum layer depth for the 2nd layer when > 2 layers' , 'm' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + mpar_meta(iLookPARAM%zmaxLayer3_upper) = var_info('zmaxLayer3_upper' , 'maximum layer depth for the 3rd layer when > 3 layers' , 'm' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + mpar_meta(iLookPARAM%zmaxLayer4_upper) = var_info('zmaxLayer4_upper' , 'maximum layer depth for the 4th layer when > 4 layers' , 'm' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + + ! ----- + ! * basin parameter data... + ! ------------------------- + bpar_meta(iLookBPAR%basin__aquiferHydCond) = var_info('basin__aquiferHydCond' , 'hydraulic conductivity of the aquifer' , 'm s-1', get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + bpar_meta(iLookBPAR%basin__aquiferScaleFactor) = var_info('basin__aquiferScaleFactor', 'scaling factor for aquifer storage in the big bucket' , 'm' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + bpar_meta(iLookBPAR%basin__aquiferBaseflowExp) = var_info('basin__aquiferBaseflowExp', 'baseflow exponent for the big bucket' , '-' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + bpar_meta(iLookBPAR%routingGammaShape) = var_info('routingGammaShape' , 'shape parameter in Gamma distribution used for sub-grid routing', '-' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + bpar_meta(iLookBPAR%routingGammaScale) = var_info('routingGammaScale' , 'scale parameter in Gamma distribution used for sub-grid routing', 's' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + + ! ----- + ! * local model prognostic (state) variables... + ! --------------------------------------------- + ! define variables for time stepping + prog_meta(iLookPROG%dt_init) = var_info('dt_init' , 'length of initial time step at start of next data interval' , 's' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + ! state variables for vegetation + prog_meta(iLookPROG%scalarCanopyIce) = var_info('scalarCanopyIce' , 'mass of ice on the vegetation canopy' , 'kg m-2' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + prog_meta(iLookPROG%scalarCanopyLiq) = var_info('scalarCanopyLiq' , 'mass of liquid water on the vegetation canopy' , 'kg m-2' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + prog_meta(iLookPROG%scalarCanopyWat) = var_info('scalarCanopyWat' , 'mass of total water on the vegetation canopy' , 'kg m-2' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + prog_meta(iLookPROG%scalarCanairTemp) = var_info('scalarCanairTemp' , 'temperature of the canopy air space' , 'K' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + prog_meta(iLookPROG%scalarCanopyTemp) = var_info('scalarCanopyTemp' , 'temperature of the vegetation canopy' , 'K' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + ! state variables for snow + prog_meta(iLookPROG%spectralSnowAlbedoDiffuse) = var_info('spectralSnowAlbedoDiffuse' , 'diffuse snow albedo for individual spectral bands' , '-' , get_ixVarType('wLength'), iMissVec, iMissVec, .false.) + prog_meta(iLookPROG%scalarSnowAlbedo) = var_info('scalarSnowAlbedo' , 'snow albedo for the entire spectral band' , '-' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + prog_meta(iLookPROG%scalarSnowDepth) = var_info('scalarSnowDepth' , 'total snow depth' , 'm' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + prog_meta(iLookPROG%scalarSWE) = var_info('scalarSWE' , 'snow water equivalent' , 'kg m-2' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + prog_meta(iLookPROG%scalarSfcMeltPond) = var_info('scalarSfcMeltPond' , 'ponded water caused by melt of the "snow without a layer"' , 'kg m-2' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + ! define state variables for the snow+soil domain + prog_meta(iLookPROG%mLayerTemp) = var_info('mLayerTemp' , 'temperature of each layer' , 'K' , get_ixVarType('midToto'), iMissVec, iMissVec, .false.) + prog_meta(iLookPROG%mLayerVolFracIce) = var_info('mLayerVolFracIce' , 'volumetric fraction of ice in each layer' , '-' , get_ixVarType('midToto'), iMissVec, iMissVec, .false.) + prog_meta(iLookPROG%mLayerVolFracLiq) = var_info('mLayerVolFracLiq' , 'volumetric fraction of liquid water in each layer' , '-' , get_ixVarType('midToto'), iMissVec, iMissVec, .false.) + prog_meta(iLookPROG%mLayerVolFracWat) = var_info('mLayerVolFracWat' , 'volumetric fraction of total water in each layer' , '-' , get_ixVarType('midToto'), iMissVec, iMissVec, .false.) + prog_meta(iLookPROG%mLayerMatricHead) = var_info('mLayerMatricHead' , 'matric head of water in the soil' , 'm' , get_ixVarType('midSoil'), iMissVec, iMissVec, .false.) + ! other state variables + prog_meta(iLookPROG%scalarAquiferStorage) = var_info('scalarAquiferStorage' , 'water required to bring aquifer to the bottom of the soil profile', 'm' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + prog_meta(iLookPROG%scalarSurfaceTemp) = var_info('scalarSurfaceTemp' , 'surface temperature (just a copy of the upper-layer temperature)' , 'K' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + ! define coordinate variables + prog_meta(iLookPROG%mLayerDepth) = var_info('mLayerDepth' , 'depth of each layer' , 'm' , get_ixVarType('midToto'), iMissVec, iMissVec, .false.) + prog_meta(iLookPROG%mLayerHeight) = var_info('mLayerHeight' , 'height of the layer mid-point (top of soil = 0)' , 'm' , get_ixVarType('midToto'), iMissVec, iMissVec, .false.) + prog_meta(iLookPROG%iLayerHeight) = var_info('iLayerHeight' , 'height of the layer interface (top of soil = 0)' , 'm' , get_ixVarType('ifcToto'), iMissVec, iMissVec, .false.) + + ! ----- + ! * local model diagnostic variables... + ! ------------------------------------- + ! local properties + diag_meta(iLookDIAG%scalarCanopyDepth) = var_info('scalarCanopyDepth' , 'canopy depth' , 'm' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + diag_meta(iLookDIAG%scalarGreenVegFraction) = var_info('scalarGreenVegFraction' , 'green vegetation fraction (used to compute LAI)' , '-' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + diag_meta(iLookDIAG%scalarBulkVolHeatCapVeg) = var_info('scalarBulkVolHeatCapVeg' , 'bulk volumetric heat capacity of vegetation' , 'J m-3 K-1' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + diag_meta(iLookDIAG%scalarCanopyEmissivity) = var_info('scalarCanopyEmissivity' , 'effective canopy emissivity' , '-' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + diag_meta(iLookDIAG%scalarRootZoneTemp) = var_info('scalarRootZoneTemp' , 'average temperature of the root zone' , 'K' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + diag_meta(iLookDIAG%scalarLAI) = var_info('scalarLAI' , 'one-sided leaf area index' , 'm2 m-2' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + diag_meta(iLookDIAG%scalarSAI) = var_info('scalarSAI' , 'one-sided stem area index' , 'm2 m-2' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + diag_meta(iLookDIAG%scalarExposedLAI) = var_info('scalarExposedLAI' , 'exposed leaf area index (after burial by snow)' , 'm2 m-2' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + diag_meta(iLookDIAG%scalarExposedSAI) = var_info('scalarExposedSAI' , 'exposed stem area index (after burial by snow)' , 'm2 m-2' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + diag_meta(iLookDIAG%scalarAdjMeasHeight) = var_info('scalarAdjMeasHeight' , 'adjusted measurement height for cases snowDepth>mHeight' , 'm' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + diag_meta(iLookDIAG%scalarCanopyIceMax) = var_info('scalarCanopyIceMax' , 'maximum interception storage capacity for ice' , 'kg m-2' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + diag_meta(iLookDIAG%scalarCanopyLiqMax) = var_info('scalarCanopyLiqMax' , 'maximum interception storage capacity for liquid water' , 'kg m-2' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + diag_meta(iLookDIAG%scalarGrowingSeasonIndex) = var_info('scalarGrowingSeasonIndex' , 'growing season index (0=off, 1=on)' , '-' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + diag_meta(iLookDIAG%scalarVolHtCap_air) = var_info('scalarVolHtCap_air' , 'volumetric heat capacity air' , 'J m-3 K-1' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + diag_meta(iLookDIAG%scalarVolHtCap_ice) = var_info('scalarVolHtCap_ice' , 'volumetric heat capacity ice' , 'J m-3 K-1' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + diag_meta(iLookDIAG%scalarVolHtCap_soil) = var_info('scalarVolHtCap_soil' , 'volumetric heat capacity dry soil' , 'J m-3 K-1' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + diag_meta(iLookDIAG%scalarVolHtCap_water) = var_info('scalarVolHtCap_water' , 'volumetric heat capacity liquid wat' , 'J m-3 K-1' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + diag_meta(iLookDIAG%mLayerVolHtCapBulk) = var_info('mLayerVolHtCapBulk' , 'volumetric heat capacity in each layer' , 'J m-3 K-1' , get_ixVarType('midToto'), iMissVec, iMissVec, .false.) + diag_meta(iLookDIAG%scalarLambda_drysoil) = var_info('scalarLambda_drysoil' , 'thermal conductivity of dry soil' , 'W m-1' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + diag_meta(iLookDIAG%scalarLambda_wetsoil) = var_info('scalarLambda_wetsoil' , 'thermal conductivity of wet soil' , 'W m-1' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + diag_meta(iLookDIAG%mLayerThermalC) = var_info('mLayerThermalC' , 'thermal conductivity at the mid-point of each layer' , 'W m-1 K-1' , get_ixVarType('midToto'), iMissVec, iMissVec, .false.) + diag_meta(iLookDIAG%iLayerThermalC) = var_info('iLayerThermalC' , 'thermal conductivity at the interface of each layer' , 'W m-1 K-1' , get_ixVarType('ifcToto'), iMissVec, iMissVec, .false.) + ! forcing + diag_meta(iLookDIAG%scalarVPair) = var_info('scalarVPair' , 'vapor pressure of the air above the vegetation canopy' , 'Pa' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + diag_meta(iLookDIAG%scalarVP_CanopyAir) = var_info('scalarVP_CanopyAir' , 'vapor pressure of the canopy air space' , 'Pa' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + diag_meta(iLookDIAG%scalarTwetbulb) = var_info('scalarTwetbulb' , 'wet bulb temperature' , 'K' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + diag_meta(iLookDIAG%scalarSnowfallTemp) = var_info('scalarSnowfallTemp' , 'temperature of fresh snow' , 'K' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + diag_meta(iLookDIAG%scalarNewSnowDensity) = var_info('scalarNewSnowDensity' , 'density of fresh snow' , 'kg m-3' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + diag_meta(iLookDIAG%scalarO2air) = var_info('scalarO2air' , 'atmospheric o2 concentration' , 'Pa' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + diag_meta(iLookDIAG%scalarCO2air) = var_info('scalarCO2air' , 'atmospheric co2 concentration' , 'Pa' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + ! shortwave radiation + diag_meta(iLookDIAG%scalarCosZenith) = var_info('scalarCosZenith' , 'cosine of the solar zenith angle' , '-' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + diag_meta(iLookDIAG%scalarFractionDirect) = var_info('scalarFractionDirect' , 'fraction of direct radiation (0-1)' , '-' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + diag_meta(iLookDIAG%scalarCanopySunlitFraction) = var_info('scalarCanopySunlitFraction' , 'sunlit fraction of canopy' , '-' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + diag_meta(iLookDIAG%scalarCanopySunlitLAI) = var_info('scalarCanopySunlitLAI' , 'sunlit leaf area' , '-' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + diag_meta(iLookDIAG%scalarCanopyShadedLAI) = var_info('scalarCanopyShadedLAI' , 'shaded leaf area' , '-' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + diag_meta(iLookDIAG%spectralAlbGndDirect) = var_info('spectralAlbGndDirect' , 'direct albedo of underlying surface for each spectral band' , '-' , get_ixVarType('wLength'), iMissVec, iMissVec, .false.) + diag_meta(iLookDIAG%spectralAlbGndDiffuse) = var_info('spectralAlbGndDiffuse' , 'diffuse albedo of underlying surface for each spectral band' , '-' , get_ixVarType('wLength'), iMissVec, iMissVec, .false.) + diag_meta(iLookDIAG%scalarGroundAlbedo) = var_info('scalarGroundAlbedo' , 'albedo of the ground surface' , '-' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + ! turbulent heat transfer + diag_meta(iLookDIAG%scalarLatHeatSubVapCanopy) = var_info('scalarLatHeatSubVapCanopy' , 'latent heat of sublimation/vaporization used for veg canopy' , 'J kg-1' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + diag_meta(iLookDIAG%scalarLatHeatSubVapGround) = var_info('scalarLatHeatSubVapGround' , 'latent heat of sublimation/vaporization used for ground surface' , 'J kg-1' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + diag_meta(iLookDIAG%scalarSatVP_CanopyTemp) = var_info('scalarSatVP_CanopyTemp' , 'saturation vapor pressure at the temperature of vegetation canopy', 'Pa' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + diag_meta(iLookDIAG%scalarSatVP_GroundTemp) = var_info('scalarSatVP_GroundTemp' , 'saturation vapor pressure at the temperature of the ground' , 'Pa' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + diag_meta(iLookDIAG%scalarZ0Canopy) = var_info('scalarZ0Canopy' , 'roughness length of the canopy' , 'm' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + diag_meta(iLookDIAG%scalarWindReductionFactor) = var_info('scalarWindReductionFactor' , 'canopy wind reduction factor' , '-' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + diag_meta(iLookDIAG%scalarZeroPlaneDisplacement) = var_info('scalarZeroPlaneDisplacement' , 'zero plane displacement' , 'm' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + diag_meta(iLookDIAG%scalarRiBulkCanopy) = var_info('scalarRiBulkCanopy' , 'bulk Richardson number for the canopy' , '-' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + diag_meta(iLookDIAG%scalarRiBulkGround) = var_info('scalarRiBulkGround' , 'bulk Richardson number for the ground surface' , '-' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + diag_meta(iLookDIAG%scalarCanopyStabilityCorrection) = var_info('scalarCanopyStabilityCorrection', 'stability correction for the canopy' , '-' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + diag_meta(iLookDIAG%scalarGroundStabilityCorrection) = var_info('scalarGroundStabilityCorrection', 'stability correction for the ground surface' , '-' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + ! evapotranspiration + diag_meta(iLookDIAG%scalarIntercellularCO2Sunlit) = var_info('scalarIntercellularCO2Sunlit' , 'carbon dioxide partial pressure of leaf interior (sunlit leaves)' , 'Pa' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + diag_meta(iLookDIAG%scalarIntercellularCO2Shaded) = var_info('scalarIntercellularCO2Shaded' , 'carbon dioxide partial pressure of leaf interior (shaded leaves)' , 'Pa' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + diag_meta(iLookDIAG%scalarTranspireLim) = var_info('scalarTranspireLim' , 'aggregate soil moisture and aquifer control on transpiration' , '-' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + diag_meta(iLookDIAG%scalarTranspireLimAqfr) = var_info('scalarTranspireLimAqfr' , 'aquifer storage control on transpiration' , '-' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + diag_meta(iLookDIAG%scalarFoliageNitrogenFactor) = var_info('scalarFoliageNitrogenFactor' , 'foliage nitrogen concentration (1=saturated)' , '-' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + diag_meta(iLookDIAG%scalarSoilRelHumidity) = var_info('scalarSoilRelHumidity' , 'relative humidity in the soil pores in the upper-most soil layer' , '-' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + diag_meta(iLookDIAG%mLayerTranspireLim) = var_info('mLayerTranspireLim' , 'soil moist & veg limit on transpiration for each layer' , '-' , get_ixVarType('midSoil'), iMissVec, iMissVec, .false.) + diag_meta(iLookDIAG%mLayerRootDensity) = var_info('mLayerRootDensity' , 'fraction of roots in each soil layer' , '-' , get_ixVarType('midSoil'), iMissVec, iMissVec, .false.) + diag_meta(iLookDIAG%scalarAquiferRootFrac) = var_info('scalarAquiferRootFrac' , 'fraction of roots below the soil profile (in the aquifer)' , '-' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + ! canopy hydrology + diag_meta(iLookDIAG%scalarFracLiqVeg) = var_info('scalarFracLiqVeg' , 'fraction of liquid water on vegetation' , '-' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + diag_meta(iLookDIAG%scalarCanopyWetFraction) = var_info('scalarCanopyWetFraction' , 'fraction canopy that is wet' , '-' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + ! snow hydrology + diag_meta(iLookDIAG%scalarSnowAge) = var_info('scalarSnowAge' , 'non-dimensional snow age' , '-' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + diag_meta(iLookDIAG%scalarGroundSnowFraction) = var_info('scalarGroundSnowFraction' , 'fraction ground that is covered with snow' , '-' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + diag_meta(iLookDIAG%spectralSnowAlbedoDirect) = var_info('spectralSnowAlbedoDirect' , 'direct snow albedo for individual spectral bands' , '-' , get_ixVarType('wLength'), iMissVec, iMissVec, .false.) + diag_meta(iLookDIAG%mLayerFracLiqSnow) = var_info('mLayerFracLiqSnow' , 'fraction of liquid water in each snow layer' , '-' , get_ixVarType('midSnow'), iMissVec, iMissVec, .false.) + diag_meta(iLookDIAG%mLayerThetaResid) = var_info('mLayerThetaResid' , 'residual volumetric water content in each snow layer' , '-' , get_ixVarType('midSnow'), iMissVec, iMissVec, .false.) + diag_meta(iLookDIAG%mLayerPoreSpace) = var_info('mLayerPoreSpace' , 'total pore space in each snow layer' , '-' , get_ixVarType('midSnow'), iMissVec, iMissVec, .false.) + diag_meta(iLookDIAG%mLayerMeltFreeze) = var_info('mLayerMeltFreeze' , 'ice content change from melt/freeze in each layer' , 'kg m-3' , get_ixVarType('midToto'), iMissVec, iMissVec, .false.) + ! soil hydrology + diag_meta(iLookDIAG%scalarInfilArea) = var_info('scalarInfilArea' , 'fraction of unfrozen area where water can infiltrate' , '-' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + diag_meta(iLookDIAG%scalarFrozenArea) = var_info('scalarFrozenArea' , 'fraction of area that is considered impermeable due to soil ice' , '-' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + diag_meta(iLookDIAG%scalarSoilControl) = var_info('scalarSoilControl' , 'soil control on infiltration (1=controlling; 0=not)' , '-' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + diag_meta(iLookDIAG%mLayerVolFracAir) = var_info('mLayerVolFracAir' , 'volumetric fraction of air in each layer' , '-' , get_ixVarType('midToto'), iMissVec, iMissVec, .false.) + diag_meta(iLookDIAG%mLayerTcrit) = var_info('mLayerTcrit' , 'critical soil temperature above which all water is unfrozen' , 'K' , get_ixVarType('midSoil'), iMissVec, iMissVec, .false.) + diag_meta(iLookDIAG%mLayerCompress) = var_info('mLayerCompress' , 'change in volumetric water content due to compression of soil' , '-' , get_ixVarType('midSoil'), iMissVec, iMissVec, .false.) + diag_meta(iLookDIAG%scalarSoilCompress) = var_info('scalarSoilCompress' , 'change in total soil storage due to compression of soil matrix' , 'kg m-2' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + diag_meta(iLookDIAG%mLayerMatricHeadLiq) = var_info('mLayerMatricHeadLiq' , 'matric potential of liquid water' , 'm' , get_ixVarType('midSoil'), iMissVec, iMissVec, .false.) + ! mass balance check + diag_meta(iLookDIAG%scalarSoilWatBalError) = var_info('scalarSoilWatBalError' , 'error in the total soil water balance' , 'kg m-2' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + diag_meta(iLookDIAG%scalarAquiferBalError) = var_info('scalarAquiferBalError' , 'error in the aquifer water balance' , 'kg m-2' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + diag_meta(iLookDIAG%scalarTotalSoilLiq) = var_info('scalarTotalSoilLiq' , 'total mass of liquid water in the soil' , 'kg m-2' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + diag_meta(iLookDIAG%scalarTotalSoilIce) = var_info('scalarTotalSoilIce' , 'total mass of ice in the soil' , 'kg m-2' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + diag_meta(iLookDIAG%scalarTotalSoilWat) = var_info('scalarTotalSoilWat' , 'total mass of water in the soil' , 'kg m-2' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + ! variable shortcuts + diag_meta(iLookDIAG%scalarVGn_m) = var_info('scalarVGn_m' , 'van Genuchten "m" parameter' , '-' , get_ixVarType('midSoil'), iMissVec, iMissVec, .false.) + diag_meta(iLookDIAG%scalarKappa) = var_info('scalarKappa' , 'constant in the freezing curve function' , 'm K-1' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + diag_meta(iLookDIAG%scalarVolLatHt_fus) = var_info('scalarVolLatHt_fus' , 'volumetric latent heat of fusion' , 'J m-3' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + ! number of function evaluations + diag_meta(iLookDIAG%numFluxCalls) = var_info('numFluxCalls' , 'number of flux calls' , '-' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + + ! ----- + ! * local model fluxes... + ! ----------------------- + ! net energy and mass fluxes for the vegetation domain + flux_meta(iLookFLUX%scalarCanairNetNrgFlux) = var_info('scalarCanairNetNrgFlux' , 'net energy flux for the canopy air space' , 'W m-2' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + flux_meta(iLookFLUX%scalarCanopyNetNrgFlux) = var_info('scalarCanopyNetNrgFlux' , 'net energy flux for the vegetation canopy' , 'W m-2' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + flux_meta(iLookFLUX%scalarGroundNetNrgFlux) = var_info('scalarGroundNetNrgFlux' , 'net energy flux for the ground surface' , 'W m-2' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + flux_meta(iLookFLUX%scalarCanopyNetLiqFlux) = var_info('scalarCanopyNetLiqFlux' , 'net liquid water flux for the vegetation canopy' , 'kg m-2 s-1' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + ! forcing + flux_meta(iLookFLUX%scalarRainfall) = var_info('scalarRainfall' , 'computed rainfall rate' , 'kg m-2 s-1' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + flux_meta(iLookFLUX%scalarSnowfall) = var_info('scalarSnowfall' , 'computed snowfall rate' , 'kg m-2 s-1' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + ! shortwave radiation + flux_meta(iLookFLUX%spectralIncomingDirect) = var_info('spectralIncomingDirect' , 'incoming direct solar radiation in each wave band' , 'W m-2' , get_ixVarType('wLength'), iMissVec, iMissVec, .false.) + flux_meta(iLookFLUX%spectralIncomingDiffuse) = var_info('spectralIncomingDiffuse' , 'incoming diffuse solar radiation in each wave band' , 'W m-2' , get_ixVarType('wLength'), iMissVec, iMissVec, .false.) + flux_meta(iLookFLUX%scalarCanopySunlitPAR) = var_info('scalarCanopySunlitPAR' , 'average absorbed par for sunlit leaves' , 'W m-2' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + flux_meta(iLookFLUX%scalarCanopyShadedPAR) = var_info('scalarCanopyShadedPAR' , 'average absorbed par for shaded leaves' , 'W m-2' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + flux_meta(iLookFLUX%spectralBelowCanopyDirect) = var_info('spectralBelowCanopyDirect' , 'downward direct flux below veg layer for each spectral band' , 'W m-2' , get_ixVarType('wLength'), iMissVec, iMissVec, .false.) + flux_meta(iLookFLUX%spectralBelowCanopyDiffuse) = var_info('spectralBelowCanopyDiffuse' , 'downward diffuse flux below veg layer for each spectral band' , 'W m-2' , get_ixVarType('wLength'), iMissVec, iMissVec, .false.) + flux_meta(iLookFLUX%scalarBelowCanopySolar) = var_info('scalarBelowCanopySolar' , 'solar radiation transmitted below the canopy' , 'W m-2' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + flux_meta(iLookFLUX%scalarCanopyAbsorbedSolar) = var_info('scalarCanopyAbsorbedSolar' , 'solar radiation absorbed by canopy' , 'W m-2' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + flux_meta(iLookFLUX%scalarGroundAbsorbedSolar) = var_info('scalarGroundAbsorbedSolar' , 'solar radiation absorbed by ground' , 'W m-2' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + ! longwave radiation + flux_meta(iLookFLUX%scalarLWRadCanopy) = var_info('scalarLWRadCanopy' , 'longwave radiation emitted from the canopy' , 'W m-2' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + flux_meta(iLookFLUX%scalarLWRadGround) = var_info('scalarLWRadGround' , 'longwave radiation emitted at the ground surface' , 'W m-2' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + flux_meta(iLookFLUX%scalarLWRadUbound2Canopy) = var_info('scalarLWRadUbound2Canopy' , 'downward atmospheric longwave radiation absorbed by the canopy' , 'W m-2' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + flux_meta(iLookFLUX%scalarLWRadUbound2Ground) = var_info('scalarLWRadUbound2Ground' , 'downward atmospheric longwave radiation absorbed by the ground' , 'W m-2' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + flux_meta(iLookFLUX%scalarLWRadUbound2Ubound) = var_info('scalarLWRadUbound2Ubound' , 'atmospheric radiation refl by ground + lost thru upper boundary' , 'W m-2' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + flux_meta(iLookFLUX%scalarLWRadCanopy2Ubound) = var_info('scalarLWRadCanopy2Ubound' , 'longwave radiation emitted from canopy lost thru upper boundary' , 'W m-2' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + flux_meta(iLookFLUX%scalarLWRadCanopy2Ground) = var_info('scalarLWRadCanopy2Ground' , 'longwave radiation emitted from canopy absorbed by the ground' , 'W m-2' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + flux_meta(iLookFLUX%scalarLWRadCanopy2Canopy) = var_info('scalarLWRadCanopy2Canopy' , 'canopy longwave reflected from ground and absorbed by the canopy' , 'W m-2' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + flux_meta(iLookFLUX%scalarLWRadGround2Ubound) = var_info('scalarLWRadGround2Ubound' , 'longwave radiation emitted from ground lost thru upper boundary' , 'W m-2' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + flux_meta(iLookFLUX%scalarLWRadGround2Canopy) = var_info('scalarLWRadGround2Canopy' , 'longwave radiation emitted from ground and absorbed by the canopy', 'W m-2' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + flux_meta(iLookFLUX%scalarLWNetCanopy) = var_info('scalarLWNetCanopy' , 'net longwave radiation at the canopy' , 'W m-2' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + flux_meta(iLookFLUX%scalarLWNetGround) = var_info('scalarLWNetGround' , 'net longwave radiation at the ground surface' , 'W m-2' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + flux_meta(iLookFLUX%scalarLWNetUbound) = var_info('scalarLWNetUbound' , 'net longwave radiation at the upper atmospheric boundary' , 'W m-2' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + ! turbulent heat transfer + flux_meta(iLookFLUX%scalarEddyDiffusCanopyTop) = var_info('scalarEddyDiffusCanopyTop' , 'eddy diffusivity for heat at the top of the canopy' , 'm2 s-1' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + flux_meta(iLookFLUX%scalarFrictionVelocity) = var_info('scalarFrictionVelocity' , 'friction velocity (canopy momentum sink)' , 'm s-1' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + flux_meta(iLookFLUX%scalarWindspdCanopyTop) = var_info('scalarWindspdCanopyTop' , 'windspeed at the top of the canopy' , 'm s-1' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + flux_meta(iLookFLUX%scalarWindspdCanopyBottom) = var_info('scalarWindspdCanopyBottom' , 'windspeed at the height of the bottom of the canopy' , 'm s-1' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + flux_meta(iLookFLUX%scalarGroundResistance) = var_info('scalarGroundResistance' , 'below canopy aerodynamic resistance' , 's m-1' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + flux_meta(iLookFLUX%scalarCanopyResistance) = var_info('scalarCanopyResistance' , 'above canopy aerodynamic resistance' , 's m-1' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + flux_meta(iLookFLUX%scalarLeafResistance) = var_info('scalarLeafResistance' , 'mean leaf boundary layer resistance per unit leaf area' , 's m-1' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + flux_meta(iLookFLUX%scalarSoilResistance) = var_info('scalarSoilResistance' , 'soil surface resistance' , 's m-1' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + flux_meta(iLookFLUX%scalarSenHeatTotal) = var_info('scalarSenHeatTotal' , 'sensible heat from the canopy air space to the atmosphere' , 'W m-2' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + flux_meta(iLookFLUX%scalarSenHeatCanopy) = var_info('scalarSenHeatCanopy' , 'sensible heat from the canopy to the canopy air space' , 'W m-2' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + flux_meta(iLookFLUX%scalarSenHeatGround) = var_info('scalarSenHeatGround' , 'sensible heat from the ground (below canopy or non-vegetated)' , 'W m-2' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + flux_meta(iLookFLUX%scalarLatHeatTotal) = var_info('scalarLatHeatTotal' , 'latent heat from the canopy air space to the atmosphere' , 'W m-2' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + flux_meta(iLookFLUX%scalarLatHeatCanopyEvap) = var_info('scalarLatHeatCanopyEvap' , 'evaporation latent heat from the canopy to the canopy air space' , 'W m-2' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + flux_meta(iLookFLUX%scalarLatHeatCanopyTrans) = var_info('scalarLatHeatCanopyTrans' , 'transpiration latent heat from the canopy to the canopy air space', 'W m-2' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + flux_meta(iLookFLUX%scalarLatHeatGround) = var_info('scalarLatHeatGround' , 'latent heat from the ground (below canopy or non-vegetated)' , 'W m-2' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + flux_meta(iLookFLUX%scalarCanopyAdvectiveHeatFlux) = var_info('scalarCanopyAdvectiveHeatFlux' , 'heat advected to the canopy with precipitation (snow + rain)' , 'W m-2' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + flux_meta(iLookFLUX%scalarGroundAdvectiveHeatFlux) = var_info('scalarGroundAdvectiveHeatFlux' , 'heat advected to the ground with throughfall + unloading/drainage', 'W m-2' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + flux_meta(iLookFLUX%scalarCanopySublimation) = var_info('scalarCanopySublimation' , 'canopy sublimation/frost' , 'kg m-2 s-1' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + flux_meta(iLookFLUX%scalarSnowSublimation) = var_info('scalarSnowSublimation' , 'snow sublimation/frost (below canopy or non-vegetated)' , 'kg m-2 s-1' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + ! liquid water fluxes associated with evapotranspiration + flux_meta(iLookFLUX%scalarStomResistSunlit) = var_info('scalarStomResistSunlit' , 'stomatal resistance for sunlit leaves' , 's m-1' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + flux_meta(iLookFLUX%scalarStomResistShaded) = var_info('scalarStomResistShaded' , 'stomatal resistance for shaded leaves' , 's m-1' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + flux_meta(iLookFLUX%scalarPhotosynthesisSunlit) = var_info('scalarPhotosynthesisSunlit' , 'sunlit photosynthesis' , 'umolco2 m-2 s-1' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + flux_meta(iLookFLUX%scalarPhotosynthesisShaded) = var_info('scalarPhotosynthesisShaded' , 'shaded photosynthesis' , 'umolco2 m-2 s-1' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + flux_meta(iLookFLUX%scalarCanopyTranspiration) = var_info('scalarCanopyTranspiration' , 'canopy transpiration' , 'kg m-2 s-1' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + flux_meta(iLookFLUX%scalarCanopyEvaporation) = var_info('scalarCanopyEvaporation' , 'canopy evaporation/condensation' , 'kg m-2 s-1' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + flux_meta(iLookFLUX%scalarGroundEvaporation) = var_info('scalarGroundEvaporation' , 'ground evaporation/condensation (below canopy or non-vegetated)' , 'kg m-2 s-1' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + flux_meta(iLookFLUX%mLayerTranspire) = var_info('mLayerTranspire' , 'transpiration loss from each soil layer' , 'm s-1' , get_ixVarType('midSoil'), iMissVec, iMissVec, .false.) + ! liquid and solid water fluxes through the canopy + flux_meta(iLookFLUX%scalarThroughfallSnow) = var_info('scalarThroughfallSnow' , 'snow that reaches the ground without ever touching the canopy' , 'kg m-2 s-1' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + flux_meta(iLookFLUX%scalarThroughfallRain) = var_info('scalarThroughfallRain' , 'rain that reaches the ground without ever touching the canopy' , 'kg m-2 s-1' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + flux_meta(iLookFLUX%scalarCanopySnowUnloading) = var_info('scalarCanopySnowUnloading' , 'unloading of snow from the vegetation canopy' , 'kg m-2 s-1' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + flux_meta(iLookFLUX%scalarCanopyLiqDrainage) = var_info('scalarCanopyLiqDrainage' , 'drainage of liquid water from the vegetation canopy' , 'kg m-2 s-1' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + flux_meta(iLookFLUX%scalarCanopyMeltFreeze) = var_info('scalarCanopyMeltFreeze' , 'melt/freeze of water stored in the canopy' , 'kg m-2 s-1' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + ! energy fluxes and for the snow and soil domains + flux_meta(iLookFLUX%iLayerConductiveFlux) = var_info('iLayerConductiveFlux' , 'conductive energy flux at layer interfaces' , 'W m-2' , get_ixVarType('ifcToto'), iMissVec, iMissVec, .false.) + flux_meta(iLookFLUX%iLayerAdvectiveFlux) = var_info('iLayerAdvectiveFlux' , 'advective energy flux at layer interfaces' , 'W m-2' , get_ixVarType('ifcToto'), iMissVec, iMissVec, .false.) + flux_meta(iLookFLUX%iLayerNrgFlux) = var_info('iLayerNrgFlux' , 'energy flux at layer interfaces' , 'W m-2' , get_ixVarType('ifcToto'), iMissVec, iMissVec, .false.) + flux_meta(iLookFLUX%mLayerNrgFlux) = var_info('mLayerNrgFlux' , 'net energy flux for each layer within the snow+soil domain' , 'J m-3 s-1' , get_ixVarType('midToto'), iMissVec, iMissVec, .false.) + ! liquid water fluxes for the snow domain + flux_meta(iLookFLUX%scalarSnowDrainage) = var_info('scalarSnowDrainage' , 'drainage from the bottom of the snow profile' , 'm s-1' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + flux_meta(iLookFLUX%iLayerLiqFluxSnow) = var_info('iLayerLiqFluxSnow' , 'liquid flux at snow layer interfaces' , 'm s-1' , get_ixVarType('ifcSnow'), iMissVec, iMissVec, .false.) + flux_meta(iLookFLUX%mLayerLiqFluxSnow) = var_info('mLayerLiqFluxSnow' , 'net liquid water flux for each snow layer' , 's-1' , get_ixVarType('midSnow'), iMissVec, iMissVec, .false.) + ! liquid water fluxes for the soil domain + flux_meta(iLookFLUX%scalarRainPlusMelt) = var_info('scalarRainPlusMelt' , 'rain plus melt, used as input to soil before surface runoff' , 'm s-1' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + flux_meta(iLookFLUX%scalarMaxInfilRate) = var_info('scalarMaxInfilRate' , 'maximum infiltration rate' , 'm s-1' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + flux_meta(iLookFLUX%scalarInfiltration) = var_info('scalarInfiltration' , 'infiltration of water into the soil profile' , 'm s-1' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + flux_meta(iLookFLUX%scalarExfiltration) = var_info('scalarExfiltration' , 'exfiltration of water from the top of the soil profile' , 'm s-1' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + flux_meta(iLookFLUX%scalarSurfaceRunoff) = var_info('scalarSurfaceRunoff' , 'surface runoff' , 'm s-1' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + flux_meta(iLookFLUX%mLayerSatHydCondMP) = var_info('mLayerSatHydCondMP' , 'saturated hydraulic conductivity of macropores in each layer' , 'm s-1' , get_ixVarType('midSoil'), iMissVec, iMissVec, .false.) + flux_meta(iLookFLUX%mLayerSatHydCond) = var_info('mLayerSatHydCond' , 'saturated hydraulic conductivity in each layer' , 'm s-1' , get_ixVarType('midSoil'), iMissVec, iMissVec, .false.) + flux_meta(iLookFLUX%iLayerSatHydCond) = var_info('iLayerSatHydCond' , 'saturated hydraulic conductivity in each layer interface' , 'm s-1' , get_ixVarType('ifcSoil'), iMissVec, iMissVec, .false.) + flux_meta(iLookFLUX%mLayerHydCond) = var_info('mLayerHydCond' , 'hydraulic conductivity in each layer' , 'm s-1' , get_ixVarType('midSoil'), iMissVec, iMissVec, .false.) + flux_meta(iLookFLUX%iLayerLiqFluxSoil) = var_info('iLayerLiqFluxSoil' , 'liquid flux at soil layer interfaces' , 'm s-1' , get_ixVarType('ifcSoil'), iMissVec, iMissVec, .false.) + flux_meta(iLookFLUX%mLayerLiqFluxSoil) = var_info('mLayerLiqFluxSoil' , 'net liquid water flux for each soil layer' , 's-1' , get_ixVarType('midSoil'), iMissVec, iMissVec, .false.) + flux_meta(iLookFLUX%mLayerBaseflow) = var_info('mLayerBaseflow' , 'baseflow from each soil layer' , 'm s-1' , get_ixVarType('midSoil'), iMissVec, iMissVec, .false.) + flux_meta(iLookFLUX%mLayerColumnInflow) = var_info('mLayerColumnInflow' , 'total inflow to each layer in a given soil column' , 'm3 s-1' , get_ixVarType('midSoil'), iMissVec, iMissVec, .false.) + flux_meta(iLookFLUX%mLayerColumnOutflow) = var_info('mLayerColumnOutflow' , 'total outflow from each layer in a given soil column' , 'm3 s-1' , get_ixVarType('midSoil'), iMissVec, iMissVec, .false.) + flux_meta(iLookFLUX%scalarSoilBaseflow) = var_info('scalarSoilBaseflow' , 'total baseflow from the soil profile' , 'm s-1' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + flux_meta(iLookFLUX%scalarSoilDrainage) = var_info('scalarSoilDrainage' , 'drainage from the bottom of the soil profile' , 'm s-1' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + flux_meta(iLookFLUX%scalarAquiferRecharge) = var_info('scalarAquiferRecharge' , 'recharge to the aquifer' , 'm s-1' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + flux_meta(iLookFLUX%scalarAquiferTranspire) = var_info('scalarAquiferTranspire' , 'transpiration loss from the aquifer' , 'm s-1' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + flux_meta(iLookFLUX%scalarAquiferBaseflow) = var_info('scalarAquiferBaseflow' , 'baseflow from the aquifer' , 'm s-1' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + ! derived variables + flux_meta(iLookFLUX%scalarTotalET) = var_info('scalarTotalET' , 'total ET' , 'kg m-2 s-1' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + flux_meta(iLookFLUX%scalarTotalRunoff) = var_info('scalarTotalRunoff' , 'total runoff' , 'm s-1' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + flux_meta(iLookFLUX%scalarNetRadiation) = var_info('scalarNetRadiation' , 'net radiation' , 'W m-2' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + + ! ----- + ! * local flux derivatives... + ! --------------------------- + ! derivatives in net vegetation energy fluxes w.r.t. relevant state variables + deriv_meta(iLookDERIV%dCanairNetFlux_dCanairTemp) = var_info('dCanairNetFlux_dCanairTemp' , 'derivative in net canopy air space flux w.r.t. canopy air temperature', 'W m-2 K-1' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + deriv_meta(iLookDERIV%dCanairNetFlux_dCanopyTemp) = var_info('dCanairNetFlux_dCanopyTemp' , 'derivative in net canopy air space flux w.r.t. canopy temperature' , 'W m-2 K-1' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + deriv_meta(iLookDERIV%dCanairNetFlux_dGroundTemp) = var_info('dCanairNetFlux_dGroundTemp' , 'derivative in net canopy air space flux w.r.t. ground temperature' , 'W m-2 K-1' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + deriv_meta(iLookDERIV%dCanopyNetFlux_dCanairTemp) = var_info('dCanopyNetFlux_dCanairTemp' , 'derivative in net canopy flux w.r.t. canopy air temperature' , 'W m-2 K-1' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + deriv_meta(iLookDERIV%dCanopyNetFlux_dCanopyTemp) = var_info('dCanopyNetFlux_dCanopyTemp' , 'derivative in net canopy flux w.r.t. canopy temperature' , 'W m-2 K-1' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + deriv_meta(iLookDERIV%dCanopyNetFlux_dGroundTemp) = var_info('dCanopyNetFlux_dGroundTemp' , 'derivative in net canopy flux w.r.t. ground temperature' , 'W m-2 K-1' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + deriv_meta(iLookDERIV%dCanopyNetFlux_dCanLiq) = var_info('dCanopyNetFlux_dCanLiq' , 'derivative in net canopy fluxes w.r.t. canopy liquid water content' , 'J kg-1 s-1' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + deriv_meta(iLookDERIV%dGroundNetFlux_dCanairTemp) = var_info('dGroundNetFlux_dCanairTemp' , 'derivative in net ground flux w.r.t. canopy air temperature' , 'W m-2 K-1' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + deriv_meta(iLookDERIV%dGroundNetFlux_dCanopyTemp) = var_info('dGroundNetFlux_dCanopyTemp' , 'derivative in net ground flux w.r.t. canopy temperature' , 'W m-2 K-1' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + deriv_meta(iLookDERIV%dGroundNetFlux_dGroundTemp) = var_info('dGroundNetFlux_dGroundTemp' , 'derivative in net ground flux w.r.t. ground temperature' , 'W m-2 K-1' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + deriv_meta(iLookDERIV%dGroundNetFlux_dCanLiq) = var_info('dGroundNetFlux_dCanLiq' , 'derivative in net ground fluxes w.r.t. canopy liquid water content' , 'J kg-1 s-1' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + ! derivatives in evaporative fluxes w.r.t. relevant state variables + deriv_meta(iLookDERIV%dCanopyEvaporation_dTCanair) = var_info('dCanopyEvaporation_dTCanair' , 'derivative in canopy evaporation w.r.t. canopy air temperature' , 'kg m-2 s-1 K-1' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + deriv_meta(iLookDERIV%dCanopyEvaporation_dTCanopy) = var_info('dCanopyEvaporation_dTCanopy' , 'derivative in canopy evaporation w.r.t. canopy temperature' , 'kg m-2 s-1 K-1' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + deriv_meta(iLookDERIV%dCanopyEvaporation_dTGround) = var_info('dCanopyEvaporation_dTGround' , 'derivative in canopy evaporation w.r.t. ground temperature' , 'kg m-2 s-1 K-1' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + deriv_meta(iLookDERIV%dCanopyEvaporation_dCanLiq) = var_info('dCanopyEvaporation_dCanLiq' , 'derivative in canopy evaporation w.r.t. canopy liquid water content' , 's-1' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + deriv_meta(iLookDERIV%dGroundEvaporation_dTCanair) = var_info('dGroundEvaporation_dTCanair' , 'derivative in ground evaporation w.r.t. canopy air temperature' , 'kg m-2 s-1 K-1' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + deriv_meta(iLookDERIV%dGroundEvaporation_dTCanopy) = var_info('dGroundEvaporation_dTCanopy' , 'derivative in ground evaporation w.r.t. canopy temperature' , 'kg m-2 s-1 K-1' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + deriv_meta(iLookDERIV%dGroundEvaporation_dTGround) = var_info('dGroundEvaporation_dTGround' , 'derivative in ground evaporation w.r.t. ground temperature' , 'kg m-2 s-1 K-1' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + deriv_meta(iLookDERIV%dGroundEvaporation_dCanLiq) = var_info('dGroundEvaporation_dCanLiq' , 'derivative in ground evaporation w.r.t. canopy liquid water content' , 's-1' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + ! derivatives in canopy water w.r.t canopy temperature + deriv_meta(iLookDERIV%dTheta_dTkCanopy) = var_info('dTheta_dTkCanopy' , 'derivative of volumetric liquid water content w.r.t. temperature' , 'K-1' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + deriv_meta(iLookDERIV%dCanLiq_dTcanopy) = var_info('dCanLiq_dTcanopy' , 'derivative of canopy liquid storage w.r.t. temperature' , 'kg m-2 K-1' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + ! derivatives in canopy liquid fluxes w.r.t. canopy water + deriv_meta(iLookDERIV%scalarCanopyLiqDeriv) = var_info('scalarCanopyLiqDeriv' , 'derivative in (throughfall + drainage) w.r.t. canopy liquid water' , 's-1' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + deriv_meta(iLookDERIV%scalarThroughfallRainDeriv) = var_info('scalarThroughfallRainDeriv' , 'derivative in throughfall w.r.t. canopy liquid water' , 's-1' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + deriv_meta(iLookDERIV%scalarCanopyLiqDrainageDeriv) = var_info('scalarCanopyLiqDrainageDeriv' , 'derivative in canopy drainage w.r.t. canopy liquid water' , 's-1' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + ! derivatives in energy fluxes at the interface of snow+soil layers w.r.t. temperature in layers above and below + deriv_meta(iLookDERIV%dNrgFlux_dTempAbove) = var_info('dNrgFlux_dTempAbove' , 'derivatives in the flux w.r.t. temperature in the layer above' , 'J m-2 s-1 K-1' , get_ixVarType('ifcToto'), iMissVec, iMissVec, .false.) + deriv_meta(iLookDERIV%dNrgFlux_dTempBelow) = var_info('dNrgFlux_dTempBelow' , 'derivatives in the flux w.r.t. temperature in the layer below' , 'J m-2 s-1 K-1' , get_ixVarType('ifcToto'), iMissVec, iMissVec, .false.) + ! derivative in liquid water fluxes at the interface of snow layers w.r.t. volumetric liquid water content in the layer above + deriv_meta(iLookDERIV%iLayerLiqFluxSnowDeriv) = var_info('iLayerLiqFluxSnowDeriv' , 'derivative in vertical liquid water flux at layer interfaces' , 'm s-1' , get_ixVarType('ifcSnow'), iMissVec, iMissVec, .false.) + ! derivative in liquid water fluxes for the soil domain w.r.t hydrology state variables + deriv_meta(iLookDERIV%dVolTot_dPsi0) = var_info('dVolTot_dPsi0' , 'derivative in total water content w.r.t. total water matric potential', 'm-1' , get_ixVarType('midSoil'), iMissVec, iMissVec, .false.) + deriv_meta(iLookDERIV%dCompress_dPsi) = var_info('dCompress_dPsi' , 'derivative in compressibility w.r.t matric head' , 'm-1' , get_ixVarType('midSoil'), iMissVec, iMissVec, .false.) + deriv_meta(iLookDERIV%mLayerdTheta_dPsi) = var_info('mLayerdTheta_dPsi' , 'derivative in the soil water characteristic w.r.t. psi' , 'm-1' , get_ixVarType('midSoil'), iMissVec, iMissVec, .false.) + deriv_meta(iLookDERIV%mLayerdPsi_dTheta) = var_info('mLayerdPsi_dTheta' , 'derivative in the soil water characteristic w.r.t. theta' , 'm' , get_ixVarType('midSoil'), iMissVec, iMissVec, .false.) + deriv_meta(iLookDERIV%dq_dHydStateAbove) = var_info('dq_dHydStateAbove' , 'change in flux at layer interfaces w.r.t. states in the layer above' , 'unknown' , get_ixVarType('ifcSoil'), iMissVec, iMissVec, .false.) + deriv_meta(iLookDERIV%dq_dHydStateBelow) = var_info('dq_dHydStateBelow' , 'change in flux at layer interfaces w.r.t. states in the layer below' , 'unknown' , get_ixVarType('ifcSoil'), iMissVec, iMissVec, .false.) + ! derivative in baseflow flux w.r.t. aquifer storage + deriv_meta(iLookDERIV%dBaseflow_dAquifer) = var_info('dBaseflow_dAquifer' , 'derivative in baseflow flux w.r.t. aquifer storage' , 's-1' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + ! derivative in liquid water fluxes for the soil domain w.r.t energy state variables + deriv_meta(iLookDERIV%dq_dNrgStateAbove) = var_info('dq_dNrgStateAbove' , 'change in flux at layer interfaces w.r.t. states in the layer above' , 'unknown' , get_ixVarType('ifcSoil'), iMissVec, iMissVec, .false.) + deriv_meta(iLookDERIV%dq_dNrgStateBelow) = var_info('dq_dNrgStateBelow' , 'change in flux at layer interfaces w.r.t. states in the layer below' , 'unknown' , get_ixVarType('ifcSoil'), iMissVec, iMissVec, .false.) + deriv_meta(iLookDERIV%mLayerdTheta_dTk) = var_info('mLayerdTheta_dTk' , 'derivative of volumetric liquid water content w.r.t. temperature' , 'K-1' , get_ixVarType('midToto'), iMissVec, iMissVec, .false.) + deriv_meta(iLookDERIV%dPsiLiq_dTemp) = var_info('dPsiLiq_dTemp' , 'derivative in the liquid water matric potential w.r.t. temperature' , 'm K-1' , get_ixVarType('midSoil'), iMissVec, iMissVec, .false.) + deriv_meta(iLookDERIV%dPsiLiq_dPsi0) = var_info('dPsiLiq_dPsi0' , 'derivative in liquid matric potential w.r.t. total matric potential' , '-' , get_ixVarType('midSoil'), iMissVec, iMissVec, .false.) + + ! ----- + ! * basin-wide runoff and aquifer fluxes... + ! ----------------------------------------- + bvar_meta(iLookBVAR%basin__TotalArea) = var_info('basin__TotalArea' , 'total basin area' , 'm2' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + bvar_meta(iLookBVAR%basin__SurfaceRunoff) = var_info('basin__SurfaceRunoff' , 'surface runoff' , 'm s-1' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + bvar_meta(iLookBVAR%basin__ColumnOutflow) = var_info('basin__ColumnOutflow' , 'outflow from all "outlet" HRUs (with no downstream HRU)', 'm3 s-1', get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + bvar_meta(iLookBVAR%basin__AquiferStorage) = var_info('basin__AquiferStorage' , 'aquifer storage' , 'm' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + bvar_meta(iLookBVAR%basin__AquiferRecharge) = var_info('basin__AquiferRecharge' , 'recharge to the aquifer' , 'm s-1' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + bvar_meta(iLookBVAR%basin__AquiferBaseflow) = var_info('basin__AquiferBaseflow' , 'baseflow from the aquifer' , 'm s-1' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + bvar_meta(iLookBVAR%basin__AquiferTranspire) = var_info('basin__AquiferTranspire', 'transpiration loss from the aquifer' , 'm s-1' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + bvar_meta(iLookBVAR%basin__SoilDrainage) = var_info('basin__SoilDrainage' , 'soil drainage' , 'm s-1' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + bvar_meta(iLookBVAR%routingRunoffFuture) = var_info('routingRunoffFuture' , 'runoff in future time steps' , 'm s-1' , get_ixVarType('routing'), iMissVec, iMissVec, .false.) + bvar_meta(iLookBVAR%routingFractionFuture) = var_info('routingFractionFuture' , 'fraction of runoff in future time steps' , '-' , get_ixVarType('routing'), iMissVec, iMissVec, .false.) + bvar_meta(iLookBVAR%averageInstantRunoff) = var_info('averageInstantRunoff' , 'instantaneous runoff' , 'm s-1' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + bvar_meta(iLookBVAR%averageRoutedRunoff) = var_info('averageRoutedRunoff' , 'routed runoff' , 'm s-1' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + + ! ----- + ! * model indices... + ! ------------------ + + ! number of model layers, and layer indices + indx_meta(iLookINDEX%nSnow) = var_info('nSnow' , 'number of snow layers' , '-', get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + indx_meta(iLookINDEX%nSoil) = var_info('nSoil' , 'number of soil layers' , '-', get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + indx_meta(iLookINDEX%nLayers) = var_info('nLayers' , 'total number of layers' , '-', get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + indx_meta(iLookINDEX%layerType) = var_info('layerType' , 'index defining type of layer (snow or soil)' , '-', get_ixVarType('midToto'), iMissVec, iMissVec, .false.) + ! number of state variables of different type + indx_meta(iLookINDEX%nCasNrg) = var_info('nCasNrg' , 'number of energy state variables for the canopy air space' , '-', get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + indx_meta(iLookINDEX%nVegNrg) = var_info('nVegNrg' , 'number of energy state variables for the vegetation canopy' , '-', get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + indx_meta(iLookINDEX%nVegMass) = var_info('nVegMass' , 'number of hydrology states for vegetation (mass of water)' , '-', get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + indx_meta(iLookINDEX%nVegState) = var_info('nVegState' , 'number of vegetation state variables' , '-', get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + indx_meta(iLookINDEX%nNrgState) = var_info('nNrgState' , 'number of energy state variables' , '-', get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + indx_meta(iLookINDEX%nWatState) = var_info('nWatState' , 'number of "total water" states (vol. total water content)' , '-', get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + indx_meta(iLookINDEX%nMatState) = var_info('nMatState' , 'number of matric head state variables' , '-', get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + indx_meta(iLookINDEX%nMassState) = var_info('nMassState' , 'number of hydrology state variables (mass of water)' , '-', get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + indx_meta(iLookINDEX%nState) = var_info('nState' , 'total number of model state variables' , '-', get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + ! number of state variables within different domains in the snow+soil system + indx_meta(iLookINDEX%nSnowSoilNrg) = var_info('nSnowSoilNrg' , 'number of energy states in the snow+soil domain' , '-', get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + indx_meta(iLookINDEX%nSnowOnlyNrg) = var_info('nSnowOnlyNrg' , 'number of energy states in the snow domain' , '-', get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + indx_meta(iLookINDEX%nSoilOnlyNrg) = var_info('nSoilOnlyNrg' , 'number of energy states in the soil domain' , '-', get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + indx_meta(iLookINDEX%nSnowSoilHyd) = var_info('nSnowSoilHyd' , 'number of hydrology states in the snow+soil domain' , '-', get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + indx_meta(iLookINDEX%nSnowOnlyHyd) = var_info('nSnowOnlyHyd' , 'number of hydrology states in the snow domain' , '-', get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + indx_meta(iLookINDEX%nSoilOnlyHyd) = var_info('nSoilOnlyHyd' , 'number of hydrology states in the soil domain' , '-', get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + ! type of model state variables + indx_meta(iLookINDEX%ixControlVolume) = var_info('ixControlVolume' , 'index of the control volume for different domains (veg, snow, soil)' , '-', get_ixVarType('unknown'), iMissVec, iMissVec, .false.) + indx_meta(iLookINDEX%ixDomainType) = var_info('ixDomainType' , 'index of the type of domain (iname_veg, iname_snow, iname_soil)' , '-', get_ixVarType('unknown'), iMissVec, iMissVec, .false.) + indx_meta(iLookINDEX%ixStateType) = var_info('ixStateType' , 'index of the type of every state variable (iname_nrgCanair, ...)' , '-', get_ixVarType('unknown'), iMissVec, iMissVec, .false.) + indx_meta(iLookINDEX%ixHydType) = var_info('ixHydType' , 'index of the type of hydrology states in snow+soil domain' , '-', get_ixVarType('midToto'), iMissVec, iMissVec, .false.) + ! type of model state variables (state subset) + indx_meta(iLookINDEX%ixDomainType_subset) = var_info('ixDomainType_subset' , '[state subset] id of domain for desired model state variables' , '-', get_ixVarType('unknown'), iMissVec, iMissVec, .false.) + indx_meta(iLookINDEX%ixStateType_subset) = var_info('ixStateType_subset' , '[state subset] type of desired model state variables' , '-', get_ixVarType('unknown'), iMissVec, iMissVec, .false.) + ! mapping between state subset and the full state vector + indx_meta(iLookINDEX%ixMapFull2Subset) = var_info('ixMapFull2Subset' , 'list of indices of the state subset in the full state vector' , '-', get_ixVarType('unknown'), iMissVec, iMissVec, .false.) + indx_meta(iLookINDEX%ixMapSubset2Full) = var_info('ixMapSubset2Full' , 'list of indices of the full state vector in the state subset' , '-', get_ixVarType('unknown'), iMissVec, iMissVec, .false.) + ! indices of model specific state variables + indx_meta(iLookINDEX%ixCasNrg) = var_info('ixCasNrg' , 'index of canopy air space energy state variable' , '-', get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + indx_meta(iLookINDEX%ixVegNrg) = var_info('ixVegNrg' , 'index of canopy energy state variable' , '-', get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + indx_meta(iLookINDEX%ixVegHyd) = var_info('ixVegHyd' , 'index of canopy hydrology state variable (mass)' , '-', get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + indx_meta(iLookINDEX%ixTopNrg) = var_info('ixTopNrg' , 'index of upper-most energy state in the snow+soil subdomain' , '-', get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + indx_meta(iLookINDEX%ixTopHyd) = var_info('ixTopHyd' , 'index of upper-most hydrology state in the snow+soil subdomain' , '-', get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + indx_meta(iLookINDEX%ixAqWat) = var_info('ixAqWat' , 'index of storage of water in the aquifer' , '-', get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + ! vectors of indices for specific state types + indx_meta(iLookINDEX%ixNrgOnly) = var_info('ixNrgOnly' , 'indices IN THE STATE SUBSET for energy states' , '-', get_ixVarType('unknown'), iMissVec, iMissVec, .false.) + indx_meta(iLookINDEX%ixHydOnly) = var_info('ixHydOnly' , 'indices IN THE STATE SUBSET for hydrology states in the snow+soil domain', '-', get_ixVarType('unknown'), iMissVec, iMissVec, .false.) + indx_meta(iLookINDEX%ixMatOnly) = var_info('ixMatOnly' , 'indices IN THE STATE SUBSET for matric head state variables' , '-', get_ixVarType('unknown'), iMissVec, iMissVec, .false.) + indx_meta(iLookINDEX%ixMassOnly) = var_info('ixMassOnly' , 'indices IN THE STATE SUBSET for hydrology states (mass of water)' , '-', get_ixVarType('unknown'), iMissVec, iMissVec, .false.) + ! vectors of indices for specific state types within specific sub-domains + indx_meta(iLookINDEX%ixSnowSoilNrg) = var_info('ixSnowSoilNrg' , 'indices IN THE STATE SUBSET for energy states in the snow+soil domain' , '-', get_ixVarType('midToto'), iMissVec, iMissVec, .false.) + indx_meta(iLookINDEX%ixSnowOnlyNrg) = var_info('ixSnowOnlyNrg' , 'indices IN THE STATE SUBSET for energy states in the snow domain' , '-', get_ixVarType('midSnow'), iMissVec, iMissVec, .false.) + indx_meta(iLookINDEX%ixSoilOnlyNrg) = var_info('ixSoilOnlyNrg' , 'indices IN THE STATE SUBSET for energy states in the soil domain' , '-', get_ixVarType('midSoil'), iMissVec, iMissVec, .false.) + indx_meta(iLookINDEX%ixSnowSoilHyd) = var_info('ixSnowSoilHyd' , 'indices IN THE STATE SUBSET for hydrology states in the snow+soil domain', '-', get_ixVarType('midToto'), iMissVec, iMissVec, .false.) + indx_meta(iLookINDEX%ixSnowOnlyHyd) = var_info('ixSnowOnlyHyd' , 'indices IN THE STATE SUBSET for hydrology states in the snow domain' , '-', get_ixVarType('midSnow'), iMissVec, iMissVec, .false.) + indx_meta(iLookINDEX%ixSoilOnlyHyd) = var_info('ixSoilOnlyHyd' , 'indices IN THE STATE SUBSET for hydrology states in the soil domain' , '-', get_ixVarType('midSoil'), iMissVec, iMissVec, .false.) + ! vectors of indices for specfic state types within specific sub-domains + indx_meta(iLookINDEX%ixNrgCanair) = var_info('ixNrgCanair' , 'indices IN THE FULL VECTOR for energy states in canopy air space domain' , '-', get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + indx_meta(iLookINDEX%ixNrgCanopy) = var_info('ixNrgCanopy' , 'indices IN THE FULL VECTOR for energy states in the canopy domain' , '-', get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + indx_meta(iLookINDEX%ixHydCanopy) = var_info('ixHydCanopy' , 'indices IN THE FULL VECTOR for hydrology states in the canopy domain' , '-', get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + indx_meta(iLookINDEX%ixNrgLayer) = var_info('ixNrgLayer' , 'indices IN THE FULL VECTOR for energy states in the snow+soil domain' , '-', get_ixVarType('midToto'), iMissVec, iMissVec, .false.) + indx_meta(iLookINDEX%ixHydLayer) = var_info('ixHydLayer' , 'indices IN THE FULL VECTOR for hydrology states in the snow+soil domain' , '-', get_ixVarType('midToto'), iMissVec, iMissVec, .false.) + indx_meta(iLookINDEX%ixWatAquifer) = var_info('ixWatAquifer' , 'indices IN THE FULL VECTOR for storage of water in the aquifer' , '-', get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + ! vectors of indices for specific state types IN SPECIFIC SUB-DOMAINS + indx_meta(iLookINDEX%ixVolFracWat) = var_info('ixVolFracWat' , 'indices IN THE SNOW+SOIL VECTOR for hyd states' , '-', get_ixVarType('unknown'), iMissVec, iMissVec, .false.) + indx_meta(iLookINDEX%ixMatricHead) = var_info('ixMatricHead' , 'indices IN THE SOIL VECTOR for hyd states' , '-', get_ixVarType('unknown'), iMissVec, iMissVec, .false.) + ! indices within state vectors + indx_meta(iLookINDEX%ixAllState) = var_info('ixAllState' , 'list of indices for all model state variables' , '-', get_ixVarType('unknown'), iMissVec, iMissVec, .false.) + indx_meta(iLookINDEX%ixSoilState) = var_info('ixSoilState' , 'list of indices for all soil layers' , '-', get_ixVarType('midSoil'), iMissVec, iMissVec, .false.) + indx_meta(iLookINDEX%ixLayerState) = var_info('ixLayerState' , 'list of indices for all model layers' , '-', get_ixVarType('midToto'), iMissVec, iMissVec, .false.) + indx_meta(iLookINDEX%ixLayerActive) = var_info('ixLayerActive' , 'list of indices for active model layers (inactive=integerMissing)' , '-', get_ixVarType('midToto'), iMissVec, iMissVec, .false.) + ! number of trials + indx_meta(iLookINDEX%numberFluxCalc) = var_info('numberFluxCalc' , 'number of flux calculations' , '-', get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + indx_meta(iLookINDEX%numberStateSplit) = var_info('numberStateSplit' , 'number of state splitting solutions' , '-', get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + indx_meta(iLookINDEX%numberDomainSplitNrg) = var_info('numberDomainSplitNrg' , 'number of domain splitting solutions for energy' , '-', get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + indx_meta(iLookINDEX%numberDomainSplitMass) = var_info('numberDomainSplitMass', 'number of domain splitting solutions for mass' , '-', get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + indx_meta(iLookINDEX%numberScalarSolutions) = var_info('numberScalarSolutions', 'number of scalar solutions' , '-', get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + + + ! read file to define model output (modifies metadata structures) + call read_output_file(err,cmessage) + if (err.ne.0) message=trim(message)//trim(cmessage) + +end subroutine popMetadat + +! ------------------------------------------------ +! subroutine to populate write commands from file input +! ------------------------------------------------ +subroutine read_output_file(err,message) + USE netcdf + ! to get name of output control file from user + USE summaActors_FileManager,only:SETTINGS_PATH ! path for metadata files + USE summaActors_FileManager,only:OUTPUT_CONTROL ! file with output controls + + ! some dimensional parameters + USE globalData, only:outFreq ! output frequencies + USE var_lookup, only:maxvarFreq ! maximum # of output files + USE var_lookup, only:maxvarStat ! maximum # of statistics + + ! metadata structures + USE globalData, only: time_meta ! data structure for time metadata + USE globalData, only: forc_meta ! data structure for forcing metadata + USE globalData, only: type_meta ! data structure for categorical metadata + USE globalData, only: attr_meta ! data structure for attribute metadata + USE globalData, only: mpar_meta ! data structure for local parameter metadata + USE globalData, only: bpar_meta ! data structure for basin parameter metadata + USE globalData, only: bvar_meta ! data structure for basin model variable metadata + USE globalData, only: indx_meta ! data structure for index metadata + USE globalData, only: prog_meta ! data structure for local prognostic (state) variables + USE globalData, only: diag_meta ! data structure for local diagnostic variables + USE globalData, only: flux_meta ! data structure for local flux variables + USE globalData, only: deriv_meta ! data structure for local flux derivatives + USE globalData, only: outputPrecision ! data structure for output precision + + ! structures of named variables + USE var_lookup, only: iLookTYPE ! named variables for categorical data + USE var_lookup, only: iLookID ! named variables for hru and gru ID metadata + USE var_lookup, only: iLookFORCE ! named variables for forcing data structure + USE var_lookup, only: iLookINDEX ! named variables for index variable data structure + USE var_lookup, only: iLookSTAT ! named variables for statitics variable data structure + USE var_lookup, only: iLookFREQ ! named variables for model output frequencies + + ! identify indices within structures + USE get_ixName_module,only:get_ixUnknown ! identify index in any structure + USE get_ixname_module,only:get_ixFreq ! identify index of model output frequency + USE get_ixname_module,only:get_ixStat ! identify index in ststistics structure + USE get_ixname_module,only:get_statName ! identify statistics name from the index + + ! modules to read ASCII data + USE ascii_util_module,only:file_open ! open file + USE ascii_util_module,only:linewidth ! match character number for one line + USE ascii_util_module,only:get_vlines ! get a vector of non-comment lines + USE ascii_util_module,only:split_line ! split a line into words + implicit none + + ! dummy variables + integer(i4b),intent(out) :: err ! error code + character(*),intent(out) :: message ! error message + + ! define file format + integer(i4b),parameter :: noStatsDesired=1001 ! no statistic desired (temporally constant variables) + integer(i4b),parameter :: provideStatName=1002 ! provide the name of the desired statistic + integer(i4b),parameter :: provideStatFlags=1003 ! provide flags defining the desired statistic + integer(i4b) :: fileFormat ! the file format + + ! define statistics flags + logical(lgt),dimension(maxvarStat) :: statFlag ! vector of statistics flags + character(len=32) :: statName ! name of desired statistic + integer(i4b) :: iStat ! index of statistics vector + + ! define frequency of model output + character(len=64) :: freqName ! name of desired output frequency + integer(i4b) :: iFreq ! index of frequency vector + + ! general local variables + character(LEN=256) :: cmessage ! error message of downwind routine + character(LEN=256) :: outfile ! full path of model output file + integer(i4b) :: unt ! file unit + character(LEN=linewidth),allocatable :: charlines(:) ! vector of character strings + character(LEN=64),allocatable :: lineWords(:) ! vector to parse textline + integer(i4b) :: nWords ! number of words in line + character(LEN=128) :: varName ! variable name + character(LEN=5) :: structName ! name of structure + integer(i4b) :: vLine ! index for loop through variables + integer(i4b) :: vDex ! index into type lists + + ! initialize error control + err=0; message='read_output_file/' + + ! ********************************************************************************************** + ! (1) open file and read variable data + ! ********************************************************************************************** + outfile = trim(SETTINGS_PATH)//trim(OUTPUT_CONTROL) ! build filename + print *, outfile + call file_open(trim(outfile),unt,err,cmessage) ! open file if(err/=0)then; message=trim(message)//trim(cmessage); return; end if - nWords = size(lineWords) - - ! define variable name - varName = trim(lineWords(nameIndex)) - - ! user cannot control time output - if (trim(varName)=='time') cycle - ! set precision if it is given - if (trim(varName)=='outputPrecision') then - statName = trim(lineWords(nWords)) - if (statName=='single' .or. statName=='float') then - outputPrecision = nf90_float - else if (statName=='double') then - outputPrecision = nf90_double - else - err=20 - cmessage='outputPrecision must be single, float, or double' - message=trim(message)//trim(cmessage)//trim(varName); - return + + ! ********************************************************************************************** + ! (2) read variable data (continue reading from previous point in the file) + ! ********************************************************************************************** + ! read the rest of the lines + call get_vlines(unt,charLines,err,cmessage) ! get a list of character strings from non-comment lines + if(err/=0)then; message=trim(message)//trim(cmessage); return; end if + close(unt) ! close the file + + ! ********************************************************************************************** + ! (3) loop to parse individual file lines + ! ********************************************************************************************** + + ! initialize output frequency + outFreq(:) = .false. + + ! loop through the lines in the file + do vLine = 1,size(charLines) + + ! parse the current line + call split_line(charLines(vLine),lineWords,err,cmessage) + if(err/=0)then; message=trim(message)//trim(cmessage); return; end if + nWords = size(lineWords) + + ! define variable name + varName = trim(lineWords(nameIndex)) + + ! user cannot control time output + if (trim(varName)=='time') cycle + ! set precision if it is given + if (trim(varName)=='outputPrecision') then + statName = trim(lineWords(nWords)) + if (statName=='single' .or. statName=='float') then + outputPrecision = nf90_float + else if (statName=='double') then + outputPrecision = nf90_double + else + err=20 + cmessage='outputPrecision must be single, float, or double' + message=trim(message)//trim(cmessage)//trim(varName); + return + end if + cycle end if - cycle - end if - ! --- variables with multiple statistics options -------------------------- + ! --- variables with multiple statistics options -------------------------- - ! identify the data structure for the given variable (structName) and the variable index (vDex) - call get_ixUnknown(trim(varName),structName,vDex,err,cmessage) - if (err/=0) then; message=trim(message)//trim(cmessage)//trim(varName); return; end if; + ! identify the data structure for the given variable (structName) and the variable index (vDex) + call get_ixUnknown(trim(varName),structName,vDex,err,cmessage) + if (err/=0) then; message=trim(message)//trim(cmessage)//trim(varName); return; end if; - ! id variables should not be specified in output control file - if (trim(structName)=='id')then - print*,'id variable requested in outputControl, will be skipped: variable='//trim(varName) - cycle - end if + ! id variables should not be specified in output control file + if (trim(structName)=='id')then + print*,'id variable requested in outputControl, will be skipped: variable='//trim(varName) + cycle + end if - ! --- identify the desired frequency in the metadata structure ----------- + ! --- identify the desired frequency in the metadata structure ----------- + + ! process time-varying variables + select case(trim(structName)) + case('indx','forc','prog','diag','flux','bvar','deriv') + ! * ensure that the frequency index exists for time varying variables + if(nWords<freqIndex)then + message=trim(message)//'must define desired output frequency for time-varing output: variable='//trim(varName) + err=20; return + endif + + ! * define the frequency name + freqName = trim(lineWords(freqIndex)) + + ! * identify index in vector + select case(freqName) + ! define cases where temporal aggregation is numeric + case('1'); iFreq = iLookFreq%timestep ! assume timestep-level output + case('24'); iFreq = iLookFreq%day ! assume daily output + ! define cases where temporal aggregation is defined using a text string + case default; iFreq = get_ixfreq(freqName) + end select + + ! * check that we could find the index + if(iFreq<0 .or. iFreq>maxvarFreq)then + message=trim(message)//'unable to identify desired output frequency for variable '//trim(varName)& + //' [entered "'//trim(freqName)//'"]' + err=20; return + endif + + ! temporally constant variables use timestep-level output (no aggregation) + case default + iFreq = iLookFREQ%timestep + freqName = 'timestep' + message=trim(message)//'unable to identify desired output frequency for variable '//trim(varName)& + //' [entered "'//trim(freqName)//'"]; outputting variable in timestep file' + end select + + ! --- identify the desired statistic in the metadata structure ----------- + + ! * check the definition of statistics + ! there are three options to define the statistic: + ! option 0: file format = varName + ! option 0: file format = varName | outFreq + ! option 1: file format = varName | outFreq | statisticName + ! option 2: file format = varName | outFreq | inst | sum | mean | var | min | max | mode + select case(nWords) + case(nameIndex + 2, nameIndex); fileFormat=noStatsDesired ! no statistic desired (temporally constant variables) + case(freqIndex + 2 ); fileFormat=provideStatName ! provide the name of the desired statistic + case(freqIndex + 2*maxVarStat); fileFormat=provideStatFlags ! provide flags defining the desired statistic + case default + message=trim(message)//'unexpected format for variable '//trim(varName)& + //' (format = "'//trim(charLines(vLine))//'")' + err=20; return + end select - ! process time-varying variables - select case(trim(structName)) - case('indx','forc','prog','diag','flux','bvar','deriv') + ! * extract the statistic name + select case(fileFormat) + + ! no statistic desired (temporally constant variables) + case(noStatsDesired); statName = 'instant' ! use instantaneous values + + ! provide the name of the desired statistic + case(provideStatName); statName = trim(lineWords(freqIndex+2)) + + ! extract the statistic name from the flags + ! NOTE: cannot imagine why someone would want to do this now since the other option is easier + ! --> included for backwards compatibility + case(provideStatFlags) + ! get statistic name + statFlag(:) = .false. + do iStat = 1,maxVarStat + if (lineWords(freqIndex + 2*iStat)=='1') then + statFlag(iStat)=.true. + statName = get_statName(istat) + end if + end do + ! check actually defined the statistic (and only defined one statistic) + if(count(statFlag)/=1)then + message=trim(message)//'expect only one statistic is defined when using flags to define statistics'& + //': entered "'//trim(charLines(vLine))//'"' + err=20; return + endif + + ! check: should not get here since checked above + case default; err=20; message=trim(message)//'unexpected file format'; return + end select - ! * ensure that the frequency index exists for time varying variables - if(nWords<freqIndex)then - message=trim(message)//'must define desired output frequency for time-varing output: variable='//trim(varName) - err=20; return + ! * get the statistics index + iStat = get_ixStat(trim(statName)) + if(iStat<0 .or. iStat>maxvarStat)then + message=trim(message)//'unable to identify desired statistic for variable '//trim(varName)& + //' [evaluating '//trim(statName)//']' + err=20; return endif - ! * define the frequency name - freqName = trim(lineWords(freqIndex)) + ! --- populate the metadata that controls the model output --------------- - ! * identify index in vector - select case(freqName) - ! define cases where temporal aggregation is numeric - case('1'); iFreq = iLookFreq%timestep ! assume timestep-level output - case('24'); iFreq = iLookFreq%day ! assume daily output - ! define cases where temporal aggregation is defined using a text string - case default; iFreq = get_ixfreq(freqName) - end select + ! identify data structure + select case (trim(structName)) - ! * check that we could find the index - if(iFreq<0 .or. iFreq>maxvarFreq)then - message=trim(message)//'unable to identify desired output frequency for variable '//trim(varName)& - //' [entered "'//trim(freqName)//'"]' - err=20; return - endif + ! temporally constant structures -- request instantaneous timestep-level output (no aggregation) + case('time' ); time_meta(vDex)%statIndex(iLookFREQ%timestep) = iLookSTAT%inst; time_meta(vDex)%varDesire=.true. ! timing data + case('bpar' ); bpar_meta(vDex)%statIndex(iLookFREQ%timestep) = iLookSTAT%inst; bpar_meta(vDex)%varDesire=.true. ! basin parameters + case('attr' ); attr_meta(vDex)%statIndex(iLookFREQ%timestep) = iLookSTAT%inst; attr_meta(vDex)%varDesire=.true. ! local attributes + case('type' ); type_meta(vDex)%statIndex(iLookFREQ%timestep) = iLookSTAT%inst; type_meta(vDex)%varDesire=.true. ! local classification + case('mpar' ); mpar_meta(vDex)%statIndex(iLookFREQ%timestep) = iLookSTAT%inst; mpar_meta(vDex)%varDesire=.true. ! model parameters - ! temporally constant variables use timestep-level output (no aggregation) - case default - message=trim(message)//'unable to identify desired output frequency for variable '//trim(varName)& - //' [entered "'//trim(freqName)//'"]; outputting variable in timestep file' - iFreq = iLookFREQ%timestep - freqName = 'timestep' - end select - - ! --- identify the desired statistic in the metadata structure ----------- - - ! * check the definition of statistics - ! there are three options to define the statistic: - ! option 0: file format = varName - ! option 0: file format = varName | outFreq - ! option 1: file format = varName | outFreq | statisticName - ! option 2: file format = varName | outFreq | inst | sum | mean | var | min | max | mode - select case(nWords) - case(nameIndex + 2, nameIndex); fileFormat=noStatsDesired ! no statistic desired (temporally constant variables) - case(freqIndex + 2 ); fileFormat=provideStatName ! provide the name of the desired statistic - case(freqIndex + 2*maxVarStat); fileFormat=provideStatFlags ! provide flags defining the desired statistic - case default - message=trim(message)//'unexpected format for variable '//trim(varName)& - //' (format = "'//trim(charLines(vLine))//'")' - err=20; return - end select - - ! * extract the statistic name - select case(fileFormat) - - ! no statistic desired (temporally constant variables) - case(noStatsDesired); statName = 'instant' ! use instantaneous values - - ! provide the name of the desired statistic - case(provideStatName); statName = trim(lineWords(freqIndex+2)) - - ! extract the statistic name from the flags - ! NOTE: cannot imagine why someone would want to do this now since the other option is easier - ! --> included for backwards compatibility - case(provideStatFlags) - ! get statistic name - statFlag(:) = .false. - do iStat = 1,maxVarStat - if (lineWords(freqIndex + 2*iStat)=='1') then - statFlag(iStat)=.true. - statName = get_statName(istat) - end if - end do - ! check actually defined the statistic (and only defined one statistic) - if(count(statFlag)/=1)then - message=trim(message)//'expect only one statistic is defined when using flags to define statistics'& - //': entered "'//trim(charLines(vLine))//'"' - err=20; return + ! index structures -- can only be output at the model time step + case('indx' ); indx_meta(vDex)%statIndex(iLookFREQ%timestep) = iLookSTAT%inst; indx_meta(vDex)%varDesire=.true. + if(iFreq/=iLookFREQ%timestep)then + message=trim(message)//'index variables can only be output at model timestep'& + //' [evaluating variable "'//trim(varName)//'" for output frequency "'//trim(freqName)//'"]' + err=20; return endif - ! check: should not get here since checked above - case default; err=20; message=trim(message)//'unexpected file format'; return - end select - - ! * get the statistics index - iStat = get_ixStat(trim(statName)) - if(iStat<0 .or. iStat>maxvarStat)then - message=trim(message)//'unable to identify desired statistic for variable '//trim(varName)& - //' [evaluating '//trim(statName)//']' - err=20; return + ! temporally varying structures + case('forc' ); call popStat(forc_meta(vDex) , iFreq, iStat, err, cmessage) ! model forcing data + case('prog' ); call popStat(prog_meta(vDex) , iFreq, iStat, err, cmessage) ! model prognostics + case('diag' ); call popStat(diag_meta(vDex) , iFreq, iStat, err, cmessage) ! model diagnostics + case('flux' ); call popStat(flux_meta(vDex) , iFreq, iStat, err, cmessage) ! model fluxes + case('bvar' ); call popStat(bvar_meta(vDex) , iFreq, iStat, err, cmessage) ! basin variables + case('deriv'); call popStat(deriv_meta(vDex), iFreq, iStat, err, cmessage) ! model derivs + + ! error control + case default; err=20;message=trim(message)//'unable to identify lookup structure';return + + end select ! select data structure + + ! error control from popStat + if (err/=0) then; message=trim(message)//trim(cmessage);return; end if + + ! ensure that time is turned on + forc_meta(iLookForce%time)%statIndex(iLookFREQ%timestep) = iLookSTAT%inst + + ! set desired output frequency + outFreq(iFreq) = .true. + + ! print output (debugging) + !write(*,'(a)') 'freqName = '//trim(freqName)//'; statName = '//trim(statName)//'; charLines(vLine) = '//trim(charLines(vLine)) + + end do ! loop through file lines with vline + + ! ********************************************************************************************** + ! (4) include time variable + ! ********************************************************************************************** + + ! force time to be written in every file + forc_meta(iLookFORCE%time)%varDesire = .true. + forc_meta(iLookFORCE%time)%statIndex(:) = iLookSTAT%inst + +end subroutine read_output_file + +! ******************************************************************************************** +! Subroutine popStat for populating the meta_data structures with information read in from file. +! This routine is called by read_output_file +! ******************************************************************************************** +subroutine popStat(meta, iFreq, iStat, err, message) + USE data_types,only:var_info ! meta_data type declaration + USE get_ixname_module,only:get_freqName ! get name of frequency from frequency index (error control) + implicit none + ! dummy variables + class(var_info),intent(inout) :: meta ! dummy meta_data structure + integer(i4b),intent(in) :: iFreq ! index in output frequency vector + integer(i4b),intent(in) :: iStat ! index in output statistics vector + integer(i4b),intent(out) :: err ! error code + character(*),intent(out) :: message ! error message + ! initiate error handling + err=0; message='popStat/' + + ! check that the variable is not already defined for a given frequency + if(meta%statIndex(iFreq)/=integerMissing)then + message=trim(message)//'variable "'//trim(meta%varName)//'" is already defined '& + //'for output frequency "'//trim(get_freqName(iFreq))//'"' + err=20; return endif - ! --- populate the metadata that controls the model output --------------- + ! identify desired variabe + meta%varDesire = .true. - ! identify data structure - select case (trim(structName)) + ! populate structure + meta%statIndex(iFreq) = iStat - ! temporally constant structures -- request instantaneous timestep-level output (no aggregation) - case('time' ); time_meta(vDex)%statIndex(iLookFREQ%timestep) = iLookSTAT%inst; time_meta(vDex)%varDesire=.true. ! timing data - case('bpar' ); bpar_meta(vDex)%statIndex(iLookFREQ%timestep) = iLookSTAT%inst; bpar_meta(vDex)%varDesire=.true. ! basin parameters - case('attr' ); attr_meta(vDex)%statIndex(iLookFREQ%timestep) = iLookSTAT%inst; attr_meta(vDex)%varDesire=.true. ! local attributes - case('type' ); type_meta(vDex)%statIndex(iLookFREQ%timestep) = iLookSTAT%inst; type_meta(vDex)%varDesire=.true. ! local classification - case('mpar' ); mpar_meta(vDex)%statIndex(iLookFREQ%timestep) = iLookSTAT%inst; mpar_meta(vDex)%varDesire=.true. ! model parameters - - ! index structures -- can only be output at the model time step - case('indx' ); indx_meta(vDex)%statIndex(iLookFREQ%timestep) = iLookSTAT%inst; indx_meta(vDex)%varDesire=.true. - if(iFreq/=iLookFREQ%timestep)then - message=trim(message)//'index variables can only be output at model timestep'& - //' [evaluating variable "'//trim(varName)//'" for output frequency "'//trim(freqName)//'"]' - err=20; return - endif - - ! temporally varying structures - case('forc' ); call popStat(forc_meta(vDex) , iFreq, iStat, err, cmessage) ! model forcing data - case('prog' ); call popStat(prog_meta(vDex) , iFreq, iStat, err, cmessage) ! model prognostics - case('diag' ); call popStat(diag_meta(vDex) , iFreq, iStat, err, cmessage) ! model diagnostics - case('flux' ); call popStat(flux_meta(vDex) , iFreq, iStat, err, cmessage) ! model fluxes - case('bvar' ); call popStat(bvar_meta(vDex) , iFreq, iStat, err, cmessage) ! basin variables - case('deriv'); call popStat(deriv_meta(vDex), iFreq, iStat, err, cmessage) ! model derivs - - ! error control - case default; err=20;message=trim(message)//'unable to identify lookup structure';return - - end select ! select data structure - - ! error control from popStat - if (err/=0) then; message=trim(message)//trim(cmessage);return; end if - - ! ensure that time is turned on - forc_meta(iLookForce%time)%statIndex(iLookFREQ%timestep) = iLookSTAT%inst - - ! set desired output frequency - outFreq(iFreq) = .true. - - ! print output (debugging) - !write(*,'(a)') 'freqName = '//trim(freqName)//'; statName = '//trim(statName)//'; charLines(vLine) = '//trim(charLines(vLine)) - - end do ! loop through file lines with vline - - ! ********************************************************************************************** - ! (4) include time variable - ! ********************************************************************************************** - - ! force time to be written in every file - forc_meta(iLookFORCE%time)%varDesire = .true. - forc_meta(iLookFORCE%time)%statIndex(:) = iLookSTAT%inst - - end subroutine read_output_file - - ! ******************************************************************************************** - ! Subroutine popStat for populating the meta_data structures with information read in from file. - ! This routine is called by read_output_file - ! ******************************************************************************************** - subroutine popStat(meta, iFreq, iStat, err, message) - USE data_types,only:var_info ! meta_data type declaration - USE get_ixname_module,only:get_freqName ! get name of frequency from frequency index (error control) - implicit none - ! dummy variables - class(var_info),intent(inout) :: meta ! dummy meta_data structure - integer(i4b),intent(in) :: iFreq ! index in output frequency vector - integer(i4b),intent(in) :: iStat ! index in output statistics vector - integer(i4b),intent(out) :: err ! error code - character(*),intent(out) :: message ! error message - ! initiate error handling - err=0; message='popStat/' - - ! check that the variable is not already defined for a given frequency - if(meta%statIndex(iFreq)/=integerMissing)then - message=trim(message)//'variable "'//trim(meta%varName)//'" is already defined '& - //'for output frequency "'//trim(get_freqName(iFreq))//'"' - err=20; return - endif - - ! identify desired variabe - meta%varDesire = .true. - - ! populate structure - meta%statIndex(iFreq) = iStat - - end subroutine popStat +end subroutine popStat end module popMetadat_module diff --git a/build/source/engine/read_attribute.f90 b/build/source/engine/read_attribute.f90 index f8dd29237f45b45ce1651c383c28708dec469c33..1c74a541c4dce38022907eeffb788c91dba60940 100644 --- a/build/source/engine/read_attribute.f90 +++ b/build/source/engine/read_attribute.f90 @@ -30,122 +30,121 @@ contains ! public subroutine read_dimension: read HRU and GRU dimension information on local attributes ! ************************************************************************************************ subroutine read_dimension(attrFile,fileGRU,fileHRU,numGRUs,numHRUs,startGRU,err,message) - USE netcdf - USE netcdf_util_module,only:nc_file_open ! open netcdf file - USE netcdf_util_module,only:nc_file_close ! close netcdf file - USE nr_utility_module ,only:arth - ! provide access to global data - USE globalData,only:gru_struc ! gru->hru mapping structure - USE globalData,only:index_map ! hru->gru mapping structure - implicit none - - ! Dummy Variables - character(*),intent(in) :: attrFile ! name of attributed file - integer(i4b),intent(out) :: fileGRU ! number of GRUs in the input file - integer(i4b),intent(out) :: fileHRU ! number of HRUs in the input file - integer(i4b),intent(in) :: numGRUs ! number of GRUs for the run domain - integer(i4b),intent(out) :: numHRUs ! number of HRUs for the run domain (value filled in this subroutine) - integer(i4b),intent(in) :: startGRU ! Index of the starting GRU - integer(i4b),intent(out) :: err ! error code - character(*),intent(out) :: message ! error message - - ! Local Variables - integer(i4b) :: iHRU ! HRU couinting index - integer(i4b) :: iGRU ! GRU loop index - integer(8),allocatable :: gru_id(:),hru_id(:)! read gru/hru IDs in from attributes file - integer(8),allocatable :: hru2gru_id(:) ! read hru->gru mapping in from attributes file - integer(i4b),allocatable :: hru_ix(:) ! hru index for search - - ! define variables for NetCDF file operation - integer(i4b) :: ncID ! NetCDF file ID - integer(i4b) :: varID ! NetCDF variable ID - integer(i4b) :: gruDimId ! variable id of GRU dimension from netcdf file - integer(i4b) :: hruDimId ! variable id of HRU dimension from netcdf file - character(len=256) :: cmessage ! error message for downwind routine - - err=0; message="read_dimension/" - ! open nc file - call nc_file_open(trim(attrFile),nf90_noWrite,ncID,err,cmessage) - if(err/=0)then; message=trim(message)//trim(cmessage); return; end if - - ! ********************************************************************************************* - ! read and set GRU dimensions - ! ********************************************************************************************** - ! get gru dimension of whole file - err = nf90_inq_dimid(ncID,"gru",gruDimId); if(err/=nf90_noerr)then; message=trim(message)//'problem finding gru dimension/'//trim(nf90_strerror(err)); return; end if - err = nf90_inquire_dimension(ncID, gruDimId, len = fileGRU); if(err/=nf90_noerr)then; message=trim(message)//'problem reading gru dimension/'//trim(nf90_strerror(err)); return; end if - - ! get hru dimension of whole file - err = nf90_inq_dimid(ncID,"hru",hruDimId); if(err/=nf90_noerr)then; message=trim(message)//'problem finding hru dimension/'//trim(nf90_strerror(err)); return; end if - err = nf90_inquire_dimension(ncID, hruDimId, len = fileHRU); if(err/=nf90_noerr)then; message=trim(message)//'problem reading hru dimension/'//trim(nf90_strerror(err)); return; end if - - ! check dimensions - if(numGRUs > fileGRU .or. numGRUs < 1) then; err=20; message=trim(message)//"numGRUs is out of range"; return; end if - - ! ********************************************************************************************* - ! read mapping vectors and populate mapping structures - ! ********************************************************************************************** - ! allocate space for GRU indices and HRU indices - allocate(gru_id(fileGRU)) - allocate(hru_ix(fileHRU),hru_id(fileHRU),hru2gru_id(fileHRU)) - - ! read gru_id from netcdf file - err = nf90_inq_varid(ncID,"gruId",varID); if (err/=0) then; message=trim(message)//'problem finding gruId'; return; end if - err = nf90_get_var(ncID,varID,gru_id); if (err/=0) then; message=trim(message)//'problem reading gruId'; return; end if - - ! read hru_id from netcdf file - err = nf90_inq_varid(ncID,"hruId",varID); if (err/=0) then; message=trim(message)//'problem finding hruId'; return; end if - err = nf90_get_var(ncID,varID,hru_id); if (err/=0) then; message=trim(message)//'problem reading hruId'; return; end if - - ! read hru2gru_id from netcdf file - err = nf90_inq_varid(ncID,"hru2gruId",varID); if (err/=0) then; message=trim(message)//'problem finding hru2gruId'; return; end if - err = nf90_get_var(ncID,varID,hru2gru_id); if (err/=0) then; message=trim(message)//'problem reading hru2gruId'; return; end if - - ! array from 1 to total # of HRUs in attributes file - hru_ix=arth(1,1,fileHRU) - - ! check that the mappings are not alreaday allocated - if (allocated(gru_struc)) then - deallocate(gru_struc) - endif - - if (allocated(index_map)) then - deallocate(index_map) - endif - - ! allocate first level of gru to hru mapping - allocate(gru_struc(numGRUs)) - - ! allocate space for the run - iHRU = 1 - do iGRU = 1,numGRUs - if (count(hru2gru_Id == gru_id(iGRU+startGRU-1)) < 1) then; err=20; message=trim(message)//'problem finding HRUs belonging to GRU'; return; end if - gru_struc(iGRU)%hruCount = count(hru2gru_Id == gru_id(iGRU+startGRU-1)) ! number of HRUs in each GRU - gru_struc(iGRU)%gru_id = gru_id(iGRU+startGRU-1) ! set gru id - gru_struc(iGRU)%gru_nc = iGRU+startGRU-1 ! set gru index in the netcdf file - - allocate(gru_struc(iGRU)%hruInfo(gru_struc(iGRU)%hruCount)) ! allocate second level of gru to hru map - gru_struc(iGRU)%hruInfo(:)%hru_nc = pack(hru_ix,hru2gru_id == gru_struc(iGRU)%gru_id) ! set hru id in attributes netcdf file - gru_struc(iGRU)%hruInfo(:)%hru_ix = arth(iHRU,1,gru_struc(iGRU)%hruCount) ! set index of hru in run domain - gru_struc(iGRU)%hruInfo(:)%hru_id = hru_id(gru_struc(iGRU)%hruInfo(:)%hru_nc) ! set id of hru - iHRU = iHRU + gru_struc(iGRU)%hruCount - end do ! iGRU = 1,nGRU - - ! set hru to gru mapping - numHRUs = sum(gru_struc%hruCount) ! Total number of HRUs - allocate(index_map(numHRUs)) ! allocate first level of hru to gru mapping - - do iGRU = 1, numGRUs - index_map(gru_struc(iGRU)%hruInfo(:)%hru_ix)%gru_ix = iGRU ! index of gru in run domain to which the hru belongs - index_map(gru_struc(iGRU)%hruInfo(:)%hru_ix)%localHRU_ix = hru_ix(1:gru_struc(iGRU)%hruCount)! index of hru within the gru - end do ! iGRU =1, numGRUs - - - deallocate(gru_id, hru_ix, hru_id, hru2gru_id) + USE netcdf + USE netcdf_util_module,only:nc_file_open ! open netcdf file + USE netcdf_util_module,only:nc_file_close ! close netcdf file + USE nr_utility_module ,only:arth + ! provide access to global data + USE globalData,only:gru_struc ! gru->hru mapping structure + USE globalData,only:index_map ! hru->gru mapping structure + implicit none + + ! Dummy Variables + character(*),intent(in) :: attrFile ! name of attributed file + integer(i4b),intent(out) :: fileGRU ! number of GRUs in the input file + integer(i4b),intent(out) :: fileHRU ! number of HRUs in the input file + integer(i4b),intent(in) :: numGRUs ! number of GRUs for the run domain + integer(i4b),intent(out) :: numHRUs ! number of HRUs for the run domain (value filled in this subroutine) + integer(i4b),intent(in) :: startGRU ! Index of the starting GRU + integer(i4b),intent(out) :: err ! error code + character(*),intent(out) :: message ! error message + + ! Local Variables + integer(i4b) :: iHRU ! HRU couinting index + integer(i4b) :: iGRU ! GRU loop index + integer(8),allocatable :: gru_id(:),hru_id(:)! read gru/hru IDs in from attributes file + integer(8),allocatable :: hru2gru_id(:) ! read hru->gru mapping in from attributes file + integer(i4b),allocatable :: hru_ix(:) ! hru index for search + + ! define variables for NetCDF file operation + integer(i4b) :: ncID ! NetCDF file ID + integer(i4b) :: varID ! NetCDF variable ID + integer(i4b) :: gruDimId ! variable id of GRU dimension from netcdf file + integer(i4b) :: hruDimId ! variable id of HRU dimension from netcdf file + character(len=256) :: cmessage ! error message for downwind routine + + err=0; message="read_dimension/" + ! open nc file + call nc_file_open(trim(attrFile),nf90_noWrite,ncID,err,cmessage) + if(err/=0)then; message=trim(message)//trim(cmessage); return; end if + + ! ********************************************************************************************* + ! read and set GRU dimensions + ! ********************************************************************************************** + ! get gru dimension of whole file + err = nf90_inq_dimid(ncID,"gru",gruDimId); if(err/=nf90_noerr)then; message=trim(message)//'problem finding gru dimension/'//trim(nf90_strerror(err)); return; end if + err = nf90_inquire_dimension(ncID, gruDimId, len = fileGRU); if(err/=nf90_noerr)then; message=trim(message)//'problem reading gru dimension/'//trim(nf90_strerror(err)); return; end if + + ! get hru dimension of whole file + err = nf90_inq_dimid(ncID,"hru",hruDimId); if(err/=nf90_noerr)then; message=trim(message)//'problem finding hru dimension/'//trim(nf90_strerror(err)); return; end if + err = nf90_inquire_dimension(ncID, hruDimId, len = fileHRU); if(err/=nf90_noerr)then; message=trim(message)//'problem reading hru dimension/'//trim(nf90_strerror(err)); return; end if + + ! check dimensions + if(numGRUs > fileGRU .or. numGRUs < 1) then; err=20; message=trim(message)//"numGRUs is out of range"; return; end if + + ! ********************************************************************************************* + ! read mapping vectors and populate mapping structures + ! ********************************************************************************************** + ! allocate space for GRU indices and HRU indices + allocate(gru_id(fileGRU)) + allocate(hru_ix(fileHRU),hru_id(fileHRU),hru2gru_id(fileHRU)) + + ! read gru_id from netcdf file + err = nf90_inq_varid(ncID,"gruId",varID); if (err/=0) then; message=trim(message)//'problem finding gruId'; return; end if + err = nf90_get_var(ncID,varID,gru_id); if (err/=0) then; message=trim(message)//'problem reading gruId'; return; end if + + ! read hru_id from netcdf file + err = nf90_inq_varid(ncID,"hruId",varID); if (err/=0) then; message=trim(message)//'problem finding hruId'; return; end if + err = nf90_get_var(ncID,varID,hru_id); if (err/=0) then; message=trim(message)//'problem reading hruId'; return; end if + + ! read hru2gru_id from netcdf file + err = nf90_inq_varid(ncID,"hru2gruId",varID); if (err/=0) then; message=trim(message)//'problem finding hru2gruId'; return; end if + err = nf90_get_var(ncID,varID,hru2gru_id); if (err/=0) then; message=trim(message)//'problem reading hru2gruId'; return; end if + + ! array from 1 to total # of HRUs in attributes file + hru_ix=arth(1,1,fileHRU) + + ! check that the mappings are not alreaday allocated + if (allocated(gru_struc)) then + deallocate(gru_struc) + endif + + if (allocated(index_map)) then + deallocate(index_map) + endif + + ! allocate first level of gru to hru mapping + allocate(gru_struc(numGRUs)) + + ! allocate space for the run + iHRU = 1 + do iGRU = 1,numGRUs + if (count(hru2gru_Id == gru_id(iGRU+startGRU-1)) < 1) then; err=20; message=trim(message)//'problem finding HRUs belonging to GRU'; return; end if + gru_struc(iGRU)%hruCount = count(hru2gru_Id == gru_id(iGRU+startGRU-1)) ! number of HRUs in each GRU + gru_struc(iGRU)%gru_id = gru_id(iGRU+startGRU-1) ! set gru id + gru_struc(iGRU)%gru_nc = iGRU+startGRU-1 ! set gru index in the netcdf file + + allocate(gru_struc(iGRU)%hruInfo(gru_struc(iGRU)%hruCount)) ! allocate second level of gru to hru map + gru_struc(iGRU)%hruInfo(:)%hru_nc = pack(hru_ix,hru2gru_id == gru_struc(iGRU)%gru_id) ! set hru id in attributes netcdf file + gru_struc(iGRU)%hruInfo(:)%hru_ix = arth(iHRU,1,gru_struc(iGRU)%hruCount) ! set index of hru in run domain + gru_struc(iGRU)%hruInfo(:)%hru_id = hru_id(gru_struc(iGRU)%hruInfo(:)%hru_nc) ! set id of hru + iHRU = iHRU + gru_struc(iGRU)%hruCount + end do ! iGRU = 1,nGRU + + ! set hru to gru mapping + numHRUs = sum(gru_struc%hruCount) ! Total number of HRUs + allocate(index_map(numHRUs)) ! allocate first level of hru to gru mapping + + do iGRU = 1, numGRUs + index_map(gru_struc(iGRU)%hruInfo(:)%hru_ix)%gru_ix = iGRU ! index of gru in run domain to which the hru belongs + index_map(gru_struc(iGRU)%hruInfo(:)%hru_ix)%localHRU_ix = hru_ix(1:gru_struc(iGRU)%hruCount)! index of hru within the gru + end do ! iGRU =1, numGRUs + + + deallocate(gru_id, hru_ix, hru_id, hru2gru_id) ! close netcdf file - call nc_file_close(ncID,err,cmessage) - if (err/=0) then; message=trim(message)//trim(cmessage); return; end if - + call nc_file_close(ncID,err,cmessage) + if (err/=0) then; message=trim(message)//trim(cmessage); return; end if end subroutine read_dimension @@ -332,6 +331,7 @@ subroutine read_attribute(indxHRU, indxGRU, attrFile, attrStruct, typeStruct, id ! ********************************************************************************************** ! (5) close netcdf file ! ********************************************************************************************** + call nc_file_close(ncID,err,cmessage) if (err/=0)then; message=trim(message)//trim(cmessage); return; end if diff --git a/build/source/interface/file_access_actor/cppwrap_fileAccess.f90 b/build/source/interface/file_access_actor/cppwrap_fileAccess.f90 index 1f51addfcf9429a802f11428c213b81be31b34e3..8173c57cd664804dca6e74f36dd8433d757373b7 100644 --- a/build/source/interface/file_access_actor/cppwrap_fileAccess.f90 +++ b/build/source/interface/file_access_actor/cppwrap_fileAccess.f90 @@ -44,11 +44,11 @@ subroutine ffile_info_C(indxGRU, handle_forcFileInfo, numFiles, err) bind(C, nam end subroutine ffile_info_C +! THis subroutine needs to be called after the ffile_info_C subroutine +! It might make more sense to have this in the global data inialization +! subroutine. But here it sits subroutine mDecisions_C(num_steps,err) bind(C, name='mDecisions_C') USE mDecisions_module,only:mDecisions ! module to read model decisions - USE allocspace4chm_module,only:allocLocal - USE globalData,only:startTime,finshTime,refTime,oldTime - USE globalData,only:time_meta implicit none ! dummy variables @@ -58,17 +58,6 @@ subroutine mDecisions_C(num_steps,err) bind(C, name='mDecisions_C') integer(i4b) :: iStruct character(len=256) :: message ! error message character(LEN=256) :: cmessage ! error message of downwind routine - ! We need to initalize these time variables for the global variables that the hrus will copy - ! allocate time structures - do iStruct=1,4 - select case(iStruct) - case(1); call allocLocal(time_meta, startTime, err=err, message=cmessage) ! start time for the model simulation - case(2); call allocLocal(time_meta, finshTime, err=err, message=cmessage) ! end time for the model simulation - case(3); call allocLocal(time_meta, refTime, err=err, message=cmessage) ! reference time for the model simulation - case(4); call allocLocal(time_meta, oldTime, err=err, message=cmessage) ! time from the previous step - end select - if(err/=0)then; message=trim(message)//trim(cmessage); return; endif - end do ! looping through time structures call mDecisions(num_steps,err,cmessage) if(err/=0)then @@ -449,29 +438,10 @@ subroutine FileAccessActor_DeallocateStructures(handle_forcFileInfo, handle_ncid deallocate(forcingDataStruct) deallocate(forcFileInfo) + deallocate(outputStructure) deallocate(outputTimeStep) deallocate(ncid) - deallocate(startTime%var); - deallocate(finshTime%var); - deallocate(refTime%var); - deallocate(oldTime%var); if(allocated(vecTime)) then; deallocate(vecTime); endif - if(allocated(averageFlux_meta)) then; deallocate(averageFlux_meta); endif - if(allocated(statForc_meta)) then; deallocate(statForc_meta); endif - if(allocated(statProg_meta)) then; deallocate(statProg_meta); endif - if(allocated(statDiag_meta)) then; deallocate(statDiag_meta); endif - if(allocated(statFlux_meta)) then; deallocate(statFlux_meta); endif - if(allocated(statIndx_meta)) then; deallocate(statIndx_meta); endif - if(allocated(statBvar_meta)) then; deallocate(statBvar_meta); endif - if(allocated(forcChild_map)) then; deallocate(forcChild_map); endif - if(allocated(progChild_map)) then; deallocate(progChild_map); endif - if(allocated(diagChild_map)) then; deallocate(diagChild_map); endif - if(allocated(fluxChild_map)) then; deallocate(fluxChild_map); endif - if(allocated(indxChild_map)) then; deallocate(indxChild_map); endif - if(allocated(bvarChild_map)) then; deallocate(bvarChild_map); endif - if(allocated(childFLUX_MEAN))then; deallocate(childFLUX_MEAN);endif - if(allocated(gru_struc))then; deallocate(gru_struc);endif - if(allocated(index_map))then; deallocate(index_map);endif end subroutine FileAccessActor_DeallocateStructures diff --git a/build/source/interface/job_actor/cppwrap_job.f90 b/build/source/interface/job_actor/cppwrap_job.f90 index 4eb777d9c081a72716cf209d538b7daf6bb3ab19..fdb62f7e56b571efba4280288bacaa6b26b26b43 100644 --- a/build/source/interface/job_actor/cppwrap_job.f90 +++ b/build/source/interface/job_actor/cppwrap_job.f90 @@ -6,6 +6,8 @@ module cppwrap_job implicit none public::initGlobals + public::cleanUpJobActor + private::allocTime contains ! ********************************************************************************************************** @@ -75,37 +77,108 @@ subroutine initGlobals(file_manager, totalGRUs, totalHRUs, numGRUs, numHRUs, sta ! Set the index of the start GRU startGRU = startGRUIndex - ! ***************************************************************************** - ! *** read the number of GRUs and HRUs - ! ***************************************************************************** - attrFile = trim(SETTINGS_PATH)//trim(LOCAL_ATTRIBUTES) - call read_dimension(trim(attrFile),fileGRU,fileHRU,numGRUs,numHRUs,startGRUIndex,err,cmessage) - if(err/=0)then - message=trim(message)//trim(cmessage) - print*, cmessage - return - endif - totalGRUs = fileGRU - totalHRUs = fileHRU - - ! ***************************************************************************** - ! *** read the number of snow and soil layers - ! ***************************************************************************** - ! set restart filename and read the number of snow and soil layers from the initial conditions (restart) file - if(STATE_PATH == '') then - restartFile = trim(SETTINGS_PATH)//trim(MODEL_INITCOND) - else - restartFile = trim(STATE_PATH)//trim(MODEL_INITCOND) - endif - - call read_icond_nlayers(trim(restartFile),numGRUs,indx_meta,err,cmessage) -! if(err/=0)then; message=trim(message)//trim(cmessage); return; endif; - if(err/=0)then - message=trim(message)//trim(cmessage) - print*, cmessage + ! ***************************************************************************** + ! *** read the number of GRUs and HRUs + ! ***************************************************************************** + attrFile = trim(SETTINGS_PATH)//trim(LOCAL_ATTRIBUTES) + call read_dimension(trim(attrFile),fileGRU,fileHRU,numGRUs,numHRUs,startGRUIndex,err,cmessage) + if(err/=0)then + message=trim(message)//trim(cmessage) + print*, cmessage return - endif + endif + totalGRUs = fileGRU + totalHRUs = fileHRU + + ! ***************************************************************************** + ! *** read the number of snow and soil layers + ! ***************************************************************************** + ! set restart filename and read the number of snow and soil layers from the initial conditions (restart) file + if(STATE_PATH == '') then + restartFile = trim(SETTINGS_PATH)//trim(MODEL_INITCOND) + else + restartFile = trim(STATE_PATH)//trim(MODEL_INITCOND) + endif + call read_icond_nlayers(trim(restartFile),numGRUs,indx_meta,err,cmessage) + if(err/=0)then + message=trim(message)//trim(cmessage) + print*, cmessage + return + endif + + ! Initalize time structures + call allocTime(err) + if(err/=0)then; message=trim(message)//trim(cmessage); return; endif + end subroutine initGlobals + +subroutine allocTime(err) + USE globalData,only:startTime,finshTime,refTime,oldTime + USE allocspace4chm_module,only:allocLocal + USE globalData,only:time_meta + + implicit none + ! dummy variables + integer(i4b),intent(inout) :: err + ! local variables + character(len=256) :: cmessage + + call allocLocal(time_meta, startTime, err=err, message=cmessage) + call allocLocal(time_meta, finshTime, err=err, message=cmessage) + call allocLocal(time_meta, refTime, err=err, message=cmessage) + call allocLocal(time_meta, oldTime, err=err, message=cmessage) + +end subroutine allocTime + + +subroutine cleanUpJobActor(err) bind(C, name='cleanUpJobActor') + USE globalData,only:structInfo ! information on the data structures + USE globalData,only:statForc_meta ! child metadata for stats + USE globalData,only:statProg_meta ! child metadata for stats + USE globalData,only:statDiag_meta ! child metadata for stats + USE globalData,only:statFlux_meta ! child metadata for stats + USE globalData,only:statIndx_meta ! child metadata for stats + USE globalData,only:statBvar_meta ! child metadata for stats + USE globalData,only:forcChild_map ! index of the child data structure: stats forc + USE globalData,only:progChild_map ! index of the child data structure: stats prog + USE globalData,only:diagChild_map ! index of the child data structure: stats diag + USE globalData,only:fluxChild_map ! index of the child data structure: stats flux + USE globalData,only:indxChild_map ! index of the child data structure: stats indx + USE globalData,only:bvarChild_map ! index of the child data structure: stats bvar + USE globalData,only:gru_struc ! gru->hru mapping structure + USE globalData,only:index_map + USE globalData,only:startTime,finshTime,refTime,oldTime + USE var_lookup,only:childFLUX_MEAN ! look-up values for timestep-average model fluxes + + implicit none + integer(c_int), intent(inout) :: err + + + ! Deallocate Time Varaibles + deallocate(startTime%var); + deallocate(finshTime%var); + deallocate(refTime%var); + deallocate(oldTime%var); + + if(allocated(averageFlux_meta)) then; deallocate(averageFlux_meta); endif + if(allocated(statForc_meta)) then; deallocate(statForc_meta); endif + if(allocated(statProg_meta)) then; deallocate(statProg_meta); endif + if(allocated(statDiag_meta)) then; deallocate(statDiag_meta); endif + if(allocated(statFlux_meta)) then; deallocate(statFlux_meta); endif + if(allocated(statIndx_meta)) then; deallocate(statIndx_meta); endif + if(allocated(statBvar_meta)) then; deallocate(statBvar_meta); endif + if(allocated(forcChild_map)) then; deallocate(forcChild_map); endif + if(allocated(progChild_map)) then; deallocate(progChild_map); endif + if(allocated(diagChild_map)) then; deallocate(diagChild_map); endif + if(allocated(fluxChild_map)) then; deallocate(fluxChild_map); endif + if(allocated(indxChild_map)) then; deallocate(indxChild_map); endif + if(allocated(bvarChild_map)) then; deallocate(bvarChild_map); endif + if(allocated(childFLUX_MEAN))then; deallocate(childFLUX_MEAN);endif + if(allocated(gru_struc))then; deallocate(gru_struc);endif + if(allocated(index_map))then; deallocate(index_map);endif + +end subroutine cleanUpJobActor + end module cppwrap_job \ No newline at end of file diff --git a/build/source/interface/job_actor/job_subroutine_wrappers.h b/build/source/interface/job_actor/job_subroutine_wrappers.h index e56ce6c21093f5647c4c659bb99da7b51515be49..8326cb0020c22b63d4f7f6ac0f729d58f49e7572 100644 --- a/build/source/interface/job_actor/job_subroutine_wrappers.h +++ b/build/source/interface/job_actor/job_subroutine_wrappers.h @@ -5,6 +5,7 @@ extern "C" { void initGlobals(char const*str1, int* totalGRUs, int* totalHRUs, int* numGRUs, int* numHRUs, int* startGRUIndex, int* err); + void cleanUpJobActor(int* err); } diff --git a/build/source/testing/Test/HRUTest.h b/build/source/testing/Test/HRUTest.h new file mode 100644 index 0000000000000000000000000000000000000000..e30de4e5af23b1bed359a93e0272e0611ed4be28 --- /dev/null +++ b/build/source/testing/Test/HRUTest.h @@ -0,0 +1,257 @@ +#ifndef HRUTEST_H_ +#define HRUTEST_H_ + +#include "caf/all.hpp" +#include "/home/k13nk/SummaProject/Summa-Actors/build/source/interface/fortran_dataTypes.h" +#include "/home/k13nk/SummaProject/Summa-Actors/build/source/interface/hru_actor/hru_subroutine_wrappers.h" +#include "messageAtoms.h" +#include <fstream> +#include <string> +#include <typeinfo> +#include <stdio.h> +#include <sys/time.h> +#include <sys/resource.h> +#include <chrono> +#include <iostream> +#include "/home/k13nk/SummaProject/Summa-Actors/build/source/actors/global.h" + +using namespace caf; + +struct hru_state { + // Actor References + caf::actor file_access_actor; + caf::actor parent; + + // Info about which HRU we are and our indexes + // into global structures in Fortran + int indxHRU; // index for hru part of derived types in FORTRAN + int indxGRU; // index for gru part of derived types in FORTRAN + int refGRU; // The actual ID of the GRU we are + + // Variables for output/forcing structures + int outputStrucSize; + int outputStep; + int stepsInCurrentFFile; + int forcingFileStep; + int currentForcingFile = 1; + + + // statistics structures + void *handle_forcStat = new_handle_var_dlength(); // model forcing data + void *handle_progStat = new_handle_var_dlength(); // model prognostic (state) variables + void *handle_diagStat = new_handle_var_dlength(); // model diagnostic variables + void *handle_fluxStat = new_handle_var_dlength(); // model fluxes + void *handle_indxStat = new_handle_var_dlength(); // model indices + void *handle_bvarStat = new_handle_var_dlength(); // basin-average variables + // primary data structures (scalars) + void *handle_timeStruct = new_handle_var_i(); // model time data + void *handle_forcStruct = new_handle_var_d(); // model forcing data + void *handle_attrStruct = new_handle_var_d(); // local attributes for each HRU + void *handle_typeStruct = new_handle_var_i(); // local classification of soil veg etc. for each HRU + void *handle_idStruct = new_handle_var_i8(); + // primary data structures (variable length vectors) + void *handle_indxStruct = new_handle_var_ilength(); // model indices + void *handle_mparStruct = new_handle_var_dlength(); // model parameters + void *handle_progStruct = new_handle_var_dlength(); // model prognostic (state) variables + void *handle_diagStruct = new_handle_var_dlength(); // model diagnostic variables + void *handle_fluxStruct = new_handle_var_dlength(); // model fluxes + // basin-average structures + void *handle_bparStruct = new_handle_var_d(); // basin-average parameters + void *handle_bvarStruct = new_handle_var_dlength(); // basin-average variables + // ancillary data structures + void *handle_dparStruct = new_handle_var_d(); // default model parameters + // Local hru data + void *handle_ncid = new_handle_var_i(); // output file ids + void *handle_statCounter = new_handle_var_i(); + void *handle_outputTimeStep = new_handle_var_i(); + void *handle_resetStats = new_handle_flagVec(); + void *handle_finalizeStats = new_handle_flagVec(); + void *handle_oldTime = new_handle_var_i(); + void *handle_refTime = new_handle_var_i(); + void *handle_finshTime = new_handle_var_i(); + void *handle_startTime = new_handle_var_i(); + // Misc Variables + int timestep = 1; // Current Timestep of HRU simulation + int computeVegFlux; // flag to indicate if we are computing fluxes over vegetation + double dt_init; // used to initialize the length of the sub-step for each HRU + double upArea; // area upslope of each HRU + int num_steps = 0; // number of time steps + int forcingStep; // index of current time step in current forcing file + int iFile; // index of current forcing file from forcing file list + int dt_init_factor = 1; // factor of dt_init (coupled_em) + bool printOutput; + int outputFrequency; + + + // Julian Day variables + double fracJulDay; + double tmZoneOffsetFracDay; + int yearLength; + int err = 0; // error conotrol + + std::chrono::time_point<std::chrono::system_clock> start; + std::chrono::time_point<std::chrono::system_clock> end; + double duration = 0.0; + std::chrono::time_point<std::chrono::system_clock> initStart; + std::chrono::time_point<std::chrono::system_clock> initEnd; + double initDuration = 0.0; + std::chrono::time_point<std::chrono::system_clock> forcingStart; + std::chrono::time_point<std::chrono::system_clock> forcingEnd; + double forcingDuration = 0.0; + std::chrono::time_point<std::chrono::system_clock> runPhysicsStart; + std::chrono::time_point<std::chrono::system_clock> runPhysicsEnd; + double runPhysicsDuration = 0.0; + std::chrono::time_point<std::chrono::system_clock> writeOutputStart; + std::chrono::time_point<std::chrono::system_clock> writeOutputEnd; + double writeOutputDuration = 0.0; + +}; + +/** + * @brief Get the settings from the settings JSON file + * + * @param self Actor State + * @param configPath Path to the directory that contains the settings file + */ +void parseSettings(stateful_actor<hru_state>* self, std::string configPath); + +/** + Function to initalize the HRU for running + */ +void Initialize_HRU(stateful_actor<hru_state>* self); + +/** + Function runs all of the hru time_steps + */ +int Run_HRU(stateful_actor<hru_state>* self); + +bool check_HRU(stateful_actor<hru_state>* self, int err); + +void initalizeTimeVars(stateful_actor<hru_state>* self); + +void finalizeTimeVars(stateful_actor<hru_state>* self); + +void deallocateHRUStructures(stateful_actor<hru_state>* self); + +void printOutput(stateful_actor<hru_state>* self); + + + +/** + * @brief HRU Actor is reponsible for carrying out the computation component of SUMMA + * + * @param self The Actor Ref + * @param refGRU The GRU we are computing in reference to the forcingFile + * @param indxGRU The GRU we are computing's index in gru_struc + * @param parent + * @return behavior + */ +behavior hru_actor(stateful_actor<hru_state>* self, int refGRU, int indxGRU, + std::string configPath, + int outputStrucSize, caf::actor parent) { + // Timing Information + self->state.start = std::chrono::high_resolution_clock::now(); + self->state.duration = 0.0; + self->state.initDuration = 0.0; + + // Actor References + self->state.parent = parent; + + // Indexes into global structures + self->state.indxHRU = 1; + self->state.indxGRU = indxGRU; + self->state.refGRU = refGRU; + + // OutputStructure Size (how many timesteps we can compute before we need to write) + self->state.outputStrucSize = outputStrucSize; + + // initialize counters + self->state.timestep = 1; // Timestep of total simulation + self->state.outputStep = 1; // Index of the output structure + self->state.forcingStep = 1; // Index into the forcing file + self->state.iFile = 1; + + Initialize_HRU(self); + + DeallocateStructures(self->state.handle_forcStat, + self->state.handle_progStat, + self->state.handle_diagStat, + self->state.handle_fluxStat, + self->state.handle_indxStat, + self->state.handle_bvarStat, + self->state.handle_timeStruct, + self->state.handle_forcStruct, + self->state.handle_attrStruct, + self->state.handle_typeStruct, + self->state.handle_idStruct, + self->state.handle_indxStruct, + self->state.handle_mparStruct, + self->state.handle_progStruct, + self->state.handle_diagStruct, + self->state.handle_fluxStruct, + self->state.handle_bparStruct, + self->state.handle_bvarStruct, + self->state.handle_dparStruct, + self->state.handle_startTime, + self->state.handle_finshTime, + self->state.handle_refTime, + self->state.handle_oldTime, + self->state.handle_ncid, + self->state.handle_statCounter, + self->state.handle_outputTimeStep, + self->state.handle_resetStats, + self->state.handle_finalizeStats, + &self->state.err); + + self->state.end = std::chrono::high_resolution_clock::now(); + self->state.duration += calculateTime(self->state.start, self->state.end); + + self->send(self->state.parent, done_init_hru_v); + + return { + }; + /********************************************************************************************************* + *********************************** END ACTOR MESSAGE HANDLERS ****************************************** + *********************************************************************************************************/ +} + +void Initialize_HRU(stateful_actor<hru_state>* self) { + self->state.initStart = std::chrono::high_resolution_clock::now(); + // aout(self) << "Initalizing HRU" << std::endl; + aout(self) << "Entering Initalize \n"; + Initialize(&self->state.indxGRU, + &self->state.num_steps, + self->state.handle_forcStat, + self->state.handle_progStat, + self->state.handle_diagStat, + self->state.handle_fluxStat, + self->state.handle_indxStat, + self->state.handle_bvarStat, + self->state.handle_timeStruct, + self->state.handle_forcStruct, + self->state.handle_attrStruct, + self->state.handle_typeStruct, + self->state.handle_idStruct, + self->state.handle_indxStruct, + self->state.handle_mparStruct, + self->state.handle_progStruct, + self->state.handle_diagStruct, + self->state.handle_fluxStruct, + self->state.handle_bparStruct, + self->state.handle_bvarStruct, + self->state.handle_dparStruct, + self->state.handle_startTime, + self->state.handle_finshTime, + self->state.handle_refTime, + self->state.handle_oldTime, &self->state.err); + + if (self->state.err != 0) { + aout(self) << "Error: Initialize - HRU = " << self->state.indxHRU << + " - indxGRU = " << self->state.indxGRU << " - refGRU = "<< self->state.refGRU << std::endl; + aout(self) << "Error = " << self->state.err << "\n"; + self->quit(); + return; + } + +} +#endif \ No newline at end of file diff --git a/build/source/testing/Test/JobTest.h b/build/source/testing/Test/JobTest.h new file mode 100644 index 0000000000000000000000000000000000000000..263077795c586dc92ec985a302e0e713cc3212db --- /dev/null +++ b/build/source/testing/Test/JobTest.h @@ -0,0 +1,117 @@ +#ifndef JOBTEST_H_ +#define JOBTEST_H_ + +#include "caf/all.hpp" +#include "caf/io/all.hpp" +#include "string.h" +#include <unistd.h> +#include <vector> +#include "/home/k13nk/SummaProject/Summa-Actors/build/source/interface/job_actor/job_subroutine_wrappers.h" +#include "HRUTest.h" +#include <chrono> +#include "messageAtoms.h" +#include <iostream> +#include <fstream> +#include <sys/stat.h> +#include "/home/k13nk/SummaProject/Summa-Actors/build/source/actors/global.h" + +struct job_state { + // Actor References + caf::actor parent; // actor reference to the top-level SummaActor + + // Job Parameters + int startGRU; // Starting GRU for this job + int numGRU; // Number of GRUs for this job + std::string configPath; + + std::string fileManager; // Path of the fileManager.txt file + + // Variables for GRU monitoring + int dt_init_start_factor = 1; // Initial Factor for dt_init (coupled_em) + int maxRunAttempts = 3; // Max number of attemtps to solve a GRU + int numGRUDone = 0; // The number of GRUs that have completed + int GRUInit = 0; // Number of GRUs initalized + int err = 0; // Error Code + int numGRUFailed = 0; // Number of GRUs that have failed + int outputStrucSize; + + // Timing Variables + std::chrono::time_point<std::chrono::system_clock> start; + std::chrono::time_point<std::chrono::system_clock> end; + double duration; + + // Output File Names for Timings + bool outputCSV; + std::string csvOut; + std::string csvPath; + std::string successOutputFile; + std::string failedOutputFile = "failedHRU"; + std::string fileAccessActorStats = "fileAccessActor.csv"; + +}; + +int parseSettings(stateful_actor<job_state>* self, std::string configPath); + +void initJob(stateful_actor<job_state>* self); + +void initalizeGRU(stateful_actor<job_state>* self); + +void runGRUs(stateful_actor<job_state>* self); + +void restartFailures(stateful_actor<job_state>* self); + +behavior job_actor(stateful_actor<job_state>* self) { + self->state.start = std::chrono::high_resolution_clock::now(); + // Set Job Variables + self->state.startGRU = 1; + self->state.numGRU = 500; + self->state.configPath = "/home/k13nk/SummaProject/Summa-Actors/config"; + self->state.outputStrucSize = 100; + self->state.fileManager = "/home/k13nk/SummaProject/SummaActorsSettings/fileManager.txt"; + + // Initalize global variables + initJob(self); + + // // spawn HRU test actor + auto gru = self->spawn(hru_actor, 1, 1, + self->state.configPath, + self->state.outputStrucSize, self); + + + return { + + [=](done_init_hru) { + // Dealocate the structure + aout(self) << "Received done from HRU\n"; + int err = 0; + cleanUpJobActor(&err); + } + }; + +} + +void initJob(stateful_actor<job_state>* self) { + std::string success = "Success"; // allows us to build the string + + int totalGRUs = 0; + int totalHRUs = 0; + int numHRUs = 0; + int err = 0; + + // aout(self) << "Initalizing Globals \n"; + initGlobals(self->state.fileManager.c_str(), + &totalGRUs, + &totalHRUs, + &self->state.numGRU, + &numHRUs, + &self->state.startGRU, + &err); + if (err != 0) { + aout(self) << "Error: initGlobals" << std::endl; + self->quit(); + } +} + + + +#endif \ No newline at end of file diff --git a/build/source/testing/Test/makefile b/build/source/testing/Test/makefile new file mode 100644 index 0000000000000000000000000000000000000000..e5a7eab35f7702858b748e56acc52cfc290b0808 --- /dev/null +++ b/build/source/testing/Test/makefile @@ -0,0 +1,281 @@ +F_MASTER = /home/k13nk/SummaProject/Summa-Actors + +FC = gfortran +CC = g++ + +INCLUDES = -I/usr/include +LIBRARIES = -lnetcdff -lnetcdf -lopenblas + +ACTORS_INCLUDES = -I/home/k13nk/actorLib/include +ACTORS_LIBRARIES = -L/home/k13nk/actorLib/lib \ +-L/home/k13nk/SummaProject/Summa-Actors/build/source/testing/Test/ \ +-lcaf_core -lcaf_io -lsumma -lnetcdff -lopenblas + +# # Debug runs +FLAGS_NOAH = -p -g -O0 -ffree-form -ffree-line-length-none -fmax-errors=0 -fbacktrace -Wno-unused -Wno-unused-dummy-argument -fPIC +FLAGS_COMM = -p -g -O0 -Wall -ffree-line-length-none -fmax-errors=0 -fbacktrace -fcheck=bounds -fPIC +FLAGS_SUMMA = -p -g -O0 -Wall -ffree-line-length-none -fmax-errors=0 -fbacktrace -fcheck=bounds -fPIC +FLAGS_ACTORS = -g -O0 -Wall + +#======================================================================== +# PART 1: Define directory paths +#======================================================================== + +# Core directory that contains source code +F_KORE_DIR = $(F_MASTER)/build/source + +# Location of the compiled modules +MOD_PATH = $(F_MASTER)/build + +# Define the directory for the executables +EXE_PATH = $(F_MASTER)/bin + +# Define directories +DRIVER_DIR = $(F_KORE_DIR)/driver +HOOKUP_DIR = $(F_KORE_DIR)/hookup +NETCDF_DIR = $(F_KORE_DIR)/netcdf +DSHARE_DIR = $(F_KORE_DIR)/dshare +NUMREC_DIR = $(F_KORE_DIR)/numrec +NOAHMP_DIR = $(F_KORE_DIR)/noah-mp +ENGINE_DIR = $(F_KORE_DIR)/engine +INTERFACE_DIR = $(F_KORE_DIR)/interface +JOB_ACTOR_DIR = $(INTERFACE_DIR)/job_actor +FILE_ACCESS_DIR = $(INTERFACE_DIR)/file_access_actor +HRU_ACTOR_DIR = $(INTERFACE_DIR)/hru_actor + +# utilities +SUMMA_NRUTIL= \ + nrtype.f90 \ + f2008funcs.f90 \ + nr_utility.f90 +NRUTIL = $(patsubst %, $(ENGINE_DIR)/%, $(SUMMA_NRUTIL)) + +# Numerical recipes procedures +# NOTE: all numerical recipes procedures are now replaced with free versions +SUMMA_NRPROC= \ + expIntegral.f90 \ + spline_int.f90 +NRPROC = $(patsubst %, $(ENGINE_DIR)/%, $(SUMMA_NRPROC)) + +# Hook-up modules (set files and directory paths) +SUMMA_HOOKUP= \ + ascii_util.f90 \ + summaActors_FileManager.f90 +HOOKUP = $(patsubst %, $(HOOKUP_DIR)/%, $(SUMMA_HOOKUP)) + +# Data modules +SUMMA_DATAMS= \ + multiconst.f90 \ + var_lookup.f90 \ + data_types.f90 \ + globalData.f90 \ + flxMapping.f90 \ + get_ixname.f90 \ + popMetadat.f90 \ + outpt_stat.f90 +DATAMS = $(patsubst %, $(DSHARE_DIR)/%, $(SUMMA_DATAMS)) + +# utility modules +SUMMA_UTILMS= \ + time_utils.f90 \ + mDecisions.f90 \ + snow_utils.f90 \ + soil_utils.f90 \ + updatState.f90 \ + matrixOper.f90 +UTILMS = $(patsubst %, $(ENGINE_DIR)/%, $(SUMMA_UTILMS)) + +# Model guts +SUMMA_MODGUT= \ + MODGUT = $(patsubst %, $(ENGINE_DIR)/%, $(SUMMA_MODGUT)) + +# Solver +SUMMA_SOLVER= \ + vegPhenlgy.f90 \ + diagn_evar.f90 \ + stomResist.f90 \ + groundwatr.f90 \ + vegSWavRad.f90 \ + vegNrgFlux.f90 \ + ssdNrgFlux.f90 \ + vegLiqFlux.f90 \ + snowLiqFlx.f90 \ + soilLiqFlx.f90 \ + bigAquifer.f90 \ + computFlux.f90 \ + computResid.f90 \ + computJacob.f90 \ + eval8summa.f90 \ + summaSolve.f90 \ + systemSolv.f90 \ + varSubstep.f90 \ + opSplittin.f90 \ + coupled_em.f90 + +SOLVER = $(patsubst %, $(ENGINE_DIR)/%, $(SUMMA_SOLVER)) + +# Interface code for Fortran-C++ +SUMMA_INTERFACE= \ + cppwrap_datatypes.f90 \ + cppwrap_auxiliary.f90 \ + cppwrap_metadata.f90 \ + +INTERFACE = $(patsubst %, $(INTERFACE_DIR)/%, $(SUMMA_INTERFACE)) + +SUMMA_FILEACCESS_INTERFACE = \ + initOutputStruc.f90 \ + deallocateOutputStruc.f90 \ + cppwrap_fileAccess.f90 + +FILEACCESS_INTERFACE = $(patsubst %, $(FILE_ACCESS_DIR)/%, $(SUMMA_FILEACCESS_INTERFACE)) + +SUMMA_JOB_INTERFACE = \ + cppwrap_job.f90 + +JOB_INTERFACE = $(patsubst %, $(JOB_ACTOR_DIR)/%, $(SUMMA_JOB_INTERFACE)) + +SUMMA_HRU_INTERFACE = \ + cppwrap_hru.f90 + +HRU_INTERFACE = $(patsubst %, $(HRU_ACTOR_DIR)/%, $(SUMMA_HRU_INTERFACE)) + + +# Define routines for SUMMA preliminaries +SUMMA_PRELIM= \ + conv_funcs.f90 \ + sunGeomtry.f90 \ + convE2Temp.f90 \ + allocspaceActors.f90 \ + alloc_file_access.f90\ + checkStruc.f90 \ + childStruc.f90 \ + ffile_info.f90 \ + read_attribute.f90 \ + read_pinit.f90 \ + pOverwrite.f90 \ + read_paramActors.f90 \ + paramCheck.f90 \ + check_icondActors.f90 \ + # allocspace.f90 +PRELIM = $(patsubst %, $(ENGINE_DIR)/%, $(SUMMA_PRELIM)) + +SUMMA_NOAHMP= \ + module_model_constants.F \ + module_sf_noahutl.F \ + module_sf_noahlsm.F \ + module_sf_noahmplsm.F + +NOAHMP = $(patsubst %, $(NOAHMP_DIR)/%, $(SUMMA_NOAHMP)) + +# Define routines for the SUMMA model runs +SUMMA_MODRUN = \ + indexState.f90 \ + getVectorz.f90 \ + updateVars.f90 \ + var_derive.f90 \ + read_forcingActors.f90 \ + access_forcing.f90\ + access_write.f90 \ + derivforce.f90 \ + snowAlbedo.f90 \ + canopySnow.f90 \ + tempAdjust.f90 \ + snwCompact.f90 \ + layerMerge.f90 \ + layerDivide.f90 \ + volicePack.f90 \ + qTimeDelay.f90 +MODRUN = $(patsubst %, $(ENGINE_DIR)/%, $(SUMMA_MODRUN)) + +# Define NetCDF routines +# OutputStrucWrite is not a netcdf subroutine and should be +# moved +SUMMA_NETCDF = \ + netcdf_util.f90 \ + def_output.f90 \ + outputStrucWrite.f90 \ + writeOutput.f90 \ + read_icondActors.f90 +NETCDF = $(patsubst %, $(NETCDF_DIR)/%, $(SUMMA_NETCDF)) + +# ... stitch together common programs +COMM_ALL = $(NRUTIL) $(NRPROC) $(HOOKUP) $(DATAMS) $(UTILMS) + +# ... stitch together SUMMA programs +SUMMA_ALL = $(NETCDF) $(PRELIM) $(MODRUN) $(SOLVER) + +# Define the driver routine +SUMMA_DRIVER= \ + summaActors_type.f90 \ + summaActors_util.f90 \ + summaActors_globalData.f90 \ + summaActors_init.f90 \ + SummaActors_setup.f90 \ + summaActors_restart.f90 \ + summaActors_forcing.f90 \ + SummaActors_modelRun.f90 \ + summaActors_alarms.f90 \ + summaActors_wOutputStruc.f90 + + +DRIVER = $(patsubst %, $(DRIVER_DIR)/%, $(SUMMA_DRIVER)) + +ACTORC = $(F_KORE_DIR)/testing/Test/testing_main.cc + +ACTOR_TEST = $(F_KORE_DIR)/testing/testing_main.cc + + +#======================================================================== +# PART 3: compilation +#====================================================================== + +# Compile +all: lib main + +lib: compile_noah compile_comm compile_summa link clean + +main: actors actorsLink actorsClean + +test: actors_test actors_testLink actorsClean + +# compile Noah-MP routines +compile_noah: + $(FC) $(FLAGS_NOAH) -c $(NRUTIL) $(NOAHMP) + +# compile common routines +compile_comm: + $(FC) $(FLAGS_COMM) -c $(COMM_ALL) $(INCLUDES) + +# compile SUMMA routines +compile_summa: + $(FC) $(FLAGS_SUMMA) -c $(SUMMA_ALL) $(DRIVER) $(INTERFACE) $(JOB_INTERFACE) $(FILEACCESS_INTERFACE) $(HRU_INTERFACE) $(INCLUDES) + +# generate library +link: + $(FC) -shared *.o -o libsumma.so + +# compile the c++ portion of SummaActors +actors: + $(CC) $(FLAGS_ACTORS) -c $(ACTORC) -std=c++17 $(ACTORS_INCLUDES) + +actorsLink: + $(CC) -o summaMain *.o $(ACTORS_LIBRARIES) + +actors_test: + $(CC) $(FLAGS_ACTORS) -c $(ACTOR_TEST) -std=c++17 $(ACTORS_INCLUDES) + +actors_testLink: + $(CC) -o summaTest *.o $(ACTORS_LIBRARIES) + +actorsClean: + rm *.o +# Remove object files +clean: + rm -f *.o *.mod soil_veg_gen_parm__genmod.f90 + +clean_lib: + rm *.so + + + + diff --git a/build/source/testing/Test/messageAtoms.h b/build/source/testing/Test/messageAtoms.h new file mode 100644 index 0000000000000000000000000000000000000000..f72dcc99df9843d6f192ae536ee4d753ce366a34 --- /dev/null +++ b/build/source/testing/Test/messageAtoms.h @@ -0,0 +1,7 @@ +#ifndef MESSAGEATOMS_H_ +#define MESSAGEATOMS_H_ + +CAF_BEGIN_TYPE_ID_BLOCK(summaTest, first_custom_type_id) + CAF_ADD_ATOM(summaTest, done_init_hru) +CAF_END_TYPE_ID_BLOCK(summaTest) +#endif diff --git a/build/source/testing/Test/testing_main.cc b/build/source/testing/Test/testing_main.cc new file mode 100644 index 0000000000000000000000000000000000000000..81ff3f09c3c936293d921acf703a3e3eb63758ee --- /dev/null +++ b/build/source/testing/Test/testing_main.cc @@ -0,0 +1,20 @@ +#include "caf/all.hpp" +#include "caf/io/all.hpp" +#include "/home/k13nk/SummaProject/Summa-Actors/build/source/testing/Test/JobTest.h" +#include <string> +#include "messageAtoms.h" +#include <bits/stdc++.h> +#include <unistd.h> +#include <iostream> + +using namespace caf; + + +void caf_main(actor_system& sys) { + scoped_actor self{sys}; + + // start SUMMA + auto job = self->spawn(job_actor); +} + +CAF_MAIN(id_block::summaTest) \ No newline at end of file diff --git a/build/source/testing/fileManagerTest1.txt b/build/source/testing/fileManagerTest1.txt deleted file mode 100644 index 4fdb8004b70bdbf8a8bab98d0d3103ab8ef3ae09..0000000000000000000000000000000000000000 --- a/build/source/testing/fileManagerTest1.txt +++ /dev/null @@ -1,20 +0,0 @@ -controlVersion 'SUMMA_FILE_MANAGER_V3.0.0' ! file manager version -simStartTime '1979-01-01 00:00' ! -simEndTime '1979-01-31 23:00' ! -tmZoneInfo 'utcTime' ! -settingsPath '/project/gwf/gwf_cmt/kck540/domain_NorthAmerica/settings/SUMMA/' ! -forcingPath '/project/gwf/gwf_cmt/kck540/domain_NorthAmerica/forcing/SummaChunkedData/' ! -outputPath '/scratch/gwf/gwf_cmt/kck540/summaActors/netcdf/' ! -decisionsFile 'modelDecisions.txt' ! Relative to settingsPath -outputControlFile 'outputControl.txt' ! Relative to settingsPath -globalHruParamFile 'localParamInfo.txt' ! Relative to settingsPath -globalGruParamFile 'basinParamInfo.txt' ! Relative to settingsPatho -attributeFile 'attributes.nc' ! Relative to settingsPath -trialParamFile 'trialParams.nc' ! Relative to settingsPath -forcingListFile 'forcingTest1.txt' ! Relative to settingsPath -initConditionFile 'coldState.nc' ! Relative to settingsPath -outFilePrefix 'SummaActors' ! -vegTableFile 'TBL_VEGPARM.TBL' ! Relative to settingsPath -soilTableFile 'TBL_SOILPARM.TBL' ! Relative to settingsPath -generalTableFile 'TBL_GENPARM.TBL' ! Relative to settingsPath -noahmpTableFile 'TBL_MPTABLE.TBL' ! Relative to settingsPath diff --git a/build/source/testing/fileManagerTest2.txt b/build/source/testing/fileManagerTest2.txt deleted file mode 100644 index 4ed7f9ed08d7566c91979c9feb32cfa2721d086b..0000000000000000000000000000000000000000 --- a/build/source/testing/fileManagerTest2.txt +++ /dev/null @@ -1,20 +0,0 @@ -controlVersion 'SUMMA_FILE_MANAGER_V3.0.0' ! file manager version -simStartTime '1979-01-01 00:00' ! -simEndTime '1979-02-28 23:00' ! -tmZoneInfo 'utcTime' ! -settingsPath '/project/gwf/gwf_cmt/kck540/domain_NorthAmerica/settings/SUMMA/' ! -forcingPath '/project/gwf/gwf_cmt/kck540/domain_NorthAmerica/forcing/SummaChunkedData/' ! -outputPath '/scratch/gwf/gwf_cmt/kck540/summaActors/netcdf/' ! -decisionsFile 'modelDecisions.txt' ! Relative to settingsPath -outputControlFile 'outputControl.txt' ! Relative to settingsPath -globalHruParamFile 'localParamInfo.txt' ! Relative to settingsPath -globalGruParamFile 'basinParamInfo.txt' ! Relative to settingsPatho -attributeFile 'attributes.nc' ! Relative to settingsPath -trialParamFile 'trialParams.nc' ! Relative to settingsPath -forcingListFile 'forcingTest2.txt' ! Relative to settingsPath -initConditionFile 'coldState.nc' ! Relative to settingsPath -outFilePrefix 'SummaActors' ! -vegTableFile 'TBL_VEGPARM.TBL' ! Relative to settingsPath -soilTableFile 'TBL_SOILPARM.TBL' ! Relative to settingsPath -generalTableFile 'TBL_GENPARM.TBL' ! Relative to settingsPath -noahmpTableFile 'TBL_MPTABLE.TBL' ! Relative to settingsPath diff --git a/build/source/testing/fileManagerTest3.txt b/build/source/testing/fileManagerTest3.txt deleted file mode 100644 index a32c24e8452979543d49bbc43eb920f104770dfa..0000000000000000000000000000000000000000 --- a/build/source/testing/fileManagerTest3.txt +++ /dev/null @@ -1,20 +0,0 @@ -controlVersion 'SUMMA_FILE_MANAGER_V3.0.0' ! file manager version -simStartTime '1979-01-01 00:00' ! -simEndTime '1979-05-31 23:00' ! -tmZoneInfo 'utcTime' ! -settingsPath '/project/gwf/gwf_cmt/kck540/domain_NorthAmerica/settings/SUMMA/' ! -forcingPath '/project/gwf/gwf_cmt/kck540/domain_NorthAmerica/forcing/SummaChunkedData/' ! -outputPath '/scratch/gwf/gwf_cmt/kck540/summaActors/netcdf/' ! -decisionsFile 'modelDecisions.txt' ! Relative to settingsPath -outputControlFile 'outputControl.txt' ! Relative to settingsPath -globalHruParamFile 'localParamInfo.txt' ! Relative to settingsPath -globalGruParamFile 'basinParamInfo.txt' ! Relative to settingsPatho -attributeFile 'attributes.nc' ! Relative to settingsPath -trialParamFile 'trialParams.nc' ! Relative to settingsPath -forcingListFile 'forcingTest3.txt' ! Relative to settingsPath -initConditionFile 'coldState.nc' ! Relative to settingsPath -outFilePrefix 'SummaActors' ! -vegTableFile 'TBL_VEGPARM.TBL' ! Relative to settingsPath -soilTableFile 'TBL_SOILPARM.TBL' ! Relative to settingsPath -generalTableFile 'TBL_GENPARM.TBL' ! Relative to settingsPath -noahmpTableFile 'TBL_MPTABLE.TBL' ! Relative to settingsPath diff --git a/build/source/testing/forcingTest1.txt b/build/source/testing/forcingTest1.txt deleted file mode 100644 index 1e3cedd2b9e37b906c8156eba6842080b8607ce7..0000000000000000000000000000000000000000 --- a/build/source/testing/forcingTest1.txt +++ /dev/null @@ -1 +0,0 @@ -NorthAmerica_remapped_1979-01-01-00-00-00-chunked.nc diff --git a/build/source/testing/forcingTest2.txt b/build/source/testing/forcingTest2.txt deleted file mode 100644 index 35caa219a677d1ab1c7d74bc12ffc820b4b268b6..0000000000000000000000000000000000000000 --- a/build/source/testing/forcingTest2.txt +++ /dev/null @@ -1,2 +0,0 @@ -NorthAmerica_remapped_1979-01-01-00-00-00-chunked.nc -NorthAmerica_remapped_1979-02-01-00-00-00-chunked.nc \ No newline at end of file diff --git a/build/source/testing/forcingTest3.txt b/build/source/testing/forcingTest3.txt deleted file mode 100644 index 1d82b1a86bf90b1e310990cdf24d71a1186ba917..0000000000000000000000000000000000000000 --- a/build/source/testing/forcingTest3.txt +++ /dev/null @@ -1,5 +0,0 @@ -NorthAmerica_remapped_1979-01-01-00-00-00-chunked.nc -NorthAmerica_remapped_1979-02-01-00-00-00-chunked.nc -NorthAmerica_remapped_1979-03-01-00-00-00-chunked.nc -NorthAmerica_remapped_1979-04-01-00-00-00-chunked.nc -NorthAmerica_remapped_1979-05-01-00-00-00-chunked.nc \ No newline at end of file diff --git a/build/source/testing/testing_main.cc b/build/source/testing/testing_main.cc index f77700e36d5ba9a998790cfd9235cdfc9a0d0cce..74ea6a39ff0a56ee8008b679eaf4d846b091b453 100644 --- a/build/source/testing/testing_main.cc +++ b/build/source/testing/testing_main.cc @@ -22,7 +22,7 @@ bool calcTimeTest(int sleepTime) { end = std::chrono::high_resolution_clock::now(); duration = calculateTime(start, end); if (duration != sleepTime) { - std::cout << "Error: calculatTime, value is " << duration << std::endl; + std::cout << "Error: calculateTime, value is " << duration << std::endl; return false; } else { return true; diff --git a/config/Summa_Actors_Settings.json b/config/Summa_Actors_Settings.json index 5011998c2b04b326fdb82e99d3c58916f9ae50c6..b20a2ee57fe0af6ed80aa745a48db8e979db9209 100644 --- a/config/Summa_Actors_Settings.json +++ b/config/Summa_Actors_Settings.json @@ -1,17 +1,17 @@ { "SummaActor": { "OuputStrucureSize": 250, - "maxGRUPerJob": 500 + "maxGRUPerJob": 1 }, "JobActor": { - "FileManagerPath": "", + "FileManagerPath": "/home/k13nk/SummaProject/SummaActorsSettings/fileManager.txt", "outputCSV": false, "csvPath": "" }, "HRUActor": { "printOutput": true, - "outputFrequency": 100000 + "outputFrequency": 10 } } \ No newline at end of file diff --git a/utils/netcdf/compareOutput.py b/utils/netcdf/compareOutput.py index 399bf813df17d649aae4f0f92c7455036aadeed7..f476a534120a17d58830e91869b90909aef9d77a 100644 --- a/utils/netcdf/compareOutput.py +++ b/utils/netcdf/compareOutput.py @@ -28,8 +28,8 @@ varList = [time, scalarSWE, scalarCanopyWat, scalarAquiferStorage, scalarTotalSo scalarTotalET, scalarTotalRunoff, scalarNetRadiation] filename = "out.txt" -originalPath = Path('/u1/kck540/output/SummaOriginal/Apr-13-2022/SummaOriginal_G000001-000010_timestep.nc') -actorsPath = Path('/u1/kck540/output/SummaActors/Apr-13-2022/SummaActorsGRU1-10_timestep.nc') +originalPath = Path('/home/k13nk/SummaProject/output/originalBench/SummaOriginal_G000001-000010_timestep.nc') +actorsPath = Path('/home/k13nk/SummaProject/output/testOutput/SummaActorsTestGRU1-10_timestep.nc') originalDataset = xr.open_dataset(originalPath) actorsDataset = xr.open_dataset(actorsPath)