Changeset 4164


Ignore:
Timestamp:
Apr 2, 2026, 9:15:00 AM (5 days ago)
Author:
emillour
Message:

Genric PCM:
Some changes following the "thermodynamics update":

  • bug fix on the size of pplev
  • renaming the module to something more explicit (thermo_mod.F90 => pcm_thermodynamics_mod.F90) and the Exner&potential temperature update routine "thermodynamics" => "thermodynamics_update"
  • some optimizations in "thermodynamics_update" : in the 'thermo_uni_ideal' case seting r(),cpp() and rcp() can be done at first call only.

EM

Location:
trunk/LMDZ.GENERIC
Files:
10 edited
1 moved

Legend:

Unmodified
Added
Removed
  • trunk/LMDZ.GENERIC/changelog.txt

    r4146 r4164  
    22522252Some fixes will be added as the model is tested in various configurations.
    22532253
     2254== 02/04/2026 ==
     2255Some changes following the "thermodynamics update":
     2256- bug fix on the size of pplev
     2257- renaming the module to something more explicit (thermo_mod.F90 =>
     2258  pcm_thermodynamics_mod.F90) and the Exner&potential temperature update
     2259  routine "thermodynamics" => "thermodynamics_update"
     2260- some optimizations in "thermodynamics_update" : in the 'thermo_uni_ideal'
     2261  case seting r(),cpp() and rcp() can be done at first call only.
  • trunk/LMDZ.GENERIC/libf/phygeneric/condensation_generic_mod.F90

    r4146 r4164  
    1111        USE mod_phys_lmdz_para, only: is_master
    1212        use generic_tracer_index_mod, only: generic_tracer_index
    13         use thermo_mod
     13        use pcm_thermodynamics_mod, only: cpp
    1414        use comcstfi_mod
    1515        IMPLICIT none
  • trunk/LMDZ.GENERIC/libf/phygeneric/conduction.F90

    r4146 r4164  
    88                        tsurf,zzlev,zzlay,muvar,qvar,firstcall,zdtconduc)
    99   
    10       use thermo_mod, only: cpp,r
     10      use pcm_thermodynamics_mod, only: cpp,r
    1111      use callkeys_mod, only: phitop_conduc,zztop,a_coeff,s_coeff,force_conduction
    1212      use conc_mod,     only: lambda
  • trunk/LMDZ.GENERIC/libf/phygeneric/convadj.F90

    r4146 r4164  
    1717      use callkeys_mod, only: tracer,water,generic_condensation, &
    1818                              virtual_theta_correction, thermo_phy
    19       use thermo_mod
    2019
    2120      implicit none
  • trunk/LMDZ.GENERIC/libf/phygeneric/moistadj_generic.F90

    r4146 r4164  
    55   use tracer_h
    66   use callkeys_mod, only: moist_convection_inhibition, thermo_phy, metallicity
    7    use thermo_mod
    87   use comcstfi_mod
    98
  • trunk/LMDZ.GENERIC/libf/phygeneric/molvis.F90

    r4146 r4164  
    1212      use conc_mod,     only: lambda
    1313      use gases_h
    14       use thermo_mod
     14      use pcm_thermodynamics_mod, only: cpp, r
    1515
    1616!=======================================================================
  • trunk/LMDZ.GENERIC/libf/phygeneric/pcm_thermodynamics_mod.F90

    r4163 r4164  
    1       module thermo_mod
     1      module pcm_thermodynamics_mod
    22
    33      use comcstfi_mod, only: cppd_ref,cppv_ref,rd_ref, rcp_ref, mugaz_ref
     
    1212      contains
    1313     
    14       subroutine thermodynamics(thermo_phy, pplay, pplev, t, ngrid, nlayer, nq, q, iq, zh, zpopsk)
    15         CHARACTER(64), INTENT(IN) :: thermo_phy               ! flag
    16         REAL, INTENT(IN)    :: pplay(ngrid,nlayer)      ! pressure (Pa)
    17         REAL, INTENT(IN)    :: pplev(ngrid,nlayer)      ! pressure (Pa)
     14      subroutine thermodynamics_update(thermo_phy, pplay, pplev, t, ngrid, nlayer, nq, q, iq, zh, zpopsk)
     15        CHARACTER(LEN=*), INTENT(IN) :: thermo_phy               ! flag
     16        REAL, INTENT(IN)    :: pplay(ngrid,nlayer)    ! pressure (Pa) at mid-layer
     17        REAL, INTENT(IN)    :: pplev(ngrid,nlayer+1)  ! pressure (Pa) at layer interfaces
    1818        REAL, INTENT(IN)    :: t(ngrid,nlayer)      ! temperature (K)
    1919        INTEGER, INTENT(IN) :: ngrid, nlayer,nq     ! Number of cells, vertical layers and tracers
     
    2727        logical, save :: firstcall=.true.
    2828!$OMP THREADPRIVATE(firstcall)
     29        character(len=80),parameter :: myname = "thermodynamics_update"
    2930       
    3031        if (firstcall) then
     
    3233          ALLOCATE(cpp(ngrid,nlayer))
    3334          ALLOCATE(rcp(ngrid,nlayer))
     35         
     36          SELECT CASE (TRIM(thermo_phy))
     37            CASE('thermo_uni_ideal')
     38              ! Ideal gas, homogeneous
     39              r(:,:) = rd_ref
     40              cpp(:,:) = cppd_ref
     41              rcp(:,:) = rcp_ref
     42            CASE DEFAULT
     43            write(*,*) 'Bad selector for thermodynamics mod: <', TRIM(thermo_phy), '>'
     44            call abort_physic(trim(myname),'Bad selector for thermodynamics mod!',1)
     45          END SELECT
     46         
    3447          firstcall=.false.
    35         endif
     48        endif ! of if (firstcall)
    3649       
    3750        SELECT CASE (TRIM(thermo_phy))
     
    3952         CASE('thermo_uni_ideal')
    4053            ! Ideal gas
    41             r(:,:) = rd_ref
    42             cpp(:,:) = cppd_ref
    43             rcp(:,:) = rcp_ref
    4454            do l=1,nlayer
    4555              do ig=1,ngrid
     
    5161            write(*,*) 'Bad selector for thermodynamics mod: <', TRIM(thermo_phy), '>'
    5262            write(*,*) 'Option is <thermo_uni_ideal>'
    53             call abort
     63            call abort_physic(trim(myname),'Bad selector for thermodynamics mod!',1)
    5464        END SELECT
    5565       
    56         end subroutine thermodynamics
     66        end subroutine thermodynamics_update
    5767       
    58         end module thermo_mod
     68        end module pcm_thermodynamics_mod
  • trunk/LMDZ.GENERIC/libf/phygeneric/physiq_mod.F90

    r4146 r4164  
    6363                            obliquit, nres, z0
    6464      use comcstfi_mod, only: pi, g, rcp_ref, rd_ref, rad, mugaz_ref, cppd_ref
    65       use thermo_mod
     65      use pcm_thermodynamics_mod, only: thermodynamics_update, r, cpp
    6666      use time_phylmdz_mod, only: daysec
    6767      use callkeys_mod, only: albedo_spectral_mode, calladj, calldifv, &
     
    855855        igcm_generic_vap=1
    856856      endif
    857       call thermodynamics(thermo_phy, pplay, pplev, pt, ngrid, nlayer, nq, pq, igcm_generic_vap, zh, zpopsk)
     857      call thermodynamics_update(thermo_phy, pplay, pplev, pt, ngrid, nlayer, nq, pq, igcm_generic_vap, zh, zpopsk)
    858858
    859859! ------------------------------------------------------
     
    12231223         
    12241224         ! Update thermodynamics
    1225          call thermodynamics(thermo_phy, pplay, pplev, pt+pdt*ptimestep, ngrid, nlayer, nq, pq+pdq*ptimestep, igcm_generic_vap,zh,zpopsk)
     1225         call thermodynamics_update(thermo_phy, pplay, pplev, pt+pdt*ptimestep, ngrid, nlayer, nq, pq+pdq*ptimestep, igcm_generic_vap,zh,zpopsk)
    12261226
    12271227         ! Test of energy conservation
     
    13051305
    13061306         ! Update thermodynamics
    1307          call thermodynamics(thermo_phy, pplay, pplev, pt+pdt*ptimestep, ngrid, nlayer, nq, pq+pdq*ptimestep, igcm_generic_vap,zh,zpopsk)
     1307         call thermodynamics_update(thermo_phy, pplay, pplev, pt+pdt*ptimestep, ngrid, nlayer, nq, pq+pdq*ptimestep, igcm_generic_vap,zh,zpopsk)
    13081308         
    13091309         ! test energy conservation
     
    14181418         
    14191419         ! Update thermodynamics
    1420          call thermodynamics(thermo_phy, pplay, pplev, pt+pdt*ptimestep, ngrid, nlayer, nq, pq+pdq*ptimestep, igcm_generic_vap,zh,zpopsk)
     1420         call thermodynamics_update(thermo_phy, pplay, pplev, pt+pdt*ptimestep, ngrid, nlayer, nq, pq+pdq*ptimestep, igcm_generic_vap,zh,zpopsk)
    14211421
    14221422      ENDIF ! end of 'calltherm'
     
    14511451         
    14521452         ! Update thermodynamics
    1453          call thermodynamics(thermo_phy, pplay, pplev, pt+pdt*ptimestep, ngrid, nlayer, nq, pq+pdq*ptimestep, igcm_generic_vap,zh,zpopsk)
     1453         call thermodynamics_update(thermo_phy, pplay, pplev, pt+pdt*ptimestep, ngrid, nlayer, nq, pq+pdq*ptimestep, igcm_generic_vap,zh,zpopsk)
    14541454
    14551455         ! Test energy conservation
     
    15051505         
    15061506         ! Update thermodynamics
    1507          call thermodynamics(thermo_phy, pplay, pplev, pt+pdt*ptimestep, ngrid, nlayer, nq, pq+pdq*ptimestep, igcm_generic_vap,zh,zpopsk)
     1507         call thermodynamics_update(thermo_phy, pplay, pplev, pt+pdt*ptimestep, ngrid, nlayer, nq, pq+pdq*ptimestep, igcm_generic_vap,zh,zpopsk)
    15081508
    15091509      ENDIF ! of IF (calllott_nonoro)
     
    15341534
    15351535         ! Update thermodynamics
    1536          call thermodynamics(thermo_phy, pplay, pplev, pt+pdt*ptimestep, ngrid, nlayer, nq, pq+pdq*ptimestep, igcm_generic_vap,zh,zpopsk)
     1536         call thermodynamics_update(thermo_phy, pplay, pplev, pt+pdt*ptimestep, ngrid, nlayer, nq, pq+pdq*ptimestep, igcm_generic_vap,zh,zpopsk)
    15371537
    15381538         ! test energy conservation
     
    15891589                 
    15901590                  ! Update thermodynamics
    1591                   call thermodynamics(thermo_phy, pplay, pplev, pt+pdt*ptimestep, ngrid, nlayer, nq, pq+pdq*ptimestep, igcm_generic_vap,zh,zpopsk)
     1591                  call thermodynamics_update(thermo_phy, pplay, pplev, pt+pdt*ptimestep, ngrid, nlayer, nq, pq+pdq*ptimestep, igcm_generic_vap,zh,zpopsk)
    15921592
    15931593                  ! Test energy conservation.
     
    16291629               
    16301630               ! Update thermodynamics
    1631                call thermodynamics(thermo_phy, pplay, pplev, pt+pdt*ptimestep, ngrid, nlayer, nq, pq+pdq*ptimestep, igcm_generic_vap,zh,zpopsk)
     1631               call thermodynamics_update(thermo_phy, pplay, pplev, pt+pdt*ptimestep, ngrid, nlayer, nq, pq+pdq*ptimestep, igcm_generic_vap,zh,zpopsk)
    16321632
    16331633               ! Test energy conservation.
     
    16791679               
    16801680               ! Update thermodynamics
    1681                call thermodynamics(thermo_phy, pplay, pplev, pt+pdt*ptimestep, ngrid, nlayer, nq, pq+pdq*ptimestep, igcm_generic_vap,zh,zpopsk)
     1681               call thermodynamics_update(thermo_phy, pplay, pplev, pt+pdt*ptimestep, ngrid, nlayer, nq, pq+pdq*ptimestep, igcm_generic_vap,zh,zpopsk)
    16821682
    16831683               ! Test energy conservation.
     
    17651765           
    17661766           ! Update thermodynamics
    1767            call thermodynamics(thermo_phy, pplay, pplev, pt+pdt*ptimestep, ngrid, nlayer, nq, pq+pdq*ptimestep, igcm_generic_vap,zh,zpopsk)
     1767           call thermodynamics_update(thermo_phy, pplay, pplev, pt+pdt*ptimestep, ngrid, nlayer, nq, pq+pdq*ptimestep, igcm_generic_vap,zh,zpopsk)
    17681768
    17691769         END IF  ! of IF (photochem)
     
    17901790               
    17911791               ! Update thermodynamics
    1792                call thermodynamics(thermo_phy, pplay, pplev, pt+pdt*ptimestep, ngrid, nlayer, nq, pq+pdq*ptimestep, igcm_generic_vap,zh,zpopsk)
     1792               call thermodynamics_update(thermo_phy, pplay, pplev, pt+pdt*ptimestep, ngrid, nlayer, nq, pq+pdq*ptimestep, igcm_generic_vap,zh,zpopsk)
    17931793
    17941794               ! Test energy conservation.
     
    18301830           
    18311831            ! Update thermodynamics
    1832             call thermodynamics(thermo_phy, pplay, pplev, pt+pdt*ptimestep, ngrid, nlayer, nq, pq+pdq*ptimestep, igcm_generic_vap,zh,zpopsk)
     1832            call thermodynamics_update(thermo_phy, pplay, pplev, pt+pdt*ptimestep, ngrid, nlayer, nq, pq+pdq*ptimestep, igcm_generic_vap,zh,zpopsk)
    18331833
    18341834            if(enertest)then
     
    18921892           
    18931893            ! Update thermodynamics
    1894             call thermodynamics(thermo_phy, pplay, pplev, pt+pdt*ptimestep, ngrid, nlayer, nq, pq+pdq*ptimestep, igcm_generic_vap,zh,zpopsk)
     1894            call thermodynamics_update(thermo_phy, pplay, pplev, pt+pdt*ptimestep, ngrid, nlayer, nq, pq+pdq*ptimestep, igcm_generic_vap,zh,zpopsk)
    18951895
    18961896            ! Test energy conservation.
     
    19801980           
    19811981            ! Update thermodynamics
    1982             call thermodynamics(thermo_phy, pplay, pplev, pt+pdt*ptimestep, ngrid, nlayer, nq, pq+pdq*ptimestep, igcm_generic_vap,zh,zpopsk)
     1982            call thermodynamics_update(thermo_phy, pplay, pplev, pt+pdt*ptimestep, ngrid, nlayer, nq, pq+pdq*ptimestep, igcm_generic_vap,zh,zpopsk)
    19831983
    19841984            ! Test water conservation
     
    20422042           
    20432043            ! Update thermodynamics
    2044             call thermodynamics(thermo_phy, pplay, pplev, pt+pdt*ptimestep, ngrid, nlayer, nq, pq+pdq*ptimestep, igcm_generic_vap,zh,zpopsk)
     2044            call thermodynamics_update(thermo_phy, pplay, pplev, pt+pdt*ptimestep, ngrid, nlayer, nq, pq+pdq*ptimestep, igcm_generic_vap,zh,zpopsk)
    20452045
    20462046         endif
     
    21622162         
    21632163        ! Update thermodynamics
    2164         call thermodynamics(thermo_phy, pplay, pplev, pt+pdt*ptimestep, ngrid, nlayer, nq, pq+pdq*ptimestep, igcm_generic_vap,zh,zpopsk)
     2164        call thermodynamics_update(thermo_phy, pplay, pplev, pt+pdt*ptimestep, ngrid, nlayer, nq, pq+pdq*ptimestep, igcm_generic_vap,zh,zpopsk)
    21652165
    21662166      endif! end of if 'tracer'
     
    24862486       
    24872487        ! Update thermodynamics
    2488         call thermodynamics(thermo_phy, pplay, pplev, pt+pdt*ptimestep, ngrid, nlayer, nq, pq+pdq*ptimestep, igcm_generic_vap,zh,zpopsk)
     2488        call thermodynamics_update(thermo_phy, pplay, pplev, pt+pdt*ptimestep, ngrid, nlayer, nq, pq+pdq*ptimestep, igcm_generic_vap,zh,zpopsk)
    24892489
    24902490      endif ! of if (callthermos)
  • trunk/LMDZ.GENERIC/libf/phygeneric/rad_correlatedk.F90

    r4146 r4164  
    3838      use tracer_h, only: constants_epsi_generic
    3939      use comcstfi_mod, only: pi, mugaz_ref
    40       use thermo_mod, only: cpp
     40      use pcm_thermodynamics_mod, only: cpp
    4141      use callkeys_mod, only: varactive,diurnal,tracer,water,varfixed,satval, &
    4242                              diagdtau,kastprof,strictboundcorrk,specOLR, &
  • trunk/LMDZ.GENERIC/libf/phygeneric/rain_generic.F90

    r4146 r4164  
    88   use aerosol_radius, only: aerosol_radius_h2o_liquid_ice_separate ! only used for precip_scheme_generic >=2
    99   use tracer_h
    10    use comcstfi_mod, only: g, cppc_ref
    11    use thermo_mod
     10   use comcstfi_mod, only: g, cppc_ref, cppd_ref
     11   use pcm_thermodynamics_mod, only: r
    1212   use generic_tracer_index_mod, only: generic_tracer_index
    1313   use callkeys_mod, only: thermo_phy,metallicity,evap_prec_generic,evap_coeff_generic, &
  • trunk/LMDZ.GENERIC/libf/phygeneric/vdif_kc.F

    r4146 r4164  
    55      use callkeys_mod, only: generic_condensation,
    66     &                        virtual_theta_correction,thermo_phy
    7       use thermo_mod, only: rcp
     7      use pcm_thermodynamics_mod, only: rcp
    88      use tracer_h
    99      IMPLICIT NONE
Note: See TracChangeset for help on using the changeset viewer.