Changeset 2842
- Timestamp:
- Dec 7, 2022, 5:53:27 PM (3 years ago)
- Location:
- trunk/LMDZ.COMMON/libf/evolution
- Files:
-
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LMDZ.COMMON/libf/evolution/ComputeCO2Adsorption.F90
r2835 r2842 1 1 SUBROUTINE regolith_co2adsorption_old(ngrid,nslope,nsoil_PEM,ps,tsoil_PEM,TI_PEM,tend_h2oglaciers,tend_co2glaciers,co2ice,waterice,m_co2_completesoil,delta_mreg) 2 #ifndef CPP_STD 2 3 use comsoil_h_PEM, only: layer_PEM, mlayer_PEM,n_1km 3 4 USE comcstfi_h, only: r, cpp, mugaz, g, rcp, pi, rad … … 91 92 92 93 !======================================================================= 94 #endif 93 95 RETURN 94 96 END -
trunk/LMDZ.COMMON/libf/evolution/adsorption_mod.F90
r2835 r2842 4 4 5 5 subroutine regolith_h2oadsorption(ngrid,nslope,nsoil_PEM,timelen, ps,q_co2,q_h2o,tsoil_PEM,TI_PEM, theta_h2o_adsorbded,m_h2o_adsorbed) 6 6 #ifndef CPP_STD 7 7 use vertical_layers_mod, ONLY: ap,bp 8 8 use comsoil_h_PEM, only: n_1km 9 #endif 9 10 10 11 implicit none … … 52 53 allocate(pvapor_avg(ngrid)) 53 54 55 56 54 57 m_h2o_adsorbed(:,:,:) = 0. 55 58 theta_h2o_adsorbded(:,:,:) = 0. 56 59 A =(1/m_co2 - 1/m_noco2) 57 60 B=1/m_noco2 61 #ifndef CPP_STD 58 62 ! 1. Compute rho surface yearly averaged 59 63 … … 98 102 99 103 RETURN 104 #endif 100 105 end subroutine 101 106 102 107 SUBROUTINE regolith_co2adsorption(ngrid,nslope,nsoil_PEM,timelen,ps,tsoil_PEM,TI_PEM,tend_h2oglaciers,tend_co2glaciers,co2ice,waterice,q_co2,q_h2o,m_co2_completesoil,delta_mreg) 108 #ifndef CPP_STD 103 109 use comsoil_h_PEM, only: layer_PEM, mlayer_PEM,n_1km 104 110 USE comcstfi_h, only: r, cpp, mugaz, g, rcp, pi, rad 105 111 use comslope_mod, only : subslope_dist,def_slope_mean 106 112 use vertical_layers_mod, ONLY: ap,bp 113 #endif 107 114 108 115 IMPLICIT NONE … … 138 145 INTEGER :: ispermanent_co2glaciers(ngrid,nslope) ! Check if the glacier is permanent 139 146 INTEGER :: ispermanent_h2oglaciers(ngrid,nslope) ! Check if the glacier is permanent 147 #ifndef CPP_STD 140 148 REAL :: deltam_reg_complete(ngrid,n_1km,nslope) ! Difference in the mass per slope and soil layer (kg/m^3) 149 #endif 141 150 REAL :: deltam_reg_slope(ngrid,nslope) ! Difference in the mass per slope (kg/m^3) 142 151 REAL :: m_h2o_adsorbed(ngrid,nsoil_PEM,nslope) ! Density of CO2 adsorbed (kg/m^3) … … 154 163 allocate(pco2(ngrid,timelen)) 155 164 allocate(pco2_avg(ngrid)) 165 166 #ifndef CPP_STD 156 167 157 168 m_h2o_adsorbed(:,:,:) = 0. … … 246 257 !======================================================================= 247 258 RETURN 259 #endif 248 260 END 249 261 -
trunk/LMDZ.COMMON/libf/evolution/computeice_table.F90
r2835 r2842 1 1 SUBROUTINE computeice_table(timelen,ngrid,nslope,nsoil_GCM,nsoil_PEM,tsoil,tsurf,q_co2,q_h2o,ps,ice_table) 2 #ifndef CPP_STD 2 3 USE comsoil_h, only: inertiedat, volcapa 3 4 USE vertical_layers_mod, ONLY: ap,bp … … 141 142 RETURN 142 143 143 144 #endif 144 145 END -
trunk/LMDZ.COMMON/libf/evolution/evol_co2_ice_s_mod_slope.F90
r2835 r2842 32 32 33 33 INTEGER :: i,j,ig0,islope ! loop variable 34 ! REAL :: not_budget, budget35 REAL :: pos_tend, neg_tend, real_coefficient,negative_part36 REAL :: new_tendencies(ngrid)37 34 38 35 STOPPING=.false. 39 40 36 41 37 ! Evolution of the water ice for each physical point … … 50 46 enddo 51 47 52 53 48 END SUBROUTINE evol_co2_ice_s_slope -
trunk/LMDZ.COMMON/libf/evolution/ini_soil_mod.F90
r2835 r2842 8 8 therm_i, timestep,tsurf_ave,tsoil_ave,tsurf_inst, tsoil_inst,q_co2,q_h2o,ps,ice_table) 9 9 10 #ifndef CPP_STD 11 10 12 use vertical_layers_mod, only: ap,bp 11 13 use comsoil_h_PEM, only: fluxgeo,layer_PEM,inertiedat_PEM 12 14 use comsoil_h,only: volcapa, nsoilmx 15 #endif 13 16 14 17 implicit none … … 86 89 87 90 real,allocatable :: diff_rho(:) ! difference of vapor content 91 92 #ifndef CPP_STD 88 93 89 94 A =(1/m_co2 - 1/m_noco2) … … 227 232 countloop = 0 228 233 enddo 234 235 #endif 229 236 230 237 END SUBROUTINE ini_icetable … … 232 239 therm_i, & 233 240 timestep,tsurf,tsoil,alph,beta) 234 241 #ifndef CPP_STD 235 242 use comsoil_h_PEM, only: layer_PEM, mlayer_PEM, & 236 243 mu_PEM,fluxgeo 237 244 use comsoil_h,only: volcapa 245 #endif 238 246 implicit none 239 247 … … 275 283 real :: coefq_PEM(0:nsoil-1) 276 284 285 #ifndef CPP_STD 286 277 287 ! 0. Initialisations and preprocessing step 278 288 if (firstcall) then … … 347 357 +coefd_PEM(ik)) 348 358 enddo 349 359 #endif 350 360 end 351 361 -
trunk/LMDZ.COMMON/libf/evolution/iostart_PEM.F90
r2794 r2842 466 466 USE mod_grid_phy_lmdz, only: klon_glo 467 467 USE dimphy, only: klev, klevp1 468 #ifndef CPP_STD 468 469 USE tracer_mod, only: nqmx 470 #else 471 use tracer_h, only: nqtot 472 #endif 469 473 USE comsoil_h_PEM, only: nsoilmx_PEM 470 474 USE comslope_mod, only: nslope … … 473 477 INTEGER :: ierr 474 478 LOGICAL,SAVE :: already_created=.false. 479 480 #ifdef CPP_STD 481 INTEGER :: nqmx 482 nqmx=nqtot 483 #endif 475 484 476 485 IF (is_master) THEN -
trunk/LMDZ.COMMON/libf/evolution/orbit_param_criterion_mod.F90
r2835 r2842 8 8 9 9 USE temps_mod_evol, ONLY: year_bp_ini, year_PEM 10 #ifndef CPP_STD 10 11 USE planete_h, ONLY: e_elips, obliquit, timeperi 11 USE comcstfi_h, only: pi 12 #else 13 use planete_mod, only: e_elips, obliquit, timeperi 14 #endif 15 USE comconst_mod, ONLY: pi 12 16 USE lask_param_mod, only: yearlask,oblask,exlask,lsplask, & 13 17 ini_lask_param_mod,last_ilask -
trunk/LMDZ.COMMON/libf/evolution/pem.F90
r2835 r2842 31 31 32 32 !module needed for INITIALISATION 33 use phyetat0_mod, only: phyetat0 33 #ifndef CPP_STD 34 34 use comsoil_h, only: tsoil, nsoilmx, ini_comsoil_h,inertiedat, mlayer,volcapa 35 35 use surfdat_h, only: tsurf, co2ice, emis,& 36 &qsurf,watercap, ini_surfdat_h, &36 qsurf,watercap, ini_surfdat_h, & 37 37 albedodat, zmea, zstd, zsig, zgam, zthe, & 38 38 hmons, summit, base,albedo_h2o_frost, & 39 frost_albedo_threshold,emissiv39 frost_albedo_threshold,emissiv 40 40 use dimradmars_mod, only: totcloudfrac, albedo 41 use dust_param_mod, only: tauscaling 42 use tracer_mod, only: noms,igcm_h2o_ice ! tracer names 43 #else 44 use comsoil_h, only: nsoilmx, ini_comsoil_h,inertiedat, mlayer,volcapa 45 use surfdat_h, only: albedodat, zmea, zstd, zsig, zgam, zthe, & 46 emissiv 47 use tracer_h, only: noms,igcm_h2o_ice,igcm_co2_ice ! tracer names 48 use phys_state_var_mod 49 #endif 50 use phyetat0_mod, only: phyetat0 51 use phyredem, only: physdem0, physdem1 41 52 use turb_mod, only: q2, wstar 42 use dust_param_mod, only: tauscaling43 53 use netcdf, only: nf90_open,NF90_NOWRITE,nf90_noerr,nf90_strerror, & 44 54 nf90_get_var, nf90_inq_varid, nf90_inq_dimid, & 45 55 nf90_inquire_dimension,nf90_close 46 use phyredem, only: physdem0, physdem147 use tracer_mod, only: noms,igcm_h2o_ice ! tracer names48 56 49 57 ! For phyredem : 50 58 USE control_mod, ONLY: iphysiq, day_step,nsplit_phys 51 use time_phylmdz_mod, only: daysec 59 USE iniphysiq_mod, ONLY: iniphysiq 60 USE logic_mod, ONLY: iflag_phys 61 #ifndef CPP_STD 52 62 use mod_phys_lmdz_para, only: is_parallel, is_sequential, & 53 63 is_mpi_root, is_omp_root, & 54 64 is_master 55 use time_phylmdz_mod, only: dtphys 65 use planete_h, only: aphelie, periheli, year_day, peri_day, & 66 obliquit 67 #else 68 ! USE comcstfi_mod, ONLY: rad,g,r,cpp,pi 69 ! USE inifis_mod, ONLY: inifis 70 use planete_mod, only: apoastr, periastr, year_day, peri_day, & 71 obliquit 72 #endif 56 73 USE mod_const_mpi, ONLY: COMM_LMDZ 57 USE comconst_mod, ONLY: rad,g,r,cpp58 USE logic_mod, ONLY: iflag_phys59 USE iniphysiq_mod, ONLY: iniphysiq60 USE infotrac61 USE comcstfi_h, only: pi62 63 74 USE comslope_mod, ONLY: nslope,def_slope,def_slope_mean, & 64 75 subslope_dist,co2ice_slope, & … … 67 78 co2iceflow, beta_slope, capcal_slope,& 68 79 albedo_slope,emiss_slope,qsurf_slope,& 69 iflat 70 80 iflat,ini_comslope_h 81 use time_phylmdz_mod, only: daysec,dtphys 82 USE comconst_mod, ONLY: rad,g,r,cpp,pi 83 USE infotrac 71 84 USE geometry_mod, only: latitude_deg 72 85 … … 83 96 !!! For orbit parameters 84 97 USE temps_mod_evol, ONLY: dt_pem, evol_orbit_pem, Max_iter_pem 85 use planete_h, only: aphelie, periheli, year_day, peri_day, &86 obliquit87 98 use orbit_param_criterion_mod, only : orbit_param_criterion 88 99 use recomp_orb_param_mod, only: recomp_orb_param … … 266 277 REAL :: totmass_adsorbded 267 278 279 #ifdef CPP_STD 280 ! INTEGER :: nsplit_phys=1 281 ! LOGICAL :: iflag_phys=.true. 282 REAL :: frost_albedo_threshold=0.05 283 REAL :: albedo_h2o_frost 284 REAL,ALLOCATABLE :: co2ice(:) 285 #endif 286 268 287 !!!!!!!!!!!!!!!!!!!!!!!!!!!! 269 288 … … 274 293 REAL :: alpha = 23.3494 275 294 295 #ifndef CPP_STD 276 296 ! Parallel variables 277 297 is_sequential=.true. … … 280 300 is_omp_root=.true. 281 301 is_master=.true. 302 #endif 282 303 283 304 day_ini=0 !test … … 369 390 iflag_phys) 370 391 371 DO nnq=1,nqtot372 if(noms(nnq).eq."h2o_ice") igcm_h2o_ice = nnq373 ENDDO374 375 392 !----------------------------READ startfi.nc --------------------- 376 393 … … 381 398 allocate(inertiesoil(ngrid,nsoilmx)) 382 399 400 #ifndef CPP_STD 383 401 CALL phyetat0 (FILE_NAME,0,0, & 384 402 nsoilmx,ngrid,nlayer,nq, & … … 405 423 enddo 406 424 enddo 425 426 #else 427 call phys_state_var_init(nq) 428 IF (.NOT.ALLOCATED(noms)) ALLOCATE(noms(nq)) ! (because noms is an argument of physdem1 whether or not tracer is on) 429 call initracer(ngrid,nq) 430 call iniaerosol() 431 call phyetat0(.true., & 432 ngrid,nlayer,FILE_NAME,0,0,nsoilmx,nq, & 433 day_ini,time_phys,tsurf,tsoil,emis,q2,qsurf, & 434 cloudfrac,totcloudfrac,hice, & 435 rnat,pctsrf_sic,tslab, tsea_ice,sea_ice) 436 call surfini(ngrid,nq,qsurf,albedo,albedo_bareground,albedo_snow_SPECTV,albedo_co2_ice_SPECTV) 437 438 call ini_comslope_h(ngrid,nsoilmx,nq) 439 440 allocate(co2ice(ngrid)) 441 co2ice(:)=qsurf(:,igcm_co2_ice) 442 co2ice_slope(:,1)=co2ice(:) 443 tsurf_slope(:,1)=tsurf(:) 444 445 if (nslope.eq.1) then 446 def_slope(1) = 0 447 def_slope(2) = 0 448 def_slope_mean=0 449 subslope_dist(:,1) = 1. 450 endif 451 452 ! Remove unphysical values of surface tracer 453 DO i=1,ngrid 454 DO nnq=1,nqtot 455 qsurf_slope(i,nnq,1)=qsurf(i,nnq) 456 if(qsurf(i,nnq).LT.0) then 457 qsurf(i,nnq)=0. 458 endif 459 enddo 460 enddo 461 #endif 462 463 DO nnq=1,nqtot 464 if(noms(nnq).eq."h2o_ice") igcm_h2o_ice = nnq 465 ENDDO 407 466 408 467 !------------------------ … … 440 499 co2_hmax(5) = co2_hmax(3) 441 500 co2_hmax(4) = 1000000. 442 endif 501 elseif(nslope.eq.1) then 502 co2_hmax(1) = 1000000. 503 else 504 print *, "Nslope must be=to 1 or 7 for now!!" 505 endif 443 506 444 507 allocate(flag_co2flow(ngrid,nslope)) … … 447 510 flag_co2flow(:,:) = 0. 448 511 flag_co2flow_mesh(:) = 0. 512 449 513 450 514 !---------------------------- READ GCM data --------------------- … … 729 793 tendencies_h2o_ice_phys_slope,tendencies_co2_ice_phys_slope,co2ice_slope,qsurf_slope(:,igcm_h2o_ice,:), co2_adsorbded_phys,delta_co2_adsorbded) 730 794 731 732 795 if(soil_pem) then 733 796 totmass_adsorbded = 0. … … 761 824 ! I_h Read the PEMstar 762 825 ! I_i Compute orbit criterion 763 826 #ifndef CPP_STD 764 827 CALL iniorbit(aphelie,periheli,year_day,peri_day,obliquit) 828 #else 829 CALL iniorbit(apoastr, periastr, year_day, peri_day,obliquit) 830 #endif 765 831 766 832 if(evol_orbit_pem) then … … 1130 1196 cos(pi*def_slope_mean(islope)/180.) 1131 1197 ENDDO 1198 #ifdef CPP_STD 1199 qsurf(ig,igcm_co2_ice)=co2ice(ig) 1200 #endif 1132 1201 ENDDO ! of DO ig=1,ngrid 1133 1202 ! H2o ice … … 1158 1227 ENDDO ! of DO ig=1,ngrid 1159 1228 1229 #ifndef CPP_STD 1160 1230 DO ig = 1,ngrid 1161 1231 DO iloop = 1,nsoilmx … … 1190 1260 ENDDO 1191 1261 ENDDO 1262 #endif 1192 1263 1193 1264 ! III_a.4 Pressure (for start) … … 1274 1345 1275 1346 ! III_b.2 WRITE restartfi.nc 1276 1347 #ifndef CPP_STD 1277 1348 call physdem0("restartfi_evol.nc",longitude,latitude, & 1278 1349 nsoilmx,ngrid,nlayer,nq, & … … 1289 1360 tsurf_slope,tsoil_slope, albedo_slope, & 1290 1361 emiss_slope,qsurf_slope,watercap_slope, TI_GCM_phys) 1362 #else 1363 call physdem0("restartfi_evol.nc",longitude,latitude,nsoilmx,ngrid,nlayer,nq, & 1364 ptimestep,pday,time_phys,cell_area, & 1365 albedo_bareground,inertiedat,zmea,zstd,zsig,zgam,zthe) 1366 1367 call physdem1("restartfi_evol.nc",nsoilmx,ngrid,nlayer,nq, & 1368 ptimestep,ztime_fin, & 1369 tsurf,tsoil,emis,q2,qsurf, & 1370 cloudfrac,totcloudfrac,hice, & 1371 rnat,pctsrf_sic,tslab,tsea_ice,sea_ice) 1372 #endif 1291 1373 1292 1374 print *, "restartfi_evol.nc has been written" -
trunk/LMDZ.COMMON/libf/evolution/pemredem.F90
r2835 r2842 12 12 put_var, put_field, length 13 13 use mod_grid_phy_lmdz, only : klon_glo 14 #ifndef CPP_STD 14 15 use planete_h, only: aphelie, emin_turb, lmixmin, obliquit, & 15 16 peri_day, periheli, year_day 16 17 use comcstfi_h, only: g, mugaz, omeg, rad, rcp 18 #else 19 use planete_mod, only: apoastr, emin_turb, lmixmin, obliquit, & 20 peri_day, periastr, year_day 21 USE comconst_mod, ONLY: g, omeg, rad 22 use comcstfi_mod, only: mugaz, rcp 23 #endif 17 24 use time_phylmdz_mod, only: daysec 18 25 implicit none … … 68 75 implicit none 69 76 77 #ifndef CPP_STD 70 78 include "callkeys.h" 79 #endif 71 80 72 81 character(len=*),intent(in) :: filename -
trunk/LMDZ.COMMON/libf/evolution/read_data_GCM.F90
r2835 r2842 118 118 print *, "Downloading data for co2ice_slope ..." 119 119 120 if(nslope.gt.1) then 121 120 122 DO islope=1,nslope 121 123 write(num,fmt='(i2.2)') islope … … 160 162 print *, "Downloading data for inertiesoil_slope done" 161 163 162 endif 164 endif !soil_pem 165 166 else !nslope=1 no slope, we copy all the values 167 co2_ice_slope(:,:,1,:)=co2_ice_s(:,:,:) 168 h2o_ice_s_slope(:,:,1,:)=h2o_ice_s(:,:,:) 169 call get_var3("tsurf",tsurf_gcm(:,:,1,:)) 170 if(soil_pem) then 171 call get_var4("tsoil",tsoil_gcm(:,:,:,1,:)) 172 call get_var4("inertiesoil",TI_gcm(:,:,:,1,:)) 173 endif !soil_pem 174 endif !nslope=1 163 175 164 176 ! Compute the minimum over the year for each point -
trunk/LMDZ.COMMON/libf/evolution/recomp_orb_param_mod.F90
r2835 r2842 8 8 9 9 USE temps_mod_evol, ONLY: year_bp_ini, year_PEM 10 #ifndef CPP_STD 10 11 USE planete_h, ONLY: e_elips, obliquit, timeperi 11 USE comcstfi_h, only: pi 12 #else 13 use planete_mod, only: e_elips, obliquit, timeperi 14 #endif 15 USE comcstfi_mod, only: pi 12 16 USE lask_param_mod, only: yearlask,oblask,exlask,lsplask, & 13 17 end_lask_param_mod,last_ilask -
trunk/LMDZ.COMMON/libf/evolution/update_soil.F90
r2835 r2842 1 1 SUBROUTINE update_soil(ngrid,nslope,nsoil_PEM,tend_h2oglaciers,tend_co2glaciers,co2ice,waterice,p_avg_new,& 2 2 ice_depth,TI_PEM) 3 3 #ifndef CPP_STD 4 4 USE comsoil_h, only: inertiedat, volcapa 5 5 USE comsoil_h_PEM, only: layer_PEM,n_1km,inertiedat_PEM … … 138 138 !======================================================================= 139 139 RETURN 140 #endif 140 141 END
Note: See TracChangeset
for help on using the changeset viewer.