Ignore:
Timestamp:
Dec 6, 2024, 5:47:19 PM (2 weeks ago)
Author:
jbclement
Message:

PEM:
Small fixes to initialize and output ice table-related variables and in the launching script.
JBC

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

Legend:

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

    r3533 r3537  
    507507== 04/12/2024 == JBC
    508508Fixing the writing format for "info_PEM.txt".
     509
     510== 06/12/2024 == JBC
     511Small fixes to initialize and output ice table-related variables and in the launching script.
  • trunk/LMDZ.COMMON/libf/evolution/deftank/launchPEM.sh

    r3498 r3537  
    114114            echo "The number of PCM runs between each PEM run has been modified from $nPCM_old to $nPCM."
    115115        fi
    116         if [ $n_myear -ne $n_myear_old ]; then
     116        if [ "$(echo "$n_myear != $n_myear_old" | bc)" -eq 1 ]; then
    117117            echo "The number of initial PCM runs has been modified from $n_myear_old to $n_myear."
    118118        fi
  • trunk/LMDZ.COMMON/libf/evolution/deftank/lib_launchPEM.sh

    r3518 r3537  
    295295    iPCM=$(($irelaunch + 1))
    296296    cleanfiles diags/diagfi .nc $irelaunch
     297    cleanfiles diags/diagsoil .nc $irelaunch
    297298    cleanfiles diags/data2reshape .nc $irelaunch
    298299    cleanfiles "out_PCM/run" "" $irelaunch
     
    310311        iPEM=1
    311312        cleanfiles diags/diagpem .nc $iPEM
     313        cleanfiles diags/diagsoilpem .nc $iPEM
    312314        cleanfiles "out_PEM/run" "" $iPEM
    313315        cleanfiles starts/restart1D_postPEM .txt $iPEM
     
    333335        il=$(echo "($irelaunch - $nPCM_ini + 1)%$nPCM + 1" | bc)
    334336        cleanfiles diags/diagpem .nc $iPEM
     337        cleanfiles diags/diagsoilpem .nc $iPEM
    335338        cleanfiles "out_PEM/run" "" $iPEM
    336339        cleanfiles starts/restart1D_postPEM .txt $iPEM
     
    366369    sed -i "1s/.*/$i_myear $n_myear $convert_years $iPCM $iPEM $nPCM $nPCM_ini/" info_PEM.txt
    367370    cleanfiles diags/diagfi .nc $(($iPCM - 1))
     371    cleanfiles diags/diagsoil .nc $(($iPCM - 1))
    368372    cleanfiles "out_PCM/run" "" $(($iPCM - 1))
    369373    cleanfiles starts/restart1D .txt $(($iPCM - 1))
     
    372376    cleanfiles diags/data2reshape .nc $(($iPCM - 1))
    373377    cleanfiles diags/diagpem .nc $irelaunch
     378    cleanfiles diags/diagsoilpem .nc $irelaunch
    374379    cleanfiles "out_PEM/run" "" $irelaunch
    375380    cleanfiles starts/restart1D_postPEM .txt $irelaunch
  • trunk/LMDZ.COMMON/libf/evolution/pem.F90

    r3532 r3537  
    995995        if (icetable_equilibrium) then
    996996            call writediagpem(ngrid,'ssi_depth_slope'//str2,'ice table depth','m',2,icetable_depth(:,islope))
    997             call writediagpem(ngrid,'ssi_thick_slope'//str2,'ice table depth','m',2,icetable_thickness(:,islope))
     997            call writediagpem(ngrid,'ssi_thick_slope'//str2,'ice table thickness','m',2,icetable_thickness(:,islope))
    998998        else if (icetable_dynamic) then
    999999            call writediagpem(ngrid,'ssi_depth_slope'//str2,'ice table depth','m',2,icetable_depth(:,islope))
    1000             call writediagpem(ngrid,'ssi_thick_slope'//str2,'ice table depth','m',2,icetable_thickness(:,islope))
    10011000        endif
    10021001
     
    10041003            call writediagsoilpem(ngrid,'tsoil_PEM_slope'//str2,'tsoil_PEM','K',3,tsoil_PEM(:,:,islope))
    10051004            call writediagsoilpem(ngrid,'inertiesoil_PEM_slope'//str2,'TI_PEM','K',3,TI_PEM(:,:,islope))
     1005            if (icetable_dynamic) call writediagpem(ngrid,'ice_porefilling'//str2,'ice pore filling','-',3,ice_porefilling(:,:,islope))
    10061006            if (adsorption_pem) then
    10071007                call writediagsoilpem(ngrid,'co2_ads_slope'//str2,'co2_ads','K',3,co2_adsorbded_phys(:,:,islope))
     
    10701070!------------------------
    10711071! III_a.1 Ice update (for startfi)
    1072 
    10731072watercap = 0.
    10741073perennial_co2ice = co2_ice
     
    12101209if (layering_algo) nb_str_max = get_nb_str_max(stratif,ngrid,nslope) ! Get the maximum number of "stratum" in the stratification (layerings)
    12111210call pemdem0("restartpem.nc",longitude,latitude,cell_area,ngrid,nslope,def_slope,subslope_dist)
    1212 call pemdem1("restartpem.nc",i_myear,nsoilmx_PEM,ngrid,nslope,tsoil_PEM, &
    1213              TI_PEM,icetable_depth,icetable_thickness,ice_porefilling,   &
     1211call pemdem1("restartpem.nc",i_myear,nsoilmx_PEM,ngrid,nslope,tsoil_PEM,TI_PEM,icetable_depth,icetable_thickness,ice_porefilling, &
    12141212             co2_adsorbded_phys,h2o_adsorbded_phys,h2o_ice,stratif)
    12151213write(*,*) "restartpem.nc has been written"
  • trunk/LMDZ.COMMON/libf/evolution/pemetat0.F90

    r3532 r3537  
    77!=======================================================================
    88
    9 SUBROUTINE pemetat0(filename,ngrid,nsoil_PCM,nsoil_PEM,nslope,timelen,timestep,TI_PEM,tsoil_PEM,ice_table_depth,ice_table_thickness, &
     9SUBROUTINE pemetat0(filename,ngrid,nsoil_PCM,nsoil_PEM,nslope,timelen,timestep,TI_PEM,tsoil_PEM,icetable_depth,icetable_thickness, &
    1010                    ice_porefilling,tsurf_avg_yr1,tsurf_avg_yr2,q_co2,q_h2o,ps_inst,tsoil_inst,d_h2oice,d_co2ice,co2_ice,h2o_ice,    &
    1111                    global_avg_pressure,watersurf_avg,watersoil_avg,m_co2_regolith_phys,deltam_co2_regolith_phys,                    &
     
    1616use comsoil_h,                  only: volcapa, inertiedat
    1717use adsorption_mod,             only: regolith_adsorption, adsorption_pem
    18 use ice_table_mod,              only: computeice_table_equilibrium, icetable_depth, icetable_thickness, icetable_equilibrium, icetable_dynamic
     18use ice_table_mod,              only: computeice_table_equilibrium, icetable_equilibrium, icetable_dynamic
    1919use constants_marspem_mod,      only: alpha_clap_h2o, beta_clap_h2o, TI_breccia, TI_bedrock
    2020use soil_thermalproperties_mod, only: update_soil_thermalproperties
     
    6060real, dimension(ngrid,nsoil_PEM,nslope),         intent(inout) :: TI_PEM              ! soil (mid-layer) thermal inertia in the PEM grid [SI]
    6161real, dimension(ngrid,nsoil_PEM,nslope),         intent(inout) :: tsoil_PEM           ! soil (mid-layer) temperature [K]
    62 real, dimension(ngrid,nslope),                   intent(inout) :: ice_table_depth     ! Ice table depth [m]
    63 real, dimension(ngrid,nslope),                   intent(inout) :: ice_table_thickness ! Ice table thickness [m]
     62real, dimension(ngrid,nslope),                   intent(inout) :: icetable_depth      ! Ice table depth [m]
     63real, dimension(ngrid,nslope),                   intent(inout) :: icetable_thickness ! Ice table thickness [m]
    6464real, dimension(ngrid,nsoil_PEM,nslope),         intent(inout) :: ice_porefilling     ! Subsurface ice pore filling [m3/m3]
    6565real, dimension(ngrid,nsoil_PEM,nslope,timelen), intent(inout) :: tsoil_inst          ! instantaneous soil (mid-layer) temperature [K]
     
    108108
    109109!0.2 Set to default values
    110 ice_table_depth = -1. ! by default, no ice table
    111 ice_table_thickness = -1.
     110icetable_depth = -1. ! by default, no ice table
     111icetable_thickness = -1.
     112ice_porefilling = 0.
    112113!1. Run
    113114if (startpem_file) then
     
    305306!3. Ice Table
    306307        if (icetable_equilibrium) then
    307             call get_field("ice_table_depth",ice_table_depth,found)
     308            call get_field("icetable_depth",icetable_depth,found)
    308309            if (.not. found) then
    309                 write(*,*)'PEM settings: failed loading <ice_table_depth>'
     310                write(*,*)'PEM settings: failed loading <icetable_depth>'
    310311                write(*,*)'will reconstruct the values of the ice table given the current state'
    311                 call computeice_table_equilibrium(ngrid,nslope,nsoil_PEM,watercaptag,watersurf_avg,watersoil_avg,TI_PEM(:,1,:),ice_table_depth,ice_table_thickness)
    312                 call update_soil_thermalproperties(ngrid,nslope,nsoil_PEM,d_h2oice,h2o_ice,global_avg_pressure,ice_table_depth,ice_table_thickness,ice_porefilling,icetable_equilibrium,icetable_dynamic,TI_PEM)
     312                call computeice_table_equilibrium(ngrid,nslope,nsoil_PEM,watercaptag,watersurf_avg,watersoil_avg,TI_PEM(:,1,:),icetable_depth,icetable_thickness)
     313                call update_soil_thermalproperties(ngrid,nslope,nsoil_PEM,d_h2oice,h2o_ice,global_avg_pressure,icetable_depth,icetable_thickness,ice_porefilling,icetable_equilibrium,icetable_dynamic,TI_PEM)
    313314                do islope = 1,nslope
    314315                    call ini_tsoil_pem(ngrid,nsoil_PEM,TI_PEM(:,:,islope),tsurf_avg_yr2(:,islope),tsoil_PEM(:,:,islope))
     
    318319        else if (icetable_dynamic) then
    319320            call get_field("ice_porefilling",ice_porefilling,found)
     321            if (.not. found) write(*,*)'PEM settings: failed loading <ice_porefilling>'
     322            call get_field("icetable_depth",icetable_depth,found)
    320323            if (.not. found) then
    321                 write(*,*)'PEM settings: failed loading <ice_porefilling>'
    322                 ice_porefilling = 0.
    323             endif
    324             call get_field("ice_table_depth",ice_table_depth,found)
    325             if (.not. found) then
    326                 write(*,*)'PEM settings: failed loading <ice_table_depth>'
     324                write(*,*)'PEM settings: failed loading <icetable_depth>'
    327325                write(*,*)'will reconstruct the values of the ice table given the current state'
    328                 ice_table_depth = -9999.
    329                 call update_soil_thermalproperties(ngrid,nslope,nsoil_PEM,d_h2oice,h2o_ice,global_avg_pressure,ice_table_depth,ice_table_thickness,ice_porefilling,icetable_equilibrium,icetable_dynamic,TI_PEM)
     326                call update_soil_thermalproperties(ngrid,nslope,nsoil_PEM,d_h2oice,h2o_ice,global_avg_pressure,icetable_depth,icetable_thickness,ice_porefilling,icetable_equilibrium,icetable_dynamic,TI_PEM)
    330327                do islope = 1,nslope
    331328                    call ini_tsoil_pem(ngrid,nsoil_PEM,TI_PEM(:,:,islope),tsurf_avg_yr2(:,islope),tsoil_PEM(:,:,islope))
     
    498495!c) Ice table
    499496        if (icetable_equilibrium) then
    500             call computeice_table_equilibrium(ngrid,nslope,nsoil_PEM,watercaptag,watersurf_avg,watersoil_avg,TI_PEM(:,1,:),ice_table_depth,ice_table_thickness)
    501             call update_soil_thermalproperties(ngrid,nslope,nsoil_PEM,d_h2oice,h2o_ice,global_avg_pressure,ice_table_depth,ice_table_thickness,ice_porefilling,icetable_equilibrium,icetable_dynamic,TI_PEM)
     497            call computeice_table_equilibrium(ngrid,nslope,nsoil_PEM,watercaptag,watersurf_avg,watersoil_avg,TI_PEM(:,1,:),icetable_depth,icetable_thickness)
     498            call update_soil_thermalproperties(ngrid,nslope,nsoil_PEM,d_h2oice,h2o_ice,global_avg_pressure,icetable_depth,icetable_thickness,ice_porefilling,icetable_equilibrium,icetable_dynamic,TI_PEM)
    502499            do islope = 1,nslope
    503500                call ini_tsoil_pem(ngrid,nsoil_PEM,TI_PEM(:,:,islope),tsurf_avg_yr2(:,islope),tsoil_PEM(:,:,islope))
     
    505502            write(*,*) 'PEMETAT0: Ice table done'
    506503        else if (icetable_dynamic) then
    507             ice_porefilling = 0.
    508             ice_table_depth = -9999.
    509             call update_soil_thermalproperties(ngrid,nslope,nsoil_PEM,d_h2oice,h2o_ice,global_avg_pressure,ice_table_depth,ice_table_thickness,ice_porefilling,icetable_equilibrium,icetable_dynamic,TI_PEM)
     504            call update_soil_thermalproperties(ngrid,nslope,nsoil_PEM,d_h2oice,h2o_ice,global_avg_pressure,icetable_depth,icetable_thickness,ice_porefilling,icetable_equilibrium,icetable_dynamic,TI_PEM)
    510505            do islope = 1,nslope
    511506                call ini_tsoil_pem(ngrid,nsoil_PEM,TI_PEM(:,:,islope),tsurf_avg_yr2(:,islope),tsoil_PEM(:,:,islope))
  • trunk/LMDZ.COMMON/libf/evolution/pemredem.F90

    r3498 r3537  
    5858
    5959SUBROUTINE pemdem1(filename,i_myear,nsoil_PEM,ngrid,nslope,tsoil_slope_PEM,inertiesoil_slope_PEM, &
    60                    ice_table_depth,ice_table_thickness,ice_porefilling,m_co2_regolith,m_h2o_regolith,h2o_ice,stratif)
     60                   icetable_depth,icetable_thickness,ice_porefilling,m_co2_regolith,m_h2o_regolith,h2o_ice,stratif)
    6161
    6262! write time-dependent variable to restart file
     
    7777real, dimension(ngrid,nsoil_PEM,nslope), intent(in) :: tsoil_slope_PEM       ! under mesh bining according to slope
    7878real, dimension(ngrid,nsoil_PEM,nslope), intent(in) :: inertiesoil_slope_PEM ! under mesh bining according to slope
    79 real, dimension(ngrid,nslope),           intent(in) :: ice_table_depth       ! under mesh bining according to slope
    80 real, dimension(ngrid,nslope),           intent(in) :: ice_table_thickness   ! under mesh bining according to slope
     79real, dimension(ngrid,nslope),           intent(in) :: icetable_depth       ! under mesh bining according to slope
     80real, dimension(ngrid,nslope),           intent(in) :: icetable_thickness   ! under mesh bining according to slope
    8181real, dimension(ngrid,nsoil_PEM,nslope), intent(in) :: ice_porefilling       ! under mesh bining according to slope
    8282real, dimension(ngrid,nsoil_PEM,nslope), intent(in) :: m_co2_regolith, m_h2o_regolith
     
    122122        call put_field("mh2o_reg_ads_slope"//num, "Mass of h2o adsorbded in the regolith",m_h2o_regolith(:,:,islope),Year)
    123123    enddo
    124     call put_field("ice_table_depth","Depth of ice table",ice_table_depth,Year)
    125     call put_field("ice_table_thickness","Depth of ice table",ice_table_thickness,Year)
     124    call put_field("icetable_depth","Depth of ice table",icetable_depth,Year)
     125    call put_field("icetable_thickness","Depth of ice table",icetable_thickness,Year)
    126126    call put_field("ice_porefilling","Subsurface ice pore filling",ice_porefilling,Year)
    127127    call put_field("inertiedat_PEM","Thermal inertie of PEM ",inertiedat_PEM,Year)
Note: See TracChangeset for help on using the changeset viewer.