| 1 | |
| 2 | = HOWTO install/compile/run ORCHIDEE-CN-P for offline use with libIGCM. == |
| 3 | This howto is based on the information which can be found in the ORCHIDEE wiki regarding the trunk version of ORCHIDEE. |
| 4 | Please check the wiki for information regarding the respective commands listed here. |
| 5 | ---- |
| 6 | ---- |
| 7 | == 1. install libIGCM & ORCHIDEE-CN-P == |
| 8 | === 1.1 where to install === |
| 9 | You should install the model NOT in the home directory; it is even too small to handle diagnostics like "out_execution" or "out_orchidee". |
| 10 | You can use , for example, your work directory: |
| 11 | curie: |
| 12 | {{{ |
| 13 | /ccc/work/cont003/dsm/<userID> |
| 14 | }}} |
| 15 | or project storage; here example for the IMBALANCE-P project on obelix: |
| 16 | {{{ |
| 17 | /home/surface3/dgoll |
| 18 | }}} |
| 19 | === 1.2 install libIGCM & trunk ORCHIDEE === |
| 20 | {{{ |
| 21 | svn co http://forge.ipsl.jussieu.fr/igcmg/svn/modipsl/trunk modipsl |
| 22 | cd modipsl/util |
| 23 | ./model ORCHIDEE_trunk |
| 24 | }}} |
| 25 | |
| 26 | === 1.3 Exchange the trunk ORCHIDEE with ORCHIDEE-CN-P === |
| 27 | {{{ |
| 28 | cd ../modeles |
| 29 | rm -fr ORCHIDEE |
| 30 | svn co svn://forge.ipsl.jussieu.fr/orchidee/branches/ORCHIDEE-CN-P ORCHIDEE |
| 31 | cd ../util ; ./ins_make |
| 32 | }}} |
| 33 | |
| 34 | ---- |
| 35 | ---- |
| 36 | |
| 37 | == 2. Compile ORCHIDEE == |
| 38 | === 2.1 modify IOIPSL === |
| 39 | adjust IOIPSL to be able to write more variables into the output by increase the value of max_var by 50 in ../modeles/IOIPSL/src/restcom.f90 |
| 40 | {{{ |
| 41 | & max_var=550, max_file=50, max_dim=NF90_MAX_VAR_DIMS |
| 42 | }}} |
| 43 | === 2.2 compile orchidee === |
| 44 | ==== A: on obelix ==== |
| 45 | {{{ |
| 46 | cd ../modeles/ORCHIDEE |
| 47 | }}} |
| 48 | First do a "normal" make to compile XIOS & IPOSL components which are needed; don't worry if the compilation of ORCHIDEE crashes |
| 49 | {{{ |
| 50 | make |
| 51 | }}} |
| 52 | then compile (do compile always with "-parallel mpi" as this executable can be run in sequential mode, too. But not vice versa) |
| 53 | {{{ |
| 54 | ./makeorchidee_fcm -driver -arch ifort_LSCE -noxios -parallel mpi |
| 55 | }}} |
| 56 | ==== B: on curie ==== |
| 57 | WARNING: before you do anything on curie; make sure you have copied the p86ipsl login environment to your home |
| 58 | according to [https://forge.ipsl.jussieu.fr/igcmg_doc/wiki/DocBenvBtgcc]: |
| 59 | {{{ |
| 60 | cp ~p86ipsl/.bashrc_curie ~/. |
| 61 | cp ~p86ipsl/.bash_profile ~/. |
| 62 | }}} |
| 63 | |
| 64 | |
| 65 | Then compile the standard way: |
| 66 | {{{ |
| 67 | cd ../config/ORCHIDEE_OL |
| 68 | gmake without_xios |
| 69 | }}} |
| 70 | |
| 71 | |
| 72 | Optional: I usually re-compile ORCHIDEE again with makeorchidee_fcm to set options (don't forget to disable xios): |
| 73 | {{{ |
| 74 | cd ../../modeles/ORCHIDEE |
| 75 | ./makeorchidee_fcm -driver -parallel mpi -arch X64_CURIE -driver -noxios |
| 76 | }}} |
| 77 | |
| 78 | ---- |
| 79 | ---- |
| 80 | |
| 81 | == 3. Run ORCHIDEE == |
| 82 | There are different setups possible with libIGCM. Please check the documentation of libIGCM for more information, here I just tell you what you need to do. |
| 83 | |
| 84 | === 3.1 SPINUP_ANALYTIC === |
| 85 | ==== 3.1.1 create new experiment folder ==== |
| 86 | {{{ |
| 87 | cd ../../config/ORCHIDEE_OL/ |
| 88 | cp -fr SPINUP_ANALYTIC/ MY_SPINUP_ANALYTIC/ |
| 89 | cd MY_SPINUP_ANALYTIC/ |
| 90 | }}} |
| 91 | ==== 3.1.2 tell libIGCM about the new input files (write me an email if you need them) ==== |
| 92 | modify the variable "ListNonDel" in COMP/stomate.card: |
| 93 | {{{ |
| 94 | ListNonDel= (${R_IN}/SRF/reftemp.nc, .), \ |
| 95 | (/home/scratch01/dgoll/ORCHIDEE/ORC-CNP/simulations/simple_forcing_DSG/USDA_SoilSuborder.nc, .), \ |
| 96 | (/home/scratch01/dgoll/ORCHIDEE/ORC-CNP/simulations/simple_forcing_DSG/lithology.nc, .), \ |
| 97 | (/home/scratch01/dgoll/ORCHIDEE/ORC-CNP/simulations/simple_forcing_DSG/deposition.nc, .) |
| 98 | }}} |
| 99 | WARNING: the deposition file is a static field at the moment; it does not include N deposition either. At the moment N deposition is set to P deposition in the ORCHIDEE code. Anyway N deposition is not accounted for in the calculations for the N & P cycle for now. |
| 100 | |
| 101 | tell that we use the new “soil_param.nc”; in COMP/sechiba.card: |
| 102 | {{{ |
| 103 | (/home/scratch01/dgoll/ORCHIDEE/ORC-CNP/simulations/simple_forcing_DSG/soils_param.nc, .), \ |
| 104 | }}} |
| 105 | ==== 3.1.3 adjust the libIGCM ==== |
| 106 | |
| 107 | disable XIOS in COMP/orchidee_ol.card |
| 108 | {{{ |
| 109 | # Use XIOS as output library instead of IOIPSL |
| 110 | XIOS=n |
| 111 | }}} |
| 112 | disable XIOS in PARAM/run.def |
| 113 | {{{ |
| 114 | # Use XIOS for writing diagnostics file |
| 115 | # defulat = n |
| 116 | XIOS_ORCHIDEE_OK = n |
| 117 | }}} |
| 118 | set the IO frequency to avoid crashes in PARAM/run.def |
| 119 | {{{ |
| 120 | # Writefrequency in seconds in sechiba_history.nc |
| 121 | # default = 86400.0 |
| 122 | WRITE_STEP = 1800.0 |
| 123 | |
| 124 | # Writefrequency in days in stomate_history.nc |
| 125 | # default = 10. |
| 126 | STOMATE_HIST_DT = 1 |
| 127 | }}} |
| 128 | |
| 129 | add the new flags for the nutrient cycles in PARAM/run.def: |
| 130 | {{{ |
| 131 | # to activate P cycle set =y |
| 132 | STOMATE_OK_PCYCLE=y |
| 133 | # to activate N cycle set =y |
| 134 | STOMATE_OK_NCYCLE=y |
| 135 | # make sure we dont fake |
| 136 | LD_FAKE_HEIGHT=n |
| 137 | # you can enable mass conservation and stoichiometry checks by =y |
| 138 | STOMATE_MASS_CONSERVATION=y |
| 139 | STOMATE_DSG_DEBUG=y |
| 140 | }}} |
| 141 | in addition you should add all the PFT and soil parameter values as set in |
| 142 | /home/users/dgoll/ORCHIDEE/DEFS_n_CARDS/run.def |
| 143 | |
| 144 | disable river routing if you run on non-global scale in run.def |
| 145 | {{{ |
| 146 | # Activate river routing |
| 147 | RIVER_ROUTING = n |
| 148 | }}} |
| 149 | |
| 150 | |
| 151 | ==== 3.1.4 adjust the job as usual ==== |
| 152 | modify config.card as usual (see wiki) |
| 153 | |
| 154 | modify run.def as usual (see wiki) |
| 155 | plus |
| 156 | if you want to archive, for example in the IMBALANCE-P storage; add to config.card: |
| 157 | {{{ |
| 158 | ARCHIVE=/home/surface3/dgoll |
| 159 | }}} |
| 160 | |
| 161 | ==== 3.1.5 create job ==== |
| 162 | {{{ |
| 163 | ../../../libIGCM/ins_job |
| 164 | }}} |
| 165 | |
| 166 | ==== 3.1.6 adjust job_file (optional) ==== |
| 167 | |
| 168 | Header to run a site scale simulation on obelix |
| 169 | {{{ |
| 170 | ###################### |
| 171 | ## OBELIX LSCE ## |
| 172 | ###################### |
| 173 | #PBS -N test |
| 174 | #PBS -m a |
| 175 | #PBS -j oe |
| 176 | #PBS -q short |
| 177 | #PBS -o Script_Output_test.000001 |
| 178 | #PBS -S /bin/ksh |
| 179 | #PBS -v BATCH_NUM_PROC_TOT=1 |
| 180 | #PBS -l nodes=1:ppn=1 |
| 181 | }}} |
| 182 | |
| 183 | to automatically have existing files deleted, set JobType=DEV |
| 184 | {{{ |
| 185 | #D- Experience type : DEB(ug), DEV(elopment), RUN (default) |
| 186 | JobType=DEV |
| 187 | }}} |
| 188 | to avoid queuing take full advantage of your job time; the value depends on #PBS -q short and computation time of orchidee |
| 189 | {{{ |
| 190 | #D- Number of execution in one job |
| 191 | PeriodNb=60 |
| 192 | }}} |
| 193 | |
| 194 | to have a temp directory you can access on obelix; exchange dgoll with your ID |
| 195 | {{{ |
| 196 | #D- Define running directory |
| 197 | #D- Default=${TMPDIR} ie temporary batch directory |
| 198 | #D- |
| 199 | #RUN_DIR_PATH=/workdir/or/scratchdir/of/this/machine |
| 200 | RUN_DIR_PATH=/home/scratch01/dgoll/RUN_DIR |
| 201 | }}} |
| 202 | ==== 3.1.7 submit the job ==== |
| 203 | on obelix: |
| 204 | {{{ |
| 205 | qsub Job_ID |
| 206 | }}} |
| 207 | on curie |
| 208 | {{{ |
| 209 | ccc_msub Job_ID |
| 210 | }}} |
| 211 | |
| 212 | |
| 213 | |
| 214 | === 3.2 ENSEMBLE: fluxnet sites [http://forge.ipsl.jussieu.fr/orchidee/wiki/Scripts/FluxnetValidation] === |
| 215 | ==== 3.2.1 create new experiment folder ==== |
| 216 | {{{ |
| 217 | cd ../../config/ORCHIDEE_OL/ |
| 218 | cp -fr ENSEMBLE/ MY_ENSEMBLE/ |
| 219 | cd MY_ENSEMBLE/ |
| 220 | }}} |
| 221 | |
| 222 | ==== 3.2.2 tell libIGCM about the new input files (write me an email if you need them) ==== |
| 223 | The configuration which are used are stored in |
| 224 | ../SPINUP/SUBJOB/OOL_SEC_STO/COMP/ |
| 225 | so, do as in 4.1.2: change the path of soil_param.nc and add the new files |
| 226 | |
| 227 | sechiba.card: |
| 228 | {{{ |
| 229 | (/home/scratch01/dgoll/ORCHIDEE/ORC-CNP/simulations/simple_forcing_DSG/soils_param.nc, .), \ |
| 230 | }}} |
| 231 | stomate.card: |
| 232 | {{{ |
| 233 | ListNonDel= (${R_IN}/SRF/reftemp.nc, .) \ |
| 234 | (/home/scratch01/dgoll/ORCHIDEE/ORC-CNP/simulations/simple_forcing_DSG/USDA_SoilSuborder.nc, .), \ |
| 235 | (/home/scratch01/dgoll/ORCHIDEE/ORC-CNP/simulations/simple_forcing_DSG/lithology.nc, .), \ |
| 236 | (/home/scratch01/dgoll/ORCHIDEE/ORC-CNP/simulations/simple_forcing_DSG/deposition.nc, .) |
| 237 | }}} |
| 238 | WARNING: the deposition file is a static field at the moment; it does not include N deposition either. At the moment N deposition is set to P deposition in the ORCHIDEE code. Anyway N deposition is not accounted for in the calculations for the N & P cycle for now. |
| 239 | |
| 240 | copy a run.def with all parameters needed to PARAM, for example this one: |
| 241 | {{{ |
| 242 | cp ~/ORCHIDEE/DEFS_n_CARDS/run.def_NV PARAM/run.def |
| 243 | }}} |
| 244 | |
| 245 | ==== 3.2.3 adjust the libIGCM ==== |
| 246 | |
| 247 | add the new flags for the nutrient cycles in fluxnet.card: |
| 248 | {{{ |
| 249 | # to activate P cycle set =y |
| 250 | STOMATE_OK_PCYCLE=y |
| 251 | # to activate N cycle set =y |
| 252 | STOMATE_OK_NCYCLE=y |
| 253 | # make sure we dont fake |
| 254 | LD_FAKE_HEIGHT=n |
| 255 | # you can enable mass conservation and stoichiometry checks by =y |
| 256 | STOMATE_MASS_CONSERVATION=y |
| 257 | STOMATE_DSG_DEBUG=y |
| 258 | }}} |
| 259 | you need to add defaults for these switches into PARAM/orchidee.default |
| 260 | {{{ |
| 261 | # STOMATE_OK_NCYLE ([FLAG]) : Activate the nitrogen cycle {OK_STOMATE} |
| 262 | STOMATE_OK_NCYCLE = n |
| 263 | |
| 264 | # STOMATE_OK_PCYLE ([FLAG]) : Activate the phosphorus cycle {OK_STOMATE} |
| 265 | STOMATE_OK_PCYCLE = n |
| 266 | |
| 267 | # STOMATE_MASS_CONSERVATION ([FLAG]) : activate mass conservation checks which force stop if violated {OK_STOMATE} |
| 268 | STOMATE_MASS_CONSERVATION = n |
| 269 | |
| 270 | # STOMATE_DSG_DEBUG ([FLAG]) : activate checks for stoichiometry and negative pools {OK_STOMATE} |
| 271 | STOMATE_DSG_DEBUG = n |
| 272 | |
| 273 | # LD_FAKE_HEIGHT ([FLAG]) : fakes height of vegetation (ORCHIDEE-CAN related) {OK_STOMATE} |
| 274 | LD_FAKE_HEIGHT = n |
| 275 | |
| 276 | }}} |
| 277 | |
| 278 | specify the spinup simulations in the config.card: |
| 279 | {{{ |
| 280 | [SPINUP] |
| 281 | # Initialisation for spin-up : |
| 282 | # orchidee with sechiba alone (!!! if ok_stomate == n !!!) |
| 283 | duree_nostomate=0 |
| 284 | # orchidee with stomate; number of years before n_iter cycles of duree_sechiba years of analytical spinup cycles |
| 285 | duree_inistomate=250 |
| 286 | # teststomate (only if duree_inistomate > 0) |
| 287 | duree_offlineini=0 |
| 288 | |
| 289 | # Loop over ORCHIDEE runs (used for spin-up) |
| 290 | # The whole job is restarted n_iter times |
| 291 | # n_iter: the number of cycles with duree_sechiba years |
| 292 | n_iter=3 |
| 293 | # orchidee with sechiba (and stomate if ok_stomate=y below) |
| 294 | duree_sechiba=50 |
| 295 | |
| 296 | # teststomate |
| 297 | duree_stomate=0 |
| 298 | # forcesoil |
| 299 | duree_carbonsol=1 |
| 300 | |
| 301 | # Final run (full ORCHIDEE) |
| 302 | # This last parameter must be non-zero. |
| 303 | duree_final=100 |
| 304 | }}} |
| 305 | |
| 306 | xios is per default disabled in "PARAM/orchidee.default" |
| 307 | routing is per default disabled in "fluxnet.card" |
| 308 | |
| 309 | ==== 3.2.4 adjust the job as usual ==== |
| 310 | modify config.card as usual ([http://forge.ipsl.jussieu.fr/orchidee/wiki/Scripts/FluxnetValidation]) |
| 311 | |
| 312 | modify run.def as usual ([http://forge.ipsl.jussieu.fr/orchidee/wiki/Scripts/FluxnetValidation]) |
| 313 | plus |
| 314 | if you want to archive, for example in the IMBALANCE-P storage; add to config.card: |
| 315 | {{{ |
| 316 | ARCHIVE=/home/surface3/dgoll |
| 317 | }}} |
| 318 | |
| 319 | modify fluxnet.card as usual (no information): |
| 320 | - if you want to keep the output files of the spinup you need to set the following variables |
| 321 | {{{ |
| 322 | # DEBUG mode for SPINUP |
| 323 | # |
| 324 | # This mode keep all SPINUP directory in ARCHIVE |
| 325 | # If disable, all ARCHIVE is automaticly cleaned. |
| 326 | DEBUG_SPIN=y |
| 327 | # If you don't want to keep old spinup steps, but last one |
| 328 | CONSERVE=y |
| 329 | }}} |
| 330 | |
| 331 | ==== 3.2.5 create job ==== |
| 332 | {{{ |
| 333 | ../../../libIGCM/ins_job |
| 334 | }}} |
| 335 | |
| 336 | ==== 3.2.6 adjust job (optional) ==== |
| 337 | |
| 338 | ==== 3.2.7 start simulations ==== |
| 339 | {{{ |
| 340 | my_prompt>> ksh |
| 341 | my_prompt>> nohup ./Job_ENSEMBLE fluxnet > out_Job 2>&1 & |
| 342 | }}} |
| 343 | ==== 3.2.8 check simulations ==== |
| 344 | to see the decomposition of the spatial domain among the processors check in the run dir "Load_balance_orchidee.dat" |
| 345 | |
| 346 | |
| 347 | on curie |
| 348 | {{{ |
| 349 | ccc_mstat -u userid |
| 350 | }}} |
| 351 | {{{ |
| 352 | ccc_mdel jobid |
| 353 | }}} |
| 354 | |
| 355 | ==== 3.2.8 post processing ==== |
| 356 | ensure the Jobname and the path to the reference simulation is set in fluxnet.card; in case there is no reference set it to NONE |
| 357 | {{{ |
| 358 | # History file of former ORCHIDEE runs (Reference) to compare with the current simulations |
| 359 | reference_base_path=/home/scratch01/dgoll/IGCM_OUT/OL2/DEVT/ensemble |
| 360 | reference_config=DSG04EnsCN |
| 361 | }}} |