300 likes | 489 Views
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
E N D
MS 698: 2014Implementing 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 • Practice Plotting
Types of Input • What types of input did we change last class?
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
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 …
ROMS_OneD The Header File:sed_toy.h Include PROJECT Functionals Build External Results trunk Include ROMS Functionals … External …
What does the header file do? • Defines or undefines options, usually related to the model setup and parameterizations Model Code: e.g. *.h, *.F
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
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
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 …
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.
ROMS_OneD Analytical Files:e.g. ana_smflux.h Include PROJECT Functionals Build External Results trunk Include ROMS Functionals … External …
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 …
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 …
ROMS_OneD NetCDF Files: Include PROJECT Functionals Build External Results trunk Include ROMS Functionals … External …
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) …
‘The’ Input Files • Main input file: ocean.in • Ocean.in calls other input files • sediment.in, floats.in, stations.in, …
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) …
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
Useful Linux Tools for Editing Code: • Be creative: *, .., ., ‘|more’, ‘> outfile.txt’ work with most commands
Other Useful Linux Tools: • Be creative: ‘*’, ‘..’, ‘|more’, ‘> outfile.txt’ work with most commands • Be careful with case-sensitive commands
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 …
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 …
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 &
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 …
ROMS_OneD ROMS Output:Location specified in ocean.in Include PROJECT Functionals Build External Results trunk Include ROMS Functionals … External …
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
Questions? >> Start lab activity
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