Ignore:
Timestamp:
Dec 4, 2024, 4:04:54 PM (3 weeks ago)
Author:
jbclement
Message:

PEM:
Removing unecessary module/subroutine "interpol_TI_PEM2PCM.F90" + Few small corrections/cleanings.
JBC

File:
1 edited

Legend:

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

    r3525 r3532  
    4545real,                           intent(in) :: global_avg_pressure ! mean average pressure on the planet [Pa]
    4646real, dimension(ngrid,nslope),  intent(in) :: tsurf_avg_yr1       ! surface temperature at the first year of PCM call [K]
    47 real, dimension(ngrid,nslope),  intent(in) :: tsurf_avg_yr2       ! surface temperature at the second  year of PCM call [K]
     47real, dimension(ngrid,nslope),  intent(in) :: tsurf_avg_yr2       ! surface temperature at the second year of PCM call [K]
    4848real, dimension(ngrid,timelen), intent(in) :: q_co2               ! MMR tracer co2 [kg/kg]
    4949real, dimension(ngrid,timelen), intent(in) :: q_h2o               ! MMR tracer h2o [kg/kg]
     
    281281                call compute_tsoil_pem(ngrid,nsoil_PEM,.true.,TI_PEM(:,:,islope),timestep,tsurf_avg_yr2(:,islope),tsoil_PEM(:,:,islope))
    282282            else
    283 ! predictor corrector: restart from year 1 of the PCM and build the evolution of
    284 ! tsoil at depth
     283! predictor corrector: restart from year 1 of the PCM and build the evolution of tsoil at depth
    285284                tsoil_tmp_yr1(:,:,islope) = tsoil_startPEM(:,:,islope)
    286285                call compute_tsoil_pem(ngrid,nsoil_PEM,.true.,TI_PEM(:,:,islope),timestep,tsurf_avg_yr1(:,islope),tsoil_tmp_yr1(:,:,islope))
     
    289288                call compute_tsoil_pem(ngrid,nsoil_PEM,.false.,TI_PEM(:,:,islope),timestep,tsurf_avg_yr2(:,islope),tsoil_tmp_yr2(:,:,islope))
    290289
    291                 do iloop = nsoil_PCM+1,nsoil_PEM
     290                do iloop = nsoil_PCM + 1,nsoil_PEM
    292291                    tsoil_PEM(:,iloop,islope) = tsoil_tmp_yr2(:,iloop,islope)
    293292                enddo
     
    295294
    296295            do it = 1,timelen
    297                 do isoil = nsoil_PCM+1,nsoil_PEM
    298                     tsoil_inst(:,isoil,islope,it) = tsoil_PEM(:,isoil,islope)
    299                 enddo
    300             enddo
    301             do isoil = nsoil_PCM+1,nsoil_PEM
    302                 do ig = 1,ngrid
    303                     watersoil_avg(ig,isoil,islope) = exp(beta_clap_h2o/tsoil_PEM(ig,isoil,islope) + alpha_clap_h2o)/tsoil_PEM(ig,isoil,islope)*mmol(igcm_h2o_vap)/(mugaz*r)
    304                 enddo
     296                tsoil_inst(:,nsoil_PCM + 1:nsoil_PEM,islope,it) = tsoil_PEM(:,nsoil_PCM + 1:nsoil_PEM,islope)
     297            enddo
     298            do isoil = nsoil_PCM + 1,nsoil_PEM
     299                watersoil_avg(:,isoil,islope) = exp(beta_clap_h2o/tsoil_PEM(:,isoil,islope) + alpha_clap_h2o)/tsoil_PEM(:,isoil,islope)*mmol(igcm_h2o_vap)/(mugaz*r)
    305300            enddo
    306301        enddo ! islope
     
    314309                write(*,*)'PEM settings: failed loading <ice_table_depth>'
    315310                write(*,*)'will reconstruct the values of the ice table given the current state'
    316                 call computeice_table_equilibrium(ngrid,nslope,nsoil_PEM,watercaptag,watersurf_avg,watersoil_avg, TI_PEM(:,1,:),ice_table_depth,ice_table_thickness)
     311                call computeice_table_equilibrium(ngrid,nslope,nsoil_PEM,watercaptag,watersurf_avg,watersoil_avg,TI_PEM(:,1,:),ice_table_depth,ice_table_thickness)
    317312                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)
    318313                do islope = 1,nslope
     
    322317            write(*,*) 'PEMETAT0: ICE TABLE done'
    323318        else if (icetable_dynamic) then
     319            call get_field("ice_porefilling",ice_porefilling,found)
     320            if (.not. found) then
     321                write(*,*)'PEM settings: failed loading <ice_porefilling>'
     322                ice_porefilling = 0.
     323            endif
    324324            call get_field("ice_table_depth",ice_table_depth,found)
    325325            if (.not. found) then
     
    331331                    call ini_tsoil_pem(ngrid,nsoil_PEM,TI_PEM(:,:,islope),tsurf_avg_yr2(:,islope),tsoil_PEM(:,:,islope))
    332332                enddo
    333             endif
    334             call get_field("ice_porefilling",ice_porefilling,found)
    335             if (.not. found) then
    336                 write(*,*)'PEM settings: failed loading <ice_porefilling>'
    337                 ice_porefilling = 1.
    338333            endif
    339334            write(*,*) 'PEMETAT0: ICE TABLE done'
     
    510505            write(*,*) 'PEMETAT0: Ice table done'
    511506        else if (icetable_dynamic) then
    512             ice_porefilling = 1.
     507            ice_porefilling = 0.
    513508            ice_table_depth = -9999.
    514509            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)
     
    518513            write(*,*) 'PEMETAT0: Ice table done'
    519514        endif
    520        
     515
    521516!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
    522517!d) Regolith adsorbed
Note: See TracChangeset for help on using the changeset viewer.