You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 22 Next »

This guide is for someone who would like to run a simulation with current library and packaging.

Step-by-step guide

1. How to create a working folder

  1. Get the current working version of gm_sim_pkg by using git clone:

    Bash_code
    $ git clone git@github.com:ucgmsim/gm_sim_pkg.git
  2. Navigate into gm_sim_pkg directory and download the lastest package from the FTP server: ftp://ucquakecore1p.canterbury.ac.nz/seisfinder/gmsim_pack_latest.tar.gz

    Bash_code
    $ wget ftp://ucquakecore1p.canterbury.ac.nz/seisfinder/gmsim_pack_latest.tar.gz
  3. Use install.sh to install the package just downloaded in the following format:

     ./install.sh gmsim_pack_latest.tar.gz [event_date] [event_location] [event_magnitude]

     

    Bash_code
    $ ./install.sh gmsim_pack_latest.tar.gz 20100904 Darfield 7.1
  4. This starts the installation process.

     

    =========================================================================
    Event Name: 20100904_Darfield_m7p1
    Run Name: 20100904_Darfield_m7p1_201705191345
    Package to be installed: /home/seb56/gm_sim_pkg/gmsim_pack_20170517_1425.tar.gz
    Run directory: /nesi/projects/nesi00213/RealTime/20100904_Darfield_m7p1_201705191345
    =========================================================================
    Do you wish to proceed? (Y/N) y
    =========================================================================
    Creating directory structure
    =========================================================================
    /home/seb56/tmp already exists.
    /nesi/projects/nesi00213/RealTime/code already exists.
    =========================================================================
    Extracting the package
    =========================================================================
    ./
    ./code/
    ./code/wrapper/
    ./code/wrapper/setup_remote.sh
    ./code/wrapper/make_vm.sh
    ./code/wrapper/make_stat.sh...
    ./GM/Sim/
    ./GM/Sim/Data/
    ./GM/Sim/Figures/
    ./Stat/
    =========================================================================
    Updating the data
    =========================================================================
    From https://github.com/ucgmsim/vm_data
    * branch master -> FETCH_HEAD
    Already up-to-date.
    =========================================================================
    Final touch
    =========================================================================
    >>> Moving to /nesi/projects/nesi00213/RealTime/code from /nesi/projects/nesi00213/RealTime/20100904_Darfield_m7p1_201705191345/code
    >>> Updating vs30-mapping data
    location: /nesi/projects/nesi00213/RealTime/code/Vs30-mapping
    collecting md5sum for file check
    Existing KRIGE_NZGD00_allNZ.Rdata is already good: No need to update
    >>> Making a symbolic link to /home/seb56/tmp/vm_data/Data
    >>> Writing gmsim.cfg
    =========================================================================
    Done!!!!=========================================================================
  5. This has created the directory structure for managing the ground motion simulation for 2010 September 4 Darfield earthquake (Mw7.1)

    20100904_Darfield_m7p1_201705191345/
    ├── GM
    │   ├── Obs
    │   │   ├── Data
    │   │   └── Figures
    │   ├── Sim
    │   │   ├── Data
    │   │   └── Figures
    │   └── Validation
    │   ├── Data
    │   └── Figures
    ├── Impact
    │   ├── Landslide
    │   └── PAGER
    ├── Src
    │   ├── Data
    │   ├── Figures
    │   └── Model
    ├── Stat
    └── VM
    ├── Data
    ├── Figures
    ├── Model
    └── Velocity-Model
    └── Data -> /home/seb56/tmp/vm_data/Data
  6. Follow the instruction shown on screen to create required Models and files.

    Instructions:
    Everyone: !!!!!!!!!!!!!! source /nesi/projects/nesi00213/RealTime/20100904_Darfield_m7p1_201705191345/path.sh !!!!!!!!!!!!!!
    VM: 1. cd /nesi/projects/nesi00213/RealTime/20100904_Darfield_m7p1_201705191345/VM
    2. config_vm.py mag centroidDepth lon lat
    3. test_vm_params.py (if params_vel.py edited)
    4. make_vm.sh
    Source: 1. cd /nesi/projects/nesi00213/RealTime/20100904_Darfield_m7p1_201705191345/Src
    2. config_src.py
    3. make_src.sh
    Obs: 1. cd /nesi/projects/nesi00213/RealTime/20100904_Darfield_m7p1_201705191345/GM/Obs
    2. config_obs.py geoNet_ftp_url
    3. make_obs.sh


    !!! Before you move on, make sure you do the first line give in the instruction. !!!

    Bash_code
    $ source /nesi/projects/nesi00213/RealTime/20100904_Darfield_m7p1_201705191345/path.sh

