Changeset 3985


Ignore:
Timestamp:
Dec 8, 2025, 2:19:07 PM (4 months ago)
Author:
jbclement
Message:

PEM:
Addition of a module "phys_constants" to read and store physical parameter of the planet properly, i.e. without going through the module "comcstfi_h" and/or "comconst_mod".
JBC

Location:
trunk/LMDZ.COMMON
Files:
1 added
12 edited

Legend:

Unmodified
Added
Removed
  • trunk/LMDZ.COMMON/libf/evolution/NS_dyn_ss_ice_m.F90

    r3961 r3985  
    2323  use constants_marspem_mod, only: sec_per_sol
    2424  use fast_subs_mars,        only: psv, icelayer_mars, NMAX
    25   use comcstfi_h,            only: pi
     25  use phys_constants,        only: pi
    2626  implicit none
    2727  integer, parameter :: NP=1   ! # of sites
  • trunk/LMDZ.COMMON/libf/evolution/adsorption_mod.F90

    r3961 r3985  
    8989use vertical_layers_mod,   only: ap, bp
    9090use constants_marspem_mod, only: alpha_clap_h2o, beta_clap_h2o, m_h2o, m_co2,m_noco2, rho_regolith
    91 use comcstfi_h,            only: pi
     91use phys_constants,        only: pi
    9292
    9393implicit none
     
    222222use vertical_layers_mod,   only: ap, bp
    223223use constants_marspem_mod, only: m_co2, m_noco2, rho_regolith
    224 use comcstfi_h,            only: pi
     224use phys_constants,        only: pi
    225225
    226226implicit none
  • trunk/LMDZ.COMMON/libf/evolution/changelog.txt

    r3984 r3985  
    820820== 08/12/2025 == JBC
    821821Addition of a module "tracers" to retain properties of atmospheric tracers.
     822
     823== 08/12/2025 == JBC
     824Addition of a module "phys_constants" to read and store physical parameter of the planet properly, i.e. without going through the module "comcstfi_h" and/or "comconst_mod".
  • trunk/LMDZ.COMMON/libf/evolution/glaciers_mod.F90

    r3983 r3985  
    2929SUBROUTINE set_perice4PCM(ngrid,nslope,PCMfrost,is_perh2oice,PCMh2oice,PCMco2ice)
    3030
    31 use metamorphism, only: iPCM_h2ofrost
    32 use comslope_mod, only: subslope_dist, def_slope_mean
    33 #ifndef CPP_1D
    34     use comconst_mod, only: pi
    35 #else
    36     use comcstfi_h,   only: pi
    37 #endif
     31use metamorphism,   only: iPCM_h2ofrost
     32use comslope_mod,   only: subslope_dist, def_slope_mean
     33use phys_constants, only: pi
     34
    3835
    3936implicit none
     
    189186SUBROUTINE compute_hmaxglaciers(ngrid,nslope,iflat,def_slope_mean,Tice,name_ice,hmax)
    190187
    191 use ice_table_mod, only: rho_ice
    192 use abort_pem_mod, only: abort_pem
    193 use comcstfi_h,    only: pi, g
     188use ice_table_mod,  only: rho_ice
     189use abort_pem_mod,  only: abort_pem
     190use phys_constants, only: pi, g
    194191
    195192!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
     
    252249!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
    253250
    254 use ice_table_mod, only: rho_ice
    255 use abort_pem_mod, only: abort_pem
    256 use comcstfi_h,    only: pi
     251use ice_table_mod,  only: rho_ice
     252use abort_pem_mod,  only: abort_pem
     253use phys_constants, only: pi
    257254
    258255implicit none
  • trunk/LMDZ.COMMON/libf/evolution/ice_table_mod.F90

    r3961 r3985  
    152152use comslope_mod,          only: subslope_dist, def_slope_mean
    153153use constants_marspem_mod, only: porosity
    154 use comcstfi_h,            only: pi
     154use phys_constants,        only: pi
    155155
    156156implicit none
  • trunk/LMDZ.COMMON/libf/evolution/orbit_param_criterion_mod.F90

    r3961 r3985  
    2424#endif
    2525use planete_h,      only: e_elips, obliquit, lsperi
    26 use comcstfi_h,    only: pi
     26use phys_constants, only: pi
    2727use time_evol_mod,  only: year_bp_ini, var_obl, var_ecc, var_lsp, convert_years
    2828use lask_param_mod, only: yearlask, obllask, ecclask, lsplask, ini_lask_param_mod, last_ilask
  • trunk/LMDZ.COMMON/libf/evolution/pem.F90

    r3984 r3985  
    8686use planete_h,                  only: year_day
    8787use surfini_mod,                only: surfini
    88 use comcstfi_h,                 only: mugaz
    8988use metamorphism,               only: ini_frost_id, set_frost4PCM, iPCM_h2ofrost, iPCM_co2frost
    90 use tracers,                    only: mmol
     89use tracers,                    only: mmol, iPCM_qh2o, ini_tracers_id, end_tracers
     90use phys_constants,             only: pi, g, r, mugaz, rad, cpp, rcp, read_constants
    9191
    9292#ifndef CPP_1D
    93     use comconst_mod,             only: pi, rad, g, r, cpp, rcp => kappa
    9493    use iniphysiq_mod,            only: iniphysiq
    9594    use control_mod,              only: iphysiq, day_step, nsplit_phys
    9695#else
    97     use comcstfi_h,               only: pi, rad, g, r, cpp, rcp
    9896    use time_phylmdz_mod,         only: iphysiq, steps_per_sol
    9997    use regular_lonlat_mod,       only: init_regular_lonlat
     
    141139real                                :: time_0
    142140
    143 ! Variables to read starfi.nc
     141! Variables to read startfi.nc
    144142character(*), parameter :: startfi_name = "startfi.nc" ! Name of the file used to initialize the PEM
    145143character(2)            :: str2
     
    364362!    I_b Read of the "start.nc" and "starfi.nc"
    365363!------------------------
     364call read_constants(startfi_name)
     365
    366366! I_b.1 Read "start.nc"
    367367write(*,*) '> Reading "start.nc"'
     
    385385    status = nf90_close(ncid)
    386386
    387     ! Initialization of physics constants and variables (comcstfi_h)
     387    ! Initialization of physics constants and variables
    388388    call iniphysiq(iim,jjm,llm,(jjm - 1)*iim + 2,comm_lmdz,daysec,day_ini,dtphys/nsplit_phys,rlatu,rlatv,rlonu,rlonv,aire,cu,cv,rad,g,r,cpp,iflag_phys)
    389389#else
     
    763763                        tsoil_PEM_timeseries(ig,isoil,islope,t) = tsoil_PEM_timeseries(ig,isoil,islope,t)*tsoil_PEM(ig,isoil,islope)/tsoil_avg_old(ig,isoil)
    764764                        ! Update of watersoil density
    765                         watersoil_density_PEM_timeseries(ig,isoil,islope,t) = exp(beta_clap_h2o/tsoil_PEM_timeseries(ig,isoil,islope,t) + alpha_clap_h2o)/tsoil_PEM_timeseries(ig,isoil,islope,t)*mmol%h2o/(mugaz*r)
     765                        watersoil_density_PEM_timeseries(ig,isoil,islope,t) = exp(beta_clap_h2o/tsoil_PEM_timeseries(ig,isoil,islope,t) + alpha_clap_h2o)/tsoil_PEM_timeseries(ig,isoil,islope,t)**mmol(iPCM_qh2o)/(mugaz*r)
    766766                        if (isnan(tsoil_PEM(ig,isoil,islope))) call abort_pem("PEM - Update Tsoil","NaN detected in tsoil_PEM",1)
    767767                    enddo
     
    11291129deallocate(q,longitude,latitude,cell_area,tsoil_PEM)
    11301130deallocate(co2_ice,h2o_ice,layerings_map)
     1131call end_tracers()
    11311132!----------------------------- END OUTPUT ------------------------------
    11321133
  • trunk/LMDZ.COMMON/libf/evolution/pemetat0.F90

    r3984 r3985  
    2323use callkeys_mod,               only: startphy_file
    2424use glaciers_mod,               only: rho_co2ice, rho_h2oice
    25 use comcstfi_h,                 only: r, mugaz, pi
     25use phys_constants,             only: pi, r, mugaz
    2626use surfdat_h,                  only: watercaptag, perennial_co2ice, qsurf
    2727use metamorphism,               only: frost4PCM, iPCM_h2ofrost, iPCM_co2frost
    28 use tracers,                    only: mmol
     28use tracers,                    only: mmol, iPCM_qh2o
    2929
    3030implicit none
     
    296296            endif !found
    297297
    298             watersoil_avg(:,nsoil_PCM + 1:nsoil_PEM,islope) = exp(beta_clap_h2o/tsoil_PEM(:,nsoil_PCM + 1:nsoil_PEM,islope) + alpha_clap_h2o)/tsoil_PEM(:,nsoil_PCM + 1:nsoil_PEM,islope)*mmol(igcm_h2o_vap)/(mugaz*r)
     298            watersoil_avg(:,nsoil_PCM + 1:nsoil_PEM,islope) = exp(beta_clap_h2o/tsoil_PEM(:,nsoil_PCM + 1:nsoil_PEM,islope) + alpha_clap_h2o)/tsoil_PEM(:,nsoil_PCM + 1:nsoil_PEM,islope)*mmol(iPCM_qh2o)/(mugaz*r)
    299299        enddo ! islope
    300300        write(*,*) 'PEMETAT0: TSOIL done'
     
    469469
    470470! First raw initialization
    471             watersoil_avg(:,nsoil_PCM + 1:nsoil_PEM,islope) = exp(beta_clap_h2o/tsoil_PEM(:,nsoil_PCM + 1:nsoil_PEM,islope) + alpha_clap_h2o)/tsoil_PEM(:,nsoil_PCM + 1:nsoil_PEM,islope)*mmol%h2o/(mugaz*r)
     471            watersoil_avg(:,nsoil_PCM + 1:nsoil_PEM,islope) = exp(beta_clap_h2o/tsoil_PEM(:,nsoil_PCM + 1:nsoil_PEM,islope) + alpha_clap_h2o)/tsoil_PEM(:,nsoil_PCM + 1:nsoil_PEM,islope)**mmol(iPCM_qh2o)/(mugaz*r)
    472472        enddo !islope
    473473        write(*,*) 'PEMETAT0: TSOIL done'
  • trunk/LMDZ.COMMON/libf/evolution/recomp_orb_param_mod.F90

    r3980 r3985  
    1717use time_evol_mod,    only: year_bp_ini, var_obl, var_ecc, var_lsp
    1818use lask_param_mod,   only: yearlask, obllask, ecclask, lsplask, end_lask_param_mod, last_ilask
    19 use comcstfi_h,       only: pi
     19use phys_constants,   only: pi
    2020use planete_h,        only: e_elips, obliquit, lsperi, periheli, aphelie, p_elips, peri_day, year_day
    2121use call_dayperi_mod, only: call_dayperi
  • trunk/LMDZ.COMMON/libf/evolution/stopping_crit_mod.F90

    r3980 r3985  
    220220SUBROUTINE stopping_crit_h2o(ngrid,nslope,cell_area,delta_h2o_adsorbed,delta_h2o_icetablesublim,h2o_ice,d_h2oice,S_atm_2_h2o,S_h2o_2_atm,S_atm_2_h2oice,S_h2oice_2_atm,stopCrit)
    221221
    222 use time_evol_mod, only: dt
    223 use comslope_mod,  only: subslope_dist, def_slope_mean
    224 use comcstfi_h,    only: pi
     222use time_evol_mod,  only: dt
     223use comslope_mod,   only: subslope_dist, def_slope_mean
     224use phys_constants, only: pi
    225225
    226226implicit none
  • trunk/LMDZ.COMMON/libf/evolution/tracers.F90

    r3984 r3985  
    77
    88! Molar masses of tracers
    9 type :: mmol
    10     real :: h2o
    11 end type mmol
     9real, dimension(:), allocatable :: mmol
    1210
    1311!=======================================================================
     
    3028! Code
    3129!-----
     30! Allocation
     31call ini_tracers(nqtot)
     32
    3233! Initialization
    3334iPCM_qh2o = -1
     
    3536! Getting the index
    3637do i = 1,nqtot
    37     if (noms(nnq) == "h2o_vap") then
    38         iPCM_qh2o = nnq
    39         mmol%h2o = 18.
     38    if (noms(i) == "h2o_vap") then
     39        iPCM_qh2o = i
     40        mmol(i) = 18.
    4041    endif
    4142enddo
     
    4445if (iPCM_qh2o < 0) error stop 'ini_frost_id: H2O vapour index not found!'
    4546
    46 END SUBROUTINE ini_frost_id
     47END SUBROUTINE ini_tracers_id
     48!=======================================================================
     49
     50SUBROUTINE ini_tracers(nqtot)
     51
     52implicit none
     53
     54! Arguments
     55!----------
     56integer, intent(in) :: nqtot
     57
     58! Local variables
     59!----------------
     60
     61! Code
     62!-----
     63if (.not. allocated(mmol)) allocate(mmol(nqtot))
     64
     65END SUBROUTINE ini_tracers
     66!=======================================================================
     67
     68SUBROUTINE end_tracers()
     69
     70implicit none
     71
     72! Arguments
     73!----------
     74
     75! Local variables
     76!----------------
     77
     78! Code
     79!-----
     80if (allocated(mmol)) deallocate(mmol)
     81
     82END SUBROUTINE end_tracers
    4783
    4884END MODULE tracers
  • trunk/LMDZ.COMMON/makelmdz_fcm

    r3872 r3985  
    505505fi
    506506
    507 if [[ -d ${LIBFGCM}/evolution &&  "$code" == "reshape_XIOS_output" ]]
    508 then
    509 if [[ "$physique" == "std" ]]
    510 then
    511    CPP_KEY="$CPP_KEY CPP_STD"
    512 fi
    513    EVOLUTION_PATH="${LIBFGCM}/evolution"
    514    INCLUDE="$INCLUDE -I${LIBFGCM}/evolution"
    515 fi
    516 
    517507
    518508# NETCDF library include/library paths
Note: See TracChangeset for help on using the changeset viewer.