Ignore:
Timestamp:
2011-08-31T09:32:29+02:00 (13 years ago)
Author:
didier.solyga
Message:

Optimize allocation memory for pft parameters. Reorganize the algorithm for the externalization : the parameters can be read only if IMPOSE_PARAM is set to true. Rewrite a loop in slowproc.f90.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/ORCHIDEE_EXT/ORCHIDEE/src_sechiba/intersurf.f90

    r407 r425  
    6969  ! 
    7070!!$ DS : ajout du flag IMPOSE_PARAM 
    71  ! Flag impos_param : it is set to true by default 
     71  ! Flag impos_param : it is set to true by default 
    7272  LOGICAL, SAVE :: impose_param = .TRUE. 
    7373  ! 
     
    27592759    TYPE(control_type), INTENT(out)            :: control_flags !! Flags that (de)activate parts of the model 
    27602760 
    2761  
    2762     ! 
    2763     !Config Key  = NVM 
    2764     !Config Desc = number of PFTs   
    2765     !Config  if  = ANYTIME 
    2766     !Config  Def  = 13 
    2767     !Config  Help = The number of vegetation types define by the user 
    2768     !Config  Units = NONE 
    2769     CALL getin_p('NVM',nvm) 
    2770     WRITE(numout,*)'the number of pfts is : ', nvm 
    27712761    ! 
    27722762    !Config Key  = LONGPRINT 
     
    28232813    ENDIF 
    28242814 
    2825     !Config Key  = IMPOSE_PARAM 
    2826     !Config Desc = Do you impose the values of the parameters? 
    2827     !Config  if  = ANYTIME 
    2828     !Config  Def  = y 
    2829     !Config  Help = This flag can deactivate the reading of some paramters. 
    2830     !               Useful if you want to use the standard values without commenting the run.def 
    2831     !Config  Units = NONE 
    2832     CALL getin_p('IMPOSE_PARAM',impose_param) 
    2833  
    2834     ! Read and allocate the pft parameters 
    2835     CALL pft_parameters_main   
    2836  
    28372815    ! 
    28382816    !Config Key  = RIVER_ROUTING 
     
    28472825    WRITE(numout,*) "RIVER routing is activated : ",control_flags%river_routing 
    28482826    ! 
    2849 !!$    DS : reading of parameters associated to river_routing 
    2850     IF ( control_flags%river_routing ) THEN 
    2851        CALL getin_routing_parameters 
    2852     ENDIF 
    28532827 
    28542828    ! 
     
    28702844    ENDIF 
    28712845    ! 
    2872 !!$    DS : reading of parameters associated to hydrol_cwrr 
    2873     IF ( control_flags%hydrol_cwrr ) THEN 
    2874        CALL getin_hydrol_cwrr_parameters 
    2875     ELSE 
    2876        CALL getin_hydrolc_parameters 
    2877        ! we read the parameters for the choisnel hydrology 
    2878     ENDIF 
    28792846 
    28802847    ! 
     
    28882855    WRITE(numout,*) 'photosynthesis: ', control_flags%ok_co2 
    28892856    ! 
    2890 !!$    DS : reading of parameters associated to ok_co2 
    2891     IF ( control_flags%ok_co2 ) THEN 
    2892        CALL getin_co2_parameters 
    2893     ENDIF 
    28942857 
    28952858    ! 
     
    29032866    WRITE(numout,*) 'STOMATE is activated: ',control_flags%ok_stomate 
    29042867    ! 
    2905 !!$    DS : reading of parameters associated to ok_stomate 
    2906     IF ( control_flags%ok_stomate ) THEN 
    2907        CALL getin_stomate_parameters 
    2908        IF ( impose_param ) THEN       
    2909           CALL getin_stomate_pft_parameters 
    2910           WRITE(numout,*)'    some stomate_pft_parameters have been imposed ' 
    2911        ELSE  
    2912           WRITE(numout,*)'    all stomate_pft_parameters are set to default values' 
    2913        ENDIF 
    2914     ENDIF 
    29152868 
    29162869    ! 
     
    29272880    ! 
    29282881    control_flags%ok_sechiba = .TRUE. 
    2929 !!$    DS : reading of parameters associated to ok_sechiba 
    2930     IF ( control_flags%ok_sechiba ) THEN 
    2931        CALL getin_sechiba_parameters 
    2932        IF ( impose_param ) THEN       
    2933           CALL getin_sechiba_pft_parameters 
    2934           WRITE(numout,*)'    some sechiba_pft_parameters have been imposed ' 
    2935        ELSE  
    2936           WRITE(numout,*)'    all sechiba_pft_parameters are set to default values' 
    2937        ENDIF 
    2938     ENDIF 
    2939  
    29402882    ! 
    29412883    ! 
     
    29652907    control_flags%ok_pheno = .TRUE. 
    29662908    ! 
    2967 !>> july 2011 
    2968     ! DS: activation of sub-models of ORCHIDEE 
     2909 
     2910!>> DS 08/2011 : for externalisation 
     2911 
     2912    ! 1. Number of PFTs defined by the user 
     2913 
     2914    !Config Key  = NVM 
     2915    !Config Desc = number of PFTs   
     2916    !Config if  = ANYTIME 
     2917    !Config Def  = 13 
     2918    !Config Help = The number of vegetation types define by the user 
     2919    !Config Units = NONE 
     2920    CALL getin_p('NVM',nvm) 
     2921    WRITE(numout,*)'the number of pfts is : ', nvm 
     2922 
     2923    ! 2. Should we read the parameters in the run.def file ? 
     2924 
     2925    !Config Key  = IMPOSE_PARAM 
     2926    !Config Desc = Do you impose the values of the parameters? 
     2927    !Config if  = ANYTIME 
     2928    !Config Def  = y 
     2929    !Config Help = This flag can deactivate the reading of some parameters. 
     2930    !               Useful if you want to use the standard values without commenting the run.def 
     2931    !Config Units = NONE 
     2932    ! 
     2933    CALL getin_p('IMPOSE_PARAM',impose_param) 
     2934 
     2935    ! 3. Allocate and intialize the pft parameters 
     2936 
     2937    CALL pft_parameters_main(control_flags%ok_sechiba,control_flags%ok_stomate) 
     2938 
     2939    ! 4. Activation sub-models of ORCHIDEE 
     2940 
    29692941    CALL activate_sub_models(control_flags%ok_sechiba, control_flags%river_routing,control_flags%ok_stomate) 
    2970     ! Vegetation configuration(impose_veg, land_use, lcchange...previously in slowproc) 
     2942 
     2943    ! 5. Vegetation configuration (impose_veg, land_use, lcchange...previously in slowproc) 
     2944 
    29712945    CALL veget_config 
     2946 
     2947    ! 6. Read the parameters in the run.def file  according the flags 
     2948 
     2949    IF ( control_flags%ok_sechiba .AND. impose_param ) THEN 
     2950       CALL getin_sechiba_parameters 
     2951       CALL getin_sechiba_pft_parameters 
     2952       WRITE(numout,*)'    some sechiba_pft_parameters have been imposed ' 
     2953    ELSE  
     2954       WRITE(numout,*)'    all sechiba_pft_parameters are set to default values' 
     2955    ENDIF 
     2956 
     2957    IF ( control_flags%ok_co2 .AND. impose_param ) THEN 
     2958       CALL getin_co2_parameters 
     2959    ENDIF 
     2960 
     2961    IF ( control_flags%hydrol_cwrr .AND. impose_param ) THEN 
     2962       CALL getin_hydrol_cwrr_parameters 
     2963    ELSE 
     2964       IF (impose_param) THEN 
     2965          CALL getin_hydrolc_parameters 
     2966          ! we read the parameters for the choisnel hydrology 
     2967       ENDIF 
     2968    ENDIF 
     2969 
     2970    IF ( control_flags%river_routing .AND. impose_param ) THEN 
     2971       CALL getin_routing_parameters 
     2972    ENDIF 
     2973 
     2974    IF ( control_flags%ok_stomate .AND. impose_param ) THEN 
     2975       CALL getin_stomate_parameters 
     2976       CALL getin_stomate_pft_parameters 
     2977       WRITE(numout,*)'    some stomate_pft_parameters have been imposed ' 
     2978    ELSE  
     2979       WRITE(numout,*)'    all stomate_pft_parameters are set to default values' 
     2980    ENDIF 
     2981 
     2982     IF ( control_flags%ok_dgvm .AND. impose_param ) THEN 
     2983       CALL getin_dgvm_parameters 
     2984    ENDIF     
     2985 
     2986!>> END DS 
     2987    ! 
    29722988    ! 
    29732989    RETURN 
Note: See TracChangeset for help on using the changeset viewer.