Skip to content

BasicTrunkTestIntro

JhanSrbinovsky edited this page Jan 6, 2015 · 1 revision

Basic Prerequisite Technical Test for Trunk Admission

It is obviously desirable to maintain a model for which at any time results are reproducible. It is similarly desirable to be able to attribute any change in the results to a particular change in the model. This can be efficiently achieved by the use of switches in the code.

At present it is preferable to declare switches as additions to TYPE cable_user. Shown below is an existing code snippet from cable_common.F90@[2620]. Where .. represent omitted lines.

   TYPE kbl_user_switches
      ..
      LOGICAL ::                                                               &
         INITIALIZE_MAPPING = .FALSE., & !
         ..
         L_NEW_RUNOFF_SPEED    = .FALSE., & !
         L_NEW_REDUCE_SOILEVP  = .FALSE.!

   END TYPE kbl_user_switches  
  
   TYPE(kbl_user_switches), SAVE :: cable_user

This should be edited to include your new switch:

   TYPE kbl_user_switches
      ..
      LOGICAL ::                                                               &
         INITIALIZE_MAPPING = .FALSE., & !
         ..
         L_NEW_RUNOFF_SPEED    = .FALSE., & !
         L_NEW_REDUCE_SOILEVP  = .FALSE., &!
         L_NEW_SWITCH  = .FALSE.    !

   END TYPE kbl_user_switches  
  
   TYPE(kbl_user_switches), SAVE :: cable_user

The switch should be set to .FALSE. by default. The cable_user TYPE is already declared in the NAMELIST and so can be set to .TRUE. in cable.ml by adding the line

   cable_user% L_NEW_SWITCH  = .TRUE. 

Then, so long as you make sure to

   USE  cable_common_module, ONLY : cable_user

wherever your developments appear, and bracket those developments logically, with for e.g.

   IF (cable_user% L_NEW_SWITCH ) CALL my_devlopment()

Then developments can readily be switched on and off. Without reverting to an earlier trunk revision or re-building.

A prerequisite to a development being pushed to the trunk is that it can be effectively switched off. There are clearly examples where it is not possible or necessary to include switches to maintain reproducibility. However it is ultimately the developers responsibility to ensure that it can.

Please see [BasicTrunkTestTech here], for details of how we simply assess this reproducibility.

Clone this wiki locally