Giter VIP home page Giter VIP logo

autoswan's Introduction

Brief description

This repository contains the toolbox for the automated creation of the SWAN wind wave model configurations for the local domains.

How to run:

To run the SWAN simulation for the new domain:

from core.simulation_case.case import Case
case = Case('domain_description.json')
case.prepare_case()
case.run()

The output is automatically converting to NetCDF4 format.

Configure new case

  1. Create JSON the describes the configuration (see the examples in 'cases' folder)
  2. Set the coordinates and paths to the data. The possible values of the BDC sources can be seen here. By default, the global wave reanalysis from NOAA is used.
  3. The source of bathymetry data can be obtained from GEBCO.

Example of configuration structure:

{
  "id": "pacific_example",
  "case_description": {
    "area_name": "Bering Sea",
    "coords": "[(53.0, 159), (53.0, 162.0), (54.0, 162), (54.0, 159.0)]",
    "grid": {
      "step": 500,
      "step_unit": "m",
      "grid_type": "spherical"
    },
    "open_boundaries": "['N','S','W','E']"
  },
  "simulation": {
    "spinup_start": "2021-01-01 00:00",
    "start": "2021-01-05 00:00",
    "end": "2021-01-10 23:00",
    "integration_step": "10 MIN",
    "parallel": "False",
    "model": "SWAN4131"
  },
  "data": {
    "upload_data": "True",
    "storage_path": "./storage",
    "force_overwrite": "False",
    "bathy_source": "./data/gebco_small.nc",
    "bdc_dataset_type": "ak_10m",
    "wind_dataset_type": "cfs2"
  },
  "output": {
    "variables": "['HSig','PDIR','RTP']",
    "save_output_fields": "True",
    "save_spectres": "True",
    "points": {
      "P1": "(53.5, 159.8, 'First point')",
      "P2": "(53.2, 159.9, 'Second point')"
    }
  },
  "nesting": {
    "nested_grid": "None"
  }
}

Installation

CDO toolbox installation (Win10):

  1. Install Windows Subsystem for Linux (as admin):
dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart
  1. Install Ubuntu Linux from Microsoft Store, restart the PC.

  2. Install CDO package as:

ubuntu
sudo apt-get update
sudo apt-get install -y cdo
  1. Fix Qt5/WSL1 issue with:
sudo strip --remove-section=.note.ABI-tag /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
  1. (optional) If you want to upload the ERA5 wind data in automated way, use the instruction to obtain the CDS API key and pun it to the $HOME/.cdsapirc.

  2. (optional) To run the SWAN in parallel mode - install MPICH2 for Windows.

autoswan's People

Contributors

nicl-nno avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

xingkunx

autoswan's Issues

How to execute the swanrun.bat file in WSL and ubuntu?

Dear team coders,
Thanks for your opensource code AutoSWAN.
I got these problems, I donot know how to solve it. can anyone help me? Thank you very much!

./swanrun.bat: line 1: @echo: command not found
./swanrun.bat: line 2: rem: command not found
./swanrun.bat: line 3: rem: command not found
./swanrun.bat: line 4: rem: command not found
./swanrun.bat: line 5: rem: command not found
./swanrun.bat: line 6: rem: command not found
./swanrun.bat: line 7: rem: command not found
./swanrun.bat: line 8: rem: command not found
./swanrun.bat: line 9: rem: command not found
./swanrun.bat: line 51: syntax error near unexpected token %%i' ./swanrun.bat: line 51: for /L %%i in (1,1,%nprocs%) do copy PRINT-00%%i %inputfile%.prt-00%%i >> nul'

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.