Changes between Version 3 and Version 4 of Documentation/UserGuide/VariableHistory


Ignore:
Timestamp:
05/26/14 08:09:18 (7 years ago)
Author:
mmcgrath
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Documentation/UserGuide/VariableHistory

    v3 v4  
    11= How to add a variable to history.nc = 
    22 
    3 Define the variable in intersurf.f90, check whether the correct operators (i.e. ave) and history level i.e. (4) are defined more information on 'histdef' and 'histwrite' can be found on the documentation page of this wiki 
     3Define the variable in intersurf.f90, check whether the correct operators (i.e. ave) and history level i.e. (4) are defined more information on 'histdef' and 'histwrite' can be found on the documentation page of this wiki ( or another HowTo, http://forge.ipsl.jussieu.fr/orchidee/wiki/HowTo/HistoryOperators) 
     4 
     5The first big question is where to put the histdef.  It goes in intersurf, but there are five possible places for it.  The questions you need to ask yourself are: 1) Is this a stomate or sechiba variable? 2) If it is sechiba, do I want to write it to the high frequency file or just the regular file (only a few variables should, in theory, be written to the HF file)? 3) Is this variable part of the ALMA convention or not (if you're not sure, the answer is probably "no")? 
     6 
     7The basic structure of intersurf for defining variables is 
     8 
     9{{{ 
     10  SUBROUTINE intsurf_history 
     11 
     12  ! Writing to the main history file, file id hist_id 
     13         IF ( .NOT. almaoutput ) THEN 
     14 
     15              ... a few hundred lines of histdefs 
     16 
     17          ELSE 
     18 
     19              ... a few hundred lines of histdefs 
     20 
     21          ENDIF 
     22 
     23    ! Writing to the HF file, file ID hist2_id 
     24        IF ( .NOT. almaoutput ) THEN 
     25 
     26              ... a few hundred lines of histdefs 
     27 
     28          ELSE 
     29 
     30              ... a few hundred lines of histdefs 
     31 
     32          ENDIF 
     33 
     34! Writing to the STOMATE history file 
     35      CALL stom_define_history 
     36 
     37  END SUBROUTINE 
     38 
     39  SUBROUTINE stom_define_history 
     40 
     41    ... a few hundred lines of histdefs 
     42 
     43  END SUBROUTINE 
     44 
     45}}} 
    446  
     47Your histdef should go in one of those five places based on how you answered the three questions above, and will look something like this. 
     48 
    549{{{  
    650! total living biomass 
     
    1256}}} 
    1357 
    14 When the variable has the value that need to written to the history file add a statement to the one below 
     58Once you have done that (making sure to use the correct file ID for the section, as well as the correct axes IDs, write frequency (dw, dw2, or hist_dt), and operation array (for the HF file, the operation arrays are followed by 2), you have to write out the variable with a histwrite somewhere in the other routines.  Make sure that the histwrite and histdef have the same file ID (you will get an error if you try to write a variable to a file for which it has not been defined), and also make sure that it appears either in the same almaoutput branch that you defined it in (if you define it in the IF statement where almaoutput is TRUE but write it surrounded by an IF statement that checks if almaoutput is FALSE, you will not see it in the history file). 
     59 
     60 
    1561{{{  
    1662CALL histwrite (hist_id_stomate, 'FRUIT_M', itime, & 
    1763         biomass(:,:,ifruit), npts*nvm, horipft_index) 
    1864}}} 
     65 
     66There also seems to be a convention that if you are defining a variable for ALMA output, the first letter is a capital letter, and otherwise it is lowercase.  I do not know this for a fact, but it seems to be that way in the code.