Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove initialisation of microclimate variables from hydrology setup #522

Closed
vgro opened this issue Jul 16, 2024 · 1 comment
Closed

remove initialisation of microclimate variables from hydrology setup #522

vgro opened this issue Jul 16, 2024 · 1 comment
Assignees

Comments

@vgro
Copy link
Collaborator

vgro commented Jul 16, 2024

Is your feature request related to a problem? Please describe.
The hydrology model currently initialized microclimatic variables for the first update. This is not needed as the variables will be initialized by the abiotic model and this should come first. The only variable that needs initializing is the wind_speed if the abiotic_simple model is used.

Describe the solution you'd like
Replace this:

        # Create subcanopy microclimate from reference height
        # TODO this needs to be removed when variable system is up and running; only
        # wind speed needs to be initialised when abiotic simple is used, see below
        # TODO currently surface layer, needs to be replaced with 2m above ground
        for var in [
            "air_temperature",
            "relative_humidity",
            "wind_speed",
            "atmospheric_pressure",
        ]:
            self.data[var] = (
                DataArray(self.data[var + "_ref"].isel(time_index=0))
                .expand_dims("layers")
                .rename(var)
                .assign_coords(
                    coords={
                        "layers": np.array([self.surface_layer_index]),
                        "layer_roles": ("layers", ["surface"]),
                        "cell_id": self.grid.cell_id,
                    },
                )
            )

with this:

        # THIS IS THE ALTERNATIVE:
        # If wind speed is not in data, which is the case if the abiotic_simple model is
        # used, create subcanopy microclimate from reference height
        # TODO currently surface layer, needs to be replaced with 2m above ground
        # if "wind_speed" not in self.data:
        #     self.data["wind_speed"] = self.layer_structure.from_template()
        #     self.data["wind_speed"][self.surface_layer_index] = self.data[
        #         "wind_speed_ref"
        #     ].isel(time_index=0)
@vgro
Copy link
Collaborator Author

vgro commented Aug 9, 2024

this becomes irrelevant with #528

@vgro vgro closed this as completed Aug 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant