velocity = False else: dt = dt_main velocity = True # print current time in simulation to command line print("+++ t = " + str(round(t / day, 2)) + " days +++") print('T: ', round(temperature_world.max() - 273.15, 1), ' - ', round(temperature_world.min() - 273.15, 1), ' C') print('U: ', round(u.max(), 2), ' - ', round(u.min(), 2), ' V: ', round(v.max(), 2), ' - ', round(v.min(), 2), ' W: ', round(w.max(), 2), ' - ', round(w.min(), 2)) # before_radiation = time.time() temperature_world, temperature_atmos = top_level.radiation_calculation( temperature_world, temperature_atmos, air_pressure, air_density, heat_capacity_earth, albedo, insolation, lat, lon, heights, dz, t, dt, day, year, axial_tilt) temperature_atmos = top_level.smoothing_3D(temperature_atmos, smoothing_parameter_t) # time_taken = float(round(time.time() - before_radiation,3)) # print('Radiation: ',str(time_taken),'s') # update air pressure old_pressure = np.copy(air_pressure) air_pressure = air_density * specific_gas * temperature_atmos if velocity: before_velocity = time.time() u, v, w = top_level.velocity_calculation(u, v, air_pressure, old_pressure, air_density,
velocity = False else: dt = dt_main velocity = True # print current time in simulation to command line print("+++ t = " + str(round(t / day, 2)) + " days +++") print('T: ', round(temperature_world.max() - 273.15, 1), ' - ', round(temperature_world.min() - 273.15, 1), ' C') print('U: ', round(u.max(), 2), ' - ', round(u.min(), 2), ' V: ', round(v.max(), 2), ' - ', round(v.min(), 2), ' W: ', round(w.max(), 2), ' - ', round(w.min(), 4)) before_radiation = time.time() temperature_world, potential_temperature = top_level.radiation_calculation( temperature_world, potential_temperature, pressure_levels, heat_capacity_earth, albedo, insolation, lat, lon, t, dt, day, year, axial_tilt) potential_temperature = top_level.smoothing_3D(potential_temperature, smoothing_parameter_t) time_taken = float(round(time.time() - before_radiation, 3)) print('Radiation: ', str(time_taken), 's') # update geopotential field for k in np.arange(1, nlevels): geopotential[:, :, k] = geopotential[:, :, k - 1] - potential_temperature[:, :, k] * ( sigma[k] - sigma[k - 1]) if velocity: