Ignore:
Timestamp:
Jun 29, 2018, 12:31:11 PM (7 years ago)
Author:
Laurent Fairhead
Message:

First attempt at merging with trunk

Location:
LMDZ6/branches/DYNAMICO-conv
Files:
30 deleted
164 edited
44 copied

Legend:

Unmodified
Added
Removed
  • LMDZ6/branches/DYNAMICO-conv

  • LMDZ6/branches/DYNAMICO-conv/DefLists/CMIP6_ping_atmos.xml

    r3020 r3356  
    11<!-- $Id$ -->
    2 <!-- Ping files generated by dr2xml 0.18 using Data Request 01.00.15 -->
     2<!-- Ping files generated by dr2xml 0.27 using Data Request 01.00.21 -->
    33<!-- lrealms= ['atmos'] -->
    44<!-- exact= False -->
    55<!--  listof_home_vars : None
    66 tierMax : 3
     7 realms_per_context : {'lmdz': ['atmos', 'atmos land'], 'nemo': ['seaIce', 'ocean', 'ocean seaIce', 'ocnBgchem', 'seaIce ocean'], 'orchidee': ['land', 'landIce land', 'land landIce', 'landIce']}
    78 max_priority : 3
    8  mips : set(['CORDEX', 'GMMIP', 'RFMIP', 'AerChemMIP', 'CMIP6', 'OMIP', 'GeoMIP', 'C4MIP', 'PDRMIP', 'DCPP', 'DECK', 'LUMIP', 'CMIP5', 'CFMIP', 'ScenarioMIP', 'DAMIP', 'CCMI', 'SolarMIP', 'VIACSAB', 'SIMIP', 'CMIP', 'ISMIP6', 'VolMIP', 'PMIP', 'FAFMIP', 'HighResMIP', 'LS3MIP', 'SPECS', 'DynVar'])
     9 max_file_size_in_floats : 20000000000.0
     10 grid_choice : {'IPSL-CM6A-LR': 'LR'}
     11 excluded_vars_file : None
     12 sizes : {'LR': [20592, 79, 32768, 91, 30, 14, 128]}
     13 ping_variables_prefix : CMIP6_
     14 source_types : {'IPSL-CM6A-LR': 'AOGCM AER BGC'}
     15 path_extra_tables : None
     16 grid_policy : native
     17 path_special_defs : None
     18 mips : {'LR': set(['CORDEX', 'GMMIP', 'RFMIP', 'VolMIP', 'CMIP6', 'ScenarioMIP', 'GeoMIP', 'C4MIP', 'PDRMIP', 'CMIP', 'DECK', 'LUMIP', 'CMIP5', 'CFMIP', 'OMIP', 'DAMIP', 'CCMI', 'SolarMIP', 'VIACSAB', 'SIMIP', 'DCPP', 'ISMIP6', 'AerChemMIP', 'PMIP', 'FAFMIP', 'DynVar', 'LS3MIP', 'SPECS', 'HighResMIP'])}
    919 excluded_vars : []
    10  realms_per_context : {'lmdz': ['atmos', 'atmos land'], 'nemo': ['seaIce', 'ocean', 'ocean seaIce', 'ocnBgchem', 'seaIce ocean'], 'orchidee': ['land', 'landIce land', 'land landIce', 'landIce']}
    11  path_extra_tables : None
    12  excluded_vars_file : None
    13  ping_variables_prefix : CMIP6_
    14  path_special_defs : None
    1520 orphan_variables : {}
    1621-->
     
    1924<field_definition>
    2025<!-- for variables which realm equals one of _atmos-->
    21    <field id="CMIP6_H2p"           field_ref="dummy_XY"         /> <!-- P1 () missing : Roche - LSCE -->
    22    <field id="CMIP6_H2s"           field_ref="dummy_XY"         /> <!-- P1 () missing : Roche - LSCE -->
    23    <field id="CMIP6_H2wv"          field_ref="dummy_XYA"        /> <!-- P1 () missing : Roche - LSCE -->
    24    <field id="CMIP6_O17p"          field_ref="dummy_XY"         /> <!-- P1 () missing : Roche - LSCE -->
    25    <field id="CMIP6_O17s"          field_ref="dummy_XY"         /> <!-- P1 () missing : Roche - LSCE -->
    26    <field id="CMIP6_O17wv"         field_ref="dummy_XYA"        /> <!-- P1 () missing : Roche - LSCE -->
    27    <field id="CMIP6_O18p"          field_ref="dummy_XY"         /> <!-- P1 () missing : Roche - LSCE -->
    28    <field id="CMIP6_O18s"          field_ref="dummy_XY"         /> <!-- P1 () missing : Roche - LSCE -->
    29    <field id="CMIP6_O18wv"         field_ref="dummy_XYA"        /> <!-- P1 () missing : Roche - LSCE -->
    30    <field id="CMIP6_aerasymbnd"    field_ref="dummy_XYA"        /> <!-- P1 (1) band_aerosol_asymmetry_parameter : Aerosol level asymmetry parameter for each band -->
    31    <field id="CMIP6_aeroptbnd"     field_ref="dummy_XYA"        /> <!-- P1 (1) atmosphere_absorption_optical_thickness_due_to_ambient_aerosol_particles : Aerosol level extinction optical depth for each band -->
    32    <field id="CMIP6_aerssabnd"     field_ref="dummy_XYA"        /> <!-- P1 (1) single_scattering_albedo_in_air_due_to_ambient_aerosol_particles : Aerosol level single-scattering albedo for each band -->
    33    <field id="CMIP6_albdiffbnd"    field_ref="dummy_XY"         /> <!-- P1 (1.0) band_diffuse_albedo : Diffuse surface albedo for each band -->
    34    <field id="CMIP6_albdirbnd"     field_ref="dummy_XY"         /> <!-- P1 (1.0) band_direct_albedo : Direct surface albedo for each band -->
    35    <field id="CMIP6_albisccp"      field_ref="albisccp"         /> <!-- P1 (1.0) cloud_albedo : ISCCP Mean Cloud Albedo. Time-means are weighted by the ISCCP Total Cloud Fraction {:cltisccp} - see  http://cfmip.metoffice.com/COSP.html -->
    36    <field id="CMIP6_aod550volso4"  field_ref="od550_STRAT"      /> <!-- P1 (1e-09) aerosol_optical_depth_due_to_stratospheric_volcanic_aerosols : aerosol optical depth at 550 nm due to stratospheric volcanic aerosols  -->
    37    <field id="CMIP6_areacella"     field_ref="aire"             /> <!-- P1 (m2) cell_area : For atmospheres with more than 1 mesh (e.g., staggered grids), report areas that apply to surface vertical fluxes of energy. -->
    38    <field id="CMIP6_ccb"           field_ref="pbase"            /> <!-- P1 (Pa) air_pressure_at_convective_cloud_base : Where convective cloud is present in the grid cell, the instantaneous cloud base altitude should be that of the bottom of the lowest level containing convective cloud. Missing data should be reported in the absence of convective cloud. The time mean should be calculated from these quantities averaging over occasions when convective cloud is present only, and should contain missing data for occasions when no convective cloud is present during the meaning period.  -->
    39    <field id="CMIP6_ccldncl"       field_ref="dummy_XY"         /> <!-- P1 (m-3) number_concentration_of_convective_cloud_liquid_water_particles_in_air_at_liquid_water_cloud_top : Droplets are liquid only.  Report concentration 'as seen from space' over convective liquid cloudy portion of grid cell.  This is the value from uppermost model layer with liquid cloud or, if available, it is better to sum over all liquid cloud tops, no matter where they occur, as long as they are seen from the top of the atmosphere. Weight by total liquid cloud top fraction of  (as seen from TOA) each time sample when computing monthly mean. -->
    40    <field id="CMIP6_cct"           field_ref="ptop"             /> <!-- P1 (Pa) air_pressure_at_convective_cloud_top : Where convective cloud is present in the grid cell, the instantaneous cloud top altitude should be that of the top of the highest level containing convective cloud. Missing data should be reported in the absence of convective cloud. The time mean should be calculated from these quantities averaging over occasions when convective cloud is present only, and should contain missing data for occasions when no convective cloud is present during the meaning period. -->
    41    <field id="CMIP6_cfadDbze94"    field_ref="cfadDbze94"       /> <!-- P1 (1.0) histogram_of_equivalent_reflectivity_factor_over_height_above_reference_ellipsoid : CFAD (Cloud Frequency Altitude Diagrams) are frequency distributions of radar  reflectivity (or lidar scattering ratio) as a function of altitude. The variable cfadDbze94 is defined as the simulated relative frequency of occurrence of radar reflectivity in sampling volumes defined by altitude bins. The radar is observing at a frequency of 94GHz. -->
    42    <field id="CMIP6_cfadLidarsr532" field_ref="cfad_lidarsr532" /> <!-- P1 (1.0) histogram_of_backscattering_ratio_over_height_above_reference_ellipsoid : CFAD (Cloud Frequency Altitude Diagrams) are frequency distributions of radar  reflectivity (or lidar scattering ratio) as a function of altitude. The variable cfadLidarsr532 is defined as the simulated relative frequency of lidar scattering ratio in sampling volumes defined by altitude bins. The lidar is observing at a wavelength of 532nm. -->
    43    <field id="CMIP6_cfc113global"  field_ref="dummy_0d"         /> <!-- P1 (1e-12) mole_fraction_of_cfc113_in_air : unset -->
    44    <field id="CMIP6_cfc11global"   field_ref="CFC11_ppt"        /> <!-- P1 (1e-12) mole_fraction_of_cfc11_in_air : unset -->
    45    <field id="CMIP6_cfc12global"   field_ref="CFC12_ppt"        /> <!-- P1 (1e-12) mole_fraction_of_cfc12_in_air : unset -->
    46    <field id="CMIP6_ch4"           field_ref="dummy_XYA"        /> <!-- P1 (mol mol-1) mole_fraction_of_methane_in_air : CH4 volume mixing ratio -->
    47    <field id="CMIP6_ch4global"     field_ref="CH4_ppb"          /> <!-- P1 (1e-09) mole_fraction_of_methane_in_air : Global Mean Mole Fraction of CH4 -->
    48    <field id="CMIP6_ci"            field_ref="ftime_con"        /> <!-- P1 (1.0) convection_time_fraction : Fraction of time that convection occurs in the grid cell. -->
    49    <field id="CMIP6_cl"            field_ref="rneb"             /> <!-- P1 (%) cloud_area_fraction_in_atmosphere_layer : Percentage cloud cover, including both large-scale and convective cloud. -->
    50    <field id="CMIP6_clc"           field_ref="rnebcon"          /> <!-- P1 (%) convective_cloud_area_fraction_in_atmosphere_layer : Include only convective cloud. -->
    51    <field id="CMIP6_clcalipso"     field_ref="pclcalipso"        /> <!-- P1 (%) cloud_area_fraction_in_atmosphere_layer : Percentage cloud cover at CALIPSO standard heights. -->
    52    <field id="CMIP6_clcalipso2"    field_ref="clcalipso2"       /> <!-- P1 (%) cloud_area_fraction_in_atmosphere_layer : Clouds detected by CALIPSO but below the detectability threshold of CloudSat -->
    53    <field id="CMIP6_clcalipsoice"  field_ref="clcalipsoice"     /> <!-- P1 (%) ice_cloud_area_fraction_in_atmosphere_layer : CALIPSO ice cloud Fraction -->
    54    <field id="CMIP6_clcalipsoliq"  field_ref="clcalipsoice"     /> <!-- P1 (%) liquid_cloud_area_fraction_in_atmosphere_layer : CALIPSO liquid cloud Fraction -->
    55    <field id="CMIP6_cldicemxrat"   field_ref="dummy_XYA"        /> <!-- P3 (1.0) cloud_ice_mixing_ratio : Cloud ice mixing ratio -->
    56    <field id="CMIP6_cldnci"        field_ref="dummy_XY"         /> <!-- P1 (m-3) number_concentration_of_ice_crystals_in_air_at_ice_cloud_top : Concentration 'as seen from space' over ice-cloud portion of grid cell.  This is the value from uppermost model layer with ice cloud or, if available, it is the sum over all ice cloud tops, no matter where they occur, as long as they are seen from the top of the atmosphere. Weight by total ice cloud top fraction (as seen from TOA) of each time sample when computing monthly mean. -->
    57    <field id="CMIP6_cldncl"        field_ref="dummy_XY"         /> <!-- P1 (m-3) number_concentration_of_cloud_liquid_water_particles_in_air_at_liquid_water_cloud_top : Droplets are liquid only.  Report concentration 'as seen from space' over liquid cloudy portion of grid cell.  This is the value from uppermost model layer with liquid cloud or, if available, it is better to sum over all liquid cloud tops, no matter where they occur, as long as they are seen from the top of the atmosphere. Weight by total liquid cloud top fraction of  (as seen from TOA) each time sample when computing monthly mean. -->
    58    <field id="CMIP6_cldnvi"        field_ref="cldnvi"           /> <!-- P1 (m-2) atmosphere_number_content_of_cloud_droplets : Droplets are liquid only.  Values are weighted by liquid cloud fraction in each layer when vertically integrating, and for monthly means the samples are weighted by total liquid cloud fraction (as seen from TOA). -->
    59    <field id="CMIP6_cldwatmxrat"   field_ref="dummy_XYA"        /> <!-- P2 (1.0) cloud_liquid_water_mixing_ratio : Cloud water mixing ratio -->
    60    <field id="CMIP6_clhcalipso"    field_ref="pclhcalipso"       /> <!-- P1 (%) cloud_area_fraction_in_atmosphere_layer : Percentage cloud cover in layer centred on 220hPa -->
    61    <field id="CMIP6_cli"           field_ref="iwcon"            /> <!-- P1 (kg kg-1) mass_fraction_of_cloud_ice_in_air : Includes both large-scale and convective cloud. This is calculated as the mass of cloud ice in the grid cell divided by the mass of air (including the water in all phases) in the grid cell. It includes precipitating hydrometeors ONLY if the precipitating hydrometeors affect the calculation of radiative transfer in model. -->
    62    <field id="CMIP6_clic"          field_ref="dummy_XYA"        /> <!-- P2 (1.0) mass_fraction_of_convective_cloud_ice_in_air : Calculated as the mass of convective cloud ice  in the grid cell divided by the mass of air (including the water in all phases) in the grid cell.  This includes precipitating hydrometeors ONLY if the precipitating hydrometeors affect the calculation of radiative transfer in model. -->
    63    <field id="CMIP6_climodis"      field_ref="climodis"         /> <!-- P1 (%) ice_cloud_area_fraction : MODIS Ice Cloud Area Percentage -->
    64    <field id="CMIP6_clis"          field_ref="dummy_XYA"        /> <!-- P2 (1.0) mass_fraction_of_stratiform_cloud_ice_in_air : Calculated as the mass of stratiform cloud ice  in the grid cell divided by the mass of air (including the water in all phases) in the grid cell.  This includes precipitating hydrometeors ONLY if the precipitating hydrometeors affect the calculation of radiative transfer in model. -->
    65    <field id="CMIP6_clisccp"       field_ref="clisccp2"         /> <!-- P1 (%) cloud_area_fraction_in_atmosphere_layer : Percentage cloud cover in optical depth categories. -->
    66    <field id="CMIP6_clivi"         field_ref="iwp"              /> <!-- P1 (kg m-2) atmosphere_cloud_ice_content : mass of ice water in the column divided by the area of the column (not just the area of the cloudy portion of the column). Includes precipitating frozen hydrometeors ONLY if the precipitating hydrometeor affects the calculation of radiative transfer in model. -->
    67    <field id="CMIP6_clivic"        field_ref="dummy_XY"         /> <!-- P1 (kg m-2) atmosphere_convective_cloud_ice_content : calculate mass of convective ice water in the column divided by the area of the column (not just the area of the cloudy portion of the column). This includes precipitating frozen hydrometeors ONLY if the precipitating hydrometeors affect the calculation of radiative transfer in model.   -->
    68    <field id="CMIP6_cllcalipso"    field_ref="pcllcalipso"       /> <!-- P1 (%) cloud_area_fraction_in_atmosphere_layer : Percentage cloud cover in layer centred on 840hPa -->
    69    <field id="CMIP6_clmcalipso"    field_ref="pclmcalipso"       /> <!-- P1 (%) cloud_area_fraction_in_atmosphere_layer : Percentage cloud cover in layer centred on 560hPa -->
    70    <field id="CMIP6_clmisr"        field_ref="clMISR"           /> <!-- P1 (%) cloud_area_fraction_in_atmosphere_layer : Cloud percentage in spectral bands and layers as observed by the Multi-angle Imaging SpectroRadiometer (MISR) instrument. -->
    71    <field id="CMIP6_cls"           field_ref="dummy_XYA"        /> <!-- P1 (%) stratiform_cloud_area_fraction_in_atmosphere_layer : unset -->
    72    <field id="CMIP6_clt"           field_ref="cldt"             /> <!-- P1 (%) cloud_area_fraction : Total cloud area fraction for the whole atmospheric column, as seen from the surface or the top of the atmosphere. Includes both large-scale and convective cloud. -->
    73    <field id="CMIP6_cltcalipso"    field_ref="pcltcalipso"       /> <!-- P1 (%) cloud_area_fraction : unset -->
    74    <field id="CMIP6_cltisccp"      field_ref="tclisccp"         /> <!-- P1 (%) cloud_area_fraction : Percentage total cloud cover, simulating ISCCP observations. -->
    75    <field id="CMIP6_cltmodis"      field_ref="cltmodis"         /> <!-- P1 (%) cloud_area_fraction : MODIS Total Cloud Cover Percentage -->
    76    <field id="CMIP6_clw"           field_ref="lwcon"            /> <!-- P1 (kg kg-1) mass_fraction_of_cloud_liquid_water_in_air : Includes both large-scale and convective cloud. Calculate as the mass of cloud liquid water in the grid cell divided by the mass of air (including the water in all phases) in the grid cells. Precipitating hydrometeors are included ONLY if the precipitating hydrometeors affect the calculation of radiative transfer in model. -->
    77    <field id="CMIP6_clwc"          field_ref="lcc3dcon"         /> <!-- P2 (1.0) mass_fraction_of_convective_cloud_liquid_water_in_air : Calculated as the mass of convective cloud liquid water in the grid cell divided by the mass of air (including the water in all phases) in the grid cell.  This includes precipitating hydrometeors ONLY if the precipitating hydrometeors affect the calculation of radiative transfer in model. -->
    78    <field id="CMIP6_clwmodis"      field_ref="clwmodis"         /> <!-- P1 (%) liquid_water_cloud_area_fraction : MODIS Liquid Cloud Fraction -->
    79    <field id="CMIP6_clws"          field_ref="lcc3dstra"        /> <!-- P2 (1.0) mass_fraction_of_stratiform_cloud_liquid_water_in_air : Calculated as the mass of stratiform cloud liquid water in the grid cell divided by the mass of air (including the water in all phases) in the grid cell.  This includes precipitating hydrometeors ONLY if the precipitating hydrometeors affect the calculation of radiative transfer in model. -->
    80    <field id="CMIP6_clwvi"         field_ref="lwp"              /> <!-- P1 (kg m-2) atmosphere_cloud_condensed_water_content : Mass of condensed (liquid + ice) water in the column divided by the area of the column (not just the area of the cloudy portion of the column). Includes precipitating hydrometeors ONLY if the precipitating hydrometeors affect the calculation of radiative transfer in model. -->
    81    <field id="CMIP6_clwvic"        field_ref="dummy_XY"         /> <!-- P1 (kg m-2) atmosphere_convective_cloud_condensed_water_content : calculate mass of convective condensed (liquid + ice) water in the column divided by the area of the column (not just the area of the cloudy portion of the column). This includes precipitating hydrometeors ONLY if the precipitating hydrometeors affect the calculation of radiative transfer in model.   -->
    82    <field id="CMIP6_co2"           field_ref="dummy_XYA"        /> <!-- P1 (mol mol-1) mole_fraction_of_carbon_dioxide_in_air : CO2 volume mixing ratio -->
    83    <field id="CMIP6_co23D"         field_ref="dummy_XYA"        /> <!-- P2 (kg kg-1) CO2_3D_tracer : report 3D field of model simulated atmospheric CO2 mass mixing ration on model levels -->
    84    <field id="CMIP6_co2mass"       field_ref="dummy_0d"         /> <!-- P1 (kg) atmosphere_mass_of_carbon_dioxide : Total atmospheric mass of Carbon Dioxide -->
    85    <field id="CMIP6_co2s"          field_ref="dummy_XY"         /> <!-- P2 (1e-06) mole_fraction_of_carbon_dioxide_in_air : As co2, but only at the surface -->
    86    <field id="CMIP6_co2totalmass"  field_ref="dummy_0d"         /> <!-- P1 (kg) CO2_total_mass_in_atmos : globally integrated mass of carbon as CO2 in atmosphere. Report as a single number for all emissions-driven runs -->
    87    <field id="CMIP6_columnmassflux" field_ref="dummy_XY"         /> <!-- P2 (kg m-2 s-1) atmosphere_net_upward_convective_mass_flux : Column integral of (mcu-mcd) -->
    88    <field id="CMIP6_conccmcn"      field_ref="dummy_XYA"        /> <!-- P1 (m-3) number_concentration_of_coarse_mode_ambient_aerosol_in_air : includes all particles with diameter larger than 1 micron -->
    89    <field id="CMIP6_conccn"        field_ref="dummy_XYA"        /> <!-- P1 (m-3) number_concentration_of_ambient_aerosol_in_air : unset -->
    90    <field id="CMIP6_concdust"      field_ref="concdust"         /> <!-- P1 (kg m-3) mass_concentration_of_dust_dry_aerosol_in_air : unset -->
    91    <field id="CMIP6_concnmcn"      field_ref="dummy_XYA"        /> <!-- P1 (m-3) number_concentration_of_nucleation_mode_ambient_aerosol_in_air : includes all particles with diameter smaller than 3 nm -->
    92    <field id="CMIP6_demc"          field_ref="dummy_XYA"        /> <!-- P2 (1.0) convective_cloud_longwave_emissivity : This is the in-cloud emissivity obtained by considering only the cloudy portion of the grid cell. -->
    93    <field id="CMIP6_dems"          field_ref="dummy_XYA"        /> <!-- P2 (1.0) stratiform_cloud_longwave_emissivity : This is the in-cloud emissivity obtained by considering only the cloudy portion of the grid cell. -->
    94    <field id="CMIP6_depdust"       field_ref="dummy_XY"         /> <!-- P1 (kg m-2 s-1) tendency_of_atmosphere_mass_content_of_dust_dry_aerosol_particles_due_to_total_deposition : Balkanski - LSCE -->
    95    <field id="CMIP6_diabdrag"      field_ref="dummy_XYA"        /> <!-- P1 (m s-2) tendency_of_eastward_wind_due_to_numerical_artefacts : Other sub-grid scale/numerical zonal drag excluding that already provided for the parameterized orographic and non-orographic gravity waves. This would be used to calculate the total 'diabatic drag'. Contributions to this additional drag such Rayleigh friction and diffusion that can be calculated from the monthly mean wind fields should not be included, but details (e.g. coefficients) of the friction and/or diffusion used in the model should be provided separately. -->
    96    <field id="CMIP6_dmc"           field_ref="upwd"             /> <!-- P2 (kg m-2 s-1) atmosphere_net_upward_deep_convective_mass_flux : The net mass flux  represents the difference between the updraft and downdraft components.   This is calculated as the convective mass flux divided by the area of the whole grid cell (not just the area of the cloud). -->
    97    <field id="CMIP6_dtauc"         field_ref="dummy_XYA"        /> <!-- P3 (1.0) atmosphere_optical_thickness_due_to_convective_cloud : This is the in-cloud optical depth obtained by considering only the cloudy portion of the grid cell -->
    98    <field id="CMIP6_dtaus"         field_ref="dummy_XYA"        /> <!-- P3 (1.0) atmosphere_optical_thickness_due_to_stratiform_cloud : This is the in-cloud optical depth obtained by considering only the cloudy portion of the grid cell. -->
    99    <field id="CMIP6_edt"           field_ref="kz"               /> <!-- P1 (m2 s-1) atmosphere_heat_diffusivity : Vertical diffusion coefficient for temperature due to parametrised eddies -->
    100    <field id="CMIP6_epfy"          field_ref="dummy_XYA"        /> <!-- P1 (m3 s-2) northward_eliassen_palm_flux_in_air : Transformed Eulerian Mean Diagnostics Meridional component Fy of Eliassen-Palm (EP) flux (Fy, Fz) derived from 6hr or higher frequency fields (use daily fields or 12 hr fields if the 6 hr are not available). Please use the definitions given by equation 3.5.3a of Andrews, Holton and Leovy text book, but scaled by density to have units m3 s-2. -->
    101    <field id="CMIP6_epfz"          field_ref="dummy_XYA"        /> <!-- P1 (m3 s-2) upward_eliassen_palm_flux_in_air : Transformed Eulerian Mean Diagnostics Meridional component Fz of the Eliassen-Palm (EP) flux (Fy, Fz) derived from 6hr or higher frequency fields (use daily fields or 12 hr fields if the 6 hr are not available). Please use the definitions given by equation 3.5.3b of Andrews, Holton and Leovy text book, but scaled by density to have units m3 s-2. -->
    102    <field id="CMIP6_evspsbl"       field_ref="evap"             /> <!-- P1 (kg m-2 s-1) water_evaporation_flux : Evaporation at surface: flux of water into the atmosphere due to conversion of both liquid and solid phases to vapor (from underlying surface and vegetation) -->
    103    <field id="CMIP6_evu"           field_ref="evu"              /> <!-- P1 (m2 s-1) atmosphere_momentum_diffusivity : Vertical diffusion coefficient for momentum due to parametrised eddies -->
    104    <field id="CMIP6_fco2antt"      field_ref="dummy_XY"         /> <!-- P1 (kg m-2 s-1) tendency_of_atmosphere_mass_content_of_carbon_dioxide_expressed_as_carbon_due_to_anthropogenic_emission : This is requested only for the emission-driven coupled carbon climate model runs.  Does not include natural fire sources but, includes all anthropogenic sources, including fossil fuel use, cement production, agricultural burning, and sources associated with anthropogenic land use change excluding forest regrowth. -->
    105    <field id="CMIP6_fco2fos"       field_ref="dummy_XY"         /> <!-- P1 (kg m-2 s-1) tendency_of_atmosphere_mass_content_of_carbon_dioxide_expressed_as_carbon_due_to_emission_from_fossil_fuel_combustion : This is the prescribed anthropogenic CO2 flux from fossil fuel use, including cement production, and flaring (but not from land-use changes, agricultural burning, forest regrowth, etc.) -->
    106    <field id="CMIP6_fco2nat"       field_ref="dummy_XY"         /> <!-- P1 (kg m-2 s-1) surface_upward_mass_flux_of_carbon_dioxide_expressed_as_carbon_due_to_emission_from_natural_sources : This is what the atmosphere sees (on its own grid).  This field should be equivalent to the combined natural fluxes of carbon  that account for natural exchanges between the atmosphere and land (nep) or ocean (fgco2) reservoirs. -->
    107    <field id="CMIP6_grpllsprof"    field_ref="dummy_XYA"        /> <!-- P2 (kg m-2 s-1) large_scale_graupel_flux : unset -->
    108    <field id="CMIP6_grplmxrat"     field_ref="dummy_XYA"        /> <!-- P2 (1.0) mass_fraction_of_graupel_in_air : Graupel mixing ratio -->
    109    <field id="CMIP6_h2o"           field_ref="dummy_XYA"        /> <!-- P2 (1.0) mass_fraction_of_water_in_air : includes all phases of water -->
    110    <field id="CMIP6_hcfc22global"  field_ref="dummy_0d"         /> <!-- P1 (1e-12) mole_fraction_of_hcfc22_in_air : unset -->
    111    <field id="CMIP6_hfdsl"         field_ref="bils"> bils*fract_ter </field> <!-- P1 (W m-2) surface_downward_heat_flux_in_air : Downward Heat Flux at Land Surface -->
    112    <field id="CMIP6_hfdsnb"        field_ref="dummy_XY"         /> <!-- P1 (W m-2) missing : Heat flux from snow into the ice or land under the snow. -->
    113    <field id="CMIP6_hfls"          field_ref="flat"             /> <!-- P1 (W m-2) surface_upward_latent_heat_flux : Surface Upward Latent Heat Flux -->
    114    <field id="CMIP6_hfmlt"         field_ref="dummy_XY"         /> <!-- P1 (W m-2) surface_snow_and_ice_melt_heat_flux : Energy consumed or released during liquid/solid phase changes. -->
    115    <field id="CMIP6_hfrs"          field_ref="dummy_XY"         /> <!-- P1 (W m-2) temperature_flux_due_to_rainfall_expressed_as_heat_flux_onto_snow_and_ice : Heat transferred to a snow cover by rain.. -->
    116    <field id="CMIP6_hfsbl"         field_ref="dummy_XY"         /> <!-- P1 (W m-2) surface_snow_and_ice_sublimation_heat_flux : Energy consumed or released during vapor/solid phase changes. -->
    117    <field id="CMIP6_hfss"          field_ref="sens"             /> <!-- P1 (W m-2) surface_upward_sensible_heat_flux : Surface Upward Sensible Heat Flux -->
    118    <field id="CMIP6_hur"           field_ref="rhum"              /> <!-- P1 (%) relative_humidity : The relative humidity with respect to liquid water for T> 0 C, and with respect to ice for T<0 C. -->
    119    <field id="CMIP6_hurs"          field_ref="rh2m"             /> <!-- P1 (%) relative_humidity : The relative humidity with respect to liquid water for T> 0 C, and with respect to ice for T<0 C. -->
    120    <field id="CMIP6_hursmax"       field_ref="CMIP6_hurs" freq_op="1d"  operation="maximum"> @this </field>   <!-- P1 (%) relative_humidity : Daily Maximum Near-Surface Relative Humidity -->
    121    <field id="CMIP6_hursmin"       field_ref="CMIP6_hurs" freq_op="1d"  operation="minimum"> @this </field>    <!-- P1 (%) relative_humidity : Daily Minimum Near-Surface Relative Humidity -->
    122    <field id="CMIP6_hursminCrop"   field_ref="dummy_XY"         /> <!-- P1 (%) relative_humidity : minimum near-surface (usually, 2 meter) relative humidity (add cell_method attribute "time: min") -->
     26   <field id="CMIP6_H2p"           field_ref="dummy_not_provided"           /> <!-- P1 ()  : 2H in total precipitation -->
     27   <field id="CMIP6_H2s"           field_ref="dummy_not_provided"           /> <!-- P1 ()  : 2H in solid precipitation -->
     28   <field id="CMIP6_H2wv"          field_ref="dummy_not_provided"           /> <!-- P1 ()  : H2 in water vapor -->
     29   <field id="CMIP6_O17p"          field_ref="dummy_not_provided"           /> <!-- P1 ()  : 17O in total precipitation -->
     30   <field id="CMIP6_O17s"          field_ref="dummy_not_provided"           /> <!-- P1 ()  : 17O in solid precipitation -->
     31   <field id="CMIP6_O17wv"         field_ref="dummy_not_provided"           /> <!-- P1 ()  : O17 in water vapor -->
     32   <field id="CMIP6_O18p"          field_ref="dummy_not_provided"           /> <!-- P1 ()  : 18O in total precipitation -->
     33   <field id="CMIP6_O18s"          field_ref="dummy_not_provided"           /> <!-- P1 ()  : 18O in solid precipitation -->
     34   <field id="CMIP6_O18wv"         field_ref="dummy_not_provided"           /> <!-- P1 ()  : O18 in water vapor -->
     35   <field id="CMIP6_aerasymbnd"    field_ref="dummy_not_provided"           /> <!-- P1 (1) band_aerosol_asymmetry_parameter : Aerosol level asymmetry parameter for each band -->
     36   <field id="CMIP6_aeroptbnd"     field_ref="dummy_not_provided"           /> <!-- P1 (1) atmosphere_absorption_optical_thickness_due_to_ambient_aerosol_particles : Aerosol level extinction optical depth for each band -->
     37   <field id="CMIP6_aerssabnd"     field_ref="dummy_not_provided"           /> <!-- P1 (1) single_scattering_albedo_in_air_due_to_ambient_aerosol_particles : Aerosol level single-scattering albedo for each band -->
     38   <field id="CMIP6_albdiffbnd"    field_ref="dummy_not_provided"           /> <!-- P1 (1) band_diffuse_albedo : Diffuse surface albedo for each band -->
     39   <field id="CMIP6_albdirbnd"     field_ref="dummy_not_provided"           /> <!-- P1 (1) band_direct_albedo : Direct surface albedo for each band -->
     40   <field id="CMIP6_albisccp"      field_ref="albisccp"                     /> <!-- P1 (1) cloud_albedo : time-means are weighted by the ISCCP Total Cloud Fraction - see  http://cfmip.metoffice.com/COSP.html -->
     41   <field id="CMIP6_aod550volso4"  field_ref="od550_STRAT"                  /> <!-- P1 (1e-09) aerosol_optical_depth_due_to_stratospheric_volcanic_aerosols : aerosol optical thickness at 550 nm due to stratospheric volcanic aerosols  -->
     42   <field id="CMIP6_areacella"     field_ref="aire"                         /> <!-- P1 (m2) cell_area : Cell areas for any grid used to report atmospheric variables and any other variable using that grid (e.g., soil moisture content). These cell areas should be defined to enable exact calculation of global integrals (e.g., of vertical fluxes of energy at the surface and top of the atmosphere). -->
     43   <field id="CMIP6_ccb"           field_ref="pbase"                        /> <!-- P1 (Pa) air_pressure_at_convective_cloud_base : Air Pressure at Convective Cloud Base -->
     44   <field id="CMIP6_ccldncl"       field_ref="dummy_XY"                     /> <!-- P1 (m-3) number_concentration_of_convective_cloud_liquid_water_particles_in_air_at_liquid_water_cloud_top : Cloud Droplet Number Concentration of Convective Cloud Tops -->
     45   <field id="CMIP6_cct"           field_ref="ptop"                         /> <!-- P1 (Pa) air_pressure_at_convective_cloud_top : Air Pressure at Convective Cloud Top -->
     46   <field id="CMIP6_cfadDbze94"    field_ref="cfadDbze94"                   /> <!-- P1 (1) histogram_of_equivalent_reflectivity_factor_over_height_above_reference_ellipsoid : CloudSat Radar Reflectivity CFAD -->
     47   <field id="CMIP6_cfadLidarsr532" field_ref="cfad_lidarsr532"             /> <!-- P1 (1) histogram_of_backscattering_ratio_over_height_above_reference_ellipsoid : CALIPSO Scattering Ratio -->
     48   <field id="CMIP6_cfc113global"  field_ref="dummy_not_provided"           /> <!-- P1 (1e-12) mole_fraction_of_cfc113_in_air : Global Mean Mole Fraction of CFC113 -->
     49   <field id="CMIP6_cfc11global"   field_ref="CFC11_ppt"                    /> <!-- P1 (1e-12) mole_fraction_of_cfc11_in_air : Global Mean Mole Fraction of CFC11 -->
     50   <field id="CMIP6_cfc12global"   field_ref="CFC12_ppt"                    /> <!-- P1 (1e-12) mole_fraction_of_cfc12_in_air : Global Mean Mole Fraction of CFC12 -->
     51   <field id="CMIP6_ch4"           field_ref="dummy_not_provided"           /> <!-- P1 (mol mol-1) mole_fraction_of_methane_in_air : Mole Fraction of CH4 -->
     52   <field id="CMIP6_ch4global"     field_ref="CH4_ppb"                      /> <!-- P1 (1e-09) mole_fraction_of_methane_in_air : Global Mean Mole Fraction of CH4 -->
     53   <field id="CMIP6_ci"            field_ref="ftime_con"                    /> <!-- P1 (1) convection_time_fraction : Fraction of time that convection occurs in the grid cell. -->
     54   <field id="CMIP6_cl"            field_ref="rneb"> rneb*100.      </field>   <!-- P1 (%) cloud_area_fraction_in_atmosphere_layer : Cloud Area Fraction in Atmosphere Layer -->
     55   <field id="CMIP6_clc"           field_ref="rnebcon"> rnebcon*100. </field>  <!-- P1 (%) convective_cloud_area_fraction_in_atmosphere_layer : Convective Cloud Area Fraction -->
     56   <field id="CMIP6_clcalipso"     field_ref="pclcalipso"                   /> <!-- P1 (%) cloud_area_fraction_in_atmosphere_layer : CALIPSO Cloud Area Fraction -->
     57   <field id="CMIP6_clcalipso2"    field_ref="clcalipso2"                   /> <!-- P1 (%) cloud_area_fraction_in_atmosphere_layer : CALIPSO Cloud Fraction Undetected by CloudSat -->
     58   <field id="CMIP6_clcalipsoice"  field_ref="clcalipsoice"                 /> <!-- P1 (%) ice_cloud_area_fraction_in_atmosphere_layer : CALIPSO Ice Cloud Fraction -->
     59   <field id="CMIP6_clcalipsoliq"  field_ref="clcalipsoice"                 /> <!-- P1 (%) liquid_cloud_area_fraction_in_atmosphere_layer : CALIPSO Liquid Cloud Fraction -->
     60   <field id="CMIP6_cldicemxrat"   field_ref="cldicemxrat"                  /> <!-- P2 (1) cloud_ice_mixing_ratio : Cloud Ice Mixing Ratio -->
     61   <field id="CMIP6_cldnci"        field_ref="dummy_XY"                     /> <!-- P1 (m-3) number_concentration_of_ice_crystals_in_air_at_ice_cloud_top : Ice Crystal Number Concentration of Cloud Tops -->
     62   <field id="CMIP6_cldncl"        field_ref="cldncl" expr=" @cldncl / @lcc" > cldncl / lcc </field> <!-- P1 (m-3) number_concentration_of_cloud_liquid_water_particles_in_air_at_liquid_water_cloud_top : Cloud Droplet Number Concentration of Cloud Tops -->
     63   <field id="CMIP6_cldnvi"        field_ref="cldnvi" expr=" @cldnvi / @lcc" > cldnvi / lcc </field> <!-- P1 (m-2) atmosphere_number_content_of_cloud_droplets : Column Integrated Cloud Droplet Number -->
     64   <field id="CMIP6_cldwatmxrat"   field_ref="cldwatmxrat"                  /> <!-- P2 (1) cloud_liquid_water_mixing_ratio : Cloud Water Mixing Ratio -->
     65   <field id="CMIP6_clhcalipso"    field_ref="pclhcalipso"                  /> <!-- P1 (%) cloud_area_fraction_in_atmosphere_layer : CALIPSO Percentage High Level Cloud -->
     66   <field id="CMIP6_cli"           field_ref="iwcon"                        /> <!-- P1 (kg kg-1) mass_fraction_of_cloud_ice_in_air : Includes both large-scale and convective cloud. This is the mass of cloud ice in the grid cell divided by the mass of air (including the water in all phases) in the grid cell. This includes precipitating hydrometeors ONLY if the precipitating hydrometeors affect the calculation of radiative transfer in model. -->
     67   <field id="CMIP6_clic"          field_ref="icc3dcon"                     /> <!-- P2 (1) mass_fraction_of_convective_cloud_ice_in_air : Calculated as the mass of convective cloud ice  in the grid cell divided by the mass of air (including the water in all phases) in the grid cell.  This includes precipitating hydrometeors ONLY if the precipitating hydrometeors affect the calculation of radiative transfer in model. -->
     68   <field id="CMIP6_climodis"      field_ref="climodis"                     /> <!-- P1 (%) ice_cloud_area_fraction : MODIS Ice Cloud Fraction -->
     69   <field id="CMIP6_clis"          field_ref="icc3dstra"                    /> <!-- P2 (1) mass_fraction_of_stratiform_cloud_ice_in_air : Calculated as the mass of stratiform cloud ice  in the grid cell divided by the mass of air (including the water in all phases) in the grid cell.  This includes precipitating hydrometeors ONLY if the precipitating hydrometeors affect the calculation of radiative transfer in model. -->
     70   <field id="CMIP6_clisccp"       field_ref="clisccp2"                     /> <!-- P1 (%) cloud_area_fraction_in_atmosphere_layer : ISCCP Percentage Cloud Area -->
     71   <field id="CMIP6_clivi"         field_ref="iwp"                          /> <!-- P1 (kg m-2) atmosphere_cloud_ice_content : mass of ice water in the column divided by the area of the column (not just the area of the cloudy portion of the column). Includes precipitating frozen hydrometeors ONLY if the precipitating hydrometeor affects the calculation of radiative transfer in model. -->
     72   <field id="CMIP6_clivic"        field_ref="dummy_XY"                     /> <!-- P1 (kg m-2) atmosphere_convective_cloud_ice_content : Convective Ice Water Path  -->
     73   <field id="CMIP6_cllcalipso"    field_ref="pcllcalipso"                  /> <!-- P1 (%) cloud_area_fraction_in_atmosphere_layer : CALIPSO Percentage Low Level Cloud -->
     74   <field id="CMIP6_clmcalipso"    field_ref="pclmcalipso"                  /> <!-- P1 (%) cloud_area_fraction_in_atmosphere_layer : CALIPSO Percentage Mid Level Cloud -->
     75   <field id="CMIP6_clmisr"        field_ref="clMISR"                       /> <!-- P1 (%) cloud_area_fraction_in_atmosphere_layer : MISR cloud area fraction -->
     76   <field id="CMIP6_cls"           field_ref="dummy_XYA"                    /> <!-- P1 (%) stratiform_cloud_area_fraction_in_atmosphere_layer : Stratiform Cloud Area Fraction -->
     77   <field id="CMIP6_clt"           field_ref="cldt"> cldt*100.        </field> <!-- P1 (%) cloud_area_fraction : for the whole atmospheric column, as seen from the surface or the top of the atmosphere. Includes both large-scale and convective cloud. -->
     78   <field id="CMIP6_clt_land"      field_ref="dummy_XY"         /> <!-- P1 (%) cloud_area_fraction : Total cloud fraction -->
     79   <field id="CMIP6_cltc"          field_ref="dummy_XY"         /> <!-- P1 (%) convective_cloud_area_fraction : For the whole atmospheric column, as seen from the surface or the top of the atmosphere. Includes only convective cloud. -->
     80   <field id="CMIP6_cltcalipso"    field_ref="pcltcalipso"                  /> <!-- P1 (%) cloud_area_fraction :  CALIPSO Total Cloud Fraction -->
     81   <field id="CMIP6_cltisccp"      field_ref="tclisccp"                     /> <!-- P1 (%) cloud_area_fraction : ISCCP Total Cloud Fraction -->
     82   <field id="CMIP6_cltmodis"      field_ref="cltmodis"                     /> <!-- P1 (%) cloud_area_fraction : MODIS Total Cloud  Fraction -->
     83   <field id="CMIP6_clw"           field_ref="lwcon"                        /> <!-- P1 (kg kg-1) mass_fraction_of_cloud_liquid_water_in_air : Includes both large-scale and convective cloud. Calculate as the mass of cloud liquid water in the grid cell divided by the mass of air (including the water in all phases) in the grid cells. Precipitating hydrometeors are included ONLY if the precipitating hydrometeors affect the calculation of radiative transfer in model. -->
     84   <field id="CMIP6_clwc"          field_ref="lcc3dcon"                     /> <!-- P2 (1) mass_fraction_of_convective_cloud_liquid_water_in_air : Calculated as the mass of convective cloud liquid water in the grid cell divided by the mass of air (including the water in all phases) in the grid cell.  This includes precipitating hydrometeors ONLY if the precipitating hydrometeors affect the calculation of radiative transfer in model. -->
     85   <field id="CMIP6_clwmodis"      field_ref="clwmodis"                     /> <!-- P1 (%) liquid_water_cloud_area_fraction : MODIS Liquid Cloud Fraction -->
     86   <field id="CMIP6_clws"          field_ref="lcc3dstra"                    /> <!-- P2 (1) mass_fraction_of_stratiform_cloud_liquid_water_in_air : Calculated as the mass of stratiform cloud liquid water in the grid cell divided by the mass of air (including the water in all phases) in the grid cell.  This includes precipitating hydrometeors ONLY if the precipitating hydrometeors affect the calculation of radiative transfer in model. -->
     87   <field id="CMIP6_clwvi"         field_ref="lwp"                          /> <!-- P1 (kg m-2) atmosphere_cloud_condensed_water_content : mass of condensed (liquid + ice) water in the column divided by the area of the column (not just the area of the cloudy portion of the column). Includes precipitating hydrometeors ONLY if the precipitating hydrometeor affects the calculation of radiative transfer in model. -->
     88   <field id="CMIP6_clwvic"        field_ref="dummy_XY"                     /> <!-- P1 (kg m-2) atmosphere_convective_cloud_condensed_water_content : Convective Condensed Water Path -->
     89   <field id="CMIP6_co2"           field_ref="dummy_not_provided"           /> <!-- P1 (mol mol-1) mole_fraction_of_carbon_dioxide_in_air :  Mole Fraction of CO2 -->
     90   <field id="CMIP6_co23D"         field_ref="dummy_not_provided"           /> <!-- P2 (kg kg-1) CO2_3D_tracer : requested for all Emissions-driven runs -->
     91   <field id="CMIP6_co2mass"       field_ref="mass_sum"> co2_ppm*1e-6*44.011/28.97*mass_sum </field> <!-- P1 (kg) atmosphere_mass_of_carbon_dioxide : Total Atmospheric Mass of CO2 -->
     92   <field id="CMIP6_co2s"          field_ref="dummy_not_provided"           /> <!-- P2 (1e-06) mole_fraction_of_carbon_dioxide_in_air : Atmosphere CO2 -->
     93   <field id="CMIP6_columnmassflux" field_ref="dummy_XY"                    /> <!-- P2 (kg m-2 s-1) atmosphere_net_upward_convective_mass_flux : Column integrated mass flux -->
     94   <field id="CMIP6_conccmcn"      field_ref="dummy_not_provided"           /> <!-- P1 (m-3) number_concentration_of_coarse_mode_ambient_aerosol_in_air : Number Concentration Coarse Mode Aerosol -->
     95   <field id="CMIP6_conccn"        field_ref="dummy_not_provided"           /> <!-- P1 (m-3) number_concentration_of_ambient_aerosol_in_air : Aerosol Number Concentration -->
     96   <field id="CMIP6_concdust"      field_ref="concdust"                     /> <!-- P1 (kg m-3) mass_concentration_of_dust_dry_aerosol_in_air : Concentration of Dust -->
     97   <field id="CMIP6_concnmcn"      field_ref="dummy_not_provided"           /> <!-- P1 (m-3) number_concentration_of_nucleation_mode_ambient_aerosol_in_air : Number Concentration of Nucleation Mode Aerosol -->
     98   <field id="CMIP6_demc"          field_ref="dummy_not_provided"                    /> <!-- P2 (1) convective_cloud_longwave_emissivity : This is the in-cloud emissivity obtained by considering only the cloudy portion of the grid cell. -->
     99   <field id="CMIP6_dems"          field_ref="dummy_not_provided"                    /> <!-- P2 (1) stratiform_cloud_longwave_emissivity : This is the in-cloud emissivity obtained by considering only the cloudy portion of the grid cell. -->
     100   <field id="CMIP6_diabdrag"      field_ref="dummy_XYA"                    /> <!-- P1 (m s-2) tendency_of_eastward_wind_due_to_numerical_artefacts : Tendency of Eastward Wind from Numerical Artefacts -->
     101   <field id="CMIP6_dmc"           field_ref="upwd"                         /> <!-- P2 (kg m-2 s-1) atmosphere_net_upward_deep_convective_mass_flux : The net mass flux  represents the difference between the updraft and downdraft components.   This is calculated as the convective mass flux divided by the area of the whole grid cell (not just the area of the cloud). -->
     102   <field id="CMIP6_dtauc"         field_ref="dummy_not_provided"           /> <!-- P2 (1) atmosphere_optical_thickness_due_to_convective_cloud : This is the in-cloud optical depth obtained by considering only the cloudy portion of the grid cell -->
     103   <field id="CMIP6_dtaus"         field_ref="dummy_not_provided"           /> <!-- P2 (1) atmosphere_optical_thickness_due_to_stratiform_cloud : This is the in-cloud optical depth obtained by considering only the cloudy portion of the grid cell. -->
     104   <field id="CMIP6_edt"           field_ref="kz"                           /> <!-- P1 (m2 s-1) atmosphere_heat_diffusivity : Eddy Diffusivity Coefficient for Temperature Variable -->
     105   <field id="CMIP6_epfy"          field_ref="dummy_XYA"                    /> <!-- P1 (m3 s-2) northward_eliassen_palm_flux_in_air : Northward Component of the Eliassen-Palm Flux -->
     106   <field id="CMIP6_epfz"          field_ref="dummy_XYA"                    /> <!-- P1 (m3 s-2) upward_eliassen_palm_flux_in_air : zonal mean; hence YZT -->
     107   <field id="CMIP6_evspsbl"       field_ref="evap"                         /> <!-- P1 (kg m-2 s-1) water_evaporation_flux : Evaporation at surface; flux of water into the atmosphere due to conversion of both liquid and solid phases to vapor (from underlying surface and vegetation) -->
     108   <field id="CMIP6_evu"           field_ref="evu"                          /> <!-- P1 (m2 s-1) atmosphere_momentum_diffusivity : Eddy Viscosity Coefficients for Momentum -->
     109   <field id="CMIP6_fco2antt"      field_ref="dummy_not_provided"           /> <!-- P1 (kg m-2 s-1) tendency_of_atmosphere_mass_content_of_carbon_dioxide_expressed_as_carbon_due_to_anthropogenic_emission : This is requested only for the emission-driven coupled carbon climate model runs.  Does not include natural fire sources but, includes all anthropogenic sources, including fossil fuel use, cement production, agricultural burning, and sources associated with anthropogenic land use change excluding forest regrowth. -->
     110   <field id="CMIP6_fco2fos"       field_ref="dummy_not_provided"           /> <!-- P1 (kg m-2 s-1) tendency_of_atmosphere_mass_content_of_carbon_dioxide_expressed_as_carbon_due_to_emission_from_fossil_fuel_combustion : This is the prescribed anthropogenic CO2 flux from fossil fuel use, including cement production, and flaring (but not from land-use changes, agricultural burning, forest regrowth, etc.) -->
     111   <field id="CMIP6_fco2nat"       field_ref="dummy_not_provided"           /> <!-- P1 (kg m-2 s-1) surface_upward_mass_flux_of_carbon_dioxide_expressed_as_carbon_due_to_emission_from_natural_sources : This is what the atmosphere sees (on its own grid).  This field should be equivalent to the combined natural fluxes of carbon (requested in the L_mon and O_mon tables) that account for natural exchanges between the atmosphere and land or ocean reservoirs (i.e., "net ecosystem biospheric productivity", for land, and "air to sea CO2 flux", for ocean.) -->
     112   <field id="CMIP6_grpllsprof"    field_ref="dummy_not_provided"           /> <!-- P2 (kg m-2 s-1) large_scale_graupel_flux : Stratiform Graupel Flux  -->
     113   <field id="CMIP6_grplmxrat"     field_ref="dummy_not_provided"           /> <!-- P2 (1) mass_fraction_of_graupel_in_air : Graupel Mixing Ratio -->
     114   <field id="CMIP6_h2o"           field_ref="ovap"> ovap+ocond       </field> <!-- P2 (1) mass_fraction_of_water_in_air : includes all phases of water -->
     115   <field id="CMIP6_hcfc22global"  field_ref="dummy_not_provided"           /> <!-- P1 (1e-12) mole_fraction_of_hcfc22_in_air : Global Mean Mole Fraction of HCFC22 -->
     116   <field id="CMIP6_hfdsl"         field_ref="bils"> bils*fract_ter   </field> <!-- P1 (W m-2) surface_downward_heat_flux_in_air : Ground heat flux -->
     117   <field id="CMIP6_hfdsnb"        field_ref="dummy_not_provided"           /> <!-- P1 (W m-2)  : Downward heat flux at snow botton -->
     118   <field id="CMIP6_hfls_ist"      field_ref="dummy_XY"         /> <!-- P1 (W m-2) surface_upward_latent_heat_flux : Surface Upward Latent Heat Flux -->
     119   <field id="CMIP6_hfls_land"     field_ref="dummy_XY"         /> <!-- P1 (W m-2) surface_upward_latent_heat_flux : Latent heat flux -->
     120   <field id="CMIP6_hfls"          field_ref="flat"> flat*(-1.)       </field>  <!-- P1 (W m-2) surface_upward_latent_heat_flux : Surface Upward Latent Heat Flux -->
     121   <field id="CMIP6_hfmlt"         field_ref="dummy_not_provided"           /> <!-- P1 (W m-2) surface_snow_and_ice_melt_heat_flux : Energy of fusion -->
     122   <field id="CMIP6_hfrs"          field_ref="dummy_not_provided"           /> <!-- P1 (W m-2) temperature_flux_due_to_rainfall_expressed_as_heat_flux_onto_snow_and_ice : Heat transferred to snowpack by rainfall -->
     123   <field id="CMIP6_hfsbl"         field_ref="dummy_not_provided"           /> <!-- P1 (W m-2) surface_snow_and_ice_sublimation_heat_flux : Energy of sublimation -->
     124   <field id="CMIP6_hfss"          field_ref="sens"> sens*(-1.) </field>       <!-- P1 (W m-2) surface_upward_sensible_heat_flux : Surface Upward Sensible Heat Flux -->
     125   <field id="CMIP6_hfss_land"     field_ref="dummy_XY"         /> <!-- P1 (W m-2) surface_upward_sensible_heat_flux : Sensible heat flux -->
     126   <field id="CMIP6_hfss_ist"      field_ref="dummy_XY"         /> <!-- P1 (W m-2) surface_upward_sensible_heat_flux : Surface Upward Sensible Heat Flux -->
     127   <field id="CMIP6_hur"           field_ref="rhum"> rhum*100. </field> <!-- P1 (%) relative_humidity : This is the relative humidity with respect to liquid water for T> 0 C, and with respect to ice for T<0 C. -->
     128   <field id="CMIP6_hurs"          field_ref="rh2m"             /> <!-- P1 (%) relative_humidity : This is the relative humidity with respect to liquid water for T> 0 C, and with respect to ice for T<0 C. -->
     129   <field id="CMIP6_hursmax"       field_ref="rh2m_max" freq_op="1d" > @rh2m_max </field> <!-- P1 (%) relative_humidity : This is the relative humidity with respect to liquid water for T> 0 C, and with respect to ice for T<0 C. -->   
     130   <field id="CMIP6_hursmin"       field_ref="rh2m_min" freq_op="1d" > @rh2m_min </field> <!-- P1 (%) relative_humidity : This is the relative humidity with respect to liquid water for T> 0 C, and with respect to ice for T<0 C. --> 
     131   <field id="CMIP6_hursminCrop"   field_ref="dummy_not_provided"         /> <!-- P1 (%) relative_humidity : Daily Minimum Near-Surface Relative Humidity over Crop Tile -->
    123132   <field id="CMIP6_hus"           field_ref="ovap"             /> <!-- P1 (1.0) specific_humidity : Specific Humidity -->
    124    <field id="CMIP6_huss"          field_ref="q2m"              /> <!-- P1 (1.0) specific_humidity : Near-surface (usually, 2 meter) specific humidity. -->
    125    <field id="CMIP6_iareafl"       field_ref="fract_sic"         >fract_sic*aire </field> <!-- P3 (m2) floating_ice_shelf_area : Total area of the floating ice shelves (the component of ice sheet that flows over ocean) -->
    126    <field id="CMIP6_iareagr"       field_ref="fract_lic"         >fract_lic*aire </field> <!-- P3 (m2) grounded_ice_sheet_area : Total area of the grounded ice sheets (the component of ice sheet resting over bedrock) -->
    127    <field id="CMIP6_intuadse"      field_ref="dummy_XY"         /> <!-- P1 (1.e6 J m-1 s-1) vertical_integral_eastward_wind_by_dry_static_energy : Mass weighted vertical integral of the product of northward wind by dry static energy per unit mass: (cp.T +zg).u -->
    128    <field id="CMIP6_intuaw"        field_ref="dummy_XY"         /> <!-- P1 (kg m-1 s-1) vertical_integral_eastward_wind_by_total_water : Used in PMIP2 -->
    129    <field id="CMIP6_intvadse"      field_ref="dummy_XY"         /> <!-- P1 (1.e6 J m-1 s-1) vertical_integral_northward_wind_by_dry_static_energy : Used in PMIP2 -->
    130    <field id="CMIP6_intvaw"        field_ref="dummy_XY"         /> <!-- P1 (kg m-1 s-1) vertical_integral_northward_wind_by_total_water : Used in PMIP2 -->
    131    <field id="CMIP6_jo2"           field_ref="dummy_XYA"        /> <!-- P1 (s-1) photolysis_rate_of_molecular_oxygen : Rate of photolysis of molecular oxygen to atomic oxygen (o2 -> o1d+o) -->
    132    <field id="CMIP6_jo3"           field_ref="dummy_XYA"        /> <!-- P1 (s-1) photolysis_rate_of_ozone : sum of rates o3 -> o1d+o2 and o3 -> o+o2 -->
    133    <field id="CMIP6_jpdftaureicemodis" field_ref="crimodis"     /> <!-- P1 (%) cloud_area_fraction_in_atmosphere_layer : MODIS Optical Thickness-Particle Size joint  distribution, ice -->
    134    <field id="CMIP6_jpdftaureliqmodis" field_ref="crlmodis"     /> <!-- P1 (%) cloud_area_fraction_in_atmosphere_layer : MODIS Optical Thickness-Particle Size joint  distribution, liquid -->
    135    <field id="CMIP6_latitude"      field_ref="lat"              /> <!-- P1 (degrees_north) latitude : latitude -->
    136    <field id="CMIP6_lim"           field_ref="dummy_0d"         /> <!-- P2 (kg) land_ice_mass : The ice sheet mass is computed as the volume times density -->
    137    <field id="CMIP6_limnsw"        field_ref="dummy_0d"         /> <!-- P2 (kg) land_ice_mass_not_displacing_sea_water : The ice sheet mass is computed as the volume above flotation times density. Changes in land_ice_mass_not_displacing_sea_water will always result in a change in sea level, unlike changes in land_ice_mass which may not result in sea level change (such as melting of the floating ice shelves, or portion of ice that sits on bedrock below sea level) -->
    138    <field id="CMIP6_loadbc"        field_ref="loadbc"           /> <!-- P1 (kg m-2) atmosphere_mass_content_of_black_carbon_dry_aerosol : unset -->
    139    <field id="CMIP6_loaddust"      field_ref="loaddust"         /> <!-- P1 (kg m-2) atmosphere_mass_content_of_dust_dry_aerosol : unset -->
    140    <field id="CMIP6_loadnh4"       field_ref="dummy_XY"         /> <!-- P1 (kg m-2) atmosphere_mass_content_of_ammonium_dry_aerosol : unset -->
    141    <field id="CMIP6_loadno3"       field_ref="loadno3"          /> <!-- P1 (kg m-2) atmosphere_mass_content_of_nitrate_dry_aerosol : unset -->
    142    <field id="CMIP6_loadoa"        field_ref="loadoa"           /> <!-- P1 (kg m-2) atmosphere_mass_content_of_particulate_organic_matter_dry_aerosol : atmosphere dry organic content: This is the vertically integrated sum of atmosphere_primary_organic_content and atmosphere_secondary_organic_content (see next two table entries). -->
    143    <field id="CMIP6_loadpoa"       field_ref="loadoa"           /> <!-- P1 (kg m-2) atmosphere_mass_content_of_primary_particulate_organic_matter_dry_aerosol : unset -->
    144    <field id="CMIP6_loadso4"       field_ref="loadso4"          /> <!-- P1 (kg m-2) atmosphere_mass_content_of_sulfate_dry_aerosol : unset -->
    145    <field id="CMIP6_loadsoa"       field_ref="dummy_XY"         /> <!-- P1 (kg m-2) atmosphere_mass_content_of_secondary_particulate_organic_matter_dry_aerosol : unset -->
    146    <field id="CMIP6_loadss"        field_ref="loadss"           /> <!-- P1 (kg m-2) atmosphere_mass_content_of_seasalt_dry_aerosol : unset -->
    147    <field id="CMIP6_longitude"     field_ref="lon"              /> <!-- P1 (degrees_east) longitude : Longitude -->
    148    <field id="CMIP6_lwsffluxaero"  field_ref="dummy_XY"         /> <!-- P2 (W m-2) longwave__flux__due_to_volcanic_aerosols_at_the_surface : downwelling longwave  flux  due to volcanic aerosols at the surface to be diagnosed through double radiation call -->
    149    <field id="CMIP6_lwsrfasdust"   field_ref="dummy_XY"         /> <!-- P1 (W m-2) tendency_of_all_sky_surface_longwave_flux_to_dust_ambient_aerosol_particles : Balkanski - LSCE -->
    150    <field id="CMIP6_lwsrfcsdust"   field_ref="dummy_XY"         /> <!-- P1 (W m-2) tendency_of_clear_sky_surface_longwave_flux_to_dust_ambient_aerosol_particles : Balkanski - LSCE -->
    151    <field id="CMIP6_lwtoaasdust"   field_ref="dummy_XY"         /> <!-- P1 (W m-2) toa_instantaneous_longwave_forcing : proposed name: toa_instantaneous_longwave_forcing_due_to_dust_ambient_aerosol -->
    152    <field id="CMIP6_lwtoacs"       field_ref="dummy_XY"         /> <!-- P1 (W m-2) tendency_of_clear_sky_top_of_atmosphere_longwave_flux_to_dust_ambient_aerosol_particles___2D_field_radiative_properties : Balkanski - LSCE -->
    153    <field id="CMIP6_lwtoacsaer"    field_ref="toplwad0"         /> <!-- P1 (W m-2) toa_instantaneous_longwave_forcing : proposed name: toa_instantaneous_longwave_forcing_due_to_ambient_aerosol_assuming_clear_sky -->
    154    <field id="CMIP6_lwtoafluxaerocs" field_ref="dummy_XY"       /> <!-- P1 (W m-2) longwave_flux_due_to_volcanic_aerosols_at_TOA_under_clear_sky : downwelling longwave flux due to volcanic aerosols at TOA under clear sky to be diagnosed through double radiation call -->
    155    <field id="CMIP6_mc"            field_ref="mc"               /> <!-- P3 (kg m-2 s-1) atmosphere_net_upward_convective_mass_flux : The net mass flux should represent the difference between the updraft and downdraft components.  The flux is computed as the mass divided by the area of the grid cell. -->
    156    <field id="CMIP6_mcd"           field_ref="dummy_XYA"        /> <!-- P2 (kg m-2 s-1) atmosphere_downdraft_convective_mass_flux : Calculated as the convective mass flux divided by the area of the whole grid cell (not just the area of the cloud). -->
    157    <field id="CMIP6_mcu"           field_ref="dummy_XYA"        /> <!-- P1 (kg m-2 s-1) atmosphere_updraft_convective_mass_flux : In accordance with common usage in geophysical disciplines, "flux" implies per unit area, called "flux density" in physics. The atmosphere convective mass flux is the vertical transport of mass for a field of cumulus clouds or thermals, given by the product of air density and vertical velocity. For an area-average, cell_methods should specify whether the average is over all the area or the area of updrafts only. -->
    158    <field id="CMIP6_md"            field_ref="dummy_XYA"        /> <!-- P1 (kg m-2 s-1) tendency_of_atmosphere_mass_content_of_dust_dry_aerosol_particles_due_to_emission : Balkanski - LSCE -->
    159    <field id="CMIP6_mmraerso4"     field_ref="concso4"> concso4/(pres/287.04/ta) </field><!-- P1 (kg kg-1) mass_fraction_of_sulfate_dry_aerosol_in_air : Aerosol Sulfate Mass Mixing Ratio -->
    160    <field id="CMIP6_mrroLi"        field_ref="dummy_XY"         /> <!-- P1 (kg m-2 s-1) land_ice_runoff_flux : Runoff flux over land ice is the difference between any available liquid water in the snowpack less any refreezing. Computed as the sum of rainfall and melt of snow or ice less any refreezing or water retained in the snowpack -->
    161    <field id="CMIP6_n2o"           field_ref="dummy_XYA"        /> <!-- P1 (mol mol-1) mole_fraction_of_nitrous_oxide_in_air : N2O volume mixing ratio -->
    162    <field id="CMIP6_n2oglobal"     field_ref="N2O_ppb"          /> <!-- P1 (1e-09) mole_fraction_of_nitrous_oxide_in_air : Global mean Nitrous Oxide (N2O) -->
    163    <field id="CMIP6_o3"            field_ref="tro3"             /> <!-- P1 (mol mol-1) mole_fraction_of_ozone_in_air : Ozone volume mixing ratio -->
    164    <field id="CMIP6_od443dust"     field_ref="dummy_XY"         /> <!-- P1 (1.0) atmosphere_optical_thickness_due_to_dust_ambient_aerosol_particles : Balkanski - LSCE -->
    165    <field id="CMIP6_od550aerso"    field_ref="od550_STRAT"      /> <!-- P1 (1.0) strat_aerosol_optical_depth : From tropopause to stratopause as defined by the model -->
    166    <field id="CMIP6_od550so4so"    field_ref="dummy_XY"         /> <!-- P1 (1.0) missing : Balkanski - LSCE -->
    167    <field id="CMIP6_od865dust"     field_ref="dummy_XY"         /> <!-- P1 (1.0) atmosphere_optical_thickness_due_to_dust_ambient_aerosol_particles : Balkanski - LSCE -->
    168    <field id="CMIP6_orog"          field_ref="dummy_XY"         /> <!-- P1 (m) surface_altitude : The surface called "surface" means the lower boundary of the atmosphere. Altitude is the (geometric) height above the geoid, which is the reference geopotential surface. The geoid is similar to mean sea level. -->
    169    <field id="CMIP6_parasolRefl_sea" field_ref="dummy_XY"         /> <!-- P1 (1.0) toa_bidirectional_reflectance : Simulated reflectance from PARASOL as seen at the top of the atmosphere for 5 solar zenith angles. Valid only over ocean and for one viewing direction (viewing zenith angle of 30 degrees and relative azimuth angle 320 degrees). -->
    170    <field id="CMIP6_pctisccp"      field_ref="ctpisccp"         /> <!-- P1 (Pa) air_pressure_at_cloud_top : ISCCP Mean Cloud Top Pressure. Time-means are weighted by the ISCCP Total Cloud Fraction {:cltisccp} - see  http://cfmip.metoffice.com/COSP.html -->
    171    <field id="CMIP6_pfull"         field_ref="pres"             /> <!-- P1 (Pa) air_pressure : Air pressure on model levels -->
    172    <field id="CMIP6_phalf"         field_ref="paprs"            /> <!-- P1 (Pa) air_pressure : Air pressure on model half-levels -->
    173    <field id="CMIP6_pr"            field_ref="precip"           /> <!-- P1 (kg m-2 s-1) precipitation_flux : includes both liquid and solid phases -->
    174    <field id="CMIP6_prCrop"        field_ref="dummy_XY"         /> <!-- P1 (kg m-2 s-1) precipitation_flux : includes both liquid and solid phases -->
    175    <field id="CMIP6_prc"           field_ref="pluc"             /> <!-- P1 (kg m-2 s-1) convective_precipitation_flux : Convective precipitation at surface; includes both liquid and solid phases. -->
    176    <field id="CMIP6_prcprof"       field_ref="pr_con_l"         /> <!-- P2 (kg m-2 s-1) convective_rainfall_flux : unset -->
    177    <field id="CMIP6_prcsh"         field_ref="dummy_XY"         /> <!-- P1 (kg m-2 s-1) shallow_convective_precipitation_flux : Convection precipitation from shallow convection -->
    178    <field id="CMIP6_prhmax"        field_ref="precip" freq_op="1h"  operation="maximum"           >   @this   </field> <!-- P1 (kg m-2 s-1) precipitation_flux : Maximum Hourly Precipitation Rate -->
    179    <field id="CMIP6_prlsns"        field_ref="snowl"            /> <!-- P2 (kg m-2 s-1) large_scale_snowfall_flux : large-scale precipitation of all forms of water in the solid phase. -->
    180    <field id="CMIP6_prlsprof"      field_ref="plul"             /> <!-- P2 (kg m-2 s-1) large_scale_rainfall_flux : unset -->
    181    <field id="CMIP6_prra"          field_ref="dummy_XY"         /> <!-- P1 (kg m-2 s-1) rainfall_flux : Rainfall rate -->
    182    <field id="CMIP6_prrc"          field_ref="pluc"             /> <!-- P1 (kg m-2 s-1) convective_rainfall_flux : Convective Rainfall rate -->
    183    <field id="CMIP6_prrsn"         field_ref="dummy_XY"         /> <!-- P1 (1) mass_fraction_of_rainfall_onto_snow : The fraction of the grid averaged rainfall which falls on the snow pack -->
    184    <field id="CMIP6_prsn"          field_ref="snow"             /> <!-- P1 (kg m-2 s-1) snowfall_flux : at surface; includes precipitation of all forms of water in the solid phase -->
    185    <field id="CMIP6_prsnc"         field_ref="pr_con_i"         /> <!-- P2 (kg m-2 s-1) convective_snowfall_flux : convective precipitation of all forms of water in the solid phase. -->
    186    <field id="CMIP6_prsnsn"        field_ref="dummy_XY"         /> <!-- P1 (1) mass_fraction_of_snowfall_onto_snow : The fraction of the snowfall which falls on the snow pack -->
    187    <field id="CMIP6_prw"           field_ref="prw"              /> <!-- P1 (kg m-2) atmosphere_water_vapor_content : vertically integrated through the atmospheric column -->
    188    <field id="CMIP6_ps"            field_ref="psol"             /> <!-- P1 (Pa) surface_air_pressure : surface pressure (not mean sea-level pressure), 2-D field to calculate the 3-D pressure field from hybrid coordinates -->
    189    <field id="CMIP6_psitem"        field_ref="dummy_lat-P"      /> <!-- P1 (kg s^-1)  meridional_streamfunction_transformed_eulerian_mean : Residual mass streamfunction, computed from vstar and integrated from the top of the atmosphere (on the native model grid). Reference: Andrews et al (1987): Middle Atmospheric Dynamics. Accademic Press. -->
    190    <field id="CMIP6_psl"           field_ref="slp"              /> <!-- P1 (Pa) air_pressure_at_sea_level : Sea Level Pressure -->
    191    <field id="CMIP6_rainmxrat"     field_ref="dummy_XYA"        /> <!-- P2 (1.0) mass_fraction_of_rain_in_air : Rain mixing ratio -->
    192    <field id="CMIP6_reffcclwtop"   field_ref="dummy_XY"         /> <!-- P1 (m) effective_radius_of_convective_cloud_liquid_water_particle_at_liquid_water_cloud_top : Droplets are liquid only.  This is the effective radius "as seen from space" over convective liquid cloudy portion of grid cell.  This is the value from uppermost model layer with liquid cloud or, if available, or for some models it is the sum over all liquid cloud tops, no matter where they occur, as long as they are seen from the top of the atmosphere. Reported values are weighted by total liquid cloud top fraction of  (as seen from TOA) each time sample when computing monthly mean.daily data, separated to large-scale clouds, convective clouds. If any of the cloud is from more than one process (i.e. shallow convection), please provide them separately. -->
    193    <field id="CMIP6_reffclic"      field_ref="dummy_XYA"        /> <!-- P2 (m) effective_radius_of_convective_cloud_ice_particle : This is defined as the in-cloud ratio of the third moment over the second moment of the particle size distribution (obtained by considering only the cloudy portion of the grid cell). -->
    194    <field id="CMIP6_reffclis"      field_ref="ref_ice"          /> <!-- P2 (m) effective_radius_of_stratiform_cloud_ice_particle : This is defined as the in-cloud ratio of the third moment over the second moment of the particle size distribution (obtained by considering only the cloudy portion of the grid cell). -->
    195    <field id="CMIP6_reffclwc"      field_ref="dummy_XYA"        /> <!-- P2 (m) effective_radius_of_convective_cloud_liquid_water_particle : Droplets are liquid.  The effective radius is defined as the ratio of the third moment over the second moment of the particle size distribution and the time-mean should be calculated, weighting the individual samples by the cloudy fraction of the grid cell. -->
    196    <field id="CMIP6_reffclws"      field_ref="dummy_XYA"        /> <!-- P2 (m) effective_radius_of_stratiform_cloud_liquid_water_particle : Droplets are liquid.  The effective radius is defined as the ratio of the third moment over the second moment of the particle size distribution and the time-mean should be calculated, weighting the individual samples by the cloudy fraction of the grid cell. -->
    197    <field id="CMIP6_reffgrpls"     field_ref="dummy_XYA"        /> <!-- P2 (m) effective_radius_of_stratiform_cloud_graupel_particle : This is defined as the in-cloud ratio of the third moment over the second moment of the particle size distribution (obtained by considering only the cloudy portion of the grid cell). -->
     133   <field id="CMIP6_huss"          field_ref="q2m"              /> <!-- P1 (1.0) specific_humidity : This is sampled synoptically. -->
     134   <field id="CMIP6_iareafl"       field_ref="fract_sic"         >fract_sic*aire </field> <!-- P3 (m2) floating_ice_shelf_area : Antarctica -->
     135   <field id="CMIP6_iareagr"       field_ref="fract_lic"         >fract_lic*aire </field> <!-- P3 (m2) grounded_ice_sheet_area : Greenland -->
     136   <field id="CMIP6_intuadse"      field_ref="ue"               /> <!-- P1 (1.e6 J m-1 s-1) vertical_integral_eastward_wind_by_dry_static_energy : Vertically integrated Eastward dry transport (cp.T +zg).u (Mass_weighted_vertical integral of the product of northward wind by dry static_energy per mass unit) -->
     137   <field id="CMIP6_intuaw"        field_ref="uwat"             /> <!-- P1 (kg m-1 s-1) vertical_integral_eastward_wind_by_total_water : Vertically integrated Eastward moisture transport (Mass_weighted_vertical integral of the product of eastward wind by total water mass per unit mass) -->
     138   <field id="CMIP6_intvadse"      field_ref="ve"               /> <!-- P1 (1.e6 J m-1 s-1) vertical_integral_northward_wind_by_dry_static_energy : Vertically integrated Northward dry transport (cp.T +zg).v (Mass_weighted_vertical integral of the product of northward wind by dry static_energy per mass unit) -->
     139   <field id="CMIP6_intvaw"        field_ref="vwat"             /> <!-- P1 (kg m-1 s-1) vertical_integral_northward_wind_by_total_water : Vertically integrated Northward moisture transport (Mass_weighted_vertical integral of the product of northward wind by total water mass per unit mass) -->
     140   <field id="CMIP6_jo2"           field_ref="dummy_not_provided"        /> <!-- P1 (s-1) photolysis_rate_of_molecular_oxygen : zonal mean; hence YZT -->
     141   <field id="CMIP6_jo3"           field_ref="dummy_not_provided"        /> <!-- P1 (s-1) photolysis_rate_of_ozone : zonal mean; hence YZT -->
     142   <field id="CMIP6_jpdftaureicemodis" field_ref="crimodis"              /> <!-- P1 (%) cloud_area_fraction_in_atmosphere_layer : MODIS Optical Thickness-Particle Size joint  distribution, ice -->
     143   <field id="CMIP6_jpdftaureliqmodis" field_ref="crlmodis"              /> <!-- P1 (%) cloud_area_fraction_in_atmosphere_layer : MODIS Optical Thickness-Particle Size joint  distribution, liquid -->
     144   <field id="CMIP6_latitude"      field_ref="io_lat"                    /> <!-- P1 (degrees_north) latitude : Latitude -->
     145   <field id="CMIP6_lim"           field_ref="dummy_not_provided"        /> <!-- P2 (kg) land_ice_mass : Greenland -->
     146   <field id="CMIP6_limnsw"        field_ref="dummy_not_provided"        /> <!-- P2 (kg) land_ice_mass_not_displacing_sea_water : Greenland -->
     147   <field id="CMIP6_loadbc"        field_ref="loadbc"           /> <!-- P1 (kg m-2) atmosphere_mass_content_of_black_carbon_dry_aerosol : Load of Black Carbon Aerosol -->
     148   <field id="CMIP6_loaddust"      field_ref="loaddust"         /> <!-- P1 (kg m-2) atmosphere_mass_content_of_dust_dry_aerosol : Load of Dust -->
     149   <field id="CMIP6_loadnh4"       field_ref="dummy_not_provided"         /> <!-- P1 (kg m-2) atmosphere_mass_content_of_ammonium_dry_aerosol : Load of NH4 -->
     150   <field id="CMIP6_loadno3"       field_ref="loadno3"          /> <!-- P1 (kg m-2) atmosphere_mass_content_of_nitrate_dry_aerosol : Load of NO3 -->
     151   <field id="CMIP6_loadoa"        field_ref="loadoa"           /> <!-- P1 (kg m-2) atmosphere_mass_content_of_particulate_organic_matter_dry_aerosol : Load of Dry Aerosol Organic Matter -->
     152   <field id="CMIP6_loadpoa"       field_ref="loadoa"           /> <!-- P1 (kg m-2) atmosphere_mass_content_of_primary_particulate_organic_matter_dry_aerosol : Load of Dry Aerosol Primary Organic Matter -->
     153   <field id="CMIP6_loadso4"       field_ref="loadso4"          /> <!-- P1 (kg m-2) atmosphere_mass_content_of_sulfate_dry_aerosol : Load of SO4 -->
     154   <field id="CMIP6_loadsoa"       field_ref="dummy_not_provided"         /> <!-- P1 (kg m-2) atmosphere_mass_content_of_secondary_particulate_organic_matter_dry_aerosol : Load of Dry Aerosol Secondary Organic Matter -->
     155   <field id="CMIP6_loadss"        field_ref="loadss"           /> <!-- P1 (kg m-2) atmosphere_mass_content_of_seasalt_dry_aerosol : Load of Seasalt -->
     156   <field id="CMIP6_longitude"     field_ref="io_lon"              /> <!-- P1 (degrees_east) longitude : Longitude -->
     157   <field id="CMIP6_lwsffluxaero"  field_ref="dummy_not_provided"         /> <!-- P2 (W m-2) longwave__flux__due_to_volcanic_aerosols_at_the_surface : downwelling longwave  flux  due to volcanic aerosols at the surface to be diagnosed through double radiation call -->
     158   <field id="CMIP6_lwsrfasdust"   field_ref="dummy_not_provided"         /> <!-- P1 (W m-2) surface_instantaneous_longwave_forcing_due_to_dust : All-sky Surface Longwave radiative flux due to Dust -->
     159   <field id="CMIP6_lwsrfcsdust"   field_ref="dummy_not_provided"         /> <!-- P1 (W m-2) surface_instantaneous_longwave_forcing_due_to_dust_in_clearsky : Clear-sky Surface Longwave radiative flux due to Dust -->
     160   <field id="CMIP6_lwtoaasdust"   field_ref="dummy_not_provided"         /> <!-- P1 (W m-2) toa_instantaneous_longwave_forcing : all sky lw-rf dust at toa -->
     161   <field id="CMIP6_lwtoacsaer"    field_ref="toplwad0"         /> <!-- P1 (W m-2) toa_instantaneous_longwave_forcing : Clear-Sky LW-RF Aerosols at TOA -->
     162   <field id="CMIP6_lwtoacsdust"   field_ref="dummy_not_provided"         /> <!-- P1 (W m-2) toa_instantaneous_longwave_forcing_due_to_dust_in_clearsky : Clear-sky TOA Longwave radiative flux due to Dust -->
     163   <field id="CMIP6_lwtoafluxaerocs" field_ref="dummy_not_provided"       /> <!-- P1 (W m-2) longwave_flux_due_to_volcanic_aerosols_at_TOA_under_clear_sky : downwelling longwave flux due to volcanic aerosols at TOA under clear sky to be diagnosed through double radiation call -->
     164   <field id="CMIP6_mc"            field_ref="mc"               /> <!-- P1 (kg m-2 s-1) atmosphere_net_upward_convective_mass_flux : The net mass flux should represent the difference between the updraft and downdraft components.  The flux is computed as the mass divided by the area of the grid cell. -->
     165   <field id="CMIP6_mcd"           field_ref="dnwd"              > (dnwd-dnwd0) &gt; 0 ? (dnwd-dnwd0) : 0 </field> <!-- P2 (kg m-2 s-1) atmosphere_downdraft_convective_mass_flux : Calculated as the convective mass flux divided by the area of the whole grid cell (not just the area of the cloud). -->
     166   <field id="CMIP6_mcu"           field_ref="upwd"             /> <!-- P1 (kg m-2 s-1) atmosphere_updraft_convective_mass_flux : Calculated as the convective mass flux divided by the area of the whole grid cell (not just the area of the cloud). -->
     167   <field id="CMIP6_md"            field_ref="dummy_not_provided"        /> <!-- P1 (kg m-2 s-1) tendency_of_atmosphere_mass_content_of_dust_dry_aerosol_particles_due_to_emission : Wet diameter mode coarse insoluble -->
     168   <field id="CMIP6_mrroLi"        field_ref="mrroli"                    /> <!-- P1 (kg m-2 s-1) land_ice_runoff_flux : Land Ice Runoff Flux -->
     169   <field id="CMIP6_n2o"           field_ref="dummy_not_provided"        /> <!-- P1 (mol mol-1) mole_fraction_of_nitrous_oxide_in_air : Mole Fraction of N2O -->
     170   <field id="CMIP6_n2oglobal"     field_ref="N2O_ppb"                   /> <!-- P1 (1e-09) mole_fraction_of_nitrous_oxide_in_air : Global Mean Mole Fraction of N2O -->
     171   <field id="CMIP6_o3"            field_ref="ozone"                     /> <!-- P1 (mol mol-1) mole_fraction_of_ozone_in_air : Mole Fraction of O3 -->
     172   <field id="CMIP6_od443dust"     field_ref="dummy_not_provided"        /> <!-- P1 (1) atmosphere_optical_thickness_due_to_dust_ambient_aerosol_particles : Optical thickness at 443 nm Dust -->
     173   <field id="CMIP6_od550aerso"    field_ref="od550_STRAT"               /> <!-- P1 (1) strat_aerosol_optical_depth : Stratospheric Optical depth at 550 nm (all aerosols) 2D-field (here we limit the computation of OD to the stratosphere only) -->
     174   <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) -->
     175   <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_parasolRefl" field_ref="parasol_refl"                /> <!-- P1 (1) toa_bidirectional_reflectance : PARASOL Reflectance -->
     177   <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 -->
     178   <field id="CMIP6_pfull"         field_ref="pres"                      /> <!-- P1 (Pa) air_pressure : Pressure on Model Levels -->
     179   <field id="CMIP6_phalf"         field_ref="paprs"                     /> <!-- P1 (Pa) air_pressure : Pressure on Model Half-Levels -->
     180   <field id="CMIP6_pr"            field_ref="precip"                    /> <!-- P1 (kg m-2 s-1) precipitation_flux : at surface; includes both liquid and solid phases from all types of clouds (both large-scale and convective) -->
     181   <field id="CMIP6_prCrop"        field_ref="dummy_not_provided"        /> <!-- P1 (kg m-2 s-1) precipitation_flux : Precipitation over Crop Tile -->
     182   <field id="CMIP6_prc"           field_ref="pluc"                      /> <!-- P1 (kg m-2 s-1) convective_precipitation_flux : at surface; includes both liquid and solid phases. -->
     183   <field id="CMIP6_prcprof"       field_ref="pr_con_l"                  /> <!-- P2 (kg m-2 s-1) convective_rainfall_flux : Convective Rainfall Flux -->
     184   <field id="CMIP6_prcsh"         field_ref="dummy_not_provided"        /> <!-- P1 (kg m-2 s-1) shallow_convective_precipitation_flux : Shallow convection precipitation flux -->
     185   <field id="CMIP6_prhmax"        field_ref="prhmax" freq_op="1h" >   @prhmax   </field> <!-- P1 (kg m-2 s-1) precipitation_flux : Maximum Hourly Precipitation Rate -->
     186   <field id="CMIP6_prlsns"        field_ref="pr_lsc_i"                  /> <!-- P2 (kg m-2 s-1) large_scale_snowfall_flux : large-scale precipitation of all forms of water in the solid phase. -->
     187   <field id="CMIP6_prlsprof"      field_ref="pr_lsc_l"                  /> <!-- P2 (kg m-2 s-1) large_scale_rainfall_flux : Stratiform Rainfall Flux -->
     188   <field id="CMIP6_prra_land"     field_ref="dummy_XY"         /> <!-- P2 (kg m-2 s-1) rainfall_flux : rainfall_flux -->
     189   <field id="CMIP6_prra_ifs"      field_ref="dummy_XY"         /> <!-- P1 (kg m-2 s-1) rainfall_flux : computed as the total mass of liquid water falling as liquid rain  into the ice-free portion of the ocean divided by the area of the ocean portion of the grid cell. -->
     190   <field id="CMIP6_prra_ist"      field_ref="dummy_XY"         /> <!-- P1 (kg m-2 s-1) rainfall_flux : over Land Ice//quantity averaged over ice sheet (grounded ice sheet and floating ice shelf) only. Needed to analyse the impact of downscaling methods -->
     191   <field id="CMIP6_prra"          field_ref="rain_fall"                 /> <!-- P1 (kg m-2 s-1) rainfall_flux : Rainfall rate -->
     192   <field id="CMIP6_prrc_land"     field_ref="dummy_XY"         /> <!-- P1 (kg m-2 s-1) convective_rainfall_flux : convective_rainfall_flux -->
     193   <field id="CMIP6_prrc"          field_ref="rain_con"                  /> <!-- P1 (kg m-2 s-1) convective_rainfall_flux : Convective Rainfall rate -->
     194   <field id="CMIP6_prrsn"         field_ref="dummy_not_provided"       /> <!-- P1 (1) mass_fraction_of_rainfall_onto_snow : mass_fraction_of_rainfall_onto_snow -->
     195   <field id="CMIP6_prsn"          field_ref="snow"                     /> <!-- P1 (kg m-2 s-1) snowfall_flux : at surface; includes precipitation of all forms of water in the solid phase -->
     196   <field id="CMIP6_prsn_ifs"      field_ref="dummy_XY"         /> <!-- P1 (kg m-2 s-1) snowfall_flux : computed as the total mass per unit time of solid-phase precipitation falling into the ice-free portion of the ocean divided by the area of the ocean portion of the grid cell.   (Snowfall flux includes all types of solid-phase precipitation.) -->
     197   <field id="CMIP6_prsn_ist"      field_ref="dummy_XY"         /> <!-- P1 (kg m-2 s-1) snowfall_flux : quantity averaged over ice sheet (grounded ice sheet and floating ice shelf) only. Needed to analyse the impact of downscaling methods -->
     198   <field id="CMIP6_prsnc_land"    field_ref="dummy_XYA"        /> <!-- P2 (kg m-2 s-1) convective_snowfall_flux : convective_snowfall_flux -->
     199   <field id="CMIP6_prsnc"         field_ref="pr_con_i"                 /> <!-- P2 (kg m-2 s-1) convective_snowfall_flux : Convective Snowfall rate -->
     200   <field id="CMIP6_prsnsn"        field_ref="dummy_not_provided"       /> <!-- P1 (1) mass_fraction_of_snowfall_onto_snow : mass_fraction_of_snowfall_onto_snow -->
     201   <field id="CMIP6_prw"           field_ref="prw"                      /> <!-- P1 (kg m-2) atmosphere_water_vapor_content : Water Vapor Path -->
     202   <field id="CMIP6_ps"            field_ref="psol"                     /> <!-- P1 (Pa) surface_air_pressure : not, in general, the same as mean sea-level pressure -->
     203   <field id="CMIP6_psitem"        field_ref="dummy_XYA"                /> <!-- P1 (kg s^-1) meridional_streamfunction_transformed_eulerian_mean : zonal mean; hence YZT -->
     204   <field id="CMIP6_psl"           field_ref="slp"                      /> <!-- P1 (Pa) air_pressure_at_sea_level : not, in general, the same as surface pressure -->
     205   <field id="CMIP6_rainmxrat"     field_ref="dummy_not_provided"       /> <!-- P2 (1) mass_fraction_of_rain_in_air : rain_mixing_ratio -->
     206   <field id="CMIP6_reffcclwtop"   field_ref="dummy_not_provided"       /> <!-- P1 (m) effective_radius_of_convective_cloud_liquid_water_particle_at_liquid_water_cloud_top : Cloud-Top Effective Droplet Radius In Convective Cloud -->
     207   <field id="CMIP6_reffclic"      field_ref="dummy_not_provided"       /> <!-- P2 (m) effective_radius_of_convective_cloud_ice_particle : Hydrometeor Effective Radius of Convective Cloud Ice -->
     208   <field id="CMIP6_reffclis"      field_ref="ref_ice"                  /> <!-- P2 (m) effective_radius_of_stratiform_cloud_ice_particle : Hydrometeor Effective Radius of Stratiform Cloud Ice -->
     209   <field id="CMIP6_reffclwc"      field_ref="dummy_not_provided"       /> <!-- P2 (m) effective_radius_of_convective_cloud_liquid_water_particle : Hydrometeor Effective Radius of Convective Cloud Liquid Water -->
     210   <field id="CMIP6_reffclws"      field_ref="reffclws" expr="@reffclws / @lcc3dstra" > reffclws / lcc3dstra </field> <!-- P2 (m) effective_radius_of_stratiform_cloud_liquid_water_particle : Hydrometeor Effective Radius of Stratiform Cloud Liquid Water -->
     211   <field id="CMIP6_reffgrpls"     field_ref="dummy_not_provided"       /> <!-- P2 (m) effective_radius_of_stratiform_cloud_graupel_particle : This is defined as the in-cloud ratio of the third moment over the second moment of the particle size distribution (obtained by considering only the cloudy portion of the grid cell). -->
    198212   <field id="CMIP6_reffrainc"     field_ref="dummy_XYA"        /> <!-- P2 (m) effective_radius_of_convective_cloud_rain_particle : This is defined as the in-cloud ratio of the third moment over the second moment of the particle size distribution (obtained by considering only the cloudy portion of the grid cell). -->
    199213   <field id="CMIP6_reffrains"     field_ref="dummy_XYA"        /> <!-- P2 (m) effective_radius_of_stratiform_cloud_rain_particle : This is defined as the in-cloud ratio of the third moment over the second moment of the particle size distribution (obtained by considering only the cloudy portion of the grid cell). -->
    200    <field id="CMIP6_reffsclwtop"   field_ref="dummy_XY"         /> <!-- P1 (m) effective_radius_of_stratiform_cloud_liquid_water_particle_at_liquid_water_cloud_top : Droplets are liquid only.  This is the effective radius "as seen from space" over liquid stratiform cloudy portion of grid cell.  This is the value from uppermost model layer with liquid cloud or, if available, or for some models it is the sum over all liquid cloud tops, no matter where they occur, as long as they are seen from the top of the atmosphere. Reported values are weighted by total liquid cloud top fraction of  (as seen from TOA) each time sample when computing monthly mean.daily data, separated to large-scale clouds, convective clouds. If any of the cloud is from more than one process (i.e. shallow convection), please provide them separately. -->
     214   <field id="CMIP6_reffsclwtop"   field_ref="reffclwtop" expr="@reffclwtop / @lcc" > reffclwtop / lcc </field> <!-- P1 (m) effective_radius_of_stratiform_cloud_liquid_water_particle_at_liquid_water_cloud_top : Cloud-Top Effective Droplet Radius In Stratiform Cloud -->
    201215   <field id="CMIP6_reffsnowc"     field_ref="dummy_XYA"        /> <!-- P2 (m) effective_radius_of_convective_cloud_snow_particle : This is defined as the in-cloud ratio of the third moment over the second moment of the particle size distribution (obtained by considering only the cloudy portion of the grid cell). -->
    202216   <field id="CMIP6_reffsnows"     field_ref="dummy_XYA"        /> <!-- P2 (m) effective_radius_of_stratiform_cloud_snow_particle : This is defined as the in-cloud ratio of the third moment over the second moment of the particle size distribution (obtained by considering only the cloudy portion of the grid cell). -->
    203    <field id="CMIP6_rld"           field_ref="rld"              /> <!-- P1 (W m-2) downwelling_longwave_flux_in_air : Downwelling Longwave Radiation (includes the fluxes at the surface and TOA) -->
    204    <field id="CMIP6_rld4co2"       field_ref="rld4co2"          /> <!-- P1 (W m-2) downwelling_longwave_flux_in_air : Downwelling longwave radiation calculated using carbon dioxide concentrations increased fourfold (includes the fluxes at the surface and TOA) -->
    205    <field id="CMIP6_rldcs"         field_ref="rldcs"            /> <!-- P1 (W m-2) downwelling_longwave_flux_in_air_assuming_clear_sky : Downwelling clear-sky longwave radiation (includes the fluxes at the surface and TOA) -->
    206    <field id="CMIP6_rldcs4co2"     field_ref="rldcs4co2"        /> <!-- P1 (W m-2) downwelling_longwave_flux_in_air_assuming_clear_sky : Downwelling clear-sky longwave radiation calculated using carbon dioxide concentrations increased fourfold (includes the fluxes at the surface and TOA) -->
     217   <field id="CMIP6_rld"           field_ref="rld"              /> <!-- P1 (W m-2) downwelling_longwave_flux_in_air : Downwelling Longwave Radiation -->
     218   <field id="CMIP6_rld4co2"       field_ref="rld4co2"          /> <!-- P1 (W m-2) downwelling_longwave_flux_in_air : Downwelling Longwave Radiation 4XCO2 Atmosphere -->
     219   <field id="CMIP6_rldcs"         field_ref="rldcs"            /> <!-- P1 (W m-2) downwelling_longwave_flux_in_air_assuming_clear_sky : Downwelling Clear-Sky Longwave Radiation -->
     220   <field id="CMIP6_rldcs4co2"     field_ref="rldcs4co2"        /> <!-- P1 (W m-2) downwelling_longwave_flux_in_air_assuming_clear_sky : Downwelling Clear-Sky Longwave Radiation 4XCO2 Atmosphere -->
     221   <field id="CMIP6_rlds_ist"      field_ref="dummy_XY"         /> <!-- P1 (W m-2) surface_downwelling_longwave_flux_in_air : Surface Downwelling Longwave Radiation -->
    207222   <field id="CMIP6_rlds"          field_ref="LWdnSFC"          /> <!-- P1 (W m-2) surface_downwelling_longwave_flux_in_air : Surface Downwelling Longwave Radiation -->
    208    <field id="CMIP6_rldscs"        field_ref="LWdnSFCclr"       /> <!-- P1 (W m-2) surface_downwelling_longwave_flux_in_air_assuming_clear_sky : Surface downwelling clear-sky longwave radiation -->
    209    <field id="CMIP6_rls"           field_ref="soll"             /> <!-- P1 (W m-2) surface_net_downward_longwave_flux : Net longwave surface radiation -->
    210    <field id="CMIP6_rlu"           field_ref="rlu"              /> <!-- P1 (W m-2) upwelling_longwave_flux_in_air : Upwelling longwave radiation (includes the fluxes at the surface and TOA) -->
    211    <field id="CMIP6_rlu4co2"       field_ref="rlu4co2"          /> <!-- P1 (W m-2) upwelling_longwave_flux_in_air : Upwelling longwave radiation calculated using carbon dioxide concentrations increased fourfold (includes the fluxes at the surface and TOA) -->
    212    <field id="CMIP6_rlucs"         field_ref="rlucs"            /> <!-- P1 (W m-2) upwelling_longwave_flux_in_air_assuming_clear_sky : Upwelling clear-sky longwave radiation  (includes the fluxes at the surface and TOA) -->
    213    <field id="CMIP6_rlucs4co2"     field_ref="rlucs4co2"        /> <!-- P1 (W m-2) upwelling_longwave_flux_in_air_assuming_clear_sky : Upwelling clear-sky longwave radiation calculated using carbon dioxide concentrations increased fourfold (includes the fluxes at the surface and TOA) -->
     223   <field id="CMIP6_rldscs"        field_ref="LWdnSFCclr"       /> <!-- P1 (W m-2) surface_downwelling_longwave_flux_in_air : Surface Downwelling Longwave Radiation -->
     224   <field id="CMIP6_rls"           field_ref="soll"             /> <!-- P1 (W m-2) surface_net_downward_longwave_flux : Net Longwave Surface Radiation -->
     225   <field id="CMIP6_rls_land"      field_ref="dummy_XY"         /> <!-- P1 (W m-2) surface_net_downward_longwave_flux : Net longwave radiation -->
     226   <field id="CMIP6_rlu"           field_ref="rlu"              />  <!-- P1 (W m-2) upwelling_longwave_flux_in_air : Fluxes are requested at all levels -->
     227   <field id="CMIP6_rlu4co2"       field_ref="rlu4co2"          /> <!-- P1 (W m-2) upwelling_longwave_flux_in_air : Upwelling Longwave Radiation 4XCO2 Atmosphere -->
     228   <field id="CMIP6_rlucs"         field_ref="rlucs"            /> <!-- P1 (W m-2) upwelling_longwave_flux_in_air_assuming_clear_sky : Includes also the fluxes at the surface and TOA. -->
     229   <field id="CMIP6_rlucs4co2"     field_ref="rlucs4co2"        /> <!-- P1 (W m-2) upwelling_longwave_flux_in_air_assuming_clear_sky : Upwelling Clear-Sky Longwave Radiation 4XCO2 Atmosphere -->
     230   <field id="CMIP6_rlus_ist"      field_ref="dummy_XY"         /> <!-- P1 (W m-2) surface_upwelling_longwave_flux_in_air : Surface Upwelling Longwave Radiation -->
    214231   <field id="CMIP6_rlus"          field_ref="LWupSFC"          /> <!-- P1 (W m-2) surface_upwelling_longwave_flux_in_air : Surface Upwelling Longwave Radiation -->
    215    <field id="CMIP6_rlut"          field_ref="topl"             /> <!-- P1 (W m-2) toa_outgoing_longwave_flux : at the top of the atmosphere (to be compared with satellite measurements) -->
    216    <field id="CMIP6_rlut4co2"      field_ref="rlut4co2"         /> <!-- P1 (W m-2) toa_outgoing_longwave_flux : Top-of-atmosphere outgoing longwave radiation calculated using carbon dioxide concentrations increased fourfold -->
    217    <field id="CMIP6_rlutcs"        field_ref="topl0"            /> <!-- P1 (W m-2) toa_outgoing_longwave_flux_assuming_clear_sky : TOA Outgoing Clear-sky Longwave Radiation -->
    218    <field id="CMIP6_rlutcs4co2"    field_ref="rlutcs4co2"       /> <!-- P1 (W m-2) toa_outgoing_longwave_flux_assuming_clear_sky : Top-of-atmosphere outgoing clear-sky longwave radiation calculated using carbon dioxide concentrations increased fourfold -->
    219    <field id="CMIP6_rsd"           field_ref="rsd"              /> <!-- P1 (W m-2) downwelling_shortwave_flux_in_air : Downwelling shortwave radiation (includes the fluxes at the surface and top-of-atmosphere) -->
    220    <field id="CMIP6_rsd4co2"       field_ref="rsd4co2"          /> <!-- P1 (W m-2) downwelling_shortwave_flux_in_air : Downwelling shortwave radiation calculated using carbon dioxide concentrations increased fourfold -->
    221    <field id="CMIP6_rsdcs"         field_ref="rsdcs"            /> <!-- P1 (W m-2) downwelling_shortwave_flux_in_air_assuming_clear_sky : Downwelling clear-sky shortwave radiation (includes the fluxes at the surface and top-of-atmosphere) -->
    222    <field id="CMIP6_rsdcs4co2"     field_ref="rsdcs4co2"        /> <!-- P1 (W m-2) downwelling_shortwave_flux_in_air_assuming_clear_sky : Downwelling clear-sky shortwave radiation calculated using carbon dioxide concentrations increased fourfold -->
    223    <field id="CMIP6_rsdcsaf"       field_ref="dummy_XYA"        /> <!-- P1 (W m-2) downwelling_shortwave_flux_assuming_clean_clear_sky : Calculated in the absence of aerosols and clouds (following Ghan). This requires a double-call in the radiation code with precisely the same meteorology. -->
    224    <field id="CMIP6_rsdcsafbnd"    field_ref="dummy_XYA"        /> <!-- P1 (W m-2) band_downwelling_shortwave_flux_assuming_clean_clear_sky : Calculated in the absence of aerosols and clouds (following Ghan). This requires a double-call in the radiation code with precisely the same meteorology. -->
    225    <field id="CMIP6_rsdcsbnd"      field_ref="dummy_XYA"        /> <!-- P1 (W m-2) band_downwelling_shortwave_flux_assuming_clear_sky : Calculated with aerosols but without clouds. This is a standard clear-sky calculation -->
    226    <field id="CMIP6_rsds"          field_ref="SWdnSFC"          /> <!-- P1 (W m-2) surface_downwelling_shortwave_flux_in_air : surface solar irradiance for UV calculations -->
    227    <field id="CMIP6_rsdscs"        field_ref="SWdnSFCclr"       /> <!-- P1 (W m-2) surface_downwelling_shortwave_flux_in_air_assuming_clear_sky : surface solar irradiance clear sky for UV calculations -->
    228    <field id="CMIP6_rsdscsaf"      field_ref="dummy_XY"         /> <!-- P1 (W m-2) surface_downwelling_shortwave_flux_in_air_assuming_clean_clear_sky : Calculated in the absence of aerosols and clouds. -->
    229    <field id="CMIP6_rsdscsafbnd"   field_ref="dummy_XY"         /> <!-- P1 (W m-2) surface_downwelling_shortwave_flux_in_air_assuming_clean_clear_sky : Calculated in the absence of aerosols and clouds, following Ghan (2013, ACP). This requires a double-call in the radiation code with precisely the same meteorology. -->
    230    <field id="CMIP6_rsdscsbnd"     field_ref="dummy_XY"         /> <!-- P1 (W m-2) surface_downwelling_shortwave_flux_in_air_assuming_clear_sky : Calculated with aerosols but without clouds. This is a standard clear-sky calculation -->
    231    <field id="CMIP6_rsdscsdiff"    field_ref="dummy_XY"         /> <!-- P1 (W m-2) surface_diffuse_downwelling_shortwave_flux_in_air_assuming_clear_sky : unset -->
    232    <field id="CMIP6_rsdsdiff"      field_ref="dummy_XY"         /> <!-- P1 (W m-2) surface_diffuse_downwelling_shortwave_flux_in_air : unset -->
    233    <field id="CMIP6_rsdt"          field_ref="SWdnTOA"          /> <!-- P1 (W m-2) toa_incoming_shortwave_flux : Shortwave radiation incident at the top of the atmosphere -->
    234    <field id="CMIP6_rss"           field_ref="sols"             /> <!-- P1 (W m-2) surface_net_downward_shortwave_flux : Net downward shortwave radiation at the surface -->
    235    <field id="CMIP6_rsu"           field_ref="rsu"              /> <!-- P1 (W m-2) upwelling_shortwave_flux_in_air : Upwelling shortwave radiation  (includes also the fluxes at the surface and top of atmosphere) -->
    236    <field id="CMIP6_rsu4co2"       field_ref="rsu4co2"          /> <!-- P1 (W m-2) upwelling_shortwave_flux_in_air : Upwelling Shortwave Radiation calculated using carbon dioxide concentrations increased fourfold -->
    237    <field id="CMIP6_rsucs"         field_ref="rsucs"            /> <!-- P1 (W m-2) upwelling_shortwave_flux_in_air_assuming_clear_sky : Upwelling clear-sky shortwave radiation  (includes the fluxes at the surface and TOA) -->
    238    <field id="CMIP6_rsucs4co2"     field_ref="rsucs4co2"        /> <!-- P1 (W m-2) upwelling_shortwave_flux_in_air_assuming_clear_sky : Upwelling clear-sky shortwave radiation calculated using carbon dioxide concentrations increased fourfold -->
    239    <field id="CMIP6_rsucsaf"       field_ref="dummy_XYA"        /> <!-- P1 (W m-2) upwelling_shortwave_flux_assuming_clean_clear_sky : Calculated in the absence of aerosols and clouds (following Ghan). This requires a double-call in the radiation code with precisely the same meteorology. -->
    240    <field id="CMIP6_rsucsafbnd"    field_ref="dummy_XYA"        /> <!-- P1 (W m-2) band_upwelling_shortwave_flux_assuming_clean_clear_sky : Calculated in the absence of aerosols and clouds (following Ghan). This requires a double-call in the radiation code with precisely the same meteorology. -->
    241    <field id="CMIP6_rsucsbnd"      field_ref="dummy_XYA"        /> <!-- P1 (W m-2) band_upwelling_shortwave_flux_assuming_clear_sky : Calculated with aerosols but without clouds. This is a standard clear-sky calculation -->
    242    <field id="CMIP6_rsus"          field_ref="SWupSFC"          /> <!-- P1 (W m-2) surface_upwelling_shortwave_flux_in_air : Surface Upwelling Shortwave Radiation -->
    243    <field id="CMIP6_rsuscs"        field_ref="SWupSFCclr"       /> <!-- P1 (W m-2) surface_upwelling_shortwave_flux_in_air_assuming_clear_sky : Surface Upwelling Clear-sky Shortwave Radiation -->
    244    <field id="CMIP6_rsuscsaf"      field_ref="dummy_XY"         /> <!-- P1 (W m-2) surface_upwelling_shortwave_flux_in_air_assuming_clean_clear_sky : Surface Upwelling Clear-sky, Aerosol Free Shortwave Radiation -->
    245    <field id="CMIP6_rsuscsafbnd"   field_ref="dummy_XY"         /> <!-- P1 (W m-2) surface_upwelling_shortwave_flux_in_air_assuming_clean_clear_sky : Calculated in the absence of aerosols and clouds, following Ghan (ACP, 2013). This requires a double-call in the radiation code with precisely the same meteorology. -->
    246    <field id="CMIP6_rsuscsbnd"     field_ref="dummy_XY"         /> <!-- P1 (W m-2) surface_upwelling_shortwave_flux_in_air_assuming_clear_sky : Calculated with aerosols but without clouds. This is a standard clear-sky calculation -->
    247    <field id="CMIP6_rsut"          field_ref="SWupTOA"          /> <!-- P1 (W m-2) toa_outgoing_shortwave_flux : at the top of the atmosphere -->
    248    <field id="CMIP6_rsut4co2"      field_ref="rsut4co2"         /> <!-- P1 (W m-2) toa_outgoing_shortwave_flux : TOA Outgoing Shortwave Radiation calculated using carbon dioxide concentrations increased fourfold -->
    249    <field id="CMIP6_rsutcs"        field_ref="SWupTOAclr"       /> <!-- P1 (W m-2) toa_outgoing_shortwave_flux_assuming_clear_sky : Calculated in the absence of clouds. -->
    250    <field id="CMIP6_rsutcs4co2"    field_ref="rsutcs4co2"       /> <!-- P1 (W m-2) toa_outgoing_shortwave_flux_assuming_clear_sky : TOA Outgoing Clear-Sky Shortwave Radiation calculated using carbon dioxide concentrations increased fourfold -->
    251    <field id="CMIP6_rsutcsafbnd"   field_ref="dummy_XY"         /> <!-- P1 (W m-2) band_toa_outgoing_shortwave_flux_assuming_clean_clear_sky : Calculated in the absence of aerosols and clouds, following Ghan (2013, ACP). This requires a double-call in the radiation code with precisely the same meteorology. -->
    252    <field id="CMIP6_rsutcsbnd"     field_ref="dummy_XY"         /> <!-- P1 (W m-2) toa_outgoing_shortwave_flux_assuming_clear_sky : Calculated with aerosols but without clouds. This is a standard clear-sky calculation -->
    253    <field id="CMIP6_rtmt"          field_ref="nettop"           /> <!-- P1 (W m-2) net_downward_radiative_flux_at_top_of_atmosphere_model : Net Downward Radiative Flux at Top of Model : I.e., at the top of that portion of the atmosphere where dynamics are explicitly treated by the model. This is reported only if it differs from the net downward radiative flux at the top of the atmosphere. -->
     232   <field id="CMIP6_rlut"          field_ref="topl"             /> <!-- P1 (W m-2) toa_outgoing_longwave_flux : TOA Outgoing Longwave Radiation -->
     233   <field id="CMIP6_rlut4co2"      field_ref="rlut4co2"         /> <!-- P1 (W m-2) toa_outgoing_longwave_flux : TOA Outgoing Longwave Radiation 4XCO2 Atmosphere -->
     234   <field id="CMIP6_rlutcs"        field_ref="topl0"            /> <!-- P1 (W m-2) toa_outgoing_longwave_flux_assuming_clear_sky : TOA Outgoing Clear-Sky Longwave Radiation -->
     235   <field id="CMIP6_rlutcs4co2"    field_ref="rlutcs4co2"       /> <!-- P1 (W m-2) toa_outgoing_longwave_flux_assuming_clear_sky : TOA Outgoing Clear-Sky Longwave Radiation 4XCO2 Atmosphere -->
     236   <field id="CMIP6_rsd"           field_ref="rsd"              /> <!-- P1 (W m-2) downwelling_shortwave_flux_in_air : Fluxes are requested at all levels -->
     237   <field id="CMIP6_rsd4co2"       field_ref="rsd4co2"          /> <!-- P1 (W m-2) downwelling_shortwave_flux_in_air : Downwelling Shortwave Radiation 4XCO2 Atmosphere -->
     238   <field id="CMIP6_rsdcs"         field_ref="rsdcs"            /> <!-- P1 (W m-2) downwelling_shortwave_flux_in_air_assuming_clear_sky : Downwelling Clear-Sky Shortwave Raiation -->
     239   <field id="CMIP6_rsdcs4co2"     field_ref="rsdcs4co2"        /> <!-- P1 (W m-2) downwelling_shortwave_flux_in_air_assuming_clear_sky : Downwelling Clear-Sky Shortwave Radiation 4XCO2 Atmosphere -->
     240   <field id="CMIP6_rsdcsbnd"      field_ref="dummy_not_provided"        />   <!-- P1 (W m-2) downwelling_shortwave_flux_in_air_assuming_clear_sky : Downwelling Clear-Sky Shortwave Radiation at each level for each band -->
     241   <field id="CMIP6_rsds"          field_ref="SWdnSFC"          /> <!-- P1 (W m-2) surface_downwelling_shortwave_flux_in_air : This is the 3-hour mean flux. -->
     242   <field id="CMIP6_rsds_ist"      field_ref="dummy_XY"         /> <!-- P1 (W m-2) surface_downwelling_shortwave_flux_in_air : Surface Downwelling Shortwave Radiation -->
     243   <field id="CMIP6_rsdscs"        field_ref="SWdnSFCclr"       /> <!-- P1 (W m-2) surface_downwelling_shortwave_flux_in_air_assuming_clear_sky : Surface Downwelling Clear-Sky Shortwave Radiation -->
     244   <field id="CMIP6_rsdscsbnd"     field_ref="dummy_not_provided"         /> <!-- P1 (W m-2) surface_downwelling_shortwave_flux_in_air_assuming_clear_sky : Surface Downwelling Clear-Sky Shortwave Radiation for each band -->
     245   <field id="CMIP6_rsdscsdiff"    field_ref="dummy_XY"         /> <!-- P1 (W m-2) surface_diffuse_downwelling_shortwave_flux_in_air_assuming_clear_sky : Surface Diffuse Downwelling Clear Sky Shortwave Radiation -->
     246   <field id="CMIP6_rsdsdiff"      field_ref="dummy_XY"         /> <!-- P1 (W m-2) surface_diffuse_downwelling_shortwave_flux_in_air : Surface Diffuse Downwelling Shortwave Radiation -->
     247   <field id="CMIP6_rsdt"          field_ref="SWdnTOA"          /> <!-- P1 (W m-2) toa_incoming_shortwave_flux : TOA Incident Shortwave Radiation -->
     248   <field id="CMIP6_rss_land"      field_ref="dummy_XY"         /> <!-- P1 (W m-2) surface_net_downward_shortwave_flux : Net shortwave radiation -->
     249   <field id="CMIP6_rss"           field_ref="sols"             /> <!-- P1 (W m-2) surface_net_downward_shortwave_flux : Net Shortwave Surface Radiation -->
     250   <field id="CMIP6_rsu"           field_ref="rsu"              /> <!-- P1 (W m-2) upwelling_shortwave_flux_in_air : Fluxes are requested at all levels -->
     251   <field id="CMIP6_rsu4co2"       field_ref="rsu4co2"          /> <!-- P1 (W m-2) upwelling_shortwave_flux_in_air : Upwelling Shortwave Radiation 4XCO2 Atmosphere -->
     252   <field id="CMIP6_rsucs"         field_ref="rsucs"            />  <!-- P1 (W m-2) upwelling_shortwave_flux_in_air_assuming_clear_sky : Includes also the fluxes at the surface and TOA. -->
     253   <field id="CMIP6_rsucs4co2"     field_ref="rsucs4co2"        /> <!-- P1 (W m-2) upwelling_shortwave_flux_in_air_assuming_clear_sky : Upwelling Clear-Sky Shortwave Radiation 4XCO2 Atmosphere -->
     254   <field id="CMIP6_rsucsbnd"      field_ref="dummy_not_provided"        /> <!-- P1 (W m-2) upwelling_shortwave_flux_in_air_assuming_clear_sky : Upwelling Clear-Sky Shortwave Radiation at each level for each band -->
     255   <field id="CMIP6_rsus_ist"      field_ref="dummy_XY"         /> <!-- P1 (W m-2) surface_upwelling_shortwave_flux_in_air : Surface Upwelling Shortwave Radiation -->
     256   <field id="CMIP6_rsus"          field_ref="SWupSFC"          /> <!-- P1 (W m-2) surface_upwelling_shortwave_flux_in_air : Surface Upwelling Shortwave Radiation -->
     257   <field id="CMIP6_rsuscs"        field_ref="SWupSFCclr"       /> <!-- P1 (W m-2) surface_upwelling_shortwave_flux_in_air_assuming_clear_sky : Surface Upwelling Clear-Sky Shortwave Radiation -->
     258   <field id="CMIP6_rsuscsbnd"     field_ref="dummy_not_provided"         /> <!-- P1 (W m-2) surface_upwelling_shortwave_flux_in_air_assuming_clear_sky : Surface Upwelling Clear-Sky Shortwave Radiation for each band -->
     259   <field id="CMIP6_rsut"          field_ref="SWupTOA"          /> <!-- P1 (W m-2) toa_outgoing_shortwave_flux : TOA Outgoing Shortwave Radiation -->
     260   <field id="CMIP6_rsut4co2"      field_ref="rsut4co2"         /> <!-- P1 (W m-2) toa_outgoing_shortwave_flux : TOA Outgoing Shortwave Radiation in 4XCO2 Atmosphere -->
     261   <field id="CMIP6_rsutcs"        field_ref="SWupTOAclr"       /> <!-- P1 (W m-2) toa_outgoing_shortwave_flux_assuming_clear_sky : TOA Outgoing Clear-Sky Shortwave Radiation -->
     262   <field id="CMIP6_rsutcs4co2"    field_ref="rsutcs4co2"       /> <!-- P1 (W m-2) toa_outgoing_shortwave_flux_assuming_clear_sky : TOA Outgoing Clear-Sky Shortwave Radiation 4XCO2 Atmosphere -->
     263   <field id="CMIP6_rsutcsafbnd"   field_ref="dummy_not_provided"         /> <!-- P1 (W m-2) band_toa_outgoing_shortwave_flux_assuming_clean_clear_sky : TOA Outgoing Clear-Sky, Aerosol-Free Shortwave Radiation in Bands -->
     264   <field id="CMIP6_rsutcsbnd"     field_ref="dummy_not_provided"         /> <!-- P1 (W m-2) toa_outgoing_shortwave_flux_assuming_clear_sky : TOA Outgoing Clear-Sky Shortwave Radiation for each band -->
     265   <field id="CMIP6_rtmt"          field_ref="nettop"           /> <!-- P1 (W m-2) net_downward_radiative_flux_at_top_of_atmosphere_model : i.e., at the top of that portion of the atmosphere where dynamics are explicitly treated by the model. This is reported only if it differs from the net downward radiative flux at the top of the atmosphere. -->
    254266   <field id="CMIP6_rv"            field_ref="dummy_XY"         /> <!-- P1 (s-1) atmosphere_relative_vorticity : Relative Vorticity at 850 hPa -->
     267   <field id="CMIP6_sblnosn"       field_ref="dummy_not_provided"         /> <!-- P1 (kg m-2 s-1) sublimation_amount_assuming_no_snow : sublimation_amount_assuming_no_snow -->
    255268   <field id="CMIP6_sci"           field_ref="ftime_th"         /> <!-- P1 (1.0) shallow_convection_time_fraction : Fraction of time that shallow convection occurs in the grid cell. -->
    256    <field id="CMIP6_scldncl"       field_ref="dummy_XY"         /> <!-- P1 (m-3) number_concentration_of_stratiform_cloud_liquid_water_particles_in_air_at_liquid_water_cloud_top : Droplets are liquid only.  Report concentration "as seen from space" over stratiform liquid cloudy portion of grid cell.  This is the value from uppermost model layer with liquid cloud or, if available, it is better to sum over all liquid cloud tops, no matter where they occur, as long as they are seen from the top of the atmosphere. Weight by total liquid cloud top fraction of  (as seen from TOA) each time sample when computing monthly mean. -->
    257    <field id="CMIP6_sconcdust"     field_ref="sconcdust"        /> <!-- P1 (kg m-3) mass_concentration_of_dust_dry_aerosol_in_air : mass concentration of dust dry aerosol in air in model lowest layer -->
    258    <field id="CMIP6_sconcso4"      field_ref="sconcso4"         /> <!-- P1 (kg m-3) mass_concentration_of_sulfate_dry_aerosol_in_air : mass concentration of sulfate dry aerosol in air in model lowest layer. -->
    259    <field id="CMIP6_sconcss"       field_ref="sconcss"          /> <!-- P1 (kg m-3) mass_concentration_of_seasalt_dry_aerosol_in_air : mass concentration of seasalt dry aerosol in air in model lowest layer -->
    260    <field id="CMIP6_sedustCI"      field_ref="dummy_XY"         /> <!-- P1 (kg m-2 s-1) tendency_of_atmosphere_mass_content_of_dust_dry_aerosol_particles_due_to_sedimentation : Balkanski - LSCE -->
    261    <field id="CMIP6_sfcWind"       field_ref="wind10m"          /> <!-- P1 (m s-1) wind_speed : near-surface (usually, 10 meters) wind speed. -->
    262    <field id="CMIP6_sfcWindmax"    field_ref="CMIP6_sfcWind" freq_op="1d"  operation="maximum"> @this </field>   <!-- P1 (m s-1) wind_speed : Daily maximum near-surface (usually, 10 meters) wind speed. -->
    263    <field id="CMIP6_sftgif"        field_ref="pourc_lic"        /> <!-- P1 (%) land_ice_area_fraction : Fraction of grid cell covered by land ice (ice sheet, ice shelf, ice cap, glacier) -->
    264    <field id="CMIP6_sftlf"         field_ref="pourc_ter"        /> <!-- P1 (%) land_area_fraction : Please express "X_area_fraction" as the percentage of horizontal area occupied by X. -->
    265    <field id="CMIP6_siltfrac"      field_ref="dummy_XYSo"       /> <!-- P1 (1.0) missing : Silt Fraction -->
    266    <field id="CMIP6_slbnosn"       field_ref="dummy_XY"         /> <!-- P1 (kg m-2 s-1) sublimation_amount_assuming_no_snow : Sublimation of the snow free area -->
     269   <field id="CMIP6_scldncl"       field_ref="dummy_XY"         /> <!-- P1 (m-3) number_concentration_of_stratiform_cloud_liquid_water_particles_in_air_at_liquid_water_cloud_top : Cloud Droplet Number Concentration of Stratiform Cloud Tops -->
     270   <field id="CMIP6_sconcdust"     field_ref="sconcdust"        /> <!-- P1 (kg m-3) mass_concentration_of_dust_dry_aerosol_in_air : Surface Concentration of Dust -->
     271   <field id="CMIP6_sconcso4"      field_ref="sconcso4"         /> <!-- P1 (kg m-3) mass_concentration_of_sulfate_dry_aerosol_in_air : Surface Concentration of SO4 -->
     272   <field id="CMIP6_sconcss"       field_ref="sconcss"          /> <!-- P1 (kg m-3) mass_concentration_of_seasalt_dry_aerosol_in_air : Surface Concentration of Seasalt -->
     273   <field id="CMIP6_sfcWind"       field_ref="wind10m"          />  <!-- P1 (m s-1) wind_speed : Near surface wind speed -->
     274   <field id="CMIP6_sfcWindmax"    field_ref="sfcWindmax" freq_op="1d"   > @sfcWindmax </field> <!-- P1 (m s-1) wind_speed : Mean Daily Maximum Near-Surface Wind Speed -->
     275   <field id="CMIP6_sftlf"         field_ref="pourc_ter"> pourc_ter+pourc_lic </field> <!-- P1 (%) land_area_fraction : Land Area Fraction -->
     276   <field id="CMIP6_siltfrac"      field_ref="dummy_not_provided"       /> <!-- P1 (1.0)  : Silt Fraction -->
    267277   <field id="CMIP6_smc"           field_ref="f_th"        /> <!-- P2 (kg m-2 s-1) atmosphere_net_upward_shallow_convective_mass_flux : The net mass flux represents the difference between the updraft and downdraft components.  For models with a distinct shallow convection scheme, this is calculated as convective mass flux divided by the area of the whole grid cell (not just the area of the cloud). -->
    268    <field id="CMIP6_snmsl"         field_ref="dummy_XY"         /> <!-- P1 (kg m-2 s-1) surface_snow_melt_flux_into_soil_layer : Water flowing out of snowpack -->
    269    <field id="CMIP6_snowmxrat"     field_ref="dummy_XYA"        /> <!-- P3 (1.0) mass_fraction_of_snow_in_air : Snow mixing ratio -->
    270    <field id="CMIP6_snrefr"        field_ref="dummy_XY"         /> <!-- P1 (kg m-2 s-1) surface_snow_and_ice_refreezing_flux : Re-freezing of water in the snow -->
    271    <field id="CMIP6_snwc"          field_ref="dummy_XY"         /> <!-- P1 (kg m-2) canopy_snow_amount : Total water mass of the snowpack (liquid or frozen), averaged over a grid cell and interecepted by the canopy. -->
    272    <field id="CMIP6_solbnd"        field_ref="dummy_XY"         /> <!-- P1 (W m-2) band_solar_insolation : Top-of-Atmosphere Solar Insolation for each band -->
    273    <field id="CMIP6_swsffluxaero"  field_ref="dummy_XY"         /> <!-- P2 (W m-2) shortwave__flux_due_to_volcanic_aerosols_at__the_surface : shortwave heating rate due to volcanic aerosols to be diagnosed through double radiation call, zonal average values required -->
    274    <field id="CMIP6_swsrfasdust"   field_ref="dummy_XY"         /> <!-- P1 (W m-2) tendency_of_all_sky_surface_shortwave_flux_due_to_dust_ambient_aerosol_particles : Balkanski - LSCE -->
    275    <field id="CMIP6_swsrfcsdust"   field_ref="dummy_XY"         /> <!-- P1 (W m-2) tendency_of_clear_sky_surface_shortwave_flux_due_to_dust_ambient_aerosol_particles : Balkanski - LSCE -->
    276    <field id="CMIP6_swtoaasdust"   field_ref="dummy_XY"         /> <!-- P1 (W m-2) toa_instantaneous_shortwave_forcing : proposed name: toa_instantaneous_shortwave_forcing_due_to_dust_ambient_aerosol -->
    277    <field id="CMIP6_swtoacsdust"   field_ref="dummy_XY"         /> <!-- P1 (W m-2) toa_instantaneous_shortwave_forcing : proposed name: toa_instantaneous_shortwave_forcing_due_to_dust_ambient_aerosol_assuming_clear_sky -->
    278    <field id="CMIP6_swtoafluxaerocs" field_ref="dummy_XY"       /> <!-- P1 (W m-2) shortwave_flux_due_to_volcanic_aerosols_at_TOA_under_clear_sky : downwelling shortwave flux due to volcanic aerosols at TOA under clear sky to be diagnosed through double radiation call -->
    279    <field id="CMIP6_sza"           field_ref="dummy_XY"         /> <!-- P1 (degree) solar_zenith_angle : The angle between the line of sight to the sun and the local vertical -->
    280    <field id="CMIP6_t2"            field_ref="dummy_XYA"        /> <!-- P2 (K2) square_of_air_temperature : Air temperature squared -->
    281    <field id="CMIP6_ta"            field_ref="temp"             /> <!-- P3 (K) air_temperature : Air Temperature -->
    282    <field id="CMIP6_tas"           field_ref="t2m"              /> <!-- P1 (K) air_temperature : near-surface (usually, 2 meter) air temperature -->
    283    <field id="CMIP6_tasmax"        field_ref="CMIP6_tas" freq_op="1d"  operation="maximum"> @this </field>   <!-- P1 (K) air_temperature : maximum near-surface (usually, 2 meter) air temperature (add cell_method attribute "time: max") -->
    284    <field id="CMIP6_tasmin"        field_ref="CMIP6_tas" freq_op="1d" operation="minimum"> @this  </field>   <!-- P1 (K) air_temperature : minimum near-surface (usually, 2 meter) air temperature (add cell_method attribute "time: min") -->
    285    <field id="CMIP6_tau"           field_ref="taux"              >  sqrt( taux^2 + tauy^2)        </field>   <!-- P1 (N m-2) surface_downward_stress : module of the momentum lost by the atmosphere to the surface. -->
    286    <field id="CMIP6_tauu"          field_ref="taux"             /> <!-- P1 (Pa) surface_downward_eastward_stress : Downward eastward wind stress at the surface -->
    287    <field id="CMIP6_tauupbl"       field_ref="dummy_XY"         /> <!-- P1 (Pa) surface_downward_eastward_stress_due_to_planetary_boundary_layer : The  downward eastward stress associated with the models parameterization of the plantary boundary layer. (This request is related to a WGNE effort to understand how models parameterize the surface stresses.) -->
    288    <field id="CMIP6_tauv"          field_ref="tauy"             /> <!-- P1 (Pa) surface_downward_northward_stress : Downward northward wind stress at the surface -->
    289    <field id="CMIP6_tauvpbl"       field_ref="dummy_XY"         /> <!-- P1 (Pa) surface_downward_northward_stress_due_to_planetary_boundary_layer : The  downward northward stress associated with the models parameterization of the plantary boundary layer. (This request is related to a WGNE effort to understand how models parameterize the surface stresses.) -->
    290    <field id="CMIP6_tdps"          field_ref="dummy_XY"         /> <!-- P2 (K) dew_point_temperature : unset -->
    291    <field id="CMIP6_tendacabf"     field_ref="dummy_0d"         /> <!-- P3 (kg s-1) tendency_of_land_ice_mass_due_to_surface_mass_balance : The total surface mass balance flux over land ice is a spatial integration of the surface mass balance flux -->
    292    <field id="CMIP6_tendlibmassbf" field_ref="dummy_0d"         /> <!-- P3 (kg s-1) tendency_of_land_ice_mass_due_to_basal_mass_balance : The total basal mass balance flux over land ice is a spatial integration of the basal mass balance flux -->
    293    <field id="CMIP6_tendlicalvf"   field_ref="dummy_0d"         /> <!-- P3 (kg s-1) tendency_of_land_ice_mass_due_to_calving : The total calving flux over land ice is a spatial integration of the calving flux -->
     278   <field id="CMIP6_snmsl"         field_ref="dummy_not_provided"         /> <!-- P1 (kg m-2 s-1) surface_snow_melt_flux_into_soil_layer : surface_snow_melt_flux_into_soil_layer -->
     279   <field id="CMIP6_snowmxrat"     field_ref="dummy_not_provided"         /> <!-- P2 (1.0) mass_fraction_of_snow_in_air : snow_mixing_ratio -->
     280   <field id="CMIP6_snrefr"        field_ref="dummy_not_provided"         /> <!-- P1 (kg m-2 s-1) surface_snow_and_ice_refreezing_flux : surface_snow_and_ice_refreezing_flux -->
     281   <field id="CMIP6_snwc"          field_ref="dummy_not_provided"         /> <!-- P1 (kg m-2) canopy_snow_amount : canopy_snow_amount -->
     282   <field id="CMIP6_solbnd"        field_ref="solbnd"         />  <!-- P1 (W m-2) solar_irradiance : Top-of-Atmosphere Solar Insolation for each band -->
     283   <field id="CMIP6_swsffluxaero"  field_ref="dummy_not_provided"         /> <!-- P2 (W m-2) shortwave__flux_due_to_volcanic_aerosols_at__the_surface : downwelling shortwave  flux due to volcanic aerosols at  the surface to be diagnosed through double radiation call -->
     284   <field id="CMIP6_swsrfasdust"   field_ref="dummy_not_provided"         /> <!-- P1 (W m-2) tendency_of_all_sky_surface_shortwave_flux_due_to_dust_ambient_aerosol_particles : All-sky Surface Shortwave radiative flux due to Dust -->
     285   <field id="CMIP6_swsrfcsdust"   field_ref="dummy_not_provided"         /> <!-- P1 (W m-2) tendency_of_clear_sky_surface_shortwave_flux_due_to_dust_ambient_aerosol_particles : Clear-sky Surface Shortwave radiative flux due to Dust -->
     286   <field id="CMIP6_swtoaasdust"   field_ref="dummy_not_provided"         /> <!-- P1 (W m-2) toa_instantaneous_shortwave_forcing : all sky sw-rf dust at toa -->
     287   <field id="CMIP6_swtoacsdust"   field_ref="dummy_not_provided"         /> <!-- P1 (W m-2) toa_instantaneous_shortwave_forcing : clear sky sw-rf dust at toa -->
     288   <field id="CMIP6_swtoafluxaerocs" field_ref="dummy_not_provided"       /> <!-- P1 (W m-2) shortwave_flux_due_to_volcanic_aerosols_at_TOA_under_clear_sky : downwelling shortwave flux due to volcanic aerosols at TOA under clear sky to be diagnosed through double radiation call -->
     289   <field id="CMIP6_sza"           field_ref="sza"              /> <!-- P1 (degree) solar_zenith_angle : solar zenith angle -->
     290   <field id="CMIP6_t2"            field_ref="temp"> temp*temp   </field> <!-- P2 (K2) square_of_air_temperature : square_of_air_temperature -->
     291   <field id="CMIP6_ta"            field_ref="temp"             /> <!-- P1 (K) air_temperature : Air Temperature -->
     292   <field id="CMIP6_tas_ist"       field_ref="dummy_XY"         /> <!-- P1 (K) air_temperature : quantity averaged over ice sheet (grounded ice sheet and floating ice shelf) only. Needed to analyse the impact of downscaling methods -->
     293   <field id="CMIP6_tas"           field_ref="t2m"              /> <!-- P1 (K) air_temperature : This is sampled synoptically. -->
     294   <field id="CMIP6_tasmax"        field_ref="tasmax" freq_op="1d"> @tasmax </field> <!-- P1 (K) air_temperature : monthly mean of the daily-maximum near-surface air temperature. --> 
     295   <field id="CMIP6_tasmaxCrop"    field_ref="dummy_not_provided"         /> <!-- P1 (K) air_temperature : Daily Maximum Near-Surface Air Temperature over Crop Tile -->
     296   <field id="CMIP6_tasmin"        field_ref="tasmin" freq_op="1d"> @tasmin  </field> <!-- P1 (K) air_temperature : Daily Minimum Near-Surface Air Temperature --> 
     297   <field id="CMIP6_tasminCrop"    field_ref="dummy_not_provided"         /> <!-- P1 (K) air_temperature : Daily Minimum Near-Surface Air Temperature over Crop Tile -->
     298   <field id="CMIP6_tau"           field_ref="taux"              >  sqrt( taux^2 + tauy^2)        </field> <!-- P1 (N m-2) surface_downward_stress : Momentum flux -->
     299   <field id="CMIP6_tauu"          field_ref="taux"             /> <!-- P1 (Pa) surface_downward_eastward_stress : Surface Downward Eastward Wind Stress -->
     300   <field id="CMIP6_tauupbl"       field_ref="dummy_XY"         /> <!-- P1 (Pa) surface_downward_eastward_stress_due_to_planetary_boundary_layer : surface -->
     301   <field id="CMIP6_tauv"          field_ref="tauy"             /> <!-- P1 (Pa) surface_downward_northward_stress : Surface Downward Northward Wind Stress -->
     302   <field id="CMIP6_tauvpbl"       field_ref="dummy_XY"         /> <!-- P1 (Pa) surface_downward_northward_stress_due_to_planetary_boundary_layer : surface -->
     303   <field id="CMIP6_tdps"          field_ref="pvap"> 273.16 + (273.16 - 35.86)/(17.269/log(pvap/611.14)-1.)      </field> <!-- P1 (K) dew_point_temperature : 2m dewpoint temperature -->
     304   <field id="CMIP6_tendacabf"     field_ref="dummy_not_provided"         /> <!-- P3 (kg s-1) tendency_of_land_ice_mass_due_to_surface_mass_balance : Greenland -->
     305   <field id="CMIP6_tendlibmassbf" field_ref="dummy_not_provided"         /> <!-- P3 (kg s-1) tendency_of_land_ice_mass_due_to_basal_mass_balance : Antarctica -->
     306   <field id="CMIP6_tendlicalvf"   field_ref="dummy_not_provided"         /> <!-- P3 (kg s-1) tendency_of_land_ice_mass_due_to_calving : Antarctica -->
    294307   <field id="CMIP6_tnhus"         field_ref="tnhus"            /> <!-- P1 (s-1) tendency_of_specific_humidity : Tendency of Specific Humidity -->
    295308   <field id="CMIP6_tnhusa"        field_ref="dqdyn"            /> <!-- P1 (s-1) tendency_of_specific_humidity_due_to_advection : Tendency of Specific Humidity due to Advection -->
    296309   <field id="CMIP6_tnhusc"        field_ref="tnhusc"           /> <!-- P1 (s-1) tendency_of_specific_humidity_due_to_convection : Tendencies from cumulus convection scheme. -->
    297    <field id="CMIP6_tnhusd"        field_ref="dqvdf"            /> <!-- P1 (s-1) tendency_of_specific_humidity_due_to_diffusion : Tendency of specific humidity due to numerical diffusion.This includes any horizontal or vertical numerical moisture diffusion not associated with the parametrized moist physics or the resolved dynamics.  For example, any vertical diffusion which is part of the boundary layer mixing scheme should be excluded, as should any diffusion which is included in the terms from the resolved dynamics.   This term is required to check the closure of the moisture budget. -->
    298    <field id="CMIP6_tnhusmp"       field_ref="dqphy"            /> <!-- P1 (s-1) tendency_of_specific_humidity_due_to_model_physics : Tendency of specific humidity due to model physics. This includes sources and sinks from parametrized moist physics (e.g. convection, boundary layer, stratiform condensation/evaporation, etc.) and excludes sources and sinks from resolved dynamics or from horizontal or vertical numerical diffusion not associated with model physicsl.  For example any diffusive mixing by the boundary layer scheme would be included. -->
    299    <field id="CMIP6_tnhuspbl"      field_ref="dqvdf"             > dqvdf+dqthe <!-- P1 (s-1) tendency_of_specific_humidity_due_to_boundary_layer_mixing : Includes all boundary layer terms including diffusive terms. -->
     310   <field id="CMIP6_tnhusd"        field_ref="dqvdf"            /> <!-- P1 (s-1) tendency_of_specific_humidity_due_to_diffusion : This includes any horizontal or vertical numerical moisture diffusion not associated with the parametrized moist physics or the resolved dynamics.  For example, any vertical diffusion which is part of the boundary layer mixing scheme should be excluded, as should any diffusion which is included in the terms from the resolved dynamics.   This term is required to check the closure of the moisture budget. -->
     311   <field id="CMIP6_tnhusmp"       field_ref="dqphy"            /> <!-- P1 (s-1) tendency_of_specific_humidity_due_to_model_physics : This includes sources and sinks from parametrized moist physics (e.g. convection, boundary layer, stratiform condensation/evaporation, etc.) and excludes sources and sinks from resolved dynamics or from horizontal or vertical numerical diffusion not associated with model physicsl.  For example any diffusive mixing by the boundary layer scheme would be included. -->
     312   <field id="CMIP6_tnhuspbl"      field_ref="dqvdf"             > dqvdf+dqthe </field> <!-- P1 (s-1) tendency_of_specific_humidity_due_to_boundary_layer_mixing : alevel site time1 -->
    300313   <field id="CMIP6_tnhusscp"      field_ref="dqlscst"          /> <!-- P1 (s-1) tendency_of_specific_humidity_due_to_stratiform_clouds_and_precipitation : Tendency of Specific Humidity Due to Stratiform Clouds and Precipitation -->
    301    <field id="CMIP6_tnhusscpbl"    field_ref="tnhusscpbl"       /> <!-- P1 (s-1) tendency_of_specific_humidity_due_to_stratiform_cloud_and_precipitation_and_boundary_layer_mixing : Tendency of Specific Humidity Due to Stratiform Cloud and Precipitation and Boundary Layer Mixing  (to be specified only in  models which do not separate budget terms for stratiform cloud, precipitation and boundary layer schemes.  Includes all bounday layer terms including and diffusive terms.) -->
     314   <field id="CMIP6_tnhusscpbl"    field_ref="tnhusscpbl"       /> <!-- P1 (s-1) tendency_of_specific_humidity_due_to_stratiform_cloud_and_precipitation_and_boundary_layer_mixing : To be specified only in  models which do not separate budget terms for stratiform cloud, precipitation and boundary layer schemes.  Includes all bounday layer terms including and diffusive terms. -->
    302315   <field id="CMIP6_tnt"           field_ref="tnt"              /> <!-- P1 (K s-1) tendency_of_air_temperature : Tendency of Air Temperature -->
    303316   <field id="CMIP6_tnta"          field_ref="dtdyn"            /> <!-- P1 (K s-1) tendency_of_air_temperature_due_to_advection : Tendency of Air Temperature due to Advection -->
    304    <field id="CMIP6_tntc"          field_ref="tntc"             /> <!-- P1 (K s-1) tendency_of_air_temperature_due_to_convection : Tendencies from cumulus convection scheme. -->
    305    <field id="CMIP6_tntd"          field_ref="dtajs"             > dtajs+dtoro+dtlif+dthin </field> <!-- P1 (K s-1) tendency_of_air_temperature_due_to_numerical_diffusion : This includes any horizontal or vertical numerical temperature diffusion not associated with the parametrized moist physics or the resolved dynamics.  For example, any vertical diffusion which is part of the boundary layer mixing scheme should be excluded, as should any diffusion which is included in the terms from the resolved dynamics.   This term is required to check the closure of the temperature budget. -->
    306    <field id="CMIP6_tntmp"         field_ref="dtphy"            /> <!-- P1 (K s-1) tendency_of_air_temperature_due_to_model_physics : Tendency of air temperature due to model physics. This includes sources and sinks from parametrized physics (e.g. radiation, convection, boundary layer, stratiform condensation/evaporation, etc.). It excludes sources and sinks from resolved dynamics and numerical diffusion not associated with parametrized physics.  For example, any vertical diffusion which is part of the boundary layer mixing scheme should be included, while numerical diffusion applied in addition to physics or resolved dynamics should be excluded.  This term is required to check the closure of the heat budget. -->
    307    <field id="CMIP6_tntnogw"       field_ref="dummy_XYA"        /> <!-- P2 (K s-1) temperature_tendency_due_to_dissipation_nonorographic_gravity_wave_drag : Temperature tendency due to dissipation of parameterized nonorographic gravity waves. -->
    308    <field id="CMIP6_tntogw"        field_ref="dtoro"            /> <!-- P2 (K s-1) temperature_tendency_due_to_dissipation_orographic_gravity_wave_drag : Temperature tendency due to dissipation of parameterized orographic gravity waves. -->
    309    <field id="CMIP6_tntpbl"        field_ref="dtvdf"             > dtvdf + dtthe </field> <!-- P1 (K s-1) tendency_of_air_temperature_due_to_boundary_layer_mixing : Includes all boundary layer terms including diffusive terms. -->
     317   <field id="CMIP6_tntc"          field_ref="tntc"             /> <!-- P1 (K s-1) tendency_of_air_temperature_due_to_convection : zonal mean; hence YZT -->
     318   <field id="CMIP6_tntd"          field_ref="dtajs"             > dtajs+dtoro+dtlif+dthin </field> <!-- P1 (K s-1) tendency_of_air_temperature_due_to_numerical_diffusion : Tendency of Air Temperature due to Numerical Diffusion -->
     319   <field id="CMIP6_tntmp"         field_ref="dtphy"            /> <!-- P1 (K s-1) tendency_of_air_temperature_due_to_model_physics : This includes sources and sinks from parametrized physics (e.g. radiation, convection, boundary layer, stratiform condensation/evaporation, etc.). It excludes sources and sinks from resolved dynamics and numerical diffusion not associated with parametrized physics.  For example, any vertical diffusion which is part of the boundary layer mixing scheme should be included, while numerical diffusion applied in addition to physics or resolved dynamics should be excluded.  This term is required to check the closure of the heat budget. -->
     320   <field id="CMIP6_tntnogw"       field_ref="dummy_XYA"        /> <!-- P2 (K s-1) temperature_tendency_due_to_dissipation_nonorographic_gravity_wave_drag : zonal mean; hence YZT -->
     321   <field id="CMIP6_tntogw"        field_ref="dtoro"            /> <!-- P2 (K s-1) temperature_tendency_due_to_dissipation_orographic_gravity_wave_drag : zonal mean; hence YZT -->
     322   <field id="CMIP6_tntpbl"        field_ref="dtvdf"             > dtvdf + dtthe </field> <!-- P1 (K s-1) tendency_of_air_temperature_due_to_boundary_layer_mixing : alevel site time1 -->
    310323   <field id="CMIP6_tntr"          field_ref="tntr"             /> <!-- P1 (K s-1) tendency_of_air_temperature_due_to_radiative_heating : Tendency of Air Temperature due to Radiative Heating -->
    311    <field id="CMIP6_tntrlcs"       field_ref="dtlw0"            /> <!-- P1 (K s-1) tendency_of_air_temperature_due_to_longwave_heating_assuming_clear_sky : Tendency of Air Temperature due to Clear Sky Longwave Radiative Heating -->
    312    <field id="CMIP6_tntrscs"       field_ref="dtsw0"            /> <!-- P1 (K s-1) tendency_of_air_temperature_due_to_shortwave_heating_assuming_clear_sky : Tendency of Air Temperature due to Clear Sky Shortwave Radiative Heating -->
    313    <field id="CMIP6_tntscp"        field_ref="dummy_XYA"        /> <!-- P1 (K s-1) tendency_of_air_temperature_due_to_stratiform_clouds_and_precipitation : Tendency of Air Temperature Due to Stratiform Clouds and Precipitation -->
    314    <field id="CMIP6_tntscpbl"      field_ref="tntscpbl"        /> <!-- P1 (K s-1) tendency_of_air_temperature_due_to_stratiform_cloud_and_precipitation_and_boundary_layer_mixing : Tendency of Air Temperature Due to Stratiform Cloud and Precipitation and Boundary Layer Mixing (to be specified only in  models which do not separate cloud, precipitation and boundary layer terms.  Includes all boundary layer terms including diffusive ones.) -->
    315    <field id="CMIP6_tr"            field_ref="dummy_XY"         /> <!-- P1 (K) surface_temperature : Effective radiative surface temperature, averaged over the grid cell -->
    316    <field id="CMIP6_ts"            field_ref="tsol"             /> <!-- P1 (K) surface_temperature : Temperature of the lower boundary of the atmosphere -->
    317    <field id="CMIP6_tsns"          field_ref="dummy_XY"         /> <!-- P1 (K) surface_temperature : Temperature of the snow surface as it interacts with the atmosphere, averaged over a grid cell. -->
    318    <field id="CMIP6_twap"          field_ref="omega">vitw*temp </field> <!-- P2 (K Pa s-1) product_of_omega_and_air_temperature : Product of air temperature and pressure tendency -->
    319    <field id="CMIP6_u2"            field_ref="vitu"              > vitu*vitu</field> <!-- P2 (m2 s-2) square_of_eastward_wind : u*u -->
     324   <field id="CMIP6_tntrlcs"       field_ref="dtlw0"            /> <!-- P1 (K s-1) tendency_of_air_temperature_due_to_longwave_heating_assuming_clear_sky : zonal mean; hence YZT -->
     325   <field id="CMIP6_tntrscs"       field_ref="dtsw0"            /> <!-- P1 (K s-1) tendency_of_air_temperature_due_to_shortwave_heating_assuming_clear_sky : zonal mean; hence YZT -->
     326   <field id="CMIP6_tntscp"        field_ref="dtlschr"          /> <!-- P1 (K s-1) tendency_of_air_temperature_due_to_stratiform_clouds_and_precipitation : alevel site time1 -->
     327   <field id="CMIP6_tntscpbl"      field_ref="tntscpbl"         /> <!-- P1 (K s-1) tendency_of_air_temperature_due_to_stratiform_cloud_and_precipitation_and_boundary_layer_mixing : To be specified only in  models which do not separate cloud, precipitation and boundary layer terms.  Includes all boundary layer terms including diffusive ones. -->
     328   <field id="CMIP6_tr"            field_ref="tsol"             /> <!-- P1 (K) surface_temperature : Surface Radiative Temperature -->
     329   <field id="CMIP6_ts"            field_ref="tsol"             /> <!-- P1 (K) surface_temperature : Surface temperature (skin for open ocean) -->
     330   <field id="CMIP6_ts_ist"        field_ref="dummy_XY"         /> <!-- P1 (K) surface_temperature : quantity averaged over ice sheet (grounded ice sheet and floating ice shelf) only. Needed to analyse the impact of downscaling methods -->
     331   <field id="CMIP6_tsns"          field_ref="dummy_not_provided"         /> <!-- P1 (K) surface_temperature : Snow Surface Temperature -->
     332   <field id="CMIP6_twap"          field_ref="vitw">vitw*temp </field> <!-- P2 (K Pa s-1) product_of_omega_and_air_temperature : air_temperature_times_omega -->
     333   <field id="CMIP6_u2"            field_ref="vitu"              > vitu*vitu</field> <!-- P2 (m2 s-2) square_of_eastward_wind : square_of_eastward_wind -->
    320334   <field id="CMIP6_ua"            field_ref="vitu"             /> <!-- P1 (m s-1) eastward_wind : Eastward Wind -->
    321    <field id="CMIP6_uas"           field_ref="u10m"             /> <!-- P1 (m s-1) eastward_wind : Eastward component of the near-surface (usually, 10 meters)  wind -->
    322    <field id="CMIP6_uqint"         field_ref="dummy_XY"         /> <!-- P1 (m2 s-1) integral_of_product_of_eastward_wind_and_specific_humidity_wrt_height : Column integrated eastward wind times specific humidity -->
    323    <field id="CMIP6_ut"            field_ref="vitu"              > vitu*temp </field> <!-- P2 (K m s-1) product_of_eastward_wind_and_air_temperature : Product of air temperature and eastward wind -->
    324    <field id="CMIP6_utendepfd"     field_ref="dummy_XYA"        /> <!-- P1 (m s-2) tendency_of_eastward_wind_due_to_eliassen_palm_flux_divergence : Tendency of the zonal mean zonal wind due to the divergence of the Eliassen-Palm flux. -->
    325    <field id="CMIP6_utendnogw"     field_ref="dummy_XYA"        /> <!-- P1 (m s-2) tendency_of_eastward_wind_due_to_nonorographic_gravity_wave_drag : Tendency of the eastward wind by parameterized nonorographic gravity waves. -->
    326    <field id="CMIP6_utendogw"      field_ref="dummy_XYA"        /> <!-- P1 (m s-2) tendency_of_eastward_wind_due_to_orographic_gravity_wave_drag : Tendency of the eastward wind by parameterized orographic gravity waves. -->
    327    <field id="CMIP6_utendvtem"     field_ref="dummy_XYA"        /> <!-- P1 (m s-1 d-1) u-tendency_by_wstar_advection : Tendency of zonally averaged eastward wind, by the residual upward wind advection (on the native model grid). Reference: Andrews et al (1987): Middle Atmospheric Dynamics. Academic Press. -->
    328    <field id="CMIP6_utendwtem"     field_ref="dummy_XYA"        /> <!-- P1 (m s-1 d-1) u-tendency_by_vstar_advection : Tendency of zonally averaged eastward wind, by the residual northward wind advection (on the native model grid). Reference: Andrews et al (1987): Middle Atmospheric Dynamics. Academic Press. -->
    329    <field id="CMIP6_uv"            field_ref="vitu"> vitu*vitv  </field> <!-- P2 (m2 s-2) product_of_eastward_wind_and_northward_wind : u*v -->
    330    <field id="CMIP6_uwap"          field_ref="vitu"> vitu*vitw  </field> <!-- P2 (Pa m s-2) product_of_eastward_wind_and_omega : u*omega -->
    331    <field id="CMIP6_v2"            field_ref="vitv"> vitv*vitv  </field> <!-- P2 (m2 s-2) square_of_northward_wind : v*v -->
    332    <field id="CMIP6_va"            field_ref="vitv"             /> <!-- P1 (m s-1) northward_wind : Northward component of the wind at 850hPa -->
    333    <field id="CMIP6_vas"           field_ref="v10m"             /> <!-- P1 (m s-1) northward_wind : Northward component of the near surface wind -->
    334    <field id="CMIP6_vortmean"      field_ref="dummy_XY"         /> <!-- P1 (s-1) atmosphere_relative_vorticity : Mean vorticity over 850,700,600 hPa -->
    335    <field id="CMIP6_vqint"         field_ref="dummy_XY"         /> <!-- P1 (m2 s-1) integral_of_product_of_northward_wind_and_specific_humidity_wrt_height : Column integrated northward wind times specific humidity -->
    336    <field id="CMIP6_vt"            field_ref="vitv"> vitv*temp  </field> <!-- P2 (K m s-1) product_of_northward_wind_and_air_temperature : Product of air temperature and northward wind -->
    337    <field id="CMIP6_vtem"          field_ref="dummy_XYA"        /> <!-- P1 (m s-1) northward_transformed_eulerian_mean_air_velocity : Transformed Eulerian Mean Diagnostics v*, meridional component of the residual meridional circulation (v*, w*) derived from 6 hr or higher frequency data fields (use instantaneous daily fields or 12 hr fields if the 6 hr data are not available). -->
    338    <field id="CMIP6_vtendnogw"     field_ref="dummy_XYA"        /> <!-- P2 (m s-2) tendency_of_northward_wind_due_to_nonorographic_gravity_wave_drag : Tendency of the northward wind by parameterized nonorographic gravity waves.  (Note that CF name tables only have a general northward tendency for all gravity waves, and we need it separated by type.) -->
    339    <field id="CMIP6_vtendogw"      field_ref="dummy_XYA"        /> <!-- P2 (m s-2) tendency_of_northward_wind_due_to_orographic_gravity_wave_drag : Tendency of the northward wind by parameterized orographic gravity waves.  (Note that CF name tables only have a general northward tendency for all gravity waves, and we need it separated by type.) -->
    340    <field id="CMIP6_vwap"          field_ref="vitv"> vitv*vitw  </field> <!-- P2 (Pa m s-2) product_of_northward_wind_and_omega : v*omega -->
    341    <field id="CMIP6_wap"           field_ref="vitw"             /> <!-- P1 (Pa s-1) lagrangian_tendency_of_air_pressure : Omega (vertical velocity in pressure coordinates, positive downwards) -->
    342    <field id="CMIP6_wap2"          field_ref="dummy_XYA"        /> <!-- P2 (Pa2 s-2) square_of_lagrangian_tendency_of_air_pressure : omega*omega -->
    343    <field id="CMIP6_wbptemp"       field_ref="dummy_XYA"        /> <!-- P1 (K) wet_bulb_potential_temperature : Wet bulb potential temperature -->
    344    <field id="CMIP6_wtem"          field_ref="dummy_XYA"        /> <!-- P1 (m s-1) unset : Transformed Eulerian Mean Diagnostics w*, meridional component of the residual meridional circulation (v*, w*) derived from 6 hr or higher frequency data fields (use instantaneous daily fields or 12 hr fields if the 6 hr data are not available). Scale height: 6950 m -->
    345    <field id="CMIP6_xgwdparam"     field_ref="east_gwstress"    /> <!-- P2 (Pa) atmosphere_eastward_stress_due_to_gravity_wave_drag : Parameterised x-component of gravity wave drag -->
    346    <field id="CMIP6_ygwdparam"     field_ref="west_gwstress"        /> <!-- P2 (Pa) atmosphere_northward_stress_due_to_gravity_wave_drag : Parameterised y- component of gravity wave drag -->
    347    <field id="CMIP6_zfull"         field_ref="zfull"            /> <!-- P2 (m) height_above_reference_ellipsoid : Altitude of Model Full-Levels -->
    348    <field id="CMIP6_zg"            field_ref="phis"             /> <!-- P1 (m) geopotential_height : Geopotential height on the 1000 hPa surface -->
    349    <field id="CMIP6_zhalf"         field_ref="zhalf"            /> <!-- P2 (m) height_above_reference_ellipsoid : Altitude of Model Half-Levels -->
    350    <field id="CMIP6_zmla"          field_ref="dummy_XY"         /> <!-- P1 (m) atmosphere_boundary_layer_thickness : Height of Boundary Layer -->
    351    <field id="CMIP6_zmlwaero"      field_ref="dummy_XYA"        /> <!-- P1 (K s-1) longwave_heating_rate_due_to_volcanic_aerosols : longwave heating rate due to volcanic aerosols to be diagnosed through double radiation call, zonal average values required -->
    352    <field id="CMIP6_zmswaero"      field_ref="dummy_XYA"        /> <!-- P1 (K s-1) shortwave_heating_rate_due_to_volcanic_aerosols : shortwave heating rate due to volcanic aerosols to be diagnosed through double radiation call, zonal average values required -->
    353    <field id="CMIP6_zmtnt"         field_ref="dummy_XYA"        /> <!-- P1 (K s-1) tendency_of_air_temperature_due_to_diabatic_processes : The diabatic heating rates due to all the processes that may change potential temperature -->
     335   <field id="CMIP6_uas"           field_ref="u10m"             /> <!-- P1 (m s-1) eastward_wind : Eastward Near-Surface Wind -->
     336   <field id="CMIP6_uqint"         field_ref="uq"               /> <!-- P1 (m2 s-1) integral_of_product_of_eastward_wind_and_specific_humidity_wrt_height : Eastward integrated moisture transport -->
     337   <field id="CMIP6_ut"            field_ref="vitu"              > vitu*temp </field> <!-- P2 (K m s-1) product_of_eastward_wind_and_air_temperature : air_temperature_times_eastward_wind -->
     338   <field id="CMIP6_utendepfd"     field_ref="dummy_XYA"        /> <!-- P1 (m s-2) tendency_of_eastward_wind_due_to_eliassen_palm_flux_divergence : Called "acceldivf" in CCMI table; we suggest new name. zonal mean; hence YZT -->
     339   <field id="CMIP6_utendnogw"     field_ref="du_gwd_rando"> du_gwd_rando + du_gwd_front </field> <!-- P1 (m s-2) tendency_of_eastward_wind_due_to_nonorographic_gravity_wave_drag : zonal mean; hence YZT -->
     340   <field id="CMIP6_utendogw"      field_ref="duoro"        /> <!-- P1 (m s-2) tendency_of_eastward_wind_due_to_orographic_gravity_wave_drag : u-tendency orographic gravity wave drag -->
     341   <field id="CMIP6_utendvtem"     field_ref="dummy_XYA"        /> <!-- P1 (m s-1 d-1) u-tendency_by_wstar_advection : zonal mean; hence YZT -->
     342   <field id="CMIP6_utendwtem"     field_ref="dummy_XYA"        /> <!-- P1 (m s-1 d-1) u-tendency_by_vstar_advection : zonal mean; hence YZT -->
     343   <field id="CMIP6_uv"            field_ref="vitu"> vitu*vitv  </field> <!-- P2 (m2 s-2) product_of_eastward_wind_and_northward_wind : eastward_wind_times_northward_wind -->
     344   <field id="CMIP6_uwap"          field_ref="vitu"> vitu*vitw  </field> <!-- P2 (Pa m s-2) product_of_eastward_wind_and_omega : eastward_wind_times_omega -->
     345   <field id="CMIP6_v2"            field_ref="vitv"> vitv*vitv  </field> <!-- P2 (m2 s-2) square_of_northward_wind : square_of_northwardwind -->
     346   <field id="CMIP6_va"            field_ref="vitv"             /> <!-- P1 (m s-1) northward_wind : Northward Wind -->
     347   <field id="CMIP6_vas"           field_ref="v10m"             /> <!-- P1 (m s-1) northward_wind : Northward Near-Surface Wind -->
     348   <field id="CMIP6_vortmean"      field_ref="dummy_XY"         /> <!-- P1 (s-1) atmosphere_relative_vorticity : Mean vorticity over 850-600 hPa layer -->
     349   <field id="CMIP6_vqint"         field_ref="vq"               /> <!-- P1 (m2 s-1) integral_of_product_of_northward_wind_and_specific_humidity_wrt_height : Northward integrated moisture transport -->
     350   <field id="CMIP6_vt"            field_ref="vitv"> vitv*temp  </field> <!-- P2 (K m s-1) product_of_northward_wind_and_air_temperature : air_temperature_times_northward_wind -->
     351   <field id="CMIP6_vtem"          field_ref="dummy_XYA"        /> <!-- P1 (m s-1) northward_transformed_eulerian_mean_air_velocity : Transformed Eulerian Mean northward wind -->
     352   <field id="CMIP6_vtendnogw"     field_ref="dv_gwd_rando">dv_gwd_rando + dv_gwd_front </field> <!-- P2 (m s-2) tendency_of_northward_wind_due_to_nonorographic_gravity_wave_drag : v-tendency nonorographic gravity wave drag -->
     353   <field id="CMIP6_vtendogw"      field_ref="dvoro"        /> <!-- P2 (m s-2) tendency_of_northward_wind_due_to_orographic_gravity_wave_drag : v-tendency orographic gravity wave drag -->
     354   <field id="CMIP6_vwap"          field_ref="vitv"> vitv*vitw  </field> <!-- P2 (Pa m s-2) product_of_northward_wind_and_omega : northward_wind_times_omega -->
     355   <field id="CMIP6_wap"           field_ref="vitw"             /> <!-- P1 (Pa s-1) lagrangian_tendency_of_air_pressure : commonly referred to as "omega", this represents the vertical component of velocity in pressure coordinates (positive down) -->
     356   <field id="CMIP6_wap2"          field_ref="vitw"> vitw*vitw  </field> <!-- P2 (Pa2 s-2) square_of_lagrangian_tendency_of_air_pressure : square_of_omega -->
     357   <field id="CMIP6_wbptemp"       field_ref="dummy_XYA"        /> <!-- P1 (K) wet_bulb_potential_temperature : plev_7 -->
     358   <field id="CMIP6_wtem"          field_ref="dummy_XYA"        /> <!-- P1 (m s-1)  : Transformed Eulerian Mean upward wind -->
     359   <field id="CMIP6_xgwdparam"     field_ref="east_gwstress"    /> <!-- P2 (Pa) atmosphere_eastward_stress_due_to_gravity_wave_drag : x_gravity_wave_drag_param -->
     360   <field id="CMIP6_ygwdparam"     field_ref="west_gwstress"    /> <!-- P2 (Pa) atmosphere_northward_stress_due_to_gravity_wave_drag : y_gravity_wave_drag_param -->
     361   <field id="CMIP6_zfull"         field_ref="zfull"            /> <!-- P2 (m) height_above_reference_ellipsoid : This is actual height above mean sea level, not geopotential height -->
     362   <field id="CMIP6_zg"            field_ref="geoph"             /> <!-- P1 (m) geopotential_height : Geopotential height on the 1000 hPa surface -->
     363   <field id="CMIP6_zhalf"         field_ref="zhalf"            /> <!-- P2 (m) height_above_reference_ellipsoid : This is actual height above mean sea level, not geopotential height.  This is actual height above mean sea level, not geopotential height.  Includes both the top of the model atmosphere and surface levels. -->
     364   <field id="CMIP6_zmla"          field_ref="s_pblh"           /> <!-- P1 (m) atmosphere_boundary_layer_thickness : Height of Boundary Layer -->
     365   <field id="CMIP6_zmlwaero"      field_ref="dummy_not_provided"        /> <!-- P1 (K s-1) longwave_heating_rate_due_to_volcanic_aerosols : longwave heating rate due to volcanic aerosols to be diagnosed through double radiation call, zonal average values required -->
     366   <field id="CMIP6_zmswaero"      field_ref="dummy_not_provided"        /> <!-- P1 (K s-1) shortwave_heating_rate_due_to_volcanic_aerosols : shortwave heating rate due to volcanic aerosols to be diagnosed through double radiation call, zonal average values required -->
     367   <field id="CMIP6_zmtnt"         field_ref="dtphy"            /> <!-- P1 (K s-1) tendency_of_air_temperature_due_to_diabatic_processes : Zonal Mean Diabatic Heating Rates -->
    354368   <field id="CMIP6_ap" field_ref="Ahyb" /><!-- One of the hybrid coordinate arrays -->
    355369   <field id="CMIP6_ap_bnds" field_ref="Ahyb_inter" /><!-- One of the hybrid coordinate arrays -->
  • LMDZ6/branches/DYNAMICO-conv/DefLists/config.def_LMDZ5_AGCM

    r2535 r3356  
    9494# 1: read a single ozone climatology that will be used day and night
    9595# 2: read two ozone climatologies, the average day and night climatology and the daylight climatology
    96 read_climoz=2
     96read_climoz=1
    9797#
    9898# Parametres simulateur COSP (CFMIP Observational Simulator Package)
  • LMDZ6/branches/DYNAMICO-conv/DefLists/context_lmdz.xml

    r3018 r3356  
    6161    <axis id="bnds" standard_name="bounds" unit="1" >
    6262    </axis>
     63    <axis id="spectband" standard_name="Sensor Band Central Radiation Wavenumber" unit="m-1">
     64    </axis>
     65    <axis id="axis_lat" standard_name="Latitude axis">
     66           <reduce_domain operation="average" direction="iDir" />
     67    </axis>
    6368
    6469<!-- Cosp axis definitions-->
     
    7580    <axis id="temp" standard_name="temperature" unit="K">
    7681    </axis>
    77     <axis id="cth16" name="cth" standard_name="altitude" unit="m">
     82    <axis id="cth" standard_name="altitude" unit="m">
    7883    </axis>
    7984    <axis id="ReffIce" standard_name="ReffIce" unit="microne" >
     
    9095
    9196  <grid_definition>
    92 <!-- Define Scalar grid for GHG, orbital parameters and solar constants -->
    93     <grid id="grid_scalar">
    94     </grid>
    9597
    9698    <grid id="klev_bnds"> <axis axis_ref="klev" /> <axis axis_ref="bnds" /> </grid>
     
    109111        <domain id="dom_glo" />
    110112        <axis id="plev" />
     113     </grid>
     114
     115     <grid id="grid_glo_spectband">
     116        <domain id="dom_glo" />
     117        <axis id="spectband" />
    111118     </grid>
    112119
     
    140147     <grid id="grid4Dcol">
    141148        <domain id="dom_glo" />
     149        <axis id="column" />
    142150        <axis id="height_mlev" />
     151     </grid>
     152
     153     <grid id="grid4Dsrbin">
     154        <domain id="dom_glo" />
     155        <axis id="height" />
     156        <axis id="scatratio" />
     157     </grid>
     158
     159     <grid id="grid4Ddbze">
     160        <domain id="dom_glo" />
     161        <axis id="height" />
     162        <axis id="dbze" />
     163     </grid>
     164
     165     <grid id="grid4Dtau">
     166        <domain id="dom_glo" />
     167        <axis id="tau" />
     168        <axis id="pressure2" />
     169     </grid>
     170
     171     <grid id="grid4Dmisr">
     172        <domain id="dom_glo" />
     173        <axis id="cth" />
     174        <axis id="tau" />
     175     </grid>
     176
     177     <grid id="grid4Dreffi">
     178        <domain id="dom_glo" />
     179        <axis id="tau" />
     180        <axis id="ReffIce" />
     181     </grid>
     182
     183     <grid id="grid4Dreffl">
     184        <domain id="dom_glo" />
     185        <axis id="tau" />
     186        <axis id="ReffLiq" />
     187     </grid>
     188     <grid id="grid4Dcol2">
     189        <domain id="dom_glo" />
     190        <axis id="height" />
    143191        <axis id="column" />
    144192     </grid>
    145193
    146      <grid id="grid4Dsrbin">
    147         <domain id="dom_glo" />
    148         <axis id="height" />
    149         <axis id="scatratio" />
    150      </grid>
    151 
    152      <grid id="grid4Ddbze">
    153         <domain id="dom_glo" />
    154         <axis id="height" />
    155         <axis id="dbze" />
    156      </grid>
    157 
    158      <grid id="grid4Dtau">
    159         <domain id="dom_glo" />
    160         <axis id="tau" />
    161         <axis id="pressure2" />
    162      </grid>
    163 
    164      <grid id="grid4Dmisr">
    165         <domain id="dom_glo" />
    166         <axis id="tau" />
    167         <axis id="cth16" />
    168      </grid>
    169 
    170      <grid id="grid4Dreffi">
    171         <domain id="dom_glo" />
    172         <axis id="tau" />
    173         <axis id="ReffIce" />
    174      </grid>
    175 
    176      <grid id="grid4Dreffl">
    177         <domain id="dom_glo" />
    178         <axis id="tau" />
    179         <axis id="ReffLiq" />
    180      </grid>
    181      <grid id="grid4Dcol2">
    182         <domain id="dom_glo" />
    183         <axis id="height" />
    184         <axis id="column" />
    185      </grid>
     194 <!-- Grid definitions to allow summing of a 3D varaible -->   
     195      <grid id="grid_3D" >
     196         <domain id="dom_glo" />
     197         <axis id="lev" />
     198       </grid>
    186199
    187200  </grid_definition>
  • LMDZ6/branches/DYNAMICO-conv/DefLists/cosp_output_nl.txt

    r2955 r3356  
    2828&COSP_OUTPUT
    2929  ! Simulator flags
    30   Lradar_sim=.false.,
     30  Lradar_sim=.true.,
    3131  Llidar_sim=.true.,
    3232  Lisccp_sim=.true.,
    33   Lmisr_sim=.false.,
    34   Lmodis_sim=.false.,
     33  Lmisr_sim=.true.,
     34  Lmodis_sim=.true.,
    3535  Lrttov_sim=.false.,
    3636  ! Output variables
     
    3939  !- CloudSat
    4040  Lcfaddbze94=.false.,
    41   Ldbze94=.true.,
     41  Ldbze94=.false.,
    4242  !- CALIPSO
    4343  Latb532=.false.,
     
    5353  Lclcalipsoice=.true.,
    5454  Lclcalipsoun=.true.,
    55   Lclcalipsotmp=.true.,
    56   Lclcalipsotmpliq=.true.,
    57   Lclcalipsotmpice=.true.,
    58   Lclcalipsotmpun=.true.,
     55  Lclcalipsotmp=.false.,
     56  Lclcalipsotmpliq=.false.,
     57  Lclcalipsotmpice=.false.,
     58  Lclcalipsotmpun=.false.,
    5959  Lclhcalipsoliq=.true.,
    6060  Lcllcalipsoliq=.true.,
     
    7070  Lcltcalipsoun=.true.,
    7171  ! OPAQ variables
    72   Lclopaquecalipso=.true.,
    73   Lclthincalipso=.true.,
    74   Lclzopaquecalipso=.true.,
    75   Lclcalipsoopaque=.true.,
    76   Lclcalipsothin=.true.,
    77   Lclcalipsozopaque=.true.,
    78   Lclcalipsoopacity=.true.,
     72  Lclopaquecalipso=.false.,
     73  Lclthincalipso=.false.,
     74  Lclzopaquecalipso=.false.,
     75  Lclcalipsoopaque=.false.,
     76  Lclcalipsothin=.false.,
     77  Lclcalipsozopaque=.false.,
     78  Lclcalipsoopacity=.false.,
    7979  ! TIBO variables
    80   Lproftemp=.true.,
    81   LprofSR=.true.,
     80  Lproftemp=.false.,
     81  LprofSR=.false.,
    8282  !- ISCCP
    8383  Lalbisccp=.true.,
     
    9191  Lmeantbclrisccp=.true.,
    9292  !- MISR
    93   LclMISR=.false.,
     93  LclMISR=.true.,
    9494  !- Use lidar and radar
    95   Lclcalipso2=.false.,
    96   Lcltlidarradar=.false.,
     95  Lclcalipso2=.true.,
     96  Lcltlidarradar=.true.,
    9797  !- These are provided for debugging or special purposes
    9898  Lfracout=.false.,
    99   LlidarBetaMol532=.true., 
     99  LlidarBetaMol532=.false., 
    100100  !- MODIS
    101   Lcltmodis=.false.,
    102   Lclwmodis=.false.,
    103   Lclimodis=.false.,
    104   Lclhmodis=.false.,
    105   Lclmmodis=.false.,
    106   Lcllmodis=.false.,
    107   Ltautmodis=.false.,
    108   Ltauwmodis=.false.,
    109   Ltauimodis=.false.,
     101  Lcltmodis=.true.,
     102  Lclwmodis=.true.,
     103  Lclimodis=.true.,
     104  Lclhmodis=.true.,
     105  Lclmmodis=.true.,
     106  Lcllmodis=.true.,
     107  Ltautmodis=.true.,
     108  Ltauwmodis=.true.,
     109  Ltauimodis=.true.,
    110110  Ltautlogmodis=.false.,
    111111  Ltauwlogmodis=.false.,
     
    113113  Lreffclwmodis=.false.,
    114114  Lreffclimodis=.false.,
    115   Lpctmodis=.false.,
    116   Llwpmodis=.false.,
    117   Liwpmodis=.false.,
    118   Lclmodis=.false.,
    119   Lcrimodis=.false.,
    120   Lcrlmodis=.false.,
     115  Lpctmodis=.true.,
     116  Llwpmodis=.true.,
     117  Liwpmodis=.true.,
     118  Lclmodis=.true.,
     119  Lcrimodis=.true.,
     120  Lcrlmodis=.true.,
    121121  !- RTTOV
    122122  Ltbrttov=.false.,
  • LMDZ6/branches/DYNAMICO-conv/DefLists/field_def_lmdz.xml

    r3014 r3356  
    77<!--    </field_group>  -->
    88
     9    <field_group id="coordinates" grid_ref="grid_glo">
     10        <field id="io_lon"  />
     11        <field id="io_lat"  />
     12    </field_group>
     13
    914    <field_group id="coord_hyb">
    1015        <field id="Ahyb"      axis_ref="klev" />
     
    1924        <field id="contfracATM"     long_name="% sfce ter+lic"  unit="-"    />
    2025        <field id="contfracOR"      long_name="% sfce terre OR" unit="-" />
     26        <field id="sza"     long_name="Solar zenithal angle "   unit="deg" />
    2127        <field id="flat"    long_name="Latent heat flux"        unit="W/m2" />
    2228        <field id="slp"     long_name="Sea Level Pressure"      unit="Pa" />
     
    2531        <field id="tsol"    long_name="Surface Temperature"     unit="K" />
    2632        <field id="t2m"        long_name="Temperature 2m" unit="K" />
     33        <field id="tasmax"  field_ref="t2m"  operation="maximum" />
     34        <field id="tasmin"  field_ref="t2m"  operation="minimum" />
    2735        <field id="t2m_min"    long_name="Temp 2m min"    unit="K" operation="minimum" />
    2836        <field id="t2m_max"    long_name="Temp 2m max"    unit="K" operation="maximum" />
     
    3644        <field id="wind10m"    long_name="10-m wind speed"      unit="m/s" />
    3745        <field id="wind10max"  long_name="10m wind speed max"   unit="m/s" />
     46        <field id="sfcWindmax" field_ref="wind10m" operation="maximum" />
    3847        <field id="sicf"    long_name="Sea-ice fraction"        unit="-" />
    3948        <field id="q2m"     long_name="Specific humidity 2m"    unit="kg/kg" />
     
    6978        <field id="ndayrain"    long_name="Number of dayrain(liq+sol)"  unit="-" />
    7079        <field id="precip"      long_name="Precip Totale liq+sol"       unit="kg/(s*m2)" />
     80        <field id="prhmax"      field_ref="precip" operation="maximum"           />
     81        <field id="rain_fall"   long_name="Precip Totale liq"   unit="kg/(s*m2)" />
     82        <field id="rain_con"   long_name="Precip convective liq"   unit="kg/(s*m2)" />
    7183        <field id="plul"    long_name="Large-scale Precip."     unit="kg/(s*m2)" />
    7284        <field id="plun"    long_name="Numerical Precip."       unit="kg/(s*m2)" />
     
    8698        <field id="SWupTOA"    long_name="SWup at TOA"    unit="W/m2" />
    8799        <field id="SWupTOAclr"    long_name="SWup clear sky at TOA"    unit="W/m2" />
     100        <field id="SWupTOAcleanclr"    long_name="SWup clean (no aerosol) clear sky at TOA"    unit="W/m2" />
    88101        <field id="SWdnTOA"    long_name="SWdn at TOA"    unit="W/m2" />
    89102        <field id="SWdnTOAclr"    long_name="SWdn clear sky at TOA"    unit="W/m2" />
     
    104117        <field id="SWupSFC"    long_name="SWup at surface"    unit="W/m2" />
    105118        <field id="SWupSFCclr"    long_name="SWup clear sky at surface"    unit="W/m2" />
     119        <field id="SWupSFCcleanclr"    long_name="SWup clean (no aerosol) clear sky at surface"    unit="W/m2" />
    106120        <field id="SWdnSFC"    long_name="SWdn at surface"    unit="W/m2" />
    107121        <field id="SWdnSFCclr"    long_name="SWdn clear sky at surface"    unit="W/m2" />
     122        <field id="SWdnSFCcleanclr"    long_name="SWdn clean (no aerosol) clear sky at surface"    unit="W/m2" />
    108123        <field id="LWupSFC"    long_name="Upwd. IR rad. at surface"    unit="W/m2" />
    109124        <field id="LWupSFCclr"    long_name="CS Upwd. IR rad. at surface"    unit="W/m2" />
     125        <field id="LWupTOAcleanclr"    long_name="CS clean (no aerosol) Upwd. IR rad. at TOA"    unit="W/m2" />
    110126        <field id="LWdnSFC"    long_name="Down. IR rad. at surface"    unit="W/m2" />
    111127        <field id="LWdnSFCclr"    long_name="Down. CS IR rad. at surface"    unit="W/m2" />
     128        <field id="LWdnSFCcleanclr"    long_name="Down. CS clean (no aerosol) IR rad. at surface"    unit="W/m2" />
    112129        <field id="bils"    long_name="Surf. total heat flux"    unit="W/m2" />
    113130        <field id="bils_tke"    long_name="Surf. total heat flux"    unit="W/m2" />
     
    118135        <field id="bils_latent"    long_name="Surf. total heat flux"    unit="W/m2" />
    119136        <field id="bils_ech"    long_name="peu importe"    unit="W/m2" />
    120         <field id="du_gwd_rando"    long_name="peu importe"    unit="W/m2" />
    121         <field id="dv_gwd_rando"    long_name="peu importe"    unit="W/m2" />
    122137        <field id="ustr_gwd_hines"    long_name="zonal wind stress Hines gravity waves"    unit="Pa" />
    123138        <field id="vstr_gwd_hines"    long_name="meridional wind stress Hines gravity waves"    unit="Pa" />
     
    144159        <field id="fqfonte"    long_name="Land ice melt"    unit="kg/m2/s" />
    145160        <field id="runofflic"  long_name="Land ice melt to ocean" unit="kg/m2/s" />
     161        <field id="mrroli"  long_name="Runoff flux over land ice" unit="kg/m2/s" />
    146162        <field id="taux"    long_name="Zonal wind stress"    unit="Pa" />
    147163        <field id="tauy"    long_name="Meridional wind stress"    unit="Pa" />
     
    219235        <field id="uq"    long_name="Zonal humidity transport"    unit="-" />
    220236        <field id="vq"    long_name="Merid humidity transport"    unit="-" />
     237        <field id="uwat"    long_name="Zonal total water transport"    unit="-" />
     238        <field id="vwat"    long_name="Merid total water transport"    unit="-" />
    221239        <field id="cape"    long_name="Conv avlbl pot ener"    unit="J/kg" />
    222240        <field id="pbase"    long_name="Cld base pressure"    unit="Pa" />
     
    247265        <field id="proba_notrig"    long_name="Probabilite de non-declenchement"    unit="-" />
    248266        <field id="random_notrig"    long_name="Tirage aleatoire de non-declenchement"    unit="-" />
     267        <field id="cv_gen"    long_name="Cumulonimbus genesis"    unit="1/(m2 s)" />
    249268        <field id="ale_bl_stat"    long_name="ALE_BL_STAT"    unit="m2/s2" />
    250269        <field id="ale_bl_trig"    long_name="ALE_BL_STAT + Condition P>Pseuil"    unit="m2/s2" />
     
    308327        <field id="v10_sic"    long_name="-"    unit="-" />
    309328        <field id="rh2m"    long_name="Relative humidity at 2m"    unit="%" />
    310         <field id="rh2m_min"    long_name="Min Relative humidity at 2m"    unit="%" />
    311         <field id="rh2m_max"    long_name="Max Relative humidity at 2m"    unit="%" />
     329        <field id="rh2m_max"    field_ref="rh2m" operation="maximum" />
     330        <field id="rh2m_min"    field_ref="rh2m" operation="minimum" />
     331<!--        <field id="rh2m_min"    long_name="Min Relative humidity at 2m"    unit="%" /> -->
     332<!--        <field id="rh2m_max"    long_name="Max Relative humidity at 2m"    unit="%" /> -->
    312333        <field id="qsat2m"    long_name="Saturant humidity at 2m"    unit="%" />
    313334        <field id="tpot"    long_name="Surface air potential temperature"    unit="K" />
    314335        <field id="tpote"    long_name="Surface air equivalent potential temperature"    unit="K" />
    315336        <field id="SWnetOR"    long_name="Sfce net SW radiation OR"    unit="W/m2" />
    316         <field id="SWdownOR"    long_name="Sfce incident SW radiation OR"    unit="W/m2" />
    317337        <field id="LWdownOR"    long_name="Sfce incident LW radiation OR"    unit="W/m2" />
    318338        <field id="snowl"    long_name="Solid Large-scale Precip."    unit="kg/(m2*s)" />
     
    438458        <field id="alb2"    long_name="Surface Near IR albedo"    unit="-" />
    439459        <field id="ftime_con"    long_name="Fraction of time convection Occurs"    unit="-" />
    440         <field id="wake_h"    long_name="wake_h"    unit="-" />
     460        <field id="ftime_deepcv"    long_name="Fraction of time deep convection Occurs"    unit="-" />
     461        <field id="wake_h"    long_name="wake height"    unit="m" />
     462        <field id="wake_dens"    long_name="number of wakes per m2"    unit="1/m2" />
    441463        <field id="wake_s"    long_name="wake_s"    unit="-" />
    442464        <field id="epmax"    long_name="epmax en fn cape"    unit="su" />
     
    521543        <field id="ocond"    long_name="Condensed water"    unit="kg/kg" />
    522544        <field id="geop"    long_name="Geopotential height"    unit="m2/s2" />
     545        <field id="geoph"    field_ref="geop" long_name="Geopotential height" unit="m" > geop/9.80665 </field>
    523546        <field id="vitu"    long_name="Zonal wind"    unit="m/s" />
    524547        <field id="vitv"    long_name="Meridional wind"    unit="m/s" />
     
    555578        <field id="lcc3dcon"    long_name="Convective cloud liquid fraction"    unit="1" />
    556579        <field id="lcc3dstra"    long_name="Stratiform cloud liquid fraction"    unit="1" />
     580        <field id="cldwatmxrat"    long_name="Cloud Water Mixing Ratio"    unit="1" />
     581        <field id="icc3dcon"    long_name="Mass Fraction of Convective Cloud Ice"    unit="kg/kg" />
     582        <field id="icc3dstra"    long_name="Mass Fraction of Stratiform Cloud Ice "    unit="kg/kg" />
     583        <field id="cldicemxrat"    long_name="Cloud Ice Mixing Ratio"    unit="1" />
    557584        <field id="clwcon"    long_name="Convective Cloud Liquid water content"    unit="kg/kg" />
    558585        <field id="Ma"    long_name="undilute adiab updraft"    unit="kg/m2/s" />
     
    628655        <field id="dulif"    long_name="Orography dU"    unit="m/s2" />
    629656        <field id="dvlif"    long_name="Orography dV"    unit="m/s2" />
     657        <field id="du_gwd_rando"    long_name="peu importe"    unit="W/m2" />
     658        <field id="dv_gwd_rando"    long_name="peu importe"    unit="W/m2" />
    630659        <field id="du_gwd_hines" long_name="Hines GWD dU" unit="m/s2" />
    631660        <field id="dv_gwd_hines" long_name="Hines GWD dV" unit="m/s2" />
     
    637666        <field id="dtlif"    long_name="Orography dT"    unit="K/s" />
    638667        <field id="dthin"    long_name="Hines GWD dT"    unit="K/s" />
    639         <field id="rsu"    long_name="SW upward radiation"    unit="W m-2" enabled="FALSE" />
    640         <field id="rsd"    long_name="SW downward radiation"    unit="W m-2" enabled="FALSE" />
    641         <field id="rlu"    long_name="LW upward radiation"    unit="W m-2" enabled="FALSE" />
    642         <field id="rld"    long_name="LW downward radiation"    unit="W m-2" enabled="FALSE" />
    643         <field id="rsucs"    long_name="SW CS upward radiation"    unit="W m-2" enabled="FALSE" />
    644         <field id="rsdcs"    long_name="SW CS downward radiation"    unit="W m-2" enabled="FALSE" />
    645         <field id="rlucs"    long_name="LW CS upward radiation"    unit="W m-2" enabled="FALSE" />
    646         <field id="rldcs"    long_name="LW CS downward radiation"    unit="W m-2" enabled="FALSE" />
     668        <field id="rsu"    long_name="SW upward radiation"    unit="W m-2" />
     669        <field id="rsd"    long_name="SW downward radiation"    unit="W m-2" />
     670        <field id="rlu"    long_name="LW upward radiation"    unit="W m-2" />
     671        <field id="rld"    long_name="LW downward radiation"    unit="W m-2" />
     672        <field id="rsucsaf"  long_name="SW clean (no aerosol) CS upward radiation"    unit="W m-2" />
     673        <field id="rsdcsaf"  long_name="SW clean (no aerosol) CS downward radiation"    unit="W m-2" />
     674        <field id="rsucs"    long_name="SW CS upward radiation"    unit="W m-2" />
     675        <field id="rsdcs"    long_name="SW CS downward radiation"    unit="W m-2" />
     676        <field id="rlucs"    long_name="LW CS upward radiation"    unit="W m-2" />
     677        <field id="rldcs"    long_name="LW CS downward radiation"    unit="W m-2" />
    647678        <field id="tnt"    long_name="Tendency of air temperature"    unit="K s-1" />
    648679        <field id="tntc"    long_name="Tendency of air temperature due to Moist Convection"    unit="K s-1" />
     
    667698        <field id="rldcs4co2"    long_name="Downwelling CS LW 4xCO2 atmosphere"    unit="W/m2" />
    668699        <field id="stratomask"    long_name="Stratospheric fraction"    unit="-" />
     700        <field id="pvap"    long_name="pvap intermediary variable" unit="-">pres*ovap*461.5 / (287.04*(1.+ (10.9491/18.0153)*ovap)) </field>
    669701    </field_group>
    670702
     
    692724        <field id="OD1020_strat_only"  long_name="Stratospheric Aerosol Optical depth at 1020 nm "       unit="1" />
    693725        <field id="surf_PM25_sulf"     long_name="Sulfate PM2.5 concentration at the surface"            unit="ug/m3" />
     726        <field id="budg_dep_dry_ocs"   long_name="OCS dry deposition flux"                               unit="kg(S)/m2/s" />
     727        <field id="budg_dep_wet_ocs"   long_name="OCS wet deposition flux"                               unit="kg(S)/m2/s" />
     728        <field id="budg_dep_dry_so2"   long_name="SO2 dry deposition flux"                               unit="kg(S)/m2/s" />
     729        <field id="budg_dep_wet_so2"   long_name="SO2 wet deposition flux"                               unit="kg(S)/m2/s" />
    694730        <field id="budg_dep_dry_h2so4" long_name="H2SO4 dry deposition flux"                             unit="kg(S)/m2/s" />
    695731        <field id="budg_dep_wet_h2so4" long_name="H2SO4 wet deposition flux"                             unit="kg(S)/m2/s" />
     
    783819    </field_group>
    784820
    785     <field_group id="fields_COSP_CALIPSO_2D" grid_ref="grid_glo" freq_op="3h">
     821    <field_group id="fields_solbnd_3D" grid_ref="grid_glo_spectband" >
     822      <field id="solbnd"    long_name="Top-of-Atmosphere Solar Insolation for each band"    unit="W m-2" />
     823    </field_group>
     824
     825    <field_group id="fields_COSP_CALIPSO_2D" grid_ref="grid_glo" freq_offset="0ts" freq_op="3h">
    786826      <field id="cllcalipso"    long_name="Lidar Low-level Cloud Fraction"   unit="1"  detect_missing_value=".true." />
    787827      <field id="clhcalipso"    long_name="Lidar Hight-level Cloud Fraction"   unit="1"  detect_missing_value=".true." />
    788828      <field id="clmcalipso"    long_name="Lidar Mid-level Cloud Fraction"   unit="1"  detect_missing_value=".true." />
    789829      <field id="cltcalipso"    long_name="Lidar Total Cloud Fraction"   unit="1"  detect_missing_value=".true." />
    790       <field id="pcllcalipso"  field_ref="cllcalipso" long_name="Lidar Low-level Cloud Fraction"   unit="%"  detect_missing_value=".true." > cllcalipso*100 </field>
    791       <field id="pclhcalipso"  field_ref="clhcalipso" long_name="Lidar Hight-level Cloud Fraction"   unit="%"  detect_missing_value=".true." > clhcalipso*100 </field>
    792       <field id="pclmcalipso"  field_ref="clmcalipso" long_name="Lidar Mid-level Cloud Fraction"   unit="%"  detect_missing_value=".true." > clmcalipso*100 </field>
    793       <field id="pcltcalipso" field_ref="cltcalipso"   long_name="Lidar Total Cloud Fraction"   unit="%" detect_missing_value=".true." > cltcalipso*100 </field>
     830      <field id="pcllcalipso"  long_name="Lidar Low-level Cloud Fraction"   unit="%"  detect_missing_value=".true." > cllcalipso*100 </field>
     831      <field id="pclhcalipso"  long_name="Lidar Hight-level Cloud Fraction"   unit="%"  detect_missing_value=".true." > clhcalipso*100 </field>
     832      <field id="pclmcalipso"  long_name="Lidar Mid-level Cloud Fraction"   unit="%"  detect_missing_value=".true." > clmcalipso*100 </field>
     833      <field id="pcltcalipso"   long_name="Lidar Total Cloud Fraction"   unit="%" detect_missing_value=".true." > cltcalipso*100 </field>
    794834      <field id="cllcalipsoice"   long_name="Lidar Ice-Phase Low-level Cloud Fraction"   unit="1"  detect_missing_value=".true." />
    795835      <field id="clhcalipsoice"   long_name="Lidar Ice-Phase Hight-level Cloud Fraction"   unit="1"  detect_missing_value=".true." />
     
    808848      <field id="clzopaquecalipso" long_name="Lidar mean altitude of opacity"   unit="m"  detect_missing_value=".true." />
    809849    </field_group> 
    810     <field_group id="fields_COSP_CALIPSO_3D_height" grid_ref="grid_glo_height" freq_op="3h">
     850    <field_group id="fields_COSP_CALIPSO_3D_height" grid_ref="grid_glo_height" freq_offset="0ts" freq_op="3h">
    811851      <field id="clcalipso"  long_name="Lidar Cloud Fraction (532 nm)" unit="1" detect_missing_value=".true." />
    812       <field id="pclcalipso" field_ref="clcalipso" long_name="Lidar Cloud Fraction (532 nm)" unit="%" detect_missing_value=".true." > clcalipso*100 </field>
     852      <field id="pclcalipso" long_name="Lidar Cloud Fraction (532 nm)" unit="%" detect_missing_value=".true." > clcalipso*100 </field>
    813853      <field id="clcalipsoice"    long_name="Lidar Ice-Phase Cloud Fraction (532 nm)" unit="1" detect_missing_value=".true." />
    814854      <field id="clcalipsoliq"    long_name="Lidar Liq-Phase Cloud Fraction (532 nm)" unit="1" detect_missing_value=".true." />
     
    820860      <field id="proftemp"         long_name="Temperature profile (40 lev)" unit="K" detect_missing_value=".true." />
    821861    </field_group>
    822     <field_group id="fields_COSP_CALIPSO_3D_heightmlev" grid_ref="grid_glo_heightmlev" freq_op="3h">
     862    <field_group id="fields_COSP_CALIPSO_3D_heightmlev" grid_ref="grid_glo_heightmlev" freq_offset="0ts" freq_op="3h">
    823863      <field id="beta_mol532" long_name="Lidar Molecular Backscatter (532 nm)" unit="m-1 sr-1" detect_missing_value=".true." />
    824864    </field_group>
    825     <field_group id="fields_COSP_CALIPSO_3D_temp" grid_ref="grid_glo_temp" freq_op="3h">
     865    <field_group id="fields_COSP_CALIPSO_3D_temp" grid_ref="grid_glo_temp" freq_offset="0ts" freq_op="3h">
    826866      <field id="clcalipsotmp"    long_name="Lidar Cloud Fraction (532 nm)" unit="%"  detect_missing_value=".true." />
    827867      <field id="clcalipsotmpliq" long_name="Lidar Liq-Phase Cloud Fraction (532 nm)" unit="1" detect_missing_value=".true." />
     
    829869      <field id="clcalipsotmpun"  long_name="Undefined-Phase Total Cloud Fraction"   unit="1"  detect_missing_value=".true." />
    830870    </field_group>
    831    <field_group id="fields_COSP_CALIPSO_3D_sza" grid_ref="grid_glo_sza" freq_op="3h">
     871   <field_group id="fields_COSP_CALIPSO_3D_sza" grid_ref="grid_glo_sza" freq_offset="0ts" freq_op="3h">
    832872     <field id="parasol_refl"  long_name="PARASOL-like mono-directional reflectance" unit="1" detect_missing_value=".true." />
    833873      <field id="parasol_crefl"  long_name="PARASOL-like mono-directional reflectance (integral)" unit="1" detect_missing_value=".true." />
    834874      <field id="Ncrefl"  long_name="Nb for PARASOL-like mono-directional reflectance" unit="1" detect_missing_value=".true." />
    835875    </field_group>
    836       <field id="cfad_lidarsr532" long_name="Lidar Scattering Ratio CFAD (532 nm)" unit="1" freq_op="3h" grid_ref="grid4Dsrbin"  detect_missing_value=".true." />
    837       <field id="atb532" long_name="Lidar Attenuated Total Backscatter (532 nm)" unit="1" freq_op="3h" grid_ref="grid4Dcol"  detect_missing_value=".true." />
    838       <field id="profSR" long_name="Scattering Ratio profiles" unit="1" freq_op="3h" grid_ref="grid4Dcol2"  detect_missing_value=".true." />
    839 
    840     <field_group id="fields_COSP_CLOUDSAT_2D" grid_ref="grid_glo" freq_op="3h">
     876      <field id="cfad_lidarsr532" long_name="Lidar Scattering Ratio CFAD (532 nm)" unit="1" freq_offset="0ts" freq_op="3h" grid_ref="grid4Dsrbin"  detect_missing_value=".true." />
     877      <field id="atb532" long_name="Lidar Attenuated Total Backscatter (532 nm)" unit="1" freq_offset="0ts" freq_op="3h" grid_ref="grid4Dcol"  detect_missing_value=".true." />
     878      <field id="profSR" long_name="Scattering Ratio profiles" unit="1" freq_offset="0ts" freq_op="3h" grid_ref="grid4Dcol2"  detect_missing_value=".true." />
     879
     880    <field_group id="fields_COSP_CLOUDSAT_2D" grid_ref="grid_glo" freq_offset="0ts" freq_op="3h">
    841881      <field id="cltlidarradar" long_name="Lidar and Radar Total Cloud Fraction" unit="1"  detect_missing_value=".true." />
    842882    </field_group>
    843     <field_group id="fields_COSP_CLOUDSAT_3D" grid_ref="grid_glo_height" freq_op="3h">
     883    <field_group id="fields_COSP_CLOUDSAT_3D" grid_ref="grid_glo_height" freq_offset="0ts" freq_op="3h">
    844884      <field id="clcalipso2"  long_name="CALIPSO Cloud Fraction Undetected by CloudSat" unit="1" detect_missing_value=".true." />
    845885    </field_group>
    846       <field id="dbze94" long_name="CloudSat Radar Reflectivity" unit="1" freq_op="3h" grid_ref="grid4Dcol"  detect_missing_value=".true." />
    847       <field id="cfadDbze94" long_name="CloudSat Radar Reflectivity CFAD" unit="1" freq_op="3h" grid_ref="grid4Ddbze"  detect_missing_value=".true." />
    848 
    849     <field_group id="fields_COSP_ISCCP_2D" grid_ref="grid_glo" freq_op="3h">
     886      <field id="dbze94" long_name="CloudSat Radar Reflectivity" unit="1" freq_offset="0ts" freq_op="3h" grid_ref="grid4Dcol"  detect_missing_value=".true." />
     887      <field id="cfadDbze94" long_name="CloudSat Radar Reflectivity CFAD" unit="1" freq_offset="0ts" freq_op="3h" grid_ref="grid4Ddbze"  detect_missing_value=".true." />
     888
     889    <field_group id="fields_COSP_ISCCP_2D" grid_ref="grid_glo" freq_offset="0ts" freq_op="3h">
    850890      <field id="sunlit" long_name="1 for day points, 0 for nightime" unit="1"  detect_missing_value=".true." />
    851891      <field id="tclisccp" long_name="Total Cloud Fraction as Calculated by the ISCCP Simulator" unit="1"  detect_missing_value=".true." />
     
    856896      <field id="meantbclrisccp" long_name="Mean clear-sky 10.5 micron brightness temperature as calculated by the ISCCP Simulator" unit="K"  detect_missing_value=".true." />
    857897    </field_group>
    858     <field_group id="fields_COSP_ISCCP_3D" grid_ref="grid_glo_column" freq_op="3h">
     898    <field_group id="fields_COSP_ISCCP_3D" grid_ref="grid_glo_column" freq_offset="0ts" freq_op="3h">
    859899      <field id="boxtauisccp" long_name="Optical Depth in Each Column as Calculated by the ISCCP Simulator" unit="1" detect_missing_value=".true." />
    860900      <field id="boxptopisccp" long_name="Cloud Top Pressure in Each Column as Calculated by the ISCCP Simulator" unit="Pa" detect_missing_value=".true." />
    861901    </field_group>
    862       <field id="clisccp2" long_name="Cloud Fraction as Calculated by the ISCCP Simulator" unit="1" freq_op="3h" grid_ref="grid4Dtau"  detect_missing_value=".true." />
    863 
    864     <field_group id="fields_COSP_MISR" freq_op="3h">
     902      <field id="clisccp2" long_name="Cloud Fraction as Calculated by the ISCCP Simulator" unit="1" freq_offset="0ts" freq_op="3h" grid_ref="grid4Dtau"  detect_missing_value=".true." />
     903
     904    <field_group id="fields_COSP_MISR" freq_offset="0ts" freq_op="3h">
    865905      <field id="clMISR" long_name="Cloud Fraction as Calculated by the MISR Simulator" unit="1" grid_ref="grid4Dmisr"  detect_missing_value=".true." />
    866906    </field_group>
    867907
    868     <field_group id="fields_COSP_MODIS" grid_ref="grid_glo" freq_op="3h">
     908    <field_group id="fields_COSP_MODIS" grid_ref="grid_glo" freq_offset="0ts" freq_op="3h">
    869909      <field id="cllmodis" long_name="MODIS Low-level Cloud Fraction" unit="1"  detect_missing_value=".true." />
    870910      <field id="clmmodis" long_name="MODIS Mid-level Cloud Fraction" unit="1"  detect_missing_value=".true." />
     
    885925      <field id="iwpmodis" long_name="Modis Ice_Water_Path_Mean" unit="kg m-2" detect_missing_value=".true." />
    886926    </field_group>
    887       <field id="clmodis" long_name="MODIS Cloud Area Fraction" unit="1" freq_op="3h" grid_ref="grid4Dtau"  detect_missing_value=".true." />
    888       <field id="crimodis" long_name="MODIS Optical_Thickness_vs_ReffIce" unit="1" freq_op="3h" grid_ref="grid4Dreffi"  detect_missing_value=".true." />
    889       <field id="crlmodis" long_name="MODIS Optical_Thickness_vs_ReffLiq" unit="1" freq_op="3h" grid_ref="grid4Dreffl"  detect_missing_value=".true." />
     927      <field id="clmodis" long_name="MODIS Cloud Area Fraction" unit="1" freq_offset="0ts" freq_op="3h" grid_ref="grid4Dtau"  detect_missing_value=".true." />
     928      <field id="crimodis" long_name="MODIS Optical_Thickness_vs_ReffIce" unit="1" freq_offset="0ts" freq_op="3h" grid_ref="grid4Dreffi"  detect_missing_value=".true." />
     929      <field id="crlmodis" long_name="MODIS Optical_Thickness_vs_ReffLiq" unit="1" freq_offset="0ts" freq_op="3h" grid_ref="grid4Dreffl"  detect_missing_value=".true." />
    890930
    891931    <field_group id="fields_AIRS" grid_ref="grid_glo" operation="instant" freq_op="3h">
     
    935975      <field id="CFC11_ppt" long_name="CFC11_ppt" unit="ppt" />
    936976      <field id="CFC12_ppt" long_name="CFC12_ppt" unit="ppt" />
     977<!-- reducing mass 3D variable to atmosphere total mass scalar -->
     978      <field id="mass_sum" field_ref="mass" grid_ref="grid_sum" grid_path="grid_sum_axis" freq_op="1mo" > @mass  </field>
    937979   </field_group>
    938980
  • LMDZ6/branches/DYNAMICO-conv/DefLists/file_def_histLES_lmdz.xml

    r2995 r3356  
    1818                <field field_ref="flat" level="5" />
    1919                <field field_ref="slp" level="10" />
     20                <field field_ref="sza" level="10" />
    2021                <field field_ref="ptstar" level="10" />
    2122                <field field_ref="pt0" level="10" />
     
    5859                <field field_ref="ndayrain" level="10" operation="instant" />
    5960                <field field_ref="precip" level="5" />
     61                <field field_ref="rain_fall" level="5" />
     62                <field field_ref="rain_con" level="5" />
    6063                <field field_ref="plul" level="10" />
    6164                <field field_ref="plun" level="10" />
     
    123126                <field field_ref="fqcalving" level="10" />
    124127                <field field_ref="fqfonte" level="10" />
     128                <field field_ref="mrroli" level="10" />
    125129                <field field_ref="runofflic" level="10" />
    126130                <field field_ref="taux" level="10" />
     
    315319                <field field_ref="l_mixmin_sic" level="10" />
    316320                <field field_ref="SWnetOR" level="10" />
    317                 <field field_ref="SWdownOR" level="10" />
    318321                <field field_ref="LWdownOR" level="10" />
    319322                <field field_ref="snowl" level="10" />
     
    411414                <field field_ref="ftime_con" level="10" operation="instant" />
    412415                <field field_ref="wake_h" level="10" />
     416                <field field_ref="wake_dens" level="10" />
    413417                <field field_ref="wake_s" level="10" />
    414418                <field field_ref="epmax" level="10" />
     
    417421                <field field_ref="lmaxth" level="10" />
    418422                <field field_ref="ftime_th" level="10" />
     423                <field field_ref="ftime_deepcv" level="10" />
    419424                <field field_ref="f0_th" level="10" />
    420425                <field field_ref="zmax_th" level="10" />
     
    463468                <field field_ref="ocond" level="10" />
    464469                <field field_ref="geop" level="10" />
     470                <field field_ref="geoph" level="10" />
    465471                <field field_ref="vitu" level="10" />
    466472                <field field_ref="vitv" level="10" />
     
    496502                <field field_ref="lcc3dcon" level="10" />
    497503                <field field_ref="lcc3dstra" level="10" />
     504                <field field_ref="cldwatmxrat" level="10" />
     505                <field field_ref="icc3dcon" level="10" />
     506                <field field_ref="icc3dstra" level="10" />
     507                <field field_ref="cldicemxrat" level="10" />
    498508                <field field_ref="clwcon" level="10" />
    499509                <field field_ref="Ma" level="10" />
  • LMDZ6/branches/DYNAMICO-conv/DefLists/file_def_histdayCOSP_lmdz.xml

    r3014 r3356  
    88                <field field_ref="clhcalipso"         level="1" />
    99                <field field_ref="cltcalipso"         level="1" />
     10                <field field_ref="pcllcalipso"         level="1" />
     11                <field field_ref="pclmcalipso"         level="1" />
     12                <field field_ref="pclhcalipso"         level="1" />
     13                <field field_ref="pcltcalipso"         level="1" />
    1014                <field field_ref="cllcalipsoice"         level="1" />
    1115                <field field_ref="clmcalipsoice"         level="1" />
     
    8387                <field field_ref="reffclwmodis" level="1" />
    8488                <field field_ref="reffclimodis" level="1" />
    85                 <field field_ref="pctmodis"  unit="1" />
     89                <field field_ref="pctmodis"  level="1" />
    8690                <field field_ref="lwpmodis" level="1" />
    8791                <field field_ref="iwpmodis" level="1" />
  • LMDZ6/branches/DYNAMICO-conv/DefLists/file_def_histday_lmdz.xml

    r2995 r3356  
    1818                <field field_ref="flat" level="1" />
    1919                <field field_ref="slp" level="1" />
     20                <field field_ref="sza" level="1" />
    2021                <field field_ref="ptstar" level="1" />
    2122                <field field_ref="pt0" level="1" />
     
    6263                <field field_ref="ndayrain" level="10" operation="instant" />
    6364                <field field_ref="precip" level="1" />
     65                <field field_ref="rain_fall" level="1" />
     66                <field field_ref="rain_con" level="1" />
    6467                <field field_ref="plul" level="1" />
    6568                <field field_ref="plun" level="1" />
     
    127130                <field field_ref="fqcalving" level="10" />
    128131                <field field_ref="fqfonte" level="10" />
     132                <field field_ref="mrroli" level="10" />
    129133                <field field_ref="runofflic" level="10" />
    130134                <field field_ref="taux" level="10" />
     
    231235                <field field_ref="proba_notrig" level="1" />
    232236                <field field_ref="random_notrig" level="1" />
     237                <field field_ref="cv_gen" level="1" />
    233238                <field field_ref="ale_bl_stat" level="1" />
    234239                <field field_ref="ale_bl_trig" level="1" />
     
    321326                <field field_ref="l_mixmin_sic" level="10" />
    322327                <field field_ref="SWnetOR" level="10" />
    323                 <field field_ref="SWdownOR" level="10" />
    324328                <field field_ref="LWdownOR" level="10" />
    325329                <field field_ref="snowl" level="1" />
     
    424428                <field field_ref="ftime_con" level="10" operation="instant" />
    425429                <field field_ref="wake_h" level="5" />
     430                <field field_ref="wake_dens" level="5" />
    426431                <field field_ref="wake_s" level="5" />
    427432                <field field_ref="epmax" level="10" />
     
    430435                <field field_ref="lmaxth" level="10" />
    431436                <field field_ref="ftime_th" level="10" />
     437                <field field_ref="ftime_deepcv" level="10" />
    432438                <field field_ref="f0_th" level="10" />
    433439                <field field_ref="zmax_th" level="4" />
     
    476482                <field field_ref="ocond" level="3" />
    477483                <field field_ref="geop" level="3" />
     484                <field field_ref="geoph" level="3" />
    478485                <field field_ref="vitu" level="3" />
    479486                <field field_ref="vitv" level="3" />
     
    509516                <field field_ref="lcc3dcon" level="6" />
    510517                <field field_ref="lcc3dstra" level="6" />
     518                <field field_ref="cldwatmxrat" level="6" />
     519                <field field_ref="icc3dcon" level="6" />
     520                <field field_ref="icc3dstra" level="6" />
     521                <field field_ref="cldicemxrat" level="6" />
    511522                <field field_ref="clwcon" level="10" />
    512523                <field field_ref="Ma" level="10" />
  • LMDZ6/branches/DYNAMICO-conv/DefLists/file_def_histhfCOSP_lmdz.xml

    r3014 r3356  
    88                <field field_ref="clhcalipso"         level="1" />
    99                <field field_ref="cltcalipso"         level="1" />
     10                <field field_ref="pcllcalipso"         level="1" />
     11                <field field_ref="pclmcalipso"         level="1" />
     12                <field field_ref="pclhcalipso"         level="1" />
     13                <field field_ref="pcltcalipso"         level="1" />
    1014                <field field_ref="cllcalipsoice"         level="1" />
    1115                <field field_ref="clmcalipsoice"         level="1" />
     
    8387                <field field_ref="reffclwmodis" level="1" />
    8488                <field field_ref="reffclimodis" level="1" />
    85                 <field field_ref="pctmodis"  unit="1" />
     89                <field field_ref="pctmodis"  level="1" />
    8690                <field field_ref="lwpmodis" level="1" />
    8791                <field field_ref="iwpmodis" level="1" />
  • LMDZ6/branches/DYNAMICO-conv/DefLists/file_def_histhf_lmdz.xml

    r2995 r3356  
    1818                <field field_ref="flat" level="5" />
    1919                <field field_ref="slp" level="10" />
     20                <field field_ref="sza" level="10" />
    2021                <field field_ref="ptstar" level="10" />
    2122                <field field_ref="pt0" level="10" />
     
    6263                <field field_ref="ndayrain" level="10" operation="instant" />
    6364                <field field_ref="precip" level="10" />
     65                <field field_ref="rain_fall" level="10" />
     66                <field field_ref="rain_con" level="10" />
    6467                <field field_ref="plul" level="10" />
    6568                <field field_ref="plun" level="10" />
     
    127130                <field field_ref="fqcalving" level="10" />
    128131                <field field_ref="fqfonte" level="10" />
     132                <field field_ref="mrroli" level="10" />
    129133                <field field_ref="runofflic" level="10" />
    130134                <field field_ref="taux" level="10" />
     
    231235                <field field_ref="proba_notrig" level="6" />
    232236                <field field_ref="random_notrig" level="6" />
     237                <field field_ref="cv_gen" level="6" />
    233238                <field field_ref="ale_bl_stat" level="6" />
    234239                <field field_ref="ale_bl_trig" level="6" />
     
    319324                <field field_ref="l_mixmin_sic" level="10" />
    320325                <field field_ref="SWnetOR" level="10" />
    321                 <field field_ref="SWdownOR" level="10" />
    322326                <field field_ref="LWdownOR" level="10" />
    323327                <field field_ref="snowl" level="10" />
     
    415419                <field field_ref="ftime_con" level="10" operation="instant" />
    416420                <field field_ref="wake_h" level="10" />
     421                <field field_ref="wake_dens" level="10" />
    417422                <field field_ref="wake_s" level="10" />
    418423                <field field_ref="epmax" level="10" />
     
    421426                <field field_ref="lmaxth" level="10" />
    422427                <field field_ref="ftime_th" level="10" />
     428                <field field_ref="ftime_deepcv" level="10" />
    423429                <field field_ref="f0_th" level="10" />
    424430                <field field_ref="zmax_th" level="5" />
     
    497503                <field field_ref="ocond" level="10" />
    498504                <field field_ref="geop" level="10" />
     505                <field field_ref="geoph" level="10" />
    499506                <field field_ref="vitu" level="5" />
    500507                <field field_ref="vitv" level="5" />
     
    528535                <field field_ref="reffclwc" level="10" />
    529536                <field field_ref="lcc3d" level="10" />
    530                 <field field_ref="lcc3dcon" level="10" />
    531                 <field field_ref="lcc3dstra" level="10" />
     537                <field field_ref="lcc3dcon" level="5" />
     538                <field field_ref="lcc3dstra" level="5" />
     539                <field field_ref="cldwatmxrat" level="5" />
     540                <field field_ref="icc3dcon" level="5" />
     541                <field field_ref="icc3dstra" level="5" />
     542                <field field_ref="cldicemxrat" level="5" />
    532543                <field field_ref="clwcon" level="10" />
    533544                <field field_ref="Ma" level="10" />
     
    640651                <field field_ref="rldcs4co2" level="10" />
    641652            </field_group>
     653
     654            <!-- VARS 3D -->
     655            <field_group operation="average" freq_op="1ts" grid_ref="grid_glo_spectband">
     656                <field field_ref="solbnd" level="4" />
     657            </field_group>
     658
    642659        </file>
    643660    </file_group>
  • LMDZ6/branches/DYNAMICO-conv/DefLists/file_def_histins_lmdz.xml

    r2995 r3356  
    1818                <field field_ref="flat" level="10" />
    1919                <field field_ref="slp" level="1" />
     20                <field field_ref="sza" level="1" />
    2021                <field field_ref="ptstar" level="1" />
    2122                <field field_ref="pt0" level="1" />
     
    5859                <field field_ref="ndayrain" level="10" operation="instant"  />
    5960                <field field_ref="precip" level="1" />
     61                <field field_ref="rain_fall" level="1" />
     62                <field field_ref="rain_con" level="1" />
    6063                <field field_ref="plul" level="1" />
    6164                <field field_ref="plun" level="1" />
     
    9396                <field field_ref="SWupSFC" level="10" />
    9497                <field field_ref="SWupSFCclr" level="10" />
    95                 <field field_ref="SWdnSFC" level="10" />
     98                <field field_ref="SWdnSFC" level="2" />
    9699                <field field_ref="SWdnSFCclr" level="10" />
    97100                <field field_ref="LWupSFC" level="10" />
     
    123126                <field field_ref="fqcalving" level="10" />
    124127                <field field_ref="fqfonte" level="10" />
     128                <field field_ref="mrroli" level="10" />
    125129                <field field_ref="runofflic" level="10" />
    126130                <field field_ref="taux" level="10" />
     
    227231                <field field_ref="proba_notrig" level="1" />
    228232                <field field_ref="random_notrig" level="1" />
     233                <field field_ref="cv_gen" level="1" />
    229234                <field field_ref="ale_bl_stat" level="1" />
    230235                <field field_ref="ale_bl_trig" level="1" />
     
    315320                <field field_ref="l_mixmin_sic" level="10" />
    316321                <field field_ref="SWnetOR" level="2" />
    317                 <field field_ref="SWdownOR" level="2" />
    318322                <field field_ref="LWdownOR" level="2" />
    319323                <field field_ref="snowl" level="10" />
     
    411415                <field field_ref="ftime_con" level="10" operation="instant" />
    412416                <field field_ref="wake_h" level="10" />
     417                <field field_ref="wake_dens" level="10" />
    413418                <field field_ref="wake_s" level="10" />
    414419                <field field_ref="epmax" level="10" />
     
    417422                <field field_ref="lmaxth" level="10" />
    418423                <field field_ref="ftime_th" level="10" />
     424                <field field_ref="ftime_deepcv" level="10" />
    419425                <field field_ref="f0_th" level="10" />
    420426                <field field_ref="zmax_th" level="4" />
     
    463469                <field field_ref="ocond" level="4" />
    464470                <field field_ref="geop" level="10" />
     471                <field field_ref="geoph" level="10" />
    465472                <field field_ref="vitu" level="4" />
    466473                <field field_ref="vitv" level="4" />
     
    496503                <field field_ref="lcc3dcon" level="10" />
    497504                <field field_ref="lcc3dstra" level="10" />
     505                <field field_ref="cldwatmxrat" level="10" />
     506                <field field_ref="icc3dcon" level="10" />
     507                <field field_ref="icc3dstra" level="10" />
     508                <field field_ref="cldicemxrat" level="10" />
    498509                <field field_ref="clwcon" level="10" />
    499510                <field field_ref="Ma" level="10" />
  • LMDZ6/branches/DYNAMICO-conv/DefLists/file_def_histmthCOSP_lmdz.xml

    r3014 r3356  
    99                <field field_ref="clhcalipso"         level="1" />
    1010                <field field_ref="cltcalipso"         level="1" />
     11                <field field_ref="pcllcalipso"         level="1" />
     12                <field field_ref="pclmcalipso"         level="1" />
     13                <field field_ref="pclhcalipso"         level="1" />
     14                <field field_ref="pcltcalipso"         level="1" />
    1115                <field field_ref="cllcalipsoice"         level="1" />
    1216                <field field_ref="clmcalipsoice"         level="1" />
     
    8488                <field field_ref="reffclwmodis" level="1" />
    8589                <field field_ref="reffclimodis" level="1" />
    86                 <field field_ref="pctmodis"  unit="1" />
     90                <field field_ref="pctmodis"  level="1" />
    8791                <field field_ref="lwpmodis" level="1" />
    8892                <field field_ref="iwpmodis" level="1" />
  • LMDZ6/branches/DYNAMICO-conv/DefLists/file_def_histmth_lmdz.xml

    r3003 r3356  
    1111
    1212            <field_group operation="once">
     13              <field field_ref="io_lon" level="1" />
     14              <field field_ref="io_lat" level="1" />
    1315              <field field_ref="Ahyb" level="1" />
    1416              <field field_ref="Ahyb_inter" level="1" />
     
    4547                <field field_ref="flat"         level="5" />
    4648                <field field_ref="slp"          level="1" />
     49                <field field_ref="sza"          level="1" />
    4750                <field field_ref="ptstar"       level="1" />
    4851                <field field_ref="pt0"          level="1" />
     
    8992                <field field_ref="ndayrain" level="1" operation="instant" />
    9093                <field field_ref="precip"   level="1" />
     94                <field field_ref="rain_fall"   level="1" />
     95                <field field_ref="rain_con"   level="1" />
    9196                <field field_ref="plul"     level="1" />
    9297                <field field_ref="plun"     level="1" />
     
    154159                <field field_ref="fqcalving" level="1" />
    155160                <field field_ref="fqfonte" level="1" />
    156                 <field field_ref="runofflic" level="1" />
     161                <field field_ref="mrroli" level="1" />
     162                <field field_ref="runofflic" level="5" />
    157163                <field field_ref="taux" level="1" />
    158164                <field field_ref="tauy" level="1" />
     
    230236                <field field_ref="uq" level="1" />
    231237                <field field_ref="vq" level="1" />
     238                <field field_ref="uwat" level="1" />
     239                <field field_ref="vwat" level="1" />
    232240                <field field_ref="cape" level="1" />
    233241                <field field_ref="pbase" level="1" />
     
    258266                <field field_ref="proba_notrig" level="1" />
    259267                <field field_ref="random_notrig" level="1" />
     268                <field field_ref="cv_gen" level="1" />
    260269                <field field_ref="ale_bl_stat" level="1" />
    261270                <field field_ref="ale_bl_trig" level="1" />
     
    330339                <field field_ref="tpot" level="10" />
    331340                <field field_ref="tpote" level="10" />
    332                 <field field_ref="tke" level="4" />
     341                <field field_ref="tke" level="7" />
    333342                <field field_ref="tke_ter" level="10" />
    334343                <field field_ref="tke_lic" level="10" />
     
    348357                <field field_ref="l_mixmin_sic" level="10" />
    349358                <field field_ref="SWnetOR" level="10" />
    350                 <field field_ref="SWdownOR" level="10" />
    351359                <field field_ref="LWdownOR" level="10" />
    352360                <field field_ref="snowl" level="10" />
     
    360368                <field field_ref="z0m" level="10" />
    361369                <field field_ref="z0h" level="10" />
    362                 <field field_ref="topswad" level="5" />
    363                 <field field_ref="topswad0" level="5" />
    364                 <field field_ref="topswai" level="5" />
    365                 <field field_ref="solswad" level="5" />
    366                 <field field_ref="solswad0" level="5" />
    367                 <field field_ref="solswai" level="5" />
    368                 <field field_ref="toplwad" level="5" />
    369                 <field field_ref="toplwad0" level="5" />
    370                 <field field_ref="toplwai" level="5" />
    371                 <field field_ref="sollwad" level="5" />
    372                 <field field_ref="sollwad0" level="5" />
    373                 <field field_ref="sollwai" level="5" />
    374                 <field field_ref="od550_ASBCM" level="2" />
    375                 <field field_ref="od550_ASPOMM" level="2" />
    376                 <field field_ref="od550_ASSO4M" level="2" />
    377                 <field field_ref="od550_CSSO4M" level="2" />
    378                 <field field_ref="od550_SSSSM" level="2" />
    379                 <field field_ref="od550_ASSSM" level="2" />
    380                 <field field_ref="od550_CSSSM" level="2" />
    381                 <field field_ref="od550_CIDUSTM" level="2" />
    382                 <field field_ref="od550_AIBCM" level="2" />
    383                 <field field_ref="od550_AIPOMM" level="2" />
    384                 <field field_ref="od550_ASNO3M" level="2" />
    385                 <field field_ref="od550_CSNO3M" level="2" />
    386                 <field field_ref="od550_CINO3M" level="2" />
     370                <field field_ref="topswad" level="10" />
     371                <field field_ref="topswad0" level="10" />
     372                <field field_ref="topswai" level="10" />
     373                <field field_ref="solswad" level="10" />
     374                <field field_ref="solswad0" level="10" />
     375                <field field_ref="solswai" level="10" />
     376                <field field_ref="toplwad" level="10" />
     377                <field field_ref="toplwad0" level="10" />
     378                <field field_ref="toplwai" level="10" />
     379                <field field_ref="sollwad" level="10" />
     380                <field field_ref="sollwad0" level="10" />
     381                <field field_ref="sollwai" level="10" />
     382                <field field_ref="od550_ASBCM" level="7" />
     383                <field field_ref="od550_ASPOMM" level="7" />
     384                <field field_ref="od550_ASSO4M" level="7" />
     385                <field field_ref="od550_CSSO4M" level="7" />
     386                <field field_ref="od550_SSSSM" level="7" />
     387                <field field_ref="od550_ASSSM" level="7" />
     388                <field field_ref="od550_CSSSM" level="7" />
     389                <field field_ref="od550_CIDUSTM" level="7" />
     390                <field field_ref="od550_AIBCM" level="7" />
     391                <field field_ref="od550_AIPOMM" level="7" />
     392                <field field_ref="od550_ASNO3M" level="7" />
     393                <field field_ref="od550_CSNO3M" level="7" />
     394                <field field_ref="od550_CINO3M" level="7" />
    387395                <field field_ref="od550_STRAT" level="2" />
    388                 <field field_ref="dryod550_ASBCM" level="2" />
    389                 <field field_ref="dryod550_ASPOMM" level="2" />
    390                 <field field_ref="dryod550_ASSO4M" level="2" />
    391                 <field field_ref="dryod550_CSSO4M" level="2" />
    392                 <field field_ref="dryod550_SSSSM" level="2" />
    393                 <field field_ref="dryod550_ASSSM" level="2" />
    394                 <field field_ref="dryod550_CSSSM" level="2" />
    395                 <field field_ref="dryod550_CIDUSTM" level="2" />
    396                 <field field_ref="dryod550_AIBCM" level="2" />
    397                 <field field_ref="dryod550_AIPOMM" level="2" />
    398                 <field field_ref="dryod550_ASNO3M" level="2" />
    399                 <field field_ref="dryod550_CSNO3M" level="2" />
    400                 <field field_ref="dryod550_CINO3M" level="2" />
     396                <field field_ref="dryod550_ASBCM" level="7" />
     397                <field field_ref="dryod550_ASPOMM" level="7" />
     398                <field field_ref="dryod550_ASSO4M" level="7" />
     399                <field field_ref="dryod550_CSSO4M" level="7" />
     400                <field field_ref="dryod550_SSSSM" level="7" />
     401                <field field_ref="dryod550_ASSSM" level="7" />
     402                <field field_ref="dryod550_CSSSM" level="7" />
     403                <field field_ref="dryod550_CIDUSTM" level="7" />
     404                <field field_ref="dryod550_AIBCM" level="7" />
     405                <field field_ref="dryod550_AIPOMM" level="7" />
     406                <field field_ref="dryod550_ASNO3M" level="7" />
     407                <field field_ref="dryod550_CSNO3M" level="7" />
     408                <field field_ref="dryod550_CINO3M" level="7" />
    401409                <field field_ref="od550aer" level="2" />
    402410                <field field_ref="dryod550aer" level="2" />
     
    407415                <field field_ref="sconcoa" level="2" />
    408416                <field field_ref="sconcbc" level="2" />
    409                 <field field_ref="sconcss" level="2" />
    410                 <field field_ref="sconcdust" level="2" />
    411                 <field field_ref="sconcno3" level="2" />
    412                 <field field_ref="loadso4" level="2" />
    413                 <field field_ref="loadoa" level="2" />
    414                 <field field_ref="loadbc" level="2" />
    415                 <field field_ref="loadss" level="2" />
    416                 <field field_ref="loaddust" level="2" />
    417                 <field field_ref="loadno3" level="2" />
    418                 <field field_ref="swtoaas_nat" level="4" />
    419                 <field field_ref="swsrfas_nat" level="4" />
    420                 <field field_ref="swtoacs_nat" level="4" />
    421                 <field field_ref="swsrfcs_nat" level="4" />
    422                 <field field_ref="swtoaas_ant" level="4" />
    423                 <field field_ref="swsrfas_ant" level="4" />
    424                 <field field_ref="swtoacs_ant" level="4" />
    425                 <field field_ref="swsrfcs_ant" level="4" />
    426                 <field field_ref="swtoacf_nat" level="4" />
    427                 <field field_ref="swsrfcf_nat" level="4" />
    428                 <field field_ref="swtoacf_ant" level="4" />
    429                 <field field_ref="swsrfcf_ant" level="4" />
    430                 <field field_ref="swtoacf_zero" level="4" />
    431                 <field field_ref="swsrfcf_zero" level="4" />
    432                 <field field_ref="cldncl" level="2" />
    433                 <field field_ref="reffclwtop" level="2" />
    434                 <field field_ref="cldnvi" level="2" />
    435                 <field field_ref="lcc" level="2" />
     417                <field field_ref="sconcss" level="11" />
     418                <field field_ref="sconcdust" level="11" />
     419                <field field_ref="sconcno3" level="11" />
     420                <field field_ref="loadso4" level="11" />
     421                <field field_ref="loadoa" level="11" />
     422                <field field_ref="loadbc" level="11" />
     423                <field field_ref="loadss" level="11" />
     424                <field field_ref="loaddust" level="11" />
     425                <field field_ref="loadno3" level="11" />
     426                <field field_ref="swtoaas_nat" level="11" />
     427                <field field_ref="swsrfas_nat" level="11" />
     428                <field field_ref="swtoacs_nat" level="11" />
     429                <field field_ref="swsrfcs_nat" level="11" />
     430                <field field_ref="swtoaas_ant" level="11" />
     431                <field field_ref="swsrfas_ant" level="11" />
     432                <field field_ref="swtoacs_ant" level="11" />
     433                <field field_ref="swsrfcs_ant" level="11" />
     434                <field field_ref="swtoacf_nat" level="11" />
     435                <field field_ref="swsrfcf_nat" level="11" />
     436                <field field_ref="swtoacf_ant" level="11" />
     437                <field field_ref="swsrfcf_ant" level="11" />
     438                <field field_ref="swtoacf_zero" level="11" />
     439                <field field_ref="swsrfcf_zero" level="11" />
     440                <field field_ref="cldncl" level="11" />
     441                <field field_ref="reffclwtop" level="11" />
     442                <field field_ref="cldnvi" level="11" />
     443                <field field_ref="lcc" level="11" />
    436444                <field field_ref="wvapp" level="2" />
    437445                <field field_ref="ozone_daylight" level="2" />
     
    464472                <field field_ref="ftime_con" level="4" operation="instant" />
    465473                <field field_ref="wake_h" level="4" />
     474                <field field_ref="wake_dens" level="4" />
    466475                <field field_ref="wake_s" level="4" />
    467476                <field field_ref="epmax" level="2" />
     
    470479                <field field_ref="lmaxth" level="10" />
    471480                <field field_ref="ftime_th" level="4" />
     481                <field field_ref="ftime_deepcv" level="4" />
    472482                <field field_ref="f0_th" level="4" />
    473483                <field field_ref="zmax_th" level="4" />
    474                 <field field_ref="rsut4co2" level="5" />
    475                 <field field_ref="rlut4co2" level="5" />
    476                 <field field_ref="rsutcs4co2" level="5" />
    477                 <field field_ref="rlutcs4co2" level="5" />
     484                <field field_ref="rsut4co2" level="10" />
     485                <field field_ref="rlut4co2" level="10" />
     486                <field field_ref="rsutcs4co2" level="10" />
     487                <field field_ref="rlutcs4co2" level="10" />
    478488                <field field_ref="dqphy2d" level="2" />
    479489                <field field_ref="dqlphy2d" level="2" />
     
    507517                <field field_ref="concno3" level="2" />
    508518                <field field_ref="ec550aer" level="2" />
    509                 <field field_ref="lwcon" level="2" />
    510                 <field field_ref="iwcon" level="2" />
    511                 <field field_ref="temp" level="2" />
    512                 <field field_ref="theta" level="2" />
    513                 <field field_ref="ovap" level="2" />
    514                 <field field_ref="ovapinit" level="2" />
    515                 <field field_ref="oliq" level="2" />
    516                 <field field_ref="ocond" level="2" />
    517                 <field field_ref="geop" level="2" />
    518                 <field field_ref="vitu" level="2" />
    519                 <field field_ref="vitv" level="2" />
    520                 <field field_ref="vitw" level="2" />
    521                 <field field_ref="pres" level="2" />
    522                 <field field_ref="paprs" level="2" />
    523                 <field field_ref="mass" level="2" />
    524                 <field field_ref="zfull" level="2" />
    525                 <field field_ref="zhalf" level="2" />
    526                 <field field_ref="rneb" level="2" />
    527                 <field field_ref="rnebcon" level="2" />
    528                 <field field_ref="rnebls" level="2" />
    529                 <field field_ref="rneblsvol" level="2" />
    530                 <field field_ref="rhum" level="2" />
    531                 <field field_ref="ozone" level="2" />
    532                 <field field_ref="upwd" level="2" />
    533                 <field field_ref="ep" level="2" />
    534                 <field field_ref="duphy" level="2" />
    535                 <field field_ref="dtphy" level="2" />
    536                 <field field_ref="dqphy" level="2" />
    537                 <field field_ref="dqlphy" level="2" />
    538                 <field field_ref="dqsphy" level="2" />
    539                 <field field_ref="pr_con_l" level="2" />
    540                 <field field_ref="pr_con_i" level="2" />
    541                 <field field_ref="pr_lsc_l" level="2" />
    542                 <field field_ref="pr_lsc_i" level="2" />
     519                <field field_ref="lwcon" level="7" />
     520                <field field_ref="iwcon" level="7" />
     521                <field field_ref="temp" level="1" />
     522                <field field_ref="theta" level="3" />
     523                <field field_ref="ovap" level="1" />
     524                <field field_ref="ovapinit" level="10" />
     525                <field field_ref="oliq" level="1" />
     526                <field field_ref="ocond" level="1" />
     527                <field field_ref="geop" level="3" />
     528                <field field_ref="geoph" level="3" />
     529                <field field_ref="vitu" level="1" />
     530                <field field_ref="vitv" level="1" />
     531                <field field_ref="vitw" level="1" />
     532                <field field_ref="pres" level="1" />
     533                <field field_ref="paprs" level="3" />
     534                <field field_ref="mass" level="3" />
     535                <field field_ref="zfull" level="1" />
     536                <field field_ref="zhalf" level="7" />
     537                <field field_ref="rneb" level="1" />
     538                <field field_ref="rnebcon" level="7" />
     539                <field field_ref="rnebls" level="7" />
     540                <field field_ref="rneblsvol" level="7" />
     541                <field field_ref="rhum" level="1" />
     542                <field field_ref="ozone" level="3" />
     543                <field field_ref="upwd" level="7" />
     544                <field field_ref="ep" level="7" />
     545                <field field_ref="duphy" level="7" />
     546                <field field_ref="dtphy" level="7" />
     547                <field field_ref="dqphy" level="7" />
     548                <field field_ref="dqlphy" level="7" />
     549                <field field_ref="dqsphy" level="7" />
     550                <field field_ref="pr_con_l" level="3" />
     551                <field field_ref="pr_con_i" level="3" />
     552                <field field_ref="pr_lsc_l" level="3" />
     553                <field field_ref="pr_lsc_i" level="3" />
    543554                <field field_ref="re" level="5" />
    544555                <field field_ref="fl" level="5" />
    545                 <field field_ref="scdnc" level="2" />
    546                 <field field_ref="reffclws" level="2" />
    547                 <field field_ref="reffclwc" level="2" />
    548                 <field field_ref="lcc3d" level="2" />
    549                 <field field_ref="lcc3dcon" level="2" />
    550                 <field field_ref="lcc3dstra" level="2" />
    551                 <field field_ref="clwcon" level="4" />
    552                 <field field_ref="Ma" level="4" />
    553                 <field field_ref="dnwd" level="4" />
    554                 <field field_ref="dnwd0" level="4" />
    555                 <field field_ref="mc" level="4" />
    556                 <field field_ref="dtdyn" level="4" />
    557                 <field field_ref="dqdyn" level="4" />
    558                 <field field_ref="dqldyn" level="4" />
    559                 <field field_ref="dqsdyn" level="4" />
    560                 <field field_ref="dudyn" level="4" />
    561                 <field field_ref="dvdyn" level="4" />
    562                 <field field_ref="dtcon" level="4" />
    563                 <field field_ref="ducon" level="4" />
    564                 <field field_ref="dvcon" level="4" />
    565                 <field field_ref="dqcon" level="4" />
    566                 <field field_ref="dtwak" level="4" />
    567                 <field field_ref="dqwak" level="4" />
    568                 <field field_ref="wake_deltat" level="4" />
    569                 <field field_ref="wake_deltaq" level="4" />
    570                 <field field_ref="wake_omg" level="4" />
    571                 <field field_ref="wdtrainA" level="4" />
    572                 <field field_ref="wdtrainM" level="4" />
    573                 <field field_ref="Vprecip" level="10" />
    574                 <field field_ref="ftd" level="4" />
    575                 <field field_ref="fqd" level="4" />
    576                 <field field_ref="dtlsc" level="4" />
    577                 <field field_ref="dtlschr" level="4" />
    578                 <field field_ref="dqlsc" level="4" />
    579                 <field field_ref="beta_prec" level="4" />
    580                 <field field_ref="dtvdf" level="4" />
     556                <field field_ref="scdnc" level="11" />
     557                <field field_ref="reffclws" level="11" />
     558                <field field_ref="reffclwc" level="11" />
     559                <field field_ref="lcc3d" level="11" />
     560                <field field_ref="lcc3dcon" level="11" />
     561                <field field_ref="lcc3dstra" level="11" />
     562                <field field_ref="cldwatmxrat" level="5" />
     563                <field field_ref="icc3dcon" level="11" />
     564                <field field_ref="icc3dstra" level="11" />
     565                <field field_ref="cldicemxrat" level="5" />
     566                <field field_ref="clwcon" level="7" />
     567                <field field_ref="Ma" level="7" />
     568                <field field_ref="dnwd" level="7" />
     569                <field field_ref="dnwd0" level="7" />
     570                <field field_ref="mc" level="7" />
     571                <field field_ref="dtdyn" level="7" />
     572                <field field_ref="dqdyn" level="7" />
     573                <field field_ref="dqldyn" level="7" />
     574                <field field_ref="dqsdyn" level="7" />
     575                <field field_ref="dudyn" level="7" />
     576                <field field_ref="dvdyn" level="7" />
     577                <field field_ref="dtcon" level="7" />
     578                <field field_ref="ducon" level="7" />
     579                <field field_ref="dvcon" level="7" />
     580                <field field_ref="dqcon" level="7" />
     581                <field field_ref="dtwak" level="7" />
     582                <field field_ref="dqwak" level="7" />
     583                <field field_ref="wake_deltat" level="7" />
     584                <field field_ref="wake_deltaq" level="7" />
     585                <field field_ref="wake_omg" level="7" />
     586                <field field_ref="wdtrainA" level="9" />
     587                <field field_ref="wdtrainM" level="9" />
     588                <field field_ref="Vprecip" level="11" />
     589                <field field_ref="ftd" level="7" />
     590                <field field_ref="fqd" level="7" />
     591                <field field_ref="dtlsc" level="7" />
     592                <field field_ref="dtlschr" level="7" />
     593                <field field_ref="dqlsc" level="7" />
     594                <field field_ref="beta_prec" level="9" />
     595                <field field_ref="dtvdf" level="7" />
    581596                <field field_ref="dtvdf_x" level="11" />
    582597                <field field_ref="dtvdf_w" level="11" />
    583                 <field field_ref="dtdis" level="4" />
    584                 <field field_ref="dqvdf" level="4" />
     598                <field field_ref="dtdis" level="7" />
     599                <field field_ref="dqvdf" level="7" />
    585600                <field field_ref="dqvdf_x" level="11" />
    586601                <field field_ref="dqvdf_w" level="11" />
    587                 <field field_ref="dteva" level="4" />
    588                 <field field_ref="dqeva" level="4" />
     602                <field field_ref="dteva" level="7" />
     603                <field field_ref="dqeva" level="7" />
    589604                <field field_ref="dqlscth" level="10" />
    590605                <field field_ref="dqlscst" level="10" />
    591606                <field field_ref="dtlscth" level="10" />
    592607                <field field_ref="dtlscst" level="10" />
    593                 <field field_ref="ptconvth" level="10" />
    594                 <field field_ref="ptconv" level="4" />
    595                 <field field_ref="ratqs" level="4" />
    596                 <field field_ref="dtthe" level="4" />
    597                 <field field_ref="f_th" level="4" />
    598                 <field field_ref="e_th" level="4" />
    599                 <field field_ref="w_th" level="4" />
     608                <field field_ref="ptconvth" level="7" />
     609                <field field_ref="ptconv" level="7" />
     610                <field field_ref="ratqs" level="7" />
     611                <field field_ref="dtthe" level="7" />
     612                <field field_ref="f_th" level="7" />
     613                <field field_ref="e_th" level="9" />
     614                <field field_ref="w_th" level="7" />
    600615                <field field_ref="lambda_th" level="10" />
    601                 <field field_ref="q_th" level="4" />
    602                 <field field_ref="a_th" level="4" />
    603                 <field field_ref="s_th" level="4" />
    604                 <field field_ref="s_env" level="4" />
    605                 <field field_ref="sigma_th" level="4" />
    606                 <field field_ref="sigma_env" level="4" />
    607                 <field field_ref="d_th" level="4" />
    608                 <field field_ref="dqthe" level="4" />
    609                 <field field_ref="dtajs" level="4" />
    610                 <field field_ref="dqajs" level="4" />
    611                 <field field_ref="dtswr" level="4" />
    612                 <field field_ref="dtsw0" level="4" />
    613                 <field field_ref="dtlwr" level="4" />
    614                 <field field_ref="dtlw0" level="4" />
    615                 <field field_ref="dtec"  level="4" />
    616                 <field field_ref="duvdf" level="4" />
    617                 <field field_ref="dvvdf" level="4" />
    618                 <field field_ref="duoro" level="4" />
    619                 <field field_ref="dvoro" level="4" />
    620                 <field field_ref="dulif" level="4" />
    621                 <field field_ref="dvlif" level="4" />
    622                 <field field_ref="du_gwd_hines" level="4" />
    623                 <field field_ref="dv_gwd_hines" level="4" />
    624                 <field field_ref="du_gwd_front" level="4" />
    625                 <field field_ref="dv_gwd_front" level="4" />
    626                 <field field_ref="east_gwstress" level="4" />
    627                 <field field_ref="west_gwstress" level="4" />
    628                 <field field_ref="dtoro" level="4" />
    629                 <field field_ref="dtlif" level="4" />
    630                 <field field_ref="dthin" level="4" />
    631                 <field field_ref="rsu" level="4" />
    632                 <field field_ref="rsd" level="4" />
    633                 <field field_ref="rlu" level="4" />
    634                 <field field_ref="rld" level="4" />
    635                 <field field_ref="rsucs" level="4" />
    636                 <field field_ref="rsdcs" level="4" />
    637                 <field field_ref="rlucs" level="4" />
    638                 <field field_ref="rldcs" level="4" />
    639                 <field field_ref="tnt"  level="4" />
    640                 <field field_ref="tntc" level="4" />
    641                 <field field_ref="tntr" level="4" />
    642                 <field field_ref="tntscpbl" level="4" />
    643                 <field field_ref="tnhus"    level="4" />
    644                 <field field_ref="tnhusc"   level="4" />
    645                 <field field_ref="tnhusscpbl" level="4" />
    646                 <field field_ref="evu" level="4" />
    647                 <field field_ref="h2o" level="4" />
    648                 <field field_ref="mcd" level="4" />
    649                 <field field_ref="dmc" level="4" />
    650                 <field field_ref="ref_liq" level="4" />
    651                 <field field_ref="ref_ice" level="4" />
    652                 <field field_ref="rsu4co2" level="5" />
    653                 <field field_ref="rlu4co2" level="5" />
    654                 <field field_ref="rsucs4co2" level="5" />
    655                 <field field_ref="rlucs4co2" level="5" />
    656                 <field field_ref="rsd4co2" level="5" />
    657                 <field field_ref="rld4co2" level="5" />
    658                 <field field_ref="rsdcs4co2" level="5" />
    659                 <field field_ref="rldcs4co2" level="5" />
     616                <field field_ref="q_th" level="9" />
     617                <field field_ref="a_th" level="9" />
     618                <field field_ref="s_th" level="9" />
     619                <field field_ref="s_env" level="9" />
     620                <field field_ref="sigma_th" level="9" />
     621                <field field_ref="sigma_env" level="9" />
     622                <field field_ref="d_th" level="9" />
     623                <field field_ref="dqthe" level="7" />
     624                <field field_ref="dtajs" level="7" />
     625                <field field_ref="dqajs" level="7" />
     626                <field field_ref="dtswr" level="7" />
     627                <field field_ref="dtsw0" level="7" />
     628                <field field_ref="dtlwr" level="7" />
     629                <field field_ref="dtlw0" level="7" />
     630                <field field_ref="dtec"  level="7" />
     631                <field field_ref="duvdf" level="7" />
     632                <field field_ref="dvvdf" level="7" />
     633                <field field_ref="duoro" level="7" />
     634                <field field_ref="dvoro" level="7" />
     635                <field field_ref="dulif" level="7" />
     636                <field field_ref="dvlif" level="7" />
     637                <field field_ref="du_gwd_hines" level="7" />
     638                <field field_ref="dv_gwd_hines" level="7" />
     639                <field field_ref="du_gwd_front" level="7" />
     640                <field field_ref="dv_gwd_front" level="7" />
     641                <field field_ref="east_gwstress" level="10" />
     642                <field field_ref="west_gwstress" level="10" />
     643                <field field_ref="dtoro" level="10" />
     644                <field field_ref="dtlif" level="7" />
     645                <field field_ref="dthin" level="7" />
     646                <field field_ref="rsu" level="5" />
     647                <field field_ref="rsd" level="10" />
     648                <field field_ref="rlu" level="10" />
     649                <field field_ref="rld" level="10" />
     650                <field field_ref="rsucs" level="10" />
     651                <field field_ref="rsdcs" level="10" />
     652                <field field_ref="rlucs" level="10" />
     653                <field field_ref="rldcs" level="10" />
     654                <field field_ref="tnt"  level="10" />
     655                <field field_ref="tntc" level="10" />
     656                <field field_ref="tntr" level="10" />
     657                <field field_ref="tntscpbl" level="10" />
     658                <field field_ref="tnhus"    level="10" />
     659                <field field_ref="tnhusc"   level="10" />
     660                <field field_ref="tnhusscpbl" level="10" />
     661                <field field_ref="evu" level="10" />
     662                <field field_ref="h2o" level="10" />
     663                <field field_ref="mcd" level="10" />
     664                <field field_ref="dmc" level="10" />
     665                <field field_ref="ref_liq" level="5" />
     666                <field field_ref="ref_ice" level="10" />
     667                <field field_ref="rsu4co2" level="10" />
     668                <field field_ref="rlu4co2" level="10" />
     669                <field field_ref="rsucs4co2" level="10" />
     670                <field field_ref="rlucs4co2" level="10" />
     671                <field field_ref="rsd4co2" level="10" />
     672                <field field_ref="rld4co2" level="10" />
     673                <field field_ref="rsdcs4co2" level="10" />
     674                <field field_ref="rldcs4co2" level="10" />
     675            </field_group>
     676
     677            <!-- VARS 3D -->
     678            <field_group operation="average" freq_op="1ts" grid_ref="grid_glo_spectband">
     679                <field field_ref="solbnd" level="10" />
    660680            </field_group>
    661681
  • LMDZ6/branches/DYNAMICO-conv/DefLists/file_def_histstn_lmdz.xml

    r2995 r3356  
    1818                <field field_ref="flat" level="10" />
    1919                <field field_ref="slp" level="10" />
     20                <field field_ref="sza" level="10" />
    2021                <field field_ref="ptstar" level="10" />
    2122                <field field_ref="pt0" level="10" />
     
    5859                <field field_ref="ndayrain" level="10" operation="instant" />
    5960                <field field_ref="precip" level="10" />
     61                <field field_ref="rain_fall" level="10" />
     62                <field field_ref="rain_con" level="10" />
    6063                <field field_ref="plul" level="10" />
    6164                <field field_ref="plun" level="10" />
     
    123126                <field field_ref="fqcalving" level="10" />
    124127                <field field_ref="fqfonte" level="10" />
     128                <field field_ref="mrroli" level="10" />
    125129                <field field_ref="runofflic" level="10" />
    126130                <field field_ref="taux" level="10" />
     
    227231                <field field_ref="proba_notrig" level="10" />
    228232                <field field_ref="random_notrig" level="10" />
     233                <field field_ref="cv_gen" level="10" />
    229234                <field field_ref="ale_bl_stat" level="10" />
    230235                <field field_ref="ale_bl_trig" level="10" />
     
    315320                <field field_ref="l_mixmin_sic" level="10" />
    316321                <field field_ref="SWnetOR" level="10" />
    317                 <field field_ref="SWdownOR" level="10" />
    318322                <field field_ref="LWdownOR" level="10" />
    319323                <field field_ref="snowl" level="10" />
     
    411415                <field field_ref="ftime_con" level="10" operation="instant" />
    412416                <field field_ref="wake_h" level="10" />
     417                <field field_ref="wake_dens" level="10" />
    413418                <field field_ref="wake_s" level="10" />
    414419                <field field_ref="epmax" level="10" />
     
    417422                <field field_ref="lmaxth" level="10" />
    418423                <field field_ref="ftime_th" level="10" />
     424                <field field_ref="ftime_deepcv" level="10" />
    419425                <field field_ref="f0_th" level="10" />
    420426                <field field_ref="zmax_th" level="10" />
     
    463469                <field field_ref="ocond" level="10" />
    464470                <field field_ref="geop" level="10" />
     471                <field field_ref="geoph" level="10" />
    465472                <field field_ref="vitu" level="10" />
    466473                <field field_ref="vitv" level="10" />
     
    496503                <field field_ref="lcc3dcon" level="10" />
    497504                <field field_ref="lcc3dstra" level="10" />
     505                <field field_ref="cldwatmxrat" level="10" />
     506                <field field_ref="icc3dcon" level="10" />
     507                <field field_ref="icc3dstra" level="10" />
     508                <field field_ref="cldicemxrat" level="10" />
    498509                <field field_ref="clwcon" level="10" />
    499510                <field field_ref="Ma" level="10" />
  • LMDZ6/branches/DYNAMICO-conv/DefLists/output.def

    r1907 r3356  
    546546flag_SWnetOR      =  10, 10, 2, 10, 10   
    547547name_SWnetOR      =  SWnetOR
    548 # Sfce incident SW radiation OR
    549 flag_SWdownOR     =  10, 10, 2, 10, 10   
    550 name_SWdownOR     =  SWdownOR
    551548# Sfce incident LW radiation OR
    552549flag_LWdownOR     =  10, 10, 2, 10, 10   
  • LMDZ6/branches/DYNAMICO-conv/arch/arch-ES_MOON.fcm

    r1907 r3356  
    22%LINK                esmpif90
    33%AR                  esar
     4%ARFLAGS             rs
    45%MAKE                gmake
    56%FPP_FLAGS           -P -traditional
  • LMDZ6/branches/DYNAMICO-conv/arch/arch-IA64_PLATINE.fcm

    r1907 r3356  
    22%LINK                mpif90
    33%AR                  ar
     4%ARFLAGS             rs
    45%MAKE                gmake
    56%FPP_FLAGS           -P -traditional
  • LMDZ6/branches/DYNAMICO-conv/arch/arch-PW6_VARGAS.fcm

    r1907 r3356  
    22%LINK                mpxlf_r
    33%AR                  ar
     4%ARFLAGS             rs
    45%MAKE                gmake
    56%FPP_FLAGS           -P -I/usr/local/pub/FFTW/3.2/include
  • LMDZ6/branches/DYNAMICO-conv/arch/arch-SX8_BRODIE.fcm

    r1907 r3356  
    22%LINK                sxmpif90
    33%AR                  sxar
     4%ARFLAGS             rs
    45%MAKE                sxgmake
    56%FPP_FLAGS           -P -traditional
  • LMDZ6/branches/DYNAMICO-conv/arch/arch-SX8_MERCURE.fcm

    r1907 r3356  
    22%LINK                sxmpif90
    33%AR                  sxar
     4%ARFLAGS             rs
    45%MAKE                make
    56%FPP_FLAGS           -P -traditional
  • LMDZ6/branches/DYNAMICO-conv/arch/arch-SX9_MERCURE.fcm

    r1907 r3356  
    22%LINK                sxmpif90
    33%AR                  sxar
     4%ARFLAGS             rs
    45%MAKE                make
    56%FPP_FLAGS           -P -traditional
  • LMDZ6/branches/DYNAMICO-conv/arch/arch-X64_ADA.fcm

    r2774 r3356  
    22%LINK                mpiifort
    33%AR                  ar
     4%ARFLAGS             rs
    45%MAKE                gmake
    56%FPP_FLAGS           -P -traditional -I/smplocal/pub/FFTW/3.3.3_dyn/include/
  • LMDZ6/branches/DYNAMICO-conv/arch/arch-X64_CURIE.fcm

    r2270 r3356  
    22%LINK                mpif90
    33%AR                  ar
     4%ARFLAGS             rs
    45%MAKE                gmake
    56%FPP_FLAGS           -P -traditional
    67%FPP_DEF             NC_DOUBLE FFT_MKL
    78#%BASE_FFLAGS        -recursive -xHost -i4 -r8 -auto -align all -I$(MKL_INC_DIR) -I$(MKL_INC_DIR)/intel64/lp64
    8 %BASE_FFLAGS         -i4 -r8 -auto -align all -I$(MKL_INC_DIR) -I$(MKL_INC_DIR)/intel64/lp64 -fp-model strict
    9 %PROD_FFLAGS         -O2
    10 %DEV_FFLAGS          -p -g -O2 -traceback -fp-stack-check
    11 %DEBUG_FFLAGS        -p -g -traceback -fp-stack-check -ftrapuv
     9%BASE_FFLAGS         -i4 -r8 -auto -align all -I$(MKL_INC_DIR) -I$(MKL_INC_DIR)/intel64/lp64
     10%PROD_FFLAGS         -O3 -axAVX,SSE4.2 -fp-model fast=2
     11%DEV_FFLAGS          -fp-model strict -p -g -O2 -traceback -fp-stack-check
     12%DEBUG_FFLAGS        -fp-model strict -p -g -traceback -fp-stack-check -ftrapuv
    1213%MPI_FFLAGS
    1314%OMP_FFLAGS          -openmp
  • LMDZ6/branches/DYNAMICO-conv/arch/arch-X64_OCCIGEN.fcm

    r2439 r3356  
    22%LINK                mpif90
    33%AR                  ar
     4%ARFLAGS             rs
    45%MAKE                gmake
    56%FPP_FLAGS           -P -traditional
  • LMDZ6/branches/DYNAMICO-conv/arch/arch-X64_TITANE.fcm

    r1907 r3356  
    22%LINK                mpif90
    33%AR                  ar
     4%ARFLAGS             rs
    45%MAKE                gmake
    56%FPP_FLAGS           -P -traditional
  • LMDZ6/branches/DYNAMICO-conv/arch/arch-g95.fcm

    r1907 r3356  
    22%LINK                g95
    33%AR                  ar
     4%ARFLAGS             rs
    45%MAKE                make
    56%FPP_FLAGS           -P -traditional
  • LMDZ6/branches/DYNAMICO-conv/arch/arch-gfortran.fcm

    r2270 r3356  
    22%LINK                gfortran
    33%AR                  ar
     4%ARFLAGS             rs
    45%MAKE                make
    56%FPP_FLAGS           -P -traditional
  • LMDZ6/branches/DYNAMICO-conv/arch/arch-gfortran_CICLAD.fcm

    r2270 r3356  
    1 %COMPILER            /usr/lib64/openmpi/1.4.5-gfortran/bin/mpif90
    2 %LINK                /usr/lib64/openmpi/1.4.5-gfortran/bin/mpif90
     1%COMPILER            $MPI_BIN/mpif90
     2%LINK                $MPI_BIN/mpif90
    33%AR                  ar
     4%ARFLAGS             rs
    45%MAKE                gmake
    56%FPP_FLAGS           -P -traditional
    67%FPP_DEF             NC_DOUBLE
    7 %BASE_FFLAGS         -c -fdefault-real-8 -fcray-pointer -frecursive
     8%BASE_FFLAGS         -c -fdefault-real-8 -fcray-pointer -frecursive -ffree-line-length-0 -fno-align-commons
    89%PROD_FFLAGS         -O3
    910%DEV_FFLAGS          -O -Wall -fbounds-check
    10 %DEBUG_FFLAGS        -ffpe-trap=invalid,zero,overflow -Wall -fbounds-check -g3 -O0 -fstack-protector-all
     11%DEBUG_FFLAGS        -ffpe-trap=invalid,zero,overflow -Wall -fbounds-check -g3 -O0 -fstack-protector-all -fbacktrace
    1112%MPI_FFLAGS
    1213%OMP_FFLAGS          -fopenmp
    13 %BASE_LD             -Wl,-rpath=/opt/netcdf42/gfortran/lib
     14%BASE_LD             -Wl,-rpath=$NETCDF_HOME/lib
    1415%MPI_LD
    1516%OMP_LD              -fopenmp
  • LMDZ6/branches/DYNAMICO-conv/arch/arch-gfortran_CICLAD.path

    r2437 r3356  
    1 NETCDF_LIBDIR="-L/opt/netcdf42/gfortran/lib -lnetcdf -lnetcdff"
    2 NETCDF_INCDIR=-I/opt/netcdf42/gfortran/include
     1NETCDF_LIBDIR="-L${NETCDF_HOME}/lib -lnetcdf -lnetcdff"
     2NETCDF_INCDIR=-I${NETCDF_HOME}/include
    33IOIPSL_INCDIR=$LMDGCM/../../lib
    44IOIPSL_LIBDIR=$LMDGCM/../../lib
  • LMDZ6/branches/DYNAMICO-conv/arch/arch-ifort_CICLAD.fcm

    r2439 r3356  
    1 %COMPILER            /usr/lib64/openmpi/1.4.5-ifort/bin/mpif90
    2 %LINK                /usr/lib64/openmpi/1.4.5-ifort/bin/mpif90
     1%COMPILER            $MPI_BIN/mpif90
     2%LINK                $MPI_BIN/mpif90
    33%AR                  ar
     4%ARFLAGS             rs
    45%MAKE                make
    56%FPP_FLAGS           -P -traditional
     
    910%DEV_FFLAGS          -p -g -O1 -fpe0 -traceback
    1011%DEBUG_FFLAGS        -p -g -O0 -fpe-all=0 -traceback -ftrapuv -fp-stack-check -check bounds,format,output_conversion,pointers,uninit -debug
    11 %MPI_FFLAGS          -I/usr/lib64/openmpi/1.4.5-ifort/include
     12%MPI_FFLAGS         
    1213%OMP_FFLAGS          -openmp
    13 %BASE_LD             -Wl,-rpath=/opt/netcdf42/ifort/lib
    14 %MPI_LD              -L/usr/lib64/openmpi/1.4.5-ifort/lib -lmpi -L/opt/intel/composer_xe_2011_sp1.9.293/mkl/lib/intel64 -lmkl_intel_lp64 -lmkl_sequential -lmkl_core
     14%BASE_LD             -Wl,-rpath=$NETCDF_HOME/lib -L/opt/intel/composer_xe_2011_sp1.9.293/mkl/lib/intel64 -lmkl_intel_lp64 -lmkl_sequential -lmkl_core
     15%MPI_LD             
    1516%OMP_LD              -openmp
  • LMDZ6/branches/DYNAMICO-conv/arch/arch-ifort_CICLAD.path

    r2437 r3356  
    1 NETCDF_LIBDIR="-L/opt/netcdf42/ifort/lib -lnetcdf -lnetcdff"
    2 NETCDF_INCDIR=-I/opt/netcdf42/ifort/include
     1NETCDF_LIBDIR="-L${NETCDF_HOME}/lib -lnetcdf -lnetcdff"
     2NETCDF_INCDIR=-I${NETCDF_HOME}/include
    33IOIPSL_INCDIR=$LMDGCM/../../lib
    44IOIPSL_LIBDIR=$LMDGCM/../../lib
  • LMDZ6/branches/DYNAMICO-conv/arch/arch-ifort_LSCE.fcm

    r1907 r3356  
    22%LINK                mpif90
    33%AR                  ar
     4%ARFLAGS             rs
    45%MAKE                gmake
    56%FPP_FLAGS           -P -traditional
  • LMDZ6/branches/DYNAMICO-conv/arch/arch-linux-32bit.fcm

    r1907 r3356  
    22%LINK                pgf95
    33%AR                  ar
     4%ARFLAGS             rs
    45%MAKE                make
    56%FPP_FLAGS           -P -traditional
  • LMDZ6/branches/DYNAMICO-conv/bld.cfg

    r2755 r3356  
    5555bld::tool::ld        %LINK
    5656bld::tool::ar        %AR
     57bld::tool::arflags   %ARFLAGS
    5758bld::tool::make      %MAKE
    5859bld::tool::fflags    %FFLAGS %INCDIR
  • LMDZ6/branches/DYNAMICO-conv/create_make_gcm

    r2326 r3356  
    6868echo 'L_MISC    = -lmisc'
    6969echo 'L_ADJNT    ='
    70 echo 'L_COSP     = -lcosp'
    7170
    7271echo
     
    7877   echo 'COMPILE90 = $(F90) $(OPTIM90) $(INCLUDE) -c'
    7978   echo 'COMPTRU90 = $(F90) $(OPTIMTRU90) $(INCLUDE) -c'
    80    echo "LINK    = $LINK"
    81    echo "AR      = $AR"
     79   echo 'LINK    = $(LINK)'
     80   echo 'AR      = $(AR)'
     81   echo 'ARFLAGS   = $(ARFLAGS)'
    8282echo
    8383echo
     
    9797echo '  cd $(LOCAL_DIR); \'
    9898echo '  $(COMPILE90) $(LIBF)/$(DIRMAIN)/$(SOURCE) -o $(PROG).o ; \'
    99 echo '  $(LINK) $(PROG).o -L$(LIBO) $(L_DYN) $(L_DYN_PHY) $(L_ADJNT) $(L_COSP) $(L_PHY) $(L_DYN) $(L_DYN3D_COMMON) $(L_MISC) $(L_DYN3D_COMMON) $(L_PHY) $(L_DYN_PHY) $(L_DYN) $(L_FILTRE) $(OPLINK) $(OPTION_LINK) -o $(LOCAL_DIR)/$(PROG).e ; $(RM) $(PROG).o '
     99echo '  $(LINK) $(PROG).o -L$(LIBO) $(L_DYN) $(L_DYN_PHY) $(L_ADJNT) $(L_PHY) $(L_DYN) $(L_DYN3D_COMMON) $(L_MISC) $(L_DYN3D_COMMON) $(L_PHY) $(L_DYN_PHY) $(L_DYN) $(L_FILTRE) $(OPLINK) $(OPTION_LINK) -o $(LOCAL_DIR)/$(PROG).e ; $(RM) $(PROG).o '
    100100echo
    101101echo 'phys : $(LIBPHY)'
     
    112112echo
    113113echo 'adjnt : $(LIBO)/libadjnt.a'
    114 echo
    115 echo 'cosp : $(LIBO)/libcosp.a'
    116114echo
    117115echo '$(FILTRE)3d : $(LIBO)/lib$(FILTRE).a'
     
    229227         # object from library
    230228         echo ' cd $(LIBO); \'
    231          echo ' $(AR) d $(LIBO)/lib'$topdiri'.a '$fili'.o ; \'
     229         echo ' $(AR) -d $(LIBO)/lib'$topdiri'.a '$fili'.o ; \'
    232230         if [ "$F90" -eq '0' ] ; then
    233231         ## Fixed Form Fortran 77
     
    243241         fi
    244242         # Put generated object in library
    245          echo ' $(AR) r $(LIBO)/lib'$topdiri'.a '$fili'.o ; $(RM) '$fili'.o ; \'
     243         echo ' $(AR) $(ARFLAGS) $(LIBO)/lib'$topdiri'.a '$fili'.o ; $(RM) '$fili'.o ; \'
    246244         echo
    247245      done
  • LMDZ6/branches/DYNAMICO-conv/libf/dyn3d/guide_mod.F90

    • Property svn:executable deleted
  • LMDZ6/branches/DYNAMICO-conv/libf/dyn3d/ini_paramLMDZ_dyn.h

    • Property svn:executable deleted
  • LMDZ6/branches/DYNAMICO-conv/libf/dyn3d/write_paramLMDZ_dyn.h

    • Property svn:executable deleted
  • LMDZ6/branches/DYNAMICO-conv/libf/dyn3d_common/invert_lat.F90

    • Property svn:executable deleted
  • LMDZ6/branches/DYNAMICO-conv/libf/dyn3dpar/guide_p_mod.F90

    • Property svn:executable deleted
  • LMDZ6/branches/DYNAMICO-conv/libf/dynphy_lonlat/phylmd/iniphysiq_mod.F90

    r3326 r3356  
    4646  USE ioipsl_getin_p_mod, ONLY: getin_p
    4747  USE slab_heat_transp_mod, ONLY: ini_slab_transp_geom
     48#ifdef REPROBUS
     49  USE CHEM_REP, ONLY : Init_chem_rep_phys
     50#endif
    4851  IMPLICIT NONE
    4952
     
    178181          rlonudyn,rlatudyn,rlonvdyn,rlatvdyn)
    179182#endif
     183    IF (type_trac == 'repr') THEN
     184#ifdef REPROBUS
     185       CALL Init_chem_rep_phys(klon_omp,nbp_lev)
     186#endif
     187    END IF
    180188  END IF
    181189
  • LMDZ6/branches/DYNAMICO-conv/libf/dynphy_lonlat/phylmd/limit_netcdf.F90

    r2947 r3356  
    2727  USE init_ssrf_m,        ONLY: start_init_subsurf
    2828
    29   CHARACTER(LEN=20), PARAMETER :: &
     29  INTEGER,           PARAMETER :: ns=256
     30  CHARACTER(LEN=ns), PARAMETER :: &
    3031  fsst(5)=['amipbc_sst_1x1.nc   ','amip_sst_1x1.nc     ','cpl_atm_sst.nc      '&
    31           ,'histmth_sst.nc      ','sstk.nc             ']
    32   CHARACTER(LEN=20), PARAMETER :: &
     32          ,'histmth_sst.nc      ','sstk.nc             '],                     &
    3333  fsic(5)=['amipbc_sic_1x1.nc   ','amip_sic_1x1.nc     ','cpl_atm_sic.nc      '&
    34           ,'histmth_sic.nc      ','ci.nc               ']
    35   CHARACTER(LEN=10), PARAMETER :: &
     34          ,'histmth_sic.nc      ','ci.nc               '],                     &
    3635  vsst(5)=['tosbcs    ','tos       ','SISUTESW  ','tsol_oce  ','sstk      '],  &
    37   vsic(5)=['sicbcs    ','sic       ','SIICECOV  ','pourc_sic ','ci        ']
    38   CHARACTER(LEN=10), PARAMETER :: &
    39   frugo='Rugos.nc  ', falbe='Albedo.nc ', frelf='Relief.nc ',    &
    40    vrug='RUGOS     ',  valb='ALBEDO    ',  vrel='RELIEF    '
     36  vsic(5)=['sicbcs    ','sic       ','SIICECOV  ','pourc_sic ','ci        '],  &
     37  frugo='Rugos.nc  ', falbe='Albedo.nc ', frelf='Relief.nc ',                  &
     38   vrug='RUGOS     ',  valb='ALBEDO    ',  vrel='RELIEF    ',                  &
     39  DegK(11)=['degK          ','degree_K      ','degreeK       ','deg_K         '&
     40           ,'degsK         ','degrees_K     ','degreesK      ','degs_K        '&
     41           ,'degree_kelvin ','degrees_kelvin','K             '],               &
     42  DegC(10)=['degC          ','degree_C      ','degreeC       ','deg_C         '&
     43           ,'degsC         ','degrees_C     ','degreesC      ','degs_C        '&
     44           ,'degree_Celsius','celsius       '], &
     45  Perc(2) =['%             ','percent       '], &
     46  Frac(2) =['1.0           ','1             ']
    4147
    4248CONTAINS
     
    8692  include "comgeom2.h"
    8793
    88 !--- INPUT NETCDF FILES NAMES --------------------------------------------------
    89   CHARACTER(LEN=20) :: icefile, sstfile, dumstr, fnam
    90   CHARACTER(LEN=10) :: varname
     94!--- INPUT NETCDF FILES AND VARIABLES NAMES ------------------------------------
     95  CHARACTER(LEN=ns) :: icefile, sstfile, fnam, varname
    9196
    9297!--- OUTPUT VARIABLES FOR NETCDF FILE ------------------------------------------
    93   REAL               :: fi_ice(klon), verif(klon)
     98  REAL               :: fi_ice(klon)
    9499  REAL, POINTER      :: phy_rug(:,:)=>NULL(), phy_ice(:,:)=>NULL()
    95100  REAL, POINTER      :: phy_sst(:,:)=>NULL(), phy_alb(:,:)=>NULL()
     
    98103
    99104!--- VARIABLES FOR OUTPUT FILE WRITING -----------------------------------------
    100   INTEGER :: ierr, nid, ndim, ntim, k, dims(2), ix_sic, ix_sst
     105  INTEGER :: nid, ndim, ntim, k, dims(2), ix_sic, ix_sst
    101106  INTEGER :: id_tim,  id_SST,  id_BILS, id_RUG, id_ALB
    102107  INTEGER :: id_FOCE, id_FSIC, id_FTER, id_FLIC, varid_longitude, varid_latitude
    103108  INTEGER :: NF90_FORMAT
    104109  INTEGER :: ndays                   !--- Depending on the output calendar
    105   CHARACTER(LEN=256) :: str
     110  CHARACTER(LEN=ns) :: str
    106111
    107112!--- INITIALIZATIONS -----------------------------------------------------------
     
    336341! Arguments:
    337342  CHARACTER(LEN=*),  INTENT(IN)     :: fnam     ! NetCDF file name
    338   CHARACTER(LEN=10), INTENT(IN)     :: varname  ! NetCDF variable name
    339   CHARACTER(LEN=3),  INTENT(IN)     :: mode     ! RUG, SIC, SST or ALB
     343  CHARACTER(LEN=*), INTENT(IN)     :: varname  ! NetCDF variable name
     344  CHARACTER(LEN=*),  INTENT(IN)     :: mode     ! RUG, SIC, SST or ALB
    340345  INTEGER,           INTENT(IN)     :: ndays    ! current year number of days
    341346  REAL,    POINTER,  DIMENSION(:, :) :: champo  ! output field = f(t)
     
    346351!--- NetCDF
    347352  INTEGER           :: ncid, varid        ! NetCDF identifiers
    348   CHARACTER(LEN=30) :: dnam               ! dimension name
     353  CHARACTER(LEN=ns) :: dnam               ! dimension name
    349354!--- dimensions
    350355  INTEGER           :: dids(4)            ! NetCDF dimensions identifiers
     
    360365  REAL, ALLOCATABLE :: champan(:,:,:)
    361366!--- input files
    362   CHARACTER(LEN=20) :: fnam_m, fnam_p     ! previous/next files names
    363   CHARACTER(LEN=20) :: cal_in             ! calendar
    364   CHARACTER(LEN=20) :: unit_sic           ! attribute "units" in sea-ice file
    365   CHARACTER(LEN=20) :: unit_sst           ! attribute "units" in sst     file
     367  CHARACTER(LEN=ns) :: fnam_m, fnam_p     ! previous/next files names
     368  CHARACTER(LEN=ns) :: cal_in             ! calendar
     369  CHARACTER(LEN=ns) :: units              ! attribute "units" in sic/sst file
    366370  INTEGER           :: ndays_in           ! number of days
     371  REAL              :: value              ! mean/max value near equator
    367372!--- misc
    368   INTEGER           :: i, j, k, l, ll     ! loop counters
     373  INTEGER           :: i, j, k, l         ! loop counters
    369374  REAL, ALLOCATABLE :: work(:,:)          ! used for extrapolation
    370   CHARACTER(LEN=128):: title, mess        ! for messages
     375  CHARACTER(LEN=ns) :: title, mess        ! for messages
    371376  LOGICAL           :: is_bcs             ! flag for BCS data
    372377  LOGICAL           :: extrp              ! flag for extrapolation
     378  LOGICAL           :: ll
    373379  REAL              :: chmin, chmax, timeday, al
    374380  INTEGER ierr, idx
     
    395401  CALL ncerr(NF90_INQ_VARID(ncid, trim(varname), varid),fnam)
    396402  CALL ncerr(NF90_INQUIRE_VARIABLE(ncid, varid, dimids=dids),fnam)
    397 
    398 !--- Read unit for sea-ice and sst only
    399   IF (mode=='SIC') THEN
    400     ierr=NF90_GET_ATT(ncid, varid, 'units', unit_sic); CALL strclean(unit_sic)
    401     IF(ierr/=NF90_NOERR) THEN; unit_sic='%'
    402       CALL msg(0,'No unit in sea-ice file. Take percentage as default value')
    403     ELSE IF(TRIM(unit_sic)=="%") THEN
    404       CALL msg(0,'Sea-ice cover is a PERCENTAGE.')
    405     ELSE IF(ANY(unit_sic==["1.0","1  "])) THEN; unit_sic="1"
    406       CALL msg(0,'Sea-ice cover is a FRACTION.')
    407     ELSE
    408       CALL abort_physic('SIC','Unrecognized sea-ice unit: '//TRIM(unit_sic),1)
    409     END IF
    410   END IF
    411   IF (mode=='SST') THEN
    412     ierr=NF90_GET_ATT(ncid, varid, 'units', unit_sst); CALL strclean(unit_sst)
    413     IF(ierr/=NF90_NOERR) THEN
    414       CALL msg(0,'No unit in sst file. Take default: kelvins.')
    415       unit_sst='X'
    416     ELSE IF(ANY(unit_sst==["degC  ","DegC  "])) THEN; unit_sst='C'
    417       CALL msg(0,'Sea-surface temperature is in CELCIUS DEGREES.')
    418     ELSE IF(ANY(unit_sst==["K     ","Kelvin"])) THEN; unit_sst='K'
    419       CALL msg(0,'Sea-surface temperature is in KELVINS.')
    420     ELSE
    421       CALL abort_physic('SST','Unrecognized sst unit: '//TRIM(unit_sst),1)
    422     END IF
    423   END IF
    424403
    425404!--- Longitude
     
    477456  DO l=1, lmdep
    478457    CALL ncerr(NF90_GET_VAR(ncid,varid,champ,[1,1,l],[imdep,jmdep,1]),fnam)
    479     !--- Check whether values are acceptable for SIC, depending on unit.
    480     !--- Dropped for mid-month boundary conditions datasets (BCS, ix_sic==1)
    481     IF(mode=='SIC'.AND.ix_sic/=1) THEN
    482       IF(TRIM(unit_sic)=="1".OR.TRIM(unit_sic)=="1.0") THEN
    483         IF(ANY(champ>1.0+EPSFRA)) &
    484           CALL abort_physic('SIC','Found sea-ice fractions greater than 1.')
    485       ELSE IF(TRIM(unit_sic)=="%") THEN
    486         IF(ANY(champ>100.0+EPSFRA)) &
    487           CALL abort_physic('SIC','Found sea-ice percentages greater than 100.')
    488 !        IF(MAXVAL(champ)< 1.01) &
    489 !          CALL abort_physic('SIC','All sea-ice percentages lower than 1.')
     458    CALL conf_dat2d(title, dlon_ini, dlat_ini, dlon, dlat, champ, .TRUE.)
     459
     460    !--- FOR SIC/SST FIELDS ONLY
     461    IF(l==1.AND.is_in(mode,['SIC','SST'])) THEN
     462
     463      !--- DETERMINE THE UNIT: READ FROM FILE OR ASSUMED USING FIELD VALUES
     464      ierr=NF90_GET_ATT(ncid, varid, 'units', units)
     465      IF(ierr==NF90_NOERR) THEN !--- ATTRIBUTE "units" FOUND IN THE FILE
     466        CALL strclean(units)
     467        IF(mode=='SIC'.AND.is_in(units,Perc)) units="%"
     468        IF(mode=='SIC'.AND.is_in(units,Frac)) units="1"
     469        IF(mode=='SST'.AND.is_in(units,DegC)) units="C"
     470        IF(mode=='SST'.AND.is_in(units,DegK)) units="K"
     471      ELSE                      !--- CHECK THE FIELD VALUES
     472        IF(mode=='SIC') value=MAXVAL(champ(:,:))
     473        IF(mode=='SST') value=   SUM(champ(:,jmdep/2),DIM=1)/REAL(imdep)
     474        IF(mode=='SIC') THEN; units="1"; IF(value>= 10.) units="%"; END IF
     475        IF(mode=='SST') THEN; units="C"; IF(value>=100.) units="K"; END IF
    490476      END IF
     477      CALL msg(0,'INPUT FILE '//TRIM(title)//' UNIT IS: "'//TRIM(units)//'".')
     478      IF(ierr/=NF90_NOERR) CALL msg(0,'WARNING ! UNIT TO BE CHECKED ! '      &
     479        //'No "units" attribute, so only based on the fields values.')
     480
     481      !--- CHECK VALUES ARE IN THE EXPECTED RANGE
     482      SELECT CASE(units)
     483        CASE('%'); ll=ANY(champ>100.0+EPSFRA); str='percentages > 100.'
     484        CASE('1'); ll=ANY(champ>  1.0+EPSFRA); str='fractions > 1.'
     485        CASE('C'); ll=ANY(champ<-100.).OR.ANY(champ> 60.); str='<-100 or >60 DegC'
     486        CASE('K'); ll=ANY(champ< 180.).OR.ANY(champ>330.); str='<180 or >330 DegK'
     487        CASE DEFAULT; CALL abort_physic(mode, 'Unrecognized '//TRIM(title)   &
     488                                                  //' unit: '//TRIM(units),1)
     489      END SELECT
     490
     491      !--- DROPPED FOR BCS DATA (FRACTIONS CAN BE HIGHER THAN 1)
     492      IF(ll.AND.ix_sic/=1.AND.mode=='SIC') &
     493        CALL abort_physic(mode,'unrealistic '//TRIM(mode)//' found: '//TRIM(str))
     494
    491495    END IF
    492     CALL conf_dat2d(title, dlon_ini, dlat_ini, dlon, dlat, champ, .TRUE.)
     496
    493497    IF(extrp) CALL extrapol(champ,imdep,jmdep,999999.,.TRUE.,.TRUE.,2,work)
    494498    IF(l==1) THEN
    495       CALL msg(5,"----------------------------------------------------------")
    496       CALL msg(5,"$$$ Barycentrique interpolation for "//TRIM(title)//" $$$")
    497       CALL msg(5,"----------------------------------------------------------")
     499      CALL msg(5,"--------------------------------------------------------")
     500      CALL msg(5,"$$$ Barycentric interpolation for "//TRIM(title)//" $$$")
     501      CALL msg(5,"--------------------------------------------------------")
    498502    END IF
    499503    IF(mode=='RUG') champ=LOG(champ)
     
    567571        IF(.NOT.is_bcs) WRITE(lunout, *)'SPLINES TIME INTERPOLATION.'
    568572        WRITE(lunout, *)' Input time vector: ', timeyear
    569         WRITE(lunout, *)' Output time vector from 0 to ', ndays-1
     573        WRITE(lunout, *)' Output time vector: from 0.5 to ', ndays-0.5
    570574     END IF
    571575  END IF
     
    614618!--- SPECIAL FILTER FOR SST: SST>271.38 --------------------------------------
    615619  IF(mode=='SST') THEN
    616     IF(TRIM(unit_sst)=="K") THEN
    617        ! Nothing to be done if the sst field is already in kelvins
    618       CALL msg(0,'SST field is already in kelvins.')
    619     ELSE
    620        ! Convert sst field from celcius degrees to kelvins
    621       CALL msg(0,'SST field converted from celcius degrees to kelvins.')
    622       champan=champan+273.15
    623     END IF
    624     CALL msg(0,'Filtering SST: SST >= 271.38')
     620    SELECT CASE(units)
     621      CASE("K"); CALL msg(0,'SST field is already in kelvins.')
     622      CASE("C"); CALL msg(0,'SST field converted from celcius degrees to kelvins.')
     623      champan(:, :, :)=champan(:, :, :)+273.15
     624    END SELECT
     625    CALL msg(0,'Filtering SST: Sea Surface Temperature >= 271.38')
    625626    WHERE(champan<271.38) champan=271.38
    626627  END IF
     
    628629!--- SPECIAL FILTER FOR SIC: 0.0<SIC<1.0 -------------------------------------
    629630  IF(mode=='SIC') THEN
    630     CALL msg(0,'Filtering SIC: 0.0 < Sea-ice < 1.0')
    631     IF(TRIM(unit_sic)=="1") THEN
    632        ! Nothing to be done if the sea-ice field is already in fraction of 1
    633        ! This is the case for sea-ice in file cpl_atm_sic.nc
    634        CALL msg(0,'Sea-ice field already in fraction of 1')
    635     ELSE
    636        ! Convert sea ice from percentage to fraction of 1
    637        CALL msg(0,'Sea-ice field converted from percentage to fraction of 1.')
     631    SELECT CASE(units)
     632      CASE("1"); CALL msg(0,'SIC field already in fraction of 1')
     633      CASE("%"); CALL msg(0,'SIC field converted from percentage to fraction of 1.')
    638634       champan(:, :, :)=champan(:, :, :)/100.
    639     END IF
    640     champan(iip1, :, :)=champan(1, :, :)
     635    END SELECT
     636    CALL msg(0,'Filtering SIC: 0.0 <= Sea-ice <=1.0')
    641637    WHERE(champan>1.0) champan=1.0
    642638    WHERE(champan<0.0) champan=0.0
     
    670666!-------------------------------------------------------------------------------
    671667! Local variables:
    672   CHARACTER(LEN=256) :: modname="start_init_orog0"
     668  CHARACTER(LEN=ns) :: modname="start_init_orog0"
    673669  INTEGER            :: fid, llm_tmp,ttm_tmp, iml,jml, iml_rel,jml_rel, itau(1)
    674670  REAL               :: lev(1), date, dt, deg2rad
     
    789785!-------------------------------------------------------------------------------
    790786
     787
     788!-------------------------------------------------------------------------------
     789!
     790FUNCTION is_in(s1,s2) RESULT(res)
     791!
     792!-------------------------------------------------------------------------------
     793  IMPLICIT NONE
     794!-------------------------------------------------------------------------------
     795! Purpose: Check wether s1 is present in the s2(:) list (case insensitive).
     796!-------------------------------------------------------------------------------
     797! Arguments:
     798  CHARACTER(LEN=*), INTENT(IN) :: s1, s2(:)
     799  LOGICAL                      :: res
     800!-------------------------------------------------------------------------------
     801  res=.FALSE.; DO k=1,SIZE(s2); res=res.OR.strLow(s1)==strLow(s2(k)); END DO
     802
     803END FUNCTION is_in
     804!
     805!-------------------------------------------------------------------------------
     806
     807
     808!-------------------------------------------------------------------------------
     809!
     810ELEMENTAL FUNCTION strLow(s) RESULT(res)
     811!
     812!-------------------------------------------------------------------------------
     813  IMPLICIT NONE
     814!-------------------------------------------------------------------------------
     815! Purpose: Lower case conversion.
     816!-------------------------------------------------------------------------------
     817! Arguments:
     818  CHARACTER(LEN=*), INTENT(IN) :: s
     819  CHARACTER(LEN=ns)            :: res
     820!-------------------------------------------------------------------------------
     821! Local variable:
     822  INTEGER :: k, ix
     823!-------------------------------------------------------------------------------
     824  res=s
     825  DO k=1,LEN(s); ix=IACHAR(s(k:k))
     826    IF(64<ix.AND.ix<91) res(k:k)=ACHAR(ix+32)
     827  END DO
     828
     829END FUNCTION strLow
     830!
     831!-------------------------------------------------------------------------------
     832
    791833#endif
    792834! of #ifndef CPP_1D
  • LMDZ6/branches/DYNAMICO-conv/libf/misc/regr_conserv_m.F90

    r2788 r3356  
    8484    IF(a==xt(it  )) co=co+xt(it  )-xs(is  )
    8585    IF(b==xt(it+1)) co=co+xt(it+1)-xs(is+1)
    86     vt(it) = vt(it)+idt*(b-a)*(vs(is)+co*slope(is))
     86    vt(it) = vt(it)+idt*(b-a)*(vs(is)+co*slope(is)/2.)
    8787  ELSE
    8888    vt(it) = vt(it)+idt*(b-a)* vs(is)
     
    142142    IF(a==xt(it  )) co=co+xt(it  )-xs(is  )
    143143    IF(b==xt(it+1)) co=co+xt(it+1)-xs(is+1)
    144     IF(ix==1) vt(it,:) = vt(it,:)+idt*(b-a)*(vs(is,:)+co*slope(is,:))
    145     IF(ix==2) vt(:,it) = vt(:,it)+idt*(b-a)*(vs(:,is)+co*slope(:,is))
     144    IF(ix==1) vt(it,:) = vt(it,:)+idt*(b-a)*(vs(is,:)+co*slope(is,:)/2.)
     145    IF(ix==2) vt(:,it) = vt(:,it)+idt*(b-a)*(vs(:,is)+co*slope(:,is)/2.)
    146146  ELSE
    147147    IF(ix==1) vt(it,:) = vt(it,:)+idt*(b-a)* vs(is,:)
     
    202202    IF(a==xt(it  )) co=co+xt(it  )-xs(is  )
    203203    IF(b==xt(it+1)) co=co+xt(it+1)-xs(is+1)
    204     IF(ix==1) vt(it,:,:) = vt(it,:,:)+idt*(b-a)*(vs(is,:,:)+co*slope(is,:,:))
    205     IF(ix==2) vt(:,it,:) = vt(:,it,:)+idt*(b-a)*(vs(:,is,:)+co*slope(:,is,:))
    206     IF(ix==3) vt(:,:,it) = vt(:,:,it)+idt*(b-a)*(vs(:,:,is)+co*slope(:,:,is))
     204    IF(ix==1) vt(it,:,:) = vt(it,:,:)+idt*(b-a)*(vs(is,:,:)+co*slope(is,:,:)/2.)
     205    IF(ix==2) vt(:,it,:) = vt(:,it,:)+idt*(b-a)*(vs(:,is,:)+co*slope(:,is,:)/2.)
     206    IF(ix==3) vt(:,:,it) = vt(:,:,it)+idt*(b-a)*(vs(:,:,is)+co*slope(:,:,is)/2.)
    207207  ELSE
    208208    IF(ix==1) vt(it,:,:) = vt(it,:,:)+idt*(b-a)* vs(is,:,:)
     
    264264    IF(a==xt(it  )) co=co+xt(it  )-xs(is  )
    265265    IF(b==xt(it+1)) co=co+xt(it+1)-xs(is+1)
    266     IF(ix==1) vt(it,:,:,:) = vt(it,:,:,:)+idt*(b-a)*(vs(is,:,:,:)+co*slope(is,:,:,:))
    267     IF(ix==2) vt(:,it,:,:) = vt(:,it,:,:)+idt*(b-a)*(vs(:,is,:,:)+co*slope(:,is,:,:))
    268     IF(ix==3) vt(:,:,it,:) = vt(:,:,it,:)+idt*(b-a)*(vs(:,:,is,:)+co*slope(:,:,is,:))
    269     IF(ix==4) vt(:,:,:,it) = vt(:,:,:,it)+idt*(b-a)*(vs(:,:,:,is)+co*slope(:,:,:,is))
     266    IF(ix==1) vt(it,:,:,:) = vt(it,:,:,:)+idt*(b-a)*(vs(is,:,:,:)+co*slope(is,:,:,:)/2.)
     267    IF(ix==2) vt(:,it,:,:) = vt(:,it,:,:)+idt*(b-a)*(vs(:,is,:,:)+co*slope(:,is,:,:)/2.)
     268    IF(ix==3) vt(:,:,it,:) = vt(:,:,it,:)+idt*(b-a)*(vs(:,:,is,:)+co*slope(:,:,is,:)/2.)
     269    IF(ix==4) vt(:,:,:,it) = vt(:,:,:,it)+idt*(b-a)*(vs(:,:,:,is)+co*slope(:,:,:,is)/2.)
    270270  ELSE
    271271    IF(ix==1) vt(it,:,:,:) = vt(it,:,:,:)+idt*(b-a)* vs(is,:,:,:)
     
    328328    IF(a==xt(it  )) co=co+xt(it  )-xs(is  )
    329329    IF(b==xt(it+1)) co=co+xt(it+1)-xs(is+1)
    330     IF(ix==1) vt(it,:,:,:,:) = vt(it,:,:,:,:)+idt*(b-a)*(vs(is,:,:,:,:)+co*slope(is,:,:,:,:))
    331     IF(ix==2) vt(:,it,:,:,:) = vt(:,it,:,:,:)+idt*(b-a)*(vs(:,is,:,:,:)+co*slope(:,is,:,:,:))
    332     IF(ix==3) vt(:,:,it,:,:) = vt(:,:,it,:,:)+idt*(b-a)*(vs(:,:,is,:,:)+co*slope(:,:,is,:,:))
    333     IF(ix==4) vt(:,:,:,it,:) = vt(:,:,:,it,:)+idt*(b-a)*(vs(:,:,:,is,:)+co*slope(:,:,:,is,:))
    334     IF(ix==5) vt(:,:,:,:,it) = vt(:,:,:,:,it)+idt*(b-a)*(vs(:,:,:,:,is)+co*slope(:,:,:,:,is))
     330    IF(ix==1) vt(it,:,:,:,:) = vt(it,:,:,:,:)+idt*(b-a)*(vs(is,:,:,:,:)+co*slope(is,:,:,:,:)/2.)
     331    IF(ix==2) vt(:,it,:,:,:) = vt(:,it,:,:,:)+idt*(b-a)*(vs(:,is,:,:,:)+co*slope(:,is,:,:,:)/2.)
     332    IF(ix==3) vt(:,:,it,:,:) = vt(:,:,it,:,:)+idt*(b-a)*(vs(:,:,is,:,:)+co*slope(:,:,is,:,:)/2.)
     333    IF(ix==4) vt(:,:,:,it,:) = vt(:,:,:,it,:)+idt*(b-a)*(vs(:,:,:,is,:)+co*slope(:,:,:,is,:)/2.)
     334    IF(ix==5) vt(:,:,:,:,it) = vt(:,:,:,:,it)+idt*(b-a)*(vs(:,:,:,:,is)+co*slope(:,:,:,:,is)/2.)
    335335  ELSE
    336336    IF(ix==1) vt(it,:,:,:,:) = vt(it,:,:,:,:)+idt*(b-a)* vs(is,:,:,:,:)
  • LMDZ6/branches/DYNAMICO-conv/libf/misc/wxios.F90

    r3336 r3356  
    301301        CALL xios_set_domain_attr_hdl(dom, nj_glo=nbp_lat, jbegin=jj_begin-1, nj=jj_nb, data_dim=2)
    302302        CALL xios_set_domain_attr_hdl(dom, lonvalue_1d=io_lon(1:nbp_lon), latvalue_1d=io_lat(jj_begin:jj_end))
     303
     304        !On definit un axe de latitudes pour les moyennes zonales
     305        IF (xios_is_valid_axis("axis_lat")) THEN
     306           CALL xios_set_axis_attr( "axis_lat", n_glo=nbp_lat, n=jj_nb, begin=jj_begin-1, value=io_lat(jj_begin:jj_end))
     307        ENDIF
    303308
    304309        IF (.NOT.is_sequential) THEN
  • LMDZ6/branches/DYNAMICO-conv/libf/phy_common/regular_lonlat_mod.F90

    r2963 r3356  
    2020  REAL,SAVE,ALLOCATABLE :: lat_reg(:)      ! value of longitude cell (rad)
    2121
    22   REAL,SAVE,ALLOCATABLE :: boundslon_reg(:,:)      ! value of boundaries cell (1=>east, 2=>west)(rad)
     22  REAL,SAVE,ALLOCATABLE :: boundslon_reg(:,:)      ! value of boundaries cell (1=>west, 2=>east)(rad)
    2323
    2424  REAL,SAVE,ALLOCATABLE :: boundslat_reg(:,:)      ! value of longitude cell (1=>north, 2=>south)(rad)
  • LMDZ6/branches/DYNAMICO-conv/libf/phylmd/Dust/phys_output_write_spl_mod.F90

    r2754 r3356  
    155155         o_rh2m, o_rh2m_min, o_rh2m_max, &
    156156         o_qsat2m, o_tpot, o_tpote, o_SWnetOR, &
    157          o_SWdownOR, o_LWdownOR, o_snowl, &
     157         o_LWdownOR, o_snowl, &
    158158         o_solldown, o_dtsvdfo, o_dtsvdft, &
    159159         o_dtsvdfg, o_dtsvdfi, o_z0m, o_z0h, o_od550aer, &
     
    982982       IF (vars_defined) zx_tmp_fi2d(1 : klon) = fsolsw( 1 : klon, is_ter)
    983983       CALL histwrite_phy(o_SWnetOR,  zx_tmp_fi2d)
    984        IF (vars_defined) zx_tmp_fi2d(1:klon) = solsw(1:klon)/(1.-albsol1(1:klon))
    985        CALL histwrite_phy(o_SWdownOR,  zx_tmp_fi2d)
    986984       CALL histwrite_phy(o_LWdownOR, sollwdown)
    987985       CALL histwrite_phy(o_snowl, snow_lsc)
  • LMDZ6/branches/DYNAMICO-conv/libf/phylmd/StratAer/aerophys.F90

    r2964 r3356  
    22!
    33MODULE aerophys
     4!
     5  IMPLICIT NONE
    46!
    57  REAL,PARAMETER                         :: ropx=1500.0              ! default aerosol particle mass density [kg/m3]
  • LMDZ6/branches/DYNAMICO-conv/libf/phylmd/StratAer/interp_sulf_input.F90

    r2752 r3356  
    3232  INTEGER, SAVE :: n_lev   ! number of levels in the input data
    3333  INTEGER n_mth   ! number of months in the input data
    34   REAL OCS_tmp, SO2_tmp
    3534  INTEGER, SAVE :: mth_pre
    3635!$OMP THREADPRIVATE(mth_pre)
     
    238237    DO k=1, klev
    239238      !
    240       OCS_tmp=tr_seri(i,k,id_OCS_strat)
    241       SO2_tmp=tr_seri(i,k,id_SO2_strat)
    242       !--OCS and SO2 prescribed below p_bound
     239      !--OCS and SO2 prescribed back to their clim values below p_bound
    243240      IF (paprs(i,k).GT.p_bound) THEN
     241        budg_3D_backgr_ocs(i,k)=OCS_clim(i,k)-tr_seri(i,k,id_OCS_strat)
     242        budg_3D_backgr_so2(i,k)=SO2_clim(i,k)-tr_seri(i,k,id_SO2_strat)
    244243        tr_seri(i,k,id_OCS_strat)=OCS_clim(i,k)
    245244        tr_seri(i,k,id_SO2_strat)=SO2_clim(i,k)
    246245      ENDIF
    247       budg_3D_backgr_ocs(i,k)=tr_seri(i,k,id_OCS_strat)-OCS_tmp
    248       budg_3D_backgr_so2(i,k)=tr_seri(i,k,id_SO2_strat)-SO2_tmp
    249246    ENDDO
    250247  ENDDO
  • LMDZ6/branches/DYNAMICO-conv/libf/phylmd/StratAer/micphy_tstep.F90

    r2752 r3356  
    44  USE aerophys
    55  USE infotrac
    6   USE phys_local_var_mod, ONLY: mdw, budg_3D_nucl, budg_3D_cond_evap, R2SO4, DENSO4, f_r_wet
     6  USE phys_local_var_mod, ONLY: mdw, budg_3D_nucl, budg_3D_cond_evap, budg_h2so4_to_part, R2SO4, DENSO4, f_r_wet
    77  USE nucleation_tstep_mod
    88  USE cond_evap_tstep_mod
     
    2525  ! local variables in coagulation routine
    2626  INTEGER, PARAMETER        :: nbtstep=4  ! Max number of time steps in microphysics per time step in physics
    27   INTEGER                   :: it,ilon,ilev,IK,count_tstep
     27  INTEGER                   :: it,ilon,ilev,count_tstep
    2828  REAL                      :: rhoa !H2SO4 number density [molecules/cm3]
    2929  REAL                      :: ntot !total number of molecules in the critical cluster (ntot>4)
     
    4343  REAL H2SO4_sat(nbtr_bin)
    4444
    45   DO IK=1,nbtr_bin
    46     Vbin(IK)=4.0*RPI*((mdw(IK)/2.)**3)/3.0
     45  DO it=1,nbtr_bin
     46    Vbin(it)=4.0*RPI*((mdw(it)/2.)**3)/3.0
    4747  ENDDO
    4848
     
    6464
    6565  DO ilon=1, klon
     66!
     67!--initialisation of diagnostic
     68  budg_h2so4_to_part(ilon)=0.0
     69!
    6670  DO ilev=1, klev
     71!
     72!--initialisation of diagnostic
     73  budg_3D_nucl(ilon,ilev)=0.0
     74  budg_3D_cond_evap(ilon,ilev)=0.0
     75!
    6776  ! only in the stratosphere
    6877  IF (is_strato(ilon,ilev)) THEN
    6978    ! initialize sulfur fluxes
    70     budg_3D_nucl(ilon,ilev)=0.0
    71     budg_3D_cond_evap(ilon,ilev)=0.0
    7279    H2SO4_init=tr_seri(ilon,ilev,id_H2SO4_strat)
    7380    ! adaptive timestep for nucleation and condensation
     
    8895             & RRSI,Vbin,FL,ASO4,DNDR)
    8996      ! consider only condensation (positive FL)
    90       DO IK=1,nbtr_bin
    91         FL(IK)=MAX(FL(IK),0.)
     97      DO it=1,nbtr_bin
     98        FL(it)=MAX(FL(it),0.)
    9299      ENDDO
    93100      ! compute total H2SO4 cond flux for all particles
    94101      cond_evap_rate=0.0
    95       DO IK=1, nbtr_bin
    96         cond_evap_rate=cond_evap_rate+tr_seri(ilon,ilev,IK+nbtr_sulgas)*FL(IK)*mH2SO4mol
     102      DO it=1, nbtr_bin
     103        cond_evap_rate=cond_evap_rate+tr_seri(ilon,ilev,it+nbtr_sulgas)*FL(it)*mH2SO4mol
    97104      ENDDO
    98105      ! determine appropriate time step
     
    124131           & RRSI,Vbin,FL,ASO4,DNDR)
    125132    ! limit evaporation (negative FL) over one physics time step to H2SO4 content of the droplet
    126     DO IK=1,nbtr_bin
    127       FL(IK)=MAX(FL(IK)*pdtphys,0.-ASO4(IK))/pdtphys
     133    DO it=1,nbtr_bin
     134      FL(it)=MAX(FL(it)*pdtphys,0.-ASO4(it))/pdtphys
    128135      ! consider only evap (negative FL)
    129       FL(IK)=MIN(FL(IK),0.)
     136      FL(it)=MIN(FL(it),0.)
    130137    ENDDO
    131138    ! compute total H2SO4 evap flux for all particles
    132139    evap_rate=0.0
    133     DO IK=1, nbtr_bin
    134       evap_rate=evap_rate+tr_seri(ilon,ilev,IK+nbtr_sulgas)*FL(IK)*mH2SO4mol
     140    DO it=1, nbtr_bin
     141      evap_rate=evap_rate+tr_seri(ilon,ilev,it+nbtr_sulgas)*FL(it)*mH2SO4mol
    135142    ENDDO
    136143    ! update H2SO4 concentration after evap
     
    141148    budg_3D_cond_evap(ilon,ilev)=budg_3D_cond_evap(ilon,ilev)+mSatom/mH2SO4mol &
    142149             & *evap_rate*(paprs(ilon,ilev)-paprs(ilon,ilev+1))/RG
     150    ! compute vertically integrated flux due to the net effect of nucleation and condensation/evaporation
     151    budg_h2so4_to_part(ilon)=budg_h2so4_to_part(ilon)+(H2SO4_init-tr_seri(ilon,ilev,id_H2SO4_strat)) &
     152             & *mSatom/mH2SO4mol*(paprs(ilon,ilev)-paprs(ilon,ilev+1))/RG/pdtphys
    143153  ENDIF
    144154  ENDDO
     
    148158    DO ilon=1, klon
    149159    DO ilev=1, klev   
    150     DO IK=1, nbtr
    151       IF (tr_seri(ilon,ilev,IK).LT.0.0) THEN
    152         PRINT *, 'micphy_tstep: negative concentration', tr_seri(ilon,ilev,IK), ilon, ilev, IK
     160    DO it=1, nbtr
     161      IF (tr_seri(ilon,ilev,it).LT.0.0) THEN
     162        PRINT *, 'micphy_tstep: negative concentration', tr_seri(ilon,ilev,it), ilon, ilev, it
    153163      ENDIF
    154164    ENDDO
  • LMDZ6/branches/DYNAMICO-conv/libf/phylmd/StratAer/traccoag_mod.F90

    r2752 r3356  
    203203            !vertically distributed emission
    204204            DO k=1, klev
    205               ! stretch emission over one day of Pinatubo eruption
    206               emission=m_aer_emiss_vol*(mSO2mol/mSatom)/m_air_gridbox(i,k)*f_lay_emiss(k)/1./86400.
     205              ! stretch emission over one day (minus one timestep) of Pinatubo eruption
     206              emission=m_aer_emiss_vol*(mSO2mol/mSatom)/m_air_gridbox(i,k)*f_lay_emiss(k)/1./(86400.-pdtphys)
    207207              tr_seri(i,k,id_SO2_strat)=tr_seri(i,k,id_SO2_strat)+emission*pdtphys
    208208              budg_emi_so2(i)=budg_emi_so2(i)+emission*zdm(k)*mSatom/mSO2mol
  • LMDZ6/branches/DYNAMICO-conv/libf/phylmd/acama_gwd_rando_m.F90

    r2665 r3356  
    2020    use dimphy, only: klon, klev
    2121    use assert_m, only: assert
     22    USE ioipsl_getin_p_mod, ONLY : getin_p
     23    USE vertical_layers_mod, ONLY : presnivs
     24
    2225    include "YOMCST.h"
    2326    include "clesphys.h"
     
    111114    REAL BV(KLON, KLEV + 1) ! Brunt Vaisala freq. (BVF) at 1/2 levels
    112115    REAL BVSEC ! Security to avoid negative BVF
     116
     117    REAL, DIMENSION(klev+1) ::HREF
     118    LOGICAL, SAVE :: gwd_reproductibilite_mpiomp=.true.
     119    LOGICAL, SAVE :: firstcall = .TRUE.
     120  !$OMP THREADPRIVATE(firstcall,gwd_reproductibilite_mpiomp)
     121
     122    CHARACTER (LEN=20) :: modname='flott_gwd_rando'
     123    CHARACTER (LEN=80) :: abort_message
     124
     125
     126
     127  IF (firstcall) THEN
     128    ! Cle introduite pour resoudre un probleme de non reproductibilite
     129    ! Le but est de pouvoir tester de revenir a la version precedenete
     130    ! A eliminer rapidement
     131    CALL getin_p('gwd_reproductibilite_mpiomp',gwd_reproductibilite_mpiomp)
     132    IF (NW+4*(NA-1)+NA>=KLEV) THEN
     133       abort_message = 'NW+3*NA>=KLEV Probleme pour generation des ondes'
     134       CALL abort_physic (modname,abort_message,1)
     135    ENDIF
     136    firstcall=.false.
     137!    CALL iophys_ini
     138  ENDIF
    113139
    114140    !-----------------------------------------------------------------
     
    205231    ! Launching altitude
    206232
     233    IF (gwd_reproductibilite_mpiomp) THEN
     234       ! Reprend la formule qui calcule PH en fonction de PP=play
     235       DO LL = 2, KLEV
     236          HREF(LL) = EXP((LOG(presnivs(LL)) + LOG(presnivs(LL - 1))) / 2.)
     237       end DO
     238       HREF(KLEV + 1) = 0.
     239       HREF(1) = 2. * presnivs(1) - HREF(2)
     240    ELSE
     241       HREF(1:KLEV)=PH(KLON/2,1:KLEV)
     242    ENDIF
     243
    207244    LAUNCH=0
    208245    LTROP =0
    209246    DO LL = 1, KLEV
    210        IF (PH(KLON / 2, LL) / PH(KLON / 2, 1) > XLAUNCH) LAUNCH = LL
     247       IF (HREF(LL) / HREF(1) > XLAUNCH) LAUNCH = LL
    211248    ENDDO
    212249    DO LL = 1, KLEV
    213        IF (PH(KLON / 2, LL) / PH(KLON / 2, 1) > XTROP) LTROP = LL
     250       IF (HREF(LL) / HREF(1) > XTROP) LTROP = LL
    214251    ENDDO
     252    !LAUNCH=22 ; LTROP=33
     253!   print*,'LAUNCH=',LAUNCH,'LTROP=',LTROP
     254
    215255
    216256!   PRINT *,'LAUNCH IN ACAMARA:',LAUNCH
     
    293333
    294334    JW = 0
    295     DO JP = 1, NP
    296        DO JK = 1, NK
    297           DO JO = 1, NO
    298              JW = JW + 1
     335    DO JW = 1, NW
    299336             ! Angle
    300337             DO II = 1, KLON
     
    340377                ! RUW0(JW, II) = RUWFRT
    341378             ENDDO
    342           end DO
    343        end DO
    344379    end DO
    345380
  • LMDZ6/branches/DYNAMICO-conv/libf/phylmd/add_wake_tend.F90

    r2635 r3356  
    1 SUBROUTINE add_wake_tend(zddeltat, zddeltaq, zds, zddens, zoccur, text, abortphy)
     1SUBROUTINE add_wake_tend(zddeltat, zddeltaq, zds, zddensaw, zddensw, zoccur, text, abortphy)
    22!===================================================================
    33! Ajoute les tendances liées aux diverses parametrisations physiques aux
     
    99
    1010USE dimphy, ONLY: klon, klev
    11 USE phys_state_var_mod, ONLY: wake_deltat, wake_deltaq, wake_s, wake_dens
     11USE phys_state_var_mod, ONLY: wake_deltat, wake_deltaq, wake_s,  &
     12                              awake_dens, wake_dens
    1213
    1314USE print_control_mod, ONLY: prt_level
     
    1718!------------
    1819  REAL, DIMENSION(klon, klev),   INTENT (IN)         :: zddeltat, zddeltaq
    19   REAL, DIMENSION(klon),         INTENT (IN)         :: zds, zddens
     20  REAL, DIMENSION(klon),         INTENT (IN)         :: zds, zddensaw, zddensw
    2021  INTEGER, DIMENSION(klon),      INTENT (IN)         :: zoccur
    2122  CHARACTER*(*),                 INTENT (IN)         :: text
     
    5354         DO i = 1, klon
    5455           IF (zoccur(i) .GE. 1) THEN
    55              wake_s(i)    = wake_s(i)    + zds(i)
    56              wake_dens(i) = wake_dens(i) + zddens(i)
     56             wake_s(i)     = wake_s(i)    + zds(i)
     57             awake_dens(i) = awake_dens(i) + zddensaw(i)
     58             wake_dens(i)  = wake_dens(i) + zddensw(i)
    5759           ELSE
    58              wake_s(i)    = 0.
    59              wake_dens(i) = 0.
     60             wake_s(i)     = 0.
     61             awake_dens(i) = 0.
     62             wake_dens(i)  = 0.
    6063           ENDIF   ! (zoccur(i) .GE. 1)
    6164         END DO
  • LMDZ6/branches/DYNAMICO-conv/libf/phylmd/aero_mod.F90

    r2823 r3356  
    22!
    33MODULE aero_mod
     4
     5  IMPLICIT NONE
     6
    47! Declaration des indices pour les aerosols
    58
     
    6568
    6669! 3/ Number of aerosol groups
    67   INTEGER, PARAMETER :: naero_grp = 12
     70  INTEGER, PARAMETER :: naero_grp = 13
    6871  ! if info_trac = inca
    6972  ! 1 = ZERO   
     
    7881  ! 10 = DNO3
    7982  ! 11 = SNO3
    80   ! 12 = empty actually
     83  ! 12 = SOAA
     84  ! 13 = SOAB
    8185  ! else
    8286  ! 1 = ZERO   
  • LMDZ6/branches/DYNAMICO-conv/libf/phylmd/albsno.F90

    • Property svn:executable deleted
  • LMDZ6/branches/DYNAMICO-conv/libf/phylmd/alpale_th.F90

    r2730 r3356  
    33                       ale_bl_trig, ale_bl_stat, ale_bl,  &
    44                       alp_bl, alp_bl_stat, &
    5                        proba_notrig, random_notrig)
     5                       proba_notrig, random_notrig, birth_rate)
    66
    77! **************************************************************
     
    4242  REAL, DIMENSION(klon), INTENT(OUT)                         :: random_notrig
    4343
     44  REAL, DIMENSION(klon), INTENT(OUT)                         :: birth_rate
     45
    4446  include "thermcell.h"
    4547
     
    5355  REAL, DIMENSION(klon)                                      :: ale_bl_ref
    5456  REAL, DIMENSION(klon)                                      :: tau_trig
    55   REAL, DIMENSION(klon)                                      :: birth_rate
    5657!
    5758    !$OMP THREADPRIVATE(random_notrig_max)
     
    6263 REAL x
    6364 umexp(x) = max(sign(1.,x-1.e-3),0.)*(1.-exp(-x))/max(x,1.e-3) + &
    64             (1.-max(sign(1.,x-1.e-3),0.))*(1.-0.5*x*(1.-x/3.*(1.-0.25*x)))
     65            (1.-max(sign(1.,x-1.e-3),0.))*(1.-0.5*x*(1.-x/3.*(1.-0.25*x)))  !!! correct formula            (jyg)
     66!!!            (1.-max(sign(1.,x-1.e-3),0.))*(-0.5*x*(1.-x/3.*(1.-0.25*x))) !!! bug introduced by mistake  (jyg)
     67!!!            (1.-max(sign(1.,x-1.e-3),0.))*(1.-0.5*x*(1.-x/3.*(1.-0.25*x)))  !!! initial correct formula (jyg)
    6568!
    6669!+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
     
    101104             !
    102105             IF (prt_level .GE. 10) THEN
    103                 print *,'cin, ale_bl_stat, alp_bl_stat ', &
    104                      cin, ale_bl_stat, alp_bl_stat
     106                print *,'cin, ale_bl_stat, alp_bl, alp_bl_stat ', &
     107                     cin, ale_bl_stat, alp_bl, alp_bl_stat
    105108             ENDIF
    106109
     
    139142                         ale_bl_trig(i)=0.
    140143                      endif
     144                      birth_rate(i) = n2(i)*exp(-s_trig/s2(i))/(tau_trig(i)*cell_area(i))
     145!!!                      birth_rate(i) = max(birth_rate(i),1.e-18)
    141146                   else
    142147!!jyg                      proba_notrig(i)=1.
     148                      birth_rate(i) = 0.
    143149                      random_notrig(i)=0.
    144150                      ale_bl_trig(i)=0.
     
    158164                         ale_bl_trig(i)=0.
    159165                      endif
     166                      birth_rate(i) = n2(i)*exp(-s_trig/s2(i))/(tau_trig(i)*cell_area(i))
     167!!!                      birth_rate(i) = max(birth_rate(i),1.e-18)
    160168                   else
    161169!!jyg                      proba_notrig(i)=1.
     170                      birth_rate(i) = 0.
    162171                      random_notrig(i)=0.
    163172                      ale_bl_trig(i)=0.
     
    255264              birth_number = n2(i)*exp(-s_trig/s2(i))
    256265              birth_rate(i) = birth_number/(tau_trig(i)*cell_area(i))
     266!!!              birth_rate(i) = max(birth_rate(i),1.e-18)
    257267              proba_notrig(i)=proba_notrig(i)*exp(-birth_number*dtime/tau_trig(i))
    258268              Alp_bl(i) = Alp_bl(i)* &
     
    262272          else
    263273!!jyg              proba_notrig(i)=1.
     274              birth_rate(i)=0.
    264275              random_notrig(i)=0.
    265276              alp_bl(i)=0.
     
    289300
    290301          IF (prt_level .GE. 10) THEN
    291              print *,'ale_bl_trig, alp_bl_stat ',ale_bl_trig, alp_bl_stat
     302             print *,'alpale_th: ale_bl_trig, alp_bl_stat, birth_rate ', &
     303                      ale_bl_trig(1), alp_bl_stat(1), birth_rate(1)
    292304          ENDIF
    293305
  • LMDZ6/branches/DYNAMICO-conv/libf/phylmd/alpale_wk.F90

    r3001 r3356  
    6767!  Compute probability that the grid-cell is intersected by a gust front
    6868!!  print *,'alpale_wk: wkrad(1), cellrad(1) ', wkrad(1), cellrad(1)
    69   proba_gf(:) = exp(-wdens(:)*rpi*max(wkrad(:)-cellrad(:),0.)**2) - &
    70                 exp(-wdens(:)*rpi*(wkrad(:)+cellrad(:))**2)
     69!!  proba_gf(:) = exp(-wdens(:)*rpi*max(wkrad(:)-cellrad(:),0.)**2) - &   ! Formules
     70!!                exp(-wdens(:)*rpi*(wkrad(:)+cellrad(:))**2)             ! fausses !
     71  proba_gf(:) = 1. - exp(-wdens(:)*rpi*((wkrad(:)+cellrad(:))**2 - &
     72                                        max(wkrad(:)-cellrad(:),0.)**2) )
    7173!
    7274  proba_gf(:) = max(proba_gf(:),1.e-3)
     
    7577!!  print *,'alpale_wk: proba_gf(1), fip(1), ', proba_gf(1), fip(1)
    7678  fip_cond(:) = fip(:)/proba_gf(:)
    77 !!  print *,'alpale_wk: fip_cond(1) ', fip_cond(1)
     79!!    print *,'alpale_wk: wkrad(1), cellrad(1), proba_gf(1), fip(1), fip_cond(1) ', &
     80!!                        wkrad(1), cellrad(1), proba_gf(1), fip(1), fip_cond(1)
    7881
    7982   RETURN
  • LMDZ6/branches/DYNAMICO-conv/libf/phylmd/calbeta.F90

    • Property svn:executable deleted
  • LMDZ6/branches/DYNAMICO-conv/libf/phylmd/calcul_fluxs_mod.F90

    • Property svn:executable deleted
    r2538 r3356  
    44MODULE calcul_fluxs_mod
    55
     6  IMPLICIT NONE
    67
    78CONTAINS
  • LMDZ6/branches/DYNAMICO-conv/libf/phylmd/calwake.F90

    r3000 r3356  
    44SUBROUTINE calwake(iflag_wake_tend, paprs, pplay, dtime, &
    55    t, q, omgb, &
    6     dt_dwn, dq_dwn, m_dwn, m_up, dt_a, dq_a, &
    7     sigd, &
    8     wake_deltat, wake_deltaq, wake_s, wake_dens, &
     6    dt_dwn, dq_dwn, m_dwn, m_up, dt_a, dq_a, wgen, &
     7    sigd, Cin, &
     8    wake_deltat, wake_deltaq, wake_s, awake_dens, wake_dens, &
    99    wake_dth, wake_h, &
    1010    wake_pe, wake_fip, wake_gfl, &
     
    1414    wake_omg, wake_dp_deltomg, &
    1515    wake_spread, wake_cstar, wake_d_deltat_gw, &
    16     wake_ddeltat, wake_ddeltaq, wake_ds, wake_ddens)
     16    wake_ddeltat, wake_ddeltaq, wake_ds, awake_ddens, wake_ddens)
    1717  ! **************************************************************
    1818  ! *
     
    4545  REAL, DIMENSION(klon, klev),   INTENT (IN)         :: m_up, m_dwn
    4646  REAL, DIMENSION(klon, klev),   INTENT (IN)         :: dt_a, dq_a
     47  REAL, DIMENSION(klon),         INTENT (IN)         :: wgen
    4748  REAL, DIMENSION(klon),         INTENT (IN)         :: sigd
     49  REAL, DIMENSION(klon),         INTENT (IN)         :: Cin
    4850  ! Input/Output
    4951  ! ------------
    5052  REAL, DIMENSION(klon, klev),   INTENT (INOUT)      :: wake_deltat, wake_deltaq
    5153  REAL, DIMENSION(klon),         INTENT (INOUT)      :: wake_s
    52   REAL, DIMENSION(klon),         INTENT (INOUT)      :: wake_dens
     54  REAL, DIMENSION(klon),         INTENT (INOUT)      :: awake_dens, wake_dens
    5355  ! Output
    5456  ! ------
     
    6769  REAL, DIMENSION(klon),         INTENT (OUT)        :: wake_cstar
    6870  REAL, DIMENSION(klon, klev),   INTENT (OUT)        :: wake_ddeltat, wake_ddeltaq
    69   REAL, DIMENSION(klon),         INTENT (OUT)        :: wake_ds, wake_ddens
     71  REAL, DIMENSION(klon),         INTENT (OUT)        :: wake_ds, awake_ddens, wake_ddens
    7072
    7173
     
    8890  REAL, DIMENSION(klon, klev)                        :: tx, qx
    8991  REAL, DIMENSION(klon)                              :: hw, wape, fip, gfl
    90   REAL, DIMENSION(klon)                              :: sigmaw, wdens
     92  REAL, DIMENSION(klon)                              :: sigmaw, awdens, wdens
    9193  REAL, DIMENSION(klon, klev)                        :: omgbdth
    9294  REAL, DIMENSION(klon, klev)                        :: dp_omgb
     
    99101  REAL, DIMENSION(klon, klev)                        :: d_deltat_gw
    100102  REAL, DIMENSION(klon, klev)                        :: d_deltatw, d_deltaqw
    101   REAL, DIMENSION(klon)                              :: d_sigmaw, d_wdens
     103  REAL, DIMENSION(klon)                              :: d_sigmaw, d_awdens, d_wdens
    102104
    103105  REAL                                               :: rdcp
     
    105107
    106108  IF (prt_level >= 10) THEN
    107     print *, '-> calwake, wake_s input ', wake_s(1)
     109    print *, '-> calwake, wake_s, wgen input ', wake_s(1), wgen(1)
    108110  ENDIF
    109111
     
    147149d_deltaqw(:,:) = 0.
    148150d_sigmaw(:) = 0.
     151d_awdens(:) = 0.
    149152d_wdens(:) = 0.
    150153!
     
    179182
    180183  DO i = 1, klon
     184    awdens(i) = max(0., awake_dens(i))
    181185    wdens(i) = max(0., wake_dens(i))
    182186  END DO
     
    206210  CALL wake(znatsurf, p, ph, pi, dtime, &
    207211    te, qe, omgbe, &
    208     dtdwn, dqdwn, amdwn, amup, dta, dqa, &
    209     sigd0, &
    210     dtw, dqw, sigmaw, wdens, &                                   ! state variables
     212    dtdwn, dqdwn, amdwn, amup, dta, dqa, wgen, &
     213    sigd0, Cin, &
     214    dtw, dqw, sigmaw, awdens, wdens, &                                   ! state variables
    211215    dth, hw, wape, fip, gfl, &
    212216    dtls, dqls, ktopw, omgbdth, dp_omgb, tx, qx, &
    213217    dtke, dqke, omg, dp_deltomg, spread, cstar, &
    214218    d_deltat_gw, &
    215     d_deltatw, d_deltaqw, d_sigmaw, d_wdens)                     ! tendencies
     219    d_deltatw, d_deltaqw, d_sigmaw, d_awdens, d_wdens)                     ! tendencies
    216220
    217221!
     
    274278    IF (ktopw(i)>0) THEN
    275279      wake_ds(i) = d_sigmaw(i)*dtime
     280      awake_ddens(i) = d_awdens(i)*dtime
    276281      wake_ddens(i) = d_wdens(i)*dtime
    277282    ELSE
     
    298303    DO i = 1, klon
    299304      wake_s(i) = sigmaw(i)
     305      awake_dens(i) = awdens(i)
    300306      wake_dens(i) = wdens(i)
    301307    END DO
  • LMDZ6/branches/DYNAMICO-conv/libf/phylmd/cfmip_point_locations.F90

    • Property svn:executable deleted
  • LMDZ6/branches/DYNAMICO-conv/libf/phylmd/clesphys.h

    r3065 r3356  
    88!..include cles_phys.h
    99!
    10        LOGICAL cycle_diurne,soil_model,new_oliq,ok_orodr,ok_orolf
     10       INTEGER iflag_cycle_diurne
     11       LOGICAL soil_model,new_oliq,ok_orodr,ok_orolf
    1112       LOGICAL ok_limitvrai
    1213       LOGICAL ok_all_xml
     14       LOGICAL ok_lwoff
    1315       INTEGER nbapp_rad, iflag_con, nbapp_cv, nbapp_wk, iflag_ener_conserv
    1416       REAL co2_ppm, co2_ppm0, solaire
     
    5355! Rugoro
    5456       Real f_rugoro,z0min
     57
     58! tau_gl : constante de rappel de la temperature a la surface de la glace
     59       REAL tau_gl
    5560
    5661!IM lev_histhf  : niveau sorties 6h
     
    101106     &     , cdmmax,cdhmax,ksta,ksta_ter,f_ri_cd_min,pbl_lmixmin_alpha  &
    102107     &     , fmagic, pmagic                                             &
    103      &     , f_cdrag_ter,f_cdrag_oce,f_rugoro,z0min                     &
     108     &     , f_cdrag_ter,f_cdrag_oce,f_rugoro,z0min,tau_gl              &
    104109     &     , min_wind_speed,f_gust_wk,f_gust_bl,f_qsat_oce,f_z0qh_oce   &
    105110     &     , z0m_seaice,z0h_seaice                                      &
     
    117122! THEN INTEGER AND LOGICALS
    118123     &     , top_height                                                 &
    119      &     , cycle_diurne, soil_model, new_oliq                         &
     124     &     , iflag_cycle_diurne, soil_model, new_oliq                         &
    120125     &     , ok_orodr, ok_orolf, ok_limitvrai, nbapp_rad                &
    121126     &     , iflag_con, nbapp_cv, nbapp_wk                              &
     
    135140     &     , iflag_ice_thermo, ok_gwd_rando, NSW, iflag_albedo          &
    136141     &     , ok_chlorophyll,ok_conserv_q, adjust_tropopause             &
    137      &     , ok_daily_climoz, ok_all_xml                                &
     142     &     , ok_daily_climoz, ok_all_xml, ok_lwoff                      &
    138143     &     , iflag_phytrac
    139144     
  • LMDZ6/branches/DYNAMICO-conv/libf/phylmd/climb_hq_mod.F90

    • Property svn:executable deleted
  • LMDZ6/branches/DYNAMICO-conv/libf/phylmd/climb_wind_mod.F90

    • Property svn:executable deleted
  • LMDZ6/branches/DYNAMICO-conv/libf/phylmd/coef_diff_turb_mod.F90

    • Property svn:executable deleted
  • LMDZ6/branches/DYNAMICO-conv/libf/phylmd/compbl.h

    • Property svn:executable deleted
  • LMDZ6/branches/DYNAMICO-conv/libf/phylmd/concvl.F90

    r2853 r3356  
    444444  END IF
    445445! ------------------------------------------------------------------
    446   IF (prt_level>=10) WRITE (lunout, *) ' cva_driver -> cbmf,plcl,plfc,wbeff ', &
    447                                          cbmf(1), plcl(1), plfc(1), wbeff(1)
     446  IF (prt_level>=10) WRITE (lunout, *) ' cva_driver -> cbmf,plcl,plfc,wbeff, d_t, d_q ', &
     447                                         cbmf(1), plcl(1), plfc(1), wbeff(1), d_t(1,1), d_q(1,1)
    448448
    449449  DO i = 1, klon
  • LMDZ6/branches/DYNAMICO-conv/libf/phylmd/condsurf.F90

    • Property svn:executable deleted
  • LMDZ6/branches/DYNAMICO-conv/libf/phylmd/conf_phys_m.F90

    r3065 r3356  
    9292    LOGICAL, SAVE       :: ok_newmicro_omp
    9393    LOGICAL, SAVE       :: ok_all_xml_omp
     94    LOGICAL, SAVE       :: ok_lwoff_omp
    9495    LOGICAL, SAVE       :: ok_journe_omp, ok_mensuel_omp, ok_instan_omp, ok_hf_omp       
    9596    LOGICAL, SAVE       :: ok_LES_omp   
     
    213214    LOGICAL,SAVE :: ok_lic_cond_omp
    214215    !
    215     LOGICAL,SAVE  :: cycle_diurne_omp,soil_model_omp,new_oliq_omp
     216    INTEGER,SAVE  :: iflag_cycle_diurne_omp
     217    LOGICAL,SAVE  :: soil_model_omp,new_oliq_omp
    216218    LOGICAL,SAVE  :: ok_orodr_omp, ok_orolf_omp, ok_limitvrai_omp
    217219    INTEGER, SAVE :: nbapp_rad_omp, iflag_con_omp
     
    295297    ok_all_xml_omp = .FALSE.
    296298    CALL getin('ok_all_xml', ok_all_xml_omp)
     299
     300    !
     301    !Config Key  = ok_lwoff
     302    !Config Desc = inhiber l effet radiatif LW des nuages
     303    !Config Def  = .FALSE.
     304    !Config Help =
     305    !
     306    ok_lwoff_omp = .FALSE.
     307    CALL getin('ok_lwoff', ok_lwoff_omp)
    297308    !
    298309
     
    405416    ! - flag_aerosol=5 => dust only
    406417    ! - flag_aerosol=6 => all aerosol
     418    ! - flag_aerosol=7 => natural aerosol + MACv2SP
     419    ! - (in this case aerosols.1980.nc should point to aerosols.nat.nc)
    407420
    408421    flag_aerosol_omp = 0
     
    709722    ! Constantes precedemment dans dyn3d/conf_gcm
    710723
    711     !Config  Key  = cycle_diurne
    712     !Config  Desc = Cycle ddiurne
    713     !Config  Def  = y
     724    !Config  Key  = iflag_cycle_diurne
     725    !Config  Desc = Cycle diurne
     726    !Config  Def  = 1
    714727    !Config  Help = Cette option permet d'eteidre le cycle diurne.
    715728    !Config         Peut etre util pour accelerer le code !
    716     cycle_diurne_omp = .TRUE.
    717     CALL getin('cycle_diurne',cycle_diurne_omp)
     729    iflag_cycle_diurne_omp = 1
     730    CALL getin('iflag_cycle_diurne',iflag_cycle_diurne_omp)
    718731
    719732    !Config  Key  = soil_model
     
    21552168    RCFC12_per = RCFC12_per_omp
    21562169
    2157     cycle_diurne = cycle_diurne_omp
     2170    iflag_cycle_diurne = iflag_cycle_diurne_omp
    21582171    soil_model = soil_model_omp
    21592172    new_oliq = new_oliq_omp
     
    22462259
    22472260    ok_all_xml = ok_all_xml_omp
     2261    ok_lwoff = ok_lwoff_omp
    22482262    ok_newmicro = ok_newmicro_omp
    22492263    ok_journe = ok_journe_omp
     
    24382452
    24392453    ! Flag_aerosol cannot be to zero if we are in coupled mode for aerosol
    2440     IF (aerosol_couple .AND. flag_aerosol .eq. 0 ) THEN
     2454    IF (aerosol_couple .AND. flag_aerosol .EQ. 0 ) THEN
    24412455       CALL abort_physic('conf_phys', 'flag_aerosol cannot be to zero if aerosol_couple=y ', 1)
    24422456    ENDIF
    24432457
    24442458    ! flag_aerosol need to be different to zero if ok_cdnc is activated
    2445     IF (ok_cdnc .AND. flag_aerosol .eq. 0) THEN
     2459    IF (ok_cdnc .AND. flag_aerosol .EQ. 0) THEN
    24462460       CALL abort_physic('conf_phys', 'flag_aerosol cannot be to zero if ok_cdnc is activated ', 1)
    24472461    ENDIF
     
    24502464    IF (ok_aie .AND. .NOT. ok_cdnc) THEN
    24512465       CALL abort_physic('conf_phys', 'ok_cdnc must be set to y if ok_aie is activated',1)
     2466    ENDIF
     2467
     2468    ! flag_aerosol=7 => MACv2SP climatology
     2469    IF (flag_aerosol.EQ.7.AND. iflag_rrtm.NE.1) THEN
     2470       CALL abort_physic('conf_phys', 'flag_aerosol=7 (MACv2SP) can only be activated with RRTM',1)
     2471    ENDIF
     2472    IF (flag_aerosol.EQ.7.AND. NSW.NE.6) THEN
     2473       CALL abort_physic('conf_phys', 'flag_aerosol=7 (MACv2SP) can only be activated with NSW=6',1)
    24522474    ENDIF
    24532475
     
    24652487    ! ORCHIDEE must be activated for ifl_pbltree=1
    24662488    IF (.NOT. ok_veget .AND. ifl_pbltree==1) THEN
    2467        WRITE(lunout,*)' ORCHIDEE must be activated for ifl_pbltree=1'
    2468        CALL abort_physic('conf_phys','ok_veget and ifl_pbltree not coherent',1)
     2489       WRITE(lunout,*)'Warning: ORCHIDEE must be activated for ifl_pbltree=1'
     2490       WRITE(lunout,*)'ifl_pbltree is now changed to zero'
     2491       ifl_pbltree=0
    24692492    END IF
    24702493
     
    25062529    write(lunout,*)'ok_lic_melt=', ok_lic_melt
    25072530    write(lunout,*)'ok_lic_cond=', ok_lic_cond
    2508     write(lunout,*)'cycle_diurne=',cycle_diurne
     2531    write(lunout,*)'iflag_cycle_diurne=',iflag_cycle_diurne
    25092532    write(lunout,*)'soil_model=',soil_model
    25102533    write(lunout,*)'new_oliq=',new_oliq
  • LMDZ6/branches/DYNAMICO-conv/libf/phylmd/cosp/cosp_output_mod.F90

    r2955 r3356  
    1212                            numMODISReffLiqBins, reffLIQ_binCenters
    1313
     14     IMPLICIT NONE
    1415! cosp_output_mod
    1516      INTEGER, PRIVATE             :: i
     
    254255  real                      :: zjulian,zjulian_start
    255256  real,dimension(Ncolumns)  :: column_ax
    256   real,dimension(2,SR_BINS) :: sratio_bounds
    257   real,dimension(SR_BINS)   ::  sratio_ax
    258257  real,dimension(DBZE_BINS) ::  dbze_ax
    259258  CHARACTER(LEN=20), DIMENSION(3)  :: chfreq = (/ '1day', '1d  ', '3h  ' /)           
     259  real,parameter,dimension(SR_BINS) :: sratio_ax = (/0.005, &
     260                                                  0.605,2.09,4.,6., &
     261                                          8.5,12.5,17.5,22.5,27.5,35.,45.,55.,70.,50040./)
    260262
    261263!!! Variables d'entree
     
    282284    enddo
    283285 
    284 
    285     sratio_bounds(2,:)=stlidar%srbval(:) ! srbval contains the upper
    286 !                                         limits from lmd_ipsl_stats.f90
    287     sratio_bounds(1,2:SR_BINS) = stlidar%srbval(1:SR_BINS-1)
    288     sratio_bounds(1,1)         = 0.0
    289     sratio_bounds(2,SR_BINS)   = 1.e5 ! This matches with Chepfer et al., JGR,
    290 !                                    ! 2009. However, it is not consistent
    291                                      ! with the upper limit in
    292                                      ! lmd_ipsl_stats.f90, which is
    293                                      ! LIDAR_UNDEF-1=998.999
    294      sratio_ax(:) = (sratio_bounds(1,:)+sratio_bounds(2,:))/2.0
    295 
    296286    cosp_outfilenames(1) = 'histmthCOSP'
    297287    cosp_outfilenames(2) = 'histdayCOSP'
     
    352342! AI nov 2015
    353343   CALL wxios_add_vaxis("temp", LIDAR_NTEMP, LIDAR_PHASE_TEMP)
    354    CALL wxios_add_vaxis("cth16", MISR_N_CTH, MISR_CTH)
     344   CALL wxios_add_vaxis("cth", MISR_N_CTH, MISR_CTH)
    355345   CALL wxios_add_vaxis("dbze", DBZE_BINS, dbze_ax)
    356346   CALL wxios_add_vaxis("scatratio", SR_BINS, sratio_ax)
     
    400390      CALL histvert(cosp_nidfiles(iff),"temp","temperature","C",LIDAR_NTEMP,LIDAR_PHASE_TEMP,nverttemp(iff))
    401391
    402       CALL histvert(cosp_nidfiles(iff),"cth16","altitude","m",MISR_N_CTH,MISR_CTH,nvertmisr(iff))
     392      CALL histvert(cosp_nidfiles(iff),"cth","altitude","m",MISR_N_CTH,MISR_CTH,nvertmisr(iff))
    403393 
    404394      CALL histvert(cosp_nidfiles(iff),"ReffIce","Effective_particle_size_Ice","microns",numMODISReffIceBins, reffICE_binCenters, &
  • LMDZ6/branches/DYNAMICO-conv/libf/phylmd/cosp/cosp_output_write_mod.F90

    r2955 r3356  
    66   USE cosp_output_mod
    77 
     8   IMPLICIT NONE
     9
    810   INTEGER, SAVE  :: itau_iocosp
    911!$OMP THREADPRIVATE(itau_iocosp)
     
    2729#ifdef CPP_XIOS
    2830    USE wxios, only: wxios_closedef
    29     USE xios, only: xios_update_calendar
    30 #endif
    31 
     31    USE xios, only: xios_update_calendar, xios_field_is_active
     32#endif
     33  IMPLICIT NONE 
    3234!!! Variables d'entree
    3335  integer               :: itap, Nlevlmdz, Ncolumns, Npoints
     
    4547
    4648!!! Variables locales
    47   integer               :: icl
     49  integer               :: icl,k,ip
    4850  logical               :: ok_sync
    49   integer               :: itau_wcosp
     51  integer               :: itau_wcosp, iff
    5052  real, dimension(Npoints,PARASOL_NREFL) :: parasolcrefl, Ncref
    5153
     54! Variables locals intermidiaires pour inverser les axes des champs 4D
     55! Compatibilite avec sorties CMIP
     56  real, dimension(Npoints,Nlevout,SR_BINS) :: tmp_fi4da_cfadL
     57  real, dimension(Npoints,Nlevout,DBZE_BINS) :: tmp_fi4da_cfadR
     58  real, dimension(Npoints,MISR_N_CTH,7) :: tmp_fi4da_misr
    5259
    5360#ifdef CPP_XIOS
     
    7986! On n'ecrit pas quand itap=1 (cosp)
    8087
    81    if (prt_level >= 10) then
    82          WRITE(lunout,*)'DO iinit=1, iinitend ',iinitend
    83    endif
    84 
    85 !#ifdef CPP_XIOS
     88!   if (prt_level >= 10) then
     89!         WRITE(lunout,*)'DO iinit=1, iinitend ',iinitend
     90!   endif
     91
     92!!#ifdef CPP_XIOS
    8693! !$OMP MASTER
    8794!IF (cosp_varsdefined) THEN
     
    94101!  !$OMP END MASTER
    95102!  !$OMP BARRIER
    96 !#endif
    97 
     103!!#endif
     104
     105!!!! Sorties Calipso
    98106 if (cfg%Llidar_sim) then
    99 ! Pb des valeurs indefinies, on les met a 0
    100 ! A refaire proprement
    101   do k = 1,Nlevout
    102      do ip = 1,Npoints
    103      if(stlidar%lidarcld(ip,k).eq.R_UNDEF)then
    104       stlidar%lidarcld(ip,k)=missing_val
    105      endif
    106      if(stlidar%proftemp(ip,k).eq.R_UNDEF)then !TIBO
    107       stlidar%proftemp(ip,k)=missing_val       !TIBO
    108      endif                                     !TIBO
    109      enddo
    110 
    111      do ii= 1,SR_BINS
    112       do ip = 1,Npoints
    113        if(stlidar%cfad_sr(ip,ii,k).eq.R_UNDEF)then
    114         stlidar%cfad_sr(ip,ii,k)=missing_val
    115        endif
    116       enddo
    117      enddo
    118 
    119      do ii= 1,Ncolumns                               !TIBO
    120       do ip = 1,Npoints                              !TIBO
    121 !       if(stlidar%profSR(ip,ii,k).eq.R_UNDEF)then    !TIBO
    122 !        stlidar%profSR(ip,ii,k)=missing_val          !TIBO
    123        if(stlidar%profSR(ip,k,ii).eq.R_UNDEF)then    !TIBO2
    124         stlidar%profSR(ip,k,ii)=missing_val          !TIBO2
    125        endif                                         !TIBO
    126       enddo                                          !TIBO
    127      enddo                                           !TIBO
    128   enddo
    129 
    130   do ip = 1,Npoints
    131    do k = 1,Nlevlmdz
    132      if(sglidar%beta_mol(ip,k).eq.R_UNDEF)then
    133       sglidar%beta_mol(ip,k)=missing_val
    134      endif
    135 
    136      do ii= 1,Ncolumns
    137        if(sglidar%beta_tot(ip,ii,k).eq.R_UNDEF)then
    138         sglidar%beta_tot(ip,ii,k)=missing_val
    139        endif
    140      enddo
    141 
    142     enddo    !k = 1,Nlevlmdz
    143    enddo     !ip = 1,Npoints
    144 
    145    do k = 1,LIDAR_NCAT
    146     do ip = 1,Npoints
    147      if(stlidar%cldlayer(ip,k).eq.R_UNDEF)then
    148        stlidar%cldlayer(ip,k)=missing_val
    149      endif
    150     enddo
    151    enddo
    152 
    153    do k = 1,LIDAR_NTYPE                       !OPAQ
    154     do ip = 1,Npoints                         !OPAQ
    155      if(stlidar%cldtype(ip,k).eq.R_UNDEF)then !OPAQ
    156        stlidar%cldtype(ip,k)=missing_val      !OPAQ
    157      endif                                    !OPAQ
    158     enddo                                     !OPAQ
    159    enddo                                      !OPAQ
    160 
     107!!! AI 02 2018
     108! Traitement missing_val
     109   where(stlidar%lidarcld == R_UNDEF) stlidar%lidarcld = missing_val
     110   where(stlidar%proftemp == R_UNDEF) stlidar%proftemp = missing_val   !TIBO 
     111   where(stlidar%profSR == R_UNDEF) stlidar%profSR = missing_val       !TIBO2
     112   where(sglidar%beta_mol == R_UNDEF) sglidar%beta_mol = missing_val 
     113   where(sglidar%beta_tot == R_UNDEF) sglidar%beta_tot = missing_val
     114   where(stlidar%cldlayer == R_UNDEF) stlidar%cldlayer = missing_val
     115   where(stlidar%cldtype == R_UNDEF) stlidar%cldtype = missing_val     !OPAQ
     116   where(stlidar%cfad_sr == R_UNDEF) stlidar%cfad_sr = missing_val
    161117! AI 11 / 2015
    162 
    163118   where(stlidar%parasolrefl == R_UNDEF) stlidar%parasolrefl = missing_val
    164119   where(stlidar%lidarcldtmp == R_UNDEF) stlidar%lidarcldtmp = missing_val
     
    167122   where(stlidar%lidarcldtype == R_UNDEF) stlidar%lidarcldtype = missing_val   !OPAQ
    168123   where(stlidar%lidarcldtmp == R_UNDEF) stlidar%lidarcldtmp = missing_val
    169    
    170 
    171    print*,'Appel histwrite2d_cosp'
    172    CALL histwrite2d_cosp(o_cllcalipso,stlidar%cldlayer(:,1))
    173    CALL histwrite2d_cosp(o_clhcalipso,stlidar%cldlayer(:,3))
    174    CALL histwrite2d_cosp(o_clmcalipso,stlidar%cldlayer(:,2))
    175    CALL histwrite2d_cosp(o_cltcalipso,stlidar%cldlayer(:,4))
    176    CALL histwrite3d_cosp(o_clcalipso,stlidar%lidarcld,nvert)
    177    CALL histwrite3d_cosp(o_clcalipsotmp,stlidar%lidarcldtmp(:,:,1),nverttemp)
    178 
    179    CALL histwrite2d_cosp(o_cllcalipsoice,stlidar%cldlayerphase(:,1,1))
    180    CALL histwrite2d_cosp(o_clhcalipsoice,stlidar%cldlayerphase(:,3,1))
    181    CALL histwrite2d_cosp(o_clmcalipsoice,stlidar%cldlayerphase(:,2,1))
    182    CALL histwrite2d_cosp(o_cltcalipsoice,stlidar%cldlayerphase(:,4,1))
    183    CALL histwrite3d_cosp(o_clcalipsoice,stlidar%lidarcldphase(:,:,1),nvert)
    184    CALL histwrite3d_cosp(o_clcalipsotmpice,stlidar%lidarcldtmp(:,:,2),nverttemp)
    185 
    186    CALL histwrite2d_cosp(o_cllcalipsoliq,stlidar%cldlayerphase(:,1,2))
    187    CALL histwrite2d_cosp(o_clhcalipsoliq,stlidar%cldlayerphase(:,3,2))
    188    CALL histwrite2d_cosp(o_clmcalipsoliq,stlidar%cldlayerphase(:,2,2))
    189    CALL histwrite2d_cosp(o_cltcalipsoliq,stlidar%cldlayerphase(:,4,2))
    190    CALL histwrite3d_cosp(o_clcalipsoliq,stlidar%lidarcldphase(:,:,2),nvert)
    191    CALL histwrite3d_cosp(o_clcalipsotmpliq,stlidar%lidarcldtmp(:,:,3),nverttemp)
    192 
    193    CALL histwrite2d_cosp(o_cllcalipsoun,stlidar%cldlayerphase(:,1,3))
    194    CALL histwrite2d_cosp(o_clhcalipsoun,stlidar%cldlayerphase(:,3,3))
    195    CALL histwrite2d_cosp(o_clmcalipsoun,stlidar%cldlayerphase(:,2,3))
    196    CALL histwrite2d_cosp(o_cltcalipsoun,stlidar%cldlayerphase(:,4,3))
    197    CALL histwrite3d_cosp(o_clcalipsoun,stlidar%lidarcldphase(:,:,3),nvert)
    198    CALL histwrite3d_cosp(o_clcalipsotmpun,stlidar%lidarcldtmp(:,:,4),nverttemp)
    199 
    200    CALL histwrite2d_cosp(o_clopaquecalipso,stlidar%cldtype(:,1))               !OPAQ
    201    CALL histwrite2d_cosp(o_clthincalipso,stlidar%cldtype(:,2))                 !OPAQ
    202    CALL histwrite2d_cosp(o_clzopaquecalipso,stlidar%cldtype(:,3))              !OPAQ
    203 
    204    CALL histwrite3d_cosp(o_clcalipsoopaque,stlidar%lidarcldtype(:,:,1),nvert)  !OPAQ
    205    CALL histwrite3d_cosp(o_clcalipsothin,stlidar%lidarcldtype(:,:,2),nvert)    !OPAQ
    206    CALL histwrite3d_cosp(o_clcalipsozopaque,stlidar%lidarcldtype(:,:,3),nvert) !OPAQ
    207    CALL histwrite3d_cosp(o_clcalipsoopacity,stlidar%lidarcldtype(:,:,4),nvert) !OPAQ
    208 
    209    CALL histwrite3d_cosp(o_proftemp,stlidar%proftemp,nvert)                    !TIBO
    210 
    211 #ifdef CPP_XIOS
    212    CALL histwrite4d_cosp(o_cfad_lidarsr532,stlidar%cfad_sr)
    213    CALL histwrite4d_cosp(o_profSR,stlidar%profSR)                              !TIBO
     124 
     125!   print*,'Appel histwrite2d_cosp'
     126   if (cfg%Lcllcalipso) CALL histwrite2d_cosp(o_cllcalipso,stlidar%cldlayer(:,1))
     127   if (cfg%Lclhcalipso) CALL histwrite2d_cosp(o_clhcalipso,stlidar%cldlayer(:,3))
     128   if (cfg%Lclmcalipso) CALL histwrite2d_cosp(o_clmcalipso,stlidar%cldlayer(:,2))
     129   if (cfg%Lcltcalipso) CALL histwrite2d_cosp(o_cltcalipso,stlidar%cldlayer(:,4))
     130   if (cfg%Lclcalipso) CALL histwrite3d_cosp(o_clcalipso,stlidar%lidarcld,nvert)
     131   if (cfg%Lclcalipsotmp) CALL histwrite3d_cosp(o_clcalipsotmp,stlidar%lidarcldtmp(:,:,1),nverttemp)
     132
     133   if (cfg%Lcllcalipsoice) CALL histwrite2d_cosp(o_cllcalipsoice,stlidar%cldlayerphase(:,1,1))
     134   if (cfg%Lclhcalipsoice) CALL histwrite2d_cosp(o_clhcalipsoice,stlidar%cldlayerphase(:,3,1))
     135   if (cfg%Lclmcalipsoice) CALL histwrite2d_cosp(o_clmcalipsoice,stlidar%cldlayerphase(:,2,1))
     136   if (cfg%Lcltcalipsoice) CALL histwrite2d_cosp(o_cltcalipsoice,stlidar%cldlayerphase(:,4,1))
     137   if (cfg%Lclcalipsoice) CALL histwrite3d_cosp(o_clcalipsoice,stlidar%lidarcldphase(:,:,1),nvert)
     138   if (cfg%Lclcalipsotmpice) CALL histwrite3d_cosp(o_clcalipsotmpice,stlidar%lidarcldtmp(:,:,2),nverttemp)
     139
     140   if (cfg%Lcllcalipsoliq) CALL histwrite2d_cosp(o_cllcalipsoliq,stlidar%cldlayerphase(:,1,2))
     141   if (cfg%Lclhcalipsoliq) CALL histwrite2d_cosp(o_clhcalipsoliq,stlidar%cldlayerphase(:,3,2))
     142   if (cfg%Lclmcalipsoliq) CALL histwrite2d_cosp(o_clmcalipsoliq,stlidar%cldlayerphase(:,2,2))
     143   if (cfg%Lcltcalipsoliq) CALL histwrite2d_cosp(o_cltcalipsoliq,stlidar%cldlayerphase(:,4,2))
     144   if (cfg%Lclcalipsoliq) CALL histwrite3d_cosp(o_clcalipsoliq,stlidar%lidarcldphase(:,:,2),nvert)
     145   if (cfg%Lclcalipsotmpliq) CALL histwrite3d_cosp(o_clcalipsotmpliq,stlidar%lidarcldtmp(:,:,3),nverttemp)
     146
     147   if (cfg%Lcllcalipsoun) CALL histwrite2d_cosp(o_cllcalipsoun,stlidar%cldlayerphase(:,1,3))
     148   if (cfg%Lclhcalipsoun) CALL histwrite2d_cosp(o_clhcalipsoun,stlidar%cldlayerphase(:,3,3))
     149   if (cfg%Lclmcalipsoun) CALL histwrite2d_cosp(o_clmcalipsoun,stlidar%cldlayerphase(:,2,3))
     150   if (cfg%Lcltcalipsoun) CALL histwrite2d_cosp(o_cltcalipsoun,stlidar%cldlayerphase(:,4,3))
     151   if (cfg%Lclcalipsoun) CALL histwrite3d_cosp(o_clcalipsoun,stlidar%lidarcldphase(:,:,3),nvert)
     152   if (cfg%Lclcalipsotmpun) CALL histwrite3d_cosp(o_clcalipsotmpun,stlidar%lidarcldtmp(:,:,4),nverttemp)
     153
     154   if (cfg%Lclopaquecalipso) CALL histwrite2d_cosp(o_clopaquecalipso,stlidar%cldtype(:,1))               !OPAQ
     155   if (cfg%Lclthincalipso) CALL histwrite2d_cosp(o_clthincalipso,stlidar%cldtype(:,2))                 !OPAQ
     156   if (cfg%Lclzopaquecalipso) CALL histwrite2d_cosp(o_clzopaquecalipso,stlidar%cldtype(:,3))              !OPAQ
     157
     158   if (cfg%Lclcalipsoopaque) CALL histwrite3d_cosp(o_clcalipsoopaque,stlidar%lidarcldtype(:,:,1),nvert)  !OPAQ
     159   if (cfg%Lclcalipsothin) CALL histwrite3d_cosp(o_clcalipsothin,stlidar%lidarcldtype(:,:,2),nvert)    !OPAQ
     160   if (cfg%Lclcalipsozopaque) CALL histwrite3d_cosp(o_clcalipsozopaque,stlidar%lidarcldtype(:,:,3),nvert) !OPAQ
     161   if (cfg%Lclcalipsoopacity) CALL histwrite3d_cosp(o_clcalipsoopacity,stlidar%lidarcldtype(:,:,4),nvert) !OPAQ
     162
     163   if (cfg%Lproftemp) CALL histwrite3d_cosp(o_proftemp,stlidar%proftemp,nvert)                    !TIBO
     164
     165#ifdef CPP_XIOS
     166   do icl=1,SR_BINS
     167      tmp_fi4da_cfadL(:,:,icl)=stlidar%cfad_sr(:,icl,:)
     168   enddo
     169!   if (cfg%LcfadLidarsr532) CALL histwrite4d_cosp(o_cfad_lidarsr532,stlidar%cfad_sr)
     170   if (cfg%LcfadLidarsr532) CALL histwrite4d_cosp(o_cfad_lidarsr532,tmp_fi4da_cfadL)
     171   if (cfg%LprofSR) CALL histwrite4d_cosp(o_profSR,stlidar%profSR)                              !TIBO
    214172#else
    215    do icl=1,SR_BINS
    216       CALL histwrite3d_cosp(o_cfad_lidarsr532,stlidar%cfad_sr(:,icl,:),nvert,icl)
     173   if (cfg%LcfadLidarsr532) then
     174     do icl=1,SR_BINS
     175        CALL histwrite3d_cosp(o_cfad_lidarsr532,stlidar%cfad_sr(:,icl,:),nvert,icl)
     176     enddo
     177   endif
     178   if (cfg%LprofSR) then
     179     do icl=1,Ncolumns                                                              !TIBO
     180        CALL histwrite3d_cosp(o_profSR,stlidar%profSR(:,icl,:),nvert,icl)           !TIBO
     181     enddo                                                                          !TIBO
     182   endif
     183#endif
     184   if (cfg%LparasolRefl) CALL histwrite3d_cosp(o_parasol_refl,stlidar%parasolrefl,nvertp)
     185
     186  if (cfg%LparasolRefl) then
     187    do k=1,PARASOL_NREFL
     188     do ip=1, Npoints
     189      if (stlidar%cldlayer(ip,4).gt.0.01.and.stlidar%parasolrefl(ip,k).ne.missing_val) then
     190        parasolcrefl(ip,k)=(stlidar%parasolrefl(ip,k)-0.03*(1.-stlidar%cldlayer(ip,4)))/ &
     191                             stlidar%cldlayer(ip,4)
     192         Ncref(ip,k) = 1.
     193      else
     194         parasolcrefl(ip,k)=missing_val
     195         Ncref(ip,k) = 0.
     196      endif
     197     enddo
     198    enddo
     199    CALL histwrite3d_cosp(o_Ncrefl,Ncref,nvertp)
     200    CALL histwrite3d_cosp(o_parasol_crefl,parasolcrefl,nvertp)
     201  endif
     202
     203#ifdef CPP_XIOS
     204   if (cfg%Latb532) CALL histwrite4d_cosp(o_atb532,sglidar%beta_tot)
     205#else
     206   if (cfg%Latb532) then 
     207     do icl=1,Ncolumns
     208        CALL histwrite3d_cosp(o_atb532,sglidar%beta_tot(:,icl,:),nvertmcosp,icl)
     209     enddo
     210   endif
     211#endif
     212
     213   if (cfg%LlidarBetaMol532) CALL histwrite3d_cosp(o_beta_mol532,sglidar%beta_mol,nvertmcosp)
     214
     215 endif !Lidar
     216
     217!!! Sorties Cloudsat
     218 if (cfg%Lradar_sim) then
     219
     220   where(stradar%cfad_ze == R_UNDEF) stradar%cfad_ze = missing_val
     221#ifdef CPP_XIOS
     222   do icl=1,DBZE_BINS
     223     tmp_fi4da_cfadR(:,:,icl)=stradar%cfad_ze(:,icl,:)
    217224   enddo
    218    do icl=1,Ncolumns                                                              !TIBO
    219       CALL histwrite3d_cosp(o_profSR,stlidar%profSR(:,icl,:),nvert,icl)           !TIBO
    220    enddo                                                                          !TIBO
    221      CALL histwrite3d_cosp(o_parasol_refl,stlidar%parasolrefl,nvertp)
    222 #endif
    223 
    224    do k=1,PARASOL_NREFL
    225     do ip=1, Npoints
    226      if (stlidar%cldlayer(ip,4).gt.0.01.and.stlidar%parasolrefl(ip,k).ne.missing_val) then
    227        parasolcrefl(ip,k)=(stlidar%parasolrefl(ip,k)-0.03*(1.-stlidar%cldlayer(ip,4)))/ &
    228                             stlidar%cldlayer(ip,4)
    229         Ncref(ip,k) = 1.
    230      else
    231         parasolcrefl(ip,k)=missing_val
    232         Ncref(ip,k) = 0.
    233      endif
     225   if (cfg%Ldbze94) CALL histwrite4d_cosp(o_dbze94,sgradar%Ze_tot)
     226!   if (cfg%LcfadDbze94) CALL histwrite4d_cosp(o_cfadDbze94,stradar%cfad_ze)
     227   if (cfg%LcfadDbze94) CALL histwrite4d_cosp(o_cfadDbze94,tmp_fi4da_cfadR)
     228#else
     229   if (cfg%Ldbze94) then
     230    do icl=1,Ncolumns
     231       CALL histwrite3d_cosp(o_dbze94,sgradar%Ze_tot(:,icl,:),nvert,icl)
    234232    enddo
    235    
    236    enddo
    237    CALL histwrite3d_cosp(o_Ncrefl,Ncref,nvertp)
    238    CALL histwrite3d_cosp(o_parasol_crefl,parasolcrefl,nvertp)
    239 
    240 #ifdef CPP_XIOS
    241    CALL histwrite4d_cosp(o_atb532,sglidar%beta_tot)
    242 #else
    243    do icl=1,Ncolumns
    244       CALL histwrite3d_cosp(o_atb532,sglidar%beta_tot(:,icl,:),nvertmcosp,icl)
    245    enddo
    246 #endif
    247 
    248    CALL histwrite3d_cosp(o_beta_mol532,sglidar%beta_mol,nvertmcosp)
    249  endif !Lidar
    250 
    251  if (cfg%Lradar_sim) then
    252 
    253 #ifdef CPP_XIOS
    254    CALL histwrite4d_cosp(o_dbze94,sgradar%Ze_tot)
    255    CALL histwrite4d_cosp(o_cfadDbze94,stradar%cfad_ze)
    256 #else
    257    do icl=1,Ncolumns
    258       CALL histwrite3d_cosp(o_dbze94,sgradar%Ze_tot(:,icl,:),nvertmcosp,icl)
    259    enddo
    260    do icl=1,DBZE_BINS
     233   endif
     234   if (cfg%LcfadDbze94) then
     235    do icl=1,DBZE_BINS
    261236    CALL histwrite3d_cosp(o_cfadDbze94,stradar%cfad_ze(:,icl,:),nvert,icl)
    262    enddo
     237    enddo
     238   endif
    263239#endif
    264240 endif
    265 
     241! endif pour radar
     242
     243!!! Sorties combinees Cloudsat et Calipso
    266244 if (cfg%Llidar_sim .and. cfg%Lradar_sim) then
    267245   where(stradar%lidar_only_freq_cloud == R_UNDEF) &
    268246                           stradar%lidar_only_freq_cloud = missing_val
    269    CALL histwrite3d_cosp(o_clcalipso2,stradar%lidar_only_freq_cloud,nvert)
     247   if (cfg%Lclcalipso) CALL histwrite3d_cosp(o_clcalipso2,stradar%lidar_only_freq_cloud,nvert)
    270248   where(stradar%radar_lidar_tcc == R_UNDEF) &
    271249                           stradar%radar_lidar_tcc = missing_val
    272    CALL histwrite2d_cosp(o_cltlidarradar,stradar%radar_lidar_tcc)
     250   if (cfg%Lcltlidarradar) CALL histwrite2d_cosp(o_cltlidarradar,stradar%radar_lidar_tcc)
    273251 endif
    274252
     253!!! Sorties Isccp
    275254 if (cfg%Lisccp_sim) then
    276 
    277 ! Traitement des valeurs indefinies
    278    do ip = 1,Npoints
    279     if(isccp%totalcldarea(ip).eq.R_UNDEF)then
    280       isccp%totalcldarea(ip)=missing_val
    281     endif
    282     if(isccp%meanptop(ip).eq.R_UNDEF)then
    283       isccp%meanptop(ip)=missing_val
    284     endif
    285     if(isccp%meantaucld(ip).eq.R_UNDEF)then
    286       isccp%meantaucld(ip)=missing_val
    287     endif
    288     if(isccp%meanalbedocld(ip).eq.R_UNDEF)then
    289      isccp%meanalbedocld(ip)=missing_val
    290     endif
    291     if(isccp%meantb(ip).eq.R_UNDEF)then
    292      isccp%meantb(ip)=missing_val
    293     endif
    294     if(isccp%meantbclr(ip).eq.R_UNDEF)then
    295        isccp%meantbclr(ip)=missing_val
    296     endif
    297 
    298     do k=1,7
    299      do ii=1,7
    300      if(isccp%fq_isccp(ip,ii,k).eq.R_UNDEF)then
    301       isccp%fq_isccp(ip,ii,k)=missing_val
    302      endif
     255  where(isccp%totalcldarea == R_UNDEF) isccp%totalcldarea = missing_val
     256  where(isccp%meanptop == R_UNDEF) isccp%meanptop = missing_val
     257  where(isccp%meantaucld == R_UNDEF) isccp%meantaucld = missing_val
     258  where(isccp%meanalbedocld == R_UNDEF) isccp%meanalbedocld = missing_val
     259  where(isccp%meantb == R_UNDEF) isccp%meantb = missing_val
     260  where(isccp%meantbclr == R_UNDEF) isccp%meantbclr = missing_val
     261  where(isccp%fq_isccp == R_UNDEF) isccp%fq_isccp = missing_val
     262  where(isccp%boxtau == R_UNDEF) isccp%boxtau = missing_val
     263  where(isccp%boxptop == R_UNDEF) isccp%boxptop = missing_val
     264
     265   CALL histwrite2d_cosp(o_sunlit,gbx%sunlit)
     266#ifdef CPP_XIOS
     267  if (cfg%Lclisccp) CALL histwrite4d_cosp(o_clisccp2,isccp%fq_isccp)
     268#else
     269   if (cfg%Lclisccp) then
     270     do icl=1,7
     271       CALL histwrite3d_cosp(o_clisccp2,isccp%fq_isccp(:,icl,:),nvertisccp,icl)
    303272     enddo
     273   endif
     274#endif
     275
     276   if (cfg%Lboxtauisccp) CALL histwrite3d_cosp(o_boxtauisccp,isccp%boxtau,nvertcol)
     277   if (cfg%Lboxptopisccp) CALL histwrite3d_cosp(o_boxptopisccp,isccp%boxptop,nvertcol)
     278   if (cfg%Lcltisccp) CALL histwrite2d_cosp(o_tclisccp,isccp%totalcldarea)
     279   if (cfg%Lpctisccp) CALL histwrite2d_cosp(o_ctpisccp,isccp%meanptop)
     280   if (cfg%Ltauisccp) CALL histwrite2d_cosp(o_tauisccp,isccp%meantaucld)
     281   if (cfg%Lalbisccp) CALL histwrite2d_cosp(o_albisccp,isccp%meanalbedocld)
     282   if (cfg%Lmeantbisccp) CALL histwrite2d_cosp(o_meantbisccp,isccp%meantb)
     283   if (cfg%Lmeantbclrisccp) CALL histwrite2d_cosp(o_meantbclrisccp,isccp%meantbclr)
     284 endif ! Isccp
     285
     286!!! MISR simulator
     287 if (cfg%Lmisr_sim) then
     288   where(misr%fq_MISR == R_UNDEF) misr%fq_MISR = missing_val
     289
     290#ifdef CPP_XIOS
     291   do icl=1,MISR_N_CTH
     292      tmp_fi4da_misr(:,icl,:)=misr%fq_MISR(:,:,icl)
     293   enddo
     294!   if (cfg%LclMISR) CALL histwrite4d_cosp(o_clMISR,misr%fq_MISR)
     295   if (cfg%LclMISR) CALL histwrite4d_cosp(o_clMISR,tmp_fi4da_misr)
     296#else
     297   if (cfg%LclMISR) then
     298    do icl=1,7
     299      CALL histwrite3d_cosp(o_clMISR,misr%fq_MISR(:,icl,:),nvertmisr,icl)
    304300    enddo
    305 
    306     do ii=1,Ncolumns
    307      if(isccp%boxtau(ip,ii).eq.R_UNDEF)then
    308        isccp%boxtau(ip,ii)=missing_val
    309      endif
    310     enddo
    311 
    312     do ii=1,Ncolumns
    313      if(isccp%boxptop(ip,ii).eq.R_UNDEF)then
    314       isccp%boxptop(ip,ii)=missing_val
    315      endif
    316     enddo
    317    enddo
    318 
    319    CALL histwrite2d_cosp(o_sunlit,gbx%sunlit)
    320 #ifdef CPP_XIOS
    321    CALL histwrite4d_cosp(o_clisccp2,isccp%fq_isccp)
    322 #else
    323    do icl=1,7
    324    CALL histwrite3d_cosp(o_clisccp2,isccp%fq_isccp(:,icl,:),nvertisccp,icl)
    325    enddo
    326 #endif
    327    CALL histwrite3d_cosp(o_boxtauisccp,isccp%boxtau,nvertcol)
    328    CALL histwrite3d_cosp(o_boxptopisccp,isccp%boxptop,nvertcol)
    329    CALL histwrite2d_cosp(o_tclisccp,isccp%totalcldarea)
    330    CALL histwrite2d_cosp(o_ctpisccp,isccp%meanptop)
    331    CALL histwrite2d_cosp(o_tauisccp,isccp%meantaucld)
    332    CALL histwrite2d_cosp(o_albisccp,isccp%meanalbedocld)
    333    CALL histwrite2d_cosp(o_meantbisccp,isccp%meantb)
    334    CALL histwrite2d_cosp(o_meantbclrisccp,isccp%meantbclr)
    335  endif ! Isccp
    336 
    337 ! MISR simulator
    338  if (cfg%Lmisr_sim) then
    339    do ip=1,Npoints
    340      do ii=1,7
    341        do k=1,MISR_N_CTH
    342         if(misr%fq_MISR(ip,ii,k).eq.R_UNDEF)then
    343             misr%fq_MISR(ip,ii,k)=missing_val
    344         endif
    345        enddo
    346      enddo
    347    enddo
    348 
    349 #ifdef CPP_XIOS
    350    CALL histwrite4d_cosp(o_clMISR,misr%fq_MISR)
    351 #else
    352    do icl=1,7
    353       CALL histwrite3d_cosp(o_clMISR,misr%fq_MISR(:,icl,:),nvertmisr,icl)
    354    enddo
     301   endif
    355302#endif
    356303 endif
    357 
    358 ! Modis simulator
     304! endif pour Misr
     305
     306!!! Modis simulator
    359307 if (cfg%Lmodis_sim) then
    360 
    361   do ip=1,Npoints
    362     if(modis%Cloud_Fraction_Low_Mean(ip).eq.R_UNDEF)then
    363       modis%Cloud_Fraction_Low_Mean(ip)=missing_val
    364     endif
    365     if(modis%Cloud_Fraction_High_Mean(ip).eq.R_UNDEF)then
    366        modis%Cloud_Fraction_High_Mean(ip)=missing_val
    367     endif
    368     if(modis%Cloud_Fraction_Mid_Mean(ip).eq.R_UNDEF)then
    369        modis%Cloud_Fraction_Mid_Mean(ip)=missing_val
    370     endif
    371     if(modis%Cloud_Fraction_Total_Mean(ip).eq.R_UNDEF)then
    372        modis%Cloud_Fraction_Total_Mean(ip)=missing_val
    373     endif
    374     if(modis%Cloud_Fraction_Water_Mean(ip).eq.R_UNDEF)then
    375        modis%Cloud_Fraction_Water_Mean(ip)=missing_val
    376     endif
    377     if(modis%Cloud_Fraction_Ice_Mean(ip).eq.R_UNDEF)then
    378        modis%Cloud_Fraction_Ice_Mean(ip)=missing_val
    379     endif
    380     if(modis%Optical_Thickness_Total_Mean(ip).eq.R_UNDEF)then
    381        modis%Optical_Thickness_Total_Mean(ip)=missing_val
    382     endif
    383     if(modis%Optical_Thickness_Water_Mean(ip).eq.R_UNDEF)then
    384        modis%Optical_Thickness_Water_Mean(ip)=missing_val
    385     endif
    386     if(modis%Optical_Thickness_Ice_Mean(ip).eq.R_UNDEF)then
    387        modis%Optical_Thickness_Ice_Mean(ip)=missing_val
    388     endif
    389     if(modis%Cloud_Particle_Size_Water_Mean(ip).eq.R_UNDEF)then
    390        modis%Cloud_Particle_Size_Water_Mean(ip)=missing_val
    391     endif
    392     if(modis%Cloud_Particle_Size_Ice_Mean(ip).eq.R_UNDEF)then
    393        modis%Cloud_Particle_Size_Ice_Mean(ip)=missing_val
    394     endif
    395     if(modis%Cloud_Top_Pressure_Total_Mean(ip).eq.R_UNDEF)then
    396        modis%Cloud_Top_Pressure_Total_Mean(ip)=missing_val
    397     endif
    398     if(modis%Liquid_Water_Path_Mean(ip).eq.R_UNDEF)then
    399        modis%Liquid_Water_Path_Mean(ip)=missing_val
    400     endif
    401     if(modis%Ice_Water_Path_Mean(ip).eq.R_UNDEF)then
    402        modis%Ice_Water_Path_Mean(ip)=missing_val
    403     endif
    404 
    405   enddo
    406 
    407     where(modis%Optical_Thickness_Total_LogMean == R_UNDEF) &
     308  where(modis%Cloud_Fraction_Low_Mean == R_UNDEF) &
     309        modis%Cloud_Fraction_Low_Mean = missing_val
     310  where(modis%Cloud_Fraction_High_Mean == R_UNDEF) &
     311        modis%Cloud_Fraction_High_Mean = missing_val
     312  where(modis%Cloud_Fraction_Mid_Mean == R_UNDEF) &
     313        modis%Cloud_Fraction_Mid_Mean = missing_val
     314  where(modis%Cloud_Fraction_Total_Mean == R_UNDEF) &
     315        modis%Cloud_Fraction_Total_Mean = missing_val
     316  where(modis%Cloud_Fraction_Water_Mean == R_UNDEF) &
     317        modis%Cloud_Fraction_Water_Mean = missing_val
     318  where(modis%Cloud_Fraction_Ice_Mean == R_UNDEF) &
     319        modis%Cloud_Fraction_Ice_Mean = missing_val
     320  where(modis%Optical_Thickness_Total_Mean == R_UNDEF) &
     321        modis%Optical_Thickness_Total_Mean = missing_val
     322  where(modis%Optical_Thickness_Water_Mean == R_UNDEF) &
     323        modis%Optical_Thickness_Water_Mean = missing_val
     324  where(modis%Optical_Thickness_Ice_Mean == R_UNDEF) &
     325        modis%Optical_Thickness_Ice_Mean = missing_val
     326  where(modis%Cloud_Particle_Size_Water_Mean == R_UNDEF) &
     327        modis%Cloud_Particle_Size_Water_Mean = missing_val
     328  where(modis%Cloud_Particle_Size_Ice_Mean == R_UNDEF) &
     329        modis%Cloud_Particle_Size_Ice_Mean = missing_val
     330  where(modis%Cloud_Top_Pressure_Total_Mean == R_UNDEF) &
     331        modis%Cloud_Top_Pressure_Total_Mean = missing_val
     332  where(modis%Liquid_Water_Path_Mean == R_UNDEF) &
     333        modis%Liquid_Water_Path_Mean = missing_val
     334  where(modis%Ice_Water_Path_Mean == R_UNDEF) &
     335        modis%Ice_Water_Path_Mean = missing_val
     336
     337  where(modis%Optical_Thickness_Total_LogMean == R_UNDEF) &
    408338          modis%Optical_Thickness_Total_LogMean = missing_val
    409339           
    410  
    411     where(modis%Optical_Thickness_Water_LogMean == R_UNDEF) &
     340  where(modis%Optical_Thickness_Water_LogMean == R_UNDEF) &
    412341          modis%Optical_Thickness_Water_LogMean = missing_val
    413342
    414     where(modis%Optical_Thickness_Ice_LogMean == R_UNDEF) &
     343  where(modis%Optical_Thickness_Ice_LogMean == R_UNDEF) &
    415344          modis%Optical_Thickness_Ice_LogMean = missing_val
    416345   
    417    CALL histwrite2d_cosp(o_cllmodis,modis%Cloud_Fraction_Low_Mean)
    418    CALL histwrite2d_cosp(o_clhmodis,modis%Cloud_Fraction_High_Mean)
    419    CALL histwrite2d_cosp(o_clmmodis,modis%Cloud_Fraction_Mid_Mean)
    420    CALL histwrite2d_cosp(o_cltmodis,modis%Cloud_Fraction_Total_Mean)
    421    CALL histwrite2d_cosp(o_clwmodis,modis%Cloud_Fraction_Water_Mean)
    422    CALL histwrite2d_cosp(o_climodis,modis%Cloud_Fraction_Ice_Mean)
    423    CALL histwrite2d_cosp(o_tautmodis,modis%Optical_Thickness_Total_Mean)
    424    CALL histwrite2d_cosp(o_tauwmodis,modis%Optical_Thickness_Water_Mean)
    425    CALL histwrite2d_cosp(o_tauimodis,modis%Optical_Thickness_Ice_Mean)
    426    CALL histwrite2d_cosp(o_tautlogmodis,modis%Optical_Thickness_Total_LogMean) 
    427    CALL histwrite2d_cosp(o_tauwlogmodis,modis%Optical_Thickness_Water_LogMean)
    428    CALL histwrite2d_cosp(o_tauilogmodis,modis%Optical_Thickness_Ice_LogMean)
    429    CALL histwrite2d_cosp(o_reffclwmodis,modis%Cloud_Particle_Size_Water_Mean)
    430    CALL histwrite2d_cosp(o_reffclimodis,modis%Cloud_Particle_Size_Ice_Mean)
    431    CALL histwrite2d_cosp(o_pctmodis,modis%Cloud_Top_Pressure_Total_Mean)
    432    CALL histwrite2d_cosp(o_lwpmodis,modis%Liquid_Water_Path_Mean)
    433    CALL histwrite2d_cosp(o_iwpmodis,modis%Ice_Water_Path_Mean)
    434 
    435    do ip=1,Npoints
    436      do ii=1,7
    437        do k=1,7
    438        if(modis%Optical_Thickness_vs_Cloud_Top_Pressure(ip,ii,k).eq.R_UNDEF)then
    439           modis%Optical_Thickness_vs_Cloud_Top_Pressure(ip,ii,k)=missing_val
    440         endif
    441        enddo
    442      enddo
    443     enddo
    444 
    445 #ifdef CPP_XIOS
    446    CALL histwrite4d_cosp(o_clmodis,modis%Optical_Thickness_vs_Cloud_Top_Pressure)
     346  if (cfg%Lcllmodis) CALL histwrite2d_cosp(o_cllmodis,modis%Cloud_Fraction_Low_Mean)
     347  if (cfg%Lclhmodis) CALL histwrite2d_cosp(o_clhmodis,modis%Cloud_Fraction_High_Mean)
     348  if (cfg%Lclmmodis) CALL histwrite2d_cosp(o_clmmodis,modis%Cloud_Fraction_Mid_Mean)
     349  if (cfg%Lcltmodis) CALL histwrite2d_cosp(o_cltmodis,modis%Cloud_Fraction_Total_Mean)
     350  if (cfg%Lclwmodis) CALL histwrite2d_cosp(o_clwmodis,modis%Cloud_Fraction_Water_Mean)
     351  if (cfg%Lclimodis) CALL histwrite2d_cosp(o_climodis,modis%Cloud_Fraction_Ice_Mean)
     352  if (cfg%Ltautmodis)  CALL histwrite2d_cosp(o_tautmodis,modis%Optical_Thickness_Total_Mean)
     353  if (cfg%Ltauwmodis) CALL histwrite2d_cosp(o_tauwmodis,modis%Optical_Thickness_Water_Mean)
     354  if (cfg%Ltauimodis) CALL histwrite2d_cosp(o_tauimodis,modis%Optical_Thickness_Ice_Mean)
     355  if (cfg%Ltautlogmodis) CALL histwrite2d_cosp(o_tautlogmodis,modis%Optical_Thickness_Total_LogMean) 
     356  if (cfg%Ltauwlogmodis) CALL histwrite2d_cosp(o_tauwlogmodis,modis%Optical_Thickness_Water_LogMean)
     357  if (cfg%Ltauilogmodis) CALL histwrite2d_cosp(o_tauilogmodis,modis%Optical_Thickness_Ice_LogMean)
     358  if (cfg%Lreffclwmodis) CALL histwrite2d_cosp(o_reffclwmodis,modis%Cloud_Particle_Size_Water_Mean)
     359  if (cfg%Lreffclimodis) CALL histwrite2d_cosp(o_reffclimodis,modis%Cloud_Particle_Size_Ice_Mean)
     360  if (cfg%Lpctmodis) CALL histwrite2d_cosp(o_pctmodis,modis%Cloud_Top_Pressure_Total_Mean)
     361  if (cfg%Llwpmodis) CALL histwrite2d_cosp(o_lwpmodis,modis%Liquid_Water_Path_Mean)
     362  if (cfg%Liwpmodis) CALL histwrite2d_cosp(o_iwpmodis,modis%Ice_Water_Path_Mean)
     363
     364    where(modis%Optical_Thickness_vs_Cloud_Top_Pressure == R_UNDEF) &
     365          modis%Optical_Thickness_vs_Cloud_Top_Pressure = missing_val
     366
     367#ifdef CPP_XIOS
     368   if (cfg%Lclmodis) CALL histwrite4d_cosp(o_clmodis,modis%Optical_Thickness_vs_Cloud_Top_Pressure)
    447369#else
     370  if (cfg%Lclmodis) then
    448371   do icl=1,7
    449372   CALL histwrite3d_cosp(o_clmodis, &
    450373     modis%Optical_Thickness_vs_Cloud_Top_Pressure(:,icl,:),nvertisccp,icl)           
    451374   enddo
     375  endif
    452376#endif
    453377
     
    459383
    460384#ifdef CPP_XIOS
    461 !    print*,'dimension de crimodis=',size(modis%Optical_Thickness_vs_ReffIce,2),&
    462 !                                    size(modis%Optical_Thickness_vs_ReffIce,3)
    463     CALL histwrite4d_cosp(o_crimodis,modis%Optical_Thickness_vs_ReffIce)
    464     CALL histwrite4d_cosp(o_crlmodis,modis%Optical_Thickness_vs_ReffLiq)
     385  if (cfg%Lcrimodis) CALL histwrite4d_cosp(o_crimodis,modis%Optical_Thickness_vs_ReffIce)
     386  if (cfg%Lcrlmodis) CALL histwrite4d_cosp(o_crlmodis,modis%Optical_Thickness_vs_ReffLiq)
    465387#else
     388  if (cfg%Lcrimodis) then
    466389    do icl=1,7
    467    CALL histwrite3d_cosp(o_crimodis, &
    468      modis%Optical_Thickness_vs_ReffIce(:,icl,:),nvertReffIce,icl)
    469    CALL histwrite3d_cosp(o_crlmodis, &
    470      modis%Optical_Thickness_vs_ReffLiq(:,icl,:),nvertReffLiq,icl)
     390     CALL histwrite3d_cosp(o_crimodis, &
     391          modis%Optical_Thickness_vs_ReffIce(:,icl,:),nvertReffIce,icl)
    471392    enddo
    472 #endif
    473  endif
     393  endif
     394  if (cfg%Lcrlmodis) then
     395    do icl=1,7
     396     CALL histwrite3d_cosp(o_crlmodis, &
     397          modis%Optical_Thickness_vs_ReffLiq(:,icl,:),nvertReffLiq,icl)
     398    enddo
     399  endif
     400#endif
     401 endif !modis
    474402
    475403 IF(.NOT.cosp_varsdefined) THEN
     
    915843
    916844#ifdef CPP_XIOS
    917     IF (ok_all_xml) THEN
     845!    IF (ok_all_xml) THEN
    918846     CALL xios_send_field(var%name, Field4d(:,:,1:nlev,1:nlev2))
    919847     IF (prt_level >= 1) WRITE(lunout,*)'xios_send_field ',var%name
    920     ENDIF
     848!    ENDIF
    921849#endif
    922850
  • LMDZ6/branches/DYNAMICO-conv/libf/phylmd/cosp/lidar_simulator.F90

    r2428 r3356  
    121121!---------------------------------------------------------------------------------
    122122
     123      USE MOD_COSP_CONSTANTS, only : ok_debug_cosp
    123124      IMPLICIT NONE
    124125      REAL :: SRsat
     
    201202      REAL pnorm_perp_liq(npoints,nlev) ! perpendicular lidar backscattered signal power for liq
    202203
     204      REAL :: seuil
     205
    203206! Output variable
    204207      REAL pnorm_perp_tot (npoints,nlev) ! perpendicular lidar backscattered signal power
     
    235238         Gamma = 0.009
    236239
     240  if (ok_debug_cosp) then
     241     seuil=1.e-18
     242  else
     243     seuil=0.0
     244  endif
    237245!------------------------------------------------------------
    238246!---- 1. Preliminary definitions and calculations :
     
    494502
    495503      DO k= nlev, 1, -1
    496               pnorm_perp_ice(:,k) = Alpha * pnorm_ice(:,k) ! Ice particles
    497               pnorm_perp_liq(:,k) = 1000*Beta * pnorm_liq(:,k)**2 + Gamma * pnorm_liq(:,k) ! Liquid particles
     504         pnorm_perp_ice(:,k) = Alpha * pnorm_ice(:,k) ! Ice particles
     505         pnorm_perp_liq(:,k) = 1000*Beta * pnorm_liq(:,k)**2 + Gamma * pnorm_liq(:,k) ! Liquid particles
    498506      ENDDO
    499507
     
    523531          tautot_lay_liq(:) = tautot_liq(:,k)-tautot_liq(:,k+1)
    524532        WHERE (tautot_lay_liq(:).GT.0.)
    525          beta_perp_liq(:,k) = pnorm_perp_liq(:,k)/ EXP(-2.0*tautot_liq(:,k+1)) * (2.*tautot_lay_liq(:)) &
    526             & / (1.-exp(-2.0*tautot_lay_liq(:)))
     533         beta_perp_liq(:,k) = pnorm_perp_liq(:,k)/ max(seuil,EXP(-2.0*tautot_liq(:,k+1))) &
     534            & * (2.*tautot_lay_liq(:)) / (1.-exp(-2.0*tautot_lay_liq(:)))
    527535
    528536        ELSEWHERE
  • LMDZ6/branches/DYNAMICO-conv/libf/phylmd/cosp/phys_cosp.F90

    r2835 r3356  
    8484  use cosp_output_write_mod
    8585!  use MOD_COSP_Modis_Simulator, only : cosp_modis
     86#ifdef CPP_XIOS
     87    USE xios, ONLY: xios_field_is_active
     88#endif
     89  use cosp_read_otputkeys
    8690
    8791  IMPLICIT NONE
     
    136140!$OMP THREADPRIVATE(debut_cosp)
    137141
     142  logical, save :: first_write=.true.
     143!$OMP THREADPRIVATE(first_write)
     144
    138145!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Input variables from LMDZ-GCM
    139146  integer                         :: overlaplmdz   !  overlap type: 1=max, 2=rand, 3=max/rand ! cosp input (output lmdz)
     
    147154  real                            :: dtime,freq_cosp
    148155  real,dimension(2)               :: time_bnds
     156
     157  double precision                            :: d_dtime
     158  double precision,dimension(2)               :: d_time_bnds
    149159 
     160  real,dimension(2,SR_BINS) :: sratio_bounds
     161  real,dimension(SR_BINS)   ::  sratio_ax
     162
    150163   namelist/COSP_INPUT/overlap,isccp_topheight,isccp_topheight_direction, &
    151164              npoints_it,ncolumns,use_vgrid,nlr,csat_vgrid, &
     
    157170
    158171!---------------- End of declaration of variables --------------
    159    
    160172
    161173!+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
     
    170182  CALL read_cosp_input
    171183
    172 ! Clefs Outputs
    173   call read_cosp_output_nl(cosp_output_nl,cfg)
     184! Clefs Outputs initialisation
     185  call cosp_outputkeys_init(cfg)
     186!!!   call cosp_outputkeys_test(cfg)
     187  print*,' Cles des differents simulateurs cosp a itap :',itap
     188  print*,'Lradar_sim,Llidar_sim,Lisccp_sim,Lmisr_sim,Lmodis_sim,Lrttov_sim,Lstats', &
     189          cfg%Lradar_sim,cfg%Llidar_sim,cfg%Lisccp_sim,cfg%Lmisr_sim,cfg%Lmodis_sim, &
     190          cfg%Lrttov_sim,cfg%Lstats
    174191
    175192    if (overlaplmdz.ne.overlap) then
     
    178195   print*,'Fin lecture Namelists, debut_cosp =',debut_cosp
    179196
    180   print*,' Cles des differents simulateurs cosp :'
    181   print*,'Lradar_sim,Llidar_sim,Lisccp_sim,Lmisr_sim,Lmodis_sim,Lrttov_sim', &
    182           cfg%Lradar_sim,cfg%Llidar_sim,cfg%Lisccp_sim,cfg%Lmisr_sim,cfg%Lmodis_sim,cfg%Lrttov_sim
    183 
    184197  endif ! debut_cosp
     198
     199!!! Ici on modifie les cles logiques pour les outputs selon les champs actives dans les .xml
     200  if ((itap.gt.1).and.(first_write))then
     201#ifdef CPP_XIOS
     202    call read_xiosfieldactive(cfg)
     203#else
     204    call read_cosp_output_nl(itap,cosp_output_nl,cfg)
     205#endif
     206    first_write=.false.
     207
     208    print*,' Cles des differents simulateurs cosp a itap :',itap
     209    print*,'Lradar_sim,Llidar_sim,Lisccp_sim,Lmisr_sim,Lmodis_sim,Lrttov_sim,Lstats', &
     210          cfg%Lradar_sim,cfg%Llidar_sim,cfg%Lisccp_sim,cfg%Lmisr_sim,cfg%Lmodis_sim, &
     211          cfg%Lrttov_sim,cfg%Lstats
     212  endif
    185213
    186214  time_bnds(1) = dtime-dtime/2.
    187215  time_bnds(2) = dtime+dtime/2.
    188216
    189 !  print*,'Debut phys_cosp itap,dtime,freq_cosp,ecrit_mth,ecrit_day,ecrit_hf ', &
    190 !          itap,dtime,freq_cosp,ecrit_mth,ecrit_day,ecrit_hf
     217  d_time_bnds=time_bnds
     218  d_dtime=dtime
     219
    191220!+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
    192221! Allocate memory for gridbox type
     
    195224!        print *, 'Allocating memory for gridbox type...'
    196225
    197 !! AI
    198 !        call construct_cosp_gridbox(dble(itap),radar_freq,surface_radar,use_mie_tables,use_gas_abs,do_ray,melt_lay,k2, &
    199 !                                    Npoints,Nlevels,Ncolumns,N_HYDRO,Nprmts_max_hydro,Naero,Nprmts_max_aero,Npoints_it, &
    200 !                                    lidar_ice_type,isccp_topheight,isccp_topheight_direction,overlap,emsfc_lw, &
    201 !                                    use_precipitation_fluxes,use_reff, &
    202 !                                    Platform,Satellite,Instrument,Nchannels,ZenAng, &
    203 !                                    channels(1:Nchannels),surfem(1:Nchannels),co2,ch4,n2o,co,gbx)
    204226! Surafce emissivity
    205227        emsfc_lw = 1.
    206228
    207         call construct_cosp_gridbox(dtime,time_bnds,radar_freq,surface_radar,use_mie_tables,use_gas_abs, &
     229        call construct_cosp_gridbox(d_dtime,d_time_bnds,radar_freq,surface_radar,use_mie_tables,use_gas_abs, &
    208230                                    do_ray,melt_lay,k2, &
    209231                                    Npoints,Nlevels,Ncolumns,N_HYDRO,Nprmts_max_hydro,Naero,Nprmts_max_aero,Npoints_it, &
     
    321343
    322344!+++++++++++++ Open output files and define output files axis !+++++++++++++
    323      if (debut_cosp) then
     345!    if (debut_cosp) then
    324346
    325347      !$OMP MASTER
    326         print *, ' Open outpts files and define axis'
     348!        print *, ' Open outpts files and define axis'
    327349        call cosp_output_open(Nlevlmdz, Ncolumns, presnivs, dtime, freq_cosp, &
    328350                              ok_mensuelCOSP, ok_journeCOSP, ok_hfCOSP, ok_all_xml, &
     
    331353      !$OMP BARRIER
    332354        debut_cosp=.false.
    333       endif ! debut_cosp
     355!      endif ! debut_cosp
     356!    else
    334357!+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
    335358        ! Call simulator
     
    344367!#endif
    345368!!
    346 
    347369!+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
    348370
     
    353375                               cfg, gbx, vgrid, sglidar, sgradar, stlidar, stradar, &
    354376                               isccp, misr, modis)
    355 
     377!    endif !debut_cosp
    356378!+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
    357379        ! Deallocate memory in derived types
    358380!+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
    359 !        print *, 'Deallocating memory...'
     381        print *, 'Deallocating memory...'
    360382        call free_cosp_gridbox(gbx)
    361383        call free_cosp_subgrid(sgx)
  • LMDZ6/branches/DYNAMICO-conv/libf/phylmd/cosp/radar_simulator_types.F90

    r2428 r3356  
    44! Part of QuickBeam v1.03 by John Haynes
    55! Updated by Roj Marchand June 2010
    6 
     6  implicit none
    77  integer, parameter ::       &
    88  maxhclass = 20         ,& ! max number of hydrometeor classes
  • LMDZ6/branches/DYNAMICO-conv/libf/phylmd/cpl_mod.F90

    • Property svn:executable deleted
  • LMDZ6/branches/DYNAMICO-conv/libf/phylmd/cv3_crit.F90

    r1992 r3356  
    1010  ! **************************************************************
    1111
     12  IMPLICIT NONE
    1213
    1314  include "cv3param.h"
  • LMDZ6/branches/DYNAMICO-conv/libf/phylmd/cv3_enthalpmix.F90

    r2902 r3356  
    5050  REAL                                      :: cpn
    5151  REAL                                      :: x, y, p0, p0m1, zdelta, zcor
    52   REAL                                      :: dpmin=1.
     52  REAL, SAVE                                :: dpmin=1.
    5353!$OMP THREADPRIVATE(dpmin)
    5454  REAL, DIMENSION(len)                      :: plim2p  ! = min(plim2(:),plim1(:)-dpmin)
  • LMDZ6/branches/DYNAMICO-conv/libf/phylmd/cv3_estatmix.F90

    r2902 r3356  
    5353  REAL                                      :: cpn
    5454  REAL                                      :: x, y, p0, zdelta, zcor
    55   REAL                                      :: dpmin=1.
     55  REAL, SAVE                                :: dpmin=1.
    5656!$OMP THREADPRIVATE(dpmin)
    5757  REAL, DIMENSION(len)                      :: plim2p  ! = min(plim2(:),plim1(:)-dpmin)
  • LMDZ6/branches/DYNAMICO-conv/libf/phylmd/cv3_routines.F90

    r3355 r3356  
    34053405DO i = 2, nlp
    34063406  DO il = 1, ncum
    3407     upwd(il,i) = max(0., upwd(il,i-1) - up_to(il,i-1) + up_from(il,i-1))
     3407    IF (i<=inb(il)+1) THEN
     3408      upwd(il,i) = max(0., upwd(il,i-1) - up_to(il,i-1) + up_from(il,i-1))
     3409    ENDIF
    34083410  ENDDO
    34093411ENDDO
     
    43724374
    43734375!inputs:
    4374   INTEGER ncum, nd, na, nloc, len
    4375   REAL ment(nloc, na, na), sigij(nloc, na, na)
    4376   REAL clw(nloc, nd), elij(nloc, na, na)
    4377   REAL ep(nloc, na)
    4378   INTEGER icb(nloc), inb(nloc)
    4379   REAL Vprecip(nloc, nd+1)
     4376  INTEGER, INTENT (IN)                               :: ncum, nd, na, nloc, len
     4377  INTEGER, DIMENSION (len), INTENT (IN)              :: icb, inb
     4378  REAL, DIMENSION (len, na, na), INTENT (IN)         :: ment, sigij, elij
     4379  REAL, DIMENSION (len, nd), INTENT (IN)             :: clw
     4380  REAL, DIMENSION (len, na), INTENT (IN)             :: ep
     4381  REAL, DIMENSION (len, nd+1), INTENT (IN)           :: Vprecip
    43804382!ouputs:
    4381   REAL da(nloc, na), phi(nloc, na, na)
    4382   REAL phi2(nloc, na, na)
    4383   REAL d1a(nloc, na), dam(nloc, na)
    4384   REAL epmlmMm(nloc, na, na), eplaMm(nloc, na)
     4383  REAL, DIMENSION (len, na, na), INTENT (OUT)        :: phi, phi2, epmlmMm
     4384  REAL, DIMENSION (len, na), INTENT (OUT)            :: da, d1a, dam, eplaMm
     4385!
    43854386! variables pour tracer dans precip de l'AA et des mel
    43864387!local variables:
  • LMDZ6/branches/DYNAMICO-conv/libf/phylmd/cva_driver.F90

    r3355 r3356  
    12031203                           wdtrainA1, wdtrainM1,                       & ! RomP
    12041204                           qtc1, sigt1, epmax_diag1) ! epmax_cape
     1205!   
     1206      IF (prt_level >= 10) THEN
     1207        Print *, 'cva_driver after cv3_uncompress:ft1(1) , ftd1(1) ', &
     1208                    ft1(igout,1), ftd1(igout,1)
     1209        Print *, 'cva_driver after cv3_uncompress:fq1(1) , fqd1(1) ', &
     1210                    fq1(igout,1), fqd1(igout,1)
     1211      ENDIF
     1212!   
    12051213    END IF
    12061214
  • LMDZ6/branches/DYNAMICO-conv/libf/phylmd/cvltr_noscav.F90

    r2320 r3356  
    3939  INTEGER                         :: i,k,j
    4040  REAL                            :: pdtimeRG
     41  REAL                            :: smallest_mp
    4142  real conserv
    4243  real smfd
     
    4748! calcul des tendances liees au downdraft
    4849! =========================================
     50!
     51  smallest_mp = tiny(mp(1,1))
    4952!cdir collapse
    5053  qfeed(:,it) = 0.
     
    8588     DO j=k-1,1,-1
    8689        DO i=1,klon
    87            if(mp(i,j+1).ne.0) then
    88               zmd(i,j,k)=zmd(i,j+1,k)*min(1.,mp(i,j)/mp(i,j+1))
    89            ENDif
     90!!           if(mp(i,j+1).ne.0) then
     91!!              zmd(i,j,k)=zmd(i,j+1,k)*min(1.,mp(i,j)/mp(i,j+1))
     92!!           ENDif
     93           zmd(i,j,k)=zmd(i,j+1,k)*mp(i,j)/max(mp(i,j),mp(i,j+1),smallest_mp)
    9094        END DO
    9195     END DO
  • LMDZ6/branches/DYNAMICO-conv/libf/phylmd/dyn1d/1DUTILS.h

    r3008 r3356  
    35693569        read (ilesfile,*) kmax2,nt1,nt2
    35703570        if (nt2>ntrac) then
    3571           stop'Augmenter le nombre de traceurs dans traceur.def'
     3571          stop 'Augmenter le nombre de traceurs dans traceur.def'
    35723572        endif
    35733573        if (kmax .ne. kmax2) then
  • LMDZ6/branches/DYNAMICO-conv/libf/phylmd/dyn1d/1D_decl_cases.h

    r2716 r3356  
    228228        logical  :: trouve_700=.true.
    229229        parameter (dt_sandu=6.*3600.)   ! forcages donnes ttes les 6 heures par ifa_sandu.txt
    230         parameter (tau_sandu=3600.)  ! temps de relaxation u,v,thetal,qt vers profil init et au dessus 700hPa
     230        parameter (tau_sandu=30000*3600.)  ! temps de relaxation u,v,thetal,qt vers profil init et au dessus 700hPa
    231231!!
    232232        real ts_sandu(nt_sandu)
  • LMDZ6/branches/DYNAMICO-conv/libf/phylmd/dyn1d/1D_nudge_sandu_astex.h

    r2921 r3356  
    2020!     print *,'l dt  relax dtadv',l,dt_phys(l),relax_thl(l),d_t_adv(l)
    2121      enddo
    22         u(1:mxcalc)=u(1:mxcalc) + timestep*(                                &         
     22
     23        u(1:mxcalc)=u(1:mxcalc) + timestep*( du_age(1:mxcalc)+             &         
    2324     &              du_phys(1:mxcalc) - relax_u(1:mxcalc))
    24         v(1:mxcalc)=v(1:mxcalc) + timestep*(                                &
     25        v(1:mxcalc)=v(1:mxcalc) + timestep*( dv_age(1:mxcalc)+              &
    2526     &               dv_phys(1:mxcalc) - relax_v(1:mxcalc))
    26 !       q(1:mxcalc,:)=q(1:mxcalc,:)+timestep*(
    27 !    .              dq(1:mxcalc,:) - relax_q(1:mxcalc,:)+
    28 !    .              d_q_adv(1:mxcalc,:))
    2927        q(1:mxcalc,1)=q(1:mxcalc,1)+timestep*(                              &
    3028     &      dq(1:mxcalc,1) - relax_q(1:mxcalc,1)+d_q_adv(1:mxcalc,1))
     
    3432     &      dt_phys(1:mxcalc)-relax_thl(1:mxcalc)+d_t_adv(1:mxcalc))
    3533
     34
  • LMDZ6/branches/DYNAMICO-conv/libf/phylmd/dyn1d/lmdz1d.F90

    r2983 r3356  
    286286       hthturb_gcssold = 0.
    287287       hqturb_gcssold = 0.
     288
     289
     290
    288291
    289292!---------------------------------------------------------------------
     
    509512      call ymds2ju(annee_ref,mois,day_ref,heure,day)
    510513      day_ini = int(day)
    511       day_end = day_ini + fnday
     514      day_end = day_ini + int(fnday)
    512515
    513516      IF (forcing_type .eq.2) THEN
     
    582585      call infotrac_init
    583586
    584       if (nqtot>nqmx) STOP'Augmenter nqmx dans lmdz1d.F'
     587      if (nqtot>nqmx) STOP 'Augmenter nqmx dans lmdz1d.F'
    585588      allocate(q(llm,nqtot)) ; q(:,:)=0.
    586589      allocate(dq(llm,nqtot))
     
    985988!
    986989!=====================================================================
     990       CALL iophys_ini
    987991! START OF THE TEMPORAL LOOP :
    988992!=====================================================================
     
    11091113      endif     
    11101114!RC
     1115      if (forcing_sandu) then
     1116         ug(1:llm)=u_mod(1:llm)
     1117         vg(1:llm)=v_mod(1:llm)
     1118      endif
    11111119
    11121120      IF (prt_level >= 5) print*, 'fcoriolis, xlat,mxcalc ', &
    11131121                                   fcoriolis, xlat,mxcalc
    11141122
    1115        du_age(1:mxcalc)=fcoriolis*(v(1:mxcalc)-vg(1:mxcalc))
    1116        dv_age(1:mxcalc)=-fcoriolis*(u(1:mxcalc)-ug(1:mxcalc))
    11171123!       print *,'u-ug=',u-ug
    11181124
    11191125!!!!!!!!!!!!!!!!!!!!!!!!
    11201126! Geostrophic wind
     1127! Le calcul ci dessous est insuffisamment precis
     1128!      du_age(1:mxcalc)=fcoriolis*(v(1:mxcalc)-vg(1:mxcalc))
     1129!      dv_age(1:mxcalc)=-fcoriolis*(u(1:mxcalc)-ug(1:mxcalc))
    11211130!!!!!!!!!!!!!!!!!!!!!!!!
    11221131       sfdt = sin(0.5*fcoriolis*timestep)
  • LMDZ6/branches/DYNAMICO-conv/libf/phylmd/ener_conserv.F90

    r2903 r3356  
    222222      DO k=1,klev
    223223        bils_ec(:)=bils_ec(:)-d_t_ec(:,k)*masse(:,k)
    224         bils_tke(:)=bils_tke(:)+0.5*(dtke(:,k)+dtke(:,k+1))*masse(:,k)
    225224        bils_diss(:)=bils_diss(:)-d_t_diss(:,k)*masse(:,k)
    226225        bils_kinetic(:)=bils_kinetic(:)+masse(:,k)* &
     
    235234      ENDDO
    236235      bils_ec(:)=rcpd*bils_ec(:)/pdtphys
    237       bils_tke(:)=bils_tke(:)/pdtphys
    238236      bils_diss(:)=rcpd*bils_diss(:)/pdtphys
    239237      bils_kinetic(:)= 0.5*bils_kinetic(:)/pdtphys
    240238      bils_enthalp(:)=rcpd*bils_enthalp(:)/pdtphys
    241239      bils_latent(:)=rlvtt*bils_latent(:)/pdtphys
     240!jyg<
     241      IF (iflag_pbl > 1) THEN
     242        DO k=1,klev
     243          bils_tke(:)=bils_tke(:)+0.5*(dtke(:,k)+dtke(:,k+1))*masse(:,k)
     244        ENDDO
     245        bils_tke(:)=bils_tke(:)/pdtphys
     246      ENDIF  ! (iflag_pbl > 1)
     247!>jyg
    242248
    243249IF (iflag_ener_conserv>=1) THEN
  • LMDZ6/branches/DYNAMICO-conv/libf/phylmd/flott_gwd_rando_m.F90

    r2665 r3356  
    1818      use dimphy, only: klon, klev
    1919      use assert_m, only: assert
     20      USE ioipsl_getin_p_mod, ONLY : getin_p
     21      USE vertical_layers_mod, ONLY : presnivs
     22
    2023      include "YOMCST.h"
    2124      include "clesphys.h"
     
    103106    REAL PH(KLON, KLEV + 1) ! Pressure at 1/2 levels
    104107    REAL PSEC ! Security to avoid division by 0 pressure
    105     REAL PHM1(KLON, KLEV + 1) ! 1/Press at 1/2 levels
    106108    REAL BV(KLON, KLEV + 1) ! Brunt Vaisala freq. (BVF) at 1/2 levels
    107109    REAL BVSEC ! Security to avoid negative BVF
     110    REAL RAN_NUM_1,RAN_NUM_2,RAN_NUM_3
     111
     112    REAL, DIMENSION(klev+1) ::HREF
     113
     114    LOGICAL, SAVE :: gwd_reproductibilite_mpiomp=.true.
     115    LOGICAL, SAVE :: firstcall = .TRUE.
     116  !$OMP THREADPRIVATE(firstcall,gwd_reproductibilite_mpiomp)
     117
     118    CHARACTER (LEN=20) :: modname='flott_gwd_rando'
     119    CHARACTER (LEN=80) :: abort_message
     120
     121
     122
     123  IF (firstcall) THEN
     124    ! Cle introduite pour resoudre un probleme de non reproductibilite
     125    ! Le but est de pouvoir tester de revenir a la version precedenete
     126    ! A eliminer rapidement
     127    CALL getin_p('gwd_reproductibilite_mpiomp',gwd_reproductibilite_mpiomp)
     128    IF (NW+3*NA>=KLEV) THEN
     129       abort_message = 'NW+3*NA>=KLEV Probleme pour generation des ondes'
     130       CALL abort_physic (modname,abort_message,1)
     131    ENDIF
     132    firstcall=.false.
     133  ENDIF
     134
    108135
    109136    !-----------------------------------------------------------------
     
    156183    ZOISEC = 1.E-6 ! Security FOR 0 INTRINSIC FREQ
    157184
     185IF (1==0) THEN
    158186    !ONLINE
    159187        call assert(klon == (/size(pp, 1), size(tt, 1), size(uu, 1), &
     
    167195          "FLOTT_GWD_RANDO klev")
    168196    !END ONLINE
     197ENDIF
    169198
    170199    IF(DELTAT < DTIME)THEN
     
    183212    DO LL = 2, KLEV
    184213       PH(:, LL) = EXP((LOG(PP(:, LL)) + LOG(PP(:, LL - 1))) / 2.)
    185        PHM1(:, LL) = 1. / PH(:, LL)
    186     end DO
    187 
     214    end DO
    188215    PH(:, KLEV + 1) = 0.
    189     PHM1(:, KLEV + 1) = 1. / PSEC
    190216    PH(:, 1) = 2. * PP(:, 1) - PH(:, 2)
    191217
    192218    ! Launching altitude
     219
     220    !Pour revenir a la version non reproductible en changeant le nombre de process
     221    IF (gwd_reproductibilite_mpiomp) THEN
     222       ! Reprend la formule qui calcule PH en fonction de PP=play
     223       DO LL = 2, KLEV
     224          HREF(LL) = EXP((LOG(presnivs(LL)) + LOG(presnivs(LL - 1))) / 2.)
     225       end DO
     226       HREF(KLEV + 1) = 0.
     227       HREF(1) = 2. * presnivs(1) - HREF(2)
     228    ELSE
     229       HREF(1:KLEV)=PH(KLON/2,1:KLEV)
     230    ENDIF
    193231
    194232    LAUNCH=0
    195233    LTROP =0
    196234    DO LL = 1, KLEV
    197        IF (PH(KLON / 2, LL) / PH(KLON / 2, 1) > XLAUNCH) LAUNCH = LL
     235       IF (HREF(LL) / HREF(1) > XLAUNCH) LAUNCH = LL
    198236    ENDDO
    199237    DO LL = 1, KLEV
    200        IF (PH(KLON / 2, LL) / PH(KLON / 2, 1) > XTROP) LTROP = LL
     238       IF (HREF(LL) / HREF(1) > XTROP) LTROP = LL
    201239    ENDDO
     240    !LAUNCH=22 ; LTROP=33
     241!   print*,'LAUNCH=',LAUNCH,'LTROP=',LTROP
    202242
    203243    ! Log pressure vert. coordinate
     
    245285    ! waves characteristics in an almost stochastic way
    246286
    247     JW = 0
    248     DO JP = 1, NP
    249        DO JK = 1, NK
    250           DO JO = 1, NO
    251              JW = JW + 1
     287    DO JW = 1, NW
    252288             ! Angle
    253289             DO II = 1, KLON
    254290                ! Angle (0 or PI so far)
    255                 ZP(JW, II) = (SIGN(1., 0.5 - MOD(TT(II, JW) * 10., 1.)) + 1.) &
     291                RAN_NUM_1=MOD(TT(II, JW) * 10., 1.)
     292                RAN_NUM_2= MOD(TT(II, JW) * 100., 1.)
     293                ZP(JW, II) = (SIGN(1., 0.5 - RAN_NUM_1) + 1.) &
    256294                     * RPI / 2.
    257295                ! Horizontal wavenumber amplitude
    258                 ZK(JW, II) = KMIN + (KMAX - KMIN) * MOD(TT(II, JW) * 100., 1.)
     296                ZK(JW, II) = KMIN + (KMAX - KMIN) *RAN_NUM_2
    259297                ! Horizontal phase speed
    260298                CPHA = 0.
    261299                DO JJ = 1, NA
     300                    RAN_NUM_3=MOD(TT(II, JW+3*JJ)**2, 1.)
    262301                    CPHA = CPHA + &
    263          CMAX*2.*(MOD(TT(II, JW+3*JJ)**2, 1.)-0.5)*SQRT(3.)/SQRT(NA*1.)
     302                    CMAX*2.*(RAN_NUM_3 -0.5)*SQRT(3.)/SQRT(NA*1.)
    264303                END DO
    265304                IF (CPHA.LT.0.)  THEN
     
    276315                RUW0(JW, II) = RUWMAX
    277316             ENDDO
    278           end DO
    279        end DO
    280     end DO
     317    ENDDO
    281318
    282319    ! 4. COMPUTE THE FLUXES
     
    417454    ENDDO
    418455
     456
    419457  END SUBROUTINE FLOTT_GWD_RANDO
    420458
  • LMDZ6/branches/DYNAMICO-conv/libf/phylmd/fonte_neige_mod.F90

    • Property svn:executable deleted
  • LMDZ6/branches/DYNAMICO-conv/libf/phylmd/freinage.F90

    r2952 r3356  
    55       tt,veget,lai, height,ypaprs,ypplay,drag_pro,d_u,d_v)
    66
    7 
    87    !ONLINE:
    98    use dimphy, only: klon, klev
    109!    USE control, ONLY: nvm
    1110!    USE indice_sol_mod, only : nvm_orch
     11
     12    IMPLICIT NONE
    1213
    1314
  • LMDZ6/branches/DYNAMICO-conv/libf/phylmd/global_mean.F90

    • Property svn:executable deleted
  • LMDZ6/branches/DYNAMICO-conv/libf/phylmd/hbtm.F90

    • Property svn:executable deleted
  • LMDZ6/branches/DYNAMICO-conv/libf/phylmd/hbtm2l.F90

    • Property svn:executable deleted
  • LMDZ6/branches/DYNAMICO-conv/libf/phylmd/hines_gwd.F90

    • Property svn:executable deleted
  • LMDZ6/branches/DYNAMICO-conv/libf/phylmd/icefrac_lsc_mod.F90

    • Property svn:executable deleted
  • LMDZ6/branches/DYNAMICO-conv/libf/phylmd/indice_sol_mod.F90

    r2952 r3356  
    11      MODULE indice_sol_mod
     2
     3            IMPLICIT NONE
     4
    25            INTEGER, PARAMETER :: nbsrf = 4 ! nombre de sous-fractions pour une maille
    36            INTEGER, PARAMETER :: is_ter=1, is_lic=2, is_oce = 3, is_sic=4
  • LMDZ6/branches/DYNAMICO-conv/libf/phylmd/infotrac_phy.F90

    r2690 r3356  
    4343  INTEGER, ALLOCATABLE, DIMENSION(:,:), SAVE    :: iqfils
    4444  INTEGER, ALLOCATABLE, DIMENSION(:), SAVE    :: iqpere
    45 !$OMP THREADPRIVATE(nqfils,nqdesc,nqdesc_tot,iqfils,iqpers)
     45!$OMP THREADPRIVATE(nqfils,nqdesc,nqdesc_tot,iqfils,iqpere)
    4646
    4747! conv_flg(it)=0 : convection desactivated for tracer number it
  • LMDZ6/branches/DYNAMICO-conv/libf/phylmd/ini_bilKP_ave.h

    • Property svn:executable deleted
  • LMDZ6/branches/DYNAMICO-conv/libf/phylmd/ini_bilKP_ins.h

    • Property svn:executable deleted
  • LMDZ6/branches/DYNAMICO-conv/libf/phylmd/interfoce_lim.F90

    • Property svn:executable deleted
  • LMDZ6/branches/DYNAMICO-conv/libf/phylmd/iophy.F90

    r3322 r3356  
    1212  INTEGER, ALLOCATABLE, DIMENSION(:), SAVE :: nptabij
    1313  INTEGER, SAVE :: itau_iophy
     14  LOGICAL :: check_dim = .false.
    1415
    1516!$OMP THREADPRIVATE(itau_iophy)
     
    3435! ug Routine pour définir itau_iophy depuis phys_output_write_mod:
    3536  SUBROUTINE set_itau_iophy(ito)
    36       IMPLICIT NONE
    37       INTEGER, INTENT(IN) :: ito
    38       itau_iophy = ito
     37    IMPLICIT NONE
     38    INTEGER, INTENT(IN) :: ito
     39    itau_iophy = ito
    3940  END SUBROUTINE
    4041
    4142  SUBROUTINE init_iophy_new(rlat,rlon)
    42   USE dimphy, ONLY: klon
    43   USE mod_phys_lmdz_para, ONLY: gather, bcast, &
    44                                 jj_nb, jj_begin, jj_end, ii_begin, ii_end, &
    45                                 mpi_size, mpi_rank, klon_mpi, &
     43
     44    USE dimphy, ONLY: klon
     45    USE mod_phys_lmdz_para, ONLY: gather, bcast, &
     46                                  jj_nb, jj_begin, jj_end, ii_begin, ii_end, &
     47                                  mpi_size, mpi_rank, klon_mpi, &
    4648                                is_sequential, is_south_pole_dyn
    4749  USE mod_grid_phy_lmdz, ONLY: nbp_lon, nbp_lat, klon_glo, grid_type, unstructured
    4850  USE print_control_mod, ONLY: prt_level,lunout
    4951#ifdef CPP_IOIPSL
    50   USE ioipsl, ONLY: flio_dom_set
     52    USE ioipsl, ONLY: flio_dom_set
    5153#endif
    5254#ifdef CPP_XIOS
    5355  use wxios, ONLY: wxios_domain_param, wxios_domain_param_unstructured, wxios_context_init
    54 #endif
    55   IMPLICIT NONE
     56    USE wxios, ONLY: wxios_domain_param
     57#endif
     58    IMPLICIT NONE
    5659    REAL,DIMENSION(klon),INTENT(IN) :: rlon
    5760    REAL,DIMENSION(klon),INTENT(IN) :: rlat
     
    172175  END SUBROUTINE init_iophy_new
    173176
     177
    174178  SUBROUTINE init_iophy(lat,lon)
    175   USE mod_phys_lmdz_para, ONLY: jj_begin, jj_end, ii_begin, ii_end, jj_nb, &
    176                                 mpi_size, mpi_rank
    177   USE ioipsl, ONLY: flio_dom_set
    178   USE mod_grid_phy_lmdz, ONLY : nbp_lon, nbp_lat
    179   IMPLICIT NONE
     179
     180    USE mod_phys_lmdz_para, ONLY: jj_begin, jj_end, ii_begin, ii_end, jj_nb, &
     181                                  mpi_size, mpi_rank
     182    USE ioipsl, ONLY: flio_dom_set
     183    USE mod_grid_phy_lmdz, ONLY : nbp_lon, nbp_lat
     184
     185    IMPLICIT NONE
     186
    180187    REAL,DIMENSION(nbp_lon),INTENT(IN) :: lon
    181188    REAL,DIMENSION(nbp_lat),INTENT(IN) :: lat
     
    225232#endif
    226233  IMPLICIT NONE
    227   include 'clesphys.h'
    228    
    229     CHARACTER*(*), INTENT(IN) :: name
    230     INTEGER, INTENT(IN) :: itau0
    231     REAL,INTENT(IN) :: zjulian
    232     REAL,INTENT(IN) :: dtime
    233     CHARACTER(LEN=*), INTENT(IN) :: ffreq
    234     INTEGER,INTENT(IN) :: lev
    235     INTEGER,INTENT(OUT) :: nhori
    236     INTEGER,INTENT(OUT) :: nid_day
     234  INCLUDE 'clesphys.h'
     235   
     236  CHARACTER*(*), INTENT(IN) :: name
     237  INTEGER, INTENT(IN) :: itau0
     238  REAL,INTENT(IN) :: zjulian
     239  REAL,INTENT(IN) :: dtime
     240  CHARACTER(LEN=*), INTENT(IN) :: ffreq
     241  INTEGER,INTENT(IN) :: lev
     242  INTEGER,INTENT(OUT) :: nhori
     243  INTEGER,INTENT(OUT) :: nid_day
    237244
    238245!$OMP MASTER   
    239     IF (is_sequential) THEN
    240       call histbeg(name,nbp_lon,io_lon, jj_nb,io_lat(jj_begin:jj_end), &
    241                    1,nbp_lon,1,jj_nb,itau0, zjulian, dtime, nhori, nid_day)
    242     ELSE
    243       call histbeg(name,nbp_lon,io_lon, jj_nb,io_lat(jj_begin:jj_end), &
    244                    1,nbp_lon,1,jj_nb,itau0, zjulian, dtime, nhori, nid_day,phys_domain_id)
    245     ENDIF
    246 
    247 #ifdef CPP_XIOS
    248     ! ug OMP en chantier...
    249     IF((.NOT. is_using_mpi) .OR. is_mpi_root) THEN
    250         ! ug Création du fichier
    251       IF (.not. ok_all_xml) THEN
    252         CALL wxios_add_file(name, ffreq, lev)
    253       ENDIF
    254     ENDIF
     246  IF (is_sequential) THEN
     247    CALL histbeg(name,nbp_lon,io_lon, jj_nb,io_lat(jj_begin:jj_end), &
     248                 1,nbp_lon,1,jj_nb,itau0, zjulian, dtime, nhori, nid_day)
     249  ELSE
     250    CALL histbeg(name,nbp_lon,io_lon, jj_nb,io_lat(jj_begin:jj_end), &
     251                 1,nbp_lon,1,jj_nb,itau0, zjulian, dtime, nhori, nid_day,phys_domain_id)
     252  ENDIF
     253
     254#ifdef CPP_XIOS
     255  ! ug OMP en chantier...
     256  IF((.NOT. is_using_mpi) .OR. is_mpi_root) THEN
     257      ! ug Création du fichier
     258    IF (.not. ok_all_xml) THEN
     259      CALL wxios_add_file(name, ffreq, lev)
     260    ENDIF
     261  ENDIF
    255262#endif
    256263!$OMP END MASTER
     
    276283#ifndef CPP_IOIPSL_NO_OUTPUT
    277284    IF (is_sequential) THEN
    278       call histbeg(name,nbp_lon,io_lon, jj_nb,io_lat(jj_begin:jj_end), &
     285      CALL histbeg(name,nbp_lon,io_lon, jj_nb,io_lat(jj_begin:jj_end), &
    279286                   1,nbp_lon,1,jj_nb,itau0, zjulian, dtime, nhori, nid_day)
    280287    ELSE
    281       call histbeg(name,nbp_lon,io_lon, jj_nb,io_lat(jj_begin:jj_end), &
     288      CALL histbeg(name,nbp_lon,io_lon, jj_nb,io_lat(jj_begin:jj_end), &
    282289                   1,nbp_lon,1,jj_nb,itau0, zjulian, dtime, nhori, nid_day,phys_domain_id)
    283290    ENDIF
     
    413420
    414421#ifndef CPP_IOIPSL_NO_OUTPUT
    415      call histbeg(nname,pim,plon,plon_bounds, &
     422     CALL histbeg(nname,pim,plon,plon_bounds, &
    416423                           plat,plat_bounds, &
    417424                           itau0, zjulian, dtime, nnhori, nnid_day)
     
    454461     ENDDO
    455462#ifndef CPP_IOIPSL_NO_OUTPUT
    456      call histbeg(nname,npstn,npplon,npplon_bounds, &
     463     CALL histbeg(nname,npstn,npplon,npplon_bounds, &
    457464                            npplat,npplat_bounds, &
    458465                            itau0,zjulian,dtime,nnhori,nnid_day,phys_domain_id)
     
    467474
    468475    USE ioipsl, ONLY: histdef
    469     USE mod_phys_lmdz_para, ONLY: jj_nb
     476    USE mod_phys_lmdz_para, ONLY: jj_nb, is_master
    470477    USE phys_output_var_mod, ONLY: type_ecri, zoutm, zdtime_moy, lev_files, &
    471478                                   nid_files, nhorim, swaero_diag, dryaod_diag, nfiles, &
     
    473480    USE mod_grid_phy_lmdz, ONLY : nbp_lon, nbp_lat
    474481    USE aero_mod, ONLY : naero_tot, name_aero_tau
     482    USE print_control_mod, ONLY: prt_level,lunout
    475483
    476484    IMPLICIT NONE
     
    493501       zstophym=zdtime_moy
    494502    ENDIF
    495 
     503    IF (check_dim .AND. is_master) WRITE(lunout,*)'histdef2d_old for ', nomvar
    496504    ! Appel a la lecture des noms et niveau d'ecriture des variables dans output.def
    497505    CALL conf_physoutputs(nomvar,flag_var)
     
    543551    USE ioipsl, ONLY: histdef
    544552    USE dimphy, ONLY: klev
    545     USE mod_phys_lmdz_para, ONLY: jj_nb
     553    USE mod_phys_lmdz_para, ONLY: jj_nb, is_master
    546554    USE phys_output_var_mod, ONLY: type_ecri, zoutm, lev_files, nid_files, &
    547555                                   nhorim, zdtime_moy, levmin, levmax, &
    548556                                   nvertm, nfiles
    549557    USE mod_grid_phy_lmdz, ONLY : nbp_lon, nbp_lat
     558    USE print_control_mod, ONLY: prt_level,lunout
    550559    IMPLICIT NONE
    551560
     
    563572    ! Appel a la lecture des noms et niveau d'ecriture des variables dans output.def
    564573    CALL conf_physoutputs(nomvar,flag_var)
     574
     575    IF (check_dim .AND. is_master) WRITE(lunout,*)'histdef3d_old for ', nomvar
    565576
    566577    IF (type_ecri(iff)=='inst(X)'.OR.type_ecri(iff)=='once') THEN
     
    590601
    591602    USE ioipsl, ONLY: histdef
    592     USE mod_phys_lmdz_para, ONLY: jj_nb
     603    USE mod_phys_lmdz_para, ONLY: jj_nb, is_master
    593604    USE phys_output_var_mod, ONLY: ctrl_out, type_ecri_files, zoutm, zdtime_moy, &
    594605                                   clef_stations, phys_out_filenames, lev_files, &
    595                                    nid_files, nhorim, swaero_diag, dryaod_diag,&
     606                                   nid_files, nhorim, swaerofree_diag, swaero_diag, dryaod_diag,&
    596607                                   ok_4xCO2atm
    597608    USE print_control_mod, ONLY: prt_level,lunout
     
    601612    USE wxios, ONLY: wxios_add_field_to_file
    602613#endif
     614    USE print_control_mod, ONLY: prt_level,lunout
    603615    IMPLICIT NONE
    604616
     
    611623    REAL zstophym
    612624    CHARACTER(LEN=20) :: typeecrit
     625
     626    IF (check_dim .AND. is_master) WRITE(lunout,*)'histdef2d for ', var%name
    613627
    614628    ! ug On récupère le type écrit de la structure:
     
    672686         var%name=='toplwai' .OR. var%name=='sollwai'  ) ) ) THEN
    673687       IF  ( var%flag(iff)<=lev_files(iff) ) swaero_diag=.TRUE.
     688    ENDIF
     689
     690    ! Set swaerofree_diag=true if at least one of the concerned variables are defined
     691    IF (var%name=='SWupTOAcleanclr' .OR. var%name=='SWupSFCcleanclr' .OR. var%name=='SWdnSFCcleanclr' .OR. &
     692        var%name=='LWupTOAcleanclr' .OR. var%name=='LWdnSFCcleanclr' ) THEN
     693       IF  ( var%flag(iff)<=lev_files(iff) ) swaerofree_diag=.TRUE.
    674694    ENDIF
    675695
     
    699719    USE ioipsl, ONLY: histdef
    700720    USE dimphy, ONLY: klev
    701     USE mod_phys_lmdz_para, ONLY: jj_nb
     721    USE mod_phys_lmdz_para, ONLY: jj_nb, is_master
    702722    USE phys_output_var_mod, ONLY: ctrl_out, type_ecri_files, zoutm, zdtime_moy, &
    703723                                   clef_stations, phys_out_filenames, lev_files, &
    704                                    nid_files, nhorim, swaero_diag, dryaod_diag, levmin, &
     724                                   nid_files, nhorim, swaerofree_diag, levmin, &
    705725                                   levmax, nvertm
    706726    USE print_control_mod, ONLY: prt_level,lunout
     
    709729    USE wxios, ONLY: wxios_add_field_to_file
    710730#endif
     731    USE print_control_mod, ONLY: prt_level,lunout
    711732    IMPLICIT NONE
    712733
     
    718739    REAL zstophym
    719740    CHARACTER(LEN=20) :: typeecrit
     741
     742    IF (check_dim .AND. is_master) WRITE(lunout,*)'histdef3d for ', var%name
    720743
    721744    ! ug On récupère le type écrit de la structure:
     
    733756    ENDIF
    734757
    735 
    736758    ! Appel a la lecture des noms et niveau d'ecriture des variables dans output.def
    737759    CALL conf_physoutputs(var%name,var%flag)
     
    774796#endif
    775797    ENDIF
     798
     799    ! Set swaerofree_diag=true if at least one of the concerned variables are defined
     800    IF (var%name=='rsucsaf' .OR. var%name=='rsdcsaf') THEN
     801       IF  ( var%flag(iff)<=lev_files(iff) ) swaerofree_diag=.TRUE.
     802    ENDIF
     803
    776804  END SUBROUTINE histdef3d
    777805
     
    796824 
    797825  SUBROUTINE histwrite2d_phy_old(nid,lpoint,name,itau,field)
    798   USE dimphy, ONLY: klon
    799   USE mod_phys_lmdz_para, ONLY: Gather_omp, grid1Dto2D_mpi, &
    800                                 is_sequential, klon_mpi_begin, klon_mpi_end, &
    801                                 jj_nb, klon_mpi
    802   USE ioipsl, ONLY: histwrite
    803   USE print_control_mod, ONLY: prt_level,lunout
    804   USE mod_grid_phy_lmdz, ONLY : nbp_lon, nbp_lat
    805   IMPLICIT NONE
     826
     827    USE dimphy, ONLY: klon
     828    USE mod_phys_lmdz_para, ONLY: Gather_omp, grid1Dto2D_mpi, &
     829                                  is_sequential, klon_mpi_begin, klon_mpi_end, &
     830                                  jj_nb, klon_mpi, is_master
     831    USE ioipsl, ONLY: histwrite
     832    USE print_control_mod, ONLY: prt_level,lunout
     833    USE mod_grid_phy_lmdz, ONLY : nbp_lon, nbp_lat
     834
     835    IMPLICIT NONE
    806836   
    807837    INTEGER,INTENT(IN) :: nid
     
    818848
    819849    IF (size(field)/=klon) CALL abort_physic('iophy::histwrite2d','Field first DIMENSION not equal to klon',1)
    820    
     850    IF (check_dim .AND. is_master) WRITE(lunout,*)'histwrite2d_phy_old for ', name
     851
    821852    CALL Gather_omp(field,buffer_omp)   
    822853!$OMP MASTER
    823854    CALL grid1Dto2D_mpi(buffer_omp,Field2d)
    824     if(.NOT.lpoint) THEN
     855    IF (.NOT.lpoint) THEN
    825856     ALLOCATE(index2d(nbp_lon*jj_nb))
    826857     ALLOCATE(fieldok(nbp_lon*jj_nb))
     
    860891
    861892  SUBROUTINE histwrite3d_phy_old(nid,lpoint,name,itau,field)
    862   USE dimphy, ONLY: klon
    863   USE mod_phys_lmdz_para, ONLY: Gather_omp, grid1Dto2D_mpi, &
    864                                 is_sequential, klon_mpi_begin, klon_mpi_end, &
    865                                 jj_nb, klon_mpi
    866   USE mod_grid_phy_lmdz, ONLY : nbp_lon, nbp_lat
    867   USE ioipsl, ONLY: histwrite
    868   USE print_control_mod, ONLY: prt_level,lunout
    869   IMPLICIT NONE
     893
     894    USE dimphy, ONLY: klon
     895    USE mod_phys_lmdz_para, ONLY: Gather_omp, grid1Dto2D_mpi, &
     896                                  is_sequential, klon_mpi_begin, klon_mpi_end, &
     897                                  jj_nb, klon_mpi, is_master
     898    USE mod_grid_phy_lmdz, ONLY : nbp_lon, nbp_lat
     899    USE ioipsl, ONLY: histwrite
     900    USE print_control_mod, ONLY: prt_level,lunout
     901
     902    IMPLICIT NONE
    870903   
    871904    INTEGER,INTENT(IN) :: nid
     
    880913    REAL,allocatable, DIMENSION(:,:) :: fieldok
    881914
     915    IF (check_dim .AND. is_master) WRITE(lunout,*)'histwrite3d_phy_old for ', name
    882916
    883917    IF (size(field,1)/=klon) CALL abort_physic('iophy::histwrite3d','Field first DIMENSION not equal to klon',1)
     
    888922    CALL grid1Dto2D_mpi(buffer_omp,field3d)
    889923    IF (.NOT.lpoint) THEN
    890      ALLOCATE(index3d(nbp_lon*jj_nb*nlev))
    891      ALLOCATE(fieldok(nbp_lon*jj_nb,nlev))
    892      IF (prt_level >= 10) write(lunout,*)'Sending ',name,' to IOIPSL'
    893      CALL histwrite(nid,name,itau,Field3d,nbp_lon*jj_nb*nlev,index3d)
    894      IF (prt_level >= 10) write(lunout,*)'Finished sending ',name,' to IOIPSL'
    895    ELSE
     924      ALLOCATE(index3d(nbp_lon*jj_nb*nlev))
     925      ALLOCATE(fieldok(nbp_lon*jj_nb,nlev))
     926      IF (prt_level >= 10) write(lunout,*)'Sending ',name,' to IOIPSL'
     927      CALL histwrite(nid,name,itau,Field3d,nbp_lon*jj_nb*nlev,index3d)
     928      IF (prt_level >= 10) write(lunout,*)'Finished sending ',name,' to IOIPSL'
     929    ELSE
    896930      nlev=size(field,2)
    897931      ALLOCATE(index3d(npstn*nlev))
     
    899933
    900934      IF (is_sequential) THEN
    901 !      klon_mpi_begin=1
    902 !      klon_mpi_end=klon
    903        DO n=1, nlev
    904        DO ip=1, npstn
    905         fieldok(ip,n)=buffer_omp(nptabij(ip),n)
    906        ENDDO
    907        ENDDO
     935!       klon_mpi_begin=1
     936!       klon_mpi_end=klon
     937        DO n=1, nlev
     938        DO ip=1, npstn
     939          fieldok(ip,n)=buffer_omp(nptabij(ip),n)
     940        ENDDO
     941        ENDDO
    908942      ELSE
    909        DO n=1, nlev
    910        DO ip=1, npstn
    911         IF(nptabij(ip).GE.klon_mpi_begin.AND. &
    912          nptabij(ip).LE.klon_mpi_end) THEN
    913          fieldok(ip,n)=buffer_omp(nptabij(ip)-klon_mpi_begin+1,n)
    914         ENDIF
    915        ENDDO
    916        ENDDO
     943        DO n=1, nlev
     944        DO ip=1, npstn
     945          IF(nptabij(ip).GE.klon_mpi_begin.AND. &
     946           nptabij(ip).LE.klon_mpi_end) THEN
     947           fieldok(ip,n)=buffer_omp(nptabij(ip)-klon_mpi_begin+1,n)
     948          ENDIF
     949        ENDDO
     950        ENDDO
    917951      ENDIF
    918952      IF (prt_level >= 10) write(lunout,*)'Sending ',name,' to IOIPSL'
     
    920954      IF (prt_level >= 10) write(lunout,*)'Finished sending ',name,' to IOIPSL'
    921955    ENDIF
    922   DEALLOCATE(index3d)
    923   DEALLOCATE(fieldok)
     956    DEALLOCATE(index3d)
     957    DEALLOCATE(fieldok)
    924958!$OMP END MASTER   
    925959
    926960  END SUBROUTINE histwrite3d_phy_old
    927 
    928 
    929961
    930962
    931963! ug NOUVELLE VERSION DES WRITE AVEC LA BOUCLE DO RENTREE
    932964  SUBROUTINE histwrite2d_phy(var,field, STD_iff)
     965
     966  USE mod_phys_lmdz_omp_transfert, ONLY: bcast_omp
    933967  USE dimphy, ONLY: klon, klev
    934968  USE mod_phys_lmdz_para, ONLY: gather_omp, grid1dto2d_mpi, &
    935969                                jj_nb, klon_mpi, klon_mpi_begin, &
    936                                 klon_mpi_end, is_sequential
     970                                klon_mpi_end, is_sequential, is_master
    937971  USE ioipsl, ONLY: histwrite
    938972  USE phys_output_var_mod, ONLY: ctrl_out, clef_files, lev_files, &
    939973                                 nfiles, vars_defined, clef_stations, &
    940                                  nid_files
     974                                 nid_files, swaerofree_diag, swaero_diag, dryaod_diag, ok_4xCO2atm
    941975  USE print_control_mod, ONLY: prt_level,lunout
    942976  USE mod_grid_phy_lmdz, ONLY : nbp_lon, nbp_lat, grid_type, unstructured, regular_lonlat
     
    947981
    948982  IMPLICIT NONE
    949   include 'clesphys.h'
    950 
    951     TYPE(ctrl_out), INTENT(IN) :: var
    952     REAL, DIMENSION(:), INTENT(IN) :: field
    953     INTEGER, INTENT(IN), OPTIONAL :: STD_iff ! ug RUSTINE POUR LES STD LEVS.....
     983  INCLUDE 'clesphys.h'
     984
     985  TYPE(ctrl_out), INTENT(IN) :: var
     986  REAL, DIMENSION(:), INTENT(IN) :: field
     987  INTEGER, INTENT(IN), OPTIONAL :: STD_iff ! ug RUSTINE POUR LES STD LEVS.....
    954988     
    955     INTEGER :: iff, iff_beg, iff_end
    956     LOGICAL, SAVE  :: firstx
     989  INTEGER :: iff, iff_beg, iff_end
     990  LOGICAL, SAVE  :: firstx
    957991!$OMP THREADPRIVATE(firstx)
    958992
    959     REAL,DIMENSION(klon_mpi) :: buffer_omp
    960     INTEGER, allocatable, DIMENSION(:) :: index2d
    961     REAL :: Field2d(nbp_lon,jj_nb)
    962 
    963     INTEGER :: ip
    964     REAL, ALLOCATABLE, DIMENSION(:) :: fieldok
    965 
    966     IF (prt_level >= 10) THEN
    967       WRITE(lunout,*)'Begin histwrite2d_phy for ',trim(var%name)
    968     ENDIF
     993  REAL,DIMENSION(klon_mpi) :: buffer_omp
     994  INTEGER, allocatable, DIMENSION(:) :: index2d
     995  REAL :: Field2d(nbp_lon,jj_nb)
     996
     997  INTEGER :: ip
     998  REAL, ALLOCATABLE, DIMENSION(:) :: fieldok
     999
     1000  IF (check_dim .AND. is_master) WRITE(lunout,*)'histwrite2d_phy for ',trim(var%name)
     1001
     1002  IF (prt_level >= 10) THEN
     1003    WRITE(lunout,*)'Begin histwrite2d_phy for ',trim(var%name)
     1004  ENDIF
     1005
    9691006! ug RUSTINE POUR LES STD LEVS.....
    970       IF (PRESENT(STD_iff)) THEN
    971             iff_beg = STD_iff
    972             iff_end = STD_iff
    973       ELSE
    974             iff_beg = 1
    975             iff_end = nfiles
    976       ENDIF
     1007  IF (PRESENT(STD_iff)) THEN
     1008        iff_beg = STD_iff
     1009        iff_end = STD_iff
     1010  ELSE
     1011        iff_beg = 1
     1012        iff_end = nfiles
     1013  ENDIF
    9771014
    9781015  ! On regarde si on est dans la phase de définition ou d'écriture:
     
    9921029      ENDIF
    9931030!$OMP END MASTER
     1031!--broadcasting the flags that have been changed in histdef2d on OMP masters
     1032      CALL bcast_omp(swaero_diag)
     1033      CALL bcast_omp(swaerofree_diag)
     1034      CALL bcast_omp(dryaod_diag)
     1035      CALL bcast_omp(ok_4xCO2atm)
     1036
    9941037  ELSE
    9951038
     
    11051148!$OMP END MASTER   
    11061149  ENDIF ! vars_defined
     1150
    11071151  IF (prt_level >= 10) WRITE(lunout,*)'End histwrite2d_phy ',trim(var%name)
     1152
    11081153  END SUBROUTINE histwrite2d_phy
    11091154
     
    11111156! ug NOUVELLE VERSION DES WRITE AVEC LA BOUCLE DO RENTREE
    11121157  SUBROUTINE histwrite3d_phy(var, field, STD_iff)
     1158
     1159  USE mod_phys_lmdz_omp_transfert, ONLY: bcast_omp
    11131160  USE dimphy, ONLY: klon, klev
    11141161  USE mod_phys_lmdz_para, ONLY: gather_omp, grid1dto2d_mpi, &
    11151162                                jj_nb, klon_mpi, klon_mpi_begin, &
    1116                                 klon_mpi_end, is_sequential
     1163                                klon_mpi_end, is_sequential, is_master
    11171164  USE ioipsl, ONLY: histwrite
    11181165  USE phys_output_var_mod, ONLY: ctrl_out, clef_files, lev_files, &
    11191166                                 nfiles, vars_defined, clef_stations, &
    1120                                  nid_files
     1167                                 nid_files, swaerofree_diag
    11211168  USE mod_grid_phy_lmdz, ONLY : nbp_lon, nbp_lat, grid_type, regular_lonlat, unstructured
    11221169#ifdef CPP_XIOS
     
    11261173
    11271174  IMPLICIT NONE
    1128   include 'clesphys.h'
    1129 
    1130     TYPE(ctrl_out), INTENT(IN) :: var
    1131     REAL, DIMENSION(:,:), INTENT(IN) :: field ! --> field(klon,:)
    1132     INTEGER, INTENT(IN), OPTIONAL :: STD_iff ! ug RUSTINE POUR LES STD LEVS.....
     1175  INCLUDE 'clesphys.h'
     1176
     1177  TYPE(ctrl_out), INTENT(IN) :: var
     1178  REAL, DIMENSION(:,:), INTENT(IN) :: field ! --> field(klon,:)
     1179  INTEGER, INTENT(IN), OPTIONAL :: STD_iff ! ug RUSTINE POUR LES STD LEVS.....
    11331180     
    1134     INTEGER :: iff, iff_beg, iff_end
    1135     LOGICAL, SAVE  :: firstx
     1181  INTEGER :: iff, iff_beg, iff_end
     1182  LOGICAL, SAVE  :: firstx
    11361183!$OMP THREADPRIVATE(firstx)
    1137     REAL,DIMENSION(klon_mpi,SIZE(field,2)) :: buffer_omp
    1138     REAL :: Field3d(nbp_lon,jj_nb,SIZE(field,2))
    1139     INTEGER :: ip, n, nlev, nlevx
    1140     INTEGER, ALLOCATABLE, DIMENSION(:) :: index3d
    1141     REAL,ALLOCATABLE, DIMENSION(:,:) :: fieldok
     1184  REAL,DIMENSION(klon_mpi,SIZE(field,2)) :: buffer_omp
     1185  REAL :: Field3d(nbp_lon,jj_nb,SIZE(field,2))
     1186  INTEGER :: ip, n, nlev, nlevx
     1187  INTEGER, ALLOCATABLE, DIMENSION(:) :: index3d
     1188  REAL,ALLOCATABLE, DIMENSION(:,:) :: fieldok
     1189
     1190  IF (check_dim .AND. is_master) WRITE(lunout,*)'histwrite3d_phy for ', trim(var%name)
    11421191
    11431192  IF (prt_level >= 10) write(lunout,*)'Begin histrwrite3d ',var%name
     
    11531202
    11541203  ! On regarde si on est dans la phase de définition ou d'écriture:
    1155   IF(.NOT.vars_defined) THEN
     1204  IF (.NOT.vars_defined) THEN
    11561205      !Si phase de définition.... on définit
    11571206!$OMP MASTER
     
    11621211      ENDDO
    11631212!$OMP END MASTER
     1213!--broadcasting the flag that have been changed in histdef3d on OMP masters
     1214      CALL bcast_omp(swaerofree_diag)
    11641215  ELSE
    11651216    !Et sinon on.... écrit
     
    11821233    IF (grid_type==regular_lonlat) CALL grid1Dto2D_mpi(buffer_omp,field3d)
    11831234
    1184 
    11851235! BOUCLE SUR LES FICHIERS
    1186      firstx=.true.
    1187 
    1188       IF (ok_all_xml) THEN
     1236    firstx=.true.
     1237
     1238    IF (ok_all_xml) THEN
    11891239#ifdef CPP_XIOS
    11901240          IF (prt_level >= 10) THEN
     
    12001250          ELSE IF (grid_type==unstructured) THEN
    12011251            CALL xios_send_field(var%name, buffer_omp(:,1:nlevx))
    1202           ENDIF
     1252        ENDIF
    12031253
    12041254#else
    12051255        CALL abort_physic ('iophy','cannot have ok_all_xml = .T. without CPP_XIOS defined' ,1)
    12061256#endif
    1207       ELSE 
    1208 
    1209 
    1210      DO iff=iff_beg, iff_end
    1211             IF (var%flag(iff) <= lev_files(iff) .AND. clef_files(iff)) THEN
     1257    ELSE 
     1258
     1259      DO iff=iff_beg, iff_end
     1260          IF (var%flag(iff) <= lev_files(iff) .AND. clef_files(iff)) THEN
    12121261#ifdef CPP_XIOS
    12131262              IF (firstx) THEN
     
    12321281              ENDIF
    12331282#endif
    1234                 IF (.NOT.clef_stations(iff)) THEN
     1283              IF (.NOT.clef_stations(iff)) THEN
    12351284                        ALLOCATE(index3d(nbp_lon*jj_nb*nlev))
    12361285                        ALLOCATE(fieldok(nbp_lon*jj_nb,nlev))
     
    12461295!#endif
    12471296!                       
    1248                 ELSE
     1297              ELSE
    12491298                        nlev=size(field,2)
    12501299                        ALLOCATE(index3d(npstn*nlev))
     
    12701319                        CALL histwrite(nid_files(iff),var%name,itau_iophy,fieldok,npstn*nlev,index3d)
    12711320#endif
    1272                   ENDIF
    1273                   DEALLOCATE(index3d)
    1274                   DEALLOCATE(fieldok)
    1275             ENDIF
     1321              ENDIF
     1322              DEALLOCATE(index3d)
     1323              DEALLOCATE(fieldok)
     1324          ENDIF
    12761325      ENDDO
    1277       ENDIF
     1326    ENDIF
    12781327!$OMP END MASTER   
    12791328  ENDIF ! vars_defined
     1329
    12801330  IF (prt_level >= 10) write(lunout,*)'End histrwrite3d ',var%name
     1331
    12811332  END SUBROUTINE histwrite3d_phy
    12821333 
     
    12851336#ifdef CPP_XIOS
    12861337  SUBROUTINE histwrite2d_xios(field_name,field)
     1338
    12871339  USE dimphy, ONLY: klon, klev
    12881340  USE mod_phys_lmdz_para, ONLY: gather_omp, grid1Dto2D_mpi, &
    12891341                                is_sequential, klon_mpi_begin, klon_mpi_end, &
    1290                                 jj_nb, klon_mpi
     1342                                jj_nb, klon_mpi, is_master
    12911343  USE mod_grid_phy_lmdz, ONLY : nbp_lon, nbp_lat, grid_type, unstructured
    12921344  USE xios, ONLY: xios_send_field
     
    12951347  IMPLICIT NONE
    12961348
    1297     CHARACTER(LEN=*), INTENT(IN) :: field_name
    1298     REAL, DIMENSION(:), INTENT(IN) :: field
     1349  CHARACTER(LEN=*), INTENT(IN) :: field_name
     1350  REAL, DIMENSION(:), INTENT(IN) :: field
    12991351     
    1300     REAL,DIMENSION(klon_mpi) :: buffer_omp
    1301     INTEGER, allocatable, DIMENSION(:) :: index2d
    1302     REAL :: Field2d(nbp_lon,jj_nb)
    1303 
    1304     INTEGER :: ip
    1305     REAL, ALLOCATABLE, DIMENSION(:) :: fieldok
    1306 
    1307     IF (prt_level >= 10) WRITE(lunout,*)'Begin histrwrite2d_xios ',field_name
    1308 
    1309     !Et sinon on.... écrit
    1310     IF (SIZE(field)/=klon .AND. SIZE(field)/=klev) CALL abort_physic('iophy::histwrite2d_xios','Field first DIMENSION not equal to klon/klev',1)
    1311    
    1312     IF (SIZE(field) == klev) then
     1352  REAL,DIMENSION(klon_mpi) :: buffer_omp
     1353  INTEGER, allocatable, DIMENSION(:) :: index2d
     1354  REAL :: Field2d(nbp_lon,jj_nb)
     1355
     1356  INTEGER :: ip
     1357  REAL, ALLOCATABLE, DIMENSION(:) :: fieldok
     1358
     1359  IF (check_dim .AND. is_master) WRITE(lunout,*)'histwrite2d_xios for ', field_name
     1360
     1361  IF (prt_level >= 10) WRITE(lunout,*)'Begin histrwrite2d_xios ',field_name
     1362
     1363  !Et sinon on.... écrit
     1364  IF (SIZE(field)/=klon .AND. SIZE(field)/=klev) CALL abort_physic('iophy::histwrite2d_xios','Field first DIMENSION not equal to klon/klev',1)
     1365   
     1366  IF (SIZE(field) == klev) then
    13131367!$OMP MASTER
    13141368        CALL xios_send_field(field_name,field)
    13151369!$OMP END MASTER   
    1316     ELSE
     1370  ELSE
    13171371        CALL Gather_omp(field,buffer_omp)   
    13181372!$OMP MASTER
     
    13571411      ENDIF
    13581412!$OMP END MASTER   
    1359     ENDIF
     1413  ENDIF
    13601414
    13611415  IF (prt_level >= 10) WRITE(lunout,*)'End histrwrite2d_xios ',field_name
     
    13651419! ug NOUVELLE VERSION DES WRITE AVEC LA BOUCLE DO RENTREE
    13661420  SUBROUTINE histwrite3d_xios(field_name, field)
     1421
    13671422  USE dimphy, ONLY: klon, klev
    13681423  USE mod_phys_lmdz_para, ONLY: gather_omp, grid1Dto2D_mpi, &
    13691424                                is_sequential, klon_mpi_begin, klon_mpi_end, &
    1370                                 jj_nb, klon_mpi
     1425                                jj_nb, klon_mpi, is_master
    13711426  USE xios, ONLY: xios_send_field
    13721427  USE mod_grid_phy_lmdz, ONLY : nbp_lon, nbp_lat, grid_type, unstructured
     
    13751430  IMPLICIT NONE
    13761431
    1377     CHARACTER(LEN=*), INTENT(IN) :: field_name
    1378     REAL, DIMENSION(:,:), INTENT(IN) :: field ! --> field(klon,:)
    1379 
    1380     REAL,DIMENSION(klon_mpi,SIZE(field,2)) :: buffer_omp
    1381     REAL :: Field3d(nbp_lon,jj_nb,SIZE(field,2))
    1382     INTEGER :: ip, n, nlev
    1383     INTEGER, ALLOCATABLE, DIMENSION(:) :: index3d
    1384     REAL,ALLOCATABLE, DIMENSION(:,:) :: fieldok
     1432  CHARACTER(LEN=*), INTENT(IN) :: field_name
     1433  REAL, DIMENSION(:,:), INTENT(IN) :: field ! --> field(klon,:)
     1434
     1435  REAL,DIMENSION(klon_mpi,SIZE(field,2)) :: buffer_omp
     1436  REAL :: Field3d(nbp_lon,jj_nb,SIZE(field,2))
     1437  INTEGER :: ip, n, nlev
     1438  INTEGER, ALLOCATABLE, DIMENSION(:) :: index3d
     1439  REAL,ALLOCATABLE, DIMENSION(:,:) :: fieldok
     1440
     1441  IF (check_dim .AND. is_master) WRITE(lunout,*)'histwrite3d_xios for ', field_name
    13851442
    13861443  IF (prt_level >= 10) write(lunout,*)'Begin histrwrite3d_xios ',field_name
    13871444
    1388     !Et on.... écrit
    1389     IF (SIZE(field,1)/=klon .AND. SIZE(field,1)/=klev) CALL abort_physic('iophy::histwrite3d_xios','Field first DIMENSION not equal to klon/klev',1)
    1390    
    1391     IF (SIZE(field,1) == klev) then
     1445  !Et on.... écrit
     1446  IF (SIZE(field,1)/=klon .AND. SIZE(field,1)/=klev) CALL abort_physic('iophy::histwrite3d_xios','Field first DIMENSION not equal to klon/klev',1)
     1447   
     1448  IF (SIZE(field,1) == klev) then
    13921449!$OMP MASTER
    13931450        CALL xios_send_field(field_name,field)
    13941451!$OMP END MASTER   
    1395     ELSE
     1452  ELSE
    13961453        nlev=SIZE(field,2)
    13971454
     
    14411498      ENDIF
    14421499!$OMP END MASTER   
    1443     ENDIF
     1500  ENDIF
    14441501
    14451502  IF (prt_level >= 10) write(lunout,*)'End histrwrite3d_xios ',field_name
     1503
    14461504  END SUBROUTINE histwrite3d_xios
    14471505
     
    14491507  SUBROUTINE histwrite0d_xios(field_name, field)
    14501508  USE xios, ONLY: xios_send_field
     1509  USE mod_phys_lmdz_para, ONLY: is_master
     1510  USE print_control_mod, ONLY: prt_level,lunout
    14511511  IMPLICIT NONE
    14521512
    1453     CHARACTER(LEN=*), INTENT(IN) :: field_name
    1454     REAL, INTENT(IN) :: field ! --> scalar
     1513  CHARACTER(LEN=*), INTENT(IN) :: field_name
     1514  REAL, INTENT(IN) :: field ! --> scalar
     1515
     1516  IF (check_dim .AND. is_master) WRITE(lunout,*)'histwrite0d_xios for ', field_name
    14551517
    14561518!$OMP MASTER
    1457    CALL xios_send_field(field_name, field)
     1519  CALL xios_send_field(field_name, field)
    14581520!$OMP END MASTER
    14591521
     
    14621524
    14631525#endif
    1464 end module iophy
     1526END MODULE iophy
  • LMDZ6/branches/DYNAMICO-conv/libf/phylmd/iophys.F90

    r2793 r3356  
    9595    IF (klon/=klon_omp) THEN
    9696      print*,'klon, klon_omp',klon,klon_omp
    97       STOP'probleme de dimension parallele'
     97      CALL abort_physic('iophys_ecrit','probleme de dimension parallele',1)
    9898    ENDIF
    9999
  • LMDZ6/branches/DYNAMICO-conv/libf/phylmd/iostart.F90

    r3312 r3356  
    8989    LOGICAL,INTENT(OUT),OPTIONAL   :: found
    9090
    91     IF (PRESENT(found)) THEN
    92       CALL Get_field_rgen(field_name,field,1,found)
    93     ELSE
    94       CALL Get_field_rgen(field_name,field,1)
    95     ENDIF
     91    CALL Get_field_rgen(field_name,field,1,found)
    9692     
    9793  END SUBROUTINE Get_Field_r1
     
    10399    LOGICAL,INTENT(OUT),OPTIONAL   :: found
    104100
    105     IF (PRESENT(found)) THEN
    106       CALL Get_field_rgen(field_name,field,size(field,2),found)
    107     ELSE
    108       CALL Get_field_rgen(field_name,field,size(field,2))
    109     ENDIF
     101    CALL Get_field_rgen(field_name,field,size(field,2),found)
    110102
    111103     
     
    118110    LOGICAL,INTENT(OUT),OPTIONAL   :: found
    119111
    120     IF (PRESENT(found)) THEN
    121       CALL Get_field_rgen(field_name,field,size(field,2)*size(field,3),found)
    122     ELSE
    123       CALL Get_field_rgen(field_name,field,size(field,2)*size(field,3))
    124     ENDIF
     112    CALL Get_field_rgen(field_name,field,size(field,2)*size(field,3),found)
    125113     
    126114  END SUBROUTINE Get_Field_r3
     
    219207    REAL                         :: varout(1)
    220208   
    221     IF (PRESENT(found)) THEN
    222       CALL Get_var_rgen(var_name,varout,size(varout),found)
    223     ELSE
    224       CALL Get_var_rgen(var_name,varout,size(varout))
    225     ENDIF
     209    CALL Get_var_rgen(var_name,varout,size(varout),found)
    226210    var=varout(1)
    227211 
     
    234218    LOGICAL,OPTIONAL,INTENT(OUT) :: found
    235219   
    236     IF (PRESENT(found)) THEN
    237       CALL Get_var_rgen(var_name,var,size(var),found)
    238     ELSE
    239       CALL Get_var_rgen(var_name,var,size(var))
    240     ENDIF
     220    CALL Get_var_rgen(var_name,var,size(var),found)
    241221 
    242222  END SUBROUTINE get_var_r1
     
    248228    LOGICAL,OPTIONAL,INTENT(OUT) :: found
    249229   
    250     IF (PRESENT(found)) THEN
    251       CALL Get_var_rgen(var_name,var,size(var),found)
    252     ELSE
    253       CALL Get_var_rgen(var_name,var,size(var))
    254     ENDIF
     230    CALL Get_var_rgen(var_name,var,size(var),found)
    255231 
    256232  END SUBROUTINE get_var_r2
     
    262238    LOGICAL,OPTIONAL,INTENT(OUT) :: found
    263239   
    264     IF (PRESENT(found)) THEN
    265       CALL Get_var_rgen(var_name,var,size(var),found)
    266     ELSE
    267       CALL Get_var_rgen(var_name,var,size(var))
    268     ENDIF
     240    CALL Get_var_rgen(var_name,var,size(var),found)
    269241 
    270242  END SUBROUTINE get_var_r3
  • LMDZ6/branches/DYNAMICO-conv/libf/phylmd/iotd.h

    • Property svn:executable deleted
  • LMDZ6/branches/DYNAMICO-conv/libf/phylmd/iotd_ecrit.F90

    • Property svn:executable deleted
  • LMDZ6/branches/DYNAMICO-conv/libf/phylmd/iotd_fin.F90

    • Property svn:executable deleted
  • LMDZ6/branches/DYNAMICO-conv/libf/phylmd/iotd_ini.F90

    • Property svn:executable deleted
  • LMDZ6/branches/DYNAMICO-conv/libf/phylmd/limit_slab.F90

    • Property svn:executable deleted
  • LMDZ6/branches/DYNAMICO-conv/libf/phylmd/newmicro.F90

    r2596 r3356  
    11! $Id$
    22
    3 
    4 
    5 SUBROUTINE newmicro(ok_cdnc, bl95_b0, bl95_b1, paprs, pplay, t, pqlwp, pclc, &
     3SUBROUTINE newmicro(flag_aerosol, ok_cdnc, bl95_b0, bl95_b1, paprs, pplay, t, pqlwp, pclc, &
    64    pcltau, pclemi, pch, pcl, pcm, pct, pctlwp, xflwp, xfiwp, xflwc, xfiwc, &
    75    mass_solu_aero, mass_solu_aero_pi, pcldtaupi, re, fl, reliq, reice, &
     
    108  USE dimphy
    119  USE phys_local_var_mod, ONLY: scdnc, cldncl, reffclwtop, lcc, reffclws, &
    12     reffclwc, cldnvi, lcc3d, lcc3dcon, lcc3dstra
     10      reffclwc, cldnvi, lcc3d, lcc3dcon, lcc3dstra, icc3dcon, icc3dstra,  &
     11      zfice, dNovrN
    1312  USE phys_state_var_mod, ONLY: rnebcon, clwcon
    1413  USE icefrac_lsc_mod ! computes ice fraction (JBM 3/14)
     14  USE ioipsl_getin_p_mod, ONLY : getin_p
     15  USE print_control_mod, ONLY: lunout
     16
     17
    1518  IMPLICIT NONE
    1619  ! ======================================================================
     
    139142  ! within the grid cell)
    140143
     144  INTEGER flag_aerosol
    141145  LOGICAL ok_cdnc
    142146  REAL bl95_b0, bl95_b1 ! Parameter in B&L 95-Formula
     
    152156  REAL zrho(klon, klev) !--rho pour la couche
    153157  REAL dh(klon, klev) !--dz pour la couche
    154   REAL zfice(klon, klev)
    155158  REAL rad_chaud(klon, klev) !--rayon pour les nuages chauds
    156159  REAL rad_chaud_pi(klon, klev) !--rayon pour les nuages chauds pre-industriels
     
    162165  REAL reliq_pi(klon, klev), reice_pi(klon, klev)
    163166
     167  REAL,SAVE :: cdnc_min=-1.
     168  REAL,SAVE :: cdnc_min_m3
     169  !$OMP THREADPRIVATE(cdnc_min,cdnc_min_m3)
     170  REAL,SAVE :: cdnc_max=-1.
     171  REAL,SAVE :: cdnc_max_m3
     172  !$OMP THREADPRIVATE(cdnc_max,cdnc_max_m3)
     173
    164174  ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
    165175  ! FH : 2011/05/24
     
    173183  ! Pour retrouver les résultats numériques de la version d'origine,
    174184  ! on impose 0.71 quand on est proche de 0.71
     185
     186  if (first) THEN
     187      call getin_p('cdnc_min',cdnc_min)
     188      cdnc_min_m3=cdnc_min*1.E6
     189      IF (cdnc_min_m3<0.) cdnc_min_m3=20.E6 ! astuce pour retrocompatibilite
     190      write(lunout,*)'cdnc_min=', cdnc_min_m3/1.E6
     191      call getin_p('cdnc_max',cdnc_max)
     192      cdnc_max_m3=cdnc_max*1.E6
     193      IF (cdnc_max_m3<0.) cdnc_max_m3=1000.E6 ! astuce pour retrocompatibilite
     194      write(lunout,*)'cdnc_max=', cdnc_max_m3/1.E6
     195  ENDIF
    175196
    176197  d_rei_dt = (rei_max-rei_min)/81.4
     
    204225        xflwc(i, k) = (1.-zfice(i,k))*pqlwp(i, k)
    205226        xfiwc(i, k) = zfice(i, k)*pqlwp(i, k)
    206       END DO
    207     END DO
     227      ENDDO
     228    ENDDO
    208229  ELSE ! of IF (iflag_t_glace.EQ.0)
    209230    DO k = 1, klev
     
    222243        xflwc(i, k) = (1.-zfice(i,k))*pqlwp(i, k)
    223244        xfiwc(i, k) = zfice(i, k)*pqlwp(i, k)
    224       END DO
    225     END DO
     245      ENDDO
     246    ENDDO
    226247  ENDIF
    227248
     
    232253    DO k = 1, klev
    233254      DO i = 1, klon
    234 
    235255        ! Formula "D" of Boucher and Lohmann, Tellus, 1995
    236256        ! Cloud droplet number concentration (CDNC) is restricted
    237257        ! to be within [20, 1000 cm^3]
    238258
    239         ! --present-day case
    240         cdnc(i, k) = 10.**(bl95_b0+bl95_b1*log(max(mass_solu_aero(i,k), &
    241           1.E-4))/log(10.))*1.E6 !-m-3
    242         cdnc(i, k) = min(1000.E6, max(20.E6,cdnc(i,k)))
    243 
    244259        ! --pre-industrial case
    245260        cdnc_pi(i, k) = 10.**(bl95_b0+bl95_b1*log(max(mass_solu_aero_pi(i,k), &
    246261          1.E-4))/log(10.))*1.E6 !-m-3
    247         cdnc_pi(i, k) = min(1000.E6, max(20.E6,cdnc_pi(i,k)))
     262        cdnc_pi(i, k) = min(cdnc_max_m3, max(cdnc_min_m3,cdnc_pi(i,k)))
     263
     264      ENDDO
     265    ENDDO
     266
     267    !--flag_aerosol=7 => MACv2SP climatology
     268    !--in this case there is an enhancement factor
     269    IF (flag_aerosol .EQ. 7) THEN
     270
     271      !--present-day
     272      DO k = 1, klev
     273        DO i = 1, klon
     274          cdnc(i, k) = cdnc_pi(i,k)*dNovrN(i)
     275        ENDDO
     276      ENDDO
     277
     278    !--standard case
     279    ELSE
     280
     281      DO k = 1, klev
     282        DO i = 1, klon
     283
     284          ! Formula "D" of Boucher and Lohmann, Tellus, 1995
     285          ! Cloud droplet number concentration (CDNC) is restricted
     286          ! to be within [20, 1000 cm^3]
     287
     288          ! --present-day case
     289          cdnc(i, k) = 10.**(bl95_b0+bl95_b1*log(max(mass_solu_aero(i,k), &
     290            1.E-4))/log(10.))*1.E6 !-m-3
     291          cdnc(i, k) = min(cdnc_max_m3, max(cdnc_min_m3,cdnc(i,k)))
     292
     293        ENDDO
     294      ENDDO
     295
     296    ENDIF !--flag_aerosol
     297
     298    !--computing cloud droplet size
     299    DO k = 1, klev
     300      DO i = 1, klon
    248301
    249302        ! --present-day case
     
    280333            zfiwp_var*(3.448E-03+2.431/rei)
    281334
    282         END IF
    283 
    284       END DO
    285     END DO
     335        ENDIF
     336
     337      ENDDO
     338    ENDDO
    286339
    287340  ELSE !--not ok_cdnc
     
    293346        rad_chaud(i, k) = rad_chau2
    294347        rad_chaud_pi(i, k) = rad_chau2
    295       END DO
    296     END DO
     348      ENDDO
     349    ENDDO
    297350    DO k = min(3, klev) + 1, klev
    298351      DO i = 1, klon
    299352        rad_chaud(i, k) = rad_chau1
    300353        rad_chaud_pi(i, k) = rad_chau1
    301       END DO
    302     END DO
    303 
    304   END IF !--ok_cdnc
     354      ENDDO
     355    ENDDO
     356
     357  ENDIF !--ok_cdnc
    305358
    306359  ! --computation of cloud optical depth and emissivity
     
    377430        pclemi(i, k) = 1.0 - exp(-coef_chau*zflwp_var-df*k_ice*zfiwp_var)
    378431
    379       END IF
     432      ENDIF
    380433
    381434      reice(i, k) = rei
     
    384437      xfiwp(i) = xfiwp(i) + xfiwc(i, k)*rhodz(i, k)
    385438
    386     END DO
    387   END DO
     439    ENDDO
     440  ENDDO
    388441
    389442  ! --if cloud droplet radius is fixed, then pcldtaupi=pcltau
     
    394447        pcldtaupi(i, k) = pcltau(i, k)
    395448        reice_pi(i, k) = reice(i, k)
    396       END DO
    397     END DO
    398   END IF
     449      ENDDO
     450    ENDDO
     451  ENDIF
    399452
    400453  DO k = 1, klev
     
    403456      reliq_pi(i, k) = rad_chaud_pi(i, k)
    404457      reice_pi(i, k) = reice(i, k)
    405     END DO
    406   END DO
     458    ENDDO
     459  ENDDO
    407460
    408461  ! COMPUTE CLOUD LIQUID PATH AND TOTAL CLOUDINESS
     
    420473    pcl(i) = 1.0
    421474    pctlwp(i) = 0.0
    422   END DO
     475  ENDDO
    423476
    424477  ! --calculation of liquid water path
     
    427480    DO i = 1, klon
    428481      pctlwp(i) = pctlwp(i) + pqlwp(i, k)*rhodz(i, k)
    429     END DO
    430   END DO
     482    ENDDO
     483  ENDDO
    431484
    432485  ! --calculation of cloud properties with cloud overlap
     
    450503            (i),kind=8),1.-zepsec))
    451504          zcloudl(i) = pclc(i, k)
    452         END IF
     505        ENDIF
    453506        zcloud(i) = pclc(i, k)
    454       END DO
    455     END DO
     507      ENDDO
     508    ENDDO
    456509  ELSE IF (novlp==2) THEN
    457510    DO k = klev, 1, -1
     
    465518        ELSE IF (paprs(i,k)>=prlmc) THEN
    466519          pcl(i) = min(pclc(i,k), pcl(i))
    467         END IF
    468       END DO
    469     END DO
     520        ENDIF
     521      ENDDO
     522    ENDDO
    470523  ELSE IF (novlp==3) THEN
    471524    DO k = klev, 1, -1
     
    479532        ELSE IF (paprs(i,k)>=prlmc) THEN
    480533          pcl(i) = pcl(i)*(1.0-pclc(i,k))
    481         END IF
    482       END DO
    483     END DO
    484   END IF
     534        ENDIF
     535      ENDDO
     536    ENDDO
     537  ENDIF
    485538
    486539  DO i = 1, klon
     
    488541    pcm(i) = 1. - pcm(i)
    489542    pcl(i) = 1. - pcl(i)
    490   END DO
     543  ENDDO
    491544
    492545  ! ========================================================
     
    509562        ELSE
    510563          lcc3d(i, k) = pclc(i, k)*phase3d(i, k)
    511         END IF
     564        ENDIF
    512565        scdnc(i, k) = lcc3d(i, k)*cdnc(i, k) ! m-3
    513       END DO
    514     END DO
     566      ENDDO
     567    ENDDO
    515568
    516569    DO i = 1, klon
     
    520573      IF (novlp.EQ.3 .OR. novlp.EQ.1) tcc(i) = 1.
    521574      IF (novlp.EQ.2) tcc(i) = 0.
    522     END DO
     575    ENDDO
    523576
    524577    DO i = 1, klon
     
    534587              WRITE (*, *) 'Hypothese de recouvrement: MAXIMUM'
    535588              first = .FALSE.
    536             END IF
     589            ENDIF
    537590            flag_max = -1.
    538591            ftmp(i) = max(tcc(i), pclc(i,k))
    539           END IF
     592          ENDIF
    540593
    541594          IF (novlp.EQ.3) THEN
     
    543596              WRITE (*, *) 'Hypothese de recouvrement: RANDOM'
    544597              first = .FALSE.
    545             END IF
     598            ENDIF
    546599            flag_max = 1.
    547600            ftmp(i) = tcc(i)*(1-pclc(i,k))
    548           END IF
     601          ENDIF
    549602
    550603          IF (novlp.EQ.1) THEN
     
    554607                &                                          RANDOM'
    555608              first = .FALSE.
    556             END IF
     609            ENDIF
    557610            flag_max = 1.
    558611            ftmp(i) = tcc(i)*(1.-max(pclc(i,k),pclc(i,k+1)))/(1.-min(pclc(i, &
    559612              k+1),1.-thres_neb))
    560           END IF
     613          ENDIF
    561614          ! Effective radius of cloud droplet at top of cloud (m)
    562615          reffclwtop(i) = reffclwtop(i) + rad_chaud(i, k)*1.0E-06*phase3d(i, &
     
    570623          tcc(i) = ftmp(i)
    571624
    572         END IF ! is there a visible, not-too-small cloud?
    573       END DO ! loop over k
     625        ENDIF ! is there a visible, not-too-small cloud?
     626      ENDDO ! loop over k
    574627
    575628      IF (novlp.EQ.3 .OR. novlp.EQ.1) tcc(i) = 1. - tcc(i)
    576629
    577     END DO ! loop over i
     630    ENDDO ! loop over i
    578631
    579632    ! ! Convective and Stratiform Cloud Droplet Effective Radius (REFFCLWC
     
    586639        lcc3dstra(i, k) = lcc3dstra(i, k) - lcc3dcon(i, k) ! eau liquide stratiforme
    587640        lcc3dstra(i, k) = max(lcc3dstra(i,k), 0.0)
     641        !FC pour la glace (CAUSES)
     642        icc3dcon(i, k) = rnebcon(i, k)*(1-phase3d(i, k))*clwcon(i, k) !  glace convective
     643        icc3dstra(i, k)= pclc(i, k)*pqlwp(i, k)*(1-phase3d(i, k))
     644        icc3dstra(i, k) = icc3dstra(i, k) - icc3dcon(i, k) ! glace stratiforme
     645        icc3dstra(i, k) = max( icc3dstra(i, k), 0.0)
     646        !FC (CAUSES)
     647
    588648        ! Compute cloud droplet radius as above in meter
    589649        radius = 1.1*((pqlwp(i,k)*pplay(i,k)/(rd*t(i,k)))/(4./3*rpi*1000.* &
     
    596656        reffclws(i, k) = radius
    597657        reffclws(i, k) = reffclws(i, k)*lcc3dstra(i, k)
    598       END DO !klev
    599     END DO !klon
     658      ENDDO !klev
     659    ENDDO !klon
    600660
    601661    ! Column Integrated Cloud Droplet Number (CLDNVI) : variable 2D
     
    609669        lcc_integrat(i) = lcc_integrat(i) + lcc3d(i, k)*dh(i, k)
    610670        height(i) = height(i) + dh(i, k)
    611       END DO ! klev
     671      ENDDO ! klev
    612672      lcc_integrat(i) = lcc_integrat(i)/height(i)
    613673      IF (lcc_integrat(i)<=1.0E-03) THEN
     
    615675      ELSE
    616676        cldnvi(i) = cldnvi(i)*lcc(i)/lcc_integrat(i)
    617       END IF
    618     END DO ! klon
     677      ENDIF
     678    ENDDO ! klon
    619679
    620680    DO i = 1, klon
     
    626686        IF (lcc3dcon(i,k)<=0.0) lcc3dcon(i, k) = 0.0
    627687        IF (lcc3dstra(i,k)<=0.0) lcc3dstra(i, k) = 0.0
    628       END DO
     688!FC (CAUSES)
     689        IF (icc3dcon(i,k)<=0.0) icc3dcon(i, k) = 0.0
     690        IF (icc3dstra(i,k)<=0.0) icc3dstra(i, k) = 0.0
     691!FC (CAUSES)
     692      ENDDO
    629693      IF (reffclwtop(i)<=0.0) reffclwtop(i) = 0.0
    630694      IF (cldncl(i)<=0.0) cldncl(i) = 0.0
    631695      IF (cldnvi(i)<=0.0) cldnvi(i) = 0.0
    632696      IF (lcc(i)<=0.0) lcc(i) = 0.0
    633     END DO
    634 
    635   END IF !ok_cdnc
     697    ENDDO
     698
     699  ENDIF !ok_cdnc
     700
     701  first=.false. !to be sure
    636702
    637703  RETURN
  • LMDZ6/branches/DYNAMICO-conv/libf/phylmd/nonlocal.F90

    • Property svn:executable deleted
  • LMDZ6/branches/DYNAMICO-conv/libf/phylmd/oasis.F90

    • Property svn:executable deleted
  • LMDZ6/branches/DYNAMICO-conv/libf/phylmd/ocean_cpl_mod.F90

    • Property svn:executable deleted
  • LMDZ6/branches/DYNAMICO-conv/libf/phylmd/ocean_forced_mod.F90

    • Property svn:executable deleted
    r2538 r3356  
    162162    USE dimphy
    163163    USE calcul_fluxs_mod
    164     USE surface_data,     ONLY : calice, calsno, tau_gl
     164    USE surface_data,     ONLY : calice, calsno
    165165    USE limit_read_mod
    166166    USE fonte_neige_mod,  ONLY : fonte_neige
  • LMDZ6/branches/DYNAMICO-conv/libf/phylmd/ocean_slab_mod.F90

    • Property svn:executable deleted
  • LMDZ6/branches/DYNAMICO-conv/libf/phylmd/pbl_surface_mod.F90

    • Property svn:executable deleted
    r3355 r3356  
    2323  USE climb_wind_mod,      ONLY : climb_wind_down, climb_wind_up
    2424  USE coef_diff_turb_mod,  ONLY : coef_diff_turb
    25 
     25  USE wx_pbl_mod,          ONLY : wx_pbl_init, wx_pbl_final, &
     26!!                                  wx_pbl_fuse_no_dts, wx_pbl_split_no_dts, &
     27!!                                  wx_pbl_fuse, wx_pbl_split
     28                                  wx_pbl0_fuse, wx_pbl0_split
    2629
    2730  IMPLICIT NONE
     
    146149!    CALL getin_p('iflag_frein',iflag_frein)
    147150!
     151!jyg<
     152!****************************************************************************************
     153! Allocate variables for pbl splitting
     154!
     155!****************************************************************************************
     156
     157    CALL wx_pbl_init
     158!>jyg
     159
    148160  END SUBROUTINE pbl_surface_init
    149161
     
    202214!!! nrlmd+jyg le 02/05/2011 et le 20/02/2012
    203215!!        tke_x,     tke_w                              &
    204        wake_dltke                                     &
    205         , treedrg                                   &
     216       wake_dltke,                                     &
     217        treedrg                                   &
    206218!FC
    207219!!!
     
    274286! pblh-----output-R- HCL
    275287! pblT-----output-R- T au nveau HCL
    276 !
    277     USE carbon_cycle_mod, ONLY : carbon_cycle_cpl, co2_send
     288! treedrg--output-R- tree drag (m)               
     289!
     290    USE carbon_cycle_mod,   ONLY : carbon_cycle_cpl, co2_send
    278291    USE indice_sol_mod
    279292    USE time_phylmdz_mod, ONLY: day_ini,annee_ref,itau_phy
    280293    USE mod_grid_phy_lmdz, ONLY : nbp_lon, nbp_lat, grid1dto2d_glo
    281     USE print_control_mod, ONLY: prt_level,lunout
     294    USE print_control_mod,  ONLY : prt_level,lunout
     295    USE ioipsl_getin_p_mod, ONLY : getin_p
    282296
    283297    IMPLICIT NONE
     
    491505    CHARACTER(len=8), DIMENSION(nbsrf), SAVE :: cl_surf
    492506!$OMP THREADPRIVATE(cl_surf)
     507    REAL, SAVE                               :: beta_land         ! beta for wx_dts
     508!$OMP THREADPRIVATE(beta_land)
    493509
    494510! Other local variables
     
    508524    REAL, DIMENSION(klon)              :: yalb,yalb_vis
    509525!albedo SB <<<
    510     REAL, DIMENSION(klon)              :: yu1, yv1
     526    REAL, DIMENSION(klon)              :: yt1, yq1, yu1, yv1
    511527    REAL, DIMENSION(klon)              :: ysnow, yqsurf, yagesno, yqsol
    512528    REAL, DIMENSION(klon)              :: yrain_f, ysnow_f
     
    717733!!! jyg le 25/03/2013
    718734!!    Variables intermediaires pour le raccord des deux colonnes \`a la surface
    719     REAL   ::   dd_Ch
    720     REAL   ::   dd_Cm
    721     REAL   ::   dd_Kh
    722     REAL   ::   dd_Km
    723     REAL   ::   dd_u
    724     REAL   ::   dd_v
    725     REAL   ::   dd_t
    726     REAL   ::   dd_q
    727     REAL   ::   dd_AH
    728     REAL   ::   dd_AQ
    729     REAL   ::   dd_AU
    730     REAL   ::   dd_AV
    731     REAL   ::   dd_BH
    732     REAL   ::   dd_BQ
    733     REAL   ::   dd_BU
    734     REAL   ::   dd_BV
    735 
    736     REAL   ::   dd_KHp
    737     REAL   ::   dd_KQp
    738     REAL   ::   dd_KUp
    739     REAL   ::   dd_KVp
     735!jyg<
     736!!    REAL   ::   dd_Ch
     737!!    REAL   ::   dd_Cm
     738!!    REAL   ::   dd_Kh
     739!!    REAL   ::   dd_Km
     740!!    REAL   ::   dd_u
     741!!    REAL   ::   dd_v
     742!!    REAL   ::   dd_t
     743!!    REAL   ::   dd_q
     744!!    REAL   ::   dd_AH
     745!!    REAL   ::   dd_AQ
     746!!    REAL   ::   dd_AU
     747!!    REAL   ::   dd_AV
     748!!    REAL   ::   dd_BH
     749!!    REAL   ::   dd_BQ
     750!!    REAL   ::   dd_BU
     751!!    REAL   ::   dd_BV
     752!!
     753!!    REAL   ::   dd_KHp
     754!!    REAL   ::   dd_KQp
     755!!    REAL   ::   dd_KUp
     756!!    REAL   ::   dd_KVp
     757!>jyg
    740758
    741759!!!
     
    744762    REAL, DIMENSION(klon)              :: y_delta_tsurf,delta_coef,tau_eq
    745763    REAL, PARAMETER                    :: facteur=2./sqrt(3.14)
    746     REAL, PARAMETER                    :: effusivity=2000.
     764    REAL, PARAMETER                    :: inertia=2000.
    747765    REAL, DIMENSION(klon)              :: ytsurf_th_x,ytsurf_th_w,yqsatsurf_x,yqsatsurf_w
    748766    REAL, DIMENSION(klon)              :: ydtsurf_th
     
    756774    REAL, DIMENSION(klon)              :: Kech_m_x, Kech_m_w
    757775    REAL, DIMENSION(klon)              :: yts_x,yts_w
    758     REAL, DIMENSION(klon)              :: Kech_Hp, Kech_H_xp, Kech_H_wp
    759     REAL, DIMENSION(klon)              :: Kech_Qp, Kech_Q_xp, Kech_Q_wp
    760     REAL, DIMENSION(klon)              :: Kech_Up, Kech_U_xp, Kech_U_wp
    761     REAL, DIMENSION(klon)              :: Kech_Vp, Kech_V_xp, Kech_V_wp
     776!jyg<
     777!!    REAL, DIMENSION(klon)              :: Kech_Hp, Kech_H_xp, Kech_H_wp
     778!!    REAL, DIMENSION(klon)              :: Kech_Qp, Kech_Q_xp, Kech_Q_wp
     779!!    REAL, DIMENSION(klon)              :: Kech_Up, Kech_U_xp, Kech_U_wp
     780!!    REAL, DIMENSION(klon)              :: Kech_Vp, Kech_V_xp, Kech_V_wp
     781!>jyg
     782!jyg<
     783    REAL, DIMENSION(klon)              :: ah, bh     ! coefficients of the delta_Tsurf equation
     784!>jyg
    762785
    763786    REAL                               :: vent
     
    825848       ! Initialize ok_flux_surf (for 1D model)
    826849       if (klon_glo>1) ok_flux_surf=.FALSE.
     850
     851       ! intialize beta_land
     852       beta_land = 0.5
     853       call getin_p('beta_land', beta_land)
    827854       
    828855       ! Initilize debug IO
     
    12681295       ENDDO
    12691296!!! jyg le 07/02/2012 et le 10/04/2013
    1270         DO k = 1, klev
     1297        DO k = 1, klev+1
    12711298          DO j = 1, knon
    12721299             i = ni(j)
     
    12741301!!             ytke(j,k)   = tke(i,k,nsrf)
    12751302             ytke(j,k)   = tke_x(i,k,nsrf)
     1303          ENDDO
     1304        ENDDO
    12761305!>jyg
     1306        DO k = 1, klev
     1307          DO j = 1, knon
     1308             i = ni(j)
    12771309!FC
    12781310             y_treedrg(j,k) =  treedrg(i,k,nsrf)
     
    13031335          ENDDO
    13041336        ENDDO
     1337        IF (prt_level .ge. 10) THEN
     1338          print *,'pbl_surface, wake_s(1), wake_dlt(1,:) ', wake_s(1), wake_dlt(1,:)
     1339          print *,'pbl_surface, wake_s(1), wake_dlq(1,:) ', wake_s(1), wake_dlq(1,:)
     1340        ENDIF
    13051341!!! nrlmd le 02/05/2011
    13061342        DO k = 1, klev+1
     
    14361472            yts_w, yqsurf, yz0m, yz0h, &
    14371473            ycdragm_w, ycdragh_w, zri1_w, pref_w )
     1474!
     1475        zgeo1(:) = wake_s(:)*zgeo1_w(:) + (1.-wake_s(:))*zgeo1_x(:)
    14381476
    14391477! --- special Dice. JYG+MPL 25112013 puis BOMEX
     
    14771515            ycoefm, ycoefh, ytke, y_treedrg)
    14781516!            ycoefm, ycoefh, ytke)
    1479 !FC y_treedrg ajouté
     1517!FC y_treedrg ajoute
    14801518       IF (iflag_pbl>=20.AND.iflag_pbl<30) THEN
    14811519! In this case, coef_diff_turb is called for the Cd only
     
    15891627!!!
    15901628            AcoefH_x, AcoefQ_x, BcoefH_x, BcoefQ_x)
     1629!!!
     1630       IF (prt_level >=10) THEN
     1631         PRINT *,'pbl_surface (climb_hq_down.x->) AcoefH_x ',AcoefH_x
     1632         PRINT *,'pbl_surface (climb_hq_down.x->) AcoefQ_x ',AcoefQ_x
     1633         PRINT *,'pbl_surface (climb_hq_down.x->) BcoefH_x ',BcoefH_x
     1634         PRINT *,'pbl_surface (climb_hq_down.x->) BcoefQ_x ',BcoefQ_x
     1635       ENDIF
    15911636!
    15921637        CALL climb_hq_down(knon, ycoefh_w, ypaprs, ypplay, &
     
    15971642!!!
    15981643            AcoefH_w, AcoefQ_w, BcoefH_w, BcoefQ_w)
     1644!!!
     1645       IF (prt_level >=10) THEN
     1646         PRINT *,'pbl_surface (climb_hq_down.w->) AcoefH_w ',AcoefH_w
     1647         PRINT *,'pbl_surface (climb_hq_down.w->) AcoefQ_w ',AcoefQ_w
     1648         PRINT *,'pbl_surface (climb_hq_down.w->) BcoefH_w ',BcoefH_w
     1649         PRINT *,'pbl_surface (climb_hq_down.w->) BcoefQ_w ',BcoefQ_w
     1650       ENDIF
    15991651!!!
    16001652       ENDIF  ! (iflag_split .eq.0)
     
    16471699       END IF
    16481700
    1649 !!! nrlmd le 13/06/2011
    1650 !----- On finit le calcul des coefficients d'\'echange:on multiplie le cdrag par le module du vent et la densit\'e dans la premi\`ere couche
    1651 !          Kech_h_x(j) = ycdragh_x(j) * &
    1652 !             (1.0+SQRT(yu_x(j,1)**2+yv_x(j,1)**2)) * &
    1653 !             ypplay(j,1)/(RD*yt_x(j,1))
    1654 !          Kech_h_w(j) = ycdragh_w(j) * &
    1655 !             (1.0+SQRT(yu_w(j,1)**2+yv_w(j,1)**2)) * &
    1656 !             ypplay(j,1)/(RD*yt_w(j,1))
    1657 !          Kech_h(j) = (1.-ywake_s(j))*Kech_h_x(j)+ywake_s(j)*Kech_h_w(j)
    1658 !
    1659 !          Kech_m_x(j) = ycdragm_x(j) * &
    1660 !             (1.0+SQRT(yu_x(j,1)**2+yv_x(j,1)**2)) * &
    1661 !             ypplay(j,1)/(RD*yt_x(j,1))
    1662 !          Kech_m_w(j) = ycdragm_w(j) * &
    1663 !             (1.0+SQRT(yu_w(j,1)**2+yv_w(j,1)**2)) * &
    1664 !             ypplay(j,1)/(RD*yt_w(j,1))
    1665 !          Kech_m(j) = (1.-ywake_s(j))*Kech_m_x(j)+ywake_s(j)*Kech_m_w(j)
    1666 !!!
    16671701
    16681702!!! nrlmd le 02/05/2011  -----------------------On raccorde les 2 colonnes dans la couche 1
    16691703!----------------------------------------------------------------------------------------
    16701704!!! jyg le 07/02/2012
    1671        IF (iflag_split .eq.1) THEN
    1672 !!!
    1673 !!! jyg le 09/04/2013 ; passage aux nouvelles expressions en differences
    1674 
    1675         DO j=1,knon
    1676 !
    1677 ! Calcul des coefficients d echange
    1678          mod_wind_x = 1.0+SQRT(yu_x(j,1)**2+yv_x(j,1)**2)
    1679          mod_wind_w = 1.0+SQRT(yu_w(j,1)**2+yv_w(j,1)**2)
    1680          rho1 = ypplay(j,1)/(RD*yt(j,1))
    1681          Kech_h_x(j) = ycdragh_x(j) * mod_wind_x * rho1
    1682          Kech_h_w(j) = ycdragh_w(j) * mod_wind_w * rho1
    1683          Kech_m_x(j) = ycdragm_x(j) * mod_wind_x * rho1
    1684          Kech_m_w(j) = ycdragm_w(j) * mod_wind_w * rho1
    1685 !
    1686          dd_Kh = Kech_h_w(j) - Kech_h_x(j)
    1687          dd_Km = Kech_m_w(j) - Kech_m_x(j)
    1688          IF (prt_level >=10) THEN
    1689           print *,' mod_wind_x, mod_wind_w ', mod_wind_x, mod_wind_w
    1690           print *,' rho1 ',rho1
    1691           print *,' ycdragh_x(j),ycdragm_x(j) ',ycdragh_x(j),ycdragm_x(j)
    1692           print *,' ycdragh_w(j),ycdragm_w(j) ',ycdragh_w(j),ycdragm_w(j)
    1693           print *,' dd_Kh: ',dd_KH
    1694          ENDIF
    1695 !
    1696          Kech_h(j) = Kech_h_x(j) + ywake_s(j)*dd_Kh
    1697          Kech_m(j) = Kech_m_x(j) + ywake_s(j)*dd_Km
    1698 !
    1699 ! Calcul des coefficients d echange corriges des retroactions
    1700         Kech_H_xp(j) = Kech_h_x(j)/(1.-BcoefH_x(j)*Kech_h_x(j)*dtime)
    1701         Kech_H_wp(j) = Kech_h_w(j)/(1.-BcoefH_w(j)*Kech_h_w(j)*dtime)
    1702         Kech_Q_xp(j) = Kech_h_x(j)/(1.-BcoefQ_x(j)*Kech_h_x(j)*dtime)
    1703         Kech_Q_wp(j) = Kech_h_w(j)/(1.-BcoefQ_w(j)*Kech_h_w(j)*dtime)
    1704         Kech_U_xp(j) = Kech_m_x(j)/(1.-BcoefU_x(j)*Kech_m_x(j)*dtime)
    1705         Kech_U_wp(j) = Kech_m_w(j)/(1.-BcoefU_w(j)*Kech_m_w(j)*dtime)
    1706         Kech_V_xp(j) = Kech_m_x(j)/(1.-BcoefV_x(j)*Kech_m_x(j)*dtime)
    1707         Kech_V_wp(j) = Kech_m_w(j)/(1.-BcoefV_w(j)*Kech_m_w(j)*dtime)
    1708 !
    1709          dd_KHp = Kech_H_wp(j) - Kech_H_xp(j)
    1710          dd_KQp = Kech_Q_wp(j) - Kech_Q_xp(j)
    1711          dd_KUp = Kech_U_wp(j) - Kech_U_xp(j)
    1712          dd_KVp = Kech_V_wp(j) - Kech_V_xp(j)
    1713 !
    1714         Kech_Hp(j) = Kech_H_xp(j) + ywake_s(j)*dd_KHp
    1715         Kech_Qp(j) = Kech_Q_xp(j) + ywake_s(j)*dd_KQp
    1716         Kech_Up(j) = Kech_U_xp(j) + ywake_s(j)*dd_KUp
    1717         Kech_Vp(j) = Kech_V_xp(j) + ywake_s(j)*dd_KVp
    1718 !
    1719 ! Calcul des differences w-x
    1720        dd_CM = ycdragm_w(j) - ycdragm_x(j)
    1721        dd_CH = ycdragh_w(j) - ycdragh_x(j)
    1722        dd_u = yu_w(j,1) - yu_x(j,1)
    1723        dd_v = yv_w(j,1) - yv_x(j,1)
    1724        dd_t = yt_w(j,1) - yt_x(j,1)
    1725        dd_q = yq_w(j,1) - yq_x(j,1)
    1726        dd_AH = AcoefH_w(j) - AcoefH_x(j)
    1727        dd_AQ = AcoefQ_w(j) - AcoefQ_x(j)
    1728        dd_AU = AcoefU_w(j) - AcoefU_x(j)
    1729        dd_AV = AcoefV_w(j) - AcoefV_x(j)
    1730        dd_BH = BcoefH_w(j) - BcoefH_x(j)
    1731        dd_BQ = BcoefQ_w(j) - BcoefQ_x(j)
    1732        dd_BU = BcoefU_w(j) - BcoefU_x(j)
    1733        dd_BV = BcoefV_w(j) - BcoefV_x(j)
    1734 !
     1705!!! jyg le 01/02/2017
     1706       IF (iflag_split .eq. 0) THEN
     1707         yt1(:) = yt(:,1)
     1708         yq1(:) = yq(:,1)
     1709!!       ELSE IF (iflag_split .eq. 1) THEN
     1710!!!
     1711!jyg<
     1712!!         CALL wx_pbl_fuse_no_dts(knon, dtime, ypplay, ywake_s, &
     1713!!                                 yt_x, yt_w, yq_x, yq_w, &
     1714!!                                 yu_x, yu_w, yv_x, yv_w, &
     1715!!                                 ycdragh_x, ycdragh_w, ycdragm_x, ycdragm_w, &
     1716!!                                 AcoefH_x, AcoefH_w, AcoefQ_x, AcoefQ_w, &
     1717!!                                 AcoefU_x, AcoefU_w, AcoefV_x, AcoefV_w, &
     1718!!                                 BcoefH_x, BcoefH_w, BcoefQ_x, BcoefQ_w, &
     1719!!                                 BcoefU_x, BcoefU_w, BcoefV_x, BcoefV_w, &
     1720!!                                 AcoefH, AcoefQ, AcoefU, AcoefV, &
     1721!!                                 BcoefH, BcoefQ, BcoefU, BcoefV, &
     1722!!                                 ycdragh, ycdragm, &
     1723!!                                 yt1, yq1, yu1, yv1 &
     1724!!                                 )
     1725       ELSE IF (iflag_split .ge. 1) THEN
     1726         CALL wx_pbl0_fuse(knon, dtime, ypplay, ywake_s, &
     1727                         yt_x, yt_w, yq_x, yq_w, &
     1728                         yu_x, yu_w, yv_x, yv_w, &
     1729                         ycdragh_x, ycdragh_w, ycdragm_x, ycdragm_w, &
     1730                         AcoefH_x, AcoefH_w, AcoefQ_x, AcoefQ_w, &
     1731                         AcoefU_x, AcoefU_w, AcoefV_x, AcoefV_w, &
     1732                         BcoefH_x, BcoefH_w, BcoefQ_x, BcoefQ_w, &
     1733                         BcoefU_x, BcoefU_w, BcoefV_x, BcoefV_w, &
     1734                         AcoefH, AcoefQ, AcoefU, AcoefV, &
     1735                         BcoefH, BcoefQ, BcoefU, BcoefV, &
     1736                         ycdragh, ycdragm, &
     1737                         yt1, yq1, yu1, yv1 &
     1738                         )
     1739!!       ELSE IF (iflag_split .ge.2) THEN
     1740!!!    Provisoire
     1741!!         ah(:) = 0.
     1742!!         bh(:) = 0.
     1743!!         IF (nsrf == is_oce) THEN
     1744!!           ybeta(:) = 1.
     1745!!         ELSE
     1746!!           ybeta(:) = beta_land
     1747!!         ENDIF
     1748!!         ycdragh(:) = ywake_s(:)*ycdragh_w(:) + (1.-ywake_s(:))*ycdragh_x(:)
     1749!!         CALL wx_dts(knon, nsrf, ywake_cstar, ywake_s, ywake_dens, &
     1750!!                     yts, ypplay(:,1), ybeta, ycdragh , ypaprs(:,1), &
     1751!!                     yq(:,1), yt(:,1), yu(:,1), yv(:,1), ygustiness, &
     1752!!                     ah, bh &
     1753!!                     )
     1754!!!
     1755!!         CALL wx_pbl_fuse(knon, dtime, ypplay, ywake_s, &
     1756!!                         yt_x, yt_w, yq_x, yq_w, &
     1757!!                         yu_x, yu_w, yv_x, yv_w, &
     1758!!                         ycdragh_x, ycdragh_w, ycdragm_x, ycdragm_w, &
     1759!!                         AcoefH_x, AcoefH_w, AcoefQ_x, AcoefQ_w, &
     1760!!                         AcoefU_x, AcoefU_w, AcoefV_x, AcoefV_w, &
     1761!!                         BcoefH_x, BcoefH_w, BcoefQ_x, BcoefQ_w, &
     1762!!                         BcoefU_x, BcoefU_w, BcoefV_x, BcoefV_w, &
     1763!!                         ah, bh, &
     1764!!                         AcoefH, AcoefQ, AcoefU, AcoefV, &
     1765!!                         BcoefH, BcoefQ, BcoefU, BcoefV, &
     1766!!                         ycdragh, ycdragm, &
     1767!!                         yt1, yq1, yu1, yv1 &
     1768!!                         )
     1769!>jyg
     1770!!!
     1771         ENDIF  ! (iflag_split .eq.0)
     1772!!!
    17351773       IF (prt_level >=10) THEN
    1736           print *,'Variables pour la fusion : Kech_H_xp(j)' ,Kech_H_xp(j)
    1737           print *,'Variables pour la fusion : Kech_H_wp(j)' ,Kech_H_wp(j)
    1738           print *,'Variables pour la fusion : Kech_Hp(j)' ,Kech_Hp(j)
    1739           print *,'Variables pour la fusion : Kech_h(j)' ,Kech_h(j)
     1774         PRINT *,'pbl_surface (fuse->): yt(1,:) ',yt(1,:)
     1775         PRINT *,'pbl_surface (fuse->): yq(1,:) ',yq(1,:)
     1776         PRINT *,'pbl_surface (fuse->): yu(1,:) ',yu(1,:)
     1777         PRINT *,'pbl_surface (fuse->): yv(1,:) ',yv(1,:)
     1778         PRINT *,'pbl_surface (fuse->): AcoefH(1) ',AcoefH(1)
     1779         PRINT *,'pbl_surface (fuse->): BcoefH(1) ',BcoefH(1)
    17401780       ENDIF
    1741 !
    1742 ! Calcul des coef A, B \'equivalents dans la couche 1
    1743 !
    1744        AcoefH(j) = AcoefH_x(j) + ywake_s(j)*(Kech_H_wp(j)/Kech_Hp(j))*dd_AH
    1745        AcoefQ(j) = AcoefQ_x(j) + ywake_s(j)*(Kech_Q_wp(j)/Kech_Qp(j))*dd_AQ
    1746        AcoefU(j) = AcoefU_x(j) + ywake_s(j)*(Kech_U_wp(j)/Kech_Up(j))*dd_AU
    1747        AcoefV(j) = AcoefV_x(j) + ywake_s(j)*(Kech_V_wp(j)/Kech_Vp(j))*dd_AV
    1748 !
    1749        BcoefH(j) = BcoefH_x(j) + ywake_s(j)*BcoefH_x(j)*(dd_Kh/Kech_h(j))*(1.+Kech_H_wp(j)/Kech_Hp(j)) &
    1750                                + ywake_s(j)*(Kech_H_wp(j)/Kech_Hp(j))*(Kech_h_w(j)/Kech_h(j))*dd_BH
    1751 
    1752        BcoefQ(j) = BcoefQ_x(j) + ywake_s(j)*BcoefQ_x(j)*(dd_Kh/Kech_h(j))*(1.+Kech_Q_wp(j)/Kech_Qp(j)) &
    1753                                + ywake_s(j)*(Kech_Q_wp(j)/Kech_Qp(j))*(Kech_h_w(j)/Kech_h(j))*dd_BQ
    1754 
    1755        BcoefU(j) = BcoefU_x(j) + ywake_s(j)*BcoefU_x(j)*(dd_Km/Kech_h(j))*(1.+Kech_U_wp(j)/Kech_Up(j)) &
    1756                                + ywake_s(j)*(Kech_U_wp(j)/Kech_Up(j))*(Kech_m_w(j)/Kech_m(j))*dd_BU
    1757 
    1758        BcoefV(j) = BcoefV_x(j) + ywake_s(j)*BcoefV_x(j)*(dd_Km/Kech_h(j))*(1.+Kech_V_wp(j)/Kech_Vp(j)) &
    1759                                + ywake_s(j)*(Kech_V_wp(j)/Kech_Vp(j))*(Kech_m_w(j)/Kech_m(j))*dd_BV
    1760 
    1761 !
    1762 ! Calcul des cdrag \'equivalents dans la couche
    1763 !
    1764        ycdragm(j) = ycdragm_x(j) + ywake_s(j)*dd_CM
    1765        ycdragh(j) = ycdragh_x(j) + ywake_s(j)*dd_CH
    1766 !
    1767 ! Calcul de T, q, u et v \'equivalents dans la couche 1
    1768        yt(j,1) = yt_x(j,1) + ywake_s(j)*(Kech_h_w(j)/Kech_h(j))*dd_t
    1769        yq(j,1) = yq_x(j,1) + ywake_s(j)*(Kech_h_w(j)/Kech_h(j))*dd_q
    1770        yu(j,1) = yu_x(j,1) + ywake_s(j)*(Kech_m_w(j)/Kech_m(j))*dd_u
    1771        yv(j,1) = yv_x(j,1) + ywake_s(j)*(Kech_m_w(j)/Kech_m(j))*dd_v
    1772 
    1773 
    1774         ENDDO
    1775 !!!
    1776        ENDIF  ! (iflag_split .eq.1)
    1777 !!!
    17781781
    17791782!****************************************************************************************
     
    18121815               rlon, rlat, yrmu0, &
    18131816               debut, lafin, ydelp(:,1), r_co2_ppm, ysolsw, ysollw, yalb, &
    1814                yts, ypplay(:,1), ycdragh, ycdragm, yrain_f, ysnow_f, yt(:,1), yq(:,1),&
     1817!!jyg               yts, ypplay(:,1), ycdragh, ycdragm, yrain_f, ysnow_f, yt(:,1), yq(:,1),&
     1818               yts, ypplay(:,1), ycdragh, ycdragm, yrain_f, ysnow_f, yt1, yq1,&
    18151819               AcoefH, AcoefQ, BcoefH, BcoefQ, &
    18161820               AcoefU, AcoefV, BcoefU, BcoefV, &
     
    18581862               yrmu0, ylwdown, yalb, ypphi(:,1), &
    18591863               ysolsw, ysollw, yts, ypplay(:,1), &
    1860                ycdragh, ycdragm, yrain_f, ysnow_f, yt(:,1), yq(:,1),&
     1864!!jyg               ycdragh, ycdragm, yrain_f, ysnow_f, yt(:,1), yq(:,1),&
     1865               ycdragh, ycdragm, yrain_f, ysnow_f, yt1, yq1,&
    18611866               AcoefH, AcoefQ, BcoefH, BcoefQ, &
    18621867               AcoefU, AcoefV, BcoefU, BcoefV, &
     
    19331938               itap, dtime, jour, knon, ni, &
    19341939               lafin, &
    1935                yts, ypplay(:,1), ycdragh, ycdragm, yrain_f, ysnow_f, yt(:,1), yq(:,1),&
     1940!!jyg               yts, ypplay(:,1), ycdragh, ycdragm, yrain_f, ysnow_f, yt(:,1), yq(:,1),&
     1941               yts, ypplay(:,1), ycdragh, ycdragm, yrain_f, ysnow_f, yt1, yq1,&
    19361942               AcoefH, AcoefQ, BcoefH, BcoefQ, &
    19371943               AcoefU, AcoefV, BcoefU, BcoefV, &
     
    19921998          yfluxlat(:) =  flat
    19931999!
    1994           IF (iflag_split .eq.0) THEN
     2000!!  Test sur iflag_split retire le 2/02/2018, sans vraiment comprendre la raison de ce test. (jyg)
     2001!!          IF (iflag_split .eq.0) THEN
    19952002             do j=1,knon
    19962003             Kech_h(j) = ycdragh(j) * (1.0+SQRT(yu(j,1)**2+yv(j,1)**2)) * &
    19972004                  ypplay(j,1)/(RD*yt(j,1))
    19982005             enddo
    1999           ENDIF ! (iflag_split .eq.0)
     2006!!          ENDIF ! (iflag_split .eq.0)
    20002007
    20012008          DO j = 1, knon
     
    20202027 &             ,  y_flux_t1(j), yfluxlat(j), ywake_s(j)
    20212028         print*,'beta,ytsurf_new', ybeta(j), ytsurf_new(j)
    2022          print*,'effusivity,facteur,cstar', effusivity, facteur,wake_cstar(j)
     2029         print*,'inertia,facteur,cstar', inertia, facteur,wake_cstar(j)
    20232030        ENDDO
    20242031       ENDIF
    20252032
    20262033!!! jyg le 07/02/2012 puis le 10/04/2013
    2027        IF (iflag_split .eq.1) THEN
    2028 !!!
    2029         DO j=1,knon
    2030          y_delta_flux_t1(j) = ( Kech_H_wp(j)*Kech_H_xp(j)*(AcoefH_w(j)-AcoefH_x(j)) + &
    2031                                 y_flux_t1(j)*(Kech_H_wp(j)-Kech_H_xp(j)) ) / Kech_Hp(j)
    2032          y_delta_flux_q1(j) = ( Kech_Q_wp(j)*Kech_Q_xp(j)*(AcoefQ_w(j)-AcoefQ_x(j)) + &
    2033                                 y_flux_q1(j)*(Kech_Q_wp(j)-Kech_Q_xp(j)) ) / Kech_Qp(j)
    2034          y_delta_flux_u1(j) = ( Kech_U_wp(j)*Kech_U_xp(j)*(AcoefU_w(j)-AcoefU_x(j)) + &
    2035                                 y_flux_u1(j)*(Kech_U_wp(j)-Kech_U_xp(j)) ) / Kech_Up(j)
    2036          y_delta_flux_v1(j) = ( Kech_V_wp(j)*Kech_V_xp(j)*(AcoefV_w(j)-AcoefV_x(j)) + &
    2037                                 y_flux_v1(j)*(Kech_V_wp(j)-Kech_V_xp(j)) ) / Kech_Vp(j)
    2038 !
    2039          y_flux_t1_x(j)=y_flux_t1(j) - ywake_s(j)*y_delta_flux_t1(j)
    2040          y_flux_t1_w(j)=y_flux_t1(j) + (1.-ywake_s(j))*y_delta_flux_t1(j)
    2041          y_flux_q1_x(j)=y_flux_q1(j) - ywake_s(j)*y_delta_flux_q1(j)
    2042          y_flux_q1_w(j)=y_flux_q1(j) + (1.-ywake_s(j))*y_delta_flux_q1(j)
    2043          y_flux_u1_x(j)=y_flux_u1(j) - ywake_s(j)*y_delta_flux_u1(j)
    2044          y_flux_u1_w(j)=y_flux_u1(j) + (1.-ywake_s(j))*y_delta_flux_u1(j)
    2045          y_flux_v1_x(j)=y_flux_v1(j) - ywake_s(j)*y_delta_flux_v1(j)
    2046          y_flux_v1_w(j)=y_flux_v1(j) + (1.-ywake_s(j))*y_delta_flux_v1(j)
    2047 !
    2048          yfluxlat_x(j)=y_flux_q1_x(j)*RLVTT
    2049          yfluxlat_w(j)=y_flux_q1_w(j)*RLVTT
    2050 
    2051         ENDDO
     2034!!       IF (iflag_split .eq.1) THEN
     2035!!!!!
     2036!!!jyg<
     2037!!         CALL wx_pbl_split_no_dts(knon, ywake_s, &
     2038!!                                AcoefH_x, AcoefH_w, &
     2039!!                                AcoefQ_x, AcoefQ_w, &
     2040!!                                AcoefU_x, AcoefU_w, &
     2041!!                                AcoefV_x, AcoefV_w, &
     2042!!                                y_flux_t1, y_flux_q1, y_flux_u1, y_flux_v1, &
     2043!!                                y_flux_t1_x, y_flux_t1_w, &
     2044!!                                y_flux_q1_x, y_flux_q1_w, &
     2045!!                                y_flux_u1_x, y_flux_u1_w, &
     2046!!                                y_flux_v1_x, y_flux_v1_w, &
     2047!!                                yfluxlat_x, yfluxlat_w &
     2048!!                                )
     2049!!       ELSE IF (iflag_split .ge. 2) THEN
     2050       IF (iflag_split .GE. 1) THEN
     2051         CALL wx_pbl0_split(knon, dtime, ywake_s, &
     2052                       y_flux_t1, y_flux_q1, y_flux_u1, y_flux_v1, &
     2053                       y_flux_t1_x, y_flux_t1_w, &
     2054                       y_flux_q1_x, y_flux_q1_w, &
     2055                       y_flux_u1_x, y_flux_u1_w, &
     2056                       y_flux_v1_x, y_flux_v1_w, &
     2057                       yfluxlat_x, yfluxlat_w, &
     2058                       y_delta_tsurf &
     2059                       )
     2060       ENDIF  ! (iflag_split .ge. 1)
     2061!>jyg
    20522062!
    20532063 
     
    20622072!!jyg!!          tau_eq(j)=(ywake_s(j)/2.)*(1./max(wake_cstar(j),0.01))*sqrt(0.4/(3.14*max(wake_dens(j),8e-12)))
    20632073!!jyg!!
    2064 !!jyg!!!          delta_coef(j)=dtime/(effusivity*sqrt(tau_eq(j)))
    2065 !!jyg!!          delta_coef(j)=facteur*sqrt(tau_eq(j))/effusivity
     2074!!jyg!!!          delta_coef(j)=dtime/(inertia*sqrt(tau_eq(j)))
     2075!!jyg!!          delta_coef(j)=facteur*sqrt(tau_eq(j))/inertia
    20662076!!jyg!!!          delta_coef(j)=0.
    20672077!!jyg!!       ELSE
     
    20922102!!jyg!!!!! fin nrlmd le 13/06/2011
    20932103!!jyg!!
     2104       IF (iflag_split .ge. 1) THEN
    20942105       IF (prt_level >=10) THEN
    20952106        DO j = 1, knon
     
    21072118 &             , y_flux_t1_x(j), y_flux_t1_w(j), y_flux_t1(j), y_flux_q1_x(j)*RLVTT, y_flux_q1_w(j)*RLVTT, yfluxlat(j), ywake_s(j)
    21082119         print*,'beta,ytsurf_new,yqsatsurf', ybeta(j), ytsurf_new(j), yqsatsurf(j)
    2109          print*,'effusivity,facteur,cstar', effusivity, facteur,wake_cstar(j)
     2120         print*,'inertia,facteur,cstar', inertia, facteur,wake_cstar(j)
    21102121        ENDDO
    21112122       ENDIF  ! (prt_level >=10)
    21122123
    21132124!!! jyg le 07/02/2012
    2114        ENDIF  ! (iflag_split .eq.1)
     2125       ENDIF  ! (iflag_split .ge.1)
    21152126!!!
    21162127
     
    23652376!!!
    23662377!!! nrlmd le 13/06/2011
    2367           delta_tsurf(i,nsrf)=y_delta_tsurf(j)*ypct(j)
     2378!!jyg20170131          delta_tsurf(i,nsrf)=y_delta_tsurf(j)*ypct(j)
     2379          delta_tsurf(i,nsrf)=y_delta_tsurf(j)
     2380!
    23682381          cdragh_x(i) = cdragh_x(i) + ycdragh_x(j)*ypct(j)
    23692382          cdragh_w(i) = cdragh_w(i) + ycdragh_w(j)*ypct(j)
     
    24002413       IF (iflag_split .eq.0) THEN
    24012414        wake_dltke(:,:,nsrf) = 0.
    2402         DO k = 1, klev
     2415        DO k = 1, klev+1
    24032416           DO j = 1, knon
    24042417              i = ni(j)
     
    24132426
    24142427       ELSE  ! (iflag_split .eq.0)
    2415         DO k = 1, klev
     2428        DO k = 1, klev+1
    24162429          DO j = 1, knon
    24172430            i = ni(j)
     
    25752588!      print*, tair1,yt(:,1),y_d_t(:,1)
    25762589
    2577 ! Calculate the temperatureflag_pbl_surface_t2m_bugiflag_pbl_surface_t2m_bug et relative humidity at 2m and the wind at 10m
     2590! Calculate the temperature and relative humidity at 2m and the wind at 10m
    25782591!!! jyg le 07/02/2012
    25792592       IF (iflag_split .eq.0) THEN
     
    30913104    IF (ALLOCATED(qsurf)) DEALLOCATE(qsurf)
    30923105    IF (ALLOCATED(ftsoil)) DEALLOCATE(ftsoil)
     3106
     3107!jyg<
     3108!****************************************************************************************
     3109! Deallocate variables for pbl splitting
     3110!
     3111!****************************************************************************************
     3112
     3113    CALL wx_pbl_final
     3114!>jyg
    30933115
    30943116  END SUBROUTINE pbl_surface_final
  • LMDZ6/branches/DYNAMICO-conv/libf/phylmd/phyetat0.F90

    r3322 r3356  
    1818       wake_deltat, wake_delta_pbl_TKE, delta_tsurf, wake_fip, wake_pe, &
    1919       wake_s, wake_dens, zgam, zmax0, zmea, zpic, zsig, &
    20        zstd, zthe, zval, ale_bl, ale_bl_trig, alp_bl, u10m, v10m, treedrg
     20       zstd, zthe, zval, ale_bl, ale_bl_trig, alp_bl, u10m, v10m, treedrg, &
     21       ale_wake, ale_bl_stat
    2122!FC
    2223  USE geometry_mod, ONLY : longitude_deg, latitude_deg
     
    120121  tab_cntrl(6)=nbapp_rad
    121122
    122   if (cycle_diurne) tab_cntrl( 7) =1.
     123  if (iflag_cycle_diurne.GE.1) tab_cntrl( 7) = iflag_cycle_diurne
    123124  if (soil_model) tab_cntrl( 8) =1.
    124125  if (new_oliq) tab_cntrl( 9) =1.
     
    419420  found=phyetat0_get(1,ale_bl_trig,"ALE_BL_TRIG","ALE BL_TRIG",0.)
    420421  found=phyetat0_get(1,alp_bl,"ALP_BL","ALP BL",0.)
     422  found=phyetat0_get(1,ale_wake,"ALE_WAKE","ALE_WAKE",0.)
     423  found=phyetat0_get(1,ale_bl_stat,"ALE_BL_STAT","ALE_BL_STAT",0.)
    421424
    422425!===========================================
  • LMDZ6/branches/DYNAMICO-conv/libf/phylmd/phyredem.F90

    r2952 r3356  
     1!
     2! $Id$
     3!
    14SUBROUTINE phyredem (fichnom)
    25!
     
    2124                                wake_cstar,                                  &
    2225                                wake_pe, wake_fip, fm_therm, entr_therm,     &
    23                                 detr_therm, Ale_bl, Ale_bl_trig, Alp_bl,     &
     26                                detr_therm, ale_bl, ale_bl_trig, alp_bl,     &
     27                                ale_wake, ale_bl_stat,                       &
    2428                                du_gwd_rando, du_gwd_front, u10m, v10m,      &
    2529                                treedrg
     
    8791  tab_cntrl(6) = nbapp_rad
    8892
    89   IF( cycle_diurne ) tab_cntrl( 7 ) = 1.
     93  IF( iflag_cycle_diurne.GE.1 ) tab_cntrl( 7 ) = iflag_cycle_diurne
    9094  IF(   soil_model ) tab_cntrl( 8 ) = 1.
    9195  IF(     new_oliq ) tab_cntrl( 9 ) = 1.
     
    282286  CALL put_field("DETR_THERM", "DETR_THERM", detr_therm)
    283287
    284   CALL put_field("ALE_BL", "ALE_BL", Ale_bl)
    285 
    286   CALL put_field("ALE_BL_TRIG", "ALE_BL_TRIG", Ale_bl_trig)
    287 
    288   CALL put_field("ALP_BL", "ALP_BL", Alp_bl)
     288  CALL put_field("ALE_BL", "ALE_BL", ale_bl)
     289
     290  CALL put_field("ALE_BL_TRIG", "ALE_BL_TRIG", ale_bl_trig)
     291
     292  CALL put_field("ALP_BL", "ALP_BL", alp_bl)
     293
     294  CALL put_field("ALE_WAKE", "ALE_WAKE", ale_wake)
     295
     296  CALL put_field("ALE_BL_STAT", "ALE_BL_STAT", ale_bl_stat)
     297
    289298
    290299  ! trs from traclmdz_mod
  • LMDZ6/branches/DYNAMICO-conv/libf/phylmd/phys_local_var_mod.F90

    r3355 r3356  
    151151      REAL, SAVE, ALLOCATABLE :: scdnc(:,:)
    152152      !$OMP THREADPRIVATE(scdnc)
     153      REAL, SAVE, ALLOCATABLE :: dNovrN(:)
     154      !$OMP THREADPRIVATE(dNovrN)
    153155      REAL, SAVE, ALLOCATABLE :: cldncl(:)
    154156      !$OMP THREADPRIVATE(cldncl)
     
    169171      REAL, SAVE, ALLOCATABLE :: lcc3dstra(:,:)
    170172      !$OMP THREADPRIVATE(lcc3dstra)
     173      REAL, SAVE, ALLOCATABLE :: icc3dcon(:,:)
     174      !$OMP THREADPRIVATE(icc3dcon)
     175      REAL, SAVE, ALLOCATABLE :: icc3dstra(:,:)
     176      !$OMP THREADPRIVATE(icc3dstra)
     177      REAL, SAVE, ALLOCATABLE :: zfice(:,:)
     178      !$OMP THREADPRIVATE(zfice)
    171179      REAL, SAVE, ALLOCATABLE :: od443aer(:)
    172180      !$OMP THREADPRIVATE(od443aer)
     
    261269!!
    262270!!         Wake variables
    263       REAL,ALLOCATABLE,SAVE,DIMENSION(:)            :: ale_wake, alp_wake
    264 !$OMP THREADPRIVATE(ale_wake, alp_wake)           
     271      REAL,ALLOCATABLE,SAVE,DIMENSION(:)            :: alp_wake
     272!$OMP THREADPRIVATE(alp_wake)           
    265273!!jyg!      REAL,ALLOCATABLE,SAVE,DIMENSION(:)            :: wake_h,wake_k
    266274      REAL,ALLOCATABLE,SAVE,DIMENSION(:)            :: wake_h
     
    271279    REAL, SAVE, ALLOCATABLE,DIMENSION(:,:)          :: d_deltat_wk, d_deltaq_wk
    272280!$OMP THREADPRIVATE(d_deltat_wk, d_deltaq_wk)
    273       REAL,ALLOCATABLE,SAVE,DIMENSION(:)            :: d_s_wk, d_dens_wk
    274 !$OMP THREADPRIVATE(d_s_wk, d_dens_wk)
     281      REAL,ALLOCATABLE,SAVE,DIMENSION(:)            :: d_s_wk, d_dens_a_wk, d_dens_wk
     282!$OMP THREADPRIVATE(d_s_wk, d_dens_a_wk, d_dens_wk)
    275283    REAL, SAVE, ALLOCATABLE,DIMENSION(:,:)          :: d_deltat_wk_gw, d_deltaq_wk_gw
    276284!$OMP THREADPRIVATE(d_deltat_wk_gw, d_deltaq_wk_gw)
     
    313321      REAL,ALLOCATABLE,SAVE,DIMENSION(:) :: slab_wfbils
    314322!$OMP THREADPRIVATE(slab_wfbils)
    315       REAL,ALLOCATABLE,SAVE,DIMENSION(:) :: tpot, tpote, ue, uq, ve, vq, zxffonte
    316 !$OMP THREADPRIVATE(tpot, tpote, ue, uq, ve, vq, zxffonte)
     323      REAL,ALLOCATABLE,SAVE,DIMENSION(:) :: tpot, tpote, ue, uq, uwat, ve, vq, vwat, zxffonte
     324!$OMP THREADPRIVATE(tpot, tpote, ue, uq, uwat, ve, vq, vwat, zxffonte)
    317325      REAL,ALLOCATABLE,SAVE,DIMENSION(:) :: zxfqcalving
    318326!$OMP THREADPRIVATE(zxfqcalving)
     
    341349!!!$OMP THREADPRIVATE(q_x, q_w)
    342350!>jyg
    343 !!! Sorties ferret
    344       REAL,ALLOCATABLE,SAVE,DIMENSION(:,:) :: dtvdf_x, dtvdf_w
    345 !$OMP THREADPRIVATE(dtvdf_x, dtvdf_w)
    346       REAL,ALLOCATABLE,SAVE,DIMENSION(:,:) :: dqvdf_x, dqvdf_w
    347 !$OMP THREADPRIVATE(dqvdf_x, dqvdf_w)
    348351! Variables supplementaires dans physiq.F relative au splitting de la surface
    349352      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:,:) :: pbl_tke_input
     
    362365      LOGICAL, SAVE, ALLOCATABLE :: ptconv(:,:)
    363366      !$OMP THREADPRIVATE(ptconv)
     367      REAL, SAVE, ALLOCATABLE :: ratqsc(:,:)
     368      !$OMP THREADPRIVATE(ratqsc)
    364369!>jyg+nrlmd
    365370  !
     
    372377      REAL,ALLOCATABLE,SAVE,DIMENSION(:) :: weak_inversion
    373378!$OMP THREADPRIVATE(weak_inversion)
    374       REAL,ALLOCATABLE,SAVE,DIMENSION(:) :: ale_bl_stat,alp_bl_conv,alp_bl_det
    375 !$OMP THREADPRIVATE(ale_bl_stat,alp_bl_conv,alp_bl_det)
     379      REAL,ALLOCATABLE,SAVE,DIMENSION(:) :: alp_bl_conv,alp_bl_det
     380!$OMP THREADPRIVATE(alp_bl_conv,alp_bl_det)
    376381      REAL,ALLOCATABLE,SAVE,DIMENSION(:) :: alp_bl_fluct_m,alp_bl_fluct_tke
    377382!$OMP THREADPRIVATE(alp_bl_fluct_m,alp_bl_fluct_tke)
     
    380385      REAL,ALLOCATABLE,SAVE,DIMENSION(:) :: proba_notrig, random_notrig
    381386!$OMP THREADPRIVATE(proba_notrig, random_notrig)
     387      REAL,ALLOCATABLE,SAVE,DIMENSION(:) :: cv_gen
     388!$OMP THREADPRIVATE(cv_gen)
    382389      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:) :: fsolsw, wfbils, wfbilo
    383390!$OMP THREADPRIVATE(fsolsw, wfbils, wfbilo)
     
    386393      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:)  :: t2m, fluxlat, fsollw,evap_pot
    387394!$OMP THREADPRIVATE(t2m, fluxlat, fsollw,evap_pot)
    388       REAL,ALLOCATABLE,SAVE,DIMENSION(:,:) :: dnwd, dnwd0, upwd, omega
    389 !$OMP THREADPRIVATE(dnwd, dnwd0, upwd, omega)
     395      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:) :: dnwd0, omega
     396!$OMP THREADPRIVATE(dnwd0, omega)
    390397      REAL,ALLOCATABLE,SAVE,DIMENSION(:) :: epmax_diag ! epmax_cape
    391398!$OMP THREADPRIVATE(epmax_diag)
    392       REAL,ALLOCATABLE,SAVE,DIMENSION(:,:) :: ep ! epmax_cape
     399!
     400!  Deep convective variables used in phytrac
     401      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:)  :: ep ! epmax_cape
    393402!$OMP THREADPRIVATE(ep)
     403      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:)  :: dnwd, upwd
     404!$OMP THREADPRIVATE(dnwd, upwd)
     405      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:)  :: pmflxr, pmflxs
     406!$OMP THREADPRIVATE(pmflxr, pmflxs)
     407      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:)  :: wdtrainA, wdtrainM
     408!$OMP THREADPRIVATE(wdtrainA, wdtrainM)
     409      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:)  :: da, mp
     410!$OMP THREADPRIVATE(da, mp)
     411      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:)  :: wght_cvfd
     412!$OMP THREADPRIVATE(wght_cvfd)
     413      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:,:):: phi, phi2, elij, epmlmMm
     414!$OMP THREADPRIVATE(phi, phi2, elij, epmlmMm)
     415      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:)  :: d1a, dam
     416!$OMP THREADPRIVATE(d1a, dam)
     417      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:)  :: ev
     418!$OMP THREADPRIVATE(ev)
     419      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:)  :: clw
     420!$OMP THREADPRIVATE(clw)
     421      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:)  :: eplaMm
     422!$OMP THREADPRIVATE(eplaMm)
     423      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:,:):: sij
     424!$OMP THREADPRIVATE(sij)
     425!
    394426!      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:) :: coefh, coefm, lambda_th
    395427      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:) :: lambda_th
     
    403435      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:) :: zx_rh
    404436!$OMP THREADPRIVATE(zx_rh)
    405       REAL,ALLOCATABLE,SAVE,DIMENSION(:,:) :: pmflxr, pmflxs, prfl, psfl, fraca
    406 !$OMP THREADPRIVATE(pmflxr, pmflxs, prfl, psfl, fraca)
     437      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:) :: prfl, psfl, fraca
     438!$OMP THREADPRIVATE(prfl, psfl, fraca)
    407439      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:) :: Vprecip, zw2
    408440!$OMP THREADPRIVATE(Vprecip, zw2)
     
    417449
    418450! ug et d'autres encore:
    419       REAL,ALLOCATABLE,SAVE,DIMENSION(:,:) :: wdtrainA, wdtrainM
    420 !$OMP THREADPRIVATE(wdtrainA, wdtrainM)
    421451      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:) :: beta_prec
    422452!$OMP THREADPRIVATE(beta_prec)
     
    482512!
    483513!---2D budget variables
     514      REAL, ALLOCATABLE, SAVE, DIMENSION(:) :: budg_dep_dry_ocs
     515      REAL, ALLOCATABLE, SAVE, DIMENSION(:) :: budg_dep_dry_so2
    484516      REAL, ALLOCATABLE, SAVE, DIMENSION(:) :: budg_dep_dry_h2so4
    485517      REAL, ALLOCATABLE, SAVE, DIMENSION(:) :: budg_dep_dry_part
    486 !$OMP THREADPRIVATE(budg_dep_dry_h2so4,budg_dep_dry_part)
     518!$OMP THREADPRIVATE(budg_dep_dry_ocs,budg_dep_dry_so2,budg_dep_dry_h2so4,budg_dep_dry_part)
     519      REAL, ALLOCATABLE, SAVE, DIMENSION(:) :: budg_dep_wet_ocs
     520      REAL, ALLOCATABLE, SAVE, DIMENSION(:) :: budg_dep_wet_so2
    487521      REAL, ALLOCATABLE, SAVE, DIMENSION(:) :: budg_dep_wet_h2so4
    488522      REAL, ALLOCATABLE, SAVE, DIMENSION(:) :: budg_dep_wet_part
    489 !$OMP THREADPRIVATE(budg_dep_wet_h2so4,budg_dep_wet_part)
     523!$OMP THREADPRIVATE(budg_dep_wet_ocs,budg_dep_wet_so2,budg_dep_wet_h2so4,budg_dep_wet_part)
    490524      REAL, ALLOCATABLE, SAVE, DIMENSION(:) :: budg_emi_ocs
    491525      REAL, ALLOCATABLE, SAVE, DIMENSION(:) :: budg_emi_so2
     
    544578      ALLOCATE(plul_st(klon),plul_th(klon))
    545579      ALLOCATE(d_t_vdf(klon,klev),d_q_vdf(klon,klev),d_t_diss(klon,klev))
    546 !nrlmd+jyg<
    547       ALLOCATE(d_t_vdf_w(klon,klev),d_q_vdf_w(klon,klev))
    548       ALLOCATE(d_t_vdf_x(klon,klev),d_q_vdf_x(klon,klev))
    549 !>nrlmd+jyg
    550580      ALLOCATE(d_u_vdf(klon,klev),d_v_vdf(klon,klev))
    551581      ALLOCATE(d_t_oli(klon,klev),d_t_oro(klon,klev))
     
    582612      ALLOCATE(tau3d_aero(klon,klev,nwave,naero_tot))
    583613      ALLOCATE(scdnc(klon, klev))
     614      ALLOCATE(dNovrN(klon))
    584615      ALLOCATE(cldncl(klon))
    585616      ALLOCATE(reffclwtop(klon))
     
    591622      ALLOCATE(lcc3dcon(klon, klev))
    592623      ALLOCATE(lcc3dstra(klon, klev))
     624      ALLOCATE(icc3dcon(klon, klev))
     625      ALLOCATE(icc3dstra(klon, klev))
     626      ALLOCATE(zfice(klon, klev))
    593627      ALLOCATE(od443aer(klon))
    594628      ALLOCATE(od550aer(klon))
     
    646680!!
    647681!!          Wake variables
    648       ALLOCATE(ale_wake(klon), alp_wake(klon))
    649       ale_wake(:)=0.
     682      ALLOCATE(alp_wake(klon))
    650683      ALLOCATE(wake_h(klon),wake_k(klon))
    651684      ALLOCATE(wake_omg(klon, klev))
    652685      ALLOCATE(d_deltat_wk(klon, klev), d_deltaq_wk(klon, klev))
    653       ALLOCATE(d_s_wk(klon), d_dens_wk(klon))
     686      ALLOCATE(d_s_wk(klon), d_dens_a_wk(klon), d_dens_wk(klon))
    654687      ALLOCATE(d_deltat_wk_gw(klon, klev), d_deltaq_wk_gw(klon, klev))
    655688      ALLOCATE(d_deltat_vdf(klon, klev), d_deltaq_vdf(klon, klev))
     
    677710      ALLOCATE(slab_wfbils(klon), tpot(klon), tpote(klon), ue(klon))
    678711      ALLOCATE(uq(klon), ve(klon), vq(klon), zxffonte(klon))
     712      ALLOCATE(uwat(klon), vwat(klon))
    679713      ALLOCATE(zxfqcalving(klon), zxfluxlat(klon))
    680714      ALLOCATE(zxtsol(klon), snow_lsc(klon), zxfqfonte(klon), zxqsurf(klon))
     
    689723!!      ALLOCATE(q_x(klon,klev), q_w(klon,klev))
    690724!>jyg
    691       ALLOCATE(dtvdf_x(klon,klev), dtvdf_w(klon,klev))
    692       dtvdf_x = 0 ; dtvdf_w=0 ;   !ym missing init
    693       ALLOCATE(dqvdf_x(klon,klev), dqvdf_w(klon,klev))
    694       dqvdf_x = 0 ; dqvdf_w=0 ;   !ym missing init
    695725      ALLOCATE(pbl_tke_input(klon,klev+1,nbsrf))
    696726      ALLOCATE(t_therm(klon,klev), q_therm(klon,klev),u_therm(klon,klev), v_therm(klon,klev))
     
    700730!
    701731      ALLOCATE(ptconv(klon,klev))
     732      ALLOCATE(ratqsc(klon,klev))
    702733!
    703734      ALLOCATE(wbeff(klon), convoccur(klon), zmax_th(klon))
     
    706737      ALLOCATE(t2m_min_mon(klon), t2m_max_mon(klon))
    707738      ALLOCATE(sens(klon), flwp(klon), fiwp(klon))
    708       ALLOCATE(ale_bl_stat(klon), alp_bl_conv(klon), alp_bl_det(klon))
     739      ALLOCATE(alp_bl_conv(klon), alp_bl_det(klon))
    709740      ale_bl_stat(:)=0 ; alp_bl_conv(:)=0 ;  alp_bl_det(:)=0
    710741      ALLOCATE(alp_bl_fluct_m(klon), alp_bl_fluct_tke(klon))
     
    713744      alp_bl_stat(:)=0
    714745      ALLOCATE(proba_notrig(klon), random_notrig(klon))
    715 
    716       ALLOCATE(dnwd(klon, klev), dnwd0(klon, klev))
     746      ALLOCATE(cv_gen(klon))
     747
     748      ALLOCATE(dnwd0(klon, klev))
    717749!      ALLOCATE(upwd(klon, klev), omega(klon, klev), coefh(klon, klev))
    718       ALLOCATE(upwd(klon, klev), omega(klon, klev))
     750      ALLOCATE(omega(klon, klev))
    719751      ALLOCATE(epmax_diag(klon)) ! epmax_cape
    720       ALLOCATE(ep(klon,klev)) ! epmax_cape
    721752!      ALLOCATE(coefm(klon, klev), lambda_th(klon, klev), cldemi(klon, klev))
    722753      ALLOCATE(lambda_th(klon, klev), cldemi(klon, klev))
     
    733764      ALLOCATE(wfevap(klon, nbsrf), wfrain(klon,nbsrf), wfsnow(klon, nbsrf))
    734765      ALLOCATE(evap_pot(klon, nbsrf))
    735 
    736       ALLOCATE(pmflxr(klon, klev+1), pmflxs(klon, klev+1), prfl(klon, klev+1))
     766!
     767!  Deep convective variables used in phytrac
     768      ALLOCATE(pmflxr(klon, klev+1), pmflxs(klon, klev+1))
     769      ALLOCATE(wdtrainA(klon,klev),wdtrainM(klon,klev))
     770      ALLOCATE(dnwd(klon, klev), upwd(klon, klev) )
     771      ALLOCATE(ep(klon,klev))                          ! epmax_cape
     772      ALLOCATE(da(klon,klev), mp(klon,klev) )
     773      ALLOCATE(phi(klon,klev,klev) )
     774      ALLOCATE(wght_cvfd(klon,klev) )
     775      ALLOCATE(phi2(klon,klev,klev) )
     776      ALLOCATE(d1a(klon,klev), dam(klon,klev))
     777      ALLOCATE(ev(klon,klev) )
     778      ALLOCATE(elij(klon,klev,klev) )
     779      ALLOCATE(clw(klon,klev) )
     780      ALLOCATE(epmlmMm(klon,klev,klev), eplaMm(klon,klev) )
     781      ALLOCATE(sij(klon,klev,klev) )
     782
     783      ALLOCATE(prfl(klon, klev+1))
    737784      ALLOCATE(psfl(klon, klev+1), fraca(klon, klev+1), Vprecip(klon, klev+1))
    738785      ALLOCATE(zw2(klon, klev+1))
     
    747794
    748795! ug et d'autres encore:
    749       ALLOCATE(wdtrainA(klon,klev),wdtrainM(klon,klev))
    750796      ALLOCATE(beta_prec(klon,klev))
    751797      ALLOCATE(rneb(klon,klev),rnebjn(klon,klev),rneblsvol(klon,klev))
     
    779825      ALLOCATE (tau_strat_1020(klon,klev))
    780826      ALLOCATE (tausum_strat(klon,3))
     827      ALLOCATE (budg_dep_dry_ocs(klon))
     828      ALLOCATE (budg_dep_wet_ocs(klon))
     829      ALLOCATE (budg_dep_dry_so2(klon))
     830      ALLOCATE (budg_dep_wet_so2(klon))
    781831      ALLOCATE (budg_dep_dry_h2so4(klon))
    782832      ALLOCATE (budg_dep_wet_h2so4(klon))
     
    832882      DEALLOCATE(plul_st,plul_th)
    833883      DEALLOCATE(d_t_vdf,d_q_vdf,d_t_diss)
    834 !nrlmd+jyg<
    835       DEALLOCATE(d_t_vdf_w,d_q_vdf_w)
    836       DEALLOCATE(d_t_vdf_x,d_q_vdf_x)
    837 !>nrlmd+jyg
    838884      DEALLOCATE(d_u_vdf,d_v_vdf)
    839885      DEALLOCATE(d_t_oli,d_t_oro)
     
    859905      DEALLOCATE(tau3d_aero)
    860906      DEALLOCATE(scdnc)
     907      DEALLOCATE(dNovrN)
    861908      DEALLOCATE(cldncl)
    862909      DEALLOCATE(reffclwtop)
     
    868915      DEALLOCATE(lcc3dcon)
    869916      DEALLOCATE(lcc3dstra)
     917      DEALLOCATE(icc3dcon)
     918      DEALLOCATE(icc3dstra)
     919      DEALLOCATE(zfice)
    870920      DEALLOCATE(od443aer)
    871921      DEALLOCATE(od550aer)
     
    925975      DEALLOCATE(ptstar, pt0, slp)
    926976!
    927       DEALLOCATE(ale_wake, alp_wake)
     977      DEALLOCATE(alp_wake)
    928978      DEALLOCATE(wake_h,wake_k)
    929979      DEALLOCATE(wake_omg)
    930980      DEALLOCATE(d_deltat_wk, d_deltaq_wk)
    931       DEALLOCATE(d_s_wk, d_dens_wk)
     981      DEALLOCATE(d_s_wk, d_dens_a_wk, d_dens_wk)
    932982      DEALLOCATE(d_deltat_wk_gw, d_deltaq_wk_gw)
    933983      DEALLOCATE(d_deltat_vdf, d_deltaq_vdf)
     
    9521002      DEALLOCATE(slab_wfbils, tpot, tpote, ue)
    9531003      DEALLOCATE(uq, ve, vq, zxffonte)
     1004      DEALLOCATE(uwat, vwat)
    9541005      DEALLOCATE(zxfqcalving, zxfluxlat)
    9551006      DEALLOCATE(zxrunofflic)
     
    9641015!!      DEALLOCATE(q_x, q_w)
    9651016!>jyg
    966       DEALLOCATE(dtvdf_x, dtvdf_w)
    967       DEALLOCATE(dqvdf_x, dqvdf_w)
     1017      DEALLOCATE(d_t_vdf_x, d_t_vdf_w)
     1018      DEALLOCATE(d_q_vdf_x, d_q_vdf_w)
    9681019      DEALLOCATE(pbl_tke_input)
    9691020      DEALLOCATE(t_therm, q_therm, u_therm, v_therm)
     
    9731024!
    9741025      DEALLOCATE(ptconv)
     1026      DEALLOCATE(ratqsc)
    9751027!
    9761028      DEALLOCATE(wbeff, convoccur, zmax_th)
     
    9791031      DEALLOCATE(t2m_min_mon, t2m_max_mon)
    9801032      DEALLOCATE(sens, flwp, fiwp)
    981       DEALLOCATE(ale_bl_stat,alp_bl_conv,alp_bl_det)
     1033      DEALLOCATE(alp_bl_conv,alp_bl_det)
    9821034      DEALLOCATE(alp_bl_fluct_m,alp_bl_fluct_tke)
    9831035      DEALLOCATE(alp_bl_stat, n2, s2)
    9841036      DEALLOCATE(proba_notrig, random_notrig)
    985 
    986       DEALLOCATE(dnwd, dnwd0)
     1037      DEALLOCATE(cv_gen)
     1038
     1039      DEALLOCATE(dnwd0)
    9871040!      DEALLOCATE(upwd, omega, coefh)
    988       DEALLOCATE(upwd, omega)
     1041      DEALLOCATE(omega)
    9891042      DEALLOCATE(epmax_diag)
    990       DEALLOCATE(ep)
    9911043!      DEALLOCATE(coefm, lambda_th, cldemi)
    9921044      DEALLOCATE(lambda_th, cldemi)
     
    10031055      DEALLOCATE(wfevap,wfrain,wfsnow)
    10041056
    1005       DEALLOCATE(pmflxr, pmflxs, prfl)
    1006       DEALLOCATE(psfl, fraca, Vprecip)
     1057      DEALLOCATE(pmflxr, pmflxs)
     1058      DEALLOCATE(wdtrainA, wdtrainM)
     1059      DEALLOCATE(upwd, dnwd)
     1060      DEALLOCATE(ep)
     1061      DEALLOCATE(da, mp )
     1062      DEALLOCATE(phi )
     1063      DEALLOCATE(wght_cvfd )
     1064      DEALLOCATE(phi2 )
     1065      DEALLOCATE(d1a, dam)
     1066      DEALLOCATE(ev )
     1067      DEALLOCATE(elij )
     1068      DEALLOCATE(clw )
     1069      DEALLOCATE(epmlmMm, eplaMm )
     1070      DEALLOCATE(sij )
     1071
     1072
     1073      DEALLOCATE(prfl, psfl, fraca, Vprecip)
    10071074      DEALLOCATE(zw2)
    10081075
     
    10151082
    10161083! ug et d'autres encore:
    1017       DEALLOCATE(wdtrainA, wdtrainM)
    10181084      DEALLOCATE(beta_prec)
    10191085      DEALLOCATE(rneb)
     
    10471113      DEALLOCATE (budg_3D_nucl)
    10481114      DEALLOCATE (budg_3D_cond_evap)
     1115      DEALLOCATE (budg_dep_dry_ocs)
     1116      DEALLOCATE (budg_dep_wet_ocs)
     1117      DEALLOCATE (budg_dep_dry_so2)
     1118      DEALLOCATE (budg_dep_wet_so2)
    10491119      DEALLOCATE (budg_dep_dry_h2so4)
    10501120      DEALLOCATE (budg_dep_wet_h2so4)
  • LMDZ6/branches/DYNAMICO-conv/libf/phylmd/phys_output_ctrlout_mod.F90

    r3003 r3356  
     1!
     2! $Id$
     3!
    14MODULE phys_output_ctrlout_mod
    25
     
    1619!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
    1720!  CHARACTER(len=20), dimension(nfiles) :: TEF = type_ecri_files
     21
     22!!! saving lon and lat as variables for CMIP6 DataRequest
     23  TYPE(ctrl_out), SAVE :: o_longitude = ctrl_out((/ 1, 1, 1, 1, 1, 1, 11, 11, 11, 11/), &
     24    'io_lon', '', '', (/ ('once', i=1, 10) /))
     25  TYPE(ctrl_out), SAVE :: o_latitude = ctrl_out((/ 1, 1, 1, 1, 1, 1, 11, 11, 11, 11/), &
     26    'io_lat', '', '', (/ ('once', i=1, 10) /))
    1827
    1928!!! Comosantes de la coordonnee sigma-hybride
     
    4554
    4655!!! 2D
     56  TYPE(ctrl_out), SAVE :: o_sza = ctrl_out((/ 1, 1, 10, 10, 5, 10, 11, 11, 11, 11/), &
     57    'sza', 'Solar zenithal angle', 'degrees', (/ ('', i=1, 10) /))
    4758
    4859! Marine
     
    324335    'ndayrain', 'Number of dayrain(liq+sol)', '-', &
    325336      (/ "inst(X)", "inst(X)", "inst(X)", "inst(X)", "inst(X)", "inst(X)", "inst(X)", "inst(X)", "inst(X)", "inst(X)" /))
     337  TYPE(ctrl_out), SAVE :: o_rain_fall = ctrl_out((/ 1, 1, 1, 10, 5, 10, 11, 11, 11, 11/), &
     338    'rain_fall', 'Precip Totale liq', 'kg/(s*m2)', (/ ('', i=1, 10) /))
     339  TYPE(ctrl_out), SAVE :: o_rain_con = ctrl_out((/ 7, 7, 7, 10, 7, 10, 11, 11, 11, 11/), &
     340    'rain_con', 'Precip liq conv.', 'kg/(s*m2)', (/ ('', i=1, 10) /))
    326341  TYPE(ctrl_out), SAVE :: o_precip = ctrl_out((/ 1, 1, 1, 10, 5, 10, 11, 11, 11, 11/), &
    327342    'precip', 'Precip Totale liq+sol', 'kg/(s*m2)', (/ ('', i=1, 10) /))
     
    381396  TYPE(ctrl_out), SAVE :: o_SWupTOAclr = ctrl_out((/ 1, 4, 10, 10, 10, 10, 11, 11, 11, 11/), &
    382397    'SWupTOAclr', 'SWup clear sky at TOA', 'W/m2', (/ ('', i=1, 10) /))
     398  TYPE(ctrl_out), SAVE :: o_SWupTOAcleanclr = ctrl_out((/ 11, 11, 11, 11, 11, 11, 11, 11, 11, 11/), &
     399    'SWupTOAcleanclr', 'SWup clear sky clean (no aerosol) at TOA', 'W/m2', (/ ('', i=1, 10) /))
    383400  TYPE(ctrl_out), SAVE :: o_SWdnTOA = ctrl_out((/ 1, 4, 10, 10, 10, 10, 11, 11, 11, 11/), &
    384401    'SWdnTOA', 'SWdn at TOA', 'W/m2', (/ ('', i=1, 10) /))
     
    427444  TYPE(ctrl_out), SAVE :: o_SWupSFCclr = ctrl_out((/ 1, 4, 10, 10, 5, 10, 11, 11, 11, 11/), &
    428445    'SWupSFCclr', 'SWup clear sky at surface', 'W/m2', (/ ('', i=1, 10) /))
     446  TYPE(ctrl_out), SAVE :: o_SWupSFCcleanclr = ctrl_out((/ 11, 11, 11, 11, 11, 11, 11, 11, 11, 11/), &
     447    'SWupSFCcleanclr', 'SWup clear sky clean (no aerosol) at surface', 'W/m2', (/ ('', i=1, 10) /))
    429448  TYPE(ctrl_out), SAVE :: o_SWdnSFC = ctrl_out((/ 1, 1, 10, 10, 5, 10, 11, 11, 11, 11/), &
    430449    'SWdnSFC', 'SWdn at surface', 'W/m2', (/ ('', i=1, 10) /))
    431450  TYPE(ctrl_out), SAVE :: o_SWdnSFCclr = ctrl_out((/ 1, 4, 10, 10, 5, 10, 11, 11, 11, 11/), &
    432451    'SWdnSFCclr', 'SWdn clear sky at surface', 'W/m2', (/ ('', i=1, 10) /))
     452  TYPE(ctrl_out), SAVE :: o_SWdnSFCcleanclr = ctrl_out((/ 11, 11, 11, 11, 11, 11, 11, 11, 11, 11/), &
     453    'SWdnSFCcleanclr', 'SWdn clear sky clean (no aerosol) at surface', 'W/m2', (/ ('', i=1, 10) /))
    433454  TYPE(ctrl_out), SAVE :: o_LWupSFC = ctrl_out((/ 1, 4, 10, 10, 5, 10, 11, 11, 11, 11/), &
    434455    'LWupSFC', 'Upwd. IR rad. at surface', 'W/m2', (/ ('', i=1, 10) /))
     
    439460  TYPE(ctrl_out), SAVE :: o_LWdnSFCclr = ctrl_out((/ 1, 4, 10, 10, 5, 10, 11, 11, 11, 11/), &
    440461    'LWdnSFCclr', 'Down. CS IR rad. at surface', 'W/m2', (/ ('', i=1, 10) /))
     462  TYPE(ctrl_out), SAVE :: o_LWupTOAcleanclr = ctrl_out((/ 11, 11, 11, 11, 11, 11, 11, 11, 11, 11/), &
     463    'LWupTOAcleanclr', 'Upward CS clean (no aerosol) IR rad. at TOA', 'W/m2', (/ ('', i=1, 10) /))
     464  TYPE(ctrl_out), SAVE :: o_LWdnSFCcleanclr = ctrl_out((/ 11, 11, 11, 11, 11, 11, 11, 11, 11, 11/), &
     465    'LWdnSFCcleanclr', 'Downward CS clean (no aerosol) IR rad. at surface', 'W/m2', (/ ('', i=1, 10) /))
    441466  TYPE(ctrl_out), SAVE :: o_bils = ctrl_out((/ 1, 2, 10, 5, 10, 10, 11, 11, 11, 11/), &
    442467    'bils', 'Surf. total heat flux', 'W/m2', (/ ('', i=1, 10) /))
     
    465490  TYPE(ctrl_out), SAVE :: o_fqfonte = ctrl_out((/ 1, 10, 10, 10, 10, 10, 11, 11, 11, 11/), &
    466491    'fqfonte', 'Land ice melt', 'kg/m2/s', (/ ('', i=1, 10) /))
     492  TYPE(ctrl_out), SAVE :: o_mrroli = ctrl_out((/ 1, 10, 10, 10, 10, 10, 11, 11, 11, 11/), &
     493    'mrroli', 'Runoff flux over land ice', 'kg/m2/s', (/ ('', i=1, 10) /))
    467494  TYPE(ctrl_out), SAVE :: o_runofflic = ctrl_out((/ 1, 10, 10, 10, 10, 10, 11, 11, 11, 11/), &
    468495    'runofflic', 'Land ice melt to ocean', 'kg/m2/s', (/ ('', i=1, 10) /))
     
    652679    'iwp', 'Cloud ice water path', 'kg/m2', (/ ('', i=1, 10) /))
    653680  TYPE(ctrl_out), SAVE :: o_ue = ctrl_out((/ 1, 10, 10, 10, 10, 10, 11, 11, 11, 11/), &
    654     'ue', 'Zonal energy transport', '-', (/ ('', i=1, 10) /))
     681    'ue', 'Zonal dry static energy transport', '-', (/ ('', i=1, 10) /))
    655682  TYPE(ctrl_out), SAVE :: o_ve = ctrl_out((/ 1, 10, 10, 10, 10, 10, 11, 11, 11, 11/), &
    656     've', 'Merid energy transport', '-', (/ ('', i=1, 10) /))
     683    've', 'Merid dry static energy transport', '-', (/ ('', i=1, 10) /))
    657684  TYPE(ctrl_out), SAVE :: o_uq = ctrl_out((/ 1, 10, 10, 10, 10, 10, 11, 11, 11, 11/), &
    658685    'uq', 'Zonal humidity transport', '-', (/ ('', i=1, 10) /))
    659686  TYPE(ctrl_out), SAVE :: o_vq = ctrl_out((/ 1, 10, 10, 10, 10, 10, 11, 11, 11, 11/), &
    660687    'vq', 'Merid humidity transport', '-', (/ ('', i=1, 10) /))
     688  TYPE(ctrl_out), SAVE :: o_uwat = ctrl_out((/ 1, 10, 10, 10, 10, 10, 11, 11, 11, 11/), &
     689    'uwat', 'Zonal total water transport', '-', (/ ('', i=1, 10) /))
     690  TYPE(ctrl_out), SAVE :: o_vwat = ctrl_out((/ 1, 10, 10, 10, 10, 10, 11, 11, 11, 11/), &
     691    'vwat', 'Merid total water transport', '-', (/ ('', i=1, 10) /))
    661692  TYPE(ctrl_out), SAVE :: o_cape = ctrl_out((/ 1, 10, 10, 10, 10, 10, 11, 11, 11, 11/), &
    662693    'cape', 'Conv avlbl pot ener', 'J/kg', (/ ('', i=1, 10) /))
     
    787818    's2', 'Surface moyenne des panaches de type 2', 'm2', (/ ('', i=1, 10) /))
    788819             
    789 !-------Déclenchement stochastiqu
     820!-------Déclenchement stochastique
    790821  TYPE(ctrl_out), SAVE :: o_proba_notrig = ctrl_out((/ 1, 6, 6, 6, 10, 10, 11, 11, 11, 11/), &
    791822    'proba_notrig', 'Probabilite de non-declenchement', ' ', (/ ('', i=1, 10) /))
     
    941972  TYPE(ctrl_out), SAVE :: o_rh2m = ctrl_out((/ 5, 5, 10, 10, 10, 10, 11, 11, 11, 11/), &
    942973    'rh2m', 'Relative humidity at 2m', '%', (/ ('', i=1, 10) /))
    943   TYPE(ctrl_out), SAVE :: o_rh2m_min = ctrl_out((/ 10, 5, 10, 10, 10, 10, 11, 11, 11, 11/), &
    944     'rh2m_min', 'Min Relative humidity at 2m', '%',                        &
    945       (/ 't_min(X)', 't_min(X)', 't_min(X)', 't_min(X)', 't_min(X)', &
    946          't_min(X)', 't_min(X)', 't_min(X)', 't_min(X)', 't_min(X)' /))
    947   TYPE(ctrl_out), SAVE :: o_rh2m_max = ctrl_out((/ 10, 5, 10, 10, 10, 10, 11, 11, 11, 11/), &
    948     'rh2m_max', 'Max Relative humidity at 2m', '%',                         &
    949       (/ 't_max(X)', 't_max(X)', 't_max(X)', 't_max(X)', 't_max(X)', &
    950          't_max(X)', 't_max(X)', 't_max(X)', 't_max(X)', 't_max(X)' /))
     974!  TYPE(ctrl_out), SAVE :: o_rh2m_min = ctrl_out((/ 10, 5, 10, 10, 10, 10, 11, 11, 11, 11/), &
     975!    'rh2m_min', 'Min Relative humidity at 2m', '%',                        &
     976!      (/ 't_min(X)', 't_min(X)', 't_min(X)', 't_min(X)', 't_min(X)', &
     977!         't_min(X)', 't_min(X)', 't_min(X)', 't_min(X)', 't_min(X)' /))
     978!  TYPE(ctrl_out), SAVE :: o_rh2m_max = ctrl_out((/ 10, 5, 10, 10, 10, 10, 11, 11, 11, 11/), &
     979!    'rh2m_max', 'Max Relative humidity at 2m', '%',                         &
     980!      (/ 't_max(X)', 't_max(X)', 't_max(X)', 't_max(X)', 't_max(X)', &
     981!         't_max(X)', 't_max(X)', 't_max(X)', 't_max(X)', 't_max(X)' /))
    951982  TYPE(ctrl_out), SAVE :: o_qsat2m = ctrl_out((/ 10, 5, 10, 10, 10, 10, 11, 11, 11, 11/), &
    952983    'qsat2m', 'Saturant humidity at 2m', '%', (/ ('', i=1, 10) /))
     
    10401071  TYPE(ctrl_out), SAVE :: o_SWnetOR = ctrl_out((/ 10, 10, 10, 10, 10, 10, 11, 11, 11, 11/), &
    10411072    'SWnetOR', 'Sfce net SW radiation OR', 'W/m2', (/ ('', i=1, 10) /))
    1042   TYPE(ctrl_out), SAVE :: o_SWdownOR = ctrl_out((/ 10, 10, 10, 10, 10, 10, 11, 11, 11, 11/), &
    1043     'SWdownOR', 'Sfce incident SW radiation OR', 'W/m2', (/ ('', i=1, 10) /))
    10441073  TYPE(ctrl_out), SAVE :: o_LWdownOR = ctrl_out((/ 10, 10, 10, 10, 10, 10, 11, 11, 11, 11/), &
    10451074    'LWdownOR', 'Sfce incident LW radiation OR', 'W/m2', (/ ('', i=1, 10) /))
     
    12871316    'vsed_aer', 'Strat. aerosol sedimentation velocity (mass-weighted)', 'm/s', (/ ('', i=1, 10) /))
    12881317!--budget  2D
     1318  TYPE(ctrl_out), SAVE :: o_budg_dep_dry_ocs = ctrl_out((/ 11, 11, 11, 11, 11, 11, 11, 11, 11, 1/), &
     1319    'budg_dep_dry_ocs',   'OCS dry deposition flux', 'kg(S)/m2/s', (/ ('', i=1, 10) /))
     1320  TYPE(ctrl_out), SAVE :: o_budg_dep_wet_ocs = ctrl_out((/ 11, 11, 11, 11, 11, 11, 11, 11, 11, 1/), &
     1321    'budg_dep_wet_ocs',   'OCS wet deposition flux', 'kg(S)/m2/s', (/ ('', i=1, 10) /))
     1322  TYPE(ctrl_out), SAVE :: o_budg_dep_dry_so2 = ctrl_out((/ 11, 11, 11, 11, 11, 11, 11, 11, 11, 1/), &
     1323    'budg_dep_dry_so2',   'SO2 dry deposition flux', 'kg(S)/m2/s', (/ ('', i=1, 10) /))
     1324  TYPE(ctrl_out), SAVE :: o_budg_dep_wet_so2 = ctrl_out((/ 11, 11, 11, 11, 11, 11, 11, 11, 11, 1/), &
     1325    'budg_dep_wet_so2',   'SO2 wet deposition flux', 'kg(S)/m2/s', (/ ('', i=1, 10) /))
    12891326  TYPE(ctrl_out), SAVE :: o_budg_dep_dry_h2so4 = ctrl_out((/ 11, 11, 11, 11, 11, 11, 11, 11, 11, 1/), &
    12901327    'budg_dep_dry_h2so4', 'H2SO4 dry deposition flux', 'kg(S)/m2/s', (/ ('', i=1, 10) /))
     
    14171454  TYPE(ctrl_out), SAVE :: o_lcc3dstra = ctrl_out((/ 2,  6, 10, 10, 10, 10, 11, 11, 11, 11/), &
    14181455    'lcc3dstra', 'Stratiform cloud liquid fraction', '1', (/ ('', i=1, 10) /))
     1456  TYPE(ctrl_out), SAVE :: o_icc3dcon = ctrl_out((/ 2,  6, 10, 10, 10, 10, 11, 11, 11, 11/), &
     1457    'icc3dcon', 'Convective cloud ice fraction', '1', (/ ('', i=1, 10) /))
     1458  TYPE(ctrl_out), SAVE :: o_icc3dstra = ctrl_out((/ 2,  6, 10, 10, 10, 10, 11, 11, 11, 11/), &
     1459    'icc3dstra', 'Stratiform cloud ice fraction', '1', (/ ('', i=1, 10) /))
     1460  TYPE(ctrl_out), SAVE :: o_cldicemxrat = ctrl_out((/ 2,  6, 10, 10, 10, 10, 11, 11, 11, 11/), &
     1461    'cldicemxrat', 'Cloud Ice Mixing Ratio', '1', (/ ('', i=1, 10) /))
     1462  TYPE(ctrl_out), SAVE :: o_cldwatmxrat = ctrl_out((/ 2,  6, 10, 10, 10, 10, 11, 11, 11, 11/), &
     1463    'cldwatmxrat', 'Cloud Water Mixing Ratio', '1', (/ ('', i=1, 10) /))
     1464  TYPE(ctrl_out), SAVE :: o_solbnd = ctrl_out((/ 2,  6, 10, 10, 10, 10, 11, 11, 11, 11/), &
     1465    'solbnd', 'Top-of-Atmosphere Solar Insolation for each band', 'W m-2', (/ ('', i=1, 10) /))
    14191466  TYPE(ctrl_out), SAVE :: o_stratomask = ctrl_out((/ 2,  6, 10, 10, 10, 10, 11, 11, 11, 11/), &
    14201467    'stratomask', 'Stratospheric fraction', '1', (/ ('', i=1, 10) /))
     
    14651512  TYPE(ctrl_out), SAVE :: o_mc = ctrl_out((/ 4, 5, 10, 10, 10, 10, 11, 11, 11, 11/), &
    14661513    'mc', 'Convective mass flux', 'kg/m2/s', (/ ('', i=1, 10) /))
     1514  TYPE(ctrl_out), SAVE :: o_ftime_deepcv = ctrl_out((/ 4, 10, 10, 10, 10, 10, 11, 11, 11, 11/), &
     1515    'ftime_deepcv', 'Fraction of time deep convection Occurs', ' ', (/ ('', i=1, 10) /))
    14671516  TYPE(ctrl_out), SAVE :: o_ftime_con = ctrl_out((/ 4, 10, 10, 10, 10, 10, 11, 11, 11, 11/), &
    1468     'ftime_con', 'Fraction of time convection Occurs', ' ',                 &
    1469       (/ 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', &
    1470          'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)' /))
     1517    'ftime_con', 'Fraction of time convection Occurs', ' ', (/ ('', i=1, 10) /))
     1518!!jyg    'ftime_con', 'Fraction of time convection Occurs', ' ',                 &
     1519!!jyg      (/ 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', &
     1520!!jyg         'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)' /))
    14711521  TYPE(ctrl_out), SAVE :: o_dtdyn = ctrl_out((/ 4, 10, 10, 10, 10, 10, 11, 11, 11, 11/), &
    14721522    'dtdyn', 'Dynamics dT', 'K/s', (/ ('', i=1, 10) /))
     
    15031553  TYPE(ctrl_out), SAVE :: o_dqwak2d = ctrl_out((/ 4, 5, 10, 10, 10, 10, 11, 11, 11, 11/), &
    15041554    'dqwak2d', 'Wake dQ', '(kg/m2)/s', (/ ('', i=1, 10) /))
     1555  TYPE(ctrl_out), SAVE :: o_cv_gen = ctrl_out((/ 4, 5, 10, 10, 10, 10, 11, 11, 11, 11/), &
     1556    'cv_gen', 'Cumulonimbus genesis', '1/(m2 s)', (/ ('', i=1, 10) /))
    15051557  TYPE(ctrl_out), SAVE :: o_wake_h = ctrl_out((/ 4, 5, 10, 10, 10, 10, 11, 11, 11, 11/), &
    15061558    'wake_h', 'wake_h', '-', (/ ('', i=1, 10) /))
     1559  TYPE(ctrl_out), SAVE :: o_wake_dens = ctrl_out((/ 4, 5, 10, 10, 10, 10, 11, 11, 11, 11/), &
     1560    'wake_dens', 'number of wakes per m2', '1/m2', (/ ('', i=1, 10) /))
    15071561  TYPE(ctrl_out), SAVE :: o_wake_s = ctrl_out((/ 4, 5, 10, 10, 10, 10, 11, 11, 11, 11/), &
    15081562    'wake_s', 'wake_s', '-', (/ ('', i=1, 10) /))
     
    15121566    'wake_deltaq', 'wake_deltaq', ' ', (/ ('', i=1, 10) /))
    15131567  TYPE(ctrl_out), SAVE :: o_wake_omg = ctrl_out((/ 4, 5, 10, 10, 10, 10, 11, 11, 11, 11/), &
    1514     'wake_omg', 'wake_omg', ' ', (/ ('', i=1, 10) /))
     1568    'wake_omg', 'wake_omg', 'Pa/s', (/ ('', i=1, 10) /))
    15151569  TYPE(ctrl_out), SAVE :: o_wdtrainA = ctrl_out((/ 4, 5, 10,  4, 10, 10, 11, 11, 11, 11 /), &
    15161570    'wdtrainA', 'precipitation from AA', '-', (/ ('', i=1, 10) /))
     
    16901744  TYPE(ctrl_out), SAVE, ALLOCATABLE :: o_trac(:)
    16911745  TYPE(ctrl_out), SAVE, ALLOCATABLE :: o_trac_cum(:)
     1746#ifdef REPROBUS
     1747  TYPE(ctrl_out), SAVE, ALLOCATABLE :: o_nas(:)
     1748#endif
    16921749  TYPE(ctrl_out), SAVE, ALLOCATABLE :: o_dtr_vdf(:)
    16931750  TYPE(ctrl_out), SAVE, ALLOCATABLE :: o_dtr_the(:)
     
    17151772  TYPE(ctrl_out), SAVE :: o_rsucs = ctrl_out((/ 4, 10, 10, 10, 10, 10, 11, 11, 11, 11/), &
    17161773    'rsucs', 'SW CS upward radiation', 'W m-2', (/ ('', i=1, 10) /))
     1774  TYPE(ctrl_out), SAVE :: o_rsucsaf = ctrl_out((/ 4, 10, 10, 10, 10, 10, 11, 11, 11, 11/), &
     1775    'rsucsaf', 'SW CS clean (no aerosol) upward radiation', 'W m-2', (/ ('', i=1, 10) /))
    17171776  TYPE(ctrl_out), SAVE :: o_rsdcs = ctrl_out((/ 4, 10, 10, 10, 10, 10, 11, 11, 11, 11/), &
    17181777    'rsdcs', 'SW CS downward radiation', 'W m-2', (/ ('', i=1, 10) /))
     1778  TYPE(ctrl_out), SAVE :: o_rsdcsaf = ctrl_out((/ 4, 10, 10, 10, 10, 10, 11, 11, 11, 11/), &
     1779    'rsdcsaf', 'SW CS clean (no aerosol) downward radiation', 'W m-2', (/ ('', i=1, 10) /))
    17191780  TYPE(ctrl_out), SAVE :: o_rlucs = ctrl_out((/ 4, 10, 10, 10, 10, 10, 11, 11, 11, 11/), &
    17201781    'rlucs', 'LW CS upward radiation', 'W m-2', (/ ('', i=1, 10) /))
  • LMDZ6/branches/DYNAMICO-conv/libf/phylmd/phys_output_mod.F90

    r3003 r3356  
    3535    USE iophy
    3636    USE dimphy
    37     USE infotrac_phy, ONLY: nqtot, nqo, niadv, tname, ttext
     37    USE infotrac_phy, ONLY: nqtot, nqo, niadv, tname, ttext, type_trac
    3838    USE ioipsl
    3939    USE phys_cal_mod, only : hour, calend
     
    4646    USE vertical_layers_mod, ONLY: ap,bp,preff,presnivs, aps, bps, pseudoalt
    4747    USE time_phylmdz_mod, ONLY: day_ini, itau_phy, start_time, annee_ref, day_ref
     48#ifdef REPROBUS
     49    USE chem_rep, ONLY: nbnas, tnamenas, ttextnas
     50#endif
    4851#ifdef CPP_XIOS
    4952    ! ug Pour les sorties XIOS
     
    137140    REAL :: ini_heure
    138141#endif
     142    INTEGER                         :: ISW
     143    REAL, DIMENSION(NSW)            :: wl1_sun, wl2_sun !wavelength bounds (in um) for SW
     144    REAL, DIMENSION(NSW)            :: wn1_sun, wn2_sun !wavenumber bounds (in m-1) for SW
     145    REAL, DIMENSION(NSW)            :: spectband  !mean wavenumb. of each sp.band
     146    REAL, DIMENSION(NSW,2)          :: spbnds_sun !bounds of spectband
    139147
    140148    WRITE(lunout,*) 'Debut phys_output_mod.F90'
     
    151159    IF (.NOT. ALLOCATED(o_trac)) ALLOCATE(o_trac(nqtot))
    152160    IF (.NOT. ALLOCATED(o_trac_cum)) ALLOCATE(o_trac_cum(nqtot))
     161#ifdef REPROBUS
     162    IF (.NOT. ALLOCATED(o_nas)) ALLOCATE(o_nas(nbnas))
     163#endif
    153164    ALLOCATE(o_dtr_the(nqtot),o_dtr_con(nqtot),o_dtr_lessi_impa(nqtot))
    154165    ALLOCATE(o_dtr_lessi_nucl(nqtot),o_dtr_insc(nqtot),o_dtr_bcscav(nqtot))
     
    354365     CALL wxios_add_vaxis("Alt", &
    355366            levmax(iff) - levmin(iff) + 1, pseudoalt)
     367
     368    IF (NSW.EQ.6) THEN
     369!
     370!wl1_sun: minimum bound of wavelength (in um)
     371!
     372      wl1_sun(1)=0.180
     373      wl1_sun(2)=0.250
     374      wl1_sun(3)=0.440
     375      wl1_sun(4)=0.690
     376      wl1_sun(5)=1.190
     377      wl1_sun(6)=2.380
     378!
     379!wl2_sun: maximum bound of wavelength (in um)
     380!
     381      wl2_sun(1)=0.250
     382      wl2_sun(2)=0.440
     383      wl2_sun(3)=0.690
     384      wl2_sun(4)=1.190
     385      wl2_sun(5)=2.380
     386      wl2_sun(6)=4.000
     387!
     388    ELSE IF(NSW.EQ.2) THEN
     389!
     390!wl1_sun: minimum bound of wavelength (in um)
     391!
     392      wl1_sun(1)=0.250
     393      wl1_sun(2)=0.690
     394!
     395!wl2_sun: maximum bound of wavelength (in um)
     396!
     397      wl2_sun(1)=0.690
     398      wl2_sun(2)=4.000
     399    ENDIF
     400
     401    DO ISW=1, NSW
     402     wn1_sun(ISW)=1.e+6/wl1_sun(ISW)
     403     wn2_sun(ISW)=1.e+6/wl2_sun(ISW)
     404     spbnds_sun(ISW,1)=wn2_sun(ISW)
     405     spbnds_sun(ISW,2)=wn1_sun(ISW)
     406     spectband(ISW)=(wn1_sun(ISW)+wn2_sun(ISW))/2
     407    ENDDO
     408!
     409!!! ajout axe vertical spectband : solar band number
     410    CALL wxios_add_vaxis("spectband", NSW, spectband, positif='down')
    356411   ELSE
    357412    ! NMC files
     
    523578            ENDDO
    524579      ENDIF
     580      IF (type_trac=='repr') THEN
     581#ifdef REPROBUS
     582         DO iiq=1,nbnas
     583            o_nas(iiq) = ctrl_out((/ 4, 5, 5, 5, 10, 10, 11, 11, 11, 11 /), &
     584                 tnamenas(iiq),ttextnas(iiq), "-", &
     585                 (/ '', '', '', '', '', '', '', '', '', '' /))
     586         ENDDO
     587#endif
     588      ENDIF
    525589
    526590   ENDDO !  iff
     
    536600
    537601    IF (prt_level >= 10) THEN
     602      WRITE(lunout,*)'swaerofree_diag=',swaerofree_diag
    538603      WRITE(lunout,*)'swaero_diag=',swaero_diag
    539604      WRITE(lunout,*)'dryaod_diag=',dryaod_diag
  • LMDZ6/branches/DYNAMICO-conv/libf/phylmd/phys_output_var_mod.F90

    r2989 r3356  
    1414  REAL, SAVE, ALLOCATABLE :: snow_o(:), zfra_o(:)
    1515  !$OMP THREADPRIVATE(snow_o, zfra_o)
     16  REAL, SAVE, ALLOCATABLE :: sza_o(:) ! solar zenithal angle
     17  !$OMP THREADPRIVATE(sza_o)
    1618  INTEGER, SAVE, ALLOCATABLE ::  itau_con(:)       ! Nombre de pas ou rflag <= 1
    1719  !$OMP THREADPRIVATE(itau_con)
     
    8688
    8789  ! swaero_diag : flag indicates if it is necessary to do calculation for some aerosol diagnostics
     90  ! swaerofree_diag : flag indicates if it is necessary to do calculation for some aerosol diagnostics
    8891  ! dryaod_diag : flag indicates if it is necessary to do calculation for some aerosol diagnostics
    8992  !--OB: this needs to be set to TRUE by default and changed back to FALSE after first radiation call
    9093  !--    and corrected back to TRUE based on output requests
     94  LOGICAL, SAVE                                :: swaerofree_diag=.TRUE.
    9195  LOGICAL, SAVE                                :: swaero_diag=.TRUE.
    9296  LOGICAL, SAVE                                :: dryaod_diag=.TRUE.
    93   !$OMP THREADPRIVATE(swaero_diag, dryaod_diag)
     97  !$OMP THREADPRIVATE(swaerofree_diag, swaero_diag, dryaod_diag)
    9498  ! ok_4xCO2atm : flag indicates if it is necessary to do a second call of
    9599  ! radiation code with a 4xCO2 or another different GES to assess SW/LW
     
    98102  !--    changed back to FALSE after first radiation call and corrected back to TRUE
    99103  !--    based on output requests
    100   LOGICAL, SAVE                                :: ok_4xCO2atm=.FALSE.
     104  LOGICAL, SAVE                                :: ok_4xCO2atm=.TRUE.
    101105  !$OMP THREADPRIVATE(ok_4xCO2atm)
    102106
     
    142146
    143147    allocate(snow_o(klon), zfra_o(klon))
     148    allocate(sza_o(klon) )
    144149    allocate(itau_con(klon))
    145150    allocate(sens_prec_liq_o(klon,2))
     
    196201
    197202    deallocate(snow_o,zfra_o,itau_con)
     203    deallocate(sza_o)
    198204    deallocate (bils_ec,bils_ech,bils_tke,bils_diss,bils_kinetic,bils_enthalp,bils_latent)
    199205    deallocate (d_qw_col, d_ql_col, d_qs_col, d_qt_col, d_ek_col, d_h_dair_col &
  • LMDZ6/branches/DYNAMICO-conv/libf/phylmd/phys_output_write_mod.F90

    r3355 r3356  
    1414CONTAINS
    1515
    16   ! ug Routine pour définir (los du premier passageà) ET sortir les variables
     16  ! ug Routine pour définir (lors du premier passage) ET sortir les variables
    1717  SUBROUTINE phys_output_write(itap, pdtphys, paprs, pphis, &
    1818       pplay, lmax_th, aerosol_couple,         &
     
    3131    USE vertical_layers_mod, ONLY : ap, bp, aps, bps
    3232    USE phys_output_ctrlout_mod, ONLY: o_phis, o_aire, is_ter, is_lic, is_oce, &
     33         o_longitude, o_latitude, &
    3334         o_Ahyb, o_Bhyb,o_Ahyb_inter, o_Bhyb_inter, &
    3435         is_ave, is_sic, o_contfracATM, o_contfracOR, &
     
    3940         o_wind10m, o_wind10max, o_gusts, o_sicf, &
    4041         o_psol, o_mass, o_qsurf, o_qsol, &
    41          o_precip, o_ndayrain, o_plul, o_pluc, o_plun, &
     42         o_precip, o_rain_fall, o_rain_con, o_ndayrain, o_plul, o_pluc, o_plun, &
    4243         o_snow, o_msnow, o_fsnow, o_evap, o_ep,o_epmax_diag, & ! epmax_cape
    4344         o_tops, o_tops0, o_topl, o_topl0, &
    44          o_SWupTOA, o_SWupTOAclr, o_SWdnTOA, &
     45         o_SWupTOA, o_SWupTOAclr, o_SWupTOAcleanclr, o_SWdnTOA, &
    4546         o_SWdnTOAclr, o_nettop, o_SWup200, &
    4647         o_SWup200clr, o_SWdn200, o_SWdn200clr, &
     
    4849         o_LWdn200clr, o_sols, o_sols0, &
    4950         o_soll, o_radsol, o_soll0, o_SWupSFC, &
    50          o_SWupSFCclr, o_SWdnSFC, o_SWdnSFCclr, &
     51         o_SWupSFCclr, o_SWupSFCcleanclr, o_SWdnSFC, o_SWdnSFCclr, o_SWdnSFCcleanclr, &
    5152         o_LWupSFC, o_LWdnSFC, o_LWupSFCclr, &
    52          o_LWdnSFCclr, o_bils, o_bils_diss, &
     53         o_LWdnSFCclr, o_LWupTOAcleanclr, o_LWdnSFCcleanclr, o_bils, o_bils_diss, &
    5354         o_bils_ec,o_bils_ech, o_bils_tke, o_bils_kinetic, &
    5455         o_bils_latent, o_bils_enthalp, o_sens, &
    55          o_fder, o_ffonte, o_fqcalving, o_fqfonte, o_runofflic, &
     56         o_fder, o_ffonte, o_fqcalving, o_fqfonte, o_mrroli, o_runofflic, &
    5657         o_taux, o_tauy, o_snowsrf, o_qsnow, &
    5758         o_snowhgt, o_toice, o_sissnow, o_runoff, &
     
    6970         o_cldhjn, o_cldtjn, o_cldq, o_lwp, o_iwp, &
    7071         o_ue, o_ve, o_uq, o_vq, o_cape, o_pbase, &
     72         o_uwat, o_vwat, &
    7173         o_ptop, o_fbase, o_plcl, o_plfc, &
    7274         o_wbeff, o_convoccur, o_cape_max, o_upwd, o_ep,o_epmax_diag, o_Ma, &
    73          o_dnwd, o_dnwd0, o_ftime_con, o_mc, &
     75         o_dnwd, o_dnwd0, o_ftime_deepcv, o_ftime_con, o_mc, &
    7476         o_prw, o_prlw, o_prsw, o_s_pblh, o_s_pblt, o_s_lcl, &
    7577         o_s_therm, o_uSTDlevs, o_vSTDlevs, &
     
    8284         o_cdragh_x   , o_cdragh_w   , o_cdragm_x   , o_cdragm_w   , &
    8385         o_kh         , o_kh_x       , o_kh_w       , &
    84          o_ale, o_alp, o_cin, o_WAPE, o_wake_h, &
     86         o_ale, o_alp, o_cin, o_WAPE, o_wake_h, o_cv_gen, o_wake_dens, &
    8587         o_wake_s, o_wake_deltat, o_wake_deltaq, &
    8688         o_wake_omg, o_dtwak, o_dqwak, o_dqwak2d, o_Vprecip, &
     
    9799         o_cldemi, o_pr_con_l, o_pr_con_i, &
    98100         o_pr_lsc_l, o_pr_lsc_i, o_re, o_fl, &
    99          o_rh2m, o_rh2m_min, o_rh2m_max, &
     101         o_rh2m, &
    100102         o_qsat2m, o_tpot, o_tpote, o_SWnetOR, &
    101          o_SWdownOR, o_LWdownOR, o_snowl, &
     103         o_LWdownOR, o_snowl, &
    102104         o_solldown, o_dtsvdfo, o_dtsvdft, &
    103105         o_dtsvdfg, o_dtsvdfi, o_z0m, o_z0h,  o_od443aer, o_od550aer, &
     
    119121         o_swtoacf_zero, o_swsrfcf_zero, &
    120122         o_topswai, o_solswai, o_toplwai, o_sollwai, o_scdnc, &
    121          o_cldncl, o_reffclws, o_reffclwc, o_stratomask,&
     123         o_cldncl, o_reffclws, o_reffclwc, o_solbnd, o_stratomask,&
    122124         o_cldnvi, o_lcc, o_lcc3d, o_lcc3dcon, &
    123          o_lcc3dstra, o_reffclwtop, o_ec550aer, &
     125         o_lcc3dstra, o_icc3dcon, o_icc3dstra, &
     126         o_cldicemxrat, o_cldwatmxrat, o_reffclwtop, o_ec550aer, &
    124127         o_lwcon, o_iwcon, o_temp, o_theta, &
    125128         o_ovapinit, o_ovap, o_oliq, o_ocond, o_geop, &
     
    153156         o_du_gwd_front, o_dv_gwd_front, &
    154157         o_east_gwstress, o_west_gwstress, &
    155          o_rsd, o_rlu, o_rld, o_rsucs, o_rsdcs, &
     158         o_rsd, o_rlu, o_rld, o_rsucs, o_rsdcs, o_rsucsaf, o_rsdcsaf, &
    156159         o_rlucs, o_rldcs, o_tnt, o_tntr, &
    157160         o_tntscpbl, o_tnhus, o_tnhusscpbl, &
     
    166169         o_uxv, o_vxq, o_vxT, o_wxq, o_vxphi, &
    167170         o_wxT, o_uxu, o_vxv, o_TxT, o_trac, &
     171#ifdef REPROBUS
     172         o_nas, &
     173#endif
    168174         o_dtr_vdf, o_dtr_the, o_dtr_con, &
    169175         o_dtr_lessi_impa, o_dtr_lessi_nucl, &
     
    177183         o_lat_prec_liq_oce, o_lat_prec_liq_sic, &
    178184         o_lat_prec_sol_oce, o_lat_prec_sol_sic, &
     185         o_sza, &
    179186! Marine
    180187         o_map_prop_hc, o_map_prop_hist, o_map_emis_hc, o_map_iwp_hc, &
     
    197204         o_budg_sed_part, o_R2SO4, o_OCS_lifetime, o_SO2_lifetime, &
    198205         o_budg_3D_backgr_ocs, o_budg_3D_backgr_so2, &
     206         o_budg_dep_dry_ocs, o_budg_dep_wet_ocs, &
     207         o_budg_dep_dry_so2, o_budg_dep_wet_so2, &
    199208         o_budg_dep_dry_h2so4, o_budg_dep_wet_h2so4, &
    200209         o_budg_dep_dry_part, o_budg_dep_wet_part, &
     
    209218         nday_rain, rain_con, snow_con, &
    210219         topsw, toplw, toplw0, swup, swdn, &
    211          topsw0, swup0, swdn0, SWup200, SWup200clr, &
     220         topsw0, swupc0, swdnc0, swup0, swdn0, SWup200, SWup200clr, &
    212221         SWdn200, SWdn200clr, LWup200, LWup200clr, &
    213222         LWdn200, LWdn200clr, solsw, solsw0, sollw, &
    214223         radsol, swradcorr, sollw0, sollwdown, sollw, gustiness, &
    215          sollwdownclr, lwdn0, ftsol, ustar, u10m, &
     224         sollwdownclr, lwdnc0, lwdn0, ftsol, ustar, u10m, &
    216225         v10m, pbl_tke, wake_delta_pbl_TKE, &
    217226         delta_tsurf, &
    218227         wstar, cape, ema_pcb, ema_pct, &
    219228         ema_cbmf, Ma, fm_therm, ale_bl, alp_bl, ale, &
    220          alp, cin, wake_pe, wake_s, wake_deltat, &
     229         alp, cin, wake_pe, wake_dens, wake_s, wake_deltat, &
    221230         wake_deltaq, ftd, fqd, ale_bl_trig, albsol1, &
     231         ale_wake, ale_bl_stat, &
    222232         rnebcon, wo, falb1, albsol2, coefh, clwcon0, &
    223233         ratqs, entr_therm, zqasc, detr_therm, f0, &
    224          lwup, lwdn, lwup0, coefm, &
    225          swupp, lwupp, swup0p, lwup0p, swdnp, lwdnp, &
    226          swdn0p, lwdn0p, tnondef, O3sumSTD, uvsumSTD, &
     234         lwup, lwdn, lwupc0, lwup0, coefm, &
     235         swupp, lwupp, swupc0p, swup0p, lwupc0p, lwup0p, swdnp, lwdnp, &
     236         swdnc0p, swdn0p, lwdnc0p, lwdn0p, tnondef, O3sumSTD, uvsumSTD, &
    227237         vqsumSTD, vTsumSTD, O3daysumSTD, wqsumSTD, &
    228238         vphisumSTD, wTsumSTD, u2sumSTD, v2sumSTD, &
     
    245255         cldh, cldt, JrNt, cldljn, cldmjn, cldhjn, &
    246256         cldtjn, cldq, flwp, fiwp, ue, ve, uq, vq, &
     257         uwat, vwat, &
    247258         plcl, plfc, wbeff, convoccur, upwd, dnwd, dnwd0, prw, prlw, prsw, &
    248259         s_pblh, s_pblt, s_lcl, s_therm, uwriteSTD, &
    249260         vwriteSTD, wwriteSTD, phiwriteSTD, qwriteSTD, &
    250          twriteSTD, ale_wake, alp_wake, &
    251          dtvdf_x    ,dtvdf_w    ,dqvdf_x    ,dqvdf_w    , &
     261         twriteSTD, alp_wake, &
     262!!         dtvdf_x    ,dtvdf_w    ,dqvdf_x    ,dqvdf_w    , &
     263         d_t_vdf_x    ,d_t_vdf_w    ,d_q_vdf_x    ,d_q_vdf_w    , &
    252264         sens_x     ,sens_w     ,zxfluxlat_x,zxfluxlat_w, &
    253265         cdragh_x   ,cdragh_w   ,cdragm_x   ,cdragm_w   , &
    254266         kh         ,kh_x       ,kh_w       , &
    255          wake_h, &
     267         cv_gen, wake_h, &
    256268         wake_omg, d_t_wake, d_q_wake, Vprecip, &
    257269         wdtrainA, wdtrainM, n2, s2, proba_notrig, &
    258          random_notrig, ale_bl_stat, &
     270         random_notrig, &
    259271         alp_bl_det, alp_bl_fluct_m, alp_bl_conv, &
    260272         alp_bl_stat, alp_bl_fluct_tke, slab_wfbils, &
     
    273285         sollwad0_aero, toplwai_aero, sollwai_aero, &
    274286         scdnc, cldncl, reffclws, reffclwc, cldnvi, stratomask,&
    275          lcc, lcc3d, lcc3dcon, lcc3dstra, reffclwtop, &
     287         lcc, lcc3d, lcc3dcon, lcc3dstra, &
     288         icc3dcon, icc3dstra, zfice, reffclwtop, &
    276289         ec550aer, flwc, fiwc, t_seri, theta, q_seri, &
    277290         ql_seri, qs_seri, tr_seri, &
     
    301314         budg_sed_part, R2SO4, OCS_lifetime, SO2_lifetime, &
    302315         budg_3D_backgr_ocs, budg_3D_backgr_so2, &
     316         budg_dep_dry_ocs, budg_dep_wet_ocs, &
     317         budg_dep_dry_so2, budg_dep_wet_so2, &
    303318         budg_dep_dry_h2so4, budg_dep_wet_h2so4, &
    304319         budg_dep_dry_part, budg_dep_wet_part, &
     
    309324#endif
    310325
     326#ifdef REPROBUS
     327    USE CHEM_REP, ONLY : nas, nbnas, tnamenas, ttextnas
     328#endif
     329
    311330    USE phys_output_var_mod, ONLY: vars_defined, snow_o, zfra_o, bils_diss, &
    312331         bils_ec,bils_ech, bils_tke, bils_kinetic, bils_latent, bils_enthalp, &
    313332         itau_con, nfiles, clef_files, nid_files, dryaod_diag, &
    314333         zustr_gwd_hines, zvstr_gwd_hines,zustr_gwd_rando, zvstr_gwd_rando, &
    315          zustr_gwd_front, zvstr_gwd_front,     &
     334         zustr_gwd_front, zvstr_gwd_front, sza_o,    &
    316335         sens_prec_liq_o, sens_prec_sol_o, lat_prec_liq_o, lat_prec_sol_o, &
    317336         cloudth_sth,cloudth_senv,cloudth_sigmath,cloudth_sigmaenv, &
     
    336355    USE indice_sol_mod, ONLY: nbsrf
    337356    USE infotrac_phy, ONLY: nqtot, nqo, type_trac, tname, niadv
    338     USE geometry_mod, ONLY: cell_area
     357    USE geometry_mod, ONLY: cell_area, latitude_deg, longitude_deg
    339358    USE surface_data, ONLY: type_ocean, version_ocean, ok_veget, ok_snow
    340359    USE aero_mod, ONLY: naero_tot, id_STRAT_phy
     
    386405    INTEGER :: itau_w
    387406    INTEGER :: i, iinit, iinitend=1, iff, iq, iiq, nsrf, k, ll, naero
    388     REAL, DIMENSION (klon) :: zx_tmp_fi2d
     407    REAL, DIMENSION (klon) :: zx_tmp_fi2d, zpt_conv2d
    389408    REAL, DIMENSION (klon,klev) :: zx_tmp_fi3d, zpt_conv
    390409    REAL, DIMENSION (klon,klev+1) :: zx_tmp_fi3d1
     410    REAL, DIMENSION (klon,NSW) :: zx_tmp_fi3dsp
    391411    CHARACTER (LEN=4)              :: bb2
    392412    INTEGER, DIMENSION(nbp_lon*nbp_lat)  :: ndex2d
     
    550570       CALL histwrite_phy(o_Ahyb_inter, Ahyb_bounds)
    551571       CALL histwrite_phy(o_Bhyb_inter, Bhyb_bounds)
     572       CALL histwrite_phy(o_longitude, longitude_deg)
     573       CALL histwrite_phy(o_latitude, latitude_deg)
    552574!
    553575#ifdef CPP_RRTM
     
    609631     ENDIF
    610632
     633       CALL histwrite_phy(o_sza, sza_o)
    611634       CALL histwrite_phy(o_flat, zxfluxlat)
    612635       CALL histwrite_phy(o_ptstar, ptstar)
     
    667690
    668691       CALL histwrite_phy(o_precip, zx_tmp_fi2d)
     692       CALL histwrite_phy(o_rain_fall, rain_fall)
    669693       CALL histwrite_phy(o_ndayrain, nday_rain)
    670694
     
    687711       ENDIF
    688712       CALL histwrite_phy(o_pluc, zx_tmp_fi2d)
     713       CALL histwrite_phy(o_rain_con, rain_con)
    689714       CALL histwrite_phy(o_snow, snow_fall)
    690715       CALL histwrite_phy(o_msnow, zxsnow)
     
    714739       ENDIF
    715740       CALL histwrite_phy(o_SWupTOAclr, zx_tmp_fi2d)
     741
     742       IF (vars_defined) THEN
     743          zx_tmp_fi2d(:) = swupc0(:,klevp1)*swradcorr(:)
     744       ENDIF
     745       CALL histwrite_phy(o_SWupTOAcleanclr, zx_tmp_fi2d)
    716746
    717747       IF (vars_defined) THEN
     
    781811
    782812       IF (vars_defined) THEN
     813          zx_tmp_fi2d(:) = swupc0(:,1)*swradcorr(:)
     814       ENDIF
     815       CALL histwrite_phy(o_SWupSFCcleanclr, zx_tmp_fi2d)
     816
     817       IF (vars_defined) THEN
    783818          zx_tmp_fi2d(:) = swdn(:,1)*swradcorr(:)
    784819       ENDIF
     
    789824       ENDIF
    790825       CALL histwrite_phy(o_SWdnSFCclr, zx_tmp_fi2d)
     826
     827       IF (vars_defined) THEN
     828          zx_tmp_fi2d(:) = swdnc0(:,1)*swradcorr(:)
     829       ENDIF
     830       CALL histwrite_phy(o_SWdnSFCcleanclr, zx_tmp_fi2d)
    791831
    792832       IF (vars_defined) THEN
     
    802842       CALL histwrite_phy(o_LWupSFCclr, zx_tmp_fi2d)
    803843       CALL histwrite_phy(o_LWdnSFCclr, sollwdownclr)
     844
     845       IF (vars_defined) THEN
     846          zx_tmp_fi2d(:) = lwupc0(:,klevp1)
     847       ENDIF
     848       CALL histwrite_phy(o_LWupTOAcleanclr, zx_tmp_fi2d)
     849       IF (vars_defined) THEN
     850          zx_tmp_fi2d(:) = -1.*lwdnc0(:,1)
     851       ENDIF
     852       CALL histwrite_phy(o_LWdnSFCcleanclr, zx_tmp_fi2d)
     853
    804854       CALL histwrite_phy(o_bils, bils)
    805855       CALL histwrite_phy(o_bils_diss, bils_diss)
     
    819869       CALL histwrite_phy(o_fqcalving, zxfqcalving)
    820870       CALL histwrite_phy(o_fqfonte, zxfqfonte)
     871       IF (vars_defined) THEN
     872          zx_tmp_fi2d(1:klon)=(zxfqfonte(1:klon)+rain_fall(1:klon))*pctsrf(1:klon,is_lic)
     873       ENDIF
     874       CALL histwrite_phy(o_mrroli, zx_tmp_fi2d)
    821875       CALL histwrite_phy(o_runofflic, zxrunofflic)
    822876       IF (vars_defined) THEN
     
    9581012       CALL histwrite_phy(o_uq, uq)
    9591013       CALL histwrite_phy(o_vq, vq)
     1014       CALL histwrite_phy(o_uwat, uwat)
     1015       CALL histwrite_phy(o_vwat, vwat)
    9601016       IF (iflag_con.GE.3) THEN ! sb
    9611017          CALL histwrite_phy(o_cape, cape)
     
    9761032          CALL histwrite_phy(o_dnwd, dnwd)
    9771033          CALL histwrite_phy(o_dnwd0, dnwd0)
    978           IF (vars_defined)         zx_tmp_fi2d=float(itau_con)/float(itap)
    979           CALL histwrite_phy(o_ftime_con, zx_tmp_fi2d)
     1034          !! The part relative to the frequency of occurence of convection
     1035          !! is now grouped with the part relative to thermals and shallow
     1036          !! convection (output of the 3 fields: ftime_deepcv, ftime_th and
     1037          !!  ftime_con).
    9801038          IF (vars_defined) THEN
    9811039             IF (iflag_thermals>=1)THEN
    982                 zx_tmp_fi3d=dnwd+dnwd0+upwd+fm_therm(:,1:klev)
     1040                zx_tmp_fi3d=-dnwd+dnwd0+upwd+fm_therm(:,1:klev)
    9831041             ELSE
    984                 zx_tmp_fi3d=dnwd+dnwd0+upwd
     1042                zx_tmp_fi3d=-dnwd+dnwd0+upwd
    9851043             ENDIF
    9861044          ENDIF
     
    10991157             CALL histwrite_phy(o_alp_wk, alp_wake)
    11001158             IF (iflag_pbl_split>=1) THEN
    1101                !ym warning : dtvdf_x, dtvdf_w, dqvdf_x, dqvdf_w are not defined by model
    1102                !ym => init to 0 in phys_local_var_mod
    1103                IF (vars_defined) zx_tmp_fi3d(1:klon,1:klev)=dtvdf_x(1:klon,1:klev)/pdtphys
    1104                CALL histwrite_phy(o_dtvdf_x    ,zx_tmp_fi3d)
    1105                IF (vars_defined) zx_tmp_fi3d(1:klon,1:klev)=dtvdf_w(1:klon,1:klev)/pdtphys
    1106                CALL histwrite_phy(o_dtvdf_w    ,zx_tmp_fi3d)
    1107                IF (vars_defined) zx_tmp_fi3d(1:klon,1:klev)=dqvdf_x(1:klon,1:klev)/pdtphys
    1108                CALL histwrite_phy(o_dqvdf_x    ,zx_tmp_fi3d)
    1109                IF (vars_defined) zx_tmp_fi3d(1:klon,1:klev)=dqvdf_w(1:klon,1:klev)/pdtphys
     1159               IF (vars_defined) zx_tmp_fi3d(1:klon,1:klev)=d_t_vdf_x(1:klon,1:klev)/pdtphys
     1160               CALL histwrite_phy(o_dtvdf_x    ,zx_tmp_fi3d)
     1161               IF (vars_defined) zx_tmp_fi3d(1:klon,1:klev)=d_t_vdf_w(1:klon,1:klev)/pdtphys
     1162               CALL histwrite_phy(o_dtvdf_w    ,zx_tmp_fi3d)
     1163               IF (vars_defined) zx_tmp_fi3d(1:klon,1:klev)=d_q_vdf_x(1:klon,1:klev)/pdtphys
     1164               CALL histwrite_phy(o_dqvdf_x    ,zx_tmp_fi3d)
     1165               IF (vars_defined) zx_tmp_fi3d(1:klon,1:klev)=d_q_vdf_w(1:klon,1:klev)/pdtphys
     1166
     1167!
    11101168               CALL histwrite_phy(o_dqvdf_w    ,zx_tmp_fi3d)
    11111169               CALL histwrite_phy(o_sens_x     ,sens_x     )
     
    11261184             CALL histwrite_phy(o_cin, cin)
    11271185             CALL histwrite_phy(o_WAPE, wake_pe)
     1186             CALL histwrite_phy(o_cv_gen, cv_gen)
    11281187             CALL histwrite_phy(o_wake_h, wake_h)
     1188             CALL histwrite_phy(o_wake_dens, wake_dens)
    11291189             CALL histwrite_phy(o_wake_s, wake_s)
    11301190             CALL histwrite_phy(o_wake_deltat, wake_deltat)
     
    12211281       CALL histwrite_phy(o_rh2m, zx_tmp_fi2d)
    12221282
    1223        IF (vars_defined) THEN
    1224           DO i=1, klon
    1225              zx_tmp_fi2d(i)=MIN(100.,rh2m(i)*100.)
    1226           ENDDO
    1227        ENDIF
    1228        CALL histwrite_phy(o_rh2m_min, zx_tmp_fi2d)
    1229 
    1230        IF (vars_defined) THEN
    1231           DO i=1, klon
    1232              zx_tmp_fi2d(i)=MIN(100.,rh2m(i)*100.)
    1233           ENDDO
    1234        ENDIF
    1235        CALL histwrite_phy(o_rh2m_max, zx_tmp_fi2d)
     1283!       IF (vars_defined) THEN
     1284!          DO i=1, klon
     1285!             zx_tmp_fi2d(i)=MIN(100.,rh2m(i)*100.)
     1286!          ENDDO
     1287!       ENDIF
     1288!       CALL histwrite_phy(o_rh2m_min, zx_tmp_fi2d)
     1289
     1290!       IF (vars_defined) THEN
     1291!          DO i=1, klon
     1292!             zx_tmp_fi2d(i)=MIN(100.,rh2m(i)*100.)
     1293!          ENDDO
     1294!       ENDIF
     1295!       CALL histwrite_phy(o_rh2m_max, zx_tmp_fi2d)
    12361296
    12371297       CALL histwrite_phy(o_qsat2m, qsat2m)
     
    12401300       IF (vars_defined) zx_tmp_fi2d(1 : klon) = fsolsw( 1 : klon, is_ter)
    12411301       CALL histwrite_phy(o_SWnetOR,  zx_tmp_fi2d)
    1242        IF (vars_defined) zx_tmp_fi2d(1:klon) = solsw(1:klon)/(1.-albsol1(1:klon))
    1243        CALL histwrite_phy(o_SWdownOR,  zx_tmp_fi2d)
    12441302       CALL histwrite_phy(o_LWdownOR, sollwdown)
    12451303       CALL histwrite_phy(o_snowl, snow_lsc)
     
    13301388          CALL histwrite_phy(o_budg_3D_nucl,         budg_3D_nucl)
    13311389          CALL histwrite_phy(o_budg_3D_cond_evap,    budg_3D_cond_evap)
     1390          CALL histwrite_phy(o_budg_dep_dry_ocs,     budg_dep_dry_ocs)
     1391          CALL histwrite_phy(o_budg_dep_wet_ocs,     budg_dep_wet_ocs)
     1392          CALL histwrite_phy(o_budg_dep_dry_so2,     budg_dep_dry_so2)
     1393          CALL histwrite_phy(o_budg_dep_wet_so2,     budg_dep_wet_so2)
    13321394          CALL histwrite_phy(o_budg_dep_dry_h2so4,   budg_dep_dry_h2so4)
    13331395          CALL histwrite_phy(o_budg_dep_wet_h2so4,   budg_dep_wet_h2so4)
     
    14351497          CALL histwrite_phy(o_lcc3dcon, lcc3dcon)
    14361498          CALL histwrite_phy(o_lcc3dstra, lcc3dstra)
     1499          CALL histwrite_phy(o_icc3dcon, icc3dcon)
     1500          CALL histwrite_phy(o_icc3dstra, icc3dstra)
     1501          CALL histwrite_phy(o_cldicemxrat, zfice)
     1502          zx_tmp_fi3d(:,:)=1-zfice(:,:)
     1503          CALL histwrite_phy(o_cldwatmxrat, zx_tmp_fi3d)
    14371504          CALL histwrite_phy(o_reffclwtop, reffclwtop)
    14381505       ENDIF
     
    14621529       CALL histwrite_phy(o_zfull,zx_tmp_fi3d)
    14631530
     1531#ifdef CPP_XIOS
     1532!solbnd begin
     1533#ifdef CPP_RRTM
     1534      IF (iflag_rrtm.EQ.1) THEN
     1535       IF (vars_defined) THEN
     1536        DO ISW=1, NSW
     1537          zx_tmp_fi3dsp(:,ISW) = swdn(:,klevp1)*swradcorr(:)*RSUN(ISW)
     1538        ENDDO
     1539        CALL histwrite_phy(o_solbnd, zx_tmp_fi3dsp)
     1540       ENDIF
     1541      ENDIF
     1542#endif
     1543!solbnd end
     1544#endif
     1545
    14641546       IF (flag_aerosol_strat.EQ.2) THEN
    14651547         CALL histwrite_phy(o_stratomask, stratomask)
     
    14701552        DO k = 2, klev
    14711553         DO i = 1, klon
    1472             zx_tmp_fi3d(i,k) = zphi(i,k)/RG + &
     1554            zx_tmp_fi3d(i,k) = zphi(i,k-1)/RG + &
    14731555                          (zphi(i,k)-zphi(i,k-1))/RG * &
    1474                           (paprs(i,k)-pplay(i,k))/(pplay(i,k)-pplay(i,k-1))
     1556                          (paprs(i,k)-pplay(i,k-1))/(pplay(i,k)-pplay(i,k-1))
    14751557         ENDDO
    14761558        ENDDO
     
    16421724          CALL histwrite_phy(o_plulst, plul_st)
    16431725          IF (vars_defined) THEN
     1726             do i=1,klon
     1727                zx_tmp_fi2d(1:klon)=lmax_th(:)
     1728             enddo
     1729          ENDIF
     1730          CALL histwrite_phy(o_lmaxth, zx_tmp_fi2d)
     1731          IF (vars_defined) THEN
    16441732             DO k=1,klev
    16451733                DO i=1,klon
     
    16531741          ENDIF
    16541742          CALL histwrite_phy(o_ptconvth, zx_tmp_fi3d)
    1655           IF (vars_defined) THEN
    1656              do i=1,klon
    1657                 zx_tmp_fi2d(1:klon)=lmax_th(:)
    1658              enddo
    1659           ENDIF
    1660           CALL histwrite_phy(o_lmaxth, zx_tmp_fi2d)
    16611743       ENDIF ! iflag_thermals>=1
     1744!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
     1745       zpt_conv = 0.
     1746       WHERE (ptconv) zpt_conv = 1.
     1747       CALL histwrite_phy(o_ptconv, zpt_conv)
     1748!!       IF (vars_defined)         zx_tmp_fi2d=float(itau_con)/float(itap)
     1749!!       CALL histwrite_phy(o_ftime_con, zx_tmp_fi2d)
     1750       IF (vars_defined) THEN
     1751          zpt_conv2d(:) = 0.
     1752          DO k=1,klev
     1753            WHERE (ptconv(:,k)) zpt_conv2d(:) = 1.
     1754          ENDDO
     1755       ENDIF
     1756       CALL histwrite_phy(o_ftime_deepcv, zpt_conv2d)
     1757       IF (vars_defined) THEN
     1758          zx_tmp_fi2d(:) = 0.
     1759          DO k=1,klev
     1760            WHERE (ptconvth(:,k)) zx_tmp_fi2d(:) = 1.
     1761          ENDDO
     1762       ENDIF
     1763       CALL histwrite_phy(o_ftime_th, zx_tmp_fi2d)
     1764       IF (vars_defined) THEN
     1765           zx_tmp_fi2d(:) = max(zx_tmp_fi2d(:),zpt_conv2d(:))
     1766       ENDIF
     1767       CALL histwrite_phy(o_ftime_con, zx_tmp_fi2d)
    16621768!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
    16631769       IF (vars_defined) zx_tmp_fi3d(1:klon,1:klev)=d_t_vdf(1:klon,1:klev)/pdtphys
     
    16751781       IF (vars_defined) CALL water_int(klon,klev,zx_tmp_fi3d,zmasse,zx_tmp_fi2d)
    16761782       CALL histwrite_phy(o_dqeva2d, zx_tmp_fi2d)
    1677        zpt_conv = 0.
    1678        WHERE (ptconv) zpt_conv = 1.
    1679        CALL histwrite_phy(o_ptconv, zpt_conv)
    16801783       CALL histwrite_phy(o_ratqs, ratqs)
    16811784       IF (vars_defined) THEN
     
    16951798       IF (iflag_thermals>=1) THEN
    16961799          ! Pour l instant 0 a y reflichir pour les thermiques
    1697           zx_tmp_fi2d=0.
    1698           CALL histwrite_phy(o_ftime_th, zx_tmp_fi2d)
     1800          ! regroupe avec ftime_deepcv et ftime_con
     1801          !!zx_tmp_fi2d=0.
     1802          !!CALL histwrite_phy(o_ftime_th, zx_tmp_fi2d)
    16991803          CALL histwrite_phy(o_f_th, fm_therm)
    17001804          CALL histwrite_phy(o_e_th, entr_therm)
     
    18281932       ENDIF
    18291933       CALL histwrite_phy(o_rsdcs, zx_tmp_fi3d1)
     1934       DO k=1, klevp1
     1935         zx_tmp_fi3d1(:,k)=swdnc0(:,k)*swradcorr(:)
     1936       ENDDO
     1937       CALL histwrite_phy(o_rsdcsaf, zx_tmp_fi3d1)
    18301938
    18311939       CALL histwrite_phy(o_rlu, lwup)
     
    20622170            IF (type_trac == 'lmdz' .OR. type_trac == 'repr' .OR. type_trac == 'coag') THEN
    20632171             !--3D fields
    2064 !             CALL histwrite_phy(o_trac(iq-nqo), tr_seri(:,:,iq-nqo))
    2065 !             CALL histwrite_phy(o_dtr_vdf(iq-nqo),d_tr_cl(:,:,iq-nqo))
    2066 !             CALL histwrite_phy(o_dtr_the(iq-nqo),d_tr_th(:,:,iq-nqo))
    2067 !             CALL histwrite_phy(o_dtr_con(iq-nqo),d_tr_cv(:,:,iq-nqo))
    2068 !             CALL histwrite_phy(o_dtr_lessi_impa(iq-nqo),d_tr_lessi_impa(:,:,iq-nqo))
    2069 !             CALL histwrite_phy(o_dtr_lessi_nucl(iq-nqo),d_tr_lessi_nucl(:,:,iq-nqo))
    2070 !             CALL histwrite_phy(o_dtr_insc(iq-nqo),d_tr_insc(:,:,iq-nqo))
    2071 !             CALL histwrite_phy(o_dtr_bcscav(iq-nqo),d_tr_bcscav(:,:,iq-nqo))
    2072 !             CALL histwrite_phy(o_dtr_evapls(iq-nqo),d_tr_evapls(:,:,iq-nqo))
    2073 !             CALL histwrite_phy(o_dtr_ls(iq-nqo),d_tr_ls(:,:,iq-nqo))
    2074 !             CALL histwrite_phy(o_dtr_trsp(iq-nqo),d_tr_trsp(:,:,iq-nqo))
    2075 !             CALL histwrite_phy(o_dtr_sscav(iq-nqo),d_tr_sscav(:,:,iq-nqo))
    2076 !             CALL histwrite_phy(o_dtr_sat(iq-nqo),d_tr_sat(:,:,iq-nqo))
    2077 !             CALL histwrite_phy(o_dtr_uscav(iq-nqo),d_tr_uscav(:,:,iq-nqo))
     2172             CALL histwrite_phy(o_trac(iq-nqo), tr_seri(:,:,iq-nqo))
     2173             CALL histwrite_phy(o_dtr_vdf(iq-nqo),d_tr_cl(:,:,iq-nqo))
     2174             CALL histwrite_phy(o_dtr_the(iq-nqo),d_tr_th(:,:,iq-nqo))
     2175             CALL histwrite_phy(o_dtr_con(iq-nqo),d_tr_cv(:,:,iq-nqo))
     2176             CALL histwrite_phy(o_dtr_lessi_impa(iq-nqo),d_tr_lessi_impa(:,:,iq-nqo))
     2177             CALL histwrite_phy(o_dtr_lessi_nucl(iq-nqo),d_tr_lessi_nucl(:,:,iq-nqo))
     2178             CALL histwrite_phy(o_dtr_insc(iq-nqo),d_tr_insc(:,:,iq-nqo))
     2179             CALL histwrite_phy(o_dtr_bcscav(iq-nqo),d_tr_bcscav(:,:,iq-nqo))
     2180             CALL histwrite_phy(o_dtr_evapls(iq-nqo),d_tr_evapls(:,:,iq-nqo))
     2181             CALL histwrite_phy(o_dtr_ls(iq-nqo),d_tr_ls(:,:,iq-nqo))
     2182             CALL histwrite_phy(o_dtr_trsp(iq-nqo),d_tr_trsp(:,:,iq-nqo))
     2183             CALL histwrite_phy(o_dtr_sscav(iq-nqo),d_tr_sscav(:,:,iq-nqo))
     2184             CALL histwrite_phy(o_dtr_sat(iq-nqo),d_tr_sat(:,:,iq-nqo))
     2185             CALL histwrite_phy(o_dtr_uscav(iq-nqo),d_tr_uscav(:,:,iq-nqo))
    20782186             !--2D fields
    2079 !             CALL histwrite_phy(o_dtr_dry(iq-nqo), flux_tr_dry(:,iq-nqo))
     2187             CALL histwrite_phy(o_dtr_dry(iq-nqo), flux_tr_dry(:,iq-nqo))
    20802188             zx_tmp_fi2d=0.
    20812189             IF (vars_defined) THEN
     
    20842192                ENDDO
    20852193             ENDIF
    2086 !             CALL histwrite_phy(o_trac_cum(iq-nqo), zx_tmp_fi2d)
     2194#ifndef REPROBUS
     2195             CALL histwrite_phy(o_trac_cum(iq-nqo), zx_tmp_fi2d)
     2196#endif
    20872197            ENDIF
    20882198          ENDDO
    20892199       ENDIF
     2200
     2201       IF (type_trac == 'repr') THEN
     2202#ifdef REPROBUS
     2203           DO iq=1,nbnas
     2204             CALL histwrite_phy(o_nas(iq), nas(:,:,iq))
     2205           ENDDO
     2206#endif
     2207       ENDIF
     2208
    20902209       ENDIF   !(iflag_phytrac==1)
    20912210
  • LMDZ6/branches/DYNAMICO-conv/libf/phylmd/phys_state_var_mod.F90

    r3312 r3356  
    1616      INTEGER, PARAMETER :: nout=3
    1717      INTEGER, PARAMETER :: napisccp=1
    18       INTEGER, SAVE :: radpas
    19       INTEGER, SAVE :: cvpas
    20       INTEGER, SAVE :: wkpas
     18      INTEGER, SAVE :: radpas  ! radiation is called every "radpas" step
     19      INTEGER, SAVE :: cvpas   ! convection is called every "cvpas" step
     20      INTEGER, SAVE :: cvpas_0 ! reference value for cvpas
     21      INTEGER, SAVE :: wkpas   ! wake scheme is called every "wkpas" step
    2122      REAL, PARAMETER :: missing_val_nf90=nf90_fill_real
    2223!$OMP THREADPRIVATE(radpas)
    2324!$OMP THREADPRIVATE(cvpas)
     25!$OMP THREADPRIVATE(cvpas_0)
    2426!$OMP THREADPRIVATE(wkpas)
    2527      REAL, SAVE :: phys_tstep, solaire_etat0
     
    111113!$OMP THREADPRIVATE(clwcon0th,rnebcon0th)
    112114! radiation outputs
    113       REAL,ALLOCATABLE,SAVE :: swdn0(:,:), swdn(:,:)
    114 !$OMP THREADPRIVATE(swdn0,swdn)
    115       REAL,ALLOCATABLE,SAVE :: swup0(:,:), swup(:,:)
    116 !$OMP THREADPRIVATE(swup0,swup)
     115      REAL,ALLOCATABLE,SAVE :: swdnc0(:,:), swdn0(:,:), swdn(:,:)
     116!$OMP THREADPRIVATE(swdnc0,swdn0,swdn)
     117      REAL,ALLOCATABLE,SAVE :: swupc0(:,:), swup0(:,:), swup(:,:)
     118!$OMP THREADPRIVATE(swupc0, swup0,swup)
    117119      REAL,ALLOCATABLE,SAVE :: SWdn200clr(:), SWdn200(:)
    118120!$OMP THREADPRIVATE(SWdn200clr,SWdn200)
    119121      REAL,ALLOCATABLE,SAVE :: SWup200clr(:), SWup200(:)
    120122!$OMP THREADPRIVATE(SWup200clr,SWup200)
    121       REAL,ALLOCATABLE,SAVE :: lwdn0(:,:), lwdn(:,:)
    122 !$OMP THREADPRIVATE(lwdn0,lwdn)
    123       REAL,ALLOCATABLE,SAVE :: lwup0(:,:), lwup(:,:)
    124 !$OMP THREADPRIVATE(lwup0,lwup)
     123      REAL,ALLOCATABLE,SAVE :: lwdnc0(:,:), lwdn0(:,:), lwdn(:,:)
     124!$OMP THREADPRIVATE(lwdnc0,lwdn0,lwdn)
     125      REAL,ALLOCATABLE,SAVE :: lwupc0(:,:), lwup0(:,:), lwup(:,:)
     126!$OMP THREADPRIVATE(lwupc0,lwup0,lwup)
    125127      REAL,ALLOCATABLE,SAVE :: LWdn200clr(:), LWdn200(:)
    126128!$OMP THREADPRIVATE(LWdn200clr,LWdn200)
     
    236238      REAL,ALLOCATABLE,SAVE :: wght_th(:,:)
    237239!$OMP THREADPRIVATE(wght_th)
     240      REAL,ALLOCATABLE,SAVE    :: ale_wake(:)
     241!$OMP THREADPRIVATE(ale_wake)
     242      REAL,ALLOCATABLE,SAVE    :: ale_bl_stat(:)
     243!$OMP THREADPRIVATE(ale_bl_stat)
    238244!
    239245! variables de la wake
     
    241247! wake_deltaq : ecart d'humidite avec la zone non perturbee
    242248! wake_s      : fraction surfacique occupee par la poche froide
     249! awake_dens  : number of active wakes per unit area
    243250! wake_dens   : number of wakes per unit area
    244251! wake_occ    : occurence of wakes (= 1 if wakes occur, =0 otherwise)
     
    252259      REAL,ALLOCATABLE,SAVE :: wake_s(:)
    253260!$OMP THREADPRIVATE(wake_s)
    254       REAL,ALLOCATABLE,SAVE :: wake_dens(:)
    255 !$OMP THREADPRIVATE(wake_dens)
     261      REAL,ALLOCATABLE,SAVE :: awake_dens(:), wake_dens(:)
     262!$OMP THREADPRIVATE(awake_dens, wake_dens)
    256263      REAL,ALLOCATABLE,SAVE :: wake_Cstar(:)
    257264!$OMP THREADPRIVATE(wake_Cstar)
     
    350357      REAL,ALLOCATABLE,SAVE :: solsw0p(:),sollw0p(:)
    351358!$OMP THREADPRIVATE(topsw0p,toplw0p,solsw0p,sollw0p)
    352       REAL,ALLOCATABLE,SAVE :: lwdn0p(:,:), lwdnp(:,:)
    353       REAL,ALLOCATABLE,SAVE :: lwup0p(:,:), lwupp(:,:)
    354 !$OMP THREADPRIVATE(lwdn0p, lwdnp, lwup0p, lwupp)
    355       REAL,ALLOCATABLE,SAVE :: swdn0p(:,:), swdnp(:,:)
    356       REAL,ALLOCATABLE,SAVE :: swup0p(:,:), swupp(:,:)
    357 !$OMP THREADPRIVATE(swdn0p, swdnp, swup0p, swupp)
     359      REAL,ALLOCATABLE,SAVE :: lwdnc0p(:,:), lwdn0p(:,:), lwdnp(:,:)
     360      REAL,ALLOCATABLE,SAVE :: lwupc0p(:,:), lwup0p(:,:), lwupp(:,:)
     361!$OMP THREADPRIVATE(lwdnc0p, lwdn0p, lwdnp, lwupc0p, lwup0p, lwupp)
     362      REAL,ALLOCATABLE,SAVE :: swdnc0p(:,:), swdn0p(:,:), swdnp(:,:)
     363      REAL,ALLOCATABLE,SAVE :: swupc0p(:,:), swup0p(:,:), swupp(:,:)
     364!$OMP THREADPRIVATE(swdnc0p, swdn0p, swdnp, swupc0p, swup0p, swupp)
    358365
    359366! pbase : cloud base pressure
     
    481488      ALLOCATE(clwcon0th(klon,klev),rnebcon0th(klon,klev))
    482489! radiation outputs
    483       ALLOCATE(swdn0(klon,klevp1), swdn(klon,klevp1))
    484       ALLOCATE(swup0(klon,klevp1), swup(klon,klevp1))
    485       ALLOCATE(lwdn0(klon,klevp1), lwdn(klon,klevp1))
    486       ALLOCATE(lwup0(klon,klevp1), lwup(klon,klevp1))
     490      ALLOCATE(swdnc0(klon,klevp1), swdn0(klon,klevp1), swdn(klon,klevp1))
     491      ALLOCATE(swupc0(klon,klevp1), swup0(klon,klevp1), swup(klon,klevp1))
     492      ALLOCATE(lwdnc0(klon,klevp1), lwdn0(klon,klevp1), lwdn(klon,klevp1))
     493      ALLOCATE(lwupc0(klon,klevp1), lwup0(klon,klevp1), lwup(klon,klevp1))
    487494      ALLOCATE(SWdn200clr(klon), SWdn200(klon))
    488495      ALLOCATE(SWup200clr(klon), SWup200(klon))
     
    534541      ALLOCATE(ftd(klon,klev), fqd(klon,klev))
    535542      ALLOCATE(Ale_bl(klon))
     543      ALLOCATE(ale_wake(klon))
     544      ALLOCATE(ale_bl_stat(klon))
    536545      ALLOCATE(Alp_bl(klon))
    537546      ALLOCATE(lalim_conv(klon))
    538547      ALLOCATE(wght_th(klon,klev))
    539548      ALLOCATE(wake_deltat(klon,klev), wake_deltaq(klon,klev))
    540       ALLOCATE(wake_s(klon), wake_dens(klon))
     549      ALLOCATE(wake_s(klon), awake_dens(klon), wake_dens(klon))
    541550      ALLOCATE(wake_Cstar(klon))
    542551      ALLOCATE(wake_pe(klon), wake_fip(klon))
     
    578587      ALLOCATE(topsw0p(klon),toplw0p(klon))
    579588      ALLOCATE(solsw0p(klon),sollw0p(klon))
    580       ALLOCATE(lwdn0p(klon,klevp1), lwdnp(klon,klevp1))
    581       ALLOCATE(lwup0p(klon,klevp1), lwupp(klon,klevp1))
    582       ALLOCATE(swdn0p(klon,klevp1), swdnp(klon,klevp1))
    583       ALLOCATE(swup0p(klon,klevp1), swupp(klon,klevp1))
     589      ALLOCATE(lwdnc0p(klon,klevp1), lwdn0p(klon,klevp1), lwdnp(klon,klevp1))
     590      ALLOCATE(lwupc0p(klon,klevp1), lwup0p(klon,klevp1), lwupp(klon,klevp1))
     591      ALLOCATE(swdnc0p(klon,klevp1), swdn0p(klon,klevp1), swdnp(klon,klevp1))
     592      ALLOCATE(swupc0p(klon,klevp1), swup0p(klon,klevp1), swupp(klon,klevp1))
    584593
    585594      ALLOCATE(cape(klon))
     
    641650      deallocate(clwcon0th, rnebcon0th)
    642651! radiation outputs
    643       deallocate(swdn0, swdn)
    644       deallocate(swup0, swup)
    645       deallocate(lwdn0, lwdn)
    646       deallocate(lwup0, lwup)
     652      deallocate(swdnc0, swdn0, swdn)
     653      deallocate(swupc0, swup0, swup)
     654      deallocate(lwdnc0, lwdn0, lwdn)
     655      deallocate(lwupc0, lwup0, lwup)
    647656      deallocate(SWdn200clr, SWdn200)
    648657      deallocate(SWup200clr, SWup200)
     
    681690      deallocate(ftd, fqd)
    682691      deallocate(Ale_bl, Alp_bl)
     692      deallocate(ale_wake)
     693      deallocate(ale_bl_stat)
    683694      deallocate(lalim_conv, wght_th)
    684695      deallocate(wake_deltat, wake_deltaq)
    685       deallocate(wake_s, wake_dens)
     696      deallocate(wake_s, awake_dens, wake_dens)
    686697      deallocate(wake_Cstar, wake_pe, wake_fip)
    687698!jyg<
     
    715726      deallocate(topsw0p,toplw0p)
    716727      deallocate(solsw0p,sollw0p)
    717       deallocate(lwdn0p, lwdnp)
    718       deallocate(lwup0p, lwupp)
    719       deallocate(swdn0p, swdnp)
    720       deallocate(swup0p, swupp)
     728      deallocate(lwdnc0p, lwdn0p, lwdnp)
     729      deallocate(lwupc0p, lwup0p, lwupp)
     730      deallocate(swdnc0p, swdn0p, swdnp)
     731      deallocate(swupc0p, swup0p, swupp)
    721732      deallocate(cape)
    722733      deallocate(pbase,bbase)
  • LMDZ6/branches/DYNAMICO-conv/libf/phylmd/physiq_mod.F90

    r3355 r3356  
    6363       !
    6464       d_t_vdf,d_q_vdf,d_u_vdf,d_v_vdf,d_t_diss, &
    65        d_t_vdf_w,d_q_vdf_w, &
    66        d_t_vdf_x,d_q_vdf_x, &
    6765       d_ts, &
    6866       !
     
    127125       slab_wfbils, tpot, tpote,               &
    128126       ue, uq, ve, vq, zxffonte,               &
     127       uwat, vwat,                             &
    129128       zxfqcalving, zxfluxlat,                 &
    130129       zxrunofflic,                            &
     
    135134       zxfluxlat_x, zxfluxlat_w, &
    136135       !
    137        dtvdf_x, dtvdf_w, &
    138        dqvdf_x, dqvdf_w, &
     136       d_t_vdf_x, d_t_vdf_w, &
     137       d_q_vdf_x, d_q_vdf_w, &
    139138       pbl_tke_input, &
    140139       t_therm, q_therm, u_therm, v_therm, &
     
    144143       !
    145144       wake_k, &
    146        ale_wake, alp_wake, &
     145       alp_wake, &
    147146       wake_h, wake_omg, &
    148147                       ! tendencies of delta T and delta q:
     
    153152       d_deltat_ajs_cv, d_deltaq_ajs_cv, & ! due to dry adjustment of (w) before convection
    154153                       ! tendencies of wake fractional area and wake number per unit area:
    155        d_s_wk,  d_dens_wk, &             ! due to wakes
    156 !!!       d_s_vdf, d_dens_vdf, &            ! due to vertical diffusion
    157 !!!       d_s_the, d_dens_the, &            ! due to thermals
     154       d_s_wk,  d_dens_a_wk,  d_dens_wk, &  ! due to wakes
     155!!!       d_s_vdf, d_dens_a_vdf, d_dens_vdf, & ! due to vertical diffusion
     156!!!       d_s_the, d_dens_a_the, d_dens_the, & ! due to thermals
    158157       !                                 
    159        ptconv, &
     158       ptconv, ratqsc, &
    160159       wbeff, convoccur, zmax_th, &
    161160       sens, flwp, fiwp,  &
    162        ale_bl_stat,alp_bl_conv,alp_bl_det,  &
     161       alp_bl_conv,alp_bl_det,  &
    163162       alp_bl_fluct_m,alp_bl_fluct_tke,  &
    164163       alp_bl_stat, n2, s2,  &
    165164       proba_notrig, random_notrig,  &
    166        !
    167        dnwd, dnwd0,  &
    168        upwd, omega,  &
     165       cv_gen,  &
     166       !
     167       dnwd0,  &
     168       omega,  &
    169169       epmax_diag,  &
     170
     171       !    Deep convective variables used in phytrac
     172       pmflxr, pmflxs,  &
     173       wdtrainA, wdtrainM,  &
     174       upwd, dnwd, &
    170175       ep,  &
     176       da, mp, &
     177       phi, &
     178       wght_cvfd, &
     179       phi2, &
     180       d1a, dam, &
     181       ev, &
     182       elij, &
     183       clw, &
     184       epmlmMm, eplaMm, &
     185       sij, &
     186
    171187       cldemi,  &
    172188       cldfra, cldtau, fiwc,  &
     
    181197       fsolsw, wfbils, wfbilo,  &
    182198       wfevap, wfrain, wfsnow,  & 
    183        pmflxr, pmflxs, prfl,  &
    184        psfl, fraca, Vprecip,  &
     199       prfl, psfl, fraca, Vprecip,  &
    185200       zw2,  &
    186201       
     
    192207       qwriteSTD, twriteSTD, rhwriteSTD, &    !pour calcul_STDlev.h
    193208       
    194        wdtrainA, wdtrainM,  &
    195209       beta_prec,  &
    196210       rneb,  &
     
    333347    INTEGER igout
    334348    !======================================================================
    335     ! Clef controlant l'activation du cycle diurne:
     349    ! Clef iflag_cycle_diurne controlant l'activation du cycle diurne:
    336350    ! en attente du codage des cles par Fred
    337     INTEGER iflag_cycle_diurne
    338     PARAMETER (iflag_cycle_diurne=1)
     351    ! iflag_cycle_diurne est initialise par conf_phys et se trouve
     352    ! dans clesphys.h (IM)
    339353    !======================================================================
    340354    ! Modele thermique du sol, a activer pour le cycle diurne:
     
    446460    REAL dtadd(klon,klev)
    447461
    448     ! Variables pour le transport convectif
    449     real da(klon,klev),phi(klon,klev,klev),mp(klon,klev)
    450     real wght_cvfd(klon,klev)
    451462#ifndef CPP_XIOS
    452463    REAL, SAVE :: missing_val=nf90_fill_real
    453464#endif
    454     ! Variables pour le lessivage convectif
    455     ! RomP >>>
    456     real phi2(klon,klev,klev)
    457     real d1a(klon,klev),dam(klon,klev)
    458     real ev(klon,klev)
    459     real clw(klon,klev),elij(klon,klev,klev)
    460     real epmlmMm(klon,klev,klev),eplaMm(klon,klev)
    461     ! RomP <<<
     465!!   Variables moved to phys_local_var_mod
     466!!    ! Variables pour le transport convectif
     467!!    real da(klon,klev),phi(klon,klev,klev),mp(klon,klev)
     468!!    real wght_cvfd(klon,klev)
     469!!    ! Variables pour le lessivage convectif
     470!!    ! RomP >>>
     471!!    real phi2(klon,klev,klev)
     472!!    real d1a(klon,klev),dam(klon,klev)
     473!!    real ev(klon,klev)
     474!!    real clw(klon,klev),elij(klon,klev,klev)
     475!!    real epmlmMm(klon,klev,klev),eplaMm(klon,klev)
     476!!    ! RomP <<<
    462477    !IM definition dynamique o_trac dans phys_output_open
    463478    !      type(ctrl_out) :: o_trac(nqtot)
     
    534549    INTEGER k_upper_cv
    535550    !------------------------------------------------------------------
     551    ! Compteur de l'occurence de cvpas=1
     552    INTEGER Ncvpaseq1
     553    SAVE Ncvpaseq1
     554    !$OMP THREADPRIVATE(Ncvpaseq1)
    536555    !
    537556    !==========================================================================
     
    549568    ! variables supplementaires de concvl
    550569    REAL Tconv(klon,klev)
    551     REAL sij(klon,klev,klev)
     570!!    variable moved to phys_local_var_mod
     571!!    REAL sij(klon,klev,klev)
    552572!!    !
    553573!!    ! variables pour tester la conservation de l'energie dans concvl
     
    624644    REAL, SAVE :: alp_offset
    625645    !$OMP THREADPRIVATE(alp_offset)
     646    REAL, SAVE :: dtcon_multistep_max=1.e6
     647    !$OMP THREADPRIVATE(dtcon_multistep_max)
     648    REAL, SAVE :: dqcon_multistep_max=1.e6
     649    !$OMP THREADPRIVATE(dqcon_multistep_max)
     650
    626651 
    627652    !
     
    874899    INTEGER :: flag_inhib_tend = 0 !  0 is the default value
    875900!!    INTEGER :: flag_inhib_tend = 2
     901    !
     902    ! Logical switch to a bug : reseting to 0 convective variables at the
     903    ! begining of physiq.
     904    LOGICAL, SAVE :: ok_bug_cv_trac = .TRUE.
     905    !$OMP THREADPRIVATE(ok_bug_cv_trac)
     906    !
     907    ! Logical switch to a bug : changing wake_deltat when thermals are active
     908    ! even when there are no wakes.
     909    LOGICAL, SAVE :: ok_bug_split_th = .TRUE.
     910    !$OMP THREADPRIVATE(ok_bug_split_th)
    876911
    877912    !
     
    886921    INTEGER kcbot(klon), kctop(klon), kdtop(klon)
    887922    !
    888     REAL ratqsc(klon,klev)
    889923    real ratqsbas,ratqshaut,tau_ratqs
    890924    save ratqsbas,ratqshaut,tau_ratqs
     
    11111145    REAL, dimension(klon, klev) :: cldfrarad   ! fraction nuageuse
    11121146
     1147    !lwoff=y : offset LW CRE for radiation code and other schemes
     1148    REAL, SAVE :: betalwoff
     1149    !OMP THREADPRIVATE(betalwoff)
     1150!
    11131151    INTEGER :: nbtr_tmp ! Number of tracer inside concvl
    11141152    REAL, dimension(klon,klev) :: sh_in ! Specific humidity entering in phytrac
     
    11251163    logical, parameter :: mass_fixer=.false.
    11261164    real qql1(klon),qql2(klon),corrqql
     1165
     1166    REAL pi
     1167
     1168    pi = 4. * ATAN(1.)
    11271169
    11281170    ! Ehouarn: set value of jjmp1 since it is no longer a "fixed parameter"
     
    12041246       ENDIF
    12051247
     1248       Ncvpaseq1 = 0
    12061249       dnwd0=0.0
    12071250       ftd=0.0
     
    12111254       pbase=0
    12121255       !IM 180608
    1213 
    12141256
    12151257       itau_con=0
     
    12371279    IF (debut) THEN
    12381280       CALL suphel ! initialiser constantes et parametres phys.
     1281! tau_gl : constante de rappel de la temperature a la surface de la glace - en
     1282       tau_gl=5.
     1283       CALL getin_p('tau_gl', tau_gl)
     1284! tau_gl : constante de rappel de la temperature a la surface de la glace - en
     1285! secondes
     1286       tau_gl=86400.*tau_gl
     1287       print*,'debut physiq_mod tau_gl=',tau_gl
    12391288       CALL getin_p('iflag_alp_wk_cond', iflag_alp_wk_cond)
    12401289       CALL getin_p('random_notrig_max',random_notrig_max)
     
    12451294                      ! 2 => convective adjustment and state variables are changed
    12461295       CALL getin_p('iflag_adjwk',iflag_adjwk)
     1296       CALL getin_p('dtcon_multistep_max',dtcon_multistep_max)
     1297       CALL getin_p('dqcon_multistep_max',dqcon_multistep_max)
    12471298       CALL getin_p('oliqmax',oliqmax)
    12481299       CALL getin_p('oicemax',oicemax)
     
    12541305                                  ! in rrtm/suphec.F90 (and rvtmp2 is set to 0).
    12551306       CALL getin_p('ok_bad_ecmwf_thermo',ok_bad_ecmwf_thermo)
     1307       CALL getin_p('ok_bug_cv_trac',ok_bug_cv_trac)
     1308       CALL getin_p('ok_bug_split_th',ok_bug_split_th)
    12561309       fl_ebil = 0 ! by default, conservation diagnostics are desactivated
    12571310       CALL getin_p('fl_ebil',fl_ebil)
     
    13281381       print*,'iflag_coupl,iflag_clos,iflag_wake', &
    13291382            iflag_coupl,iflag_clos,iflag_wake
    1330        print*,'iflag_CYCLE_DIURNE', iflag_cycle_diurne
     1383       print*,'iflag_cycle_diurne', iflag_cycle_diurne
    13311384       !
    13321385       IF (iflag_con.EQ.2.AND.iflag_cld_th.GT.-1) THEN
     
    13791432       print *,'physiq, nbapp_cv, nbapp_wk ',nbapp_cv,nbapp_wk
    13801433       IF (MOD(NINT(86400./phys_tstep),nbapp_cv).EQ.0) THEN
    1381           cvpas = NINT( 86400./phys_tstep)/nbapp_cv
     1434          cvpas_0 = NINT( 86400./phys_tstep)/nbapp_cv
     1435          cvpas = cvpas_0
    13821436       print *,'physiq, cvpas ',cvpas
    13831437       ELSE
     
    15101564!jyg<
    15111565       IF (klon_glo==1) THEN
    1512           pbl_tke(:,:,is_ave) = 0.
    1513           DO nsrf=1,nbsrf
    1514             DO k = 1,klev+1
    1515                  pbl_tke(:,k,is_ave) = pbl_tke(:,k,is_ave) &
    1516                      +pctsrf(:,nsrf)*pbl_tke(:,k,nsrf)
    1517             ENDDO
    1518           ENDDO
     1566          IF (iflag_pbl > 1) THEN         
     1567              pbl_tke(:,:,is_ave) = 0.
     1568              DO nsrf=1,nbsrf
     1569                DO k = 1,klev+1
     1570                     pbl_tke(:,k,is_ave) = pbl_tke(:,k,is_ave) &
     1571                         +pctsrf(:,nsrf)*pbl_tke(:,k,nsrf)
     1572                ENDDO
     1573              ENDDO
     1574          ELSE   ! (iflag_pbl > 1)
     1575              pbl_tke(:,:,:) = 0.
     1576          ENDIF  ! (iflag_pbl > 1)
    15191577        ELSE
    15201578          pbl_tke(:,:,is_ave) = 0. !ym missing init : maybe must be initialized in the same way that for klon_glo==1 ??
     
    16861744
    16871745#ifdef CPP_XIOS
    1688        !--setting up swaero_diag to TRUE in XIOS case
    1689        IF (xios_field_is_active("topswad").OR.xios_field_is_active("topswad0").OR. &
    1690            xios_field_is_active("solswad").OR.xios_field_is_active("solswad0").OR. &
    1691            xios_field_is_active("topswai").OR.xios_field_is_active("solswai").OR.  &
    1692              (iflag_rrtm==1.AND.(xios_field_is_active("toplwad").OR.xios_field_is_active("toplwad0").OR. &
    1693                                  xios_field_is_active("sollwad").OR.xios_field_is_active("sollwad0"))))  &
    1694            !!!--for now these fields are not in the XML files so they are omitted
    1695            !!!  xios_field_is_active("toplwai").OR.xios_field_is_active("sollwai") !))) &
    1696            swaero_diag=.TRUE.
    1697 
    1698        !--setting up dryaod_diag to TRUE in XIOS case
    1699        DO naero = 1, naero_tot-1
    1700          IF (xios_field_is_active("dryod550_"//name_aero_tau(naero))) dryaod_diag=.TRUE.
    1701        ENDDO
    1702        !
    1703        !--setting up ok_4xCO2atm to TRUE in XIOS case
    1704        IF (xios_field_is_active("rsut4co2").OR.xios_field_is_active("rlut4co2").OR. &
    1705            xios_field_is_active("rsutcs4co2").OR.xios_field_is_active("rlutcs4co2").OR. &
    1706            xios_field_is_active("rsu4co2").OR.xios_field_is_active("rsucs4co2").OR. &
    1707            xios_field_is_active("rsd4co2").OR.xios_field_is_active("rsdcs4co2").OR. &
    1708            xios_field_is_active("rlu4co2").OR.xios_field_is_active("rlucs4co2").OR. &
    1709            xios_field_is_active("rld4co2").OR.xios_field_is_active("rldcs4co2")) &
    1710            ok_4xCO2atm=.TRUE.
     1746! Need to put this initialisation after phyetat0 as in the coupled model the XIOS context is only
     1747! initialised at that moment
     1748       ! Get "missing_val" value from XML files (from temperature variable)
     1749       !$OMP MASTER
     1750       CALL xios_get_field_attr("temp",default_value=missing_val_omp)
     1751       !$OMP END MASTER
     1752       !$OMP BARRIER
     1753       missing_val=missing_val_omp
    17111754#endif
    17121755
     
    18241867       WRITE(*,*)'lat2_beta=',lat2_beta
    18251868       WRITE(*,*)'mskocean_beta=',mskocean_beta
     1869
     1870      !lwoff=y : offset LW CRE for radiation code and other schemes
     1871      !lwoff=y : betalwoff=1.
     1872      betalwoff=0.
     1873      IF (ok_lwoff) THEN
     1874         betalwoff=1.
     1875      ENDIF
     1876      WRITE(*,*)'ok_lwoff=',ok_lwoff
     1877      !
     1878      !lwoff=y to begin only sollw and sollwdown are set up to CS values
     1879      sollw = sollw + betalwoff * (sollw0 - sollw)
     1880      sollwdown(:)= sollwdown(:) + betalwoff *(-1.*ZFLDN0(:,1) - &
     1881                    sollwdown(:))
    18261882    ENDIF
    18271883    !
     
    18901946       ENDDO
    18911947    ENDDO
    1892     da(:,:)=0.
    1893     mp(:,:)=0.
    1894     phi(:,:,:)=0.
    1895     ! RomP >>>
    1896     phi2(:,:,:)=0.
    18971948    beta_prec_fisrt(:,:)=0.
    18981949    beta_prec(:,:)=0.
    1899     epmlmMm(:,:,:)=0.
    1900     eplaMm(:,:)=0.
    1901     d1a(:,:)=0.
    1902     dam(:,:)=0.
    1903     pmflxr=0.
    1904     pmflxs=0.
    1905     ! RomP <<<
     1950    !
     1951    !   Output variables from the convective scheme should not be set to 0
     1952    !   since convection is not always called at every time step.
     1953    IF (ok_bug_cv_trac) THEN
     1954      da(:,:)=0.
     1955      mp(:,:)=0.
     1956      phi(:,:,:)=0.
     1957      ! RomP >>>
     1958      phi2(:,:,:)=0.
     1959      epmlmMm(:,:,:)=0.
     1960      eplaMm(:,:)=0.
     1961      d1a(:,:)=0.
     1962      dam(:,:)=0.
     1963      pmflxr(:,:)=0.
     1964      pmflxs(:,:)=0.
     1965      ! RomP <<<
     1966    ENDIF
    19061967
    19071968    !
     
    20802141          IF(adjust_tropopause) THEN
    20812142             CALL regr_pr_time_av(ncid_climoz, vars_climoz(1:read_climoz),   &
    2082                       ro3i,  press_edg_climoz,  paprs,   wo, time_climoz,    &
    2083                       longitude_deg,   latitude_deg,    press_cen_climoz,    &
     2143                      ro3i, 'C', press_cen_climoz, pplay, wo, paprs(:,1),    &
     2144                      time_climoz ,  longitude_deg,   latitude_deg,          &
    20842145                      dyn_tropopause(t_seri, ztsol, paprs, pplay, rot))
    20852146          ELSE
    2086              CALL regr_pr_time_av(ncid_climoz, vars_climoz(1:read_climoz),   &
    2087                       ro3i,  press_edg_climoz,  paprs,  wo,  time_climoz)
     2147             CALL regr_pr_time_av(ncid_climoz,  vars_climoz(1:read_climoz),  &
     2148                      ro3i, 'C', press_cen_climoz, pplay, wo, paprs(:,1),    &
     2149                      time_climoz )
    20882150          END IF
    20892151          ! Convert from mole fraction of ozone to column density of ozone in a
     
    21972259       END SELECT
    21982260    ENDIF
     2261    sza_o = ACOS (rmu0) *180./pi
    21992262
    22002263    IF (mydebug) THEN
     
    22342297!!jyg       IF (prt_level .ge. 2 .and. mod(iflag_pbl_split,2) .eq. 1) THEN
    22352298       IF (prt_level .ge. 2 .and. mod(iflag_pbl_split,10) .ge. 1) THEN
    2236           print *,'debut du splitting de la PBL'
     2299          print *,'debut du splitting de la PBL, wake_s = ', wake_s(:)
     2300          print *,'debut du splitting de la PBL, wake_deltat = ', wake_deltat(:,1)
     2301          print *,'debut du splitting de la PBL, wake_deltaq = ', wake_deltaq(:,1)
    22372302       ENDIF
    22382303       ! !!
     
    22462311          gustiness(1:klon)=0
    22472312       ELSE IF (iflag_gusts==1) THEN
    2248           do i = 1, klon
    2249              gustiness(i)=f_gust_bl*ale_bl(i)+f_gust_wk*ale_wake(i)
    2250           enddo
     2313          gustiness(1:klon)=f_gust_bl*ale_bl(1:klon)+f_gust_wk*ale_wake(1:klon)
     2314       ELSE IF (iflag_gusts==2) THEN
     2315          gustiness(1:klon)=f_gust_bl*ale_bl_stat(1:klon)+f_gust_wk*ale_wake(1:klon)
    22512316          ! ELSE IF (iflag_gusts==2) THEN
    22522317          !    do i = 1, klon
     
    23232388          d_deltaq_vdf(:,:) = d_q_vdf_w(:,:)-d_q_vdf_x(:,:)
    23242389          CALL add_wake_tend &
    2325              (d_deltat_vdf, d_deltaq_vdf, dsig0, ddens0, wkoccur1, 'vdf', abortphy)
     2390             (d_deltat_vdf, d_deltaq_vdf, dsig0, ddens0, ddens0, wkoccur1, 'vdf', abortphy)
    23262391       ELSE
    23272392          d_deltat_vdf(:,:) = 0.
     
    24652530    ! Appel de la convection tous les "cvpas"
    24662531    !
    2467     IF (MOD(itapcv,cvpas).EQ.0) THEN
    2468 
     2532!!jyg    IF (MOD(itapcv,cvpas).EQ.0) THEN
     2533!!    print *,' physiq : itapcv, cvpas, itap-1, cvpas_0 ', &
     2534!!                       itapcv, cvpas, itap-1, cvpas_0
     2535    IF (MOD(itapcv,cvpas).EQ.0 .OR. MOD(itap-1,cvpas_0).EQ.0) THEN
     2536
     2537    !
     2538    ! Mettre a zero des variables de sortie (pour securite)
     2539    !
     2540    pmflxr(:,:) = 0.
     2541    pmflxs(:,:) = 0.
     2542    wdtrainA(:,:) = 0.
     2543    wdtrainM(:,:) = 0.
     2544    upwd(:,:) = 0.
     2545    dnwd(:,:) = 0.
     2546    ep(:,:) = 0.
     2547    da(:,:)=0.
     2548    mp(:,:)=0.
     2549    wght_cvfd(:,:)=0.
     2550    phi(:,:,:)=0.
     2551    phi2(:,:,:)=0.
     2552    epmlmMm(:,:,:)=0.
     2553    eplaMm(:,:)=0.
     2554    d1a(:,:)=0.
     2555    dam(:,:)=0.
     2556    elij(:,:,:)=0.
     2557    ev(:,:)=0.
     2558    clw(:,:)=0.
     2559    sij(:,:,:)=0.
     2560    !
    24692561    IF (iflag_con.EQ.1) THEN
    24702562       abort_message ='reactiver le call conlmd dans physiq.F'
     
    25392631             IF (iflag_adjwk == 2) THEN
    25402632               CALL add_wake_tend &
    2541                  (d_deltat_ajs_cv, d_deltaq_ajs_cv, dsig0, ddens0, wkoccur1, 'ajs_cv', abortphy)
     2633                 (d_deltat_ajs_cv, d_deltaq_ajs_cv, dsig0, ddens0, ddens0, wkoccur1, 'ajs_cv', abortphy)
    25422634             ENDIF  ! (iflag_adjwk == 2)
    25432635          ENDIF  ! (iflag_adjwk >= 1)
     
    25682660          ! Calculate the upmost level of deep convection loops: k_upper_cv
    25692661          !  (near 22 km)
    2570           izero = klon/2+1/klon
    25712662          k_upper_cv = klev
     2663          !izero = klon/2+1/klon
     2664          !DO k = klev,1,-1
     2665          !   IF (pphi(izero,k) > 22.e4) k_upper_cv = k
     2666          !ENDDO
     2667          ! FH : nouveau calcul base sur un profil global sans quoi
     2668          ! le modele etait sensible au decoupage de domaines
    25722669          DO k = klev,1,-1
    2573              IF (pphi(izero,k) > 22.e4) k_upper_cv = k
     2670             IF (-7*log(presnivs(k)/presnivs(1)) > 25.) k_upper_cv = k
    25742671          ENDDO
    25752672          IF (prt_level .ge. 5) THEN
     
    26152712          clwcon0=qcondc
    26162713          pmfu(:,:)=upwd(:,:)+dnwd(:,:)
    2617 
     2714          !
     2715          !jyg<
     2716          ! If convective tendencies are too large, then call convection
     2717          !  every time step
     2718          cvpas = cvpas_0
     2719          DO k=1,k_upper_cv
     2720             DO i=1,klon
     2721               IF (d_t_con(i,k) > 6.721 .AND. d_t_con(i,k) < 6.722 .AND.&
     2722                   d_q_con(i,k) > -.0002171 .AND. d_q_con(i,k) < -.0002170) THEN
     2723                     dtcon_multistep_max = 3.
     2724                     dqcon_multistep_max = 0.02
     2725               ENDIF
     2726             ENDDO
     2727          ENDDO
     2728!
     2729          DO k=1,k_upper_cv
     2730             DO i=1,klon
     2731!!               IF (abs(d_t_con(i,k)) > 0.24 .OR. &
     2732!!                   abs(d_q_con(i,k)) > 2.e-2) THEN
     2733               IF (abs(d_t_con(i,k)) > dtcon_multistep_max .OR. &
     2734                   abs(d_q_con(i,k)) > dqcon_multistep_max) THEN
     2735                 cvpas = 1
     2736!!                 print *,'physiq1, i,k,d_t_con(i,k),d_q_con(i,k) ', &
     2737!!                                   i,k,d_t_con(i,k),d_q_con(i,k)
     2738               ENDIF
     2739             ENDDO
     2740          ENDDO
     2741!!!   Ligne a ne surtout pas remettre sans avoir murement reflechi (jyg)
     2742!!!          call bcast(cvpas)
     2743!!!   ------------------------------------------------------------
     2744          !>jyg
     2745          !
    26182746          DO i = 1, klon
    2619              IF (iflagctrl(i).le.1) itau_con(i)=itau_con(i)+1
     2747             IF (iflagctrl(i).le.1) itau_con(i)=itau_con(i)+cvpas
    26202748          ENDDO
    26212749          !
     
    27252853    proba_notrig(:) = 1.
    27262854    itapcv = 0
    2727     ENDIF !  (MOD(itapcv,cvpas).EQ.0)
     2855    ENDIF !  (MOD(itapcv,cvpas).EQ.0 .OR. MOD(itapcv,cvpas_0).EQ.0)
    27282856!
    27292857    itapcv = itapcv+1
     2858    !
     2859    ! Compter les steps ou cvpas=1
     2860    IF (cvpas == 1) THEN
     2861      Ncvpaseq1 = Ncvpaseq1+1
     2862    ENDIF
     2863    IF (mod(itap,1000) == 0) THEN
     2864      print *,' physiq, nombre de steps ou cvpas = 1 : ', Ncvpaseq1
     2865    ENDIF
    27302866
    27312867!!!jyg  Appel diagnostique a add_phys_tend pour tester la conservation de
     
    28492985               t_seri, q_seri, omega,  &
    28502986               dt_dwn, dq_dwn, M_dwn, M_up,  &
    2851                dt_a, dq_a, &
    2852                sigd, &
    2853                wake_deltat, wake_deltaq, wake_s, wake_dens,  &
     2987               dt_a, dq_a, cv_gen, &
     2988               sigd, cin, &
     2989               wake_deltat, wake_deltaq, wake_s, awake_dens, wake_dens,  &
    28542990               wake_dth, wake_h,  &
    28552991!!               wake_pe, wake_fip, wake_gfl,  &
     
    28612997               wake_omg, wake_dp_deltomg,  &
    28622998               wake_spread, wake_Cstar, d_deltat_wk_gw,  &
    2863                d_deltat_wk, d_deltaq_wk, d_s_wk, d_dens_wk)
     2999               d_deltat_wk, d_deltaq_wk, d_s_wk, d_dens_a_wk, d_dens_wk)
    28643000          !
    28653001          !jyg    Reinitialize itapwk when wakes have been called
     
    28803016
    28813017         CALL add_wake_tend &
    2882             (d_deltat_wk, d_deltaq_wk, d_s_wk, d_dens_wk, wake_k, &
     3018            (d_deltat_wk, d_deltaq_wk, d_s_wk, d_dens_a_wk, d_dens_wk, wake_k, &
    28833019             'wake', abortphy)
    28843020          call prt_enerbil('wake',itap)
    28853021       ENDIF   ! (iflag_wake_tend .GT. 0.)
     3022       !
     3023       IF (prt_level .GE. 10) THEN
     3024         print *,' physiq, after calwake, wake_s: ',wake_s(:)
     3025         print *,' physiq, after calwake, wake_deltat: ',wake_deltat(:,1)
     3026         print *,' physiq, after calwake, wake_deltaq: ',wake_deltaq(:,1)
     3027       ENDIF
    28863028
    28873029       IF (iflag_alp_wk_cond .GT. 0.) THEN
     
    30113153             ENDDO
    30123154          !
    3013              CALL add_wake_tend &
    3014                  (d_deltat_the, d_deltaq_the, dsig0, ddens0, wkoccur1, 'the', abortphy)
     3155             IF (ok_bug_split_th) THEN
     3156               CALL add_wake_tend &
     3157                   (d_deltat_the, d_deltaq_the, dsig0, ddens0, ddens0, wkoccur1, 'the', abortphy)
     3158             ELSE
     3159               CALL add_wake_tend &
     3160                   (d_deltat_the, d_deltaq_the, dsig0, ddens0, ddens0, wake_k, 'the', abortphy)
     3161             ENDIF
    30153162             call prt_enerbil('the',itap)
    30163163          !
     
    30263173                          ale_bl_trig, ale_bl_stat, ale_bl,  &
    30273174                          alp_bl, alp_bl_stat, &
    3028                           proba_notrig, random_notrig)
     3175                          proba_notrig, random_notrig, cv_gen)
    30293176          !>jyg
    30303177
     
    34883635                        tausum_aero, drytausum_aero, tau3d_aero)
    34893636#endif
     3637
     3638                   IF (flag_aerosol .EQ. 7) THEN
     3639                      CALL MACv2SP(pphis,pplay,paprs,longitude_deg,latitude_deg,  &
     3640                                   tau_aero_sw_rrtm,piz_aero_sw_rrtm,cg_aero_sw_rrtm)
     3641                   ENDIF
     3642
    34903643                   !
    34913644                ELSE IF (NSW.EQ.2) THEN
     
    35423695       !
    35433696       !--WMO criterion to determine tropopause
    3544        CALL stratosphere_mask(missing_val, t_seri, pplay, latitude_deg)
     3697       CALL stratosphere_mask(missing_val, pphis, t_seri, pplay, latitude_deg)
    35453698       !
    35463699       !--STRAT AEROSOL
     
    35823735#ifdef CPP_StratAer
    35833736       !--compute stratospheric mask
    3584        CALL stratosphere_mask(missing_val, t_seri, pplay, latitude_deg)
     3737       CALL stratosphere_mask(missing_val, pphis, t_seri, pplay, latitude_deg)
    35853738       !--interactive strat aerosols
    35863739       CALL calcaerosolstrato_rrtm(pplay,t_seri,paprs,debut)
     
    36123765#endif
    36133766          ENDIF
    3614           CALL newmicro (ok_cdnc, bl95_b0, bl95_b1, &
     3767          CALL newmicro (flag_aerosol, ok_cdnc, bl95_b0, bl95_b1, &
    36153768               paprs, pplay, t_seri, cldliq, cldfra, &
    36163769               cldtau, cldemi, cldh, cldl, cldm, cldt, cldq, &
     
    36423795          ! global
    36433796          !
     3797!IM 251017 begin
     3798!               print*,'physiq betaCRF global zdtime=',zdtime
     3799!IM 251017 end
    36443800          DO k=1, klev
    36453801             DO i=1, klon
     
    37563912             print *,' ->radlwsw, number 1 '
    37573913          ENDIF
     3914
    37583915          !
    37593916          CALL radlwsw &
     
    37723929               tau_aero_lw_rrtm, &
    37733930               cldtaupirad,new_aod, &
     3931!              zqsat, flwcrad, fiwcrad, &
    37743932               zqsat, flwc, fiwc, &
    37753933               ref_liq, ref_ice, ref_liq_pi, ref_ice_pi, &
     
    37783936               sollwdown, &
    37793937               topsw0,toplw0,solsw0,sollw0, &
    3780                lwdn0, lwdn, lwup0, lwup,  &
    3781                swdn0, swdn, swup0, swup, &
     3938               lwdnc0, lwdn0, lwdn, lwupc0, lwup0, lwup,  &
     3939               swdnc0, swdn0, swdn, swupc0, swup0, swup, &
    37823940               topswad_aero, solswad_aero, &
    37833941               topswai_aero, solswai_aero, &
     
    37943952               ZSWFT0_i, ZFSDN0, ZFSUP0)
    37953953
     3954          !lwoff=y, betalwoff=1. : offset LW CRE for radiation code and other
     3955          !schemes
     3956          toplw = toplw + betalwoff * (toplw0 - toplw)
     3957          sollw = sollw + betalwoff * (sollw0 - sollw)
     3958          lwdn = lwdn + betalwoff * (lwdn0 - lwdn)
     3959          lwup = lwup + betalwoff * (lwup0 - lwup)
     3960          sollwdown(:)= sollwdown(:) + betalwoff *(-1.*ZFLDN0(:,1) - &
     3961                        sollwdown(:))
     3962          cool = cool + betalwoff * (cool0 - cool)
     3963 
    37963964#ifndef CPP_XIOS
    37973965          !--OB 30/05/2016 modified 21/10/2016
     
    38003968          !--this is necessary to get the right swaero at first step
    38013969          !--but only in the case of no XIOS as XIOS is covered elsewhere
     3970          IF (debut) swaerofree_diag = .FALSE.
    38023971          IF (debut) swaero_diag = .FALSE.
    38033972          IF (debut) dryaod_diag = .FALSE.
     
    38053974          !--as for swaero_diag, see above
    38063975          IF (debut) ok_4xCO2atm = .FALSE.
    3807 #endif
     3976
    38083977          !
    38093978          !IM 2eme calcul radiatif pour le cas perturbe ou au moins un
     
    38163985              RCFC11_per.NE.RCFC11_act.OR. &
    38173986              RCFC12_per.NE.RCFC12_act) ok_4xCO2atm =.TRUE.
     3987#endif
    38183988   !
    38193989          IF (ok_4xCO2atm) THEN
     
    38444014                     tau_aero_lw_rrtm, &
    38454015                     cldtaupi,new_aod, &
     4016!                    zqsat, flwcrad, fiwcrad, &
    38464017                     zqsat, flwc, fiwc, &
    38474018                     ref_liq, ref_ice, ref_liq_pi, ref_ice_pi, &
     
    38504021                     sollwdownp, &
    38514022                     topsw0p,toplw0p,solsw0p,sollw0p, &
    3852                      lwdn0p, lwdnp, lwup0p, lwupp,  &
    3853                      swdn0p, swdnp, swup0p, swupp, &
     4023                     lwdnc0p, lwdn0p, lwdnp, lwupc0p, lwup0p, lwupp,  &
     4024                     swdnc0p, swdn0p, swdnp, swupc0p, swup0p, swupp, &
    38544025                     topswad_aerop, solswad_aerop, &
    38554026                     topswai_aerop, solswai_aerop, &
     
    38654036                     ZLWFT0_i, ZFLDN0, ZFLUP0, &
    38664037                     ZSWFT0_i, ZFSDN0, ZFSUP0)
    3867           endif
    3868           !
     4038          endif !ok_4xCO2atm
    38694039       ENDIF ! aerosol_couple
    38704040       itaprad = 0
     
    42574427
    42584428
    4259     CALL tend_to_tke(pdtphys,paprs,exner,t_seri,u_seri,v_seri,dtadd,duadd,dvadd,pbl_tke)
     4429    CALL tend_to_tke(pdtphys,paprs,exner,t_seri,u_seri,v_seri,dtadd,duadd,dvadd,pctsrf,pbl_tke)
    42604430
    42614431
     
    44124582    !
    44134583    CALL transp (paprs,zxtsol, &
    4414          t_seri, q_seri, u_seri, v_seri, zphi, &
    4415          ve, vq, ue, uq)
     4584         t_seri, q_seri, ql_seri, qs_seri, u_seri, v_seri, zphi, &
     4585         ve, vq, ue, uq, vwat, uwat)
    44164586    !
    44174587    !IM global posePB BEG
     
    47094879#endif
    47104880
     4881! On remet des variables a .false. apres un premier appel
     4882    if (debut) then
     4883#ifdef CPP_XIOS
     4884      swaero_diag=.FALSE.
     4885      swaerofree_diag=.FALSE.
     4886      dryaod_diag=.FALSE.
     4887      ok_4xCO2atm= .FALSE.
     4888!      write (lunout,*)'ok_4xCO2atm= ',swaero_diag, swaerofree_diag, dryaod_diag, ok_4xCO2atm
     4889
     4890      IF (is_master) then
     4891        !--setting up swaero_diag to TRUE in XIOS case
     4892        IF (xios_field_is_active("topswad").OR.xios_field_is_active("topswad0").OR. &
     4893           xios_field_is_active("solswad").OR.xios_field_is_active("solswad0").OR. &
     4894           xios_field_is_active("topswai").OR.xios_field_is_active("solswai").OR.  &
     4895             (iflag_rrtm==1.AND.(xios_field_is_active("toplwad").OR.xios_field_is_active("toplwad0").OR. &
     4896                                 xios_field_is_active("sollwad").OR.xios_field_is_active("sollwad0"))))  &
     4897           !!!--for now these fields are not in the XML files so they are omitted
     4898           !!!  xios_field_is_active("toplwai").OR.xios_field_is_active("sollwai") !))) &
     4899           swaero_diag=.TRUE.
     4900
     4901        !--setting up swaerofree_diag to TRUE in XIOS case
     4902        IF (xios_field_is_active("SWdnSFCcleanclr").OR.xios_field_is_active("SWupSFCcleanclr").OR. &
     4903           xios_field_is_active("SWupTOAcleanclr").OR.xios_field_is_active("rsucsaf").OR.   &
     4904           xios_field_is_active("rsdcsaf") .OR. xios_field_is_active("LWdnSFCcleanclr").OR. &
     4905           xios_field_is_active("LWupTOAcleanclr")) &
     4906           swaerofree_diag=.TRUE.
     4907
     4908        !--setting up dryaod_diag to TRUE in XIOS case
     4909        DO naero = 1, naero_tot-1
     4910         IF (xios_field_is_active("dryod550_"//name_aero_tau(naero))) dryaod_diag=.TRUE.
     4911        ENDDO
     4912        !
     4913        !--setting up ok_4xCO2atm to TRUE in XIOS case
     4914        IF (xios_field_is_active("rsut4co2").OR.xios_field_is_active("rlut4co2").OR. &
     4915           xios_field_is_active("rsutcs4co2").OR.xios_field_is_active("rlutcs4co2").OR. &
     4916           xios_field_is_active("rsu4co2").OR.xios_field_is_active("rsucs4co2").OR. &
     4917           xios_field_is_active("rsd4co2").OR.xios_field_is_active("rsdcs4co2").OR. &
     4918           xios_field_is_active("rlu4co2").OR.xios_field_is_active("rlucs4co2").OR. &
     4919           xios_field_is_active("rld4co2").OR.xios_field_is_active("rldcs4co2")) &
     4920           ok_4xCO2atm=.TRUE.
     4921      endif
     4922      !$OMP BARRIER
     4923      call bcast(swaero_diag)
     4924      call bcast(swaerofree_diag)
     4925      call bcast(dryaod_diag)
     4926      call bcast(ok_4xCO2atm)
     4927!      write (lunout,*)'ok_4xCO2atm= ',swaero_diag, swaerofree_diag, dryaod_diag, ok_4xCO2atm
     4928#endif
     4929    endif
    47114930
    47124931    !====================================================================
     
    47454964       IF (is_omp_master) CALL xios_context_finalize
    47464965#endif
     4966       print *,' physiq fin, nombre de steps ou cvpas = 1 : ', Ncvpaseq1
    47474967    ENDIF
    47484968
  • LMDZ6/branches/DYNAMICO-conv/libf/phylmd/phytrac_mod.F90

    r2784 r3356  
    4949!$OMP THREADPRIVATE(d_tr_trsp,d_tr_sscav,d_tr_sat,d_tr_uscav,qPr,qDi)
    5050!$OMP THREADPRIVATE(d_tr_insc,d_tr_bcscav,d_tr_evapls,d_tr_ls,qPrls)
    51 !$OMP THREADPRIVATE(d_tr,d_tr_cl,d_tr_dry,flux_tr_dry,d_tr_dec,d_tr_cv)
     51!$OMP THREADPRIVATE(d_tr_cl,d_tr_dry,flux_tr_dry,d_tr_dec,d_tr_cv)
    5252
    5353
     
    104104    USE traccoag_mod
    105105    USE phys_local_var_mod, ONLY: mdw
     106    USE phys_local_var_mod, ONLY: budg_dep_dry_ocs,   budg_dep_wet_ocs
     107    USE phys_local_var_mod, ONLY: budg_dep_dry_so2,   budg_dep_wet_so2
    106108    USE phys_local_var_mod, ONLY: budg_dep_dry_h2so4, budg_dep_wet_h2so4
    107109    USE phys_local_var_mod, ONLY: budg_dep_dry_part,  budg_dep_wet_part
    108     USE infotrac, ONLY: nbtr_sulgas, id_SO2_strat, id_H2SO4_strat
     110    USE infotrac, ONLY: nbtr_sulgas, id_OCS_strat, id_SO2_strat, id_H2SO4_strat
    109111    USE aerophys
    110112#endif
     
    507509                ENDIF
    508510
     511             CASE('repr')
     512                 flag_cvltr(it)=.false.
     513
    509514             CASE('inca')
    510515!                IF ((it.EQ.id_Rn222) .OR. ((it.GE.id_SO2) .AND. (it.LE.id_NH3)) ) THEN
     
    701706       IF (type_trac=='coag') THEN
    702707         ! initialize wet deposition flux of sulfur
     708         budg_dep_wet_ocs(:)=0.0
     709         budg_dep_wet_so2(:)=0.0
    703710         budg_dep_wet_h2so4(:)=0.0
    704711         budg_dep_wet_part(:)=0.0
     
    709716         DO it = 1, nbtr
    710717         !do not include SO2 because most of it comes trom the troposphere
    711            IF (it==id_H2SO4_strat) THEN
     718           IF (it==id_OCS_strat) THEN
     719             budg_dep_wet_ocs(i)=budg_dep_wet_ocs(i)+d_tr_cv(i,k,it)*(mSatom/mOCSmol) &
     720                            & *(paprs(i,k)-paprs(i,k+1))/RG/pdtphys
     721           ELSEIF (it==id_SO2_strat) THEN
     722             budg_dep_wet_so2(i)=budg_dep_wet_so2(i)+d_tr_cv(i,k,it)*(mSatom/mSO2mol) &
     723                            & *(paprs(i,k)-paprs(i,k+1))/RG/pdtphys
     724           ELSEIF (it==id_H2SO4_strat) THEN
    712725             budg_dep_wet_h2so4(i)=budg_dep_wet_h2so4(i)+d_tr_cv(i,k,it)*(mSatom/mH2SO4mol) &
    713726                            & *(paprs(i,k)-paprs(i,k+1))/RG/pdtphys
     
    734747             d_tr_th(i,k,it)=0.
    735748             tr_seri(i,k,it)=MAX(tr_seri(i,k,it),0.)
    736              tr_seri(i,k,it)=MIN(tr_seri(i,k,it),1.e10)
     749! the next safeguard causes some problem for stratospheric aerosol tracers (particle number)
     750! and there is little justification for it so it is commented out (4 December 2017) by OB
     751! if reinstated please keep the ifndef CPP_StratAer
     752!#ifndef CPP_StratAer
     753!             tr_seri(i,k,it)=MIN(tr_seri(i,k,it),1.e10)
     754!#endif
    737755          END DO
    738756       END DO
     
    770788
    771789         ! initialize dry deposition flux of sulfur
     790         budg_dep_dry_ocs(:)=0.0
     791         budg_dep_dry_so2(:)=0.0
    772792         budg_dep_dry_h2so4(:)=0.0
    773793         budg_dep_dry_part(:)=0.0
     
    804824             IF (type_trac=='coag') THEN
    805825               ! compute dry deposition flux of sulfur (sum over gases and particles)
    806                IF (it==id_H2SO4_strat) THEN
     826               IF (it==id_OCS_strat) THEN
     827                 budg_dep_dry_ocs(:)=budg_dep_dry_ocs(:)-source(:,it)*(mSatom/mOCSmol)
     828               ELSEIF (it==id_SO2_strat) THEN
     829                 budg_dep_dry_so2(:)=budg_dep_dry_so2(:)-source(:,it)*(mSatom/mSO2mol)
     830               ELSEIF (it==id_H2SO4_strat) THEN
    807831                 budg_dep_dry_h2so4(:)=budg_dep_dry_h2so4(:)-source(:,it)*(mSatom/mH2SO4mol)
    808832               ELSEIF (it.GT.nbtr_sulgas) THEN
     
    890914           DO k = 1, klev
    891915           DO it = 1, nbtr
    892              IF (it==id_H2SO4_strat) THEN
     916             IF (it==id_OCS_strat) THEN
     917               budg_dep_wet_ocs(i)=budg_dep_wet_ocs(i)+d_tr_ls(i,k,it)*(mSatom/mOCSmol) &
     918                              & *(paprs(i,k)-paprs(i,k+1))/RG/pdtphys
     919             ELSEIF (it==id_SO2_strat) THEN
     920               budg_dep_wet_so2(i)=budg_dep_wet_so2(i)+d_tr_ls(i,k,it)*(mSatom/mSO2mol) &
     921                              & *(paprs(i,k)-paprs(i,k+1))/RG/pdtphys
     922             ELSEIF (it==id_H2SO4_strat) THEN
    893923               budg_dep_wet_h2so4(i)=budg_dep_wet_h2so4(i)+d_tr_ls(i,k,it)*(mSatom/mH2SO4mol) &
    894924                              & *(paprs(i,k)-paprs(i,k+1))/RG/pdtphys
  • LMDZ6/branches/DYNAMICO-conv/libf/phylmd/printflag.F90

    r1992 r3356  
    3030    &  ************'
    3131  PRINT 100
    32   PRINT 10, cycle_diurne, soil_model
     32  PRINT 10, iflag_cycle_diurne.GE.1, soil_model
    3333  PRINT 100
    3434
     
    9797  END IF
    9898
    99   IF (cycle_diurn0 .AND. .NOT. cycle_diurne .OR. .NOT. cycle_diurn0 .AND. &
    100       cycle_diurne) THEN
    101     PRINT 13, cycle_diurn0, cycle_diurne
     99  IF (cycle_diurn0 .AND. .NOT. (iflag_cycle_diurne.GE.1) .OR. .NOT. cycle_diurn0 .AND. &
     100      (iflag_cycle_diurne.GE.1) ) THEN
     101    PRINT 13, cycle_diurn0, iflag_cycle_diurne
    102102    PRINT 100
    103103  END IF
  • LMDZ6/branches/DYNAMICO-conv/libf/phylmd/radiation_ar4_param.F90

    r1933 r3356  
    11MODULE radiation_ar4_param
     2
     3 IMPLICIT NONE
    24
    35 REAL(KIND=8), parameter :: ZPDH2O = 0.8
  • LMDZ6/branches/DYNAMICO-conv/libf/phylmd/radlwsw_m.F90

    r3355 r3356  
    2828   sollwdown,&
    2929   topsw0,toplw0,solsw0,sollw0,&
    30    lwdn0, lwdn, lwup0, lwup,&
    31    swdn0, swdn, swup0, swup,&
     30   lwdnc0, lwdn0, lwdn, lwupc0, lwup0, lwup,&
     31   swdnc0, swdn0, swdn, swupc0, swup0, swup,&
    3232   topswad_aero, solswad_aero,&
    3333   topswai_aero, solswai_aero, &
     
    148148  ! ZFSDWN(klon,KLEV+1)           ; TOTAL SW  DWN FLUXES           ! added by MPL 080411
    149149  ! ZFCDWN(klon,KLEV+1)           ; CLEAR SKY SW  DWN FLUXES       ! added by MPL 080411
     150  ! ZFCCDWN(klon,KLEV+1)          ; CLEAR SKY CLEAN (NO AEROSOL) SW  DWN FLUXES      ! added by OB 211117
    150151  ! ZFSUP (klon,KLEV+1)           ; TOTAL SW  UP  FLUXES           ! added by MPL 080411
    151152  ! ZFCUP (klon,KLEV+1)           ; CLEAR SKY SW  UP  FLUXES       ! added by MPL 080411
     153  ! ZFCCUP (klon,KLEV+1)          ; CLEAR SKY CLEAN (NO AEROSOL) SW  UP  FLUXES      ! added by OB 211117
     154  ! ZFLCCDWN(klon,KLEV+1)         ; CLEAR SKY CLEAN (NO AEROSOL) LW  DWN FLUXES      ! added by OB 211117
     155  ! ZFLCCUP (klon,KLEV+1)         ; CLEAR SKY CLEAN (NO AEROSOL) LW  UP  FLUXES      ! added by OB 211117
    152156 
    153157  !======================================================================
     
    226230  REAL,    INTENT(out) :: topsw0(KLON), toplw0(KLON), solsw0(KLON), sollw0(KLON)
    227231  REAL,    INTENT(out) :: sollwdown(KLON)
    228   REAL,    INTENT(out) :: swdn(KLON,kflev+1),swdn0(KLON,kflev+1)
    229   REAL,    INTENT(out) :: swup(KLON,kflev+1),swup0(KLON,kflev+1)
    230   REAL,    INTENT(out) :: lwdn(KLON,kflev+1),lwdn0(KLON,kflev+1)
    231   REAL,    INTENT(out) :: lwup(KLON,kflev+1),lwup0(KLON,kflev+1)
     232  REAL,    INTENT(out) :: swdn(KLON,kflev+1),swdn0(KLON,kflev+1), swdnc0(KLON,kflev+1)
     233  REAL,    INTENT(out) :: swup(KLON,kflev+1),swup0(KLON,kflev+1), swupc0(KLON,kflev+1)
     234  REAL,    INTENT(out) :: lwdn(KLON,kflev+1),lwdn0(KLON,kflev+1), lwdnc0(KLON,kflev+1)
     235  REAL,    INTENT(out) :: lwup(KLON,kflev+1),lwup0(KLON,kflev+1), lwupc0(KLON,kflev+1)
    232236  REAL,    INTENT(out) :: topswad_aero(KLON), solswad_aero(KLON)         ! output: aerosol direct forcing at TOA and surface
    233237  REAL,    INTENT(out) :: topswai_aero(KLON), solswai_aero(KLON)         ! output: aerosol indirect forcing atTOA and surface
     
    252256  REAL(KIND=8) ZFSUP0(KDLON,KFLEV+1)
    253257  REAL(KIND=8) ZFSDN0(KDLON,KFLEV+1)
     258  REAL(KIND=8) ZFSUPC0(KDLON,KFLEV+1)
     259  REAL(KIND=8) ZFSDNC0(KDLON,KFLEV+1)
    254260  REAL(KIND=8) ZFLUP(KDLON,KFLEV+1)
    255261  REAL(KIND=8) ZFLDN(KDLON,KFLEV+1)
    256262  REAL(KIND=8) ZFLUP0(KDLON,KFLEV+1)
    257263  REAL(KIND=8) ZFLDN0(KDLON,KFLEV+1)
     264  REAL(KIND=8) ZFLUPC0(KDLON,KFLEV+1)
     265  REAL(KIND=8) ZFLDNC0(KDLON,KFLEV+1)
    258266  REAL(KIND=8) zx_alpha1, zx_alpha2
    259267  INTEGER k, kk, i, j, iof, nb_gr
     
    364372      REAL(KIND=8) ZFSDWN_i (klon,klev+1)
    365373      REAL(KIND=8) ZFCDWN_i (klon,klev+1)
     374      REAL(KIND=8) ZFCCDWN_i (klon,klev+1)
    366375      REAL(KIND=8) ZFSUP_i (klon,klev+1)
    367376      REAL(KIND=8) ZFCUP_i (klon,klev+1)
     377      REAL(KIND=8) ZFCCUP_i (klon,klev+1)
     378      REAL(KIND=8) ZFLCCDWN_i (klon,klev+1)
     379      REAL(KIND=8) ZFLCCUP_i (klon,klev+1)
    368380! 3 lignes suivantes a activer pour CCMVAL (MPL 20100412)
    369381!      REAL(KIND=8) RSUN(3,2)
     
    576588      ZFSUP0(i,k)=0.
    577589      ZFSDN0(i,k)=0.
     590      ZFSUPC0(i,k)=0.
     591      ZFSDNC0(i,k)=0.
     592      ZFLUPC0(i,k)=0.
     593      ZFLDNC0(i,k)=0.
    578594      ZSWFT0_i(i,k)=0.
    579595      ZFCUP_i(i,k)=0.
    580596      ZFCDWN_i(i,k)=0.
     597      ZFCCUP_i(i,k)=0.
     598      ZFCCDWN_i(i,k)=0.
     599      ZFLCCUP_i(i,k)=0.
     600      ZFLCCDWN_i(i,k)=0.
    581601      ENDDO
    582602      ENDDO
     
    681701      ZFSDWN_i(i,k)=0.
    682702      ZFCDWN_i(i,k)=0.
     703      ZFCCDWN_i(i,k)=0.
    683704      ZFSUP_i(i,k)=0.
    684705      ZFCUP_i(i,k)=0.
     706      ZFCCUP_i(i,k)=0.
     707      ZFLCCDWN_i(i,k)=0.
     708      ZFLCCUP_i(i,k)=0.
    685709      ENDDO
    686710      ENDDO
     
    828852         PTAU_LW_TOT, PTAU_LW_NAT,               &  ! rajoute par C. Kleinschmitt
    829853         ZFLUX_i  , ZFLUC_i ,&
    830          ZFSDWN_i , ZFSUP_i , ZFCDWN_i, ZFCUP_i,&
     854         ZFSDWN_i , ZFSUP_i , ZFCDWN_i, ZFCUP_i, ZFCCDWN_i, ZFCCUP_i, ZFLCCDWN_i, ZFLCCUP_i, &
    831855         ZTOPSWADAERO,ZSOLSWADAERO,&  ! rajoute par OB pour diagnostics
    832856         ZTOPSWAD0AERO,ZSOLSWAD0AERO,&
     
    909933         ZFSDN(i,k+1)  = ZFSDWN_i(i,k+1)*fract(i)
    910934         ZFSDN0(i,k+1) = ZFCDWN_i(i,k+1)*fract(i)
     935         ZFSDNC0(i,k+1)= ZFCCDWN_i(i,k+1)*fract(i)
    911936         ZFSUP (i,k+1) = ZFSUP_i(i,k+1)*fract(i)
    912937         ZFSUP0(i,k+1) = ZFCUP_i(i,k+1)*fract(i)
     938         ZFSUPC0(i,k+1)= ZFCCUP_i(i,k+1)*fract(i)
     939         ZFLDNC0(i,k+1)= ZFLCCDWN_i(i,k+1)
     940         ZFLUPC0(i,k+1)= ZFLCCUP_i(i,k+1)
    913941!   Nouveau calcul car visiblement ZSWFT et ZSWFC sont nuls dans RRTM cy32
    914942!   en sortie de radlsw.F90 - MPL 7.01.09
     
    10221050
    10231051      DO k = 1, kflev+1
     1052        swdnc0( iof+i,k)   = ZFSDNC0( i,k)
    10241053        swdn0 ( iof+i,k)   = ZFSDN0 ( i,k)
    10251054        swdn  ( iof+i,k)   = ZFSDN  ( i,k)
     1055        swupc0( iof+i,k)   = ZFSUPC0( i,k)
    10261056        swup0 ( iof+i,k)   = ZFSUP0 ( i,k)
    10271057        swup  ( iof+i,k)   = ZFSUP  ( i,k)
     1058        lwdnc0( iof+i,k)   = ZFLDNC0( i,k)
     1059        lwupc0( iof+i,k)   = ZFLUPC0( i,k)
    10281060      ENDDO
    10291061    ENDDO
  • LMDZ6/branches/DYNAMICO-conv/libf/phylmd/readchlorophyll.F90

    r2391 r3356  
    22! $Id$
    33!
     4!--This routine is to be tested with MPI / OMP parallelism
     5!--OB 26/03/2018
    46
    5 subroutine readchlorophyll(debut)
     7SUBROUTINE readchlorophyll(debut)
    68
    7     use netcdf95, only: nf95_close, nf95_gw_var, nf95_inq_dimid, &
    8                         nf95_inq_varid, nf95_open
    9     use netcdf, only: nf90_get_var, nf90_noerr, nf90_nowrite
    10 
    11     USE phys_cal_mod, ONLY : mth_cur
    12     USE mod_grid_phy_lmdz, ONLY: nbp_lon, nbp_lat, klon_glo, &
    13                                  grid2dto1d_glo
    14     USE mod_phys_lmdz_mpi_data, ONLY :  is_mpi_root
     9    USE netcdf95, ONLY: nf95_close, nf95_gw_var, nf95_inq_dimid, nf95_inq_varid, nf95_open
     10    USE netcdf, ONLY: nf90_get_var, nf90_noerr, nf90_nowrite
     11    USE phys_cal_mod, ONLY: mth_cur
     12    USE mod_grid_phy_lmdz, ONLY: nbp_lon, nbp_lat, klon_glo, grid2dto1d_glo
     13    USE mod_phys_lmdz_mpi_data, ONLY: is_mpi_root
     14    USE mod_phys_lmdz_omp_data, ONLY: is_omp_root
    1515    USE mod_phys_lmdz_para, ONLY: scatter
    1616    USE phys_state_var_mod, ONLY: chl_con
    1717
    18     implicit none
     18    IMPLICIT NONE
    1919
    20     include "YOMCST.h"
     20    INCLUDE "YOMCST.h"
    2121
    2222! Variable input
    23     logical debut
     23    LOGICAL debut
    2424
    2525! Variables locales
    26     integer n_lat   ! number of latitudes in the input data
    27     integer n_lon   ! number of longitudes in the input data
    28     integer n_lev   ! number of levels in the input data
    29     integer n_month ! number of months in the input data
    30     real, pointer:: latitude(:)
    31     real, pointer:: longitude(:)
    32     real, pointer:: time(:)
    33     integer i, k
    34     integer, save :: mth_pre
     26    INTEGER n_lat   ! number of latitudes in the input data
     27    INTEGER n_lon   ! number of longitudes in the input data
     28    INTEGER n_lev   ! number of levels in the input data
     29    INTEGER n_month ! number of months in the input data
     30    REAL, POINTER :: latitude(:)
     31    REAL, POINTER :: longitude(:)
     32    REAL, POINTER :: time(:)
     33    INTEGER i, k
     34    INTEGER, SAVE :: mth_pre
    3535!$OMP THREADPRIVATE(mth_pre)
    3636
    3737! Champs reconstitues
    38     real, allocatable:: chlorocon(:, :, :)
    39     real, allocatable:: chlorocon_mois(:, :)
    40     real, allocatable:: chlorocon_mois_glo(:)
     38    REAL, ALLOCATABLE :: chlorocon(:, :, :)
     39    REAL, ALLOCATABLE :: chlorocon_mois(:, :)
     40    REAL, ALLOCATABLE :: chlorocon_mois_glo(:)
    4141
    4242! For NetCDF:
    43     integer ncid_in  ! IDs for input files
    44     integer varid, ncerr
    45 
     43    INTEGER ncid_in  ! IDs for input files
     44    INTEGER varid, ncerr
    4645
    4746!--------------------------------------------------------
    48 
    4947
    5048!--only read file if beginning of run or start of new month
    5149    IF (debut.OR.mth_cur.NE.mth_pre) THEN
    5250
    53     IF (is_mpi_root) THEN
    54 
     51    IF (is_mpi_root.AND.is_omp_root) THEN
    5552
    5653    CALL nf95_open("chlorophyll.nc", nf90_nowrite, ncid_in)
     
    6461       STOP
    6562    ENDIF
    66 
    6763
    6864    CALL nf95_inq_varid(ncid_in, "lat", varid)
     
    104100    CALL grid2dTo1d_glo(chlorocon_mois,chlorocon_mois_glo)
    105101
    106 
    107     print*,"chrolophyll current month",mth_cur
    108     do i=1,klon_glo
     102    print *,"chrolophyll current month",mth_cur
     103    DO i=1,klon_glo
    109104!      if(isnan(chlorocon_mois_glo(i)))then ! isnan() is not in the Fortran standard...
    110105!      Another way to check for NaN:
    111        if(chlorocon_mois_glo(i).ne.chlorocon_mois_glo(i)) then
    112          chlorocon_mois_glo(i)=0.
    113       endif
    114       !print*,"high chl con",i,chlorocon_mois_glo(i)
    115     enddo
     106       IF (chlorocon_mois_glo(i).NE.chlorocon_mois_glo(i)) chlorocon_mois_glo(i)=0.
     107    ENDDO
    116108
    117109!    DEALLOCATE(chlorocon)
     
    119111!    DEALLOCATE(chlorocon_mois_glo)
    120112 
    121     ENDIF !--is_mpi_root
     113    ENDIF !--is_mpi_root and is_omp_root
    122114
    123115!--scatter on all proc
     
    129121    ENDIF !--debut ou nouveau mois
    130122
    131 end subroutine readchlorophyll
     123END SUBROUTINE readchlorophyll
  • LMDZ6/branches/DYNAMICO-conv/libf/phylmd/regr_horiz_time_climoz_m.F90

    r3326 r3356  
    190190    !--- Ensure first input longitudes interval contains first output point boundslon_reg(1,west)
    191191    dx1=locate(v1,boundslon_reg(1,west))-1
    192     v1=CSHIFT(v1,SHIFT=dx1,DIM=1); v1(nlon_in-dx1+1:)=v1(nlon_in-dx1+1:)+2.*pi
    193 
    194     !--- Extend input longitudes vector until last interval contains boundslon_reg(nlat_ou,east)
    195     dx2=0; DO WHILE(v1(1+dx2)+2.*pi<boundslon_reg(nlon_ou,east)); dx2=dx2+1; END DO
     192    v1=CSHIFT(v1,SHIFT=dx1,DIM=1); v1(nlon_in-dx1+2:)=v1(nlon_in-dx1+2:)+2.*pi
     193
     194    !--- Extend input longitudes vector until last interval contains boundslon_reg(nlon_ou,east)
     195    dx2=0; DO WHILE(v1(1+dx2)+2.*pi<=boundslon_reg(nlon_ou,east)); dx2=dx2+1; END DO
    196196
    197197    !--- Final edges longitudes vector (with margin and end point)
  • LMDZ6/branches/DYNAMICO-conv/libf/phylmd/regr_pr_comb_coefoz_m.F90

    r2788 r3356  
    128128    !$omp end master
    129129
    130     call regr_pr_time_av(ncid, (/"a2       ", "a4       ", "a6       ", &
    131          "P_net_Mob", "r_Mob    ", "temp_Mob ", "R_Het    "/), REAL(julien-1), &
    132          press_in_edg, paprs, coefoz)
     130    call regr_pr_time_av(ncid, (/"a2           ", "a4           ", "a6           ", &
     131         "P_net_Mob    ", "r_Mob        ", "temp_Mob     ", "R_Het        "/),      &
     132         REAL(julien-1), 'I', press_in_edg, paprs, coefoz)
    133133    a2 = coefoz(:, :, 1)
    134134    a4_mass = coefoz(:, :, 2) * 48. / 29.
  • LMDZ6/branches/DYNAMICO-conv/libf/phylmd/regr_pr_time_av_m.F90

    r3326 r3356  
    55  USE mod_phys_lmdz_transfert_para, ONLY: bcast
    66  USE mod_phys_lmdz_para, ONLY: mpi_rank, omp_rank
     7  USE print_control_mod,  ONLY: prt_level
    78  IMPLICIT NONE
    89
     
    1516!    to the LMDZ vertical grid.
    1617!  * the forcing fields are stretched if the following arguments are present:
    17 !     - "lat_in":   input file latitudes.
    18 !     - "pcen_in":  input file cells center pressure levels.
    19 !     - "ptrop_ou": target grid (LMDZ) tropopause pressure.
     18!     - "lat_in":  input file latitudes.
     19!     - "Ptrp_ou": target grid (LMDZ) tropopause pressure.
    2020!   so that the tropopause is shifted to the position of the one of LMDZ.
    2121!  Note that the ozone quantity conservation is not ensured.
     
    3434!    except that the latitudes are in ascending order in the input file.
    3535!  * We assume that all the input fields have the same coordinates.
    36 !  * The target vertical LMDZ grid is the grid of layer boundaries.
    37 !  * Regridding in pressure is conservative, second order.
     36!  * The target vertical LMDZ grid is the grid of layer centers.
     37!  * Regridding in pressure can be:
     38!    - Ploc=='I': pressures provided at Interfaces    => conservative 2nd order
     39!         OK for ozone coefficients regridding in Cariolle routines.
     40!    - Ploc=='C': pressures provides at cells Centers => classical linear       
     41!         OK for ozone vertical regridding, especially when torpopause
     42!      adjustment is activated, to avoid "strairs shape effect" on profiles.
    3843!  * All the fields are regridded as a single multi-dimensional array, so it
    3944!    saves CPU time to call this procedure once for several NetCDF variables
     
    4247!    1) read from the file if "tropopause_air_pressure" field is available.
    4348!    2) computed using "tro3" and "tro3_at_tropopause' (if available).
    44 !    3) computed using "tro3" and a fixed threshold otherwise, determined using
    45 !    an empirical three parameters law:
     49!    3) computed using "tro3" and a fixed threshold otherwise, constant or
     50!    determined using an empirical three parameters law:
    4651!         o3t(ppbV)=co1+co2*SIN(PI*(month-2)/6)*TANH(lat_deg/co3)
    4752!       => co1 and co2 are in ppbV, and co3 in degrees.
     
    5156!  * Fields with suffix "m"/"p" are at the closest records earlier/later than
    5257!  the mid-julian day "julien", on the global "dynamics" horizontal grid.
    53 !  * Fields(i,j,k,l) are at longitude-latitude "rlonv(i)-rlatu(j)", pressure
    54 !    interval "pint_in(k:k+1)]" and variable "nam(l)".
     58!  * Fields(i,j,k,l) are at longitude-latitude-name "rlonv(i)-rlatu(j)-nam(l)",
     59!    pressure level/interval (Ploc=="C"/"I") "pcen_in(k)"/"pcen_in(k:k+1)]".
    5560!  * In the 2D file case, the values are the same for all longitudes.
    5661!  * The tropopause correction works like this: the input fields (file) are
    5762!  interpolated on output (LMDZ) pressure field, which is streched using a power
    58 !  law in a limited zone made of 3 layers:
    59 !    1) between the two tropopauses (file and LMDZ)
    60 !    2) in an upper and a lower transitions layers
     63!  law in a limited zone made of 2 layers:
     64!    1) between lower bound (lower than lowest tropopause) and LMDZ tropopause
     65!    2) between LMDZ tropopause and upper bound (higher thzn highest tropopause)
    6166!  The stretching function has the following form:
    62 !    Sigma_str = Sigma^(1+alpha), with alpha=LOG(SigT_in/SigT_ou)/LOG(SigT_ou)
    63 This value shifts the file tropopause to the height of the one of LMDZ.
    64 The stretching is fully applied in the central zone only, and only partially
    65 in the transitions zones, thick enough to guarantee a growing stretched
    66 pressure field. The ponderation function for alpha to modulate the stretching
    67 is constant equal to 1 in the central layer, and quasi-linear (from 1 to 0)
    68 in the transition layers (from 1 to 0 ; in fact: sections of 1/log function),
    69 making this localisation function quasi-trapezoidal.
     67!        Sigma_str = Sigma^(1+alpha*phi(Sigma)), where:
     68 * alpha=LOG(SigT_in/SigT_ou)/LOG(SigT_ou)
     69   This value shifts the file tropopause to the height of the one of LMDZ.
     70 * phi is quasi-linear (sections of 1/log function) in the adjacent intervals:
     71     - from 0 to 1 in [Sig_top,SigT_ou]
     72     - from 1 to 0 in [SigT_ou,Sig_bot]
     73This quasi-triangular localization function ponderates alpha-law from one near
     74the tropopause to zero each side apart.
    7075!
    7176! * The following fields are on the global "dynamics" grid, as read from files:
    72   REAL,    SAVE, ALLOCATABLE :: v1m(:,:,:,:)       !--- Previous ozone fields
    73   REAL,    SAVE, ALLOCATABLE :: v1p(:,:,:,:)       !--- Next ozone fields
    74   REAL,    SAVE, ALLOCATABLE :: psm(:,:), psp(:,:) !--- Surface pressure
     77  REAL,    SAVE, ALLOCATABLE :: v1 (:,:,:,:)       !--- Current  time ozone fields
     78! v1: Field read/interpol at time "julien" on the global "dynamics" horiz. grid.
     79  REAL,    SAVE, ALLOCATABLE :: v1m(:,:,:,:)       !--- Previous time ozone fields
     80  REAL,    SAVE, ALLOCATABLE :: v1p(:,:,:,:)       !--- Next     time ozone fields
     81  REAL,    SAVE, ALLOCATABLE :: pgm(:,:), pgp(:,:) !--- Ground     pressure
    7582  REAL,    SAVE, ALLOCATABLE :: ptm(:,:), ptp(:,:) !--- Tropopause pressure
    7683  REAL,    SAVE, ALLOCATABLE :: otm(:,:), otp(:,:) !--- Tropopause o3 mix. ratio
     
    8188!      * for monthly input files: julien is in [time_in(irec),time_in(irec+1)]
    8289  LOGICAL, SAVE :: linterp                         !--- Interpolation in time
    83   LOGICAL, SAVE :: lPrSurf                         !--- Surface pressure flag
    84   LOGICAL, SAVE :: lPrTrop                         !--- Tropopause pressure flag
    85   LOGICAL, SAVE :: lO3Trop                         !--- Tropopause ozone flag
     90  LOGICAL, SAVE :: lPrSfile                        !--- Surface pressure flag
     91  LOGICAL, SAVE :: lPrTfile                        !--- Tropopause pressure flag
     92  LOGICAL, SAVE :: lO3Tfile                        !--- Tropopause ozone flag
    8693  LOGICAL, SAVE :: lfirst=.TRUE.                   !--- First call flag
    8794!$OMP THREADPRIVATE(lfirst)
    88   REAL,    PARAMETER :: pTropUp=5.E+3 !--- Value < tropopause pressure (Pa)
    89   REAL,    PARAMETER :: gamm = 0.4    !--- Relative thickness of transitions
    90   REAL,    PARAMETER :: rho  = 1.3    !--- Max tropopauses sigma ratio
    91   REAL,    PARAMETER :: o3t0 = 1.E-7  !--- Nominal O3 vmr at tropopause
    92   LOGICAL, PARAMETER :: lo3tp=.FALSE. !--- Use parametrized O3 vmr at tropopause
     95  REAL,    PARAMETER :: pTropUp=9.E+3 !--- Value  <  tropopause pressure (Pa)
     96  REAL,    PARAMETER :: gamm   =0.4   !--- Max. stretched layer sigma ratio
     97  REAL,    PARAMETER :: rho    =1.4   !--- Max tropopauses sigma ratio
     98  REAL,    PARAMETER :: o3t0   =1.E-7 !--- Nominal O3 vmr at tropopause
     99  LOGICAL, PARAMETER :: lO3Tpara=.FALSE. !--- Parametrized O3 vmr at tropopause
     100  LOGICAL, PARAMETER :: ldebug=.FALSE.!--- Force writefield_phy multiple outputs
     101  REAL, PARAMETER :: ChemPTrMin=9.E+3 !--- Thresholds for minimum and maximum
     102  REAL, PARAMETER :: ChemPTrMax=4.E+4 !    chemical  tropopause pressure (Pa).
     103  REAL, PARAMETER :: DynPTrMin =8.E+3 !--- Thresholds for minimum and maximum
     104  REAL, PARAMETER :: DynPTrMax =4.E+4 !    dynamical tropopause pressure (Pa).
    93105
    94106CONTAINS
     
    96108!-------------------------------------------------------------------------------
    97109!
    98 SUBROUTINE regr_pr_time_av(fID, nam, julien, pint_in, pint_ou, v3,             &
    99                              time_in, lon_in, lat_in, pcen_in, ptrop_ou)
     110SUBROUTINE regr_pr_time_av(fID, nam, julien, Ploc, Pre_in, Pre_ou, v3, Pgnd_ou,&
     111                                             time_in, lon_in, lat_in, Ptrp_ou)
    100112!
    101113!-------------------------------------------------------------------------------
     
    112124  USE slopes_m,       ONLY: slopes
    113125  USE mod_phys_lmdz_mpi_data,       ONLY: is_mpi_root
    114   USE mod_grid_phy_lmdz,            ONLY: nbp_lon, nbp_lat, nbp_lev
     126  USE mod_grid_phy_lmdz, ONLY: nlon=>nbp_lon, nlat=>nbp_lat, nlev_ou=>nbp_lev
    115127  USE mod_phys_lmdz_transfert_para, ONLY: scatter2d, scatter
    116128  USE phys_cal_mod,                 ONLY: calend, year_len, days_elapsed, jH_cur
    117129!-------------------------------------------------------------------------------
    118130! Arguments:
    119   INTEGER, INTENT(IN)  :: fID           !--- NetCDF file ID
     131  INTEGER,           INTENT(IN) :: fID        !--- NetCDF file ID
    120132  CHARACTER(LEN=13), INTENT(IN) :: nam(:)     !--- NetCDF variables names
    121   REAL,    INTENT(IN)  :: julien        !--- Days since Jan 1st
    122   REAL,    INTENT(IN)  :: pint_in(:)    !--- Interfaces file Pres, Pa, ascending
    123   REAL,    INTENT(IN)  :: pint_ou(:,:)  !--- Interfaces LMDZ pressure, Pa (g,nbp_lev+1)
    124   REAL,    INTENT(OUT) :: v3(:,:,:)     !--- Regridded field (klon,llm,SIZE(nam))
     133  REAL,              INTENT(IN) :: julien     !--- Days since Jan 1st
     134  CHARACTER(LEN=1),  INTENT(IN) :: Ploc       !--- Pressures locations
     135  !--- File/LMDZ (resp. decreasing & increasing order) pressure, Pa
     136  !    At cells centers or interfaces depending on "Ploc" keyword (C/I)
     137  REAL,    INTENT(IN)  :: Pre_in(:)           !--- in:  file      (nlev_in[+1])
     138  REAL,    INTENT(IN)  :: Pre_ou(:,:)         !--- out: LMDZ (klon,nlev_ou[+1])
     139  REAL,    INTENT(OUT) :: v3(:,:,:)           !--- Regr. fld (klon,nlev_ou,n_var)
     140  REAL,    INTENT(IN), OPTIONAL :: Pgnd_ou(:) !--- LMDZ ground pressure   (klon)
    125141  REAL,    INTENT(IN), OPTIONAL :: time_in(:) !--- Records times, in days
    126142                                              !    since Jan 1 of current year
    127   REAL,    INTENT(IN), OPTIONAL :: lon_in(:)  !--- Input/output longitudes vector
    128   REAL,    INTENT(IN), OPTIONAL :: lat_in(:)  !--- Input/output latitudes vector
    129   REAL,    INTENT(IN), OPTIONAL :: pcen_in(:) !--- Mid-layers file pressure
    130   REAL,    INTENT(IN), OPTIONAL :: ptrop_ou(:)!--- Output tropopause pres (klon)
     143  REAL,    INTENT(IN), OPTIONAL :: lon_in(:)  !--- File longitudes vector (klon)
     144  REAL,    INTENT(IN), OPTIONAL :: lat_in(:)  !--- File latitudes  vector (klon)
     145  REAL,    INTENT(IN), OPTIONAL :: Ptrp_ou(:) !--- LMDZ tropopause pres   (klon)
    131146!-------------------------------------------------------------------------------
    132147! Local variables:
     
    135150  CHARACTER(LEN=80)  :: sub
    136151  CHARACTER(LEN=320) :: str
    137   INTEGER :: vID, ncerr, n_var, ibot, ibo0, nn, itrp
    138   INTEGER :: i, nlev_in, n_dim, itop, ito0, i0
     152  INTEGER :: vID, ncerr, n_var, ibot, iout, nn
     153  INTEGER :: i, nlev_in, n_dim, itop, itrp, i0
    139154  LOGICAL :: lAdjTro                          !--- Need to adjust tropopause
    140155  REAL    :: y_frac                           !--- Elapsed year fraction
    141156  REAL    :: alpha, beta, al                  !--- For stretching/interpolation
    142157  REAL    :: SigT_in, SigT_ou                 !--- Input and output tropopauses
    143   REAL    :: Sig_bot, Sig_top                 !--- Fully strained layer  bounds
    144   REAL    :: Sig_bo0, Sig_to0                 !--- Total strained layers bounds
    145   REAL    :: Sig_in(SIZE(pint_in))            !--- Input field sigma levels
    146   REAL    :: Sig_ou (nbp_lev+1)               !--- Output LMDZ sigma levels
    147   REAL    :: phi    (nbp_lev+1)               !--- Stretching exponent anomaly
    148   REAL    :: pstr_ou(nbp_lev+1)               !--- Stretched pressure levels
    149   REAL    :: pintou (nbp_lev+1)               !--- pint_ou in reversed order
    150   REAL    :: v1(nbp_lon,nbp_lat,SIZE(pint_in)-1,SIZE(nam))
    151   REAL    :: v2(klon,           SIZE(pint_in)-1,SIZE(nam))
    152 ! v1: Field read/interpol at time "julien" on the global "dynamics" horiz. grid.
    153 ! v2: Field scattered to the partial "physics" horizontal grid.
     158  REAL    :: Sig_bot, Sig_top                 !--- Bounds of quasi-hat function
     159  REAL    :: Sig_bo0, Sig_to0                 !--- Lower/upper tropopauses
     160  REAL    :: Sig_in (SIZE(Pre_in))            !--- Input field sigma levels
     161  REAL    :: Sig_ou (SIZE(Pre_ou,2))          !--- Output LMDZ sigma levels
     162  REAL    :: phi    (SIZE(Pre_ou,2))          !--- Stretching exponent anomaly
     163  REAL    :: Pstr_ou(SIZE(Pre_ou,2))          !--- Stretched pressure levels
     164  REAL    :: Pres_ou(SIZE(Pre_ou,2))          !--- Pre_ou(i,:), reversed order
     165  REAL, DIMENSION(nlon, nlat) :: pg1,      pt1,      ot1
     166  REAL, DIMENSION(klon)       :: Pgnd_in,  Ptrp_in,  Otrp_in
     167  REAL, DIMENSION(klon)       :: Ptrop_ou, Pgrnd_ou
     168! * The following fields are scattered to the partial "physics" horizontal grid.
     169  REAL, POINTER :: v2(:,:,:)                  !--- Current  time ozone fields
    154170!     In the 2D file case, the values are the same for all longitudes.
    155 !     "v2(i,    k, l)" is at longitude-latitude  "xlon(i)-xlat(i)".
    156 ! Both are for pressure interval "press_in_edg(k:k+1)]" and variable "nam(l)"
    157   REAL, DIMENSION(nbp_lon, nbp_lat)   :: ps1, pt1, ot1
    158   REAL, DIMENSION(klon)               :: ps2, pt2, ot2, ptropou
     171!     "v2(i, k, l)" is at longitude-latitude "xlon(i)-xlat(i)" and name "nam(l)"
     172! Both are:          * if Ploc=='I' in pressure interval "press_in_edg(k:k+1)"
     173!                    * if Ploc=='C' at pressure          "press_in_cen(k)"
     174  REAL, TARGET :: &
     175    v2i(klon,SIZE(Pre_in)-1,SIZE(nam)), &     !--- v2 in Ploc=='I' case
     176    v2c(klon,SIZE(Pre_in)  ,SIZE(nam))        !--- v2 in Ploc=='C' case
    159177  LOGICAL :: ll
     178!--- For debug
     179  REAL, DIMENSION(klon)             :: Ptrop_in, Ptrop_ef
     180  REAL, DIMENSION(klon)             :: dzStrain, dzStrain0
     181  REAL, DIMENSION(klon,SIZE(Pre_ou,2)) :: Pstrn_ou, phii
    160182!-------------------------------------------------------------------------------
    161183  sub="regr_pr_time_av"
    162   nlev_in=SIZE(pint_in)-1
    163   CALL assert(SIZE(v3,1)==klon,          TRIM(sub)//" v3 klon")
    164   CALL assert(SIZE(v3,2)==nbp_lev,       TRIM(sub)//" v3 nbp_lev")
     184  nlev_in=SIZE(Pre_in); IF(Ploc=='I') nlev_in=nlev_in-1
     185  IF(Ploc=='I') THEN; v2 => v2i; ELSE; v2 => v2c; END IF
     186  CALL assert(SIZE(Pre_ou,1)==klon,TRIM(sub)//" Pre_ou klon")
     187  CALL assert(SIZE(v3,1)==klon,    TRIM(sub)//" v3 klon")
     188  CALL assert(SIZE(v3,2)==nlev_ou, TRIM(sub)//" v3 nlev_ou")
     189  IF(Ploc=='I') CALL assert(SIZE(Pre_ou,2)==nlev_ou+1,TRIM(sub)//" Pre_ou nlev_ou+1")
     190  IF(Ploc=='C') CALL assert(SIZE(Pre_ou,2)==nlev_ou  ,TRIM(sub)//" Pre_ou nlev_ou")
    165191  n_var = assert_eq(SIZE(nam),SIZE(v3,3),TRIM(sub)//" v3 n_var")
    166   CALL assert(SIZE(pint_ou,1)==klon     ,TRIM(sub)//" pint_ou klon")
    167   CALL assert(SIZE(pint_ou,2)==nbp_lev+1,TRIM(sub)//" pint_ou nbp_lev+1")
    168   IF(PRESENT(lon_in))   CALL assert(SIZE(lon_in  )==klon,TRIM(sub)//" lon_in klon")
    169   IF(PRESENT(lat_in))   CALL assert(SIZE(lat_in  )==klon,TRIM(sub)//" lat_in klon")
    170   IF(PRESENT(ptrop_ou)) CALL assert(SIZE(ptrop_ou)==klon,TRIM(sub)//" ptrop_ou klon")
    171   IF(PRESENT(pcen_in))  CALL assert(SIZE(pcen_in )==nlev_in,TRIM(sub)//" pcen_in")
    172   lAdjTro=PRESENT(ptrop_ou)
    173   IF(lAdjTro.AND.(.NOT.PRESENT(lat_in).OR..NOT.PRESENT(pcen_in))) &
    174   CALL abort_physic(sub, 'Missing lat_in and/or pcen_in (adjust_tropopause=T)', 1)
     192  IF(PRESENT(Pgnd_ou)) CALL assert(SIZE(Pgnd_ou)==klon,TRIM(sub)//" Pgnd_ou klon")
     193  IF(PRESENT(lon_in))  CALL assert(SIZE(lon_in )==klon,TRIM(sub)//" lon_in klon")
     194  IF(PRESENT(lat_in))  CALL assert(SIZE(lat_in )==klon,TRIM(sub)//" lat_in klon")
     195  IF(PRESENT(Ptrp_ou)) CALL assert(SIZE(Ptrp_ou)==klon,TRIM(sub)//" Ptrp_ou klon")
     196  lAdjTro=PRESENT(Ptrp_ou)
     197  IF(lAdjTro) THEN
     198    IF(.NOT.PRESENT(lat_in)) &
     199      CALL abort_physic(sub, 'Missing lat_in (required if adjust_tropopause=T)', 1)
     200    IF(.NOT.PRESENT(Pgnd_ou).AND.Ploc=='C') &
     201      CALL abort_physic(sub, 'Missing ground Pr(required if adjust_tropopause=T)', 1)
     202    IF(PRESENT(Pgnd_ou)) THEN; Pgrnd_ou=Pgnd_ou; ELSE; Pgrnd_ou=Pre_ou(:,1); END IF
     203  END IF
    175204
    176205  !$OMP MASTER
     
    179208    !=== CHECK WHICH FIELDS ARE AVAILABLE IN THE INPUT FILE
    180209    IF(lfirst) THEN
    181       lPrSurf=NF90_INQ_VARID(fID,"ps"                     ,vID)==NF90_NOERR
    182       lPrTrop=NF90_INQ_VARID(fID,"tropopause_air_pressure",vID)==NF90_NOERR
    183       lO3Trop=NF90_INQ_VARID(fID,"tro3_at_tropopause"     ,vID)==NF90_NOERR
     210      lPrSfile=lAdjTro.AND.NF90_INQ_VARID(fID,"ps"                     ,vID)==NF90_NOERR
     211      lPrTfile=lAdjTro.AND.NF90_INQ_VARID(fID,"tropopause_air_pressure",vID)==NF90_NOERR
     212      lO3Tfile=lAdjTro.AND.NF90_INQ_VARID(fID,"tro3_at_tropopause"     ,vID)==NF90_NOERR
    184213      CALL NF95_INQ_DIMID(fID,"time",vID)
    185214      CALL NF95_INQUIRE_DIMENSION(fID,vID,nclen=ntim_in)
    186215      linterp=PRESENT(time_in).AND.ntim_in==14
     216      ALLOCATE(v1(nlon,nlat,nlev_in,n_var))
    187217      IF(linterp) THEN
    188         ALLOCATE(v1m(nbp_lon,nbp_lat,nlev_in,n_var))
    189         ALLOCATE(v1p(nbp_lon,nbp_lat,nlev_in,n_var))
    190         ALLOCATE(psm(nbp_lon,nbp_lat),psp(nbp_lon,nbp_lat))
    191         ALLOCATE(ptm(nbp_lon,nbp_lat),ptp(nbp_lon,nbp_lat))
    192         IF(lO3Trop) ALLOCATE(otm(nbp_lon,nbp_lat),otp(nbp_lon,nbp_lat))
     218        ALLOCATE(v1m(nlon,nlat,nlev_in,n_var),v1p(nlon,nlat,nlev_in,n_var))
     219        IF(lPrSfile) ALLOCATE(pgm(nlon,nlat),pgp(nlon,nlat))
     220        IF(lPrTfile) ALLOCATE(ptm(nlon,nlat),ptp(nlon,nlat))
     221        IF(lO3Tfile) ALLOCATE(otm(nlon,nlat),otp(nlon,nlat))
    193222      END IF
    194223      !--- INITIAL INDEX: LOCATE A LAYER WELL ABOVE TROPOPAUSE (50hPa)
    195       IF(lAdjTro) itrp0=locate(pcen_in,pTropUp)
    196       CALL msg(lPrSurf,'Using GROUND PRESSURE from input O3 forcing file.',sub)
    197       CALL msg(linterp,'Monthly O3 files => ONLINE TIME INTERPOLATION.',sub)
    198       CALL msg(lAdjTro,'o3 forcing file tropopause location uses:',sub)
    199       IF(lPrTrop) THEN
    200         CALL msg(lAdjTro,'    PRESSURE AT TROPOPAUSE from file.')
    201       ELSE IF(lO3Trop) THEN
    202         CALL msg(lAdjTro,'    O3 CONCENTRATION AT TROPOPAUSE from file.')
    203       ELSE IF(lo3tp) THEN
    204         CALL msg(lAdjTro,'    PARAMETRIZED O3 concentration at tropopause.')
    205       ELSE
    206         CALL msg(lAdjTro,'    CONSTANT O3 concentration at tropopause.')
    207       END IF
     224      IF(lAdjTro) itrp0=locate(Pre_in,pTropUp)
     225      CALL msg(linterp,'Monthly O3 files => ONLINE TIME INTERPOLATION.'    ,sub)
     226      CALL msg(lPrSfile,'Using GROUND PRESSURE from input O3 forcing file.',sub)
     227      CALL msg(lAdjTro ,'o3 forcing file tropopause location uses:'        ,sub)
     228      IF(lPrTfile)      THEN; str='    INPUT FILE PRESSURE'
     229      ELSE IF(lO3Tfile) THEN; str='    INPUT FILE O3 CONCENTRATION'
     230      ELSE IF(lO3Tpara) THEN; str='    PARAMETRIZED O3 concentration'
     231      ELSE;                   str='    CONSTANT O3 concentration'; END IF
     232      CALL msg(lAdjTro,TRIM(str)//' at tropopause')
    208233    END IF
    209234
     
    213238    !=== TIME INTERPOLATION FOR MONTHLY INPUT FILES
    214239    IF(linterp) THEN
    215       WRITE(str,'(3(a,f12.8))')'Interpolating O3 at julian day ',julien,' from '&
    216       &//'fields at times ',time_in(irec),' and ', time_in(irec+1)
     240      WRITE(str,'(a,f12.8,2(a,f5.1))')'Interpolating O3 at julian day ',julien,&
     241        ' from fields at times ',time_in(irec),' and ', time_in(irec+1)
    217242      CALL msg(.TRUE.,str,sub)
    218243      al=(time_in(irec+1)-julien)/(time_in(irec+1)-time_in(irec))
    219244      v1=al*v1m+(1.-al)*v1p
    220       IF(lPrSurf) ps1=al*psm+(1.-al)*psp
    221       IF(lPrTrop) pt1=al*ptm+(1.-al)*ptp
    222       IF(lO3Trop) ot1=al*otm+(1.-al)*otp
     245      IF(lPrSfile) pg1=al*pgm+(1.-al)*pgp
     246      IF(lPrTfile) pt1=al*ptm+(1.-al)*ptp
     247      IF(lO3Tfile) ot1=al*otm+(1.-al)*otp
    223248    END IF
    224249  END IF
    225250  !$OMP END MASTER
    226251  IF(lfirst) THEN
    227     lfirst=.FALSE.;      CALL bcast(lfirst)
    228     IF(lAdjTro)          CALL bcast(itrp0)
    229     CALL bcast(lPrTrop); CALL bcast(lPrSurf)
    230     CALL bcast(lO3Trop); CALL bcast(linterp)
     252    lfirst=.FALSE.;       CALL bcast(lfirst)
     253    IF(lAdjTro)           CALL bcast(itrp0)
     254    CALL bcast(lPrSfile); CALL bcast(lPrTfile)
     255    CALL bcast(lO3Tfile); CALL bcast(linterp)
    231256  END IF
    232257  CALL scatter2d(v1,v2)
    233   !--- No "ps" in input file => assumed to be equal to current LMDZ ground press
    234   IF(lPrSurf) THEN; CALL scatter2d(ps1,ps2); ELSE; ps2=pint_ou(:,1); END IF
    235   IF(lPrTrop) CALL scatter2d(pt1,pt2)
    236   IF(lO3Trop) CALL scatter2d(ot1,ot2)
    237 
    238   !--- REGRID IN PRESSURE ; 3rd index inverted because "paprs" is decreasing
    239   IF(.NOT.lAdjTro) THEN
     258  IF(lPrSfile) CALL scatter2d(pg1,Pgnd_in)
     259  IF(lPrTfile) CALL scatter2d(pt1,Ptrp_in)
     260  IF(lO3Tfile) CALL scatter2d(ot1,Otrp_in)
     261  !--- No ground pressure in input file => choose it to be the one of LMDZ
     262  IF(lAdjTro.AND..NOT.lPrSfile) Pgnd_in(:)=Pgrnd_ou(:)
     263 
     264!-------------------------------------------------------------------------------
     265  IF(.NOT.lAdjTro) THEN       !--- REGRID IN PRESSURE ; NO TROPOPAUSE ADJUSTMENT
     266!-------------------------------------------------------------------------------
    240267    DO i=1,klon
    241       pintou = pint_ou(i,nbp_lev+1:1:-1)
    242       CALL regr_conserv(1,v2(i,:,:), pint_in(:), pintou(:),                    &
    243                           v3(i,nbp_lev:1:-1,:), slopes(1,v2(i,:,:), pint_in(:)))
     268      Pres_ou=Pre_ou(i,SIZE(Pre_ou,2):1:-1)   !--- pplay & paprs are decreasing
     269      IF(Ploc=='C') CALL regr_lint   (1,v2(i,:,:), LOG(Pre_in(:)),             &
     270        LOG(Pres_ou(:)), v3(i,nlev_ou:1:-1,:))
     271      IF(Ploc=='I') CALL regr_conserv(1,v2(i,:,:),     Pre_in(:) ,             &
     272            Pres_ou(:) , v3(i,nlev_ou:1:-1,:), slopes(1,v2(i,:,:), Pre_in(:)))
    244273    END DO
    245   ELSE
     274!-------------------------------------------------------------------------------
     275  ELSE                        !--- REGRID IN PRESSURE ; TROPOPAUSE ADJUSTMENT
     276!-------------------------------------------------------------------------------
    246277    y_frac=(REAL(days_elapsed)+jH_cur)/year_len
    247278
     
    249280    DO i=1,klon
    250281
    251       !--- LOCAL INPUT/OUTPUT (FILE/LMDZ) SIGMA LEVELS AT INTERFACES
    252       pintou=pint_ou(i,nbp_lev+1:1:-1)            !--- increasing values
    253       Sig_in(:) = [pint_in(1:nlev_in+1)/ps2(i)]   !--- increasing values
    254       Sig_ou(:) = [pintou (1:nbp_lev)/ps2(i),1.0] !--- increasing values
    255 
    256       !--- INPUT (FILE) AND OUTPUT (LMDZ) SIGMA LEVELS AT TROPOPAUSE
     282      !--- INPUT/OUTPUT (FILE/LMDZ) SIGMA LEVELS IN CURRENT COLUMN
     283      Pres_ou   = Pre_ou(i,SIZE(Pre_ou,2):1:-1)!--- pplay & paprs are decreasing
     284      Sig_in(:) = Pre_in (:)/Pgnd_in(i)            !--- increasing values
     285      Sig_ou(:) = Pres_ou(:)/Pgnd_ou(i)            !--- increasing values
     286
     287      !--- INPUT (FILE) SIGMA LEVEL AT TROPOPAUSE ; extreme values are filtered
     288      ! to keep tropopause pressure realistic ; high values are usually due to
     289      ! ozone hole fooling the crude chemical tropopause detection algorithm.
    257290      SigT_in = get_SigTrop(i,itrp)
    258       SigT_ou = ptrop_ou(i)/ps2(i)
    259 
    260       !--- AVOID THE FILAMENTS WHICH WOULD NEED A VERY THICK STRETCHED REGION
    261       IF(SigT_ou>SigT_in*rho) SigT_ou = SigT_in*rho
    262       IF(SigT_ou<SigT_in/rho) SigT_ou = SigT_in/rho
    263       ptropou(i)=SigT_ou*ps2(i)
    264 
    265       !--- STRETCHING EXPONENT INCREMENT FOR SIMPLE POWER LAW
     291      SigT_in=MIN(SigT_in,ChemPTrMax/Pgnd_in(i))   !--- too low  value filtered
     292      SigT_in=MAX(SigT_in,ChemPTrMin/Pgnd_ou(i))   !--- too high value filtered
     293
     294      !--- OUTPUT (LMDZ) SIGMA LEVEL AT TROPOPAUSE ; too high variations of the
     295      ! dynamical tropopause (especially in filaments) are conterbalanced with
     296      ! a filter ensuring it stays within a certain distance around input (file)
     297      ! tropopause, hence avoiding avoid a too thick stretched region ; a final
     298      ! extra-safety filter keeps the tropopause pressure value realistic.
     299      SigT_ou = Ptrp_ou(i)/Pgnd_ou(i)
     300      IF(SigT_ou<SigT_in/rho) SigT_ou=SigT_in/rho  !--- too low  value w/r input
     301      IF(SigT_ou>SigT_in*rho) SigT_ou=SigT_in*rho  !--- too high value w/r input
     302      SigT_ou=MIN(SigT_ou,DynPTrMax/Pgnd_ou(i))    !--- too low  value filtered
     303      SigT_ou=MAX(SigT_ou,DynPTrMin/Pgnd_ou(i))    !--- too high value filtered
     304      Ptrop_ou(i)=SigT_ou*Pgnd_ou(i)
     305      iout = locate(Sig_ou(:),SigT_ou)
     306
     307      !--- POWER LAW COEFFICIENT FOR TROPOPAUSES MATCHING
    266308      alpha = LOG(SigT_in/SigT_ou)/LOG(SigT_ou)
    267309
    268       !--- FULLY STRETCHED LAYER BOUNDS (FILE AND MODEL TROPOPAUSES)
    269       Sig_bot = MAX(SigT_in,SigT_ou) ; ibot = locate(Sig_ou(:),Sig_bot)
    270       Sig_top = MIN(SigT_in,SigT_ou) ; itop = locate(Sig_ou(:),Sig_top)
    271 
    272       !--- PARTIALLY STRETCHED LAYER BOUNDS, ENSURING >0 DERIVATIVE
    273       beta = LOG(Sig_top)/LOG(Sig_bot)
    274       Sig_bo0 = Sig_bot ; IF(alpha<0.) Sig_bo0 = Sig_bot**(1/beta)
    275       Sig_to0 = Sig_top ; IF(alpha>0.) Sig_to0 = Sig_top **  beta
    276 
    277       !--- SOME ADDITIONAL MARGIN, PROPORTIONAL TO STRETCHED REGION THICKNESS
    278       !--- gamma<log(Sig_bo0/|alpha|) to keep Sig_bo0<1
    279       Sig_bo0 = MIN(Sig_bo0*EXP( gamm*ABS(alpha)), 0.95+(1.-0.95)*Sig_bo0)
    280       Sig_to0 =     Sig_to0*EXP(-gamm*ABS(alpha))
    281       ibo0 = locate(Sig_ou(:),Sig_bo0)
    282       ito0 = locate(Sig_ou(:),Sig_to0)
    283 
    284       !--- FUNCTION FOR STRETCHING LOCALISATION
    285       !    0 < Sig_to0 < Sig_top <= Sig_bo0 < Sig_bot < 1
     310      !--- DETERMINE STRETCHING DOMAIN UPPER AND LOWER BOUNDS
     311      Sig_bo0 = MAX(SigT_in,SigT_ou)               !--- lowest  tropopause
     312      Sig_to0 = MIN(SigT_in,SigT_ou)               !--- highest tropopause
     313      beta    = (Sig_bo0/Sig_to0)**gamm            !--- stretching exponent
     314      Sig_bot = MIN(Sig_bo0*beta,0.1*(9.+Sig_bo0)) !--- must be <1
     315      ibot = locate(Sig_ou(:),Sig_bot)             !--- layer index
     316      IF(ibot-iout<2) THEN                         !--- at least one layer thick
     317        ibot=MIN(iout+2,nlev_ou); Sig_bot=Sig_ou(ibot)
     318      END IF
     319      Sig_top = Sig_to0/beta                       !--- upper bound
     320      itop = locate(Sig_ou(:),Sig_top)             !--- layer index
     321      IF(iout-itop<2) THEN                         !--- at least one layer thick
     322        itop=MAX(iout-2,1); Sig_top=Sig_ou(itop)
     323      END IF
     324
     325      !--- STRETCHING POWER LAW LOCALIZATION FUNCTION:
     326      !    0 in [0,Sig_top]    0->1 in [Sig_top,SigT_ou]
     327      !    0 in [Sig_bot,1]    1->0 in [SigT_ou, Sig_bot]
    286328      phi(:)=0.
    287       phi(itop+1:ibot) =  1.
    288       phi(ito0+1:itop) = (1.-LOG(Sig_to0)/LOG(Sig_ou(ito0+1:itop)))&
    289                             *LOG(Sig_top)/LOG(Sig_top/Sig_to0)
    290       phi(ibot+1:ibo0) = (1.-LOG(Sig_bo0)/LOG(Sig_ou(ibot+1:ibo0)))&
    291                             *LOG(Sig_bot)/LOG(Sig_bot/Sig_bo0)
    292 
    293       !--- LOCAL STRAINED OUTPUT (LMDZ) PRESSURE PROFILES (INCREASING ORDER)
    294       pstr_ou(:) = pintou(:) * Sig_ou(:)**(alpha*phi(:))
     329      phi(itop+1:iout) = (1.-LOG(Sig_top)/LOG(Sig_ou(itop+1:iout)))&
     330                            *LOG(SigT_ou)/LOG(SigT_ou/Sig_top)
     331      phi(iout+1:ibot) = (1.-LOG(Sig_bot)/LOG(Sig_ou(iout+1:ibot)))&
     332                            *LOG(SigT_ou)/LOG(SigT_ou/Sig_bot)
     333
     334      !--- LOCALY STRECHED OUTPUT (LMDZ) PRESSURE PROFILES (INCREASING ORDER)
     335      Pstr_ou(:) = Pres_ou(:) * Sig_ou(:)**(alpha*phi(:))
    295336
    296337      !--- REGRID INPUT PROFILE ON STRAINED VERTICAL OUTPUT LEVELS
    297       CALL regr_conserv(1, v2(i,:,:), pint_in(:), pstr_ou(:),                  &
    298                            v3(i,nbp_lev:1:-1,:), slopes(1,v2(i,:,:),pint_in(:)))
     338      IF(Ploc=='C') CALL regr_lint   (1, v2(i,:,:), LOG(Pre_in(:)),            &
     339        LOG(Pstr_ou(:)), v3(i,nlev_ou:1:-1,:))
     340      IF(Ploc=='I') CALL regr_conserv(1, v2(i,:,:),     Pre_in(:) ,            &
     341            Pstr_ou(:) , v3(i,nlev_ou:1:-1,:), slopes(1,v2(i,:,:), Pre_in(:)))
    299342
    300343      !--- CHECK CONCENTRATIONS. strato: 50ppbV-15ppmV ; tropo: 5ppbV-300ppbV.
    301       i0=nbp_lev-locate(pintou(:),ptropou(i))+1
    302       ll=check_ozone(v3(i, 1:i0     ,1),lon_in(i),lat_in(i),1 ,'troposphere',  &
     344      i0=nlev_ou-locate(Pres_ou(:),Ptrop_ou(i))+1
     345      ll=check_ozone(v3(i, 1:i0-1   ,1),lon_in(i),lat_in(i),1 ,'troposphere',  &
    303346                     5.E-9,3.0E-7)
    304347!     IF(ll) CALL abort_physic(sub, 'Inconsistent O3 values in troposphere', 1)
    305       ll=check_ozone(v3(i,i0:nbp_lev,1),lon_in(i),lat_in(i),i0,'stratosphere', &
     348      ll=check_ozone(v3(i,i0:nlev_ou,1),lon_in(i),lat_in(i),i0,'stratosphere', &
    306349                     5.E-8,1.5E-5)
    307350!     IF(ll) CALL abort_physic(sub, 'Inconsistent O3 values in stratosphere', 1)
    308351
     352      IF(ldebug) THEN
     353        dzStrain0(i) = SIGN(7.*LOG(Sig_bo0/Sig_to0),SigT_in-SigT_ou)
     354        dzStrain (i) = SIGN(7.*LOG(Sig_bot/Sig_top),SigT_in-SigT_ou)
     355        Ptrop_in (i) = SigT_in*Pgnd_in(i)
     356        Pstrn_ou(i,:)= Pstr_ou
     357        phii(i,:)    = phi(:)
     358        Ptrop_ef(i)  = PTrop_chem(i, itrp, locate(Pres_ou(:),PTropUp),    &
     359                             Pres_ou(:), v3(:,nlev_ou:1:-1,1),o3trop=o3t0)
     360      END IF
    309361    END DO
     362  END IF
     363  IF(ldebug.AND.lAdjTro) THEN
     364    CALL writefield_phy('PreSt_ou' ,Pstrn_ou,SIZE(Pre_ou,2)) !--- Strained Pres
     365    CALL writefield_phy('dzStrain' ,dzStrain ,1)     !--- Strained thickness
     366    CALL writefield_phy('dzStrain0',dzStrain0,1)     !--- Tropopauses distance
     367    CALL writefield_phy('phi',phii,nlev_ou)          !--- Localization function
     368    !--- Tropopauses pressures:
     369    CALL writefield_phy('PreTr_in',Ptrop_in,1)       !--- Input and effective
     370    CALL writefield_phy('PreTr_ou',Ptrop_ou,1)       !--- LMDz dyn tropopause
     371    CALL writefield_phy('PreTr_ef',Ptrop_ef,1)       !--- Effective chem tropop
     372  END IF
     373  IF(ldebug) THEN
     374    CALL writefield_phy('Ozone_in',v2(:,:,1),nlev_in)!--- Raw input O3 field
     375    CALL writefield_phy('Ozone_ou',v3(:,:,1),nlev_ou)!--- Output ozone field
     376    CALL writefield_phy('Pres_ou' ,Pre_ou,SIZE(Pre_ou,2))!--- LMDZ Pressure
    310377  END IF
    311378
     
    324391    CALL get_3Dfields(v1)               !--- Read ozone field(s)
    325392    IF(lAdjTro) THEN                    !--- Additional files for fields strain
    326       IF(lPrSurf) CALL get_2Dfield(ps1,"ps")
    327       IF(lPrTrop) CALL get_2Dfield(pt1,"tropopause_air_pressure")
    328       IF(lO3Trop) CALL get_2Dfield(ot1,"tro3_at_tropopause")
     393      IF(lPrSfile) CALL get_2Dfield(pg1,"ps")
     394      IF(lPrTfile) CALL get_2Dfield(pt1,"tropopause_air_pressure")
     395      IF(lO3Tfile) CALL get_2Dfield(ot1,"tro3_at_tropopause")
    329396    END IF
    330397  ELSE                                  !=== MONTHLY FILES: GET 2 NEAREST RECS
     
    338405      CALL get_3Dfields(v1m)            !--- Read ozone field(s)
    339406      IF(lAdjTro) THEN                  !--- Additional files for fields strain
    340         IF(lPrSurf) CALL get_2Dfield(psm,"ps")
    341         IF(lPrTrop) CALL get_2Dfield(ptm,"tropopause_air_pressure")
    342         IF(lO3Trop) CALL get_2Dfield(otm,"tro3_at_tropopause")
     407        IF(lPrSfile) CALL get_2Dfield(pgm,"ps")
     408        IF(lPrTfile) CALL get_2Dfield(ptm,"tropopause_air_pressure")
     409        IF(lO3Tfile) CALL get_2Dfield(otm,"tro3_at_tropopause")
    343410      END IF
    344411    ELSE                                !=== SHIFT FIELDS
     
    349416      v1m=v1p                           !--- Ozone fields
    350417      IF(lAdjTro) THEN                  !--- Additional files for fields strain
    351         IF(lPrSurf) psm=psp             !--- Surface pressure
    352         IF(lPrTrop) ptm=ptp             !--- Tropopause pressure
    353         IF(lO3Trop) otm=otp             !--- Tropopause ozone
     418        IF(lPrSfile) pgm=pgp             !--- Surface pressure
     419        IF(lPrTfile) ptm=ptp             !--- Tropopause pressure
     420        IF(lO3Tfile) otm=otp             !--- Tropopause ozone
    354421      END IF
    355422    END IF
     
    360427    CALL get_3Dfields(v1p)              !--- Read ozone field(s)
    361428    IF(lAdjTro) THEN                    !--- Additional files for fields strain
    362       IF(lPrSurf) CALL get_2Dfield(psp,"ps")
    363       IF(lPrTrop) CALL get_2Dfield(ptp,"tropopause_air_pressure")
    364       IF(lO3Trop) CALL get_2Dfield(otp,"tro3_at_tropopause")
     429      IF(lPrSfile) CALL get_2Dfield(pgp,"ps")
     430      IF(lPrTfile) CALL get_2Dfield(ptp,"tropopause_air_pressure")
     431      IF(lO3Tfile) CALL get_2Dfield(otp,"tro3_at_tropopause")
    365432    END IF
    366433    irec=irec-1
     
    393460  !--- Flip latitudes: ascending in input file, descending in "rlatu".
    394461  IF(n_dim==3) THEN
    395     v(1,:) = v(1,nbp_lat:1:-1)
    396     v(2:,:)= SPREAD(v(1,:),DIM=1,ncopies=nbp_lon-1)  !--- Duplication
     462    v(1,:) = v(1,nlat:1:-1)
     463    v(2:,:)= SPREAD(v(1,:),DIM=1,ncopies=nlon-1)  !--- Duplication
    397464  ELSE
    398     v(:,:) = v(:,nbp_lat:1:-1)
     465    v(:,:) = v(:,nlat:1:-1)
    399466  END IF
    400467
     
    426493  !--- Flip latitudes: ascending in input file, descending in "rlatu".
    427494  IF(n_dim==3) THEN
    428     v(1,:,:,:) = v(1,nbp_lat:1:-1,:,:)
    429     v(2:,:,:,:)= SPREAD(v(1,:,:,:),DIM=1,ncopies=nbp_lon-1)  !--- Duplication
     495    v(1,:,:,:) = v(1,nlat:1:-1,:,:)
     496    v(2:,:,:,:)= SPREAD(v(1,:,:,:),DIM=1,ncopies=nlon-1)  !--- Duplication
    430497  ELSE
    431     v(:,:,:,:) = v(:,nbp_lat:1:-1,:,:)
     498    v(:,:,:,:) = v(:,nlat:1:-1,:,:)
    432499  END IF
    433500
     
    440507!-------------------------------------------------------------------------------
    441508!
    442 FUNCTION get_SigTrop(ih,it)
    443 !
    444 !-------------------------------------------------------------------------------
    445 ! Arguments:
     509FUNCTION get_SigTrop(ih,it) RESULT(out)
     510!
     511!-------------------------------------------------------------------------------
     512! Arguments:
     513  REAL                 :: out
    446514  INTEGER, INTENT(IN)  :: ih
    447515  INTEGER, INTENT(OUT) :: it
    448   REAL                 :: get_Sigtrop
    449 !-------------------------------------------------------------------------------
    450   !--- Pressure at tropopause is read in the forcing file
    451   IF(lPrTrop) THEN                             !--- PrTrop KNOWN FROM FILE
    452     get_SigTrop=pt2(ih)/ps2(ih); RETURN
    453   END IF
    454   !--- Chemical tropopause definition is used using a particular threshold
    455   IF(lO3Trop) THEN                             !--- o3trop KNOWN FROM FILE
    456     get_SigTrop=chem_tropopause(ih,it,itrp0,pint_in,v2(:,:,1),pcen_in,ot2(ih))
    457   ELSE IF(lo3tp) THEN                          !--- o3trop PARAMETRIZATION
    458     get_SigTrop=chem_tropopause(ih,it,itrp0,pint_in,v2(:,:,1),pcen_in)
    459   ELSE                                         !--- o3trop CONSTANT
    460     get_SigTrop=chem_tropopause(ih,it,itrp0,pint_in,v2(:,:,1),pcen_in,o3t0)
    461   END IF
    462   get_SigTrop=get_SigTrop/ps2(ih)
     516!-------------------------------------------------------------------------------
     517  !--- Pressure at tropopause read from the forcing file
     518       IF(lPrTfile) THEN; out=Ptrp_in(ih)/Pgnd_in(ih); RETURN; END IF
     519
     520  !--- Chemical tropopause definition based on a particular threshold
     521       IF(lO3Tfile) THEN; out=PTrop_chem(ih,it,itrp0,Pre_in,v2(:,:,1),Otrp_in(ih))
     522  ELSE IF(lO3Tpara) THEN; out=PTrop_chem(ih,it,itrp0,Pre_in,v2(:,:,1))
     523  ELSE                  ; out=PTrop_chem(ih,it,itrp0,Pre_in,v2(:,:,1),o3t0); END IF
     524  out=out/Pgnd_in(ih)
    463525
    464526END FUNCTION get_SigTrop
     
    469531!-------------------------------------------------------------------------------
    470532!
    471 FUNCTION chem_tropopause(ih,it,it0,pint,o3,pcen,o3trop)
     533FUNCTION PTrop_chem(ih,it,it0,pres,o3,o3trop) RESULT(out)
    472534!
    473535!-------------------------------------------------------------------------------
     
    484546!-------------------------------------------------------------------------------
    485547! Arguments:
    486   REAL ::                   chem_tropopause    !--- Pressure at tropopause
     548  REAL                        :: out           !--- Pressure at tropopause
    487549  INTEGER,        INTENT(IN)  :: ih            !--- Horizontal index
    488550  INTEGER,        INTENT(OUT) :: it            !--- Index of tropopause layer
    489551  INTEGER,        INTENT(IN)  :: it0           !--- Idx: higher than tropopause
    490   REAL,           INTENT(IN)  :: pint(:)       !--- Cells-interf Pr, increasing
     552  REAL,           INTENT(IN)  :: pres(:)       !--- Pressure profile, increasing
    491553  REAL,           INTENT(IN)  :: o3(:,:)       !--- Ozone field (pptV)
    492   REAL, OPTIONAL, INTENT(IN)  :: pcen(:)       !--- Cells-center Pr, increasing
    493554  REAL, OPTIONAL, INTENT(IN)  :: o3trop        !--- Ozone at tropopause
    494555!-------------------------------------------------------------------------------
    495556! Local variables:
    496   REAL    :: o3t                               !--- Ozone concent. at tropopause
    497   REAL    :: al                                !--- Interpolation coefficient
    498   REAL    :: coef                              !--- Coeff of latitude modulation
     557  REAL :: o3t                                  !--- Ozone concent. at tropopause
     558  REAL :: al                                   !--- Interpolation coefficient
     559  REAL :: coef                                 !--- Coeff of latitude modulation
    499560  REAL, PARAMETER :: co3(3)=[91.,28.,20.]      !--- Coeff for o3 at tropopause
    500561!-------------------------------------------------------------------------------
     
    511572  it=it0; DO WHILE(o3(ih,it+1)>=o3t); it=it+1; END DO
    512573  al=(o3(ih,it)-o3t)/(o3(ih,it)-o3(ih,it+1))
    513   IF(PRESENT(pcen)) THEN
    514     chem_tropopause =       pcen(it)**(1.-al) * pcen(it+1)**al
    515   ELSE
    516     chem_tropopause = SQRT( pint(it)**(1.-al) * pint(it+2)**al * pint(it+1) )
    517   END IF
    518   it = locate(pint(:), chem_tropopause)        !--- pint(it)<ptrop<pint(it+1)
    519 
    520 END FUNCTION chem_tropopause
    521 !
    522 !-------------------------------------------------------------------------------
    523 
    524 
    525 !-------------------------------------------------------------------------------
    526 !
    527 FUNCTION check_ozone(o3col, lon, lat, ilev0, layer, vmin, vmax)
     574  IF(Ploc=='C') out =      pres(it)**(1.-al) * pres(it+1)**al
     575  IF(Ploc=='I') out = SQRT(pres(it)**(1.-al) * pres(it+2)**al *pres(it+1))
     576  it = locate(pres(:), out)                    !--- pres(it)<Ptrop<pres(it+1)
     577
     578END FUNCTION PTrop_chem
     579!
     580!-------------------------------------------------------------------------------
     581
     582
     583!-------------------------------------------------------------------------------
     584!
     585FUNCTION check_ozone(o3col, lon, lat, ilev0, layer, vmin, vmax) RESULT(out)
    528586!
    529587!-------------------------------------------------------------------------------
     
    531589!-------------------------------------------------------------------------------
    532590! Arguments:
    533   LOGICAL                      :: check_ozone      !--- .T. => some wrong values
     591  LOGICAL                      :: out          !--- .T. => some wrong values
    534592  REAL,             INTENT(IN) :: o3col(:), lon, lat
    535593  INTEGER,          INTENT(IN) :: ilev0
     
    547605  lmin=.FALSE.; IF(PRESENT(vmin)) lmin=COUNT(o3col<vmin)/=0
    548606  lmax=.FALSE.; IF(PRESENT(vmax)) lmax=COUNT(o3col>vmax)/=0
    549   check_ozone=lmin.OR.lmax; IF(.NOT.check_ozone) RETURN
     607  out=lmin.OR.lmax; IF(.NOT.out.OR.prt_level>100) RETURN
    550608
    551609  !--- SOME TOO LOW VALUES FOUND
  • LMDZ6/branches/DYNAMICO-conv/libf/phylmd/rrtm/aeropt_5wv_rrtm.F90

    r2951 r3356  
    381381     ALLOCATE (aerosol_name(nb_aer))
    382382     aerosol_name(1) = id_CIDUSTM_phy
    383   ELSEIF (flag_aerosol .EQ. 6) THEN
     383  ELSEIF (flag_aerosol .EQ. 6 .OR. flag_aerosol .EQ. 7 ) THEN
    384384     nb_aer = 13
    385385     ALLOCATE (aerosol_name(nb_aer))
  • LMDZ6/branches/DYNAMICO-conv/libf/phylmd/rrtm/aeropt_6bands_rrtm.F90

    r2842 r3356  
    507507     ALLOCATE (aerosol_name(nb_aer))
    508508     aerosol_name(1) = id_CIDUSTM_phy
    509   ELSEIF (flag_aerosol .EQ. 6) THEN
     509  ELSEIF (flag_aerosol .EQ. 6 .OR. flag_aerosol .EQ. 7 ) THEN
    510510     nb_aer = 13
    511511     ALLOCATE (aerosol_name(nb_aer))
  • LMDZ6/branches/DYNAMICO-conv/libf/phylmd/rrtm/aeropt_lw_rrtm.F90

    • Property svn:executable deleted
    r2748 r3356  
    4646  IF (ok_alw) THEN                                   !--aerosol LW effects
    4747   !
    48    IF (flag_aerosol.EQ.5.OR.flag_aerosol.EQ.6) THEN  !-Dust
     48   IF (flag_aerosol.EQ.5.OR.flag_aerosol.EQ.6.OR.flag_aerosol.EQ.7) THEN  !-Dust
    4949    !
    5050    zdh(:,:)=pdel(:,:)/(RG*zrho(:,:))      ! m
  • LMDZ6/branches/DYNAMICO-conv/libf/phylmd/rrtm/readaerosol_optic_rrtm.F90

    r2953 r3356  
    173173     !
    174174     ! Read and interpolate sulfate
    175      IF ( flag_aerosol .EQ. 1 .OR. flag_aerosol .EQ. 6 ) THEN
     175     IF ( flag_aerosol .EQ. 1 .OR. flag_aerosol .EQ. 6 .OR. flag_aerosol .EQ. 7 ) THEN
    176176
    177177        CALL readaerosol_interp(id_ASSO4M_phy, itap, pdtphys, rjourvrai, debut, pplay, paprs, t_seri, sulfacc, sulfacc_pi,loadso4)
     
    182182
    183183     ! Read and interpolate bcsol and bcins
    184      IF ( flag_aerosol .EQ. 2 .OR. flag_aerosol .EQ. 6 ) THEN
     184     IF ( flag_aerosol .EQ. 2 .OR. flag_aerosol .EQ. 6 .OR. flag_aerosol .EQ. 7 ) THEN
    185185
    186186        ! Get bc aerosol distribution
     
    195195
    196196     ! Read and interpolate pomsol and pomins
    197      IF ( flag_aerosol .EQ. 3 .OR. flag_aerosol .EQ. 6 ) THEN
     197     IF ( flag_aerosol .EQ. 3 .OR. flag_aerosol .EQ. 6 .OR. flag_aerosol .EQ. 7 ) THEN
    198198
    199199        CALL readaerosol_interp(id_ASPOMM_phy, itap, pdtphys, rjourvrai, debut, pplay, paprs, t_seri, pomsol, pomsol_pi, load_tmp3)
     
    207207
    208208     ! Read and interpolate csssm, ssssm, assssm
    209      IF (flag_aerosol .EQ. 4 .OR. flag_aerosol .EQ. 6 ) THEN
     209     IF (flag_aerosol .EQ. 4 .OR. flag_aerosol .EQ. 6 .OR. flag_aerosol .EQ. 7 ) THEN
    210210
    211211        CALL readaerosol_interp(id_SSSSM_phy ,itap, pdtphys,rjourvrai, &
     
    224224
    225225     ! Read and interpolate cidustm
    226      IF (flag_aerosol .EQ. 5 .OR. flag_aerosol .EQ. 6 ) THEN
     226     IF (flag_aerosol .EQ. 5 .OR. flag_aerosol .EQ. 6 .OR. flag_aerosol .EQ. 7 ) THEN
    227227
    228228        CALL readaerosol_interp(id_CIDUSTM_phy, itap, pdtphys, rjourvrai, debut, pplay, paprs, t_seri, cidust, cidust_pi, loaddust)
     
    234234     !
    235235     ! Read and interpolate asno3m, csno3m, cino3m
    236      IF (flag_aerosol .EQ. 6) THEN
     236     IF (flag_aerosol .EQ. 6 .OR. flag_aerosol .EQ. 7 ) THEN
    237237
    238238        CALL readaerosol_interp(id_ASNO3M_phy, itap, pdtphys, rjourvrai, &
  • LMDZ6/branches/DYNAMICO-conv/libf/phylmd/rrtm/recmwf_aero.F90

    r2529 r3356  
    2424!--end
    2525 & PFLUX,PFLUC,&
    26  & PFSDN ,PFSUP , PFSCDN , PFSCUP,&
     26 & PFSDN ,PFSUP , PFSCDN , PFSCUP, PFSCCDN, PFSCCUP, PFLCCDN, PFLCCUP,&
    2727!--OB diagnostics
    2828 & PTOPSWADAERO,PSOLSWADAERO,&
     
    8282! ok_ade---input-L- apply the Aerosol Direct Effect or not?
    8383! ok_aie---input-L- apply the Aerosol Indirect Effect or not?
    84 ! flag_aerosol-input-I- aerosol flag from 0 to 6
     84! flag_aerosol-input-I- aerosol flag from 0 to 7
    8585! flag_aerosol_strat-input-I- use stratospheric aerosols flag (T/F)
    8686! PPIZA_NAT  : (KPROMA,KLEV,NSW); Single scattering albedo of natural aerosol
     
    110110! PFSCDN(KPROMA,KLEV+1)         ; SW clear sky flux down
    111111! PFSCUP(KPROMA,KLEV+1)         ; SW clear sky flux up
     112! PFSCCDN(KPROMA,KLEV+1)        ; SW clear sky clean (no aerosol) flux down
     113! PFSCCUP(KPROMA,KLEV+1)        ; SW clear sky clean (no aerosol) flux up
     114! PFLCCDN(KPROMA,KLEV+1)        ; LW clear sky clean (no aerosol) flux down
     115! PFLCCUP(KPROMA,KLEV+1)        ; LW clear sky clean (no aerosol) flux up
    112116
    113117
     
    152156USE YOERDI   , ONLY : RRAE   ,REPCLC    ,REPH2O
    153157USE YOMARPHY , ONLY : LRDUST
    154 USE phys_output_mod, ONLY : swaero_diag
     158USE phys_output_mod, ONLY : swaerofree_diag, swaero_diag
    155159
    156160!-----------------------------------------------------------------------
     
    241245REAL(KIND=JPRB)   ,INTENT(OUT)   :: PFSCDN(KPROMA,KLEV+1)  ! SW clear sky flux down
    242246REAL(KIND=JPRB)   ,INTENT(OUT)   :: PFSCUP(KPROMA,KLEV+1)  ! SW clear sky flux up
     247REAL(KIND=JPRB)   ,INTENT(OUT)   :: PFSCCDN(KPROMA,KLEV+1) ! SW clear sky clean (no aerosol) flux down
     248REAL(KIND=JPRB)   ,INTENT(OUT)   :: PFSCCUP(KPROMA,KLEV+1) ! SW clear sky clean (no aerosol) flux up
     249REAL(KIND=JPRB)   ,INTENT(OUT)   :: PFLCCDN(KPROMA,KLEV+1) ! LW clear sky clean (no aerosol) flux down
     250REAL(KIND=JPRB)   ,INTENT(OUT)   :: PFLCCUP(KPROMA,KLEV+1) ! LW clear sky clean (no aerosol) flux up
    243251
    244252!     ==== COMPUTED IN RADITE ===
     
    607615
    608616! case with no aerosols at all is also computed IF ACTIVEFEEDBACK_ACTIVE is false
    609 !IF (swaero_diag .OR. .not. AEROSOLFEEDBACK_ACTIVE .OR. flag_aerosol .EQ. 0 ) THEN   
    610 IF (.not. AEROSOLFEEDBACK_ACTIVE .OR. flag_aerosol .EQ. 0 ) THEN   
     617IF (.not. AEROSOLFEEDBACK_ACTIVE .OR. flag_aerosol .EQ. 0 .OR. swaerofree_diag) THEN   
    611618
    612619! ZERO aerosol effect
     
    775782ENDIF
    776783
     784IF (swaerofree_diag) THEN
     785! copy shortwave clear-sky clean (no aerosol) case
     786  PFSCCUP(:,:) =   ZFSUP0_AERO(:,:,5)
     787  PFSCCDN(:,:) =   ZFSDN0_AERO(:,:,5)
     788! copy longwave clear-sky clean (no aerosol) case
     789  PFLCCUP(:,:) =   LWUP0_AERO(:,:,5)
     790  PFLCCDN(:,:) =   LWDN0_AERO(:,:,5)
     791ENDIF
     792
    777793!OB- HERE CHECK WITH MP IF BOTTOM AND TOP INDICES ARE OK !!!!!!!!!!!!!!!!!!
    778794! net anthropogenic forcing direct and 1st indirect effect diagnostics
  • LMDZ6/branches/DYNAMICO-conv/libf/phylmd/rrtm/suecrad.F90

    r2627 r3356  
    681681!    CALL GSTATS(667,0)     MPL 2.12.08
    682682    IF( NPROC > 1 )THEN
    683       stop'Pas pret pour proc > 1'
     683      stop 'Pas pret pour proc > 1'
    684684!     CALL MPL_BROADCAST (RADGRID%NDGLG,MTAGRAD,JPIOMASTER,CDSTRING='SUECRAD:')
    685685    ENDIF
     
    689689    ENDIF
    690690    IF( NPROC > 1 )THEN
    691       stop'Pas pret pour proc > 1'
     691      stop 'Pas pret pour proc > 1'
    692692!     CALL MPL_BROADCAST (RADGRID%NRGRI(1:RADGRID%NDGLG),MTAGRAD,JPIOMASTER,CDSTRING='SUECRAD:')
    693693    ENDIF
     
    864864        WRITE(NULOUT,'("RADGRID,BEGIN")')
    865865        IF( MYPROC /= 1 )THEN
    866           stop'Pas pret pour proc > 1'
     866          stop 'Pas pret pour proc > 1'
    867867!         CALL MPL_SEND(RADGRID%NGPTOT,KDEST=NPRCIDS(1),KTAG=1,CDSTRING='SUECRAD.R')
    868868!         CALL MPL_SEND(ZLATX(1:RADGRID%NGPTOT),KDEST=NPRCIDS(1),KTAG=2,CDSTRING='SUECRAD.R')
     
    876876              ENDDO
    877877            ELSE
    878               stop'Pas pret pour proc > 1'
     878              stop 'Pas pret pour proc > 1'
    879879!             CALL MPL_RECV(IGPTOT,KSOURCE=NPRCIDS(JROC),KTAG=1,CDSTRING='SUECRAD.M')
    880880!             CALL MPL_RECV(ZLATX(1:IGPTOT),KSOURCE=NPRCIDS(JROC),KTAG=2,CDSTRING='SUECRAD.M')
     
    904904        WRITE(NULOUT,'("MODELGRID,BEGIN")')
    905905        IF( MYPROC /= 1 )THEN
    906           stop'Pas pret pour proc > 1'
     906          stop 'Pas pret pour proc > 1'
    907907!         CALL MPL_SEND(NGPTOT,KDEST=NPRCIDS(1),KTAG=1,CDSTRING='SUECRAD')
    908908!         CALL MPL_SEND(ZLATX(1:NGPTOT),KDEST=NPRCIDS(1),KTAG=2,CDSTRING='SUECRAD')
     
    917917              ENDDO
    918918            ELSE
    919               stop'Pas pret pour proc > 1'
     919              stop 'Pas pret pour proc > 1'
    920920!             CALL MPL_RECV(IGPTOT,KSOURCE=NPRCIDS(JROC),KTAG=1,CDSTRING='SUECRAD')
    921921!             CALL MPL_RECV(ZLATX(1:IGPTOT),KSOURCE=NPRCIDS(JROC),KTAG=2,CDSTRING='SUECRAD')
     
    11661166        IWIDE(10)=NAROB1
    11671167        IF( MYPROC /= 1 )THEN
    1168           stop'Pas pret pour proc > 1'
     1168          stop 'Pas pret pour proc > 1'
    11691169!         CALL MPL_SEND(IWIDE(1:10),KDEST=NPRCIDS(1),KTAG=1,CDSTRING='SUECRAD.W')
    11701170        ENDIF
     
    11721172          DO JROC=1,NPROC
    11731173            IF( JROC /= MYPROC )THEN
    1174               stop'Pas pret pour proc > 1'
     1174              stop 'Pas pret pour proc > 1'
    11751175!             CALL MPL_RECV(IWIDE(1:10),KSOURCE=NPRCIDS(JROC),KTAG=1,CDSTRING='SUECRAD.W')
    11761176            ENDIF
  • LMDZ6/branches/DYNAMICO-conv/libf/phylmd/rrtm/susw15.F90

    r2010 r3356  
    5858
    5959IMPLICIT NONE
    60 REAL(KIND=JPRB)   :: ZPDH2O=0.8_JPRB
    61 REAL(KIND=JPRB)   :: ZPDUMG=0.75_JPRB
    62 REAL(KIND=JPRB)   :: ZPRH2O=30000._JPRB
    63 REAL(KIND=JPRB)   :: ZPRUMG=30000._JPRB
     60REAL(KIND=JPRB),SAVE   :: ZPDH2O=0.8_JPRB
     61REAL(KIND=JPRB),SAVE   :: ZPDUMG=0.75_JPRB
     62REAL(KIND=JPRB),SAVE   :: ZPRH2O=30000._JPRB
     63REAL(KIND=JPRB),SAVE   :: ZPRUMG=30000._JPRB
    6464
    6565!$OMP THREADPRIVATE(zpdh2o,zpdumg,zprh2o,zprumg)
  • LMDZ6/branches/DYNAMICO-conv/libf/phylmd/stratosphere_mask.F90

    r2992 r3356  
    22! $Id$
    33!
    4 SUBROUTINE stratosphere_mask(missing_val, t_seri, pplay, xlat)
     4SUBROUTINE stratosphere_mask(missing_val, pphis, t_seri, pplay, xlat)
    55
    66!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
     
    88! determination of tropopause height and temperature from gridded temperature data
    99!
    10 ! reference: Reichler, T., M. Dameris, and R. Sausen (2003):
     10! reference: Reichler, T., M. Dameris, and R. Sausen (GRL, 10.1029/2003GL018240, 2003)
    1111! modified: 6/28/06 tjr
    1212! adapted to LMDZ by C. Kleinschmitt (2016-02-15)
    13 !
    14 ! input:    temp(nlon,nlat,nlev)    3D-temperature field
    15 !       ps(nlon,nlat)       2D-surface pressure field
    16 !       zs(nlon,nlat)       2D-surface height
    17 !       nlon            grid points in x
    18 !       nlat            grid points in y
    19 !       pfull(nlon,nlat,nlev)   full pressure levels in Pa
    20 !       plimu           upper limit for tropopause pressure
    21 !       pliml           lower limit for tropopause pressure
    22 !       gamma           tropopause criterion, e.g. -0.002 K/m
    23 !
    24 ! output:   p_tropopause(klon)     tropopause pressure in Pa with missing values
    25 !           t_tropopause(klon)     tropopause temperature in K with missing values
    26 !           z_tropopause(klon)     tropopause height in m with missing values
    27 !           stratomask             stratospheric mask withtout missing values
    28 !           ifil                  # of undetermined values
     13! committed to LMDz by O. Boucher (2016) with a mistake
     14! mistake corrected by O. Boucher (2017-12-11)
     15!
     16! input:  temp(nlon,nlat,nlev)  3D-temperature field
     17!         ps(nlon,nlat)         2D-surface pressure field
     18!         zs(nlon,nlat)         2D-surface height
     19!         nlon                  grid points in x
     20!         nlat                  grid points in y
     21!         pfull(nlon,nlat,nlev) full pressure levels in Pa
     22!         plimu                 upper limit for tropopause pressure
     23!         pliml                 lower limit for tropopause pressure
     24!         gamma                 tropopause criterion, e.g. -0.002 K/m
     25!
     26! output: p_tropopause(klon)    tropopause pressure in Pa with missing values
     27!         t_tropopause(klon)    tropopause temperature in K with missing values
     28!         z_tropopause(klon)    tropopause height in m with missing values
     29!         stratomask            stratospheric mask withtout missing values
     30!         ifil                  # of undetermined values
    2931!
    3032!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
     
    3739IMPLICIT NONE
    3840
     41INCLUDE "YOMCST.h"
     42
    3943REAL, INTENT(IN)                       :: missing_val ! missing value, also XIOS
     44REAL,DIMENSION(klon),INTENT(IN)        :: pphis   ! Geopotentiel de surface
    4045REAL,DIMENSION(klon,klev),INTENT(IN)   :: t_seri  ! Temperature
    4146REAL,DIMENSION(klon,klev),INTENT(IN)   :: pplay   ! pression pour le mileu de chaque couche (en Pa)
     
    6065  ENDDO
    6166  psrf=pplay(i,1)
    62   zsrf=0.0
     67  zsrf=pphis(i)/RG           !--altitude de la surface
    6368  call twmo(missing_val, klev, t, p, psrf, zsrf, plimu, pliml, gamma, ptrp, ttrp, ztrp)
    6469  tp(i)=ptrp
     
    104109subroutine twmo(missing_val, level, t, p, ps, zs, plimu, pliml, gamma, ptrp, ttrp, ztrp)
    105110
     111! reference: Reichler, T., M. Dameris, and R. Sausen (GRL, 10.1029/2003GL018240, 2003)
     112
    106113implicit none
    107114
     
    128135ztrp=missing_val
    129136
    130 faktor = -RG/R
     137faktor = -RG/RD
    131138
    132139do j=level,2,-1
     
    218225TDLNP = TDLNP + TM*DLNP
    219226
    220 ZTRP = ZS + TDLNP*R/RG
    221 
    222 if (ZTRP .lt. 0) then
    223   print*,ZTRP
    224   print*,PS
    225   print*,P
    226   print*,T
    227   print*,ZS
    228   stop
    229 endif
     227ZTRP = ZS + TDLNP*RD/RG
     228
     229!!if (ZTRP .lt. 0) then
     230!!  print*,'ZTRP=',ZTRP
     231!!  print*,'PS=',PS
     232!!  print*,'P=',P
     233!!  print*,'T=',T
     234!!  print*,'ZS=',ZS
     235!!  stop
     236!!endif
    230237
    231238return
  • LMDZ6/branches/DYNAMICO-conv/libf/phylmd/suphel.F90

    r2136 r3356  
    33
    44SUBROUTINE suphel
     5
     6  IMPLICIT NONE
    57
    68  include "YOMCST.h"
  • LMDZ6/branches/DYNAMICO-conv/libf/phylmd/surf_land_mod.F90

    • Property svn:executable deleted
  • LMDZ6/branches/DYNAMICO-conv/libf/phylmd/surf_land_orchidee_mod.F90

    • Property svn:executable deleted
  • LMDZ6/branches/DYNAMICO-conv/libf/phylmd/surf_land_orchidee_nofrein_mod.F90

    • Property svn:executable deleted
  • LMDZ6/branches/DYNAMICO-conv/libf/phylmd/surf_land_orchidee_noz0h_mod.F90

    • Property svn:executable deleted
  • LMDZ6/branches/DYNAMICO-conv/libf/phylmd/surf_landice_mod.F90

    • Property svn:executable deleted
  • LMDZ6/branches/DYNAMICO-conv/libf/phylmd/surf_ocean_mod.F90

    • Property svn:executable deleted
    r3002 r3356  
    185185!--old parametrizations of ocean surface albedo
    186186!
    187     IF (cycle_diurne) THEN
     187    IF (iflag_cycle_diurne.GE.1) THEN
    188188!
    189189       CALL alboc_cd(rmu0,alb_eau)
  • LMDZ6/branches/DYNAMICO-conv/libf/phylmd/surf_seaice_mod.F90

    • Property svn:executable deleted
  • LMDZ6/branches/DYNAMICO-conv/libf/phylmd/surface_data.F90

    • Property svn:executable deleted
    r2912 r3356  
    44MODULE surface_data
    55
     6  IMPLICIT NONE
     7
    68  REAL, PARAMETER        :: calice=1.0/(5.1444e+06*0.15)
    7   REAL, PARAMETER        :: tau_gl=86400.*5.
    89  REAL, PARAMETER        :: calsno=1./(2.3867e+06*.15)
    910 
  • LMDZ6/branches/DYNAMICO-conv/libf/phylmd/tend_to_tke.F90

    r2897 r3356  
    3232!**************************************************************************************
    3333
    34  SUBROUTINE tend_to_tke(dt,plev,exner,temp,windu,windv,dt_a,du_a,dv_a,tke)
     34 SUBROUTINE tend_to_tke(dt,plev,exner,temp,windu,windv,dt_a,du_a,dv_a,pctsrf,tke)
    3535
    3636 USE dimphy, ONLY: klon, klev
    3737 USE indice_sol_mod, ONLY: nbsrf
     38
     39IMPLICIT NONE
    3840#include "YOMCST.h"
    3941
     
    5355  REAL du_a(klon,klev)      ! Zonal wind speed tendency [m/s], grid-cell average or for a one subsurface
    5456  REAL dv_a(klon,klev)      ! Meridional wind speed tendency [m/s], grid-cell average or for a one subsurface
     57  REAL pctsrf(klon,nbsrf+1)       ! Turbulent Kinetic energy [m2/s2], grid-cell average or for a subsurface
    5558
    5659! Inputs/Outputs
    5760!---------------
    58   REAL tke(klon,klev,nbsrf)       ! Turbulent Kinetic energy [m2/s2], grid-cell average or for a subsurface
     61  REAL tke(klon,klev+1,nbsrf+1)       ! Turbulent Kinetic energy [m2/s2], grid-cell average or for a subsurface
    5962
    6063
     
    6366
    6467
    65   INTEGER ig,k,isrf                 ! indices
     68  INTEGER i,k,isrf                 ! indices
    6669  REAL    masse(klon,klev)          ! mass in the layers [kg/m2]
    6770  REAL    unsmasse(klon,klev+1)     ! linear mass in the layers [kg/m2]
     
    121124 DO isrf=1,nbsrf
    122125    DO k=1,klev
    123        tke(:,k,isrf)= tke(:,k,isrf)+tendu(:,k)+tendv(:,k)+tendt(:,k)
    124        tke(:,k,isrf)= max(tke(:,k,isrf),1.e-10)
     126       DO i=1,klon
     127          IF (pctsrf(i,isrf)>0.) THEN
     128            tke(i,k,isrf)= tke(i,k,isrf)+tendu(i,k)+tendv(i,k)+tendt(i,k)
     129            tke(i,k,isrf)= max(tke(i,k,isrf),1.e-10)
     130          ENDIF
     131       ENDDO
    125132    ENDDO
    126133 ENDDO
    127 
    128 ! dtke_t(:,:)=tendt(:,:)
    129 ! dtke_u(:,:)=tendu(:,:)
    130 ! dtke_v(:,:)=tendv(:,:)
    131134
    132135
  • LMDZ6/branches/DYNAMICO-conv/libf/phylmd/thermcell.F90

    • Property svn:executable deleted
  • LMDZ6/branches/DYNAMICO-conv/libf/phylmd/thermcell_condens.F90

    r1907 r3356  
    2424REAL RLvCp
    2525REAL, SAVE :: DDT0=.01
     26  !$OMP THREADPRIVATE(DDT0)
     27
    2628LOGICAL afaire(klon),tout_converge
    2729
  • LMDZ6/branches/DYNAMICO-conv/libf/phylmd/thermcell_flux2.F90

    • Property svn:executable deleted
    r2311 r3356  
    4747      REAL f_old,ddd0,eee0,ddd,eee,zzz
    4848
    49       REAL fomass_max,alphamax
    50       save fomass_max,alphamax
     49      REAL,SAVE :: fomass_max=0.5
     50      REAL,SAVE :: alphamax=0.7
     51!$OMP THREADPRIVATE(fomass_max,alphamax)
    5152
    5253      logical check_debug,labort_physic
     
    5556      character (len=80) :: abort_message
    5657
    57       fomass_max=0.5
    58       alphamax=0.7
    5958
    6059      ncorecfm1=0
  • LMDZ6/branches/DYNAMICO-conv/libf/phylmd/thermcell_plume.F90

    r2406 r3356  
    1212!--------------------------------------------------------------------------
    1313USE IOIPSL, ONLY : getin
     14USE ioipsl_getin_p_mod, ONLY : getin_p
    1415
    1516       USE print_control_mod, ONLY: prt_level
     
    9697      REAL fact_gamma,fact_gamma2,fact_epsilon2
    9798
    98       REAL, SAVE :: fact_epsilon, fact_epsilon_omp=0.002
    99       REAL, SAVE :: betalpha, betalpha_omp=0.9
    100       REAL, SAVE :: afact, afact_omp=2./3.
    101       REAL, SAVE :: fact_shell, fact_shell_omp=1.
    102       REAL,SAVE :: detr_min,detr_min_omp=1.e-5
    103       REAL,SAVE :: entr_min,entr_min_omp=1.e-5
    104       REAL,SAVE :: detr_q_coef,detr_q_coef_omp=0.012
    105       REAL,SAVE :: detr_q_power,detr_q_power_omp=0.5
    106       REAL,SAVE :: mix0,mix0_omp=0.
    107       INTEGER,SAVE :: thermals_flag_alim,thermals_flag_alim_omp=0
     99      REAL, SAVE :: fact_epsilon=0.002
     100      REAL, SAVE :: betalpha=0.9
     101      REAL, SAVE :: afact=2./3.
     102      REAL, SAVE :: fact_shell=1.
     103      REAL,SAVE :: detr_min=1.e-5
     104      REAL,SAVE :: entr_min=1.e-5
     105      REAL,SAVE :: detr_q_coef=0.012
     106      REAL,SAVE :: detr_q_power=0.5
     107      REAL,SAVE :: mix0=0.
     108      INTEGER,SAVE :: thermals_flag_alim=0
    108109
    109110!$OMP THREADPRIVATE(fact_epsilon, betalpha, afact, fact_shell)
     
    112113
    113114      LOGICAL, SAVE :: first=.true.
     115  !$OMP THREADPRIVATE(first)
     116
    114117
    115118      REAL c2(ngrid,klev)
     
    121124      RLvCp = RLVTT/RCPD
    122125      IF (first) THEN
    123      !$OMP MASTER
    124 ! FH : if ok_sync=.true. , the time axis is written at each time step
    125 ! in the output files. Only at the end in the opposite case
    126      CALL getin('thermals_fact_epsilon',fact_epsilon_omp)
    127      CALL getin('thermals_betalpha',betalpha_omp)
    128      CALL getin('thermals_afact',afact_omp)
    129      CALL getin('thermals_fact_shell',fact_shell_omp)
    130      CALL getin('thermals_detr_min',detr_min_omp)
    131      CALL getin('thermals_entr_min',entr_min_omp)
    132      CALL getin('thermals_detr_q_coef',detr_q_coef_omp)
    133      CALL getin('thermals_detr_q_power',detr_q_power_omp)
    134      CALL getin('thermals_mix0',mix0_omp)
    135      CALL getin('thermals_flag_alim',thermals_flag_alim_omp)
    136 !    CALL getin('thermals_X',X_omp)
    137 !    X=X_omp
    138      !$OMP END MASTER
    139      !$OMP BARRIER
    140      fact_epsilon=fact_epsilon_omp
    141      betalpha=betalpha_omp
    142      afact=afact_omp
    143      fact_shell=fact_shell_omp
    144      detr_min=detr_min_omp
    145      entr_min=entr_min_omp
    146      detr_q_coef=detr_q_coef_omp
    147      detr_q_power=detr_q_power_omp
    148      mix0=mix0_omp
    149      thermals_flag_alim=thermals_flag_alim_omp
     126
     127     CALL getin_p('thermals_fact_epsilon',fact_epsilon)
     128     CALL getin_p('thermals_betalpha',betalpha)
     129     CALL getin_p('thermals_afact',afact)
     130     CALL getin_p('thermals_fact_shell',fact_shell)
     131     CALL getin_p('thermals_detr_min',detr_min)
     132     CALL getin_p('thermals_entr_min',entr_min)
     133     CALL getin_p('thermals_detr_q_coef',detr_q_coef)
     134     CALL getin_p('thermals_detr_q_power',detr_q_power)
     135     CALL getin_p('thermals_mix0',mix0)
     136     CALL getin_p('thermals_flag_alim',thermals_flag_alim)
     137
    150138
    151139      first=.false.
  • LMDZ6/branches/DYNAMICO-conv/libf/phylmd/thermcell_qsat.F90

    r1907 r3356  
    2323logical Zsat
    2424REAL RLvCp
     25
    2526REAL, SAVE :: DDT0=.01
     27!$OMP THREADPRIVATE(DDT0)
     28
    2629LOGICAL afaire(klon),tout_converge
    2730
  • LMDZ6/branches/DYNAMICO-conv/libf/phylmd/tracreprobus_mod.F90

    r2320 r3356  
    7272          WRITE(*,*)it,'nqtot',nqtot,'nbtr',nbtr
    7373          IF (it < nqtot) THEN
    74              WRITE(*,*)'ici',it,nqtot
     74             WRITE(*,*)'iciav',it,nqtot
    7575#ifdef REPROBUS
    76              CALL minmaxqfi_chimie(tr_seri(1,1,it),0.,1.e10,'avant chimie ')
     76             CALL minmaxqfi_chimie(it,tr_seri(1,1,it),0.,1.e10,'avant chimie ')
    7777#endif
    78              WRITE(*,*)'apres'
     78             WRITE(*,*)iter,'avpres'
    7979          ENDIF
    8080       ENDDO
     
    9494       ! pdel, pdt_rep, daynum : definit dans phytrac et utilise dans chemmain
    9595       !                 et transporte par CHEM_REP
     96
     97       DO it=1, nbtr
     98!     WRITE(lunout,*)it,' ',minval(tr_seri(:,:,it)),maxval(tr_seri(:,:,it))
     99! seulement pour les especes chimiques (pas l'age de l'air)
     100! verif valeurs extremes
     101! correction: a 1.e-30 quand =0 ou negatif et
     102! call abort si >ou= 1.e10
     103          WRITE(*,*)it,'nqtot',nqtot,'nbtr',nbtr
     104          IF (it < nqtot) THEN
     105             WRITE(*,*)'iciap',it,nqtot
     106             CALL minmaxqfi_chimie(it,tr_seri(1,1,it),0.,1.e10,'apres chemmain')
     107             WRITE(*,*)iter,'appres'
     108          ENDIF
     109       ENDDO
     110
    96111#endif       
    97112       
  • LMDZ6/branches/DYNAMICO-conv/libf/phylmd/transp.F90

    r2346 r3356  
    11
    2 ! $Header$
     2! $Id$
    33
    4 SUBROUTINE transp(paprs, tsol, t, q, u, v, geom, vtran_e, vtran_q, utran_e, &
    5     utran_q)
     4SUBROUTINE transp(paprs, tsol, t, q, ql, qs, u, v, geom, vtran_e, vtran_q, utran_e, &
     5    utran_q, vtran_w, utran_w)
    66
    77  USE dimphy
     
    1616
    1717  REAL paprs(klon, klev+1), tsol(klon)
    18   REAL t(klon, klev), q(klon, klev), u(klon, klev), v(klon, klev)
     18  REAL t(klon, klev), q(klon, klev), ql(klon, klev), qs(klon, klev)
     19  REAL u(klon, klev), v(klon, klev)
    1920  REAL utran_e(klon), utran_q(klon), vtran_e(klon), vtran_q(klon)
     21  REAL utran_w(klon), vtran_w(klon)
    2022
    2123  INTEGER i, l
     
    2830    vtran_e(i) = 0.0
    2931    vtran_q(i) = 0.0
     32    utran_w(i) = 0.0
     33    vtran_w(i) = 0.0
    3034  END DO
    3135
    3236  DO l = 1, klev
    3337    DO i = 1, klon
    34       e = rcpd*t(i, l) + rlvtt*q(i, l) + geom(i, l)
     38!      e = rcpd*t(i, l) + rlvtt*q(i, l) + geom(i, l)
     39      e = rcpd*t(i, l) + geom(i, l)
    3540      utran_e(i) = utran_e(i) + u(i, l)*e*(paprs(i,l)-paprs(i,l+1))/rg
    3641      utran_q(i) = utran_q(i) + u(i, l)*q(i, l)*(paprs(i,l)-paprs(i,l+1))/rg
     42      utran_w(i) = utran_w(i) + u(i, l)*(q(i, l)+ql(i, l)+qs(i, l))           &
     43                                       *(paprs(i,l)-paprs(i,l+1))/rg
    3744      vtran_e(i) = vtran_e(i) + v(i, l)*e*(paprs(i,l)-paprs(i,l+1))/rg
    3845      vtran_q(i) = vtran_q(i) + v(i, l)*q(i, l)*(paprs(i,l)-paprs(i,l+1))/rg
     46      vtran_w(i) = vtran_w(i) + v(i, l)*(q(i, l)+ql(i, l)+qs(i, l))           &
     47                                       *(paprs(i,l)-paprs(i,l+1))/rg
    3948    END DO
    4049  END DO
  • LMDZ6/branches/DYNAMICO-conv/libf/phylmd/transp_lay.F90

    • Property svn:executable deleted
  • LMDZ6/branches/DYNAMICO-conv/libf/phylmd/tropopause_m.F90

    r2992 r3356  
    99!-------------------------------------------------------------------------------
    1010!
    11 FUNCTION dyn_tropopause(t, ts, paprs, pplay, rot, thet0, pvor0)
     11FUNCTION dyn_tropopause(t, ts, paprs, pplay, rot, itrop, thet0, pvor0)
    1212!
    1313!-------------------------------------------------------------------------------
     
    2626  REAL, INTENT(IN)  ::  pplay(:,:) !--- Cells-centers pressure
    2727  REAL, INTENT(IN)  ::    rot(:,:) !--- Cells-centers relative vorticity
    28   REAL, INTENT(IN), OPTIONAL :: thet0, pvor0
     28  INTEGER, INTENT(OUT), OPTIONAL :: itrop(klon) !--- Last tropospheric layer idx
     29  REAL,    INTENT(IN),  OPTIONAL :: thet0, pvor0
    2930!-------------------------------------------------------------------------------
    3031! Local variables:
    3132  include "YOMCST.h"
     33  REAL, PARAMETER :: DynPTrMin =8.E+3 !--- Thresholds for minimum and maximum
     34  REAL, PARAMETER :: DynPTrMax =4.E+4 !    dynamical tropopause pressure (Pa).
    3235  CHARACTER(LEN=80)  :: sub
    3336  INTEGER :: i, k, kb, kt, kp, ib, ie, nw
     
    100103    dyn_tropopause(i) = MAX( pplay(i,kp+1)*(pplay(i,kp)/pplay(i,kp+1))**al,    &
    101104                            dyn_tropopause(i) )
     105    !--- UNREALISTIC VALUES DETECTION
     106    IF(dyn_tropopause(i)<DynPTrMin.OR.dyn_tropopause(i)>DynPTrMax) THEN
     107      dyn_tropopause(i)=MIN(MAX(dyn_tropopause(i),DynPTrMax),DynPTrMin)
     108      DO kt=1,klev-1; IF(pplay(i,kt+1)>dyn_tropopause(i)) EXIT; END DO; kp=kt
     109    END IF
     110    !--- LAST TROPOSPHERIC LAYER INDEX NEEDED
     111    IF(PRESENT(itrop)) itrop(i)=MAX(kt,kp)
    102112  END DO
    103113
  • LMDZ6/branches/DYNAMICO-conv/libf/phylmd/wake.F90

    r2922 r3356  
    44SUBROUTINE wake(znatsurf, p, ph, pi, dtime, &
    55                te0, qe0, omgb, &
    6                 dtdwn, dqdwn, amdwn, amup, dta, dqa, &
    7                 sigd_con, &
    8                 deltatw, deltaqw, sigmaw, wdens, &                          ! state variables
     6                dtdwn, dqdwn, amdwn, amup, dta, dqa, wgen, &
     7                sigd_con, Cin, &
     8                deltatw, deltaqw, sigmaw, awdens, wdens, &                  ! state variables
    99                dth, hw, wape, fip, gfl, &
    1010                dtls, dqls, ktopw, omgbdth, dp_omgb, tu, qu, &
    1111                dtke, dqke, omg, dp_deltomg, spread, cstar, &
    1212                d_deltat_gw, &
    13                 d_deltatw2, d_deltaqw2, d_sigmaw2, d_wdens2)                ! tendencies
     13                d_deltatw2, d_deltaqw2, d_sigmaw2, d_awdens2, d_wdens2)     ! tendencies
    1414
    1515
     
    4848  ! dtls : large scale temperature tendency due to wake
    4949  ! dqls : large scale humidity tendency due to wake
    50   ! hw   : hauteur de la poche
     50  ! hw   : wake top hight (given by hw*deltatw(1)/2=wape)
    5151  ! dp_omgb : vertical gradient of large scale omega
     52  ! awdens  : densite de poches actives
    5253  ! wdens   : densite de poches
    5354  ! omgbdth: flux of Delta_Theta transported by LS omega
     
    7273  ! dta  : source de chaleur due courants satures et detrain  (K/s)
    7374  ! dqa  : source d'humidite due aux courants satures et detra (kg/kg/s)
     75  ! wgen : number of wakes generated per unit area and per sec (/m^2/s)
    7476  ! amdwn: flux de masse total des descentes, par unite de
    75   ! surface de la maille (kg/m2/s)
     77  !        surface de la maille (kg/m2/s)
    7678  ! amup : flux de masse total des ascendances, par unite de
    77   ! surface de la maille (kg/m2/s)
     79  !        surface de la maille (kg/m2/s)
     80  ! sigd_con:
     81  ! Cin  : convective inhibition
    7882  ! p    : pressions aux milieux des couches (Pa)
    7983  ! ph   : pressions aux interfaces (Pa)
     
    105109  ! deltatw0   : deltatw initial
    106110  ! deltaqw0   : deltaqw initial
    107   ! hw0    : hw initial
    108   ! sigmaw0: sigmaw initial
     111  ! hw0    : wake top hight (defined as the altitude at which deltatw=0)
    109112  ! amflux : horizontal mass flux through wake boundary
    110113  ! wdens_ref: initial number of wakes per unit area (3D) or per
     
    133136  REAL, DIMENSION (klon, klev),     INTENT(IN)          :: amdwn, amup
    134137  REAL, DIMENSION (klon, klev),     INTENT(IN)          :: dta, dqa
     138  REAL, DIMENSION (klon),           INTENT(IN)          :: wgen
    135139  REAL, DIMENSION (klon),           INTENT(IN)          :: sigd_con
     140  REAL, DIMENSION (klon),           INTENT(IN)          :: Cin
    136141
    137142  !
     
    140145  REAL, DIMENSION (klon, klev),     INTENT(INOUT)       :: deltatw, deltaqw
    141146  REAL, DIMENSION (klon),           INTENT(INOUT)       :: sigmaw
     147  REAL, DIMENSION (klon),           INTENT(INOUT)       :: awdens
    142148  REAL, DIMENSION (klon),           INTENT(INOUT)       :: wdens
    143149
     
    149155  REAL, DIMENSION (klon, klev),     INTENT(OUT)         :: dtls, dqls
    150156  REAL, DIMENSION (klon, klev),     INTENT(OUT)         :: dtke, dqke
    151   REAL, DIMENSION (klon, klev),     INTENT(OUT)         :: spread
     157  REAL, DIMENSION (klon, klev),     INTENT(OUT)         :: spread    !  unused (jyg)
    152158  REAL, DIMENSION (klon, klev),     INTENT(OUT)         :: omgbdth, omg
    153159  REAL, DIMENSION (klon, klev),     INTENT(OUT)         :: dp_omgb, dp_deltomg
     
    157163  ! Tendencies of state variables
    158164  REAL, DIMENSION (klon, klev),     INTENT(OUT)         :: d_deltatw2, d_deltaqw2
    159   REAL, DIMENSION (klon),           INTENT(OUT)         :: d_sigmaw2, d_wdens2
     165  REAL, DIMENSION (klon),           INTENT(OUT)         :: d_sigmaw2, d_awdens2, d_wdens2
    160166
    161167  ! Variables internes
     
    165171  INTEGER, SAVE                                         :: igout
    166172  !$OMP THREADPRIVATE(igout)
    167   REAL                                                  :: alon
    168173  LOGICAL, SAVE                                         :: first = .TRUE.
    169174  !$OMP THREADPRIVATE(first)
     
    176181  !$OMP THREADPRIVATE(stark, wdens_ref, coefgw, alpk, crep_upper, crep_sol)
    177182
     183  REAL, SAVE                                            :: tau_cv
     184  !$OMP THREADPRIVATE(tau_cv)
     185  REAL, SAVE                                            :: rzero, aa0 ! minimal wake radius and area
     186  !$OMP THREADPRIVATE(rzero, aa0)
     187
    178188  LOGICAL, SAVE                                         :: flag_wk_check_trgl
    179189  !$OMP THREADPRIVATE(flag_wk_check_trgl)
    180190  INTEGER, SAVE                                         :: iflag_wk_check_trgl
    181191  !$OMP THREADPRIVATE(iflag_wk_check_trgl)
     192  INTEGER, SAVE                                         :: iflag_wk_pop_dyn
     193  !$OMP THREADPRIVATE(iflag_wk_pop_dyn)
    182194
    183195  REAL                                                  :: delta_t_min
    184196  INTEGER                                               :: nsub
    185197  REAL                                                  :: dtimesub
    186   REAL                                                  :: sigmad, hwmin, wapecut
     198  REAL                                                  :: wdensmin
     199  REAL, SAVE                                            :: sigmad, hwmin, wapecut, cstart
     200  !$OMP THREADPRIVATE(sigmad, hwmin, wapecut, cstart)
    187201  REAL                                                  :: sigmaw_max
    188202  REAL                                                  :: dens_rate
     
    195209  REAL, DIMENSION (klon, klev)                          :: deltaqw0
    196210  REAL, DIMENSION (klon, klev)                          :: te, qe
    197   REAL, DIMENSION (klon)                                :: sigmaw0
    198211!!  REAL, DIMENSION (klon)                                :: sigmaw1
     212
     213  ! Variables liees a la dynamique de population
     214  REAL, DIMENSION(klon)                                 :: act
     215  REAL, DIMENSION(klon)                                 :: rad_wk, tau_wk_inv
     216  REAL, DIMENSION(klon)                                 :: f_shear
     217  REAL, DIMENSION(klon)                                 :: drdt
     218  REAL, DIMENSION(klon)                                 :: d_sig_gen, d_sig_death, d_sig_col
     219  REAL, DIMENSION(klon)                                 :: wape1_act, wape2_act
     220  LOGICAL, DIMENSION (klon)                             :: kill_wake
     221  INTEGER, SAVE                                         :: iflag_wk_act
     222  !$OMP THREADPRIVATE(iflag_wk_act)
     223  REAL                                                  :: drdt_pos
     224  REAL                                                  :: tau_wk_inv_min
    199225
    200226  ! Variables pour les GW
     
    204230  REAL, DIMENSION (klon, klev)                          :: tgw
    205231
    206   ! Variables liées au calcul de hw
     232  ! Variables liees au calcul de hw
    207233  REAL, DIMENSION (klon)                                :: ptop_provis, ptop, ptop_new
    208234  REAL, DIMENSION (klon)                                :: sum_dth
     
    211237  INTEGER, DIMENSION (klon)                             :: ktop, kupper
    212238
    213   ! Variables liées au test de la forme triangulaire du profil de Delta_theta
     239  ! Variables liees au test de la forme triangulaire du profil de Delta_theta
    214240  REAL, DIMENSION (klon)                                :: sum_half_dth
    215241  REAL, DIMENSION (klon)                                :: dz_half
     
    218244  REAL, DIMENSION (klon, klev)                          :: d_deltatw, d_deltaqw
    219245  REAL, DIMENSION (klon, klev)                          :: d_te, d_qe
     246  REAL, DIMENSION (klon)                                :: d_awdens, d_wdens
    220247  REAL, DIMENSION (klon)                                :: d_sigmaw, alpha
    221248  REAL, DIMENSION (klon)                                :: q0_min, q1_min
     
    228255  INTEGER                                               ::isubstep, k, i
    229256
     257  REAL                                                  :: wdens_targ
    230258  REAL                                                  :: sigmaw_targ
    231259
     
    273301  REAL, DIMENSION (klon, klev)                          :: detr
    274302
    275   REAL, DIMENSION(klon)                                 :: sigmaw_in   ! pour les prints
     303  REAL, DIMENSION(klon)                                 :: sigmaw_in             ! pour les prints
     304  REAL, DIMENSION(klon)                                 :: awdens_in, wdens_in   ! pour les prints
    276305
    277306  ! -------------------------------------------------------------------------
     
    284313  ! -------------------------------------------------------------------------
    285314
    286   DATA wapecut, sigmad, hwmin/5., .02, 10./
     315!!  DATA wapecut, sigmad, hwmin/5., .02, 10./
     316  DATA wapecut, sigmad, hwmin/1., .02, 10./
     317!!  DATA wdensmin/1.e-12/
     318  DATA wdensmin/1.e-14/
    287319  ! cc nrlmd
    288320  DATA sigmaw_max/0.4/
    289321  DATA dens_rate/0.1/
     322  DATA rzero /5000./
    290323  ! cc
    291324  ! Longueur de maille (en m)
     
    293326
    294327  ! ALON = 3.e5
    295   alon = 1.E6
     328  ! alon = 1.E6
     329
     330  !  Provisionnal; to be suppressed when f_shear is parameterized
     331  f_shear(:) = 1.       ! 0. for strong shear, 1. for weak shear
    296332
    297333
     
    300336  ! coefgw : Coefficient pour les ondes de gravité
    301337  ! stark : Coefficient k dans Cstar=k*sqrt(2*WAPE)
    302   ! wdens : Densité de poche froide par maille
     338  ! wdens : Densité surfacique de poche froide
    303339  ! -------------------------------------------------------------------------
    304340
     
    321357  crep_sol = 1.0
    322358
     359  aa0 = 3.14*rzero*rzero
     360
     361  tau_cv = 4000.
     362
    323363  ! cc nrlmd Lecture du fichier wake_param.data
    324364  stark=0.33
    325365  CALL getin_p('stark',stark)
     366  cstart = stark*sqrt(2.*wapecut)
     367
    326368  alpk=0.25
    327369  CALL getin_p('alpk',alpk)
     
    334376  CALL getin_p('wdens_ref_l',wdens_ref(2))    !wake number per unit area ; land
    335377!>jyg
     378  iflag_wk_pop_dyn = 0
     379  CALL getin_p('iflag_wk_pop_dyn',iflag_wk_pop_dyn) ! switch between wdens prescribed
     380                                                    ! and wdens prognostic
     381  iflag_wk_act = 0
     382  CALL getin_p('iflag_wk_act',iflag_wk_act) ! 0: act(:)=0.
     383                                            ! 1: act(:)=1.
     384                                            ! 2: act(:)=f(Wape)
    336385  coefgw=4.
    337386  CALL getin_p('coefgw',coefgw)
     
    344393  WRITE(*,*) 'wdens_ref_l=', wdens_ref(2)
    345394!>jyg
     395  WRITE(*,*) 'iflag_wk_pop_dyn=',iflag_wk_pop_dyn
     396  WRITE(*,*) 'iflag_wk_act',iflag_wk_act
    346397  WRITE(*,*) 'coefgw=', coefgw
    347398
     
    357408 endif
    358409
     410 IF (iflag_wk_pop_dyn == 0) THEN
    359411  ! Initialisation de toutes des densites a wdens_ref.
    360412  ! Les densites peuvent evoluer si les poches debordent
    361413  ! (voir au tout debut de la boucle sur les substeps)
    362 !jyg<
    363 !!  wdens(:) = wdens_ref
    364   DO i = 1,klon
    365     wdens(i) = wdens_ref(znatsurf(i)+1)
    366   ENDDO
    367 !>jyg
     414  !jyg<
     415  !!  wdens(:) = wdens_ref
     416   DO i = 1,klon
     417     wdens(i) = wdens_ref(znatsurf(i)+1)
     418   ENDDO
     419  !>jyg
     420 ENDIF  ! (iflag_wk_pop_dyn == 0)
    368421
    369422  ! print*,'stark',stark
     
    415468      d_deltatw2(:,:) = 0.
    416469      d_deltaqw2(:,:) = 0.
     470
     471      IF (iflag_wk_act == 0) THEN
     472        act(:) = 0.
     473      ELSEIF (iflag_wk_act == 1) THEN
     474        act(:) = 1.
     475      ENDIF
     476
    417477!!  DO i = 1, klon
    418478!!   sigmaw_in(i) = sigmaw(i)
     
    425485  ! print*, 'sigmaw,sigd_con', sigmaw, sigd_con
    426486  ! ENDIF
     487  IF (iflag_wk_pop_dyn >=1) THEN
     488    DO i = 1, klon
     489      wdens_targ = max(wdens(i),wdensmin)
     490      d_wdens2(i) = wdens_targ - wdens(i)
     491      wdens(i) = wdens_targ
     492    END DO
     493  ELSE
     494    DO i = 1, klon
     495      d_awdens2(i) = 0.
     496      d_wdens2(i) = 0.
     497    END DO
     498  ENDIF  ! (iflag_wk_pop_dyn >=1)
     499!
    427500  DO i = 1, klon
    428501    ! c      sigmaw(i) = amax1(sigmaw(i),sigd_con(i))
     
    434507    sigmaw(i) = sigmaw_targ
    435508!>jyg
    436     sigmaw0(i) = sigmaw(i)
    437     wape(i) = 0.
    438     wape2(i) = 0.
    439     d_sigmaw(i) = 0.
    440     d_wdens2(i) = 0.
    441     ktopw(i) = 0
    442   END DO
     509  END DO
     510
     511!
     512  IF (iflag_wk_pop_dyn >= 1) THEN
     513    awdens_in(:) = awdens(:)
     514    wdens_in(:) = wdens(:)
     515!!    wdens(:) = wdens(:) + wgen(:)*dtime
     516!!    d_wdens2(:) = wgen(:)*dtime
     517!!  ELSE
     518  ENDIF  ! (iflag_wk_pop_dyn >= 1)
     519
     520  wape(:) = 0.
     521  wape2(:) = 0.
     522  d_sigmaw(:) = 0.
     523  ktopw(:) = 0
    443524!
    444525!<jyg
     
    833914      gwake(i) = .FALSE.
    834915    ELSE
     916      hw(i) = hw0(i)
    835917      cstar(i) = stark*sqrt(2.*wape(i))
    836918      gwake(i) = .TRUE.
     
    891973    ! cc           On calcule pour cela une densité wdens0 pour laquelle on
    892974    ! aurait un entrainement nul ---
     975    !jyg<
     976    ! Dans la configuration avec wdens prognostique, il s'agit d'un cas ou
     977    ! les poches sont insuffisantes pour accueillir tout le flux de masse
     978    ! des descentes unsaturees. Nous faisons alors l'hypothese que la
     979    ! convection profonde cree directement de nouvelles poches, sans passer
     980    ! par les thermiques. La nouvelle valeur de wdens est alors imposée.
     981
    893982    DO i = 1, klon
    894983      ! c       print *,' isubstep,wk_adv(i),cstar(i),wape(i) ',
     
    899988        wdens0 = (sigmaw(i)/(4.*3.14))* &
    900989          ((1.-sigmaw(i))*omg(i,kupper(i)+1)/((ph(i,1)-pupper(i))*cstar(i)))**(2)
     990        IF (prt_level >= 10) THEN
     991             print*,'omg(i,kupper(i)+1),wdens0,wdens(i),cstar(i), ph(i,1)-pupper(i)', &
     992                     omg(i,kupper(i)+1),wdens0,wdens(i),cstar(i), ph(i,1)-pupper(i)
     993        ENDIF
    901994        IF (wdens(i)<=wdens0*1.1) THEN
     995          IF (iflag_wk_pop_dyn >= 1) THEN
     996             d_wdens2(i) = d_wdens2(i) + wdens0 - wdens(i)
     997          ENDIF
    902998          wdens(i) = wdens0
    903999        END IF
    904         ! c        print*,'omg(i,kupper(i)+1),wdens0,wdens(i),cstar(i)
    905         ! c     $     ,ph(i,1)-pupper(i)',
    906         ! c     $             omg(i,kupper(i)+1),wdens0,wdens(i),cstar(i)
    907         ! c     $     ,ph(i,1)-pupper(i)
    908       END IF
    909     END DO
    910 
    911     ! cc nrlmd
     1000      END IF
     1001    END DO
    9121002
    9131003    DO i = 1, klon
    9141004      IF (wk_adv(i)) THEN
    9151005        gfl(i) = 2.*sqrt(3.14*wdens(i)*sigmaw(i))
     1006        rad_wk(i) = sqrt(sigmaw(i)/(3.14*wdens(i)))
    9161007!jyg<
    9171008!!        sigmaw(i) = amin1(sigmaw(i), sigmaw_max)
     
    9231014    END DO
    9241015
    925     DO i = 1, klon
    926       IF (wk_adv(i)) THEN
    927         ! cc nrlmd          Introduction du taux de mortalité des poches et
    928         ! test sur sigmaw_max=0.4
    929         ! cc         d_sigmaw(i) = gfl(i)*Cstar(i)*dtimesub
    930         IF (sigmaw(i)>=sigmaw_max) THEN
    931           death_rate(i) = gfl(i)*cstar(i)/sigmaw(i)
    932         ELSE
    933           death_rate(i) = 0.
    934         END IF
    935 
    936         d_sigmaw(i) = gfl(i)*cstar(i)*dtimesub - death_rate(i)*sigmaw(i)* &
    937           dtimesub
    938         ! $              - nat_rate(i)*sigmaw(i)*dtimesub
    939         ! c        print*, 'd_sigmaw(i),sigmaw(i),gfl(i),Cstar(i),wape(i),
    940         ! c     $  death_rate(i),ktop(i),kupper(i)',
    941         ! c     $                d_sigmaw(i),sigmaw(i),gfl(i),Cstar(i),wape(i),
    942         ! c     $  death_rate(i),ktop(i),kupper(i)
    943 
    944         ! sigmaw(i) =sigmaw(i) + gfl(i)*Cstar(i)*dtimesub
    945         ! sigmaw(i) =min(sigmaw(i),0.99)     !!!!!!!!
    946         ! wdens = wdens0/(10.*sigmaw)
    947         ! sigmaw =max(sigmaw,sigd_con)
    948         ! sigmaw =max(sigmaw,sigmad)
    949       END IF
    950     END DO
     1016    IF (iflag_wk_pop_dyn >= 1) THEN
     1017
     1018      IF (iflag_wk_act ==2) THEN
     1019      DO i = 1, klon
     1020        IF (wk_adv(i)) THEN
     1021          wape1_act(i) = abs(cin(i))
     1022          wape2_act(i) = 2.*wape1_act(i) + 1.
     1023          act(i) = min(1., max(0., (wape(i)-wape1_act(i)) / (wape2_act(i)-wape1_act(i)) ))
     1024        ENDIF  ! (wk_adv(i))
     1025      ENDDO
     1026      ENDIF  ! (iflag_wk_act ==2)
     1027
     1028
     1029      DO i = 1, klon
     1030        IF (wk_adv(i)) THEN
     1031!!          tau_wk(i) = max(rad_wk(i)/(3.*cstar(i))*((cstar(i)/cstart)**1.5 - 1), 100.)
     1032          tau_wk_inv(i) = max( (3.*cstar(i))/(rad_wk(i)*((cstar(i)/cstart)**1.5 - 1)), 0.)
     1033          tau_wk_inv_min = min(tau_wk_inv(i), 1./dtimesub)
     1034          drdt(i) = (cstar(i) - wgen(i)*(sigmaw(i)/wdens(i)-aa0)/gfl(i)) / &
     1035                    (1 + 2*f_shear(i)*(2.*sigmaw(i)-aa0*wdens(i)) - 2.*sigmaw(i))
     1036!!                    (1 - 2*sigmaw(i)*(1.-f_shear(i)))
     1037          drdt_pos=max(drdt(i),0.)
     1038
     1039!!          d_wdens(i) = ( wgen(i)*(1.+2.*(sigmaw(i)-sigmad)) &
     1040!!                     - wdens(i)*tau_wk_inv_min &
     1041!!                     - 2.*gfl(i)*wdens(i)*Cstar(i) )*dtimesub
     1042          d_awdens(i) = ( wgen(i) - (1./tau_cv)*(awdens(i) - act(i)*wdens(i)) )*dtimesub
     1043          d_wdens(i) = ( wgen(i) - (wdens(i)-awdens(i))*tau_wk_inv_min -  &
     1044                         2.*wdens(i)*gfl(i)*drdt_pos )*dtimesub
     1045          d_wdens(i) = max(d_wdens(i), wdensmin-wdens(i))
     1046
     1047!!          d_sigmaw(i) = ( (1.-2*f_shear(i)*sigmaw(i))*(gfl(i)*Cstar(i)+wgen(i)*sigmad/wdens(i)) &
     1048!!                      + 2.*f_shear(i)*wgen(i)*sigmaw(i)**2/wdens(i) &
     1049!!                      - sigmaw(i)*tau_wk_inv_min )*dtimesub
     1050          d_sig_gen(i) = wgen(i)*aa0
     1051          d_sig_death(i) = - sigmaw(i)*(1.-awdens(i)/wdens(i))*tau_wk_inv_min
     1052!!          d_sig_col(i) = - 2*f_shear(i)*sigmaw(i)*gfl(i)*drdt_pos
     1053          d_sig_col(i) = - 2*f_shear(i)*(2.*sigmaw(i)-wdens(i)*aa0)*gfl(i)*drdt_pos
     1054          d_sigmaw(i) = ( d_sig_gen(i) + d_sig_death(i) + d_sig_col(i) + gfl(i)*cstar(i) )*dtimesub
     1055          d_sigmaw(i) = max(d_sigmaw(i), sigmad-sigmaw(i))
     1056        ENDIF
     1057      ENDDO
     1058
     1059      IF (prt_level >= 10) THEN
     1060        print *,'wake, cstar(1), cstar(1)/cstart, rad_wk(1), tau_wk_inv(1), drdt(1) ', &
     1061                       cstar(1), cstar(1)/cstart, rad_wk(1), tau_wk_inv(1), drdt(1)
     1062        print *,'wake, wdens(1), awdens(1), act(1), d_awdens(1) ', &
     1063                       wdens(1), awdens(1), act(1), d_awdens(1)
     1064        print *,'wake, wgen, -(wdens-awdens)*tau_wk_inv, -2.*wdens*gfl*drdt_pos, d_wdens ', &
     1065                       wgen(1), -(wdens(1)-awdens(1))*tau_wk_inv(1), -2.*wdens(1)*gfl(1)*drdt_pos, d_wdens(1)
     1066        print *,'wake, d_sig_gen(1), d_sig_death(1), d_sig_col(1), d_sigmaw(1) ', &
     1067                       d_sig_gen(1), d_sig_death(1), d_sig_col(1), d_sigmaw(1)
     1068      ENDIF
     1069   
     1070    ELSE  !  (iflag_wk_pop_dyn >= 1)
     1071
     1072    ! cc nrlmd
     1073
     1074      DO i = 1, klon
     1075        IF (wk_adv(i)) THEN
     1076          ! cc nrlmd          Introduction du taux de mortalité des poches et
     1077          ! test sur sigmaw_max=0.4
     1078          ! cc         d_sigmaw(i) = gfl(i)*Cstar(i)*dtimesub
     1079          IF (sigmaw(i)>=sigmaw_max) THEN
     1080            death_rate(i) = gfl(i)*cstar(i)/sigmaw(i)
     1081          ELSE
     1082            death_rate(i) = 0.
     1083          END IF
     1084   
     1085          d_sigmaw(i) = gfl(i)*cstar(i)*dtimesub - death_rate(i)*sigmaw(i)* &
     1086            dtimesub
     1087          ! $              - nat_rate(i)*sigmaw(i)*dtimesub
     1088          ! c        print*, 'd_sigmaw(i),sigmaw(i),gfl(i),Cstar(i),wape(i),
     1089          ! c     $  death_rate(i),ktop(i),kupper(i)',
     1090          ! c     $              d_sigmaw(i),sigmaw(i),gfl(i),Cstar(i),wape(i),
     1091          ! c     $  death_rate(i),ktop(i),kupper(i)
     1092   
     1093          ! sigmaw(i) =sigmaw(i) + gfl(i)*Cstar(i)*dtimesub
     1094          ! sigmaw(i) =min(sigmaw(i),0.99)     !!!!!!!!
     1095          ! wdens = wdens0/(10.*sigmaw)
     1096          ! sigmaw =max(sigmaw,sigd_con)
     1097          ! sigmaw =max(sigmaw,sigmad)
     1098        END IF
     1099      END DO
     1100
     1101    ENDIF   !  (iflag_wk_pop_dyn >= 1)
     1102
    9511103
    9521104    ! calcul de la difference de vitesse verticale poche - zone non perturbee
     
    12231375
    12241376    ! Increment state variables
     1377!jyg<
     1378    IF (iflag_wk_pop_dyn >= 1) THEN
     1379      DO k = 1, klev
     1380        DO i = 1, klon
     1381          IF (wk_adv(i) .AND. k<=kupper(i)) THEN
     1382            detr(i,k) = - d_sig_death(i) - d_sig_col(i)     
     1383            entr(i,k) = d_sig_gen(i)
     1384          ENDIF
     1385        ENDDO
     1386      ENDDO
     1387      ELSE  ! (iflag_wk_pop_dyn >= 1)
     1388      DO k = 1, klev
     1389        DO i = 1, klon
     1390          IF (wk_adv(i) .AND. k<=kupper(i)) THEN
     1391            detr(i, k) = 0.
     1392   
     1393            entr(i, k) = 0.
     1394          ENDIF
     1395        ENDDO
     1396      ENDDO
     1397    ENDIF  ! (iflag_wk_pop_dyn >= 1)
     1398
     1399   
    12251400
    12261401    DO k = 1, klev
     
    12641439          ! cc nrlmd          Prise en compte du taux de mortalité
    12651440          ! cc               Définitions de entr, detr
    1266           detr(i, k) = 0.
    1267 
    1268           entr(i, k) = detr(i, k) + gfl(i)*cstar(i) + &
    1269             sigmaw(i)*(1.-sigmaw(i))*dp_deltomg(i, k)
    1270 
    1271           spread(i, k) = (entr(i,k)-detr(i,k))/sigmaw(i)
     1441!jyg<
     1442!!            detr(i, k) = 0.
     1443!!   
     1444!!            entr(i, k) = detr(i, k) + gfl(i)*cstar(i) + &
     1445!!              sigmaw(i)*(1.-sigmaw(i))*dp_deltomg(i, k)
     1446!!
     1447            entr(i, k) = entr(i,k) + gfl(i)*cstar(i) + &
     1448                         sigmaw(i)*(1.-sigmaw(i))*dp_deltomg(i, k)   
     1449!>jyg
     1450            spread(i, k) = (entr(i,k)-detr(i,k))/sigmaw(i)
     1451
    12721452          ! cc        spread(i,k) =
    12731453          ! (1.-sigmaw(i))*dp_deltomg(i,k)+gfl(i)*Cstar(i)/
     
    13841564      END DO
    13851565    END DO
     1566!
    13861567    DO i = 1, klon
    13871568      IF (wk_adv(i)) THEN
    13881569        sigmaw(i) = sigmaw(i) + d_sigmaw(i)
     1570        d_sigmaw2(i) = d_sigmaw2(i) + d_sigmaw(i)
     1571      END IF
     1572    END DO
    13891573!jyg<
    1390         d_sigmaw2(i) = d_sigmaw2(i) + d_sigmaw(i)
     1574    IF (iflag_wk_pop_dyn >= 1) THEN
     1575      DO i = 1, klon
     1576        IF (wk_adv(i)) THEN
     1577          awdens(i) = awdens(i) + d_awdens(i)
     1578          wdens(i) = wdens(i) + d_wdens(i)
     1579          d_awdens2(i) = d_awdens2(i) + d_awdens(i)
     1580          d_wdens2(i) = d_wdens2(i) + d_wdens(i)
     1581        END IF
     1582      END DO
     1583      DO i = 1, klon
     1584        IF (wk_adv(i)) THEN
     1585          wdens_targ = max(wdens(i),wdensmin)
     1586          d_wdens2(i) = d_wdens2(i) + wdens_targ - wdens(i)
     1587          wdens(i) = wdens_targ
     1588!
     1589          wdens_targ = min( max(awdens(i),0.), wdens(i) )
     1590          d_awdens2(i) = d_awdens2(i) + wdens_targ - awdens(i)
     1591          awdens(i) = wdens_targ
     1592        END IF
     1593      END DO
     1594      DO i = 1, klon
     1595        IF (wk_adv(i)) THEN
     1596          sigmaw_targ = max(sigmaw(i),sigmad)
     1597          d_sigmaw2(i) = d_sigmaw2(i) + sigmaw_targ - sigmaw(i)
     1598          sigmaw(i) = sigmaw_targ
     1599        END IF
     1600      END DO
     1601    ENDIF  ! (iflag_wk_pop_dyn >= 1)
    13911602!>jyg
    1392       END IF
    1393     END DO
    13941603
    13951604
     
    19012110  ! ENDDO
    19022111  ! cc
     2112
     2113  !jyg<
     2114  IF (iflag_wk_pop_dyn >= 1) THEN
     2115    DO i = 1, klon
     2116      kill_wake(i) = ((wape(i)>=wape2(i)) .AND. (wape2(i)<=wapecut)) .OR. (ktopw(i)<=2) .OR. &
     2117          .NOT. ok_qx_qw(i) .OR. (wdens(i) < 2.*wdensmin)
     2118    ENDDO
     2119  ELSE  ! (iflag_wk_pop_dyn >= 1)
     2120    DO i = 1, klon
     2121      kill_wake(i) = ((wape(i)>=wape2(i)) .AND. (wape2(i)<=wapecut)) .OR. (ktopw(i)<=2) .OR. &
     2122          .NOT. ok_qx_qw(i)
     2123    ENDDO
     2124  ENDIF  ! (iflag_wk_pop_dyn >= 1)
     2125  !>jyg
     2126
    19032127  DO k = 1, klev
    19042128    DO i = 1, klon
    1905 
    1906       ! cc nrlmd      On maintient désormais constant sigmaw en régime
    1907       ! permanent
    1908       ! cc      IF ((sigmaw(i).GT.sigmaw_max).or.
    1909       IF (((wape(i)>=wape2(i)) .AND. (wape2(i)<=1.0)) .OR. (ktopw(i)<=2) .OR. &
    1910           .NOT. ok_qx_qw(i)) THEN
     2129!!jyg      IF (((wape(i)>=wape2(i)) .AND. (wape2(i)<=wapecut)) .OR. (ktopw(i)<=2) .OR. &
     2130!!jyg          .NOT. ok_qx_qw(i)) THEN
     2131      IF (kill_wake(i)) THEN
    19112132        ! cc
    19122133        dtls(i, k) = 0.
     
    19162137        d_deltatw2(i,k) = -deltatw0(i,k)
    19172138        d_deltaqw2(i,k) = -deltaqw0(i,k)
    1918       END IF
    1919     END DO
    1920   END DO
    1921 
    1922   ! cc nrlmd      On maintient désormais constant sigmaw en régime permanent
    1923   DO i = 1, klon
    1924     IF (((wape(i)>=wape2(i)) .AND. (wape2(i)<=1.0)) .OR. (ktopw(i)<=2) .OR. &
    1925         .NOT. ok_qx_qw(i)) THEN
     2139      END IF  ! (kill_wake(i))
     2140    END DO
     2141  END DO
     2142
     2143  DO i = 1, klon
     2144!!jyg    IF (((wape(i)>=wape2(i)) .AND. (wape2(i)<=wapecut)) .OR. (ktopw(i)<=2) .OR. &
     2145!!jyg        .NOT. ok_qx_qw(i)) THEN
     2146      IF (kill_wake(i)) THEN
    19262147      ktopw(i) = 0
    19272148      wape(i) = 0.
    19282149      cstar(i) = 0.
    1929 !!jyg   Outside subroutine "Wake" hw and sigmaw are zero when there are no wakes
     2150!!jyg   Outside subroutine "Wake" hw, wdens and sigmaw are zero when there are no wakes
    19302151!!      hw(i) = hwmin                       !jyg
    19312152!!      sigmaw(i) = sigmad                  !jyg
    19322153      hw(i) = 0.                            !jyg
    1933       sigmaw(i) = 0.                        !jyg
    19342154      fip(i) = 0.
    1935     ELSE
     2155!!      sigmaw(i) = 0.                        !jyg
     2156      sigmaw_targ = 0.
     2157      d_sigmaw2(i) = d_sigmaw2(i) + sigmaw_targ - sigmaw(i)
     2158      sigmaw(i) = sigmaw_targ
     2159      IF (iflag_wk_pop_dyn >= 1) THEN
     2160!!        awdens(i) = 0.
     2161!!        wdens(i) = 0.
     2162        wdens_targ = 0.
     2163        d_wdens2(i) = wdens_targ - wdens(i)
     2164        wdens(i) = wdens_targ
     2165        wdens_targ = 0.
     2166        d_awdens2(i) = wdens_targ - awdens(i)
     2167        awdens(i) = wdens_targ
     2168      ENDIF  ! (iflag_wk_pop_dyn >= 1)
     2169    ELSE  ! (kill_wake(i))
    19362170      wape(i) = wape2(i)
    19372171      cstar(i) = cstar2(i)
    1938     END IF
     2172    END IF  ! (kill_wake(i))
    19392173    ! c        print*,'wape wape2 ktopw OK_qx_qw =',
    19402174    ! c     $          wape(i),wape2(i),ktopw(i),OK_qx_qw(i)
     
    19722206  DO i = 1, klon
    19732207    d_sigmaw2(i) = d_sigmaw2(i)/dtime
     2208    d_awdens2(i) = d_awdens2(i)/dtime
    19742209    d_wdens2(i) = d_wdens2(i)/dtime
    19752210  ENDDO
  • LMDZ6/branches/DYNAMICO-conv/libf/phylmd/write_bilKP_ave.h

    • Property svn:executable deleted
  • LMDZ6/branches/DYNAMICO-conv/libf/phylmd/write_bilKP_ins.h

    • Property svn:executable deleted
  • LMDZ6/branches/DYNAMICO-conv/libf/phylmd/yamada4.F90

    r3312 r3356  
    117117  REAL aa(klon, klev+1), aa0, aa1
    118118  INTEGER nlay, nlev
    119   LOGICAL first
    120   INTEGER ipas
    121   SAVE first, ipas
    122   ! FH/IM     data first,ipas/.true.,0/
    123   DATA first, ipas/.FALSE., 0/
    124   !$OMP THREADPRIVATE( first,ipas)
     119
    125120  LOGICAL,SAVE :: hboville=.TRUE.
    126121  REAL,SAVE :: viscom,viscoh
     
    136131  INTEGER iter
    137132  REAL dissip(klon,klev), tkeprov,tkeexp, shear(klon,klev), buoy(klon,klev)
     133  REAL :: disseff
     134
    138135  REAL,SAVE :: ric0,ric,rifc, b1, kap
    139136  !$OMP THREADPRIVATE(ric0,ric,rifc,b1,kap)
     
    147144  !$OMP THREADPRIVATE(new_yamada4,yamada4_num)
    148145  REAL, SAVE :: yun,ydeux
    149   REAL :: disseff
    150146  !$OMP THREADPRIVATE(yun,ydeux)
     147
    151148  REAL frif, falpha, fsm
    152149  REAL rino(klon, klev+1), smyam(klon, klev), styam(klon, klev), &
     
    225222  nlay = klev
    226223  nlev = klev + 1
    227   ipas = ipas + 1
    228224
    229225
     
    659655
    660656! Ajout d'une viscosite moleculaire
    661    km(:,:)=km(:,:)+viscom
    662    kn(:,:)=kn(:,:)+viscoh
    663    kq(:,:)=kq(:,:)+viscoh
     657   km(1:ngrid,2:klev)=km(1:ngrid,2:klev)+viscom
     658   kn(1:ngrid,2:klev)=kn(1:ngrid,2:klev)+viscoh
     659   kq(1:ngrid,2:klev)=kq(1:ngrid,2:klev)+viscoh
    664660
    665661  IF (prt_level>1) THEN
     
    725721!============================================================================
    726722
    727   first = .FALSE.
    728723  RETURN
    729724
     
    974969 REAL     hlim(klon)
    975970 REAL, SAVE :: kap=0.4,kapb=0.4
     971  !$OMP THREADPRIVATE(kap,kapb)
    976972 REAL zq
    977973 REAL sq(klon), sqz(klon)
  • LMDZ6/branches/DYNAMICO-conv/makelmdz

    r2746 r3356  
    7575  fi
    7676fi
    77 COSP_PATH=$LMDGCM/.void_dir
     77#COSP_PATH=$LMDGCM/.void_dir
    7878
    7979
     
    311311
    312312# get ar command from arch.fcm file
    313 archfileline=$( grep -i '^%AR' arch.fcm )
     313archfileline=$( grep -i '^%AR ' arch.fcm )
    314314arcommand=$( echo ${archfileline##%AR} )
     315
     316# get ar command options from arch.fcm file
     317archfileline=$( grep -i '^%ARFLAGS' arch.fcm )
     318arflags=$( echo ${archfileline##%ARFLAGS} )
    315319
    316320# get make utility from arch.fcm file
     
    460464   CPP_KEY="$CPP_KEY CPP_IOIPSL CPP_XIOS"
    461465   INCLUDE="$INCLUDE -I${IOIPSL_INCDIR} -I${XIOS_INCDIR}"
    462    LIB="$LIB -L${IOIPSL_LIBDIR} -l${LIBPREFIX}ioipsl -L${XIOS_LIBDIR} -l${LIBPREFIX}stdc++ -l${LIBPREFIX}xios"
     466   LIB="$LIB -L${IOIPSL_LIBDIR} -l${LIBPREFIX}ioipsl -L${XIOS_LIBDIR} -l${LIBPREFIX}stdc++ -l${LIBPREFIX}xios -l${LIBPREFIX}stdc++"
    463467elif [[ $io == xios ]]
    464468then
     
    466470   CPP_KEY="$CPP_KEY CPP_IOIPSL CPP_XIOS CPP_IOIPSL_NO_OUTPUT"
    467471   INCLUDE="$INCLUDE -I${IOIPSL_INCDIR} -I${XIOS_INCDIR}"
    468    LIB="$LIB -L${IOIPSL_LIBDIR} -l${LIBPREFIX}ioipsl -L${XIOS_LIBDIR} -l${LIBPREFIX}stdc++ -l${LIBPREFIX}xios"
     472   LIB="$LIB -L${IOIPSL_LIBDIR} -l${LIBPREFIX}ioipsl -L${XIOS_LIBDIR} -l${LIBPREFIX}stdc++ -l${LIBPREFIX}xios -l${LIBPREFIX}stdc++"
    469473fi
    470474
     
    472476then
    473477   CPP_KEY="$CPP_KEY CPP_COSP"
    474    COSP_PATH="$LIBFGCM/phylmd/cosp"
    475    src_dirs="$src_dirs cosp"
     478#   COSP_PATH="$LIBFGCM/phylmd/cosp"
     479   src_dirs="$src_dirs phy${physique}/cosp"
    476480#   LIB="${LIB} -l${LIBPREFIX}cosp"
    477    opt_dep="$opt_dep cosp"
    478    lcosp="-l${LIBPREFIX}cosp"
    479    INCLUDE="$INCLUDE"' -I$(LIBF)/cosp'
     481#  opt_dep="$opt_dep cosp"
     482#  lcosp="-l${LIBPREFIX}cosp"
     483   INCLUDE="$INCLUDE"' -I$(LIBF)/'phy${physique}'/cosp'
    480484fi
    481485
     
    764768MOD_SUFFIX="mod" \
    765769AR=$arcommand \
     770ARFLAGS="$arflags" \
    766771DIRMAIN=$dirmain \
    767772SOURCE=$source_code \
     
    796801MOD_SUFFIX="mod" \
    797802AR=$arcommand \
     803ARFLAGS="$arflags" \
    798804DIRMAIN=$dirmain \
    799805SOURCE=$source_code \
  • LMDZ6/branches/DYNAMICO-conv/makelmdz_fcm

    r2743 r3356  
    429429   CPP_KEY="$CPP_KEY CPP_IOIPSL CPP_XIOS"
    430430   INCLUDE="$INCLUDE -I${IOIPSL_INCDIR} -I${XIOS_INCDIR}"
    431    LIB="$LIB -L${IOIPSL_LIBDIR} -l${LIBPREFIX}ioipsl -L${XIOS_LIBDIR} -l${LIBPREFIX}stdc++ -l${LIBPREFIX}xios"
     431   LIB="$LIB -L${IOIPSL_LIBDIR} -l${LIBPREFIX}ioipsl -L${XIOS_LIBDIR} -l${LIBPREFIX}stdc++ -l${LIBPREFIX}xios -l${LIBPREFIX}stdc++"
    432432elif [[ $io == xios ]]
    433433then
     
    435435   CPP_KEY="$CPP_KEY CPP_IOIPSL CPP_XIOS CPP_IOIPSL_NO_OUTPUT"
    436436   INCLUDE="$INCLUDE -I${IOIPSL_INCDIR} -I${XIOS_INCDIR}"
    437    LIB="$LIB -L${IOIPSL_LIBDIR} -l${LIBPREFIX}ioipsl -L${XIOS_LIBDIR} -l${LIBPREFIX}stdc++ -l${LIBPREFIX}xios"
     437   LIB="$LIB -L${IOIPSL_LIBDIR} -l${LIBPREFIX}ioipsl -L${XIOS_LIBDIR} -l${LIBPREFIX}stdc++ -l${LIBPREFIX}xios -l${LIBPREFIX}stdc++"
    438438fi
    439439
Note: See TracChangeset for help on using the changeset viewer.