|
|
|
[[_TOC_]]
|
|
|
|
|
|
|
|
# Running MEDUSA 1D
|
|
|
|
|
|
|
|
To do this we assume you already have your environment ready and have checked out a NEMO4-MEDUSA branch.
|
|
|
|
If not, check the appropriate page from this [ wiki page](https://git.noc.ac.uk/acc/medusa_4.2.x/) .
|
|
|
|
|
|
|
|
This 1D how to page is valid for both `ARCHER2` and `ANEMONE`. Just mind the path and libraries to load, depending the machine you are running with.
|
|
|
|
* On `ARCHER2`
|
|
|
|
```sh
|
|
|
|
NEMO='/work/n01/n01/${userID}/medusa_4.2.x/nemo'
|
|
|
|
SETTING_RUN_DIR='/work/n01/n01/julpal/SETTING_RUNNING_DIR/1D_ARCHER2'
|
|
|
|
COMPILER='X86_ARCHER2-Gnu_4.2'
|
|
|
|
```
|
|
|
|
* On `ANEMONE`
|
|
|
|
```sh
|
|
|
|
NEMO='/dssgfs01/working/${userID}/NEMO/medusa_4.2.x/nemo'
|
|
|
|
SETTING_RUN_DIR='/dssgfs01/scratch/jpp1m13/SETTING_RUNNING_DIR/1D_ANEMONE'
|
|
|
|
COMPILER='x86-64_Anemone'
|
|
|
|
```
|
|
|
|
|
|
|
|
## Compiling 1D config
|
|
|
|
First thing is to compile a first time a new config based on `C1D_PAPA` :
|
|
|
|
from your NEMO4.2 base directory (should be something like `${NEMO}` defined just above, but od course, adapt to your own medusa path).
|
|
|
|
* Some corrections listed in Andrews documentations for ARCHER2 only ([here](https://docs.archer2.ac.uk/research-software/nemo/nemo/#setting-up-the-correct-environment) --
|
|
|
|
This should have already been done to compile your `ORCA2_MEDUSA` configuration, but better to double-check) :
|
|
|
|
* Update `ext/FCM/lib/Fcm/Config.pm ` by changing `FC_MODSEARCH => '', ` into `FC_MODSEARCH => '-J', `
|
|
|
|
* Add this arch file into your `arch` directory :
|
|
|
|
```sh
|
|
|
|
cp /work/n01/shared/nemo/ARCH/arch-X86_ARCHER2-Gnu_4.2.fcm arch/
|
|
|
|
```
|
|
|
|
* Now you can compile a first time -- valid whatever the machine -- type :
|
|
|
|
```sh
|
|
|
|
./makenemo -m ${COMPILER} -r C1D_PAPA -n C1D_MED -j 16
|
|
|
|
```
|
|
|
|
It should compile successfully the dynamic side only, but will create the right files at the right place. Here our 1D config is called `C1D_MED`
|
|
|
|
|
|
|
|
## Compile MEDUSA 1D
|
|
|
|
Modify our new config component and cpp keys. At the moment they are based on `C1D_PAPA` which is dynamics only.
|
|
|
|
* update `cfgs/work_cfgs.txt`
|
|
|
|
change our config line to be (just add the TOP component) :
|
|
|
|
```
|
|
|
|
C1D_MED OCE TOP
|
|
|
|
```
|
|
|
|
* Then `cfgs/C1D_MED/cpp_C1D_MED.fcm`
|
|
|
|
add the `key_top`, it should be like (not necessarily exactly the same, just add `key_top`) :
|
|
|
|
```
|
|
|
|
bld::tool::fppkeys key_xios key_linssh key_vco_1d3d key_top
|
|
|
|
```
|
|
|
|
1. To compile properly, MEDUSA still needs few things :
|
|
|
|
the MEDUSA's adapted version of NEMO and NEMO-TOP subroutines.
|
|
|
|
Just copy them from the `ORCA2_MEDUSA` config, with :
|
|
|
|
```sh
|
|
|
|
cp -d cfgs/ORCA2_MEDUSA/MY_SRC/* cfgs/C1D_MED/MY_SRC/
|
|
|
|
```
|
|
|
|
1. Now everything is ready to compile.
|
|
|
|
You can do so with :
|
|
|
|
```sh
|
|
|
|
./makenemo -m ${COMPILER} -r C1D_MED -j 16
|
|
|
|
```
|
|
|
|
## Running The PAPA "ready to use" config.
|
|
|
|
|
|
|
|
From here, NEMO-Executable is ready, but we still need to include MEDUSA's namelist and other files to be able to run it.
|
|
|
|
* go into `cfgs/C1D_MED/EXP00`.
|
|
|
|
* copy and link the files :
|
|
|
|
```sh
|
|
|
|
cp -rd ../../ORCA2_MEDUSA/EXPREF ..
|
|
|
|
ln -s ../../SHARED_MEDUSA/namelist_medusa_ref .
|
|
|
|
cp ../EXPREF/namelist_medusa_cfg .
|
|
|
|
cp -d ../EXPREF/namelist_top_* .
|
|
|
|
cp -d ../EXPREF/*medusa*xml .
|
|
|
|
cp ../EXPREF/xco2.atm .
|
|
|
|
```
|
|
|
|
1. All MEDUSA files are here. We need to adapt some.
|
|
|
|
* Update `context.xml` : add references to `field*medusa*xml` and `file*medusa*xml` files.
|
|
|
|
It should look like this afterward:
|
|
|
|
```xml
|
|
|
|
<!--
|
|
|
|
==============================================================================================
|
|
|
|
NEMO context
|
|
|
|
==============================================================================================
|
|
|
|
-->
|
|
|
|
<context id="nemo">
|
|
|
|
<!-- $id$ -->
|
|
|
|
|
|
|
|
<!-- Fields definition -->
|
|
|
|
<field_definition src="./field_def_nemo-oce.xml"/> <!-- NEMO ocean dynamics -->
|
|
|
|
<field_definition src="./field_def_nemo-medusa.xml"/> <!-- NEMO ocean dynamics -->
|
|
|
|
|
|
|
|
<!-- Files definition -->
|
|
|
|
<file_definition src="./file_def_nemo-oce.xml"/> <!-- NEMO ocean dynamics -->
|
|
|
|
<file_definition src="./file_def_nemo-medusa.xml"/> <!-- NEMO ocean dynamics -->
|
|
|
|
|
|
|
|
<!-- Axis definition -->
|
|
|
|
<axis_definition src="./axis_def_nemo.xml"/>
|
|
|
|
|
|
|
|
<!-- Domain definition -->
|
|
|
|
<domain_definition src="./domain_def_nemo.xml"/>
|
|
|
|
|
|
|
|
<!-- Grids definition -->
|
|
|
|
<grid_definition src="./grid_def_nemo.xml"/>
|
|
|
|
|
|
|
|
|
|
|
|
</context>
|
|
|
|
```
|
|
|
|
* Update `namelist_top_cfg` : change ln_rsttr to .false. (we don't start MEDUSA from a restart file, you can if you want, but not at first, for that you'd need to extract the right vertical profile from a `restart_trc` file)
|
|
|
|
* Update `namelist_medusa_cfg` : ln_read_dust to .false. (I'd recommend to change that to `true` when you get MEDUSA 1D to run. you would need to extract the right location from forcing fields).
|
|
|
|
* Update `file_def_nemo-medusa.xml` : get the right output frequency. it is `1d` in `file_def_nemo-oce.xml`. you can keep the same or update to what you prefer.
|
|
|
|
1. Now we only miss the initial conditions and forcing. Fortunately these already exits for the `PAPA` location. you can get them by running in your config `EXP00` directory (which is the running directory in our test) :
|
|
|
|
```sh
|
|
|
|
wget https://zenodo.org/record/3386310/files/INPUTS_C1D_PAPA_v4.0.tar?download=1
|
|
|
|
tar xvf 'INPUTS_C1D_PAPA_v4.0.tar?download=1'
|
|
|
|
```
|
|
|
|
The namelist are already adapted for these forcing and initial fields.
|
|
|
|
1. In our test MEDUSA starts from constant values. you can change that by extracting the right profile from a trc restart file.
|
|
|
|
|
|
|
|
Now you can run with `./nemo`
|
|
|
|
|
|
|
|
## Running from 3D-extracted conditions.
|
|
|
|
|
|
|
|
### Prepare your running directory :
|
|
|
|
|
|
|
|
For this we'll use 3D initial conditions and forcings from UKESM1.1.
|
|
|
|
Let's make a new running directory :
|
|
|
|
* go to `cfgs/C1D_MED/`
|
|
|
|
* then :
|
|
|
|
```sh
|
|
|
|
# make a new running directory :
|
|
|
|
mkdir EXP_1D
|
|
|
|
cd EXP_1D
|
|
|
|
```
|
|
|
|
* Copy and run the appropriate `COPY_ME` bash script that will prepare you running directory for the 1D runs forced with UKESM1 :
|
|
|
|
```sh
|
|
|
|
cp ${SETTING_RUN_DIR}/COPY_ME__NEMOMED-4.2_1D_UKESM1_405.sh .
|
|
|
|
./COPY_ME__NEMOMED-4.2_1D_UKESM1_405.sh
|
|
|
|
```
|
|
|
|
|
|
|
|
### Extract the initial conditions and forcings
|
|
|
|
|
|
|
|
To run this 1D run, you want to extract the initial conditions and the forcings from a specific location. you need the coordinates (`latitude` and `longitude`) and well as the corresponding grid indices (i and j).
|
|
|
|
If you look in your `namelist_cfg` file, you'll find within `namc1d` an example of famous site coordinates to use :
|
|
|
|
```fortran
|
|
|
|
!-----------------------------------------------------------------------
|
|
|
|
&namc1d ! 1D configuration options (ln_c1d =T default: PAPA station)
|
|
|
|
!-----------------------------------------------------------------------
|
|
|
|
!! Localion name | real coords(lat-lon) | grid idices(j-i) | grid coords | bathy depth
|
|
|
|
!!OWS India (59.00N, -19.00E) (273, 269) (59.02N, -18.46E) 1516
|
|
|
|
!!PAP site (49.00N, -16.50E) (258, 272) (49.11N, -16.07E) 4888
|
|
|
|
!!BATS (31.67N, -64.17E) (236, 224) (32.07N, -64.52E) 4093
|
|
|
|
!!ESTOC (29.07N, -15.25E) (232, 273) (28.72N, -15.50E) 3513
|
|
|
|
!!OWS Papa (50.00N, -145.00E) (262, 142) (50.13N, -145.37E) 4290
|
|
|
|
!!HOTS (22.75N, -158.00E) (225, 130) (22.41N, -158.50E) 4688
|
|
|
|
!!Kerfix (-50.67N, 68.42E) (113, 357) (-50.70N, 68.50E) 1796
|
|
|
|
!! -- don't forget to run: ./subset_init_forcing.sh ${i} ${j} to get the local files.
|
|
|
|
!--------------------------------------------------------------------------
|
|
|
|
rn_lat1d = 50.0 ! Column latitude
|
|
|
|
rn_lon1d = -145.0 ! Column longitude
|
|
|
|
/
|
|
|
|
|
|
|
|
```
|
|
|
|
1. You need to update the `rn_lat1d` and `rn_lon1d` in this namelist. Here we use the coordinates of `PAPA`.
|
|
|
|
1. You also need to update the bathymetry depth in the `namusr_def` namelist in `namelist_cfg`.
|
|
|
|
To make things easier, each site bathy depth is given with the coordinates. Here we adapt for the PAPA site:
|
|
|
|
```fortran
|
|
|
|
!-----------------------------------------------------------------------
|
|
|
|
&namusr_def ! C1D user defined namelist
|
|
|
|
!-----------------------------------------------------------------------
|
|
|
|
rn_bathy = 4290. ! depth in meters
|
|
|
|
/
|
|
|
|
```
|
|
|
|
1. Then, you need to extract forcings and initial conditions. in your running dir you'll find subset_init_forcing.sh
|
|
|
|
Run this script by specifying the `i` and `j` indices to extract :
|
|
|
|
```sh
|
|
|
|
./subset_init_forcing.sh ${i} ${j}
|
|
|
|
|
|
|
|
## for example, to extract what we need for the PAPA site, type :
|
|
|
|
./subset_init_forcing.sh 142 262
|
|
|
|
```
|
|
|
|
|
|
|
|
There, all should be ready.
|
|
|
|
Then make sure
|
|
|
|
* `context.xml` use the correct xml files;
|
|
|
|
* The output frequency in the file*xml files match what you want,
|
|
|
|
* one last look at the namelists.
|
|
|
|
Here, all is ready to run 10y, with 5days frequency outputs.
|
|
|
|
|
|
|
|
Finally, to run :
|
|
|
|
```sh
|
|
|
|
sbatch hetjob_ORCA1
|
|
|
|
```
|
|
|
|
|
|
|
|
### Running in high latitudes.
|
|
|
|
|
|
|
|
The C1D configuration runs without the sea-ice model in. For some reason, maybe because the test case doesn't need it. But because of this, trying to run NEMO 1D in high latitudes will end with abnormally low temperature.
|
|
|
|
|
|
|
|
Here are the additional steps needed if you need to run with the ice model `ON`.
|
|
|
|
|
|
|
|
1. Add the sea-ice component.
|
|
|
|
for this : update `cfgs/work_cfgs.txt`
|
|
|
|
change our config line to be (add the `ICE` component) :
|
|
|
|
```
|
|
|
|
C1D_MED OCE TOP ICE
|
|
|
|
```
|
|
|
|
1. Add the sea-ice cpp key
|
|
|
|
If you remember, this is done in `cfgs/C1D_MED/cpp_C1D_MED.fcm`
|
|
|
|
add the `key_si3` key, it should be like :
|
|
|
|
```
|
|
|
|
bld::tool::fppkeys key_xios key_linssh key_top key_si3
|
|
|
|
```
|
|
|
|
1. Compile with the sea ice in:
|
|
|
|
Just compile the model again as previously done :
|
|
|
|
* from your `nemo` directory, run :
|
|
|
|
```sh
|
|
|
|
./makenemo -m X86_ARCHER2-Gnu_4.2 -r C1D_MED -j 16
|
|
|
|
```
|
|
|
|
1. Add the ice namelists
|
|
|
|
They should already be here, but if not you should be able to find both `namelist_ice_ref` and `namelist_ice_cfg` in `cfgs/ORCA2_ICE_PISCES/EXPREF` directory.
|
|
|
|
1. Activate the SI3 model at run time
|
|
|
|
Change `nn_ice` in `namelist_cfg` to 2.
|
|
|
|
If `nn_ice` is not in your `namelist_cfg` copy it from `namelist_ref` and add it in (make sure to add it in the correct namelist/section).
|
|
|
|
1. Include the ice xml files.
|
|
|
|
if they are not in your running directory yet, copy the `file_def_nemo-ice.xml` and `field_def_nemo-ice.xml` from the `cfgs/ORCA2_ICE_PISCES/EXPREF` directory, and include them in the `context.xml` file. it should look like this :
|
|
|
|
```xml
|
|
|
|
<!-- Fields definition -->
|
|
|
|
<field_definition src="./field_def_nemo-oce.xml"/> <!-- NEMO ocean dynamics -->
|
|
|
|
<field_definition src="./field_def_nemo-ice.xml"/> <!-- NEMO ocean dynamics -->
|
|
|
|
<field_definition src="./field_def_nemo-medusa.xml"/> <!-- NEMO-MEDUSA ocean biology -->
|
|
|
|
|
|
|
|
<!-- Files definition -->
|
|
|
|
<file_definition src="./file_def_nemo-oce.xml"/> <!-- NEMO ocean dynamics -->
|
|
|
|
<file_definition src="./file_def_nemo-ice.xml"/> <!-- NEMO ocean dynamics -->
|
|
|
|
<file_definition src="./file_def_nemo-medusa.xml"/> <!-- NEMO ocean biology -->
|
|
|
|
```
|
|
|
|
From there you should be ready to run 1D with the ice model activated. |
|
|
|
\ No newline at end of file |