From 1a30d45ed6e626112c17daf92a37ce5cb64cfd3a Mon Sep 17 00:00:00 2001 From: Peter Kalverla Date: Tue, 17 Sep 2024 14:29:01 +0200 Subject: [PATCH 1/3] Remove all terms with wf, M, and wqM. Also remove wf property --- packages/class/src/class.ts | 29 ++++------------------------- 1 file changed, 4 insertions(+), 25 deletions(-) diff --git a/packages/class/src/class.ts b/packages/class/src/class.ts index 5b0f6b3..8292372 100644 --- a/packages/class/src/class.ts +++ b/packages/class/src/class.ts @@ -4,13 +4,6 @@ import type { ClassConfig } from "./config"; const rho = 1.2; /** Density of air [kg m-3] */ const cp = 1005.0; /** Specific heat of dry air [J kg-1 K-1] */ -// More constants that were stored as model props -// TODO: should these be settable via config? Or dynamically calculated? ??? -// const ac = 0.0; /** Cloud core fraction [-] */ // unused -const M = 0.0; /** Cloud core mass flux [m s-1] */ -const wqM = 0.0; /** Cloud core moisture flux [kg kg-1 m s-1] */ -// const wCO2M = 0; /** CO2 mass flux [ppm m s-1] */ // unused - /** * CLASS model definition * @property _cfg: object containing the model settings @@ -58,7 +51,7 @@ export class CLASS { /** Tendency of CLB [m s-1]*/ get htend(): number { - return this.we + this.ws + this.wf - M; + return this.we + this.ws; } /** Tendency of mixed-layer potential temperature [K s-1] */ @@ -72,29 +65,20 @@ export class CLASS { /** Tendency of potential temperature jump at h [K s-1] */ get dthetatend(): number { const w_th_ft = 0.0; // TODO: add free troposphere switch - return ( - this._cfg.mixedLayer.gammatheta * (this.we + this.wf - M) - - this.thetatend + - w_th_ft - ); + return this._cfg.mixedLayer.gammatheta - this.thetatend + w_th_ft; } /** Tendency of mixed-layer specific humidity [kg kg-1 s-1] */ get qtend(): number { return ( - (this._cfg.mixedLayer.wq - this.wqe - wqM) / this.h + - this._cfg.mixedLayer.advq + (this._cfg.mixedLayer.wq - this.wqe) / this.h + this._cfg.mixedLayer.advq ); } /** Tendency of specific humidity jump at h[kg kg-1 s-1] */ get dqtend(): number { const w_q_ft = 0; // TODO: add free troposphere switch - return ( - this._cfg.mixedLayer.gammaq * (this.we + this.wf - M) - - this.qtend + - w_q_ft - ); + return this._cfg.mixedLayer.gammaq - this.qtend + w_q_ft; } /** Entrainment velocity [m s-1]. */ @@ -114,11 +98,6 @@ export class CLASS { return -this._cfg.mixedLayer.divU * this.h; } - /** Mixed-layer growth due to radiative divergence [m s-1]. */ - get wf(): number { - return this._cfg.radiation.dFz / (rho * cp * this.dtheta); - } - /** Entrainment kinematic heat flux [K m s-1]. */ get wthetae(): number { return -this.we * this.dtheta; From f416d2aee0f1377b5e179b8252d57a33a3b54b3c Mon Sep 17 00:00:00 2001 From: Peter Kalverla Date: Mon, 23 Sep 2024 10:30:40 +0200 Subject: [PATCH 2/3] Also remove config related to wf --- packages/class/src/config.ts | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/packages/class/src/config.ts b/packages/class/src/config.ts index 8781fd2..8efda57 100644 --- a/packages/class/src/config.ts +++ b/packages/class/src/config.ts @@ -75,24 +75,14 @@ const mixedLayer = z }) .describe("Mixed layer"); -const radiation = z - .object({ - dFz: z.coerce - .number() - .default(0) - .describe("Cloud top radiative divergence [W m-2]"), - }) - .describe("Radiation"); - export const classConfig = z.object({ initialState: initialState.default({}), timeControl: timeControl.default({}), mixedLayer: mixedLayer.default({}), - radiation: radiation.default({}), }); export type ClassConfig = z.infer; export const classDefaultConfigSchema = zodToJsonSchema( classConfig, - "classConfig", + "classConfig" ); From 7524c2378e152597a897f75ba13de154d46d2ba2 Mon Sep 17 00:00:00 2001 From: Peter Kalverla Date: Mon, 23 Sep 2024 10:31:54 +0200 Subject: [PATCH 3/3] formatting --- packages/class/src/config.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/class/src/config.ts b/packages/class/src/config.ts index 8efda57..c578176 100644 --- a/packages/class/src/config.ts +++ b/packages/class/src/config.ts @@ -84,5 +84,5 @@ export const classConfig = z.object({ export type ClassConfig = z.infer; export const classDefaultConfigSchema = zodToJsonSchema( classConfig, - "classConfig" + "classConfig", );