Skip to content

Commit

Permalink
Revert "Merge branch 'matthewp/issue324' into sunt05/issue309"
Browse files Browse the repository at this point in the history
This reverts commit c10bfb8, reversing
changes made to 9dad419.
  • Loading branch information
sunt05 committed Jan 28, 2025
1 parent bee73bb commit 02938ae
Show file tree
Hide file tree
Showing 14 changed files with 120 additions and 380 deletions.
36 changes: 14 additions & 22 deletions .github/workflows/build-publish_to_pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,14 @@ on:
- "src/supy_driver/**"
- ".github/workflows/build-publish_to_pypi.yml"
- "test/**"
- "pyproject.toml"

pull_request:
paths: # PR events containing matching files
- "src/suews/**"
- "src/supy/**"
- "src/supy_driver/**"
- ".github/workflows/build-publish_to_pypi.yml"
- "pyproject.toml"

jobs:
build_wheels:
name: Build wheel for ${{ matrix.python }}-${{ matrix.buildplat[1] }} ${{ matrix.buildplat[2] }}
Expand All @@ -29,31 +28,13 @@ jobs:
- [macos-latest, macosx, arm64]
- [windows-2019, win, AMD64]

python: ["cp39", "cp310", "cp311", "cp312", "cp313"]
# exclude:
# - buildplat: [macos-latest, macosx, arm64]
# python: ["cp38", "cp39"]
python: ["cp310", "cp311", "cp312"]

fail-fast: false

env:
IS_32_BIT: ${{ matrix.buildplat[2] == 'x86' }}
WHEEL_NAME: ${{ matrix.python }}-${{ matrix.buildplat[1] }}-${{ matrix.buildplat[2] }}
CIBW_BUILD: ${{ matrix.python }}-${{ matrix.buildplat[1] }}*
CIBW_ARCHS: ${{ matrix.buildplat[2] }}
CIBW_ENVIRONMENT_PASS_LINUX: RUNNER_OS
CIBW_BEFORE_ALL_MACOS: >
brew install gfortran &&
brew unlink gfortran &&
brew link gfortran
CIBW_BEFORE_BUILD_WINDOWS: "pip install delvewheel" # Use delvewheel on windows
CIBW_REPAIR_WHEEL_COMMAND_WINDOWS: "delvewheel repair -w {dest_dir} {wheel}"
CIBW_TEST_REQUIRES: pytest
CIBW_TEST_COMMAND_MACOS: "python -m pytest '{project}/test'"
CIBW_TEST_COMMAND_LINUX: "python -m pytest '{project}/test'"
CIBW_TEST_COMMAND_WINDOWS: "python -m pytest {project}\\test"
CIBW_TEST_SKIP: "cp310-macosx_arm64" # skip test on arm64 on python 3.10 - cannot pass the water balance test for unknown reason even though it should be the same as x86_64
MACOSX_DEPLOYMENT_TARGET: ${{ matrix.buildplat[0] == 'macos-13' && '13.0' || '14.0' }}

steps:
- uses: actions/checkout@v4
Expand All @@ -66,7 +47,18 @@ jobs:
python-version: 3.12

- name: Build wheels
uses: pypa/[email protected]
uses: pypa/[email protected]
env:
CIBW_BUILD: ${{ matrix.python }}-${{ matrix.buildplat[1] }}*
CIBW_ARCHS: ${{ matrix.buildplat[2] }}
CIBW_ENVIRONMENT_PASS_LINUX: RUNNER_OS
CIBW_BEFORE_ALL_MACOS: "brew install gfortran && brew unlink gfortran && brew link gfortran"
CIBW_BEFORE_BUILD_WINDOWS: "pip install delvewheel" # Use delvewheel on windows
CIBW_REPAIR_WHEEL_COMMAND_WINDOWS: "delvewheel repair -w {dest_dir} {wheel}"
CIBW_TEST_REQUIRES: pytest
CIBW_TEST_COMMAND_MACOS: "python -m pytest '{project}/test'"
CIBW_TEST_COMMAND_LINUX: "python -m pytest '{project}/test'"
CIBW_TEST_COMMAND_WINDOWS: "python -m pytest {project}\\test"

