Difference between revisions of "COD Class Examples"

From WikiROMS
Jump to navigationJump to search
Line 52: Line 52:
Following the instructions above, complete these steps:
Following the instructions above, complete these steps:


# Copy the COD example files to your working directory
# Copy the '''COD''' example files to your working directory
# Modify build_bash.sh to run ROMS_APPLICATION COD_1DMIX
# Modify build_bash.sh to run <span class="sandyBrown">ROMS_APPLICATION</span>='''COD_1DMIX'''
# Compile the model, i.e. run build_bash.sh
# Compile the model, i.e. run <span class="blue">build_bash.sh</span>
# Modify your job.sh script to pass the correct input file, i.e. roms_cod_1dmix.in, to the srun command
# Modify your job.sh script to pass the correct input file, i.e. roms_cod_1dmix.in, to the srun command </br> {{note}} '''Notice:''' You must also modify <span class="blue">job.sh</span> to request the appropriate number of '''tasks'''. Review the entries for '''NtileI''' and '''NtileJ''' in <span class="blue">roms_cod_1dmix.in</span> and set the correct value.
# Submit the job to SLURM
# View the output log, i.e. the file named something like '''out.hal0007.12345678.log''' to verify the ru was successful
# Check for the creation of the netcdf output files.

Revision as of 21:41, 27 January 2022

ROMS examples for Coastal Ocean Dynamics

Introduction

The page describes idealized configurations of ROMS that are used in Rutgers course 16:712:503 Coastal Ocean Dynamics to illustrate various aspects of ocean dynamics studied in lectures.

Obtaining the source code for examples

In almost all instances the ROMS files that have been customized for these examples are on the Rutgers OARC Amarel cluster amarel.rutgers.edu in directory /projects/dmcs_1/courses/cod. Users must be a member of group dmcs_1 to access these files.

To get started, copy all the files in /projects/dmcs_1/courses/cod to the working directory where you are locally compiling and running ROMS> This is the directory where you ran the UPWELLING test case.

Verify you are in your working directory with

pwd

Then copy everything with a command like this:

cp /projects/dmcs_1/courses/cod/* .

The * is the wildcard for all files in /projects/dmcs_1/courses/cod, and the dot . signifies that the target directory is the directory you are in.

Later in the class some of these files will be updated, and new files added, and when you copy them you will want to be more selective than using the * wildcard if you don't want to overwrite files you have modified for your own work.

What are these files?

cod_*.h files

Each class example has its own cod_*.h file that will be activated to control compilation by setting ROMS_APPLICATION in your personal build_bash.sh script. For example, for COD_1DMIX, you will edit build_bash.sh to set:

export ROMS_APPLICATION=COD_1DMIX

instead of the case UPWELLING that you had when you first ran ROMS.

Once you have copied the cod_*.h file to your working directory, and modified build_bash.sh, recompile by running the build script as you did before, e.g.

./build_bash.sh -j 4

This will create a new romsM executable file to run the COD example.

ana_*.h files

The analytical files are new versions of files in the ROMS/Functionals subdirectory that you downloaded with svn that have been modified to have blocks of code for each of the class examples. The modifications are marked by C-PreProcessor (CPP) directives such as, for example:

#ifdef COD_1DMIX
...
#endif

which will cause that section of code to be compiled when option COD_1DMIX is defined.

This is the way in which we modify ROMS for our own purposes. We can safely have the code for all the COD examples in one version of each ana_*.h file because the code segments are selectively activated with CPP directives.

Some of the class examples use default settings in the analytical files and do not need special instructions.

cod_*.in files

Each class example has its own roms_cod_*.in file that ROMS will read at run-time. This is equivalent to the file roms_upwelling.in that you used when you first ran ROMS.

The job.sh script you use to submit the class examples to the SLURM scheduler with the command sbatch job.sh will have to be modified (at the srun command) to use the appropriate roms_cod*.in file. For example:

srun --mpi=pmi2 ./romsM roms_cod_1dmix.in

Configuring your working directory files to run Example COD_1DMIX

Following the instructions above, complete these steps:

  1. Copy the COD example files to your working directory
  2. Modify build_bash.sh to run ROMS_APPLICATION=COD_1DMIX
  3. Compile the model, i.e. run build_bash.sh
  4. Modify your job.sh script to pass the correct input file, i.e. roms_cod_1dmix.in, to the srun command
    Note Notice: You must also modify job.sh to request the appropriate number of tasks. Review the entries for NtileI and NtileJ in roms_cod_1dmix.in and set the correct value.
  5. Submit the job to SLURM
  6. View the output log, i.e. the file named something like out.hal0007.12345678.log to verify the ru was successful
  7. Check for the creation of the netcdf output files.