Changes between Initial Version and Version 1 of DevelopmentActivities/ORCHIDEE-CNP/howtoUse


Ignore:
Timestamp:
2016-03-15T14:01:26+01:00 (8 years ago)
Author:
dgoll
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • DevelopmentActivities/ORCHIDEE-CNP/howtoUse

    v1 v1  
     1 
     2= HOWTO install/compile/run ORCHIDEE-CN-P for offline use with libIGCM. == 
     3This howto is based on the information which can be found in the ORCHIDEE wiki regarding the trunk version of ORCHIDEE. 
     4Please 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 === 
     9You should install the model NOT in the home directory; it is even too small to handle diagnostics like "out_execution" or "out_orchidee". 
     10You can use , for example, your work directory: 
     11curie: 
     12{{{ 
     13/ccc/work/cont003/dsm/<userID> 
     14}}} 
     15or 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{{{ 
     21svn co http://forge.ipsl.jussieu.fr/igcmg/svn/modipsl/trunk modipsl 
     22cd modipsl/util 
     23./model ORCHIDEE_trunk 
     24}}}  
     25 
     26=== 1.3 Exchange the trunk ORCHIDEE with ORCHIDEE-CN-P === 
     27{{{ 
     28cd ../modeles 
     29rm -fr ORCHIDEE 
     30svn co svn://forge.ipsl.jussieu.fr/orchidee/branches/ORCHIDEE-CN-P ORCHIDEE 
     31cd ../util ; ./ins_make 
     32}}} 
     33 
     34---- 
     35---- 
     36 
     37== 2. Compile ORCHIDEE == 
     38=== 2.1 modify IOIPSL === 
     39adjust 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{{{ 
     46cd ../modeles/ORCHIDEE   
     47}}} 
     48First do a "normal" make to compile XIOS & IPOSL components which are needed; don't worry if the compilation of ORCHIDEE crashes 
     49{{{ 
     50make 
     51}}} 
     52then 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 ==== 
     57WARNING: before you do anything on curie; make sure you have copied the p86ipsl login environment to your home 
     58according to [https://forge.ipsl.jussieu.fr/igcmg_doc/wiki/DocBenvBtgcc]: 
     59{{{ 
     60cp ~p86ipsl/.bashrc_curie  ~/. 
     61cp ~p86ipsl/.bash_profile ~/. 
     62}}} 
     63  
     64 
     65Then compile the standard way: 
     66{{{ 
     67cd ../config/ORCHIDEE_OL 
     68gmake without_xios 
     69}}} 
     70 
     71 
     72Optional: I usually re-compile ORCHIDEE again with makeorchidee_fcm to set options (don't forget to disable xios): 
     73{{{ 
     74cd ../../modeles/ORCHIDEE 
     75./makeorchidee_fcm -driver -parallel mpi -arch X64_CURIE -driver -noxios 
     76}}} 
     77 
     78---- 
     79---- 
     80 
     81== 3. Run ORCHIDEE == 
     82There 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{{{ 
     87cd ../../config/ORCHIDEE_OL/ 
     88cp -fr SPINUP_ANALYTIC/ MY_SPINUP_ANALYTIC/ 
     89cd MY_SPINUP_ANALYTIC/ 
     90}}} 
     91==== 3.1.2 tell libIGCM about the new input files (write me an email if you need them) ==== 
     92modify the variable "ListNonDel" in COMP/stomate.card: 
     93{{{ 
     94ListNonDel= (${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}}} 
     99WARNING: 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 
     101tell 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 
     107disable XIOS  in COMP/orchidee_ol.card 
     108{{{ 
     109# Use XIOS as output library instead of IOIPSL 
     110XIOS=n 
     111}}} 
     112disable XIOS  in PARAM/run.def 
     113{{{ 
     114# Use XIOS for writing diagnostics file 
     115# defulat = n 
     116XIOS_ORCHIDEE_OK = n 
     117}}} 
     118set the IO frequency to avoid crashes in PARAM/run.def 
     119{{{ 
     120# Writefrequency in seconds in sechiba_history.nc 
     121# default = 86400.0 
     122WRITE_STEP = 1800.0 
     123 
     124# Writefrequency in days in stomate_history.nc 
     125# default = 10. 
     126STOMATE_HIST_DT = 1 
     127}}} 
     128 
     129add the new flags for the nutrient cycles in PARAM/run.def: 
     130{{{ 
     131# to activate P cycle set =y 
     132STOMATE_OK_PCYCLE=y 
     133# to activate N cycle set =y 
     134STOMATE_OK_NCYCLE=y 
     135# make sure we dont fake 
     136LD_FAKE_HEIGHT=n 
     137# you can enable mass conservation and stoichiometry checks by =y 
     138STOMATE_MASS_CONSERVATION=y 
     139STOMATE_DSG_DEBUG=y 
     140}}} 
     141in 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 
     144disable river routing if you run on non-global scale in run.def 
     145{{{ 
     146# Activate river routing 
     147RIVER_ROUTING = n 
     148}}} 
     149 
     150 
     151==== 3.1.4 adjust the job as usual ==== 
     152modify config.card as usual (see wiki) 
     153 
     154modify run.def as usual (see wiki) 
     155plus 
     156if you want to archive, for example in the IMBALANCE-P storage; add to config.card: 
     157{{{ 
     158ARCHIVE=/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 
     168Header 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 
     183to automatically have existing files deleted, set JobType=DEV 
     184{{{ 
     185        #D- Experience type : DEB(ug), DEV(elopment), RUN (default) 
     186        JobType=DEV  
     187}}} 
     188to 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 
     194to 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 
     200RUN_DIR_PATH=/home/scratch01/dgoll/RUN_DIR 
     201}}} 
     202==== 3.1.7 submit the job  ==== 
     203on obelix: 
     204{{{ 
     205qsub Job_ID 
     206}}} 
     207on curie 
     208{{{ 
     209ccc_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{{{ 
     217cd ../../config/ORCHIDEE_OL/ 
     218cp -fr ENSEMBLE/ MY_ENSEMBLE/ 
     219cd MY_ENSEMBLE/ 
     220}}} 
     221 
     222==== 3.2.2 tell libIGCM about the new input files (write me an email if you need them) ==== 
     223The configuration which are used are stored in  
     224../SPINUP/SUBJOB/OOL_SEC_STO/COMP/ 
     225so, do as in 4.1.2: change the path of soil_param.nc and add the new files  
     226 
     227sechiba.card: 
     228{{{ 
     229(/home/scratch01/dgoll/ORCHIDEE/ORC-CNP/simulations/simple_forcing_DSG/soils_param.nc, .), \ 
     230}}} 
     231stomate.card: 
     232{{{ 
     233ListNonDel= (${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}}} 
     238WARNING: 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 
     240copy a run.def with all parameters needed to PARAM, for example this one: 
     241{{{ 
     242cp ~/ORCHIDEE/DEFS_n_CARDS/run.def_NV PARAM/run.def 
     243}}} 
     244 
     245==== 3.2.3 adjust the libIGCM  ==== 
     246 
     247add the new flags for the nutrient cycles in fluxnet.card: 
     248{{{ 
     249# to activate P cycle set =y 
     250STOMATE_OK_PCYCLE=y 
     251# to activate N cycle set =y 
     252STOMATE_OK_NCYCLE=y 
     253# make sure we dont fake 
     254LD_FAKE_HEIGHT=n 
     255# you can enable mass conservation and stoichiometry checks by =y 
     256STOMATE_MASS_CONSERVATION=y 
     257STOMATE_DSG_DEBUG=y 
     258}}} 
     259you need to add defaults for these switches into PARAM/orchidee.default 
     260{{{ 
     261# STOMATE_OK_NCYLE ([FLAG]) :  Activate the nitrogen cycle {OK_STOMATE} 
     262STOMATE_OK_NCYCLE = n 
     263 
     264# STOMATE_OK_PCYLE ([FLAG]) :  Activate the phosphorus cycle {OK_STOMATE} 
     265STOMATE_OK_PCYCLE = n 
     266 
     267# STOMATE_MASS_CONSERVATION ([FLAG]) : activate mass conservation checks which force stop if violated {OK_STOMATE} 
     268STOMATE_MASS_CONSERVATION = n 
     269 
     270# STOMATE_DSG_DEBUG ([FLAG]) : activate checks for stoichiometry and negative pools {OK_STOMATE} 
     271STOMATE_DSG_DEBUG = n 
     272 
     273# LD_FAKE_HEIGHT ([FLAG]) : fakes height of vegetation (ORCHIDEE-CAN related) {OK_STOMATE} 
     274LD_FAKE_HEIGHT = n 
     275 
     276}}} 
     277 
     278specify the spinup simulations in the config.card: 
     279{{{ 
     280[SPINUP]                                                                               
     281# Initialisation for spin-up :                                                         
     282# orchidee with sechiba alone (!!! if ok_stomate == n !!!)                             
     283duree_nostomate=0                                                                      
     284# orchidee with stomate; number of years before n_iter cycles of duree_sechiba years of analytical spinup cycles 
     285duree_inistomate=250                                                                   
     286# teststomate (only if duree_inistomate > 0)                                           
     287duree_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 
     292n_iter=3                                                                               
     293# orchidee with sechiba (and stomate if ok_stomate=y below)                            
     294duree_sechiba=50                                                                       
     295 
     296# teststomate                                                                          
     297duree_stomate=0                                                                        
     298# forcesoil                                                                            
     299duree_carbonsol=1                                                                      
     300                                                                                       
     301# Final run (full ORCHIDEE)                                                            
     302# This last parameter must be non-zero.                                                
     303duree_final=100   
     304}}} 
     305 
     306xios is per default disabled in "PARAM/orchidee.default" 
     307routing is per default disabled in "fluxnet.card" 
     308 
     309==== 3.2.4 adjust the job as usual ==== 
     310modify config.card as usual ([http://forge.ipsl.jussieu.fr/orchidee/wiki/Scripts/FluxnetValidation]) 
     311 
     312modify run.def as usual ([http://forge.ipsl.jussieu.fr/orchidee/wiki/Scripts/FluxnetValidation]) 
     313plus 
     314if you want to archive, for example in the IMBALANCE-P storage; add to config.card: 
     315{{{ 
     316ARCHIVE=/home/surface3/dgoll  
     317}}}  
     318 
     319modify 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. 
     326DEBUG_SPIN=y 
     327# If you don't want to keep old spinup steps, but last one 
     328CONSERVE=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{{{ 
     340my_prompt>> ksh 
     341my_prompt>> nohup ./Job_ENSEMBLE fluxnet > out_Job 2>&1 & 
     342}}} 
     343==== 3.2.8 check simulations ==== 
     344to see the decomposition of the spatial domain among the processors check in the run dir "Load_balance_orchidee.dat" 
     345 
     346 
     347on curie 
     348{{{ 
     349ccc_mstat -u userid 
     350}}} 
     351{{{ 
     352ccc_mdel jobid 
     353}}} 
     354 
     355==== 3.2.8 post processing ==== 
     356ensure 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 
     359reference_base_path=/home/scratch01/dgoll/IGCM_OUT/OL2/DEVT/ensemble 
     360reference_config=DSG04EnsCN 
     361}}}