Changeset 2985


Ignore:
Timestamp:
Jun 28, 2023, 4:05:56 PM (18 months ago)
Author:
romain.vande
Message:

Generic PEM :

Adapt PEM to run with the generic model.
(CPP_STD keyword to exclude some part of the code at the compilation)

RV

Location:
trunk
Files:
11 edited

Legend:

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

    r2980 r2985  
    3636  subroutine regolith_adsorption(ngrid,nslope,nsoil_PEM,timelen,tend_h2oglaciers,tend_co2glaciers,waterice,co2ice,tsoil_PEM,TI_PEM,ps,q_co2,q_h2o, &
    3737                                m_h2o_completesoil,delta_mh2oreg, m_co2_completesoil,delta_mco2reg)
    38 #ifndef CPP_STD
     38
    3939! inputs
    4040 INTEGER,INTENT(IN) :: ngrid, nslope, nsoil_PEM,timelen ! size dimension: physics x subslope x soil x timeseries
     
    5959! -------------
    6060
     61
    6162! Compute H2O adsorption, then CO2 adsorption
    6263
     
    6869                                                          tsoil_PEM,TI_PEM,m_co2_completesoil,delta_mco2reg)
    6970
    70 #endif
    7171   RETURN
    7272  end subroutine
     
    8585!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
    8686
    87 #ifndef CPP_STD
    8887      use comsoil_h_PEM, only: layer_PEM, mlayer_PEM,index_breccia,index_bedrock
    89       USE comcstfi_h, only:  pi
     88      USE comconst_mod, only:  pi
    9089      use comslope_mod, only : subslope_dist,def_slope_mean
    9190      use vertical_layers_mod, ONLY: ap,bp
     
    9392                                      m_h2o,m_co2,m_noco2, &
    9493                                      rho_regolith
    95 #endif
     94
    9695
    9796 implicit none
     
    123122
    124123 ! local variables
    125 #ifndef CPP_STD
    126124 REAL :: deltam_reg_complete(ngrid,index_breccia,nslope)         ! Difference in the mass per slope and soil layer (kg/m^3)
    127 #endif
    128125 real :: K                        ! Used to compute theta
    129126 integer ig,iloop, islope,isoil,it   ! for loops
     
    140137
    141138! 0. Some initializations
    142 #ifndef CPP_STD
     139
    143140
    144141     allocate(mass_mean(ngrid,timelen))
     
    150147     theta_h2o_adsorbded(:,:,:) = 0.
    151148     dm_h2o_regolith_slope(:,:,:) = 0.
     149
     150#ifndef CPP_STD
    152151
    153152!0.1 Look at perenial ice
     
    184183     pvapor(:,:) = mass_mean(:,:)/m_h2o*q_h2o(:,:)*zplev_mean(:,:)
    185184     pvapor_avg(:) = sum(pvapor(:,:),2)/timelen
     185#endif
    186186     deallocate(pvapor)
    187187     deallocate(zplev_mean)
    188188     deallocate(mass_mean)
     189#ifndef CPP_STD
    189190
    190191! 1. we compute the mass of H2O adsorded in each layer of the meshes 
     
    240241  SUBROUTINE regolith_co2adsorption(ngrid,nslope,nsoil_PEM,timelen,tend_h2oglaciers,tend_co2glaciers,waterice,co2ice,ps,q_co2,q_h2o,&
    241242                                   tsoil_PEM,TI_PEM,m_co2_completesoil,delta_mreg)
    242 #ifndef CPP_STD
     243
    243244      use comsoil_h_PEM, only: layer_PEM, mlayer_PEM,index_breccia,index_bedrock,index_breccia
    244       USE comcstfi_h, only: pi
     245      USE comconst_mod, only: pi
    245246      use comslope_mod, only : subslope_dist,def_slope_mean
    246247      use vertical_layers_mod, ONLY: ap,bp
    247248      use constants_marspem_mod, only: m_co2, m_noco2,rho_regolith
    248 #endif
    249249
    250250      IMPLICIT NONE
     
    278278 INTEGER :: ispermanent_co2glaciers(ngrid,nslope)        ! Check if the co2 glacier is permanent
    279279 INTEGER :: ispermanent_h2oglaciers(ngrid,nslope)        ! Check if the h2o glacier is permanent
    280 #ifndef CPP_STD
    281280 REAL :: deltam_reg_complete(ngrid,index_breccia,nslope)         ! Difference in the mass per slope and soil layer (kg/m^3)
    282 #endif
    283281 REAL :: deltam_reg_slope(ngrid,nslope)                  ! Difference in the mass per slope  (kg/m^3)
    284282 REAL :: m_h2o_adsorbed(ngrid,nsoil_PEM,nslope)          ! Density of CO2 adsorbed (kg/m^3)
     
    298296     allocate(pco2_avg(ngrid))
    299297
    300 #ifndef CPP_STD
     298
    301299 
    302300      m_h2o_adsorbed(:,:,:) = 0.
     
    306304     dm_co2_regolith_slope(:,:,:) = 0
    307305     delta_mreg(:) = 0.
     306
     307#ifndef CPP_STD
    308308
    309309!0.1 Look at perenial ice
  • trunk/LMDZ.COMMON/libf/evolution/co2glaciers_mod.F90

    r2944 r2985  
    6363subroutine compute_hmaxglaciers_co2(ngrid,nslope,iflat,Tcond,def_slope_mean,hmax)
    6464
    65      USE comconst_mod, ONLY: pi
    66      use comcstfi_h, only: g
     65     USE comconst_mod, ONLY: pi,g
    6766
    6867!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  • trunk/LMDZ.COMMON/libf/evolution/ice_table_mod.F90

    r2980 r2985  
    5151!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
    5252    use math_mod,only: findroot
    53 #ifndef CPP_STD
    5453    USE comsoil_h_PEM, only: mlayer_PEM,layer_PEM                  ! Depth of the vertical grid
    5554    USE soil_thermalproperties_mod, only: ice_thermal_properties
     
    134133
    135134      RETURN
    136 #endif
    137135      END
    138136
  • trunk/LMDZ.COMMON/libf/evolution/pem.F90

    r2982 r2985  
    3030PROGRAM pem
    3131
    32 !module needed for INITIALISATION
     32! 1: Modules needed for reading and writting startfi:
     33      use phyetat0_mod, only: phyetat0
     34      use phyredem,     only: physdem0, physdem1
     35      use netcdf,       only: nf90_open,NF90_NOWRITE,nf90_noerr,nf90_strerror, &
     36                         nf90_get_var, nf90_inq_varid, nf90_inq_dimid, &
     37                         nf90_inquire_dimension,nf90_close
     38      ! netcdf is needed to read info like lat and lon in the physiq file
     39      use turb_mod,     only: q2, wstar
     40! 1a: Modules specific from the Marsian physiq
    3341#ifndef CPP_STD
    34       use comsoil_h, only: tsoil, nsoilmx, ini_comsoil_h,inertiedat, mlayer,volcapa,inertiesoil
    35       use surfdat_h, only: tsurf, emis,&
     42      use comsoil_h,    only: tsoil, nsoilmx, ini_comsoil_h,inertiedat, mlayer,volcapa,inertiesoil
     43      use surfdat_h,    only: tsurf, emis,&
    3644                           qsurf,watercap, ini_surfdat_h, &
    3745                           albedodat, zmea, zstd, zsig, zgam, zthe, &
     
    4048      use dimradmars_mod, only: totcloudfrac, albedo
    4149      use dust_param_mod, only: tauscaling
    42       use tracer_mod, only: noms,igcm_h2o_ice,igcm_co2 ! tracer names
    43 #else
    44       use comsoil_h, only: nsoilmx, ini_comsoil_h,inertiedat, mlayer,volcapa
    45       use surfdat_h, only: albedodat, zmea, zstd, zsig, zgam, zthe, &
     50      use tracer_mod,     only: noms,igcm_h2o_ice,igcm_co2 ! tracer names
     51#else
     52! 1b: Modules specific from the Generic physiq
     53      use comsoil_h,    only: nsoilmx, ini_comsoil_h,inertiedat, mlayer,volcapa
     54      use surfdat_h,    only: albedodat, zmea, zstd, zsig, zgam, zthe, &
    4655                           emissiv
    47       use tracer_h, only: noms,igcm_h2o_ice,igcm_co2 ! tracer names
    48       use phys_state_var_mod
    49 #endif
    50       use phyetat0_mod, only: phyetat0
    51       use phyredem, only: physdem0, physdem1
    52       use turb_mod, only: q2, wstar
    53       use netcdf, only: nf90_open,NF90_NOWRITE,nf90_noerr,nf90_strerror, &
    54                         nf90_get_var, nf90_inq_varid, nf90_inq_dimid, &
    55                         nf90_inquire_dimension,nf90_close
     56      use tracer_h,     only: noms,igcm_h2o_ice,igcm_co2 ! tracer names
     57      use phys_state_var_mod, only: cloudfrac, totcloudfrac, albedo_snow_SPECTV,HICE,RNAT, &
     58                                    PCTSRF_SIC, TSLAB, TSEA_ICE, SEA_ICE,          &
     59                                    ALBEDO_BAREGROUND,ALBEDO_CO2_ICE_SPECTV, phys_state_var_init
     60      use aerosol_mod,  only : iniaerosol
     61#endif
     62! 1c: Modules specific from the 1d marsian physiq
    5663#ifndef CPP_1D
    5764      USE iniphysiq_mod, ONLY: iniphysiq
    58 ! For phyredem :
    59       USE control_mod, ONLY: iphysiq, day_step,nsplit_phys
     65      USE control_mod,   ONLY: iphysiq, day_step,nsplit_phys
    6066#else
    6167      use time_phylmdz_mod, only: daysec, iphysiq,day_step
    6268#endif
    63       USE logic_mod, ONLY: iflag_phys
     69
    6470#ifndef CPP_STD
    6571      use mod_phys_lmdz_para, only: is_parallel, is_sequential, &
    6672                                   is_mpi_root, is_omp_root,    &
    6773                                   is_master
    68       use planete_h, only: aphelie, periheli, year_day, peri_day, &
     74      use planete_h,     only: aphelie, periheli, year_day, peri_day, &
    6975                          obliquit
    7076#else
    71 !      USE comcstfi_mod, ONLY: rad,g,r,cpp,pi
    72 !      USE inifis_mod, ONLY: inifis
    73       use planete_mod, only: apoastr, periastr, year_day, peri_day, &
     77      use planete_mod,   only: apoastr, periastr, year_day, peri_day, &
    7478                          obliquit
    7579#endif
    76       USE mod_const_mpi, ONLY: COMM_LMDZ
    77       USE comslope_mod, ONLY: nslope,def_slope,def_slope_mean, &
     80
     81      USE comslope_mod,  ONLY: nslope,def_slope,def_slope_mean, &
    7882                           subslope_dist,iflat,                &
    7983                           major_slope,ini_comslope_h
     84
     85
     86      USE logic_mod,        ONLY: iflag_phys
     87      USE mod_const_mpi,    ONLY: COMM_LMDZ
    8088      use time_phylmdz_mod, only: daysec,dtphys
    81       USE comconst_mod, ONLY: rad,g,r,cpp,pi
     89      USE comconst_mod,     ONLY: rad,g,r,cpp,pi
    8290      USE infotrac
    83       USE geometry_mod, only: latitude_deg
    84       use conf_pem_mod, only: conf_pem
    85       use pemredem, only:  pemdem0,pemdem1
    86       use co2glaciers_mod,only: co2glaciers_evol,co2glaciersflow
    87       use criterion_pem_stop_mod,only: criterion_waterice_stop,criterion_co2_stop
    88       use constants_marspem_mod,only: alpha_clap_co2,beta_clap_co2, alpha_clap_h2o,beta_clap_h2o, &
     91      USE geometry_mod,     only: latitude_deg
     92
     93      use conf_pem_mod,     only: conf_pem
     94      use pemredem,         only:  pemdem0,pemdem1
     95      use co2glaciers_mod,        only: co2glaciers_evol,co2glaciersflow
     96      use criterion_pem_stop_mod, only: criterion_waterice_stop,criterion_co2_stop
     97      use constants_marspem_mod,  only: alpha_clap_co2,beta_clap_co2, alpha_clap_h2o,beta_clap_h2o, &
    8998                                      m_co2,m_noco2
    9099      use evol_co2_ice_s_mod, only: evol_co2_ice_s
    91100      use evol_h2o_ice_s_mod, only: evol_h2o_ice_s
    92 
    93 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!! SOIL
    94       use comsoil_h_PEM, only: soil_pem,ini_comsoil_h_PEM,end_comsoil_h_PEM,nsoilmx_PEM, &
    95                               TI_PEM,inertiedat_PEM,         &                        ! soil thermal inertia         
    96                               tsoil_PEM, mlayer_PEM,layer_PEM,                  &     ! Soil temp, number of subsurface layers, soil mid layer depths
    97                               fluxgeo, &                                              ! geothermal flux for the PEM and GCM
    98                               water_reservoir                                         ! Water ressources
    99       use adsorption_mod, only : regolith_adsorption,adsorption_pem, &                ! bool to check if adsorption, main subroutine
    100                                  ini_adsorption_h_PEM, end_adsorption_h_PEM, &        ! allocate arrays                               
    101                                  co2_adsorbded_phys, h2o_adsorbded_phys               ! mass of co2 and h2O adsorbded
    102 
    103 !!! For orbit parameters
    104       USE temps_mod_evol, ONLY: dt_pem, evol_orbit_pem, Max_iter_pem
     101      use comsoil_h_PEM,      only: soil_pem,ini_comsoil_h_PEM,end_comsoil_h_PEM,nsoilmx_PEM, &
     102                               TI_PEM,inertiedat_PEM,         &                        ! soil thermal inertia         
     103                               tsoil_PEM, mlayer_PEM,layer_PEM,                  &     ! Soil temp, number of subsurface layers, soil mid layer depths
     104                               fluxgeo, &                                              ! geothermal flux for the PEM and GCM
     105                               water_reservoir                                         ! Water ressources
     106      use adsorption_mod,     only : regolith_adsorption,adsorption_pem, &                ! bool to check if adsorption, main subroutine
     107                               ini_adsorption_h_PEM, end_adsorption_h_PEM, &        ! allocate arrays                               
     108                               co2_adsorbded_phys, h2o_adsorbded_phys               ! mass of co2 and h2O adsorbded
     109      USE temps_mod_evol,            ONLY: dt_pem, evol_orbit_pem, Max_iter_pem
    105110      use orbit_param_criterion_mod, only : orbit_param_criterion
    106       use recomp_orb_param_mod, only: recomp_orb_param
     111      use recomp_orb_param_mod,      only: recomp_orb_param
    107112      use ice_table_mod, only: porefillingice_depth,porefillingice_thickness,&
    108113                               end_ice_table_porefilling,ini_ice_table_porefilling, &
     
    111116
    112117#ifdef CPP_1D
    113       use regular_lonlat_mod, only: init_regular_lonlat
     118      use regular_lonlat_mod,       only: init_regular_lonlat
    114119      use physics_distribution_mod, only: init_physics_distribution
    115       use mod_grid_phy_lmdz, only : regular_lonlat
    116       use init_phys_1d_mod, only : init_phys_1d
     120      use mod_grid_phy_lmdz,        only : regular_lonlat
     121      use init_phys_1d_mod,         only : init_phys_1d
    117122#endif
    118123
     
    147152  REAL ps(ip1jmp1)                       ! pression  au sol
    148153
    149   REAL, dimension(:),allocatable :: ps_start_GCM !(ngrid)                       ! pression  au sol
     154  REAL, dimension(:),allocatable :: ps_start_GCM    !(ngrid) pression  au sol
    150155  REAL, dimension(:,:),allocatable :: ps_timeseries !(ngrid x timelen) ! pression  au sol instantannées
    151156
     
    173178
    174179! Variable for h2o_ice evolution
    175       REAL :: ini_surf_h2o
     180      REAL :: ini_surf_h2o                                         ! Initial surface of sublimating h2o ice
    176181      REAL :: ini_surf_co2                                         ! Initial surface of sublimating co2 ice
    177182
     
    188193      LOGICAL :: STOPPING_1_water ! Logical : is there still water ice to sublimate?
    189194      LOGICAL :: STOPPING_co2     ! Logical : is the criterion (% of change in the surface of sublimating water ice) reached?
    190       LOGICAL :: STOPPING_pressure
    191       INTEGER :: criterion_stop  ! which criterion is reached ? 1= h2o ice surf, 2 = co2 ice surf, 3 = ps, 4 = orb param
     195      LOGICAL :: STOPPING_pressure! Logical : is the criterion (% of change in the surface pressure) reached?
     196      INTEGER :: criterion_stop   ! which criterion is reached ? 1= h2o ice surf, 2 = co2 ice surf, 3 = ps, 4 = orb param
    192197
    193198      real,save ::     A , B, mmean              ! Molar mass: intermediate A, B for computations of the  mean molar mass of the layer [mol/kg]
     
    222227
    223228     REAL, ALLOCATABLE :: tsurf_ave(:,:)       ! Physic x SLOPE field : Averaged Surface Temperature [K]
    224      REAL, ALLOCATABLE :: tsoil_ave(:,:,:)   ! Physic x SOIL x SLOPE field : Averaged Soil Temperature [K]
     229     REAL, ALLOCATABLE :: tsoil_ave(:,:,:)     ! Physic x SOIL x SLOPE field : Averaged Soil Temperature [K]
    225230     REAL, ALLOCATABLE :: tsurf_GCM_timeseries(:,:,:)    ! ngrid x SLOPE XTULES field : Surface Temperature in timeseries [K]
    226231
    227232     REAL, ALLOCATABLE :: tsoil_phys_PEM_timeseries(:,:,:,:) !IG x SLOPE XTULES field : NOn averaged Soil Temperature [K]
    228      REAL, ALLOCATABLE :: tsoil_GCM_timeseries(:,:,:,:)    !IG x SLOPE XTULES field : NOn averaged Soil Temperature [K]
    229      REAL, ALLOCATABLE :: tsurf_ave_yr1(:,:) ! Physic x SLOPE field : Averaged Surface Temperature of first call of the gcm [K]
     233     REAL, ALLOCATABLE :: tsoil_GCM_timeseries(:,:,:,:)      !IG x SLOPE XTULES field : NOn averaged Soil Temperature [K]
     234     REAL, ALLOCATABLE :: tsurf_ave_yr1(:,:)                 ! Physic x SLOPE field : Averaged Surface Temperature of first call of the gcm [K]
    230235
    231236     REAL,ALLOCATABLE  :: TI_locslope(:,:)    ! Physic x Soil: Intermediate thermal inertia  to compute Tsoil [SI]
    232237     REAL,ALLOCATABLE  :: Tsoil_locslope(:,:) ! Physic x Soil: intermediate when computing Tsoil [K]
    233238     REAL,ALLOCATABLE  :: Tsurf_locslope(:)   ! Physic x Soil: Intermediate surface temperature  to compute Tsoil [K]
    234      REAL,ALLOCATABLE  :: watersoil_density_timeseries(:,:,:,:) ! Physic x Soil x Slope x Times water soil density, time series [kg /m^3]
    235      REAL,ALLOCATABLE  :: watersurf_density_ave(:,:)            ! Physic  x Slope, water surface density, yearly averaged [kg/m^3]
     239     REAL,ALLOCATABLE  :: watersoil_density_timeseries(:,:,:,:)     ! Physic x Soil x Slope x Times water soil density, time series [kg /m^3]
     240     REAL,ALLOCATABLE  :: watersurf_density_ave(:,:)                ! Physic  x Slope, water surface density, yearly averaged [kg/m^3]
    236241     REAL,ALLOCATABLE  :: watersoil_density_PEM_timeseries(:,:,:,:) ! Physic x Soil x Slope x Times, water soil density, time series [kg/m^3]
    237242     REAL,ALLOCATABLE  :: watersoil_density_PEM_ave(:,:,:)          ! Physic x Soil x SLopes, water soil density, yearly averaged [kg/m^3]
     
    252257
    253258#ifdef CPP_STD
    254 !     INTEGER :: nsplit_phys=1
    255 !     LOGICAL :: iflag_phys=.true.
    256259     REAL :: frost_albedo_threshold=0.05             ! frost albedo threeshold to convert fresh frost to old ice
    257260     REAL :: albedo_h2o_frost                        ! albedo of h2o frost
    258      REAL,ALLOCATABLE :: co2ice(:)                   ! Physics: co2 ice mesh averaged [kg/m^2]
     261     REAL,allocatable :: tsurf_read_generic(:)       ! Temporary variable to do the subslope transfert dimensiion when reading form generic
     262     REAL,allocatable :: qsurf_read_generic(:,:)     ! Temporary variable to do the subslope transfert dimensiion when reading form generic
     263     REAL,allocatable :: tsoil_read_generic(:,:)     ! Temporary variable to do the subslope transfert dimensiion when reading form generic
     264     REAL,allocatable :: emis_read_generic(:)        ! Temporary variable to do the subslope transfert dimensiion when reading form generic
     265     REAL,allocatable :: albedo_read_generic(:,:)    ! Temporary variable to do the subslope transfert dimensiion when reading form generic
     266     REAL,allocatable :: tsurf(:,:)                  ! Subslope variable, only needed in the GENERIC case
     267     REAL,allocatable :: qsurf(:,:,:)                ! Subslope variable, only needed in the GENERIC case
     268     REAL,allocatable :: tsoil(:,:,:)                ! Subslope variable, only needed in the GENERIC case
     269     REAL,allocatable :: emis(:,:)                   ! Subslope variable, only needed in the GENERIC case
     270     REAL,allocatable :: watercap(:,:)               ! Subslope variable, only needed in the GENERIC case =0 no watercap in generic model
     271     LOGICAL, allocatable :: WATERCAPTAG(:)          ! Subslope variable, only needed in the GENERIC case =false no watercaptag in generic model
     272     REAL,allocatable :: albedo(:,:,:)               ! Subslope variable, only needed in the GENERIC case
     273     REAL,allocatable :: inertiesoil(:,:,:)          ! Subslope variable, only needed in the GENERIC case
    259274#endif
    260275
    261276#ifdef CPP_1D
    262 INTEGER :: nsplit_phys
    263 integer,parameter:: jjm_value=jjm-1
    264 integer :: ierr
     277  INTEGER :: nsplit_phys
     278  integer,parameter:: jjm_value=jjm-1
     279  integer :: ierr
    265280#else
    266 integer,parameter:: jjm_value=jjm
     281  integer,parameter:: jjm_value=jjm
    267282#endif
    268283
     
    449464         call initracer(ngrid,nq)
    450465         call iniaerosol()
     466         allocate(tsurf_read_generic(ngrid))
     467         allocate(qsurf_read_generic(ngrid,nq))
     468         allocate(tsoil_read_generic(ngrid,nsoilmx))
     469         allocate(emis_read_generic(ngrid))
     470         allocate(tsurf(ngrid,1))
     471         allocate(qsurf(ngrid,nq,1))
     472         allocate(tsoil(ngrid,nsoilmx,1))
     473         allocate(emis(ngrid,1))
     474         allocate(watercap(ngrid,1))
     475         allocate(watercaptag(ngrid))
     476         allocate(albedo_read_generic(ngrid,2))
     477         allocate(albedo(ngrid,2,1))
     478         allocate(inertiesoil(ngrid,nsoilmx,1))
    451479         call phyetat0(.true.,                                 &
    452480                       ngrid,nlayer,FILE_NAME,0,0,nsoilmx,nq,      &
    453                        day_ini,time_phys,tsurf,tsoil,emis,q2,qsurf,   &
     481                       day_ini,time_phys,tsurf_read_generic,tsoil_read_generic,emis_read_generic,q2,qsurf_read_generic,   &
    454482                       cloudfrac,totcloudfrac,hice,                   &
    455483                       rnat,pctsrf_sic,tslab, tsea_ice,sea_ice)
    456          call surfini(ngrid,nq,qsurf,albedo,albedo_bareground,albedo_snow_SPECTV,albedo_co2_ice_SPECTV)
    457 
    458          call ini_comslope_h(ngrid,nsoilmx,nq)
    459 
    460          allocate(co2ice(ngrid))
    461          co2ice(:)=qsurf(:,igcm_co2)
    462          co2ice_slope(:,1)=co2ice(:)
    463          tsurf_slope(:,1)=tsurf(:)
     484         call surfini(ngrid,nq,qsurf_read_generic,albedo_read_generic,albedo_bareground,albedo_snow_SPECTV,albedo_co2_ice_SPECTV)
     485
     486         nslope=1
     487         call ini_comslope_h(ngrid,1)
     488
     489         qsurf(:,:,1)=qsurf_read_generic(:,:)
     490         tsurf(:,1)=tsurf_read_generic(:)
     491         tsoil(:,:,1)=tsoil_read_generic(:,:)
     492         emis(:,1)=emis_read_generic(:)
     493         watercap(:,1)=0.
     494         watercaptag(:)=.false.
     495         albedo(:,1,1)=albedo_read_generic(:,1)
     496         albedo(:,2,1)=albedo_read_generic(:,2)
     497         inertiesoil(:,:,1)=inertiedat(:,:)
    464498
    465499if (nslope.eq.1) then
     
    473507     DO i=1,ngrid
    474508       DO nnq=1,nqtot
    475          qsurf_slope(i,nnq,1)=qsurf(i,nnq)
    476          if(qsurf(i,nnq).LT.0) then
    477            qsurf(i,nnq)=0.
     509         qsurf(i,nnq,1)=qsurf_read_generic(i,nnq)
     510         if(qsurf(i,nnq,1).LT.0) then
     511           qsurf(i,nnq,1)=0.
    478512         endif
    479513       enddo
     
    529563     call nb_time_step_GCM("data_GCM_Y1.nc",timelen)
    530564
     565     allocate(tsoil_ave(ngrid,nsoilmx,nslope))
     566     allocate(watersoil_density_PEM_ave(ngrid,nsoilmx_PEM,nslope))
     567
    531568     allocate(vmr_co2_gcm(ngrid,timelen))
    532569     allocate(ps_timeseries(ngrid,timelen))
     
    537574     allocate(tsurf_ave_yr1(ngrid,nslope))
    538575     allocate(tsurf_ave(ngrid,nslope))
    539      allocate(tsoil_ave(ngrid,nsoilmx,nslope))
     576
    540577     allocate(tsurf_GCM_timeseries(ngrid,nslope,timelen))
    541578     allocate(tsoil_GCM_timeseries(ngrid,nsoilmx,nslope,timelen))
     
    549586     allocate(tsoil_phys_PEM_timeseries(ngrid,nsoilmx_PEM,nslope,timelen))
    550587     allocate(watersoil_density_PEM_timeseries(ngrid,nsoilmx_PEM,nslope,timelen))
    551      allocate(watersoil_density_PEM_ave(ngrid,nsoilmx_PEM,nslope))
    552588     allocate(delta_co2_adsorbded(ngrid))
    553589     allocate(delta_h2o_adsorbded(ngrid))
     
    603639      ENDDO
    604640      watersoil_density_PEM_ave(:,:,:) = SUM(watersoil_density_PEM_timeseries(:,:,:,:),4)/timelen
     641  endif !soil_pem
    605642      deallocate(tsoil_ave)
    606643      deallocate(tsoil_GCM_timeseries)
    607   endif !soil_pem
    608644
    609645!------------------------
     
    11241160
    11251161! III_a.1 Ice update (for startfi)
    1126 #ifdef CPP_STD
    1127 ! Co2 ice
    1128       DO ig = 1,ngrid
    1129         co2ice(ig) = 0.
    1130         DO islope = 1,nslope
    1131           co2ice(ig) = co2ice(ig) + co2ice_slope(ig,islope) &
    1132                       * subslope_dist(ig,islope) /          &
    1133                       cos(pi*def_slope_mean(islope)/180.)
    1134         ENDDO
    1135         qsurf(ig,igcm_co2)=co2ice(ig)
    1136       ENDDO ! of DO ig=1,ngrid
    1137 #endif
    11381162
    11391163! H2O ice
  • trunk/LMDZ.COMMON/libf/evolution/pemetat0.F90

    r2980 r2985  
    6666   real :: year_PEM_read                                              ! Year of the PEM previous run
    6767   LOGICAL :: startpem_file                                           ! boolean to check if we read the startfile or not
     68#ifdef CPP_STD   
     69   logical :: watercaptag(ngrid)
     70
     71   watercaptag(:)=.false.
     72#endif
    6873
    6974!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  • trunk/LMDZ.COMMON/libf/evolution/read_data_GCM.F90

    r2980 r2985  
    122122     print *, "Downloading data for h2o_ice_s_slope done"
    123123
     124#ifndef CPP_STD
     125
    124126     print *, "Downloading data for watercap_slope ..."
    125127DO islope=1,nslope
     
    129131ENDDO           
    130132     print *, "Downloading data for watercap_slope done"
     133
     134#endif
    131135   
    132136 print *, "Downloading data for tsurf_slope ..."
     
    139143     print *, "Downloading data for tsurf_slope done"
    140144
     145#ifndef CPP_STD
     146
    141147     if(soil_pem) then
    142148
     
    169175
    170176  endif !soil_pem
     177
     178#endif
    171179
    172180  else !nslope=1 no slope, we copy all the values
     
    177185#ifndef CPP_STD
    178186!    call get_var3("watercap", watercap_slope(:,:,1,:))
    179   watercap_slope(:,:,1,:)=1.
     187  watercap_slope(:,:,1,:)=0.
     188  watersurf_density_dyn(:,:,:,:)=0.
     189  watersoil_density_dyn(:,:,:,:,:)=0.
    180190#endif
    181191
     
    188198  print *, "Computing the min of h2o_ice_slope"
    189199  min_h2o_ice_dyn(:,:,:)=minval(h2o_ice_s_dyn+watercap_slope,4)
    190 !  min_h2o_ice_dyn(:,:,:)=minval(h2o_ice_s_dyn,4)
    191200  print *, "Computing the min of co2_ice_slope"
    192201  min_co2_ice_dyn(:,:,:)=minval(co2_ice_slope_dyn,4)
  • trunk/LMDZ.COMMON/libf/evolution/recomp_orb_param_mod.F90

    r2980 r2985  
    1717      USE planete_h, ONLY: e_elips, obliquit, timeperi, periheli,aphelie,p_elips,peri_day,year_day
    1818#else
    19       use planete_mod, only: e_elips, obliquit, timeperi
     19      use planete_mod, only: e_elips, obliquit, timeperi,periastr,apoastr,p_elips,peri_day,year_day
    2020      USE comcstfi_mod, only: pi
    2121
     
    5353      ! 0. Initializations
    5454      ! **********************************************************************
     55#ifdef CPP_STD
     56      real aphelie
     57      real periheli
    5558
     59      aphelie=apoastr
     60      periheli=periastr
     61#endif
    5662
    5763          Year=year_bp_ini+year_PEM+final_iter
     
    104110              unitastr=149.597927
    105111              p_elips=0.5*(periheli+aphelie)*(1-e_elips*e_elips)/unitastr
    106 
     112#ifndef CPP_STD 
    107113              call call_dayperi(timeperi,e_elips,peri_day,year_day)
     114#endif
    108115             endif
    109116              exit
  • trunk/LMDZ.COMMON/libf/evolution/soil_thermalproperties_mod.F90

    r2962 r2985  
    5858
    5959  SUBROUTINE update_soil_thermalproperties(ngrid,nslope,nsoil_PEM,tendencies_waterice,waterice,p_avg_new,ice_depth,ice_thickness,TI_PEM)
    60 #ifndef CPP_STD
     60
    6161 USE comsoil_h, only:  inertiedat, volcapa
    6262 USE comsoil_h_PEM, only: layer_PEM,inertiedat_PEM,depth_breccia,depth_bedrock,index_breccia,index_bedrock,reg_thprop_dependp
     
    232232!=======================================================================
    233233      RETURN
    234 #endif
    235234      END subroutine update_soil_thermalproperties
    236235
  • trunk/LMDZ.COMMON/makelmdz_fcm

    r2967 r2985  
    488488if [[ -d ${LIBFGCM}/evolution &&  "$code" == "pem" ]]
    489489then
     490if [[ "$physique" == "std" ]]
     491then
     492   CPP_KEY="$CPP_KEY CPP_STD"
     493fi
    490494   EVOLUTION_PATH="${LIBFGCM}/evolution"
    491495   INCLUDE="$INCLUDE -I${LIBFGCM}/evolution"
    492496fi
     497
     498if [[ -d ${LIBFGCM}/evolution &&  "$code" == "reshape_XIOS_output" ]]
     499then
     500if [[ "$physique" == "std" ]]
     501then
     502   CPP_KEY="$CPP_KEY CPP_STD"
     503fi
     504   EVOLUTION_PATH="${LIBFGCM}/evolution"
     505   INCLUDE="$INCLUDE -I${LIBFGCM}/evolution"
     506fi
     507
    493508
    494509# NETCDF library include/library paths
  • trunk/LMDZ.GENERIC/deftank/field_def_physics.xml

    r2737 r2985  
    1414                   unit="degrees" />
    1515        </field_group>
     16
     17        <field_group id="fields_altitude" grid_ref="altitude_grid">
     18            <field id="aps"
     19                   long_name="aps" />
     20            <field id="bps"
     21                   long_name="bps" />
     22        </field_group>
     23
     24        <field_group id="fields_interlayer" grid_ref="interlayer_grid">
     25            <field id="ap"
     26                   long_name="ap" />
     27            <field id="bp"
     28                   long_name="bp" />
     29        </field_group>
     30
    1631       <!-- 1D variables (spectral)-->
    1732       <field_group id="IR_fields" grid_ref="grid_IR">
     
    4257                   long_name="Absorbed stellar radiation"
    4358                    unit="W/m2" /> 
     59            <field id="tsurf"
     60                   long_name="Surface Temperature"
     61                   unit="K" />
     62            <field id="co2ice"
     63                   long_name="CO2 ice thickness"
     64                   unit="kg/m2" />
     65            <field id="h2o_ice_s"
     66                   long_name="H2O ice thickness"
     67                   unit="kg/m2" />
     68            <field id="h2o_cropped"
     69                   long_name="h2o in the first layer" 
     70                   unit="kg/kg" />
     71            <field id="co2_cropped"
     72                   long_name="co2 in the first layer" 
     73                   unit="kg/kg" />
    4474        </field_group>
    4575
     
    74104                   long_name="Plume vertical velocity"
    75105                   unit="m/s" />
     106        </field_group>
    76107
    77         </field_group>
    78108        <!--Spectral IR 3D variables-->
    79109        <field_group id="spectral_IR_3D" grid_ref="grid_IR_3D">
  • trunk/LMDZ.GENERIC/libf/phystd/physiq_mod.F90

    r2972 r2985  
    26952695         CALL send_xios_field('h2o_vap',zq(:,:,igcm_h2o_vap))
    26962696         CALL send_xios_field('h2o_ice',zq(:,:,igcm_h2o_ice))
     2697
     2698         CALL send_xios_field('h2o_layer1',zq(:,1,igcm_h2o_vap))
     2699         CALL send_xios_field('co2_layer1',zq(:,1,igcm_co2_ice))
     2700         CALL send_xios_field('tsurf',tsurf)
     2701         CALL send_xios_field('co2ice',qsurf(1:ngrid,igcm_co2_ice))
     2702         CALL send_xios_field('h2o_ice_s',qsurf(1:ngrid,igcm_h2o_ice))
    26972703      ENDIF
    26982704
Note: See TracChangeset for help on using the changeset viewer.