Changes between Version 4 and Version 5 of Documentation/UserGuide/DebugCoupled


Ignore:
Timestamp:
2014-09-15T17:20:28+02:00 (10 years ago)
Author:
jgipsl
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Documentation/UserGuide/DebugCoupled

    v4 v5  
    1 If you've never really used LMD before, coupling is a scary event, even if you know ORCHIDEE quite well.  Thankfully, there are some tips to make things a bit easier. 
     1If you've never really used LMDZ before, coupling is a scary event, even if you know ORCHIDEE quite well.  Thankfully, there are some tips to make things a bit easier. 
    22 
    3 '''Tip 1)''' If the job crashes immediately (i.e., within a day), it's good to check the coupling between the two models, which variables are passed and what their values are.  This can be found in intersurf_gathered, in src_sechiba/intersurf.f90.  If you changed the flag check_INPUTS in this file to .TRUE. and recompile, it will create a whole bunch of useful files in the run directory when run, of the format W*.nc (Walb_nir.nc, Wfluxlat.nc, etc., one for all the variables passed to ORCHIDEE and passed from ORCHIDEE).  You can look at these with the standard NetCDF tools for each step to see if the values are unusual.  In order to determine what is "usual", I do a one day run on the same resolution with the trunk and all the options I'm interested in (11-layer hydrology, STOMATE, new physics, etc.) and enable the check_INPUTS flag.  This gives me an identical set of files to compare to. 
     3== Tip 1) check coupling == 
     4If the job crashes immediately (i.e., within a day), it's good to check the coupling between the two models, which variables are passed and what their values are.  This can be found in intersurf_gathered, in src_sechiba/intersurf.f90.  If you changed the flag check_INPUTS in this file to .TRUE. and recompile, it will create a whole bunch of useful files in the run directory when run, of the format W*.nc (Walb_nir.nc, Wfluxlat.nc, etc., one for all the variables passed to ORCHIDEE and passed from ORCHIDEE).  You can look at these with the standard NetCDF tools for each step to see if the values are unusual.  In order to determine what is "usual", I do a one day run on the same resolution with the trunk and all the options I'm interested in (11-layer hydrology, STOMATE, new physics, etc.) and enable the check_INPUTS flag.  This gives me an identical set of files to compare to. 
    45 
    56Question: where is the run directory?  It is not the submit directory (config/, where the job is submitted from), and it is not the archive directory (IGCM_OUT/, where the output files are stored).  It is a temporary directory where all the files are copied to and execution takes place.  If you look in the Script_* output file in the submit directory of a job, you can find a line which looks something like this (on Curie) 
     
    2728 
    2829 
    29 '''Tip 2)''' Turn on debug flags for ORCHIDEE and LMDZ 
     30== Tip 2) Turn on debug flags for ORCHIDEE and LMDZ == 
     31'''ORCHIDEE'''[[BR]] 
    3032 
    31 For ORCHIDEE, there are a couple options which involve changing util/AA_make.gdef.  On Curie, I generally make my own, but there is a line which already exists in the svn version of the file.  All you need to do is change 
     33The compiling of ORCHIDEE has changed so depending on when you extracted the model you should choose the appropriate method.  
     34 
     35Find out which method is used in your version by opening the file modipsl/config/LMDZOR_v5.2/AA_make. If it contains 
     36{{{ 
     37LMD9695-L39 : libioipsl liborchideefcm lmdz96x95x39 verif 
     38}}} 
     39you have the new method based on the script makeorchidee_fcm. For this case, add at the end of the line with makeorchidee_fcm '''-debug''' to the following : 
     40 
    3241 
    3342{{{ 
    34 #-Q- curie  F_O = -DCPP_PARA -O3 $(F_D) $(F_P) -I$(MODDIR) -module $(MODDIR) -fp-model precise 
    35 ######-Q- curie  F_O = -DCPP_PARA -p -g -traceback -fp-stack-check -ftrapuv -check bounds $(F_D) $(F_P) -I$(MODDIR) -module $(MODDIR) 
     43liborchideefcm : ../../modeles/ORCHIDEE/ 
     44        (cd ../../modeles/ORCHIDEE/ ; ./makeorchidee_fcm -parallel mpi -arch $(FCM_ARCH) -driver -j 8 -debug ) 
    3645}}} 
    3746 
    38 to  
     47If instead the file modipsl/config/LMDZOR_v5.2/AA_make contains  
     48{{{ 
     49LMD9695-L39 : libioipsl liborchidee lmdz96x95x39 verif 
     50}}} 
     51you have the old method with standard makefiles based on AA_make.gdef. Change in modipsl/util/AA_make.gdef the line corresponding to F_O for your machine.  
    3952 
     53For example at curie set: 
    4054{{{ 
    41 ######-Q- curie  F_O = -DCPP_PARA -O3 $(F_D) $(F_P) -I$(MODDIR) -module $(MODDIR) -fp-model precise 
    4255#-Q- curie  F_O = -DCPP_PARA -p -g -traceback -fp-stack-check -ftrapuv -check bounds $(F_D) $(F_P) -I$(MODDIR) -module $(MODDIR) 
    4356}}} 
    4457 
    45 To take into acount these changes, you have to rerun the script util/ins_make 
     58For example at ada set: 
     59#-Q- ada      F_O = -DCPP_PARA -p -g -traceback -fp-stack-check -ftrapuv -check bounds $(F_D) $(F_P) -I$(MODDIR) -module $(MODDIR) 
    4660 
    47 For LMDZ, you can change the main Makefile directly in config/LMDZOR_v5.2/.  Add -debug to the following lines 
     61Note that these lines are proposed in AA_make.gdef in commented form using ####-Q-... 
    4862 
     63'''LMDZ'''[[BR]] 
     64For LMDZ, add -debug on the 2 lines containing makelmdz_fcm in the same file modipsl/config/LMDZOR_v5.2/AA_make. You should have the following: 
    4965{{{ 
    5066lmdz: ../../modeles/LMDZ 
    51     (cd ../../modeles/LMDZ; ./makelmdz_fcm -d $(RESOL_LMDZ) -cosp true -v true -parallel mpi -arch $(FCM_ARCH) ce0l ; cp bin/ce0l_$(RESOL_LMDZ)_phylmd_para_orch.e ../../bin/create_etat0_limit.e ; ) 
    52     (cd ../../modeles/LMDZ; ./makelmdz_fcm -d $(RESOL_LMDZ) -cosp true -v true -parallel mpi -arch $(FCM_ARCH) gcm ; cp bin/gcm_$(RESOL_LMDZ)_phylmd_para_orch.e ../../bin/gcm.e ; ) 
     67    (cd ../../modeles/LMDZ; ./makelmdz_fcm -d $(RESOL_LMDZ) -cosp true -v true -debug -parallel mpi -arch $(FCM_ARCH) ce0l ; cp bin/ce0l_$(RESOL_LMDZ)_phylmd_para_orch.e ../../bin/create_etat0_limit.e ; ) 
     68    (cd ../../modeles/LMDZ; ./makelmdz_fcm -d $(RESOL_LMDZ) -cosp true -v true -debug -parallel mpi -arch $(FCM_ARCH) gcm ; cp bin/gcm_$(RESOL_LMDZ)_phylmd_para_orch.e ../../bin/gcm.e ; ) 
    5369}}} 
    5470 
    55 to have 
     71'''Recreate makefiles and compile'''[[BR]] 
     72You must now recreate the Makefile, clean and recompile. Do as follow: 
     73{{{ 
     74cd modipsl/config/LMDZOR_v5.2 
     75../../util/ins_make 
     76gmake clean 
     77gmake 
     78}}} 
     79This will recompile both ORCHIDEE and LMDZ with the new options you set.  
    5680 
    57 {{{ 
    58 lmdz: ../../modeles/LMDZ 
    59 #    (cd ../../modeles/LMDZ; ./makelmdz_fcm -d $(RESOL_LMDZ) -cosp true -v true -parallel mpi -arch $(FCM_ARCH) ce0l ; cp bin/ce0l_$(RESOL_LMDZ)_phylmd_para_orch.e ../../bin/create_etat0_limit.e ; ) 
    60     (cd ../../modeles/LMDZ; ./makelmdz_fcm -d $(RESOL_LMDZ) -cosp true -v true -debug -parallel mpi -arch $(FCM_ARCH) gcm ; cp bin/gcm_$(RESOL_LMDZ)_phylmd_para_orch.e ../../bin/gcm.e ; ) 
    61 }}} 
    62  
    63 and then type "gmake clean && gmake. You'll now recompile ORCHIDEE as well as LMDZ with debug options.  
    64  
    65 You have to be careful with this since if you run ins_make again, you will lose the addition of the "-debug" flag in the Makefile and you'll have to re-add it. If you want to keep -debug as a permanent option, add it in AA_make instead.  
    66  
    67  
    68 The actual debug flags appear to be stored in modeles/LMDZ/arch/arch-X64_CURIE.fcm.  Also note that if you forget to comment out the first line, every time you compile it will take 30 minutes or so, since LMDZ will compile multiple times due to the differences in flags! 
     81Note: The debug flags, as well as all compile options, that are used for ORCHIDEE compiled with makeorechidee_fcm are found in modeles/ORCHIDEE/arch/arch-....fcm and for LMDZ in modeles/LMDZ/arch/arch-....fcm. 
    6982 
    7083