Changeset 3961


Ignore:
Timestamp:
Nov 14, 2025, 5:26:48 PM (4 weeks ago)
Author:
jbclement
Message:

PEM:
Clearing all the tags and code related to the Generic PCM.
JBC

Location:
trunk/LMDZ.COMMON/libf/evolution
Files:
12 edited

Legend:

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

    r3563 r3961  
    2222!***********************************************************************
    2323  use constants_marspem_mod, only: sec_per_sol
    24   use fast_subs_mars, only: psv, icelayer_mars, NMAX
    25 #ifndef CPP_STD
    26     use comcstfi_h,   only: pi
    27 #else
    28     use comcstfi_mod, only: pi
    29 #endif
     24  use fast_subs_mars,        only: psv, icelayer_mars, NMAX
     25  use comcstfi_h,            only: pi
    3026  implicit none
    3127  integer, parameter :: NP=1   ! # of sites
  • trunk/LMDZ.COMMON/libf/evolution/adsorption_mod.F90

    r3571 r3961  
    7171                            tsoil_PEM,TI_PEM,m_co2_completesoil,delta_mco2reg)
    7272
    73 END SUBROUTINE
     73END SUBROUTINE regolith_adsorption
    7474
    7575!=======================================================================
     
    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 
    92 #ifndef CPP_STD
    93     use comcstfi_h,   only: pi
    94 #else
    95     use comcstfi_mod, only: pi
    96 #endif
     91use comcstfi_h,            only: pi
    9792
    9893implicit none
     
    147142ispermanent_co2glaciers = .false.
    148143
    149 #ifndef CPP_STD
    150     ! 0.1 Look at perennial ice
     144! 0.1 Look at perennial ice
     145do ig = 1,ngrid
     146    do islope = 1,nslope
     147        if (abs(d_h2oglaciers(ig,islope)) > 1.e-5 .and. abs(waterice(ig,islope)) > 0.) ispermanent_h2oglaciers(ig,islope) = .true.
     148        if (abs(d_co2glaciers(ig,islope)) > 1.e-5 .and. abs(co2ice(ig,islope)) > 0.) ispermanent_co2glaciers(ig,islope) = .true.
     149    enddo
     150enddo
     151
     152! 0.2 Compute the partial pressure of vapor
     153! a. the molecular mass into the column
     154do ig = 1,ngrid
     155    mass_mean(ig,:) = 1/(A*q_co2(ig,:) + B)
     156enddo
     157
     158! b. pressure level
     159do it = 1,timelen
    151160    do ig = 1,ngrid
    152         do islope = 1,nslope
    153             if (abs(d_h2oglaciers(ig,islope)) > 1.e-5 .and. abs(waterice(ig,islope)) > 0.) ispermanent_h2oglaciers(ig,islope) = .true.
    154             if (abs(d_co2glaciers(ig,islope)) > 1.e-5 .and. abs(co2ice(ig,islope)) > 0.) ispermanent_co2glaciers(ig,islope) = .true.
     161        zplev_mean(ig,it) = ap(1) + bp(1)*ps(ig,it)
     162    enddo
     163enddo
     164
     165! c. Vapor pressure
     166pvapor = mass_mean/m_h2o*q_h2o*zplev_mean
     167pvapor_avg = sum(pvapor,2)/timelen
     168deallocate(pvapor,zplev_mean,mass_mean)
     169
     170! 1. we compute the mass of H2O adsorded in each layer of the meshes
     171do ig = 1,ngrid
     172    do islope = 1,nslope
     173        do iloop = 1,index_breccia
     174            K = Ko*exp(e/tsoil_PEM(ig,iloop,islope))
     175            if (TI_PEM(ig,iloop,islope) < inertie_thresold) then
     176                theta_h2o_adsorbed(ig,iloop,islope) = (K*pvapor_avg(ig)/(1. + K*pvapor_avg(ig)))**mu
     177            else
     178                p_sat = exp(beta_clap_h2o/tsoil_PEM(ig,iloop,islope) + alpha_clap_h2o) ! we assume fixed temperature in the ice ... not really good but ...
     179                theta_h2o_adsorbed(ig,iloop,islope) = (K*p_sat/(1. + K*p_sat))**mu
     180            endif
     181            dm_h2o_regolith_slope(ig,iloop,islope) = as*theta_h2o_adsorbed(ig,iloop,islope)*m_theta*rho_regolith
    155182        enddo
    156183    enddo
    157 
    158     ! 0.2 Compute the partial pressure of vapor
    159     ! a. the molecular mass into the column
    160     do ig = 1,ngrid
    161         mass_mean(ig,:) = 1/(A*q_co2(ig,:) + B)
    162     enddo
    163 
    164     ! b. pressure level
    165     do it = 1,timelen
    166         do ig = 1,ngrid
    167             zplev_mean(ig,it) = ap(1) + bp(1)*ps(ig,it)
     184enddo
     185
     186! 2. Check the exchange between the atmosphere and the regolith
     187do ig = 1,ngrid
     188    delta_mreg(ig) = 0.
     189    do islope = 1,nslope
     190        deltam_reg_slope(ig,islope) = 0.
     191        do iloop = 1,index_breccia
     192            if (TI_PEM(ig,iloop,islope) < inertie_thresold .and. .not. ispermanent_h2oglaciers(ig,islope) .and. .not. ispermanent_co2glaciers(ig,islope)) then
     193                if (iloop == 1) then
     194                    deltam_reg_complete(ig,iloop,islope) = (dm_h2o_regolith_slope(ig,iloop,islope) - m_h2o_completesoil(ig,iloop,islope))*(layer_PEM(iloop))
     195                else
     196                    deltam_reg_complete(ig,iloop,islope) = (dm_h2o_regolith_slope(ig,iloop,islope) - m_h2o_completesoil(ig,iloop,islope))*(layer_PEM(iloop) - layer_PEM(iloop - 1))
     197                endif
     198            else ! NO EXCHANGE AS ICE BLOCK THE DYNAMIC!
     199                deltam_reg_complete(ig,iloop,islope) = 0.
     200            endif
     201            deltam_reg_slope(ig,islope) = deltam_reg_slope(ig,islope) + deltam_reg_complete(ig,iloop,islope)
    168202        enddo
    169     enddo
    170 
    171     ! c. Vapor pressure
    172     pvapor = mass_mean/m_h2o*q_h2o*zplev_mean
    173     pvapor_avg = sum(pvapor,2)/timelen
    174 #endif
    175 deallocate(pvapor,zplev_mean,mass_mean)
    176 
    177 #ifndef CPP_STD
    178     ! 1. we compute the mass of H2O adsorded in each layer of the meshes
    179     do ig = 1,ngrid
    180         do islope = 1,nslope
    181             do iloop = 1,index_breccia
    182                 K = Ko*exp(e/tsoil_PEM(ig,iloop,islope))
    183                 if (TI_PEM(ig,iloop,islope) < inertie_thresold) then
    184                     theta_h2o_adsorbed(ig,iloop,islope) = (K*pvapor_avg(ig)/(1. + K*pvapor_avg(ig)))**mu
    185                 else
    186                     p_sat = exp(beta_clap_h2o/tsoil_PEM(ig,iloop,islope) + alpha_clap_h2o) ! we assume fixed temperature in the ice ... not really good but ...
    187                     theta_h2o_adsorbed(ig,iloop,islope) = (K*p_sat/(1. + K*p_sat))**mu
    188                 endif
    189                 dm_h2o_regolith_slope(ig,iloop,islope) = as*theta_h2o_adsorbed(ig,iloop,islope)*m_theta*rho_regolith
    190             enddo
    191         enddo
    192     enddo
    193 
    194     ! 2. Check the exchange between the atmosphere and the regolith
    195     do ig = 1,ngrid
    196         delta_mreg(ig) = 0.
    197         do islope = 1,nslope
    198             deltam_reg_slope(ig,islope) = 0.
    199             do iloop = 1,index_breccia
    200                 if (TI_PEM(ig,iloop,islope) < inertie_thresold .and. .not. ispermanent_h2oglaciers(ig,islope) .and. .not. ispermanent_co2glaciers(ig,islope)) then
    201                     if (iloop == 1) then
    202                         deltam_reg_complete(ig,iloop,islope) = (dm_h2o_regolith_slope(ig,iloop,islope) - m_h2o_completesoil(ig,iloop,islope))*(layer_PEM(iloop))
    203                     else
    204                         deltam_reg_complete(ig,iloop,islope) = (dm_h2o_regolith_slope(ig,iloop,islope) - m_h2o_completesoil(ig,iloop,islope))*(layer_PEM(iloop) - layer_PEM(iloop - 1))
    205                     endif
    206                 else ! NO EXCHANGE AS ICE BLOCK THE DYNAMIC!
    207                     deltam_reg_complete(ig,iloop,islope) = 0.
    208                 endif
    209                 deltam_reg_slope(ig,islope) = deltam_reg_slope(ig,islope) + deltam_reg_complete(ig,iloop,islope)
    210             enddo
    211             delta_mreg(ig) = delta_mreg(ig) + deltam_reg_slope(ig,islope)*subslope_dist(ig,islope)/cos(pi*def_slope_mean(islope)/180.)
    212         enddo
    213     enddo
    214     m_h2o_completesoil = dm_h2o_regolith_slope
    215 #endif
    216 END SUBROUTINE
     203        delta_mreg(ig) = delta_mreg(ig) + deltam_reg_slope(ig,islope)*subslope_dist(ig,islope)/cos(pi*def_slope_mean(islope)/180.)
     204    enddo
     205enddo
     206m_h2o_completesoil = dm_h2o_regolith_slope
     207
     208END SUBROUTINE regolith_h2oadsorption
    217209
    218210!=======================================================================
     
    230222use vertical_layers_mod,   only: ap, bp
    231223use constants_marspem_mod, only: m_co2, m_noco2, rho_regolith
    232 
    233 #ifndef CPP_STD
    234     use comcstfi_h,   only: pi
    235 #else
    236     use comcstfi_mod, only: pi
    237 #endif
     224use comcstfi_h,            only: pi
    238225
    239226implicit none
     
    288275ispermanent_co2glaciers = .false.
    289276
    290 #ifndef CPP_STD
    291     ! 0.1 Look at perennial ice
     277! 0.1 Look at perennial ice
     278do ig = 1,ngrid
     279    do islope = 1,nslope
     280        if (abs(d_h2oglaciers(ig,islope)) > 1.e-5 .and. abs(waterice(ig,islope)) > 0.) ispermanent_h2oglaciers(ig,islope) = .true.
     281        if (abs(d_co2glaciers(ig,islope)) > 1.e-5 .and. abs(co2ice(ig,islope)) > 0.) ispermanent_co2glaciers(ig,islope) = .true.
     282    enddo
     283enddo
     284
     285! 0.2  Compute the partial pressure of CO2
     286! a. the molecular mass into the column
     287do ig = 1,ngrid
     288    mass_mean(ig,:) = 1./(A*q_co2(ig,:) + B)
     289enddo
     290
     291! b. pressure level
     292do it = 1,timelen
    292293    do ig = 1,ngrid
    293         do islope = 1,nslope
    294             if (abs(d_h2oglaciers(ig,islope)) > 1.e-5 .and. abs(waterice(ig,islope)) > 0.) ispermanent_h2oglaciers(ig,islope) = .true.
    295             if (abs(d_co2glaciers(ig,islope)) > 1.e-5 .and. abs(co2ice(ig,islope)) > 0.) ispermanent_co2glaciers(ig,islope) = .true.
     294        zplev_mean(ig,it) = ap(1) + bp(1)*ps(ig,it)
     295    enddo
     296enddo
     297
     298! c. Vapor pressure
     299pco2 = mass_mean/m_co2*q_co2*zplev_mean
     300pco2_avg(:) = sum(pco2(:,:),2)/timelen
     301
     302deallocate(zplev_mean,mass_mean,pco2)
     303
     304! 1. Compute the fraction of the pores occupied by H2O
     305call regolith_h2oadsorption(ngrid,nslope,nsoil_PEM,timelen,d_h2oglaciers,d_co2glaciers,waterice,co2ice,ps,q_co2,q_h2o,tsoil_PEM,TI_PEM, &
     306                            theta_h2o_adsorbed, m_h2o_adsorbed,delta_mh2o)
     307
     308! 2. we compute the mass of co2 adsorded in each layer of the meshes
     309do ig = 1,ngrid
     310    do islope = 1,nslope
     311        do iloop = 1,index_breccia
     312            if (TI_PEM(ig,iloop,islope) < inertie_thresold .and. .not. ispermanent_h2oglaciers(ig,islope) .and. .not. ispermanent_co2glaciers(ig,islope)) then
     313                dm_co2_regolith_slope(ig,iloop,islope) = as*rho_regolith*m_theta*(1. - theta_h2o_adsorbed(ig,iloop,islope))*alpha*pco2_avg(ig)/ &
     314                                                         (alpha*pco2_avg(ig) + sqrt(tsoil_PEM(ig,iloop,islope))*exp(beta/tsoil_PEM(ig,iloop,islope)))
     315            else
     316                if (abs(m_co2_completesoil(ig,iloop,islope)) < 1.e-10) then !!! we are at first call
     317                    dm_co2_regolith_slope(ig,iloop,islope) = as*rho_regolith*m_theta*(1. - theta_h2o_adsorbed(ig,iloop,islope))*alpha*pco2_avg(ig) &
     318                                                             /(alpha*pco2_avg(ig)+sqrt(tsoil_PEM(ig,iloop,islope))*exp(beta/tsoil_PEM(ig,iloop,islope)))
     319                else ! no change: permanent ice stick the atoms of CO2
     320                    dm_co2_regolith_slope(ig,iloop,islope) = m_co2_completesoil(ig,iloop,islope)
     321                endif
     322            endif
    296323        enddo
    297324    enddo
    298 
    299     ! 0.2  Compute the partial pressure of CO2
    300     ! a. the molecular mass into the column
    301     do ig = 1,ngrid
    302         mass_mean(ig,:) = 1./(A*q_co2(ig,:) + B)
    303     enddo
    304 
    305     ! b. pressure level
    306     do it = 1,timelen
    307         do ig = 1,ngrid
    308             zplev_mean(ig,it) = ap(1) + bp(1)*ps(ig,it)
     325enddo
     326
     327! 3. Check the exchange between the atmosphere and the regolith
     328do ig = 1,ngrid
     329    delta_mreg(ig) = 0.
     330    do islope = 1,nslope
     331        deltam_reg_slope(ig,islope) = 0.
     332        do iloop = 1,index_breccia
     333            if (TI_PEM(ig,iloop,islope) < inertie_thresold .and. .not. ispermanent_h2oglaciers(ig,islope) .and. .not. ispermanent_co2glaciers(ig,islope)) then
     334                if (iloop == 1) then
     335                    deltam_reg_complete(ig,iloop,islope) = (dm_co2_regolith_slope(ig,iloop,islope) - m_co2_completesoil(ig,iloop,islope))*(layer_PEM(iloop))
     336                else
     337                    deltam_reg_complete(ig,iloop,islope) = (dm_co2_regolith_slope(ig,iloop,islope) - m_co2_completesoil(ig,iloop,islope))*(layer_PEM(iloop) - layer_PEM(iloop - 1))
     338                endif
     339            else ! NO EXCHANGE AS ICE BLOCK THE DYNAMIC!
     340                deltam_reg_complete(ig,iloop,islope) = 0.
     341            endif
     342            deltam_reg_slope(ig,islope) = deltam_reg_slope(ig,islope) + deltam_reg_complete(ig,iloop,islope)
    309343        enddo
    310     enddo
    311 
    312     ! c. Vapor pressure
    313     pco2 = mass_mean/m_co2*q_co2*zplev_mean
    314     pco2_avg(:) = sum(pco2(:,:),2)/timelen
    315 
    316     deallocate(zplev_mean,mass_mean,pco2)
    317 
    318     ! 1. Compute the fraction of the pores occupied by H2O
    319     call regolith_h2oadsorption(ngrid,nslope,nsoil_PEM,timelen,d_h2oglaciers,d_co2glaciers,waterice,co2ice,ps,q_co2,q_h2o,tsoil_PEM,TI_PEM, &
    320                                 theta_h2o_adsorbed, m_h2o_adsorbed,delta_mh2o)
    321 
    322     ! 2. we compute the mass of co2 adsorded in each layer of the meshes
    323     do ig = 1,ngrid
    324         do islope = 1,nslope
    325             do iloop = 1,index_breccia
    326                 if (TI_PEM(ig,iloop,islope) < inertie_thresold .and. .not. ispermanent_h2oglaciers(ig,islope) .and. .not. ispermanent_co2glaciers(ig,islope)) then
    327                     dm_co2_regolith_slope(ig,iloop,islope) = as*rho_regolith*m_theta*(1. - theta_h2o_adsorbed(ig,iloop,islope))*alpha*pco2_avg(ig)/ &
    328                                                              (alpha*pco2_avg(ig) + sqrt(tsoil_PEM(ig,iloop,islope))*exp(beta/tsoil_PEM(ig,iloop,islope)))
    329                 else
    330                     if (abs(m_co2_completesoil(ig,iloop,islope)) < 1.e-10) then !!! we are at first call
    331                         dm_co2_regolith_slope(ig,iloop,islope) = as*rho_regolith*m_theta*(1. - theta_h2o_adsorbed(ig,iloop,islope))*alpha*pco2_avg(ig) &
    332                                                                  /(alpha*pco2_avg(ig)+sqrt(tsoil_PEM(ig,iloop,islope))*exp(beta/tsoil_PEM(ig,iloop,islope)))
    333                     else ! no change: permanent ice stick the atoms of CO2
    334                         dm_co2_regolith_slope(ig,iloop,islope) = m_co2_completesoil(ig,iloop,islope)
    335                     endif
    336                 endif
    337             enddo
    338         enddo
    339     enddo
    340 
    341     ! 3. Check the exchange between the atmosphere and the regolith
    342     do ig = 1,ngrid
    343         delta_mreg(ig) = 0.
    344         do islope = 1,nslope
    345             deltam_reg_slope(ig,islope) = 0.
    346             do iloop = 1,index_breccia
    347                 if (TI_PEM(ig,iloop,islope) < inertie_thresold .and. .not. ispermanent_h2oglaciers(ig,islope) .and. .not. ispermanent_co2glaciers(ig,islope)) then
    348                     if (iloop == 1) then
    349                         deltam_reg_complete(ig,iloop,islope) = (dm_co2_regolith_slope(ig,iloop,islope) - m_co2_completesoil(ig,iloop,islope))*(layer_PEM(iloop))
    350                     else
    351                         deltam_reg_complete(ig,iloop,islope) = (dm_co2_regolith_slope(ig,iloop,islope) - m_co2_completesoil(ig,iloop,islope))*(layer_PEM(iloop) - layer_PEM(iloop - 1))
    352                     endif
    353                 else ! NO EXCHANGE AS ICE BLOCK THE DYNAMIC!
    354                     deltam_reg_complete(ig,iloop,islope) = 0.
    355                 endif
    356                 deltam_reg_slope(ig,islope) = deltam_reg_slope(ig,islope) + deltam_reg_complete(ig,iloop,islope)
    357             enddo
    358             delta_mreg(ig) = delta_mreg(ig) + deltam_reg_slope(ig,islope)*subslope_dist(ig,islope)/cos(pi*def_slope_mean(islope)/180.)
    359         enddo
    360     enddo
    361     m_co2_completesoil = dm_co2_regolith_slope
    362 #endif
     344        delta_mreg(ig) = delta_mreg(ig) + deltam_reg_slope(ig,islope)*subslope_dist(ig,islope)/cos(pi*def_slope_mean(islope)/180.)
     345    enddo
     346enddo
     347m_co2_completesoil = dm_co2_regolith_slope
    363348
    364349END SUBROUTINE regolith_co2adsorption
  • trunk/LMDZ.COMMON/libf/evolution/changelog.txt

    r3958 r3961  
    791791== 12/11/2025 == JBC
    792792Checking if a PCM run length is one Martian year + Changing instruction from "run" to "year" to be clearer.
     793
     794== 14/11/2025 == JBC
     795Clearing all the tags and code related to the Generic PCM.
  • trunk/LMDZ.COMMON/libf/evolution/glaciers_mod.F90

    r3603 r3961  
    105105use ice_table_mod, only: rho_ice
    106106use abort_pem_mod, only: abort_pem
    107 #ifndef CPP_STD
    108     use comcstfi_h,   only: pi, g
    109 #else
    110     use comcstfi_mod, only: pi, g
    111 #endif
     107use comcstfi_h,    only: pi, g
    112108
    113109!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
     
    172168use ice_table_mod, only: rho_ice
    173169use abort_pem_mod, only: abort_pem
    174 #ifndef CPP_STD
    175     use comcstfi_h,   only: pi
    176 #else
    177     use comcstfi_mod, only: pi
    178 #endif
     170use comcstfi_h,    only: pi
    179171
    180172implicit none
  • trunk/LMDZ.COMMON/libf/evolution/ice_table_mod.F90

    r3602 r3961  
    152152use comslope_mod,          only: subslope_dist, def_slope_mean
    153153use constants_marspem_mod, only: porosity
    154 #ifndef CPP_STD
    155     use comcstfi_h,   only: pi
    156 #else
    157     use comcstfi_mod, only: pi
    158 #endif
     154use comcstfi_h,            only: pi
    159155
    160156implicit none
  • trunk/LMDZ.COMMON/libf/evolution/iostart_PEM.F90

    r3457 r3961  
    475475  USE mod_grid_phy_lmdz, only: klon_glo
    476476  USE dimphy, only: klev, klevp1
    477 #ifndef CPP_STD
    478477  USE tracer_mod, only: nqmx
    479 #else
    480   use tracer_h, only:   nqtot
    481 #endif
    482478  USE comsoil_h_PEM, only:  nsoilmx_PEM
    483479  USE comslope_mod, only: nslope
     
    487483    INTEGER                     :: ierr
    488484    LOGICAL,SAVE :: already_created=.false.
    489 
    490 #ifdef CPP_STD
    491     INTEGER :: nqmx
    492     nqmx=nqtot
    493 #endif
    494485
    495486    IF (is_master) THEN
  • trunk/LMDZ.COMMON/libf/evolution/orbit_param_criterion_mod.F90

    r3860 r3961  
    2323    use ioipsl_getincom, only: getin
    2424#endif
    25 #ifndef CPP_STD
    26     use planete_h,    only: e_elips, obliquit, lsperi
    27     use comcstfi_h,   only: pi
    28 #else
    29     use planete_mod,  only: e_elips, obliquit, lsperi
    30     use comcstfi_mod, only: pi
    31 #endif
     25use planete_h,      only: e_elips, obliquit, lsperi
     26use comcstfi_h,     only: pi
    3227use time_evol_mod,  only: year_bp_ini, var_obl, var_ecc, var_lsp, convert_years
    3328use lask_param_mod, only: yearlask, obllask, ecclask, lsplask, ini_lask_param_mod, last_ilask
  • trunk/LMDZ.COMMON/libf/evolution/pem.F90

    r3938 r3961  
    7777use paleoclimate_mod,           only: h2o_ice_depth, zdqsdif_ssi_tot
    7878use surf_temp,                  only: update_tsurf_nearest_baresoil
    79 
    80 #ifndef CPP_STD
    81     use comsoil_h,          only: tsoil, nsoilmx, ini_comsoil_h, inertiedat, mlayer, inertiesoil, flux_geo, nqsoil, qsoil
    82     use surfdat_h,          only: tsurf, qsurf, emis, emissiv, emisice, ini_surfdat_h,   &
    83                                   albedodat, albedice, albedo_h2o_frost, albedo_h2o_cap, &
    84                                   zmea, zstd, zsig, zgam, zthe, frost_albedo_threshold,  &
    85                                   watercap, watercaptag, perennial_co2ice, albedo_perennialco2
    86     use dimradmars_mod,     only: totcloudfrac, albedo
    87     use dust_param_mod,     only: tauscaling
    88     use tracer_mod,         only: noms, igcm_h2o_ice, igcm_co2, mmol, igcm_h2o_vap ! Tracer names and molar masses
    89     use mod_phys_lmdz_para, only: is_parallel, is_sequential, is_mpi_root, is_omp_root, is_master
    90     use planete_h,          only: aphelie, periheli, year_day, peri_day, obliquit, iniorbit
    91     use surfini_mod,        only: surfini
    92     use comcstfi_h,         only: mugaz
    93 #else
    94     use tracer_h,           only: noms, igcm_h2o_ice, igcm_co2 ! Tracer names
    95     use phys_state_var_mod, only: cloudfrac, totcloudfrac, albedo_snow_SPECTV,HICE,RNAT,   &
    96                                   PCTSRF_SIC, TSLAB, TSEA_ICE, SEA_ICE, ALBEDO_BAREGROUND, &
    97                                   ALBEDO_CO2_ICE_SPECTV, phys_state_var_init
    98     use aerosol_mod,        only: iniaerosol
    99     use planete_mod,        only: apoastr, periastr, year_day, peri_day, obliquit
    100     use comcstfi_mod,       only: pi, rad, g, r, cpp, rcp, mugaz
    101 #endif
     79use comsoil_h,                  only: tsoil, nsoilmx, ini_comsoil_h, inertiedat, mlayer, inertiesoil, flux_geo, nqsoil, qsoil
     80use surfdat_h,                  only: tsurf, qsurf, emis, emissiv, emisice, ini_surfdat_h,   &
     81                                      albedodat, albedice, albedo_h2o_frost, albedo_h2o_cap, &
     82                                      zmea, zstd, zsig, zgam, zthe, frost_albedo_threshold,  &
     83                                      watercap, watercaptag, perennial_co2ice, albedo_perennialco2
     84use dimradmars_mod,             only: totcloudfrac, albedo
     85use dust_param_mod,             only: tauscaling
     86use tracer_mod,                 only: noms, igcm_h2o_ice, igcm_co2, mmol, igcm_h2o_vap ! Tracer names and molar masses
     87use mod_phys_lmdz_para,         only: is_parallel, is_sequential, is_mpi_root, is_omp_root, is_master
     88use planete_h,                  only: aphelie, periheli, year_day, peri_day, obliquit, iniorbit
     89use surfini_mod,                only: surfini
     90use comcstfi_h,                 only: mugaz
    10291
    10392#ifndef CPP_1D
     
    255244character(32)         :: hostname = ' '
    256245
    257 #ifdef CPP_STD
    258     real                                :: frost_albedo_threshold = 0.05 ! Frost albedo threeshold to convert fresh frost to old ice
    259     real                                :: albedo_h2o_frost              ! Albedo of h2o frost
    260     real, dimension(:),     allocatable :: tsurf_read_generic            ! Temporary variable to do the subslope transfert dimension when reading form generic
    261     real, dimension(:,:),   allocatable :: qsurf_read_generic            ! Temporary variable to do the subslope transfert dimension when reading form generic
    262     real, dimension(:,:),   allocatable :: tsoil_read_generic            ! Temporary variable to do the subslope transfert dimension when reading form generic
    263     real, dimension(:),     allocatable :: emis_read_generic             ! Temporary variable to do the subslope transfert dimension when reading form generic
    264     real, dimension(:,:),   allocatable :: albedo_read_generic           ! Temporary variable to do the subslope transfert dimension when reading form generic
    265     real, dimension(:,:),   allocatable :: tsurf                         ! Subslope variable, only needed in the GENERIC case
    266     real, dimension(:,:,:), allocatable :: qsurf                         ! Subslope variable, only needed in the GENERIC case
    267     real, dimension(:,:,:), allocatable :: tsoil                         ! Subslope variable, only needed in the GENERIC case
    268     real, dimension(:,:),   allocatable :: emis                          ! Subslope variable, only needed in the GENERIC case
    269     real, dimension(:,:),   allocatable :: watercap                      ! Subslope variable, only needed in the GENERIC case =0 no watercap in generic model
    270     logical, dimension(:),  allocatable :: watercaptag                   ! Subslope variable, only needed in the GENERIC case =false no watercaptag in generic model
    271     real, dimension(:,:,:), allocatable :: albedo                        ! Subslope variable, only needed in the GENERIC case
    272     real, dimension(:,:,:), allocatable :: inertiesoil                   ! Subslope variable, only needed in the GENERIC case
    273 #endif
    274 
    275246#ifdef CPP_1D
    276247    integer            :: nsplit_phys
     
    330301
    331302! Parallel variables
    332 #ifndef CPP_STD
    333     is_sequential = .true.
    334     is_parallel = .false.
    335     is_mpi_root = .true.
    336     is_omp_root = .true.
    337     is_master = .true.
    338 #endif
     303is_sequential = .true.
     304is_parallel = .false.
     305is_mpi_root = .true.
     306is_omp_root = .true.
     307is_master = .true.
    339308
    340309! Some constants
     
    438407! I_b.2 Read the "startfi.nc"
    439408! First we read the initial state (starfi.nc)
    440 #ifndef CPP_STD
    441     write(*,*) '> Reading "startfi.nc"'
    442     call phyetat0(startfi_name,0,0,nsoilmx,ngrid,nlayer,nq,nqsoil,day_ini,time_phys,tsurf, &
    443                   tsoil,albedo,emis,q2,qsurf,qsoil,tauscaling,totcloudfrac,wstar,          &
    444                   watercap,perennial_co2ice,def_slope,def_slope_mean,subslope_dist)
    445 
    446     ! Remove unphysical values of surface tracer
    447     where (qsurf < 0.) qsurf = 0.
    448 
    449     call surfini(ngrid,nslope,qsurf)
    450 #else
    451     call phys_state_var_init(nq)
    452     if (.not. allocated(noms)) allocate(noms(nq)) ! (because noms is an argument of physdem1 whether or not tracer is on)
    453     call initracer(ngrid,nq)
    454     call iniaerosol()
    455     allocate(tsurf_read_generic(ngrid))
    456     allocate(qsurf_read_generic(ngrid,nq))
    457     allocate(tsoil_read_generic(ngrid,nsoilmx))
    458     allocate(qsoil_read_generic(ngrid,nsoilmx,nqsoil,nslope))
    459     allocate(emis_read_generic(ngrid))
    460     allocate(albedo_read_generic(ngrid,2))
    461     allocate(qsurf(ngrid,nq,1))
    462     allocate(tsurf(ngrid,1))
    463     allocate(tsoil(ngrid,nsoilmx,1))
    464     allocate(emis(ngrid,1))
    465     allocate(watercap(ngrid,1))
    466     allocate(watercaptag(ngrid))
    467     allocate(albedo(ngrid,2,1))
    468     allocate(inertiesoil(ngrid,nsoilmx,1))
    469     call phyetat0(.true.,ngrid,nlayer,startfi_name,0,0,nsoilmx,nq,nqsoil,day_ini,time_phys, &
    470                   tsurf_read_generic,tsoil_read_generic,emis_read_generic,q2,               &
    471                   qsurf_read_generic,qsoil_read_generic,cloudfrac,totcloudfrac,hice,        &
    472                   rnat,pctsrf_sic,tslab,tsea_ice,sea_ice)
    473     call surfini(ngrid,nq,qsurf_read_generic,albedo_read_generic,albedo_bareground,albedo_snow_SPECTV,albedo_co2_ice_SPECTV)
    474 
    475     nslope = 1
    476     call ini_comslope_h(ngrid,1)
    477 
    478     qsurf(:,:,1) = qsurf_read_generic
    479     tsurf(:,1) = tsurf_read_generic
    480     tsoil(:,:,1) = tsoil_read_generic
    481     emis(:,1) = emis_read_generic
    482     watercap(:,1) = 0.
    483     watercaptag(:) = .false.
    484     albedo(:,1,1) = albedo_read_generic(:,1)
    485     albedo(:,2,1) = albedo_read_generic(:,2)
    486     inertiesoil(:,:,1) = inertiedat
    487 
    488     if (nslope == 1) then
    489         def_slope(1) = 0
    490         def_slope(2) = 0
    491         def_slope_mean = 0
    492         subslope_dist(:,1) = 1.
    493     endif
    494 
    495     ! Remove unphysical values of surface tracer
    496     qsurf(:,:,1) = qsurf_read_generic
    497     where (qsurf < 0.) qsurf = 0.
    498 
    499     deallocate(tsurf_read_generic,qsurf_read_generic,qsoil_read_generic,emis_read_generic)
    500 #endif
     409write(*,*) '> Reading "startfi.nc"'
     410call phyetat0(startfi_name,0,0,nsoilmx,ngrid,nlayer,nq,nqsoil,day_ini,time_phys,tsurf, &
     411              tsoil,albedo,emis,q2,qsurf,qsoil,tauscaling,totcloudfrac,wstar,          &
     412              watercap,perennial_co2ice,def_slope,def_slope_mean,subslope_dist)
     413
     414! Remove unphysical values of surface tracer
     415where (qsurf < 0.) qsurf = 0.
     416
     417call surfini(ngrid,nslope,qsurf)
    501418
    502419do nnq = 1,nqtot  ! Why not using ini_tracer?
     
    680597!    I_i Compute orbit criterion
    681598!------------------------
    682 #ifndef CPP_STD
    683     call iniorbit(aphelie,periheli,year_day,peri_day,obliquit)
    684 #else
    685     call iniorbit(apoastr,periastr,year_day,peri_day,obliquit)
    686 #endif
     599call iniorbit(aphelie,periheli,year_day,peri_day,obliquit)
    687600
    688601n_myear_leg = Max_iter_pem
     
    11081021    enddo
    11091022    tsoil = tsoil_PEM(:,1:nsoilmx,:) + tsoil_dev
    1110 #ifndef CPP_STD
    11111023    flux_geo = fluxgeo
    1112 #endif
    11131024endif
    11141025deallocate(tsurf_avg,tsoil_dev)
     
    12391150! III_b.2 Write the "restartfi.nc"
    12401151write(*,*) '> Writing "restartfi.nc"'
    1241 #ifndef CPP_STD
    1242     call physdem0("restartfi.nc",longitude,latitude,nsoilmx,ngrid, &
    1243                   nlayer,nq,ptimestep,pday,0.,cell_area,albedodat, &
    1244                   inertiedat,def_slope,subslope_dist)
    1245     call physdem1("restartfi.nc",nsoilmx,ngrid,nlayer,nq,nqsoil,      &
    1246                   ptimestep,ztime_fin,tsurf,tsoil,inertiesoil,        &
    1247                   albedo,emis,q2,qsurf,qsoil,tauscaling,totcloudfrac, &
    1248                   wstar,watercap,perennial_co2ice)
    1249 #else
    1250     if (allocated(noms)) deallocate(noms)
    1251     deallocate(qsurf,tsurf,tsoil,emis,watercap,watercaptag,albedo,inertiesoil)
    1252     call physdem0("restartfi.nc",longitude,latitude,nsoilmx,ngrid, &
    1253                   nlayer,nq,ptimestep,pday,time_phys,cell_area,    &
    1254                   albedo_bareground,inertiedat,zmea,zstd,zsig,zgam,zthe)
    1255     call physdem1("restartfi.nc",nsoilmx,ngrid,nlayer,nq,nqsoil,       &
    1256                   ptimestep,ztime_fin,tsurf,tsoil,emis,q2,qsurf,qsoil, &
    1257                   cloudfrac,totcloudfrac,hice,rnat,pctsrf_sic,tslab,   &
    1258                   tsea_ice,sea_ice)
    1259 #endif
     1152call physdem0("restartfi.nc",longitude,latitude,nsoilmx,ngrid, &
     1153              nlayer,nq,ptimestep,pday,0.,cell_area,albedodat, &
     1154              inertiedat,def_slope,subslope_dist)
     1155call physdem1("restartfi.nc",nsoilmx,ngrid,nlayer,nq,nqsoil,      &
     1156              ptimestep,ztime_fin,tsurf,tsoil,inertiesoil,        &
     1157              albedo,emis,q2,qsurf,qsoil,tauscaling,totcloudfrac, &
     1158              wstar,watercap,perennial_co2ice)
    12601159
    12611160!------------------------
  • trunk/LMDZ.COMMON/libf/evolution/pemetat0.F90

    r3850 r3961  
    2424use callkeys_mod,               only: startphy_file
    2525use glaciers_mod,               only: rho_co2ice, rho_h2oice
    26 
    27 #ifndef CPP_STD
    28     use comcstfi_h,   only: r, mugaz, pi
    29     use surfdat_h,    only: watercaptag, watercap, perennial_co2ice
    30 #else
    31     use comcstfi_mod, only: r, mugaz, pi
    32 #endif
     26use comcstfi_h,                 only: r, mugaz, pi
     27use surfdat_h,                  only: watercaptag, watercap, perennial_co2ice
    3328
    3429implicit none
     
    7469real, dimension(:,:,:,:), allocatable   :: stratif_array     ! Array for layerings
    7570
    76 #ifdef CPP_STD
    77     logical, dimension(ngrid) :: watercaptag
    78     watercaptag = .false.
    79 #endif
    80 
    8171!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
    8272!!!
     
    112102
    113103!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
    114 #ifndef CPP_STD
    115104    ! h2o ice
    116105    h2o_ice = 0.
     
    130119    ! co2 ice
    131120    co2_ice = perennial_co2ice
    132 #endif
    133121
    134122!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  • trunk/LMDZ.COMMON/libf/evolution/read_data_PCM_mod.F90

    r3620 r3961  
    8686    where (var3_read_1 < 0.) var3_read_1 = 0.
    8787    write(*,*) "Data for co2_ice"//num//" downloaded."
    88 #ifndef CPP_STD
    8988    call get_var3("perennial_co2ice"//num,var3_read_2)
    9089    write(*,*) "Data for perennial_co2ice"//num//" downloaded."
    91 #endif
    9290
    9391    ! Compute the minimum over the year for each point
     
    105103    where (var3_read_1 < 0.) var3_read_1 = 0.
    106104    write(*,*) "Data for h2o_ice_s"//num//" downloaded."
    107 #ifndef CPP_STD
    108105    call get_var3("watercap"//num,var3_read_2)
    109106    write(*,*) "Data for watercap"//num//" downloaded."
    110 #endif
    111107
    112108    ! Compute the minimum over the year for each point
     
    207203    where (var3_read_1 < 0.) var3_read_1 = 0.
    208204    write(*,*) "Data for co2_ice"//num//" downloaded."
    209 #ifndef CPP_STD
    210205    call get_var3("perennial_co2ice"//num,var3_read_2)
    211206    write(*,*) "Data for perennial_co2ice"//num//" downloaded."
    212 #endif
    213207
    214208    ! Compute the minimum over the year for each point
     
    226220    where (var3_read_1 < 0.) var3_read_1 = 0.
    227221    write(*,*) "Data for h2o_ice_s"//num//" downloaded."
    228 #ifndef CPP_STD
    229222    call get_var3("watercap"//num,var3_read_2)
    230223    write(*,*) "Data for watercap"//num//" downloaded."
    231 #endif
    232224
    233225    ! Compute the minimum over the year for each point
  • trunk/LMDZ.COMMON/libf/evolution/recomp_orb_param_mod.F90

    r3851 r3961  
    1515SUBROUTINE recomp_orb_param(i_myear,i_myear_leg)
    1616
    17 use time_evol_mod,  only: year_bp_ini, var_obl, var_ecc, var_lsp
    18 use lask_param_mod, only: yearlask, obllask, ecclask, lsplask, end_lask_param_mod, last_ilask
    19 #ifndef CPP_STD
    20     use comcstfi_h,       only: pi
    21     use planete_h,        only: e_elips, obliquit, lsperi, periheli, aphelie, p_elips, peri_day, year_day
    22     use call_dayperi_mod, only: call_dayperi
    23 #else
    24     use comcstfi_mod,     only: pi
    25     use planete_mod,      only: e_elips, obliquit, lsperi, periastr, apoastr, p_elips, peri_day, year_day
    26 #endif
     17use time_evol_mod,    only: year_bp_ini, var_obl, var_ecc, var_lsp
     18use lask_param_mod,   only: yearlask, obllask, ecclask, lsplask, end_lask_param_mod, last_ilask
     19use comcstfi_h,       only: pi
     20use planete_h,        only: e_elips, obliquit, lsperi, periheli, aphelie, p_elips, peri_day, year_day
     21use call_dayperi_mod, only: call_dayperi
    2722
    2823implicit none
     
    5247! 0. Initializations
    5348! **********************************************************************
    54 #ifdef CPP_STD
    55     real :: aphelie, periheli
    56 
    57     aphelie = apoastr
    58     periheli = periastr
    59 #endif
    60 
    6149Year = year_bp_ini + i_myear ! We compute the current year
    6250Lsp = lsperi*180./pi         ! We convert in degree
     
    125113p_elips = 0.5*(periheli + aphelie)*(1. - e_elips*e_elips)/unitastr
    126114
    127 #ifndef CPP_STD
    128     call call_dayperi(Lsp,e_elips,peri_day,year_day)
    129 #endif
     115call call_dayperi(Lsp,e_elips,peri_day,year_day)
    130116
    131117END SUBROUTINE recomp_orb_param
  • trunk/LMDZ.COMMON/libf/evolution/stopping_crit_mod.F90

    r3938 r3961  
    155155use time_evol_mod, only: dt
    156156use comslope_mod,  only: subslope_dist, def_slope_mean
    157 #ifndef CPP_STD
    158     use comcstfi_h,   only: pi
    159 #else
    160     use comcstfi_mod, only: pi
    161 #endif
     157use comcstfi_h,    only: pi
    162158
    163159implicit none
Note: See TracChangeset for help on using the changeset viewer.