EMC Training | Day 2 Adding a New Scheme to the CCPP > Add the scheme to CCPP

Add the scheme to CCPP

Once the CCPP scheme rftim is complete, it is time to add the scheme rftim.F90 and its prerequisite module_rftim_clima.F90 to the CCPP prebuild configuration in ccpp/config/ccpp_prebuild_config.py.

Hint: Follow the procedure outlined in talk day2_3_prebuild.ppt section “Modifying CCPP prebuild config”. Note that scheme rftim will be added to the “slow physics” group.  rftim.F90 goes in SCHEME_FILES and module_rftim_clima.F90 goes in SCHEME_FILES_DEPENDENCIES.

 

The next step is to create a new Suite Definition File and edit it so that it runs the scheme rftim just after the sfc_diag scheme:

cd ${YOUR_WORK_DIR}/NEMSfv3gfs_CCPP_training/develop

cp ccpp/suites/suite_FV3_GFS_2017_updated_gfdlmp.xml ccpp/suites/suite_FV3_GFS_2017_rftim.xml

Edit ccpp/suites/suite_FV3_GFS_2017_rftim.xml and

  • change the suite name to 'FV3_GFS_2017_rftim'
  • add the scheme "rftim" after sfc_diag.

Copy the development directory to a test directory and change into that directory:

   rsync -av ${YOUR_WORK_DIR}/NEMSfv3gfs_CCPP_training/develop/ ${YOUR_WORK_DIR}/NEMSfv3gfs_CCPP_training/compile/

   cd ${YOUR_WORK_DIR}/NEMSfv3gfs_CCPP_training/compile/tests

Compile the code (this example is for a dynamic build since the STATIC variable is not specified):

  • for bash shell:

  ./compile.sh $PWD/../FV3 theia.intel “CCPP=Y HYBRID=N” '' NO NO 2>&1 | tee compile.log

  • for t/csh shell:

  ./compile.sh $PWD/../FV3 theia.intel “CCPP=Y HYBRID=N” '' NO NO  |& tee compile.log

Hint 1: After HYBRID=NO, there is a double quote plus two single quotes.

Hint 2: In file compile.log, look for the following statement: INFO: CCPP prebuild step completed successfully. If not found, some problem occurred in the CCPP prebuild stage. If found, prebuild was successful and you can look at other messages in compile.log pertaining to prebuild.

If the entire prebuild and build process was successful, this creates an executable 'fv3.exe' in the same directory.

  • The compile.sh script takes up to 6 arguments. 

PATHTR BUILD_TARGET [ MAKE_OPT [ BUILD_NR ] [ clean_before ] [ clean_after ]

  • so, in the example command-line given above,
    • PATHTR = $PWD/../FV3
    • BUILD_TARGET = theia.intel
    • MAKE_OPT = "CCPP=Y HYBRID=N"
    • BUILD_NR (name of the fv3.exe executable) = null (so no additional string, just fv3.exe)
    • clean_before = NO
    • clean_after = NO

If successful, this creates an executable 'fv3.exe' in the same directory.