1 / 30

MS 698: 2014 Implementing a Hydrodynamic Model - Part 2

MS 698: 2014 Implementing a Hydrodynamic Model - Part 2. Julia Moriarty 14 February 2014. Previously…. Governing Equations Horizontal and Vertical Grid Time-Stepping (Mode-splitting) Compiling and Running 1D Test Case Basic plots in MATLAB. This Week. Changing Inputs, Outputs

clodia
Download Presentation

MS 698: 2014 Implementing a Hydrodynamic Model - Part 2

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. MS 698: 2014Implementing a Hydrodynamic Model - Part 2 Julia Moriarty 14 February 2014

  2. Previously… • Governing Equations • Horizontal and Vertical Grid • Time-Stepping (Mode-splitting) • Compiling and Running 1D Test Case • Basic plots in MATLAB This Week • Changing Inputs, Outputs • Practice Plotting

  3. Types of Input • What types of input did we change last class?

  4. Types of Input • Header file: sed_toy.h • Analytical files: ana_smflux.h, etc. • NetCDF files: boundary_conditions.nc, etc. • Not in SED_TOY • ‘The’ input file: ocean_sed_toy.in

  5. ROMS_OneD The Header File: Include PROJECT Functionals Header file for model run: sed_toy.h Build External Results trunk Examples of header files for test cases Include ROMS Functionals … External …

  6. ROMS_OneD The Header File:sed_toy.h Include PROJECT Functionals Build External Results trunk Include ROMS Functionals … External …

  7. What does the header file do? • Defines or undefines options, usually related to the model setup and parameterizations Model Code: e.g. *.h, *.F

  8. What does the header file do? • Defines or undefines options, usually related to the model setup and parameterizations Compile Model Code: e.g. *.h, *.F Model Code used for your model run: PROJECT/Build/*.f90

  9. What does the header file do? • Defines or undefines options, usually related to the model setup and parameterizations Compile Model Code: e.g. *.h, *.F Model Code used for your model run: PROJECT/Build/*.f90

  10. ROMS_OneD What options are available for header files? Include PROJECT Functionals Build External Results cppdefs.h lists all options for header files -also see ROMS wiki: https://www.myroms.org/wiki/index.php/Documentation_Portal trunk Include ROMS Functionals … External …

  11. Model Forcing:Analytical files vs. NetCDF files • Both analytical and NetCDF files provide ways to force your model (e.g. winds, model bathymetry, boundary information) • Only use one at a time for a particular forcing • NetCDF files provide timeseries of data, more complicated model grids • Analytical files are useful for simple forcing functions, e.g. constant or sinusoidal wind forcing, constant water depth, etc.

  12. ROMS_OneD Analytical Files:e.g. ana_smflux.h Include PROJECT Functionals Build External Results trunk Include ROMS Functionals … External …

  13. ROMS_OneD Analytical Files: Include Edited copies of analytical files stored in one of these directories PROJECT Functionals Build External Results trunk Include ROMS Functionals … External Original copies of analytical files: ana_*.h …

  14. ROMS_OneD Analytical Files: Include Edited copies of analytical files stored in one of these directories PROJECT Functionals Build Steps: Specify directory for edited analytical files in build.bash (In this class, we used Include, not Functionals) Copy original ana_*.h file to your PROJECT/Functionals or Include directory Edit ana_*.h file(s) (Re)compile code External Results trunk Include ROMS Functionals … External Original copies of analytical files: ana_*.h …

  15. ROMS_OneD NetCDF Files: Include PROJECT Functionals Build External Results trunk Include ROMS Functionals … External …

  16. ROMS_OneD NetCDF Files: Include PROJECT Functionals NetCDF forcing files may be stored anywhere, but are often stored here. Build External Results trunk Include ROMS Functionals … External Examples of NetCDF forcing files (and *.in files) …

  17. ‘The’ Input Files • Main input file: ocean.in • Ocean.in calls other input files • sediment.in, floats.in, stations.in, …

  18. ROMS_OneD ‘Input Files’: ocean.in, sediment.in Include PROJECT Functionals Build Input files may be stored anywhere, but it are often stored here. External Results trunk Include ROMS Functionals … External Examples of input files (and NetCDFforcing files) …

  19. What’s in ocean.in? • Timesteps • Open boundary conditions • Basic horizontal and vertical grid information • Directions for output files • Paths for other input and output files (e.g. NetCDF files, sediment_sed_toy.in, ocean_his.nc) • … and much more … The second half of the ocean.in file is a glossary explaining all of the different parameters in ocean.in

  20. Editing Code and Input Files

  21. Useful Linux Tools for Editing Code: • Be creative: *, .., ., ‘|more’, ‘> outfile.txt’ work with most commands

  22. Other Useful Linux Tools: • Be creative: ‘*’, ‘..’, ‘|more’, ‘> outfile.txt’ work with most commands • Be careful with case-sensitive commands

  23. ROMS_OneD Is ROMS doing what you think its doing? Include PROJECT Functionals Build *.f90 files are human-readable versions of the compiled code External Results Check output files trunk Include ROMS Functionals … External …

  24. ROMS_OneD Is ROMS doing what you think its doing? Include PROJECT Functionals Build External • Check, then check again • Is the model code correct? • Does the model produce reasonable output? • Trouble shoot: • Look at *.f90’s, log file • Use write statements Results trunk Include ROMS Functionals … External …

  25. Overview of Output Files • History Files: ocean_his.nc • Stores time-series of instantaneous output. • Time-Averaged Results: ocean_avg.nc • Stores time-series of time averaged values. • Restart File: ocean_rst.nc • Used to restart a model run from exactly where it ended. • Log File: ocean_sed_toy.log • Text file with information on model configuration, error messages, and much more. • Only created if specified in the oceanS command: • oceanS < External/ocean_sed_toy.in > Results/ocean_sed_toy.log &

  26. ROMS_OneD ROMS Output Include PROJECT Functionals Build Output files may be stored anywhere, but are often stored here. External Results trunk Include ROMS Functionals … External …

  27. ROMS_OneD ROMS Output:Location specified in ocean.in Include PROJECT Functionals Build External Results trunk Include ROMS Functionals … External …

  28. Manipulating Output Files • “Directions” for output files in ocean_*.in: • NHIS – number of time-steps between writing fields into history file • NDEFHIS – number of time-steps between the creation of a new history file. NDEFHIS = 0 creates a single history file. • HISNAME – name and path for history file • Hout(*) – Tells model if it should prints out each variable to the history file

  29. Questions? >> Start lab activity

  30. Manipulating Time Steps • DT – Time-step (baroclinic) in seconds • NDTFAST – number of barotropic time-steps between each baroclinic time step • NTIMES – Total number of baroclinictimesteps. • DSTART – First Timestamp of model “Δt in history file” = DT * NHIS “Total Model Time” = DT*NTIMES

More Related