4). The types introduced in version 8_0 are used to simplify the writing of several subroutines of the code.

1). The module MODD_ISBAn is divided into 5 types:

  • ISBA_OPTIONS_t: contains all the optional choices for the model.
  • ISBA_S_t: fields defined independently of the ISBA patch and that are not packed for each ISBA patch, during the run. Ex: XZS, XCOVER.
  • ISBA_K_t: fields defined independently of the ISBA patch but that are packed for each ISBA patch, during the run. Ex: XSAND, XWSAT.
  • ISBA_P_t: fields defined for each ISBA patch and that are packed for each ISBA patch during the run. Ex: XDG, XC1SAT.
  • ISBA_PE_t: fields defined for each ISBA patch and for each TEB patch, and that are packed for each ISBA patch, during the run. Ex: XTG, XLAI.

2). The modules containing variables defined for both each ISBA patch and the tile nature are transformed:

  • the main or simple type contains the variables without the PATCH dimension
  • we define an "over-type" of this simple type, composed of an array of objects of this simple type, that will be allocated with dimension NPATCH.
    => each variable is declared only one time in the simple type.
  • For each element in this over-type, each variable is allocated directly with the size of the corresponding ISBA patch:
    • the operations PACK/UNPACK at each time step of the model, complicated to maintain and expensive in calculation time, are suppressed.
    • Some operations related to diagnostics, that lead to duplicate many fields, are suppressed.
  • Impacted modules:
    • modd_isban.F90,modd_ch_isban.F90, modd_gr_biogn.F90
    • modd_diag_isban.F90, modd_diag_evap_isban.F90, modd_diag_misc_isban.F90
    • modd_gridn.F90, modd_sson.F90

3). Writing norms associated to these changes :

  • the over-type ISBA or TEB for a simple type TYPE_t is named TYPE_NP_t. The array of types TYPE_t in this over-type is named AL.
  • The declared objects of an ISBA over-type, for an ISBA type "YT", are named "NYT".
  • When, in a subroutine, the argument is an element of an ISBA over-type named "NYT", this argument is named "YTK".

4). Consequences of these changes:

  • For the types containing variables that can be used "packed" on ISBA patches and/or not packed, the ISBA_MODEL type thus contains two declarations associated to this type: the simple type (fields aggregated on patches) and the over-type (fields by patches).
    Example: ISBA_MODEL_t contains an object of ISBA_K_t type and an object of type ISBA_NK_t.
  • The types associated to ISBA are directly used by GARDEN and GREENROOF and replace the specific GARDEN and GREENROOF types from V8_0 of SURFEX (modd_teb_gardenn.F90, modd_teb_greenroofn.F90, etc).
  • Same way, some types duplicated in the different surface types are merged in one only type:
    • modd_isba/teb/watflux/seaflux/flake_grid_n => modd_grid_n
    • modd_isba/teb/watflux/seaflux/flake_canopy/sbl_n => modd_canopy_n
    • modd_diag_isba/teb/watflux/seaflux/flake_n => modd_diag_n
  • These merges allow to also merge certain subroutines duplicated in the different surface types, for the object given in argument is now of the same type.
    Examples:
    • prep_isba/teb/watflux/seaflux/flake_canopy/sbl.F90 => prep_sbl.F90
    • garden/greenroof_properties.F90 => teb_veg_properties.F90
    • etc.
  • The initialization fields that need to be packed for each ISBA patch are now packed at the end of the INIT step. Fields that need to be unpacked are only unpacked at each item of the writing of the output fields.
  • When a subroutine has many arguments from one only type, the type is given in argument instead of all its objects, in order to simplify the calls to this subroutine.
  • For TEB in particular:
    • The subroutine diag_misc_tebn.F90 is removed because it only duplicates arrays.
    • The diagnostics arrays are directly used in teb_garden.F90.
    • Only cumul_diag_tebn.F90 is kept, to add up the fields.
    • for GARDEN and GREENROOF, the types of ISBA are used for the diagnostics, so a subroutine diag_teb_veg_initn.F90 is created.

An external pdf document explains these changes: