-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #24 from noaa-ocs-modeling/develop
rearrange README and rename scripts
- Loading branch information
Showing
41 changed files
with
293 additions
and
1,443 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,27 +12,27 @@ ocean model ensembles. | |
It utilizes [`nemspy`](https://github.com/noaa-ocs-modeling/NEMSpy) to generate NEMS configuration files, shares common | ||
configurations between runs, and organizes spinup and mesh partition into separate jobs for dependant submission. | ||
|
||
### Supported models and inputs: | ||
## Supported models and platforms | ||
|
||
- circulation models | ||
- ADCIRC (uses [`adcircpy`](https://github.com/JaimeCalzadaNOAA/adcircpy)) | ||
- forcing | ||
- ATMESH | ||
- WW3DATA | ||
- ### models | ||
- #### circulation models | ||
- ADCIRC (uses [`adcircpy`](https://github.com/JaimeCalzadaNOAA/adcircpy)) | ||
- #### forcings | ||
- ATMESH | ||
- WW3DATA | ||
- ### platforms | ||
- #### local (no job manager) | ||
- #### Hera (Slurm) | ||
- #### Stampede2 (Slurm) | ||
|
||
### Supported platforms: | ||
## Usage | ||
|
||
- local (no job manager) | ||
- Hera (Slurm) | ||
- Stampede2 (Slurm) | ||
Example scripts can be found at `examples/<platform>` | ||
|
||
### Usage | ||
### 1. generate configuration directory | ||
|
||
Example scripts can be found at `examples/<platform>`. | ||
|
||
Here is an example for running a simple mesh over the Shinnecock Inlet with a coupled `(ATMESH + WW3DATA) -> ADCIRC` scenario, | ||
and prepping a configuration directory with run script for job submission on Hera. After running the following example on Hera, | ||
the user would then run `sh run.sh` to submit the jobs. | ||
The following code (`examples/hera/hera_shinnecock_ike.py`) creates a configuration for coupling `(ATMESH + WW3DATA) -> ADCIRC` | ||
on Hera, over a small Shinnecock Inlet mesh: | ||
|
||
```python | ||
from datetime import datetime, timedelta | ||
|
@@ -56,46 +56,126 @@ FORCINGS_DIRECTORY = Path('/scratch2/COASTAL/coastal/save/shared/models') / 'for | |
# directory to which to write configuration | ||
OUTPUT_DIRECTORY = Path(__file__).parent.parent / 'data' / 'configuration' / 'hera_shinnecock_ike' | ||
|
||
if __name__ == '__main__': | ||
# dictionary defining runs with ADCIRC value perturbations - in this case, a single run with no perturbation | ||
runs = {f'test_case_1': (None, None)} | ||
|
||
# initialize `nemspy` configuration object with forcing file locations, start and end times, and processor assignment | ||
nems = ModelingSystem( | ||
start_time=datetime(2008, 8, 23), | ||
end_time=datetime(2008, 8, 23) + timedelta(days=14.5), | ||
interval=timedelta(hours=1), | ||
atm=AtmosphericMeshEntry(filename=FORCINGS_DIRECTORY / 'wind_atm_fin_ch_time_vec.nc', processors=1), | ||
wav=WaveMeshEntry(filename=FORCINGS_DIRECTORY / 'ww3.Constant.20151214_sxy_ike_date.nc', processors=1), | ||
ocn=ADCIRCEntry(processors=11), | ||
) | ||
|
||
# describe connections between coupled components | ||
nems.connect('ATM', 'OCN') | ||
nems.connect('WAV', 'OCN') | ||
nems.sequence = [ | ||
'ATM -> OCN', | ||
'WAV -> OCN', | ||
'ATM', | ||
'WAV', | ||
'OCN', | ||
] | ||
|
||
# initialize `adcircpy` forcing objects | ||
tidal_forcing = Tides() | ||
tidal_forcing.use_all() | ||
wind_forcing = AtmosphericMeshForcing(nws=17, interval_seconds=3600) | ||
wave_forcing = WaveWatch3DataForcing(nrs=5, interval_seconds=3600) | ||
|
||
# send run information to `adcircpy` and write the resulting configuration to output directory | ||
write_adcirc_configurations( | ||
nems, | ||
runs, | ||
MESH_DIRECTORY, | ||
OUTPUT_DIRECTORY, | ||
email_address='[email protected]', | ||
platform=Platform.HERA, | ||
spinup=timedelta(days=12.5), | ||
forcings=[tidal_forcing, wind_forcing, wave_forcing], | ||
) | ||
# dictionary defining runs with ADCIRC value perturbations - in this case, a single run with no perturbation | ||
runs = {f'test_case_1': (None, None)} | ||
|
||
# initialize `nemspy` configuration object with forcing file locations, start and end times, and processor assignment | ||
nems = ModelingSystem( | ||
start_time=datetime(2008, 8, 23), | ||
end_time=datetime(2008, 8, 23) + timedelta(days=14.5), | ||
interval=timedelta(hours=1), | ||
atm=AtmosphericMeshEntry(filename=FORCINGS_DIRECTORY / 'wind_atm_fin_ch_time_vec.nc', processors=1), | ||
wav=WaveMeshEntry(filename=FORCINGS_DIRECTORY / 'ww3.Constant.20151214_sxy_ike_date.nc', processors=1), | ||
ocn=ADCIRCEntry(processors=11), | ||
) | ||
|
||
# describe connections between coupled components | ||
nems.connect('ATM', 'OCN') | ||
nems.connect('WAV', 'OCN') | ||
nems.sequence = [ | ||
'ATM -> OCN', | ||
'WAV -> OCN', | ||
'ATM', | ||
'WAV', | ||
'OCN', | ||
] | ||
|
||
# initialize `adcircpy` forcing objects | ||
tidal_forcing = Tides() | ||
tidal_forcing.use_all() | ||
wind_forcing = AtmosphericMeshForcing(nws=17, interval_seconds=3600) | ||
wave_forcing = WaveWatch3DataForcing(nrs=5, interval_seconds=3600) | ||
|
||
# send run information to `adcircpy` and write the resulting configuration to output directory | ||
write_adcirc_configurations( | ||
nems, | ||
runs, | ||
MESH_DIRECTORY, | ||
OUTPUT_DIRECTORY, | ||
email_address='[email protected]', | ||
platform=Platform.HERA, | ||
spinup=timedelta(days=12.5), | ||
forcings=[tidal_forcing, wind_forcing, wave_forcing], | ||
) | ||
``` | ||
|
||
This code will generate a directory `hera_shinnecock_ike/` with the following structure: | ||
|
||
``` | ||
📦 hera_shinnecock_ike/ | ||
┣ 📂 coldstart/ | ||
┃ ┣ 📜 fort.13 | ||
┃ ┣ 📜 fort.14 | ||
┃ ┗ 📜 fort.15 | ||
┣ 📂 runs/ | ||
┃ ┗ 📂 test_case_1/ | ||
┃ ┣ 📜 fort.13 | ||
┃ ┣ 📜 fort.14 | ||
┃ ┗ 📜 fort.15 | ||
┣ 📜 config.rc.coldstart | ||
┣ 📜 config.rc.hotstart | ||
┣ 📜 model_configure.coldstart | ||
┣ 📜 model_configure.hotstart | ||
┣ 📜 nems.configure.coldstart | ||
┣ 📜 nems.configure.hotstart | ||
┣ 📜 job_adcprep_hera.job | ||
┣ 📜 job_nems_adcirc_hera.job.coldstart | ||
┣ 📜 job_nems_adcirc_hera.job.hotstart | ||
┗ 📜 run_hera.sh | ||
``` | ||
|
||
_**Note:** the required NEMS configuration files (`nems.configure`, `model_configure`) do not yet exist in the run | ||
directories (`coldstart/`, `runs/test_case_1/`). These will be populated in the next step._ | ||
|
||
### 2. run job submission script `run_<platform>.sh` | ||
|
||
Run `run_hera.sh`: | ||
|
||
```bash | ||
sh run_hera.sh | ||
``` | ||
|
||
This will first create symbolic links to populate configuration directories, | ||
|
||
``` | ||
📦 hera_shinnecock_ike/ | ||
┣ 📂 coldstart/ | ||
┃ ┣ 📜 fort.13 | ||
┃ ┣ 📜 fort.14 | ||
┃ ┣ 📜 fort.15 | ||
┃ ┣ 🔗 config.rc -> ../config.rc.coldstart | ||
┃ ┣ 🔗 model_configure -> ../model_configure.hotstart | ||
┃ ┣ 🔗 nems.configure -> ../nems.configure.coldstart | ||
┃ ┣ 🔗 hera_adcprep.job -> ../job_adcprep_hera.job | ||
┃ ┗ 🔗 hera_nems_adcirc.job -> ../job_nems_adcirc_hera.job.coldstart | ||
┣ 📂 runs/ | ||
┃ ┗ 📂 test_case_1/ | ||
┃ ┣ 📜 fort.13 | ||
┃ ┣ 📜 fort.14 | ||
┃ ┣ 📜 fort.15 | ||
┃ ┣ 🔗 config.rc -> ../../config.rc.hotstart | ||
┃ ┣ 🔗 model_configure -> ../../model_configure.hotstart | ||
┃ ┣ 🔗 nems.configure -> ../../nems.configure.hotstart | ||
┃ ┣ 🔗 hera_adcprep.job -> ../../job_adcprep_hera.job | ||
┃ ┗ 🔗 hera_nems_adcirc.job -> ../../job_nems_adcirc_hera.job.hotstart | ||
┣ 📜 config.rc.coldstart | ||
┣ 📜 config.rc.hotstart | ||
┣ 📜 model_configure.coldstart | ||
┣ 📜 model_configure.hotstart | ||
┣ 📜 nems.configure.coldstart | ||
┣ 📜 nems.configure.hotstart | ||
┣ 📜 job_adcprep_hera.job | ||
┣ 📜 job_nems_adcirc_hera.job.coldstart | ||
┣ 📜 job_nems_adcirc_hera.job.hotstart | ||
┗ 📜 run_hera.sh | ||
``` | ||
|
||
and then submit the requested jobs to the queue: | ||
|
||
```bash | ||
JOBID NAME CPUS NODE DEPENDENCY ACCOUNT PARTITION SUBMIT_TIME START_TIME END_TIME | ||
16368044 ADCIRC_MESH_PARTITION 1 1 (null) coastal hera 2021-02-18T19:29:17 N/A N/A | ||
16368045 ADCIRC_COLDSTART 11 1 afterany:16368044(unfulfilled) coastal hera 2021-02-18T19:29:17 N/A N/A | ||
16368046 ADCIRC_MESH_PARTITION 1 1 afterany:16368045(unfulfilled) coastal hera 2021-02-18T19:29:17 N/A N/A | ||
16368047 ADCIRC_HOTSTART 13 1 afterany:16368046(unfulfilled) coastal hera 2021-02-18T19:29:17 N/A N/A | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
# `config.rc` generated with NEMSpy 0.2.3.post16.dev0+f3fb2b8 | ||
# `config.rc` generated with NEMSpy 0.3.1.post9.dev0+5c0cf20 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
16 changes: 16 additions & 0 deletions
16
tests/data/reference/hera_shinnecock_ike/job_adcprep_hera.job
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#!/bin/bash --login | ||
#SBATCH -J ADCIRC_MESH_PARTITION | ||
#SBATCH -A coastal | ||
#SBATCH --mail-type=ALL | ||
#SBATCH [email protected] | ||
#SBATCH --error=ADCIRC_MESH_PARTITION.err.log | ||
#SBATCH --output=ADCIRC_MESH_PARTITION.out.log | ||
#SBATCH -n 1 | ||
#SBATCH --time=00:30:00 | ||
|
||
set -e | ||
|
||
source /scratch2/COASTAL/coastal/save/shared/repositories/ADC-WW3-NWM-NEMS/modulefiles/hera/ESMF_NUOPC | ||
|
||
srun /scratch2/COASTAL/coastal/save/shared/repositories/ADC-WW3-NWM-NEMS/ADCIRC/work/adcprep --np 11 --partmesh | ||
srun /scratch2/COASTAL/coastal/save/shared/repositories/ADC-WW3-NWM-NEMS/ADCIRC/work/adcprep --np 11 --prepall |
Oops, something went wrong.