Skip to content

Commit 69c4425

Browse files
skfoggemorway-usgs
authored andcommitted
meson swr (#14)
1 parent 8e1f2cd commit 69c4425

File tree

2 files changed

+34
-33
lines changed

2 files changed

+34
-33
lines changed

src/Model/GroundWaterEnergy/gwe-swr.f90

Lines changed: 33 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
!! can be invoked from the NPF package. Once this package is completed in its
77
!! prototyped form, it will likely be moved around.
88
!<
9-
9+
1010
module ShortwaveModule
1111
use ConstantsModule, only: LINELENGTH, LENMEMPATH, DZERO, LENVARNAME
1212
use KindModule, only: I4B, DP
@@ -26,23 +26,23 @@ module ShortwaveModule
2626
character(len=16) :: text = ' SWR'
2727

2828
type, extends(PbstBaseType) :: SwrType
29-
29+
3030
real(DP), dimension(:), pointer, contiguous :: solr => null() !< solar radiation
3131
real(DP), dimension(:), pointer, contiguous :: shd => null() !< shade fraction
3232
real(DP), dimension(:), pointer, contiguous :: swrefl => null() !< shortwave reflectance of water surface
33-
33+
3434
contains
35-
35+
3636
procedure :: da => swr_da
3737
procedure :: read_option => swr_read_option
3838
!procedure :: pbst_options => swr_options
3939
procedure :: subpck_set_stressperiod => swr_set_stressperiod
4040
procedure :: pbst_allocate_arrays => swr_allocate_arrays
4141
!procedure, private :: swr_allocate_scalars
4242
procedure, public :: swr_cq
43-
43+
4444
end type SwrType
45-
45+
4646
contains
4747

4848
!> @brief Create a new SwrType object
@@ -65,28 +65,28 @@ subroutine swr_cr(swr, name_model, inunit, iout, ncv)
6565
! -- allocate scalars
6666
!call swr%swr_allocate_scalars()
6767
end subroutine swr_cr
68-
68+
6969
!> @brief Allocate scalars specific to the streamflow energy transport (SFE)
7070
!! package.
7171
!! NO SCALARS IN THIS YET
7272
!<
7373
!subroutine swr_allocate_scalars(this)
74-
! -- modules
75-
!use MemoryManagerModule, only: mem_allocate
76-
! -- dummy
77-
!class(SwrType) :: this
78-
!
79-
! -- allocate
80-
!call mem_allocate(this%solr, 'SOLR', this%memoryPath)
81-
!call mem_allocate(this%shd, 'SHD', this%memoryPath)
82-
!call mem_allocate(this%swrefl, 'SWREFL', this%memoryPath)
83-
!
84-
! -- initialize to default values
85-
!this%solr = 600 ! W/m3
86-
!this%shd = 0.25 ! dimensionless fraction
87-
!this%swrefl = 0.03 ! dimensionless fraction
74+
! -- modules
75+
!use MemoryManagerModule, only: mem_allocate
76+
! -- dummy
77+
!class(SwrType) :: this
78+
!
79+
! -- allocate
80+
!call mem_allocate(this%solr, 'SOLR', this%memoryPath)
81+
!call mem_allocate(this%shd, 'SHD', this%memoryPath)
82+
!call mem_allocate(this%swrefl, 'SWREFL', this%memoryPath)
83+
!
84+
! -- initialize to default values
85+
!this%solr = 600 ! W/m3
86+
!this%shd = 0.25 ! dimensionless fraction
87+
!this%swrefl = 0.03 ! dimensionless fraction
8888
!end subroutine swr_allocate_scalars
89-
89+
9090
!> @brief Allocate arrays specific to the sensible heat flux (SWR) package
9191
!<
9292
subroutine swr_allocate_arrays(this)
@@ -109,18 +109,18 @@ subroutine swr_allocate_arrays(this)
109109
this%swrefl(n) = DZERO
110110
end do
111111
end subroutine
112-
112+
113113
!> @brief Set options specific to the SwrType
114114
!!
115115
! NOT USED RIGHT NOW BECAUSE NO CONSTANTS
116116
!! This routine overrides PbstBaseType%bnd_options
117117
!<
118118
!subroutine swr_options(this, option, found)
119-
! -- dummy
119+
! -- dummy
120120
! class(SwrType), intent(inout) :: this
121121
! character(len=*), intent(inout) :: option
122122
! logical, intent(inout) :: found
123-
!
123+
!
124124
! found = .true.
125125
! select case (option)
126126
! case ('DENSITY_AIR')
@@ -161,7 +161,7 @@ subroutine swr_allocate_arrays(this)
161161
! call store_error(errmsg)
162162
! call this%parser%StoreErrorUnit()
163163
! end select
164-
! end subroutine swr_options
164+
! end subroutine swr_options
165165

166166
!> @brief Calculate Shortwave Radiation Heat Flux
167167
!!
@@ -177,9 +177,9 @@ subroutine swr_cq(this, ifno, swrflx)
177177
!real(DP) :: swr_const
178178
!
179179
! -- calculate shortwave radiation heat flux (version: user input of sol rad data)
180-
swrflx = (1 - this%shd(ifno)) * (1 - this%swrefl(ifno)) * this%solr(ifno)
180+
swrflx = (1-this%shd(ifno)) * (1-this%swrefl(ifno)) * this%solr(ifno)
181181
end subroutine swr_cq
182-
182+
183183
!> @brief Deallocate package memory
184184
!!
185185
!! Deallocate TVK package scalars and arrays.
@@ -203,7 +203,7 @@ subroutine swr_da(this)
203203
! -- Deallocate parent
204204
call pbstbase_da(this)
205205
end subroutine swr_da
206-
206+
207207
!> @brief Read a SWR-specific option from the OPTIONS block
208208
!!
209209
!! Process a single SWR-specific option. Used when reading the OPTIONS block
@@ -219,7 +219,7 @@ function swr_read_option(this, keyword) result(success)
219219
! -- There are no SWR-specific options, so just return false
220220
success = .false.
221221
end function swr_read_option
222-
222+
223223
!> @brief Set the stress period attributes based on the keyword
224224
!<
225225
subroutine swr_set_stressperiod(this, itemno, keyword, found)
@@ -274,7 +274,7 @@ subroutine swr_set_stressperiod(this, itemno, keyword, found)
274274
bndElem => this%solr(itemno)
275275
call read_value_or_time_series_adv(text, itemno, jj, bndElem, &
276276
this%packName, 'BND', this%tsManager, &
277-
this%iprpak, 'SOLR')
277+
this%iprpak, 'SOLR')
278278
case default
279279
!
280280
! -- Keyword not recognized so return to caller with found = .false.
@@ -283,5 +283,5 @@ subroutine swr_set_stressperiod(this, itemno, keyword, found)
283283
!
284284
999 continue
285285
end subroutine swr_set_stressperiod
286-
287-
end module ShortwaveModule
286+
287+
end module ShortwaveModule

src/meson.build

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,7 @@ modflow_sources = files(
173173
'Model' / 'GroundWaterEnergy' / 'gwe-mwe.f90',
174174
'Model' / 'GroundWaterEnergy' / 'gwe-sfe.f90',
175175
'Model' / 'GroundWaterEnergy' / 'gwe-shf.f90',
176+
'Model' / 'GroundWaterEnergy' / 'gwe-swr.f90',
176177
'Model' / 'GroundWaterEnergy' / 'gwe-uze.f90',
177178
'Model' / 'GroundWaterEnergy' / 'PbstBase.f90',
178179
'Model' / 'GroundWaterFlow' / 'gwf.f90',

0 commit comments

Comments
 (0)