Changeset 2720 for LMDZ5/branches/testing
- Timestamp:
- Nov 30, 2016, 1:28:41 PM (8 years ago)
- Location:
- LMDZ5/branches/testing
- Files:
-
- 3 deleted
- 67 edited
- 19 copied
Legend:
- Unmodified
- Added
- Removed
-
LMDZ5/branches/testing
- Property svn:mergeinfo changed
/LMDZ5/trunk merged: 2665-2668,2670-2674,2677-2681,2683-2684,2686,2690-2719
- Property svn:mergeinfo changed
-
LMDZ5/branches/testing/DefLists/context_lmdz.xml
r2669 r2720 65 65 <axis id="cth16" name="cth" standard_name="altitude" unit="m"> 66 66 </axis> 67 <axis id="ReffIce" standard_name="ReffIce" unit="microne" > 68 </axis> 69 <axis id="ReffLiq" standard_name="ReffLiq" unit="microne" > 70 </axis> 67 71 68 72 </axis_definition> -
LMDZ5/branches/testing/DefLists/cosp_output_nl.txt
r2435 r2720 106 106 Liwpmodis=.false., 107 107 Lclmodis=.false., 108 Lcrimodis=.false., 109 Lcrlmodis=.false., 108 110 !- RTTOV 109 111 Ltbrttov=.false., -
LMDZ5/branches/testing/DefLists/field_def_lmdz.xml
r2669 r2720 111 111 <field id="bils_enthalp" long_name="Surf. total heat flux" unit="W/m2" /> 112 112 <field id="bils_latent" long_name="Surf. total heat flux" unit="W/m2" /> 113 114 115 116 117 118 119 120 121 113 <field id="bils_ech" long_name="peu importe" unit="W/m2" /> 114 <field id="du_gwd_rando" long_name="peu importe" unit="W/m2" /> 115 <field id="dv_gwd_rando" long_name="peu importe" unit="W/m2" /> 116 <field id="ustr_gwd_hines" long_name="zonal wind stress Hines gravity waves" unit="Pa" /> 117 <field id="vstr_gwd_hines" long_name="meridional wind stress Hines gravity waves" unit="Pa" /> 118 <field id="ustr_gwd_front" long_name="zonal wind stress fronts gravity waves" unit="Pa" /> 119 <field id="vstr_gwd_front" long_name="meridional wind stress fronts gravity waves" unit="Pa" /> 120 <field id="ustr_gwd_rando" long_name="zonal wind stress random gravity waves" unit="Pa" /> 121 <field id="vstr_gwd_rando" long_name="meridinal wind stress random gravity waves" unit="Pa" /> 122 122 <field id="sens" long_name="Sensible heat flux" unit="W/m2" /> 123 123 <field id="fder" long_name="Heat flux derivation" unit="W/m2" /> … … 176 176 <field id="wbilo_oce" long_name="Bilan eau oce" unit="kg/(m2*s)" /> 177 177 <field id="wbilo_sic" long_name="Bilan eau sic" unit="kg/(m2*s)" /> 178 <field id="wevap_ter" long_name="Evap eau ter" unit="kg/(m2*s)" /> 179 <field id="wevap_lic" long_name="Evap eau lic" unit="kg/(m2*s)" /> 180 <field id="wevap_oce" long_name="Evap eau oce" unit="kg/(m2*s)" /> 181 <field id="wevap_sic" long_name="Evap eau sic" unit="kg/(m2*s)" /> 182 <field id="wrain_ter" long_name="Pluie eau ter" unit="kg/(m2*s)" /> 183 <field id="wrain_lic" long_name="Pluie eau lic" unit="kg/(m2*s)" /> 184 <field id="wrain_oce" long_name="Pluie eau oce" unit="kg/(m2*s)" /> 185 <field id="wrain_sic" long_name="Pluie eau sic" unit="kg/(m2*s)" /> 186 <field id="wsnow_ter" long_name="Neige eau ter" unit="kg/(m2*s)" /> 187 <field id="wsnow_lic" long_name="Neige eau lic" unit="kg/(m2*s)" /> 188 <field id="wsnow_oce" long_name="Neige eau oce" unit="kg/(m2*s)" /> 189 <field id="wsnow_sic" long_name="Neige eau sic" unit="kg/(m2*s)" /> 178 190 <field id="cdrm" long_name="Momentum drag coef." unit="-" /> 179 191 <field id="cdrh" long_name="Heat drag coef." unit="-" /> … … 479 491 <field id="upwd" long_name="saturated updraft" unit="kg/m2/s" /> 480 492 <field id="ep" long_name="ep" unit="su" /> 493 <field id="duphy" long_name="Physics du" unit="K/s" /> 481 494 <field id="dtphy" long_name="Physics dT" unit="K/s" /> 482 495 <field id="dqphy" long_name="Physics dQ" unit="(kg/kg)/s" /> … … 560 573 <field id="dulif" long_name="Orography dU" unit="m/s2" /> 561 574 <field id="dvlif" long_name="Orography dV" unit="m/s2" /> 562 563 564 565 566 567 575 <field id="du_gwd_hines" long_name="Hines GWD dU" unit="m/s2" /> 576 <field id="dv_gwd_hines" long_name="Hines GWD dV" unit="m/s2" /> 577 <field id="du_gwd_front" long_name="Fronts GWD dU" unit="m/s2" /> 578 <field id="dv_gwd_front" long_name="Fronts GWD dV" unit="m/s2" /> 579 <field id="east_gwstress" long_name="Eastward GW Stress" unit="Pa" /> 580 <field id="west_gwstress" long_name="Westward GW Stress" unit="Pa" /> 568 581 <field id="dtoro" long_name="Orography dT" unit="K/s" /> 569 582 <field id="dtlif" long_name="Orography dT" unit="K/s" /> … … 600 613 <field id="stratomask" long_name="Stratospheric fraction" unit="-" /> 601 614 </field_group> 615 616 <field_group id="fields_strataer_trac_3D" domain_ref="dom_glo" axis_ref="presnivs"/> 617 <field_group id="fields_strataer_trac_2D" domain_ref="dom_glo"/> 618 619 <field_group id="fields_strataer_3D" domain_ref="dom_glo" axis_ref="presnivs"> 620 <field id="ext_strat_550" long_name="Strat. aerosol extinction coefficient at 550 nm" unit="1/m" /> 621 <field id="ext_strat_1020" long_name="Strat. aerosol extinction coefficient at 1020 nm" unit="1/m" /> 622 <field id="sulf_convert" long_name="SO2 mass flux converted to H2SO4" unit="kg(S)/m2/layer/s" /> 623 <field id="sulf_nucl" long_name="H2SO4 nucleation mass flux" unit="kg(S)/m2/layer/s" /> 624 <field id="sulf_cond_evap" long_name="H2SO4 condensation/evaporation mass flux" unit="kg(S)/m2/layer/s" /> 625 <field id="ocs_convert" long_name="OCS mass flux converted to SO2" unit="kg(S)/m2/layer/s" /> 626 <field id="R2SO4" long_name="H2SO4 mass fraction in aerosol" unit="%" /> 627 <field id="OCS_lifetime" long_name="OCS lifetime" unit="s" /> 628 <field id="SO2_lifetime" long_name="SO2 lifetime" unit="s" /> 629 <field id="SO2_backgr_tend" long_name="SO2 background tendency" unit="kg(S)/m2/layer/s" /> 630 <field id="OCS_backgr_tend" long_name="OCS background tendency" unit="kg(S)/m2/layer/s" /> 631 <field id="vsed_aer" long_name="Strat. aerosol sedimentation velocity (mass-weighted)" unit="m/s" /> 632 <field id="f_r_wet" long_name="Conversion factor dry to wet aerosol radius" unit="-" /> 633 </field_group> 634 635 <field_group id="fields_strataer_2D" domain_ref="dom_glo"> 636 <field id="OD550_strat_only" long_name="Stratospheric Aerosol Optical depth at 550 nm " unit="1" /> 637 <field id="OD1020_strat_only" long_name="Stratospheric Aerosol Optical depth at 1020 nm " unit="1" /> 638 <field id="sulf_dep_dry" long_name="Sulfur dry deposition flux" unit="kg(S)/m2/s" /> 639 <field id="sulf_dep_wet" long_name="Sulfur wet deposition flux" unit="kg(S)/m2/s" /> 640 <field id="surf_PM25_sulf" long_name="Sulfate PM2.5 concentration at the surface" unit="ug/m3" /> 641 <field id="p_tropopause" long_name="Tropopause pressure" unit="Pa" /> 642 <field id="sflux" long_name="Ground sedimentation flux of strat. particles" unit="kg(S)/m2/s" /> 643 </field_group> 602 644 603 645 <field_group id="fields_NMC" domain_ref="dom_glo" axis_ref="plev"> … … 624 666 </field_group> 625 667 626 <field_group id="fields_trac " domain_ref="dom_glo">668 <field_group id="fields_trac_2D" domain_ref="dom_glo"> 627 669 <field id="cumRN" long_name="Cumulated tracer RNVL1" unit="-" /> 628 670 <field id="cumPB" long_name="Cumulated tracer PBVL1" unit="-" /> 629 <field id="cumAga" long_name="Cumulated tracer Aga" unit="-" /> 630 </field_group> 631 632 <field_group id="fields_trac" domain_ref="dom_glo" axis_ref="presnivs"> 671 <field id="cumAga" long_name="Cumulated tracer Aga" unit="-" /> 672 <field id="cumdRN_dry" long_name="Surface dry deposition tracer RNVL1" unit="- s-1" /> 673 <field id="cumdPB_dry" long_name="Surface dry deposition tracer PBVL1" unit="- s-1" /> 674 <field id="cumdAga_dry" long_name="Surface dry deposition tracer Aga" unit="- s-1" /> 675 </field_group> 676 677 <field_group id="fields_trac_3D" domain_ref="dom_glo" axis_ref="presnivs"> 633 678 <field id="RN" long_name="Tracer RNVL1" unit="-" /> 634 679 <field id="dRN_vdf" long_name="Tendance tracer RNVL1" unit="-" /> … … 720 765 <field id="c20_atb532" long_name="Lidar Attenuated Total Backscatter (532 nm)" unit="1" axis_ref="height_mlev" /> 721 766 <field id="beta_mol532" long_name="Lidar Molecular Backscatter (532 nm)" unit="m-1 sr-1" axis_ref="height_mlev" /> 722 <field id="cllcalipsoice" 723 <field id="clhcalipsoice" 724 <field id="clmcalipsoice" 725 <field id="cltcalipsoice" 726 <field id="clcalipsoice" long_name="Lidar Ice-Phase Cloud Fraction (532 nm)" unit="%" axis_ref="height" />727 <field id="cllcalipsoliq" 728 <field id="clhcalipsoliq" 729 <field id="clmcalipsoliq" 730 <field id="cltcalipsoliq" 731 <field id="clcalipsoliq" long_name="Lidar Liq-Phase Cloud Fraction (532 nm)" unit="%" axis_ref="height" />767 <field id="cllcalipsoice" long_name="Lidar Ice-Phase Low-level Cloud Fraction" unit="%" /> 768 <field id="clhcalipsoice" long_name="Lidar Ice-Phase Hight-level Cloud Fraction" unit="%" /> 769 <field id="clmcalipsoice" long_name="Lidar Ice-Phase Mid-level Cloud Fraction" unit="%" /> 770 <field id="cltcalipsoice" long_name="Lidar Ice-Phase Total Cloud Fraction" unit="%" /> 771 <field id="clcalipsoice" long_name="Lidar Ice-Phase Cloud Fraction (532 nm)" unit="%" axis_ref="height" /> 772 <field id="cllcalipsoliq" long_name="Lidar Liq-Phase Low-level Cloud Fraction" unit="%" /> 773 <field id="clhcalipsoliq" long_name="Lidar Liq-Phase Hight-level Cloud Fraction" unit="%" /> 774 <field id="clmcalipsoliq" long_name="Lidar Liq-Phase Mid-level Cloud Fraction" unit="%" /> 775 <field id="cltcalipsoliq" long_name="Lidar Liq-Phase Total Cloud Fraction" unit="%" /> 776 <field id="clcalipsoliq" long_name="Lidar Liq-Phase Cloud Fraction (532 nm)" unit="%" axis_ref="height" /> 732 777 <field id="cllcalipsoun" long_name="Lidar Undefined-Phase Low-level Cloud Fraction" unit="%" /> 733 778 <field id="clhcalipsoun" long_name="Lidar Undefined-Phase Hight-level Cloud Fraction" unit="%" /> 734 779 <field id="clmcalipsoun" long_name="Lidar Undefined-Phase Mid-level Cloud Fraction" unit="%" /> 735 780 <field id="cltcalipsoun" long_name="Lidar Undefined-Phase Total Cloud Fraction" unit="%" /> 736 <field id="clcalipsoun" long_name="Lidar Undefined-Phase Cloud Fraction (532 nm)" unit="%" axis_ref="height" />737 <field id="clcalipsotmp" long_name="Lidar Cloud Fraction (532 nm)" unit="%" axis_ref="temp" />738 <field id="clcalipsotmpliq" 739 <field id="clcalipsotmpice" 781 <field id="clcalipsoun" long_name="Lidar Undefined-Phase Cloud Fraction (532 nm)" unit="%" axis_ref="height" /> 782 <field id="clcalipsotmp" long_name="Lidar Cloud Fraction (532 nm)" unit="%" axis_ref="temp" /> 783 <field id="clcalipsotmpliq" long_name="Lidar Liq-Phase Cloud Fraction (532 nm)" unit="%" axis_ref="temp" /> 784 <field id="clcalipsotmpice" long_name="Lidar Ice-Phase Cloud Fraction (532 nm)" unit="%" axis_ref="temp" /> 740 785 <field id="clcalipsotmpun" long_name="Undefined-Phase Total Cloud Fraction" unit="%" axis_ref="temp" /> 741 786 </field_group> … … 867 912 </field_group> 868 913 869 870 914 <field_group id="field_scalar" operation="instant" freq_op="30d" grid_ref="grid_scalar"> 871 915 <field id="R_ecc" long_name="R_ecc" unit="-" /> … … 873 917 <field id="R_incl" long_name="R_incl" unit="deg" /> 874 918 <field id="solaire" long_name="solaire" unit="W/m2" /> 875 876 919 <field id="rsun1" long_name="Fraction constante solaire bande 1" unit="W/m2" /> 877 920 <field id="rsun2" long_name="Fraction constante solaire bande 2" unit="W/m2" /> … … 880 923 <field id="rsun5" long_name="Fraction constante solaire bande 5" unit="W/m2" /> 881 924 <field id="rsun6" long_name="Fraction constante solaire bande 6" unit="W/m2" /> 882 883 925 <field id="co2_ppm" long_name="co2_ppm" unit="ppm" /> 884 926 <field id="CH4_ppb" long_name="CH4_ppb" unit="ppb" /> -
LMDZ5/branches/testing/DefLists/file_def_histLES_lmdz.xml
r2594 r2720 163 163 <field field_ref="wbilo_oce" level="10" /> 164 164 <field field_ref="wbilo_sic" level="10" /> 165 <field field_ref="wevap_ter" level="10" /> 166 <field field_ref="wevap_lic" level="10" /> 167 <field field_ref="wevap_oce" level="10" /> 168 <field field_ref="wevap_sic" level="10" /> 169 <field field_ref="wrain_ter" level="10" /> 170 <field field_ref="wrain_lic" level="10" /> 171 <field field_ref="wrain_oce" level="10" /> 172 <field field_ref="wrain_sic" level="10" /> 173 <field field_ref="wsnow_ter" level="10" /> 174 <field field_ref="wsnow_lic" level="10" /> 175 <field field_ref="wsnow_oce" level="10" /> 176 <field field_ref="wsnow_sic" level="10" /> 165 177 <field field_ref="cdrm" level="10" /> 166 178 <field field_ref="cdrh" level="10" /> … … 448 460 <field field_ref="upwd" level="10" /> 449 461 <field field_ref="ep" level="10" /> 462 <field field_ref="duphy" level="10" /> 450 463 <field field_ref="dtphy" level="10" /> 451 464 <field field_ref="dqphy" level="10" /> -
LMDZ5/branches/testing/DefLists/file_def_histdayCOSP_lmdz.xml
r2594 r2720 164 164 <field field_ref="c06_clmodis" level="1" axis_ref="pressure2" /> 165 165 <field field_ref="c07_clmodis" level="1" axis_ref="pressure2" /> 166 <field field_ref="c01_crimodis" level="1" axis_ref="ReffIce" /> 167 <field field_ref="c02_crimodis" level="1" axis_ref="ReffIce" /> 168 <field field_ref="c03_crimodis" level="1" axis_ref="ReffIce" /> 169 <field field_ref="c04_crimodis" level="1" axis_ref="ReffIce" /> 170 <field field_ref="c05_crimodis" level="1" axis_ref="ReffIce" /> 171 <field field_ref="c06_crimodis" level="1" axis_ref="ReffIce" /> 172 <field field_ref="c07_crimodis" level="1" axis_ref="ReffIce" /> 173 <field field_ref="c01_crlmodis" level="1" axis_ref="ReffLiq" /> 174 <field field_ref="c02_crlmodis" level="1" axis_ref="ReffLiq" /> 175 <field field_ref="c03_crlmodis" level="1" axis_ref="ReffLiq" /> 176 <field field_ref="c04_crlmodis" level="1" axis_ref="ReffLiq" /> 177 <field field_ref="c05_crlmodis" level="1" axis_ref="ReffLiq" /> 178 <field field_ref="c06_crlmodis" level="1" axis_ref="ReffLiq" /> 179 <field field_ref="c07_crlmodis" level="1" axis_ref="ReffLiq" /> 166 180 </field_group> 167 181 -
LMDZ5/branches/testing/DefLists/file_def_histday_lmdz.xml
r2594 r2720 163 163 <field field_ref="wbilo_oce" level="10" /> 164 164 <field field_ref="wbilo_sic" level="10" /> 165 <field field_ref="wevap_ter" level="10" /> 166 <field field_ref="wevap_lic" level="10" /> 167 <field field_ref="wevap_oce" level="10" /> 168 <field field_ref="wevap_sic" level="10" /> 169 <field field_ref="wrain_ter" level="10" /> 170 <field field_ref="wrain_lic" level="10" /> 171 <field field_ref="wrain_oce" level="10" /> 172 <field field_ref="wrain_sic" level="10" /> 173 <field field_ref="wsnow_ter" level="10" /> 174 <field field_ref="wsnow_lic" level="10" /> 175 <field field_ref="wsnow_oce" level="10" /> 176 <field field_ref="wsnow_sic" level="10" /> 165 177 <field field_ref="cdrm" level="10" /> 166 178 <field field_ref="cdrh" level="10" /> … … 448 460 <field field_ref="upwd" level="10" /> 449 461 <field field_ref="ep" level="10" /> 462 <field field_ref="duphy" level="10" /> 450 463 <field field_ref="dtphy" level="10" /> 451 464 <field field_ref="dqphy" level="10" /> -
LMDZ5/branches/testing/DefLists/file_def_histhfCOSP_lmdz.xml
r2594 r2720 164 164 <field field_ref="c06_clmodis" level="1" axis_ref="pressure2" /> 165 165 <field field_ref="c07_clmodis" level="1" axis_ref="pressure2" /> 166 <field field_ref="c01_crimodis" level="1" axis_ref="ReffIce" /> 167 <field field_ref="c02_crimodis" level="1" axis_ref="ReffIce" /> 168 <field field_ref="c03_crimodis" level="1" axis_ref="ReffIce" /> 169 <field field_ref="c04_crimodis" level="1" axis_ref="ReffIce" /> 170 <field field_ref="c05_crimodis" level="1" axis_ref="ReffIce" /> 171 <field field_ref="c06_crimodis" level="1" axis_ref="ReffIce" /> 172 <field field_ref="c07_crimodis" level="1" axis_ref="ReffIce" /> 173 <field field_ref="c01_crlmodis" level="1" axis_ref="ReffLiq" /> 174 <field field_ref="c02_crlmodis" level="1" axis_ref="ReffLiq" /> 175 <field field_ref="c03_crlmodis" level="1" axis_ref="ReffLiq" /> 176 <field field_ref="c04_crlmodis" level="1" axis_ref="ReffLiq" /> 177 <field field_ref="c05_crlmodis" level="1" axis_ref="ReffLiq" /> 178 <field field_ref="c06_crlmodis" level="1" axis_ref="ReffLiq" /> 179 <field field_ref="c07_crlmodis" level="1" axis_ref="ReffLiq" /> 166 180 </field_group> 167 181 -
LMDZ5/branches/testing/DefLists/file_def_histhf_lmdz.xml
r2594 r2720 163 163 <field field_ref="wbilo_oce" level="10" /> 164 164 <field field_ref="wbilo_sic" level="10" /> 165 <field field_ref="wevap_ter" level="10" /> 166 <field field_ref="wevap_lic" level="10" /> 167 <field field_ref="wevap_oce" level="10" /> 168 <field field_ref="wevap_sic" level="10" /> 169 <field field_ref="wrain_ter" level="10" /> 170 <field field_ref="wrain_lic" level="10" /> 171 <field field_ref="wrain_oce" level="10" /> 172 <field field_ref="wrain_sic" level="10" /> 173 <field field_ref="wsnow_ter" level="10" /> 174 <field field_ref="wsnow_lic" level="10" /> 175 <field field_ref="wsnow_oce" level="10" /> 176 <field field_ref="wsnow_sic" level="10" /> 165 177 <field field_ref="cdrm" level="10" /> 166 178 <field field_ref="cdrh" level="7" /> … … 478 490 <field field_ref="upwd" level="10" /> 479 491 <field field_ref="ep" level="10" /> 492 <field field_ref="duphy" level="10" /> 480 493 <field field_ref="dtphy" level="10" /> 481 494 <field field_ref="dqphy" level="10" /> -
LMDZ5/branches/testing/DefLists/file_def_histins_lmdz.xml
r2594 r2720 163 163 <field field_ref="wbilo_oce" level="10" /> 164 164 <field field_ref="wbilo_sic" level="10" /> 165 <field field_ref="wevap_ter" level="10" /> 166 <field field_ref="wevap_lic" level="10" /> 167 <field field_ref="wevap_oce" level="10" /> 168 <field field_ref="wevap_sic" level="10" /> 169 <field field_ref="wrain_ter" level="10" /> 170 <field field_ref="wrain_lic" level="10" /> 171 <field field_ref="wrain_oce" level="10" /> 172 <field field_ref="wrain_sic" level="10" /> 173 <field field_ref="wsnow_ter" level="10" /> 174 <field field_ref="wsnow_lic" level="10" /> 175 <field field_ref="wsnow_oce" level="10" /> 176 <field field_ref="wsnow_sic" level="10" /> 165 177 <field field_ref="cdrm" level="10" /> 166 178 <field field_ref="cdrh" level="10" /> … … 448 460 <field field_ref="upwd" level="10" /> 449 461 <field field_ref="ep" level="10" /> 462 <field field_ref="duphy" level="10" /> 450 463 <field field_ref="dtphy" level="10" /> 451 464 <field field_ref="dqphy" level="10" /> -
LMDZ5/branches/testing/DefLists/file_def_histmthCOSP_lmdz.xml
r2594 r2720 163 163 <field field_ref="c06_clmodis" level="1" axis_ref="pressure2" /> 164 164 <field field_ref="c07_clmodis" level="1" axis_ref="pressure2" /> 165 <field field_ref="c01_crimodis" level="1" axis_ref="ReffIce" /> 166 <field field_ref="c02_crimodis" level="1" axis_ref="ReffIce" /> 167 <field field_ref="c03_crimodis" level="1" axis_ref="ReffIce" /> 168 <field field_ref="c04_crimodis" level="1" axis_ref="ReffIce" /> 169 <field field_ref="c05_crimodis" level="1" axis_ref="ReffIce" /> 170 <field field_ref="c06_crimodis" level="1" axis_ref="ReffIce" /> 171 <field field_ref="c07_crimodis" level="1" axis_ref="ReffIce" /> 172 <field field_ref="c01_crlmodis" level="1" axis_ref="ReffLiq" /> 173 <field field_ref="c02_crlmodis" level="1" axis_ref="ReffLiq" /> 174 <field field_ref="c03_crlmodis" level="1" axis_ref="ReffLiq" /> 175 <field field_ref="c04_crlmodis" level="1" axis_ref="ReffLiq" /> 176 <field field_ref="c05_crlmodis" level="1" axis_ref="ReffLiq" /> 177 <field field_ref="c06_crlmodis" level="1" axis_ref="ReffLiq" /> 178 <field field_ref="c07_crlmodis" level="1" axis_ref="ReffLiq" /> 165 179 </field_group> 166 180 -
LMDZ5/branches/testing/DefLists/file_def_histmth_lmdz.xml
r2682 r2720 9 9 <!-- <field field_ref="Alt" level="1" /> --> 10 10 <!-- </field_group> --> 11 12 11 13 12 <field_group operation="instant" freq_op="30d"> … … 29 28 <field field_ref="CFC11_ppt" level="1" name="CFC11_ppt" /> 30 29 <field field_ref="CFC12_ppt" level="1" name="CFC12_ppt" /> 31 32 30 </field_group> 33 31 … … 185 183 <field field_ref="wbilo_oce" level="1" /> 186 184 <field field_ref="wbilo_sic" level="1" /> 185 <field field_ref="wevap_ter" level="1" /> 186 <field field_ref="wevap_lic" level="1" /> 187 <field field_ref="wevap_oce" level="1" /> 188 <field field_ref="wevap_sic" level="1" /> 189 <field field_ref="wrain_ter" level="1" /> 190 <field field_ref="wrain_lic" level="1" /> 191 <field field_ref="wrain_oce" level="1" /> 192 <field field_ref="wrain_sic" level="1" /> 193 <field field_ref="wsnow_ter" level="1" /> 194 <field field_ref="wsnow_lic" level="1" /> 195 <field field_ref="wsnow_oce" level="1" /> 196 <field field_ref="wsnow_sic" level="1" /> 187 197 <field field_ref="cdrm" level="1" /> 188 198 <field field_ref="cdrh" level="1" /> … … 325 335 <field field_ref="z0m" level="10" /> 326 336 <field field_ref="z0h" level="10" /> 327 <field field_ref="topswad" level=" 2" />328 <field field_ref="topswad0" level=" 2" />329 <field field_ref="topswai" level=" 2" />330 <field field_ref="solswad" level=" 2" />331 <field field_ref="solswad0" level=" 2" />332 <field field_ref="solswai" level=" 2" />337 <field field_ref="topswad" level="5" /> 338 <field field_ref="topswad0" level="5" /> 339 <field field_ref="topswai" level="5" /> 340 <field field_ref="solswad" level="5" /> 341 <field field_ref="solswad0" level="5" /> 342 <field field_ref="solswai" level="5" /> 333 343 <field field_ref="OD550_ASBCM" level="2" /> 334 344 <field field_ref="OD550_ASPOMM" level="2" /> … … 470 480 <field field_ref="upwd" level="2" /> 471 481 <field field_ref="ep" level="2" /> 482 <field field_ref="duphy" level="2" /> 472 483 <field field_ref="dtphy" level="2" /> 473 484 <field field_ref="dqphy" level="2" /> … … 588 599 <field field_ref="rldcs4co2" level="5" /> 589 600 </field_group> 601 602 <field_group group_ref="fields_strataer_3D" operation="average" freq_op="1ts" level="1" /> 603 <field_group group_ref="fields_strataer_2D" operation="average" freq_op="1ts" level="1" /> 604 <field_group group_ref="fields_strataer_trac_3D" operation="average" freq_op="1ts" level="1" /> 605 <field_group group_ref="fields_strataer_trac_2D" operation="average" freq_op="1ts" level="1" /> 606 590 607 </file> 591 608 592 609 </file_group> 593 610 </file_definition> 594 -
LMDZ5/branches/testing/DefLists/file_def_histstn_lmdz.xml
r2594 r2720 163 163 <field field_ref="wbilo_oce" level="10" /> 164 164 <field field_ref="wbilo_sic" level="10" /> 165 <field field_ref="wevap_ter" level="10" /> 166 <field field_ref="wevap_lic" level="10" /> 167 <field field_ref="wevap_oce" level="10" /> 168 <field field_ref="wevap_sic" level="10" /> 169 <field field_ref="wrain_ter" level="10" /> 170 <field field_ref="wrain_lic" level="10" /> 171 <field field_ref="wrain_oce" level="10" /> 172 <field field_ref="wrain_sic" level="10" /> 173 <field field_ref="wsnow_ter" level="10" /> 174 <field field_ref="wsnow_lic" level="10" /> 175 <field field_ref="wsnow_oce" level="10" /> 176 <field field_ref="wsnow_sic" level="10" /> 165 177 <field field_ref="cdrm" level="10" /> 166 178 <field field_ref="cdrh" level="10" /> … … 448 460 <field field_ref="upwd" level="10" /> 449 461 <field field_ref="ep" level="10" /> 462 <field field_ref="duphy" level="10" /> 450 463 <field field_ref="dtphy" level="10" /> 451 464 <field field_ref="dqphy" level="10" /> -
LMDZ5/branches/testing/DefLists/run.def
r2488 r2720 6 6 INCLUDEDEF=vert.def 7 7 INCLUDEDEF=physiq.def 8 INCLUDEDEF=convection.def9 8 INCLUDEDEF=orchidee.def 10 9 INCLUDEDEF=output.def -
LMDZ5/branches/testing/bld.cfg
r2641 r2720 29 29 src::rrtm %RRTM 30 30 src::dust %DUST 31 src::strataer %STRATAER 31 32 src::grid %SRC_PATH/grid 32 33 src::filtrez %FILTRE … … 108 109 bld::tool::SHELL /bin/bash 109 110 bld::tool::SHELL /bin/ksh 111 bld::tool::SHELL /bin/ksh -
LMDZ5/branches/testing/libf/dyn3d/conf_gcm.F90
r2641 r2720 18 18 USE logic_mod, ONLY: fxyhypb, iflag_phys, ok_etat0, ok_gradsfile, & 19 19 ok_guide, ok_limit, ok_strato, purmats, read_start, & 20 ysinus 20 ysinus, read_orop 21 21 USE serre_mod, ONLY: clon,clat,grossismx,grossismy,dzoomx,dzoomy, & 22 22 alphax,alphay,taux,tauy … … 854 854 CALL getin('ok_etat0',ok_etat0) 855 855 856 !Config Key = read_orop 857 !Config Desc = lecture du fichier de params orographiques sous maille 858 !Config Def = f 859 !Config Help = lecture fichier plutot que grid_noro 860 861 read_orop = .FALSE. 862 CALL getin('read_orop',read_orop) 863 856 864 write(lunout,*)' #########################################' 857 865 write(lunout,*)' Configuration des parametres de cel0' & … … 900 908 write(lunout,*)' ok_limit = ', ok_limit 901 909 write(lunout,*)' ok_etat0 = ', ok_etat0 910 write(lunout,*)' read_orop = ', read_orop 902 911 end IF test_etatinit 903 912 -
LMDZ5/branches/testing/libf/dyn3d/logic_mod.F90
r2641 r2720 25 25 LOGICAL ok_strato 26 26 LOGICAL ok_gradsfile 27 LOGICAL ok_limit 28 LOGICAL ok_etat0 27 LOGICAL ok_limit ! true for boundary conditions file creation (limit.nc) 28 LOGICAL ok_etat0 ! true for initial states creation (start.nc, startphy.nc) 29 LOGICAL read_orop ! true for sub-cell scales orographic params read in file 29 30 LOGICAL hybrid ! vertical coordinate is hybrid if true (sigma otherwise) 30 31 ! (only used if disvert_type==2) -
LMDZ5/branches/testing/libf/dyn3d_common/infotrac.F90
r2594 r2720 41 41 CHARACTER(len=8),DIMENSION(:),ALLOCATABLE, SAVE :: solsym 42 42 43 ! CRisi: cas particulier des isotopes 44 LOGICAL,SAVE :: ok_isotopes,ok_iso_verif,ok_isotrac,ok_init_iso 45 INTEGER :: niso_possibles 46 PARAMETER ( niso_possibles=5) 47 real, DIMENSION (niso_possibles),SAVE :: tnat,alpha_ideal 48 LOGICAL, DIMENSION(niso_possibles),SAVE :: use_iso 49 INTEGER, ALLOCATABLE, DIMENSION(:,:), SAVE :: iqiso ! donne indice iq en fn de (ixt,phase) 50 INTEGER, ALLOCATABLE, DIMENSION(:), SAVE :: iso_num ! donne numéro iso entre 1 et niso_possibles en fn de nqtot 51 INTEGER, ALLOCATABLE, DIMENSION(:), SAVE :: iso_indnum ! donne numéro iso entre 1 et niso effectif en fn de nqtot 52 INTEGER, ALLOCATABLE, DIMENSION(:), SAVE :: zone_num ! donne numéro de la zone de tracage en fn de nqtot 53 INTEGER, ALLOCATABLE, DIMENSION(:), SAVE :: phase_num ! donne numéro de la zone de tracage en fn de nqtot 54 INTEGER, DIMENSION(niso_possibles), SAVE :: indnum_fn_num ! donne indice entre entre 1 et niso en fonction du numéro d isotope entre 1 et niso_possibles 55 INTEGER, ALLOCATABLE, DIMENSION(:,:), SAVE :: index_trac ! numéro ixt en fn izone, indnum entre 1 et niso 56 INTEGER,SAVE :: niso,ntraceurs_zone,ntraciso 43 ! CRisi: cas particulier des isotopes 44 LOGICAL,SAVE :: ok_isotopes,ok_iso_verif,ok_isotrac,ok_init_iso 45 INTEGER :: niso_possibles 46 PARAMETER ( niso_possibles=5) 47 REAL, DIMENSION (niso_possibles),SAVE :: tnat,alpha_ideal 48 LOGICAL, DIMENSION(niso_possibles),SAVE :: use_iso 49 INTEGER, ALLOCATABLE, DIMENSION(:,:), SAVE :: iqiso ! donne indice iq en fn de (ixt,phase) 50 INTEGER, ALLOCATABLE, DIMENSION(:), SAVE :: iso_num ! donne numéro iso entre 1 et niso_possibles en fn de nqtot 51 INTEGER, ALLOCATABLE, DIMENSION(:), SAVE :: iso_indnum ! donne numéro iso entre 1 et niso effectif en fn de nqtot 52 INTEGER, ALLOCATABLE, DIMENSION(:), SAVE :: zone_num ! donne numéro de la zone de tracage en fn de nqtot 53 INTEGER, ALLOCATABLE, DIMENSION(:), SAVE :: phase_num ! donne numéro de la zone de tracage en fn de nqtot 54 INTEGER, DIMENSION(niso_possibles), SAVE :: indnum_fn_num ! donne indice entre entre 1 et niso en fonction du numéro d isotope entre 1 et niso_possibles 55 INTEGER, ALLOCATABLE, DIMENSION(:,:), SAVE :: index_trac ! numéro ixt en fn izone, indnum entre 1 et niso 56 INTEGER,SAVE :: niso,ntraceurs_zone,ntraciso 57 58 #ifdef CPP_StratAer 59 !--CK/OB for stratospheric aerosols 60 INTEGER, SAVE :: nbtr_bin 61 INTEGER, SAVE :: nbtr_sulgas 62 INTEGER, SAVE :: id_OCS_strat 63 INTEGER, SAVE :: id_SO2_strat 64 INTEGER, SAVE :: id_H2SO4_strat 65 INTEGER, SAVE :: id_BIN01_strat 66 INTEGER, SAVE :: id_TEST_strat 67 #endif 57 68 58 69 CONTAINS … … 141 152 CALL abort_gcm('infotrac_init','You must compile with cpp key REPROBUS',1) 142 153 #endif 154 ELSE IF (type_trac == 'coag') THEN 155 WRITE(lunout,*) 'Tracers are treated for COAGULATION tests : type_trac=', type_trac 156 #ifndef CPP_StratAer 157 WRITE(lunout,*) 'To run this option you must add cpp key StratAer and compile with StratAer code' 158 CALL abort_gcm('infotrac_init','You must compile with cpp key StratAer',1) 159 #endif 143 160 ELSE IF (type_trac == 'lmdz') THEN 144 161 WRITE(lunout,*) 'Tracers are treated in LMDZ only : type_trac=', type_trac … … 148 165 END IF 149 166 150 151 167 ! Test if config_inca is other then none for run without INCA 152 168 IF (type_trac/='inca' .AND. config_inca/='none') THEN … … 155 171 END IF 156 172 157 158 173 !----------------------------------------------------------------------- 159 174 ! … … 162 177 ! 163 178 !----------------------------------------------------------------------- 164 IF (type_trac == 'lmdz' .OR. type_trac == 'repr' ) THEN179 IF (type_trac == 'lmdz' .OR. type_trac == 'repr' .OR. type_trac == 'coag') THEN 165 180 OPEN(90,file='traceur.def',form='formatted',status='old', iostat=ierr) 166 181 IF(ierr.EQ.0) THEN … … 171 186 WRITE(lunout,*) trim(modname),': Problem in opening traceur.def' 172 187 WRITE(lunout,*) trim(modname),': WARNING using defaut values' 173 if (planet_type=='earth') then188 IF (planet_type=='earth') THEN 174 189 nqtrue=4 ! Default value for Earth 175 else190 ELSE 176 191 nqtrue=1 ! Default value for other planets 177 endif178 END 192 ENDIF 193 ENDIF 179 194 !jyg< 180 195 !! if ( planet_type=='earth') then … … 211 226 ALLOCATE(hadv_inca(nbtr), vadv_inca(nbtr)) 212 227 213 END 228 ENDIF ! type_trac 214 229 !>jyg 215 230 … … 266 281 ! Get choice of advection schema from file tracer.def or from INCA 267 282 !--------------------------------------------------------------------- 268 IF (type_trac == 'lmdz' .OR. type_trac == 'repr' ) THEN283 IF (type_trac == 'lmdz' .OR. type_trac == 'repr' .OR. type_trac == 'coag') THEN 269 284 IF(ierr.EQ.0) THEN 270 285 ! Continue to read tracer.def … … 346 361 END DO 347 362 348 if ( planet_type=='earth') then363 IF ( planet_type=='earth') THEN 349 364 !CR: nombre de traceurs de l eau 350 if (tnom_0(3) == 'H2Oi') then365 IF (tnom_0(3) == 'H2Oi') THEN 351 366 nqo=3 352 else367 ELSE 353 368 nqo=2 354 endif369 ENDIF 355 370 ! For Earth, water vapour & liquid tracers are not in the physics 356 371 nbtr=nqtrue-nqo 357 else372 ELSE 358 373 ! Other planets (for now); we have the same number of tracers 359 374 ! in the dynamics than in the physics 360 375 nbtr=nqtrue 361 endif 362 363 ENDIF ! (type_trac == 'lmdz' .OR. type_trac == 'repr') 376 ENDIF 377 378 #ifdef CPP_StratAer 379 IF (type_trac == 'coag') THEN 380 nbtr_bin=0 381 nbtr_sulgas=0 382 DO iq=1,nqtrue 383 IF (tnom_0(iq)(1:3)=='BIN') THEN !check if tracer name contains 'BIN' 384 nbtr_bin=nbtr_bin+1 385 ENDIF 386 IF (tnom_0(iq)(1:3)=='GAS') THEN !check if tracer name contains 'GAS' 387 nbtr_sulgas=nbtr_sulgas+1 388 ENDIF 389 ENDDO 390 print*,'nbtr_bin=',nbtr_bin 391 print*,'nbtr_sulgas=',nbtr_sulgas 392 DO iq=1,nqtrue 393 IF (tnom_0(iq)=='GASOCS') THEN 394 id_OCS_strat=iq-nqo 395 ENDIF 396 IF (tnom_0(iq)=='GASSO2') THEN 397 id_SO2_strat=iq-nqo 398 ENDIF 399 IF (tnom_0(iq)=='GASH2SO4') THEN 400 id_H2SO4_strat=iq-nqo 401 ENDIF 402 IF (tnom_0(iq)=='BIN01') THEN 403 id_BIN01_strat=iq-nqo 404 ENDIF 405 IF (tnom_0(iq)=='GASTEST') THEN 406 id_TEST_strat=iq-nqo 407 ENDIF 408 ENDDO 409 print*,'id_OCS_strat =',id_OCS_strat 410 print*,'id_SO2_strat =',id_SO2_strat 411 print*,'id_H2SO4_strat=',id_H2SO4_strat 412 print*,'id_BIN01_strat=',id_BIN01_strat 413 ENDIF 414 #endif 415 416 ENDIF ! (type_trac == 'lmdz' .OR. type_trac == 'repr' .OR. type_trac = 'coag') 364 417 !jyg< 365 418 ! -
LMDZ5/branches/testing/libf/dyn3dmem/conf_gcm.F90
r2641 r2720 22 22 USE logic_mod, ONLY: fxyhypb, iflag_phys, ok_etat0, ok_gradsfile, & 23 23 ok_guide, ok_limit, ok_strato, purmats, read_start, & 24 ysinus 24 ysinus, read_orop 25 25 USE serre_mod, ONLY: clon,clat,grossismx,grossismy,dzoomx,dzoomy, & 26 26 alphax,alphay,taux,tauy … … 929 929 CALL getin('ok_etat0',ok_etat0) 930 930 931 !Config Key = read_orop 932 !Config Desc = lecture du fichier de params orographiques sous maille 933 !Config Def = f 934 !Config Help = lecture fichier plutot que grid_noro 935 936 read_orop = .FALSE. 937 CALL getin('read_orop',read_orop) 938 931 939 write(lunout,*)' #########################################' 932 940 write(lunout,*)' Configuration des parametres de cel0' & … … 977 985 write(lunout,*)' ok_limit = ', ok_limit 978 986 write(lunout,*)' ok_etat0 = ', ok_etat0 987 write(lunout,*)' read_orop = ', read_orop 979 988 end IF test_etatinit 980 989 -
LMDZ5/branches/testing/libf/dyn3dmem/logic_mod.F90
r2641 r2720 25 25 LOGICAL ok_strato 26 26 LOGICAL ok_gradsfile 27 LOGICAL ok_limit 28 LOGICAL ok_etat0 27 LOGICAL ok_limit ! true for boundary conditions file creation (limit.nc) 28 LOGICAL ok_etat0 ! true for initial states creation (start.nc, startphy.nc) 29 LOGICAL read_orop ! true for sub-cell scales orographic params read in file 29 30 LOGICAL hybrid ! vertical coordinate is hybrid if true (sigma otherwise) 30 31 ! (only used if disvert_type==2) -
LMDZ5/branches/testing/libf/dyn3dpar/conf_gcm.F90
r2641 r2720 21 21 USE logic_mod, ONLY: fxyhypb, iflag_phys, ok_etat0, ok_gradsfile, & 22 22 ok_guide, ok_limit, ok_strato, purmats, read_start, & 23 ysinus 23 ysinus, read_orop 24 24 USE serre_mod, ONLY: clon,clat,grossismx,grossismy,dzoomx,dzoomy, & 25 25 alphax,alphay,taux,tauy … … 925 925 CALL getin('ok_etat0',ok_etat0) 926 926 927 !Config Key = read_orop 928 !Config Desc = lecture du fichier de params orographiques sous maille 929 !Config Def = f 930 !Config Help = lecture fichier plutot que grid_noro 931 932 read_orop = .FALSE. 933 CALL getin('read_orop',read_orop) 934 927 935 write(lunout,*)' #########################################' 928 936 write(lunout,*)' Configuration des parametres de cel0' & … … 973 981 write(lunout,*)' ok_limit = ', ok_limit 974 982 write(lunout,*)' ok_etat0 = ', ok_etat0 983 write(lunout,*)' read_orop = ', read_orop 975 984 end IF test_etatinit 976 985 -
LMDZ5/branches/testing/libf/dyn3dpar/logic_mod.F90
r2641 r2720 25 25 LOGICAL ok_strato 26 26 LOGICAL ok_gradsfile 27 LOGICAL ok_limit 28 LOGICAL ok_etat0 27 LOGICAL ok_limit ! true for boundary conditions file creation (limit.nc) 28 LOGICAL ok_etat0 ! true for initial states creation (start.nc, startphy.nc) 29 LOGICAL read_orop ! true for sub-cell scales orographic params read in file 29 30 LOGICAL hybrid ! vertical coordinate is hybrid if true (sigma otherwise) 30 31 ! (only used if disvert_type==2) -
LMDZ5/branches/testing/libf/dynphy_lonlat/phylmd/ce0l.F90
r2641 r2720 12 12 ! * "masque" can be: 13 13 ! - read from file "o2a.nc" (for coupled runs). 14 ! - read from file "startphy0.nc" (from a previous run). 14 15 ! - created in etat0phys or etat0dyn (for forced runs). 15 16 ! It is then passed to limit_netcdf to ensure consistancy. … … 20 21 USE etat0phys, ONLY: etat0phys_netcdf 21 22 USE limit, ONLY: limit_netcdf 22 USE netcdf, ONLY: NF90_OPEN, NF90_NOWRITE, NF90_CLOSE, NF90_NOERR 23 USE netcdf, ONLY: NF90_OPEN, NF90_NOWRITE, NF90_CLOSE, NF90_NOERR, & 24 NF90_INQUIRE_DIMENSION, NF90_INQ_DIMID, NF90_INQ_VARID, NF90_GET_VAR 23 25 USE infotrac, ONLY: type_trac, infotrac_init 24 26 USE dimphy, ONLY: klon … … 60 62 REAL, ALLOCATABLE :: lat_omask(:,:), dlat_omask(:), ocetmp (:,:) 61 63 REAL :: date, lev(1) 64 65 !--- Local variables for land mask from startphy0 file reading 66 INTEGER :: nid_sta, nid_nph, nid_msk, nphys 67 REAL, ALLOCATABLE :: masktmp(:) 68 62 69 #ifndef CPP_PARA 63 70 ! for iniphysiq in serial mode … … 133 140 ENDIF 134 141 135 !--- LAND MASK. T WOCASES:142 !--- LAND MASK. THREE CASES: 136 143 ! 1) read from ocean model file "o2a.nc" (coupled runs) 137 ! 2) computed from topography file "Relief.nc" (masque(:,:)=-99999.) 138 ! Coupled simulations (case 1) use the ocean model mask to compute the 144 ! 2) read from previous run file="startphy0.nc" 145 ! 3) computed from topography file "Relief.nc" (masque(:,:)=-99999.) 146 ! In the first case, the mask from the ocean model is used compute the 139 147 ! weights to ensure ocean fractions are the same for atmosphere and ocean. 140 148 !******************************************************************************* 141 IF(NF90_OPEN("o2a.nc", NF90_NOWRITE, nid_o2a)/=NF90_NOERR) THEN 142 WRITE(lunout,*)'BEWARE !! No ocean mask "o2a.nc" file found' 143 WRITE(lunout,*)'Forced run.' 144 masque(:,:)=-99999. 145 ELSE 149 IF(NF90_OPEN("o2a.nc", NF90_NOWRITE, nid_o2a)==NF90_NOERR) THEN 146 150 iret=NF90_CLOSE(nid_o2a) 147 151 WRITE(lunout,*)'BEWARE !! Ocean mask "o2a.nc" file found' … … 175 179 masque(iip1 ,:)=masque(1,:) 176 180 DEALLOCATE(ocemask) 181 ELSE IF(NF90_OPEN("startphy0.nc", NF90_NOWRITE, nid_sta)==NF90_NOERR) THEN 182 WRITE(lunout,*)'BEWARE !! File "startphy0.nc" found.' 183 WRITE(lunout,*)'Getting the land mask from a previous run.' 184 iret=NF90_INQ_DIMID(nid_sta,'points_physiques',nid_nph) 185 iret=NF90_INQUIRE_DIMENSION(nid_sta,nid_nph,len=nphys) 186 IF(nphys/=klon) THEN 187 WRITE(lunout,*)'Mismatching dimensions for land mask' 188 WRITE(lunout,*)'nphys = ',nphys ,' klon = ',klon 189 iret=NF90_CLOSE(nid_sta) 190 CALL abort_gcm(modname,'',1) 191 END IF 192 ALLOCATE(masktmp(klon)) 193 iret=NF90_INQ_VARID(nid_sta,'masque',nid_msk) 194 iret=NF90_GET_VAR(nid_sta,nid_msk,masktmp) 195 iret=NF90_CLOSE(nid_sta) 196 CALL gr_fi_dyn(1,klon,iip1,jjp1,masktmp,masque) 197 IF(prt_level>=1) THEN 198 WRITE(fmt,"(i4,'i1)')")iip1 ; fmt='('//ADJUSTL(fmt) 199 WRITE(lunout,*)'LAND MASK :' 200 WRITE(lunout,fmt) NINT(masque) 201 END IF 202 DEALLOCATE(masktmp) 203 ELSE 204 WRITE(lunout,*)'BEWARE !! No ocean mask "o2a.nc" file or "startphy0.nc" file found' 205 WRITE(lunout,*)'Land mask will be built from the topography file.' 206 masque(:,:)=-99999. 177 207 END IF 178 208 phis(:,:)=-99999. -
LMDZ5/branches/testing/libf/dynphy_lonlat/phylmd/etat0dyn_netcdf.F90
r2641 r2720 38 38 USE comconst_mod, ONLY: pi, cpp, kappa 39 39 USE comvert_mod, ONLY: ap, bp, preff, pressure_exner 40 USE temps_mod, ONLY: annee_ref, day_ref, itau_dyn, itau_phy 40 USE temps_mod, ONLY: annee_ref, day_ref, itau_dyn, itau_phy, start_time 41 41 42 42 IMPLICIT NONE … … 172 172 CALL caldyn0( itau, uvent, vvent, tpot, psol, masse, pk, phis, & 173 173 phi, w, pbaru, pbarv, time+iday-dayref) 174 WRITE(lunout,*)'sortie caldyn0' 174 WRITE(lunout,*)'sortie caldyn0' 175 start_time = 0. 175 176 #ifdef CPP_PARA 176 177 CALL dynredem0_loc( "start.nc", dayref, phis) -
LMDZ5/branches/testing/libf/dynphy_lonlat/phylmd/etat0phys_netcdf.F90
r2669 r2720 59 59 INTEGER, SAVE :: iml_phys, jml_phys, llm_phys, ttm_phys, fid_phys 60 60 REAL, ALLOCATABLE, SAVE :: lon_phys(:,:), lat_phys(:,:), levphys_ini(:) 61 CHARACTER(LEN=256), PARAMETER :: oroparam="oro_params.nc" 61 62 CHARACTER(LEN=256), PARAMETER :: orofname="Relief.nc", orogvar="RELIEF" 62 63 CHARACTER(LEN=256), PARAMETER :: phyfname="ECPHY.nc", psrfvar="SP" … … 255 256 ! This routine launch grid_noro, which computes parameters for SSO scheme as 256 257 ! described in LOTT & MILLER (1997) and LOTT(1999). 258 ! In case the file oroparam is present and the key read_orop is activated, 259 ! grid_noro is bypassed and sub-cell parameters are read from the file. 257 260 !=============================================================================== 258 USE grid_noro_m, ONLY: grid_noro 261 USE grid_noro_m, ONLY: grid_noro, read_noro 262 USE logic_mod, ONLY: read_orop 259 263 IMPLICIT NONE 260 264 !------------------------------------------------------------------------------- … … 266 270 CHARACTER(LEN=256) :: modname 267 271 INTEGER :: fid, llm_tmp,ttm_tmp, iml,jml, iml_rel,jml_rel, itau(1) 272 INTEGER :: ierr 268 273 REAL :: lev(1), date, dt 269 274 REAL, ALLOCATABLE :: lon_rad(:), lon_ini(:), lon_rel(:,:), relief_hi(:,:) … … 306 311 ALLOCATE(zpic0(iml,jml),zval0(iml,jml)) !--- Peaks and valley heights 307 312 313 !--- READ SUB-CELL SCALES PARAMETERS FROM A FILE (AT RIGHT RESOLUTION) 314 OPEN(UNIT=66,FILE=oroparam,STATUS='OLD',IOSTAT=ierr) 315 IF(ierr==0.AND.read_orop) THEN 316 CLOSE(UNIT=66) 317 CALL read_noro(lon_in,lat_in,oroparam, & 318 phis,zmea0,zstd0,zsig0,zgam0,zthe0,zpic0,zval0,masque) 319 ELSE 308 320 !--- CALL OROGRAPHY MODULE TO COMPUTE FIELDS 309 CALL grid_noro(lon_rad,lat_rad,relief_hi,lon_in,lat_in,phis,zmea0,zstd0, & 310 zsig0,zgam0,zthe0,zpic0,zval0,masque) 321 CALL grid_noro(lon_rad,lat_rad,relief_hi,lon_in,lat_in, & 322 phis,zmea0,zstd0,zsig0,zgam0,zthe0,zpic0,zval0,masque) 323 END IF 311 324 phis = phis * 9.81 312 325 phis(iml,:) = phis(1,:) -
LMDZ5/branches/testing/libf/dynphy_lonlat/phylmd/limit_netcdf.F90
r2641 r2720 71 71 USE netcdf95, ONLY: nf95_def_var, nf95_put_att, nf95_put_var 72 72 USE comconst_mod, ONLY: pi 73 USE phys_cal_mod, ONLY: calend 73 74 IMPLICIT NONE 74 75 !------------------------------------------------------------------------------- … … 244 245 !--- Attributes creation 245 246 CALL ncerr(NF90_PUT_ATT(nid,id_tim, "title","Jour dans l annee"),fnam) 247 CALL ncerr(NF90_PUT_ATT(nid,id_tim, "calendar",calend),fnam) 246 248 CALL ncerr(NF90_PUT_ATT(nid,id_FOCE,"title","Fraction ocean"),fnam) 247 249 CALL ncerr(NF90_PUT_ATT(nid,id_FSIC,"title","Fraction glace de mer"),fnam) … … 405 407 CASE('SIC', 'SST'); cal_in='gregorian' 406 408 END SELECT 407 CALL msg(5,'WARNING: missing "calendar" attribute for "time" in '&409 CALL msg(5,'WARNING: missing "calendar" attribute for "time" in '& 408 410 &//TRIM(fnam)//'. Choosing default value.') 409 411 END IF 412 CALL strclean(cal_in) !--- REMOVE (WEIRD) NULL CHARACTERS 410 413 CALL msg(5,'var, calendar, dim: '//TRIM(dnam)//' '//TRIM(cal_in), lmdep) 411 414 … … 477 480 fnam_p=fnam(1:idx)//'_p.nc' 478 481 IF(NF90_OPEN(fnam_p,NF90_NOWRITE,ncid)==NF90_NOERR) THEN 479 CALL msg(0,'Reading previousyear file ("'//TRIM(fnam_p)//'") first record for '//TRIM(title))482 CALL msg(0,'Reading next year file ("'//TRIM(fnam_p)//'") first record for '//TRIM(title)) 480 483 CALL ncerr(NF90_INQ_VARID(ncid, varname, varid),fnam_p) 481 484 CALL ncerr(NF90_GET_VAR(ncid,varid,champ,[1,1,1],[imdep,jmdep,1]),fnam_p) … … 767 770 !------------------------------------------------------------------------------- 768 771 772 773 !------------------------------------------------------------------------------- 774 ! 775 SUBROUTINE strclean(s) 776 ! 777 !------------------------------------------------------------------------------- 778 IMPLICIT NONE 779 !------------------------------------------------------------------------------- 780 ! Purpose: Remove tail null characters from the input string. 781 !------------------------------------------------------------------------------- 782 ! Parameters: 783 CHARACTER(LEN=*), INTENT(INOUT) :: s 784 !------------------------------------------------------------------------------- 785 ! Local variable: 786 INTEGER :: k 787 !------------------------------------------------------------------------------- 788 k=LEN_TRIM(s); DO WHILE(ICHAR(s(k:k))==0); s(k:k)=' '; k=LEN_TRIM(s); END DO 789 790 END SUBROUTINE strclean 791 ! 792 !------------------------------------------------------------------------------- 793 769 794 #endif 770 795 ! of #ifndef CPP_1D -
LMDZ5/branches/testing/libf/phylmd/acama_gwd_rando_m.F90
r2408 r2720 136 136 RUWFRT=gwd_front_ruwmax 137 137 SATFRT=gwd_front_sat 138 CMAX = 40. ! Characteristic phase speed138 CMAX = 50. ! Characteristic phase speed 139 139 ! Phase speed test 140 140 ! RUWFRT=0.01 … … 145 145 ! CRUCIAL PARAMETERS FOR THE WIND FILTERING 146 146 XLAUNCH=0.95 ! Parameter that control launching altitude 147 RDISS = 1! Diffusion parameter147 RDISS = 0.5 ! Diffusion parameter 148 148 149 149 ! maximum of rain for which our theory applies (in kg/m^2/s) … … 377 377 ! RESTORE DIMENSION OF A FLUX 378 378 ! *RD*TR/PR 379 *1. + RUW0(JW, :) 379 ! *1. + RUW0(JW, :) 380 *1. 380 381 381 382 ! Factor related to the characteristics of the waves: NONE … … 417 418 ! No breaking (Eq.6) 418 419 ! Dissipation (Eq. 8) 419 WWP(JW, :) = WWM(JW, :) * EXP(- 2. * RDISS * PR / (PH(:, LL + 1) &420 WWP(JW, :) = WWM(JW, :) * EXP(- 4. * RDISS * PR / (PH(:, LL + 1) & 420 421 + PH(:, LL)) * ((BV(:, LL + 1) + BV(:, LL)) / 2.)**3 & 421 422 / MAX(ABS(ZOP(JW, :) + ZOM(JW, :)) / 2., ZOISEC)**4 & -
LMDZ5/branches/testing/libf/phylmd/calwake.F90
r2641 r2720 71 71 REAL :: aire 72 72 REAL, DIMENSION(klon, klev) :: p, pi 73 REAL, DIMENSION(klon, klev+1) :: ph, omgbe 73 REAL, DIMENSION(klon, klev+1) :: ph 74 REAL, DIMENSION(klon, klev) :: omgbe 74 75 REAL, DIMENSION(klon, klev) :: te, qe 75 76 REAL, DIMENSION(klon, klev) :: dtdwn, dqdwn … … 81 82 REAL, DIMENSION(klon) :: hw, wape, fip, gfl 82 83 REAL, DIMENSION(klon) :: sigmaw, wdens 83 REAL, DIMENSION(klon, klev +1):: omgbdth84 REAL, DIMENSION(klon, klev) :: omgbdth 84 85 REAL, DIMENSION(klon, klev) :: dp_omgb 85 86 REAL, DIMENSION(klon, klev) :: dtke, dqke 86 REAL, DIMENSION(klon, klev +1):: omg87 REAL, DIMENSION(klon, klev) :: omg 87 88 REAL, DIMENSION(klon, klev) :: dp_deltomg, spread 88 89 REAL, DIMENSION(klon) :: cstar … … 122 123 END DO 123 124 END DO 124 125 omgbe(:, klev+1) = 0.126 125 127 126 DO i = 1, klon -
LMDZ5/branches/testing/libf/phylmd/clesphys.h
r2594 r2720 13 13 LOGICAL ok_limitvrai 14 14 LOGICAL ok_all_xml 15 INTEGER nbapp_rad, iflag_con, iflag_ener_conserv15 INTEGER nbapp_rad, iflag_con, nbapp_cv, iflag_ener_conserv 16 16 REAL co2_ppm, co2_ppm0, solaire 17 17 LOGICAL ok_suntime_rrtm … … 113 113 & , top_height & 114 114 & , cycle_diurne, soil_model, new_oliq & 115 & , ok_orodr, ok_orolf, ok_limitvrai, nbapp_rad, iflag_con & 115 & , ok_orodr, ok_orolf, ok_limitvrai, nbapp_rad & 116 & , iflag_con, nbapp_cv & 116 117 & , iflag_ener_conserv & 117 118 & , ok_4xCO2atm & -
LMDZ5/branches/testing/libf/phylmd/conf_phys_m.F90
r2669 r2720 4 4 ! 5 5 ! 6 moduleconf_phys_m7 8 implicit none9 10 contains 11 12 subroutineconf_phys(ok_journe, ok_mensuel, ok_instan, ok_hf, &6 MODULE conf_phys_m 7 8 IMPLICIT NONE 9 10 CONTAINS 11 12 SUBROUTINE conf_phys(ok_journe, ok_mensuel, ok_instan, ok_hf, & 13 13 ok_LES,& 14 14 callstats,& … … 23 23 alp_offset) 24 24 25 useIOIPSL25 USE IOIPSL 26 26 USE surface_data 27 27 USE phys_cal_mod 28 USE carbon_cycle_mod, ONLY: carbon_cycle_tr, carbon_cycle_cpl29 USE mod_grid_phy_lmdz, only: klon_glo28 USE carbon_cycle_mod, ONLY: carbon_cycle_tr, carbon_cycle_cpl 29 USE mod_grid_phy_lmdz, ONLY: klon_glo 30 30 USE print_control_mod, ONLY: lunout 31 32 31 33 32 include "conema3.h" … … 70 69 71 70 ! Sortie: 72 logical:: ok_newmicro73 integer:: iflag_radia74 logical:: ok_journe, ok_mensuel, ok_instan, ok_hf75 logical:: ok_LES71 LOGICAL :: ok_newmicro 72 INTEGER :: iflag_radia 73 LOGICAL :: ok_journe, ok_mensuel, ok_instan, ok_hf 74 LOGICAL :: ok_LES 76 75 LOGICAL :: callstats 77 76 LOGICAL :: ok_ade, ok_aie, ok_cdnc, aerosol_couple … … 81 80 LOGICAL :: new_aod 82 81 REAL :: bl95_b0, bl95_b1 83 real:: fact_cldcon, facttemps,ratqsbas,ratqshaut,tau_ratqs84 integer:: iflag_cld_th85 integer:: iflag_ratqs86 87 character (len = 6),SAVE :: type_ocean_omp, version_ocean_omp, ocean_omp88 character(len = 10),SAVE :: type_veget_omp89 CHARACTER (len = 8),SAVE:: aer_type_omp90 logical,SAVE:: ok_snow_omp91 logical,SAVE:: ok_newmicro_omp92 logical,SAVE:: ok_all_xml_omp93 logical,SAVE:: ok_journe_omp, ok_mensuel_omp, ok_instan_omp, ok_hf_omp94 logical,SAVE:: ok_LES_omp95 LOGICAL, SAVE:: callstats_omp96 LOGICAL, SAVE:: ok_ade_omp, ok_aie_omp, ok_cdnc_omp, aerosol_couple_omp82 REAL :: fact_cldcon, facttemps,ratqsbas,ratqshaut,tau_ratqs 83 INTEGER :: iflag_cld_th 84 INTEGER :: iflag_ratqs 85 86 CHARACTER (len = 6), SAVE :: type_ocean_omp, version_ocean_omp, ocean_omp 87 CHARACTER (len = 10),SAVE :: type_veget_omp 88 CHARACTER (len = 8), SAVE :: aer_type_omp 89 LOGICAL, SAVE :: ok_snow_omp 90 LOGICAL, SAVE :: ok_newmicro_omp 91 LOGICAL, SAVE :: ok_all_xml_omp 92 LOGICAL, SAVE :: ok_journe_omp, ok_mensuel_omp, ok_instan_omp, ok_hf_omp 93 LOGICAL, SAVE :: ok_LES_omp 94 LOGICAL, SAVE :: callstats_omp 95 LOGICAL, SAVE :: ok_ade_omp, ok_aie_omp, ok_cdnc_omp, aerosol_couple_omp 97 96 INTEGER, SAVE :: flag_aerosol_omp 98 97 INTEGER, SAVE :: flag_aerosol_strat_omp … … 102 101 REAL,SAVE :: freq_ISCCP_omp, ecrit_ISCCP_omp 103 102 REAL,SAVE :: freq_COSP_omp, freq_AIRS_omp 104 real,SAVE :: fact_cldcon_omp, facttemps_omp,ratqsbas_omp105 real,SAVE :: tau_cld_cv_omp, coefw_cld_cv_omp106 integer,SAVE:: iflag_cld_cv_omp107 108 109 real,SAVE:: ratqshaut_omp110 real,SAVE:: tau_ratqs_omp103 REAL,SAVE :: fact_cldcon_omp, facttemps_omp,ratqsbas_omp 104 REAL,SAVE :: tau_cld_cv_omp, coefw_cld_cv_omp 105 INTEGER, SAVE :: iflag_cld_cv_omp 106 107 108 REAL, SAVE :: ratqshaut_omp 109 REAL, SAVE :: tau_ratqs_omp 111 110 REAL, SAVE :: t_coupl_omp 112 integer,SAVE:: iflag_radia_omp113 integer,SAVE:: iflag_rrtm_omp114 integer,SAVE:: iflag_albedo_omp !albedo SB115 logical,save:: ok_chlorophyll_omp ! albedo SB116 integer,SAVE:: NSW_omp117 integer,SAVE:: iflag_cld_th_omp, ip_ebil_phy_omp118 integer,SAVE:: iflag_ratqs_omp119 120 R eal,SAVE:: f_cdrag_ter_omp,f_cdrag_oce_omp121 R eal,SAVE:: f_rugoro_omp , z0min_omp122 R eal,SAVE:: z0m_seaice_omp,z0h_seaice_omp123 REAL, SAVE:: min_wind_speed_omp,f_gust_wk_omp,f_gust_bl_omp,f_qsat_oce_omp, f_z0qh_oce_omp124 INTEGER, SAVE:: iflag_gusts_omp,iflag_z0_oce_omp111 INTEGER, SAVE :: iflag_radia_omp 112 INTEGER, SAVE :: iflag_rrtm_omp 113 INTEGER, SAVE :: iflag_albedo_omp !albedo SB 114 LOGICAL, SAVE :: ok_chlorophyll_omp ! albedo SB 115 INTEGER, SAVE :: NSW_omp 116 INTEGER, SAVE :: iflag_cld_th_omp, ip_ebil_phy_omp 117 INTEGER, SAVE :: iflag_ratqs_omp 118 119 REAL, SAVE :: f_cdrag_ter_omp,f_cdrag_oce_omp 120 REAL, SAVE :: f_rugoro_omp , z0min_omp 121 REAL, SAVE :: z0m_seaice_omp,z0h_seaice_omp 122 REAL, SAVE :: min_wind_speed_omp,f_gust_wk_omp,f_gust_bl_omp,f_qsat_oce_omp, f_z0qh_oce_omp 123 INTEGER, SAVE :: iflag_gusts_omp,iflag_z0_oce_omp 125 124 126 125 ! Local 127 real:: zzz128 129 real:: seuil_inversion130 real,save:: seuil_inversion_omp131 132 integer,SAVE :: iflag_thermals_ed_omp,iflag_thermals_optflux_omp,iflag_thermals_closure_omp133 real, SAVE :: fact_thermals_ed_dz_omp134 integer,SAVE :: iflag_thermals_omp,nsplit_thermals_omp135 real,save:: tau_thermals_omp,alp_bl_k_omp126 REAL :: zzz 127 128 REAL :: seuil_inversion 129 REAL,SAVE :: seuil_inversion_omp 130 131 INTEGER,SAVE :: iflag_thermals_ed_omp,iflag_thermals_optflux_omp,iflag_thermals_closure_omp 132 REAL, SAVE :: fact_thermals_ed_dz_omp 133 INTEGER,SAVE :: iflag_thermals_omp,nsplit_thermals_omp 134 REAL,SAVE :: tau_thermals_omp,alp_bl_k_omp 136 135 ! nrlmd le 10/04/2012 137 integer,SAVE :: iflag_trig_bl_omp,iflag_clos_bl_omp138 integer,SAVE :: tau_trig_shallow_omp,tau_trig_deep_omp139 real,SAVE :: s_trig_omp136 INTEGER,SAVE :: iflag_trig_bl_omp,iflag_clos_bl_omp 137 INTEGER,SAVE :: tau_trig_shallow_omp,tau_trig_deep_omp 138 REAL,SAVE :: s_trig_omp 140 139 ! fin nrlmd le 10/04/2012 141 real:: alp_offset140 REAL :: alp_offset 142 141 REAL, SAVE :: alp_offset_omp 143 integer,SAVE :: iflag_coupl_omp,iflag_clos_omp,iflag_wake_omp144 integer,SAVE :: iflag_cvl_sigd_omp142 INTEGER,SAVE :: iflag_coupl_omp,iflag_clos_omp,iflag_wake_omp 143 INTEGER,SAVE :: iflag_cvl_sigd_omp 145 144 REAL, SAVE :: coef_clos_ls_omp 146 145 REAL, SAVE :: supcrit1_omp, supcrit2_omp 147 146 INTEGER, SAVE :: iflag_mix_omp 148 147 INTEGER, SAVE :: iflag_mix_adiab_omp 149 real, save:: scut_omp, qqa1_omp, qqa2_omp, gammas_omp, Fmax_omp, alphas_omp148 REAL, SAVE :: scut_omp, qqa1_omp, qqa2_omp, gammas_omp, Fmax_omp, alphas_omp 150 149 REAL, SAVE :: tmax_fonte_cv_omp 151 150 … … 187 186 INTEGER,SAVE :: iflag_pbl_split_omp 188 187 INTEGER,SAVE :: iflag_order2_sollw_omp 189 I nteger, save:: lev_histins_omp, lev_histLES_omp188 INTEGER, SAVE :: lev_histins_omp, lev_histLES_omp 190 189 INTEGER, SAVE :: lev_histdayNMC_omp 191 190 INTEGER, SAVE :: levout_histNMC_omp(3) … … 205 204 LOGICAL,SAVE :: ok_lic_melt_omp 206 205 ! 207 LOGICAL,SAVE :: cycle_diurne_omp,soil_model_omp,new_oliq_omp208 LOGICAL,SAVE :: ok_orodr_omp, ok_orolf_omp, ok_limitvrai_omp206 LOGICAL,SAVE :: cycle_diurne_omp,soil_model_omp,new_oliq_omp 207 LOGICAL,SAVE :: ok_orodr_omp, ok_orolf_omp, ok_limitvrai_omp 209 208 INTEGER, SAVE :: nbapp_rad_omp, iflag_con_omp 209 INTEGER, SAVE :: nbapp_cv_omp 210 210 INTEGER, SAVE :: iflag_ener_conserv_omp 211 211 LOGICAL, SAVE :: ok_conserv_q_omp 212 212 INTEGER, SAVE :: iflag_fisrtilp_qsat_omp 213 213 INTEGER, SAVE :: iflag_bergeron_omp 214 LOGICAL,SAVE :: ok_strato_omp215 LOGICAL,SAVE :: ok_hines_omp, ok_gwd_rando_omp216 real, SAVE:: gwd_rando_ruwmax_omp, gwd_rando_sat_omp217 real, SAVE:: gwd_front_ruwmax_omp, gwd_front_sat_omp218 real, save:: sso_gkdrag_omp,sso_grahil_omp,sso_grcrit_omp219 real, save:: sso_gfrcri_omp,sso_gkwake_omp,sso_gklift_omp220 LOGICAL,SAVE :: ok_qch4_omp221 LOGICAL,SAVE 222 LOGICAL,SAVE 223 224 integer, intent(out):: read_climoz ! read ozone climatology, OpenMP shared214 LOGICAL,SAVE :: ok_strato_omp 215 LOGICAL,SAVE :: ok_hines_omp, ok_gwd_rando_omp 216 REAL, SAVE :: gwd_rando_ruwmax_omp, gwd_rando_sat_omp 217 REAL, SAVE :: gwd_front_ruwmax_omp, gwd_front_sat_omp 218 REAL, SAVE :: sso_gkdrag_omp,sso_grahil_omp,sso_grcrit_omp 219 REAL, SAVE :: sso_gfrcri_omp,sso_gkwake_omp,sso_gklift_omp 220 LOGICAL,SAVE :: ok_qch4_omp 221 LOGICAL,SAVE :: carbon_cycle_tr_omp 222 LOGICAL,SAVE :: carbon_cycle_cpl_omp 223 224 INTEGER, INTENT(OUT):: read_climoz ! read ozone climatology, OpenMP shared 225 225 ! Allowed values are 0, 1 and 2 226 226 ! 0: do not read an ozone climatology … … 239 239 ! 240 240 type_ocean_omp = 'force ' 241 callgetin('type_ocean', type_ocean_omp)241 CALL getin('type_ocean', type_ocean_omp) 242 242 ! 243 243 !Config Key = version_ocean … … 247 247 ! 248 248 version_ocean_omp = 'xxxxxx' 249 callgetin('version_ocean', version_ocean_omp)249 CALL getin('version_ocean', version_ocean_omp) 250 250 251 251 !Config Key = OCEAN … … 255 255 ! 256 256 ocean_omp = 'yyyyyy' 257 callgetin('OCEAN', ocean_omp)257 CALL getin('OCEAN', ocean_omp) 258 258 IF (ocean_omp /= 'yyyyyy') THEN 259 259 WRITE(lunout,*)'ERROR! Old variable name OCEAN used in parmeter file.' … … 261 261 WRITE(lunout,*)'You have to update your parameter file physiq.def to succed running' 262 262 CALL abort_physic('conf_phys','Variable OCEAN no longer existing, use variable name type_ocean',1) 263 END 263 ENDIF 264 264 265 265 !Config Key = t_coupl … … 269 269 ! 270 270 t_coupl_omp = 86400. 271 callgetin('t_coupl', t_coupl_omp)271 CALL getin('t_coupl', t_coupl_omp) 272 272 IF (t_coupl_omp == 0) THEN 273 273 WRITE(lunout,*)'ERROR! Timestep of coupling between atmosphere and ocean' 274 274 WRITE(lunout,*)'cannot be zero.' 275 275 CALL abort_physic('conf_phys','t_coupl = 0.',1) 276 END 276 ENDIF 277 277 278 278 ! 279 279 !Config Key = ok_all_xml 280 280 !Config Desc = utiliser les xml pourles définitions des champs pour xios 281 !Config Def = . false.282 !Config Help = 283 ! 284 ok_all_xml_omp = . false.285 callgetin('ok_all_xml', ok_all_xml_omp)281 !Config Def = .FALSE. 282 !Config Help = 283 ! 284 ok_all_xml_omp = .FALSE. 285 CALL getin('ok_all_xml', ok_all_xml_omp) 286 286 ! 287 287 … … 289 289 !Config Key = VEGET 290 290 !Config Desc = Type de modele de vegetation 291 !Config Def = . false.291 !Config Def = .FALSE. 292 292 !Config Help = Type de modele de vegetation utilise 293 293 ! 294 294 type_veget_omp ='orchidee' 295 callgetin('VEGET', type_veget_omp)295 CALL getin('VEGET', type_veget_omp) 296 296 ! 297 297 … … 299 299 !Config Key = ok_snow 300 300 !Config Desc = Flag to activate snow model SISVAT 301 !Config Def = . false.302 ok_snow_omp = . false.303 callgetin('ok_snow', ok_snow_omp)301 !Config Def = .FALSE. 302 ok_snow_omp = .FALSE. 303 CALL getin('ok_snow', ok_snow_omp) 304 304 ! Martin 305 305 306 306 !Config Key = OK_journe 307 307 !Config Desc = Pour des sorties journalieres 308 !Config Def = . false.308 !Config Def = .FALSE. 309 309 !Config Help = Pour creer le fichier histday contenant les sorties 310 310 ! journalieres 311 311 ! 312 ok_journe_omp = . false.313 callgetin('OK_journe', ok_journe_omp)312 ok_journe_omp = .FALSE. 313 CALL getin('OK_journe', ok_journe_omp) 314 314 ! 315 315 !Config Key = ok_hf 316 316 !Config Desc = Pour des sorties haute frequence 317 !Config Def = . false.317 !Config Def = .FALSE. 318 318 !Config Help = Pour creer le fichier histhf contenant les sorties 319 319 ! haute frequence ( 3h ou 6h) 320 320 ! 321 ok_hf_omp = . false.322 callgetin('ok_hf', ok_hf_omp)321 ok_hf_omp = .FALSE. 322 CALL getin('ok_hf', ok_hf_omp) 323 323 ! 324 324 !Config Key = OK_mensuel 325 325 !Config Desc = Pour des sorties mensuelles 326 !Config Def = . true.326 !Config Def = .TRUE. 327 327 !Config Help = Pour creer le fichier histmth contenant les sorties 328 328 ! mensuelles 329 329 ! 330 ok_mensuel_omp = . true.331 callgetin('OK_mensuel', ok_mensuel_omp)330 ok_mensuel_omp = .TRUE. 331 CALL getin('OK_mensuel', ok_mensuel_omp) 332 332 ! 333 333 !Config Key = OK_instan 334 334 !Config Desc = Pour des sorties instantanees 335 !Config Def = . false.335 !Config Def = .FALSE. 336 336 !Config Help = Pour creer le fichier histins contenant les sorties 337 337 ! instantanees 338 338 ! 339 ok_instan_omp = . false.340 callgetin('OK_instan', ok_instan_omp)339 ok_instan_omp = .FALSE. 340 CALL getin('OK_instan', ok_instan_omp) 341 341 ! 342 342 !Config Key = ok_ade 343 343 !Config Desc = Aerosol direct effect or not? 344 !Config Def = . false.344 !Config Def = .FALSE. 345 345 !Config Help = Used in radlwsw.F 346 346 ! 347 ok_ade_omp = . false.348 callgetin('ok_ade', ok_ade_omp)347 ok_ade_omp = .FALSE. 348 CALL getin('ok_ade', ok_ade_omp) 349 349 350 350 ! 351 351 !Config Key = ok_aie 352 352 !Config Desc = Aerosol indirect effect or not? 353 !Config Def = . false.353 !Config Def = .FALSE. 354 354 !Config Help = Used in nuage.F and radlwsw.F 355 355 ! 356 ok_aie_omp = . false.357 callgetin('ok_aie', ok_aie_omp)356 ok_aie_omp = .FALSE. 357 CALL getin('ok_aie', ok_aie_omp) 358 358 359 359 ! 360 360 !Config Key = ok_cdnc 361 361 !Config Desc = ok cloud droplet number concentration 362 !Config Def = . false.362 !Config Def = .FALSE. 363 363 !Config Help = Used in newmicro.F 364 364 ! 365 ok_cdnc_omp = . false.366 callgetin('ok_cdnc', ok_cdnc_omp)365 ok_cdnc_omp = .FALSE. 366 CALL getin('ok_cdnc', ok_cdnc_omp) 367 367 ! 368 368 !Config Key = aerosol_couple 369 369 !Config Desc = read aerosol in file or calcul by inca 370 !Config Def = . false.370 !Config Def = .FALSE. 371 371 !Config Help = Used in physiq.F 372 372 ! 373 aerosol_couple_omp = . false.373 aerosol_couple_omp = .FALSE. 374 374 CALL getin('aerosol_couple',aerosol_couple_omp) 375 375 ! … … 410 410 !Config Help = Used in physiq.F / aeropt 411 411 ! 412 flag_bc_internal_mixture_omp = . false.412 flag_bc_internal_mixture_omp = .FALSE. 413 413 CALL getin('flag_bc_internal_mixture',flag_bc_internal_mixture_omp) 414 414 … … 416 416 !Config Key = new_aod 417 417 !Config Desc = which calcul of aeropt 418 !Config Def = false418 !Config Def = FALSE 419 419 !Config Help = Used in physiq.F 420 420 ! 421 new_aod_omp = . true.421 new_aod_omp = .TRUE. 422 422 CALL getin('new_aod',new_aod_omp) 423 423 … … 429 429 ! 430 430 aer_type_omp = 'scenario' 431 callgetin('aer_type', aer_type_omp)431 CALL getin('aer_type', aer_type_omp) 432 432 433 433 ! 434 434 !Config Key = bl95_b0 435 435 !Config Desc = Parameter in CDNC-maer link (Boucher&Lohmann 1995) 436 !Config Def = . false.436 !Config Def = .FALSE. 437 437 !Config Help = Used in nuage.F 438 438 ! 439 439 bl95_b0_omp = 2. 440 callgetin('bl95_b0', bl95_b0_omp)440 CALL getin('bl95_b0', bl95_b0_omp) 441 441 442 442 !Config Key = bl95_b1 443 443 !Config Desc = Parameter in CDNC-maer link (Boucher&Lohmann 1995) 444 !Config Def = . false.444 !Config Def = .FALSE. 445 445 !Config Help = Used in nuage.F 446 446 ! 447 447 bl95_b1_omp = 0.2 448 callgetin('bl95_b1', bl95_b1_omp)448 CALL getin('bl95_b1', bl95_b1_omp) 449 449 450 450 !Config Key = freq_ISCCP … … 455 455 ! 456 456 freq_ISCCP_omp = 10800. 457 callgetin('freq_ISCCP', freq_ISCCP_omp)457 CALL getin('freq_ISCCP', freq_ISCCP_omp) 458 458 ! 459 459 !Config Key = ecrit_ISCCP … … 465 465 ! 466 466 ecrit_ISCCP_omp = 1. 467 callgetin('ecrit_ISCCP', ecrit_ISCCP_omp)467 CALL getin('ecrit_ISCCP', ecrit_ISCCP_omp) 468 468 469 469 !Config Key = freq_COSP … … 474 474 ! 475 475 freq_COSP_omp = 10800. 476 callgetin('freq_COSP', freq_COSP_omp)476 CALL getin('freq_COSP', freq_COSP_omp) 477 477 478 478 !Config Key = freq_AIRS … … 483 483 ! 484 484 freq_AIRS_omp = 10800. 485 callgetin('freq_AIRS', freq_AIRS_omp)485 CALL getin('freq_AIRS', freq_AIRS_omp) 486 486 487 487 ! … … 492 492 ! 493 493 ip_ebil_phy_omp = 0 494 call getin('ip_ebil_phy', ip_ebil_phy_omp) 494 CALL getin('ip_ebil_phy', ip_ebil_phy_omp) 495 IF (ip_ebil_phy_omp/=0) THEN 496 CALL abort_physic('conf_phys','ip_ebil_phy_omp doit etre 0 sur cette version',1) 497 ENDIF 498 495 499 ! 496 500 !Config Key = seuil_inversion … … 500 504 ! 501 505 seuil_inversion_omp = -0.1 502 callgetin('seuil_inversion', seuil_inversion_omp)506 CALL getin('seuil_inversion', seuil_inversion_omp) 503 507 504 508 ! … … 512 516 !valeur AMIP II 513 517 R_ecc_omp = 0.016715 514 callgetin('R_ecc', R_ecc_omp)518 CALL getin('R_ecc', R_ecc_omp) 515 519 ! 516 520 !Config Key = R_peri … … 522 526 !valeur AMIP II 523 527 R_peri_omp = 102.7 524 callgetin('R_peri', R_peri_omp)528 CALL getin('R_peri', R_peri_omp) 525 529 ! 526 530 !Config Key = R_incl … … 532 536 !valeur AMIP II 533 537 R_incl_omp = 23.441 534 callgetin('R_incl', R_incl_omp)538 CALL getin('R_incl', R_incl_omp) 535 539 ! 536 540 !Config Key = solaire … … 542 546 !valeur AMIP II 543 547 solaire_omp = 1365. 544 callgetin('solaire', solaire_omp)548 CALL getin('solaire', solaire_omp) 545 549 ! 546 550 !Config Key = ok_sun_time 547 551 !Config Desc = oui ou non variabilite solaire 548 !Config Def = . false.552 !Config Def = .FALSE. 549 553 !Config Help = 550 554 ! 551 555 ! 552 556 !valeur AMIP II 553 ok_suntime_rrtm_omp = . false.554 callgetin('ok_suntime_rrtm',ok_suntime_rrtm_omp)557 ok_suntime_rrtm_omp = .FALSE. 558 CALL getin('ok_suntime_rrtm',ok_suntime_rrtm_omp) 555 559 ! 556 560 !Config Key = co2_ppm … … 562 566 !valeur AMIP II 563 567 co2_ppm_omp = 348. 564 callgetin('co2_ppm', co2_ppm_omp)568 CALL getin('co2_ppm', co2_ppm_omp) 565 569 ! 566 570 !Config Key = RCO2 … … 574 578 RCO2_omp = co2_ppm_omp * 1.0e-06 * 44.011/28.97 ! pour co2_ppm=348. 575 579 576 ! callgetin('RCO2', RCO2)580 ! CALL getin('RCO2', RCO2) 577 581 ! 578 582 !Config Key = RCH4 … … 588 592 !ancienne valeur 589 593 ! RCH4 = 1.72E-06* 16.043/28.97 590 !OK callgetin('RCH4', RCH4)594 !OK CALL getin('RCH4', RCH4) 591 595 zzz = 1650. 592 callgetin('CH4_ppb', zzz)596 CALL getin('CH4_ppb', zzz) 593 597 CH4_ppb_omp = zzz 594 598 RCH4_omp = CH4_ppb_omp * 1.0E-09 * 16.043/28.97 … … 606 610 !ancienne valeur 607 611 ! RN2O = 310.E-09* 44.013/28.97 608 !OK callgetin('RN2O', RN2O)612 !OK CALL getin('RN2O', RN2O) 609 613 zzz=306. 610 callgetin('N2O_ppb', zzz)614 CALL getin('N2O_ppb', zzz) 611 615 N2O_ppb_omp = zzz 612 616 RN2O_omp = N2O_ppb_omp * 1.0E-09 * 44.013/28.97 … … 620 624 !OK RCFC11 = 280.E-12* 137.3686/28.97 621 625 zzz = 280. 622 callgetin('CFC11_ppt',zzz)626 CALL getin('CFC11_ppt',zzz) 623 627 CFC11_ppt_omp = zzz 624 628 RCFC11_omp=CFC11_ppt_omp* 1.0E-12 * 137.3686/28.97 625 629 ! RCFC11 = 1.327690990680013E-09 626 !OK callgetin('RCFC11', RCFC11)630 !OK CALL getin('RCFC11', RCFC11) 627 631 ! 628 632 !Config Key = RCFC12 … … 634 638 !OK RCFC12 = 484.E-12* 120.9140/28.97 635 639 zzz = 484. 636 callgetin('CFC12_ppt',zzz)640 CALL getin('CFC12_ppt',zzz) 637 641 CFC12_ppt_omp = zzz 638 642 RCFC12_omp = CFC12_ppt_omp * 1.0E-12 * 120.9140/28.97 639 643 ! RCFC12 = 2.020102726958923E-09 640 !OK callgetin('RCFC12', RCFC12)644 !OK CALL getin('RCFC12', RCFC12) 641 645 642 646 !ajout CFMIP begin … … 648 652 ! 649 653 co2_ppm_per_omp = co2_ppm_omp 650 callgetin('co2_ppm_per', co2_ppm_per_omp)654 CALL getin('co2_ppm_per', co2_ppm_per_omp) 651 655 ! 652 656 !Config Key = RCO2_per … … 660 664 !Config Key = ok_4xCO2atm 661 665 !Config Desc = Calcul ou non effet radiatif 4xco2 662 !Config Def = . false.663 !Config Help = 664 665 ok_4xCO2atm_omp = . false.666 callgetin('ok_4xCO2atm',ok_4xCO2atm_omp)666 !Config Def = .FALSE. 667 !Config Help = 668 669 ok_4xCO2atm_omp = .FALSE. 670 CALL getin('ok_4xCO2atm',ok_4xCO2atm_omp) 667 671 668 672 !Config Key = RCH4_per … … 672 676 ! 673 677 zzz = CH4_ppb_omp 674 callgetin('CH4_ppb_per', zzz)678 CALL getin('CH4_ppb_per', zzz) 675 679 CH4_ppb_per_omp = zzz 676 680 RCH4_per_omp = CH4_ppb_per_omp * 1.0E-09 * 16.043/28.97 … … 682 686 ! 683 687 zzz = N2O_ppb_omp 684 callgetin('N2O_ppb_per', zzz)688 CALL getin('N2O_ppb_per', zzz) 685 689 N2O_ppb_per_omp = zzz 686 690 RN2O_per_omp = N2O_ppb_per_omp * 1.0E-09 * 44.013/28.97 … … 692 696 ! 693 697 zzz = CFC11_ppt_omp 694 callgetin('CFC11_ppt_per',zzz)698 CALL getin('CFC11_ppt_per',zzz) 695 699 CFC11_ppt_per_omp = zzz 696 700 RCFC11_per_omp=CFC11_ppt_per_omp* 1.0E-12 * 137.3686/28.97 … … 702 706 ! 703 707 zzz = CFC12_ppt_omp 704 callgetin('CFC12_ppt_per',zzz)708 CALL getin('CFC12_ppt_per',zzz) 705 709 CFC12_ppt_per_omp = zzz 706 710 RCFC12_per_omp = CFC12_ppt_per_omp * 1.0E-12 * 120.9140/28.97 … … 778 782 CALL getin('iflag_con',iflag_con_omp) 779 783 784 !Config Key = nbapp_cv 785 !Config Desc = Frequence d'appel a la convection 786 !Config Def = 0 787 !Config Help = Nombre d'appels des routines de convection 788 !Config par jour. Si =0, appel a chaque pas de temps physique. 789 nbapp_cv_omp = 0 790 CALL getin('nbapp_cv',nbapp_cv_omp) 791 780 792 !Config Key = iflag_ener_conserv 781 793 !Config Desc = Flag de convection … … 851 863 ! 852 864 epmax_omp = .993 853 callgetin('epmax', epmax_omp)865 CALL getin('epmax', epmax_omp) 854 866 855 867 coef_epmax_cape_omp = 0.0 856 callgetin('coef_epmax_cape', coef_epmax_cape_omp)868 CALL getin('coef_epmax_cape', coef_epmax_cape_omp) 857 869 ! 858 870 !Config Key = ok_adj_ema 859 871 !Config Desc = 860 !Config Def = false861 !Config Help = 862 ! 863 ok_adj_ema_omp = . false.864 callgetin('ok_adj_ema',ok_adj_ema_omp)872 !Config Def = FALSE 873 !Config Help = 874 ! 875 ok_adj_ema_omp = .FALSE. 876 CALL getin('ok_adj_ema',ok_adj_ema_omp) 865 877 ! 866 878 !Config Key = iflag_clw … … 870 882 ! 871 883 iflag_clw_omp = 0 872 callgetin('iflag_clw',iflag_clw_omp)884 CALL getin('iflag_clw',iflag_clw_omp) 873 885 ! 874 886 !Config Key = cld_lc_lsc … … 878 890 ! 879 891 cld_lc_lsc_omp = 2.6e-4 880 callgetin('cld_lc_lsc',cld_lc_lsc_omp)892 CALL getin('cld_lc_lsc',cld_lc_lsc_omp) 881 893 ! 882 894 !Config Key = cld_lc_con … … 886 898 ! 887 899 cld_lc_con_omp = 2.6e-4 888 callgetin('cld_lc_con',cld_lc_con_omp)900 CALL getin('cld_lc_con',cld_lc_con_omp) 889 901 ! 890 902 !Config Key = cld_tau_lsc … … 894 906 ! 895 907 cld_tau_lsc_omp = 3600. 896 callgetin('cld_tau_lsc',cld_tau_lsc_omp)908 CALL getin('cld_tau_lsc',cld_tau_lsc_omp) 897 909 ! 898 910 !Config Key = cld_tau_con … … 902 914 ! 903 915 cld_tau_con_omp = 3600. 904 callgetin('cld_tau_con',cld_tau_con_omp)916 CALL getin('cld_tau_con',cld_tau_con_omp) 905 917 ! 906 918 !Config Key = ffallv_lsc … … 910 922 ! 911 923 ffallv_lsc_omp = 1. 912 callgetin('ffallv_lsc',ffallv_lsc_omp)924 CALL getin('ffallv_lsc',ffallv_lsc_omp) 913 925 ! 914 926 !Config Key = ffallv_con … … 918 930 ! 919 931 ffallv_con_omp = 1. 920 callgetin('ffallv_con',ffallv_con_omp)932 CALL getin('ffallv_con',ffallv_con_omp) 921 933 ! 922 934 !Config Key = coef_eva … … 926 938 ! 927 939 coef_eva_omp = 2.e-5 928 callgetin('coef_eva',coef_eva_omp)940 CALL getin('coef_eva',coef_eva_omp) 929 941 ! 930 942 !Config Key = reevap_ice 931 943 !Config Desc = 932 !Config Def = . false.933 !Config Help = 934 ! 935 reevap_ice_omp = . false.936 callgetin('reevap_ice',reevap_ice_omp)944 !Config Def = .FALSE. 945 !Config Help = 946 ! 947 reevap_ice_omp = .FALSE. 948 CALL getin('reevap_ice',reevap_ice_omp) 937 949 938 950 !Config Key = iflag_ratqs … … 942 954 ! 943 955 iflag_ratqs_omp = 1 944 callgetin('iflag_ratqs',iflag_ratqs_omp)956 CALL getin('iflag_ratqs',iflag_ratqs_omp) 945 957 946 958 ! … … 951 963 ! 952 964 iflag_radia_omp = 1 953 callgetin('iflag_radia',iflag_radia_omp)965 CALL getin('iflag_radia',iflag_radia_omp) 954 966 955 967 ! … … 960 972 ! 961 973 iflag_rrtm_omp = 0 962 callgetin('iflag_rrtm',iflag_rrtm_omp)974 CALL getin('iflag_rrtm',iflag_rrtm_omp) 963 975 964 976 ! … … 969 981 ! 970 982 NSW_omp = 2 971 callgetin('NSW',NSW_omp)983 CALL getin('NSW',NSW_omp) 972 984 !albedo SB >>> 973 985 iflag_albedo_omp = 0 974 callgetin('iflag_albedo',iflag_albedo_omp)975 976 ok_chlorophyll_omp=. false.977 callgetin('ok_chlorophyll',ok_chlorophyll_omp)986 CALL getin('iflag_albedo',iflag_albedo_omp) 987 988 ok_chlorophyll_omp=.FALSE. 989 CALL getin('ok_chlorophyll',ok_chlorophyll_omp) 978 990 !albedo SB <<< 979 991 … … 988 1000 ! pour assurer une retrocompatiblite. 989 1001 ! A abandonner un jour 990 callgetin('iflag_cldcon',iflag_cld_th_omp)991 callgetin('iflag_cld_th',iflag_cld_th_omp)1002 CALL getin('iflag_cldcon',iflag_cld_th_omp) 1003 CALL getin('iflag_cld_th',iflag_cld_th_omp) 992 1004 iflag_cld_cv_omp = 0 993 callgetin('iflag_cld_cv',iflag_cld_cv_omp)1005 CALL getin('iflag_cld_cv',iflag_cld_cv_omp) 994 1006 995 1007 ! … … 1000 1012 ! 1001 1013 tau_cld_cv_omp = 10. 1002 callgetin('tau_cld_cv',tau_cld_cv_omp)1014 CALL getin('tau_cld_cv',tau_cld_cv_omp) 1003 1015 1004 1016 ! … … 1009 1021 ! 1010 1022 coefw_cld_cv_omp = 0.1 1011 callgetin('coefw_cld_cv',coefw_cld_cv_omp)1023 CALL getin('coefw_cld_cv',coefw_cld_cv_omp) 1012 1024 1013 1025 … … 1021 1033 ! 1022 1034 iflag_pdf_omp = 0 1023 callgetin('iflag_pdf',iflag_pdf_omp)1035 CALL getin('iflag_pdf',iflag_pdf_omp) 1024 1036 ! 1025 1037 !Config Key = fact_cldcon … … 1029 1041 ! 1030 1042 fact_cldcon_omp = 0.375 1031 callgetin('fact_cldcon',fact_cldcon_omp)1043 CALL getin('fact_cldcon',fact_cldcon_omp) 1032 1044 1033 1045 ! … … 1038 1050 ! 1039 1051 facttemps_omp = 1.e-4 1040 callgetin('facttemps',facttemps_omp)1052 CALL getin('facttemps',facttemps_omp) 1041 1053 1042 1054 ! 1043 1055 !Config Key = ok_newmicro 1044 1056 !Config Desc = 1045 !Config Def = . true.1046 !Config Help = 1047 ! 1048 ok_newmicro_omp = . true.1049 callgetin('ok_newmicro',ok_newmicro_omp)1057 !Config Def = .TRUE. 1058 !Config Help = 1059 ! 1060 ok_newmicro_omp = .TRUE. 1061 CALL getin('ok_newmicro',ok_newmicro_omp) 1050 1062 ! 1051 1063 !Config Key = ratqsbas … … 1055 1067 ! 1056 1068 ratqsbas_omp = 0.01 1057 callgetin('ratqsbas',ratqsbas_omp)1069 CALL getin('ratqsbas',ratqsbas_omp) 1058 1070 ! 1059 1071 !Config Key = ratqshaut … … 1063 1075 ! 1064 1076 ratqshaut_omp = 0.3 1065 callgetin('ratqshaut',ratqshaut_omp)1077 CALL getin('ratqshaut',ratqshaut_omp) 1066 1078 1067 1079 !Config Key = tau_ratqs … … 1071 1083 ! 1072 1084 tau_ratqs_omp = 1800. 1073 callgetin('tau_ratqs',tau_ratqs_omp)1085 CALL getin('tau_ratqs',tau_ratqs_omp) 1074 1086 1075 1087 ! … … 1083 1095 ! 1084 1096 solarlong0_omp = -999.999 1085 callgetin('solarlong0',solarlong0_omp)1097 CALL getin('solarlong0',solarlong0_omp) 1086 1098 ! 1087 1099 !----------------------------------------------------------------------- … … 1090 1102 ! Default value -1 to activate the full computation 1091 1103 qsol0_omp = -1. 1092 callgetin('qsol0',qsol0_omp)1104 CALL getin('qsol0',qsol0_omp) 1093 1105 evap0_omp = -1. 1094 callgetin('evap0',evap0_omp)1106 CALL getin('evap0',evap0_omp) 1095 1107 albsno0_omp = -1. 1096 callgetin('albsno0',albsno0_omp)1108 CALL getin('albsno0',albsno0_omp) 1097 1109 ! 1098 1110 !----------------------------------------------------------------------- … … 1104 1116 ! 1105 1117 inertie_ice_omp = 2000. 1106 callgetin('inertie_ice',inertie_ice_omp)1118 CALL getin('inertie_ice',inertie_ice_omp) 1107 1119 ! 1108 1120 !Config Key = inertie_sno … … 1112 1124 ! 1113 1125 inertie_sno_omp = 2000. 1114 callgetin('inertie_sno',inertie_sno_omp)1126 CALL getin('inertie_sno',inertie_sno_omp) 1115 1127 ! 1116 1128 !Config Key = inertie_sol … … 1120 1132 ! 1121 1133 inertie_sol_omp = 2000. 1122 callgetin('inertie_sol',inertie_sol_omp)1134 CALL getin('inertie_sol',inertie_sol_omp) 1123 1135 1124 1136 ! … … 1129 1141 ! 1130 1142 rad_froid_omp = 35.0 1131 callgetin('rad_froid',rad_froid_omp)1143 CALL getin('rad_froid',rad_froid_omp) 1132 1144 1133 1145 ! … … 1138 1150 ! 1139 1151 rad_chau1_omp = 13.0 1140 callgetin('rad_chau1',rad_chau1_omp)1152 CALL getin('rad_chau1',rad_chau1_omp) 1141 1153 1142 1154 ! … … 1147 1159 ! 1148 1160 rad_chau2_omp = 9.0 1149 callgetin('rad_chau2',rad_chau2_omp)1161 CALL getin('rad_chau2',rad_chau2_omp) 1150 1162 1151 1163 ! … … 1156 1168 ! 1157 1169 t_glace_min_omp = 258. 1158 callgetin('t_glace_min',t_glace_min_omp)1170 CALL getin('t_glace_min',t_glace_min_omp) 1159 1171 1160 1172 ! … … 1165 1177 ! 1166 1178 t_glace_max_omp = 273.13 1167 callgetin('t_glace_max',t_glace_max_omp)1179 CALL getin('t_glace_max',t_glace_max_omp) 1168 1180 1169 1181 ! … … 1174 1186 ! 1175 1187 exposant_glace_omp = 1. 1176 callgetin('exposant_glace',exposant_glace_omp)1188 CALL getin('exposant_glace',exposant_glace_omp) 1177 1189 1178 1190 ! … … 1183 1195 ! 1184 1196 iflag_t_glace_omp = 0 1185 callgetin('iflag_t_glace',iflag_t_glace_omp)1197 CALL getin('iflag_t_glace',iflag_t_glace_omp) 1186 1198 1187 1199 ! … … 1192 1204 ! 1193 1205 iflag_cloudth_vert_omp = 0 1194 callgetin('iflag_cloudth_vert',iflag_cloudth_vert_omp)1206 CALL getin('iflag_cloudth_vert',iflag_cloudth_vert_omp) 1195 1207 1196 1208 ! … … 1201 1213 ! 1202 1214 iflag_ice_thermo_omp = 0 1203 callgetin('iflag_ice_thermo',iflag_ice_thermo_omp)1215 CALL getin('iflag_ice_thermo',iflag_ice_thermo_omp) 1204 1216 1205 1217 !Config Key = rei_min … … 1209 1221 ! 1210 1222 rei_min_omp = 3.5 1211 callgetin('rei_min',rei_min_omp)1223 CALL getin('rei_min',rei_min_omp) 1212 1224 1213 1225 ! … … 1218 1230 ! 1219 1231 rei_max_omp = 61.29 1220 callgetin('rei_max',rei_max_omp)1232 CALL getin('rei_max',rei_max_omp) 1221 1233 1222 1234 ! … … 1227 1239 ! 1228 1240 top_height_omp = 3 1229 callgetin('top_height',top_height_omp)1241 CALL getin('top_height',top_height_omp) 1230 1242 1231 1243 ! … … 1236 1248 ! 1237 1249 overlap_omp = 3 1238 call getin('overlap',overlap_omp) 1239 1240 1241 ! 1250 CALL getin('overlap',overlap_omp) 1251 1242 1252 ! 1243 1253 !Config Key = cdmmax … … 1247 1257 ! 1248 1258 cdmmax_omp = 1.3E-3 1249 callgetin('cdmmax',cdmmax_omp)1259 CALL getin('cdmmax',cdmmax_omp) 1250 1260 1251 1261 ! … … 1256 1266 ! 1257 1267 cdhmax_omp = 1.1E-3 1258 callgetin('cdhmax',cdhmax_omp)1268 CALL getin('cdhmax',cdhmax_omp) 1259 1269 1260 1270 !261103 … … 1266 1276 ! 1267 1277 ksta_omp = 1.0e-10 1268 callgetin('ksta',ksta_omp)1278 CALL getin('ksta',ksta_omp) 1269 1279 1270 1280 ! … … 1275 1285 ! 1276 1286 ksta_ter_omp = 1.0e-10 1277 callgetin('ksta_ter',ksta_ter_omp)1287 CALL getin('ksta_ter',ksta_ter_omp) 1278 1288 1279 1289 !Config Key = f_ri_cd_min … … 1283 1293 ! 1284 1294 f_ri_cd_min_omp = 0.1 1285 callgetin('f_ri_cd_min',f_ri_cd_min_omp)1295 CALL getin('f_ri_cd_min',f_ri_cd_min_omp) 1286 1296 1287 1297 ! 1288 1298 !Config Key = ok_kzmin 1289 1299 !Config Desc = 1290 !Config Def = . true.1291 !Config Help = 1292 ! 1293 ok_kzmin_omp = . true.1294 callgetin('ok_kzmin',ok_kzmin_omp)1300 !Config Def = .TRUE. 1301 !Config Help = 1302 ! 1303 ok_kzmin_omp = .TRUE. 1304 CALL getin('ok_kzmin',ok_kzmin_omp) 1295 1305 1296 1306 pbl_lmixmin_alpha_omp=0.0 1297 call getin('pbl_lmixmin_alpha',pbl_lmixmin_alpha_omp) 1298 1307 CALL getin('pbl_lmixmin_alpha',pbl_lmixmin_alpha_omp) 1299 1308 1300 1309 ! … … 1305 1314 ! 1306 1315 fmagic_omp = 1. 1307 callgetin('fmagic',fmagic_omp)1316 CALL getin('fmagic',fmagic_omp) 1308 1317 1309 1318 ! … … 1314 1323 ! 1315 1324 pmagic_omp = 0. 1316 callgetin('pmagic',pmagic_omp)1325 CALL getin('pmagic',pmagic_omp) 1317 1326 1318 1327 1319 1328 !Config Key = ok_lic_melt 1320 1329 !Config Desc = Prise en compte de la fonte de la calotte dans le bilan d'eau 1321 !Config Def = . false.1322 !Config Help = mettre a . false. pour assurer la conservation en eau1323 ok_lic_melt_omp = . false.1324 callgetin('ok_lic_melt', ok_lic_melt_omp)1330 !Config Def = .FALSE. 1331 !Config Help = mettre a .FALSE. pour assurer la conservation en eau 1332 ok_lic_melt_omp = .FALSE. 1333 CALL getin('ok_lic_melt', ok_lic_melt_omp) 1325 1334 1326 1335 ! … … 1334 1343 ! 1335 1344 iflag_pbl_omp = 1 1336 callgetin('iflag_pbl',iflag_pbl_omp)1345 CALL getin('iflag_pbl',iflag_pbl_omp) 1337 1346 ! 1338 1347 !Config Key = iflag_pbl_split … … 1342 1351 ! 1343 1352 iflag_pbl_split_omp = 0 1344 callgetin('iflag_pbl_split',iflag_pbl_split_omp)1353 CALL getin('iflag_pbl_split',iflag_pbl_split_omp) 1345 1354 ! 1346 1355 !Config Key = iflag_order2_sollw … … 1350 1359 ! 1351 1360 iflag_order2_sollw_omp = 0 1352 callgetin('iflag_order2_sollw',iflag_order2_sollw_omp)1361 CALL getin('iflag_order2_sollw',iflag_order2_sollw_omp) 1353 1362 ! 1354 1363 !Config Key = iflag_thermals … … 1358 1367 ! 1359 1368 iflag_thermals_omp = 0 1360 callgetin('iflag_thermals',iflag_thermals_omp)1369 CALL getin('iflag_thermals',iflag_thermals_omp) 1361 1370 ! 1362 1371 !Config Key = iflag_thermals_ed … … 1367 1376 fact_thermals_ed_dz_omp = 0.1 1368 1377 1369 callgetin('fact_thermals_ed_dz',fact_thermals_ed_dz_omp)1378 CALL getin('fact_thermals_ed_dz',fact_thermals_ed_dz_omp) 1370 1379 ! 1371 1380 ! … … 1376 1385 ! 1377 1386 iflag_thermals_ed_omp = 0 1378 callgetin('iflag_thermals_ed',iflag_thermals_ed_omp)1387 CALL getin('iflag_thermals_ed',iflag_thermals_ed_omp) 1379 1388 ! 1380 1389 ! … … 1385 1394 ! 1386 1395 iflag_thermals_optflux_omp = 0 1387 callgetin('iflag_thermals_optflux',iflag_thermals_optflux_omp)1396 CALL getin('iflag_thermals_optflux',iflag_thermals_optflux_omp) 1388 1397 ! 1389 1398 !Config Key = iflag_thermals_closure … … 1393 1402 ! 1394 1403 iflag_thermals_closure_omp = 1 1395 call getin('iflag_thermals_closure',iflag_thermals_closure_omp) 1396 ! 1397 ! 1398 ! 1404 CALL getin('iflag_thermals_closure',iflag_thermals_closure_omp) 1399 1405 ! 1400 1406 !Config Key = nsplit_thermals … … 1404 1410 ! 1405 1411 nsplit_thermals_omp = 1 1406 callgetin('nsplit_thermals',nsplit_thermals_omp)1412 CALL getin('nsplit_thermals',nsplit_thermals_omp) 1407 1413 1408 1414 !Config Key = alp_bl_k … … 1412 1418 ! 1413 1419 alp_bl_k_omp = 1. 1414 callgetin('alp_bl_k',alp_bl_k_omp)1420 CALL getin('alp_bl_k',alp_bl_k_omp) 1415 1421 1416 1422 ! nrlmd le 10/04/2012 … … 1422 1428 ! 1423 1429 iflag_trig_bl_omp = 0 1424 callgetin('iflag_trig_bl',iflag_trig_bl_omp)1430 CALL getin('iflag_trig_bl',iflag_trig_bl_omp) 1425 1431 1426 1432 !Config Key = s_trig_bl … … 1430 1436 ! 1431 1437 s_trig_omp = 2e7 1432 callgetin('s_trig',s_trig_omp)1438 CALL getin('s_trig',s_trig_omp) 1433 1439 1434 1440 !Config Key = tau_trig_shallow … … 1438 1444 ! 1439 1445 tau_trig_shallow_omp = 600 1440 callgetin('tau_trig_shallow',tau_trig_shallow_omp)1446 CALL getin('tau_trig_shallow',tau_trig_shallow_omp) 1441 1447 1442 1448 !Config Key = tau_trig_deep … … 1446 1452 ! 1447 1453 tau_trig_deep_omp = 1800 1448 callgetin('tau_trig_deep',tau_trig_deep_omp)1454 CALL getin('tau_trig_deep',tau_trig_deep_omp) 1449 1455 1450 1456 !Config Key = iflag_clos_bl … … 1454 1460 ! 1455 1461 iflag_clos_bl_omp = 0 1456 callgetin('iflag_clos_bl',iflag_clos_bl_omp)1462 CALL getin('iflag_clos_bl',iflag_clos_bl_omp) 1457 1463 1458 1464 ! fin nrlmd le 10/04/2012 … … 1465 1471 ! 1466 1472 tau_thermals_omp = 0. 1467 callgetin('tau_thermals',tau_thermals_omp)1473 CALL getin('tau_thermals',tau_thermals_omp) 1468 1474 1469 1475 ! … … 1474 1480 ! 1475 1481 iflag_coupl_omp = 0 1476 callgetin('iflag_coupl',iflag_coupl_omp)1482 CALL getin('iflag_coupl',iflag_coupl_omp) 1477 1483 1478 1484 ! … … 1483 1489 ! 1484 1490 iflag_clos_omp = 1 1485 callgetin('iflag_clos',iflag_clos_omp)1491 CALL getin('iflag_clos',iflag_clos_omp) 1486 1492 ! 1487 1493 !Config Key = coef_clos_ls … … 1491 1497 ! 1492 1498 coef_clos_ls_omp = 0. 1493 callgetin('coef_clos_ls',coef_clos_ls_omp)1499 CALL getin('coef_clos_ls',coef_clos_ls_omp) 1494 1500 1495 1501 ! … … 1500 1506 ! 1501 1507 iflag_cvl_sigd_omp = 0 1502 callgetin('iflag_cvl_sigd',iflag_cvl_sigd_omp)1508 CALL getin('iflag_cvl_sigd',iflag_cvl_sigd_omp) 1503 1509 1504 1510 !Config Key = iflag_wake … … 1508 1514 ! 1509 1515 iflag_wake_omp = 0 1510 callgetin('iflag_wake',iflag_wake_omp)1516 CALL getin('iflag_wake',iflag_wake_omp) 1511 1517 1512 1518 !Config Key = alp_offset … … 1516 1522 ! 1517 1523 alp_offset_omp = 0. 1518 callgetin('alp_offset',alp_offset_omp)1524 CALL getin('alp_offset',alp_offset_omp) 1519 1525 1520 1526 ! … … 1525 1531 ! 1526 1532 lev_histhf_omp = 1 1527 callgetin('lev_histhf',lev_histhf_omp)1533 CALL getin('lev_histhf',lev_histhf_omp) 1528 1534 1529 1535 ! … … 1534 1540 ! 1535 1541 lev_histday_omp = 1 1536 callgetin('lev_histday',lev_histday_omp)1542 CALL getin('lev_histday',lev_histday_omp) 1537 1543 1538 1544 ! … … 1543 1549 ! 1544 1550 lev_histmth_omp = 2 1545 callgetin('lev_histmth',lev_histmth_omp)1551 CALL getin('lev_histmth',lev_histmth_omp) 1546 1552 ! 1547 1553 !Config Key = lev_histins … … 1551 1557 ! 1552 1558 lev_histins_omp = 1 1553 callgetin('lev_histins',lev_histins_omp)1559 CALL getin('lev_histins',lev_histins_omp) 1554 1560 ! 1555 1561 !Config Key = lev_histLES … … 1559 1565 ! 1560 1566 lev_histLES_omp = 1 1561 callgetin('lev_histLES',lev_histLES_omp)1567 CALL getin('lev_histLES',lev_histLES_omp) 1562 1568 ! 1563 1569 !Config Key = lev_histdayNMC … … 1567 1573 ! 1568 1574 lev_histdayNMC_omp = 8 1569 callgetin('lev_histdayNMC',lev_histdayNMC_omp)1575 CALL getin('lev_histdayNMC',lev_histdayNMC_omp) 1570 1576 ! 1571 1577 !Config Key = levout_histNMC … … 1577 1583 levout_histNMC_omp(2) = 5 1578 1584 levout_histNMC_omp(3) = 5 1579 callgetin('levout_histNMC',levout_histNMC_omp)1585 CALL getin('levout_histNMC',levout_histNMC_omp) 1580 1586 ! 1581 1587 !histNMC BEG … … 1587 1593 !Config Help = 1588 1594 ! 1589 ok_histNMC_omp(1) = . false.1590 ok_histNMC_omp(2) = . false.1591 ok_histNMC_omp(3) = . false.1592 callgetin('ok_histNMC',ok_histNMC_omp)1595 ok_histNMC_omp(1) = .FALSE. 1596 ok_histNMC_omp(2) = .FALSE. 1597 ok_histNMC_omp(3) = .FALSE. 1598 CALL getin('ok_histNMC',ok_histNMC_omp) 1593 1599 ! 1594 1600 !Config Key = freq_outNMC … … 1602 1608 freq_outNMC_omp(2) = 1. 1603 1609 freq_outNMC_omp(3) = 1./4. 1604 callgetin('freq_outNMC',freq_outNMC_omp)1610 CALL getin('freq_outNMC',freq_outNMC_omp) 1605 1611 ! 1606 1612 !Config Key = freq_calNMC … … 1614 1620 freq_calNMC_omp(2) = pasphys 1615 1621 freq_calNMC_omp(3) = pasphys 1616 callgetin('freq_calNMC',freq_calNMC_omp)1622 CALL getin('freq_calNMC',freq_calNMC_omp) 1617 1623 ! 1618 1624 !Config Key = type_run … … 1622 1628 ! 1623 1629 type_run_omp = 'AMIP' 1624 callgetin('type_run',type_run_omp)1630 CALL getin('type_run',type_run_omp) 1625 1631 1626 1632 ! 1627 1633 !Config Key = ok_cosp 1628 1634 !Config Desc = 1629 !Config Def = . false.1630 !Config Help = 1631 ! 1632 ok_cosp_omp = . false.1633 callgetin('ok_cosp',ok_cosp_omp)1635 !Config Def = .FALSE. 1636 !Config Help = 1637 ! 1638 ok_cosp_omp = .FALSE. 1639 CALL getin('ok_cosp',ok_cosp_omp) 1634 1640 1635 1641 ! 1636 1642 !Config Key = ok_airs 1637 1643 !Config Desc = 1638 !Config Def = . false.1639 !Config Help = 1640 ! 1641 ok_airs_omp = . false.1642 callgetin('ok_airs',ok_airs_omp)1644 !Config Def = .FALSE. 1645 !Config Help = 1646 ! 1647 ok_airs_omp = .FALSE. 1648 CALL getin('ok_airs',ok_airs_omp) 1643 1649 1644 1650 ! 1645 1651 !Config Key = ok_mensuelCOSP 1646 1652 !Config Desc = 1647 !Config Def = . true.1648 !Config Help = 1649 ! 1650 ok_mensuelCOSP_omp = . true.1651 callgetin('ok_mensuelCOSP',ok_mensuelCOSP_omp)1653 !Config Def = .TRUE. 1654 !Config Help = 1655 ! 1656 ok_mensuelCOSP_omp = .TRUE. 1657 CALL getin('ok_mensuelCOSP',ok_mensuelCOSP_omp) 1652 1658 1653 1659 ! 1654 1660 !Config Key = ok_journeCOSP 1655 1661 !Config Desc = 1656 !Config Def = . true.1657 !Config Help = 1658 ! 1659 ok_journeCOSP_omp = . true.1660 callgetin('ok_journeCOSP',ok_journeCOSP_omp)1662 !Config Def = .TRUE. 1663 !Config Help = 1664 ! 1665 ok_journeCOSP_omp = .TRUE. 1666 CALL getin('ok_journeCOSP',ok_journeCOSP_omp) 1661 1667 1662 1668 ! 1663 1669 !Config Key = ok_hfCOSP 1664 1670 !Config Desc = 1665 !Config Def = . false.1666 !Config Help = 1667 ! 1668 ok_hfCOSP_omp = . false.1669 callgetin('ok_hfCOSP',ok_hfCOSP_omp)1671 !Config Def = .FALSE. 1672 !Config Help = 1673 ! 1674 ok_hfCOSP_omp = .FALSE. 1675 CALL getin('ok_hfCOSP',ok_hfCOSP_omp) 1670 1676 1671 1677 ! … … 1679 1685 ! 1680 1686 lonmin_ins_omp = 100. 1681 callgetin('lonmin_ins',lonmin_ins_omp)1687 CALL getin('lonmin_ins',lonmin_ins_omp) 1682 1688 ! 1683 1689 !Config Key = lonmax_ins … … 1687 1693 ! 1688 1694 lonmax_ins_omp = 130. 1689 callgetin('lonmax_ins',lonmax_ins_omp)1695 CALL getin('lonmax_ins',lonmax_ins_omp) 1690 1696 ! 1691 1697 !Config Key = latmin_ins … … 1695 1701 ! 1696 1702 latmin_ins_omp = -20. 1697 callgetin('latmin_ins',latmin_ins_omp)1703 CALL getin('latmin_ins',latmin_ins_omp) 1698 1704 ! 1699 1705 !Config Key = latmax_ins … … 1703 1709 ! 1704 1710 latmax_ins_omp = 20. 1705 callgetin('latmax_ins',latmax_ins_omp)1711 CALL getin('latmax_ins',latmax_ins_omp) 1706 1712 ! 1707 1713 !Config Key = ecrit_hf … … 1711 1717 ! 1712 1718 ecrit_hf_omp = 1./8. 1713 callgetin('ecrit_hf',ecrit_hf_omp)1719 CALL getin('ecrit_hf',ecrit_hf_omp) 1714 1720 ! 1715 1721 !Config Key = ecrit_ins … … 1719 1725 ! 1720 1726 ecrit_ins_omp = 1./48. 1721 callgetin('ecrit_ins',ecrit_ins_omp)1727 CALL getin('ecrit_ins',ecrit_ins_omp) 1722 1728 ! 1723 1729 !Config Key = ecrit_day … … 1727 1733 ! 1728 1734 ecrit_day_omp = 1.0 1729 callgetin('ecrit_day',ecrit_day_omp)1735 CALL getin('ecrit_day',ecrit_day_omp) 1730 1736 ! 1731 1737 !Config Key = ecrit_mth … … 1735 1741 ! 1736 1742 ecrit_mth_omp = 30. 1737 callgetin('ecrit_mth',ecrit_mth_omp)1743 CALL getin('ecrit_mth',ecrit_mth_omp) 1738 1744 ! 1739 1745 !Config Key = ecrit_tra … … 1743 1749 ! 1744 1750 ecrit_tra_omp = 0. 1745 callgetin('ecrit_tra',ecrit_tra_omp)1751 CALL getin('ecrit_tra',ecrit_tra_omp) 1746 1752 ! 1747 1753 !Config Key = ecrit_reg … … 1751 1757 ! 1752 1758 ecrit_reg_omp = 0.25 !4 fois par jour 1753 callgetin('ecrit_reg',ecrit_reg_omp)1759 CALL getin('ecrit_reg',ecrit_reg_omp) 1754 1760 ! 1755 1761 ! … … 1759 1765 ! 1760 1766 f_cdrag_ter_omp = 0.8 1761 callgetin('f_cdrag_ter',f_cdrag_ter_omp)1767 CALL getin('f_cdrag_ter',f_cdrag_ter_omp) 1762 1768 ! 1763 1769 f_cdrag_oce_omp = 0.8 1764 callgetin('f_cdrag_oce',f_cdrag_oce_omp)1770 CALL getin('f_cdrag_oce',f_cdrag_oce_omp) 1765 1771 ! 1766 1772 1767 1773 ! Gustiness flags 1768 1774 f_z0qh_oce_omp = 1. 1769 callgetin('f_z0qh_oce',f_z0qh_oce_omp)1775 CALL getin('f_z0qh_oce',f_z0qh_oce_omp) 1770 1776 ! 1771 1777 f_qsat_oce_omp = 1. 1772 callgetin('f_qsat_oce',f_qsat_oce_omp)1778 CALL getin('f_qsat_oce',f_qsat_oce_omp) 1773 1779 ! 1774 1780 f_gust_bl_omp = 0. 1775 callgetin('f_gust_bl',f_gust_bl_omp)1781 CALL getin('f_gust_bl',f_gust_bl_omp) 1776 1782 ! 1777 1783 f_gust_wk_omp = 0. 1778 callgetin('f_gust_wk',f_gust_wk_omp)1784 CALL getin('f_gust_wk',f_gust_wk_omp) 1779 1785 ! 1780 1786 !Config Key = iflag_z0_oce … … 1784 1790 ! 1785 1791 iflag_z0_oce_omp=0 1786 callgetin('iflag_z0_oce',iflag_z0_oce_omp)1792 CALL getin('iflag_z0_oce',iflag_z0_oce_omp) 1787 1793 ! 1788 1794 iflag_gusts_omp=0 1789 callgetin('iflag_gusts',iflag_gusts_omp)1795 CALL getin('iflag_gusts',iflag_gusts_omp) 1790 1796 ! 1791 1797 min_wind_speed_omp = 1. 1792 callgetin('min_wind_speed',min_wind_speed_omp)1793 1794 z0m_seaice_omp = 0.002 ; callgetin('z0m_seaice',z0m_seaice_omp)1795 z0h_seaice_omp = 0.002 ; callgetin('z0h_seaice',z0h_seaice_omp)1798 CALL getin('min_wind_speed',min_wind_speed_omp) 1799 1800 z0m_seaice_omp = 0.002 ; CALL getin('z0m_seaice',z0m_seaice_omp) 1801 z0h_seaice_omp = 0.002 ; CALL getin('z0h_seaice',z0h_seaice_omp) 1796 1802 1797 1803 f_rugoro_omp = 0. 1798 callgetin('f_rugoro',f_rugoro_omp)1804 CALL getin('f_rugoro',f_rugoro_omp) 1799 1805 1800 1806 z0min_omp = 0.000015 1801 callgetin('z0min',z0min_omp)1807 CALL getin('z0min',z0min_omp) 1802 1808 1803 1809 … … 1810 1816 ! 1811 1817 supcrit1_omp = .540 1812 callgetin('supcrit1',supcrit1_omp)1818 CALL getin('supcrit1',supcrit1_omp) 1813 1819 1814 1820 ! … … 1819 1825 ! 1820 1826 supcrit2_omp = .600 1821 callgetin('supcrit2',supcrit2_omp)1827 CALL getin('supcrit2',supcrit2_omp) 1822 1828 1823 1829 ! … … 1834 1840 ! 1835 1841 iflag_mix_omp = 1 1836 callgetin('iflag_mix',iflag_mix_omp)1842 CALL getin('iflag_mix',iflag_mix_omp) 1837 1843 1838 1844 ! … … 1848 1854 ! 1849 1855 iflag_mix_adiab_omp = 0 1850 callgetin('iflag_mix_adiab',iflag_mix_adiab_omp)1856 CALL getin('iflag_mix_adiab',iflag_mix_adiab_omp) 1851 1857 1852 1858 ! … … 1857 1863 ! 1858 1864 scut_omp = 0.95 1859 callgetin('scut',scut_omp)1865 CALL getin('scut',scut_omp) 1860 1866 1861 1867 ! … … 1866 1872 ! 1867 1873 qqa1_omp = 1.0 1868 callgetin('qqa1',qqa1_omp)1874 CALL getin('qqa1',qqa1_omp) 1869 1875 1870 1876 ! … … 1875 1881 ! 1876 1882 qqa2_omp = 0.0 1877 callgetin('qqa2',qqa2_omp)1883 CALL getin('qqa2',qqa2_omp) 1878 1884 1879 1885 ! … … 1884 1890 ! 1885 1891 gammas_omp = 0.05 1886 callgetin('gammas',gammas_omp)1892 CALL getin('gammas',gammas_omp) 1887 1893 1888 1894 ! … … 1893 1899 ! 1894 1900 Fmax_omp = 0.65 1895 callgetin('Fmax',Fmax_omp)1901 CALL getin('Fmax',Fmax_omp) 1896 1902 1897 1903 ! … … 1902 1908 ! 1903 1909 tmax_fonte_cv_omp = 275.15 1904 callgetin('tmax_fonte_cv',tmax_fonte_cv_omp)1910 CALL getin('tmax_fonte_cv',tmax_fonte_cv_omp) 1905 1911 1906 1912 ! … … 1911 1917 ! 1912 1918 alphas_omp = -5. 1913 callgetin('alphas',alphas_omp)1919 CALL getin('alphas',alphas_omp) 1914 1920 1915 1921 !Config key = ok_strato … … 1986 1992 !Config Key = OK_LES 1987 1993 !Config Desc = Pour des sorties LES 1988 !Config Def = . false.1994 !Config Def = .FALSE. 1989 1995 !Config Help = Pour creer le fichier histLES contenant les sorties 1990 1996 ! LES 1991 1997 ! 1992 ok_LES_omp = . false.1993 callgetin('OK_LES', ok_LES_omp)1998 ok_LES_omp = .FALSE. 1999 CALL getin('OK_LES', ok_LES_omp) 1994 2000 1995 2001 !Config Key = callstats 1996 2002 !Config Desc = Pour des sorties callstats 1997 !Config Def = . false.2003 !Config Def = .FALSE. 1998 2004 !Config Help = Pour creer le fichier stats contenant les sorties 1999 2005 ! stats 2000 2006 ! 2001 callstats_omp = . false.2002 callgetin('callstats', callstats_omp)2007 callstats_omp = .FALSE. 2008 CALL getin('callstats', callstats_omp) 2003 2009 ! 2004 2010 !Config Key = ecrit_LES … … 2010 2016 ! 2011 2017 ecrit_LES_omp = 1./8. 2012 callgetin('ecrit_LES', ecrit_LES_omp)2018 CALL getin('ecrit_LES', ecrit_LES_omp) 2013 2019 ! 2014 2020 read_climoz = 0 ! default value 2015 callgetin('read_climoz', read_climoz)2021 CALL getin('read_climoz', read_climoz) 2016 2022 2017 2023 carbon_cycle_tr_omp=.FALSE. … … 2059 2065 nbapp_rad = nbapp_rad_omp 2060 2066 iflag_con = iflag_con_omp 2067 nbapp_cv = nbapp_cv_omp 2061 2068 iflag_ener_conserv = iflag_ener_conserv_omp 2062 2069 ok_conserv_q = ok_conserv_q_omp … … 2124 2131 t_coupl = t_coupl_omp 2125 2132 2126 ok_veget=. true.2133 ok_veget=.TRUE. 2127 2134 type_veget=type_veget_omp 2128 if (type_veget=='n' .or. type_veget=='bucket' .or. type_veget=='betaclim') & 2129 then 2130 ok_veget=.false. 2131 endif 2135 IF (type_veget=='n' .or. type_veget=='bucket' .or. type_veget=='betaclim') THEN 2136 ok_veget=.FALSE. 2137 ENDIF 2132 2138 ! Martin 2133 2139 ok_snow = ok_snow_omp … … 2226 2232 iflag_z0_oce=iflag_z0_oce_omp 2227 2233 2228 2229 2234 z0m_seaice=z0m_seaice_omp 2230 2235 z0h_seaice=z0h_seaice_omp … … 2270 2275 WRITE(lunout,*)' ERROR version_ocean=',version_ocean,' not valid in coupled configuration' 2271 2276 CALL abort_physic('conf_phys','version_ocean not valid',1) 2272 END 2277 ENDIF 2273 2278 2274 2279 IF (type_ocean=='slab' .AND. version_ocean=='xxxxxx') THEN … … 2278 2283 WRITE(lunout,*)' ERROR version_ocean=',version_ocean,' not valid with slab ocean' 2279 2284 CALL abort_physic('conf_phys','version_ocean not valid',1) 2280 END 2285 ENDIF 2281 2286 2282 2287 !--test on radiative scheme … … 2295 2300 CALL abort_physic('conf_phys','choice iflag_rrtm not valid',1) 2296 2301 ENDIF 2302 #ifdef CPP_StratAer 2303 IF (iflag_rrtm .NE. 1) THEN 2304 WRITE(lunout,*) ' ERROR iflag_rrtm<>1 but StratAer activated' 2305 CALL abort_physic('conf_phys','iflag_rrtm not valid for StratAer',1) 2306 ENDIF 2307 IF (NSW .NE. 6) THEN 2308 WRITE(lunout,*) ' ERROR NSW<>6 but StratAer activated' 2309 CALL abort_physic('conf_phys','NSW not valid for StratAer',1) 2310 ENDIF 2311 #endif 2297 2312 2298 2313 !--test on ocean surface albedo … … 2307 2322 IF ( flag_aerosol .EQ. 0 ) THEN 2308 2323 CALL abort_physic('conf_phys','flag_aerosol=0 not compatible avec ok_ade ou ok_aie=.TRUE.',1) 2309 END 2324 ENDIF 2310 2325 IF ( .NOT. new_aod .AND. flag_aerosol .NE. 1) THEN 2311 2326 CALL abort_physic('conf_phys','new_aod=.FALSE. not compatible avec flag_aerosol=1',1) 2312 END 2313 END 2327 ENDIF 2328 ENDIF 2314 2329 2315 2330 ! Flag_aerosol cannot be to zero if we are in coupled mode for aerosol … … 2384 2399 write(lunout,*)'nbapp_rad=',nbapp_rad 2385 2400 write(lunout,*)'iflag_con=',iflag_con 2401 write(lunout,*)'nbapp_cv=',nbapp_cv 2386 2402 write(lunout,*)'iflag_ener_conserv=',iflag_ener_conserv 2387 2403 write(lunout,*)'ok_conserv_q=',ok_conserv_q … … 2533 2549 !$OMP END MASTER 2534 2550 2535 return2536 2537 end subroutineconf_phys2538 2539 end moduleconf_phys_m2551 RETURN 2552 2553 END SUBROUTINE conf_phys 2554 2555 END MODULE conf_phys_m 2540 2556 ! 2541 2557 !################################################################# 2542 2558 ! 2543 2559 2544 subroutineconf_interface(tau_calv)2545 2546 useIOIPSL2560 SUBROUTINE conf_interface(tau_calv) 2561 2562 USE IOIPSL 2547 2563 USE print_control_mod, ONLY: lunout 2548 implicit none2564 IMPLICIT NONE 2549 2565 ! Configuration de l'interace atm/surf 2550 2566 ! … … 2562 2578 tau_calv_omp = 360.*10. 2563 2579 !$OMP MASTER 2564 callgetin('tau_calv',tau_calv_omp)2580 CALL getin('tau_calv',tau_calv_omp) 2565 2581 !$OMP END MASTER 2566 2582 !$OMP BARRIER … … 2574 2590 !$OMP END MASTER 2575 2591 2576 return2577 2578 end subroutineconf_interface2592 RETURN 2593 2594 END SUBROUTINE conf_interface -
LMDZ5/branches/testing/libf/phylmd/cosp/cosp_constants.F90
r2594 r2720 35 35 #include "cosp_defs.h" 36 36 MODULE MOD_COSP_CONSTANTS 37 38 use netcdf, only: nf90_fill_real39 37 IMPLICIT NONE 40 38 … … 54 52 ! Missing value 55 53 real,parameter :: R_UNDEF = -1.0E30 56 ! real,parameter :: R_UNDEF = nf90_fill_real57 54 58 55 ! Number of possible output variables 59 integer,parameter :: N_OUT_LIST = 6 360 integer,parameter :: N3D = 856 integer,parameter :: N_OUT_LIST = 65 57 integer,parameter :: N3D = 10 61 58 integer,parameter :: N2D = 14 62 59 integer,parameter :: N1D = 40 … … 108 105 -31.5,-28.5,-25.5,-22.5,-19.5,-16.5,-13.5,-10.5, -7.5, -4.5, & 109 106 -1.5, 1.5, 4.5, 7.5, 10.5, 13.5, 16.5, 19.5, 22.5, 25.5/) 110 real,parameter,dimension(2,LIDAR_NTEMP) :: LIDAR_PHASE_TEMP_BNDS=reshape(source=& 111 (/-273.15,-90.,-90.,-87.,-87.,-84.,-84.,-81.,-81.,-78., & 107 real,parameter,dimension(2,LIDAR_NTEMP) :: LIDAR_PHASE_TEMP_BNDS=reshape(source=(/-273.15,-90.,-90.,-87.,-87.,-84.,-84.,-81.,-81.,-78., & 112 108 -78.,-75.,-75.,-72.,-72.,-69.,-69.,-66.,-66.,-63., & 113 109 -63.,-60.,-60.,-57.,-57.,-54.,-54.,-51.,-51.,-48., & -
LMDZ5/branches/testing/libf/phylmd/cosp/cosp_modis_simulator.F90
r2435 r2720 2 2 ! Author: Robert Pincus, Cooperative Institute for Research in the Environmental Sciences 3 3 ! All rights reserved. 4 ! $Revision: 88 $, $Date: 2013-11-13 15:08:38 +0100 (mer. 13 nov.2013) $4 ! $Revision: 88 $, $Date: 2013-11-13 07:08:38 -0700 (Wed, 13 Nov 2013) $ 5 5 ! $URL: http://cfmip-obs-sim.googlecode.com/svn/stable/v1.4.0/cosp_modis_simulator.F90 $ 6 6 ! … … 65 65 ! 66 66 real, dimension(:, :, :), pointer :: Optical_Thickness_vs_Cloud_Top_Pressure 67 real, dimension(:, :, :), pointer :: Optical_Thickness_vs_ReffICE 68 real, dimension(:, :, :), pointer :: Optical_Thickness_vs_ReffLIQ 67 69 end type COSP_MODIS 68 70 … … 115 117 116 118 real, dimension(count(gridBox%sunlit(:) > 0), numModisTauBins, numModisPressureBins) :: & 117 jointHistogram 119 jointHistogram 120 real, dimension(count(gridBox%sunlit(:) > 0), numModisTauBins, numMODISReffIceBins) :: & 121 jointHistogram2 122 real, dimension(count(gridBox%sunlit(:) > 0), numModisTauBins, numMODISReffLiqBins) :: & 123 jointHistogram3 118 124 119 125 integer, dimension(count(gridBox%sunlit(:) > 0)) :: sunlit … … 214 220 retrievedPhase(i, :), retrievedCloudTopPressure(i, :), & 215 221 retrievedTau(i, :), retrievedSize(i, :)) 216 end do 217 call modis_L3_simulator(retrievedPhase, & 218 retrievedCloudTopPressure, & 219 retrievedTau, retrievedSize, & 220 cfTotal, cfLiquid, cfIce, & 221 cfHigh, cfMid, cfLow, & 222 meanTauTotal, meanTauLiquid, meanTauIce, & 223 meanLogTauTotal, meanLogTauLiquid, meanLogTauIce, & 224 meanSizeLiquid, meanSizeIce, & 225 meanCloudTopPressure, & 226 meanLiquidWaterPath, meanIceWaterPath, & 227 jointHistogram) 222 end do 223 224 ! DJS2015: Call L3 modis simulator used by cospv2.0 225 ! call modis_L3_simulator(retrievedPhase, & 226 ! retrievedCloudTopPressure, & 227 ! retrievedTau, retrievedSize, & 228 ! cfTotal, cfLiquid, cfIce, & 229 ! cfHigh, cfMid, cfLow, & 230 ! meanTauTotal, meanTauLiquid, meanTauIce, & 231 ! meanLogTauTotal, meanLogTauLiquid, meanLogTauIce, & 232 ! meanSizeLiquid, meanSizeIce, & 233 ! meanCloudTopPressure, & 234 ! meanLiquidWaterPath, meanIceWaterPath, & 235 ! jointHistogram) 236 call modis_column(nSunlit,nSubcols,retrievedPhase,retrievedCloudTopPressure, & 237 retrievedTau,retrievedSize,cfTotal,cfLiquid,cfIce,cfHigh, & 238 cfMid,cfLow,meanTauTotal,meanTauLiquid,meanTauIce, & 239 meanLogTauTotal,meanLogTauLiquid,meanLogTauIce, & 240 meanSizeLiquid,meanSizeIce,meanCloudTopPressure, & 241 meanLiquidWaterPath, meanIceWaterPath, & 242 jointHistogram,jointHistogram2,jointHistogram3) 243 ! DJS2015: END 244 228 245 ! 229 246 ! Copy results into COSP structure … … 254 271 255 272 modisSim%Optical_Thickness_vs_Cloud_Top_Pressure(sunlit(:), 2:numModisTauBins+1, :) = jointHistogram(:, :, :) 273 modisSim%Optical_Thickness_vs_ReffICE(sunlit(:),2:numModisTauBins+1,:) = jointHistogram2(:, :, :) 274 modisSim%Optical_Thickness_vs_ReffLIQ(sunlit(:),2:numModisTauBins+1,:) = jointHistogram3(:, :, :) 256 275 ! 257 276 ! Reorder pressure bins in joint histogram to go from surface to TOA 258 277 ! 259 modisSim%Optical_Thickness_vs_Cloud_Top_Pressure(:,:,:) = & 260 modisSim%Optical_Thickness_vs_Cloud_Top_Pressure(:, :, numModisPressureBins:1:-1) 278 modisSim%Optical_Thickness_vs_Cloud_Top_Pressure(:,:,:) = modisSim%Optical_Thickness_vs_Cloud_Top_Pressure(:, :, numModisPressureBins:1:-1) 261 279 if(nSunlit < nPoints) then 262 280 ! … … 288 306 289 307 modisSim%Optical_Thickness_vs_Cloud_Top_Pressure(notSunlit(:), :, :) = R_UNDEF 308 modisSim%Optical_Thickness_vs_ReffICE(notSunlit(:), :, :) = R_UNDEF 309 modisSim%Optical_Thickness_vs_ReffLIQ(notSunlit(:), :, :) = R_UNDEF 290 310 end if 291 311 else … … 318 338 319 339 modisSim%Optical_Thickness_vs_Cloud_Top_Pressure(:, :, :) = R_UNDEF 340 modisSim%Optical_Thickness_vs_ReffICE(:, :, :) = R_UNDEF 341 modisSim%Optical_Thickness_vs_ReffLIQ(:, :, :) = R_UNDEF 320 342 end if 321 343 … … 363 385 364 386 allocate(x%Optical_Thickness_vs_Cloud_Top_Pressure(nPoints, numModisTauBins+1, numModisPressureBins)) 387 allocate(x%Optical_Thickness_vs_ReffICE(nPoints, numModisTauBins+1, numModisReffIceBins)) 388 allocate(x%Optical_Thickness_vs_ReffLIQ(nPoints, numModisTauBins+1, numModisReffLiqBins)) 365 389 x%Optical_Thickness_vs_Cloud_Top_Pressure(:, :, :) = R_UNDEF 366 390 END SUBROUTINE CONSTRUCT_COSP_MODIS … … 400 424 401 425 if(associated(x%Optical_Thickness_vs_Cloud_Top_Pressure)) deallocate(x%Optical_Thickness_vs_Cloud_Top_Pressure ) 426 if(associated(x%Optical_Thickness_vs_ReffIce)) deallocate(x%Optical_Thickness_vs_ReffIce) 427 if(associated(x%Optical_Thickness_vs_ReffLiq)) deallocate(x%Optical_Thickness_vs_ReffLiq) 402 428 END SUBROUTINE FREE_COSP_MODIS 403 429 ! ----------------------------------------------------- … … 447 473 448 474 copy%Optical_Thickness_vs_Cloud_Top_Pressure(copy_start:copy_end, :, :) = & 449 orig%Optical_Thickness_vs_Cloud_Top_Pressure(orig_start:orig_end, :, :) 475 orig%Optical_Thickness_vs_Cloud_Top_Pressure(orig_start:orig_end, :, :) 476 copy%Optical_Thickness_vs_ReffIce(copy_start:copy_end, :, :) = & 477 orig%Optical_Thickness_vs_ReffIce(orig_start:orig_end, :, :) 478 copy%Optical_Thickness_vs_ReffLiq(copy_start:copy_end, :, :) = & 479 orig%Optical_Thickness_vs_ReffLiq(orig_start:orig_end, :, :) 480 450 481 END SUBROUTINE COSP_MODIS_CPSECTION 451 482 ! ----------------------------------------------------- -
LMDZ5/branches/testing/libf/phylmd/cosp/cosp_output_mod.F90
r2669 r2720 9 9 USE MOD_COSP_TYPES 10 10 use MOD_COSP_Modis_Simulator, only : cosp_modis 11 use mod_modis_sim, only : numMODISReffIceBins, reffICE_binCenters, & 12 numMODISReffLiqBins, reffLIQ_binCenters 11 13 12 14 ! cosp_output_mod … … 17 19 !$OMP THREADPRIVATE(cosp_outfilekeys, cosp_nidfiles) 18 20 INTEGER, DIMENSION(3), SAVE :: nhoricosp,nvert,nvertmcosp,nvertcol,nvertbze, & 19 nvertsratio,nvertisccp,nvertp,nverttemp,nvertmisr 21 nvertsratio,nvertisccp,nvertp,nverttemp,nvertmisr, & 22 nvertReffIce,nvertReffLiq 20 23 REAL, DIMENSION(3), SAVE :: zoutm_cosp 21 24 !$OMP THREADPRIVATE(nhoricosp, nvert,nvertmcosp,nvertcol,nvertsratio,nvertbze,nvertisccp,nvertp,zoutm_cosp,nverttemp,nvertmisr) 25 !$OMP THREADPRIVATE(nvertReffIce,nvertReffLiq) 22 26 REAL, SAVE :: zdtimemoy_cosp 23 27 !$OMP THREADPRIVATE(zdtimemoy_cosp) … … 176 180 TYPE(ctrl_outcosp), SAVE :: o_clmodis = ctrl_outcosp((/ .TRUE., .TRUE., .TRUE. /), & 177 181 "clmodis", "MODIS Cloud Area Fraction", "%", (/ ('', i=1, 3) /)) 182 TYPE(ctrl_outcosp), SAVE :: o_crimodis = ctrl_outcosp((/ .TRUE., .TRUE., .TRUE. /), & 183 "crimodis", "Optical_Thickness_vs_ReffIce from Modis", "%", (/ ('',i=1, 3) /)) 184 TYPE(ctrl_outcosp), SAVE :: o_crlmodis = ctrl_outcosp((/ .TRUE., .TRUE.,.TRUE. /), & 185 "crlmodis", "Optical_Thickness_vs_ReffLiq from Modis", "%", (/ ('',i=1, 3) /)) 178 186 179 187 ! Rttovs simulator … … 325 333 ! CALL wxios_add_vaxis("dbze", DBZE_BINS, dbze_ax) 326 334 ! CALL wxios_add_vaxis("scatratio", SR_BINS, sratio_ax) 335 CALL wxios_add_vaxis("ReffIce", numMODISReffIceBins, reffICE_binCenters) 336 CALL wxios_add_vaxis("ReffLiq", numMODISReffLiqBins, reffLIQ_binCenters) 337 327 338 #endif 328 339 … … 366 377 367 378 CALL histvert(cosp_nidfiles(iff),"cth16","altitude","m",MISR_N_CTH,MISR_CTH,nvertmisr(iff)) 379 380 CALL histvert(cosp_nidfiles(iff),"ReffIce","Effective_particle_size_Ice","microns",numMODISReffIceBins, reffICE_binCenters, & 381 nvertReffIce(iff)) 382 383 CALL histvert(cosp_nidfiles(iff),"ReffLiq","Effective_particle_size_Liq","microns",numMODISReffLiqBins, reffLIQ_binCenters, & 384 nvertReffLiq(iff)) 368 385 369 386 ! CALL histvert(cosp_nidfiles(iff),"dbze","equivalent_reflectivity_factor","dBZ",DBZE_BINS,dbze_ax,nvertbze(iff)) -
LMDZ5/branches/testing/libf/phylmd/cosp/cosp_output_write_mod.F90
r2594 r2720 372 372 endif 373 373 374 where(modis%Optical_Thickness_vs_ReffIce == R_UNDEF) & 375 modis%Optical_Thickness_vs_ReffIce = Cosp_fill_value 376 377 where(modis%Optical_Thickness_vs_ReffLiq == R_UNDEF) & 378 modis%Optical_Thickness_vs_ReffLiq = Cosp_fill_value 379 380 do icl=1,7 381 CALL histwrite3d_cosp(o_crimodis, & 382 modis%Optical_Thickness_vs_ReffIce(:,icl,:),nvertReffIce,icl) 383 CALL histwrite3d_cosp(o_crlmodis, & 384 modis%Optical_Thickness_vs_ReffLiq(:,icl,:),nvertReffLiq,icl) 385 enddo 386 374 387 IF(.NOT.cosp_varsdefined) THEN 375 388 !$OMP MASTER … … 521 534 ELSE IF (nvertsave.eq.nvertmisr(iff)) THEN 522 535 klevs=MISR_N_CTH 523 nam_axvert="cth16" 536 nam_axvert="cth16" 537 ELSE IF (nvertsave.eq.nvertReffIce(iff)) THEN 538 klevs= numMODISReffIceBins 539 nam_axvert="ReffIce" 540 ELSE IF (nvertsave.eq.nvertReffLiq(iff)) THEN 541 klevs= numMODISReffLiqBins 542 nam_axvert="ReffLiq" 524 543 ELSE 525 544 klevs=Nlevout -
LMDZ5/branches/testing/libf/phylmd/cosp/cosp_types.F90
r2435 r2720 51 51 Lcltmodis,Lclwmodis,Lclimodis,Lclhmodis,Lclmmodis,Lcllmodis,Ltautmodis,Ltauwmodis,Ltauimodis,Ltautlogmodis, & 52 52 Ltauwlogmodis,Ltauilogmodis,Lreffclwmodis,Lreffclimodis,Lpctmodis,Llwpmodis, & 53 Liwpmodis,Lclmodis 53 Liwpmodis,Lclmodis,Lcrimodis,Lcrlmodis 54 54 55 55 character(len=32) :: out_list(N_OUT_LIST) -
LMDZ5/branches/testing/libf/phylmd/cosp/modis_simulator.F90
r2435 r2720 2 2 ! Author: Robert Pincus, Cooperative Institute for Research in the Environmental Sciences 3 3 ! All rights reserved. 4 ! $Revision: 88 $, $Date: 2013-11-13 15:08:38 +0100 (mer. 13 nov.2013) $4 ! $Revision: 88 $, $Date: 2013-11-13 07:08:38 -0700 (Wed, 13 Nov 2013) $ 5 5 ! $URL: http://cfmip-obs-sim.googlecode.com/svn/stable/v1.4.0/MODIS_simulator/modis_simulator.F90 $ 6 6 ! … … 79 79 real, parameter :: re_water_min= 4., re_water_max= 30., re_ice_min= 5., re_ice_max= 90. 80 80 integer, parameter :: num_trial_res = 15 ! increase to make the linear pseudo-retrieval of size more accurate 81 logical, parameter :: use_two_re_iterations = .false. ! do two retrieval iterations? 82 81 ! DJS2015: Remove unused parameter 82 ! logical, parameter :: use_two_re_iterations = .false. ! do two retrieval iterations? 83 ! DJS2015 END 83 84 ! 84 85 ! Precompute near-IR optical params vs size for retrieval scheme … … 125 126 nominalPressureHistogramCenters = (nominalPressureHistogramBoundaries(1, :) + & 126 127 nominalPressureHistogramBoundaries(2, :) ) / 2. 128 ! DJS2015 START: Add bin descriptions for joint-histograms of partice-sizes and optical depth. This is 129 ! identical to what is done in COSPv.2.0.0 for histogram bin initialization. 130 integer :: j 131 integer,parameter :: & 132 numMODISReffLiqBins = 6, & ! Number of bins for tau/ReffLiq joint-histogram 133 numMODISReffIceBins = 6 ! Number of bins for tau/ReffICE joint-histogram 134 real,parameter,dimension(numMODISReffLiqBins+1) :: & 135 reffLIQ_binBounds = (/0., 8e-6, 1.0e-5, 1.3e-5, 1.5e-5, 2.0e-5, 3.0e-5/) 136 real,parameter,dimension(numMODISReffIceBins+1) :: & 137 reffICE_binBounds = (/0., 1.0e-5, 2.0e-5, 3.0e-5, 4.0e-5, 6.0e-5, 9.0e-5/) 138 real,parameter,dimension(2,numMODISReffIceBins) :: & 139 reffICE_binEdges = reshape(source=(/reffICE_binBounds(1),((reffICE_binBounds(k), & 140 l=1,2),k=2,numMODISReffIceBins),reffICE_binBounds(numMODISReffIceBins+1)/), & 141 shape = (/2,numMODISReffIceBins/)) 142 real,parameter,dimension(2,numMODISReffLiqBins) :: & 143 reffLIQ_binEdges = reshape(source=(/reffLIQ_binBounds(1),((reffLIQ_binBounds(k), & 144 l=1,2),k=2,numMODISReffLiqBins),reffLIQ_binBounds(numMODISReffIceBins+1)/), & 145 shape = (/2,numMODISReffLiqBins/)) 146 real,parameter,dimension(numMODISReffIceBins) :: & 147 reffICE_binCenters = (reffICE_binEdges(1,:)+reffICE_binEdges(2,:))/2. 148 real,parameter,dimension(numMODISReffLiqBins) :: & 149 reffLIQ_binCenters = (reffLIQ_binEdges(1,:)+reffLIQ_binEdges(2,:))/2. 150 ! DJS2015 END 151 127 152 ! ------------------------------ 128 153 ! There are two ways to call the MODIS simulator: … … 384 409 385 410 end subroutine modis_L2_simulator_oneTau 411 412 ! ######################################################################################## 413 subroutine modis_column(nPoints,nSubCols,phase, cloud_top_pressure, optical_thickness, particle_size, & 414 Cloud_Fraction_Total_Mean, Cloud_Fraction_Water_Mean, Cloud_Fraction_Ice_Mean, & 415 Cloud_Fraction_High_Mean, Cloud_Fraction_Mid_Mean, Cloud_Fraction_Low_Mean, & 416 Optical_Thickness_Total_Mean, Optical_Thickness_Water_Mean, Optical_Thickness_Ice_Mean, & 417 Optical_Thickness_Total_MeanLog10, Optical_Thickness_Water_MeanLog10, Optical_Thickness_Ice_MeanLog10,& 418 Cloud_Particle_Size_Water_Mean, Cloud_Particle_Size_Ice_Mean, Cloud_Top_Pressure_Total_Mean, & 419 Liquid_Water_Path_Mean, Ice_Water_Path_Mean, & 420 Optical_Thickness_vs_Cloud_Top_Pressure,Optical_Thickness_vs_ReffIce,Optical_Thickness_vs_ReffLiq) 421 422 ! INPUTS 423 integer,intent(in) :: & 424 nPoints, & ! Number of horizontal gridpoints 425 nSubCols ! Number of subcolumns 426 integer,intent(in), dimension(:,:) :: & 427 !ds integer,intent(in), dimension(nPoints, nSubCols) :: & 428 phase 429 real,intent(in),dimension(:,:) :: & 430 !ds real,intent(in),dimension(nPoints, nSubCols) :: & 431 cloud_top_pressure, & 432 optical_thickness, & 433 particle_size 434 435 ! OUTPUTS 436 real,intent(inout),dimension(:) :: & ! 437 !ds real,intent(inout),dimension(nPoints) :: & ! 438 Cloud_Fraction_Total_Mean, & ! 439 Cloud_Fraction_Water_Mean, & ! 440 Cloud_Fraction_Ice_Mean, & ! 441 Cloud_Fraction_High_Mean, & ! 442 Cloud_Fraction_Mid_Mean, & ! 443 Cloud_Fraction_Low_Mean, & ! 444 Optical_Thickness_Total_Mean, & ! 445 Optical_Thickness_Water_Mean, & ! 446 Optical_Thickness_Ice_Mean, & ! 447 Optical_Thickness_Total_MeanLog10, & ! 448 Optical_Thickness_Water_MeanLog10, & ! 449 Optical_Thickness_Ice_MeanLog10, & ! 450 Cloud_Particle_Size_Water_Mean, & ! 451 Cloud_Particle_Size_Ice_Mean, & ! 452 Cloud_Top_Pressure_Total_Mean, & ! 453 Liquid_Water_Path_Mean, & ! 454 Ice_Water_Path_Mean ! 455 real,intent(inout),dimension(:,:,:) :: & 456 !ds real,intent(inout),dimension(nPoints,numTauHistogramBins,numPressureHistogramBins) :: & 457 Optical_Thickness_vs_Cloud_Top_Pressure 458 real,intent(inout),dimension(:,:,:) :: & 459 !ds real,intent(inout),dimension(nPoints,numTauHistogramBins,numMODISReffIceBins) :: & 460 Optical_Thickness_vs_ReffIce 461 real,intent(inout),dimension(:,:,:) :: & 462 !ds real,intent(inout),dimension(nPoints,numTauHistogramBins,numMODISReffLiqBins) :: & 463 Optical_Thickness_vs_ReffLiq 464 465 ! LOCAL VARIABLES 466 real, parameter :: & 467 LWP_conversion = 2./3. * 1000. ! MKS units 468 integer :: i, j 469 logical, dimension(nPoints,nSubCols) :: & 470 cloudMask, & 471 waterCloudMask, & 472 iceCloudMask, & 473 validRetrievalMask 474 real,dimension(nPoints,nSubCols) :: & 475 tauWRK,ctpWRK,reffIceWRK,reffLiqWRK 476 477 ! ######################################################################################## 478 ! Include only those pixels with successful retrievals in the statistics 479 ! ######################################################################################## 480 validRetrievalMask(1:nPoints,1:nSubCols) = particle_size(1:nPoints,1:nSubCols) > 0. 481 cloudMask(1:nPoints,1:nSubCols) = phase(1:nPoints,1:nSubCols) /= phaseIsNone .and. & 482 validRetrievalMask(1:nPoints,1:nSubCols) 483 waterCloudMask(1:nPoints,1:nSubCols) = phase(1:nPoints,1:nSubCols) == phaseIsLiquid .and. & 484 validRetrievalMask(1:nPoints,1:nSubCols) 485 iceCloudMask(1:nPoints,1:nSubCols) = phase(1:nPoints,1:nSubCols) == phaseIsIce .and. & 486 validRetrievalMask(1:nPoints,1:nSubCols) 487 488 ! ######################################################################################## 489 ! Use these as pixel counts at first 490 ! ######################################################################################## 491 Cloud_Fraction_Total_Mean(1:nPoints) = real(count(cloudMask, dim = 2)) 492 Cloud_Fraction_Water_Mean(1:nPoints) = real(count(waterCloudMask, dim = 2)) 493 Cloud_Fraction_Ice_Mean(1:nPoints) = real(count(iceCloudMask, dim = 2)) 494 Cloud_Fraction_High_Mean(1:nPoints) = real(count(cloudMask .and. cloud_top_pressure <= & 495 highCloudPressureLimit, dim = 2)) 496 Cloud_Fraction_Low_Mean(1:nPoints) = real(count(cloudMask .and. cloud_top_pressure > & 497 lowCloudPressureLimit, dim = 2)) 498 Cloud_Fraction_Mid_Mean(1:nPoints) = Cloud_Fraction_Total_Mean(1:nPoints) - Cloud_Fraction_High_Mean(1:nPoints)& 499 - Cloud_Fraction_Low_Mean(1:nPoints) 500 501 ! ######################################################################################## 502 ! Compute mean optical thickness. 503 ! ######################################################################################## 504 Optical_Thickness_Total_Mean(1:nPoints) = sum(optical_thickness, mask = cloudMask, dim = 2) / & 505 Cloud_Fraction_Total_Mean(1:nPoints) 506 Optical_Thickness_Water_Mean(1:nPoints) = sum(optical_thickness, mask = waterCloudMask, dim = 2) / & 507 Cloud_Fraction_Water_Mean(1:nPoints) 508 Optical_Thickness_Ice_Mean(1:nPoints) = sum(optical_thickness, mask = iceCloudMask, dim = 2) / & 509 Cloud_Fraction_Ice_Mean(1:nPoints) 510 511 ! ######################################################################################## 512 ! We take the absolute value of optical thickness here to satisfy compilers that complains 513 ! when we evaluate the logarithm of a negative number, even though it's not included in 514 ! the sum. 515 ! ######################################################################################## 516 Optical_Thickness_Total_MeanLog10(1:nPoints) = sum(log10(abs(optical_thickness)), mask = cloudMask, & 517 dim = 2) / Cloud_Fraction_Total_Mean(1:nPoints) 518 Optical_Thickness_Water_MeanLog10(1:nPoints) = sum(log10(abs(optical_thickness)), mask = waterCloudMask,& 519 dim = 2) / Cloud_Fraction_Water_Mean(1:nPoints) 520 Optical_Thickness_Ice_MeanLog10(1:nPoints) = sum(log10(abs(optical_thickness)), mask = iceCloudMask,& 521 dim = 2) / Cloud_Fraction_Ice_Mean(1:nPoints) 522 Cloud_Particle_Size_Water_Mean(1:nPoints) = sum(particle_size, mask = waterCloudMask, dim = 2) / & 523 Cloud_Fraction_Water_Mean(1:nPoints) 524 Cloud_Particle_Size_Ice_Mean(1:nPoints) = sum(particle_size, mask = iceCloudMask, dim = 2) / & 525 Cloud_Fraction_Ice_Mean(1:nPoints) 526 Cloud_Top_Pressure_Total_Mean(1:nPoints) = sum(cloud_top_pressure, mask = cloudMask, dim = 2) / & 527 max(1, count(cloudMask, dim = 2)) 528 Liquid_Water_Path_Mean(1:nPoints) = LWP_conversion*sum(particle_size*optical_thickness, & 529 mask=waterCloudMask,dim=2)/Cloud_Fraction_Water_Mean(1:nPoints) 530 Ice_Water_Path_Mean(1:nPoints) = LWP_conversion * ice_density*sum(particle_size*optical_thickness,& 531 mask=iceCloudMask,dim = 2) /Cloud_Fraction_Ice_Mean(1:nPoints) 532 533 ! ######################################################################################## 534 ! Normalize pixel counts to fraction. The first three cloud fractions have been set to -1 535 ! in cloud-free areas, so set those places to 0. 536 ! ######################################################################################## 537 Cloud_Fraction_High_Mean(1:nPoints) = Cloud_Fraction_High_Mean(1:nPoints) /nSubcols 538 Cloud_Fraction_Mid_Mean(1:nPoints) = Cloud_Fraction_Mid_Mean(1:nPoints) /nSubcols 539 Cloud_Fraction_Low_Mean(1:nPoints) = Cloud_Fraction_Low_Mean(1:nPoints) /nSubcols 540 541 ! ######################################################################################## 542 ! Set clear-scenes to undefined 543 ! ######################################################################################## 544 where (Cloud_Fraction_Total_Mean == 0) 545 Optical_Thickness_Total_Mean = R_UNDEF 546 Optical_Thickness_Total_MeanLog10 = R_UNDEF 547 Cloud_Top_Pressure_Total_Mean = R_UNDEF 548 endwhere 549 where (Cloud_Fraction_Water_Mean == 0) 550 Optical_Thickness_Water_Mean = R_UNDEF 551 Optical_Thickness_Water_MeanLog10 = R_UNDEF 552 Cloud_Particle_Size_Water_Mean = R_UNDEF 553 Liquid_Water_Path_Mean = R_UNDEF 554 endwhere 555 where (Cloud_Fraction_Ice_Mean == 0) 556 Optical_Thickness_Ice_Mean = R_UNDEF 557 Optical_Thickness_Ice_MeanLog10 = R_UNDEF 558 Cloud_Particle_Size_Ice_Mean = R_UNDEF 559 Ice_Water_Path_Mean = R_UNDEF 560 endwhere 561 where (Cloud_Fraction_High_Mean == 0) Cloud_Fraction_High_Mean = R_UNDEF 562 where (Cloud_Fraction_Mid_Mean == 0) Cloud_Fraction_Mid_Mean = R_UNDEF 563 where (Cloud_Fraction_Low_Mean == 0) Cloud_Fraction_Low_Mean = R_UNDEF 564 565 ! ######################################################################################## 566 ! Joint histogram 567 ! ######################################################################################## 568 569 ! Loop over all points 570 tauWRK(1:nPoints,1:nSubCols) = optical_thickness(1:nPoints,1:nSubCols) 571 ctpWRK(1:nPoints,1:nSubCols) = cloud_top_pressure(1:nPoints,1:nSubCols) 572 reffIceWRK(1:nPoints,1:nSubCols) = merge(particle_size,R_UNDEF,iceCloudMask) 573 reffLiqWRK(1:nPoints,1:nSubCols) = merge(particle_size,R_UNDEF,waterCloudMask) 574 do j=1,nPoints 575 576 ! Fill clear and optically thin subcolumns with fill 577 where(.not. cloudMask(j,1:nSubCols)) 578 tauWRK(j,1:nSubCols) = -999. 579 ctpWRK(j,1:nSubCols) = -999. 580 endwhere 581 ! Joint histogram of tau/CTP 582 call hist2D(tauWRK(j,1:nSubCols),ctpWRK(j,1:nSubCols),nSubCols,& 583 tauHistogramBoundaries,numTauHistogramBins,& 584 pressureHistogramBoundaries,numPressureHistogramBins,& 585 Optical_Thickness_vs_Cloud_Top_Pressure(j,1:numTauHistogramBins,1:numPressureHistogramBins)) 586 ! Joint histogram of tau/ReffICE 587 call hist2D(tauWRK(j,1:nSubCols),reffIceWrk(j,1:nSubCols),nSubCols, & 588 tauHistogramBoundaries,numTauHistogramBins,reffICE_binBounds, & 589 numMODISReffIceBins, Optical_Thickness_vs_ReffIce(j,1:numTauHistogramBins,1:numMODISReffIceBins)) 590 ! Joint histogram of tau/ReffLIQ 591 call hist2D(tauWRK(j,1:nSubCols),reffLiqWrk(j,1:nSubCols),nSubCols, & 592 tauHistogramBoundaries,numTauHistogramBins,reffLIQ_binBounds, & 593 numMODISReffLiqBins, Optical_Thickness_vs_ReffLiq(j,1:numTauHistogramBins,1:numMODISReffLiqBins)) 594 595 enddo 596 Optical_Thickness_vs_Cloud_Top_Pressure(1:nPoints,1:numTauHistogramBins,1:numPressureHistogramBins) = & 597 Optical_Thickness_vs_Cloud_Top_Pressure(1:nPoints,1:numTauHistogramBins,1:numPressureHistogramBins)/nSubCols 598 Optical_Thickness_vs_ReffIce(1:nPoints,1:numTauHistogramBins,1:numMODISReffIceBins) = & 599 Optical_Thickness_vs_ReffIce(1:nPoints,1:numTauHistogramBins,1:numMODISReffIceBins)/nSubCols 600 Optical_Thickness_vs_ReffLiq(1:nPoints,1:numTauHistogramBins,1:numMODISReffLiqBins) = & 601 Optical_Thickness_vs_ReffLiq(1:nPoints,1:numTauHistogramBins,1:numMODISReffLiqBins)/nSubCols 602 603 end subroutine modis_column 604 ! ###################################################################################### 605 ! SUBROUTINE hist2D 606 ! ###################################################################################### 607 subroutine hist2D(var1,var2,npts,bin1,nbin1,bin2,nbin2,jointHist) 608 implicit none 609 610 ! INPUTS 611 integer, intent(in) :: & 612 npts, & ! Number of data points to be sorted 613 nbin1, & ! Number of bins in histogram direction 1 614 nbin2 ! Number of bins in histogram direction 2 615 real,intent(in),dimension(npts) :: & 616 var1, & ! Variable 1 to be sorted into bins 617 var2 ! variable 2 to be sorted into bins 618 real,intent(in),dimension(nbin1+1) :: & 619 bin1 ! Histogram bin 1 boundaries 620 real,intent(in),dimension(nbin2+1) :: & 621 bin2 ! Histogram bin 2 boundaries 622 ! OUTPUTS 623 real,intent(out),dimension(nbin1,nbin2) :: & 624 jointHist 625 626 ! LOCAL VARIABLES 627 integer :: ij,ik 628 629 do ij=2,nbin1+1 630 do ik=2,nbin2+1 631 jointHist(ij-1,ik-1)=count(var1 .ge. bin1(ij-1) .and. var1 .lt. bin1(ij) .and. & 632 var2 .ge. bin2(ik-1) .and. var2 .lt. bin2(ik)) 633 enddo 634 enddo 635 end subroutine hist2D 636 386 637 !------------------------------------------------------------------------------------------------ 387 638 subroutine modis_L3_simulator(phase, cloud_top_pressure, optical_thickness, particle_size, & … … 666 917 ! If first retrieval works, can try 2nd iteration using greater re resolution 667 918 ! 668 if(use_two_re_iterations .and. retrieve_re > 0.) then 669 re_min = retrieve_re - delta_re 670 re_max = retrieve_re + delta_re 671 delta_re = (re_max - re_min)/real(num_trial_res-1) 672 673 trial_re(:) = re_min + delta_re * (/ (i - 1, i = 1, num_trial_res) /) 674 g(:) = get_g_nir( phase, trial_re(:)) 675 w0(:) = get_ssa_nir(phase, trial_re(:)) 676 predicted_Refl_nir(:) = two_stream_reflectance(tau, g(:), w0(:)) 677 retrieve_re = interpolate_to_min(trial_re(:), predicted_Refl_nir(:), obs_Refl_nir) 678 end if 919 ! DJS2015: Remove unused piece of code 920 ! if(use_two_re_iterations .and. retrieve_re > 0.) then 921 ! re_min = retrieve_re - delta_re 922 ! re_max = retrieve_re + delta_re 923 ! delta_re = (re_max - re_min)/real(num_trial_res-1) 924 ! 925 ! trial_re(:) = re_min + delta_re * (/ (i - 1, i = 1, num_trial_res) /) 926 ! g(:) = get_g_nir( phase, trial_re(:)) 927 ! w0(:) = get_ssa_nir(phase, trial_re(:)) 928 ! predicted_Refl_nir(:) = two_stream_reflectance(tau, g(:), w0(:)) 929 ! retrieve_re = interpolate_to_min(trial_re(:), predicted_Refl_nir(:), obs_Refl_nir) 930 ! end if 931 ! DJS2015 END 679 932 else 680 933 retrieve_re = re_fill … … 739 992 real, intent(in) :: re 740 993 real :: get_g_nir 741 742 real, dimension(3), parameter :: ice_coefficients = (/ 0.7432, 4.5563e-3, -2.8697e-5 /), &743 small_water_coefficients = (/ 0.8027, -1.0496e-2, 1.7071e-3 /), &744 big_water_coefficients = (/ 0.7931, 5.3087e-3, -7.4995e-5 /)745 746 ! approx. fits from MODIS Collection 5 LUT scattering calculations747 if(phase == phaseIsLiquid) then 748 if(re < 8.) then749 get_g_nir = fit_to_quadratic(re, small_water_coefficients)750 if(re < re_water_min) get_g_nir = fit_to_quadratic(re_water_min, small_water_coefficients)751 else752 get_g_nir = fit_to_quadratic(re,big_water_coefficients)753 if(re > re_water_max) get_g_nir = fit_to_quadratic(re_water_max, big_water_coefficients)754 end if994 995 real, dimension(3), parameter :: ice_coefficients = (/ 0.7490, 6.5153e-3, -5.4136e-5 /), & 996 small_water_coefficients = (/ 1.0364, -8.8800e-2, 7.0000e-3 /) 997 real, dimension(4), parameter :: big_water_coefficients = (/ 0.6035, 2.8993e-2, -1.1051e-3, 1.5134e-5 /) 998 999 ! approx. fits from MODIS Collection 6 LUT scattering calculations for 3.7 µm channel size retrievals 1000 if(phase == phaseIsLiquid) then 1001 if(re < 7.) then 1002 get_g_nir = fit_to_quadratic(re, small_water_coefficients) 1003 if(re < re_water_min) get_g_nir = fit_to_quadratic(re_water_min, small_water_coefficients) 1004 else 1005 get_g_nir = fit_to_cubic(re, big_water_coefficients) 1006 if(re > re_water_max) get_g_nir = fit_to_cubic(re_water_max, big_water_coefficients) 1007 end if 755 1008 else 756 get_g_nir = fit_to_quadratic(re, ice_coefficients)1009 get_g_nir = fit_to_quadratic(re, ice_coefficients) 757 1010 if(re < re_ice_min) get_g_nir = fit_to_quadratic(re_ice_min, ice_coefficients) 758 1011 if(re > re_ice_max) get_g_nir = fit_to_quadratic(re_ice_max, ice_coefficients) … … 771 1024 ! Fits from Steve Platnick 772 1025 ! 1026 real, dimension(4), parameter :: ice_coefficients = (/ 0.9625, -1.8069e-2, 3.3281e-4,-2.2865e-6/) 1027 real, dimension(3), parameter :: water_coefficients = (/ 1.0044, -1.1397e-2, 1.3300e-4 /) 773 1028 774 real, dimension(4), parameter :: ice_coefficients = (/ 0.9994, -4.5199e-3, 3.9370e-5, -1.5235e-7 /) 775 real, dimension(3), parameter :: water_coefficients = (/ 1.0008, -2.5626e-3, 1.6024e-5 /) 776 777 ! approx. fits from MODIS Collection 5 LUT scattering calculations 1029 ! approx. fits from MODIS Collection 6 LUT scattering calculations 778 1030 if(phase == phaseIsLiquid) then 779 1031 get_ssa_nir = fit_to_quadratic(re, water_coefficients) -
LMDZ5/branches/testing/libf/phylmd/cosp/read_cosp_output_nl.F90
r2435 r2720 41 41 Lcltmodis,Lclwmodis,Lclimodis,Lclhmodis,Lclmmodis,Lcllmodis,Ltautmodis,Ltauwmodis,Ltauimodis,Ltautlogmodis, & 42 42 Ltauwlogmodis,Ltauilogmodis,Lreffclwmodis,Lreffclimodis,Lpctmodis,Llwpmodis, & 43 Liwpmodis,Lclmodis 43 Liwpmodis,Lclmodis,Lcrimodis,Lcrlmodis 44 44 45 45 namelist/COSP_OUTPUT/Lradar_sim,Llidar_sim,Lisccp_sim,Lmodis_sim,Lmisr_sim,Lrttov_sim, & … … 57 57 Lcltmodis,Lclwmodis,Lclimodis,Lclhmodis,Lclmmodis,Lcllmodis,Ltautmodis,Ltauwmodis,Ltauimodis,Ltautlogmodis, & 58 58 Ltauwlogmodis,Ltauilogmodis,Lreffclwmodis,Lreffclimodis,Lpctmodis,Llwpmodis, & 59 Liwpmodis,Lclmodis 59 Liwpmodis,Lclmodis,Lcrimodis,Lcrlmodis 60 60 61 61 do i=1,N_OUT_LIST … … 137 137 CALL bcast(Lclmodis) 138 138 CALL bcast(Ltbrttov) 139 CALL bcast(Lcrimodis) 140 CALL bcast(Lcrlmodis) 141 139 142 !$OMP BARRIER 140 143 … … 223 226 Liwpmodis=.false. 224 227 Lclmodis=.false. 228 Lcrimodis=.false. 229 Lcrlmodis=.false. 225 230 endif 226 231 if (Lmodis_sim) Lisccp_sim = .true. … … 381 386 i = i+1 382 387 if (Lclmodis) cfg%out_list(i) = 'clmodis' 388 i = i+1 389 if (Lcrimodis) cfg%out_list(i) = 'crimodis' 390 i = i+1 391 if (Lcrlmodis) cfg%out_list(i) = 'crlmodis' 383 392 384 393 if (i /= N_OUT_LIST) then … … 459 468 cfg%Liwpmodis=Liwpmodis 460 469 cfg%Lclmodis=Lclmodis 461 470 cfg%Lcrimodis=Lcrimodis 471 cfg%Lcrlmodis=Lcrlmodis 472 462 473 END SUBROUTINE READ_COSP_OUTPUT_NL 463 474 -
LMDZ5/branches/testing/libf/phylmd/cv3_routines.F90
r2641 r2720 2354 2354 2355 2355 ! ------------------------------------------------------ 2356 IF (prt_level .GE. 10) print *,' ->cv3_unsat, iflag(1) ', iflag(1) 2356 2357 2357 2358 ! ============================= … … 2359 2360 ! ============================= 2360 2361 ! (loops up to nl+1) 2362 mp(:,:) = 0. 2363 rp(:,:) = 0. 2364 up(:,:) = 0. 2365 vp(:,:) = 0. 2366 water(:,:) = 0. 2367 evap(:,:) = 0. 2368 wt(:,:) = 0. 2369 ice(:,:) = 0. 2370 fondue(:,:) = 0. 2371 faci(:,:) = 0. 2372 b(:,:) = 0. 2373 sigd(:) = 0. 2374 !! RomP >>> 2375 wdtrainA(:,:) = 0. 2376 wdtrainM(:,:) = 0. 2377 !! RomP <<< 2361 2378 2362 2379 DO i = 1, nlp 2363 2380 DO il = 1, ncum 2364 mp(il, i) = 0.02365 2381 rp(il, i) = rr(il, i) 2366 2382 up(il, i) = u(il, i) 2367 2383 vp(il, i) = v(il, i) 2368 2384 wt(il, i) = 0.001 2369 water(il, i) = 0.0 2370 faci(il, i) = 0.0 2371 ice(il, i) = 0.0 2372 fondue(il, i) = 0.0 2373 evap(il, i) = 0.0 2374 b(il, i) = 0.0 2375 END DO 2376 END DO 2377 !! RomP >>> 2378 DO i = 1, nlp 2379 DO il = 1, ncum 2380 wdtrainA(il, i) = 0.0 2381 wdtrainM(il, i) = 0.0 2382 END DO 2383 END DO 2384 !! RomP <<< 2385 END DO 2386 END DO 2385 2387 2386 2388 ! *** Set the fractionnal area sigd of precipitating downdraughts … … 2422 2424 !! lwork(il)=.TRUE. 2423 2425 !! if(ep(il,inb(il)).lt.0.0001)lwork(il)=.FALSE. 2424 lwork(il) = ep(il, inb(il)) >= 0.0001 2426 !jyg< 2427 !! lwork(il) = ep(il, inb(il)) >= 0.0001 2428 lwork(il) = ep(il, inb(il)) >= 0.0001 .AND. iflag(il) <= 2 2425 2429 END DO 2426 2430 … … 2725 2729 2726 2730 END IF !(i.le.inb(il) .and. lwork(il) .and. i.ne.1) 2731 IF (prt_level .GE. 20) THEN 2732 PRINT *,'cv3_unsat, mp hydrostatic ', i, mp(il,i) 2733 ENDIF 2727 2734 END DO 2728 2735 ! ---------------------------------------------------------------- … … 2771 2778 END IF 2772 2779 mp(il, i) = max(0.0, mp(il,i)) 2780 IF (prt_level .GE. 20) THEN 2781 PRINT *,'cv3_unsat, mp cubic ', i, mp(il,i) 2782 ENDIF 2773 2783 2774 2784 IF (cvflag_ice) THEN -
LMDZ5/branches/testing/libf/phylmd/dyn1d/1DUTILS.h
r2641 r2720 55 55 56 56 !Config Key = prt_level 57 !Config Desc = niveau d'impressions de d ébogage57 !Config Desc = niveau d'impressions de debogage 58 58 !Config Def = 0 59 !Config Help = Niveau d'impression pour le d ébogage59 !Config Help = Niveau d'impression pour le debogage 60 60 !Config (0 = minimum d'impression) 61 61 ! prt_level = 0 … … 118 118 ! use geostrophic wind ug=10m/s vg=0m/s. Duration of the case 53100s 119 119 ! Radiation to be switched off 120 ! > 100 ==> forcing_case = .true. or forcing_case2 = .true. 121 ! initial profiles from case.nc file 120 122 ! 121 123 forcing_type = 0 … … 134 136 ENDIF 135 137 136 !Param ètres de forçage138 !Parametres de forcage 137 139 !Config Key = tend_t 138 140 !Config Desc = forcage ou non par advection de T … … 303 305 CALL getin('rugos',rugos) 304 306 307 !Config Key = rugosh 308 !Config Desc = coefficient de frottement 309 !Config Def = rugos 310 !Config Help = calcul du Cdrag 311 rugosh = rugos 312 CALL getin('rugosh',rugosh) 313 314 315 316 !Config Key = snowmass 317 !Config Desc = mass de neige de la surface en kg/m2 318 !Config Def = 0.0000 319 !Config Help = snowmass 320 snowmass = 0.0000 321 CALL getin('snowmass',snowmass) 322 305 323 !Config Key = wtsurf et wqsurf 306 324 !Config Desc = ??? … … 342 360 !Config Key = zpicinp 343 361 !Config Desc = denivellation orographie 344 !Config Def = 300.362 !Config Def = 0. 345 363 !Config Help = input brise 346 zpicinp = 300.364 zpicinp = 0. 347 365 CALL getin('zpicinp',zpicinp) 348 366 !Config key = nudge_tsoil … … 378 396 CALL getin('tau_soil_nudge',tau_soil_nudge) 379 397 398 !---------------------------------------------------------- 399 ! Param??tres de for??age pour les forcages communs: 400 ! Pour les forcages communs: ces entiers valent 0 ou 1 401 ! tadv= advection tempe, tadvv= adv tempe verticale, tadvh= adv tempe horizontale 402 ! qadv= advection q, qadvv= adv q verticale, qadvh= adv q horizontale 403 ! trad= 0 (rayonnement actif) ou 1 (prescrit par tend_rad) ou adv (prescir et contenu dans les tadv) 404 ! forcages en omega, w, vent geostrophique ou ustar 405 ! Parametres de nudging en u,v,t,q valent 0 ou 1 ou le temps de nudging 406 !---------------------------------------------------------- 407 408 !Config Key = tadv 409 !Config Desc = forcage ou non par advection totale de T 410 !Config Def = false 411 !Config Help = forcage ou non par advection totale de T 412 tadv =0 413 CALL getin('tadv',tadv) 414 415 !Config Key = tadvv 416 !Config Desc = forcage ou non par advection verticale de T 417 !Config Def = false 418 !Config Help = forcage ou non par advection verticale de T 419 tadvv =0 420 CALL getin('tadvv',tadvv) 421 422 !Config Key = tadvh 423 !Config Desc = forcage ou non par advection horizontale de T 424 !Config Def = false 425 !Config Help = forcage ou non par advection horizontale de T 426 tadvh =0 427 CALL getin('tadvh',tadvh) 428 429 !Config Key = thadv 430 !Config Desc = forcage ou non par advection totale de Theta 431 !Config Def = false 432 !Config Help = forcage ou non par advection totale de Theta 433 thadv =0 434 CALL getin('thadv',thadv) 435 436 !Config Key = thadvv 437 !Config Desc = forcage ou non par advection verticale de Theta 438 !Config Def = false 439 !Config Help = forcage ou non par advection verticale de Theta 440 thadvv =0 441 CALL getin('thadvv',thadvv) 442 443 !Config Key = thadvh 444 !Config Desc = forcage ou non par advection horizontale de Theta 445 !Config Def = false 446 !Config Help = forcage ou non par advection horizontale de Theta 447 thadvh =0 448 CALL getin('thadvh',thadvh) 449 450 !Config Key = qadv 451 !Config Desc = forcage ou non par advection totale de Q 452 !Config Def = false 453 !Config Help = forcage ou non par advection totale de Q 454 qadv =0 455 CALL getin('qadv',qadv) 456 457 !Config Key = qadvv 458 !Config Desc = forcage ou non par advection verticale de Q 459 !Config Def = false 460 !Config Help = forcage ou non par advection verticale de Q 461 qadvv =0 462 CALL getin('qadvv',qadvv) 463 464 !Config Key = qadvh 465 !Config Desc = forcage ou non par advection horizontale de Q 466 !Config Def = false 467 !Config Help = forcage ou non par advection horizontale de Q 468 qadvh =0 469 CALL getin('qadvh',qadvh) 470 471 !Config Key = trad 472 !Config Desc = forcage ou non par tendance radiative 473 !Config Def = false 474 !Config Help = forcage ou non par tendance radiative 475 trad =0 476 CALL getin('trad',trad) 477 478 !Config Key = forc_omega 479 !Config Desc = forcage ou non par omega 480 !Config Def = false 481 !Config Help = forcage ou non par omega 482 forc_omega =0 483 CALL getin('forc_omega',forc_omega) 484 485 !Config Key = forc_w 486 !Config Desc = forcage ou non par w 487 !Config Def = false 488 !Config Help = forcage ou non par w 489 forc_w =0 490 CALL getin('forc_w',forc_w) 491 492 !Config Key = forc_geo 493 !Config Desc = forcage ou non par geo 494 !Config Def = false 495 !Config Help = forcage ou non par geo 496 forc_geo =0 497 CALL getin('forc_geo',forc_geo) 498 499 ! Meme chose que ok_precr_ust 500 !Config Key = forc_ustar 501 !Config Desc = forcage ou non par ustar 502 !Config Def = false 503 !Config Help = forcage ou non par ustar 504 forc_ustar =0 505 CALL getin('forc_ustar',forc_ustar) 506 IF (forc_ustar .EQ. 1) ok_prescr_ust=.true. 507 508 !Config Key = nudging_u 509 !Config Desc = forcage ou non par nudging sur u 510 !Config Def = false 511 !Config Help = forcage ou non par nudging sur u 512 nudging_u =0 513 CALL getin('nudging_u',nudging_u) 514 515 !Config Key = nudging_v 516 !Config Desc = forcage ou non par nudging sur v 517 !Config Def = false 518 !Config Help = forcage ou non par nudging sur v 519 nudging_v =0 520 CALL getin('nudging_v',nudging_v) 521 522 !Config Key = nudging_w 523 !Config Desc = forcage ou non par nudging sur w 524 !Config Def = false 525 !Config Help = forcage ou non par nudging sur w 526 nudging_w =0 527 CALL getin('nudging_w',nudging_w) 528 529 !Config Key = nudging_q 530 !Config Desc = forcage ou non par nudging sur q 531 !Config Def = false 532 !Config Help = forcage ou non par nudging sur q 533 nudging_q =0 534 CALL getin('nudging_q',nudging_q) 535 536 !Config Key = nudging_t 537 !Config Desc = forcage ou non par nudging sur t 538 !Config Def = false 539 !Config Help = forcage ou non par nudging sur t 540 nudging_t =0 541 CALL getin('nudging_t',nudging_t) 380 542 381 543 … … 395 557 write(lunout,*)' zsurf = ', zsurf 396 558 write(lunout,*)' rugos = ', rugos 559 write(lunout,*)' snowmass=', snowmass 397 560 write(lunout,*)' wtsurf = ', wtsurf 398 561 write(lunout,*)' wqsurf = ', wqsurf … … 406 569 write(lunout,*)' Tsoil_nudge = ', Tsoil_nudge 407 570 write(lunout,*)' tau_soil_nudge = ', tau_soil_nudge 571 write(lunout,*)' tadv = ', tadv 572 write(lunout,*)' tadvv = ', tadvv 573 write(lunout,*)' tadvh = ', tadvh 574 write(lunout,*)' thadv = ', thadv 575 write(lunout,*)' thadvv = ', thadvv 576 write(lunout,*)' thadvh = ', thadvh 577 write(lunout,*)' qadv = ', qadv 578 write(lunout,*)' qadvv = ', qadvv 579 write(lunout,*)' qadvh = ', qadvh 580 write(lunout,*)' trad = ', trad 581 write(lunout,*)' forc_omega = ', forc_omega 582 write(lunout,*)' forc_w = ', forc_w 583 write(lunout,*)' forc_geo = ', forc_geo 584 write(lunout,*)' forc_ustar = ', forc_ustar 585 write(lunout,*)' nudging_u = ', nudging_u 586 write(lunout,*)' nudging_v = ', nudging_v 587 write(lunout,*)' nudging_t = ', nudging_t 588 write(lunout,*)' nudging_q = ', nudging_q 408 589 IF (forcing_type .eq.40) THEN 409 590 write(lunout,*) '--- Forcing type GCSS Old --- with:' … … 1106 1287 !---------------------------------------------------------------------- 1107 1288 ! Calcul de l'advection verticale (ascendance et subsidence) de 1108 ! temp érature et d'humidité. Hypothèse : ce qui rentre de l'extérieur1109 ! a les m êmes caractéristiques que l'air de la colonne 1D (WTG) ou1289 ! temperature et d'humidite. Hypothese : ce qui rentre de l'exterieur 1290 ! a les memes caracteristiques que l'air de la colonne 1D (WTG) ou 1110 1291 ! sans WTG rajouter une advection horizontale 1111 1292 !---------------------------------------------------------------------- … … 1180 1361 !---------------------------------------------------------------------- 1181 1362 ! Calcul de l'advection verticale (ascendance et subsidence) de 1182 ! temp érature et d'humidité. Hypothèse : ce qui rentre de l'extérieur1183 ! a les m êmes caractéristiques que l'air de la colonne 1D (WTG) ou1363 ! temperature et d'humidite. Hypothese : ce qui rentre de l'exterieur 1364 ! a les memes caracteristiques que l'air de la colonne 1D (WTG) ou 1184 1365 ! sans WTG rajouter une advection horizontale 1185 1366 !---------------------------------------------------------------------- … … 2934 3115 endif 2935 3116 if (annee_ref.eq.1992 .and. day1.lt.day_ini_toga) then 2936 print*,'TOGA-COARE a d ébutéle 1er Nov 1992 (jour julien=306)'3117 print*,'TOGA-COARE a debute le 1er Nov 1992 (jour julien=306)' 2937 3118 print*,'Changer dayref dans run.def' 2938 3119 stop … … 3141 3322 3142 3323 !====================================================================== 3324 SUBROUTINE interp_gabls4_time(day,day1,annee_ref & 3325 & ,year_ini_gabls4,day_ini_gabls4,nt_gabls4,dt_gabls4,nlev_gabls4 & 3326 & ,ug_gabls4,vg_gabls4,ht_gabls4,hq_gabls4,tg_gabls4 & 3327 & ,ug_prof,vg_prof,ht_prof,hq_prof,tg_prof) 3328 implicit none 3329 3330 !--------------------------------------------------------------------------------------- 3331 ! Time interpolation of a 2D field to the timestep corresponding to day 3332 ! 3333 ! day: current julian day 3334 ! day1: first day of the simulation 3335 ! nt_gabls4: total nb of data in the forcing (e.g. 37 for gabls4) 3336 ! dt_gabls4: total time interval (in sec) between 2 forcing data (e.g. 60min. for gabls4) 3337 !--------------------------------------------------------------------------------------- 3338 3339 #include "compar1d.h" 3340 3341 ! inputs: 3342 integer annee_ref 3343 integer nt_gabls4,nlev_gabls4 3344 integer year_ini_gabls4 3345 real day, day1,day_ini_gabls4,dt_gabls4 3346 real ug_gabls4(nlev_gabls4,nt_gabls4),vg_gabls4(nlev_gabls4,nt_gabls4) 3347 real ht_gabls4(nlev_gabls4,nt_gabls4),hq_gabls4(nlev_gabls4,nt_gabls4) 3348 real tg_gabls4(nt_gabls4), tg_prof 3349 ! outputs: 3350 real ug_prof(nlev_gabls4),vg_prof(nlev_gabls4) 3351 real ht_prof(nlev_gabls4),hq_prof(nlev_gabls4) 3352 ! local: 3353 integer it_gabls41, it_gabls42,k 3354 real timeit,time_gabls41,time_gabls42,frac 3355 3356 3357 3358 ! Check that initial day of the simulation consistent with gabls4 period: 3359 if (forcing_type.eq.8 ) then 3360 print *,'annee_ref=',annee_ref 3361 print *,'day1=',day1 3362 print *,'day_ini_gabls4=',day_ini_gabls4 3363 if (annee_ref.ne.2009) then 3364 print*,'Pour gabls4, annee_ref doit etre 2009' 3365 print*,'Changer annee_ref dans run.def' 3366 stop 3367 endif 3368 if (annee_ref.eq.2009 .and. day1.gt.day_ini_gabls4) then 3369 print*,'gabls4 a debute le 11 dec 2009 (jour julien=345)' 3370 print*,'Changer dayref dans run.def',day1,day_ini_gabls4 3371 stop 3372 endif 3373 if (annee_ref.eq.2009 .and. day1.gt.day_ini_gabls4+2) then 3374 print*,'gabls4 a fini le 12 dec 2009 (jour julien=346)' 3375 print*,'Changer dayref ou nday dans run.def',day1,day_ini_gabls4 3376 stop 3377 endif 3378 endif 3379 3380 timeit=(day-day_ini_gabls4)*86400 3381 print *,'day,day_ini_gabls4=',day,day_ini_gabls4 3382 print *,'nt_gabls4,dt,timeit=',nt_gabls4,dt_gabls4,timeit 3383 3384 ! Determine the closest observation times: 3385 it_gabls41=INT(timeit/dt_gabls4)+1 3386 it_gabls42=it_gabls41 + 1 3387 time_gabls41=(it_gabls41-1)*dt_gabls4 3388 time_gabls42=(it_gabls42-1)*dt_gabls4 3389 3390 if (it_gabls41 .ge. nt_gabls4) then 3391 write(*,*) 'PB-stop: day, it_gabls41, it_gabls42, timeit: ',day,it_gabls41,it_gabls42,timeit/86400. 3392 stop 3393 endif 3394 3395 ! time interpolation: 3396 frac=(time_gabls42-timeit)/(time_gabls42-time_gabls41) 3397 frac=max(frac,0.0) 3398 3399 3400 do k=1,nlev_gabls4 3401 ug_prof(k) = ug_gabls4(k,it_gabls42)-frac*(ug_gabls4(k,it_gabls42)-ug_gabls4(k,it_gabls41)) 3402 vg_prof(k) = vg_gabls4(k,it_gabls42)-frac*(vg_gabls4(k,it_gabls42)-vg_gabls4(k,it_gabls41)) 3403 ht_prof(k) = ht_gabls4(k,it_gabls42)-frac*(ht_gabls4(k,it_gabls42)-ht_gabls4(k,it_gabls41)) 3404 hq_prof(k) = hq_gabls4(k,it_gabls42)-frac*(hq_gabls4(k,it_gabls42)-hq_gabls4(k,it_gabls41)) 3405 enddo 3406 tg_prof=tg_gabls4(it_gabls42)-frac*(tg_gabls4(it_gabls42)-tg_gabls4(it_gabls41)) 3407 return 3408 END 3409 3410 !====================================================================== 3143 3411 SUBROUTINE interp_armcu_time(day,day1,annee_ref & 3144 3412 & ,year_ini_armcu,day_ini_armcu,nt_armcu,dt_armcu & … … 3679 3947 !===================================================================== 3680 3948 subroutine read_dice(fich_dice,nlevel,ntime & 3681 & ,zz,pres,t h,qv,u,v,o3 &3949 & ,zz,pres,t,qv,u,v,o3 & 3682 3950 & ,shf,lhf,lwup,swup,tg,ustar,psurf,ug,vg & 3683 3951 & ,hadvt,hadvq,hadvu,hadvv,w,omega) … … 3689 3957 3690 3958 #include "netcdf.inc" 3959 #include "YOMCST.h" 3691 3960 3692 3961 integer ntime,nlevel … … 3696 3965 real*8 zz(nlevel) 3697 3966 3698 real*8 th(nlevel),pres(nlevel) 3967 real*8 th(nlevel),pres(nlevel),t(nlevel) 3699 3968 real*8 qv(nlevel),u(nlevel),v(nlevel),o3(nlevel) 3700 3969 real*8 shf(ntime),lhf(ntime),lwup(ntime),swup(ntime),tg(ntime) … … 3702 3971 real*8 hadvt(nlevel,ntime),hadvq(nlevel,ntime),hadvu(nlevel,ntime) 3703 3972 real*8 hadvv(nlevel,ntime),w(nlevel,ntime),omega(nlevel,ntime) 3973 real*8 pzero 3704 3974 3705 3975 integer nid, ierr … … 3708 3978 integer var3didin(nbvar3d) 3709 3979 3980 pzero=100000. 3710 3981 ierr = NF_OPEN(fich_dice,NF_NOWRITE,nid) 3711 3982 if (ierr.NE.NF_NOERR) then … … 3882 4153 endif 3883 4154 ! write(*,*)'lecture th ok',th 4155 do k=1,nlevel 4156 t(k)=th(k)*(pres(k)/pzero)**rkappa 4157 enddo 3884 4158 3885 4159 #ifdef NC_DOUBLE … … 4095 4369 end subroutine read_dice 4096 4370 !===================================================================== 4371 subroutine read_gabls4(fich_gabls4,nlevel,ntime,nsol & 4372 & ,zz,depth_sn,ug,vg,pf,th,t,qv,u,v,hadvt,hadvq,tg,tsnow,snow_dens) 4373 4374 !program reading initial profils and forcings of the Gabls4 case study 4375 4376 4377 implicit none 4378 4379 #include "netcdf.inc" 4380 4381 integer ntime,nlevel,nsol 4382 integer l,k 4383 character*80 :: fich_gabls4 4384 real*8 time(ntime) 4385 4386 ! ATTENTION: visiblement quand on lit gabls4_driver.nc on recupere les donnees 4387 ! dans un ordre inverse par rapport a la convention LMDZ 4388 ! ==> il faut tout inverser (MPL 20141024) 4389 ! les variables indexees "_i" sont celles qui sont lues dans gabls4_driver.nc 4390 real*8 zz_i(nlevel),th_i(nlevel),pf_i(nlevel),t_i(nlevel) 4391 real*8 qv_i(nlevel),u_i(nlevel),v_i(nlevel),ug_i(nlevel,ntime),vg_i(nlevel,ntime) 4392 real*8 hadvt_i(nlevel,ntime),hadvq_i(nlevel,ntime) 4393 4394 real*8 zz(nlevel),th(nlevel),pf(nlevel),t(nlevel) 4395 real*8 qv(nlevel),u(nlevel),v(nlevel),ug(nlevel,ntime),vg(nlevel,ntime) 4396 real*8 hadvt(nlevel,ntime),hadvq(nlevel,ntime) 4397 4398 real*8 depth_sn(nsol),tsnow(nsol),snow_dens(nsol) 4399 real*8 tg(ntime) 4400 integer nid, ierr 4401 integer nbvar3d 4402 parameter(nbvar3d=30) 4403 integer var3didin(nbvar3d) 4404 4405 ierr = NF_OPEN(fich_gabls4,NF_NOWRITE,nid) 4406 if (ierr.NE.NF_NOERR) then 4407 write(*,*) 'ERROR: Pb opening forcings nc file ' 4408 write(*,*) NF_STRERROR(ierr) 4409 stop "" 4410 endif 4411 4412 4413 ierr=NF_INQ_VARID(nid,"height",var3didin(1)) 4414 if(ierr/=NF_NOERR) then 4415 write(*,*) NF_STRERROR(ierr) 4416 stop 'height' 4417 endif 4418 4419 ierr=NF_INQ_VARID(nid,"depth_sn",var3didin(2)) 4420 if(ierr/=NF_NOERR) then 4421 write(*,*) NF_STRERROR(ierr) 4422 stop 'depth_sn' 4423 endif 4424 4425 ierr=NF_INQ_VARID(nid,"Ug",var3didin(3)) 4426 if(ierr/=NF_NOERR) then 4427 write(*,*) NF_STRERROR(ierr) 4428 stop 'Ug' 4429 endif 4430 4431 ierr=NF_INQ_VARID(nid,"Vg",var3didin(4)) 4432 if(ierr/=NF_NOERR) then 4433 write(*,*) NF_STRERROR(ierr) 4434 stop 'Vg' 4435 endif 4436 ierr=NF_INQ_VARID(nid,"pf",var3didin(5)) 4437 if(ierr/=NF_NOERR) then 4438 write(*,*) NF_STRERROR(ierr) 4439 stop 'pf' 4440 endif 4441 4442 ierr=NF_INQ_VARID(nid,"theta",var3didin(6)) 4443 if(ierr/=NF_NOERR) then 4444 write(*,*) NF_STRERROR(ierr) 4445 stop 'theta' 4446 endif 4447 4448 ierr=NF_INQ_VARID(nid,"tempe",var3didin(7)) 4449 if(ierr/=NF_NOERR) then 4450 write(*,*) NF_STRERROR(ierr) 4451 stop 'tempe' 4452 endif 4453 4454 ierr=NF_INQ_VARID(nid,"qv",var3didin(8)) 4455 if(ierr/=NF_NOERR) then 4456 write(*,*) NF_STRERROR(ierr) 4457 stop 'qv' 4458 endif 4459 4460 ierr=NF_INQ_VARID(nid,"u",var3didin(9)) 4461 if(ierr/=NF_NOERR) then 4462 write(*,*) NF_STRERROR(ierr) 4463 stop 'u' 4464 endif 4465 4466 ierr=NF_INQ_VARID(nid,"v",var3didin(10)) 4467 if(ierr/=NF_NOERR) then 4468 write(*,*) NF_STRERROR(ierr) 4469 stop 'v' 4470 endif 4471 4472 ierr=NF_INQ_VARID(nid,"hadvT",var3didin(11)) 4473 if(ierr/=NF_NOERR) then 4474 write(*,*) NF_STRERROR(ierr) 4475 stop 'hadvt' 4476 endif 4477 4478 ierr=NF_INQ_VARID(nid,"hadvQ",var3didin(12)) 4479 if(ierr/=NF_NOERR) then 4480 write(*,*) NF_STRERROR(ierr) 4481 stop 'hadvq' 4482 endif 4483 4484 ierr=NF_INQ_VARID(nid,"Tsnow",var3didin(14)) 4485 if(ierr/=NF_NOERR) then 4486 write(*,*) NF_STRERROR(ierr) 4487 stop 'tsnow' 4488 endif 4489 4490 ierr=NF_INQ_VARID(nid,"snow_density",var3didin(15)) 4491 if(ierr/=NF_NOERR) then 4492 write(*,*) NF_STRERROR(ierr) 4493 stop 'snow_density' 4494 endif 4495 4496 ierr=NF_INQ_VARID(nid,"Tg",var3didin(16)) 4497 if(ierr/=NF_NOERR) then 4498 write(*,*) NF_STRERROR(ierr) 4499 stop 'Tg' 4500 endif 4501 4502 4503 !dimensions lecture 4504 ! call catchaxis(nid,ntime,nlevel,time,z,ierr) 4505 4506 #ifdef NC_DOUBLE 4507 ierr = NF_GET_VAR_DOUBLE(nid,var3didin(1),zz_i) 4508 #else 4509 ierr = NF_GET_VAR_REAL(nid,var3didin(1),zz_i) 4510 #endif 4511 if(ierr/=NF_NOERR) then 4512 write(*,*) NF_STRERROR(ierr) 4513 stop "getvarup" 4514 endif 4515 4516 #ifdef NC_DOUBLE 4517 ierr = NF_GET_VAR_DOUBLE(nid,var3didin(2),depth_sn) 4518 #else 4519 ierr = NF_GET_VAR_REAL(nid,var3didin(2),depth_sn) 4520 #endif 4521 if(ierr/=NF_NOERR) then 4522 write(*,*) NF_STRERROR(ierr) 4523 stop "getvarup" 4524 endif 4525 4526 #ifdef NC_DOUBLE 4527 ierr = NF_GET_VAR_DOUBLE(nid,var3didin(3),ug_i) 4528 #else 4529 ierr = NF_GET_VAR_REAL(nid,var3didin(3),ug_i) 4530 #endif 4531 if(ierr/=NF_NOERR) then 4532 write(*,*) NF_STRERROR(ierr) 4533 stop "getvarup" 4534 endif 4535 4536 #ifdef NC_DOUBLE 4537 ierr = NF_GET_VAR_DOUBLE(nid,var3didin(4),vg_i) 4538 #else 4539 ierr = NF_GET_VAR_REAL(nid,var3didin(4),vg_i) 4540 #endif 4541 if(ierr/=NF_NOERR) then 4542 write(*,*) NF_STRERROR(ierr) 4543 stop "getvarup" 4544 endif 4545 4546 #ifdef NC_DOUBLE 4547 ierr = NF_GET_VAR_DOUBLE(nid,var3didin(5),pf_i) 4548 #else 4549 ierr = NF_GET_VAR_REAL(nid,var3didin(5),pf_i) 4550 #endif 4551 if(ierr/=NF_NOERR) then 4552 write(*,*) NF_STRERROR(ierr) 4553 stop "getvarup" 4554 endif 4555 4556 #ifdef NC_DOUBLE 4557 ierr = NF_GET_VAR_DOUBLE(nid,var3didin(6),th_i) 4558 #else 4559 ierr = NF_GET_VAR_REAL(nid,var3didin(6),th_i) 4560 #endif 4561 if(ierr/=NF_NOERR) then 4562 write(*,*) NF_STRERROR(ierr) 4563 stop "getvarup" 4564 endif 4565 4566 #ifdef NC_DOUBLE 4567 ierr = NF_GET_VAR_DOUBLE(nid,var3didin(7),t_i) 4568 #else 4569 ierr = NF_GET_VAR_REAL(nid,var3didin(7),t_i) 4570 #endif 4571 if(ierr/=NF_NOERR) then 4572 write(*,*) NF_STRERROR(ierr) 4573 stop "getvarup" 4574 endif 4575 4576 #ifdef NC_DOUBLE 4577 ierr = NF_GET_VAR_DOUBLE(nid,var3didin(8),qv_i) 4578 #else 4579 ierr = NF_GET_VAR_REAL(nid,var3didin(8),qv_i) 4580 #endif 4581 if(ierr/=NF_NOERR) then 4582 write(*,*) NF_STRERROR(ierr) 4583 stop "getvarup" 4584 endif 4585 4586 #ifdef NC_DOUBLE 4587 ierr = NF_GET_VAR_DOUBLE(nid,var3didin(9),u_i) 4588 #else 4589 ierr = NF_GET_VAR_REAL(nid,var3didin(9),u_i) 4590 #endif 4591 if(ierr/=NF_NOERR) then 4592 write(*,*) NF_STRERROR(ierr) 4593 stop "getvarup" 4594 endif 4595 4596 #ifdef NC_DOUBLE 4597 ierr = NF_GET_VAR_DOUBLE(nid,var3didin(10),v_i) 4598 #else 4599 ierr = NF_GET_VAR_REAL(nid,var3didin(10),v_i) 4600 #endif 4601 if(ierr/=NF_NOERR) then 4602 write(*,*) NF_STRERROR(ierr) 4603 stop "getvarup" 4604 endif 4605 4606 #ifdef NC_DOUBLE 4607 ierr = NF_GET_VAR_DOUBLE(nid,var3didin(11),hadvt_i) 4608 #else 4609 ierr = NF_GET_VAR_REAL(nid,var3didin(11),hadvt_i) 4610 #endif 4611 if(ierr/=NF_NOERR) then 4612 write(*,*) NF_STRERROR(ierr) 4613 stop "getvarup" 4614 endif 4615 4616 #ifdef NC_DOUBLE 4617 ierr = NF_GET_VAR_DOUBLE(nid,var3didin(12),hadvq_i) 4618 #else 4619 ierr = NF_GET_VAR_REAL(nid,var3didin(12),hadvq_i) 4620 #endif 4621 if(ierr/=NF_NOERR) then 4622 write(*,*) NF_STRERROR(ierr) 4623 stop "getvarup" 4624 endif 4625 4626 #ifdef NC_DOUBLE 4627 ierr = NF_GET_VAR_DOUBLE(nid,var3didin(14),tsnow) 4628 #else 4629 ierr = NF_GET_VAR_REAL(nid,var3didin(14),tsnow) 4630 #endif 4631 if(ierr/=NF_NOERR) then 4632 write(*,*) NF_STRERROR(ierr) 4633 stop "getvarup" 4634 endif 4635 4636 #ifdef NC_DOUBLE 4637 ierr = NF_GET_VAR_DOUBLE(nid,var3didin(15),snow_dens) 4638 #else 4639 ierr = NF_GET_VAR_REAL(nid,var3didin(15),snow_dens) 4640 #endif 4641 if(ierr/=NF_NOERR) then 4642 write(*,*) NF_STRERROR(ierr) 4643 stop "getvarup" 4644 endif 4645 4646 #ifdef NC_DOUBLE 4647 ierr = NF_GET_VAR_DOUBLE(nid,var3didin(16),tg) 4648 #else 4649 ierr = NF_GET_VAR_REAL(nid,var3didin(16),tg) 4650 #endif 4651 if(ierr/=NF_NOERR) then 4652 write(*,*) NF_STRERROR(ierr) 4653 stop "getvarup" 4654 endif 4655 4656 ! On remet les variables lues dans le bon ordre des niveaux (MPL 20141024) 4657 do k=1,nlevel 4658 zz(k)=zz_i(nlevel+1-k) 4659 ug(k,:)=ug_i(nlevel+1-k,:) 4660 vg(k,:)=vg_i(nlevel+1-k,:) 4661 pf(k)=pf_i(nlevel+1-k) 4662 print *,'pf=',pf(k) 4663 th(k)=th_i(nlevel+1-k) 4664 t(k)=t_i(nlevel+1-k) 4665 qv(k)=qv_i(nlevel+1-k) 4666 u(k)=u_i(nlevel+1-k) 4667 v(k)=v_i(nlevel+1-k) 4668 hadvt(k,:)=hadvt_i(nlevel+1-k,:) 4669 hadvq(k,:)=hadvq_i(nlevel+1-k,:) 4670 enddo 4671 return 4672 end subroutine read_gabls4 4673 !===================================================================== 4674 4097 4675 ! Reads CIRC input files 4098 4676 … … 4390 4968 ! 4391 4969 ! Cette formule remplace d_q = (1/tau) [rh_targ - rh] qsat(T_new) 4392 ! qui n' était pas correcte.4970 ! qui n'etait pas correcte. 4393 4971 ! 4394 4972 IF (tnew.LT.RTT) THEN … … 4465 5043 END 4466 5044 5045 !===================================================================== 5046 SUBROUTINE interp2_case_vertical(play,nlev_cas,plev_prof_cas & 5047 & ,t_prof_cas,th_prof_cas,thv_prof_cas,thl_prof_cas & 5048 & ,qv_prof_cas,ql_prof_cas,qi_prof_cas,u_prof_cas,v_prof_cas & 5049 & ,ug_prof_cas,vg_prof_cas,vitw_prof_cas,omega_prof_cas & 5050 & ,du_prof_cas,hu_prof_cas,vu_prof_cas,dv_prof_cas,hv_prof_cas,vv_prof_cas & 5051 & ,dt_prof_cas,ht_prof_cas,vt_prof_cas,dtrad_prof_cas,dq_prof_cas,hq_prof_cas,vq_prof_cas & 5052 & ,dth_prof_cas,hth_prof_cas,vth_prof_cas & 5053 ! 5054 & ,t_mod_cas,theta_mod_cas,thv_mod_cas,thl_mod_cas & 5055 & ,qv_mod_cas,ql_mod_cas,qi_mod_cas,u_mod_cas,v_mod_cas & 5056 & ,ug_mod_cas,vg_mod_cas,w_mod_cas,omega_mod_cas & 5057 & ,du_mod_cas,hu_mod_cas,vu_mod_cas,dv_mod_cas,hv_mod_cas,vv_mod_cas & 5058 & ,dt_mod_cas,ht_mod_cas,vt_mod_cas,dtrad_mod_cas,dq_mod_cas,hq_mod_cas,vq_mod_cas & 5059 & ,dth_mod_cas,hth_mod_cas,vth_mod_cas,mxcalc) 5060 5061 implicit none 5062 5063 #include "dimensions.h" 5064 5065 !------------------------------------------------------------------------- 5066 ! Vertical interpolation of generic case forcing data onto mod_casel levels 5067 !------------------------------------------------------------------------- 5068 5069 integer nlevmax 5070 parameter (nlevmax=41) 5071 integer nlev_cas,mxcalc 5072 ! real play(llm), plev_prof(nlevmax) 5073 ! real t_prof(nlevmax),q_prof(nlevmax) 5074 ! real u_prof(nlevmax),v_prof(nlevmax), w_prof(nlevmax) 5075 ! real ht_prof(nlevmax),vt_prof(nlevmax) 5076 ! real hq_prof(nlevmax),vq_prof(nlevmax) 5077 5078 real play(llm), plev_prof_cas(nlev_cas) 5079 real t_prof_cas(nlev_cas),th_prof_cas(nlev_cas),thv_prof_cas(nlev_cas),thl_prof_cas(nlev_cas) 5080 real qv_prof_cas(nlev_cas),ql_prof_cas(nlev_cas),qi_prof_cas(nlev_cas) 5081 real u_prof_cas(nlev_cas),v_prof_cas(nlev_cas) 5082 real ug_prof_cas(nlev_cas),vg_prof_cas(nlev_cas), vitw_prof_cas(nlev_cas),omega_prof_cas(nlev_cas) 5083 real du_prof_cas(nlev_cas),hu_prof_cas(nlev_cas),vu_prof_cas(nlev_cas) 5084 real dv_prof_cas(nlev_cas),hv_prof_cas(nlev_cas),vv_prof_cas(nlev_cas) 5085 real dt_prof_cas(nlev_cas),ht_prof_cas(nlev_cas),vt_prof_cas(nlev_cas),dtrad_prof_cas(nlev_cas) 5086 real dth_prof_cas(nlev_cas),hth_prof_cas(nlev_cas),vth_prof_cas(nlev_cas) 5087 real dq_prof_cas(nlev_cas),hq_prof_cas(nlev_cas),vq_prof_cas(nlev_cas) 5088 5089 real t_mod_cas(llm),theta_mod_cas(llm),thv_mod_cas(llm),thl_mod_cas(llm) 5090 real qv_mod_cas(llm),ql_mod_cas(llm),qi_mod_cas(llm) 5091 real u_mod_cas(llm),v_mod_cas(llm) 5092 real ug_mod_cas(llm),vg_mod_cas(llm), w_mod_cas(llm),omega_mod_cas(llm) 5093 real du_mod_cas(llm),hu_mod_cas(llm),vu_mod_cas(llm) 5094 real dv_mod_cas(llm),hv_mod_cas(llm),vv_mod_cas(llm) 5095 real dt_mod_cas(llm),ht_mod_cas(llm),vt_mod_cas(llm),dtrad_mod_cas(llm) 5096 real dth_mod_cas(llm),hth_mod_cas(llm),vth_mod_cas(llm) 5097 real dq_mod_cas(llm),hq_mod_cas(llm),vq_mod_cas(llm) 5098 5099 integer l,k,k1,k2 5100 real frac,frac1,frac2,fact 5101 5102 do l = 1, llm 5103 print *,'debut interp2, play=',l,play(l) 5104 enddo 5105 ! do l = 1, nlev_cas 5106 ! print *,'debut interp2, plev_prof_cas=',l,play(l),plev_prof_cas(l) 5107 ! enddo 5108 5109 do l = 1, llm 5110 5111 if (play(l).ge.plev_prof_cas(nlev_cas)) then 5112 5113 mxcalc=l 5114 print *,'debut interp2, mxcalc=',mxcalc 5115 k1=0 5116 k2=0 5117 5118 if (play(l).le.plev_prof_cas(1)) then 5119 5120 do k = 1, nlev_cas-1 5121 if (play(l).le.plev_prof_cas(k).and. play(l).gt.plev_prof_cas(k+1)) then 5122 k1=k 5123 k2=k+1 5124 endif 5125 enddo 5126 5127 if (k1.eq.0 .or. k2.eq.0) then 5128 write(*,*) 'PB! k1, k2 = ',k1,k2 5129 write(*,*) 'l,play(l) = ',l,play(l)/100 5130 do k = 1, nlev_cas-1 5131 write(*,*) 'k,plev_prof_cas(k) = ',k,plev_prof_cas(k)/100 5132 enddo 5133 endif 5134 5135 frac = (plev_prof_cas(k2)-play(l))/(plev_prof_cas(k2)-plev_prof_cas(k1)) 5136 t_mod_cas(l)= t_prof_cas(k2) - frac*(t_prof_cas(k2)-t_prof_cas(k1)) 5137 theta_mod_cas(l)= th_prof_cas(k2) - frac*(th_prof_cas(k2)-th_prof_cas(k1)) 5138 thv_mod_cas(l)= thv_prof_cas(k2) - frac*(thv_prof_cas(k2)-thv_prof_cas(k1)) 5139 thl_mod_cas(l)= thl_prof_cas(k2) - frac*(thl_prof_cas(k2)-thl_prof_cas(k1)) 5140 qv_mod_cas(l)= qv_prof_cas(k2) - frac*(qv_prof_cas(k2)-qv_prof_cas(k1)) 5141 ql_mod_cas(l)= ql_prof_cas(k2) - frac*(ql_prof_cas(k2)-ql_prof_cas(k1)) 5142 qi_mod_cas(l)= qi_prof_cas(k2) - frac*(qi_prof_cas(k2)-qi_prof_cas(k1)) 5143 u_mod_cas(l)= u_prof_cas(k2) - frac*(u_prof_cas(k2)-u_prof_cas(k1)) 5144 v_mod_cas(l)= v_prof_cas(k2) - frac*(v_prof_cas(k2)-v_prof_cas(k1)) 5145 ug_mod_cas(l)= ug_prof_cas(k2) - frac*(ug_prof_cas(k2)-ug_prof_cas(k1)) 5146 vg_mod_cas(l)= vg_prof_cas(k2) - frac*(vg_prof_cas(k2)-vg_prof_cas(k1)) 5147 w_mod_cas(l)= vitw_prof_cas(k2) - frac*(vitw_prof_cas(k2)-vitw_prof_cas(k1)) 5148 omega_mod_cas(l)= omega_prof_cas(k2) - frac*(omega_prof_cas(k2)-omega_prof_cas(k1)) 5149 du_mod_cas(l)= du_prof_cas(k2) - frac*(du_prof_cas(k2)-du_prof_cas(k1)) 5150 hu_mod_cas(l)= hu_prof_cas(k2) - frac*(hu_prof_cas(k2)-hu_prof_cas(k1)) 5151 vu_mod_cas(l)= vu_prof_cas(k2) - frac*(vu_prof_cas(k2)-vu_prof_cas(k1)) 5152 dv_mod_cas(l)= dv_prof_cas(k2) - frac*(dv_prof_cas(k2)-dv_prof_cas(k1)) 5153 hv_mod_cas(l)= hv_prof_cas(k2) - frac*(hv_prof_cas(k2)-hv_prof_cas(k1)) 5154 vv_mod_cas(l)= vv_prof_cas(k2) - frac*(vv_prof_cas(k2)-vv_prof_cas(k1)) 5155 dt_mod_cas(l)= dt_prof_cas(k2) - frac*(dt_prof_cas(k2)-dt_prof_cas(k1)) 5156 ht_mod_cas(l)= ht_prof_cas(k2) - frac*(ht_prof_cas(k2)-ht_prof_cas(k1)) 5157 vt_mod_cas(l)= vt_prof_cas(k2) - frac*(vt_prof_cas(k2)-vt_prof_cas(k1)) 5158 dth_mod_cas(l)= dth_prof_cas(k2) - frac*(dth_prof_cas(k2)-dth_prof_cas(k1)) 5159 hth_mod_cas(l)= hth_prof_cas(k2) - frac*(hth_prof_cas(k2)-hth_prof_cas(k1)) 5160 vth_mod_cas(l)= vth_prof_cas(k2) - frac*(vth_prof_cas(k2)-vth_prof_cas(k1)) 5161 dq_mod_cas(l)= dq_prof_cas(k2) - frac*(dq_prof_cas(k2)-dq_prof_cas(k1)) 5162 hq_mod_cas(l)= hq_prof_cas(k2) - frac*(hq_prof_cas(k2)-hq_prof_cas(k1)) 5163 vq_mod_cas(l)= vq_prof_cas(k2) - frac*(vq_prof_cas(k2)-vq_prof_cas(k1)) 5164 5165 else !play>plev_prof_cas(1) 5166 5167 k1=1 5168 k2=2 5169 print *,'interp2_vert, k1,k2=',plev_prof_cas(k1),plev_prof_cas(k2) 5170 frac1 = (play(l)-plev_prof_cas(k2))/(plev_prof_cas(k1)-plev_prof_cas(k2)) 5171 frac2 = (play(l)-plev_prof_cas(k1))/(plev_prof_cas(k1)-plev_prof_cas(k2)) 5172 t_mod_cas(l)= frac1*t_prof_cas(k1) - frac2*t_prof_cas(k2) 5173 theta_mod_cas(l)= frac1*th_prof_cas(k1) - frac2*th_prof_cas(k2) 5174 thv_mod_cas(l)= frac1*thv_prof_cas(k1) - frac2*thv_prof_cas(k2) 5175 thl_mod_cas(l)= frac1*thl_prof_cas(k1) - frac2*thl_prof_cas(k2) 5176 qv_mod_cas(l)= frac1*qv_prof_cas(k1) - frac2*qv_prof_cas(k2) 5177 ql_mod_cas(l)= frac1*ql_prof_cas(k1) - frac2*ql_prof_cas(k2) 5178 qi_mod_cas(l)= frac1*qi_prof_cas(k1) - frac2*qi_prof_cas(k2) 5179 u_mod_cas(l)= frac1*u_prof_cas(k1) - frac2*u_prof_cas(k2) 5180 v_mod_cas(l)= frac1*v_prof_cas(k1) - frac2*v_prof_cas(k2) 5181 ug_mod_cas(l)= frac1*ug_prof_cas(k1) - frac2*ug_prof_cas(k2) 5182 vg_mod_cas(l)= frac1*vg_prof_cas(k1) - frac2*vg_prof_cas(k2) 5183 w_mod_cas(l)= frac1*vitw_prof_cas(k1) - frac2*vitw_prof_cas(k2) 5184 omega_mod_cas(l)= frac1*omega_prof_cas(k1) - frac2*omega_prof_cas(k2) 5185 du_mod_cas(l)= frac1*du_prof_cas(k1) - frac2*du_prof_cas(k2) 5186 hu_mod_cas(l)= frac1*hu_prof_cas(k1) - frac2*hu_prof_cas(k2) 5187 vu_mod_cas(l)= frac1*vu_prof_cas(k1) - frac2*vu_prof_cas(k2) 5188 dv_mod_cas(l)= frac1*dv_prof_cas(k1) - frac2*dv_prof_cas(k2) 5189 hv_mod_cas(l)= frac1*hv_prof_cas(k1) - frac2*hv_prof_cas(k2) 5190 vv_mod_cas(l)= frac1*vv_prof_cas(k1) - frac2*vv_prof_cas(k2) 5191 dt_mod_cas(l)= frac1*dt_prof_cas(k1) - frac2*dt_prof_cas(k2) 5192 ht_mod_cas(l)= frac1*ht_prof_cas(k1) - frac2*ht_prof_cas(k2) 5193 vt_mod_cas(l)= frac1*vt_prof_cas(k1) - frac2*vt_prof_cas(k2) 5194 dth_mod_cas(l)= frac1*dth_prof_cas(k1) - frac2*dth_prof_cas(k2) 5195 hth_mod_cas(l)= frac1*hth_prof_cas(k1) - frac2*hth_prof_cas(k2) 5196 vth_mod_cas(l)= frac1*vth_prof_cas(k1) - frac2*vth_prof_cas(k2) 5197 dq_mod_cas(l)= frac1*dq_prof_cas(k1) - frac2*dq_prof_cas(k2) 5198 hq_mod_cas(l)= frac1*hq_prof_cas(k1) - frac2*hq_prof_cas(k2) 5199 vq_mod_cas(l)= frac1*vq_prof_cas(k1) - frac2*vq_prof_cas(k2) 5200 5201 endif ! play.le.plev_prof_cas(1) 5202 5203 else ! above max altitude of forcing file 5204 5205 !jyg 5206 fact=20.*(plev_prof_cas(nlev_cas)-play(l))/plev_prof_cas(nlev_cas) !jyg 5207 fact = max(fact,0.) !jyg 5208 fact = exp(-fact) !jyg 5209 t_mod_cas(l)= t_prof_cas(nlev_cas) !jyg 5210 theta_mod_cas(l)= th_prof_cas(nlev_cas) !jyg 5211 thv_mod_cas(l)= thv_prof_cas(nlev_cas) !jyg 5212 thl_mod_cas(l)= thl_prof_cas(nlev_cas) !jyg 5213 qv_mod_cas(l)= qv_prof_cas(nlev_cas)*fact !jyg 5214 ql_mod_cas(l)= ql_prof_cas(nlev_cas)*fact !jyg 5215 qi_mod_cas(l)= qi_prof_cas(nlev_cas)*fact !jyg 5216 u_mod_cas(l)= u_prof_cas(nlev_cas)*fact !jyg 5217 v_mod_cas(l)= v_prof_cas(nlev_cas)*fact !jyg 5218 ug_mod_cas(l)= ug_prof_cas(nlev_cas)*fact !jyg 5219 vg_mod_cas(l)= vg_prof_cas(nlev_cas)*fact !jyg 5220 w_mod_cas(l)= 0.0 !jyg 5221 du_mod_cas(l)= du_prof_cas(nlev_cas)*fact 5222 hu_mod_cas(l)= hu_prof_cas(nlev_cas)*fact !jyg 5223 vu_mod_cas(l)= vu_prof_cas(nlev_cas)*fact !jyg 5224 dv_mod_cas(l)= dv_prof_cas(nlev_cas)*fact 5225 hv_mod_cas(l)= hv_prof_cas(nlev_cas)*fact !jyg 5226 vv_mod_cas(l)= vv_prof_cas(nlev_cas)*fact !jyg 5227 dt_mod_cas(l)= dt_prof_cas(nlev_cas) 5228 ht_mod_cas(l)= ht_prof_cas(nlev_cas) !jyg 5229 vt_mod_cas(l)= vt_prof_cas(nlev_cas) !jyg 5230 dth_mod_cas(l)= dth_prof_cas(nlev_cas) 5231 hth_mod_cas(l)= hth_prof_cas(nlev_cas) !jyg 5232 vth_mod_cas(l)= vth_prof_cas(nlev_cas) !jyg 5233 dq_mod_cas(l)= dq_prof_cas(nlev_cas)*fact 5234 hq_mod_cas(l)= hq_prof_cas(nlev_cas)*fact !jyg 5235 vq_mod_cas(l)= vq_prof_cas(nlev_cas)*fact !jyg 5236 5237 endif ! play 5238 5239 enddo ! l 5240 5241 ! do l = 1,llm 5242 ! print *,'t_mod_cas(l),q_mod_cas(l),ht_mod_cas(l),hq_mod_cas(l) ', 5243 ! $ l,t_mod_cas(l),q_mod_cas(l),ht_mod_cas(l),hq_mod_cas(l) 5244 ! enddo 5245 5246 return 5247 end 5248 !***************************************************************************** 5249 5250 -
LMDZ5/branches/testing/libf/phylmd/dyn1d/1D_decl_cases.h
r2408 r2720 33 33 34 34 real w_mod(llm), t_mod(llm),q_mod(llm) 35 real u_mod(llm),v_mod(llm), ht_mod(llm),vt_mod(llm) 35 real u_mod(llm),v_mod(llm), ht_mod(llm),vt_mod(llm),ug_mod(llm),vg_mod(llm) 36 36 real hq_mod(llm),vq_mod(llm),qv_mod(llm),ql_mod(llm),qt_mod(llm) 37 37 real th_mod(llm) … … 94 94 95 95 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 96 !Declarations specifiques au cas GABLS4 (MPL 20141023) 97 character*80 :: fich_gabls4 98 integer nlev_gabls4, nt_gabls4, nsol_gabls4 99 parameter (nlev_gabls4=90, nt_gabls4=37, nsol_gabls4=19) 100 integer year_ini_gabls4, day_ini_gabls4, mth_ini_gabls4 101 real heure_ini_gabls4 102 real day_ju_ini_gabls4 ! Julian day of gabls4 first day 103 parameter (year_ini_gabls4=2009) 104 parameter (mth_ini_gabls4=12) 105 parameter (day_ini_gabls4=11) ! 11 = 11 decembre 2009 106 parameter (heure_ini_gabls4=0.) !0UTC en secondes 107 real dt_gabls4 108 parameter (dt_gabls4=3600.) ! 1 forcage ttes les heures 109 110 !profils initiaux: 111 real plev_gabls4(nlev_gabls4) 112 real zz_gabls4(nlev_gabls4) 113 real th_gabls4(nlev_gabls4),t_gabls4(nlev_gabls4),qv_gabls4(nlev_gabls4) 114 real u_gabls4(nlev_gabls4), v_gabls4(nlev_gabls4) 115 real depth_sn_gabls4(nsol_gabls4),tsnow_gabls4(nsol_gabls4),snow_dens_gabls4(nsol_gabls4) 116 real t_gabi(nlev_gabls4),qv_gabi(nlev_gabls4) 117 real u_gabi(nlev_gabls4), v_gabi(nlev_gabls4),ug_gabi(nlev_gabls4), vg_gabi(nlev_gabls4) 118 real ht_gabi(nlev_gabls4),hq_gabi(nlev_gabls4),poub(nlev_gabls4) 119 120 !forcings 121 real ht_gabls4(nlev_gabls4,nt_gabls4),hq_gabls4(nlev_gabls4,nt_gabls4) 122 real ug_gabls4(nlev_gabls4,nt_gabls4),vg_gabls4(nlev_gabls4,nt_gabls4) 123 real tg_gabls4(nt_gabls4) 124 real ht_profg(nlev_gabls4),hq_profg(nlev_gabls4) 125 real ug_profg(nlev_gabls4),vg_profg(nlev_gabls4) 126 real tg_profg 127 128 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 129 96 130 !Declarations specifiques au cas DICE (MPL 02072013) 97 131 character*80 :: fich_dice … … 112 146 113 147 real zz_dice(nlev_dice) 114 real t h_dice(nlev_dice),qv_dice(nlev_dice)148 real t_dice(nlev_dice),qv_dice(nlev_dice) 115 149 real u_dice(nlev_dice), v_dice(nlev_dice),o3_dice(nlev_dice) 116 150 real ht_dice(nlev_dice,nt_dice) … … 119 153 real w_dice(nlev_dice,nt_dice),omega_dice(nlev_dice,nt_dice) 120 154 real o3_mod(llm),hu_mod(llm),hv_mod(llm) 121 real t h_dicei(nlev_dice),qv_dicei(nlev_dice)155 real t_dicei(nlev_dice),qv_dicei(nlev_dice) 122 156 real u_dicei(nlev_dice), v_dicei(nlev_dice),o3_dicei(nlev_dice) 123 157 real ht_dicei(nlev_dice) … … 209 243 real thl_mod(llm),omega_mod(llm),o3mmr_mod(llm),tke_mod(llm) 210 244 !vertical advection computation 211 real d_t_z(llm), d_q_z(llm)212 real d_t_dyn_z(llm), d_q_dyn_z(llm)245 real d_t_z(llm),d_th_z(llm), d_q_z(llm) 246 real d_t_dyn_z(llm),d_th_dyn_z(llm), d_q_dyn_z(llm) 213 247 real d_u_z(llm),d_v_z(llm) 214 248 real d_u_dyn(llm),d_v_dyn(llm) … … 244 278 245 279 real w_mod_cas(llm), t_mod_cas(llm),q_mod_cas(llm) 280 real theta_mod_cas(llm),thl_mod_cas(llm),thv_mod_cas(llm) 281 real qv_mod_cas(llm),ql_mod_cas(llm),qi_mod_cas(llm) 246 282 real ug_mod_cas(llm),vg_mod_cas(llm) 247 283 real u_mod_cas(llm),v_mod_cas(llm) 284 real omega_mod_cas(llm) 248 285 real ht_mod_cas(llm),vt_mod_cas(llm),dt_mod_cas(llm),dtrad_mod_cas(llm) 286 real hth_mod_cas(llm),vth_mod_cas(llm),dth_mod_cas(llm) 249 287 real hq_mod_cas(llm),vq_mod_cas(llm),dq_mod_cas(llm) 250 288 real hu_mod_cas(llm),vu_mod_cas(llm),du_mod_cas(llm) … … 253 291 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 254 292 293 -
LMDZ5/branches/testing/libf/phylmd/dyn1d/1D_interp_cases.h
r2594 r2720 118 118 ! vertical interpolation: 119 119 CALL interp_dice_vertical(play,nlev_dice,nt_dice,plev_dice & 120 & ,t h_dice,qv_dice,u_dice,v_dice,o3_dice &120 & ,t_dice,qv_dice,u_dice,v_dice,o3_dice & 121 121 & ,ht_profd,hq_profd,hu_profd,hv_profd,w_profd,omega_profd & 122 & ,t h_mod,qv_mod,u_mod,v_mod,o3_mod &122 & ,t_mod,qv_mod,u_mod,v_mod,o3_mod & 123 123 & ,ht_mod,hq_mod,hu_mod,hv_mod,w_mod,omega_mod,mxcalc) 124 124 ! do l = 1, llm … … 192 192 endif ! forcing_dice 193 193 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 194 ! Interpolation gabls4 forcing 195 !--------------------------------------------------------------------- 196 if (forcing_gabls4 ) then 197 198 if (prt_level.ge.1) then 199 print*,'#### ITAP,day,day1,(day-day1)*86400,(day-day1)*86400/dt_gabls4=',& 200 & day,day1,(day-day1)*86400.,(day-day1)*86400/dt_gabls4 201 endif 202 203 ! time interpolation: 204 CALL interp_gabls4_time(daytime,day1,annee_ref & 205 & ,year_ini_gabls4,day_ju_ini_gabls4,nt_gabls4,dt_gabls4,nlev_gabls4 & 206 & ,ug_gabls4,vg_gabls4,ht_gabls4,hq_gabls4,tg_gabls4 & 207 & ,ug_profg,vg_profg,ht_profg,hq_profg,tg_profg) 208 209 if (type_ts_forcing.eq.1) ts_cur = tg_prof ! SST used in read_tsurf1d 210 211 ! vertical interpolation: 212 ! on re-utilise le programme interp_dice_vertical: les transformations sur 213 ! plev_gabls4,th_gabls4,qv_gabls4,u_gabls4,v_gabls4 ne sont pas prises en compte. 214 ! seules celles sur ht_profg,hq_profg,ug_profg,vg_profg sont prises en compte. 215 216 CALL interp_dice_vertical(play,nlev_gabls4,nt_gabls4,plev_gabls4 & 217 ! & ,t_gabls4,qv_gabls4,u_gabls4,v_gabls4,poub & 218 & ,poub,poub,poub,poub,poub & 219 & ,ht_profg,hq_profg,ug_profg,vg_profg,poub,poub & 220 & ,t_mod,qv_mod,u_mod,v_mod,o3_mod & 221 & ,ht_mod,hq_mod,ug_mod,vg_mod,w_mod,omega_mod,mxcalc) 222 223 do l = 1, llm 224 ug(l)= ug_mod(l) 225 vg(l)= vg_mod(l) 226 d_th_adv(l)=ht_mod(l) 227 d_q_adv(l,1)=hq_mod(l) 228 enddo 229 230 endif ! forcing_gabls4 231 !--------------------------------------------------------------------- 232 194 233 !--------------------------------------------------------------------- 195 234 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! … … 766 805 enddo 767 806 807 ! Faut-il multiplier par -1 ? (MPL 20160713) 808 IF(ok_flux_surf) THEN 809 fsens=sens_prof_cas 810 flat=lat_prof_cas 811 ENDIF 812 ! 813 IF (ok_prescr_ust) THEN 814 ust=ustar_prof_cas 815 print *,'ust=',ust 816 ENDIF 768 817 endif ! forcing_case 769 818 770 819 771 820 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 772 821 !--------------------------------------------------------------------- 822 ! Interpolation forcing standard case 823 !--------------------------------------------------------------------- 824 if (forcing_case2) then 825 826 print*, & 827 & '#### ITAP,day,day1,(day-day1)*86400,(day-day1)*86400/pdt_cas=', & 828 & daytime,day1,(daytime-day1)*86400., & 829 & (daytime-day1)*86400/pdt_cas 830 831 ! time interpolation: 832 CALL interp2_case_time(daytime,day1,annee_ref & 833 ! & ,year_ini_cas,day_ju_ini_cas,nt_cas,pdt_cas,nlev_cas & 834 & ,nt_cas,nlev_cas & 835 & ,ts_cas,ps_cas,plev_cas,t_cas,th_cas,thv_cas,thl_cas,qv_cas,ql_cas,qi_cas & 836 & ,u_cas,v_cas,ug_cas,vg_cas,vitw_cas,omega_cas,du_cas,hu_cas,vu_cas & 837 & ,dv_cas,hv_cas,vv_cas,dt_cas,ht_cas,vt_cas,dtrad_cas & 838 & ,dq_cas,hq_cas,vq_cas,dth_cas,hth_cas,vth_cas,lat_cas,sens_cas,ustar_cas & 839 & ,uw_cas,vw_cas,q1_cas,q2_cas,tke_cas & 840 ! 841 & ,ts_prof_cas,plev_prof_cas,t_prof_cas,theta_prof_cas,thv_prof_cas & 842 & ,thl_prof_cas,qv_prof_cas,ql_prof_cas,qi_prof_cas & 843 & ,u_prof_cas,v_prof_cas,ug_prof_cas,vg_prof_cas,vitw_prof_cas,omega_prof_cas & 844 & ,du_prof_cas,hu_prof_cas,vu_prof_cas & 845 & ,dv_prof_cas,hv_prof_cas,vv_prof_cas,dt_prof_cas,ht_prof_cas,vt_prof_cas & 846 & ,dtrad_prof_cas,dq_prof_cas,hq_prof_cas,vq_prof_cas & 847 & ,dth_prof_cas,hth_prof_cas,vth_prof_cas,lat_prof_cas & 848 & ,sens_prof_cas,ustar_prof_cas,uw_prof_cas,vw_prof_cas,q1_prof_cas,q2_prof_cas,tke_prof_cas) 849 850 ts_cur = ts_prof_cas 851 ! psurf=plev_prof_cas(1) 852 psurf=ps_prof_cas 853 854 ! vertical interpolation: 855 CALL interp2_case_vertical(play,nlev_cas,plev_prof_cas & 856 & ,t_prof_cas,theta_prof_cas,thv_prof_cas,thl_prof_cas & 857 & ,qv_prof_cas,ql_prof_cas,qi_prof_cas,u_prof_cas,v_prof_cas & 858 & ,ug_prof_cas,vg_prof_cas,vitw_prof_cas,omega_prof_cas & 859 & ,du_prof_cas,hu_prof_cas,vu_prof_cas,dv_prof_cas,hv_prof_cas,vv_prof_cas & 860 & ,dt_prof_cas,ht_prof_cas,vt_prof_cas,dtrad_prof_cas,dq_prof_cas,hq_prof_cas,vq_prof_cas & 861 & ,dth_prof_cas,hth_prof_cas,vth_prof_cas & 862 ! 863 & ,t_mod_cas,theta_mod_cas,thv_mod_cas,thl_mod_cas,qv_mod_cas,ql_mod_cas,qi_mod_cas & 864 & ,u_mod_cas,v_mod_cas,ug_mod_cas,vg_mod_cas,w_mod_cas,omega_mod_cas & 865 & ,du_mod_cas,hu_mod_cas,vu_mod_cas,dv_mod_cas,hv_mod_cas,vv_mod_cas & 866 & ,dt_mod_cas,ht_mod_cas,vt_mod_cas,dtrad_mod_cas,dq_mod_cas,hq_mod_cas,vq_mod_cas & 867 & ,dth_mod_cas,hth_mod_cas,vth_mod_cas,mxcalc) 868 869 870 DO l=1,llm 871 teta(l)=temp(l)*(100000./play(l))**(rd/rcpd) 872 ENDDO 873 !calcul de l'advection verticale a partir du omega 874 !Calcul des gradients verticaux 875 !initialisation 876 d_t_z(:)=0. 877 d_th_z(:)=0. 878 d_q_z(:)=0. 879 d_t_dyn_z(:)=0. 880 d_th_dyn_z(:)=0. 881 d_q_dyn_z(:)=0. 882 DO l=2,llm-1 883 d_t_z(l)=(temp(l+1)-temp(l-1))/(play(l+1)-play(l-1)) 884 d_th_z(l)=(teta(l+1)-teta(l-1))/(play(l+1)-play(l-1)) 885 d_q_z(l)=(q(l+1,1)-q(l-1,1))/(play(l+1)-play(l-1)) 886 ENDDO 887 d_t_z(1)=d_t_z(2) 888 d_th_z(1)=d_th_z(2) 889 d_q_z(1)=d_q_z(2) 890 d_t_z(llm)=d_t_z(llm-1) 891 d_th_z(llm)=d_th_z(llm-1) 892 d_q_z(llm)=d_q_z(llm-1) 893 894 !Calcul de l advection verticale 895 d_t_dyn_z(:)=w_mod_cas(:)*d_t_z(:) 896 d_th_dyn_z(:)=w_mod_cas(:)*d_th_z(:) 897 d_q_dyn_z(:)=w_mod_cas(:)*d_q_z(:) 898 899 !wind nudging 900 if (nudging_u.gt.0.) then 901 do l=1,llm 902 u(l)=u(l)+timestep*(u_mod_cas(l)-u(l))/(nudge_u) 903 enddo 904 else 905 do l=1,llm 906 ug(l) = u_mod_cas(l) 907 enddo 908 endif 909 910 if (nudging_v.gt.0.) then 911 do l=1,llm 912 v(l)=v(l)+timestep*(v_mod_cas(l)-v(l))/(nudge_v) 913 enddo 914 else 915 do l=1,llm 916 vg(l) = v_mod_cas(l) 917 enddo 918 endif 919 920 if (nudging_w.gt.0.) then 921 do l=1,llm 922 w(l)=w(l)+timestep*(w_mod_cas(l)-w(l))/(nudge_w) 923 enddo 924 else 925 do l=1,llm 926 w(l) = w_mod_cas(l) 927 enddo 928 endif 929 930 !nudging of q and temp 931 if (nudging_t.gt.0.) then 932 do l=1,llm 933 temp(l)=temp(l)+timestep*(t_mod_cas(l)-temp(l))/(nudge_t) 934 enddo 935 endif 936 if (nudging_q.gt.0.) then 937 do l=1,llm 938 q(l,1)=q(l,1)+timestep*(q_mod_cas(l)-q(l,1))/(nudge_q) 939 enddo 940 endif 941 942 do l = 1, llm 943 omega(l) = w_mod_cas(l) 944 omega2(l)= omega(l)/rg*airefi ! flxmass_w calcule comme ds physiq 945 alpha = rd*temp(l)*(1.+(rv/rd-1.)*q(l,1))/play(l) 946 947 !calcul advection 948 ! if ((tend_u.eq.1).and.(tend_w.eq.0)) then 949 ! d_u_adv(l)=du_mod_cas(l) 950 ! else if ((tend_u.eq.1).and.(tend_w.eq.1)) then 951 ! d_u_adv(l)=hu_mod_cas(l)-d_u_dyn_z(l) 952 ! endif 953 ! 954 ! if ((tend_v.eq.1).and.(tend_w.eq.0)) then 955 ! d_v_adv(l)=dv_mod_cas(l) 956 ! else if ((tend_v.eq.1).and.(tend_w.eq.1)) then 957 ! d_v_adv(l)=hv_mod_cas(l)-d_v_dyn_z(l) 958 ! endif 959 ! 960 !----------------------------------------------------- 961 if (tadv.eq.1 .or. tadvh.eq.1) then 962 d_t_adv(l)=alpha*omega(l)/rcpd-dt_mod_cas(l) 963 else if (tadvv.eq.1) then 964 ! ATTENTION d_t_dyn_z pas calcule (voir twpice) 965 d_t_adv(l)=alpha*omega(l)/rcpd-ht_mod_cas(l)-d_t_dyn_z(l) 966 endif 967 print *,'interp_case d_t_dyn_z=',d_t_dyn_z(l),d_q_dyn_z(l) 968 969 ! Verifier le signe !! 970 if (thadv.eq.1 .or. thadvh.eq.1) then 971 d_th_adv(l)=dth_mod_cas(l) 972 print *,'dthadv=',d_th_adv(l)*86400. 973 else if (thadvv.eq.1) then 974 d_th_adv(l)=hth_mod_cas(l)-d_th_dyn_z(l) 975 endif 976 977 ! Verifier le signe !! 978 if ((qadv.eq.1).and.(forc_w.eq.0)) then 979 d_q_adv(l,1)=dq_mod_cas(l) 980 else if ((qadvh.eq.1).and.(forc_w.eq.1)) then 981 d_q_adv(l,1)=hq_mod_cas(l)-d_q_dyn_z(l) 982 endif 983 984 if (trad.eq.1) then 985 tend_rayo=1 986 dt_cooling(l) = dtrad_mod_cas(l) 987 ! print *,'dt_cooling=',dt_cooling(l) 988 else 989 dt_cooling(l) = 0.0 990 endif 991 enddo 992 993 ! Faut-il multiplier par -1 ? (MPL 20160713) 994 IF(ok_flux_surf) THEN 995 fsens=-1.*sens_prof_cas 996 flat=-1.*lat_prof_cas 997 print *,'1D_interp: sens,flat',fsens,flat 998 ENDIF 999 ! 1000 IF (ok_prescr_ust) THEN 1001 ust=ustar_prof_cas 1002 print *,'ust=',ust 1003 ENDIF 1004 endif ! forcing_case2 1005 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 1006 -
LMDZ5/branches/testing/libf/phylmd/dyn1d/1D_read_forc_cases.h
r2408 r2720 367 367 fich_dice='dice_driver.nc' 368 368 call read_dice(fich_dice,nlev_dice,nt_dice & 369 & ,zz_dice,plev_dice,t h_dice,qv_dice,u_dice,v_dice,o3_dice &369 & ,zz_dice,plev_dice,t_dice,qv_dice,u_dice,v_dice,o3_dice & 370 370 & ,shf_dice,lhf_dice,lwup_dice,swup_dice,tg_dice,ustar_dice& 371 371 & ,psurf_dice,ug_dice,vg_dice,ht_dice,hq_dice & … … 376 376 !champs initiaux: 377 377 do k=1,nlev_dice 378 t h_dicei(k)=th_dice(k)378 t_dicei(k)=t_dice(k) 379 379 qv_dicei(k)=qv_dice(k) 380 380 u_dicei(k)=u_dice(k) … … 405 405 406 406 CALL interp_dice_vertical(play,nlev_dice,nt_dice,plev_dice & 407 & ,t h_dicei,qv_dicei,u_dicei,v_dicei,o3_dicei &407 & ,t_dicei,qv_dicei,u_dicei,v_dicei,o3_dicei & 408 408 & ,ht_dicei,hq_dicei,hu_dicei,hv_dicei,w_dicei,omega_dicei& 409 & ,t h_mod,qv_mod,u_mod,v_mod,o3_mod &409 & ,t_mod,qv_mod,u_mod,v_mod,o3_mod & 410 410 & ,ht_mod,hq_mod,hu_mod,hv_mod,w_mod,omega_mod,mxcalc) 411 411 … … 425 425 do l = 1, llm 426 426 ! Ligne du dessous ?? decommenter si on lit theta au lieu de temp 427 428 !temp(l) = t_mod(l)427 ! temp(l) = th_mod(l)*(play(l)/pzero)**rkappa 428 temp(l) = t_mod(l) 429 429 q(l,1) = qv_mod(l) 430 430 q(l,2) = 0.0 … … 473 473 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 474 474 !--------------------------------------------------------------------- 475 ! Forcing from GABLS4 experiment 476 !--------------------------------------------------------------------- 477 478 !!!! Si la temperature de surface n'est pas impos??e: 479 480 if (forcing_gabls4) then 481 !read GABLS4 forcings 482 483 fich_gabls4='gabls4_driver.nc' 484 485 486 call read_gabls4(fich_gabls4,nlev_gabls4,nt_gabls4,nsol_gabls4,zz_gabls4,depth_sn_gabls4,ug_gabls4,vg_gabls4 & 487 & ,plev_gabls4,th_gabls4,t_gabls4,qv_gabls4,u_gabls4,v_gabls4,ht_gabls4,hq_gabls4,tg_gabls4,tsnow_gabls4,snow_dens_gabls4) 488 489 write(*,*) 'Forcing GABLS4 lu' 490 491 !champs initiaux: 492 do k=1,nlev_gabls4 493 t_gabi(k)=t_gabls4(k) 494 qv_gabi(k)=qv_gabls4(k) 495 u_gabi(k)=u_gabls4(k) 496 v_gabi(k)=v_gabls4(k) 497 poub(k)=0. 498 ht_gabi(k)=ht_gabls4(k,1) 499 hq_gabi(k)=hq_gabls4(k,1) 500 ug_gabi(k)=ug_gabls4(k,1) 501 vg_gabi(k)=vg_gabls4(k,1) 502 enddo 503 504 omega(:)=0. 505 omega2(:)=0. 506 rho(:)=0. 507 ! vertical interpolation using TOGA interpolation routine: 508 ! write(*,*)'avant interp vert', t_proftwp 509 ! 510 ! CALL interp_dice_time(daytime,day1,annee_ref 511 ! i ,year_ini_dice,day_ju_ini_dice,nt_dice,dt_dice 512 ! i ,nlev_dice,shf_dice,lhf_dice,lwup_dice,swup_dice 513 ! i ,tg_dice,ustar_dice,psurf_dice,ug_dice,vg_dice 514 ! i ,ht_dice,hq_dice,hu_dice,hv_dice,w_dice,omega_dice 515 ! o ,shf_prof,lhf_prof,lwup_prof,swup_prof,tg_prof 516 ! o ,ustar_prof,psurf_prof,ug_profd,vg_profd 517 ! o ,ht_profd,hq_profd,hu_profd,hv_profd,w_profd 518 ! o ,omega_profd) 519 520 CALL interp_dice_vertical(play,nlev_gabls4,nt_gabls4,plev_gabls4 & 521 & ,t_gabi,qv_gabi,u_gabi,v_gabi,poub & 522 & ,ht_gabi,hq_gabi,ug_gabi,vg_gabi,poub,poub & 523 & ,t_mod,qv_mod,u_mod,v_mod,o3_mod & 524 & ,ht_mod,hq_mod,ug_mod,vg_mod,w_mod,omega_mod,mxcalc) 525 526 ! Les forcages GABLS4 ont l air d etre en K/S quoiqu en dise le fichier gabls4_driver.nc !? MPL 20141024 527 ! ht_mod(:)=ht_mod(:)/86400. 528 ! hq_mod(:)=hq_mod(:)/86400. 529 530 ! initial and boundary conditions : 531 write(*,*) 'SST initiale mxcalc: ',tsurf,mxcalc 532 do l = 1, llm 533 ! Ligne du dessous ?? decommenter si on lit theta au lieu de temp 534 ! temp(l) = th_mod(l)*(play(l)/pzero)**rkappa 535 temp(l) = t_mod(l) 536 q(l,1) = qv_mod(l) 537 q(l,2) = 0.0 538 ! print *,'read_forc: l,temp,q=',l,temp(l),q(l,1) 539 u(l) = u_mod(l) 540 v(l) = v_mod(l) 541 ug(l)=ug_mod(l) 542 vg(l)=vg_mod(l) 543 544 ! 545 ! tg=tsurf 546 ! 547 548 print *,'***** tsurf=',tsurf 549 rho(l) = play(l)/(rd*temp(l)*(1.+(rv/rd-1.)*q(l,1))) 550 ! omega(l) = w_mod(l)*(-rg*rho(l)) 551 omega(l) = omega_mod(l) 552 omega2(l)=omega(l)/rg*airefi ! flxmass_w calcule comme ds physiq 553 554 555 556 alpha = rd*temp(l)*(1.+(rv/rd-1.)*q(l,1))/play(l) 557 !on applique le forcage total au premier pas de temps 558 !attention: signe different de toga 559 ! d_th_adv(l) = alpha*omega(l)/rcpd+ht_mod(l) 560 !forcage en th 561 d_th_adv(l) = ht_mod(l) 562 d_q_adv(l,1) = hq_mod(l) 563 d_q_adv(l,2) = 0.0 564 dt_cooling(l)=0. 565 enddo 566 567 !--------------- Residus forcages du cas Dice (a supprimer) MPL 20141024--------------- 568 ! Le cas Dice doit etre force avec ustar mais on peut simplifier en forcant par 569 ! le coefficient de trainee en surface cd**2=ustar*vent(k=1) 570 ! On commence ici a stocker ustar dans cdrag puis on terminera le calcul dans pbl_surface 571 ! MPL 05082013 572 ! ust=ustar_dice(1) 573 ! tg=tg_dice(1) 574 ! print *,'ust= ',ust 575 ! IF (tsurf .LE. 0.) THEN 576 ! tsurf= tg_dice(1) 577 ! ENDIF 578 ! psurf= psurf_dice(1) 579 ! solsw_in = (1.-albedo)/albedo*swup_dice(1) 580 ! sollw_in = (0.7*RSIGMA*temp(1)**4)-lwup_dice(1) 581 ! PRINT *,'1D_READ_FORC : solsw, sollw',solsw_in,sollw_in 582 !-------------------------------------------------------------------------------------- 583 endif !forcing_gabls4 584 585 586 475 587 ! Forcing from Arm_Cu case 476 588 ! For this case, ifa_armcu.txt contains sensible, latent heat fluxes … … 797 909 endif !forcing_case 798 910 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 911 !--------------------------------------------------------------------- 912 ! Forcing from standard case : 913 !--------------------------------------------------------------------- 914 915 if (forcing_case2) then 916 917 write(*,*),'avant call read2_1D_cas' 918 call read2_1D_cas 919 write(*,*) 'Forcing read' 920 921 !Time interpolation for initial conditions using interpolation routine 922 write(*,*) 'AVT 1ere INTERPOLATION: day,day1 = ',daytime,day1 923 CALL interp2_case_time(daytime,day1,annee_ref & 924 ! & ,year_ini_cas,day_ju_ini_cas,nt_cas,pdt_cas,nlev_cas & 925 & ,nt_cas,nlev_cas & 926 & ,ts_cas,ps_cas,plev_cas,t_cas,th_cas,thv_cas,thl_cas,qv_cas,ql_cas,qi_cas & 927 & ,u_cas,v_cas,ug_cas,vg_cas,vitw_cas,omega_cas,du_cas,hu_cas,vu_cas & 928 & ,dv_cas,hv_cas,vv_cas,dt_cas,ht_cas,vt_cas,dtrad_cas & 929 & ,dq_cas,hq_cas,vq_cas,dth_cas,hth_cas,vth_cas,lat_cas,sens_cas,ustar_cas & 930 & ,uw_cas,vw_cas,q1_cas,q2_cas,tke_cas & 931 ! 932 & ,ts_prof_cas,plev_prof_cas,t_prof_cas,theta_prof_cas,thv_prof_cas & 933 & ,thl_prof_cas,qv_prof_cas,ql_prof_cas,qi_prof_cas & 934 & ,u_prof_cas,v_prof_cas,ug_prof_cas,vg_prof_cas,vitw_prof_cas,omega_prof_cas & 935 & ,du_prof_cas,hu_prof_cas,vu_prof_cas & 936 & ,dv_prof_cas,hv_prof_cas,vv_prof_cas,dt_prof_cas,ht_prof_cas,vt_prof_cas & 937 & ,dtrad_prof_cas,dq_prof_cas,hq_prof_cas,vq_prof_cas & 938 & ,dth_prof_cas,hth_prof_cas,vth_prof_cas,lat_prof_cas & 939 & ,sens_prof_cas,ustar_prof_cas,uw_prof_cas,vw_prof_cas,q1_prof_cas,q2_prof_cas,tke_prof_cas) 940 941 do l = 1, nlev_cas 942 print *,'apres 1ere interp: plev_cas, plev_prof_cas=',l,plev_cas(l,1),plev_prof_cas(l) 943 enddo 944 945 ! vertical interpolation using interpolation routine: 946 ! write(*,*)'avant interp vert', t_prof 947 CALL interp2_case_vertical(play,nlev_cas,plev_prof_cas & 948 & ,t_prof_cas,theta_prof_cas,thv_prof_cas,thl_prof_cas & 949 & ,qv_prof_cas,ql_prof_cas,qi_prof_cas,u_prof_cas,v_prof_cas & 950 & ,ug_prof_cas,vg_prof_cas,vitw_prof_cas,omega_prof_cas & 951 & ,du_prof_cas,hu_prof_cas,vu_prof_cas,dv_prof_cas,hv_prof_cas,vv_prof_cas & 952 & ,dt_prof_cas,ht_prof_cas,vt_prof_cas,dtrad_prof_cas,dq_prof_cas,hq_prof_cas,vq_prof_cas & 953 & ,dth_prof_cas,hth_prof_cas,vth_prof_cas & 954 ! 955 & ,t_mod_cas,theta_mod_cas,thv_mod_cas,thl_mod_cas,qv_mod_cas,ql_mod_cas,qi_mod_cas & 956 & ,u_mod_cas,v_mod_cas,ug_mod_cas,vg_mod_cas,w_mod_cas,omega_mod_cas & 957 & ,du_mod_cas,hu_mod_cas,vu_mod_cas,dv_mod_cas,hv_mod_cas,vv_mod_cas & 958 & ,dt_mod_cas,ht_mod_cas,vt_mod_cas,dtrad_mod_cas,dq_mod_cas,hq_mod_cas,vq_mod_cas & 959 & ,dth_mod_cas,hth_mod_cas,vth_mod_cas,mxcalc) 960 961 ! write(*,*) 'Profil initial forcing case interpole',t_mod 962 963 ! initial and boundary conditions : 964 ! tsurf = ts_prof_cas 965 ts_cur = ts_prof_cas 966 psurf=plev_prof_cas(1) 967 write(*,*) 'SST initiale: ',tsurf 968 do l = 1, llm 969 temp(l) = t_mod_cas(l) 970 q(l,1) = qv_mod_cas(l) 971 q(l,2) = ql_mod_cas(l) 972 u(l) = u_mod_cas(l) 973 ug(l)= u_mod_cas(l) 974 v(l) = v_mod_cas(l) 975 vg(l)= v_mod_cas(l) 976 omega(l) = w_mod_cas(l) 977 omega2(l)=omega(l)/rg*airefi ! flxmass_w calcule comme ds physiq 978 979 alpha = rd*temp(l)*(1.+(rv/rd-1.)*q(l,1))/play(l) 980 !on applique le forcage total au premier pas de temps 981 !attention: signe different de toga 982 d_th_adv(l) = alpha*omega(l)/rcpd+(ht_mod_cas(l)+vt_mod_cas(l)) 983 d_t_adv(l) = alpha*omega(l)/rcpd+(ht_mod_cas(l)+vt_mod_cas(l)) 984 ! d_q_adv(l,1) = (hq_mod_cas(l)+vq_mod_cas(l)) 985 d_q_adv(l,1) = dq_mod_cas(l) 986 d_q_adv(l,2) = 0.0 987 ! d_u_adv(l) = (hu_mod_cas(l)+vu_mod_cas(l)) 988 d_u_adv(l) = du_mod_cas(l) 989 ! d_u_adv(l) = (hv_mod_cas(l)+vv_mod_cas(l)) 990 d_u_adv(l) = dv_mod_cas(l) 991 enddo 992 993 ! Faut-il multiplier par -1 ? (MPL 20160713) 994 IF (ok_flux_surf) THEN 995 fsens=-1.*sens_prof_cas 996 flat=-1.*lat_prof_cas 997 ENDIF 998 ! 999 IF (ok_prescr_ust) THEN 1000 ust=ustar_prof_cas 1001 print *,'ust=',ust 1002 ENDIF 1003 1004 endif !forcing_case2 1005 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 1006 -
LMDZ5/branches/testing/libf/phylmd/dyn1d/compar1d.h
r2408 r2720 9 9 real :: tsurf 10 10 real :: rugos 11 real :: rugosh 11 12 real :: xqsol(1:2) 12 13 real :: qsurf … … 14 15 real :: zsurf 15 16 real :: albedo 17 real :: snowmass 16 18 17 19 real :: time … … 30 32 logical :: ok_old_disvert 31 33 34 ! Pour les forcages communs: ces entiers valent 0 ou 1 35 ! tadv= advection tempe, tadvv= adv tempe verticale, tadvh= adv tempe horizontale 36 ! idem pour l advection en theta 37 ! qadv= advection q, qadvv= adv q verticale, qadvh= adv q horizontale 38 ! trad= 0 (rayonnement actif) ou 1 (prescrit par tend_rad) ou adv (prescir et contenu dans les tadv) 39 ! forcages en omega, w, vent geostrophique ou ustar 40 ! Parametres de nudging en u,v,t,q valent 0 ou 1 ou le temps de nudging 41 42 integer :: tadv, tadvv, tadvh, qadv, qadvv, qadvh, thadv, thadvv, thadvh, trad 43 integer :: forc_omega, forc_w, forc_geo, forc_ustar 44 real :: nudging_u, nudging_v, nudging_w, nudging_t, nudging_q 32 45 common/com_par1d/ & 33 & nat_surf,tsurf,rugos, 46 & nat_surf,tsurf,rugos,rugosh, & 34 47 & xqsol,qsurf,psurf,zsurf,albedo,time,time_ini,xlat,xlon,airefi, & 35 48 & wtsurf,wqsurf,restart_runoff,xagesno,qsolinp,zpicinp, & 36 49 & forcing_type,tend_u,tend_v,tend_w,tend_t,tend_q,tend_rayo, & 37 50 & nudge_u,nudge_v,nudge_w,nudge_t,nudge_q, & 38 & iflag_nudge, & 39 & restart,ok_old_disvert 51 & iflag_nudge,snowmass, & 52 & restart,ok_old_disvert, & 53 & tadv, tadvv, tadvh, qadv, qadvv, qadvh, thadv, thadvv, thadvh, & 54 & trad, forc_omega, forc_w, forc_geo, forc_ustar, & 55 & nudging_u, nudging_v, nudging_t, nudging_q 40 56 41 57 !$OMP THREADPRIVATE(/com_par1d/) … … 50 66 51 67 68 -
LMDZ5/branches/testing/libf/phylmd/dyn1d/lmdz1d.F90
r2641 r2720 21 21 zgam, zmax0, zmea, zpic, zsig, & 22 22 zstd, zthe, zval, ale_bl, ale_bl_trig, alp_bl 23 23 24 USE dimphy 24 25 USE surface_data, only : type_ocean,ok_veget … … 31 32 USE indice_sol_mod 32 33 USE phyaqua_mod 33 USE mod_1D_cases_read 34 ! USE mod_1D_cases_read 35 USE mod_1D_cases_read2 34 36 USE mod_1D_amma_read 35 37 USE print_control_mod, ONLY: lunout, prt_level … … 131 133 logical :: forcing_amma = .false. 132 134 logical :: forcing_dice = .false. 135 logical :: forcing_gabls4 = .false. 136 133 137 logical :: forcing_GCM2SCM = .false. 134 138 logical :: forcing_GCSSold = .false. … … 137 141 logical :: forcing_fire = .false. 138 142 logical :: forcing_case = .false. 143 logical :: forcing_case2 = .false. 139 144 integer :: type_ts_forcing ! 0 = SST constant; 1 = SST read from a file 140 145 ! (cf read_tsurf1d.F) … … 174 179 real :: pzero=1.e5 175 180 real :: play (llm),zlay (llm),sig_s(llm),plev(llm+1) 176 real :: playd(llm),zlayd(llm),ap_amma(llm+1),bp_amma(llm+1) ,poub181 real :: playd(llm),zlayd(llm),ap_amma(llm+1),bp_amma(llm+1) 177 182 178 183 !--------------------------------------------------------------------- … … 189 194 real :: du_phys(llm),dv_phys(llm),dt_phys(llm) 190 195 real :: dt_dyn(llm) 191 real :: dt_cooling(llm),d_t h_adv(llm),d_t_nudge(llm)196 real :: dt_cooling(llm),d_t_adv(llm),d_th_adv(llm),d_t_nudge(llm) 192 197 real :: d_u_nudge(llm),d_v_nudge(llm) 193 198 real :: du_adv(llm),dv_adv(llm) … … 322 327 ! Different stages: soil model alone, atm. model alone 323 328 ! then both models coupled 329 !forcing_type = 8 ==> forcing_gabls4 = .true. 330 ! initial profiles and large scale forcings in gabls4_driver.nc 324 331 !forcing_type >= 100 ==> forcing_case = .true. 325 332 ! initial profiles and large scale forcings in cas.nc … … 327 334 ! 101=cindynamo 328 335 ! 102=bomex 336 !forcing_type >= 100 ==> forcing_case2 = .true. 337 ! temporary flag while all the 1D cases are not whith the same cas.nc forcing file 338 ! 103=arm_cu2 ie arm_cu with new forcing format 339 ! 104=rico2 ie rico with new forcing format 329 340 !forcing_type = 40 ==> forcing_GCSSold = .true. 330 341 ! initial profile from GCSS file … … 363 374 elseif (forcing_type .eq.7) THEN 364 375 forcing_dice = .true. 376 elseif (forcing_type .eq.8) THEN 377 forcing_gabls4 = .true. 365 378 elseif (forcing_type .eq.101) THEN ! Cindynamo starts 1-10-2011 0h 366 379 forcing_case = .true. … … 375 388 mth_ini_cas=6 376 389 day_deb=24 390 heure_ini_cas=0. 391 pdt_cas=1800. ! forcing frequency 392 elseif (forcing_type .eq.103) THEN ! Arm_cu starts 21-6-1997 11h30 393 forcing_case2 = .true. 394 year_ini_cas=1997 395 mth_ini_cas=6 396 day_deb=21 397 heure_ini_cas=11.5 398 pdt_cas=1800. ! forcing frequency 399 elseif (forcing_type .eq.104) THEN ! rico starts 16-12-2004 0h 400 forcing_case2 = .true. 401 year_ini_cas=2004 402 mth_ini_cas=12 403 day_deb=16 377 404 heure_ini_cas=0. 378 405 pdt_cas=1800. ! forcing frequency … … 449 476 endif 450 477 print *,'fnday=',fnday 451 478 ! start_time doit etre en FRACTION DE JOUR 452 479 start_time=time_ini/24. 453 480 454 481 ! Special case for arm_cu which lasts less than one day : 53100s !! (MPL 20111026) 455 482 IF(forcing_type .EQ. 61) fnday=53100./86400. 483 IF(forcing_type .EQ. 103) fnday=53100./86400. 456 484 ! Special case for amma which lasts less than one day : 64800s !! (MPL 20120216) 457 485 IF(forcing_type .EQ. 6) fnday=64800./86400. 458 486 ! IF(forcing_type .EQ. 6) fnday=50400./86400. 487 IF(forcing_type .EQ. 8 ) fnday=129600./86400. 459 488 annee_ref = anneeref 460 489 mois = 1 … … 487 516 & (year_ini_dice,mth_ini_dice,day_ini_dice,heure_ini_dice & 488 517 & ,day_ju_ini_dice) 518 ELSEIF (forcing_type .eq.8 ) THEN 519 ! Convert the initial date of GABLS4 to Julian day 520 call ymds2ju & 521 & (year_ini_gabls4,mth_ini_gabls4,day_ini_gabls4,heure_ini_gabls4 & 522 & ,day_ju_ini_gabls4) 489 523 ELSEIF (forcing_type .gt.100) THEN 490 524 ! Convert the initial date to Julian day … … 492 526 print*,'time case',year_ini_cas,mth_ini_cas,day_ini_cas 493 527 call ymds2ju & 494 & (year_ini_cas,mth_ini_cas,day_ini_cas,heure_ini_cas 528 & (year_ini_cas,mth_ini_cas,day_ini_cas,heure_ini_cas*3600 & 495 529 & ,day_ju_ini_cas) 496 530 print*,'time case 2',day_ini_cas,day_ju_ini_cas … … 514 548 ENDIF 515 549 550 IF (forcing_type .gt.100) THEN 551 daytime = day + heure_ini_cas/24. ! 1st day and initial time of the simulation 552 ELSE 516 553 daytime = day + time_ini/24. ! 1st day and initial time of the simulation 554 ENDIF 517 555 ! Print out the actual date of the beginning of the simulation : 518 556 call ju2ymds(daytime,year_print, month_print,day_print,sec_print) … … 699 737 700 738 fder=0. 701 snsrf(1,:)= 0. ! couverture de neige des sous surface739 snsrf(1,:)=snowmass ! masse de neige des sous surface 702 740 qsurfsrf(1,:)=qsurf ! humidite de l'air des sous surface 703 741 fevap=0. 704 742 z0m(1,:)=rugos ! couverture de neige des sous surface 705 z0h(1,:)=rugos 743 z0h(1,:)=rugosh ! couverture de neige des sous surface 706 744 agesno = xagesno 707 745 tsoil(:,:,:)=tsurf … … 726 764 print*,'avant phyredem' 727 765 pctsrf(1,:)=0. 728 if (nat_surf.eq.0.) then766 if (nat_surf.eq.0.) then 729 767 pctsrf(1,is_oce)=1. 730 768 pctsrf(1,is_ter)=0. 731 else 769 pctsrf(1,is_lic)=0. 770 pctsrf(1,is_sic)=0. 771 else if (nat_surf .eq. 1) then 732 772 pctsrf(1,is_oce)=0. 733 773 pctsrf(1,is_ter)=1. 734 end if 774 pctsrf(1,is_lic)=0. 775 pctsrf(1,is_sic)=0. 776 else if (nat_surf .eq. 2) then 777 pctsrf(1,is_oce)=0. 778 pctsrf(1,is_ter)=0. 779 pctsrf(1,is_lic)=1. 780 pctsrf(1,is_sic)=0. 781 else if (nat_surf .eq. 3) then 782 pctsrf(1,is_oce)=0. 783 pctsrf(1,is_ter)=0. 784 pctsrf(1,is_lic)=0. 785 pctsrf(1,is_sic)=1. 786 787 end if 788 735 789 736 790 print*,'nat_surf,pctsrf(1,is_oce),pctsrf(1,is_ter)',nat_surf & … … 1005 1059 1006 1060 if (forcing_toga .or. forcing_GCSSold .or. forcing_twpice & 1007 & .or.forcing_amma ) then1061 & .or.forcing_amma .or. forcing_type.eq.101) then 1008 1062 fcoriolis=0.0 ; ug=0. ; vg=0. 1009 1063 endif 1010 if(forcing_rico) then 1064 1065 if(forcing_rico) then 1011 1066 dt_cooling=0. 1012 1067 endif 1013 1068 1014 1069 IF (prt_level >= 5) print*, 'fcoriolis, xlat,mxcalc ', & … … 1172 1227 !#endif 1173 1228 1229 -
LMDZ5/branches/testing/libf/phylmd/fisrtilp.F90
r2687 r2720 15 15 USE icefrac_lsc_mod ! compute ice fraction (JBM 3/14) 16 16 USE print_control_mod, ONLY: prt_level, lunout 17 USE cloudth_mod 18 USE ioipsl_getin_p_mod, ONLY : getin_p 17 19 IMPLICIT none 18 20 !====================================================================== … … 145 147 !$OMP THREADPRIVATE(appel1er) 146 148 ! 149 ! iflag_oldbug_fisrtilp=0 enleve le BUG par JYG : tglace_min -> tglace_max 150 ! iflag_oldbug_fisrtilp=1 ajoute le BUG 151 INTEGER,SAVE :: iflag_oldbug_fisrtilp=0 !=0 sans bug 152 !$OMP THREADPRIVATE(iflag_oldbug_fisrtilp) 147 153 !--------------------------------------------------------------- 148 154 ! … … 188 194 if (prt_level>9)write(lunout,*)'NUAGES4 A. JAM' 189 195 IF (appel1er) THEN 196 CALL getin_p('iflag_oldbug_fisrtilp',iflag_oldbug_fisrtilp) 197 write(lunout,*)' iflag_oldbug_fisrtilp =',iflag_oldbug_fisrtilp 190 198 ! 191 199 WRITE(lunout,*) 'fisrtilp, ninter:', ninter … … 574 582 if (iflag_cld_th>=5) then 575 583 576 call cloudth(klon,klev,k,ztv, & 584 if (iflag_cloudth_vert<=2) then 585 call cloudth(klon,klev,k,ztv, & 577 586 zq,zqta,fraca, & 578 587 qcloud,ctot,zpspsk,paprs,ztla,zthl, & 579 588 ratqs,zqs,t) 580 589 elseif (iflag_cloudth_vert==3) then 590 call cloudth_v3(klon,klev,k,ztv, & 591 zq,zqta,fraca, & 592 qcloud,ctot,zpspsk,paprs,ztla,zthl, & 593 ratqs,zqs,t) 594 endif 581 595 do i=1,klon 582 596 rneb(i,k)=ctot(i,k) … … 624 638 zdelta = MAX(0.,SIGN(1.,t_glace_min_old-Tbef(i))) 625 639 else if (iflag_t_glace.ge.1) then 626 zdelta = MAX(0.,SIGN(1.,t_glace_max-Tbef(i))) 627 ! BUG corrige par JYG zdelta = MAX(0.,SIGN(1.,t_glace_min-Tbef(i))) 640 if (iflag_oldbug_fisrtilp.EQ.0) then 641 zdelta = MAX(0.,SIGN(1.,t_glace_max-Tbef(i))) 642 else 643 !avec bug : zdelta = MAX(0.,SIGN(1.,t_glace_min-Tbef(i))) 644 zdelta = MAX(0.,SIGN(1.,t_glace_min-Tbef(i))) 645 endif 628 646 endif 629 647 endif -
LMDZ5/branches/testing/libf/phylmd/flott_gwd_rando_m.F90
r2408 r2720 120 120 121 121 122 RDISS = 1.! Diffusion parameter122 RDISS = 0.5 ! Diffusion parameter 123 123 ! ONLINE 124 124 RUWMAX=GWD_RANDO_RUWMAX … … 346 346 ! No breaking (Eq.6) 347 347 ! Dissipation (Eq. 8) 348 WWP(JW, :) = WWM(JW, :) * EXP(- 2. * RDISS * PR / (PH(:, LL + 1) &348 WWP(JW, :) = WWM(JW, :) * EXP(- 4. * RDISS * PR / (PH(:, LL + 1) & 349 349 + PH(:, LL)) * ((BV(:, LL + 1) + BV(:, LL)) / 2.)**3 & 350 350 / MAX(ABS(ZOP(JW, :) + ZOM(JW, :)) / 2., ZOISEC)**4 & -
LMDZ5/branches/testing/libf/phylmd/grid_noro_m.F90
r2594 r2720 6 6 USE assert_eq_m, ONLY: assert_eq 7 7 PRIVATE 8 PUBLIC :: grid_noro, grid_noro0 8 PUBLIC :: grid_noro, grid_noro0, read_noro 9 9 10 10 … … 71 71 ! CORRELATIONS OF USN OROGRAPHY GRADIENTS ! dim (imar+2*iext,jmdp+2) 72 72 REAL, ALLOCATABLE :: zxtzxusn(:,:), zytzyusn(:,:), zxtzyusn(:,:) 73 REAL, ALLOCATABLE :: mask_tmp(:,:), zmea0(:,:) ! dim (imar+1,jmar) 74 REAL, ALLOCATABLE :: num_tot(:,:), num_lan(:,:) ! dim (imax,jmax) 75 REAL, ALLOCATABLE :: a(:), b(:) ! dim (imax) 76 REAL, ALLOCATABLE :: c(:), d(:) ! dim (jmax) 73 REAL, ALLOCATABLE :: num_tot(:,:), num_lan(:,:) ! dim (imar+1,jmar) 74 REAL, ALLOCATABLE :: a(:), b(:) ! dim (imar+1) 75 REAL, ALLOCATABLE :: c(:), d(:) ! dim (jmar) 77 76 LOGICAL :: masque_lu 78 77 INTEGER :: i, ii, imdp, imar, iext 79 78 INTEGER :: j, jj, jmdp, jmar, nn 80 REAL :: xpi, zdeltax, zlenx, weighx, xincr, z meanor081 REAL :: rad, zdeltay, zleny, weighy, masque, z measud082 REAL :: zbordnor, zmeanor, zstdnor, zsignor, zweinor, zpicnor, zvalnor 83 REAL :: zbordsud, zmeasud, zstdsud, zsigsud, zweisud, zpicsud, zvalsud 84 REAL :: zbordest, zbordoue, xk, xl, xm, xp, xq, xw 79 REAL :: xpi, zdeltax, zlenx, weighx, xincr, zweinor, xk, xl, xm 80 REAL :: rad, zdeltay, zleny, weighy, masque, zweisud, xp, xq, xw 81 82 83 85 84 !------------------------------------------------------------------------------- 86 85 imdp=assert_eq(SIZE(xd),SIZE(zd,1),TRIM(modname)//" imdp") … … 170 169 DO jj = 1, jmar 171 170 DO j = 2,jmdp+1 172 zlenx =zleny*COS(yusn(j))171 zlenx=zleny*COS(yusn(j)) 173 172 zdeltax=zdeltay*COS(yusn(j)) 174 zbordnor=(xincr+c(jj)-yusn(j))*rad175 zbordsud=(xincr-d(jj)+yusn(j))*rad176 weighy=AMAX1(0.,AMIN1(zbordnor,zbordsud,zleny)) 173 weighy=(xincr+AMIN1(c(jj)-yusn(j),yusn(j)-d(jj)))*rad 174 weighy=AMAX1(0.,AMIN1(weighy,zleny)) 175 177 176 IF(weighy==0.) CYCLE 178 177 DO i = 2, imdp+2*iext-1 179 zbordest=(xusn(i)-a(ii)+xincr)*rad*COS(yusn(j))180 zbordoue=(b(ii)+xincr-xusn(i))*rad*COS(yusn(j))181 weighx=AMAX1(0.,AMIN1(zbordest,zbordoue,zlenx)) 178 weighx=(xincr+AMIN1(xusn(i)-a(ii),b(ii)-xusn(i)))*rad*COS(yusn(j)) 179 weighx=AMAX1(0.,AMIN1(weighx,zlenx)) 180 182 181 IF(weighx==0.) CYCLE 183 182 num_tot(ii,jj)=num_tot(ii,jj)+1.0 … … 198 197 !--- COMPUTE PARAMETERS NEEDED BY LOTT & MILLER (1997) AND LOTT (1999) SSO SCHEME 199 198 IF(.NOT.masque_lu) THEN 200 WHERE(weight(:, 1:jmar-1)/=0.0) mask=num_lan(:,:)/num_tot(:,:)199 WHERE(weight(:,:)/=0.0) mask=num_lan(:,:)/num_tot(:,:) 201 200 END IF 202 nn=COUNT(weight(:, 1:jmar-1)==0.0)201 nn=COUNT(weight(:,:)==0.0) 203 202 IF(nn/=0) WRITE(lunout,*)'Problem with weight ; vanishing occurrences: ',nn 204 203 WHERE(weight(:,:)/=0.0) … … 224 223 !--- FIRST FILTER, MOVING AVERAGE OVER 9 POINTS. 225 224 !------------------------------------------------------------------------------- 226 ALLOCATE(zmea0(imar+1,jmar))227 zmea0(:,:)=zmea(:,:) ! GK211005 (CG) UNSMOOTHED TOPO 225 zphi(:,:)=zmea(:,:) ! GK211005 (CG) UNSMOOTHED TOPO 226 228 227 CALL MVA9(zmea); CALL MVA9(zstd); CALL MVA9(zpic); CALL MVA9(zval) 229 228 CALL MVA9(zxtzx); CALL MVA9(zxtzy); CALL MVA9(zytzy) 230 229 231 230 !--- MASK BASED ON GROUND MAXIMUM, 10% THRESHOLD. (SURFACE PARAMS MEANINGLESS) 232 ALLOCATE(mask_tmp(imar+1,jmar)); mask_tmp(:,:)=0.0 233 WHERE(mask>=0.1) mask_tmp = 1. 234 WHERE(weight(:,:)/=0.0) 235 ! zphi (:,:)= mask_tmp(:,:)*zmea (:,:) ! GK211005 (CG) not necessarly smoothed 236 zphi (:,:)= mask_tmp(:,:)*zmea0(:,:) 237 zmea0(:,:)= mask_tmp(:,:)*zmea0(:,:) 238 zmea (:,:)= mask_tmp(:,:)*zmea (:,:) 239 zpic (:,:)= mask_tmp(:,:)*zpic (:,:) 240 zval (:,:)= mask_tmp(:,:)*zval (:,:) 241 zstd (:,:)= mask_tmp(:,:)*zstd (:,:) 231 WHERE(weight(:,:)==0.0.OR.mask<0.1) 232 zphi(:,:)=0.0; zmea(:,:)=0.0; zpic(:,:)=0.0; zval(:,:)=0.0; zstd(:,:)=0.0 242 233 END WHERE 243 234 DO ii = 1, imar 244 235 DO jj = 1, jmar 245 IF (weight(ii,jj)/=0.0) THEN 246 !--- Coefficients K, L et M: 247 xk=(zxtzx(ii,jj)+zytzy(ii,jj))/2. 248 xl=(zxtzx(ii,jj)-zytzy(ii,jj))/2. 249 xm=zxtzy(ii,jj) 250 xp=xk-SQRT(xl**2+xm**2) 251 xq=xk+SQRT(xl**2+xm**2) 252 xw=1.e-8 253 IF(xp<=xw) xp=0. 254 IF(xq<=xw) xq=xw 255 IF(ABS(xm)<=xw) xm=xw*SIGN(1.,xm) 256 !--- SLOPE 257 zsig(ii,jj)=SQRT(xq)*mask_tmp(ii,jj) 258 !---ISOTROPY 259 zgam(ii,jj)=xp/xq*mask_tmp(ii,jj) 260 !--- THETA ANGLE 261 zthe(ii,jj)=57.29577951*ATAN2(xm,xl)/2.*mask_tmp(ii,jj) 262 END IF 236 IF(weight(ii,jj)==0.0) CYCLE 237 !--- Coefficients K, L et M: 238 xk=(zxtzx(ii,jj)+zytzy(ii,jj))/2. 239 xl=(zxtzx(ii,jj)-zytzy(ii,jj))/2. 240 xm=zxtzy(ii,jj) 241 xp=xk-SQRT(xl**2+xm**2) 242 xq=xk+SQRT(xl**2+xm**2) 243 xw=1.e-8 244 IF(xp<=xw) xp=0. 245 IF(xq<=xw) xq=xw 246 IF(ABS(xm)<=xw) xm=xw*SIGN(1.,xm) 247 !--- SLOPE, ANISOTROPY AND THETA ANGLE 248 zsig(ii,jj)=SQRT(xq) 249 zgam(ii,jj)=xp/xq 250 zthe(ii,jj)=90.*ATAN2(xm,xl)/xpi 263 251 END DO 264 252 END DO 253 WHERE(weight(:,:)==0.0.OR.mask<0.1) 254 zsig(:,:)=0.0; zgam(:,:)=0.0; zthe(:,:)=0.0 255 END WHERE 256 265 257 WRITE(lunout,*)' MEAN ORO:' ,MAXVAL(zmea) 266 258 WRITE(lunout,*)' ST. DEV.:' ,MAXVAL(zstd) … … 271 263 WRITE(lunout,*)' val:' ,MAXVAL(zval) 272 264 273 !--- Values at poles 274 zmea0(imar+1,:)=zmea0(1,:) 275 zmea (imar+1,:)=zmea (1,:) 276 zphi (imar+1,:)=zphi (1,:) 277 zpic (imar+1,:)=zpic (1,:) 278 zval (imar+1,:)=zval (1,:) 279 zstd (imar+1,:)=zstd (1,:) 280 zsig (imar+1,:)=zsig (1,:) 281 zgam (imar+1,:)=zgam (1,:) 282 zthe (imar+1,:)=zthe (1,:) 283 284 zweinor =SUM(weight(1:imar, 1),DIM=1) 285 zweisud =SUM(weight(1:imar,jmar),DIM=1) 286 zmeanor0=SUM(weight(1:imar, 1)*zmea0(1:imar, 1),DIM=1) 287 zmeasud0=SUM(weight(1:imar,jmar)*zmea0(1:imar,jmar),DIM=1) 288 zmeanor =SUM(weight(1:imar, 1)*zmea (1:imar, 1),DIM=1) 289 zmeasud =SUM(weight(1:imar,jmar)*zmea (1:imar,jmar),DIM=1) 290 zstdnor =SUM(weight(1:imar, 1)*zstd (1:imar, 1),DIM=1) 291 zstdsud =SUM(weight(1:imar,jmar)*zstd (1:imar,jmar),DIM=1) 292 zsignor =SUM(weight(1:imar, 1)*zsig (1:imar, 1),DIM=1) 293 zsigsud =SUM(weight(1:imar,jmar)*zsig (1:imar,jmar),DIM=1) 294 zpicnor =SUM(weight(1:imar, 1)*zpic (1:imar, 1),DIM=1) 295 zpicsud =SUM(weight(1:imar,jmar)*zpic (1:imar,jmar),DIM=1) 296 zvalnor =SUM(weight(1:imar, 1)*zval (1:imar, 1),DIM=1) 297 zvalsud =SUM(weight(1:imar,jmar)*zval (1:imar,jmar),DIM=1) 298 299 zmea(:,1)=zmeanor /zweinor; zmea(:,jmar)=zmeasud /zweisud 300 ! zphi(:,1)=zmeanor0/zweinor; zphi(:,jmar)=zmeasud0/zweisud TO COMMIT 301 zphi(:,1)=zmeanor /zweinor; zphi(:,jmar)=zmeasud /zweisud 302 zpic(:,1)=zpicnor /zweinor; zpic(:,jmar)=zpicsud /zweisud 303 zval(:,1)=zvalnor /zweinor; zval(:,jmar)=zvalsud /zweisud 304 zstd(:,1)=zstdnor /zweinor; zstd(:,jmar)=zstdsud /zweisud 305 zsig(:,1)=zsignor /zweinor; zsig(:,jmar)=zsigsud /zweisud 306 zgam(:,1)=1.; zgam(:,jmar)=1. 307 zthe(:,1)=0.; zthe(:,jmar)=0. 265 !--- Values at redundant longitude 266 zmea(imar+1,:)=zmea(1,:) 267 zphi(imar+1,:)=zphi(1,:) 268 zpic(imar+1,:)=zpic(1,:) 269 zval(imar+1,:)=zval(1,:) 270 zstd(imar+1,:)=zstd(1,:) 271 zsig(imar+1,:)=zsig(1,:) 272 zgam(imar+1,:)=zgam(1,:) 273 zthe(imar+1,:)=zthe(1,:) 274 275 !--- Values at north pole 276 zweinor =SUM(weight(1:imar,1)) 277 zmea(:,1)=SUM(weight(1:imar,1)*zmea(1:imar,1))/zweinor 278 zphi(:,1)=SUM(weight(1:imar,1)*zphi(1:imar,1))/zweinor 279 zpic(:,1)=SUM(weight(1:imar,1)*zpic(1:imar,1))/zweinor 280 zval(:,1)=SUM(weight(1:imar,1)*zval(1:imar,1))/zweinor 281 zstd(:,1)=SUM(weight(1:imar,1)*zstd(1:imar,1))/zweinor 282 zsig(:,1)=SUM(weight(1:imar,1)*zsig(1:imar,1))/zweinor 283 zgam(:,1)=1.; zthe(:,1)=0. 284 285 !--- Values at south pole 286 zweisud =SUM(weight(1:imar,jmar),DIM=1) 287 zmea(:,jmar)=SUM(weight(1:imar,jmar)*zmea(1:imar,jmar))/zweisud 288 zphi(:,jmar)=SUM(weight(1:imar,jmar)*zphi(1:imar,jmar))/zweisud 289 zpic(:,jmar)=SUM(weight(1:imar,jmar)*zpic(1:imar,jmar))/zweisud 290 zval(:,jmar)=SUM(weight(1:imar,jmar)*zval(1:imar,jmar))/zweisud 291 zstd(:,jmar)=SUM(weight(1:imar,jmar)*zstd(1:imar,jmar))/zweisud 292 zsig(:,jmar)=SUM(weight(1:imar,jmar)*zsig(1:imar,jmar))/zweisud 293 zgam(:,jmar)=1.; zthe(:,jmar)=0. 308 294 309 295 END SUBROUTINE grid_noro … … 323 309 !------------------------------------------------------------------------------- 324 310 ! Arguments: 325 REAL, INTENT(IN) 326 REAL, INTENT(IN) :: zd(:,:) !--- INPUT FIELD (imdp,jmdp)327 REAL, INTENT(IN) 328 REAL, INTENT(OUT) 329 REAL, INTENT( INOUT):: mask(:,:) !--- MASK (imar+1,jmar)311 REAL, INTENT(IN) :: xd(:), yd(:) !--- INPUT COORDINATES (imdp) (jmdp) 312 REAL, INTENT(IN) :: zd(:,:) !--- INPUT FIELD (imdp, jmdp) 313 REAL, INTENT(IN) :: x(:), y(:) !--- OUTPUT COORDINATES (imar+1) (jmar) 314 REAL, INTENT(OUT) :: zphi(:,:) !--- GEOPOTENTIAL (imar+1,jmar) 315 REAL, INTENT(OUT) :: mask(:,:) !--- MASK (imar+1,jmar) 330 316 !------------------------------------------------------------------------------- 331 317 ! Local variables: 332 318 CHARACTER(LEN=256) :: modname="grid_noro0" 333 319 REAL, ALLOCATABLE :: xusn(:), yusn(:) ! dim (imdp+2*iext) (jmdp+2) 334 REAL, ALLOCATABLE :: zusn(:,:) ! dim (imdp+2*iext, jmdp+2)320 REAL, ALLOCATABLE :: zusn(:,:) ! dim (imdp+2*iext, jmdp+2) 335 321 REAL, ALLOCATABLE :: weight(:,:) ! dim (imar+1,jmar) 336 REAL, ALLOCATABLE :: mask_tmp(:,:), zmea(:,:)! dim (imar+1,jmar)337 REAL, ALLOCATABLE :: num_tot(:,:), num_lan(:,:) ! dim (imax,jmax)338 REAL, ALLOCATABLE :: a(:), b(:) ! dim (imax)339 REAL, ALLOCATABLE :: c(:), d(:) ! dim (jmax) 322 REAL, ALLOCATABLE :: num_tot(:,:), num_lan(:,:) ! dim (imar+1,jmar) 323 REAL, ALLOCATABLE :: a(:), b(:) ! dim (imar+1) 324 REAL, ALLOCATABLE :: c(:), d(:) ! dim (jmar) 325 340 326 LOGICAL :: masque_lu 341 327 INTEGER :: i, ii, imdp, imar, iext 342 328 INTEGER :: j, jj, jmdp, jmar, nn 343 REAL :: xpi, zlenx, weighx, xincr, zbordnor, zmeanor, zweinor, zbordest344 REAL :: rad, zleny, weighy, masque, zbordsud, zmeasud, zweisud, zbordoue 329 REAL :: xpi, zlenx, zleny, weighx, weighy, xincr, masque, rad 330 345 331 !------------------------------------------------------------------------------- 346 332 imdp=assert_eq(SIZE(xd),SIZE(zd,1),TRIM(modname)//" imdp") … … 392 378 393 379 !--- INITIALIZATIONS: 394 ALLOCATE(weight(imar+1,jmar)); weight(:,:)= 0.0 395 ALLOCATE(zmea (imar+1,jmar)); zmea (:,:)= 0.0 380 ALLOCATE(weight(imar+1,jmar)); weight(:,:)=0.0; zphi(:,:)=0.0 396 381 397 382 !--- SUMMATION OVER GRIDPOINT AREA … … 403 388 DO jj = 1, jmar 404 389 DO j = 2,jmdp+1 405 zlenx =zleny *COS(yusn(j)) 406 zbordnor=(xincr+c(jj)-yusn(j))*rad 407 zbordsud=(xincr-d(jj)+yusn(j))*rad 408 weighy=AMAX1(0.,AMIN1(zbordnor,zbordsud,zleny)) 409 IF(weighy/=0) THEN 410 DO i = 2, imdp+2*iext-1 411 zbordest=(xusn(i)-a(ii)+xincr)*rad*COS(yusn(j)) 412 zbordoue=(b(ii)+xincr-xusn(i))*rad*COS(yusn(j)) 413 weighx=AMAX1(0.,AMIN1(zbordest,zbordoue,zlenx)) 414 IF(weighx/=0)THEN 415 num_tot(ii,jj)=num_tot(ii,jj)+1.0 416 IF(zusn(i,j)>=1.)num_lan(ii,jj)=num_lan(ii,jj)+1.0 417 weight(ii,jj)=weight(ii,jj)+weighx*weighy 418 zmea (ii,jj)=zmea (ii,jj)+zusn(i,j)*weighx*weighy !--- MEAN 419 END IF 420 END DO 421 END IF 390 zlenx=zleny*COS(yusn(j)) 391 weighy=(xincr+AMIN1(c(jj)-yusn(j),yusn(j)-d(jj)))*rad 392 weighy=AMAX1(0.,AMIN1(weighy,zleny)) 393 IF(weighy/=0) CYCLE 394 DO i = 2, imdp+2*iext-1 395 weighx=(xincr+AMIN1(xusn(i)-a(ii),b(ii)-xusn(i)))*rad*COS(yusn(j)) 396 weighx=AMAX1(0.,AMIN1(weighx,zlenx)) 397 IF(weighx/=0) CYCLE 398 num_tot(ii,jj)=num_tot(ii,jj)+1.0 399 IF(zusn(i,j)>=1.)num_lan(ii,jj)=num_lan(ii,jj)+1.0 400 weight(ii,jj)=weight(ii,jj)+weighx*weighy 401 zphi (ii,jj)=zphi (ii,jj)+zusn(i,j)*weighx*weighy !--- MEAN 402 END DO 422 403 END DO 423 404 END DO … … 426 407 !--- COMPUTE PARAMETERS NEEDED BY LOTT & MILLER (1997) AND LOTT (1999) SSO SCHEME 427 408 IF(.NOT.masque_lu) THEN 428 WHERE(weight(:, 1:jmar-1)/=0.0) mask=num_lan(:,:)/num_tot(:,:)409 WHERE(weight(:,:)/=0.0) mask=num_lan(:,:)/num_tot(:,:) 429 410 END IF 430 nn=COUNT(weight(:, 1:jmar-1)==0.0)411 nn=COUNT(weight(:,:)==0.0) 431 412 IF(nn/=0) WRITE(lunout,*)'Problem with weight ; vanishing occurrences: ',nn 432 WHERE(weight/=0.0) z mea(:,:)=zmea(:,:)/weight(:,:)413 WHERE(weight/=0.0) zphi(:,:)=zphi(:,:)/weight(:,:) 433 414 434 415 !--- MASK BASED ON GROUND MAXIMUM, 10% THRESHOLD (<10%: SURF PARAMS MEANINGLESS) 435 ALLOCATE(mask_tmp(imar+1,jmar)); mask_tmp(:,:)=0.0 436 WHERE(mask>=0.1) mask_tmp = 1. 437 WHERE(weight(:,:)/=0.0) 438 zphi(:,:)=mask_tmp(:,:)*zmea(:,:) 439 zmea(:,:)=mask_tmp(:,:)*zmea(:,:) 440 END WHERE 416 WHERE(weight(:,:)==0.0.OR.mask<0.1) zphi(:,:)=0.0 417 WRITE(lunout,*)' MEAN ORO:' ,MAXVAL(zphi) 418 419 !--- Values at redundant longitude and at poles 420 zphi(imar+1,:)=zphi(1,:) 421 zphi(:, 1)=SUM(weight(1:imar, 1)*zphi(1:imar, 1))/SUM(weight(1:imar, 1)) 422 zphi(:,jmar)=SUM(weight(1:imar,jmar)*zphi(1:imar,jmar))/SUM(weight(1:imar,jmar)) 423 424 END SUBROUTINE grid_noro0 425 ! 426 !------------------------------------------------------------------------------- 427 428 429 !------------------------------------------------------------------------------- 430 ! 431 SUBROUTINE read_noro(x,y,fname,zphi,zmea,zstd,zsig,zgam,zthe,zpic,zval,mask) 432 ! 433 !------------------------------------------------------------------------------- 434 ! Purpose: Read parameters usually determined with grid_noro from a file. 435 !=============================================================================== 436 USE netcdf, ONLY: NF90_OPEN, NF90_INQ_DIMID, NF90_INQUIRE_DIMENSION, & 437 NF90_NOERR, NF90_CLOSE, NF90_INQ_VARID, NF90_GET_VAR, NF90_STRERROR, & 438 NF90_NOWRITE 439 IMPLICIT NONE 440 !------------------------------------------------------------------------------- 441 ! Arguments: 442 REAL, INTENT(IN) :: x(:), y(:) !--- OUTPUT COORDINATES (imar+1) (jmar) 443 CHARACTER(LEN=*), INTENT(IN) :: fname ! PARAMETERS FILE NAME 444 REAL, INTENT(OUT) :: zphi(:,:) !--- GEOPOTENTIAL (imar+1,jmar) 445 REAL, INTENT(OUT) :: zmea(:,:) !--- MEAN OROGRAPHY (imar+1,jmar) 446 REAL, INTENT(OUT) :: zstd(:,:) !--- STANDARD DEVIATION (imar+1,jmar) 447 REAL, INTENT(OUT) :: zsig(:,:) !--- SLOPE (imar+1,jmar) 448 REAL, INTENT(OUT) :: zgam(:,:) !--- ANISOTROPY (imar+1,jmar) 449 REAL, INTENT(OUT) :: zthe(:,:) !--- SMALL AXIS ORIENTATION (imar+1,jmar) 450 REAL, INTENT(OUT) :: zpic(:,:) !--- MAXIMUM ALTITUDE (imar+1,jmar) 451 REAL, INTENT(OUT) :: zval(:,:) !--- MINIMUM ALTITUDE (imar+1,jmar) 452 REAL, INTENT(OUT) :: mask(:,:) !--- MASK (imar+1,jmar) 453 !------------------------------------------------------------------------------- 454 ! Local variables: 455 CHARACTER(LEN=256) :: modname="read_noro" 456 INTEGER :: imar, jmar, fid, did, vid 457 LOGICAL :: masque_lu 458 REAL :: xpi, d2r 459 !------------------------------------------------------------------------------- 460 imar=assert_eq([SIZE(x),SIZE(zphi,1),SIZE(zmea,1),SIZE(zstd,1),SIZE(zsig,1), & 461 SIZE(zgam,1),SIZE(zthe,1),SIZE(zpic,1),SIZE(zval,1), & 462 SIZE(mask,1)],TRIM(modname)//" imar")-1 463 jmar=assert_eq([SIZE(y),SIZE(zphi,2),SIZE(zmea,2),SIZE(zstd,2),SIZE(zsig,2), & 464 SIZE(zgam,2),SIZE(zthe,2),SIZE(zpic,2),SIZE(zval,2), & 465 SIZE(mask,2)],TRIM(modname)//" jmar") 466 xpi=ACOS(-1.0); d2r=xpi/180. 467 WRITE(lunout,*)"*** Orography parameters at sub-cell scale from file ***" 468 469 !--- ARE WE USING A READ MASK ? 470 masque_lu=ANY(mask/=-99999.); IF(.NOT.masque_lu) mask=0.0 471 WRITE(lunout,*)'Masque lu: ',masque_lu 472 CALL ncerr(NF90_OPEN(fname,NF90_NOWRITE,fid)) 473 CALL check_dim('x','longitude',x(1:imar)) 474 CALL check_dim('y','latitude' ,y(1:jmar)) 475 IF(.NOT.masque_lu) CALL get_fld('mask',mask) 476 CALL get_fld('Zphi',zphi) 477 CALL get_fld('Zmea',zmea) 478 CALL get_fld('mu' ,zstd) 479 CALL get_fld('Zsig',zsig) 480 CALL get_fld('Zgam',zgam) 481 CALL get_fld('Zthe',zthe) 482 zpic=zmea+2*zstd 483 zval=MAX(0.,zmea-2.*zstd) 484 CALL ncerr(NF90_CLOSE(fid)) 441 485 WRITE(lunout,*)' MEAN ORO:' ,MAXVAL(zmea) 442 443 !--- Values at poles 444 zphi(imar+1,:)=zphi(1,:) 445 446 zweinor=SUM(weight(1:imar, 1),DIM=1) 447 zweisud=SUM(weight(1:imar,jmar),DIM=1) 448 zmeanor=SUM(weight(1:imar, 1)*zmea(1:imar, 1),DIM=1) 449 zmeasud=SUM(weight(1:imar,jmar)*zmea(1:imar,jmar),DIM=1) 450 zphi(:,1)=zmeanor/zweinor; zphi(:,jmar)=zmeasud/zweisud 451 452 END SUBROUTINE grid_noro0 486 WRITE(lunout,*)' ST. DEV.:' ,MAXVAL(zstd) 487 WRITE(lunout,*)' PENTE:' ,MAXVAL(zsig) 488 WRITE(lunout,*)' ANISOTROP:',MAXVAL(zgam) 489 WRITE(lunout,*)' ANGLE:' ,MINVAL(zthe),MAXVAL(zthe) 490 WRITE(lunout,*)' pic:' ,MAXVAL(zpic) 491 WRITE(lunout,*)' val:' ,MAXVAL(zval) 492 493 CONTAINS 494 495 496 SUBROUTINE get_fld(var,fld) 497 CHARACTER(LEN=*), INTENT(IN) :: var 498 REAL, INTENT(INOUT) :: fld(:,:) 499 CALL ncerr(NF90_INQ_VARID(fid,var,vid),var) 500 CALL ncerr(NF90_GET_VAR(fid,vid,fld(1:imar,:)),var) 501 fld(imar+1,:)=fld(1,:) 502 END SUBROUTINE get_fld 503 504 SUBROUTINE check_dim(dimd,nam,dimv) 505 CHARACTER(LEN=*), INTENT(IN) :: dimd 506 CHARACTER(LEN=*), INTENT(IN) :: nam 507 REAL, INTENT(IN) :: dimv(:) 508 REAL, ALLOCATABLE :: tmp(:) 509 INTEGER :: n 510 CALL ncerr(NF90_INQ_DIMID(fid,dimd,did)) 511 CALL ncerr(NF90_INQUIRE_DIMENSION(fid,did,len=n)); ALLOCATE(tmp(n)) 512 CALL ncerr(NF90_INQ_VARID(fid,dimd,did)) 513 CALL ncerr(NF90_GET_VAR(fid,did,tmp)) 514 IF(MAXVAL(tmp)>xpi) tmp=tmp*d2r 515 IF(n/=SIZE(dimv).OR.ANY(ABS(tmp-dimv)>1E-6)) THEN 516 WRITE(lunout,*)'Problem with file "'//TRIM(fname)//'".' 517 CALL abort_physic(modname,'Grid differs from LMDZ for '//TRIM(nam)//'.',1) 518 END IF 519 END SUBROUTINE check_dim 520 521 SUBROUTINE ncerr(ncres,var) 522 IMPLICIT NONE 523 INTEGER, INTENT(IN) :: ncres 524 CHARACTER(LEN=*), INTENT(IN), OPTIONAL :: var 525 CHARACTER(LEN=256) :: mess 526 IF(ncres/=NF90_NOERR) THEN 527 mess='Problem with file "'//TRIM(fname)//'"' 528 IF(PRESENT(var)) mess=TRIM(mess)//' and variable "'//TRIM(var)//'"' 529 WRITE(lunout,*)TRIM(mess)//'.' 530 CALL abort_physic(modname,NF90_STRERROR(ncres),1) 531 END IF 532 END SUBROUTINE ncerr 533 534 END SUBROUTINE read_noro 453 535 ! 454 536 !------------------------------------------------------------------------------- … … 494 576 END MODULE grid_noro_m 495 577 578 -
LMDZ5/branches/testing/libf/phylmd/infotrac_phy.F90
r2408 r2720 95 95 indnum_fn_num_,index_trac_,& 96 96 niso_,ntraceurs_zone_,ntraciso_) 97 ! transfer information on tracers from dynamics to physics 98 USE print_control_mod, ONLY: prt_level, lunout 99 IMPLICIT NONE 97 98 ! transfer information on tracers from dynamics to physics 99 USE print_control_mod, ONLY: prt_level, lunout 100 IMPLICIT NONE 101 100 102 INTEGER,INTENT(IN) :: nqtot_ 101 103 INTEGER,INTENT(IN) :: nqo_ -
LMDZ5/branches/testing/libf/phylmd/limit_read_mod.F90
r2408 r2720 148 148 USE netcdf 149 149 USE indice_sol_mod 150 USE phys_cal_mod, ONLY : calend, year_len 151 USE print_control_mod, ONLY: lunout, prt_level 150 152 151 153 IMPLICIT NONE … … 170 172 ! Locals variables 171 173 !**************************************************************************************** 172 INTEGER :: nid, nvarid 174 INTEGER :: nid, nvarid, ndimid, nn 173 175 INTEGER :: ii, ierr 174 176 INTEGER, DIMENSION(2) :: start, epais … … 178 180 REAL, DIMENSION(klon_glo) :: alb_glo ! albedo at global grid 179 181 CHARACTER(len=20) :: modname='limit_read_mod' 182 CHARACTER(LEN=99) :: abort_message, calendar, str 180 183 181 184 ! End declaration … … 207 210 ! 1) Open the file limit.nc if it is the right moment to read, once a day. 208 211 ! The file is read only by the master thread of the master mpi process(is_mpi_root) 212 ! Check by the way if the number of records is correct. 209 213 ! 210 214 !**************************************************************************************** … … 220 224 IF (ierr /= NF90_NOERR) CALL abort_physic(modname,& 221 225 'Pb d''ouverture du fichier de conditions aux limites',1) 222 226 227 !--- WARNING IF CALENDAR IS KNOWN AND DOES NOT MATCH THE ONE OF LMDZ 228 ierr=NF90_INQ_VARID(nid, 'TEMPS', nvarid) 229 ierr=NF90_GET_ATT(nid, nvarid, 'calendar', calendar) 230 IF(ierr==NF90_NOERR.AND.calendar/=calend.AND.prt_level>=1) THEN 231 WRITE(lunout,*)'BEWARE: gcm and limit.nc calendars differ: ' 232 WRITE(lunout,*)' '//TRIM(calend)//' for gcm' 233 WRITE(lunout,*)' '//TRIM(calendar)//' for limit.nc file' 234 END IF 235 236 !--- ERROR IF FILE RECORDS NUMBER IS NOT EQUAL TO EXPECTED NUMBER OF DAYS 237 ierr=NF90_INQUIRE(nid, UnlimitedDimID=ndimid) 238 ierr=NF90_INQUIRE_DIMENSION(nid, ndimid, len=nn) 239 CALL num2str(nn,str) 240 abort_message='limit.nc records number ('//TRIM(str)//') does'//& 241 ' not match year length (' 242 CALL num2str(year_len,str) 243 abort_message=TRIM(abort_message)//TRIM(str)//')' 244 IF(nn/=year_len) CALL abort_physic(modname,abort_message,1) 245 246 !--- ERROR IF FILES AND LMDZ HORIZONTAL RESOLUTIONS DO NOT MATCH 247 ierr=NF90_INQ_DIMID(nid, 'points_physiques', ndimid) 248 ierr=NF90_INQUIRE_DIMENSION(nid, ndimid, len=nn) 249 CALL num2str(nn,str) 250 abort_message='limit.nc horizontal number of cells ('//TRIM(str)//') does'//& 251 ' not match LMDZ klon_glo (' 252 CALL num2str(klon_glo,str) 253 abort_message=TRIM(abort_message)//TRIM(str)//')' 254 IF(nn/=klon_glo) CALL abort_physic(modname,abort_message,1) 255 223 256 ! La tranche de donnees a lire: 224 257 start(1) = 1 … … 337 370 END SUBROUTINE limit_read_tot 338 371 372 !-------------------------------------------------------------------------------------- 373 SUBROUTINE num2str(n,str) 374 !-------------------------------------------------------------------------------------- 375 ! Arguments: 376 INTEGER, INTENT(IN) :: n 377 CHARACTER(LEN=99), INTENT(OUT) :: str 378 !-------------------------------------------------------------------------------------- 379 ! Local variables: 380 INTEGER :: nn 381 !-------------------------------------------------------------------------------------- 382 nn=n; str=''; DO WHILE(nn>0); str=CHAR(nn-10*(nn/10)-48)//TRIM(str); nn=nn/10; END DO 383 END SUBROUTINE num2str 384 !-------------------------------------------------------------------------------------- 339 385 340 386 END MODULE limit_read_mod -
LMDZ5/branches/testing/libf/phylmd/ocean_albedo.F90
r2258 r2720 3 3 ! 4 4 5 ! ######### 6 7 subroutine ocean_albedo(knon,zrmu0,knindex,pwind,SFRWL,alb_dir_new,alb_dif_new) 8 9 10 ! ################################################################## 11 ! 5 SUBROUTINE ocean_albedo(knon,zrmu0,knindex,pwind,SFRWL,alb_dir_new,alb_dif_new) 6 !! 12 7 !!**** *ALBEDO_RS14* 13 8 !! 14 9 !! PURPOSE 15 10 !! ------- 16 ! computes the direct & diffuse albedo over open water 17 ! 18 ! 11 !! computes the direct & diffuse albedo over open water 12 !! 19 13 !!** METHOD 20 14 !! ------ 21 ! 15 !! 22 16 !! EXTERNAL 23 17 !! -------- … … 25 19 !! IMPLICIT ARGUMENTS 26 20 !! ------------------ 27 !!28 21 !! 29 22 !! REFERENCE 30 23 !! --------- 31 !!32 24 !! 33 25 !! AUTHOR … … 38 30 !! ------------- 39 31 !! Original 03/2014 40 ! 05/2014 R. Séférian & B. Decharme :: Adaptation to spectral 41 ! computation for diffuse and direct albedo 42 ! 08/2014 S. Baek :: for wider wavelength range 200-4000nm and 43 ! adaptation to LMDZ + whitecap effect by Koepke + chrolophyll 44 ! map from climatology file 45 ! 32 !! 05/2014 R. Séférian & B. Decharme :: Adaptation to spectral 33 !! computation for diffuse and direct albedo 34 !! 08/2014 S. Baek :: for wider wavelength range 200-4000nm and 35 !! adaptation to LMDZ + whitecap effect by Koepke + chrolophyll 36 !! map from climatology file 37 !! 10/2016 O. Boucher :: some optimisation following R. 38 !! Seferian's work in the CNRM Model 39 !! 46 40 !------------------------------------------------------------------------------- 47 41 ! … … 50 44 ! 51 45 USE ocean_albedo_para 52 use dimphy 53 !LF USE PARKIND1 ,ONLY : JPIM ,JPRB 54 use phys_state_var_mod, only : chl_con 46 USE dimphy 47 USE phys_state_var_mod, ONLY : chl_con 55 48 ! 56 49 ! … … 60 53 ! ------------------------- 61 54 ! 62 63 55 include "clesphys.h" 64 65 integer, intent(in) :: knon 66 integer, dimension(klon), intent(in) :: knindex 67 real, dimension(klon), intent(in) :: zrmu0,pwind 68 real, dimension(klon,nsw), intent(out) :: alb_dir_new,alb_dif_new 69 real, dimension(6),intent(in) :: SFRWL 70 71 72 !=== LOCAL VARIABLES 73 74 REAL, parameter :: XPI=4.*atan(1.) 75 56 ! 57 INTEGER, INTENT(IN) :: knon 58 INTEGER, DIMENSION(klon), INTENT(IN) :: knindex 59 REAL, DIMENSION(klon), INTENT(IN) :: zrmu0 !--cos(SZA) on full vector 60 REAL, DIMENSION(klon), INTENT(IN) :: pwind !--wind speed on compressed vector 61 REAL, DIMENSION(6),INTENT(IN) :: SFRWL 62 REAL, DIMENSION(klon,nsw), INTENT(OUT) :: alb_dir_new, alb_dif_new 76 63 ! 77 64 !* 0.2 declarations of local variables 78 65 ! ------------------------- 79 66 ! 80 REAL, DIMENSION(klon) :: ZCHL ! surface chlorophyll 81 REAL, DIMENSION(klon,NNWL) :: ZDIR_ALB ! direct ocean surface albedo (spectral) 82 REAL, DIMENSION(klon,NNWL) :: ZSCA_ALB ! diffuse ocean surface albedo (spectral) 83 ! 84 INTEGER :: JI, JWL ! indexes 85 REAL :: ZWL ! input parameter: wavelength and diffuse/direct fraction of light 86 REAL:: ZSIG, ZREFM, ZXX2, ZR00, ZRR0, ZRRR ! computation variables 87 REAL:: ZR22, ZUE, ZUE2, ZR11DF, ZALBT, ZFWC ! computation variables 88 REAL:: ZCHLABS, ZAW, ZBW, ZAP, ZYLMD, ZBP550 ! computation variables 89 REAL:: ZBBP, ZNU, ZHB ! computation variables 90 REAL:: ZCOSZEN ! Cosine of the zenith solar angle 91 REAL:: ZR11, ZRW, ZRWDF, ZRDF ! 4 components of the OSA 92 ! new damping coefficient 93 REAL:: ZDAMP 94 67 REAL, DIMENSION(klon) :: ZCHL ! surface chlorophyll 68 REAL, DIMENSION(klon) :: ZCOSZEN ! Cosine of the zenith solar angle 69 ! 70 INTEGER :: JWL, INU ! indexes 71 INTEGER :: JI 72 REAL :: ZWL ! input parameter: wavelength and diffuse/direct fraction of light 73 REAL:: ZCHLABS, ZAW, ZBW, ZREFM, ZYLMD, ZUE, ZUE2 ! scalar computation variables 74 ! 75 REAL, DIMENSION(klon) :: ZAP, ZXX2, ZR00, ZRR0, ZRRR ! computation variables 76 REAL, DIMENSION(klon) :: ZR22, ZR11DF ! computation variables 77 REAL, DIMENSION(klon) :: ZBBP, ZNU, ZHB ! computation variables 78 REAL, DIMENSION(klon) :: ZR11, ZRW, ZRWDF, ZRDF ! 4 components of the OSA 79 REAL, DIMENSION(klon) :: ZSIG, ZFWC, ZWORK1, ZWORK2, ZWORK3 95 80 ! 96 REAL :: ZWORK ! dummy variable 97 ! 98 !LF REAL(KIND=JPRB) :: ZHOOK_HANDLE 99 ! 100 !------------------------------------------------------------------------------- 101 ! 102 ! 103 104 105 106 ! 81 !--initialisations------------- 82 ! 83 84 IF (knon==0) RETURN ! A verifier pourquoi on en a besoin... 85 107 86 alb_dir_new(:,:) = 0. 108 87 alb_dif_new(:,:) = 0. 109 88 ! 110 ZDIR_ALB(:,:) = 0. 111 ZSCA_ALB(:,:) = 0. 112 ! 113 ! 114 115 !ZCHL(:) = CHL_CON!0.05 ! averaged global values for surface chlorophyll 116 if(ok_chlorophyll)then 117 do ji=1,knon 118 ZCHL(ji)=CHL_CON(knindex(ji)) 119 enddo 120 else 121 ZCHL(:) = 0.05 122 endif 123 124 125 ! 126 DO JWL=1,NNWL ! loop over the wavelength 127 ! 128 DO JI=1,knon ! loop over the grid points 129 130 131 !--------------------------------------------------------------------------------- 132 ! 0- Compute baseline values 133 !--------------------------------------------------------------------------------- 89 ! Initialisation of chlorophyll content 90 ! ZCHL(:) = CHL_CON!0.05 ! averaged global values for surface chlorophyll 91 IF (ok_chlorophyll) THEN 92 ZCHL(1:knon)=CHL_CON(knindex(1:knon)) 93 ELSE 94 ZCHL(1:knon) = 0.05 95 ENDIF 96 97 ! variables that do not depend on wavelengths 98 ! loop over the grid points 99 ! functions of chlorophyll content 100 ZWORK1(1:knon)= EXP(LOG(ZCHL(1:knon))*0.65) 101 ZWORK2(1:knon)= 0.416 * EXP(LOG(ZCHL(1:knon))*0.766) 102 ZWORK3(1:knon)= LOG10(ZCHL(1:knon)) 103 ! store the cosine of the solar zenith angle 104 ZCOSZEN(1:knon) = zrmu0(knindex(1:knon)) 105 ! Compute sigma derived from wind speed (Cox & Munk reflectance model) 106 ZSIG(1:knon)=SQRT(0.003+0.00512*PWIND(1:knon)) 107 ! original : correction for foam (Eq 16-17) 108 ! has to be update once we have information from wave model (discussion with G. Madec) 109 ZFWC(1:knon)=3.97e-4*PWIND(1:knon)**1.59 ! Salisbury 2014 eq(2) at 37GHz, value in fraction 110 ! 111 DO JWL=1,NNWL ! loop over the wavelengths 112 ! 113 !--------------------------------------------------------------------------------- 114 ! 0- Compute baseline values 115 !--------------------------------------------------------------------------------- 134 116 135 136 ZWL=XAKWL(JWL) !!!----------wavelength value137 117 ! Get refractive index for the correspoding wavelength 118 ZWL=XAKWL(JWL) !!!--------- wavelength value 119 ZREFM= XAKREFM(JWL) !!!--------- refraction index value 138 120 139 140 ! compute the cosine of the solar zenith angle 141 ! ZCOSZEN = COS(XPI/2 - PZENITH(JI)) 142 ZCOSZEN = zrmu0(knindex(JI)) 143 ! Compute sigma derived from wind speed (Cox & Munk reflectance model) 144 ZSIG=SQRT(0.003+0.00512*PWIND(JI)) 145 146 147 !--------------------------------------------------------------------------------- 148 ! 1- Compute direct surface albedo (ZR11) 149 !--------------------------------------------------------------------------------- 150 ! 151 ZXX2=SQRT(1.0-(1.0-ZCOSZEN**2)/ZREFM**2) 152 ZRR0=0.50*(((ZXX2-ZREFM*ZCOSZEN)/(ZXX2+ZREFM*ZCOSZEN))**2 +((ZCOSZEN-ZREFM*ZXX2)/(ZCOSZEN+ZREFM*ZXX2))**2) 153 ZRRR=0.50*(((ZXX2-1.34*ZCOSZEN)/(ZXX2+1.34*ZCOSZEN))**2 +((ZCOSZEN-1.34*ZXX2)/(ZCOSZEN+1.34*ZXX2))**2) 154 ZR11=ZRR0-(0.0152-1.7873*ZCOSZEN+6.8972*ZCOSZEN**2-8.5778*ZCOSZEN**3+4.071*ZSIG-7.6446*ZCOSZEN*ZSIG) & 155 & * EXP(0.1643-7.8409*ZCOSZEN-3.5639*ZCOSZEN**2-2.3588*ZSIG+10.0538*ZCOSZEN*ZSIG)*ZRR0/ZRRR 156 ! 157 !--------------------------------------------------------------------------------- 158 ! 2- Compute surface diffuse albedo (ZRDF) 159 !--------------------------------------------------------------------------------- 160 ! Diffuse albedo from Jin et al., 2006 + estimation from diffuse fraction of 161 ! light (relying later on AOD) 162 ZRDF=-0.1482-0.012*ZSIG+0.1609*ZREFM-0.0244*ZSIG*ZREFM ! surface diffuse (Eq 5a-5b) 121 !--------------------------------------------------------------------------------- 122 ! 1- Compute direct surface albedo (ZR11) 123 !--------------------------------------------------------------------------------- 124 ! 125 ZXX2(1:knon)=SQRT(1.0-(1.0-ZCOSZEN(1:knon)**2)/ZREFM**2) 126 ZRR0(1:knon)=0.50*(((ZXX2(1:knon)-ZREFM*ZCOSZEN(1:knon))/(ZXX2(1:knon)+ZREFM*ZCOSZEN(1:knon)))**2 + & 127 ((ZCOSZEN(1:knon)-ZREFM*ZXX2(1:knon))/(ZCOSZEN(1:knon)+ZREFM*ZXX2(1:knon)))**2) 128 ZRRR(1:knon)=0.50*(((ZXX2(1:knon)-1.34*ZCOSZEN(1:knon))/(ZXX2(1:knon)+1.34*ZCOSZEN(1:knon)))**2 + & 129 ((ZCOSZEN(1:knon)-1.34*ZXX2(1:knon))/(ZCOSZEN(1:knon)+1.34*ZXX2(1:knon)))**2) 130 ZR11(1:knon)=ZRR0(1:knon)-(0.0152-1.7873*ZCOSZEN(1:knon)+6.8972*ZCOSZEN(1:knon)**2-8.5778*ZCOSZEN(1:knon)**3+ & 131 4.071*ZSIG(1:knon)-7.6446*ZCOSZEN(1:knon)*ZSIG(1:knon)) * & 132 EXP(0.1643-7.8409*ZCOSZEN(1:knon)-3.5639*ZCOSZEN(1:knon)**2-2.3588*ZSIG(1:knon)+ & 133 10.0538*ZCOSZEN(1:knon)*ZSIG(1:knon))*ZRR0(1:knon)/ZRRR(1:knon) 134 ! 135 !--------------------------------------------------------------------------------- 136 ! 2- Compute surface diffuse albedo (ZRDF) 137 !--------------------------------------------------------------------------------- 138 ! Diffuse albedo from Jin et al., 2006 + estimation from diffuse fraction of 139 ! light (relying later on AOD). CNRM model has opted for Eq 5b 140 ZRDF(1:knon)=-0.1482-0.012*ZSIG(1:knon)+0.1609*ZREFM-0.0244*ZSIG(1:knon)*ZREFM ! surface diffuse (Eq 5a) 141 !!ZRDF(1:knon)=-0.1479+0.1502*ZREFM-0.0176*ZSIG(1:knon)*ZREFM ! surface diffuse (Eq 5b) 142 143 !--------------------------------------------------------------------------------- 144 ! *- Determine absorption and backscattering 145 ! coefficients to determine reflectance below the surface (Ro) once for all 146 ! 147 ! *.1- Absorption by chlorophyll 148 ZCHLABS= XAKACHL(JWL) 149 ! *.2- Absorption by seawater 150 ZAW= XAKAW3(JWL) 151 ! *.3- Backscattering by seawater 152 ZBW= XAKBW(JWL) 153 ! *.4- Backscattering by chlorophyll 154 ZYLMD = EXP(0.014*(440.0-ZWL)) 155 ZAP(1:knon) = 0.06*ZCHLABS*ZWORK1(1:knon) +0.2*(XAW440+0.06*ZWORK1(1:knon))*ZYLMD 163 156 164 !--------------------------------------------------------------------------------- 165 ! *- Determine absorption and backscattering 166 ! coefficients to determine reflectance below the surface (Ro) once for all 167 ! 168 ! *.1- Absorption by chlorophyll 169 ZCHLABS= XAKACHL(JWL) 170 ! *.2- Absorption by seawater 171 ZAW= XAKAW3(JWL) 172 ! *.3- Backscattering by seawater 173 ZBW= XAKBW(JWL) 174 ! *.4- Backscattering by chlorophyll 175 ZYLMD = EXP(0.014*(440.0-ZWL)) 176 ZWORK= EXP(LOG(ZCHL(JI))*0.65) 177 ZAP = 0.06*ZCHLABS*ZWORK +0.2*(XAW440+0.06*ZWORK)*ZYLMD 178 ZBP550 = 0.416 * EXP(LOG(ZCHL(JI))*0.766) 157 !! WHERE ( ZCHL(1:knon) > 0.02 ) 158 !! ZNU(:)=MIN(0.0,0.5*(ZWORK3(:)-0.3)) 159 !! ZBBP(:)=(0.002+0.01*(0.5-0.25*ZWORK3(:))*(ZWL/550.)**ZNU(:))*ZWORK2(:) 160 !! ELSEWHERE 161 !! ZBBP(:)=0.019*(550./ZWL)*ZWORK2(:) !ZBBPf=0.0113 at chl<=0.02 162 !! ENDWHERE 163 164 do JI = 1, knon 165 IF (ZCHL(JI) > 0.02) THEN 166 ZNU(JI)=MIN(0.0,0.5*(ZWORK3(JI)-0.3)) 167 ZBBP(JI)=(0.002+0.01*(0.5-0.25*ZWORK3(JI))*(ZWL/550.)**ZNU(JI)) & 168 *ZWORK2(JI) 169 ELSE 170 ZBBP(JI)=0.019*(550./ZWL)*ZWORK2(JI) !ZBBPf=0.0113 at chl<=0.02 171 ENDIF 172 ENDDO 173 174 ! Morel-Gentili(1991), Eq (12) 175 ! ZHB=h/(h+2*ZBBPf*(1.-h)) 176 ZHB(1:knon)=0.5*ZBW/(0.5*ZBW+ZBBP(1:knon)) 179 177 180 IF ( ZCHL(JI) > 2. ) THEN 181 ZNU=0. 182 ELSE 183 IF ( ZCHL(JI) > 0.02 ) THEN 184 ZWORK=LOG10(ZCHL(JI)) 185 ZNU=0.5*(ZWORK-0.3) 186 ZBBP=(0.002+0.01*(0.5-0.25*ZWORK)*(ZWL/550.)**ZNU)*ZBP550 187 ELSE 188 ZBBP=0.019*(550./ZWL)*ZBP550 !ZBBPf=0.0113 at chl<=0.02 189 ENDIF 178 !--------------------------------------------------------------------------------- 179 ! 3- Compute direct water-leaving albedo (ZRW) 180 !--------------------------------------------------------------------------------- 181 ! Based on Morel & Gentilli 1991 parametrization 182 ZR22(1:knon)=0.48168549-0.014894708*ZSIG(1:knon)-0.20703885*ZSIG(1:knon)**2 183 184 ! Use Morel 91 formula to compute the direct reflectance 185 ! below the surface 186 ZR00(1:knon)=(0.5*ZBW+ZBBP(1:knon))/(ZAW+ZAP(1:knon)) * & 187 (0.6279-0.2227*ZHB(1:knon)-0.0513*ZHB(1:knon)**2 + & 188 (-0.3119+0.2465*ZHB(1:knon))*ZCOSZEN(1:knon)) 189 ZRW(1:knon)=ZR00(1:knon)*(1.-ZR22(1:knon))/(1.-ZR00(1:knon)*ZR22(1:knon)) 190 191 !--------------------------------------------------------------------------------- 192 ! 4- Compute diffuse water-leaving albedo (ZRWDF) 193 !--------------------------------------------------------------------------------- 194 ! as previous water-leaving computation but assumes a uniform incidence of 195 ! shortwave at surface (ue) 196 ZUE=0.676 ! equivalent u_unif for diffuse incidence 197 ZUE2=SQRT(1.0-(1.0-ZUE**2)/ZREFM**2) 198 ZRR0(1:knon)=0.50*(((ZUE2-ZREFM*ZUE)/(ZUE2+ZREFM*ZUE))**2 +((ZUE-ZREFM*ZUE2)/(ZUE+ZREFM*ZUE2))**2) 199 ZRRR(1:knon)=0.50*(((ZUE2-1.34*ZUE)/(ZUE2+1.34*ZUE))**2 +((ZUE-1.34*ZUE2)/(ZUE+1.34*ZUE2))**2) 200 ZR11DF(1:knon)=ZRR0(1:knon)-(0.0152-1.7873*ZUE+6.8972*ZUE**2-8.5778*ZUE**3+4.071*ZSIG(1:knon)-7.6446*ZUE*ZSIG(1:knon)) * & 201 EXP(0.1643-7.8409*ZUE-3.5639*ZUE**2-2.3588*ZSIG(1:knon)+10.0538*ZUE*ZSIG(1:knon))*ZRR0(1:knon)/ZRRR(1:knon) 202 203 ! Use Morel 91 formula to compute the diffuse 204 ! reflectance below the surface 205 ZR00(1:knon)=(0.5*ZBW+ZBBP(1:knon))/(ZAW+ZAP(1:knon))*(0.6279-0.2227*ZHB(1:knon)-0.0513*ZHB(1:knon)**2 + (-0.3119+0.2465*ZHB(1:knon))*ZUE) 206 ZRWDF(1:knon)=ZR00(1:knon)*(1.-ZR22(1:knon))*(1.-ZR11DF(1:knon))/(1.-ZR00(1:knon)*ZR22(1:knon)) 207 208 ! get waveband index inu for each nsw band 209 SELECT CASE(nsw) 210 CASE(2) 211 IF (JWL.LE.49) THEN ! from 200 to 680 nm 212 inu=1 213 ELSE ! from 690 to 4000 nm 214 inu=2 190 215 ENDIF 191 192 ! Morel-Gentili(1991), Eq (12) 193 ! ZHB=h/(h+2*ZBBPf*(1.-h)) 194 ZHB=0.5*ZBW/(0.5*ZBW+ZBBP) 195 196 !--------------------------------------------------------------------------------- 197 ! 3- Compute direct water-leaving albedo (ZRW) 198 !--------------------------------------------------------------------------------- 199 ! Based on Morel & Gentilli 1991 parametrization 200 ZR22=0.48168549-0.014894708*ZSIG-0.20703885*ZSIG**2 201 ! Use Morel 91 formula to compute the direct reflectance 202 ! below the surface 203 ZR00=(0.5*ZBW+ZBBP)/(ZAW+ZAP) *(0.6279-0.2227*ZHB-0.0513*ZHB**2 + (-0.3119+0.2465*ZHB)*ZCOSZEN) 204 ZRW=ZR00*(1.-ZR22)*(1.-ZR11)/(1.-ZR00*ZR22) 205 206 ZRW=ZR00*(1.-ZR22)/(1.-ZR00*ZR22) 207 !--------------------------------------------------------------------------------- 208 ! 4- Compute diffuse water-leaving albedo (ZRWDF) 209 !--------------------------------------------------------------------------------- 210 ! as previous water-leaving computation but assumes a uniform incidence of 211 ! shortwave at surface (ue) 212 ZUE=0.676 ! equivalent u_unif for diffuse incidence 213 ZUE2=SQRT(1.0-(1.0-ZUE**2)/ZREFM**2) 214 ZRR0=0.50*(((ZUE2-ZREFM*ZUE)/(ZUE2+ZREFM*ZUE))**2 +((ZUE-ZREFM*ZUE2)/(ZUE+ZREFM*ZUE2))**2) 215 ZRRR=0.50*(((ZUE2-1.34*ZUE)/(ZUE2+1.34*ZUE))**2 +((ZUE-1.34*ZUE2)/(ZUE+1.34*ZUE2))**2) 216 ZR11DF=ZRR0-(0.0152-1.7873*ZUE+6.8972*ZUE**2-8.5778*ZUE**3+4.071*ZSIG-7.6446*ZUE*ZSIG) & 217 & * EXP(0.1643-7.8409*ZUE-3.5639*ZUE**2-2.3588*ZSIG+10.0538*ZUE*ZSIG)*ZRR0/ZRRR 218 ! Use Morel 91 formula to compute the diffuse 219 ! reflectance below the surface 220 ZR00=(0.5*ZBW+ZBBP)/(ZAW+ZAP) *(0.6279-0.2227*ZHB-0.0513*ZHB**2 + (-0.3119+0.2465*ZHB)*ZUE) 221 ZRWDF=ZR00*(1.-ZR22)*(1.-ZR11DF)/(1.-ZR00*ZR22) 222 223 ! original : correction for foam (Eq 16-17) 224 ZFWC=3.97e-4*PWIND(JI)**(1.59) ! Salisbury 2014 eq(2) at 37GHz, value in fraction 225 ! has to be update once we have information from wave model (discussion with G. Madec) 226 227 ! -------------------------------------------------------------------- 228 ! *- OSA estimation 229 ! -------------------------------------------------------------------- 230 ! partitionning direct and diffuse albedo 231 ! 232 233 ! excluding diffuse albedo ZRW on ZDIR_ALB 234 ZDIR_ALB(JI,JWL) = XFRWL(JWL) *((1.-ZFWC) * (ZR11+ZRW) +ZFWC*XRWC(JWL)) 235 ZSCA_ALB(JI,JWL) = XFRWL(JWL) *((1.-ZFWC) * (ZRDF+ZRWDF) + ZFWC*XRWC(JWL)) 236 237 ! print*,ji,ZFWC,ZDIR_ALB(JI,JWL),ZSCA_ALB(JI,JWL),pwind(ji) 238 ENDDO ! end of the loop over grid points 216 CASE(4) 217 IF (JWL.LE.49) THEN ! from 200 to 680 nm 218 inu=1 219 ELSE IF (JWL.LE.99) THEN ! from 690 to 1180 nm 220 inu=2 221 ELSE IF (JWL.LE.218) THEN ! from 1190 to 2370 nm 222 inu=3 223 ELSE ! from 2380 to 4000 nm 224 inu=4 225 ENDIF 226 CASE(6) 227 IF (JWL.LE.5) THEN ! from 200 to 240 nm 228 inu=1 229 ELSE IF (JWL.LE.24) THEN ! from 250 to 430 nm 230 inu=2 231 ELSE IF (JWL.LE.49) THEN ! from 440 to 680 nm 232 inu=3 233 ELSE IF (JWL.LE.99) THEN ! from 690 to 1180 nm 234 inu=4 235 ELSE IF (JWL.LE.218) THEN ! from 1190 to 2370 nm 236 inu=5 237 ELSE ! from 2380 to 4000 nm 238 inu=6 239 ENDIF 240 END SELECT 241 242 ! partitionning direct and diffuse albedo 243 ! excluding diffuse albedo ZRW on ZDIR_ALB 244 245 !--direct 246 alb_dir_new(1:knon,inu)=alb_dir_new(1:knon,inu) + & 247 ( XFRWL(JWL) * ((1.-ZFWC(1:knon)) * (ZR11(1:knon)+ZRW(1:knon)) + ZFWC(1:knon)*XRWC(JWL)) )/SFRWL(inu) 248 !--diffuse 249 alb_dif_new(1:knon,inu)=alb_dif_new(1:knon,inu) + & 250 ( XFRWL(JWL) * ((1.-ZFWC(1:knon)) * (ZRDF(1:knon)+ZRWDF(1:knon)) + ZFWC(1:knon)*XRWC(JWL)) )/SFRWL(inu) 239 251 240 252 ENDDO ! ending loop over wavelengths 241 253 242 243 ! integral for each nsw band 244 245 select case(nsw) 246 case(2) 247 do ji=1,knon 248 alb_dir_new(ji,1)=sum(zdir_alb(ji,1:49))/SFRWL(1) ! from 200nm to 680nm 249 alb_dir_new(ji,2)=sum(zdir_alb(ji,50:381))/SFRWL(2) ! from 690nm to 4000 nm 250 251 alb_dif_new(ji,1)=sum(zsca_alb(ji,1:49))/SFRWL(1) ! from 200nm to 680nm 252 alb_dif_new(ji,2)=sum(zsca_alb(ji,50:381))/SFRWL(2) ! from 690nm to 4000 nm 253 enddo 254 case(4) 255 do ji=1,knon 256 alb_dir_new(ji,1)=sum(zdir_alb(ji,1:49))/SFRWL(1) ! from 200nm to 680nm 257 alb_dir_new(ji,2)=sum(zdir_alb(ji,50:99))/SFRWL(2) ! from 690nm to 1180 nm 258 alb_dir_new(ji,3)=sum(zdir_alb(ji,100:218))/SFRWL(3) ! from 1190nm to 2370 nm 259 alb_dir_new(ji,4)=sum(zdir_alb(ji,219:381))/SFRWL(4) ! from 2380nm to 4000 nm 260 261 alb_dif_new(ji,1)=sum(zsca_alb(ji,1:49))/SFRWL(1) ! from 200nm to 680nm 262 alb_dif_new(ji,2)=sum(zsca_alb(ji,50:99))/SFRWL(2) ! from 690nm to 1180 nm 263 alb_dif_new(ji,3)=sum(zsca_alb(ji,100:218))/SFRWL(3) ! from 1190nm to 2370 nm 264 alb_dif_new(ji,4)=sum(zsca_alb(ji,219:381))/SFRWL(4) ! from 2380nm to 4000 nm 265 enddo 266 case(6) 267 do ji=1,knon 268 alb_dir_new(ji,1)=sum(zdir_alb(ji,1:5))/SFRWL(1) ! from 200nm to 240nm 269 alb_dir_new(ji,2)=sum(zdir_alb(ji,6:24))/SFRWL(2) ! from 250nm to 430 nm 270 alb_dir_new(ji,3)=sum(zdir_alb(ji,25:49))/SFRWL(3) ! from 440nm to 680 nm 271 alb_dir_new(ji,4)=sum(zdir_alb(ji,50:99))/SFRWL(4) ! from 690nm to 1180 nm 272 alb_dir_new(ji,5)=sum(zdir_alb(ji,100:218))/SFRWL(5) ! from 1190nm to 2370 nm 273 alb_dir_new(ji,6)=sum(zdir_alb(ji,219:381))/SFRWL(6) ! from 2380nm to 4000 nm 274 275 alb_dif_new(ji,1)=sum(zsca_alb(ji,1:5))/SFRWL(1) ! from 200nm to 240nm 276 alb_dif_new(ji,2)=sum(zsca_alb(ji,6:24))/SFRWL(2) ! from 250nm to 430 nm 277 alb_dif_new(ji,3)=sum(zsca_alb(ji,25:49))/SFRWL(3) ! from 440nm to 680 nm 278 alb_dif_new(ji,4)=sum(zsca_alb(ji,50:99))/SFRWL(4) ! from 690nm to 1180 nm 279 alb_dif_new(ji,5)=sum(zsca_alb(ji,100:218))/SFRWL(5) ! from 1190nm to 2370 nm 280 alb_dif_new(ji,6)=sum(zsca_alb(ji,219:381))/SFRWL(6) ! from 2380nm to 4000 nm 281 enddo 282 end select 283 284 285 286 END subroutine ocean_albedo 287 254 END SUBROUTINE ocean_albedo -
LMDZ5/branches/testing/libf/phylmd/pbl_surface_mod.F90
r2669 r2720 179 179 z0m, z0h, agesno, sollw, solsw, & 180 180 d_ts, evap, fluxlat, t2m, & 181 wfbils, wfbilo, flux_t, flux_u, flux_v,& 181 wfbils, wfbilo, wfevap, wfrain, wfsnow, & 182 flux_t, flux_u, flux_v, & 182 183 dflux_t, dflux_q, zxsnow, & 183 184 !jyg< … … 431 432 REAL, DIMENSION(klon, nbsrf), INTENT(OUT) :: t2m ! temperature at 2 meter height 432 433 REAL, DIMENSION(klon, nbsrf), INTENT(OUT) :: wfbils ! heat balance at surface 433 REAL, DIMENSION(klon, nbsrf), INTENT(OUT) :: wfbilo ! water balance at surface 434 REAL, DIMENSION(klon, nbsrf), INTENT(OUT) :: wfbilo ! water balance at surface weighted by srf 435 REAL, DIMENSION(klon, nbsrf), INTENT(OUT) :: wfevap ! water balance (evap) at surface weighted by srf 436 REAL, DIMENSION(klon, nbsrf), INTENT(OUT) :: wfrain ! water balance (rain) at surface weighted by srf 437 REAL, DIMENSION(klon, nbsrf), INTENT(OUT) :: wfsnow ! water balance (snow) at surface weighted by srf 434 438 REAL, DIMENSION(klon, klev, nbsrf), INTENT(OUT) :: flux_t ! sensible heat flux (CpT) J/m**2/s (W/m**2) 435 439 ! positve orientation downwards … … 845 849 zt2m(:)=0. ; zq2m(:)=0. ; qsat2m(:)=0. ; rh2m(:)=0. 846 850 d_t(:,:)=0. ; d_t_diss(:,:)=0. ; d_q(:,:)=0. ; d_u(:,:)=0. ; d_v(:,:)=0. 847 zcoefh(:,:,:)=0. ; zcoefm(:,:,:)=0.848 851 zxsens_x(:)=0. ; zxsens_w(:)=0. ; zxfluxlat_x(:)=0. ; zxfluxlat_w(:)=0. 849 852 cdragh_x(:)=0. ; cdragh_w(:)=0. ; cdragm_x(:)=0. ; cdragm_w(:)=0. … … 865 868 fluxlat(:,:)=0. 866 869 wfbils(:,:)=0. ; wfbilo(:,:)=0. 870 wfevap(:,:)=0. ; wfrain(:,:)=0. ; wfsnow(:,:)=0. 867 871 flux_t(:,:,:)=0. ; flux_q(:,:,:)=0. ; flux_u(:,:,:)=0. ; flux_v(:,:,:)=0. 868 872 dflux_t(:)=0. ; dflux_q(:)=0. … … 2098 2102 CALL yamada_c(knon,dtime,ypaprs,ypplay & 2099 2103 & ,yu,yv,yt,y_d_u,y_d_v,y_d_t,ycdragm,ytke,ycoefm,ycoefh,ycoefq,y_d_t_diss,yustar & 2100 & ,iflag_pbl ,nsrf)2104 & ,iflag_pbl) 2101 2105 ENDIF 2102 2106 ! print*,'yamada_c OK' … … 2116 2120 & ,yu_x,yv_x,yt_x,y_d_u_x,y_d_v_x,y_d_t_x,ycdragm_x,ytke_x,ycoefm_x,ycoefh_x & 2117 2121 ,ycoefq_x,y_d_t_diss_x,yustar_x & 2118 & ,iflag_pbl ,nsrf)2122 & ,iflag_pbl) 2119 2123 ENDIF 2120 2124 ! print*,'yamada_c OK' … … 2133 2137 & ,yu_w,yv_w,yt_w,y_d_u_w,y_d_v_w,y_d_t_w,ycdragm_w,ytke_w,ycoefm_w,ycoefh_w & 2134 2138 ,ycoefq_w,y_d_t_diss_w,yustar_w & 2135 & ,iflag_pbl ,nsrf)2139 & ,iflag_pbl) 2136 2140 ENDIF 2137 2141 ! print*,'yamada_c OK' … … 2321 2325 !!! 2322 2326 IF (iflag_split .eq.0) THEN 2323 DO k = 2, klev2327 DO k = 1, klev 2324 2328 DO j = 1, knon 2325 2329 i = ni(j) … … 2334 2338 2335 2339 ELSE 2336 DO k = 2, klev2340 DO k = 1, klev 2337 2341 DO j = 1, knon 2338 2342 i = ni(j) … … 2823 2827 wfbils(i,nsrf) = ( solsw(i,nsrf) + sollw(i,nsrf) & 2824 2828 + flux_t(i,1,nsrf) + fluxlat(i,nsrf) ) * pctsrf(i,nsrf) 2825 wfbilo(i,nsrf) = (evap(i,nsrf) - (rain_f(i) + snow_f(i))) * & 2826 pctsrf(i,nsrf) 2829 wfbilo(i,nsrf) = (evap(i,nsrf)-(rain_f(i)+snow_f(i)))*pctsrf(i,nsrf) 2830 wfevap(i,nsrf) = evap(i,nsrf)*pctsrf(i,nsrf) 2831 wfrain(i,nsrf) = rain_f(i)*pctsrf(i,nsrf) 2832 wfsnow(i,nsrf) = snow_f(i)*pctsrf(i,nsrf) 2827 2833 2828 2834 zxtsol(i) = zxtsol(i) + ts(i,nsrf) * pctsrf(i,nsrf) -
LMDZ5/branches/testing/libf/phylmd/phys_local_var_mod.F90
r2641 r2720 29 29 REAL, SAVE, ALLOCATABLE :: d_u_dyn(:,:), d_v_dyn(:,:) 30 30 !$OMP THREADPRIVATE(d_u_dyn, d_v_dyn) 31 !!!!32 31 REAL, SAVE, ALLOCATABLE :: d_tr_dyn(:,:,:) 33 32 !$OMP THREADPRIVATE(d_tr_dyn) 34 !!!!35 33 REAL, SAVE, ALLOCATABLE :: d_t_con(:,:),d_q_con(:,:) 36 34 !$OMP THREADPRIVATE(d_t_con,d_q_con) … … 55 53 !$OMP THREADPRIVATE(d_t_ajs_x, d_q_ajs_x) 56 54 !>nrlmd 57 REAL, SAVE, ALLOCATABLE :: d_t_eva(:,:),d_q_eva(:,:) 58 !$OMP THREADPRIVATE(d_t_eva,d_q_eva )55 REAL, SAVE, ALLOCATABLE :: d_t_eva(:,:),d_q_eva(:,:),d_ql_eva(:,:),d_qi_eva(:,:) 56 !$OMP THREADPRIVATE(d_t_eva,d_q_eva,d_ql_eva,d_qi_eva) 59 57 REAL, SAVE, ALLOCATABLE :: d_t_lscst(:,:),d_q_lscst(:,:) 60 58 !$OMP THREADPRIVATE(d_t_lscst,d_q_lscst) … … 372 370 REAL,ALLOCATABLE,SAVE,DIMENSION(:,:) :: fsolsw, wfbils, wfbilo 373 371 !$OMP THREADPRIVATE(fsolsw, wfbils, wfbilo) 372 REAL,ALLOCATABLE,SAVE,DIMENSION(:,:) :: wfevap, wfrain, wfsnow 373 !$OMP THREADPRIVATE(wfevap,wfrain,wfsnow) 374 374 REAL,ALLOCATABLE,SAVE,DIMENSION(:,:) :: t2m, fluxlat, fsollw,evap_pot 375 375 !$OMP THREADPRIVATE(t2m, fluxlat, fsollw,evap_pot) … … 418 418 !$OMP THREADPRIVATE(sissnow,runoff,albsol3_lic) 419 419 420 #ifdef CPP_StratAer 421 ! variables for strat. aerosol CK 422 REAL, ALLOCATABLE, SAVE, DIMENSION(:,:) :: R2SO4 423 !$OMP THREADPRIVATE(R2SO4) 424 REAL, ALLOCATABLE, SAVE, DIMENSION(:,:) :: DENSO4 425 !$OMP THREADPRIVATE(DENSO4) 426 REAL, ALLOCATABLE, SAVE, DIMENSION(:,:) :: f_r_wet 427 !$OMP THREADPRIVATE(f_r_wet) 428 REAL, ALLOCATABLE, SAVE, DIMENSION(:) :: sfluxaer 429 !$OMP THREADPRIVATE(sfluxaer) 430 REAL, ALLOCATABLE, SAVE, DIMENSION(:,:) :: decfluxaer 431 !$OMP THREADPRIVATE(decfluxaer) 432 REAL, ALLOCATABLE, SAVE, DIMENSION(:) :: mdw 433 !$OMP THREADPRIVATE(mdw) 434 REAL, ALLOCATABLE, SAVE, DIMENSION(:,:) :: sulf_convert 435 !$OMP THREADPRIVATE(sulf_convert) 436 REAL, ALLOCATABLE, SAVE, DIMENSION(:,:) :: sulf_nucl 437 !$OMP THREADPRIVATE(sulf_nucl) 438 REAL, ALLOCATABLE, SAVE, DIMENSION(:,:) :: sulf_cond_evap 439 !$OMP THREADPRIVATE(sulf_cond_evap) 440 REAL, ALLOCATABLE, SAVE, DIMENSION(:,:) :: ocs_convert 441 !$OMP THREADPRIVATE(ocs_convert) 442 REAL, ALLOCATABLE, SAVE, DIMENSION(:,:) :: SO2_backgr_tend 443 !$OMP THREADPRIVATE(SO2_backgr_tend) 444 REAL, ALLOCATABLE, SAVE, DIMENSION(:,:) :: OCS_backgr_tend 445 !$OMP THREADPRIVATE(OCS_backgr_tend) 446 REAL, ALLOCATABLE, SAVE, DIMENSION(:,:) :: OCS_lifetime 447 !$OMP THREADPRIVATE(OCS_lifetime) 448 REAL, ALLOCATABLE, SAVE, DIMENSION(:,:) :: SO2_lifetime 449 !$OMP THREADPRIVATE(SO2_lifetime) 450 REAL, ALLOCATABLE, SAVE, DIMENSION(:,:) :: alpha_bin 451 !$OMP THREADPRIVATE(alpha_bin) 452 REAL, ALLOCATABLE, SAVE, DIMENSION(:,:) :: piz_bin 453 !$OMP THREADPRIVATE(piz_bin) 454 REAL, ALLOCATABLE, SAVE, DIMENSION(:,:) :: cg_bin 455 !$OMP THREADPRIVATE(cg_bin) 456 REAL, ALLOCATABLE, SAVE, DIMENSION(:,:) :: tau_strat_550 457 !$OMP THREADPRIVATE(tau_strat_550) 458 REAL, ALLOCATABLE, SAVE, DIMENSION(:,:) :: tau_strat_550_lay 459 !$OMP THREADPRIVATE(tau_strat_550_lay) 460 REAL, ALLOCATABLE, SAVE, DIMENSION(:,:) :: tau_strat_1020 461 !$OMP THREADPRIVATE(tau_strat_1020) 462 REAL, ALLOCATABLE, SAVE, DIMENSION(:,:) :: tausum_strat 463 !$OMP THREADPRIVATE(tausum_strat) 464 REAL, ALLOCATABLE, SAVE, DIMENSION(:) :: sulf_dep_dry 465 !$OMP THREADPRIVATE(sulf_dep_dry) 466 REAL, ALLOCATABLE, SAVE, DIMENSION(:) :: sulf_dep_wet 467 !$OMP THREADPRIVATE(sulf_dep_wet) 468 REAL, ALLOCATABLE, SAVE, DIMENSION(:) :: surf_PM25_sulf 469 !$OMP THREADPRIVATE(surf_PM25_sulf) 470 REAL, ALLOCATABLE, SAVE, DIMENSION(:) :: p_tropopause 471 !$OMP THREADPRIVATE(p_tropopause) 472 REAL, ALLOCATABLE, SAVE, DIMENSION(:,:) :: vsed_aer 473 !$OMP THREADPRIVATE(vsed_aer) 474 #endif 475 420 476 CONTAINS 421 477 … … 456 512 allocate(d_u_ajs(klon,klev),d_v_ajs(klon,klev)) 457 513 allocate(d_t_eva(klon,klev),d_q_eva(klon,klev)) 514 allocate(d_ql_eva(klon,klev),d_qi_eva(klon,klev)) 458 515 allocate(d_t_lscst(klon,klev),d_q_lscst(klon,klev)) 459 516 allocate(d_t_lscth(klon,klev),d_q_lscth(klon,klev)) … … 633 690 ALLOCATE(fsollw(klon, nbsrf)) 634 691 ALLOCATE(fsolsw(klon, nbsrf), wfbils(klon, nbsrf), wfbilo(klon, nbsrf)) 692 ALLOCATE(wfevap(klon, nbsrf), wfrain(klon,nbsrf), wfsnow(klon, nbsrf)) 635 693 ALLOCATE(evap_pot(klon, nbsrf)) 636 694 … … 656 714 ALLOCATE (sissnow(klon),runoff(klon),albsol3_lic(klon)) 657 715 658 716 #ifdef CPP_StratAer 717 ALLOCATE (R2SO4(klon,klev)) 718 ALLOCATE (DENSO4(klon,klev)) 719 ALLOCATE (f_r_wet(klon,klev)) 720 ALLOCATE (sfluxaer(klon)) 721 ALLOCATE (decfluxaer(klon,nbtr)) 722 ALLOCATE (mdw(nbtr)) 723 ALLOCATE (sulf_convert(klon,klev)) 724 ALLOCATE (sulf_nucl(klon,klev)) 725 ALLOCATE (sulf_cond_evap(klon,klev)) 726 ALLOCATE (ocs_convert(klon,klev)) 727 ALLOCATE (SO2_backgr_tend(klon,klev)) 728 ALLOCATE (OCS_backgr_tend(klon,klev)) 729 ALLOCATE (OCS_lifetime(klon,klev)) 730 ALLOCATE (SO2_lifetime(klon,klev)) 731 ALLOCATE (alpha_bin(nbands_sw_rrtm+nbands_lw_rrtm+nwave+nwave_lw,nbtr)) 732 ALLOCATE (piz_bin(nbands_sw_rrtm+nbands_lw_rrtm+nwave+nwave_lw,nbtr)) 733 ALLOCATE (cg_bin(nbands_sw_rrtm+nbands_lw_rrtm+nwave+nwave_lw,nbtr)) 734 ALLOCATE (tau_strat_550(klon,klev)) 735 ALLOCATE (tau_strat_550_lay(klon,klev)) 736 ALLOCATE (tau_strat_1020(klon,klev)) 737 ALLOCATE (tausum_strat(klon,3)) 738 ALLOCATE (sulf_dep_dry(klon)) 739 ALLOCATE (sulf_dep_wet(klon)) 740 ALLOCATE (surf_PM25_sulf(klon)) 741 ALLOCATE (p_tropopause(klon)) 742 ALLOCATE (vsed_aer(klon,klev)) 743 #endif 659 744 660 745 END SUBROUTINE phys_local_var_init … … 690 775 deallocate(d_u_ajs,d_v_ajs) 691 776 deallocate(d_t_eva,d_q_eva) 777 deallocate(d_ql_eva,d_qi_eva) 692 778 deallocate(d_t_lscst,d_q_lscst) 693 779 deallocate(d_t_lscth,d_q_lscth) … … 854 940 DEALLOCATE(fsollw, evap_pot) 855 941 DEALLOCATE(fsolsw, wfbils, wfbilo) 942 DEALLOCATE(wfevap,wfrain,wfsnow) 856 943 857 944 DEALLOCATE(pmflxr, pmflxs, prfl) … … 872 959 DEALLOCATE (zxsnow,snowhgt,qsnow,to_ice,sissnow,runoff,albsol3_lic) 873 960 961 #ifdef CPP_StratAer 962 ! variables for strat. aerosol CK 963 DEALLOCATE (R2SO4) 964 DEALLOCATE (DENSO4) 965 DEALLOCATE (f_r_wet) 966 DEALLOCATE (sfluxaer) 967 DEALLOCATE (decfluxaer) 968 DEALLOCATE (mdw) 969 DEALLOCATE (sulf_convert) 970 DEALLOCATE (sulf_nucl) 971 DEALLOCATE (sulf_cond_evap) 972 DEALLOCATE (ocs_convert) 973 DEALLOCATE (SO2_backgr_tend) 974 DEALLOCATE (OCS_backgr_tend) 975 DEALLOCATE (SO2_lifetime) 976 DEALLOCATE (OCS_lifetime) 977 DEALLOCATE (alpha_bin) 978 DEALLOCATE (piz_bin) 979 DEALLOCATE (cg_bin) 980 DEALLOCATE (tau_strat_550) 981 DEALLOCATE (tau_strat_550_lay) 982 DEALLOCATE (tau_strat_1020) 983 DEALLOCATE (tausum_strat) 984 DEALLOCATE (sulf_dep_dry) 985 DEALLOCATE (sulf_dep_wet) 986 DEALLOCATE (surf_PM25_sulf) 987 DEALLOCATE (p_tropopause) 988 DEALLOCATE (vsed_aer) 989 #endif 990 874 991 END SUBROUTINE phys_local_var_end 875 992 -
LMDZ5/branches/testing/libf/phylmd/phys_output_ctrlout_mod.F90
r2669 r2720 586 586 ctrl_out((/ 1, 10, 10, 10, 10, 10, 11, 11, 11 /),'wbilo_sic', & 587 587 "Bilan eau "//clnsurf(4),"kg/(m2*s)", (/ ('', i=1, 9) /)) /) 588 589 TYPE(ctrl_out), SAVE, DIMENSION(4) :: o_wevap_srf = (/ & 590 ctrl_out((/ 1, 10, 10, 10, 10, 10, 11, 11, 11 /),'wevap_ter', & 591 "Evap eau "//clnsurf(1),"kg/(m2*s)", (/ ('', i=1, 9) /)), & 592 ctrl_out((/ 1, 10, 10, 10, 10, 10, 11, 11, 11 /),'wevap_lic', & 593 "Evap eau "//clnsurf(2),"kg/(m2*s)", (/ ('', i=1, 9) /)), & 594 ctrl_out((/ 1, 10, 10, 10, 10, 10, 11, 11, 11 /),'wevap_oce', & 595 "Evap eau "//clnsurf(3),"kg/(m2*s)", (/ ('', i=1, 9) /)), & 596 ctrl_out((/ 1, 10, 10, 10, 10, 10, 11, 11, 11 /),'wevap_sic', & 597 "Evap eau "//clnsurf(4),"kg/(m2*s)", (/ ('', i=1, 9) /)) /) 598 599 TYPE(ctrl_out), SAVE, DIMENSION(4) :: o_wrain_srf = (/ & 600 ctrl_out((/ 1, 10, 10, 10, 10, 10, 11, 11, 11 /),'wrain_ter', & 601 "Pluie eau "//clnsurf(1),"kg/(m2*s)", (/ ('', i=1, 9) /)), & 602 ctrl_out((/ 1, 10, 10, 10, 10, 10, 11, 11, 11 /),'wrain_lic', & 603 "Pluie eau "//clnsurf(2),"kg/(m2*s)", (/ ('', i=1, 9) /)), & 604 ctrl_out((/ 1, 10, 10, 10, 10, 10, 11, 11, 11 /),'wrain_oce', & 605 "Pluie eau "//clnsurf(3),"kg/(m2*s)", (/ ('', i=1, 9) /)), & 606 ctrl_out((/ 1, 10, 10, 10, 10, 10, 11, 11, 11 /),'wrain_sic', & 607 "Pluie eau "//clnsurf(4),"kg/(m2*s)", (/ ('', i=1, 9) /)) /) 608 609 TYPE(ctrl_out), SAVE, DIMENSION(4) :: o_wsnow_srf = (/ & 610 ctrl_out((/ 1, 10, 10, 10, 10, 10, 11, 11, 11 /),'wsnow_ter', & 611 "Neige eau "//clnsurf(1),"kg/(m2*s)", (/ ('', i=1, 9) /)), & 612 ctrl_out((/ 1, 10, 10, 10, 10, 10, 11, 11, 11 /),'wsnow_lic', & 613 "Neige eau "//clnsurf(2),"kg/(m2*s)", (/ ('', i=1, 9) /)), & 614 ctrl_out((/ 1, 10, 10, 10, 10, 10, 11, 11, 11 /),'wsnow_oce', & 615 "Neige eau "//clnsurf(3),"kg/(m2*s)", (/ ('', i=1, 9) /)), & 616 ctrl_out((/ 1, 10, 10, 10, 10, 10, 11, 11, 11 /),'wsnow_sic', & 617 "Neige eau "//clnsurf(4),"kg/(m2*s)", (/ ('', i=1, 9) /)) /) 588 618 589 619 TYPE(ctrl_out), SAVE :: o_cdrm = ctrl_out((/ 1, 10, 10, 10, 10, 10, 11, 11, 11 /), & … … 1144 1174 'lcc', 'Cloud liquid fraction at top of cloud', '1', (/ ('', i=1, 9) /)) 1145 1175 1176 #ifdef CPP_StratAer 1177 TYPE(ctrl_out), SAVE :: o_ext_strat_550 = ctrl_out((/ 1, 6, 7, 10, 10, 10, 11, 11, 11 /), & 1178 'ext_strat_550', 'Strat. aerosol extinction coefficient at 550 nm', '1/m', (/ ('', i=1, 9) /)) 1179 TYPE(ctrl_out), SAVE :: o_ext_strat_1020 = ctrl_out((/ 1, 6, 7, 10, 10, 10, 11, 11, 11 /), & 1180 'ext_strat_1020', 'Strat. aerosol extinction coefficient at 1020 nm', '1/m', (/ ('', i=1, 9) /)) 1181 TYPE(ctrl_out), SAVE :: o_tau_strat_550 = ctrl_out((/ 1, 6, 7, 10, 10, 10, 11, 11, 11 /), & 1182 'OD550_strat_only', 'Stratospheric Aerosol Optical depth at 550 nm ', '1', (/ ('', i=1, 9) /)) 1183 TYPE(ctrl_out), SAVE :: o_tau_strat_1020 = ctrl_out((/ 1, 6, 7, 10, 10, 10, 11, 11, 11 /), & 1184 'OD1020_strat_only', 'Stratospheric Aerosol Optical depth at 1020 nm ', '1', (/ ('', i=1, 9) /)) 1185 TYPE(ctrl_out), SAVE :: o_sulf_convert = ctrl_out((/ 1, 6, 7, 10, 10, 10, 11, 11, 11 /), & 1186 'sulf_convert', 'SO2 mass flux converted to H2SO4', 'kg(S)/m2/layer/s', (/ ('', i=1, 9) /)) 1187 TYPE(ctrl_out), SAVE :: o_sulf_nucl = ctrl_out((/ 1, 6, 7, 10, 10, 10, 11, 11, 11 /), & 1188 'sulf_nucl', 'H2SO4 nucleation mass flux', 'kg(S)/m2/layer/s', (/ ('', i=1, 9) /)) 1189 TYPE(ctrl_out), SAVE :: o_sulf_cond_evap = ctrl_out((/ 1, 6, 7, 10, 10, 10, 11, 11, 11 /), & 1190 'sulf_cond_evap', 'H2SO4 condensation/evaporation mass flux', 'kg(S)/m2/layer/s', (/ ('', i=1, 9) /)) 1191 TYPE(ctrl_out), SAVE :: o_ocs_convert = ctrl_out((/ 1, 6, 7, 10, 10, 10, 11, 11, 11 /), & 1192 'ocs_convert', 'OCS mass flux converted to SO2', 'kg(S)/m2/layer/s', (/ ('', i=1, 9) /)) 1193 TYPE(ctrl_out), SAVE :: o_R2SO4 = ctrl_out((/ 1, 6, 7, 10, 10, 10, 11, 11, 11 /), & 1194 'R2SO4', 'H2SO4 mass fraction in aerosol', '%', (/ ('', i=1, 9) /)) 1195 TYPE(ctrl_out), SAVE :: o_OCS_lifetime = ctrl_out((/ 1, 6, 7, 10, 10, 10, 11, 11, 11 /), & 1196 'OCS_lifetime', 'OCS lifetime', 's', (/ ('', i=1, 9) /)) 1197 TYPE(ctrl_out), SAVE :: o_SO2_lifetime = ctrl_out((/ 1, 6, 7, 10, 10, 10, 11, 11, 11 /), & 1198 'SO2_lifetime', 'SO2 lifetime', 's', (/ ('', i=1, 9) /)) 1199 TYPE(ctrl_out), SAVE :: o_SO2_backgr_tend = ctrl_out((/ 1, 6, 7, 10, 10, 10, 11, 11, 11 /), & 1200 'SO2_backgr_tend', 'SO2 background tendency', 'kg(S)/m2/layer/s', (/ ('', i=1, 9) /)) 1201 TYPE(ctrl_out), SAVE :: o_OCS_backgr_tend = ctrl_out((/ 1, 6, 7, 10, 10, 10, 11, 11, 11 /), & 1202 'OCS_backgr_tend', 'OCS background tendency', 'kg(S)/m2/layer/s', (/ ('', i=1, 9) /)) 1203 TYPE(ctrl_out), SAVE :: o_vsed_aer = ctrl_out((/ 1, 6, 7, 10, 10, 10, 11, 11, 11 /), & 1204 'vsed_aer', 'Strat. aerosol sedimentation velocity (mass-weighted)', 'm/s', (/ ('', i=1, 9) /)) 1205 TYPE(ctrl_out), SAVE :: o_f_r_wet = ctrl_out((/ 1, 6, 7, 10, 10, 10, 11, 11, 11 /), & 1206 'f_r_wet', 'Conversion factor dry to wet aerosol radius', '-', (/ ('', i=1, 9) /)) 1207 TYPE(ctrl_out), SAVE :: o_sulf_dep_dry = ctrl_out((/ 1, 10, 10, 10, 10, 10, 11, 11, 11 /), & 1208 'sulf_dep_dry', 'Sulfur dry deposition flux', 'kg(S)/m2/s', (/ ('', i=1, 9) /)) 1209 TYPE(ctrl_out), SAVE :: o_sulf_dep_wet = ctrl_out((/ 1, 10, 10, 10, 10, 10, 11, 11, 11 /), & 1210 'sulf_dep_wet', 'Sulfur wet deposition flux', 'kg(S)/m2/s', (/ ('', i=1, 9) /)) 1211 TYPE(ctrl_out), SAVE :: o_surf_PM25_sulf = ctrl_out((/ 1, 10, 10, 10, 10, 10, 11, 11, 11 /), & 1212 'surf_PM25_sulf', 'Sulfate PM2.5 concentration at the surface', 'ug/m3', (/ ('', i=1, 9) /)) 1213 TYPE(ctrl_out), SAVE :: o_p_tropopause = ctrl_out((/ 1, 10, 10, 10, 10, 10, 11, 11, 11 /), & 1214 'p_tropopause', 'Tropopause pressure', 'Pa', (/ ('', i=1, 9) /)) 1215 TYPE(ctrl_out), SAVE :: o_sfluxaer = ctrl_out((/ 1, 10, 10, 10, 10, 10, 11, 11, 11 /), & 1216 'sflux', 'Ground sedimentation flux of strat. particles', 'kg(S)/m2/s', (/ ('', i=1, 9) /)) 1217 #endif 1146 1218 1147 1219 !!!!!!!!!!!!!!!!!!!!!! 3D !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! … … 1204 1276 TYPE(ctrl_out), SAVE :: o_ep = ctrl_out((/ 2, 10, 10, 10, 10, 10, 11, 11, 11 /), & 1205 1277 'ep', 'ep', 'su', (/ ('', i=1, 9) /)) 1278 TYPE(ctrl_out), SAVE :: o_duphy = ctrl_out((/ 2, 10, 10, 10, 10, 10, 11, 11, 11 /), & 1279 'duphy', 'Physics du', 'm/s2', (/ ('', i=1, 9) /)) 1206 1280 TYPE(ctrl_out), SAVE :: o_dtphy = ctrl_out((/ 2, 10, 10, 10, 10, 10, 11, 11, 11 /), & 1207 1281 'dtphy', 'Physics dT', 'K/s', (/ ('', i=1, 9) /)) -
LMDZ5/branches/testing/libf/phylmd/phys_output_mod.F90
r2594 r2720 32 32 new_aod, aerosol_couple, flag_aerosol_strat, & 33 33 pdtphys, paprs, pphis, pplay, lmax_th, ptconv, ptconvth, ivap, & 34 d_ t, qx, d_qx, zmasse, ok_sync)34 d_u, d_t, qx, d_qx, zmasse, ok_sync) 35 35 36 36 USE iophy … … 41 41 USE mod_phys_lmdz_para 42 42 USE aero_mod, only : naero_spc,name_aero 43 43 !Martin 44 44 USE surface_data, ONLY : ok_snow 45 45 USE phys_output_ctrlout_mod … … 65 65 REAL, INTENT(IN) :: pdtphys 66 66 REAL, DIMENSION(klon), INTENT(IN) :: pphis 67 REAL, DIMENSION(klon, klev), INTENT(IN) :: pplay, d_ t67 REAL, DIMENSION(klon, klev), INTENT(IN) :: pplay, d_u, d_t 68 68 REAL, DIMENSION(klon, klev+1), INTENT(IN) :: paprs 69 69 REAL, DIMENSION(klon,klev,nqtot), INTENT(IN):: qx, d_qx … … 265 265 CALL ymds2ju(annee_ref, 1, idayref, 0.0, zjulian) 266 266 CALL ymds2ju(annee_ref, 1, day_ini, start_time*rday, zjulian_start) 267 END 267 ENDIF 268 268 269 269 #ifdef CPP_XIOS … … 293 293 WRITE(lunout,*)'Bp Hybrid = ',Bhyb(1:klev) 294 294 WRITE(lunout,*)'Alt approx des couches pour une haut d echelle de 8km = ',Alt(1:klev) 295 ! endif295 ! ENDIF 296 296 297 297 ecrit_files(7) = ecrit_files(1) … … 302 302 303 303 ! Calculate ecrit_files for all files 304 IF ( chtimestep(iff).eq.'Default' ) then304 IF ( chtimestep(iff).eq.'Default' ) THEN 305 305 ! Par defaut ecrit_files = (ecrit_mensuel ecrit_jour ecrit_hf 306 306 ! ...)*86400. 307 307 ecrit_files(iff)=ecrit_files(iff)*86400. 308 ELSE IF (chtimestep(iff).eq.'-1') then308 ELSE IF (chtimestep(iff).eq.'-1') THEN 309 309 PRINT*,'ecrit_files(',iff,') < 0 so IOIPSL work on different' 310 310 PRINT*,'months length' 311 311 ecrit_files(iff)=-1. 312 else312 ELSE 313 313 CALL convers_timesteps(chtimestep(iff),dtime,ecrit_files(iff)) 314 314 ENDIF … … 320 320 #ifdef CPP_XIOS 321 321 !!! Ouverture de chaque fichier XIOS !!!!!!!!!!! 322 IF (.not. ok_all_xml) then323 if (prt_level >= 10) then322 IF (.not. ok_all_xml) THEN 323 IF (prt_level >= 10) THEN 324 324 print*,'phys_output_open: call wxios_add_file with phys_out_filenames(iff)=',trim(phys_out_filenames(iff)) 325 endif325 ENDIF 326 326 CALL wxios_add_file(phys_out_filenames(iff),chtimestep(iff),lev_files(iff)) 327 327 ENDIF 328 328 329 329 !!! Declaration des axes verticaux de chaque fichier: 330 if (prt_level >= 10) then330 IF (prt_level >= 10) THEN 331 331 print*,'phys_output_open: Declare vertical axes for each file' 332 endif333 if (iff.le.6) then332 ENDIF 333 IF (iff.le.6) THEN 334 334 CALL wxios_add_vaxis("presnivs", & 335 335 levmax(iff) - levmin(iff) + 1, presnivs(levmin(iff):levmax(iff))) … … 340 340 CALL wxios_add_vaxis("Alt", & 341 341 levmax(iff) - levmin(iff) + 1, Alt) 342 else342 ELSE 343 343 ! NMC files 344 344 CALL wxios_add_vaxis("plev", & 345 345 levmax(iff) - levmin(iff) + 1, rlevSTD(levmin(iff):levmax(iff))) 346 endif346 ENDIF 347 347 #endif 348 348 … … 350 350 !!!!!!!!!!!!!!!!! Traitement dans le cas ou l'on veut stocker sur un domaine limite !! 351 351 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 352 IF (phys_out_regfkey(iff)) then352 IF (phys_out_regfkey(iff)) THEN 353 353 imin_ins=1 354 354 imax_ins=nbp_lon … … 357 357 358 358 ! correction abderr 359 doi=1,nbp_lon359 DO i=1,nbp_lon 360 360 WRITE(lunout,*)'io_lon(i)=',io_lon(i) 361 361 IF (io_lon(i).le.phys_out_lonmin(iff)) imin_ins=i 362 362 IF (io_lon(i).le.phys_out_lonmax(iff)) imax_ins=i+1 363 enddo364 365 doj=1,jjmp1363 ENDDO 364 365 DO j=1,jjmp1 366 366 WRITE(lunout,*)'io_lat(j)=',io_lat(j) 367 367 IF (io_lat(j).ge.phys_out_latmin(iff)) jmax_ins=j+1 368 368 IF (io_lat(j).ge.phys_out_latmax(iff)) jmin_ins=j 369 enddo369 ENDDO 370 370 371 371 WRITE(lunout,*)'On stoke le fichier histoire numero ',iff,' sur ', & … … 382 382 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 383 383 !IM fichiers stations 384 elseIF (clef_stations(iff)) THEN385 386 if (prt_level >= 10) then384 ELSE IF (clef_stations(iff)) THEN 385 386 IF (prt_level >= 10) THEN 387 387 WRITE(lunout,*)'phys_output_open: iff=',iff,' phys_out_filenames(iff)=',phys_out_filenames(iff) 388 endif388 ENDIF 389 389 390 390 CALL histbeg_phy_all(rlon,rlat,pim,tabij,ipt,jpt,plon,plat,plon_bounds,plat_bounds, & 391 391 phys_out_filenames(iff), & 392 392 itau_phy,zjulian,dtime,nhorim(iff),nid_files(iff)) 393 else393 ELSE 394 394 CALL histbeg_phy_all(phys_out_filenames(iff),itau_phy,zjulian,& 395 395 dtime,nhorim(iff),nid_files(iff)) 396 endif396 ENDIF 397 397 398 398 #ifndef CPP_IOIPSL_NO_OUTPUT 399 if (iff.le.6) then399 IF (iff.le.6) THEN 400 400 CALL histvert(nid_files(iff), "presnivs", "Vertical levels", "Pa", & 401 401 levmax(iff) - levmin(iff) + 1, & … … 411 411 levmax(iff) - levmin(iff) + 1,Alt,nvertAlt(iff)) 412 412 413 else413 ELSE 414 414 CALL histvert(nid_files(iff), "plev", "pressure", "Pa", & 415 415 levmax(iff) - levmin(iff) + 1, & 416 416 rlevSTD(levmin(iff):levmax(iff)), nvertm(iff), "down") 417 endif417 ENDIF 418 418 #endif 419 419 420 420 ENDIF ! clef_files 421 421 422 !CR: ajout d'une variable eau423 ! IF (nqtot>=3) THEN424 425 422 IF (nqtot>=nqo+1) THEN 426 ! DO iq=3,nqtot423 ! 427 424 DO iq=nqo+1,nqtot 428 425 iiq=niadv(iq) 429 o_trac(iq-nqo) = ctrl_out((/ 4, 5, 5, 5, 10, 10, 11, 11, 11 /), &426 o_trac(iq-nqo) = ctrl_out((/ 1, 5, 5, 5, 10, 10, 11, 11, 11 /), & 430 427 tname(iiq),'Tracer '//ttext(iiq), "-", & 431 428 (/ '', '', '', '', '', '', '', '', '' /)) … … 500 497 (/ '', '', '', '', '', '', '', '', '' /)) 501 498 502 o_trac_cum(iq-nqo) = ctrl_out((/ 3, 4, 10, 10, 10, 10, 11, 11, 11 /), &499 o_trac_cum(iq-nqo) = ctrl_out((/ 1, 4, 10, 10, 10, 10, 11, 11, 11 /), & 503 500 'cum'//tname(iiq),& 504 501 'Cumulated tracer '//ttext(iiq), "-", & … … 506 503 ENDDO 507 504 ENDIF 508 509 505 510 506 ENDDO ! iff … … 519 515 ecrit_ins = ecrit_files(6) 520 516 521 if (prt_level >= 10) then517 IF (prt_level >= 10) THEN 522 518 WRITE(lunout,*)'swaero_diag=',swaero_diag 523 519 WRITE(lunout,*)'phys_output_open: ends here' 524 endif 525 526 end SUBROUTINE phys_output_open 527 528 520 ENDIF 521 522 END SUBROUTINE phys_output_open 529 523 530 524 SUBROUTINE convers_timesteps(str,dtime,timestep) … … 548 542 WRITE(lunout,*) "ipos = ", ipos 549 543 WRITE(lunout,*) "il = ", il 550 if (ipos == 0) callabort_physic("convers_timesteps", "bad str", 1)544 IF (ipos == 0) CALL abort_physic("convers_timesteps", "bad str", 1) 551 545 read(str(1:ipos),*) ttt 552 546 WRITE(lunout,*)ttt … … 554 548 555 549 556 IF ( il == ipos ) then550 IF ( il == ipos ) THEN 557 551 type='day' 558 endif552 ENDIF 559 553 560 554 IF ( type == 'day'.or.type == 'days'.or.type == 'jours'.or.type == 'jour' ) timestep = ttt * dayseconde 561 IF ( type == 'mounths'.or.type == 'mth'.or.type == 'mois' ) then555 IF ( type == 'mounths'.or.type == 'mth'.or.type == 'mois' ) THEN 562 556 WRITE(lunout,*)'annee_ref,day_ref mon_len',annee_ref,day_ref,mth_len 563 557 timestep = ttt * dayseconde * mth_len 564 endif558 ENDIF 565 559 IF ( type == 'hours'.or.type == 'hr'.or.type == 'heurs') timestep = ttt * dayseconde / 24. 566 560 IF ( type == 'mn'.or.type == 'minutes' ) timestep = ttt * 60. … … 575 569 576 570 END MODULE phys_output_mod 577 578 -
LMDZ5/branches/testing/libf/phylmd/phys_output_write_mod.F90
r2669 r2720 6 6 USE phytrac_mod, ONLY : d_tr_cl, d_tr_th, d_tr_cv, d_tr_lessi_impa, & 7 7 d_tr_lessi_nucl, d_tr_insc, d_tr_bcscav, d_tr_evapls, d_tr_ls, & 8 d_tr_trsp, d_tr_sscav, d_tr_sat, d_tr_uscav 8 d_tr_trsp, d_tr_sscav, d_tr_sat, d_tr_uscav, flux_tr_dry 9 9 10 10 ! Author: Abderrahmane IDELKADI (original include file) … … 19 19 ok_ade, ok_aie, ivap, iliq, isol, new_aod, ok_sync, & 20 20 ptconv, read_climoz, clevSTD, ptconvth, & 21 d_ t, qx, d_qx, zmasse, flag_aerosol, flag_aerosol_strat, ok_cdnc)21 d_u, d_t, qx, d_qx, zmasse, flag_aerosol, flag_aerosol_strat, ok_cdnc) 22 22 23 23 ! This subroutine does the actual writing of diagnostics that were 24 24 ! defined and initialised in phys_output_mod.F90 25 25 26 USE dimphy, only: klon, klev, klevp1 26 USE dimphy, ONLY: klon, klev, klevp1 27 USE infotrac, ONLY: nbtr 27 28 USE mod_phys_lmdz_para, ONLY: is_north_pole_phy,is_south_pole_phy 28 29 USE mod_grid_phy_lmdz, ONLY : nbp_lon, nbp_lat 29 USE time_phylmdz_mod, only: day_step_phy, start_time, itau_phy30 USE phys_output_ctrlout_mod, only: o_phis, o_aire, is_ter, is_lic, is_oce, &30 USE time_phylmdz_mod, ONLY: day_step_phy, start_time, itau_phy 31 USE phys_output_ctrlout_mod, ONLY: o_phis, o_aire, is_ter, is_lic, is_oce, & 31 32 is_ave, is_sic, o_contfracATM, o_contfracOR, & 32 33 o_aireTER, o_flat, o_slp, o_ptstar, o_pt0, o_tsol, & … … 59 60 o_sens_srf, o_lat_srf, o_flw_srf, & 60 61 o_fsw_srf, o_wbils_srf, o_wbilo_srf, & 62 o_wevap_srf, o_wrain_srf, o_wsnow_srf, & 61 63 o_tke_srf, o_tke_max_srf,o_dltpbltke_srf, o_wstar, & 62 64 o_l_mixmin,o_l_mix, & … … 122 124 o_zfull, o_zhalf, o_rneb, o_rnebjn, o_rnebcon, & 123 125 o_rnebls, o_rhum, o_ozone, o_ozone_light, & 124 o_d tphy, o_dqphy, o_dqphy2d, o_dqlphy, o_dqlphy2d, &126 o_duphy, o_dtphy, o_dqphy, o_dqphy2d, o_dqlphy, o_dqlphy2d, & 125 127 o_dqsphy, o_dqsphy2d, o_albe_srf, o_z0m_srf, o_z0h_srf, & 126 128 o_ages_srf, o_snow_srf, o_alb1, o_alb2, o_tke, & … … 162 164 o_dtr_lessi_impa, o_dtr_lessi_nucl, & 163 165 o_dtr_insc, o_dtr_bcscav, o_dtr_evapls, & 164 o_dtr_ls, o_dtr_trsp, o_dtr_sscav, &166 o_dtr_ls, o_dtr_trsp, o_dtr_sscav, o_dtr_dry, & 165 167 o_dtr_sat, o_dtr_uscav, o_trac_cum, o_du_gwd_rando, o_dv_gwd_rando, & 166 168 o_ustr_gwd_hines,o_vstr_gwd_hines,o_ustr_gwd_rando,o_vstr_gwd_rando, & … … 181 183 o_alt_tropo 182 184 183 184 USE phys_state_var_mod, only: pctsrf, paire_ter, rain_fall, snow_fall, & 185 #ifdef CPP_StratAer 186 USE phys_output_ctrlout_mod, ONLY: & 187 o_sulf_convert, o_sulf_nucl, o_sulf_cond_evap, o_ocs_convert, & 188 o_sfluxaer, o_R2SO4, o_OCS_lifetime, o_SO2_lifetime, & 189 o_OCS_backgr_tend, o_SO2_backgr_tend, o_sulf_dep_dry, o_sulf_dep_wet, & 190 o_surf_PM25_sulf, o_ext_strat_550, o_tau_strat_550, & 191 o_p_tropopause, o_vsed_aer, o_tau_strat_1020, o_ext_strat_1020, o_f_r_wet 192 #endif 193 194 USE phys_state_var_mod, ONLY: pctsrf, paire_ter, rain_fall, snow_fall, & 185 195 qsol, z0m, z0h, fevap, agesno, & 186 196 nday_rain, rain_con, snow_con, & … … 209 219 vphiSTD, wTSTD, u2STD, v2STD, T2STD, missing_val_nf90 210 220 211 USE phys_local_var_mod, only: zxfluxlat, slp, ptstar, pt0, zxtsol, zt2m, &221 USE phys_local_var_mod, ONLY: zxfluxlat, slp, ptstar, pt0, zxtsol, zt2m, & 212 222 t2m_min_mon, t2m_max_mon, evap, & 213 223 l_mixmin,l_mix, & … … 218 228 sissnow, runoff, albsol3_lic, evap_pot, & 219 229 t2m, fluxt, fluxlat, fsollw, fsolsw, & 220 wfbils, wfbilo, cdragm, cdragh, cldl, cldm, & 230 wfbils, wfbilo, wfevap, wfrain, wfsnow, & 231 cdragm, cdragh, cldl, cldm, & 221 232 cldh, cldt, JrNt, cldljn, cldmjn, cldhjn, & 222 233 cldtjn, cldq, flwp, fiwp, ue, ve, uq, vq, & … … 271 282 ep, epmax_diag ! epmax_cape 272 283 273 USE phys_output_var_mod, only: vars_defined, snow_o, zfra_o, bils_diss, & 284 #ifdef CPP_StratAer 285 USE phys_local_var_mod, ONLY: & 286 sulf_convert, sulf_nucl, sulf_cond_evap, ocs_convert, & 287 sfluxaer, R2SO4, OCS_lifetime, SO2_lifetime, & 288 OCS_backgr_tend, SO2_backgr_tend, sulf_dep_dry, sulf_dep_wet, & 289 surf_PM25_sulf, tau_strat_550, p_tropopause, tausum_strat, & 290 vsed_aer, tau_strat_1020, f_r_wet 291 #endif 292 293 USE phys_output_var_mod, ONLY: vars_defined, snow_o, zfra_o, bils_diss, & 274 294 bils_ec,bils_ech, bils_tke, bils_kinetic, bils_latent, bils_enthalp, & 275 295 itau_con, nfiles, clef_files, nid_files, & … … 290 310 alt_tropo 291 311 292 293 294 USE ocean_slab_mod, only: nslay, tslab, slab_bils, slab_bilg, tice, & 312 USE ocean_slab_mod, ONLY: nslay, tslab, slab_bils, slab_bilg, tice, & 295 313 seaice, slab_ekman,slab_hdiff, dt_ekman, dt_hdiff 296 USE pbl_surface_mod, only: snow297 USE indice_sol_mod, only: nbsrf298 USE infotrac_phy, only: nqtot, nqo, type_trac299 USE geometry_mod, only: cell_area300 USE surface_data, only: type_ocean, version_ocean, ok_veget, ok_snow301 ! USE aero_mod, only: naero_spc302 USE aero_mod, only: naero_tot, id_STRAT_phy303 USE ioipsl, only: histend, histsync304 USE iophy, only: set_itau_iophy, histwrite_phy305 USE netcdf, only: nf90_fill_real314 USE pbl_surface_mod, ONLY: snow 315 USE indice_sol_mod, ONLY: nbsrf 316 USE infotrac_phy, ONLY: nqtot, nqo, type_trac, tname, niadv 317 USE geometry_mod, ONLY: cell_area 318 USE surface_data, ONLY: type_ocean, version_ocean, ok_veget, ok_snow 319 ! USE aero_mod, ONLY: naero_spc 320 USE aero_mod, ONLY: naero_tot, id_STRAT_phy 321 USE ioipsl, ONLY: histend, histsync 322 USE iophy, ONLY: set_itau_iophy, histwrite_phy 323 USE netcdf, ONLY: nf90_fill_real 306 324 USE print_control_mod, ONLY: prt_level,lunout 307 325 … … 309 327 #ifdef CPP_XIOS 310 328 ! ug Pour les sorties XIOS 311 USE xios , ONLY: xios_update_calendar312 USE wxios, only: wxios_closedef, missing_val313 #endif 314 USE phys_cal_mod, only: mth_len329 USE xios 330 USE wxios, ONLY: wxios_closedef, missing_val 331 #endif 332 USE phys_cal_mod, ONLY : mth_len 315 333 316 334 #ifdef CPP_RRTM … … 319 337 320 338 IMPLICIT NONE 321 322 339 323 340 INCLUDE "clesphys.h" … … 336 353 REAL, DIMENSION(klon,nlevSTD) :: zx_tmp_fi3d_STD 337 354 REAL, DIMENSION(klon) :: pphis 338 REAL, DIMENSION(klon, klev) :: pplay, d_ t355 REAL, DIMENSION(klon, klev) :: pplay, d_u, d_t 339 356 REAL, DIMENSION(klon, klev+1) :: paprs 340 357 REAL, DIMENSION(klon,klev,nqtot) :: qx, d_qx … … 347 364 ! Local 348 365 INTEGER :: itau_w 349 INTEGER :: i, iinit, iinitend=1, iff, iq, nsrf, k, ll, naero366 INTEGER :: i, iinit, iinitend=1, iff, iq, iiq, nsrf, k, ll, naero 350 367 REAL, DIMENSION (klon) :: zx_tmp_fi2d 351 368 REAL, DIMENSION (klon,klev) :: zx_tmp_fi3d, zpt_conv … … 362 379 INTEGER ISW 363 380 CHARACTER*1 ch1 381 CHARACTER*20 varname 382 383 #ifdef CPP_XIOS 384 TYPE(xios_fieldgroup) :: group_handle 385 TYPE(xios_field) :: child 386 #endif 364 387 365 388 ! On calcul le nouveau tau: … … 368 391 CALL set_itau_iophy(itau_w) 369 392 370 IF (.NOT.vars_defined) THEN393 IF (.NOT.vars_defined) THEN 371 394 iinitend = 2 372 395 ELSE … … 374 397 ENDIF 375 398 399 #ifdef CPP_XIOS 400 #ifdef CPP_StratAer 401 IF (.NOT.vars_defined) THEN 402 !On ajoute les variables 3D traceurs par l interface fortran 403 CALL xios_get_handle("fields_strataer_trac_3D", group_handle) 404 ! On boucle sur les traceurs pour les ajouter au groupe puis fixer les attributs 405 DO iq=nqo+1, nqtot 406 iiq=niadv(iq) 407 varname=trim(tname(iiq)) 408 WRITE (lunout,*) 'XIOS var=', nqo, iq, varname 409 CALL xios_add_child(group_handle, child, varname) 410 CALL xios_set_attr(child, name=varname, unit="kg kg-1") 411 varname='d'//trim(tname(iiq))//'_vdf' 412 CALL xios_add_child(group_handle, child, varname) 413 CALL xios_set_attr(child, name=varname, unit="kg kg-1 s-1") 414 varname='d'//trim(tname(iiq))//'_the' 415 CALL xios_add_child(group_handle, child, varname) 416 CALL xios_set_attr(child, name=varname, unit="kg kg-1 s-1") 417 varname='d'//trim(tname(iiq))//'_con' 418 CALL xios_add_child(group_handle, child, varname) 419 CALL xios_set_attr(child, name=varname, unit="kg kg-1 s-1") 420 varname='d'//trim(tname(iiq))//'_lessi_impa' 421 CALL xios_add_child(group_handle, child, varname) 422 CALL xios_set_attr(child, name=varname, unit="kg kg-1 s-1") 423 varname='d'//trim(tname(iiq))//'_lessi_nucl' 424 CALL xios_add_child(group_handle, child, varname) 425 CALL xios_set_attr(child, name=varname, unit="kg kg-1 s-1") 426 varname='d'//trim(tname(iiq))//'_insc' 427 CALL xios_add_child(group_handle, child, varname) 428 CALL xios_set_attr(child, name=varname, unit="kg kg-1 s-1") 429 varname='d'//trim(tname(iiq))//'_bcscav' 430 CALL xios_add_child(group_handle, child, varname) 431 CALL xios_set_attr(child, name=varname, unit="kg kg-1 s-1") 432 varname='d'//trim(tname(iiq))//'_evapls' 433 CALL xios_add_child(group_handle, child, varname) 434 CALL xios_set_attr(child, name=varname, unit="kg kg-1 s-1") 435 varname='d'//trim(tname(iiq))//'_ls' 436 CALL xios_add_child(group_handle, child, varname) 437 CALL xios_set_attr(child, name=varname, unit="kg kg-1 s-1") 438 varname='d'//trim(tname(iiq))//'_trsp' 439 CALL xios_add_child(group_handle, child, varname) 440 CALL xios_set_attr(child, name=varname, unit="kg kg-1 s-1") 441 varname='d'//trim(tname(iiq))//'_sscav' 442 CALL xios_add_child(group_handle, child, varname) 443 CALL xios_set_attr(child, name=varname, unit="kg kg-1 s-1") 444 varname='d'//trim(tname(iiq))//'_sat' 445 CALL xios_add_child(group_handle, child, varname) 446 CALL xios_set_attr(child, name=varname, unit="kg kg-1 s-1") 447 varname='d'//trim(tname(iiq))//'_uscav' 448 CALL xios_add_child(group_handle, child, varname) 449 CALL xios_set_attr(child, name=varname, unit="kg kg-1 s-1") 450 ENDDO 451 !On ajoute les variables 2D traceurs par l interface fortran 452 CALL xios_get_handle("fields_strataer_trac_2D", group_handle) 453 ! On boucle sur les traceurs pour les ajouter au groupe puis fixer les attributs 454 DO iq=nqo+1, nqtot 455 iiq=niadv(iq) 456 varname='cum'//trim(tname(iiq)) 457 WRITE (lunout,*) 'XIOS var=', iq, varname 458 CALL xios_add_child(group_handle, child, varname) 459 CALL xios_set_attr(child, name=varname, unit="kg m-2") 460 varname='cumd'//trim(tname(iiq))//'_dry' 461 CALL xios_add_child(group_handle, child, varname) 462 CALL xios_set_attr(child, name=varname, unit="kg m-2 s-1") 463 ENDDO 464 ENDIF 465 #endif 466 #endif 467 376 468 ! ug la boucle qui suit ne sert qu'une fois, pour l'initialisation, sinon il n'y a toujours qu'un seul passage: 377 469 DO iinit=1, iinitend … … 379 471 !$OMP MASTER 380 472 IF (vars_defined) THEN 381 if(prt_level >= 10) then473 IF (prt_level >= 10) then 382 474 write(lunout,*)"phys_output_write: call xios_update_calendar, itau_w=",itau_w 383 endif475 ENDIF 384 476 ! CALL xios_update_calendar(itau_w) 385 477 CALL xios_update_calendar(itap) 386 END 478 ENDIF 387 479 !$OMP END MASTER 388 480 !$OMP BARRIER … … 393 485 394 486 zx_tmp_fi2d = cell_area 395 if(is_north_pole_phy) then487 IF (is_north_pole_phy) then 396 488 zx_tmp_fi2d(1) = cell_area(1)/nbp_lon 397 endif398 if(is_south_pole_phy) then489 ENDIF 490 IF (is_south_pole_phy) then 399 491 zx_tmp_fi2d(klon) = cell_area(klon)/nbp_lon 400 endif492 ENDIf 401 493 CALL histwrite_phy(o_aire, zx_tmp_fi2d) 402 494 … … 679 771 680 772 DO nsrf = 1, nbsrf 773 681 774 IF (vars_defined) zx_tmp_fi2d(1 : klon) = pctsrf( 1 : klon, nsrf)*100. 682 775 CALL histwrite_phy(o_pourc_srf(nsrf), zx_tmp_fi2d) … … 713 806 IF (vars_defined) zx_tmp_fi2d(1 : klon) = wfbilo( 1 : klon, nsrf) 714 807 CALL histwrite_phy(o_wbilo_srf(nsrf), zx_tmp_fi2d) 808 IF (vars_defined) zx_tmp_fi2d(1 : klon) = wfevap( 1 : klon, nsrf) 809 CALL histwrite_phy(o_wevap_srf(nsrf), zx_tmp_fi2d) 810 IF (vars_defined) zx_tmp_fi2d(1 : klon) = wfrain( 1 : klon, nsrf) 811 CALL histwrite_phy(o_wrain_srf(nsrf), zx_tmp_fi2d) 812 IF (vars_defined) zx_tmp_fi2d(1 : klon) = wfsnow( 1 : klon, nsrf) 813 CALL histwrite_phy(o_wsnow_srf(nsrf), zx_tmp_fi2d) 715 814 716 815 IF (iflag_pbl > 1) THEN … … 770 869 CALL histwrite_phy(o_uq, uq) 771 870 CALL histwrite_phy(o_vq, vq) 772 IF (iflag_con.GE.3) THEN ! sb871 IF (iflag_con.GE.3) THEN ! sb 773 872 CALL histwrite_phy(o_cape, cape) 774 873 CALL histwrite_phy(o_pbase, ema_pcb) 775 874 CALL histwrite_phy(o_ptop, ema_pct) 776 875 CALL histwrite_phy(o_fbase, ema_cbmf) 777 if (iflag_con /= 30) then876 IF (iflag_con /= 30) THEN 778 877 CALL histwrite_phy(o_plcl, plcl) 779 878 CALL histwrite_phy(o_plfc, plfc) 780 879 CALL histwrite_phy(o_wbeff, wbeff) 781 end if880 ENDIF 782 881 783 882 CALL histwrite_phy(o_cape_max, cape) … … 790 889 CALL histwrite_phy(o_ftime_con, zx_tmp_fi2d) 791 890 IF (vars_defined) THEN 792 IF (iflag_thermals>=1)THEN891 IF (iflag_thermals>=1)THEN 793 892 zx_tmp_fi3d=dnwd+dnwd0+upwd+fm_therm(:,1:klev) 794 893 ELSE … … 841 940 DO k=1, nlevSTD 842 941 bb2=clevSTD(k) 843 IF (bb2.EQ."850".OR.bb2.EQ."700".OR. &942 IF (bb2.EQ."850".OR.bb2.EQ."700".OR. & 844 943 bb2.EQ."500".OR.bb2.EQ."200".OR. & 845 944 bb2.EQ."100".OR. & … … 862 961 #endif 863 962 #ifdef CPP_XIOS 864 IF (ok_all_xml) THEN963 IF (ok_all_xml) THEN 865 964 !XIOS CALL xios_get_field_attr("u850",default_value=missing_val) 866 965 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! … … 868 967 DO k=1, nlevSTD 869 968 bb2=clevSTD(k) 870 IF (bb2.EQ."850".OR.bb2.EQ."700".OR. &969 IF (bb2.EQ."850".OR.bb2.EQ."700".OR. & 871 970 bb2.EQ."500".OR.bb2.EQ."200".OR. & 872 971 bb2.EQ."100".OR. & … … 985 1084 ELSE 986 1085 CALL histwrite_phy(o_tslab, tslab(:,1:nslay)) 987 END 1086 ENDIF 988 1087 IF (version_ocean=='sicINT') THEN 989 1088 CALL histwrite_phy(o_slab_bilg, slab_bilg) 990 1089 CALL histwrite_phy(o_slab_tice, tice) 991 1090 CALL histwrite_phy(o_slab_sic, seaice) 992 END 1091 ENDIF 993 1092 IF (slab_hdiff) THEN 994 1093 IF (nslay.EQ.1) THEN … … 997 1096 ELSE 998 1097 CALL histwrite_phy(o_slab_hdiff, dt_hdiff(:,1:nslay)) 999 END 1000 END 1098 ENDIF 1099 ENDIF 1001 1100 IF (slab_ekman.GT.0) THEN 1002 1101 IF (nslay.EQ.1) THEN … … 1005 1104 ELSE 1006 1105 CALL histwrite_phy(o_slab_ekman, dt_ekman(:,1:nslay)) 1007 END 1008 END 1106 ENDIF 1107 ENDIF 1009 1108 ENDIF !type_ocean == force/slab 1010 1109 CALL histwrite_phy(o_weakinv, weak_inversion) … … 1085 1184 ENDIF 1086 1185 IF (flag_aerosol.GT.0.OR.flag_aerosol_strat.GT.0) THEN 1087 ! DO naero = 1, naero_spc1088 !--correction mini bug OB1089 1186 DO naero = 1, naero_tot 1090 CALL histwrite_phy(o_tausumaero(naero), & 1091 tausum_aero(:,2,naero) ) 1187 CALL histwrite_phy(o_tausumaero(naero),tausum_aero(:,2,naero)) 1092 1188 END DO 1093 1189 ENDIF 1094 1190 IF (flag_aerosol_strat.GT.0) THEN 1095 CALL histwrite_phy(o_tausumaero_lw, & 1096 tausum_aero(:,6,id_STRAT_phy) ) 1097 ENDIF 1098 ENDIF 1191 CALL histwrite_phy(o_tausumaero_lw,tausum_aero(:,6,id_STRAT_phy)) 1192 ENDIF 1193 ENDIF 1194 #ifdef CPP_StratAer 1195 IF (type_trac=='coag') THEN 1196 CALL histwrite_phy(o_sulf_convert, sulf_convert) 1197 CALL histwrite_phy(o_sulf_nucl, sulf_nucl) 1198 CALL histwrite_phy(o_sulf_cond_evap, sulf_cond_evap) 1199 CALL histwrite_phy(o_ocs_convert, ocs_convert) 1200 CALL histwrite_phy(o_R2SO4, R2SO4) 1201 CALL histwrite_phy(o_OCS_lifetime, OCS_lifetime) 1202 CALL histwrite_phy(o_SO2_lifetime, SO2_lifetime) 1203 CALL histwrite_phy(o_OCS_backgr_tend, OCS_backgr_tend) 1204 CALL histwrite_phy(o_SO2_backgr_tend, SO2_backgr_tend) 1205 CALL histwrite_phy(o_sulf_dep_dry, sulf_dep_dry) 1206 CALL histwrite_phy(o_sulf_dep_wet, sulf_dep_wet) 1207 CALL histwrite_phy(o_surf_PM25_sulf, surf_PM25_sulf) 1208 CALL histwrite_phy(o_p_tropopause, p_tropopause) 1209 CALL histwrite_phy(o_sfluxaer, sfluxaer) 1210 CALL histwrite_phy(o_vsed_aer, vsed_aer) 1211 CALL histwrite_phy(o_f_r_wet, f_r_wet) 1212 CALL histwrite_phy(o_ext_strat_550, tau_strat_550) 1213 CALL histwrite_phy(o_ext_strat_1020, tau_strat_1020) 1214 CALL histwrite_phy(o_tau_strat_550, tausum_strat(:,1)) 1215 CALL histwrite_phy(o_tau_strat_1020, tausum_strat(:,2)) 1216 ENDIF 1217 #endif 1099 1218 IF (ok_ade) THEN 1100 1219 CALL histwrite_phy(o_topswad, topswad_aero*swradcorr) … … 1107 1226 CALL histwrite_phy(o_sollwad0, sollwad0_aero) 1108 1227 !====MS forcing diagnostics 1109 if (new_aod) then1228 IF (new_aod) THEN 1110 1229 zx_tmp_fi2d(:)=topsw_aero(:,1)*swradcorr(:) 1111 1230 CALL histwrite_phy(o_swtoaas_nat,zx_tmp_fi2d) … … 1126 1245 CALL histwrite_phy(o_swsrfcs_ant,zx_tmp_fi2d) 1127 1246 !cf 1128 if (.not. aerosol_couple) then1247 IF (.not. aerosol_couple) THEN 1129 1248 zx_tmp_fi2d(:)=topswcf_aero(:,1)*swradcorr(:) 1130 1249 CALL histwrite_phy(o_swtoacf_nat,zx_tmp_fi2d) … … 1139 1258 zx_tmp_fi2d(:)=solswcf_aero(:,3)*swradcorr(:) 1140 1259 CALL histwrite_phy(o_swsrfcf_zero,zx_tmp_fi2d) 1141 endif1142 endif! new_aod1260 ENDIF 1261 ENDIF ! new_aod 1143 1262 !====MS forcing diagnostics 1144 1263 ENDIF … … 1214 1333 ENDIF 1215 1334 1335 CALL histwrite_phy(o_duphy, d_u) 1336 1216 1337 CALL histwrite_phy(o_dtphy, d_t) 1217 1338 … … 1250 1371 CALL histwrite_phy(o_alb2, albsol2) 1251 1372 !FH Sorties pour la couche limite 1252 if (iflag_pbl>1) then1373 IF (iflag_pbl>1) THEN 1253 1374 zx_tmp_fi3d=0. 1254 1375 IF (vars_defined) THEN 1255 donsrf=1,nbsrf1256 dok=1,klev1376 DO nsrf=1,nbsrf 1377 DO k=1,klev 1257 1378 zx_tmp_fi3d(:,k)=zx_tmp_fi3d(:,k) & 1258 1379 +pctsrf(:,nsrf)*pbl_tke(:,k,nsrf) 1259 enddo1260 enddo1380 ENDDO 1381 ENDDO 1261 1382 ENDIF 1262 1383 CALL histwrite_phy(o_tke, zx_tmp_fi3d) … … 1314 1435 CALL histwrite_phy(o_dqcon2d, zx_tmp_fi2d) 1315 1436 1316 IF (iflag_thermals.EQ.0) THEN1437 IF (iflag_thermals.EQ.0) THEN 1317 1438 IF (vars_defined) zx_tmp_fi3d(1:klon,1:klev)=d_q_con(1:klon,1:klev)/pdtphys 1318 1439 CALL histwrite_phy(o_tnhusc, zx_tmp_fi3d) 1319 ELSE IF (iflag_thermals.GE.1.AND.iflag_wake.EQ.1) THEN1440 ELSE IF (iflag_thermals.GE.1.AND.iflag_wake.EQ.1) THEN 1320 1441 IF (vars_defined) THEN 1321 1442 zx_tmp_fi3d(1:klon,1:klev)=d_q_con(1:klon,1:klev)/pdtphys + & … … 1339 1460 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 1340 1461 ! Sorties specifiques a la separation thermiques/non thermiques 1341 if (iflag_thermals>=1) then1342 IF (vars_defined) zx_tmp_fi3d(1:klon,1:klev)=d_t_lscth(1:klon,1:klev)/pdtphys1462 IF (iflag_thermals>=1) THEN 1463 IF (vars_defined) zx_tmp_fi3d(1:klon,1:klev)=d_t_lscth(1:klon,1:klev)/pdtphys 1343 1464 CALL histwrite_phy(o_dtlscth, zx_tmp_fi3d) 1344 IF (vars_defined) zx_tmp_fi3d(1:klon,1:klev)=d_t_lscst(1:klon,1:klev)/pdtphys1465 IF (vars_defined) zx_tmp_fi3d(1:klon,1:klev)=d_t_lscst(1:klon,1:klev)/pdtphys 1345 1466 CALL histwrite_phy(o_dtlscst, zx_tmp_fi3d) 1346 IF (vars_defined) zx_tmp_fi3d(1:klon,1:klev)=d_q_lscth(1:klon,1:klev)/pdtphys1467 IF (vars_defined) zx_tmp_fi3d(1:klon,1:klev)=d_q_lscth(1:klon,1:klev)/pdtphys 1347 1468 CALL histwrite_phy(o_dqlscth, zx_tmp_fi3d) 1348 1469 CALL water_int(klon,klev,zx_tmp_fi3d,zmasse,zx_tmp_fi2d) 1349 1470 CALL histwrite_phy(o_dqlscth2d, zx_tmp_fi2d) 1350 IF (vars_defined) zx_tmp_fi3d(1:klon,1:klev)=d_q_lscst(1:klon,1:klev)/pdtphys1471 IF (vars_defined) zx_tmp_fi3d(1:klon,1:klev)=d_q_lscst(1:klon,1:klev)/pdtphys 1351 1472 CALL histwrite_phy(o_dqlscst, zx_tmp_fi3d) 1352 1473 CALL water_int(klon,klev,zx_tmp_fi3d,zmasse,zx_tmp_fi2d) … … 1355 1476 CALL histwrite_phy(o_plulst, plul_st) 1356 1477 IF (vars_defined) THEN 1357 dok=1,klev1358 doi=1,klon1359 if (ptconvth(i,k)) then1478 DO k=1,klev 1479 DO i=1,klon 1480 IF (ptconvth(i,k)) THEN 1360 1481 zx_tmp_fi3d(i,k)=1. 1361 else1482 ELSE 1362 1483 zx_tmp_fi3d(i,k)=0. 1363 endif1364 enddo1365 enddo1484 ENDIF 1485 ENDDO 1486 ENDDO 1366 1487 ENDIF 1367 1488 CALL histwrite_phy(o_ptconvth, zx_tmp_fi3d) … … 1372 1493 ENDIF 1373 1494 CALL histwrite_phy(o_lmaxth, zx_tmp_fi2d) 1374 endif! iflag_thermals>=11495 ENDIF ! iflag_thermals>=1 1375 1496 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 1376 1497 IF (vars_defined) zx_tmp_fi3d(1:klon,1:klev)=d_t_vdf(1:klon,1:klev)/pdtphys 1377 1498 CALL histwrite_phy(o_dtvdf, zx_tmp_fi3d) 1378 IF (vars_defined) zx_tmp_fi3d(1:klon,1:klev)=d_t_diss(1:klon,1:klev)/pdtphys1499 IF (vars_defined) zx_tmp_fi3d(1:klon,1:klev)=d_t_diss(1:klon,1:klev)/pdtphys 1379 1500 CALL histwrite_phy(o_dtdis, zx_tmp_fi3d) 1380 1501 IF (vars_defined) zx_tmp_fi3d(1:klon,1:klev)=d_q_vdf(1:klon,1:klev)/pdtphys … … 1426 1547 CALL histwrite_phy(o_dqthe2d, zx_tmp_fi2d) 1427 1548 ENDIF !iflag_thermals 1428 IF (vars_defined) zx_tmp_fi3d(1:klon,1:klev)=d_t_ajsb(1:klon,1:klev)/pdtphys1549 IF (vars_defined) zx_tmp_fi3d(1:klon,1:klev)=d_t_ajsb(1:klon,1:klev)/pdtphys 1429 1550 CALL histwrite_phy(o_dtajs, zx_tmp_fi3d) 1430 IF (vars_defined) zx_tmp_fi3d(1:klon,1:klev)=d_q_ajsb(1:klon,1:klev)/pdtphys1551 IF (vars_defined) zx_tmp_fi3d(1:klon,1:klev)=d_q_ajsb(1:klon,1:klev)/pdtphys 1431 1552 CALL histwrite_phy(o_dqajs, zx_tmp_fi3d) 1432 1553 CALL water_int(klon,klev,zx_tmp_fi3d,zmasse,zx_tmp_fi2d) 1433 1554 CALL histwrite_phy(o_dqajs2d, zx_tmp_fi2d) 1434 IF (vars_defined) zx_tmp_fi3d(1:klon,1:klev)=d_t_swr(1:klon,1:klev)/pdtphys1555 IF (vars_defined) zx_tmp_fi3d(1:klon,1:klev)=d_t_swr(1:klon,1:klev)/pdtphys 1435 1556 CALL histwrite_phy(o_dtswr, zx_tmp_fi3d) 1436 IF (vars_defined) zx_tmp_fi3d(1:klon,1:klev)=d_t_sw0(1:klon,1:klev)/pdtphys1557 IF (vars_defined) zx_tmp_fi3d(1:klon,1:klev)=d_t_sw0(1:klon,1:klev)/pdtphys 1437 1558 CALL histwrite_phy(o_dtsw0, zx_tmp_fi3d) 1438 IF (vars_defined) zx_tmp_fi3d(1:klon,1:klev)=d_t_lwr(1:klon,1:klev)/pdtphys1559 IF (vars_defined) zx_tmp_fi3d(1:klon,1:klev)=d_t_lwr(1:klon,1:klev)/pdtphys 1439 1560 CALL histwrite_phy(o_dtlwr, zx_tmp_fi3d) 1440 IF (vars_defined) zx_tmp_fi3d(1:klon,1:klev)=d_t_lw0(1:klon,1:klev)/pdtphys1561 IF (vars_defined) zx_tmp_fi3d(1:klon,1:klev)=d_t_lw0(1:klon,1:klev)/pdtphys 1441 1562 CALL histwrite_phy(o_dtlw0, zx_tmp_fi3d) 1442 IF (vars_defined) zx_tmp_fi3d(1:klon,1:klev)=d_t_ec(1:klon,1:klev)/pdtphys1563 IF (vars_defined) zx_tmp_fi3d(1:klon,1:klev)=d_t_ec(1:klon,1:klev)/pdtphys 1443 1564 CALL histwrite_phy(o_dtec, zx_tmp_fi3d) 1444 IF (vars_defined) zx_tmp_fi3d(1:klon,1:klev)=d_u_vdf(1:klon,1:klev)/pdtphys1565 IF (vars_defined) zx_tmp_fi3d(1:klon,1:klev)=d_u_vdf(1:klon,1:klev)/pdtphys 1445 1566 CALL histwrite_phy(o_duvdf, zx_tmp_fi3d) 1446 IF (vars_defined) zx_tmp_fi3d(1:klon,1:klev)=d_v_vdf(1:klon,1:klev)/pdtphys1567 IF (vars_defined) zx_tmp_fi3d(1:klon,1:klev)=d_v_vdf(1:klon,1:klev)/pdtphys 1447 1568 CALL histwrite_phy(o_dvvdf, zx_tmp_fi3d) 1448 1569 IF (ok_orodr) THEN 1449 IF (vars_defined) zx_tmp_fi3d(1:klon,1:klev)=d_u_oro(1:klon,1:klev)/pdtphys1570 IF (vars_defined) zx_tmp_fi3d(1:klon,1:klev)=d_u_oro(1:klon,1:klev)/pdtphys 1450 1571 CALL histwrite_phy(o_duoro, zx_tmp_fi3d) 1451 IF (vars_defined) zx_tmp_fi3d(1:klon,1:klev)=d_v_oro(1:klon,1:klev)/pdtphys1572 IF (vars_defined) zx_tmp_fi3d(1:klon,1:klev)=d_v_oro(1:klon,1:klev)/pdtphys 1452 1573 CALL histwrite_phy(o_dvoro, zx_tmp_fi3d) 1453 IF (vars_defined) zx_tmp_fi3d(1:klon,1:klev)=d_t_oro(1:klon,1:klev)/pdtphys1574 IF (vars_defined) zx_tmp_fi3d(1:klon,1:klev)=d_t_oro(1:klon,1:klev)/pdtphys 1454 1575 CALL histwrite_phy(o_dtoro, zx_tmp_fi3d) 1455 1576 ENDIF 1456 1577 IF (ok_orolf) THEN 1457 IF (vars_defined) zx_tmp_fi3d(1:klon,1:klev)=d_u_lif(1:klon,1:klev)/pdtphys1578 IF (vars_defined) zx_tmp_fi3d(1:klon,1:klev)=d_u_lif(1:klon,1:klev)/pdtphys 1458 1579 CALL histwrite_phy(o_dulif, zx_tmp_fi3d) 1459 1580 1460 IF (vars_defined) zx_tmp_fi3d(1:klon,1:klev)=d_v_lif(1:klon,1:klev)/pdtphys1581 IF (vars_defined) zx_tmp_fi3d(1:klon,1:klev)=d_v_lif(1:klon,1:klev)/pdtphys 1461 1582 CALL histwrite_phy(o_dvlif, zx_tmp_fi3d) 1462 1583 1463 IF (vars_defined) zx_tmp_fi3d(1:klon,1:klev)=d_t_lif(1:klon,1:klev)/pdtphys1584 IF (vars_defined) zx_tmp_fi3d(1:klon,1:klev)=d_t_lif(1:klon,1:klev)/pdtphys 1464 1585 CALL histwrite_phy(o_dtlif, zx_tmp_fi3d) 1465 1586 ENDIF … … 1468 1589 CALL histwrite_phy(o_du_gwd_hines, du_gwd_hines/pdtphys) 1469 1590 CALL histwrite_phy(o_dv_gwd_hines, dv_gwd_hines/pdtphys) 1470 IF (vars_defined) zx_tmp_fi3d(1:klon,1:klev)=d_t_hin(1:klon,1:klev)/pdtphys1591 IF (vars_defined) zx_tmp_fi3d(1:klon,1:klev)=d_t_hin(1:klon,1:klev)/pdtphys 1471 1592 CALL histwrite_phy(o_dthin, zx_tmp_fi3d) 1472 1593 CALL histwrite_phy(o_ustr_gwd_hines, zustr_gwd_hines) 1473 1594 CALL histwrite_phy(o_vstr_gwd_hines, zvstr_gwd_hines) 1474 endIF1475 1476 if (.not. ok_hines .and. ok_gwd_rando) then1595 ENDIF 1596 1597 IF (.not. ok_hines .and. ok_gwd_rando) THEN 1477 1598 CALL histwrite_phy(o_du_gwd_front, du_gwd_front / pdtphys) 1478 1599 CALL histwrite_phy(o_dv_gwd_front, dv_gwd_front / pdtphys) … … 1481 1602 ENDIF 1482 1603 1483 IF (ok_gwd_rando) then1604 IF (ok_gwd_rando) THEN 1484 1605 CALL histwrite_phy(o_du_gwd_rando, du_gwd_rando / pdtphys) 1485 1606 CALL histwrite_phy(o_dv_gwd_rando, dv_gwd_rando / pdtphys) … … 1488 1609 CALL histwrite_phy(o_east_gwstress, east_gwstress ) 1489 1610 CALL histwrite_phy(o_west_gwstress, west_gwstress ) 1490 endIF1491 1492 IF (ok_qch4) then1611 ENDIF 1612 1613 IF (ok_qch4) THEN 1493 1614 CALL histwrite_phy(o_dqch4, d_q_ch4 / pdtphys) 1494 1615 ENDIF … … 1516 1637 CALL histwrite_phy(o_rldcs, lwdn0) 1517 1638 1518 IF (vars_defined) THEN1639 IF (vars_defined) THEN 1519 1640 zx_tmp_fi3d(1:klon,1:klev)=d_t(1:klon,1:klev)+ & 1520 1641 d_t_dyn(1:klon,1:klev) … … 1522 1643 CALL histwrite_phy(o_tnt, zx_tmp_fi3d) 1523 1644 1524 IF (vars_defined) THEN1645 IF (vars_defined) THEN 1525 1646 zx_tmp_fi3d(1:klon,1:klev)=d_t_swr(1:klon,1:klev)/pdtphys + & 1526 1647 d_t_lwr(1:klon,1:klev)/pdtphys 1527 1648 ENDIF 1528 1649 CALL histwrite_phy(o_tntr, zx_tmp_fi3d) 1529 IF (vars_defined) THEN1650 IF (vars_defined) THEN 1530 1651 zx_tmp_fi3d(1:klon,1:klev)= (d_t_lsc(1:klon,1:klev)+ & 1531 1652 d_t_eva(1:klon,1:klev)+ & … … 1533 1654 ENDIF 1534 1655 CALL histwrite_phy(o_tntscpbl, zx_tmp_fi3d) 1535 IF (vars_defined) THEN1656 IF (vars_defined) THEN 1536 1657 zx_tmp_fi3d(1:klon,1:klev)=d_qx(1:klon,1:klev,ivap)+ & 1537 1658 d_q_dyn(1:klon,1:klev) 1538 1659 ENDIF 1539 1660 CALL histwrite_phy(o_tnhus, zx_tmp_fi3d) 1540 IF (vars_defined) THEN1661 IF (vars_defined) THEN 1541 1662 zx_tmp_fi3d(1:klon,1:klev)=d_q_lsc(1:klon,1:klev)/pdtphys+ & 1542 1663 d_q_eva(1:klon,1:klev)/pdtphys … … 1544 1665 CALL histwrite_phy(o_tnhusscpbl, zx_tmp_fi3d) 1545 1666 CALL histwrite_phy(o_evu, coefm(:,:,is_ave)) 1546 IF (vars_defined) THEN1667 IF (vars_defined) THEN 1547 1668 zx_tmp_fi3d(1:klon,1:klev)=q_seri(1:klon,1:klev)+ & 1548 1669 ql_seri(1:klon,1:klev) 1549 1670 ENDIF 1550 1671 CALL histwrite_phy(o_h2o, zx_tmp_fi3d) 1551 if (iflag_con >= 3) then1552 IF (vars_defined) THEN1672 IF (iflag_con >= 3) THEN 1673 IF (vars_defined) THEN 1553 1674 zx_tmp_fi3d(1:klon,1:klev)=-1 * (dnwd(1:klon,1:klev)+ & 1554 1675 dnwd0(1:klon,1:klev)) 1555 1676 ENDIF 1556 1677 CALL histwrite_phy(o_mcd, zx_tmp_fi3d) 1557 IF (vars_defined) THEN1678 IF (vars_defined) THEN 1558 1679 zx_tmp_fi3d(1:klon,1:klev)=upwd(1:klon,1:klev) + & 1559 1680 dnwd(1:klon,1:klev)+ dnwd0(1:klon,1:klev) 1560 1681 ENDIF 1561 1682 CALL histwrite_phy(o_dmc, zx_tmp_fi3d) 1562 else if (iflag_con == 2) then1683 ELSE IF (iflag_con == 2) THEN 1563 1684 CALL histwrite_phy(o_mcd, pmfd) 1564 1685 CALL histwrite_phy(o_dmc, pmfu + pmfd) 1565 end if1686 ENDIF 1566 1687 CALL histwrite_phy(o_ref_liq, ref_liq) 1567 1688 CALL histwrite_phy(o_ref_ice, ref_ice) 1568 if(RCO2_per.NE.RCO2_act.OR.RCH4_per.NE.RCH4_act.OR. &1689 IF (RCO2_per.NE.RCO2_act.OR.RCH4_per.NE.RCH4_act.OR. & 1569 1690 RN2O_per.NE.RN2O_act.OR.RCFC11_per.NE.RCFC11_act.OR. & 1570 1691 RCFC12_per.NE.RCFC12_act) THEN 1571 IF (vars_defined) zx_tmp_fi2d(:) = swupp(:,klevp1)*swradcorr(:)1692 IF (vars_defined) zx_tmp_fi2d(:) = swupp(:,klevp1)*swradcorr(:) 1572 1693 CALL histwrite_phy(o_rsut4co2, zx_tmp_fi2d) 1573 IF (vars_defined) zx_tmp_fi2d(:) = lwupp(:,klevp1)1694 IF (vars_defined) zx_tmp_fi2d(:) = lwupp(:,klevp1) 1574 1695 CALL histwrite_phy(o_rlut4co2, zx_tmp_fi2d) 1575 IF (vars_defined) zx_tmp_fi2d(:) = swup0p(:,klevp1)*swradcorr(:)1696 IF (vars_defined) zx_tmp_fi2d(:) = swup0p(:,klevp1)*swradcorr(:) 1576 1697 CALL histwrite_phy(o_rsutcs4co2, zx_tmp_fi2d) 1577 IF (vars_defined) zx_tmp_fi2d(:) = lwup0p(:,klevp1)1698 IF (vars_defined) zx_tmp_fi2d(:) = lwup0p(:,klevp1) 1578 1699 CALL histwrite_phy(o_rlutcs4co2, zx_tmp_fi2d) 1579 1700 DO k=1, klevp1 … … 1615 1736 CALL histwrite_phy(o_va,vwriteSTD(:,:,iff-6),iff) 1616 1737 CALL histwrite_phy(o_wap,wwriteSTD(:,:,iff-6),iff) 1617 IF (vars_defined) THEN1738 IF (vars_defined) THEN 1618 1739 DO k=1, nlevSTD 1619 1740 DO i=1, klon 1620 IF (tnondef(i,k,iff-6).NE.missing_val) THEN1621 IF (freq_outNMC(iff-6).LT.0) THEN1741 IF (tnondef(i,k,iff-6).NE.missing_val) THEN 1742 IF (freq_outNMC(iff-6).LT.0) THEN 1622 1743 freq_moyNMC(iff-6)=(mth_len*un_jour)/freq_calNMC(iff-6) 1623 1744 ELSE … … 1632 1753 ENDIF 1633 1754 CALL histwrite_phy(o_psbg,zx_tmp_fi3d_STD,iff) 1634 IF (vars_defined) THEN1755 IF (vars_defined) THEN 1635 1756 DO k=1, nlevSTD 1636 1757 DO i=1, klon 1637 IF (O3sumSTD(i,k,iff-6).NE.missing_val) THEN1758 IF (O3sumSTD(i,k,iff-6).NE.missing_val) THEN 1638 1759 zx_tmp_fi3d_STD(i,k) = O3sumSTD(i,k,iff-6) * 1.e+9 1639 1760 ELSE … … 1644 1765 ENDIF 1645 1766 CALL histwrite_phy(o_tro3,zx_tmp_fi3d_STD,iff) 1646 if(read_climoz == 2) THEN1647 IF (vars_defined) THEN1767 IF (read_climoz == 2) THEN 1768 IF (vars_defined) THEN 1648 1769 DO k=1, nlevSTD 1649 1770 DO i=1, klon 1650 IF (O3daysumSTD(i,k,iff-6).NE.missing_val) THEN1771 IF (O3daysumSTD(i,k,iff-6).NE.missing_val) THEN 1651 1772 zx_tmp_fi3d_STD(i,k) = O3daysumSTD(i,k,iff-6) * 1.e+9 1652 1773 ELSE … … 1672 1793 #endif 1673 1794 #ifdef CPP_XIOS 1674 IF (ok_all_xml) THEN1795 IF (ok_all_xml) THEN 1675 1796 ! DO iff=7, nfiles 1676 1797 … … 1683 1804 CALL histwrite_phy(o_va,vlevSTD(:,:)) 1684 1805 CALL histwrite_phy(o_wap,wlevSTD(:,:)) 1685 ! IF (vars_defined) THEN1806 ! IF (vars_defined) THEN 1686 1807 ! DO k=1, nlevSTD 1687 1808 ! DO i=1, klon 1688 ! IF (tnondef(i,k,3).NE.missing_val) THEN1689 ! IF (freq_outNMC(iff-6).LT.0) THEN1809 ! IF (tnondef(i,k,3).NE.missing_val) THEN 1810 ! IF (freq_outNMC(iff-6).LT.0) THEN 1690 1811 ! freq_moyNMC(iff-6)=(mth_len*un_jour)/freq_calNMC(iff-6) 1691 1812 ! ELSE … … 1700 1821 ! ENDIF 1701 1822 ! CALL histwrite_phy(o_psbg,zx_tmp_fi3d_STD) 1702 IF (vars_defined) THEN1823 IF (vars_defined) THEN 1703 1824 DO k=1, nlevSTD 1704 1825 DO i=1, klon 1705 IF (O3STD(i,k).NE.missing_val) THEN1826 IF (O3STD(i,k).NE.missing_val) THEN 1706 1827 zx_tmp_fi3d_STD(i,k) = O3STD(i,k) * 1.e+9 1707 1828 ELSE … … 1712 1833 ENDIF 1713 1834 CALL histwrite_phy(o_tro3,zx_tmp_fi3d_STD) 1714 if(read_climoz == 2) THEN1715 IF (vars_defined) THEN1835 IF (read_climoz == 2) THEN 1836 IF (vars_defined) THEN 1716 1837 DO k=1, nlevSTD 1717 1838 DO i=1, klon 1718 IF (O3daySTD(i,k).NE.missing_val) THEN1839 IF (O3daySTD(i,k).NE.missing_val) THEN 1719 1840 zx_tmp_fi3d_STD(i,k) = O3daySTD(i,k) * 1.e+9 1720 1841 ELSE … … 1725 1846 ENDIF 1726 1847 CALL histwrite_phy(o_tro3_daylight,zx_tmp_fi3d_STD) 1727 endif1848 ENDIF 1728 1849 CALL histwrite_phy(o_uxv,uvSTD(:,:)) 1729 1850 CALL histwrite_phy(o_vxq,vqSTD(:,:)) … … 1739 1860 #endif 1740 1861 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 1741 IF (nqtot.GE.nqo+1) THEN 1742 DO iq=nqo+1,nqtot 1743 IF (type_trac == 'lmdz' .OR. type_trac == 'repr') THEN 1744 1745 !jyg< 1746 !! CALL histwrite_phy(o_trac(iq-nqo), qx(:,:,iq)) 1862 IF (nqtot.GE.nqo+1) THEN 1863 DO iq=nqo+1, nqtot 1864 IF (type_trac == 'lmdz' .OR. type_trac == 'repr' .OR. type_trac == 'coag') THEN 1865 !--3D fields 1747 1866 CALL histwrite_phy(o_trac(iq-nqo), tr_seri(:,:,iq-nqo)) 1748 !>jyg1749 1867 CALL histwrite_phy(o_dtr_vdf(iq-nqo),d_tr_cl(:,:,iq-nqo)) 1750 1868 CALL histwrite_phy(o_dtr_the(iq-nqo),d_tr_th(:,:,iq-nqo)) … … 1760 1878 CALL histwrite_phy(o_dtr_sat(iq-nqo),d_tr_sat(:,:,iq-nqo)) 1761 1879 CALL histwrite_phy(o_dtr_uscav(iq-nqo),d_tr_uscav(:,:,iq-nqo)) 1880 !--2D fields 1881 CALL histwrite_phy(o_dtr_dry(iq-nqo), flux_tr_dry(:,iq-nqo)) 1762 1882 zx_tmp_fi2d=0. 1763 IF (vars_defined) THEN1883 IF (vars_defined) THEN 1764 1884 DO k=1,klev 1765 !jyg<1766 !! zx_tmp_fi2d(:)=zx_tmp_fi2d(:)+zmasse(:,k)*qx(:,k,iq)1767 1885 zx_tmp_fi2d(:)=zx_tmp_fi2d(:)+zmasse(:,k)*tr_seri(:,k,iq-nqo) 1768 !>jyg1769 1886 ENDDO 1770 1887 ENDIF 1771 1888 CALL histwrite_phy(o_trac_cum(iq-nqo), zx_tmp_fi2d) 1772 endif1773 ENDDO 1774 ENDIF 1775 1776 IF (.NOT.vars_defined) THEN1889 ENDIF 1890 ENDDO 1891 ENDIF 1892 1893 IF (.NOT.vars_defined) THEN 1777 1894 !$OMP MASTER 1778 1895 #ifndef CPP_IOIPSL_NO_OUTPUT … … 1782 1899 ndex2d = 0 1783 1900 ndex3d = 0 1784 1785 1901 ENDIF ! clef_files 1786 1902 ENDDO ! iff … … 1790 1906 CALL wxios_closedef() 1791 1907 #endif 1792 1793 1908 !$OMP END MASTER 1794 1909 !$OMP BARRIER 1795 1910 vars_defined = .TRUE. 1796 1911 1797 END IF1798 1799 END 1800 1801 IF (vars_defined) THEN1912 ENDIF !--.NOT.vars_defined 1913 1914 ENDDO 1915 1916 IF (vars_defined) THEN 1802 1917 ! On synchronise les fichiers pour IOIPSL 1803 1918 #ifndef CPP_IOIPSL_NO_OUTPUT … … 1812 1927 ENDIF 1813 1928 1814 1815 1929 END SUBROUTINE phys_output_write 1816 1930 -
LMDZ5/branches/testing/libf/phylmd/phys_state_var_mod.F90
r2641 r2720 17 17 INTEGER, PARAMETER :: napisccp=1 18 18 INTEGER, SAVE :: radpas 19 INTEGER, SAVE :: cvpas 19 20 REAL, PARAMETER :: missing_val_nf90=nf90_fill_real 20 21 !$OMP THREADPRIVATE(radpas) 22 !$OMP THREADPRIVATE(cvpas) 21 23 REAL, SAVE :: dtime, solaire_etat0 22 24 !$OMP THREADPRIVATE(dtime, solaire_etat0) -
LMDZ5/branches/testing/libf/phylmd/physiq_mod.F90
r2682 r2720 54 54 d_t_ajs_x,d_q_ajs_x, & 55 55 ! 56 d_t_eva,d_q_eva, &56 d_t_eva,d_q_eva,d_ql_eva,d_qi_eva, & 57 57 d_t_lsc,d_q_lsc,d_ql_lsc,d_qi_lsc, & 58 58 d_t_lscst,d_q_lscst, & … … 174 174 fsollw, evap_pot, & 175 175 fsolsw, wfbils, wfbilo, & 176 176 wfevap, wfrain, wfsnow, & 177 177 pmflxr, pmflxs, prfl, & 178 178 psfl, fraca, Vprecip, & … … 219 219 #ifdef CPP_XIOS 220 220 USE wxios, ONLY: missing_val, missing_val_omp 221 USE xios, ONLY: xios_get_field_attr 221 USE xios, ONLY: xios_get_field_attr, xios_field_is_active 222 222 #endif 223 223 #ifdef REPROBUS … … 745 745 REAL conv_q(klon,klev) ! convergence de l'humidite (kg/kg/s) 746 746 REAL conv_t(klon,klev) ! convergence de la temperature(K/s) 747 748 ! 749 ! REAL zxsnow(klon) 747 ! 750 748 REAL zxsnow_dummy(klon) 751 749 REAL zsav_tsol(klon) … … 763 761 real zqsat(klon,klev) 764 762 ! 765 INTEGER i, k, iq, ig, j, nsrf, ll, l, iiq763 INTEGER i, k, iq, j, nsrf, ll, l 766 764 ! 767 765 REAL t_coup … … 777 775 REAL s_trmb1(klon), s_trmb2(klon) 778 776 REAL s_trmb3(klon) 777 778 ! La convection n'est pas calculee tous les pas, il faut donc 779 ! sauvegarder les sorties de la convection 780 !ym SAVE 781 !ym SAVE 782 !ym SAVE 783 ! 784 INTEGER itapcv 785 SAVE itapcv 786 !$OMP THREADPRIVATE(itapcv) 787 779 788 !KE43 780 789 ! Variables locales pour la convection de K. Emanuel (sb): … … 884 893 !IM 141004 END 885 894 !IM 190504 BEG 886 INTEGER ij887 895 ! INTEGER imp1jmp1 888 896 ! PARAMETER(imp1jmp1=(iim+1)*jjmp1) … … 893 901 LOGICAL ok_msk 894 902 REAL msk(klon) 895 !IM896 REAL airetot, pi897 903 !ym A voir plus tard 898 904 !ym REAL zm_wo(jjmp1, klev) … … 932 938 !$OMP THREADPRIVATE(ok_sync) 933 939 real date0 934 integer idayref935 940 936 941 ! essai writephys … … 953 958 DATA ip_ebil/0/ 954 959 !$OMP THREADPRIVATE(ip_ebil) 955 INTEGER if_ebil ! level for energy conserv. dignostics956 SAVE if_ebil957 !$OMP THREADPRIVATE(if_ebil)958 960 REAL q2m(klon,nbsrf) ! humidite a 2m 959 961 … … 1099 1101 ! en imposant la valeur de igout. 1100 1102 !======================================================================d 1101 if (prt_level.ge.1) then1103 IF (prt_level.ge.1) THEN 1102 1104 igout=klon/2+1/klon 1103 1105 write(lunout,*) 'DEBUT DE PHYSIQ !!!!!!!!!!!!!!!!!!!!' … … 1110 1112 1111 1113 write(lunout,*) 'paprs, play, phi, u, v, t' 1112 dok=1,klev1114 DO k=1,klev 1113 1115 write(lunout,*) paprs(igout,k),pplay(igout,k),pphi(igout,k), & 1114 1116 u(igout,k),v(igout,k),t(igout,k) 1115 enddo1117 ENDDO 1116 1118 write(lunout,*) 'ovap (g/kg), oliq (g/kg)' 1117 dok=1,klev1119 DO k=1,klev 1118 1120 write(lunout,*) qx(igout,k,1)*1000,qx(igout,k,2)*1000. 1119 enddo1120 endif1121 ENDDO 1122 ENDIF 1121 1123 1122 1124 !====================================================================== 1123 1125 1124 if (first) then1126 IF (first) THEN 1125 1127 !CR:nvelles variables convection/poches froides 1126 1128 1127 1129 print*, '=================================================' 1128 1130 print*, 'Allocation des variables locales et sauvegardees' 1129 callphys_local_var_init1131 CALL phys_local_var_init 1130 1132 ! 1131 1133 pasphys=pdtphys 1132 1134 ! appel a la lecture du run.def physique 1133 callconf_phys(ok_journe, ok_mensuel, &1135 CALL conf_phys(ok_journe, ok_mensuel, & 1134 1136 ok_instan, ok_hf, & 1135 1137 ok_LES, & … … 1145 1147 read_climoz, & 1146 1148 alp_offset) 1147 callphys_state_var_init(read_climoz)1148 callphys_output_var_init1149 CALL phys_state_var_init(read_climoz) 1150 CALL phys_output_var_init 1149 1151 print*, '=================================================' 1150 1152 ! 1151 1153 !CR: check sur le nb de traceurs de l eau 1152 if ((iflag_ice_thermo.gt.0).and.(nqo==2)) then1154 IF ((iflag_ice_thermo.gt.0).and.(nqo==2)) THEN 1153 1155 WRITE (lunout, *) ' iflag_ice_thermo==1 requires 3 H2O tracers ', & 1154 1156 '(H2Ov, H2Ol, H2Oi) but nqo=', nqo, '. Might as well stop here.' 1155 1157 STOP 1156 endif1158 ENDIF 1157 1159 1158 1160 dnwd0=0.0 … … 1167 1169 first=.false. 1168 1170 1169 endif! first1171 ENDIF ! first 1170 1172 1171 1173 !ym => necessaire pour iflag_con != 2 … … 1189 1191 DO i=1,klon 1190 1192 zero_v(i)=0. 1191 END 1192 END 1193 ENDDO 1194 ENDIF 1193 1195 1194 1196 IF (debut) THEN … … 1204 1206 ENDIF 1205 1207 1206 if(prt_level.ge.1) print*,'CONVERGENCE PHYSIQUE THERM 1 '1208 IF (prt_level.ge.1) print *,'CONVERGENCE PHYSIQUE THERM 1 ' 1207 1209 1208 1210 … … 1248 1250 ELSE 1249 1251 config_inca='none' ! default 1250 END 1252 ENDIF 1251 1253 1252 1254 IF (aerosol_couple .AND. (config_inca /= "aero" & … … 1282 1284 itap = 0 1283 1285 itaprad = 0 1286 itapcv = 0 1284 1287 1285 1288 ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! … … 1287 1290 ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 1288 1291 1289 if (iflag_pbl>1) then1292 IF (iflag_pbl>1) THEN 1290 1293 PRINT*, "Using method MELLOR&YAMADA" 1291 endif1294 ENDIF 1292 1295 1293 1296 ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! … … 1307 1310 abort_message='nbre de pas de temps physique n est pas multiple ' & 1308 1311 // 'de nbapp_rad' 1312 CALL abort_physic(modname,abort_message,1) 1313 ENDIF 1314 IF (nbapp_cv .EQ. 0) nbapp_cv=86400./dtime 1315 print *,'physiq, nbapp_cv ',nbapp_cv 1316 IF (MOD(INT(86400./dtime),nbapp_cv).EQ.0) THEN 1317 cvpas = NINT( 86400./dtime/nbapp_cv) 1318 print *,'physiq, cvpas ',cvpas 1319 ELSE 1320 WRITE(lunout,*) 'le nombre de pas de temps physique doit etre un ', & 1321 'multiple de nbapp_cv' 1322 WRITE(lunout,*) 'changer nbapp_cv ou alors commenter ce test ', & 1323 'mais 1+1<>2' 1324 abort_message='nbre de pas de temps physique n est pas multiple ' & 1325 // 'de nbapp_cv' 1309 1326 call abort_physic(modname,abort_message,1) 1310 1327 ENDIF … … 1329 1346 1330 1347 1331 1332 1348 ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 1333 1349 ! … … 1352 1368 klon 1353 1369 abort_message='nlon et klon ne sont pas coherents' 1354 callabort_physic(modname,abort_message,1)1370 CALL abort_physic(modname,abort_message,1) 1355 1371 ENDIF 1356 1372 IF (nlev .NE. klev) THEN … … 1358 1374 klev 1359 1375 abort_message='nlev et klev ne sont pas coherents' 1360 callabort_physic(modname,abort_message,1)1376 CALL abort_physic(modname,abort_message,1) 1361 1377 ENDIF 1362 1378 ! … … 1365 1381 WRITE(lunout,*)"Au minimum 4 appels par jour si cycle diurne" 1366 1382 abort_message='Nbre d appels au rayonnement insuffisant' 1367 callabort_physic(modname,abort_message,1)1383 CALL abort_physic(modname,abort_message,1) 1368 1384 ENDIF 1369 1385 WRITE(lunout,*)"Clef pour la convection, iflag_con=", iflag_con … … 1396 1412 !CR:04.12.07: initialisations poches froides 1397 1413 ! Controle de ALE et ALP pour la fermeture convective (jyg) 1398 if (iflag_wake>=1) then1414 IF (iflag_wake>=1) THEN 1399 1415 CALL ini_wake(0.,0.,it_wape_prescr,wape_prescr,fip_prescr & 1400 1416 ,alp_bl_prescr, ale_bl_prescr) … … 1416 1432 d_s_wk(:) = 0. 1417 1433 d_dens_wk(:) = 0. 1418 endif1434 ENDIF 1419 1435 1420 1436 ! do i = 1,klon … … 1428 1444 OPEN(98,file='npCFMIP_param.data',status='old', & 1429 1445 form='formatted',iostat=iostat) 1430 if (iostat == 0) then1446 IF (iostat == 0) THEN 1431 1447 READ(98,*,end=998) nCFMIP 1432 1448 998 CONTINUE … … 1435 1451 IF(nCFMIP.GT.npCFMIP) THEN 1436 1452 print*,'nCFMIP > npCFMIP : augmenter npCFMIP et recompiler' 1437 callabort_physic("physiq", "", 1)1438 else1453 CALL abort_physic("physiq", "", 1) 1454 ELSE 1439 1455 print*,'physiq npCFMIP=',npCFMIP,'nCFMIP=',nCFMIP 1440 1456 ENDIF … … 1463 1479 tabijGCM, lonGCM, latGCM, iGCM, jGCM) 1464 1480 ! 1465 else1481 ELSE 1466 1482 ALLOCATE(tabijGCM(0)) 1467 1483 ALLOCATE(lonGCM(0), latGCM(0)) 1468 1484 ALLOCATE(iGCM(0), jGCM(0)) 1469 end if1470 else1485 ENDIF 1486 ELSE 1471 1487 ALLOCATE(tabijGCM(0)) 1472 1488 ALLOCATE(lonGCM(0), latGCM(0)) … … 1499 1515 zuthe(i)=0. 1500 1516 zvthe(i)=0. 1501 if(zstd(i).gt.10.)then1517 IF (zstd(i).gt.10.) THEN 1502 1518 zuthe(i)=(1.-zgam(i))*cos(zthe(i)) 1503 1519 zvthe(i)=(1.-zgam(i))*sin(zthe(i)) 1504 endif1520 ENDIF 1505 1521 ENDDO 1506 1522 ENDIF … … 1524 1540 !============================================================= 1525 1541 1542 #ifdef CPP_XIOS 1543 !--setting up swaero_diag to TRUE in XIOS case 1544 IF (xios_field_is_active("topswad").OR.xios_field_is_active("topswad0").OR. & 1545 xios_field_is_active("solswad").OR.xios_field_is_active("solswad0").OR. & 1546 xios_field_is_active("topswai").OR.xios_field_is_active("solswai").OR. & 1547 (iflag_rrtm==1.AND.(xios_field_is_active("toplwad").OR.xios_field_is_active("toplwad0").OR. & 1548 xios_field_is_active("sollwad").OR.xios_field_is_active("sollwad0")))) & 1549 !!!--for now these fields are not in the XML files so they are omitted 1550 !!! xios_field_is_active("toplwai").OR.xios_field_is_active("sollwai") !))) & 1551 swaero_diag=.TRUE. 1552 #endif 1553 1526 1554 #ifdef CPP_IOIPSL 1527 1555 … … 1531 1559 ok_sync_omp=.false. 1532 1560 CALL getin('ok_sync',ok_sync_omp) 1533 callphys_output_open(longitude_deg,latitude_deg,nCFMIP,tabijGCM, &1561 CALL phys_output_open(longitude_deg,latitude_deg,nCFMIP,tabijGCM, & 1534 1562 iGCM,jGCM,lonGCM,latGCM, & 1535 1563 jjmp1,nlevSTD,clevSTD,rlevSTD, dtime,ok_veget, & … … 1540 1568 flag_aerosol_strat, pdtphys, paprs, pphis, & 1541 1569 pplay, lmax_th, ptconv, ptconvth, ivap, & 1542 d_ t, qx, d_qx, zmasse, ok_sync_omp)1570 d_u, d_t, qx, d_qx, zmasse, ok_sync_omp) 1543 1571 !$OMP END MASTER 1544 1572 !$OMP BARRIER … … 1605 1633 CALL VTb(VTphysiq) 1606 1634 #endif 1607 END 1635 ENDIF 1608 1636 ! 1609 1637 ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! … … 1611 1639 ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 1612 1640 1613 calliniradia(klon,klev,paprs(1,1:klev+1))1641 CALL iniradia(klon,klev,paprs(1,1:klev+1)) 1614 1642 1615 1643 !$omp single 1616 if (read_climoz >= 1) then1617 callopen_climoz(ncid_climoz, press_climoz)1618 END 1644 IF (read_climoz >= 1) THEN 1645 CALL open_climoz(ncid_climoz, press_climoz) 1646 ENDIF 1619 1647 !$omp end single 1620 1648 ! … … 1697 1725 CALL Rtime(debut) 1698 1726 #endif 1699 END 1727 ENDIF 1700 1728 1701 1729 … … 1757 1785 ql_seri(i,k) = qx(i,k,iliq) 1758 1786 !CR: ATTENTION, on rajoute la variable glace 1759 if (nqo.eq.2) then1787 IF (nqo.eq.2) THEN 1760 1788 qs_seri(i,k) = 0. 1761 else if (nqo.eq.3) then1789 ELSE IF (nqo.eq.3) THEN 1762 1790 qs_seri(i,k) = qx(i,k,isol) 1763 endif1791 ENDIF 1764 1792 ENDDO 1765 1793 ENDDO … … 1805 1833 ENDDO 1806 1834 ! Initialize variables used for diagnostic purpose 1807 if (flag_inhib_tend .ne. 0) call init_cmp_seri 1808 !IM 1809 IF (ip_ebil_phy.ge.1) THEN 1810 ztit='after dynamic' 1811 CALL diagetpq(cell_area,ztit,ip_ebil_phy,1,1,dtime & 1812 , t_seri,q_seri,ql_seri,qs_seri,u_seri,v_seri,paprs,pplay & 1813 , d_h_vcol, d_qt, d_qw, d_ql, d_qs, d_ec) 1814 ! Comme les tendances de la physique sont ajoute dans la dynamique, 1815 ! on devrait avoir que la variation d'entalpie par la dynamique 1816 ! est egale a la variation de la physique au pas de temps precedent. 1817 ! Donc la somme de ces 2 variations devrait etre nulle. 1818 call diagphy(cell_area,ztit,ip_ebil_phy & 1819 , zero_v, zero_v, zero_v, zero_v, zero_v & 1820 , zero_v, zero_v, zero_v, ztsol & 1821 , d_h_vcol+d_h_vcol_phy, d_qt, 0. & 1822 , fs_bound, fq_bound ) 1823 END IF 1835 IF (flag_inhib_tend .ne. 0) CALL init_cmp_seri 1824 1836 1825 1837 ! Diagnostiquer la tendance dynamique … … 1932 1944 ELSE 1933 1945 ro3i = int((days_elapsed + jh_cur - jh_1jan) / year_len * 360.) + 1 1934 if(ro3i == 361) ro3i = 3601935 if (read_climoz == 1) then1936 callregr_pr_av(ncid_climoz, (/"tro3"/), julien=ro3i, &1946 IF (ro3i == 361) ro3i = 360 1947 IF (read_climoz == 1) THEN 1948 CALL regr_pr_av(ncid_climoz, (/"tro3"/), julien=ro3i, & 1937 1949 press_in_edg=press_climoz, paprs=paprs, v3=wo) 1938 else1950 ELSE 1939 1951 ! read_climoz == 2 1940 callregr_pr_av(ncid_climoz, (/"tro3 ", &1952 CALL regr_pr_av(ncid_climoz, (/"tro3 ", & 1941 1953 "tro3_daylight"/), julien=ro3i, press_in_edg=press_climoz, & 1942 1954 paprs=paprs, v3=wo) 1943 end if1955 ENDIF 1944 1956 ! Convert from mole fraction of ozone to column density of ozone in a 1945 1957 ! cell, in kDU: 1946 forall(l = 1: read_climoz) wo(:, :, l) = wo(:, :, l) * rmo3 / rmd &1958 FORALL (l = 1: read_climoz) wo(:, :, l) = wo(:, :, l) * rmo3 / rmd & 1947 1959 * zmasse / dobson_u / 1e3 1948 1960 ! (By regridding ozone values for LMDZ only once every 360th of … … 1956 1968 ! Re-evaporer l'eau liquide nuageuse 1957 1969 ! 1958 DO k = 1, klev ! re-evaporation de l'eau liquide nuageuse 1959 DO i = 1, klon 1960 zlvdcp=RLVTT/RCPD/(1.0+RVTMP2*q_seri(i,k)) 1961 !jyg< 1962 ! Attention : Arnaud a propose des formules completement differentes 1963 ! A verifier !!! 1964 zlsdcp=RLSTT/RCPD/(1.0+RVTMP2*q_seri(i,k)) 1965 IF (iflag_ice_thermo .EQ. 0) THEN 1966 zlsdcp=zlvdcp 1967 ENDIF 1968 !>jyg 1969 1970 if (iflag_ice_thermo.eq.0) then 1971 !pas necessaire a priori 1972 1973 zdelta = MAX(0.,SIGN(1.,RTT-t_seri(i,k))) 1974 zb = MAX(0.0,ql_seri(i,k)) 1975 za = - MAX(0.0,ql_seri(i,k)) & 1976 * (zlvdcp*(1.-zdelta)+zlsdcp*zdelta) 1977 t_seri(i,k) = t_seri(i,k) + za 1978 q_seri(i,k) = q_seri(i,k) + zb 1979 ql_seri(i,k) = 0.0 1980 d_t_eva(i,k) = za 1981 d_q_eva(i,k) = zb 1982 1983 else 1984 1985 !CR: on r\'e-\'evapore eau liquide et glace 1986 1987 ! zdelta = MAX(0.,SIGN(1.,RTT-t_seri(i,k))) 1988 ! zb = MAX(0.0,ql_seri(i,k)) 1989 ! za = - MAX(0.0,ql_seri(i,k)) & 1990 ! * (zlvdcp*(1.-zdelta)+zlsdcp*zdelta) 1991 zb = MAX(0.0,ql_seri(i,k)+qs_seri(i,k)) 1992 za = - MAX(0.0,ql_seri(i,k))*zlvdcp & 1993 - MAX(0.0,qs_seri(i,k))*zlsdcp 1994 t_seri(i,k) = t_seri(i,k) + za 1995 q_seri(i,k) = q_seri(i,k) + zb 1996 ql_seri(i,k) = 0.0 1997 !on \'evapore la glace 1998 qs_seri(i,k) = 0.0 1999 d_t_eva(i,k) = za 2000 d_q_eva(i,k) = zb 2001 endif 2002 2003 ENDDO 2004 ENDDO 2005 !IM 2006 IF (ip_ebil_phy.ge.2) THEN 2007 ztit='after reevap' 2008 CALL diagetpq(cell_area,ztit,ip_ebil_phy,2,1,dtime & 2009 , t_seri,q_seri,ql_seri,qs_seri,u_seri,v_seri,paprs,pplay & 2010 , d_h_vcol, d_qt, d_qw, d_ql, d_qs, d_ec) 2011 call diagphy(cell_area,ztit,ip_ebil_phy & 2012 , zero_v, zero_v, zero_v, zero_v, zero_v & 2013 , zero_v, zero_v, zero_v, ztsol & 2014 , d_h_vcol, d_qt, d_ec & 2015 , fs_bound, fq_bound ) 2016 ! 2017 END IF 2018 2019 ! 1970 CALL reevap (klon,klev,iflag_ice_thermo,t_seri,q_seri,ql_seri,qs_seri, & 1971 & d_t_eva,d_q_eva,d_ql_eva,d_qi_eva) 1972 1973 CALL add_phys_tend & 1974 (du0,dv0,d_t_eva,d_q_eva,d_ql_eva,d_qi_eva,paprs,& 1975 'eva',abortphy,flag_inhib_tend) 1976 2020 1977 !========================================================================= 2021 1978 ! Calculs de l'orbite. … … 2024 1981 2025 1982 ! !! jyg 17 Sep 2010 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 2026 callymds2ju(year_cur, mth_eq, day_eq,0., jD_eq)1983 CALL ymds2ju(year_cur, mth_eq, day_eq,0., jD_eq) 2027 1984 day_since_equinox = (jD_cur + jH_cur) - jD_eq 2028 1985 ! 2029 1986 ! choix entre calcul de la longitude solaire vraie ou valeur fixee a 2030 1987 ! solarlong0 2031 if (solarlong0<-999.) then2032 if (new_orbit) then1988 IF (solarlong0<-999.) THEN 1989 IF (new_orbit) THEN 2033 1990 ! calcul selon la routine utilisee pour les planetes 2034 callsolarlong(day_since_equinox, zlongi, dist)2035 else1991 CALL solarlong(day_since_equinox, zlongi, dist) 1992 ELSE 2036 1993 ! calcul selon la routine utilisee pour l'AR4 2037 1994 CALL orbite(REAL(days_elapsed+1),zlongi,dist) 2038 endif2039 else1995 ENDIF 1996 ELSE 2040 1997 zlongi=solarlong0 ! longitude solaire vraie 2041 1998 dist=1. ! distance au soleil / moyenne 2042 endif2043 if(prt_level.ge.1) & 2044 1999 ENDIF 2000 2001 IF (prt_level.ge.1) write(lunout,*)'Longitude solaire ',zlongi,solarlong0,dist 2045 2002 2046 2003 … … 2052 2009 ! Cet ensoleillement est sym\'etrique autour de l'\'equateur et 2053 2010 ! non nul aux poles. 2054 IF (abs(solarlong0-1000.)<1.e-4) then2055 callzenang_an(iflag_cycle_diurne.GE.1,jH_cur, &2011 IF (abs(solarlong0-1000.)<1.e-4) THEN 2012 CALL zenang_an(iflag_cycle_diurne.GE.1,jH_cur, & 2056 2013 latitude_deg,longitude_deg,rmu0,fract) 2057 2014 JrNt = 1.0 … … 2106 2063 ENDIF 2107 2064 2108 if (mydebug) then2109 callwritefield_phy('u_seri',u_seri,nbp_lev)2110 callwritefield_phy('v_seri',v_seri,nbp_lev)2111 callwritefield_phy('t_seri',t_seri,nbp_lev)2112 callwritefield_phy('q_seri',q_seri,nbp_lev)2113 endif2065 IF (mydebug) THEN 2066 CALL writefield_phy('u_seri',u_seri,nbp_lev) 2067 CALL writefield_phy('v_seri',v_seri,nbp_lev) 2068 CALL writefield_phy('t_seri',t_seri,nbp_lev) 2069 CALL writefield_phy('q_seri',q_seri,nbp_lev) 2070 ENDIF 2114 2071 2115 2072 !cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc … … 2137 2094 2138 2095 2139 if (iflag_pbl/=0) then2096 IF (iflag_pbl/=0) THEN 2140 2097 2141 2098 !jyg+nrlmd< … … 2210 2167 z0m, z0h, agesno, fsollw, fsolsw, & 2211 2168 d_ts, fevap, fluxlat, t2m, & 2212 wfbils, wfbilo, fluxt, fluxu, fluxv, & 2169 wfbils, wfbilo, wfevap, wfrain, wfsnow, & 2170 fluxt, fluxu, fluxv, & 2213 2171 dsens, devap, zxsnow, & 2214 2172 zxfluxt, zxfluxq, q2m, fluxq, pbl_tke, & … … 2245 2203 !-------------------------------------------------------------------- 2246 2204 2247 if (mydebug) then 2248 call writefield_phy('u_seri',u_seri,nbp_lev) 2249 call writefield_phy('v_seri',v_seri,nbp_lev) 2250 call writefield_phy('t_seri',t_seri,nbp_lev) 2251 call writefield_phy('q_seri',q_seri,nbp_lev) 2252 endif 2253 2205 IF (mydebug) THEN 2206 CALL writefield_phy('u_seri',u_seri,nbp_lev) 2207 CALL writefield_phy('v_seri',v_seri,nbp_lev) 2208 CALL writefield_phy('t_seri',t_seri,nbp_lev) 2209 CALL writefield_phy('q_seri',q_seri,nbp_lev) 2210 ENDIF 2254 2211 2255 2212 !albedo SB >>> … … 2258 2215 falb1=0. 2259 2216 falb2=0. 2260 select case(nsw)2261 case(2)2217 SELECT CASE(nsw) 2218 CASE(2) 2262 2219 albsol1=albsol_dir(:,1) 2263 2220 albsol2=albsol_dir(:,2) 2264 2221 falb1=falb_dir(:,1,:) 2265 2222 falb2=falb_dir(:,2,:) 2266 case(4)2223 CASE(4) 2267 2224 albsol1=albsol_dir(:,1) 2268 2225 albsol2=albsol_dir(:,2)*SFRWL(2)+albsol_dir(:,3)*SFRWL(3) & … … 2273 2230 +falb_dir(:,4,:)*SFRWL(4) 2274 2231 falb2=falb2/(SFRWL(2)+SFRWL(3)+SFRWL(4)) 2275 case(6)2232 CASE(6) 2276 2233 albsol1=albsol_dir(:,1)*SFRWL(1)+albsol_dir(:,2)*SFRWL(2) & 2277 2234 +albsol_dir(:,3)*SFRWL(3) … … 2286 2243 +falb_dir(:,6,:)*SFRWL(6) 2287 2244 falb2=falb2/(SFRWL(4)+SFRWL(5)+SFRWL(6)) 2288 end select2245 END SELECt 2289 2246 !albedo SB <<< 2290 2247 … … 2292 2249 CALL evappot(klon,nbsrf,ftsol,pplay(:,1),cdragh, & 2293 2250 t_seri(:,1),q_seri(:,1),u_seri(:,1),v_seri(:,1),evap_pot) 2294 2295 2296 IF (ip_ebil_phy.ge.2) THEN2297 ztit='after surface_main'2298 CALL diagetpq(cell_area,ztit,ip_ebil_phy,2,2,dtime &2299 , t_seri,q_seri,ql_seri,qs_seri,u_seri,v_seri,paprs,pplay &2300 , d_h_vcol, d_qt, d_qw, d_ql, d_qs, d_ec)2301 call diagphy(cell_area,ztit,ip_ebil_phy &2302 , zero_v, zero_v, zero_v, zero_v, sens &2303 , evap , zero_v, zero_v, ztsol &2304 , d_h_vcol, d_qt, d_ec &2305 , fs_bound, fq_bound )2306 END IF2307 2251 2308 2252 ENDIF … … 2331 2275 ENDDO 2332 2276 2333 if (prt_level.ge.1) then2277 IF (prt_level.ge.1) THEN 2334 2278 write(lunout,*) 'L qsat (g/kg) avant clouds_gno' 2335 2279 write(lunout,'(i4,f15.4)') (k,1000.*zqsat(igout,k),k=1,klev) 2336 endif2280 ENDIF 2337 2281 ! 2338 2282 ! Appeler la convection (au choix) … … 2368 2312 DO i = 1, klon 2369 2313 omega(i,k) = RG*flxmass_w(i,k) / cell_area(i) 2370 END DO 2371 END DO 2372 if (prt_level.ge.1) write(lunout,*) 'omega(igout, :) = ', & 2314 ENDDO 2315 ENDDO 2316 2317 IF (prt_level.ge.1) write(lunout,*) 'omega(igout, :) = ', & 2373 2318 omega(igout, :) 2319 2320 ! 2321 ! Appel de la convection tous les "cvpas" 2322 ! 2323 IF (MOD(itapcv,cvpas).EQ.0) THEN 2374 2324 2375 2325 IF (iflag_con.EQ.1) THEN … … 2404 2354 !ajout pour la parametrisation des poches froides: calcul de 2405 2355 !t_w et t_x: si pas de poches froides, t_w=t_x=t_seri 2406 if (iflag_wake>=1) then 2407 do k=1,klev 2408 do i=1,klon 2409 t_w(i,k) = t_seri(i,k) & 2410 +(1-wake_s(i))*wake_deltat(i,k) 2411 q_w(i,k) = q_seri(i,k) & 2412 +(1-wake_s(i))*wake_deltaq(i,k) 2413 t_x(i,k) = t_seri(i,k) & 2414 -wake_s(i)*wake_deltat(i,k) 2415 q_x(i,k) = q_seri(i,k) & 2416 -wake_s(i)*wake_deltaq(i,k) 2417 enddo 2418 enddo 2419 else 2420 t_w(:,:) = t_seri(:,:) 2356 IF (iflag_wake>=1) THEN 2357 DO k=1,klev 2358 DO i=1,klon 2359 t_w(i,k) = t_seri(i,k) + (1-wake_s(i))*wake_deltat(i,k) 2360 q_w(i,k) = q_seri(i,k) + (1-wake_s(i))*wake_deltaq(i,k) 2361 t_x(i,k) = t_seri(i,k) - wake_s(i)*wake_deltat(i,k) 2362 q_x(i,k) = q_seri(i,k) - wake_s(i)*wake_deltaq(i,k) 2363 ENDDO 2364 ENDDO 2365 ELSE 2366 t_w(:,:) = t_seri(:,:) 2421 2367 q_w(:,:) = q_seri(:,:) 2422 2368 t_x(:,:) = t_seri(:,:) 2423 2369 q_x(:,:) = q_seri(:,:) 2424 endif2370 ENDIF 2425 2371 ! 2426 2372 !jyg< … … 2491 2437 ELSE 2492 2438 nbtr_tmp=nbtr 2493 END 2439 ENDIF 2494 2440 !jyg iflag_con est dans clesphys 2495 2441 !c CALL concvl (iflag_con,iflag_clos, … … 2524 2470 pmfu(:,:)=upwd(:,:)+dnwd(:,:) 2525 2471 2526 doi = 1, klon2527 if(iflagctrl(i).le.1) itau_con(i)=itau_con(i)+12528 enddo2472 DO i = 1, klon 2473 IF (iflagctrl(i).le.1) itau_con(i)=itau_con(i)+1 2474 ENDDO 2529 2475 ! 2530 2476 !jyg< … … 2578 2524 clwcon0(:,:)=fact_cldcon*clwcon0(:,:) 2579 2525 IF (iflag_cld_cv == 0) THEN 2580 callclouds_gno &2526 CALL clouds_gno & 2581 2527 (klon,klev,q_seri,zqsat,clwcon0,ptconv,ratqsc,rnebcon0) 2582 2528 ELSE 2583 callclouds_bigauss &2529 CALL clouds_bigauss & 2584 2530 (klon,klev,q_seri,zqsat,qtc_cv,sigt_cv,ptconv,ratqsc,rnebcon0) 2585 2531 ENDIF … … 2601 2547 ema_pct(i) = paprs(i,itop_con(i)+1) 2602 2548 2603 if (itop_con(i).gt.klev-3) then2604 if(prt_level >= 9) then2549 IF (itop_con(i).gt.klev-3) THEN 2550 IF (prt_level >= 9) THEN 2605 2551 write(lunout,*)'La convection monte trop haut ' 2606 2552 write(lunout,*)'itop_con(,',i,',)=',itop_con(i) 2607 endif2608 endif2553 ENDIF 2554 ENDIF 2609 2555 ENDDO 2610 2556 ELSE IF (iflag_con.eq.0) THEN … … 2622 2568 ELSE 2623 2569 WRITE(lunout,*) "iflag_con non-prevu", iflag_con 2624 callabort_physic("physiq", "", 1)2570 CALL abort_physic("physiq", "", 1) 2625 2571 ENDIF 2626 2572 … … 2628 2574 ! . d_u_con, d_v_con) 2629 2575 2576 itapcv = 0 2577 ENDIF ! (MOD(itapcv,cvpas).EQ.0) 2578 itapcv = itapcv+1 2579 2630 2580 CALL add_phys_tend(d_u_con, d_v_con, d_t_con, d_q_con, dql0, dqi0, paprs, & 2631 2581 'convection',abortphy,flag_inhib_tend) … … 2633 2583 !------------------------------------------------------------------------- 2634 2584 2635 if (mydebug) then 2636 call writefield_phy('u_seri',u_seri,nbp_lev) 2637 call writefield_phy('v_seri',v_seri,nbp_lev) 2638 call writefield_phy('t_seri',t_seri,nbp_lev) 2639 call writefield_phy('q_seri',q_seri,nbp_lev) 2640 endif 2641 2642 !IM 2643 IF (ip_ebil_phy.ge.2) THEN 2644 ztit='after convect' 2645 CALL diagetpq(cell_area,ztit,ip_ebil_phy,2,2,dtime & 2646 , t_seri,q_seri,ql_seri,qs_seri,u_seri,v_seri,paprs,pplay & 2647 , d_h_vcol, d_qt, d_qw, d_ql, d_qs, d_ec) 2648 call diagphy(cell_area,ztit,ip_ebil_phy & 2649 , zero_v, zero_v, zero_v, zero_v, zero_v & 2650 , zero_v, rain_con, snow_con, ztsol & 2651 , d_h_vcol, d_qt, d_ec & 2652 , fs_bound, fq_bound ) 2653 END IF 2654 ! 2585 IF (mydebug) THEN 2586 CALL writefield_phy('u_seri',u_seri,nbp_lev) 2587 CALL writefield_phy('v_seri',v_seri,nbp_lev) 2588 CALL writefield_phy('t_seri',t_seri,nbp_lev) 2589 CALL writefield_phy('q_seri',q_seri,nbp_lev) 2590 ENDIF 2591 2655 2592 IF (check) THEN 2656 2593 za = qcheck(klon,klev,paprs,q_seri,ql_seri,cell_area) … … 2701 2638 ! froides 2702 2639 ! 2703 if (iflag_wake>=1) then 2640 IF (iflag_wake>=1) THEN 2641 ! 2642 ! Call wakes only when convection has been called 2643 IF (itapcv .EQ. 1) THEN 2644 ! 2704 2645 DO k=1,klev 2705 2646 DO i=1,klon … … 2740 2681 ! 2741 2682 !calcul caracteristiques de la poche froide 2742 callcalWAKE (iflag_wake_tend, paprs, pplay, dtime, &2683 CALL calWAKE (iflag_wake_tend, paprs, pplay, dtime, & 2743 2684 t_seri, q_seri, omega, & 2744 2685 dt_dwn, dq_dwn, M_dwn, M_up, & … … 2755 2696 wake_spread, wake_Cstar, d_deltat_wk_gw, & 2756 2697 d_deltat_wk, d_deltaq_wk, d_s_wk, d_dens_wk) 2698 ! 2699 ENDIF ! (mod(itapcv,cvpas) .EQ. 1) 2757 2700 ! 2758 2701 !----------------------------------------------------------------------- … … 2771 2714 ENDIF ! (iflag_wake_tend .GT. 0.) 2772 2715 2773 endif ! (iflag_wake>=1) 2774 ! 2775 !=================================================================== 2776 !JYG 2777 IF (ip_ebil_phy.ge.2) THEN 2778 ztit='after wake' 2779 CALL diagetpq(cell_area,ztit,ip_ebil_phy,2,2,dtime & 2780 , t_seri,q_seri,ql_seri,qs_seri,u_seri,v_seri,paprs,pplay & 2781 , d_h_vcol, d_qt, d_qw, d_ql, d_qs, d_ec) 2782 call diagphy(cell_area,ztit,ip_ebil_phy & 2783 , zero_v, zero_v, zero_v, zero_v, zero_v & 2784 , zero_v, zero_v, zero_v, ztsol & 2785 , d_h_vcol, d_qt, d_ec & 2786 , fs_bound, fq_bound ) 2787 END IF 2788 2789 ! print*,'apres callwake iflag_cld_th=', iflag_cld_th 2716 ENDIF ! (iflag_wake>=1) 2790 2717 ! 2791 2718 !=================================================================== … … 2793 2720 !=================================================================== 2794 2721 ! 2795 callstratocu_if(klon,klev,pctsrf,paprs, pplay,t_seri &2722 CALL stratocu_if(klon,klev,pctsrf,paprs, pplay,t_seri & 2796 2723 ,seuil_inversion,weak_inversion,dthmin) 2797 2724 … … 2810 2737 ! detr_therm(:,:)=0. 2811 2738 ! 2812 IF (prt_level>9)WRITE(lunout,*) &2739 IF (prt_level>9) WRITE(lunout,*) & 2813 2740 'AVANT LA CONVECTION SECHE , iflag_thermals=' & 2814 2741 ,iflag_thermals,' nsplit_thermals=',nsplit_thermals 2815 if(iflag_thermals<0) then2742 IF (iflag_thermals<0) THEN 2816 2743 ! Rien 2817 2744 ! ==== 2818 IF (prt_level>9)WRITE(lunout,*)'pas de convection seche'2819 2820 2821 else2745 IF (prt_level>9) WRITE(lunout,*)'pas de convection seche' 2746 2747 2748 ELSE 2822 2749 2823 2750 ! Thermiques 2824 2751 ! ========== 2825 IF (prt_level>9)WRITE(lunout,*)'JUSTE AVANT , iflag_thermals=' &2752 IF (prt_level>9) WRITE(lunout,*)'JUSTE AVANT , iflag_thermals=' & 2826 2753 ,iflag_thermals,' nsplit_thermals=',nsplit_thermals 2827 2754 … … 2838 2765 !cc fin nrlmd le 10/04/2012 2839 2766 2840 if (iflag_thermals>=1) then2767 IF (iflag_thermals>=1) THEN 2841 2768 !jyg< 2842 2769 IF (mod(iflag_pbl_split/2,2) .EQ. 1) THEN … … 2862 2789 ENDIF 2863 2790 !>jyg 2864 callcalltherm(pdtphys &2791 CALL calltherm(pdtphys & 2865 2792 ,pplay,paprs,pphi,weak_inversion & 2866 2793 ! ,u_seri,v_seri,t_seri,q_seri,zqsat,debut & !jyg … … 2928 2855 ! ------------------------------------------------------------------- 2929 2856 2930 doi=1,klon2857 DO i=1,klon 2931 2858 ! zmax_th(i)=pphi(i,lmax_th(i))/rg 2932 2859 !CR:04/05/12:correction calcul zmax 2933 2860 zmax_th(i)=zmax0(i) 2934 enddo 2935 2936 endif 2937 2861 ENDDO 2862 2863 ENDIF 2938 2864 2939 2865 ! Ajustement sec … … 2944 2870 ! Dans le cas contraire, on demarre au niveau 1. 2945 2871 2946 if (iflag_thermals>=13.or.iflag_thermals<=0) then2947 2948 if(iflag_thermals.eq.0) then2949 IF (prt_level>9)WRITE(lunout,*)'ajsec'2872 IF (iflag_thermals>=13.or.iflag_thermals<=0) THEN 2873 2874 IF (iflag_thermals.eq.0) THEN 2875 IF (prt_level>9) WRITE(lunout,*)'ajsec' 2950 2876 limbas(:)=1 2951 else2877 ELSE 2952 2878 limbas(:)=lmax_th(:) 2953 endif2879 ENDIF 2954 2880 2955 2881 ! Attention : le call ajsec_convV2 n'est maintenu que momentanneement … … 2959 2885 ! non nulles numeriquement pour des mailles non concernees. 2960 2886 2961 if (iflag_thermals==0) then2887 IF (iflag_thermals==0) THEN 2962 2888 ! Calling adjustment alone (but not the thermal plume model) 2963 2889 CALL ajsec_convV2(paprs, pplay, t_seri,q_seri & 2964 2890 , d_t_ajsb, d_q_ajsb) 2965 else if (iflag_thermals>0) then2891 ELSE IF (iflag_thermals>0) THEN 2966 2892 ! Calling adjustment above the top of thermal plumes 2967 2893 CALL ajsec(paprs, pplay, t_seri,q_seri,limbas & 2968 2894 , d_t_ajsb, d_q_ajsb) 2969 endif2895 ENDIF 2970 2896 2971 2897 !-------------------------------------------------------------------- … … 2978 2904 !--------------------------------------------------------------------- 2979 2905 2980 endif2981 2982 endif2906 ENDIF 2907 2908 ENDIF 2983 2909 ! 2984 2910 !=================================================================== 2985 !IM2986 IF (ip_ebil_phy.ge.2) THEN2987 ztit='after dry_adjust'2988 CALL diagetpq(cell_area,ztit,ip_ebil_phy,2,2,dtime &2989 , t_seri,q_seri,ql_seri,qs_seri,u_seri,v_seri,paprs,pplay &2990 , d_h_vcol, d_qt, d_qw, d_ql, d_qs, d_ec)2991 call diagphy(cell_area,ztit,ip_ebil_phy &2992 , zero_v, zero_v, zero_v, zero_v, zero_v &2993 , zero_v, zero_v, zero_v, ztsol &2994 , d_h_vcol, d_qt, d_ec &2995 , fs_bound, fq_bound )2996 END IF2997 2998 2999 !-------------------------------------------------------------------------3000 2911 ! Computation of ratqs, the width (normalized) of the subrid scale 3001 2912 ! water distribution … … 3073 2984 WRITE(lunout,*)"Precip=", zx_t 3074 2985 ENDIF 3075 !IM 3076 IF (ip_ebil_phy.ge.2) THEN 3077 ztit='after fisrt' 3078 CALL diagetpq(cell_area,ztit,ip_ebil_phy,2,2,dtime & 3079 , t_seri,q_seri,ql_seri,qs_seri,u_seri,v_seri,paprs,pplay & 3080 , d_h_vcol, d_qt, d_qw, d_ql, d_qs, d_ec) 3081 call diagphy(cell_area,ztit,ip_ebil_phy & 3082 , zero_v, zero_v, zero_v, zero_v, zero_v & 3083 , zero_v, rain_lsc, snow_lsc, ztsol & 3084 , d_h_vcol, d_qt, d_ec & 3085 , fs_bound, fq_bound ) 3086 END IF 3087 3088 if (mydebug) then 3089 call writefield_phy('u_seri',u_seri,nbp_lev) 3090 call writefield_phy('v_seri',v_seri,nbp_lev) 3091 call writefield_phy('t_seri',t_seri,nbp_lev) 3092 call writefield_phy('q_seri',q_seri,nbp_lev) 3093 endif 2986 2987 IF (mydebug) THEN 2988 CALL writefield_phy('u_seri',u_seri,nbp_lev) 2989 CALL writefield_phy('v_seri',v_seri,nbp_lev) 2990 CALL writefield_phy('t_seri',t_seri,nbp_lev) 2991 CALL writefield_phy('q_seri',q_seri,nbp_lev) 2992 ENDIF 3094 2993 3095 2994 ! … … 3106 3005 ! print*,'avant calcul de la pseudo precip ' 3107 3006 ! print*,'iflag_cld_th',iflag_cld_th 3108 if (iflag_cld_th.eq.-1) then3007 IF (iflag_cld_th.eq.-1) THEN 3109 3008 rain_tiedtke=rain_con 3110 else3009 ELSE 3111 3010 ! print*,'calcul de la pseudo precip ' 3112 3011 rain_tiedtke=0. 3113 3012 ! print*,'calcul de la pseudo precip 0' 3114 dok=1,klev3115 doi=1,klon3116 if (d_q_con(i,k).lt.0.) then3013 DO k=1,klev 3014 DO i=1,klon 3015 IF (d_q_con(i,k).lt.0.) THEN 3117 3016 rain_tiedtke(i)=rain_tiedtke(i)-d_q_con(i,k)/pdtphys & 3118 3017 *(paprs(i,k)-paprs(i,k+1))/rg 3119 endif3120 enddo3121 enddo3122 endif3018 ENDIF 3019 ENDDO 3020 ENDDO 3021 ENDIF 3123 3022 ! 3124 3023 ! call dump2d(iim,jjm,rain_tiedtke(2:klon-1),'PSEUDO PRECIP ') … … 3144 3043 ! facttemps 3145 3044 facteur = pdtphys *facttemps 3146 dok=1,klev3147 doi=1,klon3045 DO k=1,klev 3046 DO i=1,klon 3148 3047 rnebcon(i,k)=rnebcon(i,k)*facteur 3149 if (rnebcon0(i,k)*clwcon0(i,k).gt.rnebcon(i,k)*clwcon(i,k)) & 3150 then 3048 IF (rnebcon0(i,k)*clwcon0(i,k).GT.rnebcon(i,k)*clwcon(i,k)) THEN 3151 3049 rnebcon(i,k)=rnebcon0(i,k) 3152 3050 clwcon(i,k)=clwcon0(i,k) 3153 endif3154 enddo3155 enddo3051 ENDIF 3052 ENDDO 3053 ENDDO 3156 3054 3157 3055 ! On prend la somme des fractions nuageuses et des contenus en eau 3158 3056 3159 if (iflag_cld_th>=5) then3160 3161 dok=1,klev3057 IF (iflag_cld_th>=5) THEN 3058 3059 DO k=1,klev 3162 3060 ptconvth(:,k)=fm_therm(:,k+1)>0. 3163 enddo3164 3165 if (iflag_coupl==4) then3061 ENDDO 3062 3063 IF (iflag_coupl==4) THEN 3166 3064 3167 3065 ! Dans le cas iflag_coupl==4, on prend la somme des convertures 3168 3066 ! convectives et lsc dans la partie des thermiques 3169 3067 ! Le controle par iflag_coupl est peut etre provisoire. 3170 dok=1,klev3171 doi=1,klon3172 if (ptconv(i,k).and.ptconvth(i,k)) then3068 DO k=1,klev 3069 DO i=1,klon 3070 IF (ptconv(i,k).AND.ptconvth(i,k)) THEN 3173 3071 cldliq(i,k)=cldliq(i,k)+rnebcon(i,k)*clwcon(i,k) 3174 3072 cldfra(i,k)=min(cldfra(i,k)+rnebcon(i,k),1.) 3175 else if (ptconv(i,k)) then3073 ELSE IF (ptconv(i,k)) THEN 3176 3074 cldfra(i,k)=rnebcon(i,k) 3177 3075 cldliq(i,k)=rnebcon(i,k)*clwcon(i,k) 3178 endif3179 enddo3180 enddo3181 3182 else if (iflag_coupl==5) then3183 dok=1,klev3184 doi=1,klon3076 ENDIF 3077 ENDDO 3078 ENDDO 3079 3080 ELSE IF (iflag_coupl==5) THEN 3081 DO k=1,klev 3082 DO i=1,klon 3185 3083 cldfra(i,k)=min(cldfra(i,k)+rnebcon(i,k),1.) 3186 3084 cldliq(i,k)=cldliq(i,k)+rnebcon(i,k)*clwcon(i,k) 3187 enddo3188 enddo3189 3190 else3085 ENDDO 3086 ENDDO 3087 3088 ELSE 3191 3089 3192 3090 ! Si on est sur un point touche par la convection … … 3198 3096 ! definition des points sur lesquels ls thermiques sont actifs 3199 3097 3200 dok=1,klev3201 doi=1,klon3202 if (ptconv(i,k).and. .not. ptconvth(i,k)) then3098 DO k=1,klev 3099 DO i=1,klon 3100 IF (ptconv(i,k).AND. .NOT.ptconvth(i,k)) THEN 3203 3101 cldfra(i,k)=rnebcon(i,k) 3204 3102 cldliq(i,k)=rnebcon(i,k)*clwcon(i,k) 3205 endif3206 enddo3207 enddo3208 3209 endif3210 3211 else3103 ENDIF 3104 ENDDO 3105 ENDDO 3106 3107 ENDIF 3108 3109 ELSE 3212 3110 3213 3111 ! Ancienne version 3214 3112 cldfra(:,:)=min(max(cldfra(:,:),rnebcon(:,:)),1.) 3215 3113 cldliq(:,:)=cldliq(:,:)+rnebcon(:,:)*clwcon(:,:) 3216 endif3114 ENDIF 3217 3115 3218 3116 ENDIF … … 3246 3144 snow_fall(i) = snow_con(i) + snow_lsc(i) 3247 3145 ENDDO 3248 !IM3249 IF (ip_ebil_phy.ge.2) THEN3250 ztit="after diagcld"3251 CALL diagetpq(cell_area,ztit,ip_ebil_phy,2,2,dtime &3252 , t_seri,q_seri,ql_seri,qs_seri,u_seri,v_seri,paprs,pplay &3253 , d_h_vcol, d_qt, d_qw, d_ql, d_qs, d_ec)3254 call diagphy(cell_area,ztit,ip_ebil_phy &3255 , zero_v, zero_v, zero_v, zero_v, zero_v &3256 , zero_v, zero_v, zero_v, ztsol &3257 , d_h_vcol, d_qt, d_ec &3258 , fs_bound, fq_bound )3259 END IF3260 3146 ! 3261 3147 ! Calculer l'humidite relative pour diagnostique … … 3315 3201 calday = REAL(days_elapsed + 1) + jH_cur 3316 3202 3317 callchemtime(itap+itau_phy-1, date0, dtime, itap)3203 CALL chemtime(itap+itau_phy-1, date0, dtime, itap) 3318 3204 IF (config_inca == 'aero' .OR. config_inca == 'aeNP') THEN 3319 3205 CALL AEROSOL_METEO_CALC( & … … 3321 3207 prfl,psfl,pctsrf,cell_area, & 3322 3208 latitude_deg,longitude_deg,u10m,v10m) 3323 END 3209 ENDIF 3324 3210 3325 3211 zxsnow_dummy(:) = 0.0 … … 3364 3250 CALL VTb(VTphysiq) 3365 3251 #endif 3366 END 3252 ENDIF !type_trac = inca 3367 3253 3368 3254 … … 3389 3275 IF (aerosol_couple .AND. config_inca == 'aero' ) THEN 3390 3276 abort_message='config_inca=aero et rrtm=1 impossible' 3391 callabort_physic(modname,abort_message,1)3277 CALL abort_physic(modname,abort_message,1) 3392 3278 ELSE 3393 3279 ! … … 3424 3310 abort_message='Only NSW=2 or 6 are possible with ' & 3425 3311 // 'aerosols and iflag_rrtm=1' 3426 callabort_physic(modname,abort_message,1)3312 CALL abort_physic(modname,abort_message,1) 3427 3313 ENDIF 3428 3314 … … 3434 3320 abort_message='You should compile with -rrtm if running ' & 3435 3321 // 'with iflag_rrtm=1' 3436 callabort_physic(modname,abort_message,1)3322 CALL abort_physic(modname,abort_message,1) 3437 3323 #endif 3438 3324 ! … … 3470 3356 ELSE 3471 3357 #ifdef CPP_RRTM 3358 #ifndef CPP_StratAer 3359 !--prescribed strat aerosols 3360 !--only in the case of non-interactive strat aerosols 3472 3361 IF (flag_aerosol_strat.EQ.1) THEN 3473 3362 CALL readaerosolstrato1_rrtm(debut) … … 3479 3368 CALL abort_physic(modname,abort_message,1) 3480 3369 ENDIF 3370 #endif 3481 3371 #else 3482 3372 abort_message='You should compile with -rrtm if running ' & … … 3486 3376 ENDIF 3487 3377 ENDIF 3378 ! 3379 #ifdef CPP_RRTM 3380 #ifdef CPP_StratAer 3381 !--compute stratospheric mask 3382 CALL stratosphere_mask(t_seri, pplay, latitude_deg) 3383 !--interactive strat aerosols 3384 CALL calcaerosolstrato_rrtm(pplay,t_seri,paprs,debut) 3385 #endif 3386 #endif 3488 3387 !--fin STRAT AEROSOL 3489 3388 ! … … 3495 3394 mass_solu_aero(:,:) = ccm(:,:,1) 3496 3395 mass_solu_aero_pi(:,:) = ccm(:,:,2) 3497 END 3396 ENDIF 3498 3397 3499 3398 IF (ok_newmicro) then … … 3604 3503 ENDIF 3605 3504 3606 if (mydebug) then3607 callwritefield_phy('u_seri',u_seri,nbp_lev)3608 callwritefield_phy('v_seri',v_seri,nbp_lev)3609 callwritefield_phy('t_seri',t_seri,nbp_lev)3610 callwritefield_phy('q_seri',q_seri,nbp_lev)3611 endif3505 IF (mydebug) THEN 3506 CALL writefield_phy('u_seri',u_seri,nbp_lev) 3507 CALL writefield_phy('v_seri',v_seri,nbp_lev) 3508 CALL writefield_phy('t_seri',t_seri,nbp_lev) 3509 CALL writefield_phy('q_seri',q_seri,nbp_lev) 3510 ENDIF 3612 3511 3613 3512 ! … … 3617 3516 IF (iflag_radia .ge. 2) THEN 3618 3517 zsav_tsol (:) = zxtsol(:) 3619 callperturb_radlwsw(zxtsol,iflag_radia)3518 CALL perturb_radlwsw(zxtsol,iflag_radia) 3620 3519 ENDIF 3621 3520 … … 3625 3524 (kdlon,kflev,dist, rmu0, fract, solaire, & 3626 3525 paprs, pplay,zxtsol,albsol1, albsol2, t_seri,q_seri, & 3627 wo(:, :, 1), &3526 size(wo,3), wo, & 3628 3527 cldfrarad, cldemirad, cldtaurad, & 3629 3528 heat,heat0,cool,cool0,albpla, & … … 3693 3592 ZSWFT0_i, ZFSDN0, ZFSUP0) 3694 3593 3695 !--OB 30/05/2016 3594 #ifndef CPP_XIOS 3595 !--OB 30/05/2016 modified 21/10/2016 3696 3596 !--here we return swaero_diag to FALSE 3697 3597 !--and histdef will switch it back to TRUE if necessary 3698 3598 !--this is necessary to get the right swaero at first step 3599 !--but only in the case of no XIOS as XIOS is covered elsewhere 3699 3600 IF (debut) swaero_diag = .FALSE. 3601 #endif 3700 3602 ! 3701 3603 !IM 2eme calcul radiatif pour le cas perturbe ou au moins un … … 3703 3605 !IM Par defaut on a les taux perturbes egaux aux taux actuels 3704 3606 ! 3705 if (ok_4xCO2atm) then3706 if (RCO2_per.NE.RCO2_act.OR.RCH4_per.NE.RCH4_act.OR.&3707 3708 3607 IF (ok_4xCO2atm) THEN 3608 IF (RCO2_per.NE.RCO2_act.OR.RCH4_per.NE.RCH4_act.OR. & 3609 RN2O_per.NE.RN2O_act.OR.RCFC11_per.NE.RCFC11_act.OR. & 3610 RCFC12_per.NE.RCFC12_act) THEN 3709 3611 ! 3710 3612 RCO2 = RCO2_per … … 3774 3676 PRINT *,'>>>> heat et cool mis a zero ' 3775 3677 PRINT *,'--------------------------------------------------' 3776 END 3678 ENDIF 3777 3679 heat=0. 3778 3680 cool=0. … … 3786 3688 lwdn=0. 3787 3689 lwdn0=0. 3788 END 3690 ENDIF 3789 3691 3790 3692 ! … … 3795 3697 radsol=solsw*swradcorr+sollw 3796 3698 3797 if (ok_4xCO2atm) then3699 IF (ok_4xCO2atm) THEN 3798 3700 radsolp=solswp*swradcorr+sollwp 3799 endif3701 ENDIF 3800 3702 3801 3703 ! … … 3815 3717 3816 3718 ! 3817 if (mydebug) then 3818 call writefield_phy('u_seri',u_seri,nbp_lev) 3819 call writefield_phy('v_seri',v_seri,nbp_lev) 3820 call writefield_phy('t_seri',t_seri,nbp_lev) 3821 call writefield_phy('q_seri',q_seri,nbp_lev) 3822 endif 3823 3824 !IM 3825 IF (ip_ebil_phy.ge.2) THEN 3826 ztit='after rad' 3827 CALL diagetpq(cell_area,ztit,ip_ebil_phy,2,2,dtime & 3828 , t_seri,q_seri,ql_seri,qs_seri,u_seri,v_seri,paprs,pplay & 3829 , d_h_vcol, d_qt, d_qw, d_ql, d_qs, d_ec) 3830 call diagphy(cell_area,ztit,ip_ebil_phy & 3831 , topsw, toplw, solsw, sollw, zero_v & 3832 , zero_v, zero_v, zero_v, ztsol & 3833 , d_h_vcol, d_qt, d_ec & 3834 , fs_bound, fq_bound ) 3835 END IF 3836 ! 3837 ! 3719 IF (mydebug) THEN 3720 CALL writefield_phy('u_seri',u_seri,nbp_lev) 3721 CALL writefield_phy('v_seri',v_seri,nbp_lev) 3722 CALL writefield_phy('t_seri',t_seri,nbp_lev) 3723 CALL writefield_phy('q_seri',q_seri,nbp_lev) 3724 ENDIF 3725 3838 3726 ! Calculer l'hydrologie de la surface 3839 3727 ! … … 3901 3789 ENDIF ! fin de test sur ok_orodr 3902 3790 ! 3903 if (mydebug) then3904 callwritefield_phy('u_seri',u_seri,nbp_lev)3905 callwritefield_phy('v_seri',v_seri,nbp_lev)3906 callwritefield_phy('t_seri',t_seri,nbp_lev)3907 callwritefield_phy('q_seri',q_seri,nbp_lev)3908 endif3791 IF (mydebug) THEN 3792 CALL writefield_phy('u_seri',u_seri,nbp_lev) 3793 CALL writefield_phy('v_seri',v_seri,nbp_lev) 3794 CALL writefield_phy('t_seri',t_seri,nbp_lev) 3795 CALL writefield_phy('q_seri',q_seri,nbp_lev) 3796 ENDIF 3909 3797 3910 3798 IF (ok_orolf) THEN … … 3985 3873 ENDIF 3986 3874 3987 if (ok_gwd_rando) then3988 callFLOTT_GWD_rando(DTIME, pplay, t_seri, u_seri, v_seri, &3875 IF (ok_gwd_rando) THEN 3876 CALL FLOTT_GWD_rando(DTIME, pplay, t_seri, u_seri, v_seri, & 3989 3877 rain_fall + snow_fall, zustr_gwd_rando, zvstr_gwd_rando, & 3990 3878 du_gwd_rando, dv_gwd_rando, east_gwstress, west_gwstress) … … 3999 3887 * (paprs(:, k)-paprs(:, k+1))/rg 4000 3888 ENDDO 4001 end if3889 ENDIF 4002 3890 4003 3891 ! STRESS NECESSAIRES: TOUTE LA PHYSIQUE 4004 3892 4005 if (mydebug) then4006 callwritefield_phy('u_seri',u_seri,nbp_lev)4007 callwritefield_phy('v_seri',v_seri,nbp_lev)4008 callwritefield_phy('t_seri',t_seri,nbp_lev)4009 callwritefield_phy('q_seri',q_seri,nbp_lev)4010 endif3893 IF (mydebug) THEN 3894 CALL writefield_phy('u_seri',u_seri,nbp_lev) 3895 CALL writefield_phy('v_seri',v_seri,nbp_lev) 3896 CALL writefield_phy('t_seri',t_seri,nbp_lev) 3897 CALL writefield_phy('q_seri',q_seri,nbp_lev) 3898 ENDIF 4011 3899 4012 3900 DO i = 1, klon … … 4035 3923 ENDIF 4036 3924 !IM cf. FLott END 4037 !IM4038 IF (ip_ebil_phy.ge.2) THEN4039 ztit='after orography'4040 CALL diagetpq(cell_area,ztit,ip_ebil_phy,2,2,dtime &4041 , t_seri,q_seri,ql_seri,qs_seri,u_seri,v_seri,paprs,pplay &4042 , d_h_vcol, d_qt, d_qw, d_ql, d_qs, d_ec)4043 call diagphy(cell_area,ztit,ip_ebil_phy &4044 , zero_v, zero_v, zero_v, zero_v, zero_v &4045 , zero_v, zero_v, zero_v, ztsol &4046 , d_h_vcol, d_qt, d_ec &4047 , fs_bound, fq_bound )4048 END IF4049 4050 3925 !DC Calcul de la tendance due au methane 4051 3926 IF(ok_qch4) THEN … … 4054 3929 CALL add_phys_tend(du0, dv0, dt0, d_q_ch4*dtime, dql0, dqi0, paprs, & 4055 3930 'q_ch4', abortphy,flag_inhib_tend) 4056 END 3931 ENDIF 4057 3932 ! 4058 3933 ! … … 4073 3948 ! print*,'Dans physiq.F avant appel cosp ref_liq,ref_ice=', 4074 3949 ! s ref_liq,ref_ice 4075 callphys_cosp(itap,dtime,freq_cosp, &3950 CALL phys_cosp(itap,dtime,freq_cosp, & 4076 3951 ok_mensuelCOSP,ok_journeCOSP,ok_hfCOSP, & 4077 3952 ecrit_mth,ecrit_day,ecrit_hf, ok_all_xml, & … … 4103 3978 4104 3979 IF (itap.eq.1.or.MOD(itap,NINT(freq_airs/dtime)).EQ.0) THEN 4105 write(*,*) 'je vais appeler simu_airs, ok_airs, freq_airs=', & 4106 & ok_airs, freq_airs 4107 call simu_airs(itap,rneb, t_seri, cldemi, fiwc, ref_ice, pphi, pplay, paprs,& 4108 & map_prop_hc,map_prop_hist,& 4109 & map_emis_hc,map_iwp_hc,map_deltaz_hc,map_pcld_hc,map_tcld_hc,& 4110 & map_emis_Cb,map_pcld_Cb,map_tcld_Cb,& 4111 & map_emis_ThCi,map_pcld_ThCi,map_tcld_ThCi,& 4112 & map_emis_Anv,map_pcld_Anv,map_tcld_Anv,& 4113 & map_emis_hist,map_iwp_hist,map_deltaz_hist,map_rad_hist,& 4114 & map_ntot,map_hc,map_hist,& 4115 & map_Cb,map_ThCi,map_Anv,& 4116 & alt_tropo ) 3980 write(*,*) 'je vais appeler simu_airs, ok_airs, freq_airs=', ok_airs, freq_airs 3981 CALL simu_airs(itap,rneb, t_seri, cldemi, fiwc, ref_ice, pphi, pplay, paprs,& 3982 & map_prop_hc,map_prop_hist,& 3983 & map_emis_hc,map_iwp_hc,map_deltaz_hc,map_pcld_hc,map_tcld_hc,& 3984 & map_emis_Cb,map_pcld_Cb,map_tcld_Cb,& 3985 & map_emis_ThCi,map_pcld_ThCi,map_tcld_ThCi,& 3986 & map_emis_Anv,map_pcld_Anv,map_tcld_Anv,& 3987 & map_emis_hist,map_iwp_hist,map_deltaz_hist,map_rad_hist,& 3988 & map_ntot,map_hc,map_hist,& 3989 & map_Cb,map_ThCi,map_Anv,& 3990 & alt_tropo ) 4117 3991 ENDIF 4118 3992 … … 4133 4007 ELSE 4134 4008 sh_in(:,:) = qx(:,:,ivap) 4135 END 4009 ENDIF 4136 4010 4137 4011 #ifdef CPP_Dust … … 4153 4027 #else 4154 4028 4155 callphytrac ( &4029 CALL phytrac ( & 4156 4030 itap, days_elapsed+1, jH_cur, debut, & 4157 4031 lafin, dtime, u, v, t, & … … 4183 4057 IF (prt_level.ge.9) & 4184 4058 print*,'Attention on met a 0 les thermiques pour phystoke' 4185 callphystokenc ( &4059 CALL phystokenc ( & 4186 4060 nlon,klev,pdtphys,longitude_deg,latitude_deg, & 4187 4061 t,pmfu, pmfd, pen_u, pde_u, pen_d, pde_d, & … … 4226 4100 t_seri(:,:)=t_seri(:,:)+d_t_ec(:,:) 4227 4101 4228 !IM4229 IF (ip_ebil_phy.ge.1) THEN4230 ztit='after physic'4231 CALL diagetpq(cell_area,ztit,ip_ebil_phy,1,1,dtime &4232 , t_seri,q_seri,ql_seri,qs_seri,u_seri,v_seri,paprs,pplay &4233 , d_h_vcol, d_qt, d_qw, d_ql, d_qs, d_ec)4234 ! Comme les tendances de la physique sont ajoute dans la dynamique,4235 ! on devrait avoir que la variation d'entalpie par la dynamique4236 ! est egale a la variation de la physique au pas de temps precedent.4237 ! Donc la somme de ces 2 variations devrait etre nulle.4238 4239 call diagphy(cell_area,ztit,ip_ebil_phy &4240 , topsw, toplw, solsw, sollw, sens &4241 , evap, rain_fall, snow_fall, ztsol &4242 , d_h_vcol, d_qt, d_ec &4243 , fs_bound, fq_bound )4244 !4245 d_h_vcol_phy=d_h_vcol4246 !4247 END IF4248 !4249 4102 !======================================================================= 4250 4103 ! SORTIES … … 4308 4161 CALL VTb(VTphysiq) 4309 4162 #endif 4310 END 4163 ENDIF 4311 4164 4312 4165 … … 4318 4171 ENDIF 4319 4172 ! 4320 if (mydebug) then4321 callwritefield_phy('u_seri',u_seri,nbp_lev)4322 callwritefield_phy('v_seri',v_seri,nbp_lev)4323 callwritefield_phy('t_seri',t_seri,nbp_lev)4324 callwritefield_phy('q_seri',q_seri,nbp_lev)4325 endif4173 IF (mydebug) THEN 4174 CALL writefield_phy('u_seri',u_seri,nbp_lev) 4175 CALL writefield_phy('v_seri',v_seri,nbp_lev) 4176 CALL writefield_phy('t_seri',t_seri,nbp_lev) 4177 CALL writefield_phy('q_seri',q_seri,nbp_lev) 4178 ENDIF 4326 4179 4327 4180 DO k = 1, klev … … 4333 4186 d_qx(i,k,iliq) = ( ql_seri(i,k) - qx(i,k,iliq) ) / dtime 4334 4187 !CR: on ajoute le contenu en glace 4335 if (nqo.eq.3) then4188 IF (nqo.eq.3) THEN 4336 4189 d_qx(i,k,isol) = ( qs_seri(i,k) - qx(i,k,isol) ) / dtime 4337 endif4190 ENDIF 4338 4191 ENDDO 4339 4192 ENDDO … … 4402 4255 !========================================================================== 4403 4256 4404 if (prt_level.ge.1) then4257 IF (prt_level.ge.1) THEN 4405 4258 write(lunout,*) 'FIN DE PHYSIQ !!!!!!!!!!!!!!!!!!!!' 4406 4259 write(lunout,*) & … … 4411 4264 pctsrf(igout,is_sic) 4412 4265 write(lunout,*) 'd_t_dyn,d_t_con,d_t_lsc,d_t_ajsb,d_t_ajs,d_t_eva' 4413 dok=1,klev4266 DO k=1,klev 4414 4267 write(lunout,*) d_t_dyn(igout,k),d_t_con(igout,k), & 4415 4268 d_t_lsc(igout,k),d_t_ajsb(igout,k),d_t_ajs(igout,k), & 4416 4269 d_t_eva(igout,k) 4417 enddo4270 ENDDO 4418 4271 write(lunout,*) 'cool,heat' 4419 dok=1,klev4272 DO k=1,klev 4420 4273 write(lunout,*) cool(igout,k),heat(igout,k) 4421 enddo4274 ENDDO 4422 4275 4423 4276 !jyg< (En attendant de statuer sur le sort de d_t_oli) … … 4428 4281 !jyg! enddo 4429 4282 write(lunout,*) 'd_t_vdf,d_t_oro,d_t_lif,d_t_ec' 4430 dok=1,klev4283 DO k=1,klev 4431 4284 write(lunout,*) d_t_vdf(igout,k), & 4432 4285 d_t_oro(igout,k),d_t_lif(igout,k),d_t_ec(igout,k) 4433 enddo4286 ENDDO 4434 4287 !>jyg 4435 4288 4436 4289 write(lunout,*) 'd_ps ',d_ps(igout) 4437 4290 write(lunout,*) 'd_u, d_v, d_t, d_qx1, d_qx2 ' 4438 dok=1,klev4291 DO k=1,klev 4439 4292 write(lunout,*) d_u(igout,k),d_v(igout,k),d_t(igout,k), & 4440 4293 d_qx(igout,k,1),d_qx(igout,k,2) 4441 enddo 4442 endif 4443 4444 !========================================================================== 4294 ENDDO 4295 ENDIF 4445 4296 4446 4297 !============================================================ … … 4483 4334 !============================================================= 4484 4335 4485 if (iflag_thermals>=1) then4336 IF (iflag_thermals>=1) THEN 4486 4337 d_t_lscth=0. 4487 4338 d_t_lscst=0. 4488 4339 d_q_lscth=0. 4489 4340 d_q_lscst=0. 4490 dok=1,klev4491 doi=1,klon4492 if (ptconvth(i,k)) then4341 DO k=1,klev 4342 DO i=1,klon 4343 IF (ptconvth(i,k)) THEN 4493 4344 d_t_lscth(i,k)=d_t_eva(i,k)+d_t_lsc(i,k) 4494 4345 d_q_lscth(i,k)=d_q_eva(i,k)+d_q_lsc(i,k) 4495 else4346 ELSE 4496 4347 d_t_lscst(i,k)=d_t_eva(i,k)+d_t_lsc(i,k) 4497 4348 d_q_lscst(i,k)=d_q_eva(i,k)+d_q_lsc(i,k) 4498 endif4499 enddo4500 enddo4501 4502 doi=1,klon4349 ENDIF 4350 ENDDO 4351 ENDDO 4352 4353 DO i=1,klon 4503 4354 plul_st(i)=prfl(i,lmax_th(i)+1)+psfl(i,lmax_th(i)+1) 4504 4355 plul_th(i)=prfl(i,1)+psfl(i,1) 4505 enddo 4506 endif 4507 4356 ENDDO 4357 ENDIF 4508 4358 4509 4359 !On effectue les sorties: … … 4521 4371 ok_ade, ok_aie, ivap, iliq, isol, new_aod, & 4522 4372 ok_sync, ptconv, read_climoz, clevSTD, & 4523 ptconvth, d_ t, qx, d_qx, zmasse,&4373 ptconvth, d_u, d_t, qx, d_qx, zmasse, & 4524 4374 flag_aerosol, flag_aerosol_strat, ok_cdnc) 4525 4375 #endif 4526 4527 4376 4528 4377 #ifndef CPP_XIOS … … 4557 4406 ! close(97) 4558 4407 !$OMP MASTER 4559 if (read_climoz >= 1) then4560 if (is_mpi_root) then4561 callnf95_close(ncid_climoz)4562 end if4563 deallocate(press_climoz) ! pointer4564 end if4408 IF (read_climoz >= 1) THEN 4409 IF (is_mpi_root) THEN 4410 CALL nf95_close(ncid_climoz) 4411 ENDIF 4412 DEALLOCATE(press_climoz) ! pointer 4413 ENDIF 4565 4414 !$OMP END MASTER 4566 4415 ENDIF -
LMDZ5/branches/testing/libf/phylmd/phytrac_mod.F90
r2641 r2720 97 97 USE tracreprobus_mod 98 98 USE indice_sol_mod 99 100 99 USE mod_phys_lmdz_mpi_data, ONLY : is_mpi_root 101 100 USE print_control_mod, ONLY: lunout 102 101 USE aero_mod, ONLY : naero_grp 102 103 #ifdef CPP_StratAer 104 USE traccoag_mod 105 USE phys_local_var_mod, ONLY: mdw, sulf_dep_dry, sulf_dep_wet 106 USE infotrac, ONLY: nbtr_sulgas, id_SO2_strat, id_H2SO4_strat 107 USE aerophys 108 #endif 103 109 104 110 IMPLICIT NONE … … 208 214 !-------------- 209 215 ! 210 !211 216 REAL,DIMENSION(:),INTENT(IN) :: cdragh ! (klon) coeff drag pour T et Q 212 217 REAL,DIMENSION(:,:),INTENT(IN) :: coefh ! (klon,klev) coeff melange CL (m**2/s) … … 215 220 REAL,DIMENSION(:),INTENT(IN) :: yu1 ! (klon) vents au premier niveau 216 221 REAL,DIMENSION(:),INTENT(IN) :: yv1 ! (klon) vents au premier niveau 217 218 222 ! 219 223 !Lessivage: … … 238 242 REAL,DIMENSION(klon,nbsrf),INTENT(IN) :: pctsrf ! Pourcentage de sol (nature du sol) 239 243 240 244 #ifdef CPP_StratAer 245 REAL,DIMENSION(klon) :: v_dep_dry !dry deposition velocity of stratospheric sulfate in m/s 246 #endif 241 247 ! Output argument 242 248 !---------------- 243 249 REAL,DIMENSION(klon,klev,nbtr),INTENT(INOUT) :: tr_seri ! Concentration Traceur [U/KgA] 244 250 REAL,DIMENSION(klon,klev) :: sourceBE 251 245 252 !======================================================================================= 246 253 ! -- LOCAL VARIABLES -- … … 267 274 INTEGER :: itau_w ! pas de temps ecriture = nstep + itau_phy 268 275 LOGICAL,PARAMETER :: ok_sync=.TRUE. 269 270 276 ! 271 277 ! Nature du traceur … … 369 375 END DO 370 376 377 DO it=1, nbtr 378 DO i=1,klon 379 d_tr_dry(i,it)=0. 380 flux_tr_dry(i,it)=0. 381 END DO 382 END DO 383 371 384 DO k = 1, klev 372 385 DO i = 1, klon … … 456 469 CASE('repr') 457 470 source(:,:)=0. 471 #ifdef CPP_StratAer 472 CASE('coag') 473 source(:,:)=0. 474 DO it= 1, nbtr_sulgas 475 aerosol(it)=.FALSE. 476 IF (it==id_H2SO4_strat) aerosol(it)=.TRUE. 477 ENDDO 478 DO it= nbtr_sulgas+1, nbtr 479 aerosol(it)=.TRUE. 480 ENDDO 481 #endif 458 482 END SELECT 459 483 … … 504 528 !--for now we do not scavenge in cvltr 505 529 flag_cvltr(it)=.false. 530 531 #ifdef CPP_StratAer 532 CASE('coag') 533 IF (convscav.and.aerosol(it)) THEN 534 flag_cvltr(it)=.true. 535 ccntrAA(it) =ccntrAA_in 536 ccntrENV(it)=ccntrENV_in 537 coefcoli(it)=coefcoli_in 538 ELSE 539 flag_cvltr(it)=.false. 540 ENDIF 541 #endif 542 506 543 END SELECT 507 544 ENDDO … … 572 609 ! Appel fait en fin de phytrac pour avoir les emissions modifiees par 573 610 ! la couche limite et la convection avant le calcul de la chimie 611 574 612 CASE('repr') 575 613 ! -- CHIMIE REPROBUS -- 576 577 614 CALL tracreprobus(pdtphys, gmtime, debutphy, julien, & 578 615 presnivs, xlat, xlon, pphis, pphi, & … … 580 617 tr_seri) 581 618 619 #ifdef CPP_StratAer 620 CASE('coag') 621 ! --STRATOSPHERIC AER IN THE STRAT -- 622 CALL traccoag(pdtphys, gmtime, debutphy, julien, & 623 presnivs, xlat, xlon, pphis, pphi, & 624 t_seri, pplay, paprs, sh, rh , & 625 tr_seri) 626 #endif 627 582 628 END SELECT 583 629 !====================================================================== … … 591 637 IF (iflag_con.LT.2) THEN 592 638 !--pas de transport convectif 593 594 639 d_tr_cv(:,:,it)=0. 640 595 641 ELSE IF (iflag_con.EQ.2) THEN 596 642 !--ancien transport convectif de Tiedtke … … 648 694 649 695 END DO ! nbtr 696 697 #ifdef CPP_StratAer 698 IF (type_trac=='coag') THEN 699 ! initialize wet deposition flux of sulfur 700 sulf_dep_wet(:)=0.0 701 ! compute wet deposition flux of sulfur (sum over gases and particles) 702 ! and convert to kg(S)/m2/s 703 DO i = 1, klon 704 DO k = 1, klev 705 DO it = 1, nbtr 706 !do not include SO2 because most of it comes trom the troposphere 707 IF (it==id_H2SO4_strat) THEN 708 sulf_dep_wet(i)=sulf_dep_wet(i)+d_tr_cv(i,k,it)*(mSatom/mH2SO4mol) & 709 & *(paprs(i,k)-paprs(i,k+1))/RG/pdtphys 710 ELSEIF (it.GT.nbtr_sulgas) THEN 711 sulf_dep_wet(i)=sulf_dep_wet(i)+d_tr_cv(i,k,it)*(mSatom/mH2SO4mol) & 712 & *dens_aer_dry*4./3.*RPI*(mdw(it-nbtr_sulgas)/2.)**3 & 713 & *(paprs(i,k)-paprs(i,k+1))/RG/pdtphys 714 ENDIF 715 ENDDO 716 ENDDO 717 ENDDO 718 ENDIF 719 #endif 650 720 651 721 END IF ! convection … … 692 762 ! Injection during BL mixing 693 763 ! 764 #ifdef CPP_StratAer 765 IF (type_trac=='coag') THEN 766 767 ! initialize dry deposition flux of sulfur 768 sulf_dep_dry(:)=0.0 769 770 ! compute dry deposition velocity as function of surface type (numbers 771 ! from IPSL note 23, 2002) 772 v_dep_dry(:) = pctsrf(:,is_ter) * 2.5e-3 & 773 & + pctsrf(:,is_oce) * 0.5e-3 & 774 & + pctsrf(:,is_lic) * 2.5e-3 & 775 & + pctsrf(:,is_sic) * 2.5e-3 776 777 ! compute surface dry deposition flux 778 zrho(:,1)=pplay(:,1)/t_seri(:,1)/RD 779 780 DO it=1, nbtr 781 source(:,it) = - v_dep_dry(:) * tr_seri(:,1,it) * zrho(:,1) 782 ENDDO 783 784 ENDIF 785 #endif 786 694 787 DO it=1, nbtr 695 788 ! … … 703 796 tr_seri(:,:,it)=tr_seri(:,:,it)+d_tr_cl(:,:,it) 704 797 ! 705 END IF 798 #ifdef CPP_StratAer 799 IF (type_trac=='coag') THEN 800 ! compute dry deposition flux of sulfur (sum over gases and particles) 801 IF (it==id_H2SO4_strat) THEN 802 sulf_dep_dry(:)=sulf_dep_dry(:)-source(:,it)*(mSatom/mH2SO4mol) 803 ELSEIF (it.GT.nbtr_sulgas) THEN 804 sulf_dep_dry(:)=sulf_dep_dry(:)-source(:,it)*(mSatom/mH2SO4mol)*dens_aer_dry & 805 & *4./3.*RPI*(mdw(it-nbtr_sulgas)/2.)**3 806 ENDIF 807 ENDIF 808 #endif 809 ! 810 ENDIF 706 811 ! 707 END 812 ENDDO 708 813 ! 709 814 ELSE IF (iflag_vdf_trac==0) THEN … … 720 825 ! 721 826 ! Nothing happens 722 !723 827 d_tr_cl=0. 724 828 ! … … 772 876 773 877 END DO !tr 878 879 #ifdef CPP_StratAer 880 IF (type_trac=='coag') THEN 881 ! compute wet deposition flux of sulfur (sum over gases and 882 ! particles) and convert to kg(S)/m2/s 883 ! adding contribution of d_tr_ls to d_tr_cv (above) 884 DO i = 1, klon 885 DO k = 1, klev 886 DO it = 1, nbtr 887 IF (it==id_H2SO4_strat) THEN 888 sulf_dep_wet(i)=sulf_dep_wet(i)+d_tr_ls(i,k,it)*(mSatom/mH2SO4mol) & 889 & *(paprs(i,k)-paprs(i,k+1))/RG/pdtphys 890 ELSEIF (it.GT.nbtr_sulgas) THEN 891 sulf_dep_wet(i)=sulf_dep_wet(i)+d_tr_ls(i,k,it)*(mSatom/mH2SO4mol) & 892 & *dens_aer_dry*4./3.*RPI*(mdw(it-nbtr_sulgas)/2.)**3 & 893 & *(paprs(i,k)-paprs(i,k+1))/RG/pdtphys 894 ENDIF 895 ENDDO 896 ENDDO 897 ENDDO 898 ENDIF 899 #endif 774 900 775 901 ELSE IF (iflag_lscav .EQ. 2) THEN ! frac_impa, frac_nucl -
LMDZ5/branches/testing/libf/phylmd/rrtm/readaerosol_optic_rrtm.F90
r2669 r2720 20 20 21 21 USE infotrac_phy 22 USE YOMCST 22 23 23 24 IMPLICIT NONE 25 24 26 include "clesphys.h" 25 include "YOMCST.h"26 27 27 28 28 ! Input arguments … … 104 104 !--convert to ug m-3 unit for consistency with offline fields 105 105 ! 106 doi=1,nbtr107 select case(trim(solsym(i)))108 case("ASBCM")106 DO i=1,nbtr 107 SELECT CASE(trim(solsym(i))) 108 CASE ("ASBCM") 109 109 id_ASBCM = i 110 case("ASPOMM")110 CASE ("ASPOMM") 111 111 id_ASPOMM = i 112 case("ASSO4M")112 CASE ("ASSO4M") 113 113 id_ASSO4M = i 114 case("ASMSAM")114 CASE ("ASMSAM") 115 115 id_ASMSAM = i 116 case("CSSO4M")116 CASE ("CSSO4M") 117 117 id_CSSO4M = i 118 case("CSMSAM")118 CASE ("CSMSAM") 119 119 id_CSMSAM = i 120 case("SSSSM")120 CASE ("SSSSM") 121 121 id_SSSSM = i 122 case("CSSSM")122 CASE ("CSSSM") 123 123 id_CSSSM = i 124 case("ASSSM")124 CASE ("ASSSM") 125 125 id_ASSSM = i 126 case("CIDUSTM")126 CASE ("CIDUSTM") 127 127 id_CIDUSTM = i 128 case("AIBCM")128 CASE ("AIBCM") 129 129 id_AIBCM = i 130 case("AIPOMM")130 CASE ("AIPOMM") 131 131 id_AIPOMM = i 132 case("ASNO3M")132 CASE ("ASNO3M") 133 133 id_ASNO3M = i 134 case("CSNO3M")134 CASE ("CSNO3M") 135 135 id_CSNO3M = i 136 case("CINO3M")136 CASE ("CINO3M") 137 137 id_CINO3M = i 138 end select 139 enddo 140 138 END SELECT 139 ENDDO 141 140 142 141 bcsol(:,:) = tr_seri(:,:,id_ASBCM) *zrho(:,:)*1.e9 ! ASBCM … … 171 170 ! 172 171 ! Read and interpolate sulfate 173 IF ( flag_aerosol .EQ. 1 .OR. & 174 flag_aerosol .EQ. 6 ) THEN 172 IF ( flag_aerosol .EQ. 1 .OR. flag_aerosol .EQ. 6 ) THEN 175 173 176 174 CALL readaerosol_interp(id_ASSO4M_phy, itap, pdtphys, rjourvrai, debut, pplay, paprs, t_seri, sulfacc, sulfacc_pi,loadso4) … … 178 176 sulfacc(:,:) = 0. ; sulfacc_pi(:,:) = 0. 179 177 loadso4=0. 180 END 178 ENDIF 181 179 182 180 ! Read and interpolate bcsol and bcins 183 IF ( flag_aerosol .EQ. 2 .OR. & 184 flag_aerosol .EQ. 6 ) THEN 181 IF ( flag_aerosol .EQ. 2 .OR. flag_aerosol .EQ. 6 ) THEN 185 182 186 183 ! Get bc aerosol distribution … … 192 189 bcins(:,:) = 0. ; bcins_pi(:,:) = 0. 193 190 loadbc=0. 194 END IF 195 191 ENDIF 196 192 197 193 ! Read and interpolate pomsol and pomins 198 IF ( flag_aerosol .EQ. 3 .OR. & 199 flag_aerosol .EQ. 6 ) THEN 194 IF ( flag_aerosol .EQ. 3 .OR. flag_aerosol .EQ. 6 ) THEN 200 195 201 196 CALL readaerosol_interp(id_ASPOMM_phy, itap, pdtphys, rjourvrai, debut, pplay, paprs, t_seri, pomsol, pomsol_pi, load_tmp3) … … 206 201 pomins(:,:) = 0. ; pomins_pi(:,:) = 0. 207 202 loadoa=0. 208 END IF 209 203 ENDIF 210 204 211 205 ! Read and interpolate csssm, ssssm, assssm 212 IF (flag_aerosol .EQ. 4 .OR. & 213 flag_aerosol .EQ. 6 ) THEN 206 IF (flag_aerosol .EQ. 4 .OR. flag_aerosol .EQ. 6 ) THEN 214 207 215 208 CALL readaerosol_interp(id_SSSSM_phy ,itap, pdtphys,rjourvrai, & … … 228 221 229 222 ! Read and interpolate cidustm 230 IF (flag_aerosol .EQ. 5 .OR. & 231 flag_aerosol .EQ. 6 ) THEN 223 IF (flag_aerosol .EQ. 5 .OR. flag_aerosol .EQ. 6 ) THEN 232 224 233 225 CALL readaerosol_interp(id_CIDUSTM_phy, itap, pdtphys, rjourvrai, debut, pplay, paprs, t_seri, cidust, cidust_pi, loaddust) … … 299 291 DO i = 1, klon 300 292 pdel(i,k) = paprs(i,k) - paprs (i,k+1) 301 END 302 END 293 ENDDO 294 ENDDO 303 295 304 296 !--new aerosol properties -
LMDZ5/branches/testing/libf/phylmd/rrtm/readaerosolstrato1_rrtm.F90
r2594 r2720 2 2 ! $Id: readaerosolstrato1_rrtm.F90 2526 2016-05-26 22:13:40Z oboucher $ 3 3 ! 4 subroutinereadaerosolstrato1_rrtm(debut)5 6 use netcdf95, only: nf95_close, nf95_gw_var, nf95_inq_dimid, &4 SUBROUTINE readaerosolstrato1_rrtm(debut) 5 6 USE netcdf95, ONLY: nf95_close, nf95_gw_var, nf95_inq_dimid, & 7 7 nf95_inq_varid, nf95_open 8 use netcdf, only: nf90_get_var, nf90_noerr, nf90_nowrite8 USE netcdf, ONLY: nf90_get_var, nf90_noerr, nf90_nowrite 9 9 10 10 USE phys_cal_mod, ONLY : mth_cur … … 17 17 USE aero_mod 18 18 USE dimphy 19 USE YOERAD , ONLY : NLW 20 21 implicit none 22 23 include "YOMCST.h" 19 USE YOERAD, ONLY : NLW 20 USE YOMCST 21 22 IMPLICIT NONE 24 23 25 24 ! Variable input 26 logicaldebut25 LOGICAL debut 27 26 28 27 ! Variables locales 29 integern_lat ! number of latitudes in the input data30 integern_lon ! number of longitudes in the input data31 integern_lev ! number of levels in the input data32 integern_month ! number of months in the input data33 real, pointer:: latitude(:)34 real, pointer:: longitude(:)35 real, pointer:: time(:)36 real, pointer:: lev(:)37 integerk, band, wave, i38 integer, save:: mth_pre39 40 real, allocatable, dimension(:,:), save:: tau_aer_strat28 INTEGER n_lat ! number of latitudes in the input data 29 INTEGER n_lon ! number of longitudes in the input data 30 INTEGER n_lev ! number of levels in the input data 31 INTEGER n_month ! number of months in the input data 32 REAL, POINTER:: latitude(:) 33 REAL, POINTER:: longitude(:) 34 REAL, POINTER:: time(:) 35 REAL, POINTER:: lev(:) 36 INTEGER k, band, wave, i 37 INTEGER, SAVE :: mth_pre 38 39 REAL, ALLOCATABLE, DIMENSION(:,:), SAVE :: tau_aer_strat 41 40 !$OMP THREADPRIVATE(tau_aer_strat) 42 41 43 42 ! Champs reconstitues 44 real, allocatable:: tauaerstrat(:, :, :, :)45 real, allocatable:: tauaerstrat_mois(:, :, :)46 real, allocatable:: tauaerstrat_mois_glo(:, :)47 48 real, allocatable:: sum_tau_aer_strat(:)43 REAL, ALLOCATABLE:: tauaerstrat(:, :, :, :) 44 REAL, ALLOCATABLE:: tauaerstrat_mois(:, :, :) 45 REAL, ALLOCATABLE:: tauaerstrat_mois_glo(:, :) 46 47 REAL, ALLOCATABLE:: sum_tau_aer_strat(:) 49 48 50 49 ! For NetCDF: 51 integerncid_in ! IDs for input files52 integervarid, ncerr50 INTEGER ncid_in ! IDs for input files 51 INTEGER varid, ncerr 53 52 54 53 ! Stratospheric aerosols optical properties 55 54 ! alpha_sw_strat over the 6 bands is normalised by the 550 nm extinction coefficient 56 real, dimension(nbands_sw_rrtm) :: alpha_sw_strat, piz_sw_strat, cg_sw_strat57 dataalpha_sw_strat/0.8545564, 0.8451642, 0.9821724, 0.8145110, 0.3073565, 7.7966176E-02/58 datacg_sw_strat /0.6997170, 0.6810035, 0.7403592, 0.7562674, 0.6676504, 0.3478689/59 datapiz_sw_strat /0.9999998, 0.9999998, 1.000000000, 0.9999958, 0.9977155, 0.4510679/55 REAL, DIMENSION(nbands_sw_rrtm) :: alpha_sw_strat, piz_sw_strat, cg_sw_strat 56 DATA alpha_sw_strat/0.8545564, 0.8451642, 0.9821724, 0.8145110, 0.3073565, 7.7966176E-02/ 57 DATA cg_sw_strat /0.6997170, 0.6810035, 0.7403592, 0.7562674, 0.6676504, 0.3478689/ 58 DATA piz_sw_strat /0.9999998, 0.9999998, 1.000000000, 0.9999958, 0.9977155, 0.4510679/ 60 59 ! 61 60 !--diagnostics AOD in the SW 62 61 ! alpha_sw_strat_wave is *not* normalised by the 550 nm extinction coefficient 63 real, dimension(nwave_sw) :: alpha_sw_strat_wave64 dataalpha_sw_strat_wave/3.708007,4.125824,4.136584,3.887478,3.507738/62 REAL, DIMENSION(nwave_sw) :: alpha_sw_strat_wave 63 DATA alpha_sw_strat_wave/3.708007,4.125824,4.136584,3.887478,3.507738/ 65 64 ! 66 65 !--diagnostics AOD in the LW at 10 um (not normalised by the 550 nm ext coefficient 67 real:: alpha_lw_strat_wave(nwave_lw)68 dataalpha_lw_strat_wave/0.2746812/69 ! 70 real, dimension(nbands_lw_rrtm) :: alpha_lw_abs_rrtm71 dataalpha_lw_abs_rrtm/ 8.8340312E-02, 6.9856711E-02, 6.2652975E-02, 5.7188231E-02, &66 REAL :: alpha_lw_strat_wave(nwave_lw) 67 DATA alpha_lw_strat_wave/0.2746812/ 68 ! 69 REAL, DIMENSION(nbands_lw_rrtm) :: alpha_lw_abs_rrtm 70 DATA alpha_lw_abs_rrtm/ 8.8340312E-02, 6.9856711E-02, 6.2652975E-02, 5.7188231E-02, & 72 71 6.3157059E-02, 5.5072524E-02, 5.0571125E-02, 0.1349073, & 73 72 0.1381676, 9.6506312E-02, 5.1312990E-02, 2.4256418E-02, & … … 237 236 tau_aero_lw_rrtm = MAX(tau_aero_lw_rrtm,1.e-15) 238 237 239 end subroutinereadaerosolstrato1_rrtm238 END SUBROUTINE readaerosolstrato1_rrtm -
LMDZ5/branches/testing/libf/phylmd/rrtm/readaerosolstrato2_rrtm.F90
r2594 r2720 2 2 ! $Id: readaerosolstrato2_rrtm.F90 2526 2016-05-26 22:13:40Z oboucher $ 3 3 ! 4 subroutinereadaerosolstrato2_rrtm(debut)5 6 use netcdf95, only: nf95_close, nf95_gw_var, nf95_inq_dimid, &4 SUBROUTINE readaerosolstrato2_rrtm(debut) 5 6 USE netcdf95, ONLY: nf95_close, nf95_gw_var, nf95_inq_dimid, & 7 7 nf95_inq_varid, nf95_open 8 use netcdf, only: nf90_get_var, nf90_noerr, nf90_nowrite8 USE netcdf, ONLY: nf90_get_var, nf90_noerr, nf90_nowrite 9 9 10 10 USE phys_cal_mod, ONLY : mth_cur … … 17 17 USE aero_mod 18 18 USE dimphy 19 USE YOERAD 20 21 implicit none 22 23 include "YOMCST.h" 19 USE YOERAD, ONLY : NLW 20 USE YOMCST 21 22 IMPLICIT NONE 23 24 24 INCLUDE "clesphys.h" 25 25 … … 28 28 29 29 ! Variable input 30 logical, intent(in) :: debut30 LOGICAL, INTENT(IN) :: debut 31 31 32 32 ! Variables locales 33 integer n_lat ! number of latitudes in the input data 34 integer n_lon ! number of longitudes 35 integer n_lev ! number of levels in the input data 36 integer n_month ! number of months in the input data 37 integer n_wav ! number of wavelengths in the input data 38 real, pointer:: latitude(:) 39 real, pointer:: longitude(:) 40 real, pointer:: time(:) 41 real, pointer:: lev(:) 42 real, pointer:: wav(:) 43 integer i,k,wave,band 44 integer, save :: mth_pre 45 46 real, allocatable, dimension(:,:,:), save :: tau_aer_strat 47 real, allocatable, dimension(:,:,:), save :: piz_aer_strat 48 real, allocatable, dimension(:,:,:), save :: cg_aer_strat 49 real, allocatable, dimension(:,:,:), save :: taulw_aer_strat 33 INTEGER n_lat ! number of latitudes in the input data 34 INTEGER n_lon ! number of longitudes 35 INTEGER n_lev ! number of levels in the input data 36 INTEGER n_month ! number of months in the input data 37 INTEGER n_wav ! number of wavelengths in the input data 38 REAL, POINTER:: latitude(:) 39 REAL, POINTER:: time(:) 40 REAL, POINTER:: lev(:) 41 REAL, POINTER:: wav(:) 42 INTEGER i,k,wave,band 43 INTEGER, SAVE :: mth_pre 44 45 REAL, ALLOCATABLE, DIMENSION(:,:,:), SAVE :: tau_aer_strat 46 REAL, ALLOCATABLE, DIMENSION(:,:,:), SAVE :: piz_aer_strat 47 REAL, ALLOCATABLE, DIMENSION(:,:,:), SAVE :: cg_aer_strat 48 REAL, ALLOCATABLE, DIMENSION(:,:,:), SAVE :: taulw_aer_strat 50 49 !$OMP THREADPRIVATE(tau_aer_strat,piz_aer_strat,cg_aer_strat,taulw_aer_strat) 51 50 52 51 ! Champs reconstitues 53 real, allocatable:: tauaerstrat(:, :, :, :)54 real, allocatable:: pizaerstrat(:, :, :, :)55 real, allocatable:: cgaerstrat(:, :, :, :)56 real, allocatable:: taulwaerstrat(:, :, :, :)57 58 real, allocatable:: tauaerstrat_mois(:, :, :, :)59 real, allocatable:: pizaerstrat_mois(:, :, :, :)60 real, allocatable:: cgaerstrat_mois(:, :, :, :)61 real, allocatable:: taulwaerstrat_mois(:, :, :, :)62 63 real, allocatable:: tauaerstrat_mois_glo(:, :, :)64 real, allocatable:: pizaerstrat_mois_glo(:, :, :)65 real, allocatable:: cgaerstrat_mois_glo(:, :, :)66 real, allocatable:: taulwaerstrat_mois_glo(:, :, :)52 REAL, ALLOCATABLE:: tauaerstrat(:, :, :, :) 53 REAL, ALLOCATABLE:: pizaerstrat(:, :, :, :) 54 REAL, ALLOCATABLE:: cgaerstrat(:, :, :, :) 55 REAL, ALLOCATABLE:: taulwaerstrat(:, :, :, :) 56 57 REAL, ALLOCATABLE:: tauaerstrat_mois(:, :, :, :) 58 REAL, ALLOCATABLE:: pizaerstrat_mois(:, :, :, :) 59 REAL, ALLOCATABLE:: cgaerstrat_mois(:, :, :, :) 60 REAL, ALLOCATABLE:: taulwaerstrat_mois(:, :, :, :) 61 62 REAL, ALLOCATABLE:: tauaerstrat_mois_glo(:, :, :) 63 REAL, ALLOCATABLE:: pizaerstrat_mois_glo(:, :, :) 64 REAL, ALLOCATABLE:: cgaerstrat_mois_glo(:, :, :) 65 REAL, ALLOCATABLE:: taulwaerstrat_mois_glo(:, :, :) 67 66 68 67 ! For NetCDF: 69 integerncid_in ! IDs for input files70 integervarid, ncerr68 INTEGER ncid_in ! IDs for input files 69 INTEGER varid, ncerr 71 70 72 71 !-------------------------------------------------------- … … 343 342 tau_aero_lw_rrtm = MAX(tau_aero_lw_rrtm,1.e-15) 344 343 345 end subroutinereadaerosolstrato2_rrtm344 END SUBROUTINE readaerosolstrato2_rrtm -
LMDZ5/branches/testing/libf/phylmd/stratosphere_mask.F90
r2542 r2720 28 28 USE dimphy 29 29 USE phys_local_var_mod, ONLY: stratomask 30 #ifdef CPP_StratAer 31 USE phys_local_var_mod, ONLY: p_tropopause 32 #endif 30 33 31 34 IMPLICIT NONE … … 89 92 ENDDO 90 93 91 !!--diagnostic not used for now 92 !!p_tropopause(:)=tp(:) 94 !--this is only diagnosedd in the case of StratAer 95 !--but it could be useful to LMDz 96 #ifdef CPP_StratAer 97 p_tropopause(:)=tp(:) 98 #endif 93 99 94 100 IF (ifil.gt.0) THEN -
LMDZ5/branches/testing/libf/phylmd/surf_ocean_mod.F90
r2542 r2720 104 104 ! 105 105 !****************************************************************************** 106 radsol( :) = 0.0106 radsol(1:klon) = 0.0 ! initialisation a priori inutile 107 107 radsol(1:knon) = swnet(1:knon) + lwnet(1:knon) 108 108 … … 118 118 ! Si on suit les formulations par exemple de Tessel, on 119 119 ! a z0h=0.4*nu/u*, z0q=0.62*nu/u*, d'ou f_z0qh_oce=0.62/0.4=1.55 120 cdragq( :)=cdragh(:)* &121 log(z1lay( :)/z0h(:))/log(z1lay(:)/(f_z0qh_oce*z0h(:)))120 cdragq(1:knon)=cdragh(1:knon)* & 121 log(z1lay(1:knon)/z0h(1:knon))/log(z1lay(1:knon)/(f_z0qh_oce*z0h(1:knon))) 122 122 ELSE 123 cdragq( :)=cdragh(:)123 cdragq(1:knon)=cdragh(1:knon) 124 124 ENDIF 125 125 … … 169 169 !****************************************************************************** 170 170 IF (type_ocean.NE.'slab') THEN 171 lmt_bils( :)=0.171 lmt_bils(1:klon)=0. 172 172 DO i=1,knon 173 173 lmt_bils(knindex(i))=(swnet(i)+lwnet(i)+fluxsens(i)+fluxlat(i)) & … … 189 189 !--ad-hoc correction for model radiative balance tuning 190 190 !--now outside alboc_cd routine 191 alb_eau( :) = fmagic*alb_eau(:) + pmagic192 alb_eau =MIN(MAX(alb_eau,0.0),1.0)191 alb_eau(1:klon) = fmagic*alb_eau(1:klon) + pmagic 192 alb_eau(1:klon)=MIN(MAX(alb_eau(1:klon),0.0),1.0) 193 193 ! 194 194 ELSE … … 197 197 !--ad-hoc correction for model radiative balance tuning 198 198 !--now outside alboc routine 199 alb_eau( :) = fmagic*alb_eau(:) + pmagic200 alb_eau =MIN(MAX(alb_eau(i),0.04),0.60)199 alb_eau(1:klon) = fmagic*alb_eau(1:klon) + pmagic 200 alb_eau(1:klon)=MIN(MAX(alb_eau(1:klon),0.04),0.60) 201 201 ! 202 202 ENDIF … … 209 209 !IM 09122015 next line corresponds to the old way of doing in LMDZ5A/IPSLCM5A versions 210 210 !albedo for diffuse radiation is taken the same as for direct radiation 211 alb_dif_new =alb_dir_new211 alb_dif_new(1:knon,:)=alb_dir_new(1:knon,:) 212 212 !IM 09122015 end 213 213 ! … … 219 219 ! 220 220 !--ad-hoc correction for model radiative balance tuning 221 alb_dir_new(:,:) = fmagic*alb_dir_new(:,:) + pmagic 222 alb_dir_new=MIN(MAX(alb_dir_new,0.0),1.0) 223 alb_dif_new=MIN(MAX(alb_dif_new,0.0),1.0) 221 alb_dir_new(1:knon,:) = fmagic*alb_dir_new(1:knon,:) + pmagic 222 alb_dif_new(1:knon,:) = fmagic*alb_dif_new(1:knon,:) + pmagic 223 alb_dir_new(1:knon,:)=MIN(MAX(alb_dir_new(1:knon,:),0.0),1.0) 224 alb_dif_new(1:knon,:)=MIN(MAX(alb_dif_new(1:knon,:),0.0),1.0) 224 225 ! 225 226 ENDIF -
LMDZ5/branches/testing/libf/phylmd/wake.F90
r2641 r2720 125 125 126 126 REAL, DIMENSION (klon, klev), INTENT(IN) :: p, pi 127 REAL, DIMENSION (klon, klev+1), INTENT(IN) :: ph, omgb 127 REAL, DIMENSION (klon, klev+1), INTENT(IN) :: ph 128 REAL, DIMENSION (klon, klev), INTENT(IN) :: omgb 128 129 REAL, INTENT(IN) :: dtime 129 130 REAL, DIMENSION (klon, klev), INTENT(IN) :: te0, qe0 … … 148 149 REAL, DIMENSION (klon, klev), INTENT(OUT) :: dtke, dqke 149 150 REAL, DIMENSION (klon, klev), INTENT(OUT) :: spread 150 REAL, DIMENSION (klon, klev +1),INTENT(OUT) :: omgbdth, omg151 REAL, DIMENSION (klon, klev), INTENT(OUT) :: omgbdth, omg 151 152 REAL, DIMENSION (klon, klev), INTENT(OUT) :: dp_omgb, dp_deltomg 152 153 REAL, DIMENSION (klon, klev), INTENT(OUT) :: d_deltat_gw … … 161 162 162 163 ! Variables à fixer 164 INTEGER, SAVE :: igout 165 !$OMP THREADPRIVATE(igout) 163 166 REAL :: alon 164 167 LOGICAL, SAVE :: first = .TRUE. … … 182 185 REAL, DIMENSION (klon, klev) :: deltaqw0 183 186 REAL, DIMENSION (klon, klev) :: te, qe 184 REAL, DIMENSION (klon) :: sigmaw0, sigmaw1 187 REAL, DIMENSION (klon) :: sigmaw0 188 !! REAL, DIMENSION (klon) :: sigmaw1 185 189 186 190 ! Variables pour les GW … … 228 232 REAL, DIMENSION (klon, klev) :: the, thu 229 233 230 REAL, DIMENSION (klon, klev +1):: omgbw234 REAL, DIMENSION (klon, klev) :: omgbw 231 235 REAL, DIMENSION (klon) :: pupper 232 236 REAL, DIMENSION (klon) :: omgtop … … 250 254 251 255 ! cc nrlmd 252 REAL, DIMENSION (klon) :: death_rate, nat_rate 256 REAL, DIMENSION (klon) :: death_rate 257 !! REAL, DIMENSION (klon) :: nat_rate 253 258 REAL, DIMENSION (klon, klev) :: entr 254 259 REAL, DIMENSION (klon, klev) :: detr … … 296 301 297 302 if (first) then 303 304 igout = klon/2+1/klon 305 298 306 crep_upper = 0.9 299 307 crep_sol = 1.0 … … 332 340 delta_t_min = 0.2 333 341 334 ! 1. - Save initial values and initialize tendencies 335 ! -------------------------------------------------- 336 337 DO k = 1, klev 338 DO i = 1, klon 339 ppi(i, k) = pi(i, k) 340 deltatw0(i, k) = deltatw(i, k) 341 deltaqw0(i, k) = deltaqw(i, k) 342 te(i, k) = te0(i, k) 343 qe(i, k) = qe0(i, k) 344 dtls(i, k) = 0. 345 dqls(i, k) = 0. 346 d_deltat_gw(i, k) = 0. 347 d_te(i, k) = 0. 348 d_qe(i, k) = 0. 349 d_deltatw(i, k) = 0. 350 d_deltaqw(i, k) = 0. 351 ! IM 060508 beg 352 d_deltatw2(i, k) = 0. 353 d_deltaqw2(i, k) = 0. 354 ! IM 060508 end 355 END DO 356 END DO 357 DO i = 1, klon 358 sigmaw_in(i) = sigmaw(i) 359 END DO 342 ! 1. - Save initial values, initialize tendencies, initialize output fields 343 ! ------------------------------------------------------------------------ 344 345 !jyg< 346 !! DO k = 1, klev 347 !! DO i = 1, klon 348 !! ppi(i, k) = pi(i, k) 349 !! deltatw0(i, k) = deltatw(i, k) 350 !! deltaqw0(i, k) = deltaqw(i, k) 351 !! te(i, k) = te0(i, k) 352 !! qe(i, k) = qe0(i, k) 353 !! dtls(i, k) = 0. 354 !! dqls(i, k) = 0. 355 !! d_deltat_gw(i, k) = 0. 356 !! d_te(i, k) = 0. 357 !! d_qe(i, k) = 0. 358 !! d_deltatw(i, k) = 0. 359 !! d_deltaqw(i, k) = 0. 360 !! ! IM 060508 beg 361 !! d_deltatw2(i, k) = 0. 362 !! d_deltaqw2(i, k) = 0. 363 !! ! IM 060508 end 364 !! END DO 365 !! END DO 366 ppi(:,:) = pi(:,:) 367 deltatw0(:,:) = deltatw(:,:) 368 deltaqw0(:,:) = deltaqw(:,:) 369 te(:,:) = te0(:,:) 370 qe(:,:) = qe0(:,:) 371 dtls(:,:) = 0. 372 dqls(:,:) = 0. 373 d_deltat_gw(:,:) = 0. 374 d_te(:,:) = 0. 375 d_qe(:,:) = 0. 376 d_deltatw(:,:) = 0. 377 d_deltaqw(:,:) = 0. 378 d_deltatw2(:,:) = 0. 379 d_deltaqw2(:,:) = 0. 380 !! DO i = 1, klon 381 !! sigmaw_in(i) = sigmaw(i) 382 !! END DO 383 sigmaw_in(:) = sigmaw(:) 384 !>jyg 385 360 386 ! sigmaw1=sigmaw 361 387 ! IF (sigd_con.GT.sigmaw1) THEN … … 378 404 ktopw(i) = 0 379 405 END DO 380 406 ! 407 !<jyg 408 dth(:,:) = 0. 409 tu(:,:) = 0. 410 qu(:,:) = 0. 411 dtke(:,:) = 0. 412 dqke(:,:) = 0. 413 spread(:,:) = 0. 414 omgbdth(:,:) = 0. 415 omg(:,:) = 0. 416 dp_omgb(:,:) = 0. 417 dp_deltomg(:,:) = 0. 418 hw(:) = 0. 419 wape(:) = 0. 420 fip(:) = 0. 421 gfl(:) = 0. 422 cstar(:) = 0. 423 ktopw(:) = 0 424 ! 425 ! Vertical advection local variables 426 omgbw(:,:) = 0. 427 omgtop(:) = 0 428 dp_omgbw(:,:) = 0. 429 omgbdq(:,:) = 0. 430 !>jyg 431 ! 432 IF (prt_level>=10) THEN 433 PRINT *, 'wake-1, sigmaw(igout) ', sigmaw(igout) 434 PRINT *, 'wake-1, deltatw(igout,k) ', (k,deltatw(igout,k), k=1,klev) 435 PRINT *, 'wake-1, deltaqw(igout,k) ', (k,deltaqw(igout,k), k=1,klev) 436 PRINT *, 'wake-1, dowwdraughts, amdwn(igout,k) ', (k,amdwn(igout,k), k=1,klev) 437 PRINT *, 'wake-1, dowwdraughts, dtdwn(igout,k) ', (k,dtdwn(igout,k), k=1,klev) 438 PRINT *, 'wake-1, dowwdraughts, dqdwn(igout,k) ', (k,dqdwn(igout,k), k=1,klev) 439 PRINT *, 'wake-1, updraughts, amup(igout,k) ', (k,amup(igout,k), k=1,klev) 440 PRINT *, 'wake-1, updraughts, dta(igout,k) ', (k,dta(igout,k), k=1,klev) 441 PRINT *, 'wake-1, updraughts, dqa(igout,k) ', (k,dqa(igout,k), k=1,klev) 442 ENDIF 381 443 382 444 ! 2. - Prognostic part … … 570 632 END DO 571 633 634 IF (prt_level>=10) THEN 635 PRINT *, 'wake-2, ptop_provis(igout), ptop(igout) ', ptop_provis(igout), ptop(igout) 636 ENDIF 637 572 638 573 639 ! -5/ Determination de ktop et kupper … … 611 677 END DO 612 678 END DO 679 680 IF (prt_level>=10) THEN 681 PRINT *, 'wake-3, ktop(igout), kupper(igout) ', ktop(igout), kupper(igout) 682 ENDIF 613 683 614 684 ! -5/ Set deltatw & deltaqw to 0 above kupper … … 753 823 END DO 754 824 825 IF (prt_level>=10) THEN 826 PRINT *, 'wake-4, sigmaw(igout), cstar(igout), wape(igout) ', & 827 sigmaw(igout), cstar(igout), wape(igout) 828 ENDIF 829 830 755 831 ! C ----------------------------------------------------------------- 756 832 ! Sub-time-stepping … … 769 845 wk_adv(i) = ok_qx_qw(i) .AND. alpha(i) >= 1. 770 846 END DO 847 IF (prt_level>=10) THEN 848 PRINT *, 'wake-4.1, isubstep,wk_adv(igout),cstar(igout),wape(igout) ', & 849 isubstep,wk_adv(igout),cstar(igout),wape(igout) 850 ENDIF 771 851 772 852 ! cc nrlmd Ajout d'un recalcul de wdens dans le cas d'un entrainement … … 835 915 ! calcul de la difference de vitesse verticale poche - zone non perturbee 836 916 ! IM 060208 differences par rapport au code initial; init. a 0 dp_deltomg 837 ! IM 060208 et omg sur les niveaux de 1 a klev+1, alors que avant l'on 838 ! definit 917 ! IM 060208 et omg sur les niveaux de 1 a klev+1, alors que avant l'on definit 839 918 ! IM 060208 au niveau k=1..? 919 !JYG 161013 Correction : maintenant omg est dimensionne a klev. 840 920 DO k = 1, klev 841 921 DO i = 1, klon … … 845 925 END DO 846 926 END DO 847 DO k = 1, klev + 1927 DO k = 1, klev 848 928 DO i = 1, klon 849 929 IF (wk_adv(i)) THEN !!! nrlmd … … 879 959 END IF 880 960 END DO 961 962 IF (prt_level>=10) THEN 963 PRINT *, 'wake-4.2, omg(igout,k) ', (k,omg(igout,k), k=1,klev) 964 PRINT *, 'wake-4.2, omgtop(igout) ', omgtop(igout) 965 ENDIF 881 966 882 967 ! ----------------- … … 926 1011 END DO 927 1012 END DO 1013 !! print *,'omg(igout,k) ', (k,omg(igout,k),k=1,klev) 928 1014 ! cc nrlmd 929 1015 ! c DO i=1,klon … … 936 1022 937 1023 938 DO k = 1, klev + 11024 DO k = 1, klev 939 1025 DO i = 1, klon 940 1026 IF (wk_adv(i)) THEN … … 945 1031 ! -- and its vertical gradient dp_omgbw 946 1032 947 DO k = 1, klev 1033 DO k = 1, klev-1 948 1034 DO i = 1, klon 949 1035 IF (wk_adv(i)) THEN … … 951 1037 END IF 952 1038 END DO 1039 END DO 1040 DO i = 1, klon 1041 IF (wk_adv(i)) THEN 1042 dp_omgbw(i, klev) = 0. 1043 END IF 953 1044 END DO 954 1045 … … 1030 1121 END DO 1031 1122 1123 IF (prt_level>=10) THEN 1124 PRINT *, 'wake-4.3, th1(igout,k) ', (k,th1(igout,k), k=1,klev) 1125 PRINT *, 'wake-4.3, th2(igout,k) ', (k,th2(igout,k), k=1,klev) 1126 PRINT *, 'wake-4.3, dth(igout,k) ', (k,dth(igout,k), k=1,klev) 1127 PRINT *, 'wake-4.3, omgbdth(igout,k) ', (k,omgbdth(igout,k), k=1,klev) 1128 ENDIF 1129 1032 1130 ! ----------------------------------------------------------------- 1033 DO k = 1, klev 1131 DO k = 1, klev-1 1034 1132 DO i = 1, klon 1035 1133 IF (wk_adv(i) .AND. k<=kupper(i)-1) THEN … … 1043 1141 (1.-alpha_up(i,k))*omgbdth(i,k)- & 1044 1142 alpha_up(i,k+1)*omgbdth(i,k+1))*ppi(i, k) 1045 ! print*,'d_deltatw=',d_deltatw(i,k)1143 ! print*,'d_deltatw=', k, d_deltatw(i,k) 1046 1144 1047 1145 d_deltaqw(i, k) = dtimesub/(ph(i,k)-ph(i,k+1))* & … … 1050 1148 (1.-alpha_up(i,k))*omgbdq(i,k)- & 1051 1149 alpha_up(i,k+1)*omgbdq(i,k+1)) 1052 ! print*,'d_deltaqw=',d_deltaqw(i,k)1150 ! print*,'d_deltaqw=', k, d_deltaqw(i,k) 1053 1151 1054 1152 ! and increment large scale tendencies … … 1080 1178 END DO 1081 1179 ! ------------------------------------------------------------------ 1180 1181 IF (prt_level>=10) THEN 1182 PRINT *, 'wake-4.3, d_deltatw(igout,k) ', (k,d_deltatw(igout,k), k=1,klev) 1183 PRINT *, 'wake-4.3, d_deltaqw(igout,k) ', (k,d_deltaqw(igout,k), k=1,klev) 1184 ENDIF 1082 1185 1083 1186 ! Increment state variables … … 1505 1608 END DO ! end sub-timestep loop 1506 1609 1610 IF (prt_level>=10) THEN 1611 PRINT *, 'wake-5, sigmaw(igout), cstar(igout), wape(igout) ', & 1612 sigmaw(igout), cstar(igout), wape(igout) 1613 ENDIF 1507 1614 1508 1615 … … 1761 1868 ! c $ wape(i),wape2(i),ktopw(i),OK_qx_qw(i) 1762 1869 END DO 1870 1871 IF (prt_level>=10) THEN 1872 PRINT *, 'wake-6, wape wape2 ktopw OK_qx_qw =', & 1873 wape(igout),wape2(igout),ktopw(igout),OK_qx_qw(igout) 1874 ENDIF 1875 1763 1876 1764 1877 ! ----------------------------------------------------------------- -
LMDZ5/branches/testing/libf/phylmd/yamada_c.F90
r2408 r2720 4 4 SUBROUTINE yamada_c(ngrid,timestep,plev,play & 5 5 & ,pu,pv,pt,d_u,d_v,d_t,cd,q2,km,kn,kq,d_t_diss,ustar & 6 & ,iflag_pbl ,okiophys)6 & ,iflag_pbl) 7 7 USE dimphy, ONLY: klon, klev 8 8 USE print_control_mod, ONLY: prt_level 9 USE ioipsl_getin_p_mod, ONLY : getin_p 10 9 11 IMPLICIT NONE 10 12 #include "YOMCST.h" … … 50 52 REAL, DIMENSION(klon,klev) :: pu,pv,pt 51 53 REAL, DIMENSION(klon,klev) :: d_t_diss 52 INTEGER okiophys53 54 54 55 REAL timestep … … 68 69 REAL unsdzdec(klon,klev+1) 69 70 70 REAL km(klon,klev +1)71 REAL km(klon,klev) 71 72 REAL kmpre(klon,klev+1),tmp2 72 73 REAL mpre(klon,klev+1) 73 REAL kn(klon,klev +1)74 REAL kq(klon,klev +1)74 REAL kn(klon,klev) 75 REAL kq(klon,klev) 75 76 real ff(klon,klev+1),delta(klon,klev+1) 76 77 real aa(klon,klev+1),aa0,aa1 … … 84 85 data first,ipas/.false.,0/ 85 86 !$OMP THREADPRIVATE( first,ipas) 87 INTEGER, SAVE :: iflag_tke_diff=0 88 !$OMP THREADPRIVATE(iflag_tke_diff) 89 86 90 87 91 integer ig,k … … 119 123 REAL, DIMENSION(klon,klev) :: exner,masse 120 124 REAL, DIMENSION(klon,klev+1) :: masseb,q2old,q2neg 125 LOGICAL okiophys 121 126 122 127 frif(ri)=0.6588*(ri+0.1776-sqrt(ri*ri-0.3221*ri+0.03156)) … … 128 133 129 134 135 okiophys=klon==1 130 136 if (firstcall) then 137 CALL getin_p('iflag_tke_diff',iflag_tke_diff) 131 138 allocate(l0(klon)) 132 #ifdef IOPHYS 133 call iophys_ini 139 #define IOPHYS 140 #ifdef IOPHYS 141 ! call iophys_ini 134 142 #endif 135 143 firstcall=.false. 136 144 endif 137 145 138 139 #ifdef IOPHYS 140 if (okiophys==1) then 146 IF (ngrid<=0) RETURN ! Bizarre : on n a pas ce probeleme pour coef_diff_turb 147 148 #ifdef IOPHYS 149 if (okiophys) then 141 150 call iophys_ecrit('q2i',klev,'q2 debut my','m2/s2',q2(:,1:klev)) 142 151 call iophys_ecrit('kmi',klev,'Kz debut my','m/s2',km(:,1:klev)) … … 146 155 nlay=klev 147 156 nlev=klev+1 157 148 158 149 159 !------------------------------------------------------------------------- … … 152 162 153 163 154 zu(:,:)=pu(:,:)+0.5*d_u(:,:) 155 zv(:,:)=pv(:,:)+0.5*d_v(:,:) 156 zt(:,:)=pt(:,:)+0.5*d_t(:,:) 164 zalpha=0.5 ! Anciennement 0.5. Essayer de voir pourquoi ? 165 zu(:,:)=pu(:,:)+zalpha*d_u(:,:) 166 zv(:,:)=pv(:,:)+zalpha*d_v(:,:) 167 zt(:,:)=pt(:,:)+zalpha*d_t(:,:) 168 157 169 do k=1,klev 158 170 exner(:,k)=(play(:,k)/plev(:,1))**RKAPPA 159 171 masse(:,k)=(plev(:,k)-plev(:,k+1))/RG 172 teta(:,k)=zt(:,k)/exner(:,k) 160 173 enddo 161 teta(:,:)=zt(:,:)/exner(:,:)162 174 163 175 ! Atmospheric mass at layer interfaces, where the TKE is computed … … 168 180 enddo 169 181 masseb(:,:)=0.5*masseb(:,:) 170 171 172 182 173 183 zlev(:,1)=0. … … 202 212 203 213 #ifdef IOPHYS 204 if (okiophys ==1) then214 if (okiophys) then 205 215 call iophys_ecrit('zlay',klev,'Geop','m',zlay) 206 216 call iophys_ecrit('teta',klev,'teta','K',teta) 207 217 call iophys_ecrit('temp',klev,'temp','K',zt) 208 218 call iophys_ecrit('pt',klev,'temp','K',pt) 219 call iophys_ecrit('pu',klev,'u','m/s',pu) 220 call iophys_ecrit('pv',klev,'v','m/s',pv) 209 221 call iophys_ecrit('d_u',klev,'d_u','m/s2',d_u) 210 222 call iophys_ecrit('d_v',klev,'d_v','m/s2',d_v) … … 213 225 call iophys_ecrit('masse',klev,'masse','',masse) 214 226 call iophys_ecrit('masseb',klev,'masseb','',masseb) 215 call iophys_ecrit('Cm2',klev,'m2 conserv','m/s',(dddu(:,1:klev)+dddv(:,1:klev))/(masseb(:,1:klev)*timestep))216 call iophys_ecrit('Cn2',klev,'m2 conserv','m/s',(rcpd*dddt(:,1:klev)/masseb(:,1:klev))/timestep)217 call iophys_ecrit('rifc',klev,'rif conservative','',rcpd*dddt(:,1:klev)/min(dddu(:,1:klev)+dddv(:,1:klev),-1.e-20))218 227 endif 219 228 #endif … … 273 282 rif(ig,k)=rifc 274 283 endif 275 if(rif(ig,k) .lt.0.16) then284 if(rif(ig,k)<0.16) then 276 285 alpha(ig,k)=falpha(rif(ig,k)) 277 286 sm(ig,k)=fsm(rif(ig,k)) … … 338 347 339 348 #ifdef IOPHYS 340 if (okiophys ==1) then349 if (okiophys) then 341 350 call iophys_ecrit('rif',klev,'Flux Richardson','m',rif(:,1:klev)) 342 351 call iophys_ecrit('m2',klev,'m2 ','m/s',m2(:,1:klev)) 343 call iophys_ecrit('Km2 ',klev,'m2 conserv','m/s',km(:,1:klev)*m2(:,1:klev))352 call iophys_ecrit('Km2app',klev,'m2 conserv','m/s',km(:,1:klev)*m2(:,1:klev)) 344 353 call iophys_ecrit('Km',klev,'Km','m2/s',km(:,1:klev)) 345 354 endif … … 357 366 ! Evolution of TKE under source terms K M2 and K N2 358 367 leff(:,:)=max(l(:,:),1.) 359 IF (iflag_pbl==29) THEN 360 km2(:,:)=km(:,:)*m2(:,:) 361 kn2(:,:)=kn2(:,:)*rif(:,:) 362 ELSEIF (iflag_pbl==25) THEN 363 DO k=1,klev 364 km2(:,k)=-0.5*(dddu(:,k)+dddv(:,k)+dddu(:,k+1)+dddv(:,k+1)) & 365 & /(masse(:,k)*timestep) 366 kn2(:,k)=rcpd*0.5*(dddt(:,k)+dddt(:,k+1))/(masse(:,k)*timestep) 367 leff(:,k)=0.5*(leff(:,k)+leff(:,k+1)) 368 ENDDO 369 km2(:,klev+1)=0. ; kn2(:,klev+1)=0. 370 ELSE 368 369 !################################################################## 370 !# IF (iflag_pbl==29) THEN 371 !# STOP'Ne pas utiliser iflag_pbl=29' 372 !# km2(:,:)=km(:,:)*m2(:,:) 373 !# kn2(:,:)=kn2(:,:)*rif(:,:) 374 !# ELSEIF (iflag_pbl==25) THEN 375 ! VERSION AVEC LA TKE EN MILIEU DE COUCHE 376 !# STOP'Ne pas utiliser iflag_pbl=25' 377 !# DO k=1,klev 378 !# km2(:,k)=-0.5*(dddu(:,k)+dddv(:,k)+dddu(:,k+1)+dddv(:,k+1)) & 379 !# & /(masse(:,k)*timestep) 380 !# kn2(:,k)=rcpd*0.5*(dddt(:,k)+dddt(:,k+1))/(masse(:,k)*timestep) 381 !# leff(:,k)=0.5*(leff(:,k)+leff(:,k+1)) 382 !# ENDDO 383 !# km2(:,klev+1)=0. ; kn2(:,klev+1)=0. 384 !# ELSE 385 !################################################################# 386 371 387 km2(:,:)=-(dddu(:,:)+dddv(:,:))/(masseb(:,:)*timestep) 372 388 kn2(:,:)=rcpd*dddt(:,:)/(masseb(:,:)*timestep) 373 ENDIF389 ! ENDIF 374 390 q2neg(:,:)=q2(:,:)+timestep*(km2(:,:)-kn2(:,:)) 375 391 q2(:,:)=min(max(q2neg(:,:),1.e-10),1.e4) 392 393 394 #ifdef IOPHYS 395 if (okiophys) then 396 call iophys_ecrit('km2',klev,'m2 conserv','m/s',km2(:,1:klev)) 397 call iophys_ecrit('kn2',klev,'n2 conserv','m/s',kn2(:,1:klev)) 398 endif 399 #endif 376 400 377 401 ! Dissipation of TKE … … 379 403 q2(:,:)=1./(1./sqrt(q2(:,:))+timestep/(2*leff(:,:)*b1)) 380 404 q2(:,:)=q2(:,:)*q2(:,:) 381 405 ! IF (iflag_pbl<=24) THEN 382 406 DO k=1,klev 383 407 d_t_diss(:,k)=(masseb(:,k)*(q2neg(:,k)-q2(:,k))+masseb(:,k+1)*(q2neg(:,k+1)-q2(:,k+1)))/(2.*rcpd*masse(:,k)) 384 408 ENDDO 385 ELSE IF (iflag_pbl<=27) THEN 386 DO k=1,klev 387 d_t_diss(:,k)=(q2neg(:,k)-q2(:,k))/rcpd 388 ENDDO 389 ENDIF 409 410 !################################################################### 411 ! ELSE IF (iflag_pbl<=27) THEN 412 ! DO k=1,klev 413 ! d_t_diss(:,k)=(q2neg(:,k)-q2(:,k))/rcpd 414 ! ENDDO 415 ! ENDIF 390 416 ! print*,'iflag_pbl ',d_t_diss 417 !################################################################### 391 418 392 419 393 420 ! Compuation of stability functions 394 IF (iflag_pbl/=29) THEN421 ! IF (iflag_pbl/=29) THEN 395 422 DO k=1,klev 396 423 DO ig=1,ngrid … … 409 436 ENDDO 410 437 ENDDO 411 ENDIF438 ! ENDIF 412 439 413 440 ! Computation of turbulent diffusivities 414 IF (25<=iflag_pbl.and.iflag_pbl<=28) THEN 415 DO k=2,klev 416 sqrtq(:,k)=sqrt(0.5*(q2(:,k)+q2(:,k-1))) 417 ENDDO 418 ELSE 419 DO k=2,klev 420 sqrtq(:,k)=sqrt(q2(:,k)) 421 ENDDO 422 ENDIF 423 DO k=2,klev 424 DO ig=1,ngrid 425 km(ig,k)=leff(ig,k)*sqrtq(ig,k)*sm(ig,k) 426 kn(ig,k)=km(ig,k)*alpha(ig,k) 427 kq(ig,k)=leff(ig,k)*zq*0.2 428 ! print*,q2(ig,k),zq,km(ig,k) 441 ! IF (25<=iflag_pbl.and.iflag_pbl<=28) THEN 442 ! DO k=2,klev 443 ! sqrtq(:,k)=sqrt(0.5*(q2(:,k)+q2(:,k-1))) 444 ! ENDDO 445 ! ELSE 446 kq(:,:)=0. 447 DO k=1,klev 448 ! Coefficient au milieu des couches pour diffuser la TKE 449 kq(:,k)=0.5*leff(:,k)*sqrt(q2(:,k))*0.2 429 450 ENDDO 451 452 #ifdef IOPHYS 453 if (okiophys) then 454 call iophys_ecrit('q2b',klev,'KTE inter','m2/s',q2(:,1:klev)) 455 endif 456 #endif 457 458 IF (iflag_tke_diff==1) THEN 459 CALL vdif_q2(timestep, RG, RD, ngrid, plev, pt, kq, q2) 460 ENDIF 461 462 km(:,:)=0. 463 kn(:,:)=0. 464 DO k=1,klev 465 km(:,k)=leff(:,k)*sqrt(q2(:,k))*sm(:,k) 466 kn(:,k)=km(:,k)*alpha(:,k) 430 467 ENDDO 431 468 432 469 433 434 #ifdef IOPHYS 435 if (okiophys==1) then 470 #ifdef IOPHYS 471 if (okiophys) then 436 472 call iophys_ecrit('mixingl',klev,'Mixing length','m',leff(:,1:klev)) 437 473 call iophys_ecrit('rife',klev,'Flux Richardson','m',rif(:,1:klev)) … … 447 483 #endif 448 484 485 449 486 ENDIF 450 487 … … 452 489 ! print*,'OK2' 453 490 RETURN 454 !==================================================================== 455 ! Yamada 2.0 456 !==================================================================== 457 if (iflag_pbl.eq.6) then 458 459 do k=2,klev 460 q2(:,k)=l(:,k)**2*zz(:,k) 461 enddo 462 463 464 else if (iflag_pbl.eq.7) then 465 !==================================================================== 466 ! Yamada 2.Fournier 467 !==================================================================== 468 469 ! Calcul de l, km, au pas precedent 470 do k=2,klev 471 do ig=1,ngrid 472 ! print*,'SMML=',sm(ig,k),l(ig,k) 473 delta(ig,k)=q2(ig,k)/(l(ig,k)**2*sm(ig,k)) 474 kmpre(ig,k)=l(ig,k)*sqrt(q2(ig,k))*sm(ig,k) 475 mpre(ig,k)=sqrt(m2(ig,k)) 476 ! print*,'0L=',k,l(ig,k),delta(ig,k),km(ig,k) 477 enddo 478 enddo 479 480 do k=2,klev-1 481 do ig=1,ngrid 482 m2cstat=max(alpha(ig,k)*n2(ig,k)+delta(ig,k)/b1,1.e-12) 483 mcstat=sqrt(m2cstat) 484 485 ! print*,'M2 L=',k,mpre(ig,k),mcstat 486 ! 487 ! -----{puis on ecrit la valeur de q qui annule l'equation de m 488 ! supposee en q3} 489 ! 490 IF (k.eq.2) THEN 491 kmcstat=1.E+0 / mcstat & 492 & *( unsdz(ig,k)*kmpre(ig,k+1) & 493 & *mpre(ig,k+1) & 494 & +unsdz(ig,k-1) & 495 & *cd(ig) & 496 & *( sqrt(zu(ig,3)**2+zv(ig,3)**2) & 497 & -mcstat/unsdzdec(ig,k) & 498 & -mpre(ig,k+1)/unsdzdec(ig,k+1) )**2) & 499 & /( unsdz(ig,k)+unsdz(ig,k-1) ) 500 ELSE 501 kmcstat=1.E+0 / mcstat & 502 & *( unsdz(ig,k)*kmpre(ig,k+1) & 503 & *mpre(ig,k+1) & 504 & +unsdz(ig,k-1)*kmpre(ig,k-1) & 505 & *mpre(ig,k-1) ) & 506 & /( unsdz(ig,k)+unsdz(ig,k-1) ) 507 ENDIF 508 ! print*,'T2 L=',k,tmp2 509 tmp2=kmcstat & 510 & /( sm(ig,k)/q2(ig,k) ) & 511 & /l(ig,k) 512 q2(ig,k)=max(tmp2,1.e-12)**(2./3.) 513 ! print*,'Q2 L=',k,q2(ig,k) 514 ! 515 enddo 516 enddo 517 518 else if (iflag_pbl==8.or.iflag_pbl==9) then 519 !==================================================================== 520 ! Yamada 2.5 a la Didi 521 !==================================================================== 522 523 524 ! Calcul de l, km, au pas precedent 525 do k=2,klev 526 do ig=1,ngrid 527 ! print*,'SMML=',sm(ig,k),l(ig,k) 528 delta(ig,k)=q2(ig,k)/(l(ig,k)**2*sm(ig,k)) 529 if (delta(ig,k).lt.1.e-20) then 530 ! print*,'ATTENTION L=',k,' Delta=',delta(ig,k) 531 delta(ig,k)=1.e-20 532 endif 533 km(ig,k)=l(ig,k)*sqrt(q2(ig,k))*sm(ig,k) 534 aa0=(m2(ig,k)-alpha(ig,k)*n2(ig,k)-delta(ig,k)/b1) 535 aa1=(m2(ig,k)*(1.-rif(ig,k))-delta(ig,k)/b1) 536 ! abder print*,'AA L=',k,aa0,aa1,aa1/max(m2(ig,k),1.e-20) 537 aa(ig,k)=aa1*timestep/(delta(ig,k)*l(ig,k)) 538 ! print*,'0L=',k,l(ig,k),delta(ig,k),km(ig,k) 539 qpre=sqrt(q2(ig,k)) 540 ! if (iflag_pbl.eq.8 ) then 541 if (aa(ig,k).gt.0.) then 542 q2(ig,k)=(qpre+aa(ig,k)*qpre*qpre)**2 543 else 544 q2(ig,k)=(qpre/(1.-aa(ig,k)*qpre))**2 545 endif 546 ! else ! iflag_pbl=9 547 ! if (aa(ig,k)*qpre.gt.0.9) then 548 ! q2(ig,k)=(qpre*10.)**2 549 ! else 550 ! q2(ig,k)=(qpre/(1.-aa(ig,k)*qpre))**2 551 ! endif 552 ! endif 553 q2(ig,k)=min(max(q2(ig,k),1.e-10),1.e4) 554 ! print*,'Q2 L=',k,q2(ig,k),qpre*qpre 555 enddo 556 enddo 557 558 else if (iflag_pbl>=10) then 559 560 ! print*,'Schema mixte D' 561 ! print*,'Longueur ',l(:,:) 562 do k=2,klev-1 563 l(:,k)=max(l(:,k),1.) 564 km(:,k)=l(:,k)*sqrt(q2(:,k))*sm(:,k) 565 q2(:,k)=q2(:,k)+timestep*km(:,k)*m2(:,k)*(1.-rif(:,k)) 566 q2(:,k)=min(max(q2(:,k),1.e-10),1.e4) 567 q2(:,k)=1./(1./sqrt(q2(:,k))+timestep/(2*l(:,k)*b1)) 568 q2(:,k)=q2(:,k)*q2(:,k) 569 enddo 570 571 572 else 573 CALL abort_physic(modname,'Cas nom prevu dans yamada4',1) 574 575 endif ! Fin du cas 8 576 577 ! print*,'OK8' 578 579 !==================================================================== 580 ! Calcul des coefficients de m�ange 581 !==================================================================== 582 do k=2,klev 583 ! print*,'k=',k 584 do ig=1,ngrid 585 !abde print*,'KML=',l(ig,k),q2(ig,k),sm(ig,k) 586 zq=sqrt(q2(ig,k)) 587 km(ig,k)=l(ig,k)*zq*sm(ig,k) 588 kn(ig,k)=km(ig,k)*alpha(ig,k) 589 kq(ig,k)=l(ig,k)*zq*0.2 590 ! print*,'KML=',km(ig,k),kn(ig,k) 591 enddo 592 enddo 593 594 ! Transport diffusif vertical de la TKE. 595 if (iflag_pbl.ge.12) then 596 ! print*,'YAMADA VDIF' 597 q2(:,1)=q2(:,2) 598 call vdif_q2(timestep,RG,RD,ngrid,plev,zt,kq,q2) 599 endif 600 601 ! Traitement des cas noctrunes avec l'introduction d'une longueur 602 ! minilale. 603 604 !==================================================================== 605 ! Traitement particulier pour les cas tres stables. 606 ! D'apres Holtslag Boville. 607 608 if (prt_level>1) THEN 609 print*,'YAMADA4 0' 610 endif !(prt_level>1) THEN 611 do ig=1,ngrid 612 coriol(ig)=1.e-4 613 pblhmin(ig)=0.07*ustar(ig)/max(abs(coriol(ig)),2.546e-5) 614 enddo 615 616 ! print*,'pblhmin ',pblhmin 617 !Test a remettre 21 11 02 618 ! test abd 13 05 02 if(0.eq.1) then 619 if(1==1) then 620 if(iflag_pbl==8.or.iflag_pbl==10) then 621 622 do k=2,klev 623 do ig=1,ngrid 624 if (teta(ig,2).gt.teta(ig,1)) then 625 qmin=ustar(ig)*(max(1.-zlev(ig,k)/pblhmin(ig),0.))**2 626 kmin=kap*zlev(ig,k)*qmin 627 else 628 kmin=-1. ! kmin n'est utilise que pour les SL stables. 629 endif 630 if (kn(ig,k).lt.kmin.or.km(ig,k).lt.kmin) then 631 ! print*,'Seuil min Km K=',k,kmin,km(ig,k),kn(ig,k) 632 ! s ,sqrt(q2(ig,k)),pblhmin(ig),qmin/sm(ig,k) 633 kn(ig,k)=kmin 634 km(ig,k)=kmin 635 kq(ig,k)=kmin 636 ! la longueur de melange est suposee etre l= kap z 637 ! K=l q Sm d'ou q2=(K/l Sm)**2 638 q2(ig,k)=(qmin/sm(ig,k))**2 639 endif 640 enddo 641 enddo 642 643 else 644 645 do k=2,klev 646 do ig=1,ngrid 647 if (teta(ig,2).gt.teta(ig,1)) then 648 qmin=ustar(ig)*(max(1.-zlev(ig,k)/pblhmin(ig),0.))**2 649 kmin=kap*zlev(ig,k)*qmin 650 else 651 kmin=-1. ! kmin n'est utilise que pour les SL stables. 652 endif 653 if (kn(ig,k).lt.kmin.or.km(ig,k).lt.kmin) then 654 ! print*,'Seuil min Km K=',k,kmin,km(ig,k),kn(ig,k) 655 ! s ,sqrt(q2(ig,k)),pblhmin(ig),qmin/sm(ig,k) 656 kn(ig,k)=kmin 657 km(ig,k)=kmin 658 kq(ig,k)=kmin 659 ! la longueur de melange est suposee etre l= kap z 660 ! K=l q Sm d'ou q2=(K/l Sm)**2 661 sm(ig,k)=1. 662 alpha(ig,k)=1. 663 q2(ig,k)=min((qmin/sm(ig,k))**2,10.) 664 zq=sqrt(q2(ig,k)) 665 km(ig,k)=l(ig,k)*zq*sm(ig,k) 666 kn(ig,k)=km(ig,k)*alpha(ig,k) 667 kq(ig,k)=l(ig,k)*zq*0.2 668 endif 669 enddo 670 enddo 671 endif 672 673 endif 674 675 if (prt_level>1) THEN 676 print*,'YAMADA4 1' 677 endif !(prt_level>1) THEN 678 ! Diagnostique pour stokage 679 680 if(1.eq.0)then 681 rino=rif 682 smyam(1:ngrid,1)=0. 683 styam(1:ngrid,1)=0. 684 lyam(1:ngrid,1)=0. 685 knyam(1:ngrid,1)=0. 686 w2yam(1:ngrid,1)=0. 687 t2yam(1:ngrid,1)=0. 688 689 smyam(1:ngrid,2:klev)=sm(1:ngrid,2:klev) 690 styam(1:ngrid,2:klev)=sm(1:ngrid,2:klev)*alpha(1:ngrid,2:klev) 691 lyam(1:ngrid,2:klev)=l(1:ngrid,2:klev) 692 knyam(1:ngrid,2:klev)=kn(1:ngrid,2:klev) 693 694 ! Estimations de w'2 et T'2 d'apres Abdela et McFarlane 695 696 w2yam(1:ngrid,2:klev)=q2(1:ngrid,2:klev)*0.24 & 697 & +lyam(1:ngrid,2:klev)*5.17*kn(1:ngrid,2:klev) & 698 & *n2(1:ngrid,2:klev)/sqrt(q2(1:ngrid,2:klev)) 699 700 t2yam(1:ngrid,2:klev)=9.1*kn(1:ngrid,2:klev) & 701 & *dtetadz(1:ngrid,2:klev)**2 & 702 & /sqrt(q2(1:ngrid,2:klev))*lyam(1:ngrid,2:klev) 703 endif 704 705 ! print*,'OKFIN' 706 first=.false. 707 return 708 end 491 END -
LMDZ5/branches/testing/makelmdz
r2641 r2720 29 29 rrtm=false 30 30 dust=false 31 strataer=false 31 32 full="" 32 33 … … 113 114 [-rrtm true/false] : compile with/without rrtm package (default: false) 114 115 [-dust true/false] : compile with/without the dust package from Boucher et al. (default: false) 116 [-strataer true/false] : compile with/without the strat aer package from Boucher et al. (default: false) 115 117 [-parallel none/mpi/omp/mpi_omp] : parallelism (default: none) : mpi, openmp or mixted mpi_openmp 116 118 [-g GRI] : grid configuration in dyn3d/GRI_xy.h (default: reg, inclues a zoom) … … 180 182 dust="$2" ; shift ; shift ;; 181 183 184 "-strataer") 185 strataer="$2" ; shift ; shift ;; 186 182 187 "-mem") 183 188 paramem="mem" ; shift ;; … … 459 464 CPP_KEY="$CPP_KEY CPP_Dust" 460 465 src_dirs="$src_dirs phy${physique}/Dust" 466 fi 467 468 if [[ "$strataer" == "true" ]] 469 then 470 CPP_KEY="$CPP_KEY CPP_StratAer" 471 src_dirs="$src_dirs phy${physique}/StratAer" 461 472 fi 462 473 -
LMDZ5/branches/testing/makelmdz_fcm
r2641 r2720 26 26 rrtm=false 27 27 dust=false 28 strataer=false 28 29 chimie=false 29 30 parallel=none … … 48 49 RRTM_PATH=$LMDGCM/.void_dir 49 50 DUST_PATH=$LMDGCM/.void_dir 51 STRATAER_PATH=$LMDGCM/.void_dir 50 52 SISVAT_PATH=$LMDGCM/.void_dir 51 53 COSP_PATH=$LMDGCM/.void_dir … … 90 92 [-rrtm true/false] : compile with/without rrtm package (default: false) 91 93 [-dust true/false] : compile with/without the dust package by Boucher and co (default: false) 94 [-strataer true/false] : compile with/without the strat aer package by Boucher and co (default: false) 92 95 [-parallel none/mpi/omp/mpi_omp] : parallelism (default: none) : mpi, openmp or mixted mpi_openmp 93 96 [-g GRI] : grid configuration in dyn3d/GRI_xy.h (default: reg, inclues a zoom) … … 144 147 "-dust") 145 148 dust="$2" ; shift ; shift ;; 149 150 "-strataer") 151 strataer="$2" ; shift ; shift ;; 146 152 147 153 "-chimie") … … 363 369 fi 364 370 371 if [[ "$strataer" == "true" ]] 372 then 373 CPP_KEY="$CPP_KEY CPP_StratAer" 374 STRATAER_PATH="$LIBFGCM/%PHYS/StratAer" 375 fi 376 365 377 if [[ $io == ioipsl ]] 366 378 then … … 593 605 echo "%RRTM $RRTM_PATH" >> $config_fcm 594 606 echo "%DUST $DUST_PATH" >> $config_fcm 607 echo "%STRATAER $STRATAER_PATH" >> $config_fcm 595 608 echo "%SISVAT $SISVAT_PATH" >> $config_fcm 596 609 echo "%COSP $COSP_PATH" >> $config_fcm
Note: See TracChangeset
for help on using the changeset viewer.