Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions src/bmi_pet.c
Original file line number Diff line number Diff line change
Expand Up @@ -791,6 +791,14 @@ int read_init_config_pet(pet_model* model, const char* config_file)//,

} // end loop through config
fclose(fp);

// Validate parameters here if needed
if (model->pet_params.zero_plane_displacement_height_m <= 0.0){
// if displacement height is 0 (or less for some unknown reason...)
// set to small value to avoid division by zero in wind profile equation
model->pet_params.zero_plane_displacement_height_m = 0.01;
}

return BMI_SUCCESS;
} // end: read_init_config

Expand Down