Changeset 3170


Ignore:
Timestamp:
Jan 4, 2024, 11:37:33 AM (12 months ago)
Author:
llange
Message:

Mars PEM
Fixing a small bug: the subroutine compute_icetable was always called, even if tthe option 'icetable_equilibrium' was set to false in the run_PEM.def. It is now fixed by adding a flag before the call.
LL

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

Legend:

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

    r3161 r3170  
    186186- 'ini_h2o_bigreservoir' is renamed into 'ini_huge_h2oice'.
    187187- Some cleanings, in particular for the main program "pem.F90".
     188
     189== 04/01/2024 == LL
     190Fixing a small bug: the subroutine compute_icetable was always called, even if tthe option 'icetable_equilibrium' was set to false in the run_PEM.def. It is now fixed by adding a flag before the call.
  • trunk/LMDZ.COMMON/libf/evolution/pem.F90

    r3161 r3170  
    5555use recomp_orb_param_mod,       only: recomp_orb_param
    5656use ice_table_mod,              only: porefillingice_depth, porefillingice_thickness, end_ice_table_porefilling, &
    57                                       ini_ice_table_porefilling, computeice_table_equilibrium,compute_massh2o_exchange_ssi
     57                                      ini_ice_table_porefilling, icetable_equilibrium, computeice_table_equilibrium,compute_massh2o_exchange_ssi
    5858use soil_thermalproperties_mod, only: update_soil_thermalproperties
    5959use time_phylmdz_mod,           only: daysec, dtphys, day_end
     
    838838
    839839! II_d.3 Update the ice table
    840         write(*,*) "Compute ice table"
    841         porefillingice_thickness_prev_iter = porefillingice_thickness
    842         call computeice_table_equilibrium(ngrid,nslope,nsoilmx_PEM,watercaptag,watersurf_density_ave,watersoil_density_PEM_ave,TI_PEM(:,1,:),porefillingice_depth,porefillingice_thickness)
    843         call compute_massh2o_exchange_ssi(ngrid,nslope,nsoilmx_PEM,porefillingice_thickness_prev_iter,porefillingice_thickness,porefillingice_depth,tsoil_PEM,delta_h2o_icetablesublim) ! Mass of H2O exchange between the ssi and the atmosphere
    844 
     840        if (icetable_equilibrium) then
     841            write(*,*) "Compute ice table"
     842            porefillingice_thickness_prev_iter = porefillingice_thickness
     843            call computeice_table_equilibrium(ngrid,nslope,nsoilmx_PEM,watercaptag,watersurf_density_ave,watersoil_density_PEM_ave,TI_PEM(:,1,:),porefillingice_depth,porefillingice_thickness)
     844            call compute_massh2o_exchange_ssi(ngrid,nslope,nsoilmx_PEM,porefillingice_thickness_prev_iter,porefillingice_thickness,porefillingice_depth,tsoil_PEM,delta_h2o_icetablesublim) ! Mass of H2O exchange between the ssi and the atmosphere
     845        endif
    845846! II_d.4 Update the soil thermal properties
    846847        call update_soil_thermalproperties(ngrid,nslope,nsoilmx_PEM,tend_h2o_ice,h2o_ice,global_avg_press_new,porefillingice_depth,porefillingice_thickness,TI_PEM)
  • trunk/LMDZ.COMMON/libf/evolution/pemetat0.F90

    r3161 r3170  
    1616use comsoil_h,                  only: volcapa, inertiedat
    1717use adsorption_mod,             only: regolith_adsorption, adsorption_pem
    18 use ice_table_mod,              only: computeice_table_equilibrium
     18use ice_table_mod,              only: computeice_table_equilibrium, icetable_equilibrium
    1919use constants_marspem_mod,      only: alpha_clap_h2o, beta_clap_h2o, TI_breccia, TI_bedrock
    2020use soil_thermalproperties_mod, only: update_soil_thermalproperties
     
    102102!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
    103103
    104 !0. Check if the start_PEM exist.
     104!0.1 Check if the start_PEM exist.
    105105
    106106inquire(file = filename,exist = startpem_file)
     
    108108write(*,*)'Is start PEM?',startpem_file
    109109
     110!0.2 Set to default values
     111ice_table = -1.  ! by default, no ice table
     112ice_table_thickness = -1.
    110113!1. Run
    111114if (startpem_file) then
     
    272275!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
    273276!3. Ice Table
    274         call get_field("ice_table",ice_table,found)
    275         if (.not. found) then
    276             write(*,*)'PEM settings: failed loading <ice_table>'
    277             write(*,*)'will reconstruct the values of the ice table given the current state'
    278             ice_table = -1  ! by default, no ice table
    279             ice_table_thickness = -1  ! by default, no ice table
    280             call computeice_table_equilibrium(ngrid,nslope,nsoil_PEM,watercaptag,watersurf_avg,watersoil_avg, TI_PEM(:,1,:),ice_table,ice_table_thickness)
    281             call update_soil_thermalproperties(ngrid,nslope,nsoil_PEM,tend_h2o_ice,h2o_ice,global_avg_pressure,ice_table,ice_table_thickness,TI_PEM)
    282             do islope = 1,nslope
    283                 call soil_pem_ini(ngrid,nsoil_PEM,TI_PEM(:,:,islope),tsurf_avg_yr2(:,islope),tsoil_PEM(:,:,islope))
    284             enddo
     277        if(icetable_equilibrium) then
     278            call get_field("ice_table",ice_table,found)
     279            if (.not. found) then
     280                write(*,*)'PEM settings: failed loading <ice_table>'
     281                write(*,*)'will reconstruct the values of the ice table given the current state'
     282                call computeice_table_equilibrium(ngrid,nslope,nsoil_PEM,watercaptag,watersurf_avg,watersoil_avg, TI_PEM(:,1,:),ice_table,ice_table_thickness)
     283                call update_soil_thermalproperties(ngrid,nslope,nsoil_PEM,tend_h2o_ice,h2o_ice,global_avg_pressure,ice_table,ice_table_thickness,TI_PEM)
     284                do islope = 1,nslope
     285                    call soil_pem_ini(ngrid,nsoil_PEM,TI_PEM(:,:,islope),tsurf_avg_yr2(:,islope),tsoil_PEM(:,:,islope))
     286                enddo
     287            endif
     288            write(*,*) 'PEMETAT0: ICE TABLE done'
    285289        endif
    286 
    287         write(*,*) 'PEMETAT0: ICE TABLE done'
    288290
    289291!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
     
    442444!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
    443445!c) Ice table
    444         ice_table = -1.  ! by default, no ice table
    445         ice_table_thickness = -1.
    446         call computeice_table_equilibrium(ngrid,nslope,nsoil_PEM,watercaptag,watersurf_avg,watersoil_avg,TI_PEM(:,1,:),ice_table,ice_table_thickness)
    447         call update_soil_thermalproperties(ngrid,nslope,nsoil_PEM,tend_h2o_ice,h2o_ice,global_avg_pressure,ice_table,ice_table_thickness,TI_PEM)
    448         do islope = 1,nslope
    449             call soil_pem_ini(ngrid,nsoil_PEM,TI_PEM(:,:,islope),tsurf_avg_yr2(:,islope),tsoil_PEM(:,:,islope))
    450         enddo
    451         write(*,*) 'PEMETAT0: Ice table done'
    452 
     446        if(icetable_equilibrium) then
     447            call computeice_table_equilibrium(ngrid,nslope,nsoil_PEM,watercaptag,watersurf_avg,watersoil_avg,TI_PEM(:,1,:),ice_table,ice_table_thickness)
     448            call update_soil_thermalproperties(ngrid,nslope,nsoil_PEM,tend_h2o_ice,h2o_ice,global_avg_pressure,ice_table,ice_table_thickness,TI_PEM)
     449            do islope = 1,nslope
     450                call soil_pem_ini(ngrid,nsoil_PEM,TI_PEM(:,:,islope),tsurf_avg_yr2(:,islope),tsoil_PEM(:,:,islope))
     451            enddo
     452            write(*,*) 'PEMETAT0: Ice table done'
     453        endif
     454       
    453455!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
    454456!d) Regolith adsorbed
Note: See TracChangeset for help on using the changeset viewer.