Changeset 3673 for trunk/LMDZ.COMMON/libf/evolution/deftank
- Timestamp:
- Mar 7, 2025, 10:01:32 AM (4 months ago)
- Location:
- trunk/LMDZ.COMMON/libf/evolution/deftank
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
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
Note: See TracChangeset
for help on using the changeset viewer.