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