Changeset 6296 for CONFIG


Ignore:
Timestamp:
12/22/22 16:17:21 (16 months ago)
Author:
aclsce
Message:

IPSLCM7 : updated component revisions accordingly with ICOLMDZOR_v7 for DYNAMICO, ICOSA_LMDZ, ORCHIDEE and LMDZ.

Location:
CONFIG/UNIFORM/v7/IPSLCM7
Files:
5 added
2 deleted
17 edited

Legend:

Unmodified
Added
Removed
  • CONFIG/UNIFORM/v7/IPSLCM7/EXPERIMENTS/IPSLCM/piControl_TEST/COMP/dynamico.card

    r5479 r6296  
    4040 
    4141[OutputText] 
    42 List=   (run_dynamico.def, earth_const.def, iodef.xml, context_dynamico.xml, context_input_dynamico.xml, field_def_dynamico.xml, file_def_dynamico.xml, out_icosa_lmdz.exe.out*, out_icosa_lmdz.exe.err*, xios_client_*) 
     42List=   (run_dynamico.def, earth_const.def, iodef.xml, context_dynamico.xml, context_input_dynamico.xml, field_def_dynamico.xml, file_def_dynamico.xml, out_icosa_lmdz.exe.out, out_icosa_lmdz.exe.err, xios_client_*) 
    4343 
    4444 
  • CONFIG/UNIFORM/v7/IPSLCM7/EXPERIMENTS/IPSLCM/piControl_TEST/COMP/lmdz.card

    r6070 r6296  
    55# Physics package to use : 
    66# LMDZ_Physics=AP for standard/old physics(defalut), can be used with LMDZ4_AR5 or LMDZ5/trunk sources 
    7 LMDZ_Physics=NPv6.1.3 
     7LMDZ_Physics=NPv6.2 
    88 
    99# Set ConfType to choose parameters for aerosols, solar and green house gazes. 
     
    7979        (${SUBMIT_DIR}/PARAM/guide.def, .),                                 \ 
    8080        (${SUBMIT_DIR}/PARAM/run.def, .),                                   \ 
    81         (${SUBMIT_DIR}/PARAM/traceur.def, .),                               \ 
     81        (${SUBMIT_DIR}/PARAM/tracer.def, .),                                \ 
    8282        (${SUBMIT_DIR}/PARAM/iodef.xml, . ),                                \ 
    8383        (${SUBMIT_DIR}/PARAM/ping_LMDZ.xml, ping_lmdz.xml ),                \ 
     
    8686        (${MODIPSL}/modeles/LMDZ/DefLists/field_def_lmdz.xml, . ),          \ 
    8787        (${MODIPSL}/modeles/LMDZ/DefLists/field_def_cosp1.xml, . ),         \ 
    88         (${MODIPSL}/modeles/LMDZ/DefLists/file_def_histmth_lmdz.xml, . ),   \ 
     88        (${SUBMIT_DIR}/PARAM/file_def_histmth_lmdz.xml, . ),                \ 
    8989        (${MODIPSL}/modeles/LMDZ/DefLists/file_def_histmthCOSP_lmdz.xml, .),\ 
    9090        (${MODIPSL}/modeles/LMDZ/DefLists/file_def_histmthNMC_lmdz.xml, . ),\ 
     
    107107 
    108108[OutputText] 
    109 List=   (physiq.def, run.def, traceur.def, guide.def, config.def, vert.def, used_run.def, context_lmdz.xml, field_def_lmdz.xml, file_def_*lmdz.xml, debug.01, lmdz.prt) 
     109List=   (physiq.def, run.def, tracer.def, guide.def, config.def, vert.def, used_run.def, context_lmdz.xml, field_def_lmdz.xml, file_def_*lmdz.xml, debug.01, lmdz.prt) 
    110110 
    111111[OutputFiles] 
  • CONFIG/UNIFORM/v7/IPSLCM7/EXPERIMENTS/IPSLCM/piControl_TEST/COMP/oasis.card

    r5479 r6296  
    66FreqCoupling=5400 
    77FreqCouplingRoffCalv=86400 
    8 Lucia=y 
     8Lucia=n 
    99 
    1010# ByPass_addnoise_sst=y : use addnoise on sst in CPL restart for following CumulPeriod only 
     
    2323[BoundaryFiles] 
    2424List=   () 
    25 ListNonDel= (${R_IN}/CPL/IPSLCM7/${config_UserChoices_ORCA_version}xICO${RESOL_NBP}/grids_${config_UserChoices_ORCA_version}xICO${RESOL_NBP}_MOSAIX_v1.nc, grids.nc),\ 
    26             (${R_IN}/CPL/IPSLCM7/${config_UserChoices_ORCA_version}xICO${RESOL_NBP}/masks_${config_UserChoices_ORCA_version}xICO${RESOL_NBP}_MOSAIX_v1.nc, masks.nc),\ 
    27                 (${R_IN}/CPL/IPSLCM7/${config_UserChoices_ORCA_version}xICO${RESOL_NBP}/areas_${config_UserChoices_ORCA_version}xICO${RESOL_NBP}_MOSAIX_v1.nc, areas.nc),\ 
    28             (${R_IN}/CPL/IPSLCM7/${config_UserChoices_ORCA_version}xICO${RESOL_NBP}/rmp_teORCA1.2_to_tICO40_TempIceAlb_1stOrder_MOSAIX_v1.nc, .),\ 
    29             (${R_IN}/CPL/IPSLCM7/${config_UserChoices_ORCA_version}xICO${RESOL_NBP}/rmp_tICO40_to_ueORCA1.2_WindStress_2ndOrder_MOSAIX_v1.nc, .),\ 
    30                 (${R_IN}/CPL/IPSLCM7/${config_UserChoices_ORCA_version}xICO${RESOL_NBP}/rmp_tICO40_to_veORCA1.2_WindStress_2ndOrder_MOSAIX_v1.nc, .),\ 
    31                 (${R_IN}/CPL/IPSLCM7/${config_UserChoices_ORCA_version}xICO${RESOL_NBP}/rmp_tICO40_to_teORCA1.2_HeatWaterFluxes_2ndOrder_MOSAIX_v1.nc, .),\ 
    32             (${R_IN}/CPL/IPSLCM7/${config_UserChoices_ORCA_version}xICO${RESOL_NBP}/rmp_tICO40_to_teORCA1.2_calving_nosouth_MOSAIX_v1.nc, .),\ 
    33             (${R_IN}/CPL/IPSLCM7/${config_UserChoices_ORCA_version}xICO${RESOL_NBP}/rmp_tICO40_to_teORCA1.2_calving_iceberg_MOSAIX_v1.nc, .),\ 
    34             (${R_IN}/CPL/IPSLCM7/${config_UserChoices_ORCA_version}xICO${RESOL_NBP}/rmp_tICO40_to_teORCA1.2_calving_iceshelf_MOSAIX_v1.nc, .),\ 
    35             (${R_IN}/CPL/IPSLCM7/${config_UserChoices_ORCA_version}xICO${RESOL_NBP}/rmp_tICO40_to_teORCA1.2_runoff_Quantity_to_Surfacic_MOSAIX_v1.nc, .) 
     25ListNonDel= (${R_IN}/CPL/IPSLCM7/${config_UserChoices_ORCA_version}xICO${RESOL_NBP}/grids_${config_UserChoices_ORCA_version}xICO${RESOL_NBP}_MOSAIX_v2.nc, grids.nc),\ 
     26            (${R_IN}/CPL/IPSLCM7/${config_UserChoices_ORCA_version}xICO${RESOL_NBP}/masks_${config_UserChoices_ORCA_version}xICO${RESOL_NBP}_MOSAIX_v2.nc, masks.nc),\ 
     27                (${R_IN}/CPL/IPSLCM7/${config_UserChoices_ORCA_version}xICO${RESOL_NBP}/areas_${config_UserChoices_ORCA_version}xICO${RESOL_NBP}_MOSAIX_v2.nc, areas.nc),\ 
     28            (${R_IN}/CPL/IPSLCM7/${config_UserChoices_ORCA_version}xICO${RESOL_NBP}/rmp_teORCA1.2_to_tICO40_TempIceAlb_1stOrder_MOSAIX_v2.nc, .),\ 
     29            (${R_IN}/CPL/IPSLCM7/${config_UserChoices_ORCA_version}xICO${RESOL_NBP}/rmp_tICO40_to_ueORCA1.2_WindStress_2ndOrder_MOSAIX_v2.nc, .),\ 
     30                (${R_IN}/CPL/IPSLCM7/${config_UserChoices_ORCA_version}xICO${RESOL_NBP}/rmp_tICO40_to_veORCA1.2_WindStress_2ndOrder_MOSAIX_v2.nc, .),\ 
     31                (${R_IN}/CPL/IPSLCM7/${config_UserChoices_ORCA_version}xICO${RESOL_NBP}/rmp_tICO40_to_teORCA1.2_HeatWaterFluxes_2ndOrder_MOSAIX_v2.nc, .),\ 
     32            (${R_IN}/CPL/IPSLCM7/${config_UserChoices_ORCA_version}xICO${RESOL_NBP}/rmp_tICO40_to_teORCA1.2_calving_nosouth_MOSAIX_v2.nc, .),\ 
     33            (${R_IN}/CPL/IPSLCM7/${config_UserChoices_ORCA_version}xICO${RESOL_NBP}/rmp_tICO40_to_teORCA1.2_calving_iceberg_MOSAIX_v2.nc, .),\ 
     34            (${R_IN}/CPL/IPSLCM7/${config_UserChoices_ORCA_version}xICO${RESOL_NBP}/rmp_tICO40_to_teORCA1.2_calving_iceshelf_MOSAIX_v2.nc, .),\ 
     35            (${R_IN}/CPL/IPSLCM7/${config_UserChoices_ORCA_version}xICO${RESOL_NBP}/rmp_tICO40_to_teORCA1.2_runoff_Quantity_to_Surfacic_MOSAIX_v2.nc, .) 
    3636 
    3737[SmoothFiles] 
  • CONFIG/UNIFORM/v7/IPSLCM7/EXPERIMENTS/IPSLCM/piControl_TEST/COMP/orchidee.card

    r6135 r6296  
    1111VEGET_UPDATE=0Y 
    1212 
     13# Choice for routing scheme. Set ROUTING below to have following parameters set in orchidee.def :  
     14# ROUTING=standard   => in orchidee.def RIVER_ROUTING=y and ROUTING_METHOD=standard 
     15# ROUTING=simple     => in orchidee.def RIVER_ROUTING=y and ROUTING_METHOD=simple 
     16# ROUTING=off        => in orchidee.def RIVER_ROUTING=n  
     17ROUTING=simple 
     18 
    1319# Specify output level for output files 
    1420# Only the files sechiba_history.nc, sechiba_out_2.nc and sechiba_history_4dim.nc can be set here. 
     
    1622# output_level_filename=12    : highest level which will output all variables 
    1723# output_level_filename=NONE  : deactivate the file 
    18 output_level_sechiba_history = 2 
     24output_level_sechiba_history = 11 
    1925output_level_sechiba_out_2 = NONE 
    2026output_level_sechiba_history_4dim = NONE 
     
    3642List= () 
    3743ListNonDel= (${R_IN}/SRF/PFTMAPS/CMIP6/ESA-LUH2v2/historical/15PFT.v2/PFTmap_1850.nc, PFTmap.nc),\ 
    38             (${R_IN}/SRF/WOODHARVEST/LUH2v2/historical4/woodharvest_1850.nc,           woodharvest.nc) 
     44            (${R_IN}/SRF/WOODHARVEST/LUH2v2/historical4/woodharvest_1850.nc,           woodharvest.nc),\ 
     45            (${R_IN}/SRF/ROUTING/routing_simple.nc, .) 
    3946 
    4047 
     
    4552List=   (${SUBMIT_DIR}/PARAM/orchidee.def, .)   ,\ 
    4653    (${SUBMIT_DIR}/PARAM/ping_orchidee.xml, . )                       ,\ 
    47         (${MODIPSL}/modeles/ORCHIDEE/src_xml/file_def_orchidee.xml, .)  ,\ 
     54        (${SUBMIT_DIR}/PARAM/file_def_orchidee.xml, .)  ,\ 
    4855        (${MODIPSL}/modeles/ORCHIDEE/src_xml/context_input_orchidee.xml, .) ,\ 
    4956        (${MODIPSL}/modeles/ORCHIDEE/src_xml/context_routing_orchidee.xml, .)   ,\ 
     
    5259 
    5360[RestartFiles] 
    54 List=   (sechiba_rest_out.nc, sechiba_rest.nc, sechiba_rest_in.nc) 
     61List=   (sechiba_rest_out.nc, sechiba_rest.nc, sechiba_rest_in.nc),\ 
     62        (routing_restart.nc, routing_restart.nc, routing_start.nc) 
    5563 
    5664[OutputText] 
    57 List=   (out_orchidee*, orchidee.def, used_orchidee.def, iodef.xml, context_orchidee.xml, context_routing_orchidee.xml, context_input_orchidee.xml, field_def_orchidee.xml, file_def_orchidee.xml, river_desc.nc) 
     65List=   (out_orchidee, orchidee.def, used_orchidee.def, iodef.xml, context_orchidee.xml, context_routing_orchidee.xml, context_input_orchidee.xml, field_def_orchidee.xml, file_def_orchidee.xml, river_desc.nc) 
    5866 
    5967[OutputFiles] 
  • CONFIG/UNIFORM/v7/IPSLCM7/GENERAL/DRIVER/dynamico.driver

    r5479 r6296  
    2121        IGCM_debug_Exit "RESOL_ATM_Z must be set in dynamico.card UserSection" 
    2222        IGCM_debug_Verif_Exit 
     23    fi 
     24 
     25    if [ ! -f ${SUBMIT_DIR}/../../../modeles/DYNAMICO/xml/file_def_dynamico.xml ];  then  
     26        module load python3 
     27        python3 ${SUBMIT_DIR}/../../../modeles/DYNAMICO/xml/file_def_dynamico.xml.py > ${SUBMIT_DIR}/../../../modeles/DYNAMICO/xml/file_def_dynamico.xml 
    2328    fi 
    2429 
  • CONFIG/UNIFORM/v7/IPSLCM7/GENERAL/DRIVER/lmdz.driver

    r6014 r6296  
    3131        RESOL_ATM_Z=${dynamico_UserChoices_RESOL_ATM_Z} 
    3232        RESOL_NBP=${dynamico_UserChoices_RESOL_NBP} 
     33    RESOL_ATM="nbp${RESOL_NBP}" 
    3334    fi 
    3435 
     
    379380    fi 
    380381 
    381     if [ X${config_ListOfComponents_CHM} = Xinca ] ; then 
     382    if [ X${config_UserChoices_ConfigType} = XESMCO2AER ] ; then 
     383    echo "ESM config, with INCA and CO2i, set type_trac=inco in run.def" 
     384    IGCM_comp_modifyDefFile blocker run.def type_trac inco 
     385    IGCM_comp_modifyDefFile blocker run.def iflag_phytrac 1 
     386    elif [ X${config_ListOfComponents_CHM} = Xinca ] ; then 
    382387        echo "Activate coupling to INCA, set type_trac=inca in run.def" 
    383388        IGCM_comp_modifyDefFile blocker run.def type_trac inca 
     
    492497    fi  
    493498 
    494     if [ X${config_UserChoices_ConfigType} = XESMCO2 ] ; then 
     499    if ( [ X${config_UserChoices_ConfigType} = XESMCO2 ] || [ X${config_UserChoices_ConfigType} = XESMCO2AER ] ) ; then 
    495500        # Set carbon cycle parameters according to parmeters in lmdz.card  
    496501        IGCM_comp_modifyDefFile blocker config.def level_coupling_esm 2  
     
    498503        IGCM_comp_modifyDefFile blocker config.def carbon_cycle_tr ${lmdz_UserChoices_carbon_cycle_tr} 
    499504        IGCM_comp_modifyDefFile blocker config.def carbon_cycle_rad ${lmdz_UserChoices_carbon_cycle_rad} 
     505        IGCM_comp_modifyDefFile nonblocker config.def co2_ppm0 ${lmdz_UserChoices_co2_ppm0}  
    500506    else 
    501507        # Take default value set in config.def 
     
    504510        IGCM_comp_modifyDefFile nonblocker config.def carbon_cycle_tr DEFAULT 
    505511        IGCM_comp_modifyDefFile nonblocker config.def carbon_cycle_rad DEFAULT 
     512        IGCM_comp_modifyDefFile nonblocker config.def co2_ppm0 DEFAULT 
     513    fi 
     514 
     515    if ( [ X${config_UserChoices_ConfigType} = XESMCO2 ] ) ; then 
     516        # Set carbon cycle parameters according to parmeters in lmdz.card  
     517        IGCM_comp_modifyDefFile nonblocker config.def read_fco2_ocean_cor ${lmdz_UserChoices_read_fco2_ocean_cor} 
     518        IGCM_comp_modifyDefFile nonblocker config.def var_fco2_ocean_cor ${lmdz_UserChoices_var_fco2_ocean_cor} 
     519        IGCM_comp_modifyDefFile nonblocker config.def read_fco2_land_cor ${lmdz_UserChoices_read_fco2_land_cor} 
     520        IGCM_comp_modifyDefFile nonblocker config.def var_fco2_land_cor ${lmdz_UserChoices_var_fco2_land_cor} 
     521    else 
     522        IGCM_comp_modifyDefFile nonblocker config.def read_fco2_ocean_cor DEFAULT 
     523        IGCM_comp_modifyDefFile nonblocker config.def var_fco2_ocean_cor DEFAULT 
     524        IGCM_comp_modifyDefFile nonblocker config.def read_fco2_land_cor DEFAULT 
     525        IGCM_comp_modifyDefFile nonblocker config.def var_fco2_land_cor DEFAULT 
    506526    fi 
    507527 
     
    572592    fi 
    573593    # Include xml files for output configuration if running with workflow CMIP6 
    574     if [ X"$( echo ${config_UserChoices_ExpType} | grep CMIP6 )" != "X" ] ; then 
     594    if ( [ X"$( echo ${config_UserChoices_ExpType} | grep CMIP6 )" != "X" ] || [ X${config_Post_dr2xmlIPSL} = XTRUE ] ) ; then 
    575595        echo '<context id="LMDZ" src="./ping_lmdz.xml"/>' >> add.tmp 
    576596        echo '<context id="LMDZ" src="./dr2xml_lmdz.xml"/>' >> add.tmp 
     
    615635            valuei=720 
    616636            valuej=360 
     637    elif [ ${RESOL_NBP} == 320  ] ; then 
     638        valuei=1440 
     639        valuej=720 
    617640        else 
    618641            IGCM_debug_Exit "RESOL_NBP=${RESOL_NBP} is not yet implemented in drivers" 
  • CONFIG/UNIFORM/v7/IPSLCM7/GENERAL/DRIVER/orchidee.driver

    r5479 r6296  
    1515    fi 
    1616 
     17    # Define the resolution only if the composant ICO for DYNAMICO is set in config.card 
     18    if [ ! X${config_ListOfComponents_ICO} = X ] ; then 
     19    RESOL_SRF="nbp${RESOL_NBP}" 
     20    fi 
     21 
     22 
    1723    IGCM_debug_PopStack "SRF_Initialize" 
    1824} 
     
    4046        IGCM_comp_modifyXmlFile nonblocker file_def_orchidee.xml stomate2 output_level 0 
    4147        IGCM_comp_modifyXmlFile nonblocker file_def_orchidee.xml stomate2 output_freq 1mo 
    42  
    43         IGCM_comp_modifyXmlFile nonblocker file_def_orchidee.xml stomate3 enabled .FALSE. 
    44         IGCM_comp_modifyXmlFile nonblocker file_def_orchidee.xml stomate3 output_level 0 
    45         IGCM_comp_modifyXmlFile nonblocker file_def_orchidee.xml stomate3 output_freq 1mo 
     48        IGCM_comp_modifyXmlFile nonblocker file_def_orchidee.xml stomate3 enabled .FALSE. 
     49        IGCM_comp_modifyXmlFile nonblocker file_def_orchidee.xml stomate3 output_level 0 
     50        IGCM_comp_modifyXmlFile nonblocker file_def_orchidee.xml stomate3 output_freq 1mo 
     51        IGCM_comp_modifyXmlFile nonblocker file_def_orchidee.xml stomate4 enabled .FALSE. 
     52        IGCM_comp_modifyXmlFile nonblocker file_def_orchidee.xml stomate4 output_level 0 
     53        IGCM_comp_modifyXmlFile nonblocker file_def_orchidee.xml stomate4 output_freq 1mo 
    4654    fi 
    4755 
     
    6472    else 
    6573        IGCM_comp_modifyDefFile nonblocker orchidee.def VEGET_UPDATE 0Y 
     74    fi 
     75 
     76    # Set parameters related to ROUTING in orchidee.def 
     77    if [ X${orchidee_UserChoices_ROUTING} = X ] || [ X${orchidee_UserChoices_ROUTING} = Xstandard ]; then 
     78        # Nothing is set or ROUTING=standard in orchidee.def, default option 
     79        IGCM_comp_modifyDefFile nonblocker orchidee.def RIVER_ROUTING y 
     80        IGCM_comp_modifyDefFile nonblocker orchidee.def ROUTING_METHOD  standard 
     81    elif [ X${orchidee_UserChoices_ROUTING} = Xsimple ]; then 
     82        # ROUTING=simple is set in orchidee.card 
     83        IGCM_comp_modifyDefFile nonblocker orchidee.def RIVER_ROUTING y 
     84        IGCM_comp_modifyDefFile nonblocker orchidee.def ROUTING_METHOD  simple 
     85    elif [ X${orchidee_UserChoices_ROUTING} = Xhighres ]; then 
     86        # ROUTING=highres is set in orchidee.card 
     87        IGCM_comp_modifyDefFile nonblocker orchidee.def RIVER_ROUTING y 
     88        IGCM_comp_modifyDefFile nonblocker orchidee.def ROUTING_METHOD  highres 
     89    else 
     90        # ROUTING=off, routing will be deactivated 
     91        IGCM_comp_modifyDefFile nonblocker orchidee.def RIVER_ROUTING n 
     92        IGCM_comp_modifyDefFile nonblocker orchidee.def ROUTING_METHOD  standard 
    6693    fi 
    6794 
     
    114141        IGCM_comp_modifyXmlFile nonblocker file_def_orchidee.xml sechiba1 output_level ${orchidee_UserChoices_output_level_sechiba_history} 
    115142        IGCM_comp_modifyXmlFile nonblocker file_def_orchidee.xml sechiba1 output_freq  ${orchidee_UserChoices_output_freq_sechiba_history} 
     143        IGCM_comp_modifyXmlFile force      file_def_orchidee.xml groupremap_sechiba1 group_ref remap_${orchidee_UserChoices_output_freq_sechiba_history} 
    116144    fi 
    117145     
     
    126154        IGCM_comp_modifyXmlFile nonblocker file_def_orchidee.xml sechiba2 output_level ${orchidee_UserChoices_output_level_sechiba_out_2} 
    127155        IGCM_comp_modifyXmlFile nonblocker file_def_orchidee.xml sechiba2 output_freq  ${orchidee_UserChoices_output_freq_sechiba_out_2} 
     156        IGCM_comp_modifyXmlFile force      file_def_orchidee.xml groupremap_sechiba2 group_ref remap_${orchidee_UserChoices_output_freq_sechiba_out_2}           
    128157    fi 
    129158     
     
    138167        IGCM_comp_modifyXmlFile nonblocker file_def_orchidee.xml sechiba3 output_level ${orchidee_UserChoices_output_level_sechiba_history_4dim} 
    139168        IGCM_comp_modifyXmlFile nonblocker file_def_orchidee.xml sechiba3 output_freq  ${orchidee_UserChoices_output_freq_sechiba_history_4dim} 
     169        IGCM_comp_modifyXmlFile force      file_def_orchidee.xml groupremap_sechiba3 group_ref remap_${orchidee_UserChoices_output_freq_sechiba_history_4dim}            
    140170    fi 
    141171         
     
    153183        echo '<context id="orchidee" src="./context_input_orchidee.xml"/>' >> add.tmp 
    154184    fi 
     185 
     186    # Add inclusion of file context_routing_orchidee.xml if this file exists 
     187    if [ -f context_routing_orchidee.xml ] ; then 
     188        echo '<context id="orchidee" src="./context_routing_orchidee.xml"/>' >> add.tmp 
     189    fi 
     190 
    155191    # Include xml files for output configuration if running with workflow CMIP6 
    156     if [ X"$( echo ${config_UserChoices_ExpType} | grep CMIP6 )" != "X" ] ; then 
    157         echo '<context id="orchidee" src="./ping_orchidee.xml"/>' >> add.tmp 
    158         echo '<context id="orchidee" src="./dr2xml_orchidee.xml"/>' >> add.tmp 
     192    if ( [ X"$( echo ${config_UserChoices_ExpType} | grep CMIP6 )" != "X" ] || [ X${config_Post_dr2xmlIPSL} = XTRUE ] ) ; then 
     193          echo '<context id="orchidee" src="./ping_orchidee.xml"/>' >> add.tmp 
     194          echo '<context id="orchidee" src="./dr2xml_orchidee.xml"/>' >> add.tmp 
    159195    fi 
    160196    cp iodef.xml iodef.xml.tmp 
     
    198234            valuei=720 
    199235            valuej=360 
     236    elif [ ${RESOL_NBP} == 320  ] ; then 
     237        valuei=1440 
     238        valuej=720 
    200239        else 
    201240            IGCM_debug_Exit "RESOL_NBP=${RESOL_NBP} is not yet implemented in drivers" 
  • CONFIG/UNIFORM/v7/IPSLCM7/GENERAL/PARAM/config.def_actuel

    r5479 r6296  
    88carbon_cycle_rad=_AUTO_ : DEFAULT=n 
    99 
     10## read_fco2_ocean_cor : y/n flag d'activation de la correction du flux net de carbone (ocean)  
     11read_fco2_ocean_cor=_AUTO_ : DEFAULT=n 
     12## var_fco2_ocean_cor : valeur de la correction du flux net de carbone (ocean)  
     13var_fco2_ocean_cor=_AUTO_: DEFAULT = 0.2576 
     14## read_fco2_land_cor : y/n flag d'activation de la correction du flux net de carbone (land)  
     15read_fco2_land_cor=_AUTO_ : DEFAULT=n 
     16## var_fco2_land_cor : valeur de la correction du flux net de carbone (land)  
     17var_fco2_land_cor=_AUTO_: DEFAULT =-0.2036 
     18 
    1019##  Cycle diurne  ou non                  
    1120iflag_cycle_diurne=1 
    12 ##  Soil Model  ou non                
     21 
     22## Soil Model ou non 
    1323soil_model=y 
    14 ## Pas de temps de couplage (s). 
     24 
     25## Pas de temps de couplage (s) 
    1526t_coupl=_AUTO_ 
    1627 
     
    4152### co2_ppm =    taux CO2 en ppm, l'année 2000 forcage CMIP6 
    4253co2_ppm = _AUTO_: DEFAULT = 3.6912e+02 
     54# co2_ppm0 = taux initial du CO2 en ppm, l'année 1850 forcage CMIP6 (transport) 
     55co2_ppm0 = _AUTO_: DEFAULT  = 2.8432e+02 
    4356### co2_ppm_per =    taux 4xCO2 en ppm (uniqument pour calcul des diags) 
    4457co2_ppm_per = _AUTO_: DEFAULT = 14.7648e+02 
     
    6679###  flag_aerosol = type of coupled aerosol, if aerosol offline  
    6780###  0 => no aerosol, 1 => sulfate only, 2 => bc only, 3 => pom only, 4 => seasalt only, 5 => dust only, 6 => all aerosol 
    68 flag_aerosol=_AUTO_  
     81flag_aerosol=_AUTO_ 
    6982### ok_cdnc=y/n   Cloud droplet number concentration 
    7083ok_cdnc=_AUTO_ 
     
    7992# 2: read two ozone climatologies, the average day and night climatology and the daylight climatology 
    8093read_climoz=_AUTO_ 
    81 #  
     94# 
    8295# Aerosols stratospheriques utilises par defaut  
    8396flag_aerosol_strat=_AUTO_ : DEFAULT=2 
  • CONFIG/UNIFORM/v7/IPSLCM7/GENERAL/PARAM/config.def_annuel

    r5479 r6296  
    1 # level_coupling_esm : 0(pas d'echange de carbone), 2 (change entre LMDZ/CPL/NEMO et LMDZ/ORCHIDEE) 
     1## level_coupling_esm : 0(pas d'echange de carbone), 2 (change entre LMDZ/CPL/NEMO et LMDZ/ORCHIDEE) 
    22level_coupling_esm=  _AUTO_: DEFAULT = 0 
    33## carbon_cycle_cpl: couplage des flux de carbone ATM/OCE, ATM/SRF 
     
    88carbon_cycle_rad=_AUTO_ : DEFAULT=n 
    99 
     10## read_fco2_ocean_cor : y/n flag d'activation de la correction du flux net de carbone (ocean)  
     11read_fco2_ocean_cor=_AUTO_ : DEFAULT=n 
     12## var_fco2_ocean_cor : valeur de la correction du flux net de carbone (ocean)  
     13var_fco2_ocean_cor=_AUTO_: DEFAULT = 0.2576 
     14## read_fco2_land_cor : y/n flag d'activation de la correction du flux net de carbone (land)  
     15read_fco2_land_cor=_AUTO_ : DEFAULT=n 
     16## var_fco2_land_cor : valeur de la correction du flux net de carbone (land)  
     17var_fco2_land_cor=_AUTO_: DEFAULT =-0.2036 
     18 
    1019##  Cycle diurne  ou non                  
    1120iflag_cycle_diurne=1 
    12 ##  Soil Model  ou non                
     21 
     22## Soil Model ou non 
    1323soil_model=y 
    14 ## Pas de temps de couplage (s). 
     24 
     25## Pas de temps de couplage (s) 
    1526t_coupl=_AUTO_ 
    1627 
     
    4152### co2_ppm =    taux CO2 en ppm 
    4253co2_ppm = _AUTO_ 
     54# co2_ppm0 = taux initial du CO2 en ppm, l'année 1850 forcage CMIP6 (transport) 
     55co2_ppm0 = _AUTO_: DEFAULT  = 2.8432e+02 
    4356### co2_ppm_per =    taux 4xCO2 en ppm (uniqument pour calcul des diags) 
    4457co2_ppm_per = _AUTO_ 
     
    6679###  flag_aerosol = type of coupled aerosol, if aerosol offline  
    6780###  0 => no aerosol, 1 => sulfate only, 2 => bc only, 3 => pom only, 4 => seasalt only, 5 => dust only, 6 => all aerosol 
    68 flag_aerosol=_AUTO_  
     81flag_aerosol=_AUTO_ 
    6982### ok_cdnc=y/n   Cloud droplet number concentration 
    7083ok_cdnc=_AUTO_ 
    7184# ok_alw=y flag pour activer l effet LW des poussieres 
    7285ok_alw=y 
    73 # 
    7486# 
    7587# Parametre de lecture de l'ozone 
     
    8092# 2: read two ozone climatologies, the average day and night climatology and the daylight climatology 
    8193read_climoz=_AUTO_ 
    82 #  
     94# 
    8395# Aerosols stratospheriques utilises par defaut  
    8496flag_aerosol_strat=_AUTO_ : DEFAULT=2 
  • CONFIG/UNIFORM/v7/IPSLCM7/GENERAL/PARAM/config.def_preind

    r5479 r6296  
    88carbon_cycle_rad=_AUTO_ : DEFAULT=n 
    99 
     10## read_fco2_ocean_cor : y/n flag d'activation de la correction du flux net de carbone (ocean)  
     11read_fco2_ocean_cor=_AUTO_ : DEFAULT=n 
     12## var_fco2_ocean_cor : valeur de la correction du flux net de carbone (ocean)  
     13var_fco2_ocean_cor=_AUTO_: DEFAULT = 0.2576 
     14## read_fco2_land_cor : y/n flag d'activation de la correction du flux net de carbone (land)  
     15read_fco2_land_cor=_AUTO_ : DEFAULT=n 
     16## var_fco2_land_cor : valeur de la correction du flux net de carbone (land)  
     17var_fco2_land_cor=_AUTO_: DEFAULT =-0.2036 
     18 
    1019##  Cycle diurne  ou non                  
    1120iflag_cycle_diurne=1 
    1221 
    13 ## Pas de temps de couplage (s).  
     22## Soil Model ou non 
     23soil_model=y 
     24 
     25## Pas de temps de couplage (s) 
    1426t_coupl=_AUTO_ 
    15  
    16 ##  Soil Model  ou non                
    17 soil_model=y 
    1827 
    1928## Nombre  d'appels des routines de rayonnements ( par jour)                  
     
    4352### co2_ppm_per =    taux 4xCO2 en ppm (uniqument pour calcul des diags) 
    4453co2_ppm_per = _AUTO_: DEFAULT  =11.3728e+02 
     54## co2_ppm0 = taux initial du CO2 en ppm, l'année 1850 forcage CMIP6 (transport) 
     55co2_ppm0 = _AUTO_: DEFAULT  = 2.8432e+02 
    4556### CH4_ppb =    taux CH4 en ppb, l'année 1850 forcage CMIP6 
    4657CH4_ppb = _AUTO_: DEFAULT = 8.0825e+02 
     
    8192# 
    8293# Aerosols stratospheriques utilises par defaut  
    83 # 
    8494flag_aerosol_strat=_AUTO_ : DEFAULT=2 
    8595# Diag VolMIP to get volcanic aerosols effects instead of tropospheric ones 
     
    8797# 
    8898# COSP 
    89 # 
    9099ok_cosp=_AUTO_ 
  • CONFIG/UNIFORM/v7/IPSLCM7/GENERAL/PARAM/iodef.xml

    r5479 r6296  
    2121        <variable_group id="buffer"> 
    2222            <variable id="optimal_buffer_size" type="string">performance</variable> 
    23             <variable id="buffer_size_factor" type="double">1.0</variable> 
     23            <variable id="buffer_size_factor" type="double">2.0</variable> 
    2424            <variable id="min_buffer_size" type="int">10000000</variable> 
    2525         </variable_group> 
  • CONFIG/UNIFORM/v7/IPSLCM7/GENERAL/PARAM/namcouple_ORCA1xICO40

    r5479 r6296  
    6060# Mozaic: 1) mapping filename 2) connected unit 3) dataset rank 4) Maximum 
    6161#         number of overlapped neighbors 
    62 rmp_teORCA1.2_to_tICO40_TempIceAlb_1stOrder_MOSAIX_v1.nc dst 
     62rmp_teORCA1.2_to_tICO40_TempIceAlb_1stOrder_MOSAIX_v2.nc dst 
    6363# CHECKOUT: indicate computation of global, land and sea field integrals. 
    6464# 
     
    7575# CHECKIN: indicate computation of global, land and sea field integrals. 
    7676# 
    77 rmp_teORCA1.2_to_tICO40_TempIceAlb_1stOrder_MOSAIX_v1.nc dst 
     77rmp_teORCA1.2_to_tICO40_TempIceAlb_1stOrder_MOSAIX_v2.nc dst 
    7878# CHECKOUT: indicate computation of global, land and sea field integrals. 
    7979# 
     
    9090# CHECKIN: indicate computation of global, land and sea field integrals. 
    9191#  
    92 rmp_teORCA1.2_to_tICO40_TempIceAlb_1stOrder_MOSAIX_v1.nc dst 
     92rmp_teORCA1.2_to_tICO40_TempIceAlb_1stOrder_MOSAIX_v2.nc dst 
    9393# CHECKOUT: indicate computation of global, land and sea field integrals. 
    9494# 
     
    105105# CHECKIN: indicate computation of global, land and sea field integrals. 
    106106# 
    107  rmp_teORCA1.2_to_tICO40_TempIceAlb_1stOrder_MOSAIX_v1.nc dst 
     107 rmp_teORCA1.2_to_tICO40_TempIceAlb_1stOrder_MOSAIX_v2.nc dst 
    108108# CHECKOUT: indicate computation of global, land and sea field integrals. 
    109109# 
     
    119119# CHECKIN: indicate computation of global, land and sea field integrals. 
    120120# 
    121 rmp_teORCA1.2_to_tICO40_TempIceAlb_1stOrder_MOSAIX_v1.nc dst 
     121rmp_teORCA1.2_to_tICO40_TempIceAlb_1stOrder_MOSAIX_v2.nc dst 
    122122# CHECKOUT: indicate computation of global, land and sea field integrals. 
    123123# 
     
    133133# CHECKIN: indicate computation of global, land and sea field integrals. 
    134134# 
    135 rmp_teORCA1.2_to_tICO40_TempIceAlb_1stOrder_MOSAIX_v1.nc dst 
     135rmp_teORCA1.2_to_tICO40_TempIceAlb_1stOrder_MOSAIX_v2.nc dst 
    136136# CHECKOUT: indicate computation of global, land and sea field integrals. 
    137137 
     
    146146# CHECKIN: indicate computation of global, land and sea field integrals. 
    147147# 
    148 rmp_teORCA1.2_to_tICO40_TempIceAlb_1stOrder_MOSAIX_v1.nc dst 
     148rmp_teORCA1.2_to_tICO40_TempIceAlb_1stOrder_MOSAIX_v2.nc dst 
    149149# CHECKOUT: indicate computation of global, land and sea field integrals. 
    150150# 
     
    164164# CHECKIN: indicate computation of global, land and sea field integrals. 
    165165# Interpolation method ou parametres mozaic 
    166 rmp_tICO40_to_ueORCA1.2_WindStress_2ndOrder_MOSAIX_v1.nc src 
     166rmp_tICO40_to_ueORCA1.2_WindStress_2ndOrder_MOSAIX_v2.nc src 
    167167# CHECKOUT: indicate computation of global, land and sea field integrals. 
    168168# 
     
    177177# CHECKIN: indicate computation of global, land and sea field integrals. 
    178178# Interpolation method ou parametres mozaic 
    179 rmp_tICO40_to_ueORCA1.2_WindStress_2ndOrder_MOSAIX_v1.nc src 
     179rmp_tICO40_to_ueORCA1.2_WindStress_2ndOrder_MOSAIX_v2.nc src 
    180180# CHECKOUT: indicate computation of global, land and sea field integrals. 
    181181# 
     
    190190# CHECKIN: indicate computation of global, land and sea field integrals. 
    191191# Interpolation method ou parametres mozaic 
    192 rmp_tICO40_to_ueORCA1.2_WindStress_2ndOrder_MOSAIX_v1.nc src 
     192rmp_tICO40_to_ueORCA1.2_WindStress_2ndOrder_MOSAIX_v2.nc src 
    193193# CHECKOUT: indicate computation of global, land and sea field integrals. 
    194194# 
     
    205205MAPPING 
    206206# Interpolation method or mozaic parameters 
    207 rmp_tICO40_to_veORCA1.2_WindStress_2ndOrder_MOSAIX_v1.nc src 
     207rmp_tICO40_to_veORCA1.2_WindStress_2ndOrder_MOSAIX_v2.nc src 
    208208# CHECKOUT: indicate computation of global, land and sea field integrals. 
    209209# 
     
    219219MAPPING 
    220220# Interpolation method or mozaic parameters 
    221 rmp_tICO40_to_veORCA1.2_WindStress_2ndOrder_MOSAIX_v1.nc src 
     221rmp_tICO40_to_veORCA1.2_WindStress_2ndOrder_MOSAIX_v2.nc src 
    222222# 
    223223# CHECKOUT: indicate computation of global, land and sea field integrals. 
     
    234234MAPPING 
    235235# Interpolation method or mozaic parameters 
    236 rmp_tICO40_to_veORCA1.2_WindStress_2ndOrder_MOSAIX_v1.nc src 
     236rmp_tICO40_to_veORCA1.2_WindStress_2ndOrder_MOSAIX_v2.nc src 
    237237# CHECKOUT: indicate computation of global, land and sea field integrals. 
    238238# 
     
    246246# CHECKIN: indicate computation of global, land and sea field integrals. 
    247247# Interpolation method ou parametres mozaic 
    248 rmp_tICO40_to_teORCA1.2_HeatWaterFluxes_2ndOrder_MOSAIX_v1.nc src 
     248rmp_tICO40_to_teORCA1.2_HeatWaterFluxes_2ndOrder_MOSAIX_v2.nc src 
    249249# CHECKOUT: indicate computation of global, land and sea field integrals. 
    250250#  
     
    259259# CHECKIN: indicate computation of global, land and sea field integrals. 
    260260# Interpolation method ou parametres mozaic 
    261 rmp_tICO40_to_teORCA1.2_HeatWaterFluxes_2ndOrder_MOSAIX_v1.nc src 
     261rmp_tICO40_to_teORCA1.2_HeatWaterFluxes_2ndOrder_MOSAIX_v2.nc src 
    262262# CHECKOUT: indicate computation of global, land and sea field integrals. 
    263263# 
     
    272272# CHECKIN: indicate computation of global, land and sea field integrals. 
    273273# Interpolation method ou parametres mozaic 
    274 rmp_tICO40_to_teORCA1.2_HeatWaterFluxes_2ndOrder_MOSAIX_v1.nc src 
     274rmp_tICO40_to_teORCA1.2_HeatWaterFluxes_2ndOrder_MOSAIX_v2.nc src 
    275275# CHECKOUT: indicate computation of global, land and sea field integrals. 
    276276# 
     
    285285# CHECKIN: indicate computation of global, land and sea field integrals. 
    286286# Interpolation method ou parametres mozaic 
    287 rmp_tICO40_to_teORCA1.2_HeatWaterFluxes_2ndOrder_MOSAIX_v1.nc src 
     287rmp_tICO40_to_teORCA1.2_HeatWaterFluxes_2ndOrder_MOSAIX_v2.nc src 
    288288# CHECKOUT: indicate computation of global, land and sea field integrals. 
    289289# 
     
    298298# CHECKIN: indicate computation of global, land and sea field integrals. 
    299299# Interpolation method ou parametres mozaic 
    300 rmp_tICO40_to_teORCA1.2_HeatWaterFluxes_2ndOrder_MOSAIX_v1.nc src 
     300rmp_tICO40_to_teORCA1.2_HeatWaterFluxes_2ndOrder_MOSAIX_v2.nc src 
    301301# CHECKOUT: indicate computation of global, land and sea field integrals. 
    302302# 
     
    311311# CHECKIN: indicate computation of global, land and sea field integrals. 
    312312# Interpolation method or mozaic parameters 
    313 rmp_tICO40_to_teORCA1.2_HeatWaterFluxes_2ndOrder_MOSAIX_v1.nc src 
     313rmp_tICO40_to_teORCA1.2_HeatWaterFluxes_2ndOrder_MOSAIX_v2.nc src 
    314314# CHECKOUT: indicate computation of global, land and sea field integrals. 
    315315# 
     
    324324# CHECKIN: indicate computation of global, land and sea field integrals. 
    325325# Interpolation method ou parametres mozaic 
    326 rmp_tICO40_to_teORCA1.2_HeatWaterFluxes_2ndOrder_MOSAIX_v1.nc src 
     326rmp_tICO40_to_teORCA1.2_HeatWaterFluxes_2ndOrder_MOSAIX_v2.nc src 
    327327# CHECKOUT: indicate computation of global, land and sea field integrals. 
    328328# 
     
    337337# CHECKIN: indicate computation of global, land and sea field integrals. 
    338338# Interpolation method or mozaic parameters 
    339 rmp_tICO40_to_teORCA1.2_HeatWaterFluxes_2ndOrder_MOSAIX_v1.nc src 
     339rmp_tICO40_to_teORCA1.2_HeatWaterFluxes_2ndOrder_MOSAIX_v2.nc src 
    340340# CHECKOUT: indicate computation of global, land and sea field integrals. 
    341341# 
     
    350350# CHECKIN: indicate computation of global, land and sea field integrals. 
    351351# Interpolation method ou parametres mozaic 
    352 rmp_tICO40_to_teORCA1.2_HeatWaterFluxes_2ndOrder_MOSAIX_v1.nc src 
     352rmp_tICO40_to_teORCA1.2_HeatWaterFluxes_2ndOrder_MOSAIX_v2.nc src 
    353353# CHECKOUT: indicate computation of global, land and sea field integrals. 
    354354# 
     
    363363# CHECKIN: indicate computation of global, land and sea field integrals. 
    364364# Interpolation method ou parametres mozaic 
    365 rmp_tICO40_to_teORCA1.2_HeatWaterFluxes_2ndOrder_MOSAIX_v1.nc src 
     365rmp_tICO40_to_teORCA1.2_HeatWaterFluxes_2ndOrder_MOSAIX_v2.nc src 
    366366# CHECKOUT: indicate computation of global, land and sea field integrals. 
    367367# 
     
    377377# CHECKIN: indicate computation of global, land and sea field integrals. 
    378378# Interpolation method ou parametres mozaic 
    379 rmp_tICO40_to_teORCA1.2_calving_nosouth_MOSAIX_v1.nc dst 
     379rmp_tICO40_to_teORCA1.2_calving_nosouth_MOSAIX_v2.nc dst 
    380380# CHECKOUT: indicate computation of global, land and sea field integrals. 
    381381# 
     
    391391# CHECKIN: indicate computation of global, land and sea field integrals. 
    392392# Interpolation method ou parametres mozaic 
    393 rmp_tICO40_to_teORCA1.2_calving_iceberg_MOSAIX_v1.nc dst 
     393rmp_tICO40_to_teORCA1.2_calving_iceberg_MOSAIX_v2.nc dst 
    3943940.5 0 
    395395# CHECKOUT: indicate computation of global, land and sea field integrals. 
     
    405405# CHECKIN: indicate computation of global, land and sea field integrals. 
    406406# Interpolation method ou parametres mozaic 
    407 rmp_tICO40_to_teORCA1.2_calving_iceshelf_MOSAIX_v1.nc dst 
     407rmp_tICO40_to_teORCA1.2_calving_iceshelf_MOSAIX_v2.nc dst 
    4084080.5 0 
    409409# CHECKOUT: indicate computation of global, land and sea field integrals. 
     
    412412# Field 27 : liquid run-off (river + direct)  (a->o 18) 
    413413# 
    414 COLIQRUN  O_Runoff 32 <freq_coupling_roff_calv>  3  flxat.nc   <output_mode> 
    415 1 16002 362 332 tico  torc  LAG=<lag_atm_roff_calv>  
    416 P  0 P  2 
    417 MAPPING CONSERV BLASNEW 
     414COLIQRUN  O_Runoff 32 <freq_coupling_roff_calv>  4  flxat.nc   <output_mode> 
     4151 16002 362 332 oico  torc  LAG=<lag_atm_roff_calv>  
     416P  0 P  2 
     417LOCTRANS MAPPING CONSERV BLASNEW 
     418AVERAGE 
    418419# Interpolation method ou parametres mozaic 
    419420# weights convert from kg/s to kg/m^2/s 
    420 rmp_tICO40_to_teORCA1.2_runoff_Quantity_to_Surfacic_MOSAIX_v1.nc src 
    421 #rmp_tICO40_to_teORCA1.2_Quantity_MOSAIX_v1.nc src 
    422 #rmp_tICO40_to_teORCA1.2_HeatWaterFluxes_MOSAIX_v1.nc src 
     421rmp_tICO40_to_teORCA1.2_runoff_Quantity_to_Surfacic_MOSAIX_v2.nc dst 
     422#rmp_tICO40_to_teORCA1.2_Quantity_MOSAIX_v2.nc src 
     423#rmp_tICO40_to_teORCA1.2_HeatWaterFluxes_MOSAIX_v2.nc src 
    423424# CONSERV 
    424425GLOBAL bfb 
    425426# change units from m/s to kg/s 
    426 1000 0 
     4271000.0 0 
    427428# CHECKOUT: indicate computation of global, land and sea field integrals. 
    428429# 
  • CONFIG/UNIFORM/v7/IPSLCM7/GENERAL/PARAM/orchidee.def

    r5483 r6296  
    4141# Activate river routing 
    4242# default = y 
    43 RIVER_ROUTING = n  
     43RIVER_ROUTING = _AUTO_ 
     44 
     45# Choice of routing method: standard or simple 
     46ROUTING_METHOD = _AUTO_ 
    4447 
    4548# Activate creation of river_desc.nc file 
     
    133136 
    134137# Activate downregulation for CO2 
    135 DOWNREGULATION_CO2=y 
     138# Set DOWNREGULATION_CO2_NEW=y to activate new revised version of  
     139# downregulation parametrization available in ORCHIDEE_2_0 for  
     140# configurations v6.1.11 or later or in ORCHIDEE_2_2 from revision 6393 and later.  
     141# When DOWNREGULATION_CO2_NEW=y,  
     142# DOWNREGULATION_CO2 will be forced to false by the model. 
     143DOWNREGULATION_CO2_NEW=y 
    136144DOWNREGULATION_CO2_BASELEVEL=380. 
    137145 
     
    218226#************************************************************************ 
    219227# CHEMISTRY_OK_BVOC :  Activate chemistry 
    220 CHEMISTRY_BVOC =  n 
     228CHEMISTRY_BVOC = _AUTO_: DEFAULT=n 
    221229 
    222230# CO2 FOR BVOC - WILKINSON :  CO2 inhibition effect for isoprene based on Wilkinson approach? 
  • CONFIG/UNIFORM/v7/IPSLCM7/GENERAL/PARAM/ping_LMDZ.xml

    r5479 r6296  
    174174   <field id="CMIP6_od550so4so"    field_ref="dummy_not_provided"        /> <!-- P1 (1)  : Stratospheric Optical depth at 550 nm (sulphate only) 2D-field (here we limit the computation of OD to the stratosphere only) -->  
    175175   <field id="CMIP6_od865dust"     field_ref="dummy_not_provided"        /> <!-- P1 (1) atmosphere_optical_thickness_due_to_dust_ambient_aerosol_particles : Optical thickness at 865 nm Dust --> 
     176   <field id="CMIP6_orog"          field_ref="phis" > phis / 9.80665 </field> <!-- P1 (m) surface_altitude : Surface Altitude --> 
    176177   <field id="CMIP6_parasolRefl" field_ref="parasol_refl"                /> <!-- P1 (1) toa_bidirectional_reflectance : PARASOL Reflectance --> 
    177178   <field id="CMIP6_pctisccp"      field_ref="ctpisccp"                  /> <!-- P1 (Pa) air_pressure_at_cloud_top : time-means weighted by the ISCCP Total Cloud Fraction - see  http://cfmip.metoffice.com/COSP.html --> 
  • CONFIG/UNIFORM/v7/IPSLCM7/SOURCES/LMDZ/oasis.F90

    r5479 r6296  
    2424  USE mod_prism_get_proto 
    2525  USE mod_prism_put_proto 
     26#endif 
     27#ifdef CPP_CPLOCNINCA 
     28  USE incaoasis, ONLY : inforcv 
    2629#endif 
    2730#endif 
     
    5962  INTEGER, PARAMETER :: ids_qraiic = 28 
    6063  INTEGER, PARAMETER :: ids_qsnoic = 29 
    61   INTEGER, PARAMETER :: maxsend    = 29  ! Maximum number of fields to send 
     64  INTEGER, PARAMETER :: ids_delta_sst = 30, ids_delta_sal = 31 
     65   
     66  INTEGER, PARAMETER :: maxsend    = 31  ! Maximum number of fields to send 
    6267   
    6368  ! Id for fields received from ocean 
     69 
    6470  INTEGER, PARAMETER :: idr_sisutw = 1 
    6571  INTEGER, PARAMETER :: idr_icecov = 2 
     
    7076  INTEGER, PARAMETER :: idr_curenz = 7 
    7177  INTEGER, PARAMETER :: idr_oceco2 = 8 
    72   INTEGER, PARAMETER :: maxrecv    = 8  ! Maximum number of fields to receive 
    73    
     78 
     79  INTEGER, PARAMETER :: idr_sss = 9 
     80  ! bulk salinity of the surface layer of the ocean, in ppt 
     81 
     82  INTEGER, PARAMETER :: maxrecv    = 9  ! Maximum number of fields to receive 
     83   
     84#ifdef CPP_CPLOCNINCA 
     85  INTEGER, PARAMETER :: idr_ocedms = 1 
     86  INTEGER, PARAMETER :: maxrcv = 1 
     87#endif 
    7488 
    7589  TYPE, PUBLIC ::   FLD_CPL            ! Type for coupling field information 
     
    110124    USE geometry_mod, ONLY: ind_cell_glo                     
    111125    USE mod_phys_lmdz_mpi_data, ONLY: klon_mpi_para_nb 
    112      
    113  
     126    use config_ocean_skin_m, only: activate_ocean_skin 
    114127 
    115128! Local variables 
     
    127140    CHARACTER (len = 80)               :: abort_message  
    128141    LOGICAL, SAVE                      :: cpl_current_omp 
    129     INTEGER, DIMENSION(klon_mpi)           :: ind_cell_glo_mpi 
     142    INTEGER, DIMENSION(klon_mpi)       :: ind_cell_glo_mpi 
    130143 
    131144!*    1. Initializations 
     
    164177 
    165178!************************************************************************************ 
    166 ! Gather global index to be used for oasis decomposition  
     179! Gather global index to be used for oasis decomposition 
    167180!************************************************************************************ 
    168181    CALL gather_omp(ind_cell_glo,ind_cell_glo_mpi) 
     
    189202    infosend(ids_calvin)%action = .TRUE. ; infosend(ids_calvin)%name = 'COCALVIN' 
    190203     
     204    if (activate_ocean_skin == 2) then 
     205       infosend(ids_delta_sst)%action = .TRUE. 
     206       infosend(ids_delta_sst)%name = 'CODELSST' 
     207       infosend(ids_delta_sal)%action = .TRUE. 
     208       infosend(ids_delta_sal)%name = 'CODELSSS' 
     209    end if 
     210            
    191211    IF (version_ocean=='nemo') THEN 
    192212        infosend(ids_shftot)%action = .TRUE. ; infosend(ids_shftot)%name = 'COQSRMIX' 
     
    225245   inforecv(idr_icealw)%action = .TRUE. ; inforecv(idr_icealw)%name = 'SIICEALW' 
    226246   inforecv(idr_icetem)%action = .TRUE. ; inforecv(idr_icetem)%name = 'SIICTEMW' 
     247 
     248   if (activate_ocean_skin >= 1) then 
     249      inforecv(idr_sss)%action = .TRUE. 
     250      inforecv(idr_sss)%name = 'SISUSALW' 
     251   end if 
    227252    
    228253   IF (cpl_current ) THEN 
     
    235260       inforecv(idr_oceco2)%action = .TRUE. ; inforecv(idr_oceco2)%name = 'SICO2FLX' 
    236261   ENDIF 
     262#ifdef CPP_CPLOCNINCA 
     263       inforcv(idr_ocedms)%action = .TRUE. ; inforcv(idr_ocedms)%name = 'SIDMSFLX' 
     264#endif 
    237265 
    238266!************************************************************************************ 
     
    319347       ENDIF 
    320348    END DO 
    321      
     349 
     350! Now, if also coupling CPL with INCA, initialize here fields to be exchanged. 
     351#ifdef CPP_CPLOCNINCA 
     352    DO jf=1,maxrcv  
     353       IF (inforcv(jf)%action) THEN 
     354          CALL prism_def_var_proto(inforcv(jf)%nid, inforcv(jf)%name, il_part_id, & 
     355               il_var_nodims, PRISM_In, il_var_actual_shape, il_var_type, & 
     356               ierror) 
     357          IF (ierror .NE. PRISM_Ok) THEN 
     358             WRITE(lunout,*) 'inicma : Problem with prism_def_var_proto for field : ',& 
     359                  inforcv(jf)%name 
     360             abort_message=' Problem in call to prism_def_var_proto for fields to receive' 
     361             CALL abort_physic(modname,abort_message,1) 
     362          ENDIF 
     363       ENDIF 
     364    END DO 
     365#endif 
     366  
    322367!************************************************************************************ 
    323368! Atmospheric Fields to send 
  • CONFIG/UNIFORM/v7/IPSLCM7/SOURCES/LMDZ/physiq_mod.F90

    r5484 r6296  
    11! 
    2 ! $Id: physiq_mod.F90 3666 2020-04-20 10:13:34Z lfalletti $ 
     2! $Id: physiq_mod.F90 4298 2022-10-17 08:15:06Z pcadule $ 
    33! 
    44!#define IO_DEBUG 
     
    1616       d_u, d_v, d_t, d_qx, d_ps) 
    1717 
     18! For clarity, the "USE" section is now arranged in alphabetical order, 
     19! with a separate section for CPP keys 
     20! PLEASE try to follow this rule  
     21 
     22    USE ACAMA_GWD_rando_m, only: ACAMA_GWD_rando 
     23    USE aero_mod 
     24    USE add_phys_tend_mod, only : add_pbl_tend, add_phys_tend, diag_phys_tend, prt_enerbil, & 
     25  &      fl_ebil, fl_cor_ebil 
    1826    USE assert_m, only: assert 
     27    USE change_srf_frac_mod 
     28    USE conf_phys_m, only: conf_phys 
     29    USE carbon_cycle_mod, ONLY : infocfields_init, RCO2_glo, carbon_cycle_rad 
     30    USE CFMIP_point_locations   ! IM stations CFMIP 
     31    USE cmp_seri_mod 
     32    USE dimphy 
     33    USE etat0_limit_unstruct_mod 
     34    USE FLOTT_GWD_rando_m, only: FLOTT_GWD_rando 
     35    USE fonte_neige_mod, ONLY  : fonte_neige_get_vars 
     36    USE geometry_mod, ONLY: cell_area, latitude_deg, longitude_deg, longitude,latitude, & 
     37         boundslon,boundslat, dx, dy, ind_cell_glo 
    1938    USE ioipsl, only: histbeg, histvert, histdef, histend, histsync, & 
    2039         histwrite, ju2ymds, ymds2ju, getin 
    21     USE geometry_mod, ONLY: cell_area, latitude_deg, longitude_deg 
     40    USE ioipsl_getin_p_mod, ONLY : getin_p 
     41    USE indice_sol_mod 
     42    USE infotrac_phy, ONLY: nqtot, nbtr, nqo, tracers, types_trac, nqCO2 
     43    USE readTracFiles_mod, ONLY: addPhase 
     44    USE strings_mod,  ONLY: strIdx 
     45    USE iophy 
     46    USE limit_read_mod, ONLY : init_limit_read 
     47    USE mod_grid_phy_lmdz, ONLY: nbp_lon, nbp_lat, nbp_lev, klon_glo, grid1dTo2d_glo, grid_type, unstructured 
     48    USE mod_phys_lmdz_mpi_data, only: is_mpi_root 
     49    USE mod_phys_lmdz_para 
     50    USE netcdf95, only: nf95_close 
     51    USE netcdf, only: nf90_fill_real     ! IM for NMC files 
     52    USE open_climoz_m, only: open_climoz ! ozone climatology from a file 
     53    USE ozonecm_m, only: ozonecm ! ozone of J.-F. Royer 
     54    USE pbl_surface_mod, ONLY : pbl_surface 
     55    USE phyaqua_mod, only: zenang_an 
     56    USE phystokenc_mod, ONLY: offline, phystokenc 
    2257    USE phys_cal_mod, only: year_len, mth_len, days_elapsed, jh_1jan, & 
    23          year_cur, mth_cur,jD_cur, jH_cur, jD_ref, day_cur, hour 
     58         year_cur, mth_cur,jD_cur, jH_cur, jD_ref, day_cur, hour, calend 
     59!!  USE phys_local_var_mod, ONLY : a long list of variables 
     60!!              ==> see below, after "CPP Keys" section 
     61    USE phys_state_var_mod ! Variables sauvegardees de la physique 
     62    USE phys_output_mod 
     63    USE phys_output_ctrlout_mod 
     64    USE print_control_mod, ONLY: mydebug=>debug , lunout, prt_level, & 
     65         alert_first_call, call_alert, prt_alerte 
     66    USE readaerosol_mod, ONLY : init_aero_fromfile 
     67    USE readaerosolstrato_m, ONLY : init_readaerosolstrato 
     68    USE radlwsw_m, only: radlwsw 
     69    USE regr_horiz_time_climoz_m, ONLY: regr_horiz_time_climoz 
     70    USE regr_pr_time_av_m, only: regr_pr_time_av 
     71    USE surface_data,     ONLY : type_ocean, ok_veget, landice_opt 
     72    USE time_phylmdz_mod, only: annee_ref, current_time, day_ini, day_ref, & 
     73          day_step_phy, itau_phy, pdtphys, raz_date, start_time, update_time, ndays 
     74    USE tracinca_mod, ONLY: config_inca 
     75    USE tropopause_m,     ONLY: dyn_tropopause 
     76    USE ice_sursat_mod,  ONLY: flight_init, airplane 
     77    USE vampir 
     78    USE VERTICAL_LAYERS_MOD, ONLY: aps,bps, ap, bp 
    2479    USE write_field_phy 
    25     USE dimphy 
    26     USE infotrac_phy, ONLY: nqtot, nbtr, nqo, type_trac 
    27     USE mod_grid_phy_lmdz, ONLY: nbp_lon, nbp_lat, nbp_lev, klon_glo, grid1dTo2d_glo, grid_type, unstructured 
    28     USE mod_phys_lmdz_para 
    29     USE iophy 
    30     USE print_control_mod, ONLY: mydebug=>debug , lunout, prt_level 
    31     USE phystokenc_mod, ONLY: offline, phystokenc 
    32     USE time_phylmdz_mod, only: raz_date, day_step_phy, update_time,current_time 
    33     USE vampir 
    34     USE pbl_surface_mod, ONLY : pbl_surface 
    35     USE change_srf_frac_mod 
    36     USE surface_data,     ONLY : type_ocean, ok_veget, ok_snow 
    37     USE tropopause_m,     ONLY: dyn_tropopause 
     80#ifdef CPP_XIOS 
     81    USE wxios, ONLY: g_ctx, wxios_set_context 
     82#endif 
     83    USE lscp_mod, ONLY : lscp 
     84    USE wake_ini_mod, ONLY : wake_ini 
     85    USE thermcell_ini_mod, ONLY : thermcell_ini 
     86 
     87    !USE cmp_seri_mod 
     88!    USE add_phys_tend_mod, only : add_pbl_tend, add_phys_tend, diag_phys_tend, prt_enerbil, & 
     89!  &      fl_ebil, fl_cor_ebil 
     90 
     91!!!!!!!!!!!!!!!!!! "USE" section for CPP keys !!!!!!!!!!!!!!!!!!!!!!!! 
     92! 
     93! 
    3894#ifdef CPP_Dust 
    39     USE phytracr_spl_mod, ONLY: phytracr_spl 
     95    USE phytracr_spl_mod, ONLY: phytracr_spl, phytracr_spl_out_init 
     96    USE phys_output_write_spl_mod 
     97#else 
     98    USE phytrac_mod, ONLY : phytrac_init, phytrac 
     99    USE phys_output_write_mod 
    40100#endif 
     101 
     102 
     103#ifdef REPROBUS 
     104    USE CHEM_REP, ONLY : Init_chem_rep_xjour, & 
     105         d_q_rep,d_ql_rep,d_qi_rep,ptrop,ttrop, & 
     106         ztrop, gravit,itroprep, Z1,Z2,fac,B 
     107#endif 
     108 
     109 
     110#ifdef CPP_RRTM 
     111    USE YOERAD, ONLY : NRADLP 
     112    USE YOESW, ONLY : RSUN 
     113#endif 
     114 
     115 
    41116#ifdef CPP_StratAer 
    42117    USE strataer_mod, ONLY: strataer_init 
    43118#endif 
    44     USE phys_local_var_mod, ONLY: phys_local_var_init, phys_local_var_end, & 
     119 
     120 
     121#ifdef CPP_XIOS 
     122    USE xios, ONLY: xios_update_calendar, xios_context_finalize 
     123    USE xios, ONLY: xios_get_field_attr, xios_field_is_active, xios_context 
     124    USE xios, ONLY: xios_set_current_context 
     125    USE wxios, ONLY: missing_val, missing_val_omp 
     126#endif 
     127#ifndef CPP_XIOS 
     128    USE paramLMDZ_phy_mod 
     129#endif 
     130! 
     131! 
     132!!!!!!!!!!!!!!!!!!  END "USE" for CPP keys !!!!!!!!!!!!!!!!!!!!!! 
     133 
     134USE phys_local_var_mod, ONLY: phys_local_var_init, phys_local_var_end, & 
    45135       ! [Variables internes non sauvegardees de la physique] 
    46136       ! Variables locales pour effectuer les appels en serie 
    47        t_seri,q_seri,ql_seri,qs_seri,u_seri,v_seri,tr_seri, & 
     137       t_seri,q_seri,ql_seri,qs_seri,u_seri,v_seri,tr_seri,rneb_seri, & 
    48138       ! Dynamic tendencies (diagnostics) 
    49        d_t_dyn,d_q_dyn,d_ql_dyn,d_qs_dyn,d_u_dyn,d_v_dyn,d_tr_dyn, & 
     139       d_t_dyn,d_q_dyn,d_ql_dyn,d_qs_dyn,d_u_dyn,d_v_dyn,d_tr_dyn,d_rneb_dyn, & 
    50140       d_q_dyn2d,d_ql_dyn2d,d_qs_dyn2d, & 
    51141       ! Physic tendencies 
     
    66156       ! 
    67157       d_t_vdf,d_q_vdf,d_u_vdf,d_v_vdf,d_t_diss, & 
     158       d_t_vdf_x, d_t_vdf_w, & 
     159       d_q_vdf_x, d_q_vdf_w, & 
    68160       d_ts, & 
    69161       ! 
     
    119211       cdragm, cdragh,                   & 
    120212       zustar, zu10m, zv10m, rh2m, qsat2m, & 
    121        zq2m, zt2m, weak_inversion, & 
    122        zq2m_cor,zt2m_cor,zu10m_cor,zv10m_cor, & ! pour corriger d'un bug 
    123        zrh2m_cor,zqsat2m_cor, & 
     213       zq2m, zt2m, zn2mout, weak_inversion, & 
    124214       zt2m_min_mon, zt2m_max_mon,   &         ! pour calcul_divers.h 
    125215       t2m_min_mon, t2m_max_mon,  &            ! pour calcul_divers.h 
     
    134224       zxrunofflic,                            & 
    135225       zxtsol, snow_lsc, zxfqfonte, zxqsurf,   & 
     226       delta_qsurf,                            & 
    136227       rain_lsc, rain_num,                     & 
    137228       ! 
     
    139230       zxfluxlat_x, zxfluxlat_w, & 
    140231       ! 
    141        d_t_vdf_x, d_t_vdf_w, & 
    142        d_q_vdf_x, d_q_vdf_w, & 
    143        pbl_tke_input, & 
     232       pbl_tke_input, tke_dissip, l_mix, wprime,& 
    144233       t_therm, q_therm, u_therm, v_therm, & 
    145234       cdragh_x, cdragh_w, & 
     
    168257       alp_bl_stat, n2, s2,  & 
    169258       proba_notrig, random_notrig,  & 
    170        cv_gen,  & 
     259!!       cv_gen,  &  !moved to phys_state_var_mod 
    171260       ! 
    172261       dnwd0,  & 
     
    195284       ref_liq, ref_ice, theta,  & 
    196285       ref_liq_pi, ref_ice_pi,  & 
    197        zphi, zx_rh, & 
     286       zphi, zx_rh, zx_rhl, zx_rhi, & 
    198287       pmfd, pmfu,  & 
    199288       ! 
     
    216305       zxsnow,snowhgt,qsnow,to_ice,sissnow,runoff,albsol3_lic 
    217306       ! 
    218     USE phys_state_var_mod ! Variables sauvegardees de la physique 
    219 #ifdef CPP_Dust 
    220     USE phys_output_write_spl_mod 
    221 #else 
    222     USE phys_output_var_mod ! Variables pour les ecritures des sorties 
    223 #endif 
    224  
    225     USE phys_output_write_mod 
    226     USE fonte_neige_mod, ONLY  : fonte_neige_get_vars 
    227     USE phys_output_mod 
    228     USE phys_output_ctrlout_mod 
    229     USE open_climoz_m, only: open_climoz ! ozone climatology from a file 
    230     USE regr_pr_time_av_m, only: regr_pr_time_av 
    231     USE netcdf95, only: nf95_close 
    232     !IM for NMC files 
    233     USE netcdf, only: nf90_fill_real 
    234     USE mod_phys_lmdz_mpi_data, only: is_mpi_root 
    235     USE aero_mod 
    236     USE ozonecm_m, only: ozonecm ! ozone of J.-F. Royer 
    237     USE conf_phys_m, only: conf_phys 
    238     USE radlwsw_m, only: radlwsw 
    239     USE phyaqua_mod, only: zenang_an 
    240     USE time_phylmdz_mod, only: day_step_phy, annee_ref, day_ref, itau_phy, & 
    241          start_time, pdtphys, day_ini 
    242     USE tracinca_mod, ONLY: config_inca 
    243 #ifdef CPP_XIOS 
    244     USE wxios, ONLY: missing_val, missing_val_omp 
    245     USE xios, ONLY: xios_get_field_attr, xios_field_is_active 
    246 #endif 
    247 #ifdef REPROBUS 
    248     USE CHEM_REP, ONLY : Init_chem_rep_xjour, & 
    249          d_q_rep,d_ql_rep,d_qi_rep,ptrop,ttrop, & 
    250          ztrop, gravit,itroprep, Z1,Z2,fac,B 
    251 #endif 
    252     USE indice_sol_mod 
    253     USE phytrac_mod, ONLY : phytrac_init, phytrac 
    254     USE carbon_cycle_mod, ONLY : infocfields_init, RCO2_glo, carbon_cycle_rad 
    255  
    256 #ifdef CPP_RRTM 
    257     USE YOERAD, ONLY : NRADLP 
    258     USE YOESW, ONLY : RSUN 
    259 #endif 
    260     USE ioipsl_getin_p_mod, ONLY : getin_p 
    261  
    262 #ifndef CPP_XIOS 
    263     USE paramLMDZ_phy_mod 
    264 #endif 
    265  
    266     USE cmp_seri_mod 
    267     USE add_phys_tend_mod, only : add_pbl_tend, add_phys_tend, diag_phys_tend, prt_enerbil, & 
    268   &      fl_ebil, fl_cor_ebil 
    269  
    270     !IM stations CFMIP 
    271     USE CFMIP_point_locations 
    272     USE FLOTT_GWD_rando_m, only: FLOTT_GWD_rando 
    273     USE ACAMA_GWD_rando_m, only: ACAMA_GWD_rando 
    274     USE VERTICAL_LAYERS_MOD, ONLY: aps,bps, ap, bp 
    275     USE etat0_limit_unstruct_mod 
    276 #ifdef CPP_XIOS 
    277     USE xios, ONLY: xios_update_calendar, xios_context_finalize 
    278 #endif 
    279     USE limit_read_mod, ONLY : init_limit_read 
    280     USE regr_horiz_time_climoz_m, ONLY: regr_horiz_time_climoz 
    281     USE readaerosol_mod, ONLY : init_aero_fromfile 
    282     USE readaerosolstrato_m, ONLY : init_readaerosolstrato 
    283307 
    284308    IMPLICIT NONE 
     
    336360    include "dimsoil.h" 
    337361    include "clesphys.h" 
    338     include "thermcell.h" 
     362    include "alpale.h" 
    339363    include "dimpft.h" 
    340364    !====================================================================== 
    341365    LOGICAL, SAVE :: ok_volcan ! pour activer les diagnostics volcaniques 
    342366    !$OMP THREADPRIVATE(ok_volcan) 
     367    INTEGER, SAVE :: flag_volc_surfstrat ! pour imposer le cool/heat rate à la surf/strato 
     368    !$OMP THREADPRIVATE(flag_volc_surfstrat) 
    343369    LOGICAL ok_cvl  ! pour activer le nouveau driver pour convection KE 
    344370    PARAMETER (ok_cvl=.TRUE.) 
     
    421447    !====================================================================== 
    422448    ! 
    423     INTEGER ivap          ! indice de traceurs pour vapeur d'eau 
    424     PARAMETER (ivap=1) 
    425     INTEGER iliq          ! indice de traceurs pour eau liquide 
    426     PARAMETER (iliq=2) 
    427     !CR: on ajoute la phase glace 
    428     INTEGER isol          ! indice de traceurs pour eau glace 
    429     PARAMETER (isol=3) 
     449    ! indices de traceurs eau vapeur, liquide, glace, fraction nuageuse LS (optional) 
     450    INTEGER,SAVE :: ivap, iliq, isol, irneb 
     451!$OMP THREADPRIVATE(ivap, iliq, isol, irneb) 
    430452    ! 
    431453    ! 
     
    469491    REAL dtadd(klon,klev) 
    470492 
     493!#ifdef CPP_XIOS 
     494!    TYPE(xios_context), SAVE :: g_ctx 
     495!#endif 
     496 
    471497#ifndef CPP_XIOS 
    472498    REAL, SAVE :: missing_val=nf90_fill_real 
     
    602628                                                        ! gust-front in the grid cell. 
    603629    !$OMP THREADPRIVATE(iflag_alp_wk_cond) 
    604  
    605     INTEGER,  SAVE               :: iflag_bug_t2m_ipslcm61=1 ! 
    606     !$OMP THREADPRIVATE(iflag_bug_t2m_ipslcm61) 
    607     INTEGER,  SAVE               :: iflag_bug_t2m_stab_ipslcm61=-1 ! 
    608     !$OMP THREADPRIVATE(iflag_bug_t2m_stab_ipslcm61) 
    609630 
    610631    REAL t_w(klon,klev),q_w(klon,klev) ! temperature and moisture profiles in the wake region 
     
    842863    real zqsat(klon,klev) 
    843864    ! 
    844     INTEGER i, k, iq, j, nsrf, ll, l 
     865    INTEGER i, k, iq, j, nsrf, ll, l, itr 
    845866    ! 
    846867    REAL t_coup 
     
    949970    !IM cf. AM 081204 BEG 
    950971    LOGICAL ptconvth(klon,klev) 
     972 
     973    REAL picefra(klon,klev) 
    951974    !IM cf. AM 081204 END 
    952975    ! 
     
    10201043!JLD    REAL zstophy, zout 
    10211044 
    1022     CHARACTER*20 modname 
     1045    CHARACTER (LEN=20) :: modname='physiq_mod' 
    10231046    CHARACTER*80 abort_message 
    10241047    LOGICAL, SAVE ::  ok_sync, ok_sync_omp 
     
    11721195    integer iostat 
    11731196 
     1197    REAL, dimension(klon,klev+1) :: tke_dissip_ave, l_mix_ave, wprime_ave 
    11741198    REAL zzz 
    11751199    !albedo SB >>> 
     
    11861210    pi = 4. * ATAN(1.) 
    11871211 
     1212    ! set-up call to alerte function 
     1213    call_alert = (alert_first_call .AND. is_master) 
     1214     
    11881215    ! Ehouarn: set value of jjmp1 since it is no longer a "fixed parameter" 
    11891216    jjmp1=nbp_lat 
     
    11961223    phys_tstep=NINT(pdtphys) 
    11971224#ifdef CPP_XIOS 
    1198     IF (.NOT. debut .AND. is_omp_master) CALL xios_update_calendar(itap+1) 
     1225! switch to XIOS LMDZ physics context  
     1226!!!!$OMP MASTER 
     1227!!!!    WRITE(*,*)'PHYSICS XIOS Context :', g_ctx 
     1228!!!!    CALL wxios_set_context() 
     1229!!!!$OMP END MASTER 
     1230    IF (.NOT. debut .AND. is_omp_master) THEN 
     1231       CALL wxios_set_context() 
     1232       CALL xios_update_calendar(itap+1) 
     1233    ENDIF 
    11991234#endif 
    12001235 
     
    12301265 
    12311266    IF (first) THEN  
     1267       ivap = strIdx(tracers(:)%name, addPhase('H2O', 'g')) 
     1268       iliq = strIdx(tracers(:)%name, addPhase('H2O', 'l')) 
     1269       isol = strIdx(tracers(:)%name, addPhase('H2O', 's')) 
     1270       irneb= strIdx(tracers(:)%name, addPhase('H2O', 'r')) 
     1271!       CALL init_etat0_limit_unstruct 
     1272!       IF (.NOT. create_etat0_limit) CALL init_limit_read(days_elapsed) 
    12321273       !CR:nvelles variables convection/poches froides 
    12331274 
     
    12451286            fact_cldcon, facttemps,ok_newmicro,iflag_radia, & 
    12461287            iflag_cld_th,iflag_ratqs,ratqsbas,ratqshaut,tau_ratqs, & 
    1247             ok_ade, ok_aie, ok_alw, ok_cdnc, ok_volcan, aerosol_couple, & 
    1248             chemistry_couple, & 
    1249             flag_aerosol, flag_aerosol_strat, flag_aer_feedback, & 
     1288            ok_ade, ok_aie, ok_alw, ok_cdnc, ok_volcan, flag_volc_surfstrat, aerosol_couple, & 
     1289            chemistry_couple, flag_aerosol, flag_aerosol_strat, flag_aer_feedback, & 
    12501290            flag_bc_internal_mixture, bl95_b0, bl95_b1, & 
    12511291                                ! nv flags pour la convection et les 
     
    12641304#endif 
    12651305 
     1306       !!CALL flight_init 
     1307 
    12661308       print*, '=================================================' 
    12671309       ! 
     
    12691311       IF ((iflag_ice_thermo.gt.0).and.(nqo==2)) THEN 
    12701312          WRITE (lunout, *) ' iflag_ice_thermo==1 requires 3 H2O tracers ', & 
    1271                '(H2Ov, H2Ol, H2Oi) but nqo=', nqo, '. Might as well stop here.' 
     1313               '(H2O_g, H2O_l, H2O_s) but nqo=', nqo, '. Might as well stop here.' 
     1314          abort_message='see above' 
     1315          CALL abort_physic(modname,abort_message,1) 
     1316       ENDIF 
     1317 
     1318       IF (ok_ice_sursat.AND.(iflag_ice_thermo.EQ.0)) THEN 
     1319          WRITE (lunout, *) ' ok_ice_sursat=y requires iflag_ice_thermo=1 as well' 
     1320          abort_message='see above' 
     1321          CALL abort_physic(modname,abort_message,1) 
     1322       ENDIF 
     1323 
     1324       IF (ok_ice_sursat.AND.(nqo.NE.4)) THEN 
     1325          WRITE (lunout, *) ' ok_ice_sursat=y requires 4 H2O tracers ', & 
     1326               '(H2O_g, H2O_l, H2O_s, H2O_r) but nqo=', nqo, '. Might as well stop here.' 
     1327          abort_message='see above' 
     1328          CALL abort_physic(modname,abort_message,1) 
     1329       ENDIF 
     1330 
     1331       IF (ok_plane_h2o.AND..NOT.ok_ice_sursat) THEN 
     1332          WRITE (lunout, *) ' ok_plane_h2o=y requires ok_ice_sursat=y ' 
     1333          abort_message='see above' 
     1334          CALL abort_physic(modname,abort_message,1) 
     1335       ENDIF 
     1336 
     1337       IF (ok_plane_contrail.AND..NOT.ok_ice_sursat) THEN 
     1338          WRITE (lunout, *) ' ok_plane_contrail=y requires ok_ice_sursat=y ' 
    12721339          abort_message='see above' 
    12731340          CALL abort_physic(modname,abort_message,1) 
     
    13031370    forall (k=1: nbp_lev) zmasse(:, k) = (paprs(:, k)-paprs(:, k+1)) / rg 
    13041371 
    1305     modname = 'physiq' 
    13061372 
    13071373    IF (debut) THEN 
     
    13141380       tau_gl=86400.*tau_gl 
    13151381       WRITE(lunout,*) 'debut physiq_mod tau_gl=',tau_gl 
    1316  
    1317        iflag_bug_t2m_ipslcm61 = 1 
    1318        CALL getin_p('iflag_bug_t2m_ipslcm61', iflag_bug_t2m_ipslcm61) 
    1319        iflag_bug_t2m_stab_ipslcm61 = -1 
    1320        CALL getin_p('iflag_bug_t2m_stab_ipslcm61', iflag_bug_t2m_stab_ipslcm61) 
    13211382 
    13221383       CALL getin_p('iflag_alp_wk_cond', iflag_alp_wk_cond)  
     
    13471408       iflag_phytrac = 1 ! by default we do want to call phytrac 
    13481409       CALL getin_p('iflag_phytrac',iflag_phytrac) 
     1410#ifdef CPP_Dust 
     1411       IF (iflag_phytrac.EQ.0) THEN  
     1412         WRITE(lunout,*) 'In order to run with SPLA, iflag_phytrac will be forced to 1' 
     1413         iflag_phytrac = 1 
     1414       ENDIF 
     1415#endif 
    13491416       nvm_lmdz = 13 
    13501417       CALL getin_p('NVM',nvm_lmdz) 
     
    14041471       tau_overturning_th(:)=0. 
    14051472 
    1406        IF (type_trac == 'inca') THEN 
     1473       IF (ANY(types_trac == 'inca') .OR. ANY(types_trac == 'inco')) THEN 
    14071474          ! jg : initialisation jusqu'au ces variables sont dans restart 
    14081475          ccm(:,:,:) = 0. 
     
    16091676#ifdef CPP_COSP 
    16101677      IF (ok_cosp) THEN 
    1611            DO k = 1, klev 
    1612              DO i = 1, klon 
    1613                phicosp(i,k) = pphi(i,k) + pphis(i) 
    1614              ENDDO 
    1615            ENDDO 
     1678!           DO k = 1, klev 
     1679!             DO i = 1, klon 
     1680!               phicosp(i,k) = pphi(i,k) + pphis(i) 
     1681!             ENDDO 
     1682!           ENDDO 
    16161683        CALL phys_cosp(itap,phys_tstep,freq_cosp, & 
    16171684               ok_mensuelCOSP,ok_journeCOSP,ok_hfCOSP, & 
     
    16311698#ifdef CPP_COSP2 
    16321699        IF (ok_cosp) THEN 
    1633            DO k = 1, klev 
    1634              DO i = 1, klon 
    1635                phicosp(i,k) = pphi(i,k) + pphis(i) 
    1636              ENDDO 
    1637            ENDDO 
     1700!           DO k = 1, klev 
     1701!             DO i = 1, klon 
     1702!               phicosp(i,k) = pphi(i,k) + pphis(i) 
     1703!             ENDDO 
     1704!           ENDDO 
    16381705          CALL phys_cosp2(itap,phys_tstep,freq_cosp, & 
    16391706               ok_mensuelCOSP,ok_journeCOSP,ok_hfCOSP, & 
     
    16771744!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 
    16781745       ! Nouvelle initialisation pour le rayonnement RRTM 
    1679        ! 
    16801746!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 
    16811747 
    16821748       CALL iniradia(klon,klev,paprs(1,1:klev+1)) 
    1683        ! Initialisation des champs dans phytrac qui sont utilisés par phys_output_write 
     1749 
     1750!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 
     1751       CALL wake_ini(rg,rd,rv,prt_level) 
     1752       CALL thermcell_ini(iflag_thermals,prt_level,tau_thermals,lunout, & 
     1753   &    RG,RD,RCPD,RKAPPA,RLVTT,RETV) 
     1754 
     1755!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 
     1756 
     1757       ! 
     1758!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 
     1759       ! Initialisation des champs dans phytrac* qui sont utilises par phys_output_write* 
     1760       ! 
     1761!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 
     1762 
     1763#ifdef CPP_Dust 
     1764       ! Quand on utilise SPLA, on force iflag_phytrac=1 
     1765       CALL phytracr_spl_out_init() 
     1766       CALL phys_output_write_spl(itap, pdtphys, paprs, pphis,                  & 
     1767                                pplay, lmax_th, aerosol_couple,                 & 
     1768                                ok_ade, ok_aie, ivap, ok_sync,                  & 
     1769                                ptconv, read_climoz, clevSTD,                   & 
     1770                                ptconvth, d_t, qx, d_qx, d_tr_dyn, zmasse,      & 
     1771                                flag_aerosol, flag_aerosol_strat, ok_cdnc) 
     1772#else 
     1773       ! phys_output_write écrit des variables traceurs seulement si iflag_phytrac == 1  
     1774       ! donc seulement dans ce cas on doit appeler phytrac_init() 
    16841775       IF (iflag_phytrac == 1 ) THEN 
    16851776          CALL phytrac_init() 
    1686         ENDIF 
    1687  
     1777       ENDIF 
    16881778       CALL phys_output_write(itap, pdtphys, paprs, pphis,                    & 
    16891779                              pplay, lmax_th, aerosol_couple,                 & 
     
    16921782                              ptconvth, d_u, d_t, qx, d_qx, zmasse,           & 
    16931783                              flag_aerosol, flag_aerosol_strat, ok_cdnc) 
     1784#endif 
     1785 
    16941786 
    16951787#ifdef CPP_XIOS 
     
    17131805            ENDDO 
    17141806          ENDDO 
    1715         ELSE 
     1807       ELSE 
    17161808          pbl_tke(:,:,is_ave) = 0. !ym missing init : maybe must be initialized in the same way that for klon_glo==1 ?? 
    17171809!>jyg 
     
    17571849          CALL abort_physic(modname,abort_message,1) 
    17581850       ENDIF 
     1851 
     1852!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 
     1853       ! Initialisation pour la convection de K.E. et pour les poches froides 
     1854       ! 
     1855!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 
     1856 
    17591857       WRITE(lunout,*)"Clef pour la convection, iflag_con=", iflag_con 
    1760        WRITE(lunout,*)"Clef pour le driver de la convection, ok_cvl=", & 
    1761             ok_cvl 
     1858       WRITE(lunout,*)"Clef pour le driver de la convection, ok_cvl=", ok_cvl 
    17621859       ! 
    17631860       !KE43 
     
    18061903             d_s_wk(:) = 0. 
    18071904             d_dens_wk(:) = 0. 
    1808           ENDIF 
     1905          ENDIF  !  (iflag_wake>=1) 
    18091906 
    18101907          !        do i = 1,klon 
     
    18171914       !   ALLOCATE(lonGCM(0), latGCM(0)) 
    18181915       !   ALLOCATE(iGCM(0), jGCM(0)) 
    1819        ENDIF 
    1820  
     1916       ENDIF  !  (iflag_con.GE.3) 
     1917       ! 
    18211918       DO i=1,klon 
    18221919          rugoro(i) = f_rugoro * MAX(1.0e-05, zstd(i)*zsig(i)/2.0) 
     
    18871984       !$OMP BARRIER 
    18881985       missing_val=missing_val_omp 
     1986       !  
     1987       ! Now we activate some double radiation call flags only if some 
     1988       ! diagnostics are requested, otherwise there is no point in doing this 
     1989       IF (is_master) THEN 
     1990         !--setting up swaero_diag to TRUE in XIOS case  
     1991         IF (xios_field_is_active("topswad").OR.xios_field_is_active("topswad0").OR. &  
     1992            xios_field_is_active("solswad").OR.xios_field_is_active("solswad0").OR. &  
     1993            xios_field_is_active("topswai").OR.xios_field_is_active("solswai").OR.  &  
     1994              (iflag_rrtm==1.AND.(xios_field_is_active("toplwad").OR.xios_field_is_active("toplwad0").OR. &  
     1995                                  xios_field_is_active("sollwad").OR.xios_field_is_active("sollwad0"))))  &  
     1996            !!!--for now these fields are not in the XML files so they are omitted  
     1997            !!!  xios_field_is_active("toplwai").OR.xios_field_is_active("sollwai") !))) &  
     1998            swaero_diag=.TRUE.  
     1999  
     2000         !--setting up swaerofree_diag to TRUE in XIOS case  
     2001         IF (xios_field_is_active("SWdnSFCcleanclr").OR.xios_field_is_active("SWupSFCcleanclr").OR. & 
     2002            xios_field_is_active("SWupTOAcleanclr").OR.xios_field_is_active("rsucsaf").OR.   & 
     2003            xios_field_is_active("rsdcsaf") .OR. xios_field_is_active("LWdnSFCcleanclr").OR. & 
     2004            xios_field_is_active("LWupTOAcleanclr")) & 
     2005            swaerofree_diag=.TRUE.  
     2006  
     2007         !--setting up dryaod_diag to TRUE in XIOS case  
     2008         DO naero = 1, naero_tot-1 
     2009          IF (xios_field_is_active("dryod550_"//name_aero_tau(naero))) dryaod_diag=.TRUE.  
     2010         ENDDO 
     2011         ! 
     2012         !--setting up ok_4xCO2atm to TRUE in XIOS case  
     2013         IF (xios_field_is_active("rsut4co2").OR.xios_field_is_active("rlut4co2").OR. &  
     2014            xios_field_is_active("rsutcs4co2").OR.xios_field_is_active("rlutcs4co2").OR. & 
     2015            xios_field_is_active("rsu4co2").OR.xios_field_is_active("rsucs4co2").OR. & 
     2016            xios_field_is_active("rsd4co2").OR.xios_field_is_active("rsdcs4co2").OR. & 
     2017            xios_field_is_active("rlu4co2").OR.xios_field_is_active("rlucs4co2").OR. & 
     2018            xios_field_is_active("rld4co2").OR.xios_field_is_active("rldcs4co2")) & 
     2019            ok_4xCO2atm=.TRUE.  
     2020       ENDIF 
     2021       !$OMP BARRIER 
     2022       CALL bcast(swaero_diag) 
     2023       CALL bcast(swaerofree_diag) 
     2024       CALL bcast(dryaod_diag) 
     2025       CALL bcast(ok_4xCO2atm) 
    18892026#endif  
    1890  
    1891  
     2027       ! 
    18922028       CALL printflag( tabcntr0,radpas,ok_journe, & 
    18932029            ok_instan, ok_region ) 
    18942030       ! 
    18952031       ! 
    1896        ! 
    18972032       ! Prescrire l'ozone dans l'atmosphere 
    1898        ! 
    18992033       ! 
    19002034       !c         DO i = 1, klon 
     
    19042038       !c         ENDDO 
    19052039       ! 
    1906        IF (type_trac == 'inca') THEN 
     2040       IF (ANY(types_trac == 'inca') .OR. ANY(types_trac == 'inco')) THEN ! ModThL 
    19072041#ifdef INCA 
    19082042          CALL VTe(VTphysiq) 
     
    19112045          WRITE(lunout,*) 'initial time chemini', days_elapsed, calday 
    19122046 
    1913           CALL chemini(  & 
    1914                rg, & 
    1915                ra, & 
    1916                cell_area, & 
    1917                latitude_deg, & 
    1918                longitude_deg, & 
    1919                presnivs, & 
    1920                calday, & 
    1921                klon, & 
    1922                nqtot, & 
    1923                nqo, & 
    1924                pdtphys, & 
    1925                annee_ref, & 
    1926                year_cur, & 
    1927                day_ref,  & 
    1928                day_ini, & 
    1929                start_time, & 
    1930                itau_phy, & 
    1931                date0, & 
    1932                io_lon, & 
    1933                io_lat, & 
    1934                chemistry_couple, & 
    1935                init_source, & 
    1936                init_tauinca, & 
    1937                init_pizinca, & 
    1938                init_cginca, & 
    1939                init_ccminca) 
     2047          call init_const_lmdz( & 
     2048          ndays, nbsrf, is_oce,is_sic, is_ter,is_lic, calend, & 
     2049          config_inca) 
     2050 
     2051          CALL init_inca_geometry( &  
     2052               longitude, latitude, & 
     2053               boundslon, boundslat, & 
     2054               cell_area, ind_cell_glo)  
     2055 
     2056          if (grid_type==unstructured) THEN  
     2057             CALL chemini(  pplay, & 
     2058                  nbp_lon, nbp_lat, & 
     2059                  latitude_deg, & 
     2060                  longitude_deg, & 
     2061                  presnivs, & 
     2062                  calday, & 
     2063                  klon, & 
     2064                  nqtot, & 
     2065                  nqo+nqCO2, & 
     2066                  pdtphys, & 
     2067                  annee_ref, & 
     2068                  year_cur, & 
     2069                  day_ref,  & 
     2070                  day_ini, & 
     2071                  start_time, & 
     2072                  itau_phy, & 
     2073                  date0, & 
     2074                  chemistry_couple, & 
     2075                  init_source, & 
     2076                  init_tauinca, & 
     2077                  init_pizinca, & 
     2078                  init_cginca, & 
     2079                  init_ccminca) 
     2080          ELSE 
     2081             CALL chemini(  pplay, & 
     2082                  nbp_lon, nbp_lat, & 
     2083                  latitude_deg, & 
     2084                  longitude_deg, & 
     2085                  presnivs, & 
     2086                  calday, & 
     2087                  klon, & 
     2088                  nqtot, & 
     2089                  nqo+nqCO2, & 
     2090                  pdtphys, & 
     2091                  annee_ref, & 
     2092                  year_cur, & 
     2093                  day_ref,  & 
     2094                  day_ini, & 
     2095                  start_time, & 
     2096                  itau_phy, & 
     2097                  date0, & 
     2098                  chemistry_couple, & 
     2099                  init_source, & 
     2100                  init_tauinca, & 
     2101                  init_pizinca, & 
     2102                  init_cginca, & 
     2103                  init_ccminca, & 
     2104                  io_lon, & 
     2105                  io_lat) 
     2106          ENDIF 
    19402107 
    19412108 
     
    19522119#endif 
    19532120       ENDIF 
    1954        IF (type_trac == 'repr') THEN 
     2121       ! 
     2122       IF (ANY(types_trac == 'repr')) THEN 
    19552123#ifdef REPROBUS 
    19562124          CALL chemini_rep(  & 
     
    20002168          SFRWL(6)=3.02191470E-02 
    20012169       END SELECT 
    2002  
    2003  
    20042170       !albedo SB <<< 
    20052171 
     
    20402206 
    20412207 
     2208 
    20422209    ENDIF 
    20432210    ! 
     
    20552222      ENDIF 
    20562223    ENDIF 
     2224! switch to XIOS LMDZ physics context just in case 
     2225!$OMP MASTER 
     2226!!!!#ifdef CPP_XIOS 
     2227!!!!    WRITE(*,*)'PHYSICS XIOS Context :', g_ctx 
     2228!!!!    CALL xios_set_current_context(g_ctx) 
     2229!!!!#endif 
     2230!$OMP END MASTER 
     2231 
    20572232    ! 
    20582233    ! 
     
    20662241 
    20672242    ! Update time and other variables in Reprobus 
    2068     IF (type_trac == 'repr') THEN 
     2243    IF (ANY(types_trac == 'repr')) THEN 
    20692244#ifdef REPROBUS 
    20702245       CALL Init_chem_rep_xjour(jD_cur-jD_ref+day_ref) 
     
    21242299      ! RomP <<< 
    21252300    ENDIF 
    2126  
    21272301    ! 
    21282302    ! Ne pas affecter les valeurs entrees de u, v, h, et q 
     
    21362310          ql_seri(i,k) = qx(i,k,iliq) 
    21372311          !CR: ATTENTION, on rajoute la variable glace 
    2138           IF (nqo.eq.2) THEN 
     2312          IF (nqo.EQ.2) THEN             !--vapour and liquid only 
    21392313             qs_seri(i,k) = 0. 
    2140           ELSE IF (nqo.eq.3) THEN 
     2314             rneb_seri(i,k) = 0. 
     2315          ELSE IF (nqo.EQ.3) THEN        !--vapour, liquid and ice 
    21412316             qs_seri(i,k) = qx(i,k,isol) 
     2317             rneb_seri(i,k) = 0. 
     2318          ELSE IF (nqo.EQ.4) THEN        !--vapour, liquid, ice and rneb 
     2319             qs_seri(i,k) = qx(i,k,isol) 
     2320             rneb_seri(i,k) = qx(i,k,irneb) 
    21422321          ENDIF 
    21432322       ENDDO 
     
    21552334 
    21562335    tke0(:,:)=pbl_tke(:,:,is_ave) 
    2157     !CR:Nombre de traceurs de l'eau: nqo 
    2158     !  IF (nqtot.GE.3) THEN 
    2159     IF (nqtot.GE.(nqo+1)) THEN 
    2160        !     DO iq = 3, nqtot         
    2161        DO iq = nqo+1, nqtot   
     2336    IF (nqtot > nqo) THEN 
     2337       ! water isotopes are not included in tr_seri 
     2338       itr = 0 
     2339       DO iq = 1, nqtot 
     2340         IF(.NOT.tracers(iq)%isInPhysics) CYCLE 
     2341         itr = itr+1 
    21622342          DO  k = 1, klev 
    21632343             DO  i = 1, klon 
    2164                 !              tr_seri(i,k,iq-2) = qx(i,k,iq) 
    2165                 tr_seri(i,k,iq-nqo) = qx(i,k,iq) 
     2344                tr_seri(i,k,itr) = qx(i,k,iq) 
    21662345             ENDDO 
    21672346          ENDDO 
    21682347       ENDDO 
    21692348    ELSE 
    2170        DO k = 1, klev 
    2171           DO i = 1, klon 
    2172              tr_seri(i,k,1) = 0.0 
    2173           ENDDO 
    2174        ENDDO 
     2349! DC: make sure the final "1" index was meant for 1st H2O phase (vapor) !!! 
     2350       tr_seri(:,:,strIdx(tracers(:)%name,addPhase('H2O','g'))) = 0.0 
    21752351    ENDIF 
    21762352! 
     
    21792355    IF (debut) THEN 
    21802356      WRITE(lunout,*)' WARNING: tr_ancien initialised to tr_seri' 
    2181       DO iq = nqo+1, nqtot 
    2182            tr_ancien(:,:,iq-nqo)=tr_seri(:,:,iq-nqo) 
    2183       ENDDO 
     2357       itr = 0 
     2358       do iq = 1, nqtot 
     2359         IF(.NOT.tracers(iq)%isInPhysics) CYCLE 
     2360         itr = itr+1 
     2361         tr_ancien(:,:,itr)=tr_seri(:,:,itr)        
     2362       enddo 
    21842363    ENDIF 
    21852364    ! 
     
    22122391       d_qs_dyn2d(:)=(zx_tmp_fi2d(:)-prsw_ancien(:))/phys_tstep 
    22132392       ! !! RomP >>>   td dyn traceur 
    2214        IF (nqtot.GT.nqo) THEN     ! jyg 
    2215           DO iq = nqo+1, nqtot      ! jyg 
    2216               d_tr_dyn(:,:,iq-nqo)=(tr_seri(:,:,iq-nqo)-tr_ancien(:,:,iq-nqo))/phys_tstep ! jyg 
    2217           ENDDO 
    2218        ENDIF 
     2393       IF (nqtot > nqo) d_tr_dyn(:,:,:)=(tr_seri(:,:,:)-tr_ancien(:,:,:))/phys_tstep 
    22192394       ! !! RomP <<< 
     2395       !!d_rneb_dyn(:,:)=(rneb_seri(:,:)-rneb_ancien(:,:))/phys_tstep 
     2396       d_rneb_dyn(:,:)=0.0 
    22202397    ELSE 
    22212398       d_u_dyn(:,:)  = 0.0 
     
    22292406       d_qs_dyn2d(:) = 0.0 
    22302407       ! !! RomP >>>   td dyn traceur 
    2231        IF (nqtot.GT.nqo) THEN                                       ! jyg 
    2232           DO iq = nqo+1, nqtot                                      ! jyg 
    2233               d_tr_dyn(:,:,iq-nqo)= 0.0                             ! jyg 
    2234           ENDDO 
    2235        ENDIF 
     2408       IF (nqtot > nqo) d_tr_dyn(:,:,:)= 0.0 
    22362409       ! !! RomP <<< 
     2410       d_rneb_dyn(:,:)=0.0 
    22372411       ancien_ok = .TRUE. 
    22382412    ENDIF 
     
    24632637    !   s_therm,   s_trmb1,   s_trmb2, s_trmb3, 
    24642638    !   zu10m,     zv10m,   fder, 
    2465     !   zxqsurf,   rh2m,      zxfluxu, zxfluxv, 
     2639    !   zxqsurf,   delta_qsurf, 
     2640    !   rh2m,      zxfluxu, zxfluxv, 
    24662641    !   frugs,     agesno,    fsollw,  fsolsw, 
    24672642    !   d_ts,      fevap,     fluxlat, t2m, 
     
    25132688            debut,     lafin, & 
    25142689            longitude_deg, latitude_deg, rugoro,  zrmu0,      & 
    2515             zsig,      sollwdown, pphi,    cldt,      & 
    2516             rain_fall, snow_fall, solsw,   sollw,     & 
     2690            sollwdown,    cldt,      & 
     2691            rain_fall, snow_fall, solsw,   solswfdiff, sollw,     & 
    25172692            gustiness,                                & 
    25182693            t_seri,    q_seri,    u_seri,  v_seri,    & 
     
    25242699                                !albedo SB <<< 
    25252700            cdragh,    cdragm,  u1,    v1,            & 
     2701            beta_aridity, & 
    25262702                                !albedo SB >>> 
    25272703                                ! albsol1,   albsol2,   sens,    evap,      & 
     
    25292705                                !albedo SB <<< 
    25302706            albsol3_lic,runoff,   snowhgt,   qsnow, to_ice, sissnow, & 
    2531             zxtsol,    zxfluxlat, zt2m,    qsat2m,  & 
     2707            zxtsol,    zxfluxlat, zt2m,    qsat2m,  zn2mout, & 
    25322708            d_t_vdf,   d_q_vdf,   d_u_vdf, d_v_vdf, d_t_diss, & 
    25332709                                !nrlmd< 
     
    25502726            s_therm,   s_trmb1,   s_trmb2, s_trmb3, & 
    25512727            zustar, zu10m,     zv10m,   fder, & 
    2552             zxqsurf,   rh2m,      zxfluxu, zxfluxv, & 
     2728            zxqsurf, delta_qsurf,   rh2m,      zxfluxu, zxfluxv, & 
    25532729            z0m, z0h,     agesno,    fsollw,  fsolsw, & 
    25542730            d_ts,      fevap,     fluxlat, t2m, & 
     
    25762752!>jyg 
    25772753       ENDIF 
    2578  
    2579 !add limitation for t,q at and wind at 10m 
    2580         if ( iflag_bug_t2m_ipslcm61 == 0 ) THEN 
    2581           CALL borne_var_surf( klon,klev,nbsrf,                 & 
    2582             iflag_bug_t2m_stab_ipslcm61,                        & 
    2583             t_seri(:,1),q_seri(:,1),u_seri(:,1),v_seri(:,1),    & 
    2584             ftsol,zxqsurf,pctsrf,paprs,                         & 
    2585             t2m, q2m, u10m, v10m,                               & 
    2586             zt2m_cor, zq2m_cor, zu10m_cor, zv10m_cor,           & 
    2587             zrh2m_cor, zqsat2m_cor) 
    2588         ELSE 
    2589           zt2m_cor(:)=zt2m(:) 
    2590           zq2m_cor(:)=zq2m(:) 
    2591           zu10m_cor(:)=zu10m(:) 
    2592           zv10m_cor(:)=zv10m(:) 
    2593           zqsat2m_cor=999.999 
    2594         ENDIF 
    25952754 
    25962755       !--------------------------------------------------------------------- 
     
    27972956         ENDDO 
    27982957       ELSE 
    2799                t_w(:,:) = t_seri(:,:) 
     2958                t_w(:,:) = t_seri(:,:) 
    28002959                q_w(:,:) = q_seri(:,:) 
    28012960                t_x(:,:) = t_seri(:,:) 
     
    28733032          ! 
    28743033          !>jyg 
    2875           IF (type_trac == 'repr') THEN 
     3034          IF (ANY(types_trac == 'repr')) THEN 
    28763035             nbtr_tmp=ntra 
    28773036          ELSE 
     
    30133172 
    30143173       DO i = 1, klon 
    3015           ema_pcb(i)  = paprs(i,ibas_con(i)) 
     3174          ! C Risi modif: pour éviter pb de dépassement d'indice dans les cas 
     3175          ! où i n'est pas un point convectif et donc ibas_con(i)=0 
     3176          ! c'est un pb indépendant des isotopes 
     3177          if (ibas_con(i) > 0) then 
     3178             ema_pcb(i)  = paprs(i,ibas_con(i)) 
     3179          else 
     3180             ema_pcb(i)  = 0.0 
     3181          endif 
    30163182       ENDDO 
    30173183       DO i = 1, klon 
     
    34393605    ! Computation of ratqs, the width (normalized) of the subrid scale  
    34403606    ! water distribution 
     3607 
     3608    tke_dissip_ave(:,:)=0. 
     3609    l_mix_ave(:,:)=0. 
     3610    wprime_ave(:,:)=0. 
     3611 
     3612    DO nsrf = 1, nbsrf 
     3613       DO i = 1, klon 
     3614          tke_dissip_ave(i,:) = tke_dissip_ave(i,:) + tke_dissip(i,:,nsrf)*pctsrf(i,nsrf) 
     3615          l_mix_ave(i,:) = l_mix_ave(i,:) + l_mix(i,:,nsrf)*pctsrf(i,nsrf) 
     3616          wprime_ave(i,:) = wprime_ave(i,:) + wprime(i,:,nsrf)*pctsrf(i,nsrf) 
     3617       ENDDO 
     3618    ENDDO 
     3619 
    34413620    CALL  calcratqs(klon,klev,prt_level,lunout,        & 
    34423621         iflag_ratqs,iflag_con,iflag_cld_th,pdtphys,  & 
    34433622         ratqsbas,ratqshaut,ratqsp0, ratqsdp, & 
    3444          tau_ratqs,fact_cldcon,   & 
     3623         tau_ratqs,fact_cldcon,wake_s, wake_deltaq,   & 
    34453624         ptconv,ptconvth,clwcon0th, rnebcon0th,     & 
    3446          paprs,pplay,q_seri,zqsat,fm_therm, & 
    3447          ratqs,ratqsc) 
    3448  
     3625         paprs,pplay,t_seri,q_seri, qtc_cv, sigt_cv, zqsat, & 
     3626         pbl_tke(:,:,is_ave),tke_dissip_ave,l_mix_ave,wprime_ave,t2m,q2m,fm_therm, & 
     3627         ratqs,ratqsc,ratqs_inter) 
    34493628 
    34503629    ! 
     
    34563635    ENDIF 
    34573636    ! 
     3637 
     3638    picefra(:,:)=0. 
     3639 
     3640    IF (ok_new_lscp) THEN 
     3641 
     3642    !--mise à jour de flight_m et flight_h2o dans leur module 
     3643    IF (ok_plane_h2o .OR. ok_plane_contrail) THEN 
     3644      CALL airplane(debut,pphis,pplay,paprs,t_seri) 
     3645    ENDIF 
     3646 
     3647    CALL lscp(phys_tstep,missing_val,paprs,pplay, & 
     3648         t_seri, q_seri,ptconv,ratqs, & 
     3649         d_t_lsc, d_q_lsc, d_ql_lsc, d_qi_lsc, rneb, rneb_seri, &  
     3650         cldliq, picefra, rain_lsc, snow_lsc, & 
     3651         pfrac_impa, pfrac_nucl, pfrac_1nucl, & 
     3652         frac_impa, frac_nucl, beta_prec_fisrt, & 
     3653         prfl, psfl, rhcl,  & 
     3654         zqasc, fraca,ztv,zpspsk,ztla,zthl,iflag_cld_th, & 
     3655         iflag_ice_thermo, ok_ice_sursat) 
     3656 
     3657    ELSE 
     3658 
    34583659    CALL fisrtilp(phys_tstep,paprs,pplay, & 
    34593660         t_seri, q_seri,ptconv,ratqs, & 
     
    34653666         zqasc, fraca,ztv,zpspsk,ztla,zthl,iflag_cld_th, & 
    34663667         iflag_ice_thermo) 
     3668 
     3669    ENDIF 
    34673670    ! 
    34683671    WHERE (rain_lsc < 0) rain_lsc = 0. 
     
    34873690       ENDDO 
    34883691    ENDDO 
    3489     IF (nqo==3) THEN 
     3692    IF (nqo >= 3) THEN 
    34903693    DO k = 1, klev 
    34913694       DO i = 1, klon 
     
    37043907          ENDIF 
    37053908          zx_rh(i,k) = q_seri(i,k)/zx_qs 
     3909            IF (iflag_ice_thermo .GT. 0) THEN 
     3910          zx_rhl(i,k) = q_seri(i,k)/(qsatl(zx_t)/pplay(i,k)) 
     3911          zx_rhi(i,k) = q_seri(i,k)/(qsats(zx_t)/pplay(i,k)) 
     3912            ENDIF 
    37063913          zqsat(i,k)=zx_qs 
    37073914       ENDDO 
     
    37303937    ENDDO 
    37313938 
    3732     IF (type_trac == 'inca') THEN 
     3939    IF (ANY(types_trac == 'inca') .OR. ANY(types_trac == 'inco')) THEN ! ModThL 
    37333940#ifdef INCA 
    37343941       CALL VTe(VTphysiq) 
     
    37733980            nbp_lon, & 
    37743981            nbp_lat-1, & 
    3775             tr_seri, & 
     3982            tr_seri(:,:,1+nqCO2:nbtr), & 
    37763983            ftsol, & 
    37773984            paprs, & 
     
    37843991       CALL VTe(VTinca) 
    37853992       CALL VTb(VTphysiq) 
    3786 #endif  
    3787     ENDIF !type_trac = inca 
    3788     IF (type_trac == 'repr') THEN 
     3993#endif 
     3994    ENDIF !type_trac = inca or inco 
     3995    IF (ANY(types_trac == 'repr')) THEN 
    37893996#ifdef REPROBUS 
    37903997    !CALL chemtime_rep(itap+itau_phy-1, date0, dtime, itap) 
     
    39564163 
    39574164       IF (ok_newmicro) then 
    3958           IF (iflag_rrtm.NE.0) THEN  
     4165! AI          IF (iflag_rrtm.NE.0) THEN  
     4166          IF (iflag_rrtm.EQ.1) THEN 
    39594167#ifdef CPP_RRTM 
    39604168             IF (ok_cdnc.AND.NRADLP.NE.3) THEN 
     
    39704178          ENDIF 
    39714179          CALL newmicro (flag_aerosol, ok_cdnc, bl95_b0, bl95_b1, & 
    3972                paprs, pplay, t_seri, cldliq, cldfra, & 
     4180               paprs, pplay, t_seri, cldliq, picefra, cldfra, & 
    39734181               cldtau, cldemi, cldh, cldl, cldm, cldt, cldq, & 
    39744182               flwp, fiwp, flwc, fiwc, & 
    39754183               mass_solu_aero, mass_solu_aero_pi, & 
    3976                cldtaupi, re, fl, ref_liq, ref_ice, & 
     4184               cldtaupi, latitude_deg, re, fl, ref_liq, ref_ice, & 
    39774185               ref_liq_pi, ref_ice_pi) 
    39784186       ELSE 
    39794187          CALL nuage (paprs, pplay, & 
    3980                t_seri, cldliq, cldfra, cldtau, cldemi, & 
     4188               t_seri, cldliq, picefra, cldfra, cldtau, cldemi, & 
    39814189               cldh, cldl, cldm, cldt, cldq, & 
    39824190               ok_aie, & 
     
    41144322          !  
    41154323          !--interactive CO2 in ppm from carbon cycle 
    4116           IF (carbon_cycle_rad.AND..NOT.debut) THEN 
    4117             RCO2=RCO2_glo 
    4118           ENDIF 
     4324          IF (carbon_cycle_rad) RCO2=RCO2_glo 
    41194325          ! 
    41204326          IF (prt_level .GE.10) THEN 
     
    41304336               t_seri,q_seri,wo, & 
    41314337               cldfrarad, cldemirad, cldtaurad, & 
    4132                ok_ade.OR.flag_aerosol_strat.GT.0, ok_aie,  ok_volcan, & 
    4133                flag_aerosol, & 
    4134                flag_aerosol_strat, flag_aer_feedback, & 
     4338               ok_ade.OR.flag_aerosol_strat.GT.0, ok_aie,  ok_volcan, flag_volc_surfstrat, & 
     4339               flag_aerosol, flag_aerosol_strat, flag_aer_feedback, & 
    41354340               tau_aero, piz_aero, cg_aero, & 
    41364341               tau_aero_sw_rrtm, piz_aero_sw_rrtm, cg_aero_sw_rrtm, &  
     
    41434348               heat,heat0,cool,cool0,albpla, & 
    41444349               heat_volc,cool_volc, & 
    4145                topsw,toplw,solsw,sollw, & 
     4350               topsw,toplw,solsw,solswfdiff,sollw, & 
    41464351               sollwdown, & 
    41474352               topsw0,toplw0,solsw0,sollw0, & 
     
    42174422                     t_seri,q_seri,wo, & 
    42184423                     cldfrarad, cldemirad, cldtaurad, & 
    4219                      ok_ade.OR.flag_aerosol_strat.GT.0, ok_aie,  ok_volcan, & 
    4220                      flag_aerosol, & 
    4221                      flag_aerosol_strat, flag_aer_feedback, & 
     4424                     ok_ade.OR.flag_aerosol_strat.GT.0, ok_aie,  ok_volcan, flag_volc_surfstrat, & 
     4425                     flag_aerosol, flag_aerosol_strat, flag_aer_feedback, & 
    42224426                     tau_aero, piz_aero, cg_aero, & 
    42234427                     tau_aero_sw_rrtm, piz_aero_sw_rrtm, cg_aero_sw_rrtm, & 
     
    42304434                     heatp,heat0p,coolp,cool0p,albplap, & 
    42314435                     heat_volc,cool_volc, & 
    4232                      topswp,toplwp,solswp,sollwp, & 
     4436                     topswp,toplwp,solswp,solswfdiffp,sollwp, & 
    42334437                     sollwdownp, & 
    42344438                     topsw0p,toplw0p,solsw0p,sollw0p, & 
     
    42484452                     ZLWFT0_i, ZFLDN0, ZFLUP0, & 
    42494453                     ZSWFT0_i, ZFSDN0, ZFSUP0) 
    4250           endif !ok_4xCO2atm 
     4454          ENDIF !ok_4xCO2atm 
    42514455       ENDIF ! aerosol_couple 
    42524456       itaprad = 0 
     
    46294833 
    46304834    CALL tend_to_tke(pdtphys,paprs,exner,t_seri,u_seri,v_seri,dtadd,duadd,dvadd,pctsrf,pbl_tke) 
    4631  
     4835   ! 
     4836   ! Prevent pbl_tke_w from becoming negative 
     4837    wake_delta_pbl_tke(:,:,:) = max(wake_delta_pbl_tke(:,:,:), -pbl_tke(:,:,:)) 
     4838   ! 
    46324839 
    46334840       ENDIF 
     
    47004907#ifdef CPP_COSPV2 
    47014908       IF (itap.eq.1.or.MOD(itap,NINT(freq_cosp/phys_tstep)).EQ.0) THEN 
     4909!        IF (MOD(itap,NINT(freq_cosp/phys_tstep)).EQ.0) THEN 
    47024910 
    47034911          IF (prt_level .GE.10) THEN 
    47044912             print*,'freq_cosp',freq_cosp 
    47054913          ENDIF 
     4914           DO k = 1, klev 
     4915             DO i = 1, klon 
     4916               phicosp(i,k) = pphi(i,k) + pphis(i) 
     4917             ENDDO 
     4918           ENDDO 
    47064919          mr_ozone=wo(:, :, 1) * dobson_u * 1e3 / zmasse 
    47074920                 print*,'Dans physiq.F avant appel ' 
     
    47554968    ! 
    47564969 
    4757     IF (type_trac=='repr') THEN 
     4970    IF (ANY(types_trac=='repr')) THEN 
    47584971!MM pas d'impact, car on recupere q_seri,tr_seri,t_seri via phys_local_var_mod 
    47594972!MM                               dans Reprobus 
     
    47664979    ELSE 
    47674980       sh_in(:,:) = qx(:,:,ivap) 
    4768        ch_in(:,:) = qx(:,:,iliq) 
    4769     ENDIF 
    4770  
    4771     IF (iflag_phytrac == 1 ) THEN 
     4981       IF (nqo >= 3) THEN  
     4982          ch_in(:,:) = qx(:,:,iliq) + qx(:,:,isol) 
     4983       ELSE  
     4984          ch_in(:,:) = qx(:,:,iliq) 
     4985       ENDIF 
     4986    ENDIF 
    47724987 
    47734988#ifdef CPP_Dust 
    4774       CALL       phytracr_spl ( debut,lafin , jD_cur,jH_cur,iflag_con,       &  ! I 
     4989    !  Avec SPLA, iflag_phytrac est forcé =1  
     4990    CALL       phytracr_spl ( debut,lafin , jD_cur,jH_cur,iflag_con,       &  ! I 
    47754991                      pdtphys,ftsol,                                   &  ! I 
    47764992                      t,q_seri,paprs,pplay,RHcl,                  &  ! I 
     
    47885004 
    47895005#else 
    4790  
    4791     CALL phytrac ( & 
     5006    IF (iflag_phytrac == 1 ) THEN 
     5007      CALL phytrac ( & 
    47925008         itap,     days_elapsed+1,    jH_cur,   debut, & 
    47935009         lafin,    phys_tstep,     u, v,     t, & 
     
    48265042 
    48275043#endif 
     5044    ENDIF    ! (iflag_phytrac=1) 
    48285045 
    48295046#endif 
    4830     ENDIF    ! (iflag_phytrac=1) 
     5047    !ENDIF    ! (iflag_phytrac=1) 
    48315048 
    48325049    IF (offline) THEN 
     
    48495066    ! Calculer le transport de l'eau et de l'energie (diagnostique) 
    48505067    ! 
    4851     CALL transp (paprs,zxtsol, & 
    4852          t_seri, q_seri, ql_seri, qs_seri, u_seri, v_seri, zphi, & 
    4853          ve, vq, ue, uq, vwat, uwat) 
     5068    CALL transp (paprs,zxtsol, t_seri, q_seri, ql_seri, qs_seri, u_seri, v_seri, zphi, & 
     5069                 ue, ve, uq, vq, uwat, vwat) 
    48545070    ! 
    48555071    !IM global posePB BEG 
    48565072    IF(1.EQ.0) THEN 
    48575073       ! 
    4858        CALL transp_lay (paprs,zxtsol, & 
    4859             t_seri, q_seri, u_seri, v_seri, zphi, & 
     5074       CALL transp_lay (paprs,zxtsol, t_seri, q_seri, u_seri, v_seri, zphi, & 
    48605075            ve_lay, vq_lay, ue_lay, uq_lay) 
    48615076       ! 
    48625077    ENDIF !(1.EQ.0) THEN 
    48635078    !IM global posePB END 
     5079    ! 
    48645080    ! Accumuler les variables a stocker dans les fichiers histoire: 
    48655081    ! 
     
    48725088    d_t_ec(:,:)=0. 
    48735089    forall (k=1: nbp_lev) exner(:, k) = (pplay(:, k)/paprs(:,1))**RKAPPA 
    4874     CALL ener_conserv(klon,klev,pdtphys,u,v,t,qx(:,:,ivap),qx(:,:,iliq),qx(:,:,isol), & 
     5090    CALL ener_conserv(klon,klev,pdtphys,u,v,t,qx,ivap,iliq,isol, & 
    48755091         u_seri,v_seri,t_seri,q_seri,ql_seri,qs_seri,pbl_tke(:,:,is_ave)-tke0(:,:), & 
    48765092         zmasse,exner,d_t_ec) 
     
    49055121    ENDDO 
    49065122    ! 
    4907     IF (type_trac == 'inca') THEN 
     5123    IF (ANY(types_trac == 'inca') .OR. ANY(types_trac == 'inco')) THEN 
    49085124#ifdef INCA 
    49095125       CALL VTe(VTphysiq) 
     
    49145130            pplay, & 
    49155131            t_seri, & 
    4916             tr_seri, & 
     5132            tr_seri(:,:,1+nqCO2:nbtr), & 
    49175133            nbtr, & 
    49185134            paprs, & 
     
    49225138            pphis, & 
    49235139            zx_rh, & 
    4924             aps, bps, ap, bp) 
     5140            aps, bps, ap, bp, lafin) 
    49255141 
    49265142       CALL VTe(VTinca) 
     
    49295145    ENDIF 
    49305146 
     5147    IF (ANY(types_trac == 'repr')) THEN 
     5148#ifdef REPROBUS 
     5149        CALL coord_hyb_rep(paprs, pplay, aps, bps, ap, bp, cell_area) 
     5150#endif 
     5151    ENDIF 
    49315152 
    49325153    ! 
     
    49525173          d_qx(i,k,iliq) = ( ql_seri(i,k) - qx(i,k,iliq) ) / phys_tstep 
    49535174          !CR: on ajoute le contenu en glace 
    4954           IF (nqo.eq.3) THEN 
     5175          IF (nqo >= 3) THEN 
    49555176             d_qx(i,k,isol) = ( qs_seri(i,k) - qx(i,k,isol) ) / phys_tstep 
     5177          ENDIF 
     5178          !--ice_sursat: nqo=4, on ajoute rneb 
     5179          IF (nqo == 4) THEN 
     5180             d_qx(i,k,irneb) = ( rneb_seri(i,k) - qx(i,k,irneb) ) / phys_tstep 
    49565181          ENDIF 
    49575182       ENDDO 
    49585183    ENDDO 
    49595184    ! 
    4960     !CR: nb de traceurs eau: nqo 
    4961     !  IF (nqtot.GE.3) THEN 
    4962     IF (nqtot.GE.(nqo+1)) THEN 
    4963        !     DO iq = 3, nqtot 
    4964        DO iq = nqo+1, nqtot 
     5185    IF (nqtot > nqo) THEN 
     5186       itr = 0 
     5187       DO iq = 1, nqtot 
     5188          IF(.NOT.tracers(iq)%isInPhysics) CYCLE 
     5189          itr = itr+1 
    49655190          DO  k = 1, klev 
    49665191             DO  i = 1, klon 
    4967                 ! d_qx(i,k,iq) = ( tr_seri(i,k,iq-2) - qx(i,k,iq) ) / phys_tstep 
    4968                 d_qx(i,k,iq) = ( tr_seri(i,k,iq-nqo) - qx(i,k,iq) ) / phys_tstep 
     5192                d_qx(i,k,iq) = ( tr_seri(i,k,itr) - qx(i,k,iq) ) / phys_tstep 
    49695193             ENDDO 
    49705194          ENDDO 
     
    50035227    ql_ancien(:,:) = ql_seri(:,:) 
    50045228    qs_ancien(:,:) = qs_seri(:,:) 
     5229    rneb_ancien(:,:) = rneb_seri(:,:) 
    50055230    CALL water_int(klon,klev,q_ancien,zmasse,prw_ancien) 
    50065231    CALL water_int(klon,klev,ql_ancien,zmasse,prlw_ancien) 
    50075232    CALL water_int(klon,klev,qs_ancien,zmasse,prsw_ancien) 
    50085233    ! !! RomP >>> 
    5009     !CR: nb de traceurs eau: nqo 
    5010     IF (nqtot.GT.nqo) THEN 
    5011        DO iq = nqo+1, nqtot 
    5012           tr_ancien(:,:,iq-nqo) = tr_seri(:,:,iq-nqo) 
    5013        ENDDO 
    5014     ENDIF 
     5234    IF (nqtot > nqo) tr_ancien(:,:,:) = tr_seri(:,:,:) 
    50155235    ! !! RomP <<< 
    50165236    !========================================================================== 
     
    51285348  CALL phys_output_write_spl(itap, pdtphys, paprs, pphis,  & 
    51295349       pplay, lmax_th, aerosol_couple,                 & 
    5130        ok_ade, ok_aie, ivap, ok_sync,         & 
     5350       ok_ade, ok_aie, ivap, ok_sync,                  & 
    51315351       ptconv, read_climoz, clevSTD,                   & 
    51325352       ptconvth, d_t, qx, d_qx, d_tr_dyn, zmasse,      & 
     
    51475367#endif 
    51485368 
    5149 ! On remet des variables a .false. apres un premier appel 
    5150     IF (debut) THEN 
    5151 #ifdef CPP_XIOS 
    5152       swaero_diag=.FALSE. 
    5153       swaerofree_diag=.FALSE. 
    5154       dryaod_diag=.FALSE. 
    5155       ok_4xCO2atm= .FALSE. 
    5156 !      write (lunout,*)'ok_4xCO2atm= ',swaero_diag, swaerofree_diag, dryaod_diag, ok_4xCO2atm 
    5157  
    5158       IF (is_master) THEN 
    5159         !--setting up swaero_diag to TRUE in XIOS case  
    5160         IF (xios_field_is_active("topswad").OR.xios_field_is_active("topswad0").OR. &  
    5161            xios_field_is_active("solswad").OR.xios_field_is_active("solswad0").OR. &  
    5162            xios_field_is_active("topswai").OR.xios_field_is_active("solswai").OR.  &  
    5163              (iflag_rrtm==1.AND.(xios_field_is_active("toplwad").OR.xios_field_is_active("toplwad0").OR. &  
    5164                                  xios_field_is_active("sollwad").OR.xios_field_is_active("sollwad0"))))  &  
    5165            !!!--for now these fields are not in the XML files so they are omitted  
    5166            !!!  xios_field_is_active("toplwai").OR.xios_field_is_active("sollwai") !))) &  
    5167            swaero_diag=.TRUE.  
    5168  
    5169         !--setting up swaerofree_diag to TRUE in XIOS case  
    5170         IF (xios_field_is_active("SWdnSFCcleanclr").OR.xios_field_is_active("SWupSFCcleanclr").OR. & 
    5171            xios_field_is_active("SWupTOAcleanclr").OR.xios_field_is_active("rsucsaf").OR.   & 
    5172            xios_field_is_active("rsdcsaf") .OR. xios_field_is_active("LWdnSFCcleanclr").OR. & 
    5173            xios_field_is_active("LWupTOAcleanclr")) & 
    5174            swaerofree_diag=.TRUE.  
    5175  
    5176         !--setting up dryaod_diag to TRUE in XIOS case  
    5177         DO naero = 1, naero_tot-1 
    5178          IF (xios_field_is_active("dryod550_"//name_aero_tau(naero))) dryaod_diag=.TRUE.  
    5179         ENDDO 
    5180         ! 
    5181         !--setting up ok_4xCO2atm to TRUE in XIOS case  
    5182         IF (xios_field_is_active("rsut4co2").OR.xios_field_is_active("rlut4co2").OR. &  
    5183            xios_field_is_active("rsutcs4co2").OR.xios_field_is_active("rlutcs4co2").OR. & 
    5184            xios_field_is_active("rsu4co2").OR.xios_field_is_active("rsucs4co2").OR. & 
    5185            xios_field_is_active("rsd4co2").OR.xios_field_is_active("rsdcs4co2").OR. & 
    5186            xios_field_is_active("rlu4co2").OR.xios_field_is_active("rlucs4co2").OR. & 
    5187            xios_field_is_active("rld4co2").OR.xios_field_is_active("rldcs4co2")) & 
    5188            ok_4xCO2atm=.TRUE.  
    5189       ENDIF 
    5190       !$OMP BARRIER 
    5191       CALL bcast(swaero_diag) 
    5192       CALL bcast(swaerofree_diag) 
    5193       CALL bcast(dryaod_diag) 
    5194       CALL bcast(ok_4xCO2atm) 
    5195 !      write (lunout,*)'ok_4xCO2atm= ',swaero_diag, swaerofree_diag, dryaod_diag, ok_4xCO2atm 
    5196 #endif 
    5197     ENDIF 
    5198  
    51995369    !==================================================================== 
    52005370    ! Arret du modele apres hgardfou en cas de detection d'un 
     
    52145384    ! 
    52155385 
     5386    ! Disabling calls to the prt_alerte function 
     5387    alert_first_call = .FALSE. 
     5388     
    52165389    IF (lafin) THEN 
    52175390       itau_phy = itau_phy + itap 
     
    52325405#ifdef CPP_XIOS 
    52335406       IF (is_omp_master) CALL xios_context_finalize 
     5407 
     5408#ifdef INCA 
     5409       if (ANY(types_trac == 'inca' )) then  
     5410          IF (is_omp_master .and. grid_type==unstructured) THEN  
     5411             CALL finalize_inca 
     5412          ENDIF 
     5413       endif 
     5414#endif 
     5415 
    52345416#endif 
    52355417       WRITE(lunout,*) ' physiq fin, nombre de steps ou cvpas = 1 : ', Ncvpaseq1 
  • CONFIG/UNIFORM/v7/IPSLCM7/compile_ipslcm7.sh

    r5479 r6296  
    4444full_orch="" 
    4545full_dyna="" 
    46  
     46# choose radiative code compilation option  
     47rad=rrtm 
     48opt_rad="" 
    4749# Default netcdf_lib is used for XIOS but can be change by argument 
    4850netcdf_lib="" 
     
    103105        "-full_inca")  full_inca="-clean"; shift ;; 
    104106        "-cleannemo")  full_nemo=y ; shift ;; 
     107        "-rad")        rad=$2; shift ; shift ;; 
    105108        *)             echo "unknown option "$1" , exiting..." ; exit 
    106109    esac 
     
    138141                echo "You used -parallel" $parallel 
    139142            fi ;; 
     143        spirit*) 
     144            fcm_arch=ifort_MESOIPSL;; 
    140145        ciclad*|climserv*|loholt*|camelot*) 
    141146            fcm_arch=ifort_CICLAD;; 
     
    152157    echo >> $outfile 
    153158    echo "The file ARCH/arch-${fcm_arch}.env will now be sourced with modules needed for compilation for all components." 
    154     echo "Note that this new environement might be kept after compilation."  
    155     echo "If this is the case, source again your personal environment after compilation. " 
    156     echo " Personal module list before sourcing of ARCH/arch.env file:"    >> $outfile   
    157     module list   >> $outfile 2>&1  
    158  
     159    echo "Note that this new environement might be kept after compilation." 
     160    echo "If this is the case, source again your personal environment after compilation." 
     161    echo " Personal module list before sourcing of ARCH/arch.env file:"    >> $outfile  
     162    module list   >> $outfile 2>&1 
     163    svn_version=$(module list -t | grep subversion) 
     164        
    159165    # Make a link to this file, to be used also in config.card 
    160166    rm -f ARCH/arch.env 
     
    162168 
    163169    # Source the file 
    164     source ARCH/arch.env   >> $outfile 2>&1  
    165     echo >> $outfile  
    166     echo " New module list after sourcing of ARCH/arch.env file:"    >> $outfile   
    167     module list   >> $outfile 2>&1  
     170    source ARCH/arch.env   >> $outfile 2>&1 
     171    if [ X$svn_version != X ] ; then 
     172        module load ${svn_version} 
     173    fi 
     174    echo >> $outfile 
     175    echo " New module list after sourcing of ARCH/arch.env file:"    >> $outfile  
     176    module list   >> $outfile 2>&1 
    168177fi 
    169178 
     
    173182echo; echo "NOW COMPILE IOIPSL" 
    174183echo >> $outfile ; echo " NOW COMPILE IOIPSL"   >> $outfile  
    175  
    176 # Check if compilation with fcm is included in IOIPSL 
    177 if [ ! -f makeioipsl_fcm ] ; then 
    178   echo "The file makeiopsl_fcm do not exist. Probably this is not the right version of IOIPSL." 
    179   echo "Version of IOIPSL with fcm compilation is needed to compile with this script. Stop now." 
    180   exit 
    181 fi 
    182184 
    183185echo ./makeioipsl_fcm -$optmode -parallel -arch ${fcm_arch} -arch_path $arch_path -j 8 $full_flag   >> $outfile  
     
    320322echo; echo "NOW COMPILE LMDZ FOR COUPLING TO DYNAMICO" 
    321323echo >> $outfile ; echo " NOW COMPILE LMDZ FOR COUPLING TO DYNAMICO"   >> $outfile  
    322  
     324# Retrieve the final svn release number, needed for radiative code suffix of executable 
     325lmdzsvn=`svnversion . | egrep -o "[0-9]+"  | awk 'NR==1'` 
    323326# Temporary use of SOURCES/LMDZ to handle modifications needed by IPSLCM7 
    324327cp $mysrc_path/LMDZ/*.*90  libf/phylmd/. 
     
    337340fi 
    338341 
    339 echo ./makelmdz_fcm -p lmd -c OMCT -rrtm true -$optmode -mem -parallel $parallel -libphy -v orchidee2.1 -io xios -arch $fcm_arch -j 8 $full_lmdz    >> $outfile  
    340      ./makelmdz_fcm -p lmd -c OMCT -rrtm true -$optmode -mem -parallel $parallel -libphy -v orchidee2.1 -io xios -arch $fcm_arch -j 8 $full_lmdz    >> $outfile 2>&1 
     342# Need to define the proper option for radiative code compilation. By default, we use rrtm 
     343case $rad in 
     344    oldrad) opt_rad="" ;; 
     345    rrtm)   if [ $lmdzsvn -le 4185 ] ; then opt_rad="-rrtm true" ; else opt_rad="-rad rrtm" ; fi ;; 
     346    ecrad)  opt_rad="-rad ecrad" ;; 
     347    *) echo Only oldrad rrtm ecrad for rad option ; exit 
     348esac 
     349 
     350if [ $lmdzsvn -le 4185 -a $rad = "ecrad" ] ; then echo "ecrad only available for LMDZ rev starting with 4186 " ; exit ; fi 
     351 
     352echo ./makelmdz_fcm -p lmd -c OMCT $opt_rad -$optmode -mem -parallel $parallel -libphy -v orchidee2.1 -io xios -arch $fcm_arch -j 8 $full_lmdz    >> $outfile  
     353     ./makelmdz_fcm -p lmd -c OMCT $opt_rad -$optmode -mem -parallel $parallel -libphy -v orchidee2.1 -io xios -arch $fcm_arch -j 8 $full_lmdz    >> $outfile 2>&1 
    341354# Test if compiling finished 
    342355if [[ $? != 0 ]] ; then 
     
    351364echo >> $outfile ; echo " NOW COMPILE DYNAMICO"   >> $outfile  
    352365 
    353 echo ./make_icosa -$optmode -parallel $parallel -external_ioipsl -with_oasis -with_xios -arch $fcm_arch -arch_path $arch_path -job 8 $full_dyna    >> $outfile  
    354      ./make_icosa -$optmode -parallel $parallel -external_ioipsl -with_oasis -with_xios -arch $fcm_arch -arch_path $arch_path -job 8 $full_dyna    >> $outfile 2>&1 
     366echo ./make_icosa -$optmode -with_fcm1 -parallel $parallel -external_ioipsl -with_oasis -with_xios -arch $fcm_arch -arch_path $arch_path -job 8 $full_dyna    >> $outfile  
     367     ./make_icosa -$optmode -with_fcm1 -parallel $parallel -external_ioipsl -with_oasis -with_xios -arch $fcm_arch -arch_path $arch_path -job 8 $full_dyna    >> $outfile 2>&1 
    355368# Test if compiling finished 
    356369if [[ $? != 0 ]] ; then 
     
    388401    echo; echo "NOW COMPILE LMDZ REGULAR LAT-LON MODE. Resolution = ${resol_atm}" 
    389402    echo >> $outfile ; echo " NOW COMPILE LMDZ REGULAR LAT-LON MODE. Resolution = ${resol_atm}"   >> $outfile  
    390  
    391403    # Check if the compilation of LMDZ was previsouly interupted prematured.  
    392404    # In that case, the files dimension.h and .lock exist. If the files exist, they are here removed to avoid makelmdz_fcm  
     
    401413        rm -f .lock 
    402414    fi 
    403     echo ./makelmdz_fcm -d ${resol_atm} -c OMCT -p lmd -rrtm true -$optmode -mem -parallel $parallel -io xios -v orchidee2.1 -arch $fcm_arch -j 8 $full_lmdz gcm    >> $outfile  
    404          ./makelmdz_fcm -d ${resol_atm} -c OMCT -p lmd -rrtm true -$optmode -mem -parallel $parallel -io xios -v orchidee2.1 -arch $fcm_arch -j 8 $full_lmdz gcm    >> $outfile 2>&1 
     415    echo ./makelmdz_fcm -d ${resol_atm} -c OMCT -p lmd $opt_rad -$optmode -mem -parallel $parallel -io xios -v orchidee2.1 -arch $fcm_arch -j 8 $full_lmdz gcm    >> $outfile  
     416         ./makelmdz_fcm -d ${resol_atm} -c OMCT -p lmd $opt_rad -$optmode -mem -parallel $parallel -io xios -v orchidee2.1 -arch $fcm_arch -j 8 $full_lmdz gcm    >> $outfile 2>&1 
    405417    # Test if compiling finished 
    406418    if [[ $? != 0 ]] ; then 
     
    421433    fi 
    422434 
    423     # Find executable suffix 
    424     if [ $parallel == seq ] || [ $parallel == none ] ; then 
    425         suffix=_${resol_atm}_phylmd_seq_orch.e 
    426     else 
    427         suffix=_${resol_atm}_phylmd_para_mem_orch.e 
    428     fi 
    429     echo gcm suffix = $suffix 
     435# Find executable suffix 
     436suffix=_${resol_atm}_phylmd 
     437if [ $lmdzsvn -ge 4186 ] ; then suffix=${suffix}_${rad} ; fi 
     438if [ $parallel == seq ] || [ $parallel == none ] ; then 
     439    suffix=${suffix}_seq_orch.e 
     440else 
     441    suffix=${suffix}_para_mem_orch.e 
     442fi 
     443echo gcm suffix = $suffix 
     444 
    430445     
    431446    # Move executables to modipsl/bin folder 
Note: See TracChangeset for help on using the changeset viewer.