Changeset 3319
- Timestamp:
- Apr 26, 2024, 5:03:35 PM (8 months ago)
- Location:
- trunk/LMDZ.COMMON/libf/evolution
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LMDZ.COMMON/libf/evolution/conf_pem.F90
r3256 r3319 29 29 use glaciers_mod, only: h2oice_flow, co2ice_flow, inf_h2oice_threshold, metam_co2ice_threshold, metam_h2oice_threshold, metam_h2oice, metam_co2ice 30 30 use ice_table_mod, only: icetable_equilibrium, icetable_dynamic 31 use layering_mod, only: layering_algo 31 32 32 33 implicit none … … 103 104 write(*,*) 'Thermal properties of the regolith vary with pressure ?', reg_thprop_dependp 104 105 105 !#---------- Layering parameters ----------#106 106 fluxgeo = 0. 107 107 call getin('fluxgeo',fluxgeo) … … 174 174 call getin('co2ice_flow',co2ice_flow) 175 175 176 !#---------- Layering parameters ----------# 177 layering_algo = .false. 178 call getin('layering',layering_algo) 179 176 180 END SUBROUTINE conf_pem 177 181 -
trunk/LMDZ.COMMON/libf/evolution/deftank/launch_pem.sh
r3317 r3319 18 18 fi 19 19 20 # Save the current value of LC_NUMERIC and set it to a locale that uses a dot as the decimal separator 21 OLD_LC_NUMERIC=$LC_NUMERIC 22 LC_NUMERIC=en_US.UTF-8 23 24 25 ##################################################################### 20 26 # A few parameters that might need be changed depending on your setup: 21 27 # Path to the arch.env to source: 22 28 source ../trunk/LMDZ.COMMON/arch.env 23 29 24 # Save the current value of LC_NUMERIC and set it to a locale that uses a dot as the decimal separator25 OLD_LC_NUMERIC=$LC_NUMERIC26 LC_NUMERIC=en_US.UTF-827 28 29 #####################################################################30 30 #---------- Modify here the number of years to be simulated ------------ 31 31 ## set the number of years, either Martian or Earth years: -
trunk/LMDZ.COMMON/libf/evolution/deftank/run_PEM.def
r3308 r3319 52 52 # reg_thprop_dependp=.false. 53 53 54 #---------- Layering parameters ----------#55 54 # Value of the geothermal flux? Default = 0. 56 55 # fluxgeo=0. … … 93 92 # co2ice_flow=.true. 94 93 94 !#---------- Layering parameters ----------# 95 # Do you want to run with the layering algorithm? Default = .false. 96 # layering=.true. 97 95 98 # Some definitions for the physics, in file 'callphys.def' 96 99 INCLUDEDEF=callphys.def -
trunk/LMDZ.COMMON/libf/evolution/evol_ice_mod.F90
r3308 r3319 106 106 enddo 107 107 108 new_tendencies = 0. 108 109 if (abs(pos_tend) < 1.e-10 .or. abs(neg_tend) < 1.e-10) then 109 110 write(*,*) "Reason of stopping: there is no sublimating or condensing h2o ice!" … … 112 113 write(*,*) "This can be due to the absence of h2o ice in the PCM run!" 113 114 stopPEM = 2 114 new_tendencies = 0.115 115 else 116 116 ! We adapt the tendencies to conserve h2o and do only exchange between grid points -
trunk/LMDZ.COMMON/libf/evolution/layering_mod.F90
r3317 r3319 15 15 real, parameter :: eps = epsilon(1.), tol = 1.e2*eps 16 16 integer :: nb_str_max 17 logical :: layering_algo 17 18 18 19 ! Physical parameters -
trunk/LMDZ.COMMON/libf/evolution/pem.F90
r3317 r3319 70 70 use writediagpem_mod, only: writediagpem, writediagsoilpem 71 71 use co2condens_mod, only: CO2cond_ps 72 use layering_mod, only: tend_dust, ptrarray, stratum, layering, ini_layering, del_layering, make_layering, get_nb_str_max, nb_str_max 72 use layering_mod, only: tend_dust, ptrarray, stratum, layering, ini_layering, del_layering, make_layering, get_nb_str_max, nb_str_max, layering_algo 73 73 74 74 #ifndef CPP_STD … … 351 351 status = nf90_close(ncid) 352 352 353 call iniphysiq( 'startfi.nc',iim,jjm,llm,(jjm-1)*iim+2,comm_lmdz,daysec,day_ini,dtphys/nsplit_phys,rlatu,rlatv,rlonu,rlonv,aire,cu,cv,rad,g,r,cpp,iflag_phys)353 call iniphysiq(iim,jjm,llm,(jjm-1)*iim+2,comm_lmdz,daysec,day_ini,dtphys/nsplit_phys,rlatu,rlatv,rlonu,rlonv,aire,cu,cv,rad,g,r,cpp,iflag_phys) 354 354 #else 355 355 ps_start_PCM(1) = ps(1) … … 589 589 590 590 allocate(stratif(ngrid,nslope)) 591 do islope = 1,nslope 592 do i = 1,ngrid 593 call ini_layering(stratif(i,islope)) 594 enddo 595 enddo 591 if (layering_algo) then 592 do islope = 1,nslope 593 do i = 1,ngrid 594 call ini_layering(stratif(i,islope)) 595 enddo 596 enddo 597 endif 596 598 597 599 call pemetat0("startpem.nc",ngrid,nsoilmx,nsoilmx_PEM,nslope,timelen,timestep,TI_PEM,tsoil_PEM,porefillingice_depth, & … … 655 657 year_iter = 0 656 658 stopPEM = 0 657 allocate(new_str(ngrid,nslope),new_lag1(ngrid,nslope),new_lag2(ngrid,nslope),current1(ngrid,nslope),current2(ngrid,nslope)) 658 new_str = .true. 659 new_lag1 = .true. 660 new_lag2 = .true. 661 do islope = 1,nslope 662 do ig = 1,ngrid 663 current1(ig,islope)%p => stratif(ig,islope)%top 664 current2(ig,islope)%p => stratif(ig,islope)%top 665 enddo 666 enddo 659 if (layering_algo) then 660 allocate(new_str(ngrid,nslope),new_lag1(ngrid,nslope),new_lag2(ngrid,nslope),current1(ngrid,nslope),current2(ngrid,nslope)) 661 new_str = .true. 662 new_lag1 = .true. 663 new_lag2 = .true. 664 do islope = 1,nslope 665 do ig = 1,ngrid 666 current1(ig,islope)%p => stratif(ig,islope)%top 667 current2(ig,islope)%p => stratif(ig,islope)%top 668 enddo 669 enddo 670 endif 667 671 668 672 do while (year_iter < 10 .and. i_myear < n_myear) … … 748 752 call evol_h2o_ice(ngrid,nslope,cell_area,delta_h2o_adsorbded,delta_h2o_icetablesublim,h2o_ice,tend_h2o_ice,stopPEM) 749 753 call evol_co2_ice(ngrid,nslope,co2_ice,tend_co2_ice) 750 do islope = 1,nslope 751 do ig = 1,ngrid 752 call make_layering(stratif(ig,islope),tend_co2_ice(ig,islope),tend_h2o_ice(ig,islope),tend_dust,new_str(ig,islope),new_lag1(ig,islope),new_lag2(ig,islope),stopPEM,current1(ig,islope)%p,current2(ig,islope)%p) 753 enddo 754 enddo 754 if (layering_algo) then 755 do islope = 1,nslope 756 do ig = 1,ngrid 757 call make_layering(stratif(ig,islope),tend_co2_ice(ig,islope),tend_h2o_ice(ig,islope),tend_dust,new_str(ig,islope),new_lag1(ig,islope),new_lag2(ig,islope),stopPEM,current1(ig,islope)%p,current2(ig,islope)%p) 758 enddo 759 enddo 760 endif 755 761 756 762 !------------------------ … … 1122 1128 ! III_c Write the "restartpem.nc" 1123 1129 !------------------------ 1124 nb_str_max = get_nb_str_max(stratif,ngrid,nslope) ! Get the maximum number of "stratum" in the stratification (layerings)1130 if (layering_algo) nb_str_max = get_nb_str_max(stratif,ngrid,nslope) ! Get the maximum number of "stratum" in the stratification (layerings) 1125 1131 call pemdem0("restartpem.nc",longitude,latitude,cell_area,ngrid,nslope,def_slope,subslope_dist) 1126 1132 call pemdem1("restartpem.nc",i_myear,nsoilmx_PEM,ngrid,nslope,tsoil_PEM, & … … 1136 1142 write(*,*) "LL & RV & JBC: so far, so good!" 1137 1143 1138 do islope = 1,nslope 1139 do i = 1,ngrid 1140 call del_layering(stratif(i,islope)) 1141 enddo 1142 enddo 1143 deallocate(stratif,new_str,new_lag1,new_lag2,current1,current2) 1144 if (layering_algo) then 1145 do islope = 1,nslope 1146 do i = 1,ngrid 1147 call del_layering(stratif(i,islope)) 1148 enddo 1149 enddo 1150 deallocate(new_str,new_lag1,new_lag2,current1,current2) 1151 endif 1144 1152 deallocate(vmr_co2_PCM,ps_timeseries,tsurf_PCM_timeseries,q_co2_PEM_phys,q_h2o_PEM_phys) 1145 1153 deallocate(co2_ice_PCM,watersurf_density_ave,watersoil_density_timeseries,Tsurfavg_before_saved) 1146 1154 deallocate(tsoil_phys_PEM_timeseries,watersoil_density_PEM_timeseries,watersoil_density_PEM_ave) 1147 1155 deallocate(delta_co2_adsorbded,delta_h2o_adsorbded,vmr_co2_PEM_phys,delta_h2o_icetablesublim,porefillingice_thickness_prev_iter) 1148 deallocate(co2_ice_ini )1156 deallocate(co2_ice_ini,stratif) 1149 1157 !----------------------------- END OUTPUT ------------------------------ 1150 1158 -
trunk/LMDZ.COMMON/libf/evolution/pemetat0.F90
r3308 r3319 23 23 use compute_soiltemp_mod, only: ini_tsoil_pem, compute_tsoil_pem 24 24 use comslope_mod, only: def_slope_mean, subslope_dist 25 use layering_mod, only: layering, array2stratif 25 use layering_mod, only: layering, array2stratif, nb_str_max, layering_algo 26 26 27 27 #ifndef CPP_STD … … 78 78 logical :: startpem_file ! boolean to check if we read the startfile or not 79 79 real, dimension(:,:,:,:), allocatable :: stratif_array ! Array for stratification (layerings) 80 real :: nb_str_max81 80 82 81 #ifdef CPP_STD … … 118 117 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 119 118 ! Stratification (layerings) 120 found = inquire_dimension("nb_str_max") 121 if (.not. found) then 122 write(*,*) 'Pemetat0: failed loading <nb_str_max>!' 123 write(*,*) '''nb_str_max'' is set to 10!' 124 nb_str_max = 10. 125 else 126 nb_str_max = inquire_dimension_length('nb_str_max') 119 nb_str_max = 3 120 if (layering_algo) then 121 found = inquire_dimension("nb_str_max") 122 if (.not. found) then 123 write(*,*) 'Pemetat0: failed loading <nb_str_max>!' 124 write(*,*) '''nb_str_max'' is set to 3!' 125 else 126 nb_str_max = int(inquire_dimension_length('nb_str_max')) 127 endif 128 allocate(stratif_array(ngrid,nslope,nb_str_max,6)) 129 stratif_array = 0. 130 do islope = 1,nslope 131 write(num,'(i2.2)') islope 132 call get_field('stratif_slope'//num//'_thickness',stratif_array(:,islope,:,1),found) 133 call get_field('stratif_slope'//num//'_top_elevation',stratif_array(:,islope,:,2),found2) 134 found = found .or. found2 135 call get_field('stratif_slope'//num//'_co2ice_volfrac',stratif_array(:,islope,:,3),found2) 136 found = found .or. found2 137 call get_field('stratif_slope'//num//'_h2oice_volfrac',stratif_array(:,islope,:,4),found2) 138 found = found .or. found2 139 call get_field('stratif_slope'//num//'_dust_volfrac',stratif_array(:,islope,:,5),found2) 140 found = found .or. found2 141 call get_field('stratif_slope'//num//'_air_volfrac',stratif_array(:,islope,:,6),found2) 142 found = found .or. found2 143 if (.not. found) then 144 write(*,*) 'Pemetat0: failed loading at least one of the properties of <stratif_slope'//num//'>' 145 endif ! not found 146 enddo ! islope 147 call array2stratif(stratif_array,ngrid,nslope,stratif) 148 deallocate(stratif_array) 127 149 endif 128 allocate(stratif_array(ngrid,nslope,int(nb_str_max),6))129 stratif_array = 0.130 do islope = 1,nslope131 write(num,'(i2.2)') islope132 call get_field('stratif_slope'//num//'_thickness',stratif_array(:,islope,:,1),found)133 call get_field('stratif_slope'//num//'_top_elevation',stratif_array(:,islope,:,2),found2)134 found = found .or. found2135 call get_field('stratif_slope'//num//'_co2ice_volfrac',stratif_array(:,islope,:,3),found2)136 found = found .or. found2137 call get_field('stratif_slope'//num//'_h2oice_volfrac',stratif_array(:,islope,:,4),found2)138 found = found .or. found2139 call get_field('stratif_slope'//num//'_dust_volfrac',stratif_array(:,islope,:,5),found2)140 found = found .or. found2141 call get_field('stratif_slope'//num//'_air_volfrac',stratif_array(:,islope,:,6),found2)142 found = found .or. found2143 if (.not. found) then144 write(*,*) 'Pemetat0: failed loading at least one of the properties of <stratif_slope'//num//'>'145 endif ! not found146 enddo ! islope147 call array2stratif(stratif_array,ngrid,nslope,stratif)148 deallocate(stratif_array)149 150 150 151 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! … … 358 359 359 360 ! Stratification (layerings) 360 write(*,*)'So the stratification (layerings) is initialized with only the 3 sub-surface strata.'361 361 nb_str_max = 3 362 if (layering_algo) write(*,*)'So the stratification (layerings) is initialized with only the 3 sub-surface strata.' 362 363 363 364 ! h2o ice -
trunk/LMDZ.COMMON/libf/evolution/pemredem.F90
r3313 r3319 64 64 use comsoil_h_PEM, only: inertiedat_PEM, soil_pem 65 65 use time_evol_mod, only: year_bp_ini, convert_years 66 use layering_mod, only: layering, nb_str_max, stratif2array, print_layering 66 use layering_mod, only: layering, nb_str_max, stratif2array, print_layering, layering_algo 67 67 68 68 implicit none … … 96 96 call put_field('h2o_ice','h2o_ice',h2o_ice,Year) 97 97 98 allocate(stratif_array(ngrid,nslope,nb_str_max,6)) 99 call stratif2array(stratif,ngrid,nslope,stratif_array) 100 do islope = 1,nslope 101 write(num,fmt='(i2.2)') islope 102 call put_field('stratif_slope'//num//'_thickness','Layering thickness',stratif_array(:,islope,:,1),Year) 103 call put_field('stratif_slope'//num//'_top_elevation','Layering top elevation',stratif_array(:,islope,:,2),Year) 104 call put_field('stratif_slope'//num//'_co2ice_volfrac','Layering CO2 ice volume fraction',stratif_array(:,islope,:,3),Year) 105 call put_field('stratif_slope'//num//'_h2oice_volfrac','Layering H2O ice volume fraction',stratif_array(:,islope,:,4),Year) 106 call put_field('stratif_slope'//num//'_dust_volfrac','Layering dust volume fraction',stratif_array(:,islope,:,5),Year) 107 call put_field('stratif_slope'//num//'_air_volfrac','Layering air volume fraction',stratif_array(:,islope,:,6),Year) 108 enddo 109 deallocate(stratif_array) 98 if (layering_algo) then 99 allocate(stratif_array(ngrid,nslope,nb_str_max,6)) 100 call stratif2array(stratif,ngrid,nslope,stratif_array) 101 do islope = 1,nslope 102 write(num,fmt='(i2.2)') islope 103 call put_field('stratif_slope'//num//'_thickness','Layering thickness',stratif_array(:,islope,:,1),Year) 104 call put_field('stratif_slope'//num//'_top_elevation','Layering top elevation',stratif_array(:,islope,:,2),Year) 105 call put_field('stratif_slope'//num//'_co2ice_volfrac','Layering CO2 ice volume fraction',stratif_array(:,islope,:,3),Year) 106 call put_field('stratif_slope'//num//'_h2oice_volfrac','Layering H2O ice volume fraction',stratif_array(:,islope,:,4),Year) 107 call put_field('stratif_slope'//num//'_dust_volfrac','Layering dust volume fraction',stratif_array(:,islope,:,5),Year) 108 call put_field('stratif_slope'//num//'_air_volfrac','Layering air volume fraction',stratif_array(:,islope,:,6),Year) 109 enddo 110 deallocate(stratif_array) 111 endif 110 112 111 113 if (soil_pem) then
Note: See TracChangeset
for help on using the changeset viewer.