OSCURS is an ocean surface currents model historically powered by daily 6-hour FNMOC mean sea level pressure (MSLP) interpolated to an equal-area OSCURS grid and then run via legacy Fortran and a PHP web front end.
This repo documents and delivers a Python-based replacement that reproduces the Fortran results while modernizing data handling, storage, automation, and the user interface.
- Legacy site: https://oceanview.pfeg.noaa.gov/oscurs/
- Use case: Daily pressure → interpolation to OSCURS equal-area grid → OSCURS trajectory model → downloadable tracks via web UI.
- FNMOC sftp’s 360° x 180° SLP every 6 hours to
oceanwatch.- Fleet Numerical Meteorology and Oceanography Center runs numerical models to generate 6-hourly mean sea level pressure and other parameters (GRIB format).
- Forecasts are used for the Navy fleet but not generally stored by FNMOC. ERD has stored and used these outputs for decades to generate the Bakun Upwelling Index.
- Cron job on oceanwatch converts GRIB→NetCDF.
- Daily: generates
monthly_pressure.nccontaining current month's data (~7am; may have missing data). - Monthly: appends to yearly NetCDF, calculates Ekman transports & upwelling index, captures missing data; serves files on ERDDAP.
- Daily: generates
- Daily cron on oceanwatch calculates 6-hr upwelling index/transports, displayed on web page; sends to
oceanview. - On oceanview (~07:45am):
- Interpolate FNMOC SLP (180×360, 1°) → OSCURS equal-area grid (180×92).
- Extract 00:00 UTC slice each day; save to
this_month_oscurs.nc; append tooscurs_pressure.nc(huge). - Ideally: split
oscurs_pressure.ncinto yearly/decade files.
Sources:
Legacy Fortran code:
- Daily:
old/code/daily_netcdf_generation/{pres_interp_daily.f, pres_append_daily.f} - Monthly:
old/code/monthly_netcdf_generation/{pres_interp_monthly.f, pres_append.f} - Early Python attempt:
old/code/Ryan_netcdf_generation(close, but not exact).
- Interpolated data above is input to the OSCURS model.
- Model code in
old/code/model_code; parameters inoscurs_web_page. - Web page (Dojo + PHP) executes model with user inputs.
- Can run via wget, e.g.:
Ex:
wget -O test.txt "https://oceanview.pfeg.noaa.gov/oscurs/runOscurs9.php?cl=1&latdeg=45&latmin=0&londeg=175&lonmin=0&year=2011&mon=NOV&day=4&nnnn=20&factor=1&angle=0&ddfac=1&outfile=filename1.csv"This will give you a 20 day track starting at 45N, 175W, Nov 4 2011, where the output will be written to the file on your computer called test.txt in your current directory.
The legacy OSCURS pipeline relied on Fortran scripts and large monolithic NetCDF files.
The new workflow replaces these with Python-based processes that:
- Reproduce the Fortran results with high numerical parity.
- Reduce file size and improve manageability.
- Prepare for a more flexible model execution setup.
- Develop Python code to interpolate 1-degree mean sea level pressure (MSLP) to the OSCURS 180×92 grid.
- Status: Complete; validated against Fortran outputs.
- Reconfigure the OSCURS pressure file into chunks (e.g., yearly) so it is smaller and easier to manage.
- Operationalize daily interpolation process to add daily interpolated data to the yearly file.
- At set intervals (monthly, yearly), check for and integrate corrections to the data.
- Develop Python code to run OSCURS, producing results as close as possible to the Fortran code.
- Decide where the model code will reside (e.g., local, server, hosted repository).
- Determine if a RESTful service similar to the current PHP code should be provided for remote execution.
- Identify other needed steps such as testing and validation procedures.
- Develop a user interface for running the model.
- Decide where the UI will reside and how users will access it.
- Yearly NetCDF files instead of a single large monolithic file.
- Use of Python for interpolation and model execution instead of Fortran.
- Flexibility to adapt the workflow for new interfaces or hosting environments.
- Structured approach to incorporating corrected data at regular intervals.