Changeset 5623 for LMDZ6


Ignore:
Timestamp:
Apr 21, 2025, 7:25:01 PM (7 weeks ago)
Author:
aborella
Message:

Small bug corrections + temporary patch for children tracers in ICO (back to full parents tracers) + now truly no aviation data needed to run

Location:
LMDZ6/branches/contrails
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • LMDZ6/branches/contrails/DefLists/context_input_lmdz.xml

    r5619 r5623  
    434434<field_definition>
    435435
    436   <field id ="KMFLOWN_read" field_ref="KMFLOWN_id"  read_access="true" />
    437   <field id ="KMFLOWN_interp" field_ref="KMFLOWN_read"  read_access="true" grid_ref="grid_from_aviation" />
     436  <field id ="KMFLOWN_read" field_ref="KMFLOWN_id"  enabled="false" read_access="true" />
     437  <field id ="KMFLOWN_interp" field_ref="KMFLOWN_read"  enabled="false" read_access="true" grid_ref="grid_from_aviation" />
    438438
    439439</field_definition>
  • LMDZ6/branches/contrails/libf/misc/readTracFiles_mod.f90

    r5618 r5623  
    121121  !--- SOME PARAMETERS THAT ARE NOT LIKELY TO CHANGE OFTEN
    122122  CHARACTER(LEN=maxlen), SAVE      :: tran0        = 'air'      !--- Default transporting fluid
    123   CHARACTER(LEN=maxlen), PARAMETER :: old_phases   = 'vlib'     !--- Old phases for water (no separator)
    124   CHARACTER(LEN=maxlen), PARAMETER :: known_phases = 'glsb'     !--- Known phases initials
     123  CHARACTER(LEN=maxlen), PARAMETER :: old_phases   = 'vlibfcapqt'     !--- Old phases for water (no separator)
     124  CHARACTER(LEN=maxlen), PARAMETER :: known_phases = 'glsbfcapqt'     !--- Known phases initials
    125125  INTEGER, PARAMETER :: nphases = LEN_TRIM(known_phases)        !--- Number of phases
    126126  CHARACTER(LEN=maxlen), SAVE      :: phases_names(nphases) &   !--- Known phases names
    127                                 = ['gaseous  ', 'liquid   ', 'solid    ','blownSnow']
     127                                = ['gaseous  ', 'liquid   ', 'solid    ','blownSnow', 'fraccld  ', 'cldvap   ', 'avifrac  ', 'pavifra  ', 'qvapavi  ', 'ticeavi  ']
    128128  CHARACTER(LEN=1),      SAVE :: phases_sep  =  '_'             !--- Phase separator
    129129  CHARACTER(LEN=maxlen), SAVE :: isoFile = 'isotopes_params.def'!--- Name of the isotopes parameters file
  • LMDZ6/branches/contrails/libf/phylmd/infotrac_phy.F90

    r5618 r5623  
    369369   iqva = strIdx(tracers(:)%name, 'CONTWATER_g')
    370370   iqia = strIdx(tracers(:)%name, 'CONTWATER_s')
     371   !--Two ways of declaring tracers - the way below should be deleted in the future
     372   IF (icf.EQ.0) icf  = strIdx(tracers(:)%name, addPhase('H2O', 'f'))
     373   IF (iqvc.EQ.0) iqvc = strIdx(tracers(:)%name, addPhase('H2O', 'c'))
     374   IF (icfa.EQ.0) icfa = strIdx(tracers(:)%name, addPhase('H2O', 'a'))
     375   IF (ipcf.EQ.0) ipcf = strIdx(tracers(:)%name, addPhase('H2O', 'p'))
     376   IF (iqva.EQ.0) iqva = strIdx(tracers(:)%name, addPhase('H2O', 'q'))
     377   IF (iqia.EQ.0) iqia = strIdx(tracers(:)%name, addPhase('H2O', 't'))
    371378
    372379   IF(CPPKEY_STRATAER .AND. type_trac == 'coag') THEN
  • LMDZ6/branches/contrails/libf/phylmd/lmdz_aviation.f90

    r5619 r5623  
    288288IF (grid_type==unstructured) THEN
    289289
    290     ! Activate aviation file
    291     IF (is_omp_master) CALL xios_set_file_attr("aviation", enabled=.TRUE.)
    292 
    293     ! Get number of vertical levels and level values
    294     IF (is_omp_master) CALL xios_get_axis_attr( "aviation_lev", n_glo=nleva )
     290    IF (is_omp_master) THEN
     291      ! Activate aviation file
     292      CALL xios_set_file_attr("aviation", enabled=.TRUE.)
     293      ! Activate aviation fields
     294      CALL xios_set_field_attr("KMFLOWN_read", enabled=.TRUE.)
     295      CALL xios_set_field_attr("KMFLOWN_interp", enabled=.TRUE.)
     296
     297      ! Get number of vertical levels and level values
     298      CALL xios_get_axis_attr( "aviation_lev", n_glo=nleva )
     299    ENDIF
    295300    CALL bcast_omp(nleva)
    296301
  • LMDZ6/branches/contrails/libf/phylmd/lmdz_lscp_condensation.f90

    r5615 r5623  
    245245! for dissipation
    246246REAL :: pdf_shape
     247REAL :: dcf_sub_tmp, dqvc_sub_tmp
    247248!
    248249! for condensation
     
    532533          !--incld_ice_thresh times the saturation
    533534          IF ( qiceincld .LT. ( incld_ice_thresh * qsat(i) ) ) THEN
    534             dcf_sub(i) = ( qiceincld / ( incld_ice_thresh * qsat(i) ) - 1. ) * cldfra(i)
    535             dqvc_sub(i) = qvapincld * dcf_sub(i)
    536 
    537             cldfra(i) = cldfra(i) + dcf_sub(i)
    538             qcld(i) = qcld(i) + dqvc_sub(i)
    539             qvc(i) = qvc(i) + dqvc_sub(i)
    540             clrfra(i) = MIN(1., clrfra(i) - dcf_sub(i))
    541             qclr(i) = qclr(i) - dqvc_sub(i)
     535            dcf_sub_tmp = ( qiceincld / ( incld_ice_thresh * qsat(i) ) - 1. ) * cldfra(i)
     536            dqvc_sub_tmp = qvapincld * dcf_sub_tmp
     537
     538            cldfra(i) = cldfra(i) + dcf_sub_tmp
     539            qcld(i) = qcld(i) + dqvc_sub_tmp
     540            qvc(i) = qvc(i) + dqvc_sub_tmp
     541            clrfra(i) = MIN(1., clrfra(i) - dcf_sub_tmp)
     542            qclr(i) = qclr(i) - dqvc_sub_tmp
     543          ELSE
     544            dcf_sub_tmp = 0.
     545            dqvc_sub_tmp = 0.
    542546          ENDIF
    543547
     
    590594            clrfra(i) = MIN(1., clrfra(i) - dcf_sub(i))
    591595            qclr(i)   = qclr(i) - dqvc_sub(i) - dqi_sub(i)
    592           ENDIF ! qvapincld_new .GT. 0.
    593 
    594 
    595           !------------------------------------
    596           !--       PHASE ADJUSTMENT        --
    597           !------------------------------------
    598 
    599           IF ( qvapincld_new .EQ. 0. ) THEN
     596          ELSEIF ( qvapincld_new .EQ. 0. ) THEN
    600597            !--If all the ice has been sublimated, we sublimate
    601598            !--completely the cloud and do not activate the dissipation
     
    606603            dqi_sub(i) = - ( qcld(i) - qvc(i) )
    607604
     605            !--Add tendencies
    608606            cldfra(i) = 0.
    609607            qcld(i) = 0.
     
    611609            clrfra(i) = MIN(1., clrfra(i) - dcf_sub(i))
    612610            qclr(i) = qclr(i) - dqvc_sub(i) - dqi_sub(i)
    613           ELSE
     611          ENDIF ! qvapincld_new .GT. qvapincld
     612
     613          !--We readd previously calculated dcf_sub_tmp and dqvc_sub_tmp to the diagnostics
     614          dcf_sub(i) = dcf_sub(i) + dcf_sub_tmp
     615          dqvc_sub(i) = dqvc_sub(i) + dqvc_sub_tmp
     616
     617
     618          !------------------------------------
     619          !--       PHASE ADJUSTMENT        --
     620          !------------------------------------
     621
     622          IF ( qvapincld_new .GT. 0. ) THEN
    614623            !--Adjustment of the IWC to the new vapor in cloud
    615624            !--(this can be either positive or negative)
     
    840849          qiceinmix = ( qcld(i) - qvc(i) ) / cldfra(i) / ( 1. + clrfra_mix / cldfra_mix )
    841850          tauinv_depsub = qiceinmix**(1./3.) * kappa_depsub
    842           qvapinmix_lim = qsat(i) - qiceinmix / ( 1. - EXP( - dtime * tauinv_depsub ) )
     851          qvapinmix_lim = qsat(i) - qiceinmix / ( 1. - EXP( - dtime / 2. * tauinv_depsub ) )
    843852          qvapinclr_lim = qvapinmix_lim * ( 1. + cldfra_mix / clrfra_mix ) &
    844853                        - qvc(i) / cldfra(i) * cldfra_mix / clrfra_mix
     
    11171126          IF ( ok_unadjusted_clouds .AND. .NOT. ok_warm_cloud ) THEN
    11181127            tauinv_depsub = qiceincld**(1./3.) * kappa_depsub
    1119             qvapinclr_lim = qsat(i) - qiceincld / ( 1. - EXP( - dtime * tauinv_depsub ) )
     1128            qvapinclr_lim = qsat(i) - qiceincld / ( 1. - EXP( - dtime / 2. * tauinv_depsub ) )
    11201129          ELSE
    11211130            qvapinclr_lim = qsat(i) - qiceincld
     
    11441153            dcf_sed(i)  = clrfra_sed * pdf_fra_above_lim / clrfra(i)
    11451154            dqvc_sed(i) = dcf_sed(i) * pdf_q_above_lim / pdf_fra_above_lim
    1146             !--We include the sedimentated ice:
    1147             dqi_sed(i)  = qiceincld &    !--We include the sedimentated ice:
    1148                         * ( dcf_sed(i) & !--the part that falls in the newly formed cloud and
    1149                           + cldfra(i) )  !--the part that falls in the existing cloud
    1150                        
    11511155          ENDIF
     1156          !--We include the sedimentated ice:
     1157          dqi_sed(i)  = qiceincld &    !--We include the sedimentated ice:
     1158                      * ( dcf_sed(i) & !--the part that falls in the newly formed cloud and
     1159                        + cldfra(i) )  !--the part that falls in the existing cloud
    11521160
    11531161        ELSE
  • LMDZ6/branches/contrails/libf/phylmd/physiq_mod.F90

    r5618 r5623  
    24732473             cf_seri(i,k)  = qx(i,k,icf)
    24742474             qvc_seri(i,k) = qx(i,k,iqvc)
     2475             !--DYNAMICO can return NaNs for children tracers
     2476             IF (ISNAN(qvc_seri(i,k))) qvc_seri(i,k) = 0.
    24752477          ENDIF
    24762478          IF (ok_plane_contrail) THEN
     
    24792481             qva_seri(i,k) = qx(i,k,iqva)
    24802482             qia_seri(i,k) = qx(i,k,iqia)
     2483             !--DYNAMICO can return NaNs for children tracers
     2484             IF (ISNAN(cfa_seri(i,k))) cfa_seri(i,k) = 0.
     2485             IF (ISNAN(pcf_seri(i,k))) pcf_seri(i,k) = 0.
     2486             IF (ISNAN(qva_seri(i,k))) qva_seri(i,k) = 0.
     2487             IF (ISNAN(qia_seri(i,k))) qia_seri(i,k) = 0.
    24812488          ENDIF
    24822489       ENDDO
Note: See TracChangeset for help on using the changeset viewer.