def parameterization(aerosols, V, T0, S0, P0): """Run the provided parameterization of the Ghan parcel model. """ na, sig, rhodry, hygro, rad = _unpack_aerosols(aerosols) ## Convert units P0 = P0/100. # Pa -> hPa V = V*100. # m/s -> cm/s ## Call Ghan model code explicit = False fn, smax = ghan_model(T0, P0, V, explicit, na, sig, rhodry, hygro, rad) return fn, smax
def explicit(aerosols, V, T0, S0, P0): """Run Steve Ghan's explicit parcel model. """ na, sig, rhodry, hygro, rad = _unpack_aerosols(aerosols) ## Convert units P0 = P0/100. # Pa -> hPa V = V*100. # m/s -> cm/s ## Call Ghan model code explicit = True fn, smax = ghan_model(T0, P0, V, explicit, na, sig, rhodry, hygro, rad) ## TODO: It would be nice to spit out a trace of the Ghan model vertical profile, ## but this is hard. Could either re-write part of subgrid_mod.f90 (NO), or try to ## read the output file "fort.100". Problem with the latter is that the file doesn't ## finalize until after Python has exited. return fn, smax