
9648323760596b0a6c27e3463215af33.ppt
- Количество слайдов: 102
Object Modeling System Olaf David OMS Workshop September 2007, Fort Collins 1
Agenda • Historical Review • Overview OMS 2. 1 – System Features and Architecture (Olaf D. ) – OMS Colab integration. – Component Repository (Wes L. ) – A new Approach in model Development (Steve M. USGS) – Model Calibration - Lauren H (USGS) OMS Workshop September 2007, Fort Collins 2
History Project Started 2000 Mission: Develop a Next Generation Modeling Platform for ARS based on MMS experience Major Milestones: 2001/02 2003/04 2005/06 2007 Initial Prototype Netbeans 3. 6 PF Netbeans 4. 0 PF Netbeans 5. 5. 1 PF Swing based Major Refactoring Modeling Projects CVS Co. Lab Use Ressource Analysis Project Plan/Process (Worldwind) CEAP Co. Lab integraion SOA/Calib PRMS/RZWQM PRMS/J 2000/RLS/… OMS Workshop September 2007, Fort Collins 3
Required Features • Modules / Component are the building blocks for models • Allow for reuse of those! • Visual assembly of models • The legacy issue (be modern but not too modern!) • Scientific Programming Languages • Object oriented is “state of the art” in Software Engineering • Fits ARS/USDA needs OMS Workshop September 2007, Fort Collins 4
Principle Modeling System Structure Generic System Components Model Setup time step iteration GUI spatial unit iteration Spatial unit component Sensitivity Analysis … Hydr. … Erosion Interception GW … Surface water use WQ WQ … Ground water use Irrig. … Irrigation Plant growth Surface RO Snow Soilwater Interflow Groundwater Baseflow Stream RO Data Parameter Handling ETP Data IO Time step component Process module library Optimization OMS Workshop September 2007, Fort Collins [Krause 2004] 5
2001 Prototype • Java 1. 3 • Swing application • XML • Dictionary • Monolithic OMS Workshop September 2007, Fort Collins 6
OMS in 2002 • Netbeans 3. 5 PF • Update center • Modularization • RWQM Prototype • PRMS prototype OMS Workshop September 2007, Fort Collins 7
Netbeans Application Platform • Open Source, Java, Developer community • User interface management • Data and presentation management • Setting management • Graphical Editing • The Editor • The Wizard framework • Storage management • Big Selection of additional components • Internet-based update delivery • Modular architecture OMS Workshop September 2007, Fort Collins 8
2004 OMS (1. 1) Modeling Projects • Netbeans 3. 6 PF Component Editor Output Analysis • Few Modules – Component. Builder – Module. Builder – Analysis – OMS Core • Compiler Statisti Component Library OMS Workshop September 2007, Fort Collins Model Editor Parameter Editor 9
2005 OMS (1. 2) • Modeling Projects • First Component Library (Local) • Internal Code disaggregation • GCC bundle OMS Workshop September 2007, Fort Collins 10
2006 – OMS 2. 0 • NB 5. 0 • Improved spatial Modeling • Data Analysis • Execution API OMS Workshop September 2007, Fort Collins 11
2007 OMS 2. 1 • Netbeans 5. 5. 1 PF • JDK 1. 6 • Modeling Projects • Simulation management – ESP • Co. Lab access • Model Calibration – Luca • Visualization – Worldwind (Prototype) OMS Workshop September 2007, Fort Collins 12
Current and Upcoming System Main Development Collaborations • USGS – – – • NRCS – – – • Worldwind, Geolem (MSU) – • Codebeamer Integration (NASA) – • System Testing NWCC – Testing (ESP, Luca) GEOLEM SUN Microsystems / Intland – • Luca - Model Calibration Analysis, Ensemble Streamflow Prediction GIS, GEOLEM Related activities – – – FRAMES (EPA) Catchment Modeling Toolkit, Apsim (CSIRO) Open. MI (EU) Daisy (Copenhagen) Federal MOU on Multimedia Modeling Systems, … OMS Workshop September 2007, Fort Collins 13
Developer Group • Ian Schneider (2002 – 2006) (a lot!) • Wes Lloyd (since Aug. 2007) (first Co. Lab Integration) • System Code Contributors – Steve Markstrom (Analysis, ESP, …) – Makiko Umemoto (Luca) – Hussein Chinoy (Worldwind) – Few Students • Tester – Frank Geter, Dennis Flanagan, George Leaveslay, Pat Bartling, Candace Batts – Alan Andales, Jim Ascough, Mark Strudley, Dave Garen, – … OMS Workshop September 2007, Fort Collins 14
Applications, current efforts • Precipitation Runoff Modeling System • Common Wind and Water Erosion Model • J 2000 (fully distributed watershed model) • OMNI • Range / Livestock OMS Workshop September 2007, Fort Collins 15
OMS Publications • … • David O. et al. (2002): The Object Modeling System In: Agricultural System Models in Field Research and Technology Transfer, L. Ahuja, L. Ma, T. A. Howell, Eds. , Lewis Publishers, CRC Press LLC, 2002: Chapter 15, 317 - 331. • Ahuja, L. R. , David, O. , and Ascough II, J. C. (2004). Developing natural resource models using the Object Modeling System: Feasibility and challenges. Advances in Geosciences, Vol. 4, pp 29 -36, 9 -8 -2005 • Flanagan D. C. , Ascough, J. C. , Geter, W. F, David O. (2005): Developing of a Hillslope Erosion Module for the Object Modeling System. Proceedings of the 2005 ASAE Annual International Meeting, Tampa, Florida, July 17 -20, 2005. • Rizzoli, et al. (2006): Integrated modeling frameworks for environmental assessment and decision support. Book chapter in: Modelling and Software for Integrated Assessment and Management (Elsevier IDEA Book Series). 2006. • … OMS Workshop September 2007, Fort Collins 16
OMS 2. 1 User Interface OMS Workshop September 2007, Fort Collins 17
OMS 2. 1 User Interface OMS Workshop September 2007, Fort Collins 18
OMS Modular Tool Concept OMS Workshop September 2007, Fort Collins 19
Modeling Projects • Workspace that contains all resource for developing and running a model – Documentation – Input Data – Output data – Model Components • Component = behavior – Model Assemblies • Model = components + attributes – Simulations • Simulation =model + input data + execution scheme + additional info • Project level Actions OMS Workshop September 2007, Fort Collins 20
Project Resource Creation OMS Workshop September 2007, Fort Collins 21
General Properties Window • Allows for general Configuration changes of almost everything – Components – Model – Attributes – Files – … OMS Workshop September 2007, Fort Collins 22
Recent Features • Model Simulation Management • Meta Data Annotations for Components • Execution API & SOA • USDA Co. Lab Integration • Luca Model Calibration OMS Workshop September 2007, Fort Collins 23
Component Development “Creating the model building blocks” OMS Workshop September 2007, Fort Collins 24
What is a Component ? • Encapsulates Data and Operations to realize one specific purpose • Communicates to its environment using a defined interface • Black box behavior • Testability by its own ! Attribute Component OMS Workshop September 2007, Fort Collins Model Component 25
(IV) Component Implementation Attribute ojects • Java Class that implements – Executable, Component Implementation – Stateful … • Defines Attributes references – Attribute. Double – Attribute. Integer –. . • Defined Method structure – initialization – component logic – cleaning up resources init() run() cleanup() – additional methods OMS Workshop September 2007, Fort Collins 26
Component API OMS Workshop September 2007, Fort Collins 27
Component Sources • Java Language – (maybe native bindings) • Project Components folder • Packages • Wizard Generation OMS Workshop September 2007, Fort Collins 28
Component Editor OMS Workshop September 2007, Fort Collins 29
Component Attributes • Attribute Objects – Type – Name • Attribute Annotations – Description area – Access – Role snow_trs – Unit – Constraint snow_trans • Packages – org. oms. model. data. annotations OMS Workshop September 2007, Fort Collins 30
Component Behavior • Initialization • Execution • Cleanup • Native Code handling • Visual elements • package – org. oms. model. components OMS Workshop September 2007, Fort Collins 31
Component Meta Data • Component Name • Annotations – Description – Keywords – Version Info – Source – Author – (Status) OMS Workshop September 2007, Fort Collins 32
Native Components • Can be implemented in FORTRAN, C, C++ • FORTRAN: automatic encapsulation of subroutines/functions into a component. • Embedded JNative library is able to call dynamic link libraries. OMS Workshop September 2007, Fort Collins 33
Model Integration Integrate Components into a model Connect Component Attributes OMS Workshop September 2007, Fort Collins 34
Component Library C B A B B Model Snowmelt Component Library Infiltration Evaporation Interception Regionalization A A A B B B C C D D OMS Workshop September 2007, Fort Collins 35
Create a Model using the Wizard • Model Wizard • A model is a hierarchical assembly of components • Sequential Execution order OMS Workshop September 2007, Fort Collins 36
Component Palette • Controls execution of components • Control Components – Sequential execution – Parallel Execution – Conditional Exec – Iteration – Temporal Execution – Spatial Execution OMS Workshop September 2007, Fort Collins 37
Adding a Component • Drag and Drop a component into a model • Where to instantiate the Attributes? • Scoping OMS Workshop September 2007, Fort Collins 38
Model Attributes • Attributes that gets shared between components • Global data element in a model • Primitive and aggregated data structures • Introduced by components when they are added to the model or explicitly declared OMS Workshop September 2007, Fort Collins 39
Component Connectivity • Shows and Controls how a component is connected to the models data • Connections changeable • Component Attribute references point to Model Attribute Objects • Path like syntax OMS Workshop September 2007, Fort Collins 40
Component Connectivity OMS Workshop September 2007, Fort Collins 41
Data Assimilation Tables Parameter OMS Workshop September 2007, Fort Collins 42
Data Input • Tabular data • Property parameter sets • Any other “unknown” data files • Wizard OMS Workshop September 2007, Fort Collins 43
Tabular Data support • Table API / SPI – CSV – MMS statvar/data – Net. CDF – JDBC • COSU oriented • Multi view Editor • Copy & paste from/to Excel OMS Workshop September 2007, Fort Collins 44
Property Parameter Sets • Model parameter • Structure – key = value OMS Workshop September 2007, Fort Collins 45
Model Execution Various ways to execute a model Visual Batch … OMS Workshop September 2007, Fort Collins 46
Visual Execution • Editing • Filtering – Type – Name – Role – Dimension – Access • Selection OMS Workshop September 2007, Fort Collins 47
Spreadsheet view • Transpose view • Apply formulas – Math – Statistics OMS Workshop September 2007, Fort Collins 48
Control Model Execution • Set breakpoints • Execution will stop after component execution • Check attributes in Explorer • Debugging at the component level OMS Workshop September 2007, Fort Collins 49
Batch Execution • No GUI, just standard output • Not exciting, but very useful OMS Workshop September 2007, Fort Collins 50
Output Analysis “Ad-hoc post run analysis” OMS Workshop September 2007, Fort Collins 51
Analysis • Analysis types • Configure them once and execute often. • Plays well with simulation management OMS Workshop September 2007, Fort Collins 52
Analysis • Canned analysis configuration • Analysis of output data – Graphs • TS Plot • XY Error • Flow duration • Residuals – Statistics • Table IO/API OMS Workshop September 2007, Fort Collins 53
Analysis 2 D Plot types • 2 D Plot types – Combined scale – Multiple scale – Vert/Horiz. Arranged – Scattered Plots – Statistical Moments OMS Workshop September 2007, Fort Collins 54
ESP Trace Analysis • USGS OUI ESP Tool • Statistical analysis • Report generation OMS Workshop September 2007, Fort Collins 55
NASA Worldwind OMS Prototype (not in 2. 1) OMS Workshop September 2007, Fort Collins 56
Extension to map OMS model output data into Worldwind OMS Workshop September 2007, Fort Collins 57
Simulations Configure a model application OMS Workshop September 2007, Fort Collins 58
Simulation ? • = Model + Input Data + Execution type + (Analysis) + Additional Settings • Type – Basic Simulation – Ensemble Streamflow Prediction – Model calibration using LUCA (Prototype) • Combine models with different data file, and ways to execute them together. OMS Workshop September 2007, Fort Collins 59
Simulations • Wizard generated • Icons represent types OMS Workshop September 2007, Fort Collins 60
Basic Simulation Sections • Drag and Drop from project – Model – Parameter file • Check execution type – GUI – Batch • (Analysis) OMS Workshop September 2007, Fort Collins 61
Ensemble Streamflow Prediction • Similar to Basic Simulation – Model – Parameter Files • ESP parameter – Init period – Forecasting period – Historical years OMS Workshop September 2007, Fort Collins 62
Model Calibration using Luca • Luca wizard start • Calibration settings overview OMS Workshop September 2007, Fort Collins 63
Calibration wizard as developed at USGS (prototype) • Stepwise Calibration Methodology – Lauren … • OMS Adaptation – Execution API – Table API – -> COSU OMS Workshop September 2007, Fort Collins 64
Documentation Co. Lab OMS Project OMS Workshop September 2007, Fort Collins 65
Documentation • OMS Project WIKI – Olaf, Frank, George OMS Workshop September 2007, Fort Collins 66
OMS Architecture Points of Extension OMS Workshop September 2007, Fort Collins 67
Model Applications Object Modeling System Version 2. + Platform Regionalized CEAP Model Process Component Process Component Modeling Runtime JAVA 2 Platform Operating Systems Graphical User Interface Component Statistical Builder Spatial Analysis Modeling Visualization Uncertainty API Analysis Modeling Project Management Modeling Data Core Component Tools Management GNU Compilers Component Library (C, C++, Fortran) Build Component Library. . . System Library. . . Net. Beans Platform Modeling Projects Application JAVA 2 Platform Windows USDA Co. Lab Linux Version Control System (Subversion) Model Builder Virtual Machine Solaris Others USDA Modeling Collaboration OMS Workshop September 2007, Fort Collins Infrastructure Operating System 68
Build OMS from Source • Get Netbeans 5. 5. 1 + JDK 1. 6 • Checkout OMS SVN 2. 1 branch – https: //colab. sc. egov. usda. gov/svn/ oms/branches/2. 1 • Open the project – “omsbuild/omsplatform” – 25 sub-projects • Build / run OMS Workshop September 2007, Fort Collins 69
OMS – System Development in Co. Lab • OMS Subversion Repository – ~240 MB source for 3980 Revisions • OMS Co. Lab Project – 33 members – Documentation in WIKI – Tracker for Milestones, Enhancements Requests, and Bugs – Stores Releases OMS Workshop September 2007, Fort Collins 70
OMS Extensibility • Netbeans API’s – ~40 separate API to write an OMS compatible tool • OMS API’s – Component API (model dev) – Model Execution API (system integration) – Table API/SPI (data formats) – Analysis API – Spreadsheets – SOA OMS Workshop September 2007, Fort Collins 71
OMS and SOA : Model Execution Service • 1) Model Execution Service – Headless execution of a model based on the OMS execution API. – No UI / Netbeans Dependencies – Callable from Java/. NET Web service Modeling API – Prototype for Ann. AGNPS – NRCS Plugin Architecture Modeling Core Data Management JAVA 2 Platform OS OMS Workshop September 2007, Fort Collins 72
OMS and SOA : Model Development Service • 2) Model Resource Management Service – Components are stored in Co. Lab and can be accessed from OMS – Co. Lab (OMS Component Library) web service • Pushing and pulling of components as a prototype OMS Workshop September 2007, Fort Collins 73
Co. Lab Access from within OMS • Connects direct to USDA Collaboration platform • Work with projects – Tracker item submission – Discussion forums – Shared documents – Builds OMS Workshop September 2007, Fort Collins 74
Access Co. Lab Components directly (Prototype) Connect Integrate Explore OMS Workshop September 2007, Fort Collins Palette 75
Additional Features Co. Lab Integration Component Library “Advanced Simulation Management” Luca & beyond OMS Workshop September 2007, Fort Collins 76
Summary • OMS is a integrated model development environment IDE. • It embraces component oriented software development CBSD for modeling • Open Modeling Platform has an extensible architecture in many ways, it is adoptable for future integrations. • It is certified within the common computing environment CCE. • OMS integrates directly into USDA Co. Lab for sharing of its component resources. • It is Open Source, development help is always welcome. OMS Workshop September 2007, Fort Collins 77
Modularization OMS Workshop September 2007, Fort Collins 78
Modularization • Essential for design of complex system • Since (Parnas 1976): – „On the Criteria to be used in Decomposing complex systems into Modules“ [CACM] • Common guide lines for „concern separation“ in systems OMS Workshop September 2007, Fort Collins 79
What is a Module ? • Encapsulates Data and Operations to realize one specific purpose • Communicates to its environment through definite interface • Black box behavior • Testability by its own ! OMS Workshop September 2007, Fort Collins 80
Module Design Criteria • Cohesion ( ) • Coupling ( ) • Interface (slim) • Size (? ) • testability ! • Interference / Side effects (!) • Number of Imports / Uses OMS Workshop September 2007, Fort Collins 81
Think about Bindings A B D C ! OMS Workshop September 2007, Fort Collins 82
Again. . . B A ! C OMS Workshop September 2007, Fort Collins 83
Complexity =. . . + f( # Modules) Inner Module Complexity Opt OMS Workshop September 2007, Fort Collins Overall System Complexity #Modules 84
Complexity and Reusability c************************************ c potet_jh. f: Determine whether transpiration is occurring and c compute the potential evapotranspiration for each HRU c version: 1. 3 (markstro) c*********************************************************************** c c petdecl - set up parameters for potential et computations c integer function petdecl_jh(transp_on, potet, + basin_potet, lday, daily_potet) include 'fmodules. inc' integer transp_on(MAXHRU) integer lday real potet(MAXHRU), basin_potet real daily_potet(MAXHRU) petdecl_jh = 1 if(declpri('potet_lday', 1, 'integer', lday). ne. 0) return if(declpri('potet_daily_potet', MAXHRU, 'real', + daily_potet). ne. 0) return if(declvar('potet', 'transp_on', 'nhru', MAXHRU, 'integer', + 'Switch indicating whether transpiration is occurring, '// + ' 0=no 1=yes', + 'none', + transp_on). ne. 0) return if(declvar('potet', 'nhru', MAXHRU, 'real', + 'Potential evapotranspiration on an HRU', + 'inches', + potet). ne. 0) return nhru = getdim('nhru') if(nhru. eq. -1) return if(getparam('potet', 'transp_end', MAXHRU, 'integer', transp_end) +. ne. 0) return if(getparam('potet', 'transp_tmax', MAXHRU, 'real', transp_tmax) +. ne. 0) return if(getparam('potet', 'jh_coef', MAXMO, 'real', jh_coef) +. ne. 0) return if(declparam('potet', 'transp_end', 'nhru', 'integer', + '10', '12', + 'End month of transpiration period', + 'Last month for transpiration computations; '// + 'Transpiration is computed thru end of month', + 'month'). ne. 0) return if(declparam('potet', 'transp_tmax', 'nhru', 'real', + '500. ', '1000. ', + 'Tmax index to determine start of transpiration', + 'Temperature index to determine the specific date of the '// + 'start of the transpiration period. Subroutine sums tmax '// + 'for each HRU starting with the first day of month '// + 'transp_beg. When the sum exceeds this index, '// + 'transpiration begins', + 'degrees'). ne. 0) return if(declparam('potet', 'jh_coef', 'nmonths', 'real', + '. 014', '. 005', '. 060', + 'Monthly air temp coefficient - Jensen-Haise', + 'Monthly air temperature coefficient used in Jensen'// + '-Haise potential evapotranspiration computations, see '// + 'PRMS manual for calculation method', + '? ? '). ne. 0) return if(declparam('potet', 'jh_coef_hru', 'nhru', 'real', + '13. 0', '5. 0', '20. 0', + 'HRU air temp coefficient - Jensen-Haise', + 'Air temperature coefficient used in Jensen-Haise potential '// + 'evapotranspiration computations for aech HRU. See PRMS '// + 'manual for calculation method', + '? ? '). ne. 0) return if(declparam('potet', 'epan_coef', 'nmonths', 'real', + '1. 0', '0. 2', '3. 0', + 'Evaporation pan coefficient', + 'none'). ne. 0) return if(declparam('potet_jh', 'hru_area', 'nhru', 'real', + '1. 0', '0. 01', '1 e+09', + 'HRU area', + 'acres'). ne. 0) return if(declparam('potet_jh', 'basin_area', 'one', 'real', + '1. 0', '0. 01', '1 e+09', + 'Total basin area', + 'acres'). ne. 0) return if(declparam('potet_jh', 'hru_radpl', 'nhru', 'integer', + '1', 'bounded', 'nradpl', + 'Index of radiation plane for HRU', + 'Index of radiation plane used to compute solar '// + 'radiation for an HRU', + 'none'). ne. 0) return if(declparam('temp_1 sta', 'temp_units', 'one', 'integer', + '0', '1', + 'Units for observed temperature, 0=F, 1=C', + 'none'). ne. 0) return if(getparam('basin', 'basin_area', 1, 'real', basin_area) +. ne. 0) return if(getparam('basin', 'hru_area', MAXHRU, 'real', hru_area) +. ne. 0) return if(getparam('soltab', 'hru_radpl', MAXHRU, 'integer', hru_radpl) +. ne. 0) return call dattim('start', starttime) mo = starttime(2) day = starttime(3) transp_on(i) = 1 else transp_check(i) = 1 end if else if((transp_end(i)-transp_beg(i)). gt. 0) then if(mo. gt. transp_beg(i). and. mo. lt. transp_end(i)) + transp_on(i) = 1 if(getvar('temp', 'tavgf', MAXHRU, 'real', tavgf). ne. 0) return + if(getvar('temp', 'tavgc', MAXHRU, 'real', tavgc). ne. 0) return if(getvar('solrad', 'swrad', MAXHRU, 'real', swrad). ne. 0) return + if(dt. lt. 24. ) then if(getvar('solrad', 'daily_swrad', MAXHRU, 'real', swrad). ne. 0) return end if do 20 i=1, nhru elh = (597. 3 -(. 57*tavgc(i)))*2. 54 rin = swrad(i)/elh daily_potet(i) = jh_coef(mo)*(tavgf(i)-jh_coef_hru(i))*rin if(daily_potet(i). lt. 0. ) daily_potet(i) = 0. continue do 30 i=1, nhru if(dt. lt. 24. ) then factor = (dt * 60. ) / 1440. else factor = 1. end if potet(i) = factor * daily_potet(i) basin_potet = basin_potet + potet(i) * hru_area(i) 30 continue basin_potet = basin_potet / basin_area C write (*, *) 'basin_potet ', basin_potet C write (*, 101) potet C 101 format(' potet ', 177 f 10. 4) else if((mo. gt. transp_beg(i). and. mo. le. 12). or. + (mo. ge. 1. and. mo. lt. transp_end(i))) transp_on(i) = 1 • MMS module structure • Fortran 77 petrun_jh = 0 end if 10 continue return end lday = 0 c************************************ c c Main potet_jh routine c petinit_jh = 0 return end integer function potet_jh_prms(arg) c************************************ c c petrun - Keeps track of transpiration on or off and computes c potential et for each HRU each day c integer function petrun_jh(transp_beg, transp_end, transp_on, + transp_check, transp_tmax, tmax_sum, + jh_coef, jh_coef_hru, potet, nhru, + basin_potet, basin_area, hru_area, + hru_radpl, temp_units, lday, + daily_potet) include 'fmodules. inc' integer transp_beg(MAXHRU), transp_end(MAXHRU), nhru integer transp_on(MAXHRU), transp_check(MAXHRU) integer nowtime(6), mo, i, day, lday integer hru_radpl(MAXHRU), temp_units real transp_tmax(MAXHRU), tmax_sum(MAXHRU), jh_coef(MAXMO) real jh_coef_hru(MAXHRU), tavgc(MAXHRU), tavgf(MAXHRU) real swrad(MAXHRU), potet(MAXHRU), tmaxf(MAXHRU), elh, rin real basin_potet, basin_area, hru_area(MAXHRU) real daily_potet(MAXHRU), tmaxc(MAXHRU) real factor double precision dt petrun_jh = 1 include 'fmodules. inc' character*(*) arg integer petdecl_jh, petinit_jh, petrun_jh, retval integer transp_on(MAXHRU), transp_check(MAXHRU), nhru integer transp_beg(MAXHRU), transp_end(MAXHRU) integer hru_radpl(MAXHRU), temp_units real potet(MAXHRU), transp_tmax(MAXHRU), tmax_sum(MAXHRU) real jh_coef(MAXMO), jh_coef_hru(MAXHRU) real basin_potet, basin_area, hru_area(MAXHRU) real daily_potet(MAXHRU) integer lday • Where is „Jensen. Haise“ ? save transp_on, transp_check, nhru, transp_beg, transp_end save potet, transp_tmax, tmax_sum, jh_coef_hru save basin_potet, basin_area, hru_radpl, temp_units save lday, daily_potet retval = 0 if(arg. eq. 'declare') then retval = petdecl_jh(transp_on, potet, basin_potet, lday, daily_potet) + else if(arg. eq. 'initialize') then retval = petinit_jh(nhru, transp_beg, transp_end, transp_tmax, jh_coef_hru, transp_on, tmax_sum, transp_check, basin_area, hru_radpl, temp_units, lday) + + + dt = deltim() call dattim('now', nowtime) mo = nowtime(2) day = nowtime(3) basin_potet = 0. else if(arg. eq. 'run') then retval = petrun_jh(transp_beg, transp_end, transp_on, transp_check, transp_tmax, tmax_sum, jh_coef_hru, potet, nhru, basin_potet, basin_area, hru_radpl, temp_units, lday, daily_potet) + + C******Set switch for active transpiration period if(lday. ne. day) then end if lday = day + if(getvar('temp', 'tmaxf', MAXHRU, 'real', tmaxf). ne. 0) return + if(getvar('temp', 'tmaxc', MAXHRU, 'real', tmaxc). ne. 0) return C******Debug level print call dpint 4('End of potet_jh, retval = ', retval, 1, 2) do 10 i= 1, nhru C******If in checking period, then for each day C******sum max temp until greater than temperature index parameter, C******at which time, turn transpiration switch on, check switch off potet_jh_prms = retval return end if(transp_check(i). eq. 1) then if(temp_units. eq. 0) then if(tmaxf(i). gt. 32. ) tmax_sum(i) = tmax_sum(i) + tmaxf(i) else if(tmaxc(i). gt. 0. ) tmax_sum(i) = tmax_sum(i) + tmaxc(i) endif return end if(tmax_sum(i). gt. transp_tmax(i)) then transp_on(i) = 1 transp_check(i) = 0 tmax_sum(i) = 0. end if C******Otherwise, check for month to turn check switch on or C***** transpiration switch off include 'fmodules. inc' petinit_jh = 1 if(mo. eq. transp_end(i)) transp_on(i) = 0 end if if(mo. eq. transp_beg(i)) then if(day. gt. 10) then petdecl_jh = 0 integer nhru, transp_beg(MAXHRU), transp_end(MAXHRU) integer transp_on(MAXHRU), starttime(6), mo, day, i integer hru_radpl(MAXHRU), temp_units integer lday real transp_tmax(MAXHRU), jh_coef(MAXMO), jh_coef_hru(MAXHRU) integer transp_check(MAXHRU) real basin_area, hru_area(MAXHRU) real tmax_sum(MAXHRU) + 20 do 10 i = 1, nhru transp_on(i) = 0 tmax_sum(i) = 0. transp_check(i) = 0 else C******Compute potential et for each hru using Jensen-Haise formulation if(getparam('temp_1 sta', 'temp_units', 1, 'integer', temp_units) +. ne. 0) return c************************************ c c petinit - Initialize potet module - get parameter values, c set initial transp_on switch c integer function petinit_jh(nhru, transp_beg, transp_end, + transp_tmax, jh_coef_hru, + transp_on, tmax_sum, transp_check, + basin_area, hru_radpl, + temp_units, lday) if(transp_on(i). eq. 1) then end if 10 continue + if(getparam('potet', 'jh_coef_hru', MAXHRU, 'real', jh_coef_hru) +. ne. 0) return if(declvar('potet', 'basin_potet', 'one', 1, 'real', + 'Basin area-weighted average of potential et', + 'inches', + basin_potet). ne. 0) return if(declparam('potet', 'transp_beg', 'nhru', 'integer', + '4', '12', + 'Month to begin testing for transpiration', + 'Month to begin summing tmaxf for each HRU; when sum is '// + '>= to transp_tmax, transpiration begins', + 'month'). ne. 0) return C******If transpiration switch on, check for end of period if(getparam('potet', 'transp_beg', MAXHRU, 'integer', transp_beg) +. ne. 0) return else + + if(mo. eq. transp_beg(i)) then transp_check(i) = 1 if(temp_units. eq. 0) then if(tmaxf(i). gt. 32. ) tmax_sum(i) = tmax_sum(i) + tmaxf(i) else if(tmaxc(i). gt. 0. ) tmax_sum(i) = tmax_sum(i) + tmaxc(i) endif if(day. eq. 1) then OMS Workshop September 2007, Fort Collins 85
Co. Lab & Subversion Support for Modeling OMS Workshop September 2007, Fort Collins 86
OMS Workshop September 2007, Fort Collins 87
USDA Colab Overview • Colab is an acronym for: – Collaborative Software Development Laboratory – Similar to concepts as Source. Forge, Collab. Net, Codehaus, . . . • Colab’s purpose is to facilitate collaborative model development in a location independent environment. • History – Identified the need in 2004 – Prototype phase in 2004/2005 – Production in April 2005 – Founding members USDA (NRCS/ASRU), EPA, CSU, USGS • http: //colab. usda. gov OMS Workshop September 2007, Fort Collins 88
There is room for process enhancements in IT Problem • 2/3 of projects fails on time, budget or miss the scope Trends • Globalization, IT manager are managing global teams • Co-location research groups • Shortened release circles • Growing code size and complexity OMS Workshop September 2007, Fort Collins 89
Tools needed by Open Source Communities Requirements • Must be efficient over WAN, (home) • Transparency, achievability • On the fly setup infrastructure • Easy to maintain Communication • Mailing lists, Forums • Wikis, Blogs, RSS the mailing lists, forums replacements Commonly used Version Control Systems • CVS, Subversion, the CVS replacement Build • ANT, Cruise. Control, part of Maven Issue tracking • Bugzilla, simple part of Jira • IDE with integrated CVS, Subversion support IDE OMS Workshop September 2007, Fort Collins 90
Colab Overview Colab is made up of two major components 1. Code. Beamer • 2. Commercial web application to help manage software project development, communication, and documents. Subversion • Open source Version Control System OMS Workshop September 2007, Fort Collins 91
Code. Beamer Architecture OMS Workshop September 2007, Fort Collins 92
Co. Lab objectives with respect to modeling • 1) Facilitate the development of OMS itself. Make the development process available to the community. • 2) Migrate existing modeling efforts in USDA into a structured development environment. Tracking / version control. OMS Workshop September 2007, Fort Collins 93
Collaborative Software Development from the User Perspective Co. Lab as an enterprise platform of integrated applications includes • Issue tracking for Bugs, Task, CRQ • Document Management • Wiki Spaces • SCM integration (Subversion) • QA metrics • Build support • Discussion Forum, Email integration • Dashboard • Search and Indexing • USDA e. Auth integration (Siteminder) OMS Workshop September 2007, Fort Collins 94
1) OMS development supported by Colab OMS Workshop September 2007, Fort Collins 95
OMS Development Process OMS Workshop September 2007, Fort Collins 96
Development Process OMS Workshop September 2007, Fort Collins 97
2) General Modeling Projects in Co. Lab OMS Workshop September 2007, Fort Collins 98
2) Structured Model Development Process 1. Integrate Source into Colab 2. Adopt the use of a (i) version control system and (ii) software project management as provided in Colab 3. Modeling Source; Refactoring using peer review 4. Modularize and use a modeling framework (OMS), eliminate redundancies 5. Implement automated model tests against selected data sets within Colab 6. Use Colab progress tracking methods on model development (software project management) 7. Involve external collaborator and scientific community for contribution and enhancements. • Progress Levels for different models – – – SWAT: 1. . 2 WWEM: 4 AGNPS: 2 REMM CONCEPTS: 2 PRMS : 4 J 2000: 5 OMS Workshop September 2007, Fort Collins 99
Co. Lab Metrics • User Accounts (969) Projects (315) Repositories (269) repositories) Documents (21, 652) ~100 active User/Day • Code repository ~20 GB, Documents ~4 GB • Users from ~15 different institutions. • Example Modeling Projects – AGNPS (NRCS), FRAMES/3 MRA (EPA), OMS Unified Wind and Water Erosion (ARS), PRMS (USGS), SWAT (ARS; 2005), RZWQM (ARS), DSSAT Components (OMS), Range/Lifestock (ASRU), J 2000 (FSU Jena), COSU (MOU on MIMS), and many others … • Training classes on (i) Version Control Workflow using Subversion (ii) Codebeamer Project Management and (iii) OMS Workshop September 2007, Fort Collins 100
Results of the use of a Co. Lab • Reduction of administration efforts • Cost reduction at • Professional Service costs, Implementation, Training efforts and cost of travel • Set up of a centralized Project repository • Reduction of „Ramp Up Time“ • Enhanced Communication • Build of Knowledge, -distribution and –usage • Productivity enhancement for technical and economic user • Simplifies communication OMS Workshop September 2007, Fort Collins 101
USDA Modeling and Collaboration Infrastructure Model Development - Construct - Run - Analyze - Test - Verify Model Project Management - Tracker Codebeamer - Forums - Documents - CMM Reports - Access Control OMS Subversion Model Resources Change Management - Version Control - Change Management - Repository - Concurrent Access OMS Workshop September 2007, Fort Collins 102
9648323760596b0a6c27e3463215af33.ppt