2. How to create a Velocity Model

  1. Go to the VM directory that instruction has provided

    Bash_code
    $ cd /nesi/projects/nesi00213/RealTime/20100904_Darfield_m7p1_201705191345/VM
  2. Execute config_vm.py to generate params_vel.py, a config file used for velocity modelling. The command is in the following format.

    $ config_vm.py magnitude centroid_Depth Latitude Longitude

    Bash_code
    /nesi/projects/nesi00213/RealTime/20100904_Darfield_m7p1_201705191345/VM : config_vm.py -h
    usage: config_vm.py [-h] [--model_version MODEL_VERSION] [--min_vs MIN_VS]
                        [--topo_type TOPO_TYPE] [--hh HH]
                        [--extent_zmin EXTENT_ZMIN] [--extent_x EXTENT_X]
                        [--extent_y EXTENT_Y] [--extent_zmax EXTENT_ZMAX]
                        [--sim_duration SIM_DURATION] [--flo FLO] [--rot ROT]
                        [--code CODE] [--output_dir OUTPUT_DIR]
                        [--slice_params_dir SLICE_PARAMS_DIR]
                        mag centroidDepth lon lat
    positional arguments:
      mag
      centroidDepth
      lon
      lat
    optional arguments:
      -h, --help            show this help message and exit
      --model_version MODEL_VERSION
      --min_vs MIN_VS
      --topo_type TOPO_TYPE
      --hh HH
      --extent_zmin EXTENT_ZMIN
      --extent_x EXTENT_X
      --extent_y EXTENT_Y
      --extent_zmax EXTENT_ZMAX
      --sim_duration SIM_DURATION
      --flo FLO
      --rot ROT
      --code CODE
      --output_dir OUTPUT_DIR
      --slice_params_dir SLICE_PARAMS_DIR

    Three parameters mag, centroidDepth, lon, lat are mandatory. You can set other options with --option, such as --hh 0.2 or manually set by editing params_vel.py

    Bash_code
    /nesi/projects/nesi00213/RealTime/20100904_Darfield_m7p1_201705191345/VM : config_vm.py 7.1  46.00 172.3 -43.6 --hh 0.2 --rot -10 --extent_x 140 --extent_y 120 --extent_zmax 46.0 --sim_duration 100
    mag = 7.1 centroidDepth = 46.0 lon= 172.3 lat = -43.6
    ############  Generated params_vel.py
    
    # If you edited this file manually, run 'test_vm_params.py' for integrity check !!!
    # Section I. Basic parameters (Manual Edit allowed)
    mag = '7.1'
    centroidDepth = '46.00'
    MODEL_LAT = '-43.6'
    MODEL_LON = '172.3'
    MODEL_ROT = '-10.0'
    hh = '0.200'
    min_vs = '0.5'
    model_version = '1.65'
    topo_type = 'BULLDOZED'
    output_directory = 'Rapid_Model'
    extracted_slice_parameters_directory = 'SliceParametersNZ/SliceParametersExtracted.txt'
    code = 'rt'
    # Section II. Derived parameters that can be manually editted
    extent_x = '140.0'
    extent_y = '120.0'
    extent_zmax = '46.0'
    extent_zmin = '0.0'
    sim_duration = '100.0'
    flo = '0.5'
    # Section III. Automated values. DO NOT EDIT (Manual changes will be ignored)
    nx = ' 700'
    ny = ' 600'
    nz = '230'
    sufx = '_rt01-h0.200'
    ############  Estimated Wallclock time
    nx=700 ny=600 nz=230 sim_duration=100 num_procs=512
    Maximum: 0:55:02
    Average: 0:17:16.597834
    Minimum: 0:11:58.613082
    
    


  3. You can manually edit params_vel.py. But you are strongly advised to run test_vm_params.py to validate your params_vel.py if manually edited. Note that values in Section II will be automatically computed based on the values in Section I, but user can manually edit them. However, any manual changes made to Section III will be ignored. 
    In the example, we execute test_vm_params.py after manually editing the value for "code" from "rt" to "nz". This creates new params_vel.py after making a backup of the original, and shows the difference between two. Notice " | " where a difference is observed (line 30).

    Bash_code
    /nesi/projects/nesi00213/RealTime/20100904_Darfield_m7p1_201705011613/VM :test_vm_params.py
    #####################   Backing up params_vel.py to params_vel.py.bak
    #####################  params_vel.py updated
    diff -y params_vel.py.bak params_vel.py
    # If you edited this file manually, run 'test_vm_params.py' f   # If you edited this file manually, run 'test_vm_params.py' f
    # Section I. Basic parameters (Manual Edit allowed)             # Section I. Basic parameters (Manual Edit allowed)
    mag = '7.1'                                                     mag = '7.1'
    centroidDepth = '46.00'                                         centroidDepth = '46.00'
    MODEL_LAT = '-43.6'                                             MODEL_LAT = '-43.6'
    MODEL_LON = '172.3'                                             MODEL_LON = '172.3'
    MODEL_ROT = '-10.0'                                             MODEL_ROT = '-10.0'
    hh = '0.200'                                                    hh = '0.200'
    min_vs = '0.5'                                                  min_vs = '0.5'
    model_version = '1.65'                                          model_version = '1.65'
    topo_type = 'BULLDOZED'                                         topo_type = 'BULLDOZED'
    output_directory = 'Rapid_Model'                                output_directory = 'Rapid_Model'
    extracted_slice_parameters_directory = 'SliceParametersNZ/Sli   extracted_slice_parameters_directory = 'SliceParametersNZ/Sli
    code = 'nz'                                                     code = 'nz'
    # Section II. Derived parameters that can be manually editted   # Section II. Derived parameters that can be manually editted
    extent_x = '140.0'                                              extent_x = '140.0'
    extent_y = '120.0'                                              extent_y = '120.0'
    extent_zmax = '46.0'                                            extent_zmax = '46.0'
    extent_zmin = '0.0'                                             extent_zmin = '0.0'
    sim_duration = '100.0'                                          sim_duration = '100.0'
    flo = '0.5'                                                     flo = '0.5'
    # Section III. Automated values. DO NOT EDIT (Manual changes    # Section III. Automated values. DO NOT EDIT (Manual changes
    nx = ' 700'                                                     nx = ' 700'
    ny = ' 600'                                                     ny = ' 600'
    nz = '230'                                                      nz = '230'
    sufx = '_rt01-h0.200'                                         | sufx = '_nz01-h0.200'
    
    ############  Estimated Wallclock time
    nx=700 ny=600 nz=230 sim_duration=100 num_procs=512
    Maximum: 0:55:02
    Average: 0:17:16.597834
    Minimum: 0:11:58.613082
    
    
  4. Run make_vm.sh to create the Velocity Model
  5. Follow the instruction given on the screen to provide a path to a admin.

