Changeset 3426 for trunk/LMDZ.COMMON/libf/evolution
- Timestamp:
- Sep 6, 2024, 1:32:48 PM (4 months ago)
- Location:
- trunk/LMDZ.COMMON/libf/evolution
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LMDZ.COMMON/libf/evolution/changelog.txt
r3424 r3426 416 416 == 02/09/2024 == JBC 417 417 Modification to the layering algorithm to make dust lag prevent further sublimation. 418 419 == 06/09/2024 == JBC 420 Modification in the way of updating the soil temperatures to improve the computation time + Small correction in the calculation of 'timestep'. -
trunk/LMDZ.COMMON/libf/evolution/pem.F90
r3419 r3426 204 204 real, dimension(:,:), allocatable :: tsurf_avg ! Physic x SLOPE field: Averaged Surface Temperature [K] 205 205 real, dimension(:,:,:), allocatable :: tsoil_avg ! Physic x SOIL x SLOPE field: Averaged Soil Temperature [K] 206 real, dimension(:,:,:), allocatable :: tsoil_anom ! Amplitude between instataneous and yearly average soil temperature [K]207 206 real, dimension(:,:,:), allocatable :: tsurf_PCM_timeseries ! ngrid x SLOPE x TIMES field: Surface Temperature in timeseries [K] 208 real, dimension(:,:,:,:), allocatable :: tsoil_phys_PEM_timeseries ! IG x S LOPE x TIMES field: Non averaged Soil Temperature [K]209 real, dimension(:,:,:,:), allocatable :: tsoil_ PCM_timeseries ! IG x SLOPE x TIMES field: Non averaged Soil Temperature[K]207 real, dimension(:,:,:,:), allocatable :: tsoil_phys_PEM_timeseries ! IG x SOIL x SLOPE x TIMES field: Non averaged Soil Temperature [K] 208 real, dimension(:,:,:,:), allocatable :: tsoil_anom ! IG x SOIL x SLOPE x TIMES field: Amplitude between instataneous and yearly average soil temperature at the beginning [K] 210 209 real, dimension(:,:), allocatable :: tsurf_avg_yr1 ! Physic x SLOPE field: Averaged Surface Temperature of first call of the PCM [K] 211 real, dimension(:,:), allocatable :: TI_locslope ! Physic x Soil: Intermediate thermal inertia to compute Tsoil [SI]212 210 real, dimension(:,:), allocatable :: Tsoil_locslope ! Physic x Soil: Intermediate when computing Tsoil [K] 213 211 real, dimension(:), allocatable :: Tsurf_locslope ! Physic x Soil: Intermediate surface temperature to compute Tsoil [K] … … 343 341 year_day = 669 344 342 daysec = 88775. 345 timestep = year_day*daysec /year_step343 timestep = year_day*daysec*year_step 346 344 347 345 !----------------------------- INITIALIZATION -------------------------- … … 540 538 allocate(tsurf_avg(ngrid,nslope)) 541 539 allocate(tsurf_PCM_timeseries(ngrid,nslope,timelen)) 542 allocate(tsoil_ PCM_timeseries(ngrid,nsoilmx,nslope,timelen))540 allocate(tsoil_anom(ngrid,nsoilmx,nslope,timelen)) 543 541 allocate(q_co2_PEM_phys(ngrid,timelen)) 544 542 allocate(q_h2o_PEM_phys(ngrid,timelen)) … … 557 555 write(*,*) "Downloading data Y1..." 558 556 call read_data_PCM("data_PCM_Y1.nc",timelen,iim,jjm_value,ngrid,nslope,vmr_co2_PCM,ps_timeseries,min_co2_ice(:,:,1),min_h2o_ice(:,:,1), & 559 tsurf_avg_yr1,tsoil_avg,tsurf_PCM_timeseries,tsoil_ PCM_timeseries,q_co2_PEM_phys,q_h2o_PEM_phys, &557 tsurf_avg_yr1,tsoil_avg,tsurf_PCM_timeseries,tsoil_anom,q_co2_PEM_phys,q_h2o_PEM_phys, & 560 558 watersurf_density_avg,watersoil_density_timeseries) 561 559 write(*,*) "Downloading data Y1 done!" … … 564 562 write(*,*) "Downloading data Y2..." 565 563 call read_data_PCM("data_PCM_Y2.nc",timelen,iim,jjm_value,ngrid,nslope,vmr_co2_PCM,ps_timeseries,min_co2_ice(:,:,2),min_h2o_ice(:,:,2), & 566 tsurf_avg,tsoil_avg,tsurf_PCM_timeseries,tsoil_ PCM_timeseries,q_co2_PEM_phys,q_h2o_PEM_phys, &564 tsurf_avg,tsoil_avg,tsurf_PCM_timeseries,tsoil_anom,q_co2_PEM_phys,q_h2o_PEM_phys, & 567 565 watersurf_density_avg,watersoil_density_timeseries) 568 566 write(*,*) "Downloading data Y2 done!" … … 580 578 581 579 if (soil_pem) then 582 allocate(tsoil_anom(ngrid,nsoilmx,nslope)) 583 tsoil_anom = tsoil - tsoil_avg ! compute anomaly between Tsoil(t) in the startfi - <Tsoil> to recompute properly tsoil in the restart 580 do t = 1,timelen 581 tsoil_anom(:,:,:,t) = tsoil_anom(:,:,:,t) - tsoil_avg ! compute anomaly between Tsoil(t) in the startfi - <Tsoil> to recompute properly tsoil in the restart 582 enddo 584 583 call soil_settings_PEM(ngrid,nslope,nsoilmx_PEM,nsoilmx,inertiesoil,TI_PEM) 585 584 tsoil_PEM(:,1:nsoilmx,:) = tsoil_avg 586 tsoil_phys_PEM_timeseries(:,1:nsoilmx,:,:) = tsoil_ PCM_timeseries585 tsoil_phys_PEM_timeseries(:,1:nsoilmx,:,:) = tsoil_anom 587 586 watersoil_density_PEM_timeseries(:,1:nsoilmx,:,:) = watersoil_density_timeseries 588 587 do l = nsoilmx + 1,nsoilmx_PEM … … 592 591 watersoil_density_PEM_avg = sum(watersoil_density_PEM_timeseries,4)/timelen 593 592 endif !soil_pem 594 deallocate(tsoil_avg ,tsoil_PCM_timeseries)593 deallocate(tsoil_avg) 595 594 596 595 !------------------------ … … 895 894 896 895 ! II_d.2 Update soil temperature 897 allocate(TI_locslope(ngrid,nsoilmx_PEM))896 write(*,*)"Updating soil temperature" 898 897 allocate(Tsoil_locslope(ngrid,nsoilmx_PEM)) 899 allocate(Tsurf_locslope(ngrid))900 write(*,*)"Updating soil temperature"901 902 ! Soil averaged903 898 do islope = 1,nslope 904 TI_locslope = TI_PEM(:,:,islope) 899 call compute_tsoil_pem(ngrid,nsoilmx_PEM,.true.,TI_PEM(:,:,islope),timestep,tsurf_avg(:,islope),tsoil_PEM(:,:,islope)) 900 call compute_tsoil_pem(ngrid,nsoilmx_PEM,.false.,TI_PEM(:,:,islope),timestep,tsurf_avg(:,islope),tsoil_PEM(:,:,islope)) 901 905 902 do t = 1,timelen 906 Tsoil_locslope = tsoil_phys_PEM_timeseries(:,:,islope,t) 907 Tsurf_locslope = tsurf_PCM_timeseries(:,islope,t) 908 call compute_tsoil_pem(ngrid,nsoilmx_PEM,.true.,TI_locslope,timestep/timelen,Tsurf_locslope,Tsoil_locslope) 909 call compute_tsoil_pem(ngrid,nsoilmx_PEM,.false.,TI_locslope,timestep/timelen,Tsurf_locslope,Tsoil_locslope) 910 tsoil_phys_PEM_timeseries(:,:,islope,t) = Tsoil_locslope 903 Tsoil_locslope(:,1:nsoilmx) = tsoil_PEM(:,1:nsoilmx,islope) + tsoil_anom(:,:,islope,t) 904 Tsoil_locslope(:,nsoilmx + 1:) = tsoil_PEM(:,nsoilmx + 1:,islope) 911 905 do ig = 1,ngrid 912 906 do isoil = 1,nsoilmx_PEM 913 907 watersoil_density_PEM_timeseries(ig,isoil,islope,t) = exp(beta_clap_h2o/Tsoil_locslope(ig,isoil) + alpha_clap_h2o)/Tsoil_locslope(ig,isoil)*mmol(igcm_h2o_vap)/(mugaz*r) 914 if (isnan( Tsoil_locslope(ig,isoil))) call abort_pem("PEM - Update Tsoil","NaN detected in Tsoil",1)908 if (isnan(tsoil_PEM(ig,isoil,islope))) call abort_pem("PEM - Update Tsoil","NaN detected in tsoil_PEM",1) 915 909 enddo 916 910 enddo 917 911 enddo 918 912 enddo 919 tsoil_PEM = sum(tsoil_phys_PEM_timeseries,4)/timelen920 913 watersoil_density_PEM_avg = sum(watersoil_density_PEM_timeseries,4)/timelen 921 914 922 915 write(*,*) "Update of soil temperature done" 923 916 924 deallocate(T I_locslope,Tsoil_locslope,Tsurf_locslope)917 deallocate(Tsoil_locslope) 925 918 926 919 ! II_d.3 Update the ice table … … 1080 1073 if (soil_pem) then 1081 1074 call interpol_TI_PEM2PCM(ngrid,nslope,nsoilmx_PEM,nsoilmx,TI_PEM,inertiesoil) 1082 tsoil = tsoil_PEM(:,1:nsoilmx,:) + tsoil_anom 1083 deallocate(tsoil_anom) 1075 tsoil = tsoil_PEM(:,1:nsoilmx,:) + tsoil_anom(:,:,:,timelen) 1084 1076 #ifndef CPP_STD 1085 1077 flux_geo = fluxgeo 1086 1078 #endif 1087 1079 endif 1080 deallocate(tsoil_anom) 1088 1081 1089 1082 ! III_a.4 Pressure (for start)
Note: See TracChangeset
for help on using the changeset viewer.