From 722710b69a1907b476c1b54488d60c7ca50fc7fd Mon Sep 17 00:00:00 2001 From: Courtney Peverley Date: Thu, 7 Nov 2024 15:56:05 -0700 Subject: [PATCH] update conversion documentation to reflect new atmos_phys directory structure --- docs/conversion/conversion-background.md | 2 +- docs/conversion/convert-portable-layer.md | 10 +++++----- docs/conversion/create-sdf.md | 2 +- docs/conversion/interstitials.md | 6 +++--- docs/conversion/walkthrough.md | 6 +++--- 5 files changed, 13 insertions(+), 13 deletions(-) diff --git a/docs/conversion/conversion-background.md b/docs/conversion/conversion-background.md index 18cb3d4..88d3eae 100644 --- a/docs/conversion/conversion-background.md +++ b/docs/conversion/conversion-background.md @@ -72,7 +72,7 @@ bin/git-fleximod update - Make a new directory for your parameterization within the atmospheric_physics submodule directory ``` -mkdir src/physics/ncar_ccpp/ +mkdir src/physics/ncar_ccpp/schemes/ ``` - Navigate into the atmospheric_physics submodule directory diff --git a/docs/conversion/convert-portable-layer.md b/docs/conversion/convert-portable-layer.md index 140a67c..56df61c 100644 --- a/docs/conversion/convert-portable-layer.md +++ b/docs/conversion/convert-portable-layer.md @@ -13,13 +13,13 @@ The portable module will most likely live in `$CAM/src/physics/cam` or `$CAM/src The driver code in each physics directory is `physpkg.F90`, which typically calls the CAM interface to the portable layer (often called `_cam.F90`), but also sometimes calls portable layer directly. Once you locate the core code that you will be converting, copy it into the new directory you created in the atmospheric_physics submodule directory: ``` -cp $CAM/src/physics//.F90 $CAM-SIMA/src/physics/ncar_ccpp/ +cp $CAM/src/physics//.F90 $CAM-SIMA/src/physics/ncar_ccpp/schemes/ ``` ## Optional: pre-split the module Many CAM schemes have more than one "run" or "tend" method contained within them. To split them into separate files and test them, do the following: -- In the atmospheric physics directory (`ncar_ccpp`), create a separate module for each piece which has a "run" or "tend" method. +- In the atmospheric physics directory (`ncar_ccpp/schemes/`), create a separate module for each piece which has a "run" or "tend" method. - An easy way to see what routines need to be separated out, is to look at the "use" statement(s) in `physpkg.F90` for your parametrization's module. If more than one routine is listed, you most likely will need to separate these out. - If there is shared, module-level data or shared subroutines which are called internally, put these all in a _common.F90 module. @@ -169,12 +169,12 @@ Make ESCOMP/atmospheric_physics and ESCOMP/CAM tags if substantial changes have - Do at the very least a sanity compilation and run using the ESCOMP/CAM code base - Delete the original module from src/physics/cam - - Use your pulled apart modules in atmos_phys/. + - Use your pulled apart modules in `atmos_phys/schemes/`. - In bld/configure in the ESCOMP/CAM source code, find the section "Add the CCPP'ized subdirectories". Add following line: ``` -print $fh "$camsrcdir/src/atmos_phys/\n"; +print $fh "$camsrcdir/src/atmos_phys/schemes/\n"; ``` - Modify code as needed until this modified code compiles and runs properly. -- If you want to benchmark your development to this point, you will need to open PRs to both NCAR/atmospheric_physics and ESCOMP/CAM. +- If you want to benchmark your development to this point, you will need to open PRs to both ESCOMP/atmospheric_physics and ESCOMP/CAM. Proceed to [2 - Create metadata](create-metadata.md) \ No newline at end of file diff --git a/docs/conversion/create-sdf.md b/docs/conversion/create-sdf.md index 2ee9460..08de636 100644 --- a/docs/conversion/create-sdf.md +++ b/docs/conversion/create-sdf.md @@ -1,7 +1,7 @@ # 5 - Create an SDF The **Suite Definition File (SDF)** tells the CCPP-Framework which schemes will be run in what order. For more, see [CCPP in CAM-SIMA](../design/ccpp-in-cam-sima.md) -- In `$CAM-SIMA/src/physics/ncar_ccpp`, create `suite_.xml`. This is your SDF! +- In `$CAM-SIMA/src/physics/ncar_ccpp/suites`, create `suite_.xml`. This is your SDF! - See the template below. You will need to select either `physics_before_coupler` or `physics_after_coupler` as your group name. ``` diff --git a/docs/conversion/interstitials.md b/docs/conversion/interstitials.md index 4de0283..25afa0b 100644 --- a/docs/conversion/interstitials.md +++ b/docs/conversion/interstitials.md @@ -6,8 +6,8 @@ An **interstitial** is a scheme that does calculations or variable modifications - In CAM, interstitial code will appear as either function calls or calculations/modifications in the CAM interface just before or just after the call to the parameterization - If the interstitial code is a function call, that function/module should be CCPP-ized (if not already) and that scheme will be included in the SDF - It the interstitial code is loose in the CAM interface, it is recommended that, when possible, that code be moved into the scheme (either the beginning or end of the scheme subroutine) - - UNLESS: it's a common (across multiple parameterizations) calculation/translation/modification. In which case, a new scheme should be created to do that calculation (scheme will live in `$CAM-SIMA/src/physics/ncar_ccpp/utilities`) - - If it is absolutely necessary to create a scheme-specific interstitial, that scheme should be called `_pre` or `_post` (depending on where in the SDF it will be placed) and will live in the `ncar_ccpp/` directory + - UNLESS: it's a common (across multiple parameterizations) calculation/translation/modification. In which case, a new scheme should be created to do that calculation (scheme will live in `$CAM-SIMA/src/physics/ncar_ccpp/schemes/utilities`) + - If it is absolutely necessary to create a scheme-specific interstitial, that scheme should be called `_pre` or `_post` (depending on where in the SDF it will be placed) and will live in the `ncar_ccpp/schemes/` directory This section covers a few interstitial scenarios you are likely to face. @@ -20,7 +20,7 @@ All `addfld`/`outfld` calls will go in a `_diagnostic.F90` int - See: [History Usage](../usage/history.md/#adding-a-diagnostic-field-to-the-cam-sima-source-code) for the specifications of the CAM-SIMA-versions of `addfld` and `outfld` calls ## Utilities -As mentioned, there are some calculations/conversions/translations that are performed often throughout the physics code in CAM. These schemes are available for use in the `$CAM-SIMA/src/physics/ncar_ccpp/utilities` directory and include: +As mentioned, there are some calculations/conversions/translations that are performed often throughout the physics code in CAM. These schemes are available for use in the `$CAM-SIMA/src/physics/ncar_ccpp/schemes/utilities` directory and include: - **state_converters.F90**: contains common conversions/calculations of [state variables](../design/ccpp-in-cam-sima.md/#state-and-tendency-variables), including these schemes: diff --git a/docs/conversion/walkthrough.md b/docs/conversion/walkthrough.md index d77ed51..f7e72e0 100644 --- a/docs/conversion/walkthrough.md +++ b/docs/conversion/walkthrough.md @@ -35,8 +35,8 @@ git branch ccppize-lunar-tides ESCOMP/development git checkout ccppize-lunar-tides git push -u bugsy9236 ccppize-lunar-tides bin/git-fleximod update -mkdir src/physics/ncar_ccpp/lunar_tides -cp ../CAM/src/physics/cam/lunar_tides.F90 src/physics/ncar_ccpp/lunar_tides/ +mkdir src/physics/ncar_ccpp/schemes/lunar_tides +cp ../CAM/src/physics/cam/lunar_tides.F90 src/physics/ncar_ccpp/schemes/lunar_tides/ cd src/physics/ncar_ccpp git remote add bugsy9236 https://github.com/bugsy9236/atmospheric_physics git fetch bugsy9236 @@ -592,7 +592,7 @@ He then populates the generated metadata template (`lunar_tides.meta`) with the Bug will revisit the missing standard names when he hears back from the other CAM SEs/scientists about what the names should be. ## 4 - Create namelist XML file -Bug creates the following namelist xml file (called `lunar_tides_namelist.xml`) in the `ncar_ccpp/lunar_tides` directory. It contains one entry - for `apply_lunar_tides` +Bug creates the following namelist xml file (called `lunar_tides_namelist.xml`) in the `ncar_ccpp/schemes/lunar_tides` directory. It contains one entry - for `apply_lunar_tides` ```