3. How to create Rupture Model (Source)

  1. Go to the Src directory that instruction has provided
    e.g. $ cd /home/jonney/20100904_Darfield_m7p1_201705181350/Src
  2. Create the config file that is needed for generating a Rupture Model
    $ config_src.py type
    e.g. $ config_src.py 2
  3. Go to the folder provided by instrutions
    e.g. $ cd /home/jonney/20100904_Darfield_m7p1_201705181350/Src/Model/20100904_Darfield_m7p1/t2_103245_20170518_175214
  4. Edit the setSrfParams.py
    note: every variables with #!!!PLEASE SPECIFY!!!# must be provided
  5. Create the Model using make_src.sh
    e.g. $ make_src.sh
  6. Follow the instruction given on the screen to provide a path to a admin.

4. How to create observation files

note: you can skip this part if you are running for a future event (not yet happened)

  1. Go to the Obs directory that instruction has provided
    e.g. $ cd /home/jonney/20100904_Darfield_m7p1_201705181350/GM/Obs
  2. Create the config file that is needed
    $ config_obs.py geoNet_ftp_url
    e.g. $ config_obs.py ftp://ftp.geonet.org.nz/strong/processed/Proc/2010/09_Sep/2010-09-04_045556/Vol1/data/
  3. Run make_obs.sh to generate all the files
    e.g. $ make_obs.sh
  4. Follow the instruction given on the screen to provide a path to a admin.

5. How to setup the simulation

  1. After admin tells you that all files are uploaded to Fitzroy, Run setup_remote.sh
    $ setup_remote.sh username
    e.g $ setup_remote.sh jonney

6. Run the simulation on Low Frequency (LF)

  1. Go to the Simulation Folder, located at /nesi/projects/nesi00213/RunFolder/user/run_name
    e.g. $ cd /nesi/projects/nesi00213/RunFolder/ykh22/20100904_Darfield_m7p1_201705181350
  2. Run submit_emod3d.sh
    $ ./submit_emod3d.h
  3. It will ask you to enter a wall_clock_limit and if it should auto submit the job.
    note: if you prefer to change some detail configurations, press 2(no) for auto submit.*
  4. use llsubmit to submit your job if you selected to not to auto submit.
  5. Use llq to check if your job has finished. (job status: R= running, C= Complete, I = idle)
    $ llq -u user
  6. After Emod3d finished, run submit_post_emod3d.sh
    note: if you prefer to change some detail configurations, press 2(no) for auto submit.*
    $ ./submit_post_emod3d.sh

7. Run the simulation on High Frequency (HF)

note: this part can run before LF is finished

  1. Run install_bb.sh, to setup the parameters
    $ ./install_bb.sh
  2. Choose from the options according to simulation requirement
  3. Run submit_hf.sh
    $ ./submit_hf.sh
    note: if you prefer to change some detail configurations, press 2(no) for auto submit.*

*: use llsubmit to submit your job if you selected not to auto submit. $ llsubmit job.ll

8. Run the Simulation on Broadband (BB)

Note: This part MUST wait untill both LF and HF are finished

  1. Run submit_bb.sh
    $ ./submit_bb.sh




  • No labels