Getting Started with SURF-NEMO¶
Download and Install SURF Virtual Machine¶
surf_vm_VERSION.zip
-
Navigate to https://www.virtualbox.org/ and click on Downloads button.
Choose the
VirtualBox base package
(version >=6) corresponding to the host operating system of your computer (i.e. Windows, Mac, Linux). Save the corresponding file on your computer, double-click it to open it, and follow the installation instructions.
-
In addition to the base package, download also the
Extension Packs
. This package provides additional functionality to the base package, such as virtual USB device, remote desktop support, ecc. To install this extension, simply double-click on the package file and follow the installation instructions. Please install the same version extension pack as your installed version of the VirtualBox base package.
-
Download the current version (v1.01) of the SURF virtual machine from
SURF web-page.
In the virtual machines is installed the Debian GNU/Linux 8.11 operating system.
The Guest Additions have been also installed to optimize the guest operating system for better performance and usability.
Extract than the package in your VirtualBox directory which Oracle VM VirtualBox creates in the current system user's home directory
(i.e.
/Users/USERNAME/VirtualBox VMs/
for Mac user).unzip surf_1.01.zip
-
Open the VirtualBox software. From the menu, choose Machine > add and navigate to the file
surf.vbox
. This file is an XML file that contains settings of the Machine. This will add the Virtual Machinesurf
to the list of Virtual Machine
-
To start the VM surf, you can double-click on its entry in the list in the VirtualBox Manager window or select its entry and press the Start button at the top of the window. A window opens.
The VM Login should look like the
figure 6.5
.
In the login dialogue box enter:
- surf as login
- surf2019 as an initial password
Disk Partitions mounted on the SURF Virtual Machine¶
surf.vdi
containing the Debian GNU/Linux operating system (version 10.3)surf_scratch.vdi
thought to contain source code files, datasets sample and experiments.
sudo fdisk -l
- the disk
/dev/sda
"mounted" as filesystems to the root directory/
- the disk
/dev/sdb
"mounted" in the directory/scratch
.
- Shut down the virtual OS before you can edit settings.
- Select the surf VM in the VirtualBox Manager and click Settings.
- Select Shared Folders, and click the Plus button to add a new shared folder. Specify the host folder you want to share.
- Select auto-mount and then click OK.
- You can now re-start the VM surf. The shared folder is mounted into the /media directory, along with the prefix "sf_".
Changing Configuration on the SURF Virtual Machine¶
- Select the surf VM in the VirtualBox Manager, right-click it and choose Setting.
- increase/decrease the number of cores based on your performance desires.
- increase/decrease the number of GB of RAM allocated to your VM according to the size of your computational domain.
- increase/decrease the video memory and scale factor of your screen
- With the VM Power off, open a terminal and move to the location of the surf_scratch.vdi file that you want to resize,
- At the terminal prompt, type the command:
VBoxManage modifyhd surf_scratch.vdi --resize SIZE_MB
- Restart the SURF VM and open the GParted application from the Application Menu
- Select the /dev/sdb partition (an unlocated drive space is now available). Resize to the unalocated area
Parameter | Description | Values |
---|---|---|
Name | Name given the VM | surf |
Guest OS | Operating system running on this VM | Debian Linux |
Memory | Amount of memory available to this VM | 2 [GB] |
Cores | Number of CPU cores being used by this VM | 2 |
Disk Capacity | Total disk capacity available to this VM | 40 [GB] |
Network Adapters | Number of network adapters available to this VM | 1 |
IP Address | IP address assigned to the VM | x |
Download and Install SURF packages¶
/scratch
.
The scratch directory follows the directory structure as shown in Fig. B.1. The VM you have installed does not contain the SURF packages (source codes and static datasets) and you need to download and install them. The SURF packages are packaged and distributed as a GZIP Compressed Tar Archive file (with a .tar.gz extension). The general scheme adopted to manage the versions provides that the releases contain in the name indications of the version in the format:
packageName_<VERSION>.tar.gz
-
Once logged in the VM surf, download the current version of the SURF-NEMO (surf_nemo_1.01.tar.gz)
and SURF-DATASETS (surf_datasets_1.01.tar.gz) packages directly from the
SURF web-page
and save it in the directory
/scratch/surf/surf_install/releases/
(for simplicity, we abbreviate this location as$SURF_RELEASES
). -
Go to the directory
$SURF_RELEASES
and run the installation bash scriptinstall.sh
followed by the package name. For the SURF-NEMO packages type:For the SURF-DATASETS packages type:cd $SURF_RELEASES ; install.sh surf_nemo_1.01.tar.gz
The installation process will extract the archive in the directorycd $SURF_RELEASES ; install.sh surf_datasets_1.01.tar.gz
/scratch/surf/surf_nemo/
and/scratch/surf/surf_datasets/
, respectively, and will create a symbolic linkcurrent
in this directory that points to the extracted folder (for simplicity, we abbreviate this location as$SURF_NEMO
,$SURF_DATASETS
, respectively).
Compiling the source code¶
/scratch/surf/surf_nemo/current/scripts/
and run the compilation bash script compile.sh
followed by the package name (or by the word 'all' to compile all the packages):
cd /scratch/surf/surf_nemo/current/scripts; ./compile_codes.sh all
Running the case study: Gulf of Taranto¶
-
Download the input datasets (gulfTaranto_20141005.tar.gz) of this case study directly from the web-repository
(https://www.surf-platform.org)
and extract it in the directory
/scratch/surf/indata_offline/
Note If you want to change the local repository path to some other location of your choice make sure to change the path in the configuration file.tar -zxvf gulfTaranto_20141005.tar.gz
-
Create a new folder in the directory
/scratch/from_GUI/
and let's call it gulfTaranto_20141005. This is the Experiment ID name which uniquely identifies the experiment.cd /scratch/from_GUI/; mkdir gulfTaranto_20141005
-
Copy the template configuration file
/scratch/surf/surf_nemo/current/setParFree.json
in the directory/scratch/from_GUI/gulfTaranto_20141005/
which contains the configuration for this case study.necd; cp setParFree.json /scratch/from_GUI/gulfTaranto_20141005/
-
After that, from the directory
/scratch/surf/surf_nemo/current/scripts/
, you just need to execute the Julia scriptrun_exp.jl
followed by the experiment IDgulfTaranto_20141005
This will create the folder gulfTaranto_20141005 in the directoryjulia run_exp.jl gulfTaranto_20141005
/scratch/surf/experiments/
with a directory tree as in fig.x.1 (refer to the Appendix B for more details)
set_lrun
of the configuration file setParFree.json
lrun_childMeshmask
to enable the execution of the CHILD-MESHMASK GENERATION task. lrun_regridPreAtm
to enable the execution of the ATMOSPHERIC-DATA-REGRIDDING task. lrun_regridPreOceIC
to enable the execution of the OCEAN-IC-DATA-REGRIDDING task. lrun_regridPreOceBC
to enable the execution of the OCEAN-BC-DATA-REGRIDDING task. lrun_regridPreWeights
if you want to compute (=True) or just copy (=False) the WEIGHT-FILEs for REMAPPING in the Regridding phase. lrun_ocean
to enable the execution of the NEMO code.
{
"id":"A001","title":"set_lrun",
"items": [
{"name": "lrun_childMeshMask",
"value": "True"
},
{"name": "lrun_regridPreAtm",
"value": "True"
},
{"name": "lrun_regridPreOceIC",
"value": "True"
},
{"name": "lrun_regridPreOceBC",
"value": "True"
},
{"name": "lrun_regridPreWeights",
"value ": "True"
},
{"name": "lrun_ocean",
"value": "True"
}
]
}
Post-processing the results¶
Visualizing the results with Ncview¶
ncview SURF_1h_20141006_20141006_grid_T.nc
Analyzing and Visualizing results using NCAR graphic packages¶
run_postProc.jl
followed by the experiment ID. Example for the case study experiment type the following command:
julia run_postproc.jl gulfTaranto_20141005
set_lrun_post
and set_visual_lplot
of the configuration file setParFree.json
lrun_visDom
to enable the plotting of the user-defined domains.lrun_visIndata
to enable the plotting of the Indata Bat, Atm, OceIC, OceBC fields.lrun_visExtrapdata
to enable the plotting of the Extrapdata Atm, OceIC, OceBC fields.lrun_visRegriddata
to enable the execution of the OCEAN-IC-DATA-REGRIDDING task.lrun_visOutdata
to enable the execution of the OCEAN-BC-DATA-REGRIDDING task.lrun_chlVSpar
if you want to compute (=True) or just copy (=False) the WEIGHT-FILEs for REMAPPING in the Regridding phase.lrun_surfVSctd
enables the execution of the NEMO code.lrun_surfVSsat
enables the execution of the NEMO code.lrun_surfVSmooring
enables the execution of the NEMO code.lrun_surfVSferrybox
enables the execution of the NEMO code.{
"id":"B000","title":"set_lrun_post",
"items": [
{"name": "lrun_visDom",
"value": "True"
},
{"name": "lrun_visIndata",
"value": "True"
},
{"name": "lrun_visExtrapdata",
"value": "True"
},
{"name": "lrun_visRegriddata",
"value": "True"
},
{"name": "lrun_visOutdata",
"value ": "True"
},
{"name": "lrun_chlVSpar",
"value": "True"
},
{"name": "lrun_surfVSctd",
"value": "True"
},
{"name": "lrun_surfVSsat",
"value": "True"
},
{"name": "lrun_surfVSmooring",
"value": "True"
},
{"name": "lrun_surfVSferrybox",
"value": "True"
}
]
}
lplotMesh
to enable plotting of the Child MeshMask fields.lplotBat
to enable the plotting of the Bathymetry fields.lplotAtm
to enable the plotting of the Atmospheric fields.lplotOceIC
to enable the plotting of the Initial Condition Ocean fields.lplotOceBC
to enable the plotting of the Open Boundary Condition Ocean fields.lplotOceBCbdy
to enable the plotting of the Open Boundary Condition Ocean fields.lplotOceOut
to enable the plotting of the Output Ocean fields.{
"id":"B001","title":"set_visual_lplot",
"items": [
{"name": "lplotMesh",
"value": "True"
},
{"name": "lplotBat",
"value": "True"
},
{"name": "lplotAtm",
"value": "True"
},
{"name": "lplotOceIC",
"value": "True"
},
{"name": "lplotOceBC",
"value": "True"
},
{"name": "lplotOceBCbdy",
"value": "True"
},
{"name": "lplotOceOut",
"value": "True"
}
]
}
Make a new experiments¶
Let's assume you want to study the circulation of the Sermilik fjord in Greenland from 1 February 2017 at 00:00 to 7 February 2017 at 24:00 ... add more details.
-
Choose the name of experiment ID (e.g.
greenlandFjord_20170201
) and create the foldercd /scratch/from_GUI/; mkdir greenlandFjord_20170201
-
Copy the template configuration file
/scratch/surf/surf_nemo/current/setParFree.json
in the directory/scratch/from_GUI/greenlandFjord_20170201
cp /scratch/surf/surf_nemo/current/setParFree.json ./greenlandFjord_20170201/
-
Modify the user configuration file
setParFree.json
according to your needsparam1 = xxx
param2 = xxx
param3 = xxx
param4 = xxx -
From the directory
/scratch/surf/surf_nemo/current/scripts/
, execute the Julia scriptrun_exp.jl
followed by the experiment IDgreenlandFjord_20170201
cd /scratch/surf/surf_nemo/current/scripts/; julia run_exp.jl greenlandFjord_20170201
-
After running the simulation, you can display the simulation results by using
the Julia script
run_postproc.jl
followed by the experiment IDgreenlandFjord_20170201
cd /scratch/surf/surf_nemo/current/scripts/; julia run_postproc.jl greenlandFjord_20170201
In principle you can simply use the template model and modify it to your needs, and not be too much concerned with the input files they create. But our advice is never to use the template model as black boxes. It is therefore important to understand how the codes work, which options they have and how their input files are structured.
Multiple downscaling experiments¶
SURF-NEMO package includes multiple nesting capability (i.e. consecutive nested models can be
implemented with increasing grid resolutions).
Let's assume you want to downscale from an existing experiment (e.g. from the template experiment
gulfTaranto_20141005
)
in order to increase the spatial resolution to 800m ... add details.
-
Go to the existing experiment directory
cd /scratch/surf/experiments/gulfTaranto_20141005/
-
Modify the user configuration file
setParFree.json
according to your needsparam1 = xxx
param2 = xxx
param3 = xxx
param4 = xxx -
From the directory
/scratch/surf/experiments/gulfTaranto_20141005/code/ocean/scripts/
, execute the Julia scriptrun_exp.jl
followed by the experiment IDgulfTaranto_20141005
cd /scratch/surf/experiments/gulfTaranto_20141005/code/ocean/scripts/; julia run_exp.jl gulfTaranto_20141005
-
After running the simulation, you can display the simulation results by using the julia script
run_postproc.jl
followed by the experiment IDgulfTaranto_20141005
julia run_postproc.jl gulfTaranto_20141005