Changeset 3673 for trunk/LMDZ.COMMON/libf
- Timestamp:
- Mar 7, 2025, 10:01:32 AM (3 months ago)
- Location:
- trunk/LMDZ.COMMON/libf/evolution
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LMDZ.COMMON/libf/evolution/changelog.txt
r3667 r3673 616 616 == 03/03/2025 == JBC 617 617 Adjusting the anticipation time for more security regarding the job time limit detection. 618 619 == 07/03/2025 == JBC 620 - Correction for the update of average pressure at the end. 621 - Addition of pore-filled ice information for 'stratum' in the layering algorithm. 622 - Deactivating the soil temperature shifting because of bad values given by interpolation. -
trunk/LMDZ.COMMON/libf/evolution/deftank/visu_evol_layering.py
r3666 r3673 67 67 stratif_h2oice = np.zeros((ngrid,nfile,nslope,max_nb_str)) 68 68 stratif_dust = np.zeros((ngrid,nfile,nslope,max_nb_str)) 69 stratif_ air= np.zeros((ngrid,nfile,nslope,max_nb_str))69 stratif_pore = np.zeros((ngrid,nfile,nslope,max_nb_str)) 70 70 for var_name in datasets[0].variables: 71 71 if 'top_elevation' in var_name: … … 97 97 stratif_dust[i,j,k,:datasets[j].variables[var_name].shape[1]] = datasets[j].variables[var_name][0,:,i] 98 98 print(f"Processed variable: {var_name}") 99 elif ' air_volfrac' in var_name:99 elif 'pore_volfrac' in var_name: 100 100 for i in range(0,ngrid): 101 101 for j in range(0,nfile): 102 102 for k in range(0,nslope): 103 103 if f'slope{k + 1:02d}' in var_name: 104 stratif_ air[i,j,k,:datasets[j].variables[var_name].shape[1]] = datasets[j].variables[var_name][0,:,i]104 stratif_pore[i,j,k,:datasets[j].variables[var_name].shape[1]] = datasets[j].variables[var_name][0,:,i] 105 105 print(f"Processed variable: {var_name}") 106 106 … … 109 109 ds.close() 110 110 111 stratif_data = [stratif_heights,stratif_co2ice,stratif_h2oice,stratif_dust,stratif_ air]111 stratif_data = [stratif_heights,stratif_co2ice,stratif_h2oice,stratif_dust,stratif_pore] 112 112 return stratif_data, max_top_elevation, longitude, latitude 113 113 … … 158 158 159 159 ### Figures plotting 160 subtitle = ['CO2 ice','H2O ice','Dust',' Air']160 subtitle = ['CO2 ice','H2O ice','Dust','Pore'] 161 161 cmap = plt.get_cmap('viridis').copy() 162 162 cmap.set_under('white') -
trunk/LMDZ.COMMON/libf/evolution/deftank/visu_layering.py
r3458 r3673 43 43 stratif_h2oice_volfrac = [] 44 44 stratif_dust_volfrac = [] 45 stratif_ air_volfrac = []45 stratif_pore_volfrac = [] 46 46 for i in range(1,nslope + 1): 47 47 stratif_thickness.append(nc_file.variables['stratif_slope' + str(i).zfill(2) + '_thickness'][:]) … … 50 50 stratif_h2oice_volfrac.append(nc_file.variables['stratif_slope' + str(i).zfill(2) + '_h2oice_volfrac'][:]) 51 51 stratif_dust_volfrac.append(nc_file.variables['stratif_slope' + str(i).zfill(2) + '_dust_volfrac'][:]) 52 stratif_ air_volfrac.append(nc_file.variables['stratif_slope' + str(i).zfill(2) + '_air_volfrac'][:])52 stratif_pore_volfrac.append(nc_file.variables['stratif_slope' + str(i).zfill(2) + '_pore_volfrac'][:]) 53 53 54 54 ### Display the data 55 55 igrid = igrid - 1 56 56 islope = islope - 1 57 labels = 'CO2 ice', 'H2O ice', 'Dust', ' Air'57 labels = 'CO2 ice', 'H2O ice', 'Dust', 'Pore' 58 58 contents = np.zeros([4,len(stratif_top_elevation[islope][0,:,igrid]) + 1]) 59 59 height = np.zeros(len(stratif_top_elevation[islope][0,:,igrid]) + 1) … … 64 64 contents[1,1 + i] = stratif_h2oice_volfrac[islope][0,i,igrid] 65 65 contents[2,1 + i] = stratif_dust_volfrac[islope][0,i,igrid] 66 contents[3,1 + i] = stratif_ air_volfrac[islope][0,i,igrid]66 contents[3,1 + i] = stratif_pore_volfrac[islope][0,i,igrid] 67 67 contents[:,0] = contents[:,1] 68 68 -
trunk/LMDZ.COMMON/libf/evolution/layering_mod.F90
r3666 r3673 33 33 ! Stratum = node of the linked list 34 34 type :: stratum 35 real :: thickness ! Layer thickness [m] 36 real :: top_elevation ! Layer top_elevation (top height from the surface) [m] 37 real :: co2ice_volfrac ! CO2 ice volumetric fraction 38 real :: h2oice_volfrac ! H2O ice volumetric fraction 39 real :: dust_volfrac ! Dust volumetric fraction 40 real :: air_volfrac ! Air volumetric fraction inside pores 41 type(stratum), pointer :: up => null() ! Upper stratum (next node) 42 type(stratum), pointer :: down => null() ! Lower stratum (previous node) 35 real :: thickness ! Layer thickness [m] 36 real :: top_elevation ! Layer top_elevation (top height from the surface) [m] 37 real :: co2ice_volfrac ! CO2 ice volumetric fraction 38 real :: h2oice_volfrac ! H2O ice volumetric fraction 39 real :: dust_volfrac ! Dust volumetric fraction 40 real :: pore_volfrac ! Pore volumetric fraction = pores 41 real :: poreice_volfrac ! Pore-filled ice volumetric fraction 42 type(stratum), pointer :: up => null() ! Upper stratum (next node) 43 type(stratum), pointer :: down => null() ! Lower stratum (previous node) 43 44 end type stratum 44 45 … … 85 86 86 87 !---- Code 87 write(*,'(a20,es13.6)') 'Thickness : ', this%thickness 88 write(*,'(a20,es13.6)') 'Top elevation : ', this%top_elevation 89 write(*,'(a20,es13.6)') 'CO2 ice (m3/m3): ', this%co2ice_volfrac 90 write(*,'(a20,es13.6)') 'H2O ice (m3/m3): ', this%h2oice_volfrac 91 write(*,'(a20,es13.6)') 'Dust (m3/m3) : ', this%dust_volfrac 92 write(*,'(a20,es13.6)') 'Air (m3/m3) : ', this%air_volfrac 88 write(*,'(a,es13.6)') 'Thickness : ', this%thickness 89 write(*,'(a,es13.6)') 'Top elevation : ', this%top_elevation 90 write(*,'(a,es13.6)') 'CO2 ice (m3/m3) : ', this%co2ice_volfrac 91 write(*,'(a,es13.6)') 'H2O ice (m3/m3) : ', this%h2oice_volfrac 92 write(*,'(a,es13.6)') 'Dust (m3/m3) : ', this%dust_volfrac 93 write(*,'(a,es13.6)') 'Porosity (m3/m3) : ', this%pore_volfrac 94 write(*,'(a,es13.6)') 'Pore-filled ice (m3/m3): ', this%poreice_volfrac 93 95 94 96 END SUBROUTINE print_stratum … … 96 98 !======================================================================= 97 99 ! To add a stratum to the top of a layering 98 SUBROUTINE add_stratum(this,thickness,top_elevation,co2ice,h2oice,dust, air)100 SUBROUTINE add_stratum(this,thickness,top_elevation,co2ice,h2oice,dust,pore,poreice) 99 101 100 102 implicit none … … 102 104 !---- Arguments 103 105 type(layering), intent(inout) :: this 104 real, intent(in), optional :: thickness, top_elevation, co2ice, h2oice, dust, air106 real, intent(in), optional :: thickness, top_elevation, co2ice, h2oice, dust, pore, poreice 105 107 106 108 !---- Local variables … … 116 118 str%h2oice_volfrac = 0. 117 119 str%dust_volfrac = 0. 118 str%air_volfrac = 1. 120 str%pore_volfrac = 1. 121 str%poreice_volfrac = 0. 119 122 if (present(thickness)) str%thickness = thickness 120 123 if (present(top_elevation)) str%top_elevation = top_elevation … … 122 125 if (present(h2oice)) str%h2oice_volfrac = h2oice 123 126 if (present(dust)) str%dust_volfrac = dust 124 if (present(air)) str%air_volfrac = air 127 if (present(pore)) str%pore_volfrac = pore 128 if (present(poreice)) str%poreice_volfrac = poreice 125 129 126 130 ! Verification of volume fraction 127 if (abs(1. - (str%co2ice_volfrac + str%h2oice_volfrac + str%dust_volfrac + str% air_volfrac)) > tol) then131 if (abs(1. - (str%co2ice_volfrac + str%h2oice_volfrac + str%dust_volfrac + str%pore_volfrac)) > tol) then 128 132 call print_stratum(str) 129 133 error stop 'add_stratum: properties for the new stratum are not possible (sum of volumetric fraction /= 1)!' … … 147 151 !======================================================================= 148 152 ! To insert a stratum after another one in a layering 149 SUBROUTINE insert_stratum(this,str_prev,thickness,top_elevation,co2ice,h2oice,dust, air)153 SUBROUTINE insert_stratum(this,str_prev,thickness,top_elevation,co2ice,h2oice,dust,pore,poreice) 150 154 151 155 implicit none … … 154 158 type(layering), intent(inout) :: this 155 159 type(stratum), pointer, intent(inout) :: str_prev 156 real, intent(in), optional :: thickness, top_elevation, co2ice, h2oice, dust, air160 real, intent(in), optional :: thickness, top_elevation, co2ice, h2oice, dust, pore, poreice 157 161 158 162 !---- Local variables … … 161 165 !---- Code 162 166 if (.not. associated(str_prev%up)) then ! If str_prev is the top stratum of the layering 163 call add_stratum(this,thickness,top_elevation,co2ice,h2oice,dust, air)167 call add_stratum(this,thickness,top_elevation,co2ice,h2oice,dust,pore,poreice) 164 168 else 165 169 ! Creation of the stratum … … 171 175 str%h2oice_volfrac = 0. 172 176 str%dust_volfrac = 0. 173 str%air_volfrac = 1. 177 str%pore_volfrac = 1. 178 str%poreice_volfrac = 0. 174 179 if (present(thickness)) str%thickness = thickness 175 180 if (present(top_elevation)) str%top_elevation = top_elevation … … 177 182 if (present(h2oice)) str%h2oice_volfrac = h2oice 178 183 if (present(dust)) str%dust_volfrac = dust 179 if (present(air)) str%air_volfrac = air 184 if (present(pore)) str%pore_volfrac = pore 185 if (present(poreice)) str%poreice_volfrac = poreice 180 186 181 187 ! Verification of volume fraction 182 if (abs(1. - (str%co2ice_volfrac + str%h2oice_volfrac + str%dust_volfrac + str% air_volfrac)) > tol) then188 if (abs(1. - (str%co2ice_volfrac + str%h2oice_volfrac + str%dust_volfrac + str%pore_volfrac)) > tol) then 183 189 call print_stratum(str) 184 190 error stop 'add_stratum: properties for the new stratum are not possible (sum of volumetric fraction /= 1)!' … … 326 332 i = this%nb_str 327 333 do while (associated(current)) 328 write(*,'(a 8,i4)') 'Stratum ', i334 write(*,'(a,i4)') 'Stratum ', i 329 335 call print_stratum(current) 330 336 write(*,*) … … 386 392 stratif_array(ig,islope,k,4) = current%h2oice_volfrac 387 393 stratif_array(ig,islope,k,5) = current%dust_volfrac 388 stratif_array(ig,islope,k,6) = current%air_volfrac 394 stratif_array(ig,islope,k,6) = current%pore_volfrac 395 stratif_array(ig,islope,k,7) = current%poreice_volfrac 389 396 current => current%up 390 397 k = k + 1 … … 412 419 do islope = 1,nslope 413 420 do ig = 1,ngrid 414 stratif(ig,islope)%bottom%thickness = stratif_array(ig,islope,1,1) 415 stratif(ig,islope)%bottom%top_elevation = stratif_array(ig,islope,1,2) 416 stratif(ig,islope)%bottom%co2ice_volfrac = stratif_array(ig,islope,1,3) 417 stratif(ig,islope)%bottom%h2oice_volfrac = stratif_array(ig,islope,1,4) 418 stratif(ig,islope)%bottom%dust_volfrac = stratif_array(ig,islope,1,5) 419 stratif(ig,islope)%bottom%air_volfrac = stratif_array(ig,islope,1,6) 421 stratif(ig,islope)%bottom%thickness = stratif_array(ig,islope,1,1) 422 stratif(ig,islope)%bottom%top_elevation = stratif_array(ig,islope,1,2) 423 stratif(ig,islope)%bottom%co2ice_volfrac = stratif_array(ig,islope,1,3) 424 stratif(ig,islope)%bottom%h2oice_volfrac = stratif_array(ig,islope,1,4) 425 stratif(ig,islope)%bottom%dust_volfrac = stratif_array(ig,islope,1,5) 426 stratif(ig,islope)%bottom%pore_volfrac = stratif_array(ig,islope,1,6) 427 stratif(ig,islope)%bottom%poreice_volfrac = stratif_array(ig,islope,1,7) 420 428 do k = 2,size(stratif_array,3) 421 429 if (all(abs(stratif_array(ig,islope,k,:)) < eps)) exit 422 call add_stratum(stratif(ig,islope),stratif_array(ig,islope,k,1),stratif_array(ig,islope,k,2),stratif_array(ig,islope,k,3),stratif_array(ig,islope,k,4),stratif_array(ig,islope,k,5),stratif_array(ig,islope,k,6) )430 call add_stratum(stratif(ig,islope),stratif_array(ig,islope,k,1),stratif_array(ig,islope,k,2),stratif_array(ig,islope,k,3),stratif_array(ig,islope,k,4),stratif_array(ig,islope,k,5),stratif_array(ig,islope,k,6),stratif_array(ig,islope,k,7)) 423 431 enddo 424 432 enddo … … 490 498 do while (h2lift_tot > 0. .and. associated(current1)) 491 499 ! Is the considered stratum a dust lag? 492 if (abs(1. - (current1%dust_volfrac + current1% air_volfrac)) < tol) then ! Yes, we can lift dust500 if (abs(1. - (current1%dust_volfrac + current1%pore_volfrac)) < tol) then ! Yes, we can lift dust 493 501 h_dust_old = current1%dust_volfrac*current1%thickness 494 502 ! How much dust can be lifted in the considered dust lag? … … 524 532 if (thickness > 0.) then ! Only if the stratum is building up 525 533 if (new_str) then 526 call add_stratum(this,thickness,this%top%top_elevation + thickness,0.,0.,dh_dust/thickness,dry_regolith_porosity )534 call add_stratum(this,thickness,this%top%top_elevation + thickness,0.,0.,dh_dust/thickness,dry_regolith_porosity,0.) 527 535 new_str = .false. 528 536 else … … 540 548 if (thickness > 0.) then ! Only if the stratum is building up 541 549 if (new_str) then 542 call add_stratum(this,thickness,this%top%top_elevation + thickness,dh_co2ice/thickness,dh_h2oice/thickness,dh_dust/thickness,1. - (dh_co2ice/thickness + dh_h2oice/thickness + dh_dust/thickness) )550 call add_stratum(this,thickness,this%top%top_elevation + thickness,dh_co2ice/thickness,dh_h2oice/thickness,dh_dust/thickness,1. - (dh_co2ice/thickness + dh_h2oice/thickness + dh_dust/thickness),0.) 543 551 new_str = .false. 544 552 else … … 563 571 if (associated(current1%up)) then ! If there is an upper stratum 564 572 currentloc => current1%up 565 do while (abs(1. - (currentloc%dust_volfrac + currentloc% air_volfrac)) < tol)573 do while (abs(1. - (currentloc%dust_volfrac + currentloc%pore_volfrac)) < tol) 566 574 h_toplag = h_toplag + currentloc%thickness 567 575 if (.not. associated(currentloc%up)) exit … … 578 586 else if (h_co2ice_old < eps) then ! There is nothing to sublimate 579 587 ! Is the considered stratum a dust lag? 580 if (abs(1. - (current1%dust_volfrac + current1% air_volfrac)) < tol) then ! Yes, we move to the underlying stratum588 if (abs(1. - (current1%dust_volfrac + current1%pore_volfrac)) < tol) then ! Yes, we move to the underlying stratum 581 589 current1 => current1%down 582 590 new_lag1 = .true. … … 600 608 if (thickness > 0.) then ! Only if the stratum is building up 601 609 if (new_str) then 602 call add_stratum(this,thickness,this%top%top_elevation + thickness,0.,dh_h2oice/thickness,dh_dust/thickness,1. - (dh_h2oice/thickness + dh_dust/thickness) )610 call add_stratum(this,thickness,this%top%top_elevation + thickness,0.,dh_h2oice/thickness,dh_dust/thickness,1. - (dh_h2oice/thickness + dh_dust/thickness),0.) 603 611 new_str = .false. 604 612 else … … 623 631 if (associated(current1%up)) then ! If there is an upper stratum 624 632 currentloc => current1%up 625 do while (abs(1. - (currentloc%dust_volfrac + currentloc% air_volfrac)) < tol)633 do while (abs(1. - (currentloc%dust_volfrac + currentloc%pore_volfrac)) < tol) 626 634 h_toplag = h_toplag + currentloc%thickness 627 635 if (.not. associated(currentloc%up)) exit … … 638 646 else if (h_co2ice_old < eps) then ! There is nothing to sublimate 639 647 ! Is the considered stratum a dust lag? 640 if (abs(1. - (current1%dust_volfrac + current1% air_volfrac)) < tol) then ! Yes, we move to the underlying stratum648 if (abs(1. - (current1%dust_volfrac + current1%pore_volfrac)) < tol) then ! Yes, we move to the underlying stratum 641 649 current1 => current1%down 642 650 new_lag1 = .true. … … 667 675 if (associated(current2%up)) then ! If there is an upper stratum 668 676 currentloc => current2%up 669 do while (abs(1. - (currentloc%dust_volfrac + currentloc% air_volfrac)) < tol)677 do while (abs(1. - (currentloc%dust_volfrac + currentloc%pore_volfrac)) < tol) 670 678 h_toplag = h_toplag + currentloc%thickness 671 679 if (.not. associated(currentloc%up)) exit … … 682 690 else if (h_h2oice_old < eps) then ! There is nothing to sublimate 683 691 ! Is the considered stratum a dust lag? 684 if (abs(1. - (current1%dust_volfrac + current1% air_volfrac)) < tol) then ! Yes, we move to the underlying stratum692 if (abs(1. - (current1%dust_volfrac + current1%pore_volfrac)) < tol) then ! Yes, we move to the underlying stratum 685 693 current1 => current1%down 686 694 new_lag1 = .true. … … 743 751 str%h2oice_volfrac = h_h2oice_old/str%thickness 744 752 str%dust_volfrac = (h_dust_old - hsubl_dust)/str%thickness 745 str%air_volfrac = 1. - (str%co2ice_volfrac + str%h2oice_volfrac + str%dust_volfrac) 753 str%pore_volfrac = 1. - (str%co2ice_volfrac + str%h2oice_volfrac + str%dust_volfrac) 754 str%poreice_volfrac = 0. 746 755 ! Correct the value of top_elevation for the upper strata 747 756 current => str%up … … 801 810 str%h2oice_volfrac = (h_h2oice_old - h2subl)/str%thickness 802 811 str%dust_volfrac = (h_dust_old - hsubl_dust)/str%thickness 803 str%air_volfrac = 1. - (str%co2ice_volfrac + str%h2oice_volfrac + str%dust_volfrac) 812 str%pore_volfrac = 1. - (str%co2ice_volfrac + str%h2oice_volfrac + str%dust_volfrac) 813 str%poreice_volfrac = 0. 804 814 ! Correct the value of top_elevation for the upper strata 805 815 current => str%up … … 838 848 !---- Code 839 849 ! Update of properties in the eroding dust lag 840 str%thickness = str%thickness - h2lift/(1. - str% air_volfrac)841 str%top_elevation = str%top_elevation - h2lift/(1. - str% air_volfrac)850 str%thickness = str%thickness - h2lift/(1. - str%pore_volfrac) 851 str%top_elevation = str%top_elevation - h2lift/(1. - str%pore_volfrac) 842 852 ! Remove the eroding dust lag if there is no dust anymore 843 853 if (str%thickness < tol) call rm_stratum(this,str) -
trunk/LMDZ.COMMON/libf/evolution/pem.F90
r3667 r3673 145 145 real, dimension(:), allocatable :: ps_start ! surface pressure in the start file 146 146 real, dimension(:), allocatable :: ps_start0 ! surface pressure in the start file at the beginning 147 real, dimension(:), allocatable :: ps_avg ! (ngrid) Average dsurface pressure147 real, dimension(:), allocatable :: ps_avg ! (ngrid) Average surface pressure 148 148 real, dimension(:), allocatable :: ps_dev ! (ngrid x timelen) Surface pressure deviation 149 149 real, dimension(:,:), allocatable :: ps_timeseries ! (ngrid x timelen) Instantaneous surface pressure … … 206 206 207 207 ! Variables for surface and soil 208 real, dimension(:,:), allocatable :: tsurf_avg ! Grid points x Slope field: Average dsurface temperature [K]208 real, dimension(:,:), allocatable :: tsurf_avg ! Grid points x Slope field: Average surface temperature [K] 209 209 real, dimension(:,:), allocatable :: tsurf_dev ! Grid points x Slope field: Surface temperature deviation [K] 210 real, dimension(:,:), allocatable :: tsurf_avg_yr1 ! Grid points x Slope field: Average dsurface temperature of first call of the PCM [K]211 real, dimension(:,:,:), allocatable :: tsoil_avg ! Grid points x Soil x Slope field: Average dSoil Temperature [K]212 real, dimension(:,:), allocatable :: tsoil_avg_old ! Grid points x Soil field: Average dSoil Temperature at the previous time step [K]210 real, dimension(:,:), allocatable :: tsurf_avg_yr1 ! Grid points x Slope field: Average surface temperature of first call of the PCM [K] 211 real, dimension(:,:,:), allocatable :: tsoil_avg ! Grid points x Soil x Slope field: Average Soil Temperature [K] 212 real, dimension(:,:), allocatable :: tsoil_avg_old ! Grid points x Soil field: Average Soil Temperature at the previous time step [K] 213 213 real, dimension(:,:,:), allocatable :: tsoil_dev ! Grid points x Soil x Slope field: Soil temperature deviation [K] 214 214 real, dimension(:,:,:,:), allocatable :: tsoil_timeseries ! Grid points x Soil x Slope x Times field: Soil temperature timeseries [K] … … 216 216 real, dimension(:,:,:,:), allocatable :: tsoil_PEM_timeseries_old ! Grid points x Soil x Slope x Times field: Soil temperature timeseries for PEM at the previous time step [K] 217 217 real, dimension(:,:,:,:), allocatable :: watersoil_density_timeseries ! Grid points x Soil x Slope x Times Water soil density timeseries [kg /m^3] 218 real, dimension(:,:), allocatable :: watersurf_density_avg ! Grid points x Slope: Average dwater surface density [kg/m^3]218 real, dimension(:,:), allocatable :: watersurf_density_avg ! Grid points x Slope: Average water surface density [kg/m^3] 219 219 real, dimension(:,:,:,:), allocatable :: watersoil_density_PEM_timeseries ! Grid points x Soil x Slope x Times: Water soil density timeseries for PEM [kg/m^3] 220 real, dimension(:,:,:), allocatable :: watersoil_density_PEM_avg ! Grid points x Soil x Slopes: Average dwater soil density [kg/m^3]220 real, dimension(:,:,:), allocatable :: watersoil_density_PEM_avg ! Grid points x Soil x Slopes: Average water soil density [kg/m^3] 221 221 real, dimension(:), allocatable :: delta_co2_adsorbed ! Physics: quantity of CO2 that is exchanged because of adsorption / desorption [kg/m^2] 222 222 real, dimension(:), allocatable :: delta_h2o_adsorbed ! Physics: quantity of H2O that is exchanged because of adsorption / desorption [kg/m^2] … … 374 374 call hostnm(hostname) ! Machine/station name 375 375 write(*,*) 376 write(*,*) ' ######### PEM information #########'376 write(*,*) '********* PEM information *********' 377 377 write(*,*) '+ User : '//trim(logname) 378 378 write(*,*) '+ Machine : '//trim(hostname) … … 406 406 !------------------------ 407 407 write(*,*) 408 write(*,*) ' ######### PEM initialization #########'408 write(*,*) '********* PEM initialization *********' 409 409 write(*,*) '> Reading "run.def" (PEM)' 410 410 #ifndef CPP_1D … … 638 638 ps_avg_global_ini = sum(cell_area*ps_avg)/total_surface 639 639 ps_avg_global_new = ps_avg_global_ini 640 write(*,*) "Total surface of the planet 641 write(*,*) "Initial global average dpressure =", ps_avg_global_ini640 write(*,*) "Total surface of the planet =", total_surface 641 write(*,*) "Initial global average pressure =", ps_avg_global_ini 642 642 643 643 !------------------------ … … 732 732 !------------------------ 733 733 write(*,*) 734 write(*,*) ' ######### PEM cycle #########'734 write(*,*) '********* PEM cycle *********' 735 735 i_myear_leg = 0 736 736 stopPEM = 0 … … 750 750 do while (i_myear_leg < n_myear_leg .and. i_myear < n_myear) 751 751 ! II.a.1. Compute updated global pressure 752 write(*,'(a,f10.2)') ' ####Iteration of the PEM leg (Martian years): ', i_myear_leg + 1752 write(*,'(a,f10.2)') ' **** Iteration of the PEM leg (Martian years): ', i_myear_leg + 1 753 753 write(*,*) "> Updating the surface pressure" 754 754 ps_avg_global_old = ps_avg_global_new … … 775 775 enddo 776 776 enddo 777 do ig = 1,ngrid 778 ps_timeseries(ig,:) = ps_timeseries(ig,:)*ps_avg_global_new/ps_avg_global_old 779 enddo 777 ps_timeseries(:,:) = ps_timeseries(:,:)*ps_avg_global_new/ps_avg_global_old 780 778 write(*,*) "> Updating the pressure levels timeseries for the new pressure" 781 779 allocate(zplev_timeseries_new(ngrid,nlayer + 1,timelen)) … … 893 891 if (soil_pem) then 894 892 ! II_d.2 Shifting soil temperature to surface 895 call shift_tsoil2surf(ngrid,nsoilmx_PEM,nslope,zshift_surf,zlag,tsurf_avg,tsoil_PEM)893 !call shift_tsoil2surf(ngrid,nsoilmx_PEM,nslope,zshift_surf,zlag,tsurf_avg,tsoil_PEM) 896 894 897 895 ! II_d.3 Update soil temperature … … 939 937 enddo 940 938 deallocate(porefill) 941 call compute_massh2o_exchange_ssi(ngrid,nslope,nsoilmx_PEM,icetable_thickness_old,ice_porefilling_old,tsurf_avg, 939 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 942 940 endif 943 941 deallocate(icetable_thickness_old,ice_porefilling_old) … … 1040 1038 select case (stopPEM) 1041 1039 case(1) 1042 write(*,'(a,i0,a)') " ####STOPPING because surface of h2o ice sublimating is too low: ", stopPEM, ". See message above."1040 write(*,'(a,i0,a)') " **** STOPPING because surface of h2o ice sublimating is too low: ", stopPEM, ". See message above." 1043 1041 case(2) 1044 write(*,'(a,i0,a)') " ####STOPPING because tendencies on h2o ice = 0: ", stopPEM, ". See message above."1042 write(*,'(a,i0,a)') " **** STOPPING because tendencies on h2o ice = 0: ", stopPEM, ". See message above." 1045 1043 case(3) 1046 write(*,'(a,i0,a)') " ####STOPPING because surface of co2 ice sublimating is too low: ", stopPEM, ". See message above."1044 write(*,'(a,i0,a)') " **** STOPPING because surface of co2 ice sublimating is too low: ", stopPEM, ". See message above." 1047 1045 case(4) 1048 write(*,'(a,i0,a)') " ####STOPPING because surface global pressure changed too much: ", stopPEM, ". See message above."1046 write(*,'(a,i0,a)') " **** STOPPING because surface global pressure changed too much: ", stopPEM, ". See message above." 1049 1047 case(5) 1050 write(*,'(a,i0)') " ####STOPPING because maximum number of iterations is reached (possibly due to orbital parameters): ", stopPEM1048 write(*,'(a,i0)') " **** STOPPING because maximum number of iterations is reached (possibly due to orbital parameters): ", stopPEM 1051 1049 case(6) 1052 write(*,'(a,i0)') " ####STOPPING because maximum number of Martian years to be simulated is reached: ", stopPEM1050 write(*,'(a,i0)') " **** STOPPING because maximum number of Martian years to be simulated is reached: ", stopPEM 1053 1051 case(7) 1054 write(*,'(a,i0)') " ####STOPPING because the time limit for the PEM job will be reached soon: ", stopPEM1052 write(*,'(a,i0)') " **** STOPPING because the time limit for the PEM job will be reached soon: ", stopPEM 1055 1053 case(8) 1056 write(*,'(a,i0)') " ####STOPPING because the layering algorithm met an hasty end: ", stopPEM1054 write(*,'(a,i0)') " **** STOPPING because the layering algorithm met an hasty end: ", stopPEM 1057 1055 case default 1058 write(*,'(a,i0)') " ####STOPPING with unknown stopping criterion code: ", stopPEM1056 write(*,'(a,i0)') " **** STOPPING with unknown stopping criterion code: ", stopPEM 1059 1057 end select 1060 1058 exit 1061 1059 else 1062 write(*,'(a,f10.2,a)') ' ####The chained simulation has run for ',i_myear,' Martian years.'1063 write(*,*) ' ####The PEM can continue!'1064 write(*,*) ' ####'1060 write(*,'(a,f10.2,a)') ' **** The chained simulation has run for ',i_myear,' Martian years.' 1061 write(*,*) '**** The PEM can continue!' 1062 write(*,*) '****' 1065 1063 endif 1066 1064 enddo ! big time iteration loop of the pem … … 1081 1079 ! III_a.1 Ice update for start file 1082 1080 write(*,*) 1083 write(*,*) ' ######### PEM finalization #########'1081 write(*,*) '********* PEM finalization *********' 1084 1082 write(*,*) '> Reconstructing perennial ice and frost for the PCM' 1085 1083 watercap = 0. … … 1133 1131 write(*,*) '> Reconstructing the pressure for the PCM' 1134 1132 allocate(ps_start(ngrid)) 1135 ! The pressure deviation is rescaled to avoid disproportionate oscillations in case of huge average pressure drop 1136 ps_start = ps_avg + ps_dev*ps_avg_global_new/ps_avg_global_ini 1133 ps_start = (ps_avg + ps_dev)*ps_avg_global_new/ps_avg_global_ini ! The pressure deviation is rescaled as well to avoid disproportionate oscillations in case of huge average pressure drop 1137 1134 deallocate(ps_avg,ps_dev) 1138 1135 … … 1288 1285 1289 1286 write(*,*) 1290 write(*,*) ' ######### PEM finalization #########'1287 write(*,*) '********* PEM finalization *********' 1291 1288 write(*,'(a,f10.2,a)') " + The PEM leg has run for ", i_myear_leg, " Martian years." 1292 1289 write(*,'(a,f10.2,a,f10.2,a)') " + The chained simulation has run for ", i_myear, " Martian years =", i_myear*convert_years, " Earth years." 1293 1290 write(*,'(a,f10.2,a)') " + The reached date is now ", (year_bp_ini + i_myear)*convert_years, " Earth years." 1294 1291 write(*,*) "+ PEM: so far, so good!" 1295 write(*,*) ' ####################################'1292 write(*,*) '************************************' 1296 1293 1297 1294 if (layering_algo) then -
trunk/LMDZ.COMMON/libf/evolution/pemetat0.F90
r3666 r3673 65 65 real, dimension(ngrid,nsoil_PEM,nslope), intent(inout) :: watersoil_avg ! surface water ice density, yearly averaged (kg/m^3) 66 66 ! local 67 real, dimension(ngrid,nsoil_PEM,nslope) :: tsoil_startpem 68 real, dimension(ngrid,nsoil_PEM,nslope) :: TI_startPEM 69 logical :: found, found2 70 integer :: iloop, ig, islope , isoil! index for loops71 real :: delta 72 character(2) :: num 73 logical :: startpem_file 74 real, dimension(:,:,:,:), allocatable :: stratif_array 67 real, dimension(ngrid,nsoil_PEM,nslope) :: tsoil_startpem ! soil temperature saved in the start [K] 68 real, dimension(ngrid,nsoil_PEM,nslope) :: TI_startPEM ! soil thermal inertia saved in the start [SI] 69 logical :: found, found2 ! check if variables are found in the start 70 integer :: iloop, ig, islope ! index for loops 71 real :: delta ! Depth of the interface regolith-breccia, breccia -bedrock [m] 72 character(2) :: num ! intermediate string to read PEM start sloped variables 73 logical :: startpem_file ! boolean to check if we read the startfile or not 74 real, dimension(:,:,:,:), allocatable :: stratif_array ! Array for stratification (layerings) 75 75 76 76 #ifdef CPP_STD … … 143 143 nb_str_max = int(inquire_dimension_length('nb_str_max')) 144 144 endif 145 allocate(stratif_array(ngrid,nslope,nb_str_max, 6))145 allocate(stratif_array(ngrid,nslope,nb_str_max,7)) 146 146 stratif_array = 0. 147 147 do islope = 1,nslope … … 156 156 call get_field('stratif_slope'//num//'_dust_volfrac',stratif_array(:,islope,:,5),found2) 157 157 found = found .or. found2 158 call get_field('stratif_slope'//num//'_air_volfrac',stratif_array(:,islope,:,6),found2) 158 call get_field('stratif_slope'//num//'_pore_volfrac',stratif_array(:,islope,:,6),found2) 159 found = found .or. found2 160 call get_field('stratif_slope'//num//'_icepore_volfrac',stratif_array(:,islope,:,7),found2) 159 161 found = found .or. found2 160 162 if (.not. found) then … … 267 269 call compute_tsoil_pem(ngrid,nsoil_PEM,.false.,TI_PEM(:,:,islope),timestep,tsurf_avg_yr2(:,islope),tsoil_startpem(:,:,islope)) 268 270 269 do iloop = nsoil_PCM + 1,nsoil_PEM 270 tsoil_PEM(:,iloop,islope) = tsoil_startpem(:,iloop,islope) 271 enddo 271 tsoil_PEM(:,nsoil_PCM + 1:nsoil_PEM,islope) = tsoil_startpem(:,nsoil_PCM + 1:nsoil_PEM,islope) 272 272 endif !found 273 273 274 do isoil = nsoil_PCM + 1,nsoil_PEM 275 watersoil_avg(:,isoil,islope) = exp(beta_clap_h2o/tsoil_PEM(:,isoil,islope) + alpha_clap_h2o)/tsoil_PEM(:,isoil,islope)*mmol(igcm_h2o_vap)/(mugaz*r) 276 enddo 274 watersoil_avg(:,nsoil_PCM + 1:nsoil_PEM,islope) = exp(beta_clap_h2o/tsoil_PEM(:,nsoil_PCM + 1:nsoil_PEM,islope) + alpha_clap_h2o)/tsoil_PEM(:,nsoil_PCM + 1:nsoil_PEM,islope)*mmol(igcm_h2o_vap)/(mugaz*r) 277 275 enddo ! islope 278 276 write(*,*) 'PEMETAT0: TSOIL done' … … 431 429 432 430 ! First raw initialization 433 do isoil = nsoil_PCM + 1,nsoil_PEM 434 do ig = 1,ngrid 435 watersoil_avg(ig,isoil,islope) = exp(beta_clap_h2o/tsoil_PEM(ig,isoil,islope) + alpha_clap_h2o)/tsoil_PEM(ig,isoil,islope)*mmol(igcm_h2o_vap)/(mugaz*r) 436 enddo 437 enddo 431 watersoil_avg(:,nsoil_PCM + 1:nsoil_PEM,islope) = exp(beta_clap_h2o/tsoil_PEM(:,nsoil_PCM + 1:nsoil_PEM,islope) + alpha_clap_h2o)/tsoil_PEM(:,nsoil_PCM + 1:nsoil_PEM,islope)*mmol(igcm_h2o_vap)/(mugaz*r) 438 432 enddo !islope 439 433 write(*,*) 'PEMETAT0: TSOIL done' -
trunk/LMDZ.COMMON/libf/evolution/pemredem.F90
r3591 r3673 99 99 100 100 if (layering_algo) then 101 allocate(stratif_array(ngrid,nslope,nb_str_max, 6))101 allocate(stratif_array(ngrid,nslope,nb_str_max,7)) 102 102 call stratif2array(stratif,ngrid,nslope,stratif_array) 103 103 do islope = 1,nslope … … 108 108 call put_field('stratif_slope'//num//'_h2oice_volfrac','Layering H2O ice volume fraction',stratif_array(:,islope,:,4),Year) 109 109 call put_field('stratif_slope'//num//'_dust_volfrac','Layering dust volume fraction',stratif_array(:,islope,:,5),Year) 110 call put_field('stratif_slope'//num//'_air_volfrac','Layering air volume fraction',stratif_array(:,islope,:,6),Year) 110 call put_field('stratif_slope'//num//'_pore_volfrac','Layering pore volume fraction',stratif_array(:,islope,:,6),Year) 111 call put_field('stratif_slope'//num//'_icepore_volfrac','Layering ice pore volume fraction',stratif_array(:,islope,:,7),Year) 111 112 enddo 112 113 deallocate(stratif_array)
Note: See TracChangeset
for help on using the changeset viewer.