Changeset 3070
- Timestamp:
- Oct 5, 2023, 11:29:45 AM (14 months ago)
- Location:
- trunk/LMDZ.COMMON/libf/evolution
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LMDZ.COMMON/libf/evolution/changelog.txt
r3068 r3070 86 86 == 03/10/2023 == JBC 87 87 Following the commits r3066 and r3067, the PEM initialization in 1D has been adapted. 88 89 == 05/10/2023 == JBC 90 Correction of a bug: the variable 'g' was not correctly initialized in 1D. A little of code cleaning. -
trunk/LMDZ.COMMON/libf/evolution/compute_tendencies_slope.F90
r3039 r3070 1 ! 2 ! $Id $ 3 ! 4 SUBROUTINE compute_tendencies_slope(ngrid,nslope,min_ice_Y1,& 5 min_ice_Y2,tendencies_ice) 1 SUBROUTINE compute_tendencies_slope(ngrid,nslope,min_ice_Y1,min_ice_Y2,tendencies_ice) 6 2 7 IMPLICIT NONE 3 implicit none 8 4 9 5 !======================================================================= … … 15 11 ! arguments: 16 12 ! ---------- 17 18 13 ! INPUT 19 20 INTEGER, intent(in) :: ngrid, nslope ! # of grid points along longitude/latitude/ total 21 REAL, intent(in) , dimension(ngrid,nslope):: min_ice_Y1 ! LON x LAT field : minimum of water ice at each point for the first year 22 REAL, intent(in) , dimension(ngrid,nslope):: min_ice_Y2 ! LON x LAT field : minimum of water ice at each point for the second year 14 integer, intent(in) :: ngrid, nslope ! # of grid points along longitude/latitude/ total 15 real, dimension(ngrid,nslope), intent(in) :: min_ice_Y1 ! LON x LAT field : minimum of water ice at each point for the first year 16 real, dimension(ngrid,nslope), intent(in) :: min_ice_Y2 ! LON x LAT field : minimum of water ice at each point for the second year 23 17 24 18 ! OUTPUT 25 REAL, intent(out) , dimension(ngrid,nslope) :: tendencies_ice ! physical point field : difference between the minima = evolution of perenial ice 26 27 ! local: 28 ! ------ 29 INTEGER :: ig,islope ! loop variable 19 real, dimension(ngrid,nslope), intent(out) :: tendencies_ice ! physical point field : difference between the minima = evolution of perenial ice 30 20 31 21 !======================================================================= 32 22 33 23 ! We compute the difference 34 35 DO ig=1,ngrid 36 DO islope = 1, nslope 37 tendencies_ice(ig,islope)=min_ice_Y2(ig,islope)-min_ice_Y1(ig,islope) 38 enddo 39 ENDDO 24 tendencies_ice = min_ice_Y2 - min_ice_Y1 40 25 41 26 ! If the difference is too small; there is no evolution 42 DO ig=1,ngrid 43 DO islope = 1, nslope 44 if(abs(tendencies_ice(ig,islope)).LT.1.0E-10) then 45 tendencies_ice(ig,islope)=0. 46 endif 47 enddo 48 ENDDO 27 where (abs(tendencies_ice) < 1.e-10) tendencies_ice = 0. 49 28 50 29 END SUBROUTINE compute_tendencies_slope -
trunk/LMDZ.COMMON/libf/evolution/pem.F90
r3069 r3070 34 34 use logic_mod, only: iflag_phys 35 35 use mod_const_mpi, only: COMM_LMDZ 36 use comconst_mod, only: rad, g, cpp, pi37 36 use infotrac 38 37 use geometry_mod, only: latitude_deg … … 73 72 use mod_phys_lmdz_para, only: is_parallel, is_sequential, is_mpi_root, is_omp_root, is_master 74 73 use planete_h, only: aphelie, periheli, year_day, peri_day, obliquit 75 use comcstfi_h, only: r, mugaz 74 use comcstfi_h, only: r, mugaz, g 76 75 use paleoclimate_mod, only: albedo_perenialco2 77 76 #else … … 88 87 use iniphysiq_mod, only: iniphysiq 89 88 use control_mod, only: iphysiq, day_step, nsplit_phys 89 use comconst_mod, only: rad, g, cpp, pi 90 90 #else 91 91 use time_phylmdz_mod, only: iphysiq, day_step 92 use comcstfi_h, only: pi, rad, g, cpp 92 93 #endif 93 94 … … 339 340 ! In the gcm, these values are given to the physic by the dynamic. 340 341 ! Here we simply read them in the startfi_evol.nc file 341 status = nf90_open(FILE_NAME, NF90_NOWRITE, ncid)342 status = nf90_open(FILE_NAME, NF90_NOWRITE, ncid) 342 343 343 344 status = nf90_inq_varid(ncid,"longitude",lonvarid) … … 362 363 watercap,perenial_co2ice,def_slope,def_slope_mean,subslope_dist) 363 364 364 ! Remove unphysical values of surface tracer 365 do i = 1,ngrid 366 do nnq = 1,nqtot 367 do islope = 1,nslope 368 if (qsurf(i,nnq,islope) < 0) qsurf(i,nnq,islope) = 0. 369 enddo 370 enddo 371 enddo 365 ! Remove unphysical values of surface tracer 366 where (qsurf < 0.) qsurf = 0. 372 367 373 368 call surfini(ngrid,qsurf) … … 416 411 endif 417 412 418 ! Remove unphysical values of surface tracer 419 do i = 1,ngrid 420 do nnq = 1,nqtot 421 qsurf(i,nnq,1) = qsurf_read_generic(i,nnq) 422 if (qsurf(i,nnq,1) < 0) qsurf(i,nnq,1) = 0. 423 enddo 424 enddo 413 ! Remove unphysical values of surface tracer 414 qsurf(:,:,1) = qsurf_read_generic(:,:) 415 where (qsurf < 0.) qsurf = 0. 425 416 #endif 426 417 … … 517 508 if (soil_pem) then 518 509 call soil_settings_PEM(ngrid,nslope,nsoilmx_PEM,nsoilmx,inertiesoil,TI_PEM) 519 do l =1,nsoilmx520 tsoil_PEM(:,l,:) =tsoil_ave(:,l,:)521 tsoil_phys_PEM_timeseries(:,l,:,:) =tsoil_GCM_timeseries(:,l,:,:)522 watersoil_density_PEM_timeseries(:,l,:,:) =watersoil_density_timeseries(:,l,:,:)523 enddo 524 do l =nsoilmx+1,nsoilmx_PEM525 tsoil_PEM(:,l,:) =tsoil_ave(:,nsoilmx,:)526 watersoil_density_PEM_timeseries(:,l,:,:) =watersoil_density_timeseries(:,nsoilmx,:,:)527 enddo 528 watersoil_density_PEM_ave(:,:,:) = SUM(watersoil_density_PEM_timeseries(:,:,:,:),4)/timelen510 do l = 1,nsoilmx 511 tsoil_PEM(:,l,:) = tsoil_ave(:,l,:) 512 tsoil_phys_PEM_timeseries(:,l,:,:) = tsoil_GCM_timeseries(:,l,:,:) 513 watersoil_density_PEM_timeseries(:,l,:,:) = watersoil_density_timeseries(:,l,:,:) 514 enddo 515 do l = nsoilmx + 1,nsoilmx_PEM 516 tsoil_PEM(:,l,:) = tsoil_ave(:,nsoilmx,:) 517 watersoil_density_PEM_timeseries(:,l,:,:) = watersoil_density_timeseries(:,nsoilmx,:,:) 518 enddo 519 watersoil_density_PEM_ave(:,:,:) = sum(watersoil_density_PEM_timeseries(:,:,:,:),4)/timelen 529 520 endif !soil_pem 530 521 deallocate(tsoil_ave,tsoil_GCM_timeseries) … … 559 550 Total_surface = 0. 560 551 do i = 1,ngrid 561 Total_surface = Total_surface +cell_area(i)552 Total_surface = Total_surface + cell_area(i) 562 553 do islope = 1,nslope 563 554 if (tendencies_co2_ice(i,islope) < 0) then 564 555 initial_co2_ice_sublim(i,islope) = 1. 565 ini_surf_co2 = ini_surf_co2 +cell_area(i)*subslope_dist(i,islope)556 ini_surf_co2 = ini_surf_co2 + cell_area(i)*subslope_dist(i,islope) 566 557 else 567 558 initial_co2_ice_sublim(i,islope) = 0. … … 586 577 allocate(zplev_gcm(ngrid,nlayer + 1)) 587 578 588 do l = 1,nlayer + 1 589 do ig = 1,ngrid 590 zplev_gcm(ig,l) = ap(l) + bp(l)*ps_start_GCM(ig) 591 enddo 579 do ig = 1,ngrid 580 zplev_gcm(ig,:) = ap(:) + bp(:)*ps_start_GCM(ig) 592 581 enddo 593 582 … … 623 612 totmassh2o_adsorbded = 0. 624 613 do ig = 1,ngrid 625 do islope = 1, 614 do islope = 1,nslope 626 615 do l = 1,nsoilmx_PEM - 1 627 616 totmassco2_adsorbded = totmassco2_adsorbded + co2_adsorbded_phys(ig,l,islope)*(layer_PEM(l+1) - layer_PEM(l))* & … … 665 654 ! II.a.1. Compute updated global pressure 666 655 write(*,*) "Recomputing the new pressure..." 667 668 656 do i = 1,ngrid 669 657 do islope = 1,nslope … … 682 670 683 671 ! II.a.2. Old pressure levels for the timeseries, this value is deleted when unused and recreated each time (big memory consuption) 684 allocate(zplev_old_timeseries(ngrid,nlayer +1,timelen))672 allocate(zplev_old_timeseries(ngrid,nlayer + 1,timelen)) 685 673 write(*,*) "Recomputing the old pressure levels timeserie adapted to the old pressure..." 686 674 do l = 1,nlayer + 1 … … 721 709 do t = 1,timelen 722 710 q_co2_PEM_phys(ig,t) = q_co2_PEM_phys(ig,t)*(zplev_old_timeseries(ig,l,t) - zplev_old_timeseries(ig,l + 1,t))/ & 723 (zplev_new_timeseries(ig,l,t) - zplev_new_timeseries(ig,l + 1,t)) &724 + ((zplev_new_timeseries(ig,l,t) - zplev_new_timeseries(ig,l + 1,t)) &711 (zplev_new_timeseries(ig,l,t) - zplev_new_timeseries(ig,l + 1,t)) & 712 + ((zplev_new_timeseries(ig,l,t) - zplev_new_timeseries(ig,l + 1,t)) & 725 713 - (zplev_old_timeseries(ig,l,t) - zplev_old_timeseries(ig,l + 1,t)))/ & 726 714 (zplev_new_timeseries(ig,l,t) - zplev_new_timeseries(ig,l + 1,t)) … … 881 869 enddo 882 870 enddo 883 tsoil_PEM(:,:,:) = SUM(tsoil_phys_PEM_timeseries(:,:,:,:),4)/timelen884 watersoil_density_PEM_ave(:,:,:) = SUM(watersoil_density_PEM_timeseries(:,:,:,:),4)/timelen871 tsoil_PEM(:,:,:) = sum(tsoil_phys_PEM_timeseries(:,:,:,:),4)/timelen 872 watersoil_density_PEM_ave(:,:,:) = sum(watersoil_density_PEM_timeseries(:,:,:,:),4)/timelen 885 873 886 874 write(*,*) "Update of soil temperature done" … … 893 881 call computeice_table_equilibrium(ngrid,nslope,nsoilmx_PEM,watercaptag,watersurf_density_ave,watersoil_density_PEM_ave,TI_PEM(:,1,:),porefillingice_depth,porefillingice_thickness) 894 882 895 call compute_massh2o_exchange_ssi(ngrid,nslope,nsoilmx_PEM,porefillingice_thickness_prev_iter,porefillingice_thickness,porefillingice_depth,tsoil_PEM, & 896 delta_h2o_icetablesublim) ! Mass of H2O exchange between the ssi and the atmosphere 883 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 897 884 898 885 write(*,*) "Update soil propreties" 899 886 900 887 ! II_d.4 Update the soil thermal properties 901 call update_soil_thermalproperties(ngrid,nslope,nsoilmx_PEM,tendencies_h2o_ice,qsurf(:,igcm_h2o_ice,:),global_ave_press_new, & 902 porefillingice_depth,porefillingice_thickness,TI_PEM) 888 call update_soil_thermalproperties(ngrid,nslope,nsoilmx_PEM,tendencies_h2o_ice,qsurf(:,igcm_h2o_ice,:),global_ave_press_new,porefillingice_depth,porefillingice_thickness,TI_PEM) 903 889 904 890 ! II_d.5 Update the mass of the regolith adsorbded … … 914 900 do l = 1,nsoilmx_PEM - 1 915 901 totmassco2_adsorbded = totmassco2_adsorbded + co2_adsorbded_phys(ig,l,islope)*(layer_PEM(l+1) - layer_PEM(l))* & 916 subslope_dist(ig,islope)/cos(pi*def_slope_mean(islope)/180.) * & 917 cell_area(ig) 902 subslope_dist(ig,islope)/cos(pi*def_slope_mean(islope)/180.)*cell_area(ig) 918 903 totmassh2o_adsorbded = totmassh2o_adsorbded + h2o_adsorbded_phys(ig,l,islope)*(layer_PEM(l+1) - layer_PEM(l))* & 919 subslope_dist(ig,islope)/cos(pi*def_slope_mean(islope)/180.) * & 920 cell_area(ig) 904 subslope_dist(ig,islope)/cos(pi*def_slope_mean(islope)/180.)*cell_area(ig) 921 905 enddo 922 906 enddo … … 1077 1061 do ig = 1,ngrid 1078 1062 q(ig,l,nnq) = q(ig,l,nnq)*(zplev_gcm(ig,l) - zplev_gcm(ig,l + 1))/(zplev_new(ig,l) - zplev_new(ig,l + 1)) & 1079 + ((zplev_new(ig,l) - zplev_new(ig,l + 1)) - (zplev_gcm(ig,l) - zplev_gcm(ig,l + 1)))/ & 1080 (zplev_new(ig,l) - zplev_new(ig,l + 1)) 1063 + ((zplev_new(ig,l) - zplev_new(ig,l + 1)) - (zplev_gcm(ig,l) - zplev_gcm(ig,l + 1)))/(zplev_new(ig,l) - zplev_new(ig,l + 1)) 1081 1064 enddo 1082 1065 q(:,llm,nnq) = q(:,llm - 1,nnq)
Note: See TracChangeset
for help on using the changeset viewer.