Changeset 4293 for LMDZ6/trunk


Ignore:
Timestamp:
Oct 4, 2022, 9:42:41 PM (2 years ago)
Author:
dcugnet
Message:

Commit for Nicolas: fixes for StratAer?.

Location:
LMDZ6/trunk/libf/phylmd
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • LMDZ6/trunk/libf/phylmd/StratAer/calcaerosolstrato_rrtm.F90

    r3677 r4293  
    1616  INCLUDE "clesphys.h"
    1717  INCLUDE "paramet.h"
    18   INCLUDE "thermcell.h"
    1918  INCLUDE "iniprint.h"
    2019
  • LMDZ6/trunk/libf/phylmd/StratAer/micphy_tstep.F90

    r3677 r4293  
    77  USE dimphy, ONLY : klon,klev
    88  USE aerophys
    9   USE infotrac_phy
     9  USE infotrac_phy, ONLY : nbtr_bin, nbtr_sulgas, nbtr, id_H2SO4_strat
    1010  USE phys_local_var_mod, ONLY: mdw, budg_3D_nucl, budg_3D_cond_evap, budg_h2so4_to_part, R2SO4, DENSO4, f_r_wet
    1111  USE nucleation_tstep_mod
     
    4747  REAL ASO4(nbtr_bin)
    4848  REAL DNDR(nbtr_bin)
    49   REAL H2SO4_sat(nbtr_bin)
     49  REAL H2SO4_sat
    5050
    5151  DO it=1,nbtr_bin
     
    107107             & ACTSO4(ilon,ilev),R2SO4(ilon,ilev),DENSO4(ilon,ilev),f_r_wet(ilon,ilev), &
    108108             & RRSI,Vbin,FL,ASO4,DNDR)
     109      ! Compute H2SO4 saturate vapor for big particules
     110      H2SO4_sat = DNDR(nbtr_bin)/(pplay(ilon,ilev)/t_seri(ilon,ilev)/RD/1.E6/mH2SO4mol)
    109111      ! consider only condensation (positive FL)
    110112      DO it=1,nbtr_bin
     
    117119      ENDDO
    118120      ! determine appropriate time step
    119       dt=(H2SO4_init-H2SO4_sat(nbtr_bin))/float(nbtstep)/MAX(1.e-30, nucl_rate+cond_evap_rate) !cond_evap_rate pos. for cond. and neg. for evap.
     121      dt=(H2SO4_init-H2SO4_sat)/float(nbtstep)/MAX(1.e-30, nucl_rate+cond_evap_rate) !cond_evap_rate pos. for cond. and neg. for evap.
    120122      IF (dt.LT.0.0) THEN
    121123        dt=PDT
  • LMDZ6/trunk/libf/phylmd/StratAer/nucleation_tstep_mod.F90

    r3690 r4293  
    604604     na_n=x_n*ntot_n
    605605     IF (na_n .LT. 1.) THEN
    606         print *, 'Warning: number of acid molecules < 1 in nucleation regime, setting na_n=1'
     606!        print *, 'Warning: number of acid molecules < 1 in nucleation regime, setting na_n=1'
    607607        na_n=1.0
    608608     ENDIF
  • LMDZ6/trunk/libf/phylmd/StratAer/strataer_mod.F90

    r3930 r4293  
    7979    !Config Help = Used in physiq.F
    8080    !
    81     flag_sulf_emit = 0
     81    flag_sulf_emit = 0 ! Background (default)
     82    flag_sulf_emit_distrib = 0 ! Gaussian (default)
    8283    nErupt = 0 ! eruption number
    8384    injdur = 0 ! init injection duration
     
    8788       CALL getin_p('nErupt',nErupt)
    8889       CALL getin_p('injdur',injdur)
     90       CALL getin_p('flag_sulf_emit_distrib',flag_sulf_emit_distrib)
     91
     92       year_emit_vol=0 ; mth_emit_vol=0 ; day_emit_vol=0
     93       m_aer_emiss_vol=0. ; altemiss_vol=0. ; sigma_alt_vol=0.
     94       xlon_min_vol=0. ; xlon_max_vol=0.
     95       xlat_min_vol=0. ; xlat_max_vol=0.
     96
     97       IF (nErupt.GT.0) THEN
     98          ALLOCATE(year_emit_vol(nErupt),mth_emit_vol(nErupt),day_emit_vol(nErupt))
     99          ALLOCATE(m_aer_emiss_vol(nErupt),altemiss_vol(nErupt),sigma_alt_vol(nErupt))
     100          ALLOCATE(xlat_min_vol(nErupt),xlon_min_vol(nErupt))
     101          ALLOCATE(xlat_max_vol(nErupt),xlon_max_vol(nErupt))
     102       ELSE
     103          WRITE(lunout,*) 'ERROR : Using flag_sulf_emit=1 (ie Volcanic eruption) but nErupt (',nErupt,') <=0 !'
     104          CALL abort_physic('strataer_mod','No eruption define in physiq_def (nErupt=0). Add one or use background condition.',1)
     105       ENDIF
     106
     107       CALL getin_p('year_emit_vol',year_emit_vol)
     108       CALL getin_p('mth_emit_vol',mth_emit_vol)
     109       CALL getin_p('day_emit_vol',day_emit_vol)
     110       CALL getin_p('m_aer_emiss_vol',m_aer_emiss_vol)
     111       CALL getin_p('altemiss_vol',altemiss_vol)
     112       CALL getin_p('sigma_alt_vol',sigma_alt_vol)
     113       CALL getin_p('xlon_min_vol',xlon_min_vol)
     114       CALL getin_p('xlon_max_vol',xlon_max_vol)
     115       CALL getin_p('xlat_min_vol',xlat_min_vol)
     116       CALL getin_p('xlat_max_vol',xlat_max_vol)
    89117    ELSEIF (flag_sulf_emit == 2) THEN ! SAI
    90118       CALL getin_p('m_aer_emiss_sai',m_aer_emiss_sai)
     
    93121       CALL getin_p('xlat_sai',xlat_sai)
    94122       CALL getin_p('xlon_sai',xlon_sai)
    95        CALL getin_p('flag_sulf_emit_distrib',flag_sulf_emit_distrib)
    96123    ELSEIF (flag_sulf_emit == 3) THEN ! SAI between latitudes
    97124       CALL getin_p('m_aer_emiss_sai',m_aer_emiss_sai)
     
    101128       CALL getin_p('xlat_max_sai',xlat_max_sai)
    102129       CALL getin_p('xlat_min_sai',xlat_min_sai)
    103        CALL getin_p('flag_sulf_emit_distrib',flag_sulf_emit_distrib)
    104130    ENDIF
    105131
    106     ALLOCATE(year_emit_vol(nErupt),mth_emit_vol(nErupt),day_emit_vol(nErupt))
    107     ALLOCATE(m_aer_emiss_vol(nErupt),altemiss_vol(nErupt),sigma_alt_vol(nErupt))
    108     ALLOCATE(xlat_min_vol(nErupt),xlon_min_vol(nErupt))
    109     ALLOCATE(xlat_max_vol(nErupt),xlon_max_vol(nErupt))
    110    
    111     IF (nErupt.GT.0) THEN
    112       year_emit_vol=0 ; mth_emit_vol=0 ; day_emit_vol=0
    113       m_aer_emiss_vol=0. ; altemiss_vol=0. ; sigma_alt_vol=0.
    114       xlon_min_vol=0. ; xlon_max_vol=0.
    115       xlat_min_vol=0. ; xlat_max_vol=0.
    116     ENDIF
    117    
    118     CALL getin_p('year_emit_vol',year_emit_vol)
    119     CALL getin_p('mth_emit_vol',mth_emit_vol)
    120     CALL getin_p('day_emit_vol',day_emit_vol)
    121     CALL getin_p('m_aer_emiss_vol',m_aer_emiss_vol)
    122     CALL getin_p('altemiss_vol',altemiss_vol)
    123     CALL getin_p('sigma_alt_vol',sigma_alt_vol)
    124     CALL getin_p('xlon_min_vol',xlon_min_vol)
    125     CALL getin_p('xlon_max_vol',xlon_max_vol)
    126     CALL getin_p('xlat_min_vol',xlat_min_vol)
    127     CALL getin_p('xlat_max_vol',xlat_max_vol)
    128132    !Config Key  = flag_nuc_rate_box
    129133    !Config Desc = define or not a box for nucleation rate
     
    136140    !
    137141    flag_nuc_rate_box = .FALSE.
     142    nuclat_min=0  ; nuclat_max=0
     143    nucpres_min=0 ; nucpres_max=0
     144
    138145    CALL getin_p('flag_nuc_rate_box',flag_nuc_rate_box)
    139146    CALL getin_p('nuclat_min',nuclat_min)
     
    153160       WRITE(lunout,*) 'IN STRATAER : altemiss_vol',altemiss_vol
    154161       WRITE(lunout,*) 'IN STRATAER : sigma_alt_vol',sigma_alt_vol
    155        WRITE(lunout,*) 'IN STRATAER : ponde_lonlat_vol',ponde_lonlat_vol
    156162       WRITE(lunout,*) 'IN STRATAER : xlat_min_vol',xlat_min_vol
    157163       WRITE(lunout,*) 'IN STRATAER : xlat_max_vol',xlat_max_vol
     
    164170       WRITE(lunout,*) 'IN STRATAER : xlat_sai',xlat_sai
    165171       WRITE(lunout,*) 'IN STRATAER : xlon_sai',xlon_sai
    166        WRITE(lunout,*) 'flag_sulf_emit_distrib = ',flag_sulf_emit_distrib
    167172    ELSEIF (flag_sulf_emit == 3) THEN
    168173       WRITE(lunout,*) 'IN STRATAER : m_aer_emiss_sai',m_aer_emiss_sai
     
    172177       WRITE(lunout,*) 'IN STRATAER : xlat_max_sai',xlat_max_sai
    173178       WRITE(lunout,*) 'IN STRATAER : xlon_sai',xlon_sai
    174        WRITE(lunout,*) 'flag_sulf_emit_distrib = ',flag_sulf_emit_distrib
    175179    ENDIF
     180    WRITE(lunout,*) 'flag_sulf_emit_distrib = ',flag_sulf_emit_distrib
    176181    WRITE(lunout,*) 'IN STRATAER : flag_nuc_rate_box = ',flag_nuc_rate_box
    177182    IF (flag_nuc_rate_box) THEN
     
    181186    !ENDIF
    182187
    183     CALL strataer_ponde_init
    184     WRITE(lunout,*) 'IN STRATAER INT2 END'
     188    IF (flag_sulf_emit == 1) THEN
     189       CALL strataer_ponde_init
     190       WRITE(lunout,*) 'IN STRATAER INT2 END'
     191    END IF
     192    WRITE(lunout,*) 'IN STRATAER END'
    185193
    186194  END SUBROUTINE strataer_init
  • LMDZ6/trunk/libf/phylmd/StratAer/traccoag_mod.F90

    r3677 r4293  
    1717
    1818    USE dimphy
    19     USE infotrac_phy
     19    USE infotrac_phy, ONLY : nbtr_bin, nbtr_sulgas, nbtr, id_SO2_strat
    2020    USE aerophys
    2121    USE geometry_mod, ONLY : cell_area, boundslat
     
    2323    USE mod_phys_lmdz_mpi_data, ONLY :  is_mpi_root
    2424    USE mod_phys_lmdz_para, only: gather, scatter
    25     USE phys_cal_mod
     25    USE phys_cal_mod, ONLY : year_len, year_cur,mth_cur, day_cur, hour
    2626    USE sulfate_aer_mod
    2727    USE phys_local_var_mod, ONLY: stratomask
     
    2929    USE print_control_mod, ONLY: lunout
    3030    USE strataer_mod
    31     USE phys_cal_mod, ONLY : year_len
    3231
    3332    IMPLICIT NONE
  • LMDZ6/trunk/libf/phylmd/infotrac_phy.F90

    r4232 r4293  
    1616   PUBLIC :: nqtot,   nbtr,   nqo,   nqCO2,   nqtottr      !--- Main dimensions
    1717   PUBLIC :: conv_flg, pbl_flg                             !--- Convection & boundary layer activation keys
     18#ifdef CPP_StratAer
     19   PUBLIC :: nbtr_bin, nbtr_sulgas                         !--- Number of aerosols bins and sulfur gases for StratAer model
     20   PUBLIC :: id_OCS_strat, id_SO2_strat, id_H2SO4_strat, id_BIN01_strat, id_TEST_strat
     21#endif
    1822
    1923   !=== FOR ISOTOPES: General
  • LMDZ6/trunk/libf/phylmd/phys_output_write_mod.F90

    r4263 r4293  
    481481#ifdef CPP_StratAer
    482482    LOGICAL, PARAMETER :: debug_strataer=.FALSE.
     483    CHARACTER(LEN=maxlen) :: unt
    483484#endif
    484485    REAL,DIMENSION(klon,klev) :: z, dz
  • LMDZ6/trunk/libf/phylmd/phytrac_mod.F90

    r4170 r4293  
    707707                !--with the full array tr_seri even if only item it is processed
    708708
    709                 print*,'CV SCAV ',it,ccntrAA(it),ccntrENV(it)
    710 
    711709                CALL cvltr_scav(pdtphys, da, phi,phi2,d1a,dam, mp,ep,         &
    712710                     sigd,sij,wght_cvfd,clw,elij,epmlmMm,eplaMm,              &     
Note: See TracChangeset for help on using the changeset viewer.