- name: Setup tmate session for debugging
if: failure()
Expand Down
4 changes: 0 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -407,16 +407,12 @@ save-AVL_6_vars273/
AVL_*_vars*
schema/dev/df_state_test.pkl
schema/df_state_test.pkl
schema/dev/df_state_test.pkl
schema/df_state_test.pkl
error_info.md
schema/dev/config-suews-output.yml
schema/dev/convert-yml-df.ipynb
file_list.txt
data_met_raw.pkl
test-quick.py
quick-test.ipynb
data_met_raw.pkl
test-quick.py
df_water*.pkl
quick-test.ipynb
3 changes: 1 addition & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ dependencies = [
"matplotlib",
"chardet",
"scipy",
"pydantic", # for yaml-based config
"pydantic",
"f90wrap==0.2.15", # f90wrap is required for f2py-based supy driver
"dask", # needs dask for parallel tasks
"f90nml", # utility for namelist files
Expand All @@ -46,7 +46,6 @@ classifiers = [
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Intended Audience :: Education",
"Intended Audience :: Science/Research",
"Operating System :: MacOS :: MacOS X",
Expand Down
2 changes: 1 addition & 1 deletion src/suews/src/suews_ctrl_const.f95
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ MODULE allocateArray
ncolumnsDataOutRSL = 30*4 + 5 + 13 + 2, &
ncolumnsDataOutDebug = 1 + 5 + 103 + 14 + 5 + 4 + 3 + 1, &
ncolumnsDataOutSPARTACUS = 5 + 7 + 4*15 + 3 + 6*15 + 2*15 + 4, &
ncolumnsDataOutSTEBBS = 5 + 57
ncolumnsDataOutSTEBBS = 5 + 32

! ---- Define input file headers ---------------------------------------------------------------
CHARACTER(len=20), DIMENSION(ncolumnsSiteSelect) :: HeaderSiteSelect_File !Header for SiteSelect.txt
Expand Down
87 changes: 31 additions & 56 deletions src/suews/src/suews_ctrl_output.f95
Original file line number Diff line number Diff line change
Expand Up @@ -1189,62 +1189,37 @@ MODULE ctrl_output
+ ncolumnsDataOutSTEBBS - 5 &
)/ &
varAttr('ws', 'm s-1', f104, 'Wind speed', aA, 'STEBBS', 0), &
varAttr('Tair_sout', 'degC', f104, 'Air temperature', aA, 'STEBBS', 0), &
varAttr('Tsurf_sout', 'degC', f104, 'Surface temperature', aA, 'STEBBS', 0), &
varAttr('Kroof_sout', 'W m-2', f104, 'Shortwave radiation on roof', aA, 'STEBBS', 0), &
varAttr('Lroof_sout', 'W m-2', f104, 'Longwave radiation on roof', aA, 'STEBBS', 0), &
varAttr('Kwall_sout', 'W m-2', f104, 'Shortwave radiation on wall', aA, 'STEBBS', 0), &
varAttr('Lwall_sout', 'W m-2', f104, 'Longwave radiation on wall', aA, 'STEBBS', 0), &
varAttr('Tair_ind', 'degC', f104, 'Indoor air temperature', aA, 'STEBBS', 0), &
varAttr('Tindoormass', 'degC', f104, 'Indoor mass temperature', aA, 'STEBBS', 0), &
varAttr('Tintwallroof', 'degC', f104, 'Internal wall/roof temperature', aA, 'STEBBS', 0), &
varAttr('Textwallroof', 'degC', f104, 'External wall/roof temperature', aA, 'STEBBS', 0), &
varAttr('Tintwindow', 'degC', f104, 'Internal window temperature', aA, 'STEBBS', 0), &
varAttr('Textwindow', 'degC', f104, 'External window temperature', aA, 'STEBBS', 0), &
varAttr('Tintgrndflr', 'degC', f104, 'Internal ground floor temperature', aA, 'STEBBS', 0), &
varAttr('Textgrndflr', 'degC', f104, 'External ground floor temperature', aA, 'STEBBS', 0), &
varAttr('Qtotal_heat', 'W', f104, 'Total heating', aA, 'STEBBS', 0), &
varAttr('Qtotal_cool', 'W', f104, 'Total cooling', aA, 'STEBBS', 0), &
varAttr('Qsw_trans_win', 'W', f104, 'Shortwave transmitted through window', aA, 'STEBBS', 0), &
varAttr('sw_abs_win', 'W', f104, 'Shortwave absorbed by window', aA, 'STEBBS', 0), &
varAttr('Qsw_abs_wall', 'W', f104, 'Shortwave absorbed by wall/roof', aA, 'STEBBS', 0), &
varAttr('Qconv_indair', 'W', f104, 'Convective heat from indoor air to indoor mass', aA, 'STEBBS', 0), &
varAttr('Qlw_net_intwall', 'W', f104, 'Net longwave from internal wall/roof to other indoor surfaces', aA, 'STEBBS', 0), &
varAttr('lw_net_intwin', 'W', f104, 'Net longwave from internal window to other indoor surfaces', aA, 'STEBBS', 0), &
varAttr('lw_net_intgrnd', 'W', f104, 'Net longwave from internal ground floor to other indoor surfaces', aA, 'STEBBS', 0), &
varAttr('Q_appliance', 'W', f104, 'Appliance heat', aA, 'STEBBS', 0), &
varAttr('Q_ventilation', 'W', f104, 'Ventilation heat', aA, 'STEBBS', 0), &
varAttr('Qconv_indwall', 'W', f104, 'Convective heat from indoor air to internal wall/roof', aA, 'STEBBS', 0), &
varAttr('Qconv_indwin', 'W', f104, 'Convective heat from indoor air to internal window', aA, 'STEBBS', 0), &
varAttr('Qconv_indgrnd', 'W', f104, 'Convective heat from indoor air to internal ground floor', aA, 'STEBBS', 0), &
varAttr('Qloss_eff_heat', 'W', f104, 'Heat loss efficiency', aA, 'STEBBS', 0), &
varAttr('Qcond_wall', 'W', f104, 'Conductive heat through wall/roof', aA, 'STEBBS', 0), &
varAttr('Qcond_window', 'W', f104, 'Conductive heat through window', aA, 'STEBBS', 0), &
varAttr('Qcond_grndflr', 'W', f104, 'Conductive heat through ground floor', aA, 'STEBBS', 0), &
varAttr('Qcond_ground', 'W', f104, 'Conductive heat through ground', aA, 'STEBBS', 0), &
varAttr('Qlw_net_extwall', 'W', f104, 'Net longwave from external wall/roof to outdoor air', aA, 'STEBBS', 0), &
varAttr('Qlw_net_extwin', 'W', f104, 'Net longwave from external window to outdoor air', aA, 'STEBBS', 0), &
varAttr('Qconv_extwall', 'W', f104, 'Convective heat from external wall/roof to outdoor air', aA, 'STEBBS', 0), &
varAttr('Qconv_extwin', 'W', f104, 'Convective heat from external window to outdoor air', aA, 'STEBBS', 0), &
varAttr('q_cooling', 'W', f104, 'Cooling', aA, 'STEBBS', 0), &
varAttr('Qtotal_water', 'W', f104, 'Total water tank heat', aA, 'STEBBS', 0), &
varAttr('Qloss_drain', 'W', f104, 'Drain heat loss', aA, 'STEBBS', 0), &
varAttr('Twater_tank', 'degC', f104, 'Water tank temperature', aA, 'STEBBS', 0), &
varAttr('Tintwall_tank', 'degC', f104, 'Internal wall temperature of tank', aA, 'STEBBS', 0), &
varAttr('Textwall_tank', 'degC', f104, 'External wall temperature of tank', aA, 'STEBBS', 0), &
varAttr('Twater_vessel', 'degC', f104, 'Water vessel temperature', aA, 'STEBBS', 0), &
varAttr('Tintwall_vessel', 'degC', f104, 'Internal wall temperature of vessel', aA, 'STEBBS', 0), &
varAttr('Textwall_vessel', 'degC', f104, 'External wall temperature of vessel', aA, 'STEBBS', 0), &
varAttr('Vwater_vessel', 'm3', f104, 'Volume of water in vessel', aA, 'STEBBS', 0), &
varAttr('Awater_vessel', 'm2', f104, 'Area of water in vessel', aA, 'STEBBS', 0), &
varAttr('Vwall_vessel', 'm3', f104, 'Volume of wall in vessel', aA, 'STEBBS', 0), &
varAttr('qsensible', 'W', f104, 'Sensible heat', aA, 'STEBBS', 0), &
varAttr('qlatent', 'W', f104, 'Latent heat', aA, 'STEBBS', 0), &
varAttr('QS_total', 'W', f104, 'Storage heat flux', aA, 'STEBBS', 0), &
varAttr('QS_fabric', 'W', f104, 'Storage heat flux in fabric', aA, 'STEBBS', 0), &
varAttr('QS_air', 'W', f104, 'Storage heat flux in air', aA, 'STEBBS', 0), &
varAttr('Vwall_tank', 'm3', f104, 'Volume of wall in tank', aA, 'STEBBS', 0), &
varAttr('Vwater_tank', 'm3', f104, 'Volume of water in tank', aA, 'STEBBS', 0) &
varAttr('Tair', 'degC', f104, 'Air temperature', aA, 'STEBBS', 0), &
varAttr('Tsurf', 'degC', f104, 'Surface temperature', aA, 'STEBBS', 0), &
varAttr('Kroof', 'W m-2', f104, 'Downward shortwave radiation', aA, 'STEBBS', 0), &
varAttr('Lroof', 'W m-2', f104, 'Downward longwave radiation', aA, 'STEBBS', 0), &
varAttr('Kwall', 'W m-2', f104, 'Downward shortwave radiation', aA, 'STEBBS', 0), &
varAttr('Lwall', 'W m-2', f104, 'Downward longwave radiation', aA, 'STEBBS', 0), &
varAttr('Qheat_dom', 'W m-2', f104, 'TEMP', aA, 'STEBBS', 0), &
varAttr('Qcool_dom', 'W m-2', f104, 'TEMP', aA, 'STEBBS', 0), &
varAttr('dom_temp', 'degC', f104, 'TEMP', aA, 'STEBBS', 0), &
varAttr('qfb_hw_dom', '', f104, 'TEMP', aA, 'STEBBS', 0), &
varAttr('qfm_dom', '', f104, 'TEMP', aA, 'STEBBS', 0), &
varAttr('qfb_dom_air', '', f104, 'TEMP', aA, 'STEBBS', 0), &
varAttr('Qsw_transmitted_window', '', f104, 'TEMP', aA, 'STEBBS', 0), &
varAttr('Qsw_absorbed_window', '', f104, 'TEMP', aA, 'STEBBS', 0), &
varAttr('Qsw_absorbed_wallroof', '', f104, 'TEMP', aA, 'STEBBS', 0), &
varAttr('Qcond_ground', '', f104, 'TEMP', aA, 'STEBBS', 0), &
varAttr('Qlw_net_extwallroof_to_outair', '', f104, 'TEMP', aA, 'STEBBS', 0), &
varAttr('Qlw_net_extwindow_to_outair', '', f104, 'TEMP', aA, 'STEBBS', 0), &
varAttr('Qconv_extwallroof_to_outair', '', f104, 'TEMP', aA, 'STEBBS', 0), &
varAttr('Qconv_extwindow_to_outair', '', f104, 'TEMP', aA, 'STEBBS', 0), &
varAttr('QStar', 'W m-2', f104, 'Net all-wave radiation', aA, 'STEBBS', 0), &
varAttr('QEC', 'W m-2', f104, 'TEMP', aA, 'STEBBS', 0), &
varAttr('QH', 'W m-2', f104, 'TEMP', aA, 'STEBBS', 0), &
varAttr('QS', 'W m-2', f104, '(TEMP)', aA, 'STEBBS', 0), &
varAttr('QBAE', 'W m-2', f104, '(TEMP)', aA, 'STEBBS', 0), &
varAttr('QWaste', 'W m-2', f104, 'TEMP', aA, 'STEBBS', 0), &
varAttr('Textwallroof', '', f104, 'TEMP', aA, 'STEBBS', 0), &
varAttr('Tintwallroof', '', f104, 'TEMP', aA, 'STEBBS', 0), &
varAttr('Textwindow', '', f104, 'TEMP', aA, 'STEBBS', 0), &
varAttr('Tintwindow', '', f104, 'TEMP', aA, 'STEBBS', 0), &
varAttr('Tair_ind', '', f104, 'TEMP', aA, 'STEBBS', 0) &
/

CONTAINS
Expand Down
2 changes: 1 addition & 1 deletion src/suews/src/suews_phys_atmmoiststab.f95
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
MODULE AtmMoistStab_module
USE SUEWS_DEF_DTS, ONLY: atm_state, SUEWS_FORCING, SUEWS_TIMER, SUEWS_STATE
IMPLICIT NONE
REAL(KIND(1D0)), PARAMETER :: neut_limit = 1.E-2 !Limit for neutral stability
REAL(KIND(1D0)), PARAMETER :: neut_limit = 1.E-4 !Limit for neutral stability
REAL(KIND(1D0)), PARAMETER :: k = 0.4 !Von Karman's contant
REAL(KIND(1D0)), PARAMETER :: grav = 9.80665 !g - gravity - physics today august 1987

Expand Down
6 changes: 4 additions & 2 deletions src/suews/src/suews_phys_rslprof.f95
Original file line number Diff line number Diff line change
Expand Up @@ -1062,9 +1062,11 @@ SUBROUTINE RSLProfile( &
! Step 0: Calculate grid-cell dependent constants and Beta (crucial for H&F method)
CALL RSL_cal_prms( &
StabilityMethod, & !input
nz_above, zarray(nz_can + 1:nz), & !input
!nz_above, zarray(nz_can + 1:nz), & !input
nz_above + 1, zarray(nz_can:nz), & !input
zh, L_MOD, sfr_surf, FAI, PAI, & !input
psihatm_z(nz_can + 1:nz), psihath_z(nz_can + 1:nz), & !output
!psihatm_z(nz_can + 1:nz), psihath_z(nz_can + 1:nz), & !output
psihatm_z(nz_can:nz), psihath_z(nz_can:nz), & !output
zH_RSL, L_MOD_RSL, & ! output
Lc, beta, zd_RSL, z0_RSL, elm, Scc, fx)

Expand Down
Loading

0 comments on commit 02938ae

Please sign in to comment.