Changes between Version 23 and Version 24 of Documentation


Ignore:
Timestamp:
2012-09-12T10:25:09+02:00 (12 years ago)
Author:
dsolyga
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Documentation

    v23 v24  
    3131 
    3232 
    33 == Technical Documentation == 
    3433 
    35 === How to understand the operations performed on the variables when written in the history files === 
    36  '''1. IOIPSL/src/histcom.f90'''[[BR]] 
    37  
    38 First read more about the IOIPSL module that manages the history files here: 
    39 http://www.ipsl.jussieu.fr/~ioipsl/WWW2/index.html 
    40  
    41 The main information __useful for ORCHIDEE__ is reproduced below:[[BR]] 
    42  
    43 ''histdef'': The variables which will be written are declared and the following information is passed: 
    44  * name of variable 
    45  * title  
    46  * units  
    47  * size of the variable  
    48  * '''operation to be carried out on the variable before writing it''' 
    49  * frequency at which the operations need to be done (positive values are in units of seconds and negative values are in units of month)  
    50  * frequency at which the resulting data need to be written into the file(positive values are in units of seconds and negative values are in units of month)  
    51  
    52 '''Allowed operations'''[[BR]] 
    53  
    54 In ''histdef'' the user may specify for each field that is going to be archived a number of operations. 3 types may be distinguished: Vector operations, vector-scalar operations and index operations on the vector. In the description of the operations to be carried out the vector will be represented by x. For instance a gather operation will be written "gather(x)". It must be noted that the indexing operations will use as index vector the one passed to histwrite. On top of this a time operation has to be chosen. There only one is allowed and it should be outer most operator. For instance the time averaging of the gather operation will be written as "ave(gather(x))". 
    55  
    56  * Allowed time operations: 
    57 ||ave||time average of the field|| 
    58 ||inst||instantaneous values of the field is going to be written|| 
    59 ||t_min||the minimum value over the time period is going to be archived|| 
    60 ||t_max||the maximum value over the time period is going to be archived|| 
    61 ||t_sum||sums the variable over time|| 
    62 ||once||the field is written once on the file without any time axis|| 
    63 ||never||the field is never written|| 
    64  
    65  * Allowed vector operations:[[BR]] 
    66 Usage: cels(x) 
    67 ||cels||transforms the field into degrees Celsius|| 
    68  
    69  * Allowed vector-scalar operations:[[BR]] 
    70 Usage: scal*x 
    71 ||*||multiplication|| 
    72  
    73  * Allowed indexing operations:[[BR]] 
    74 Usage: gather(x) 
    75 ||gather||Gathers from the input data all the points listed in index and puts them onto the file. Other points in the resulting array are going to labeled as missing. This operation could be used to reduce the resolution of  the history file.|| 
    76 ||scatter||Scatters from the input data onto the points which are listed in the index. Other points are going to be labeled as missing. This is used for instance to put a variable only available over oceans onto a global grid.|| 
    77  
    78 Examples:[[BR]] 
    79  * ave(scatter(cels(X)): Will average the variables (temperature for instance) in celsius and scatter it onto the grid. This could be used in an ocean model where all grid points are in a vector and cover only ocean points. Thus in the history file you will have the field placed correctly on the map. 
    80  * ave(max(cels(x),0.)): Average over time only the temperature (if that is the variable in Kelvin) which are above 0. 
    81  * t_max(X): Computes the maximum over the time between two writes of the variable. 
    82  
    83  
    84  '''2. src_sechiba/intersurf.f90'''[[BR]] 
    85  
    86 The ''histdef'' calls are made in the ''intsurf_history'' subroutine for the sechiba history file and similarly in the ''stom_define_history'' subroutine for the stomate history file. 
    87  
    88 Characters strings are first declared to perform units conversion for fluxes: 
    89  
    90 {{{ 
    91 !! Operations to be performed on fluxes 
    92 CHARACTER(LEN=30)   :: flux_op      
    93 !! Operations which do not include a scatter                
    94 CHARACTER(LEN=30)   :: flux_sc     
    95 !! Operation in seconds                 
    96 CHARACTER(LEN=30)   :: flux_insec, flux_scinsec  
    97 }}} 
    98    
    99  
    100 The history level will determine the number of output variables: 
    101  
    102 {{{ 
    103 !! history output level (default is 10 => maximum output) 
    104 INTEGER(i_std)     :: hist_level  
    105 }}} 
    106  
    107 The following strings arrays will contain the operation to perform from 1 to hist_level and contain ‘never’ from hist_level to 10, meaning there is nothing to do (the variable is not written in the history file). 
    108  
    109 {{{ 
    110 !! The various operations to be performed 
    111 CHARACTER(LEN=40),DIMENSION(max_hist_level) :: & 
    112          & ave, avecels, avescatter, fluxop, & 
    113          & fluxop_scinsec, tmincels, tmaxcels, once, sumscatter   
    114 }}} 
    115  
    116 For fluxes, the operation is written as a string with IOIPSL operators including a multiplication by the number required to obtain the desired output unit: 
    117  
    118 {{{ 
    119 WRITE(flux_op,'("ave(scatter(X*",F8.1,"))")') one_day/dt 
    120 WRITE(flux_sc,'("ave(X*",F8.1,")")') one_day/dt 
    121 WRITE(flux_insec,'("ave(X*",F8.6,")")') un/dt 
    122 WRITE(flux_scinsec,'("ave(scatter(X*",F8.6,"))")') un/dt 
    123 }}} 
    124  
    125 Reading of the chosen history level from the run.def file: 
    126  
    127 {{{ 
    128 !Config  Key  = SECHIBA_HISTLEVEL 
    129 !Config  Desc = SECHIBA history output level (0..10) 
    130 !Config  Def  = 5 
    131 !Config  Help = Chooses the list of variables in the history file.  
    132 !Config         Values between 0: nothing is written; 10: everything is  
    133 !Config         written are available More details can be found on the web under documentation. 
    134 !Config         web under documentation. 
    135 hist_level = 5 
    136 CALL getin_p('SECHIBA_HISTLEVEL', hist_level) 
    137 }}} 
    138  
    139  
    140  
    141 {{{ 
    142 !- define operations as a function of history level. 
    143 !- Above hist_level, operation='never' 
    144 ave(1:max_hist_level) = 'ave(X)' 
    145 IF (hist_level < max_hist_level) THEN 
    146        ave(hist_level+1:max_hist_level) = 'never' 
    147 ENDIF 
    148 sumscatter(1:max_hist_level) = 't_sum(scatter(X))' 
    149 IF (hist_level < max_hist_level) THEN 
    150        sumscatter(hist_level+1:max_hist_level) = 'never' 
    151 ENDIF 
    152 avecels(1:max_hist_level) = 'ave(cels(X))' 
    153 IF (hist_level < max_hist_level) THEN 
    154        avecels(hist_level+1:max_hist_level) = 'never' 
    155 ENDIF 
    156 avescatter(1:max_hist_level) = 'ave(scatter(X))' 
    157 IF (hist_level < max_hist_level) THEN 
    158        avescatter(hist_level+1:max_hist_level) = 'never' 
    159 ENDIF 
    160 tmincels(1:max_hist_level) = 't_min(cels(X))' 
    161 IF (hist_level < max_hist_level) THEN 
    162        tmincels(hist_level+1:max_hist_level) = 'never' 
    163 ENDIF 
    164 tmaxcels(1:max_hist_level) = 't_max(cels(X))' 
    165 IF (hist_level < max_hist_level) THEN 
    166        tmaxcels(hist_level+1:max_hist_level) = 'never' 
    167 ENDIF 
    168 fluxop(1:max_hist_level) = flux_op 
    169 IF (hist_level < max_hist_level) THEN 
    170        fluxop(hist_level+1:max_hist_level) = 'never' 
    171 ENDIF 
    172 fluxop_scinsec(1:max_hist_level) = flux_scinsec 
    173 IF (hist_level < max_hist_level) THEN 
    174        fluxop_scinsec(hist_level+1:max_hist_level) = 'never' 
    175 ENDIF 
    176 once(1:max_hist_level) = 'once(scatter(X))' 
    177 IF (hist_level < max_hist_level) THEN 
    178        once(hist_level+1:max_hist_level) = 'never' 
    179 ENDIF 
    180 }}} 
    181  
    182  
    183 If for example ''hist_lev''=5, for a variable with a corresponding ''histdef'' call containing ''operator''(6), ''operator''(6) is ‘never’ and the variable won’t appear in the history file. For another variable with a corresponding ''histdef'' call containing ''operator''(4), the variable will be processing according to the ''operator'' definition and written in the history file.[[BR]] 
    184  
    185  
    186  
    187 Example:[[BR]] 
    188  
    189 ALMA convention [[BR]] 
    190  
    191 Here we divide per dt to get per seconds: 
    192  
    193  
    194 {{{ 
    195 CALL histdef(hist_id, 'Evap', 'Total Evapotranspiration', 'kg/m2/s', &  
    196            & iim,jjm, hori_id, 1,1,1, -99, 32, fluxop_scinsec(1), dt, dw)  
    197 }}} 
    198  
    199 NOT ALMA [[BR]] 
    200  
    201 Here we multiply per one_day/dt to get per days:  
    202  
    203 {{{ 
    204 CALL histdef(hist_id, 'evap', 'Evaporation', 'mm/d', &  
    205            & iim,jjm, hori_id, 1,1,1, -99, 32, fluxop(1), dt, dw)  
    206 }}} 
    207