Changeset 3603
- Timestamp:
- Jan 28, 2025, 5:16:15 PM (37 hours ago)
- Location:
- trunk/LMDZ.COMMON/libf/evolution
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LMDZ.COMMON/libf/evolution/changelog.txt
r3602 r3603 562 562 - In case of very low surface shifting, checking if the index is inside the bounds of 'tsoil' and 'mlayer' and replace them by the value at surface if necessary. 563 563 - Few cleanings. 564 565 == 28/01/2025 == JBC 566 - Bug correction about the pressure/teta reconstruction for the PCM (mismatch between the physical and dynamical grid). 567 - Improvement of messages giving info about the PEM workflow in the terminal. -
trunk/LMDZ.COMMON/libf/evolution/evol_ice_mod.F90
r3571 r3603 34 34 !======================================================================= 35 35 ! Evolution of CO2 ice for each physical point 36 write(*,*) ' Evolution of co2 ice'36 write(*,*) '> Evolution of CO2 ice' 37 37 38 38 co2_ice_old = co2_ice … … 88 88 real, dimension(ngrid,nslope) :: new_tend ! Tendencies computed in order to conserve h2o ice on the surface, only exchange between surface are done 89 89 !======================================================================= 90 write(*,*) '> Evolution of H2O ice' 90 91 if (ngrid /= 1) then ! Not in 1D 91 92 ! We compute the amount of condensing and sublimating h2o ice -
trunk/LMDZ.COMMON/libf/evolution/glaciers_mod.F90
r3591 r3603 53 53 real, dimension(ngrid,nslope) :: hmax ! Grid points x Slope field: maximum thickness for co2 glacier before flow 54 54 55 write(*,*) " Flow of CO2 glaciers"55 write(*,*) "> Flow of CO2 glaciers" 56 56 call computeTcondCO2(timelen,ngrid,nslope,vmr_co2_PEM,ps_PCM,ps_avg_global_ini,ps_avg_global,Tcond) 57 57 call compute_hmaxglaciers(ngrid,nslope,iflat,def_slope_mean,Tcond,"co2",hmax) … … 93 93 real, dimension(ngrid,nslope) :: hmax ! Grid points x Slope field: maximum thickness for co2 glacier before flow 94 94 95 write(*,*) " Flow of H2O glaciers"95 write(*,*) "> Flow of H2O glaciers" 96 96 call compute_hmaxglaciers(ngrid,nslope,iflat,def_slope_mean,Tice,"h2o",hmax) 97 97 call transfer_ice_duringflow(ngrid,nslope,iflat,subslope_dist,def_slope_mean,hmax,Tice,h2oice,flag_h2oflow) -
trunk/LMDZ.COMMON/libf/evolution/pem.F90
r3602 r3603 139 139 real, dimension(ip1jmp1,llm) :: teta ! Potential temperature 140 140 real, dimension(:,:,:), allocatable :: q ! champs advectes 141 real, dimension( ip1jmp1) :: ps_start_dyn ! surface pressure in the start file (dynamic grid)141 real, dimension(:), allocatable :: pdyn ! pressure for the dynamic grid 142 142 real, dimension(:), allocatable :: ps_start ! surface pressure in the start file 143 143 real, dimension(:), allocatable :: ps_start0 ! surface pressure in the start file at the beginning … … 286 286 integer :: i, l, ig, nnq, t, islope, ig_loop, islope_loop, isoil, icap 287 287 logical :: num_str 288 289 write(*,*) ' * . . + . * .. + . . . ' 290 write(*,*) ' + _______ ________ ____ ____ * + ' 291 write(*,*) ' + . * |_ __ \|_ __ ||_ \ / _| . *' 292 write(*,*) ' . . | |__) | | |_ \_| | \/ | * * . ' 293 write(*,*) ' . | ___/ | _| _ | |\ /| | . . ' 294 write(*,*) '. * * _| |_ _| |__/ | _| |_\/_| |_ * ' 295 write(*,*) ' |_____| |________||_____||_____| + . ' 296 write(*,*) ' . * . * .. + * . + .' 288 297 289 298 ! Elapsed time with system clock … … 371 380 ! I_a Read the "run.def" 372 381 !------------------------ 382 write(*,*) '> Reading "run.def" (PEM)' 373 383 #ifndef CPP_1D 374 384 dtphys = daysec/48. ! Dummy value (overwritten in phyetat0) … … 379 389 allocate(longitude(ngrid),latitude(ngrid),cell_area(ngrid)) 380 390 #else 381 allocate(q(1,llm,nqtot) )391 allocate(q(1,llm,nqtot),pdyn(1)) 382 392 allocate(longitude(1),latitude(1),cell_area(1)) 383 393 … … 395 405 endif 396 406 397 call init_testphys1d('start1D.txt','startfi.nc',therestart1D,therestartfi,ngrid,nlayer,610.,nq,q, & 398 time_0,ps_start_dyn(1),ucov,vcov,teta,ndt,ptif,pks,dtphys,zqsat,dq,dqdyn,day0,day,gru,grv,w, & 407 write(*,*) '> Reading "start1D.txt" and "startfi.nc"' 408 call init_testphys1d('start1D.txt','startfi.nc',therestart1D,therestartfi,ngrid,nlayer,610.,nq,q, & 409 time_0,pdyn,ucov,vcov,teta,ndt,ptif,pks,dtphys,zqsat,dq,dqdyn,day0,day,gru,grv,w, & 399 410 play,plev,latitude,longitude,cell_area,atm_wat_profile,atm_wat_tau) 400 ps_start_dyn(2) = ps_start_dyn(1)401 411 nsplit_phys = 1 402 412 day_step = steps_per_sol … … 410 420 !------------------------ 411 421 ! I_b.1 Read "start.nc" 422 write(*,*) '> Reading "start.nc"' 412 423 allocate(ps_start0(ngrid)) 413 424 #ifndef CPP_1D 414 call dynetat0(start_name,vcov,ucov,teta,q,masse,ps_start_dyn,phis,time_0) 415 416 call gr_dyn_fi(1,iip1,jjp1,ngridmx,ps_start_dyn,ps_start0) 425 allocate(pdyn(ip1jmp1)) 426 call dynetat0(start_name,vcov,ucov,teta,q,masse,pdyn,phis,time_0) 427 428 call gr_dyn_fi(1,iip1,jjp1,ngridmx,pdyn,ps_start0) 417 429 418 430 call iniconst ! Initialization of dynamical constants (comconst_mod) … … 431 443 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) 432 444 #else 433 ps_start0 (1) = ps_start_dyn(1)445 ps_start0 = pdyn 434 446 #endif 447 deallocate(pdyn) 435 448 436 449 ! In the PCM, these values are given to the physic by the dynamic. … … 450 463 ! First we read the initial state (starfi.nc) 451 464 #ifndef CPP_STD 465 write(*,*) '> Reading "startfi.nc"' 452 466 call phyetat0(startfi_name,0,0,nsoilmx,ngrid,nlayer,nq,nqsoil,day_ini,time_phys,tsurf, & 453 467 tsoil,albedo,emis,q2,qsurf,qsoil,tauscaling,totcloudfrac,wstar, & … … 510 524 #endif 511 525 512 do nnq = 1,nqtot ! Why not using ini_tracer 526 do nnq = 1,nqtot ! Why not using ini_tracer? 513 527 if (noms(nnq) == "h2o_ice") igcm_h2o_ice = nnq 514 528 if (noms(nnq) == "h2o_vap") then … … 529 543 enddo 530 544 write(*,*) 'Flat slope for islope = ',iflat 531 write(*,*) ' corresponding criterium = ',def_slope_mean(iflat)545 write(*,*) 'Corresponding criterium = ',def_slope_mean(iflat) 532 546 533 547 !------------------------ … … 597 611 ps_avg_global_ini = sum(cell_area*ps_avg)/total_surface 598 612 ps_avg_global_new = ps_avg_global_ini 599 write(*,*) "Total surface of the planet =", total_surface613 write(*,*) "Total surface of the planet =", total_surface 600 614 write(*,*) "Initial global averaged pressure =", ps_avg_global_ini 601 615 … … 604 618 ! I_h Read the "startpem.nc" 605 619 !------------------------ 620 write(*,*) '> Reading "startpem.nc"' 606 621 allocate(co2_ice(ngrid,nslope),h2o_ice(ngrid,nslope),stratif(ngrid,nslope)) 607 622 allocate(delta_h2o_adsorbed(ngrid),delta_co2_adsorbed(ngrid),delta_h2o_icetablesublim(ngrid)) … … 642 657 enddo 643 658 enddo 644 write(*,*) "Total initial surface of co2 ice sublimating (slope) =", co2ice_sublim_surf_ini 645 write(*,*) "Total initial surface of h2o ice sublimating (slope) =", h2oice_ini_surf 646 659 write(*,*) "Total initial surface of CO2 ice sublimating =", co2ice_sublim_surf_ini 660 write(*,*) "Total initial surface of H2O ice sublimating =", h2oice_ini_surf 647 661 648 662 if (adsorption_pem) then … … 707 721 do while (i_myear_leg < n_myear_leg .and. i_myear < n_myear) 708 722 ! II.a.1. Compute updated global pressure 709 write(*,*) " Recomputing the new pressure..."723 write(*,*) "> Updating the surface pressure" 710 724 ps_avg_global_old = ps_avg_global_new 711 725 do i = 1,ngrid … … 720 734 enddo 721 735 endif 722 write(*,*) 'Global average pressure old time step ',ps_avg_global_old723 write(*,*) 'Global average pressure new time step ',ps_avg_global_new736 write(*,*) 'Global average pressure old time step:',ps_avg_global_old 737 write(*,*) 'Global average pressure new time step:',ps_avg_global_new 724 738 725 739 ! II.a.2. Pressure timeseries (the values are deleted when unused because of big memory consumption) 740 write(*,*) "> Updating the surface pressure timeseries for the new pressure" 726 741 allocate(zplev_timeseries_old(ngrid,nlayer + 1,timelen)) 727 write(*,*) "Recomputing the pressure levels timeseries adapted to the old pressure..."728 742 do l = 1,nlayer + 1 729 743 do ig = 1,ngrid … … 731 745 enddo 732 746 enddo 733 write(*,*) "Recomputing the surface pressure timeseries adapted to the new pressure..."734 747 do ig = 1,ngrid 735 748 ps_timeseries(ig,:) = ps_timeseries(ig,:)*ps_avg_global_new/ps_avg_global_old 736 749 enddo 737 write(*,*) " Recomputing the pressure levels timeseries adapted to the new pressure..."750 write(*,*) "> Updating the pressure levels timeseries for the new pressure" 738 751 allocate(zplev_timeseries_new(ngrid,nlayer + 1,timelen)) 739 752 do l = 1,nlayer + 1 … … 744 757 745 758 ! II.a.3. Tracers timeseries 746 write(*,*) " Recomputing of tracer VMR timeseries for the new pressure..."759 write(*,*) "> Updating the tracer VMR timeseries for the new pressure" 747 760 allocate(vmr_co2_PEM_phys(ngrid,timelen)) 748 761 l = 1 … … 805 818 !------------------------ 806 819 ! II_d.1 Update Tsurf 807 write(*,*) " Updating the new Tsurf"820 write(*,*) "> Updating surface temperature" 808 821 do ig = 1,ngrid 809 822 do islope = 1,nslope … … 811 824 if (is_co2ice_ini(ig,islope) .and. co2_ice(ig,islope) < 1.e-10 .and. .not. co2ice_disappeared(ig,islope)) then 812 825 co2ice_disappeared(ig,islope) = .true. 813 if (latitude_deg(ig) > 0 ) then826 if (latitude_deg(ig) > 0.) then 814 827 outer1: do ig_loop = ig,ngrid 815 828 do islope_loop = islope,iflat,-1 … … 838 851 if (soil_pem) then 839 852 ! II_d.2 Shifting soil temperature to surface 853 write(*,*) "> Shifting soil temperature profile to match surface evolution" 840 854 call shift_tsoil2surf(ngrid,nsoilmx_PEM,nslope,zshift_surf,zlag,tsurf_avg,tsoil_PEM) 841 855 deallocate(zshift_surf,zlag) 842 856 843 857 ! II_d.3 Update soil temperature 844 write(*,*)" Updating soil temperature"858 write(*,*)"> Updating soil temperature profile" 845 859 allocate(tsoil_avg_old(ngrid,nsoilmx_PEM)) 846 860 do islope = 1,nslope … … 863 877 watersoil_density_PEM_avg = sum(watersoil_density_PEM_timeseries,4)/timelen 864 878 deallocate(tsoil_avg_old) 865 write(*,*) "Update of soil temperature done"866 879 867 880 ! II_d.4 Update the ice table 868 881 allocate(icetable_thickness_old(ngrid,nslope),ice_porefilling_old(ngrid,nsoilmx_PEM,nslope)) 869 882 if (icetable_equilibrium) then 870 write(*,*) " Computeice table (equilibrium method)"883 write(*,*) "> Updating ice table (equilibrium method)" 871 884 icetable_thickness_old = icetable_thickness 872 885 call computeice_table_equilibrium(ngrid,nslope,nsoilmx_PEM,watercaptag,watersurf_density_avg,watersoil_density_PEM_avg,TI_PEM(:,1,:),icetable_depth,icetable_thickness) 873 886 call compute_massh2o_exchange_ssi(ngrid,nslope,nsoilmx_PEM,icetable_thickness_old,ice_porefilling_old,tsurf_avg,tsoil_PEM,delta_h2o_icetablesublim) ! Mass of H2O exchange between the ssi and the atmosphere 874 887 else if (icetable_dynamic) then 875 write(*,*) " Computeice table (dynamic method)"888 write(*,*) "> Updating ice table (dynamic method)" 876 889 ice_porefilling_old = ice_porefilling 877 890 allocate(porefill(nsoilmx_PEM)) … … 916 929 enddo 917 930 enddo 918 write(*,*) "Tot mass of CO2 in the regolith=", totmassco2_adsorbed919 write(*,*) "Tot mass of H2O in the regolith=", totmassh2o_adsorbed931 write(*,*) "Total mass of CO2 in the regolith =", totmassco2_adsorbed 932 write(*,*) "Total mass of H2O in the regolith =", totmassh2o_adsorbed 920 933 endif 921 934 endif !soil_pem … … 965 978 ! II_g Checking the stopping criterion 966 979 !------------------------ 967 write(*,*) " Checking the stopping criteria..."980 write(*,*) "> Checking the stopping criteria" 968 981 call stopping_crit_h2o_ice(cell_area,h2oice_ini_surf,is_h2oice_sublim_ini,h2o_ice,stopPEM,ngrid) 969 982 call stopping_crit_co2(cell_area,co2ice_sublim_surf_ini,is_co2ice_sublim_ini,co2_ice,stopPEM,ngrid,ps_avg_global_ini,ps_avg_global_new,nslope) … … 998 1011 else 999 1012 write(*,*) "The PEM can continue!" 1000 write(*,*) "Number of iterations of the PEM : i_myear_leg =", i_myear_leg1001 write(*,*) "Number of simulated Martian years: i_myear =", i_myear1013 write(*,*) "Number of iterations of the PEM : i_myear_leg =", i_myear_leg 1014 write(*,*) "Number of simulated Martian years: i_myear =", i_myear 1002 1015 endif 1003 1016 enddo ! big time iteration loop of the pem … … 1024 1037 !------------------------ 1025 1038 ! III_a.1 Ice update for start file 1039 write(*,*) '> Reconstructing perennial ice and frost for the PCM' 1026 1040 watercap = 0. 1027 1041 perennial_co2ice = co2_ice … … 1052 1066 1053 1067 ! III.a.2. Tsurf update for start file 1068 write(*,*) '> Reconstructing the surface temperature for the PCM' 1054 1069 tsurf = tsurf_avg + tsurf_dev 1055 1070 deallocate(tsurf_dev) … … 1057 1072 ! III_a.3 Tsoil update for start file 1058 1073 if (soil_pem) then 1074 write(*,*) '> Reconstructing the soil temperature profile for the PCM' 1059 1075 inertiesoil = TI_PEM(:,:nsoilmx,:) 1060 1076 ! Tsurf has evolved and so the soil temperature profile needs to be adapted to match this new value … … 1070 1086 1071 1087 ! III_a.4 Pressure update for start file 1088 write(*,*) '> Reconstructing the pressure for the PCM' 1072 1089 allocate(ps_start(ngrid)) 1073 1090 ps_start = ps_avg + ps_dev … … 1075 1092 1076 1093 ! III_a.5 Tracers update for start file 1094 write(*,*) '> Reconstructing the tracer VMR for the PCM' 1077 1095 allocate(zplev_start0(ngrid,nlayer + 1),zplev_new(ngrid,nlayer + 1)) 1078 1096 do l = 1,nlayer + 1 … … 1118 1136 1119 1137 ! III_a.6 Albedo update for start file 1138 write(*,*) '> Reconstructing the albedo for the PCM' 1120 1139 do ig = 1,ngrid 1121 1140 if (latitude(ig) < 0.) then … … 1124 1143 icap = 1 ! Northern hemisphere 1125 1144 endif 1126 do islope = 1,n grid1145 do islope = 1,nslope 1127 1146 ! Bare ground 1128 1147 albedo(ig,:,islope) = albedodat(ig) … … 1154 1173 1155 1174 ! III_a.7 Orbital parameters update for start file 1175 write(*,*) '> Setting the new orbital parameters' 1156 1176 if (evol_orbit_pem) call recomp_orb_param(i_myear,i_myear_leg) 1157 1177 … … 1164 1184 pday = day_ini 1165 1185 ztime_fin = time_phys 1166 1167 1186 #ifndef CPP_1D 1187 write(*,*) '> Writing "restart.nc"' 1188 ! Correction on teta due to surface pressure changes 1189 allocate(pdyn(ip1jmp1)) 1190 call gr_fi_dyn(1,ngrid,iip1,jjp1,ps_start0/ps_start,pdyn) 1191 do i = 1,ip1jmp1 1192 teta(i,:) = teta(i,:)*pdyn(i)**kappa 1193 enddo 1194 ! Correction on atmospheric pressure 1168 1195 allocate(p(ip1jmp1,nlayer + 1)) 1169 ! Correction on teta due to surface pressure changes 1170 do l = 1,nlayer 1171 do i = 1,ip1jmp1 1172 teta(i,l)= teta(i,l)*(ps_start0(i)/ps_start(i))**kappa 1173 enddo 1174 enddo 1175 ! Correction on atmospheric pressure 1176 call pression(ip1jmp1,ap,bp,ps_start,p) 1196 call gr_fi_dyn(1,ngrid,iip1,jjp1,ps_start,pdyn) 1197 call pression(ip1jmp1,ap,bp,pdyn,p) 1177 1198 ! Correction on the mass of atmosphere 1178 1199 call massdair(p,masse) 1179 1200 call dynredem0("restart.nc",day_ini,phis) 1180 1201 call dynredem1("restart.nc",time_0,vcov,ucov,teta,q,masse,ps_start) 1181 write(*,*) "restart.nc has been written." 1182 deallocate(ap,bp,p) 1202 deallocate(ap,bp,p,pdyn) 1183 1203 #else 1204 write(*,*) '> Writing "restart1D.txt"' 1184 1205 call writerestart1D('restart1D.txt',ps_start(1),tsurf(1,:),nlayer,size(tsurf,2),teta,ucov,vcov,nq,noms,qsurf(1,:,:),q) 1185 write(*,*) "restart1D.txt has been written."1186 1206 #endif 1187 1207 deallocate(ps_start0,ps_start) 1188 1208 1189 1209 ! III_b.2 Write the "restartfi.nc" 1210 write(*,*) '> Writing "restartfi.nc"' 1190 1211 #ifndef CPP_STD 1191 1212 call physdem0("restartfi.nc",longitude,latitude,nsoilmx,ngrid, & … … 1207 1228 tsea_ice,sea_ice) 1208 1229 #endif 1209 write(*,*) "restartfi.nc has been written."1210 1230 1211 1231 !------------------------ … … 1213 1233 ! III_c Write the "restartpem.nc" 1214 1234 !------------------------ 1235 write(*,*) '> Writing "restartpem.nc"' 1215 1236 if (layering_algo) nb_str_max = get_nb_str_max(stratif,ngrid,nslope) ! Get the maximum number of "stratum" in the stratification (layerings) 1216 1237 call pemdem0("restartpem.nc",longitude,latitude,cell_area,ngrid,nslope,def_slope,subslope_dist) 1217 1238 call pemdem1("restartpem.nc",i_myear,nsoilmx_PEM,ngrid,nslope,tsoil_PEM,TI_PEM,icetable_depth,icetable_thickness,ice_porefilling, & 1218 1239 co2_adsorbed_phys,h2o_adsorbed_phys,h2o_ice,stratif) 1219 write(*,*) "restartpem.nc has been written."1220 1240 1221 1241 call info_PEM(i_myear_leg,stopPEM,i_myear,n_myear) 1222 1242 1223 write(*,*) " The PEM has run for", i_myear_leg, "Martian years."1224 write(*,*) " The chained simulation has run for", i_myear, "Martian years =", i_myear*convert_years, "Earth years."1225 write(*,*) " The reached date is now", (year_bp_ini + i_myear)*convert_years, "Earth years."1226 write(*,*) " PEM: so far, so good!"1243 write(*,*) ">> The PEM has run for", i_myear_leg, "Martian years." 1244 write(*,*) ">> The chained simulation has run for", i_myear, "Martian years =", i_myear*convert_years, "Earth years." 1245 write(*,*) ">> The reached date is now", (year_bp_ini + i_myear)*convert_years, "Earth years." 1246 write(*,*) ">> PEM: so far, so good!" 1227 1247 1228 1248 if (layering_algo) then -
trunk/LMDZ.COMMON/libf/evolution/read_data_PCM_mod.F90
r3602 r3603 181 181 ! Close the NetCDF file 182 182 call error_msg(nf90_close(fID),"close",filename1) 183 write(*,*) ' "'//filename1//'" processed!'183 write(*,*) '> "'//filename1//'" processed!' 184 184 185 185 !------------------------------- Year 2 -------------------------------- … … 445 445 ! Close the NetCDF file 446 446 call error_msg(nf90_close(fID),"close",filename2) 447 write(*,*) '" '//filename2//'" processed!'447 write(*,*) '"> '//filename2//'" processed!' 448 448 449 449 END SUBROUTINE read_data_PCM -
trunk/LMDZ.COMMON/libf/evolution/recomp_tend_co2_mod.F90
r3584 r3603 40 40 real :: coef, avg 41 41 42 write(*,*) " Update of the CO2 tendency from the currentpressure"42 write(*,*) "> Updating the CO2 ice tendency for the new pressure" 43 43 44 44 ! Evolution of the water ice for each physical point -
trunk/LMDZ.COMMON/libf/evolution/writediagpem.F90
r3532 r3603 824 824 ierr=NF_INQ_DIMID(nid,"time",id(4)) 825 825 ! Tell the world about it 826 write(*,*) "===================== "827 write(*,*) " writediagsoilpem: creating variable "//trim(name)826 write(*,*) "===========================" 827 write(*,*) "DIAGSOILPEM: creating variable "//trim(name) 828 828 call def_var(nid,name,title,units,4,id,varid,ierr) 829 829 endif ! of if (ierr.ne.NF_NOERR) … … 908 908 ierr=NF_INQ_DIMID(nid,"time",id(3)) 909 909 ! Tell the world about it 910 write(*,*) "===================== "911 write(*,*) " writediagsoilpem: creating variable "//trim(name)910 write(*,*) "===========================" 911 write(*,*) "DIAGSOILPEM: creating variable "//trim(name) 912 912 call def_var(nid,name,title,units,3,id,varid,ierr) 913 913 endif ! of if (ierr.ne.NF_NOERR) … … 959 959 ierr=NF_INQ_DIMID(nid,"time",id(1)) 960 960 ! Tell the world about it 961 write(*,*) "===================== "962 write(*,*) " writediagsoilpem: creating variable "//trim(name)961 write(*,*) "===========================" 962 write(*,*) "DIAGSOILPEM: creating variable "//trim(name) 963 963 call def_var(nid,name,title,units,1,id,varid,ierr) 964 964 endif ! of if (ierr.ne.NF_NOERR)
Note: See TracChangeset
for help on using the changeset viewer.