Change horizontal domain - nick-klingaman/mckpp GitHub Wiki
Changing the horizontal domain
You will need to add a new horizontal MC-KPP horizontal domain if you want to:
- Reduce or enlarge the horizontal domain over which the model runs, keeping the horizontal resolution the same.
- Run at a new horizontal resolution
Note that you do not necessarily need to change the horizontal domain if you are changing the coupling region , because MC-KPP can run over a domain that is larger than the domain over which it is coupled to the atmosphere. Changing the horizontal domain can be cumbersome, so it is not recommended unless you need to do it.
Until MC-KPP supports MPI-based parallelism, we cannot support near-global coupling at resolutions beyond N216 due to HPC memory limitations. Thus, for resolutions beyond N216, reducing the MC-KPP horizontal domain to the minimum required for the desired coupling region is an effective way to reduce memory requirements and ensure the model can run efficiently.
Creating a new MC-KPP parameter.inc file
The MC-KPP horizontal domain is defined at compile time. Thus, modifying it requires modifying the source code, particularly the parameter.inc file. You will need to:
- Check out the MC-KPP source code from puma (see documentation ). Checking out the code from GitHub will not work unless your Rose suite can pull the MC-KPP source code from GitHub or from your local working copy.
- Copy one of the existing
parameter.inc.*files to a new file that describes your domain. The typical pattern isparameter.inc.[resolution]_[domain], for exampleparameter.inc.n512e_tropics. - Edit this new file to modify the following parameters:
NXis the number of gridpoints in the MC-KPP domain in the x directionNYis the number of gridpoints in the MC-KPP domain in the y directionNX_GLOBEis the number of gridpoints globally in the x direction (i.e., the MetUM global longitude grid)NY_GLOBEis the number of gridpoints globally in the y direction (i.e., the MetUM global latitude grid)
- Add your new file to the repository with
svn add [file]and commit your changes to the puma repository.
Modifying the MetUM-GOML Rose suite
Starting from one of the standard MetUM-GOML Rose suites , you will need to
-
In
rose_suite.conf
a. ChangeKPP_DOMAINin to the name you gave your [domain] in the step above. The name must match so that FCM can find the correct parameter.inc file when compiling MC-KPP.
b. Ensure thatKPP_RESOLUTIONis set to the [resolution] you used in the step above. Normally, this is the same as the MetUM atmospheric resolution. If you use the GUI Rose suite editor, yourKPP_DOMAIN(and possiblyKPP_RESOLUTION) will not be available as choices insuite conf --> Build and run. You can add these as choices by editingmeta/rose-meta.conf. -
Under
coupled -> namelist -> KPP Namelist -> Horizontal and Vertical Domain(or in theNAME_DOMAINsection ofapp/coupled/rose-app.conf):
a. Changealatandalonto the first (southernmost) latitude and first longitude (from east to west) of the domain over which you want to run KPP. Recall that this is not necessarily the same domain as the region in which you want to couple MC-KPP to the atmosphere.
b. Ensure thatdelta_latanddelta_lonare correct for your horizontal resolution. If you are not changing the MC-KPP horizontal resolution from the resolution already configured in the suite, you do not need to change these settings. -
Under
coupled -> namelist -> KPP Namelist -> Coupling Controls(or in theNAME_COUPLEsection ofapp/coupled/rose-app.conf):
a. Changeifirstandilastto the indices of the first (smallest longitude in degrees east) and last (largest longitude in degrees east) coupled gridpoints on the atmospheric grid. Note that MC-KPP is written in Fortran, so these indices are 1-based. Note that these are the indices on the atmospheric grid, not the indices on your MC-KPP domain.
b. Similarly, changejfirstandjlastto the indices of the first (southernmost) and last (northernmost) coupled gridpoints on the atmospheric grid. -
Ensure that all of the MC-KPP ancillary files you need to use include data for all points within your domain. The ancillary files can include data outside your domain; MC-KPP will slice out your domain accordingly.
Once you have completed the above steps, you should be ready to run a MetUM-GOML simulation with your new KPP horizontal domain.