Changes between Version 3 and Version 4 of Documentation/UserGuide/VariableHistory
- Timestamp:
- 05/26/14 08:09:18 (7 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Documentation/UserGuide/VariableHistory
v3 v4 1 1 = How to add a variable to history.nc = 2 2 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 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 ( or another HowTo, http://forge.ipsl.jussieu.fr/orchidee/wiki/HowTo/HistoryOperators) 4 5 The 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 7 The 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 }}} 4 46 47 Your 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 5 49 {{{ 6 50 ! total living biomass … … 12 56 }}} 13 57 14 When the variable has the value that need to written to the history file add a statement to the one below 58 Once 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 15 61 {{{ 16 62 CALL histwrite (hist_id_stomate, 'FRUIT_M', itime, & 17 63 biomass(:,:,ifruit), npts*nvm, horipft_index) 18 64 }}} 65 66 There 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.