Ignore:
Timestamp:
Jan 25, 2024, 2:33:52 PM (10 months ago)
Author:
jbclement
Message:

PEM:

  • Addition of a script "inipem_orbit.sh" in the deftank to modify the orbital parameters of a file "startfi.nc" according to the date set in the file "run_PEM.def" and data found in "obl_ecc_lsp.asc";
  • Flow of glaciers is now computed only when there are slopes;
  • Reversion to the name "diagpem.nc" for the PEM outputs (as decided) which was modified in r3171;
  • Some small cleanings.

JBC

Location:
trunk/LMDZ.COMMON/libf/evolution
Files:
1 added
9 edited

Legend:

Unmodified
Added
Removed
  • trunk/LMDZ.COMMON/libf/evolution/changelog.txt

    r3178 r3181  
    204204gathered in an unique Tsoil module.
    205205(cosmetic commit)
     206
     207== 09/01/2023 == JBC
     208- Addition of a script "inipem_orbit.sh" in the deftank to modify the orbital parameters of a file "startfi.nc" according to the date set in the file "run_PEM.def" and data found in "obl_ecc_lsp.asc";
     209- Flow of glaciers is now computed only when there are slopes;
     210- Reversion to the name "diagpem.nc" for the PEM outputs (as decided) which was modified in r3171;
     211- Some small cleanings.
  • trunk/LMDZ.COMMON/libf/evolution/constants_marspem_mod.F90

    r3161 r3181  
    33implicit none
    44
    5 ! Duration of a year and day 
     5! Duration of a year and day
    66integer, parameter :: sols_per_my = 669    ! Number of Sols per year
    77real,    parameter :: sec_per_sol = 88775. ! Duration of a sol, in seconds
    88
    9 ! Molecular masses for CO2,H2O and non condensible gaz, following Franz et al. 2017   
    10 real, parameter :: m_co2 = 44.01e-3    ! CO2 molecular mass (kg/mol)   
    11 real, parameter :: m_noco2 = 33.37e-3  ! Non condensible mol mass (kg/mol)   
     9! Molecular masses for CO2,H2O and non condensible gaz, following Franz et al. 2017
     10real, parameter :: m_co2 = 44.01e-3    ! CO2 molecular mass (kg/mol)
     11real, parameter :: m_noco2 = 33.37e-3  ! Non condensible mol mass (kg/mol)
    1212real, parameter :: m_h2o = 18.01528e-3 ! Molecular weight of h2o (kg/mol)
    1313
     
    2020real, parameter :: beta_clap_h2o = -6143.7  ! Kelvin, Murphy and Koop 2005
    2121
    22 ! Density of the regolith (Zent et al., 1995, Buhler and Piqueux 2021)     
     22! Density of the regolith (Zent et al., 1995, Buhler and Piqueux 2021)
    2323real, parameter :: rho_regolith = 2000. ! kg/m^3
    2424
     
    3232
    3333! Stefan Boltzmann constant
    34 real, parameter :: sigmaB = 5.678e-8 
     34real, parameter :: sigmaB = 5.678e-8
    3535
    3636! Latent heat of CO2
  • trunk/LMDZ.COMMON/libf/evolution/deftank/launch_orb_1Dchained.sh

    r3173 r3181  
    3131#------------------ Modify here the name of PCM exe --------------------
    3232## fill in the name of executable for PCM:
    33 exePCM=testphys1d_29_phymars_para.e
     33exePCM="testphys1d_29_phymars_para.e"
    3434
    3535#----------- Modify here the name of the orbital data file -------------
    3636## fill in the name of executable for PCM:
    37 orb_data=obl_ecc_lsp.asc
     37orb_data="obl_ecc_lsp.asc"
    3838
    3939#------ Check if files/directories necessary for the script exist ------
  • trunk/LMDZ.COMMON/libf/evolution/deftank/launch_pem.sh

    r3145 r3181  
    3232#------------------ Modify here the name of PEM exe --------------------
    3333## fill in the name of executable for PEM:
    34 exePEM=pem_29_phymars_seq.e
     34exePEM="pem_29_phymars_seq.e"
    3535
    3636#-------------- Modify here the name of reshape XIOS exe ---------------
    3737## fill in the name of executable for reshape XIOS:
    38 exeReshape=reshape_XIOS_output_64x48x29_phymars_seq.e
     38exeReshape="reshape_XIOS_output_64x48x29_phymars_seq.e"
    3939
    4040#------ Check if files/directories necessary for the script exist ------
  • trunk/LMDZ.COMMON/libf/evolution/pem.F90

    r3178 r3181  
    6868use recomp_tend_co2_slope_mod,  only: recomp_tend_co2_slope
    6969use compute_soiltemp_mod,       only: compute_tsoil_pem
    70 use writediagpem_mod,           only: writediagfipem, writediagsoilpem
     70use writediagpem_mod,           only: writediagpem, writediagsoilpem
    7171
    7272#ifndef CPP_STD
     
    219219logical                               :: bool_sublim                        ! logical to check if there is sublimation or not
    220220real, dimension(:,:),     allocatable :: porefillingice_thickness_prev_iter ! ngrid x nslope: Thickness of the ice table at the previous iteration [m]
    221 real, dimension(:),       allocatable :: delta_h2o_icetablesublim(:)        ! ngrid x Total mass of the H2O that has sublimated / condenses from the ice table [kg]
     221real, dimension(:),       allocatable :: delta_h2o_icetablesublim           ! ngrid x Total mass of the H2O that has sublimated / condenses from the ice table [kg]
    222222
    223223! Some variables for the PEM run
     
    725725!    II_c Flow of glaciers
    726726!------------------------
    727     if (co2ice_flow) call flow_co2glaciers(timelen,ngrid,nslope,iflat,subslope_dist,def_slope_mean,vmr_co2_PEM_phys,ps_timeseries, &
     727    if (co2ice_flow .and. nslope > 1) call flow_co2glaciers(timelen,ngrid,nslope,iflat,subslope_dist,def_slope_mean,vmr_co2_PEM_phys,ps_timeseries, &
    728728                                            global_avg_press_PCM,global_avg_press_new,co2_ice,flag_co2flow,flag_co2flow_mesh)
    729     if (h2oice_flow) call flow_h2oglaciers(timelen,ngrid,nslope,iflat,subslope_dist,def_slope_mean,tsurf_ave,h2o_ice,flag_h2oflow,flag_h2oflow_mesh)
     729    if (h2oice_flow .and. nslope > 1) call flow_h2oglaciers(timelen,ngrid,nslope,iflat,subslope_dist,def_slope_mean,tsurf_ave,h2o_ice,flag_h2oflow,flag_h2oflow_mesh)
    730730
    731731!------------------------
     
    776776                do t = 1,timelen
    777777                    if (co2_ice_PCM(ig,islope,t) > 1.e-3) then
    778                         ave = ave + beta_clap_co2/(alpha_clap_co2-log(vmr_co2_PEM_phys(ig,t)*ps_timeseries(ig,t)/100.))
     778                        ave = ave + beta_clap_co2/(alpha_clap_co2 - log(vmr_co2_PEM_phys(ig,t)*ps_timeseries(ig,t)/100.))
    779779                    else
    780780                        ave = ave + tsurf_PCM_timeseries(ig,islope,t)
     
    874874!    II_e Outputs
    875875!------------------------
    876     call writediagfipem(ngrid,'ps_ave','Global average pressure','Pa',0,(/global_avg_press_new/))
     876    call writediagpem(ngrid,'ps_ave','Global average pressure','Pa',0,(/global_avg_press_new/))
    877877    do islope = 1,nslope
    878878        write(str2(1:2),'(i2.2)') islope
    879         call writediagfipem(ngrid,'h2o_ice_slope'//str2,'H2O ice','kg.m-2',2,h2o_ice(:,islope))
    880         call writediagfipem(ngrid,'co2_ice_slope'//str2,'CO2 ice','kg.m-2',2,co2_ice(:,islope))
    881         call writediagfipem(ngrid,'tend_h2o_ice_slope'//str2,'H2O ice tend','kg.m-2.year-1',2,tend_h2o_ice(:,islope))
    882         call writediagfipem(ngrid,'tend_co2_ice_slope'//str2,'CO2 ice tend','kg.m-2.year-1',2,tend_co2_ice(:,islope))
    883         call writediagfipem(ngrid,'Flow_co2ice_slope'//str2,'CO2 ice flow','Boolean',2,flag_co2flow(:,islope))
    884         call writediagfipem(ngrid,'tsurf_slope'//str2,'tsurf','K',2,tsurf(:,islope))
     879        call writediagpem(ngrid,'h2o_ice_slope'//str2,'H2O ice','kg.m-2',2,h2o_ice(:,islope))
     880        call writediagpem(ngrid,'co2_ice_slope'//str2,'CO2 ice','kg.m-2',2,co2_ice(:,islope))
     881        call writediagpem(ngrid,'tend_h2o_ice_slope'//str2,'H2O ice tend','kg.m-2.year-1',2,tend_h2o_ice(:,islope))
     882        call writediagpem(ngrid,'tend_co2_ice_slope'//str2,'CO2 ice tend','kg.m-2.year-1',2,tend_co2_ice(:,islope))
     883        call writediagpem(ngrid,'Flow_co2ice_slope'//str2,'CO2 ice flow','Boolean',2,flag_co2flow(:,islope))
     884        call writediagpem(ngrid,'tsurf_slope'//str2,'tsurf','K',2,tsurf(:,islope))
    885885        if(icetable_equilibrium) then
    886             call writediagfipem(ngrid,'ssi_depth_slope'//str2,'ice table depth','m',2,porefillingice_depth(:,islope))
    887             call writediagfipem(ngrid,'ssi_thick_slope'//str2,'ice table depth','m',2,porefillingice_thickness(:,islope))
     886            call writediagpem(ngrid,'ssi_depth_slope'//str2,'ice table depth','m',2,porefillingice_depth(:,islope))
     887            call writediagpem(ngrid,'ssi_thick_slope'//str2,'ice table depth','m',2,porefillingice_thickness(:,islope))
    888888        endif
    889889        if(soil_pem) then
     
    985985    tsoil = tsoil_phys_PEM_timeseries(:,1:nsoilmx,:,timelen)
    986986#ifndef CPP_STD
    987     flux_geo(:,:) = fluxgeo
     987    flux_geo = fluxgeo
    988988#endif
    989989endif
  • trunk/LMDZ.COMMON/libf/evolution/read_data_PCM_mod.F90

    r3152 r3181  
    3535!=======================================================================
    3636! Arguments:
    37 
    3837character(*), intent(in) :: filename                            ! File name
    3938integer,      intent(in) :: timelen                             ! number of times stored in the file
    4039integer,      intent(in) :: iim_input, jjm_input, ngrid, nslope ! number of points in the lat x lon dynamical grid, number of subgrid slopes
    4140! Ouputs
    42 real, dimension(ngrid,nslope),         intent(out) :: min_co2_ice      ! Minimum of co2 ice  per slope of the year [kg/m^2]
     41real, dimension(ngrid,nslope),         intent(out) :: min_co2_ice      ! Minimum of co2 ice per slope of the year [kg/m^2]
    4342real, dimension(ngrid,nslope),         intent(out) :: min_h2o_ice      ! Minimum of h2o ice per slope of the year [kg/m^2]
    44 real, dimension(ngrid,timelen),        intent(out) :: vmr_co2_PCM_phys ! Physics x Times  co2 volume mixing ratio retrieve from the PCM [m^3/m^3]
     43real, dimension(ngrid,timelen),        intent(out) :: vmr_co2_PCM_phys ! Physics x Times co2 volume mixing ratio retrieve from the PCM [m^3/m^3]
    4544real, dimension(ngrid,timelen),        intent(out) :: ps_timeseries    ! Surface Pressure [Pa]
    4645real, dimension(ngrid,timelen),        intent(out) :: q_co2            ! CO2 mass mixing ratio in the first layer [kg/m^3]
  • trunk/LMDZ.COMMON/libf/evolution/recomp_tend_co2_slope_mod.F90

    r3149 r3181  
    2424!   INPUT
    2525integer,                        intent(in) :: timelen, ngrid, nslope
    26 real, dimension(ngrid,timelen), intent(in) :: vmr_co2_PCM                 ! physical point field : Volume mixing ratio of co2 in the first layer
    27 real, dimension(ngrid,timelen), intent(in) :: vmr_co2_pem                 ! physical point field : Volume mixing ratio of co2 in the first layer
    28 real, dimension(ngrid,timelen), intent(in) :: ps_PCM_2                    ! physical point field : Surface pressure in the PCM
     26real, dimension(ngrid,timelen), intent(in) :: vmr_co2_PCM                 ! physical point field: Volume mixing ratio of co2 in the first layer
     27real, dimension(ngrid,timelen), intent(in) :: vmr_co2_pem                 ! physical point field: Volume mixing ratio of co2 in the first layer
     28real, dimension(ngrid,timelen), intent(in) :: ps_PCM_2                    ! physical point field: Surface pressure in the PCM
    2929real,                           intent(in) :: global_avg_press_PCM        ! global averaged pressure at previous timestep
    3030real,                           intent(in) :: global_avg_press_new        ! global averaged pressure at current timestep
    31 real, dimension(ngrid,nslope),  intent(in) :: tendencies_co2_ice_phys_ini ! physical point field : Evolution of perennial ice over one year
     31real, dimension(ngrid,nslope),  intent(in) :: tendencies_co2_ice_phys_ini ! physical point field: Evolution of perennial ice over one year
    3232real, dimension(ngrid,nslope),  intent(in) :: co2ice_slope                ! CO2 ice per mesh and sub-grid slope (kg/m^2)
    3333real, dimension(ngrid,nslope),  intent(in) :: emissivity_slope            ! Emissivity per mesh and sub-grid slope(1)
    3434!   OUTPUT
    35 real, intent(inout) ::  tendencies_co2_ice_phys(ngrid,nslope) ! physical point field : Evolution of perennial ice over one year
     35real, dimension(ngrid,nslope), intent(inout) ::  tendencies_co2_ice_phys ! physical point field: Evolution of perennial ice over one year
    3636
    3737!   local:
    38 !   ----
     38!   ------
    3939integer :: i, t, islope
    4040real    :: coef, ave
  • trunk/LMDZ.COMMON/libf/evolution/reshape_XIOS_output.F90

    r3106 r3181  
    3030    write(*,*) 'numyear',numyear
    3131    write(str(1:1),'(i1.1)') numyear
    32     !nf90_open                 ! open existing netCDF dataset
    33     !integer :: ncid, state
    34     !...
     32
    3533    state = nf90_open(path = "data2reshape"//str//".nc", mode = nf90_nowrite, ncid = ncid1)
    3634    if (state /= nf90_noerr) call handle_err(state)
     
    6967            len_lon = len_
    7068            len_ = len_ + 1
    71         elseif (name_ == "lat".or. name_ == "latitude") then
     69        else if (name_ == "lat".or. name_ == "latitude") then
    7270            dimid_lat=dimids(i)
    7371            len_lat=len_
    74         elseif (name_ == "time_counter".or. name_ ==  "Time") then
     72        else if (name_ == "time_counter".or. name_ ==  "Time") then
    7573            dimid_time=dimids(i)
    7674            len_time=len_
    77         elseif (name_ == "soil_layers".or. name_ ==  "subsurface_layers") then
     75        else if (name_ == "soil_layers".or. name_ ==  "subsurface_layers") then
    7876            dimid_soil=dimids(i)
    7977            len_soil = len_
     
    161159                deallocate(tempvalues_2d)
    162160            endif
    163         elseif (numdims == 3) then
     161        else if (numdims == 3) then
    164162            allocate(tempvalues_3d(len_lon,len_lat,len_time))
    165163            allocate(values_3d(len_lon + 1,len_lat,len_time))
     
    210208
    211209END PROGRAM reshape_XIOS_output
    212 
  • trunk/LMDZ.COMMON/libf/evolution/writediagpem.F90

    r3171 r3181  
    77!=======================================================================
    88
    9 SUBROUTINE writediagfipem(ngrid,nom,titre,unite,dim,px)
     9SUBROUTINE writediagpem(ngrid,nom,titre,unite,dim,px)
    1010
    1111!  Ecriture de variables diagnostiques au choix dans la physique
     
    8686integer                 :: idim, varid
    8787integer                 :: nid
    88 character(*), parameter :: fichnom = "diagfipem.nc"
     88character(*), parameter :: fichnom = "diagpem.nc"
    8989integer, dimension(4)   :: id
    9090integer, dimension(4)   :: edges, corner
     
    578578if (is_master) ierr= NF_CLOSE(nid)
    579579
    580 END SUBROUTINE writediagfipem
     580END SUBROUTINE writediagpem
    581581
    582582subroutine writediagsoilpem(ngrid,name,title,units,dimpx,px)
Note: See TracChangeset for help on using the changeset viewer.