- Timestamp:
- Nov 5, 2025, 6:17:11 PM (3 months ago)
- Location:
- trunk/LMDZ.PLUTO/libf
- Files:
-
- 7 edited
-
muphypluto/mp2m_globals.F90 (modified) (25 diffs)
-
muphypluto/mp2m_haze.F90 (modified) (2 diffs)
-
muphypluto/mp2m_intgcm.F90 (modified) (9 diffs)
-
muphypluto/mp2m_methods.F90 (modified) (2 diffs)
-
phypluto/mp2m_diagnostics.F90 (modified) (9 diffs)
-
phypluto/mp2m_inimufi.F90 (modified) (1 diff)
-
phypluto/physiq_mod.F90 (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/LMDZ.PLUTO/libf/muphypluto/mp2m_globals.F90
r3951 r3952 30 30 ! - Vertical structure part 31 31 ! 32 ! The module also contains t hirteenmethods:32 ! The module also contains twenty methods: 33 33 ! - mm_global_init_0 34 34 ! - mm_global_init_1 35 35 ! - mm_column_init 36 36 ! - mm_aerosols_init 37 ! - mm_clouds_init 37 38 ! - mm_alpha_s, mm_alpha_f 38 ! - mm_effg39 39 ! - mm_set_moments_thresholds 40 40 ! - mm_get_rcs, mm_get_rcf 41 ! - mm_set_moments_cld_thresholds 42 ! - cldprop_sc, cldprop_ve 43 ! - read_esp 44 ! - mm_effg 41 45 ! - mm_dump_parameters 42 46 ! - check_r1, check_l1, check_i1, check_s1 … … 58 62 PUBLIC 59 63 60 PRIVATE :: c heck_r1,check_i1,check_l1,check_s1,read_esp64 PRIVATE :: cldprop_sc,cldprop_ve,read_esp,check_r1,check_i1,check_l1,check_s1 61 65 62 66 ! ~~~~~~~~~~~~~~~~~~~ … … 71 75 PROTECTED :: mm_ini,mm_ini_col,mm_ini_aer 72 76 ! Model parameters (mm_global_init) 73 PROTECTED :: mm_dt,mm_rhoaer,mm_df,mm_rm,mm_ haze_prod_pCH4,mm_p_prod,mm_rc_prod,mm_tx_prod,mm_rpla,mm_g0,mm_rb2ra77 PROTECTED :: mm_dt,mm_rhoaer,mm_df,mm_rm,mm_call_CH4hazeprod,mm_p_prod,mm_rc_prod,mm_tx_prod,mm_rpla,mm_g0,mm_rb2ra 74 78 ! Atmospheric vertical structure (mm_column_init) 75 79 PROTECTED :: mm_nla,mm_nle,mm_zlay,mm_zlev,mm_play,mm_plev,mm_temp,mm_rhoair,mm_btemp,mm_dzlev,mm_dzlay … … 84 88 !~~~~~~~~~~~~~ 85 89 ! Initialization control flags (cannot be updated) 86 !PROTECTED :: mm_ini_cld90 PROTECTED :: mm_ini_cld 87 91 ! Condensible species parameters (mm_global_init) 88 92 PROTECTED :: mm_nesp, mm_spcname, mm_xESPS 93 ! Condensible species parameters (mm_clouds_init) 94 PROTECTED :: mm_gas 89 95 ! Moments parameters (mm_clouds_init) 90 !PROTECTED :: mm_m0ccn, mm_m3ccn, mm_m3ice96 PROTECTED :: mm_m0ccn, mm_m3ccn, mm_m3ice 91 97 ! Moments parameters (derived, are updated with moments parameters) 92 !PROTECTED :: mm_drad, mm_drho98 PROTECTED :: mm_drad, mm_drho 93 99 ! Thresholds parameters 94 ! PROTECTED :: mm_m0ccn_min, mm_m3cld_min100 PROTECTED :: mm_m0ccn_min, mm_m3ccn_min, mm_m3cld_min, mm_drad_min, mm_drad_max 95 101 96 102 ! ~~~~~~~~~~~~~ … … 100 106 !~~~~~~~~~~~~ 101 107 ! Enable/Disable haze production. 102 LOGICAL, SAVE :: mm_ w_haze_prod= .true.108 LOGICAL, SAVE :: mm_call_hazeprod = .true. 103 109 ! Enable/Disable haze production from CH4 photolysis. 104 LOGICAL, SAVE :: mm_ haze_prod_pCH4= .true.110 LOGICAL, SAVE :: mm_call_CH4hazeprod = .true. 105 111 ! Enable/Disable haze sedimentation. 106 LOGICAL, SAVE :: mm_ w_haze_sed= .true.112 LOGICAL, SAVE :: mm_call_hazesed = .true. 107 113 ! Enable/Disable haze coagulation. 108 LOGICAL, SAVE :: mm_ w_haze_coag= .true.114 LOGICAL, SAVE :: mm_call_hazecoag = .true. 109 115 ! Force all aerosols moments to fall at M0 settling velocity. 110 LOGICAL, SAVE :: mm_wsed_m0 = .false.116 LOGICAL, SAVE :: mm_wsed_m0 = .false. 111 117 ! Force all aerosols moments to fall at M3 settling velocity. 112 LOGICAL, SAVE :: mm_wsed_m3 = .false.118 LOGICAL, SAVE :: mm_wsed_m3 = .false. 113 119 ! Enable/Disable spherical probability transfert. 114 LOGICAL, SAVE :: mm_ w_ps2s = .true.120 LOGICAL, SAVE :: mm_call_ps2s = .true. 115 121 ! Enable/Disable aerosol electric charge correction. 116 LOGICAL, SAVE :: mm_ w_qe = .true.122 LOGICAL, SAVE :: mm_call_qe = .true. 117 123 118 124 ! Cloud model: … … 134 140 ! Initialization control flag [[mm_globals(module):mm_aerosols_init(function)]]. 135 141 LOGICAL, PUBLIC, SAVE :: mm_ini_aer = .false. 142 ! Initialization control flag [[mm_globals(module):mm_clouds_init(function)]]. 143 LOGICAL, PUBLIC, SAVE :: mm_ini_cld = .false. 136 144 137 145 ! ~~~~~~~~~~~~~~~~~~~~~~~ … … 197 205 !~~~~~~~~~~~~~ 198 206 ! Total number of cloud condensation nuclei minimum threshold. 199 ! REAL(kind=mm_wp), SAVE :: mm_m0ccn_min = 1.e-8_mm_wp 207 REAL(kind=mm_wp), SAVE :: mm_m0ccn_min = 1.e-8_mm_wp 208 ! Total volume of cloud condensation nuclei minimum threshold. 209 REAL(kind=mm_wp), SAVE :: mm_m3ccn_min = 1.e-35_mm_wp 200 210 ! Total volume of cloud drop minimum threshold. 201 !REAL(kind=mm_wp), SAVE :: mm_m3cld_min = 1.e-35_mm_wp211 REAL(kind=mm_wp), SAVE :: mm_m3cld_min = 1.e-35_mm_wp 202 212 ! Characteristic cloud drop radius minimum threshold. 203 !REAL(kind=mm_wp), SAVE :: mm_drad_min = 1.e-9_mm_wp213 REAL(kind=mm_wp), SAVE :: mm_drad_min = 1.e-9_mm_wp 204 214 ! Characteristic cloud drop radius Maximum threshold. 205 ! REAL(kind=mm_wp), SAVE :: mm_drad_max = 1.e-2_mm_wp215 REAL(kind=mm_wp), SAVE :: mm_drad_max = 1.e-3_mm_wp 206 216 207 217 ! Planet radius (m) and gravity acceleration (m.s-2). … … 354 364 REAL(kind=mm_wp), DIMENSION(:), ALLOCATABLE, SAVE :: mm_dzlay 355 365 366 ! Haze model: 367 ! ~~~~~~~~~~~ 356 368 ! Spherical mode - 0th order moment (m-3). 357 369 REAL(kind=mm_wp), DIMENSION(:), ALLOCATABLE, SAVE :: mm_m0aer_s … … 392 404 REAL(kind=mm_wp), DIMENSION(:), ALLOCATABLE, SAVE :: mm_aer_f_flux 393 405 406 ! Cloud model: 407 ! ~~~~~~~~~~~~ 408 ! Cloud condensation nuclei - 0th order moment (m-3). 409 REAL(kind=mm_wp), DIMENSION(:), ALLOCATABLE, SAVE :: mm_m0ccn 410 ! Cloud condensation nuclei - 3rd order moment (m3.m-3). 411 REAL(kind=mm_wp), DIMENSION(:), ALLOCATABLE, SAVE :: mm_m3ccn 412 ! Mean drop radius (m). 413 REAL(kind=mm_wp), DIMENSION(:), ALLOCATABLE, SAVE :: mm_drad 414 ! Mean Drop density (kg.m-3). 415 REAL(kind=mm_wp), DIMENSION(:), ALLOCATABLE, SAVE :: mm_drho 416 417 ! Ice components - 3rd order moments (m3.m-3). 418 ! It is a 2D array with the vertical layers in first dimension, and 419 ! the number of ice components in the second. 420 REAL(kind=mm_wp), DIMENSION(:,:), ALLOCATABLE, SAVE :: mm_m3ice 421 ! Condensible species molar fraction (mol.mol-1). 422 ! It is a 2D array with the vertical layers in first dimension, and 423 ! the number of condensible species in the second. 424 REAL(kind=mm_wp), DIMENSION(:,:), ALLOCATABLE, SAVE :: mm_gas 425 426 ! CCN precipitation (kg.m-2). 427 REAL(kind=mm_wp), SAVE :: mm_ccn_prec = 0._mm_wp 428 ! Ice components precipitation (kg.m-2). 429 REAL(kind=mm_wp), DIMENSION(:), ALLOCATABLE, SAVE :: mm_ice_prec 430 431 ! CCN (and ices) settling velocity (m.s-1). 432 REAL(kind=mm_wp), DIMENSION(:), ALLOCATABLE, SAVE :: mm_cld_vsed 433 434 ! CCN mass fluxes (kg.m-2.s-1). 435 REAL(kind=mm_wp), DIMENSION(:), ALLOCATABLE, SAVE :: mm_ccn_flux 436 ! Ice components sedimentation fluxes (kg.m-2.s-1). 437 REAL(kind=mm_wp), DIMENSION(:,:), ALLOCATABLE, SAVE :: mm_ice_fluxes 438 439 ! Condensible species saturation ratio. 440 REAL(kind=mm_wp), DIMENSION(:,:), ALLOCATABLE, SAVE :: mm_gas_sat 441 ! Condensible components nucleation rates (m-2.s-1). 442 REAL(kind=mm_wp), DIMENSION(:,:), ALLOCATABLE, SAVE :: mm_nrate 443 ! Condensible components growth rates (m2.s-1). 444 REAL(kind=mm_wp), DIMENSION(:,:), ALLOCATABLE, SAVE :: mm_grate 445 446 ! --- OPENMP --------------- 394 447 ! All variables related to column computations should be private to each thread 395 !$OMP THREADPRIVATE(mm_ini_col,mm_ini_aer )448 !$OMP THREADPRIVATE(mm_ini_col,mm_ini_aer,mm_ini_cld) 396 449 !$OMP THREADPRIVATE(mm_zlay,mm_zlev,mm_play,mm_plev,mm_temp,mm_rhoair,mm_btemp,mm_dzlev,mm_dzlay) 397 450 !$OMP THREADPRIVATE(mm_m0aer_s,mm_m3aer_s,mm_m0aer_f,mm_m3aer_f) 398 !$OMP THREADPRIVATE(mm_rcs,mm_rcf) 399 !$OMP THREADPRIVATE(mm_m0as_vsed,mm_m3as_vsed,mm_m0af_vsed,mm_m3af_vsed) 400 !$OMP THREADPRIVATE(mm_aer_s_flux,mm_aer_f_flux) 451 !$OMP THREADPRIVATE(mm_m0ccn,mm_m3ccn,mm_m3ice,mm_gas) 452 !$OMP THREADPRIVATE(mm_rcs,mm_rcf,mm_drad,mm_drho) 453 !$OMP THREADPRIVATE(mm_m0as_vsed,mm_m3as_vsed,mm_m0af_vsed,mm_m3af_vsed,mm_cld_vsed) 454 !$OMP THREADPRIVATE(mm_aer_s_flux,mm_aer_f_flux,mm_ccn_prec,mm_ice_prec,mm_ccn_flux,mm_ice_fluxes,mm_gas_sat,mm_nrate,mm_grate) 401 455 !$OMP THREADPRIVATE(mm_m0as_min,mm_m3as_min,mm_rcs_min,mm_m0af_min,mm_m3af_min,mm_rcf_min) 456 !$OMP THREADPRIVATE(mm_m0ccn_min,mm_m3ccn_min,mm_m3cld_min,mm_drad_min,mm_drad_max) 402 457 !$OMP THREADPRIVATE(mm_nla,mm_nle) 458 ! -------------------------- 403 459 404 460 ! Interface to global initialization. … … 417 473 END INTERFACE mm_check_opt 418 474 475 ! Interface to cloud properties methods. 476 ! The method computes clouds properties (mean drop radius and denstity) from their afferent 477 ! moments. It is overloaded to compute properties at a single level or over all the vertical 478 ! atmospheric structure. 479 INTERFACE mm_cloud_properties 480 MODULE PROCEDURE cldprop_sc,cldprop_ve 481 END INTERFACE mm_cloud_properties 482 419 483 420 484 CONTAINS … … 425 489 !============================================================================ 426 490 427 FUNCTION mm_global_init_0(dt,df,rm,rho_aer, haze_prod_pCH4,p_prod,tx_prod,rc_prod,&428 rplanet,g0,air_rad,air_mmol, &429 coag_interactions, w_haze_prod,w_haze_sed,w_haze_coag,&430 force_wsed_to_m0,force_wsed_to_m3, &431 m0as_min,rcs_min,m0af_min,rcf_min, &432 clouds,spcfile, debug) RESULT(err)491 FUNCTION mm_global_init_0(dt,df,rm,rho_aer,call_CH4hazeprod,p_prod,tx_prod,rc_prod, & 492 rplanet,g0,air_rad,air_mmol, & 493 coag_interactions,call_hazeprod,call_hazesed,call_hazecoag,& 494 force_wsed_to_m0,force_wsed_to_m3, & 495 m0as_min,rcs_min,m0af_min,rcf_min, & 496 clouds,spcfile,m0ccn_min,drad_min,debug) RESULT(err) 433 497 !! Initialize global parameters of the model. 434 498 !! … … 449 513 REAL(kind=mm_wp), INTENT(in) :: rho_aer 450 514 ! Enable/Disable production from CH4 photolysis. 451 LOGICAL, INTENT(in) :: haze_prod_pCH4515 LOGICAL, INTENT(in) :: call_CH4hazeprod 452 516 ! Aerosol production pressure level (Pa). 453 517 REAL(kind=mm_wp), INTENT(in) :: p_prod … … 468 532 INTEGER, INTENT(in) :: coag_interactions 469 533 ! Haze production process control flag. 470 LOGICAL, INTENT(in) :: w_haze_prod534 LOGICAL, INTENT(in) :: call_hazeprod 471 535 ! Haze sedimentation process control flag. 472 LOGICAL, INTENT(in) :: w_haze_sed536 LOGICAL, INTENT(in) :: call_hazesed 473 537 ! Haze coagulation process control flag. 474 LOGICAL, INTENT(in) :: w_haze_coag538 LOGICAL, INTENT(in) :: call_hazecoag 475 539 ! Force __all__ aerosols moments to fall at M0 settling velocity. 476 540 LOGICAL, INTENT(in) :: force_wsed_to_m0 … … 491 555 ! Clouds microphysics condensible species properties file. 492 556 CHARACTER(len=*), INTENT(in) :: spcfile 557 ! Minimum threshold for M0 of cloud condensation nuceli (m-3). 558 REAL(kind=mm_wp), INTENT(in) :: m0ccn_min 559 ! Minimum threshold for the cloud drop radius (m). 560 REAL(kind=mm_wp), INTENT(in) :: drad_min 493 561 494 562 ! Debug mode control flag. … … 512 580 513 581 ! Free parameters: 514 mm_dt = dt515 mm_df = df516 mm_rm = rm517 mm_rhoaer = rho_aer518 mm_ haze_prod_pCH4 = haze_prod_pCH4519 mm_p_prod = p_prod520 mm_tx_prod = tx_prod521 mm_rc_prod = rc_prod522 mm_rpla = rplanet523 mm_g0 = g0524 mm_air_rad = air_rad525 mm_air_mmol = air_mmol526 mm_air_mmas = air_mmol / mm_navo582 mm_dt = dt 583 mm_df = df 584 mm_rm = rm 585 mm_rhoaer = rho_aer 586 mm_call_CH4hazeprod = call_CH4hazeprod 587 mm_p_prod = p_prod 588 mm_tx_prod = tx_prod 589 mm_rc_prod = rc_prod 590 mm_rpla = rplanet 591 mm_g0 = g0 592 mm_air_rad = air_rad 593 mm_air_mmol = air_mmol 594 mm_air_mmas = air_mmol / mm_navo 527 595 528 596 ! Microphysical processes - Haze: … … 532 600 RETURN 533 601 ENDIF 534 mm_ w_haze_prod = w_haze_prod535 mm_ w_haze_sed = w_haze_sed536 mm_ w_haze_coag = w_haze_coag537 mm_wsed_m0 = force_wsed_to_m0538 mm_wsed_m3 = force_wsed_to_m3602 mm_call_hazeprod = call_hazeprod 603 mm_call_hazesed = call_hazesed 604 mm_call_hazecoag = call_hazecoag 605 mm_wsed_m0 = force_wsed_to_m0 606 mm_wsed_m3 = force_wsed_to_m3 539 607 540 608 ! Moment threshold flags: 541 609 mm_m0as_min = MAX(0._mm_wp,m0as_min) 542 mm_rcs_min = MAX(1.e- 10_mm_wp,rcs_min)610 mm_rcs_min = MAX(1.e-9_mm_wp,rcs_min) 543 611 mm_m0af_min = MAX(0._mm_wp,m0af_min) 544 612 mm_rcf_min = MAX(mm_rm,rcf_min) … … 591 659 ENDIF 592 660 ENDDO 661 662 ! Moment threshold flags: 663 mm_m0ccn_min = MAX(0._mm_wp,m0ccn_min) 664 mm_drad_min = MAX(1.e-9_mm_wp,drad_min) 665 666 ! Computes M3 thresholds: 667 mm_m3ccn_min = mm_m0ccn_min*mm_alpha_s(3._mm_wp) * mm_rcs_min**3._mm_wp 668 mm_m3cld_min = mm_m0ccn_min * mm_drad_min**3._mm_wp 593 669 ENDIF ! end of mm_call_clouds 594 670 … … 645 721 err = mm_check_opt(cfg_get_value(cfg,"rho_aer",mm_rhoaer),mm_rhoaer,wlog=mm_log) 646 722 IF (err/=0) RETURN 647 err = mm_check_opt(cfg_get_value(cfg,"call_haze_prod",mm_ haze_prod_pCH4),mm_haze_prod_pCH4,wlog=mm_log)723 err = mm_check_opt(cfg_get_value(cfg,"call_haze_prod",mm_call_CH4hazeprod),mm_call_CH4hazeprod,wlog=mm_log) 648 724 IF (err/=0) RETURN 649 725 err = mm_check_opt(cfg_get_value(cfg,"p_prod",mm_p_prod),mm_p_prod,wlog=mm_log) … … 671 747 RETURN 672 748 ENDIF 673 err = mm_check_opt(cfg_get_value(cfg,"haze_production",mm_ w_haze_prod),mm_w_haze_prod,wlog=mm_log)674 IF (err/=0) RETURN 675 err = mm_check_opt(cfg_get_value(cfg,"haze_sedimentation",mm_ w_haze_sed),mm_w_haze_sed,wlog=mm_log)676 IF (err/=0) RETURN 677 err = mm_check_opt(cfg_get_value(cfg,"haze_coagulation",mm_ w_haze_coag),mm_w_haze_coag,wlog=mm_log)749 err = mm_check_opt(cfg_get_value(cfg,"haze_production",mm_call_hazeprod),mm_call_hazeprod,wlog=mm_log) 750 IF (err/=0) RETURN 751 err = mm_check_opt(cfg_get_value(cfg,"haze_sedimentation",mm_call_hazesed),mm_call_hazesed,wlog=mm_log) 752 IF (err/=0) RETURN 753 err = mm_check_opt(cfg_get_value(cfg,"haze_coagulation",mm_call_hazecoag),mm_call_hazecoag,wlog=mm_log) 678 754 IF (err/=0) RETURN 679 755 err = mm_check_opt(cfg_get_value(cfg,"wsed_m0",mm_wsed_m0),mm_wsed_m0,wlog=mm_log) … … 936 1012 ! Initialization of aerosol tracers: 937 1013 ! @note: mm_dzlev is already from top to ground 938 mm_m0aer_s = m0aer_s(mm_nla:1:-1) /mm_dzlev(:)939 mm_m3aer_s = m3aer_s(mm_nla:1:-1) /mm_dzlev(:)940 mm_m0aer_f = m0aer_f(mm_nla:1:-1) /mm_dzlev(:)941 mm_m3aer_f = m3aer_f(mm_nla:1:-1) /mm_dzlev(:)1014 mm_m0aer_s = m0aer_s(mm_nla:1:-1) / mm_dzlev(:) 1015 mm_m3aer_s = m3aer_s(mm_nla:1:-1) / mm_dzlev(:) 1016 mm_m0aer_f = m0aer_f(mm_nla:1:-1) / mm_dzlev(:) 1017 mm_m3aer_f = m3aer_f(mm_nla:1:-1) / mm_dzlev(:) 942 1018 943 1019 ! Setup threshold (useful for preventing bugs): … … 962 1038 963 1039 END FUNCTION mm_aerosols_init 1040 1041 FUNCTION mm_clouds_init(m0ccn,m3ccn,m3ice,gas) RESULT(err) 1042 !! Initialize clouds tracers vertical grid. 1043 !! 1044 !! The subroutine initializes cloud microphysics tracers columns. It allocates variables if 1045 !! required and stores input vectors in reversed order. It also computes the mean drop radius 1046 !! and density and allocates diagnostic vectors. 1047 !! 1048 !! @note 1049 !! All the input arguments should be defined from __GROUND__ to __TOP__. 1050 !! 1051 !! @warning 1052 !! [[mm_global_init(interface)]] and [[mm_column_init(function)]] must have been called at least once before this method is called. 1053 !! Moreover, this method should be after each call of [[mm_column_init(function)]] to reflect changes in the 1054 !! vertical atmospheric structure. 1055 !! 1056 REAL(kind=mm_wp), DIMENSION(:), INTENT(in) :: m0ccn ! 0th order moment of the CCN distribution (m-2). 1057 REAL(kind=mm_wp), DIMENSION(:), INTENT(in) :: m3ccn ! 3rd order moment of the CCN distribution (m3.m-2). 1058 REAL(kind=mm_wp), DIMENSION(:,:), INTENT(in) :: m3ice ! 3rd order moments of the ice components (m3.m-2). 1059 REAL(kind=mm_wp), DIMENSION(:,:), INTENT(in) :: gas ! Condensible species gas molar fraction (mol.mol-1). 1060 1061 INTEGER :: i 1062 TYPE(error) :: err ! Error status of the function. 1063 1064 err = noerror 1065 IF (.NOT.mm_ini) THEN 1066 err = error("Global initialization not done yet",-8) 1067 RETURN 1068 ENDIF 1069 1070 IF (.NOT.mm_call_clouds) THEN 1071 IF (mm_debug) WRITE(*,'(a)') "[MM_DEBUG - mm_clouds_init]: Cloud microphysic is not enabled..." 1072 RETURN 1073 ENDIF 1074 1075 ! Allocate variable if required: 1076 IF (.NOT.ALLOCATED(mm_m0ccn)) ALLOCATE(mm_m0ccn(mm_nla)) 1077 IF (.NOT.ALLOCATED(mm_m3ccn)) ALLOCATE(mm_m3ccn(mm_nla)) 1078 IF (.NOT.ALLOCATED(mm_m3ice)) ALLOCATE(mm_m3ice(mm_nla,mm_nesp)) 1079 IF (.NOT.ALLOCATED(mm_gas)) ALLOCATE(mm_gas(mm_nla,mm_nesp)) 1080 IF (.NOT.ALLOCATED(mm_drad)) ALLOCATE(mm_drad(mm_nla)) 1081 IF (.NOT.ALLOCATED(mm_drho)) ALLOCATE(mm_drho(mm_nla)) 1082 1083 ! Allocate memory for diagnostics: 1084 mm_ccn_prec = 0._mm_wp 1085 IF (.NOT.ALLOCATED(mm_ice_prec)) THEN 1086 ALLOCATE(mm_ice_prec(mm_nesp)) ; mm_ice_prec(:) = 0._mm_wp 1087 ENDIF 1088 IF (.NOT.ALLOCATED(mm_cld_vsed)) THEN 1089 ALLOCATE(mm_cld_vsed(mm_nla)) ; mm_cld_vsed(:) = 0._mm_wp 1090 ENDIF 1091 IF (.NOT.ALLOCATED(mm_ccn_flux)) THEN 1092 ALLOCATE(mm_ccn_flux(mm_nla)) ; mm_ccn_flux(:) = 0._mm_wp 1093 ENDIF 1094 IF (.NOT.ALLOCATED(mm_ice_fluxes)) THEN 1095 ALLOCATE(mm_ice_fluxes(mm_nla,mm_nesp)) ; mm_ice_fluxes(:,:) = 0._mm_wp 1096 ENDIF 1097 IF (.NOT.ALLOCATED(mm_gas_sat)) THEN 1098 ALLOCATE(mm_gas_sat(mm_nla,mm_nesp)) ; mm_gas_sat(:,:) = 0._mm_wp 1099 ENDIF 1100 IF (.NOT.ALLOCATED(mm_nrate)) THEN 1101 ALLOCATE(mm_nrate(mm_nla,mm_nesp)) ; mm_nrate(:,:) = 0._mm_wp 1102 ENDIF 1103 IF (.NOT.ALLOCATED(mm_grate)) THEN 1104 ALLOCATE(mm_grate(mm_nla,mm_nesp)) ; mm_grate(:,:) = 0._mm_wp 1105 ENDIF 1106 1107 ! /!\ mm_dzlev already from top to ground 1108 mm_m0ccn = m0ccn(mm_nla:1:-1) / mm_dzlev(:) 1109 mm_m3ccn = m3ccn(mm_nla:1:-1) / mm_dzlev(:) 1110 DO i = 1, mm_nesp 1111 mm_m3ice(:,i) = m3ice(mm_nla:1:-1,i) / mm_dzlev(:) 1112 mm_gas(:,i) = gas(mm_nla:1:-1,i) 1113 ENDDO 1114 1115 ! Setup threshold: 1116 call mm_set_moments_cld_thresholds() 1117 1118 ! Drop mean radius and density: 1119 call mm_cloud_properties(mm_m0ccn,mm_m3ccn,mm_m3ice,mm_drad,mm_drho) 1120 1121 ! End of initialization: 1122 mm_ini_cld = .true. 1123 1124 END FUNCTION mm_clouds_init 964 1125 965 1126 … … 1063 1224 ! CLOUD RELATED METHODS 1064 1225 !============================================================================ 1226 1227 SUBROUTINE mm_set_moments_cld_thresholds() 1228 !! Apply minimum threshold for the cloud drop moments. 1229 !! The method resets moments values to zero if their current value is below the minimum threholds. 1230 !! 1231 INTEGER :: i, j 1232 REAL(kind=mm_wp) :: m3cld = 0._mm_wp 1233 1234 DO i = 1, mm_nla 1235 m3cld = mm_m3ccn(i) 1236 DO j = 1, mm_nesp 1237 m3cld = m3cld + mm_m3ice(i,j) 1238 ENDDO 1239 1240 IF ((mm_m0ccn(i) < mm_m0ccn_min) .OR. (mm_m3ccn(i) < mm_m3ccn_min) .OR. (m3cld < mm_m3cld_min)) THEN 1241 mm_m0ccn(i) = 0._mm_wp 1242 mm_m3ccn(i) = 0._mm_wp 1243 DO j = 1, mm_nesp 1244 mm_m3ice(i,j) = 0._mm_wp 1245 ENDDO 1246 ENDIF 1247 ENDDO 1248 END SUBROUTINE mm_set_moments_cld_thresholds 1249 1250 1251 SUBROUTINE cldprop_sc(m0ccn,m3ccn,m3ice,drad,drho) 1252 !! Get cloud drop properties (scalar). 1253 !! The method computes the mean radius and mean density of cloud drops. 1254 !! 1255 !! @warning 1256 !! If __drad__ is greater than __drmax__ it is automatically set to __drmax__, but computation of 1257 !! __drho__ remains unmodified. So __drho__ is not correct in that case! 1258 !! 1259 REAL(kind=mm_wp), INTENT(in) :: m0ccn ! 0th order moment of the ccn 1260 REAL(kind=mm_wp), INTENT(in) :: m3ccn ! 3rd order moment of the ccn 1261 REAL(kind=mm_wp), INTENT(in), DIMENSION(:) :: m3ice ! 3rd order moments of each ice component 1262 REAL(kind=mm_wp), INTENT(out) :: drad ! Output mean drop radius 1263 REAL(kind=mm_wp), INTENT(out), OPTIONAL :: drho ! Optional output mean drop density 1264 1265 REAL(kind=mm_wp) :: Ntot, Vtot, Wtot 1266 REAL(kind=mm_wp), PARAMETER :: athird = 1._mm_wp / 3._mm_wp 1267 REAL(kind=mm_wp), PARAMETER :: pifac = (4._mm_wp * mm_pi) / 3._mm_wp 1268 1269 ! Set to zero : 1270 drad = 0._mm_wp 1271 IF (PRESENT(drho)) drho = 0._mm_wp 1272 1273 ! Initialization : 1274 Ntot = m0ccn 1275 Vtot = m3ccn + SUM(m3ice) 1276 Wtot = m3ccn*mm_rhoaer + SUM(m3ice*mm_xESPS(:)%rho_s) 1277 1278 IF (Ntot <= mm_m0ccn_min .OR. Vtot <= mm_m3cld_min) THEN 1279 drad = mm_drad_min 1280 IF (PRESENT(drho)) drho = mm_rhoaer 1281 ELSE 1282 drad = (Vtot / Ntot)**athird 1283 drad = MAX(MIN(drad,mm_drad_max),mm_drad_min) 1284 IF (PRESENT(drho)) drho = Wtot / Vtot 1285 ENDIF 1286 1287 RETURN 1288 END SUBROUTINE cldprop_sc 1289 1290 SUBROUTINE cldprop_ve(m0ccn,m3ccn,m3ice,drad,drho) 1291 !! Get cloud drop properties (vector). 1292 !! 1293 !! The method performs the same computations than [[cldprop_sc(subroutine)]] 1294 !! but for the entire vertical atmospheric structure. 1295 !! 1296 REAL(kind=mm_wp), INTENT(in), DIMENSION(:) :: m0ccn ! 0th order moment of the ccn. 1297 REAL(kind=mm_wp), INTENT(in), DIMENSION(:) :: m3ccn ! 3rd order moment of the ccn. 1298 REAL(kind=mm_wp), INTENT(in), DIMENSION(:,:) :: m3ice ! 3rd order moments of each ice component. 1299 REAL(kind=mm_wp), INTENT(out), DIMENSION(:) :: drad ! Output mean drop radius. 1300 REAL(kind=mm_wp), INTENT(out), DIMENSION(:), OPTIONAL :: drho ! Optional output mean drop density. 1301 1302 INTEGER :: i 1303 1304 IF (PRESENT(drho)) THEN 1305 DO i = 1, SIZE(m0ccn) 1306 call cldprop_sc(m0ccn(i),m3ccn(i),m3ice(i,:),drad(i),drho(i)) 1307 ENDDO 1308 ELSE 1309 DO i = 1, SIZE(m0ccn) 1310 call cldprop_sc(m0ccn(i),m3ccn(i),m3ice(i,:),drad(i)) 1311 ENDDO 1312 ENDIF 1313 1314 RETURN 1315 END SUBROUTINE cldprop_ve 1316 1065 1317 1066 1318 FUNCTION read_esp(parser,sec,pp) RESULT (err) … … 1127 1379 1128 1380 ! Haze production: 1129 WRITE(*,'(a,L2)') "mm_ w_haze_prod : ", mm_w_haze_prod1381 WRITE(*,'(a,L2)') "mm_call_hazeprod : ", mm_call_hazeprod 1130 1382 WRITE(*,'(a,ES14.7)') "mm_rc_prod (m) : ", mm_rc_prod 1131 WRITE(*,'(a,L2)') "mm_ haze_prod_pCH4 : ", mm_haze_prod_pCH41132 IF (.NOT. mm_ haze_prod_pCH4) THEN1383 WRITE(*,'(a,L2)') "mm_call_CH4hazeprod : ", mm_call_CH4hazeprod 1384 IF (.NOT. mm_call_CH4hazeprod) THEN 1133 1385 WRITE(*,'(a,ES14.7)') " --> mm_p_prod (Pa) : ", mm_p_prod 1134 1386 WRITE(*,'(a,ES14.7)') " --> mm_tx_prod (kg.m-2.s-1): ", mm_tx_prod … … 1137 1389 1138 1390 ! Haze coagulation: 1139 WRITE(*,'(a,L2)') "mm_ w_haze_coag : ", mm_w_haze_coag1140 IF (mm_ w_haze_coag) THEN1391 WRITE(*,'(a,L2)') "mm_call_hazecoag : ", mm_call_hazecoag 1392 IF (mm_call_hazecoag) THEN 1141 1393 WRITE(*,'(a,I2.2)') " --> mm_coag_interactions : ", mm_coag_choice 1142 1394 ENDIF 1143 1395 1144 1396 ! Haze sedimentation: 1145 WRITE(*,'(a,L2)') "mm_ w_haze_sed : ", mm_w_haze_sed1146 IF (mm_ w_haze_sed) THEN1397 WRITE(*,'(a,L2)') "mm_call_hazesed : ", mm_call_hazesed 1398 IF (mm_call_hazesed) THEN 1147 1399 WRITE(*,'(a,L2)') " --> mm_wsed_m0 : ", mm_wsed_m0 1148 1400 WRITE(*,'(a,L2)') " --> mm_wsed_m3 : ", mm_wsed_m3 … … 1157 1409 WRITE(*,'(a,ES14.7)') " mm_m0af_min (m-3) : ", mm_m0af_min 1158 1410 WRITE(*,'(a,ES14.7)') " mm_rcf_min (m) : ", mm_rcf_min 1411 WRITE(*,'(a)') "---------------------------------------" 1412 1413 ! Clouds related: 1414 WRITE(*,'(a,L2)') "mm_call_clouds : ", mm_call_clouds 1415 IF (mm_call_clouds) THEN 1416 WRITE(*,'(a)') " Thresholds clouds drop" 1417 WRITE(*,'(a,ES14.7)') " --> mm_m0ccn_min : ", mm_m0ccn_min 1418 WRITE(*,'(a,ES14.7)') " --> mm_drad_min : ", mm_drad_min 1419 WRITE(*,'(a,ES14.7)') " --> mm_drad_max : ", mm_drad_max 1420 ENDIF 1159 1421 WRITE(*,'(a)') "---------------------------------------" 1160 1422 -
trunk/LMDZ.PLUTO/libf/muphypluto/mp2m_haze.F90
r3951 r3952 99 99 100 100 ! Coagulation 101 IF (mm_ w_haze_coag) THEN101 IF (mm_call_hazecoag) THEN 102 102 call mm_haze_coagulation(dm0a_s,dm3a_s,dm0a_f,dm3a_f) 103 103 ENDIF 104 104 105 105 ! Sedimentation 106 IF (mm_ w_haze_sed) THEN106 IF (mm_call_hazesed) THEN 107 107 call mm_haze_sedimentation(zdm0as,zdm3as,zdm0af,zdm3af) 108 108 … … 119 119 120 120 ! Production 121 IF (mm_ w_haze_prod) THEN121 IF (mm_call_hazeprod) THEN 122 122 ! Production by photolysis of CH4 123 IF (mm_ haze_prod_pCH4) THEN123 IF (mm_call_CH4hazeprod) THEN 124 124 dm0a_s = dm0a_s + (m3a_s_prod / (mm_rc_prod**3 * mm_alpha_s(3._mm_wp))) 125 125 dm3a_s = dm3a_s + m3a_s_prod -
trunk/LMDZ.PLUTO/libf/muphypluto/mp2m_intgcm.F90
r3951 r3952 8 8 ! 9 9 ! The module also contains three methods: 10 ! - mm_initialize(dt, haze_prod_pCH4,p_prod,tx_prod,rc_prod,rm,df,rho_aer,rplanet,g0,air_rad,air_mmol,cfgpath)10 ! - mm_initialize(dt,call_CH4hazeprod,p_prod,tx_prod,rc_prod,rm,df,rho_aer,rplanet,g0,air_rad,air_mmol,cfgpath) 11 11 ! - read_aprm(parser,sec,pp) 12 12 ! - abort_program(err) … … 29 29 CONTAINS 30 30 31 SUBROUTINE mm_initialize(dt, haze_prod_pCH4,p_prod,tx_prod,rc_prod,rm,df,rho_aer,rplanet,g0,air_rad,air_mmol,clouds,cfgpath)31 SUBROUTINE mm_initialize(dt,call_CH4hazeprod,p_prod,tx_prod,rc_prod,rm,df,rho_aer,rplanet,g0,air_rad,air_mmol,clouds,cfgpath) 32 32 !! Initialize global parameters of the model. 33 33 !! … … 46 46 REAL(kind=mm_wp), INTENT(in) :: dt 47 47 ! Enable/Disable production from CH4 photolysis. 48 LOGICAL :: haze_prod_pCH448 LOGICAL :: call_CH4hazeprod 49 49 ! Aerosol production pressure level (Pa). 50 50 REAL(kind=mm_wp), INTENT(in) :: p_prod … … 84 84 ! Thresholds related parameters. 85 85 REAL(kind=mm_wp) :: m0as_min,rcs_min,m0af_min,rcf_min 86 REAL(kind=mm_wp) :: m0ccn_min,drad_min 86 87 ! Debug mode control flag (may print lot of stuff if enabled). 87 88 LOGICAL :: wdebug … … 105 106 m0af_min = 1e-8_mm_wp 106 107 rcf_min = 1e-9_mm_wp 108 m0ccn_min = 1e-8_mm_wp 109 drad_min = 1e-9_mm_wp 107 110 wdebug = .false. 108 111 … … 132 135 err = mm_check_opt(cfg_get_value(cparser,"m0af_min",m0af_min) ,m0af_min ,1e-8_mm_wp,mm_log) 133 136 err = mm_check_opt(cfg_get_value(cparser,"rcf_min",rcf_min) ,rcf_min ,rm ,mm_log) 137 err = mm_check_opt(cfg_get_value(cparser,"m0ccn_min",m0ccn_min) ,m0ccn_min ,1e-8_mm_wp,mm_log) 138 err = mm_check_opt(cfg_get_value(cparser,"drad_min",drad_min) ,drad_min ,1e-9_mm_wp,mm_log) 134 139 err = mm_check_opt(cfg_get_value(cparser,"debug",wdebug) ,wdebug ,.false. ,mm_log) 135 140 … … 154 159 ! Transfert probabilities (S --> F): 155 160 ! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 156 err = mm_check_opt(cfg_get_value(cparser, "transfert_probability", mm_ w_ps2s), mm_w_ps2s, wlog=mm_log)161 err = mm_check_opt(cfg_get_value(cparser, "transfert_probability", mm_call_ps2s), mm_call_ps2s, wlog=mm_log) 157 162 IF (err/=0) call abort_program(err) 158 163 159 IF (mm_ w_haze_coag .AND. mm_w_ps2s) THEN164 IF (mm_call_hazecoag .AND. mm_call_ps2s) THEN 160 165 err = mm_check_opt(cfg_get_value(cparser, "ps2s_file", pssfile), pssfile) 161 166 IF (err /= 0) call abort_program(err) … … 177 182 ! Mean electric correction: 178 183 ! ~~~~~~~~~~~~~~~~~~~~~~~~~ 179 err = mm_check_opt(cfg_get_value(cparser, "electric_charging", mm_ w_qe), mm_w_qe, wlog=mm_log)184 err = mm_check_opt(cfg_get_value(cparser, "electric_charging", mm_call_qe), mm_call_qe, wlog=mm_log) 180 185 IF (err/=0) call abort_program(err) 181 186 182 IF (mm_ w_haze_coag .AND. mm_w_qe) THEN187 IF (mm_call_hazecoag .AND. mm_call_qe) THEN 183 188 err = mm_check_opt(cfg_get_value(cparser, "mq_file", mqfile), mqfile) 184 189 IF (err /= 0) call abort_program(err) … … 224 229 ! 2. YAMMS initialization 225 230 !------------------------ 226 err = mm_global_init_0(dt,df,rm,rho_aer,haze_prod_pCH4,p_prod,tx_prod,rc_prod, & 227 rplanet,g0,air_rad,air_mmol,coag_choice, & 228 w_h_prod,w_h_sed,w_h_coag,fwsed_m0,fwsed_m3, & 229 m0as_min,rcs_min,m0af_min,rcf_min, & 230 clouds,spcpath,wdebug) 231 err = mm_global_init_0(dt,df,rm,rho_aer,call_CH4hazeprod,p_prod,tx_prod,rc_prod, & 232 rplanet,g0,air_rad,air_mmol,coag_choice, & 233 w_h_prod,w_h_sed,w_h_coag,fwsed_m0,fwsed_m3, & 234 m0as_min,rcs_min,m0af_min,rcf_min, & 235 clouds,spcpath,m0ccn_min,drad_min & 236 wdebug) 231 237 IF (err /= 0) call abort_program(err) 232 238 233 239 ! Dump parameters. 234 240 WRITE(*,'(a)') "========= MUPHYS PARAMETERS ===========" 235 WRITE(*,'(a,L2)') "transfert_probability: ", mm_ w_ps2s236 WRITE(*,'(a,L2)') "electric_charging : ", mm_ w_qe241 WRITE(*,'(a,L2)') "transfert_probability: ", mm_call_ps2s 242 WRITE(*,'(a,L2)') "electric_charging : ", mm_call_qe 237 243 call mm_dump_parameters() 238 244 -
trunk/LMDZ.PLUTO/libf/muphypluto/mp2m_methods.F90
r3560 r3952 98 98 99 99 res = 1._mm_wp 100 IF (rcs <= 0.0_mm_wp .OR. .NOT.mm_ w_ps2s) RETURN100 IF (rcs <= 0.0_mm_wp .OR. .NOT.mm_call_ps2s) RETURN 101 101 102 102 SELECT CASE(k+flow) … … 148 148 149 149 chx = 0 150 IF (.NOT.mm_ w_qe) THEN150 IF (.NOT.mm_call_qe) THEN 151 151 res = 1._mm_wp 152 152 RETURN -
trunk/LMDZ.PLUTO/libf/phypluto/mp2m_diagnostics.F90
r3951 r3952 10 10 ! 11 11 ! The module also contains three methods: 12 ! - inimuphy_diag(ngrid,nlayer,nq,pq,int2ext) 13 ! - alpha_s(k) 14 ! - alpha_f(k) 12 ! - inimuphy_diag(ngrid,nlayer,nq,pq,int2ext) | Initialize the variables associated to microphysics diagnostics. 13 ! - alpha_s(k) | Inter-moment relation for spherical aerosols size distribution law. 14 ! - alpha_f(k) | Inter-moment relation for fractal aerosols size distribution law. 15 ! 16 ! @warning 17 ! We suppose a given order of microphysical tracers in micro_indx and micro_ice_indx: 18 ! 1. mu_m0as, 2. mu_m3as, 3. mu_m0af, 4. mu_m3af. 19 ! If clouds are activated: 20 ! 5. mu_m0ccn, 6. mu_m3ccn, 7(+). mu_m3ices. 15 21 ! 16 22 ! Authors … … 20 26 21 27 USE tracer_h 22 28 USE callkeys_mod, only : haze_rc_prod, haze_rm, callmuclouds 29 23 30 IMPLICIT NONE 24 31 32 ! Haze model diagnostics 25 33 REAL(kind=8), ALLOCATABLE, DIMENSION(:) :: mp2m_aer_s_prec ! Spherical aerosols precipitation (kg.m-2.s-1). 26 34 REAL(kind=8), ALLOCATABLE, DIMENSION(:) :: mp2m_aer_f_prec ! Fractal aerosols precipitation (kg.m-2.s-1). … … 31 39 REAL(kind=8), ALLOCATABLE, DIMENSION(:,:) :: mp2m_rc_sph ! Spherical mode characteristic radius, i.e. bulk radius (m). 32 40 REAL(kind=8), ALLOCATABLE, DIMENSION(:,:) :: mp2m_rc_fra ! Fractal mode characteristic radius, i.e. bulk radius (m). 33 34 !$OMP THREADPRIVATE(mp2m_aer_s_prec,mp2m_aer_f_prec,mp2m_aer_s_w,mp2m_aer_f_w,mp2m_aer_s_flux,mp2m_aer_f_flux) 35 !$OMP THREADPRIVATE(mp2m_rc_sph,mp2m_rc_fra) 41 !$OMP THREADPRIVATE(mp2m_aer_s_prec,mp2m_aer_f_prec,mp2m_aer_s_w,mp2m_aer_f_w,mp2m_aer_s_flux,mp2m_aer_f_flux) 42 !$OMP THREADPRIVATE(mp2m_rc_sph,mp2m_rc_fra) 43 44 ! Cloud model diagnostics 45 REAL(kind=8), ALLOCATABLE, DIMENSION(:) :: mp2m_ccn_prec ! CCN precipitation (kg.m-2.s-1). 46 REAL(kind=8), ALLOCATABLE, DIMENSION(:,:) :: mp2m_ice_prec ! Ice precipitation (kg.m-2.s-1). 47 REAL(kind=8), ALLOCATABLE, DIMENSION(:,:) :: mp2m_cld_w ! Cloud drop settling velocity (m.s-1). 48 REAL(kind=8), ALLOCATABLE, DIMENSION(:,:) :: mp2m_ccn_flux ! CCN mass flux (kg.m-2.s-1). 49 REAL(kind=8), ALLOCATABLE, DIMENSION(:,:,:) :: mp2m_ice_fluxes ! Ice mass fluxes (kg.m-2.s-1). 50 REAL(kind=8), ALLOCATABLE, DIMENSION(:,:) :: mp2m_rc_cld ! Cloud drop radius (m). 51 REAL(kind=8), ALLOCATABLE, DIMENSION(:,:,:) :: mp2m_gas_sat ! Condensible gaz saturation ratios. 52 REAL(kind=8), ALLOCATABLE, DIMENSION(:,:,:) :: mp2m_nrate ! Condensible species nucleation rate (m-2.s-1). 53 REAL(kind=8), ALLOCATABLE, DIMENSION(:,:,:) :: mp2m_grate ! Condensible species growth rate (m2.s-1). 54 !$OMP THREADPRIVATE(mp2m_ccn_prec,mp2m_ice_prec,mp2m_cld_w,mp2m_ccn_flux,mp2m_ice_fluxes) 55 !$OMP THREADPRIVATE(mp2m_rc_cld,mp2m_gas_sat,mp2m_nrate,mp2m_grate) 36 56 37 57 CONTAINS … … 40 60 !! Initialize the variables associated to microphysics diagnostics. 41 61 !! 42 use callkeys_mod, only : haze_rc_prod, haze_rm43 44 62 INTEGER, INTENT(in) :: ngrid ! Number of points of the horizontal grid. 45 63 INTEGER, INTENT(in) :: nlayer ! Number of points of the vertical grid (layers). … … 51 69 ! Local variables: 52 70 !~~~~~~~~~~~~~~~~~ 53 REAL, DIMENSION(:,:), ALLOCATABLE :: m0as ! 0th order moment of the spherical mode (m-3). 54 REAL, DIMENSION(:,:), ALLOCATABLE :: m3as ! 3rd order moment of the spherical mode (m3.m-3). 55 REAL, DIMENSION(:,:), ALLOCATABLE :: m0af ! 0th order moment of the fractal mode (m-3). 56 REAL, DIMENSION(:,:), ALLOCATABLE :: m3af ! 3rd order moment of the fractal mode (m3.m-3). 71 INTEGER :: i 72 REAL(kind=8), DIMENSION(:,:), ALLOCATABLE :: m0as ! 0th order moment of the spherical mode (m-3). 73 REAL(kind=8), DIMENSION(:,:), ALLOCATABLE :: m3as ! 3rd order moment of the spherical mode (m3.m-3). 74 REAL(kind=8), DIMENSION(:,:), ALLOCATABLE :: m0af ! 0th order moment of the fractal mode (m-3). 75 REAL(kind=8), DIMENSION(:,:), ALLOCATABLE :: m3af ! 3rd order moment of the fractal mode (m3.m-3). 76 REAL(kind=8), DIMENSION(:,:), ALLOCATABLE :: m0ccn ! 0th order moment of the cloud condensation nuclei (m-3). 77 REAL(kind=8), DIMENSION(:,:), ALLOCATABLE :: m3ccn ! 3rd order moment of the cloud condensation nuclei (m3.m-3). 78 REAL(kind=8), DIMENSION(:,:), ALLOCATABLE :: m3itot ! 3rd order moment of the total ices (m3.m-3). 57 79 58 80 IF (.NOT.ALLOCATED(mp2m_aer_s_prec)) ALLOCATE(mp2m_aer_s_prec(ngrid)) … … 64 86 IF (.NOT.ALLOCATED(mp2m_rc_sph)) ALLOCATE(mp2m_rc_sph(ngrid,nlayer)) 65 87 IF (.NOT.ALLOCATED(mp2m_rc_fra)) ALLOCATE(mp2m_rc_fra(ngrid,nlayer)) 66 88 89 IF (.NOT.ALLOCATED(mp2m_ccn_prec)) ALLOCATE(mp2m_ccn_prec(ngrid)) 90 IF (.NOT.ALLOCATED(mp2m_ice_prec)) ALLOCATE(mp2m_ice_prec(ngrid,nmicro_ices)) 91 IF (.NOT.ALLOCATED(mp2m_cld_w)) ALLOCATE(mp2m_cld_w(ngrid,nlayer)) 92 IF (.NOT.ALLOCATED(mp2m_ccn_flux)) ALLOCATE(mp2m_ccn_flux(ngrid,nlayer)) 93 IF (.NOT.ALLOCATED(mp2m_ice_fluxes)) ALLOCATE(mp2m_ice_fluxes(ngrid,nlayer,nmicro_ices)) 94 IF (.NOT.ALLOCATED(mp2m_rc_cld)) ALLOCATE(mp2m_rc_cld(ngrid,nlayer)) 95 IF (.NOT.ALLOCATED(mp2m_gas_sat)) ALLOCATE(mp2m_gas_sat(ngrid,nlayer,nmicro_ices)) 96 IF (.NOT.ALLOCATED(mp2m_nrate)) ALLOCATE(mp2m_nrate(ngrid,nlayer,nmicro_ices)) 97 IF (.NOT.ALLOCATED(mp2m_grate)) ALLOCATE(mp2m_grate(ngrid,nlayer,nmicro_ices)) 98 99 ALLOCATE(m0as(ngrid,nlayer)) 100 ALLOCATE(m3as(ngrid,nlayer)) 101 ALLOCATE(m0af(ngrid,nlayer)) 102 ALLOCATE(m3af(ngrid,nlayer)) 103 ALLOCATE(m0ccn(ngrid,nlayer)) 104 ALLOCATE(m3ccn(ngrid,nlayer)) 105 ALLOCATE(m3itot(ngrid,nlayer)) 106 107 ! Set to 0: 108 !~~~~~~~~~~ 67 109 mp2m_aer_s_prec(:) = 0d0 68 110 mp2m_aer_f_prec(:) = 0d0 … … 71 113 mp2m_aer_s_flux(:,:) = 0d0 72 114 mp2m_aer_f_flux(:,:) = 0d0 73 74 ! Initializes the radius to their first value (useful for radiative transfer). 75 m0as = pq(:,:,micro_indx(1)) * int2ext 76 m3as = pq(:,:,micro_indx(2)) * int2ext 77 m0af = pq(:,:,micro_indx(3)) * int2ext 78 m3af = pq(:,:,micro_indx(4)) * int2ext 79 115 mp2m_rc_sph(:,:) = 0d0 116 mp2m_rc_fra(:,:) = 0d0 117 118 mp2m_ccn_prec(:) = 0d0 119 mp2m_ice_prec(:,:) = 0d0 120 mp2m_cld_w(:,:) = 0d0 121 mp2m_ccn_flux(:,:) = 0d0 122 mp2m_ice_fluxes(:,:,:) = 0d0 123 mp2m_rc_cld(:,:) = 0d0 124 mp2m_gas_sat(:,:,:) = 0d0 125 mp2m_nrate(:,:,:) = 0d0 126 mp2m_grate(:,:,:) = 0d0 127 128 m0as(:,:) = 0d0 129 m3as(:,:) = 0d0 130 m0af(:,:) = 0d0 131 m3af(:,:) = 0d0 132 m0ccn(:,:) = 0d0 133 m3ccn(:,:) = 0d0 134 m3itot(:,:) = 0d0 135 136 ! Initializes the radius to their first value (useful for radiative transfer): 137 !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 138 ! Spherical aerosols 139 m0as(:,:) = pq(:,:,micro_indx(1)) * int2ext 140 m3as(:,:) = pq(:,:,micro_indx(2)) * int2ext 141 80 142 WHERE(m0as > 1e-8 .AND. m3as > (1e-8*alpha_s(3.)*haze_rc_prod**3)) 81 143 mp2m_rc_sph = (m3as / (m0as*alpha_s(3.)))**(1./3.) … … 84 146 ENDWHERE 85 147 148 ! Fractal aerosols 149 m0af(:,:) = pq(:,:,micro_indx(3)) * int2ext 150 m3af(:,:) = pq(:,:,micro_indx(4)) * int2ext 151 86 152 WHERE(m0af > 1e-8 .AND. m3af > (1e-8*alpha_f(3.)*haze_rm**3)) 87 153 mp2m_rc_fra = (m3af / (m0af*alpha_f(3.)))**(1./3.) … … 89 155 mp2m_rc_fra = 0d0 90 156 ENDWHERE 91 157 158 ! Cloud drops 159 IF (callmuclouds) THEN 160 m0ccn(:,:) = pq(:,:,micro_indx(5)) * int2ext 161 m3ccn(:,:) = pq(:,:,micro_indx(6)) * int2ext 162 DO i=1, size(micro_ice_indx) 163 m3itot(:,:) = m3itot(:,:) + (pq(:,:,micro_ice_indx(i)) * int2ext) 164 ENDDO 165 166 WHERE(m0ccn > 1e-8 .AND. (m3ccn+m3itot) > (1e-8*alpha_f(3.)*haze_rm**3)) 167 mp2m_rc_cld = ((m3ccn+m3itot) / (m0ccn))**(1./3.) 168 ELSEWHERE 169 mp2m_rc_cld = 0d0 170 ENDWHERE 171 ENDIF ! end of callmuclouds 172 92 173 CONTAINS 93 174 -
trunk/LMDZ.PLUTO/libf/phypluto/mp2m_inimufi.F90
r3951 r3952 1 1 subroutine inimufi(ptimestep) 2 2 use callkeys_mod, only : call_haze_prod_pCH4, haze_p_prod, haze_tx_prod, haze_rc_prod, & 3 haze_rm, haze_df, haze_rho, air_rad, &3 haze_rm, haze_df, haze_rho, air_rad, & 4 4 callmuclouds 5 5 use tracer_h -
trunk/LMDZ.PLUTO/libf/phypluto/physiq_mod.F90
r3951 r3952 181 181 ! pdv(ngrid,nlayer) \ Temporal derivative of the corresponding 182 182 ! pdt(ngrid,nlayer) / variables due to physical processes. 183 ! pdq(ngrid,nlayer )/184 ! pdpsrf(ngrid) /183 ! pdq(ngrid,nlayer,nq) / 184 ! pdpsrf(ngrid) / 185 185 ! 186 186 ! … … 2528 2528 call write_output("m3"//TRIM(str(6:)),"Volume of "//TRIM(str(6:))//" ice","m3.m-3",zq(:,:,micro_ice_indx(iq))*int2ext(:,:)) 2529 2529 enddo 2530 2531 ! Diagnostics: 2532 call write_output("ccn_prec","Cloud condensation nuclei precipitation","kg.m-2.s-1",mp2m_ccn_prec(:)) 2533 call write_output("cld_w","Cloud drop settling velocity","m.s-1",mp2m_cld_w(:,:)) 2534 call write_output("ccn_flux","Cloud condensation nuclei mass flux","kg.m-2.s-1",mp2m_ccn_flux(:,:)) 2535 call write_output("rcld","Cloud drop radius","m",mp2m_rc_cld(:,:)) 2536 2537 do iq = 1, size(micro_ice_indx) 2538 str = TRIM(nameOfTracer(micro_ice_indx(iq))) 2539 call write_output(TRIM(str(6:))//"ice_prec",TRIM(str(6:))//" ice precipitation","kg.m-2.s-1",mp2m_ice_prec(:,iq)) 2540 call write_output(TRIM(str(6:))//"ice_flux",TRIM(str(6:))//" ice mass flux","kg.m-2.s-1",mp2m_ice_fluxes(:,:,iq)) 2541 call write_output(TRIM(str(6:))//"_sat",TRIM(str(6:))//" saturation ratio","",mp2m_gas_sat(:,:,iq)) 2542 call write_output(TRIM(str(6:))//"_nrate",TRIM(str(6:))//" nucleation rate","m-2.s-1",mp2m_nrate(:,:,iq)) 2543 call write_output(TRIM(str(6:))//"_grate",TRIM(str(6:))//" ice growth rate","m2.s-1",mp2m_grate(:,:,iq)) 2544 enddo 2530 2545 endif ! end callmuclouds 2531 2546 endif ! end callmufi
Note: See TracChangeset
for help on using the changeset viewer.
