-
Notifications
You must be signed in to change notification settings - Fork 19
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 unnecessary transfer of variable values in call to solve_noahowp_grid #82
Changes from 17 commits
d3e4f80
0b8d74b
ba93adb
5c7f60f
8dc5a99
0083bd1
594a39d
a2b0831
e1910ec
fdccb17
df81139
55b9b7b
62d3135
95f8cec
a251dab
e3654d1
5641a70
4ac6201
7f29ff4
ee47505
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Removing transfer of variables that are now transferred in newly added |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,25 +16,11 @@ subroutine DomainVarInTransfer(domain, domaingrid, ix, iy) | |
integer, intent(in) :: ix | ||
integer, intent(in) :: iy | ||
|
||
domain%DT = domaingrid%DT | ||
domain%ix = ix | ||
domain%iy = iy | ||
domain%dx = domaingrid%dx | ||
domain%dy = domaingrid%dy | ||
domain%n_x = domaingrid%n_x | ||
domain%n_y = domaingrid%n_y | ||
domain%startdate = domaingrid%startdate | ||
domain%enddate = domaingrid%enddate | ||
domain%nowdate = domaingrid%nowdate | ||
domain%start_datetime = domaingrid%start_datetime | ||
domain%end_datetime = domaingrid%end_datetime | ||
domain%curr_datetime = domaingrid%sim_datetimes(domaingrid%itime) | ||
domain%itime = domaingrid%itime | ||
domain%ntime = domaingrid%ntime | ||
domain%time_dbl = domaingrid%time_dbl | ||
domain%lat = domaingrid%lat(ix,iy) | ||
domain%lon = domaingrid%lon(ix,iy) | ||
domain%ZREF = domaingrid%ZREF | ||
domain%lon = domaingrid%lon(ix,iy) | ||
domain%terrain_slope = domaingrid%terrain_slope(ix,iy) | ||
domain%azimuth = domaingrid%azimuth(ix,iy) | ||
domain%vegtyp = domaingrid%vegtyp(ix,iy) | ||
|
@@ -60,7 +46,7 @@ subroutine DomainVarOutTransfer(domain, domaingrid, ix, iy) | |
domaingrid%zsoil(ix,iy,:) = domain%zsoil(:) | ||
domaingrid%dzsnso(ix,iy,:) = domain%dzsnso(:) | ||
domaingrid%zsnso(ix,iy,:) = domain%zsnso(:) | ||
domaingrid%nowdate = domain%nowdate !this needs to be kept here until nowdate is updated in domaingriddedDriverModule | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Removing obsolete comment |
||
domaingrid%nowdate = domain%nowdate | ||
|
||
end subroutine DomainVarOutTransfer | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,8 @@ | ||
module EnergyType | ||
|
||
use NamelistRead, only: namelist_type | ||
|
||
use NamelistRead, only: namelist_type | ||
use EnergyGridType, only: energygrid_type | ||
|
||
implicit none | ||
save | ||
private | ||
|
@@ -361,11 +362,13 @@ subroutine InitDefault(this) | |
|
||
end subroutine InitDefault | ||
|
||
subroutine InitTransfer(this, namelist) | ||
subroutine InitTransfer(this, energygrid) | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
class(energy_type) :: this | ||
type(namelist_type) :: namelist | ||
class(energy_type), intent(inout) :: this | ||
type(energygrid_type), intent(in) :: energygrid | ||
|
||
!Nothing to do | ||
|
||
end subroutine InitTransfer | ||
|
||
end module EnergyType |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,7 @@ | ||
module ForcingType | ||
|
||
use NamelistRead, only: namelist_type | ||
use ForcingGridType, only: forcinggrid_type | ||
implicit none | ||
save | ||
private | ||
|
@@ -47,14 +49,16 @@ module ForcingType | |
procedure, public :: Init | ||
procedure, private :: InitAllocate | ||
procedure, private :: InitDefault | ||
procedure, public :: InitTransfer | ||
|
||
end type forcing_type | ||
|
||
contains | ||
|
||
subroutine Init(this) | ||
subroutine Init(this,namelist) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Make |
||
|
||
class(forcing_type) :: this | ||
class(forcing_type), intent(inout) :: this | ||
type(namelist_type), intent(in) :: namelist | ||
|
||
call this%InitAllocate() | ||
call this%InitDefault() | ||
|
@@ -63,7 +67,7 @@ end subroutine Init | |
|
||
subroutine InitAllocate(this) | ||
|
||
class(forcing_type) :: this | ||
class(forcing_type), intent(inout) :: this | ||
|
||
if(.NOT.allocated(this%SOLAD)) allocate(this%SOLAD (2)) | ||
if(.NOT.allocated(this%SOLAI)) allocate(this%SOLAI (2)) | ||
|
@@ -72,7 +76,7 @@ end subroutine InitAllocate | |
|
||
subroutine InitDefault(this) | ||
|
||
class(forcing_type) :: this | ||
class(forcing_type), intent(inout) :: this | ||
|
||
this%SFCPRS = huge(1.0) | ||
this%SFCPRS = huge(1.0) | ||
|
@@ -119,4 +123,14 @@ subroutine InitDefault(this) | |
|
||
end subroutine InitDefault | ||
|
||
subroutine InitTransfer(this,forcinggrid) | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
class(forcing_type), intent(inout) :: this | ||
type(forcinggrid_type), intent(in) :: forcinggrid | ||
|
||
this%JULIAN = forcinggrid%JULIAN | ||
this%YEARLEN = forcinggrid%YEARLEN | ||
|
||
end subroutine InitTransfer | ||
|
||
end module ForcingType |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -41,8 +41,6 @@ subroutine ForcingVarInTransfer(forcing, forcinggrid, ix, iy) | |
forcing%RHOAIR = forcinggrid%RHOAIR(ix,iy) | ||
forcing%FPICE = forcinggrid%FPICE(ix,iy) | ||
forcing%SWDOWN = forcinggrid%SWDOWN(ix,iy) | ||
forcing%JULIAN = forcinggrid%JULIAN | ||
forcing%YEARLEN = forcinggrid%YEARLEN | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Transfer-in for these variables has been moved to |
||
forcing%SOLAD(:) = forcinggrid%SOLAD(ix,iy,:) | ||
forcing%SOLAI(:) = forcinggrid%SOLAI(ix,iy,:) | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,7 @@ | ||
module LevelsType | ||
|
||
use NamelistRead, only: namelist_type | ||
use LevelsGridType, only: levelsgrid_type | ||
implicit none | ||
save | ||
private | ||
|
@@ -13,15 +15,17 @@ module LevelsType | |
contains | ||
|
||
procedure, public :: Init | ||
procedure, private :: InitDefault | ||
procedure, private :: InitDefault | ||
procedure, public :: InitTransfer | ||
|
||
end type levels_type | ||
|
||
contains | ||
|
||
subroutine Init(this) | ||
subroutine Init(this,namelist) | ||
|
||
class(levels_type) :: this | ||
class(levels_type), intent(inout) :: this | ||
type(namelist_type), intent(in) :: namelist | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Making |
||
|
||
call this%InitDefault() | ||
|
||
|
@@ -37,4 +41,15 @@ subroutine InitDefault(this) | |
|
||
end subroutine InitDefault | ||
|
||
subroutine InitTransfer(this,levelsgrid) | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Re-adding |
||
class(levels_type) :: this | ||
type(levelsgrid_type) :: levelsgrid | ||
|
||
this%nsoil = levelsgrid%nsoil | ||
this%nsnow = levelsgrid%nsnow | ||
this%nveg = levelsgrid%nveg | ||
|
||
end subroutine InitTransfer | ||
|
||
end module LevelsType |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,9 +16,7 @@ subroutine LevelsVarInTransfer(levels, levelsgrid, ix, iy) | |
integer, intent(in) :: ix | ||
integer, intent(in) :: iy | ||
|
||
levels%nsoil = levelsgrid%nsoil | ||
levels%nsnow = levelsgrid%nsnow | ||
levels%nveg = levelsgrid%nveg | ||
! Nothing to do | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. These variables do not have spatial indices as defined in |
||
end subroutine LevelsVarInTransfer | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,7 @@ | ||
module OptionsType | ||
|
||
use NamelistRead, only: namelist_type | ||
use OptionsGridType, only: optionsgrid_type | ||
implicit none | ||
save | ||
private | ||
|
@@ -107,23 +109,25 @@ module OptionsType | |
contains | ||
|
||
procedure, public :: Init | ||
procedure, private :: InitDefault | ||
procedure, private :: InitDefault | ||
procedure, public :: InitTransfer | ||
|
||
end type options_type | ||
|
||
contains | ||
|
||
subroutine Init(this) | ||
subroutine Init(this,namelist) | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Make |
||
class(options_type), intent(out) :: this | ||
class(options_type), intent(inout) :: this | ||
type(namelist_type), intent(in) :: namelist | ||
|
||
call this%InitDefault() | ||
|
||
end subroutine Init | ||
|
||
subroutine InitDefault(this) | ||
|
||
class(options_type), intent(out) :: this | ||
class(options_type), intent(inout) :: this | ||
|
||
this%opt_snf = huge(1) | ||
this%opt_run = huge(1) | ||
|
@@ -145,4 +149,29 @@ subroutine InitDefault(this) | |
|
||
end subroutine InitDefault | ||
|
||
subroutine InitTransfer(this,optionsgrid) | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Re-adding |
||
class(options_type), intent(inout) :: this | ||
type(optionsgrid_type), intent(in) :: optionsgrid | ||
|
||
this%opt_snf = optionsgrid%opt_snf | ||
this%opt_run = optionsgrid%opt_run | ||
this%opt_drn = optionsgrid%opt_drn | ||
this%opt_inf = optionsgrid%opt_inf | ||
this%opt_infdv = optionsgrid%opt_infdv | ||
this%dveg = optionsgrid%dveg | ||
this%opt_alb = optionsgrid%opt_alb | ||
this%opt_rad = optionsgrid%opt_rad | ||
this%opt_sfc = optionsgrid%opt_sfc | ||
this%opt_crs = optionsgrid%opt_crs | ||
this%opt_crop = optionsgrid%opt_crop | ||
this%opt_stc = optionsgrid%opt_stc | ||
this%opt_tbot = optionsgrid%opt_tbot | ||
this%opt_frz = optionsgrid%opt_frz | ||
this%opt_btr = optionsgrid%opt_btr | ||
this%opt_rsf = optionsgrid%opt_rsf | ||
this%opt_sub = optionsgrid%opt_sub | ||
|
||
end subroutine InitTransfer | ||
|
||
end module OptionsType |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,39 +7,27 @@ module OptionsTypeTransfer | |
|
||
contains | ||
|
||
subroutine OptionsVarInTransfer(options, optionsgrid) | ||
subroutine OptionsVarInTransfer(options, optionsgrid, ix, iy) | ||
|
||
implicit none | ||
|
||
type(options_type), intent(inout) :: options | ||
type(optionsgrid_type), intent(in) :: optionsgrid | ||
integer, intent(in) :: ix | ||
integer, intent(in) :: iy | ||
|
||
options%opt_snf = optionsgrid%opt_snf | ||
options%opt_run = optionsgrid%opt_run | ||
options%opt_drn = optionsgrid%opt_drn | ||
options%opt_inf = optionsgrid%opt_inf | ||
options%opt_infdv = optionsgrid%opt_infdv | ||
options%dveg = optionsgrid%dveg | ||
options%opt_alb = optionsgrid%opt_alb | ||
options%opt_rad = optionsgrid%opt_rad | ||
options%opt_sfc = optionsgrid%opt_sfc | ||
options%opt_crs = optionsgrid%opt_crs | ||
options%opt_crop = optionsgrid%opt_crop | ||
options%opt_stc = optionsgrid%opt_stc | ||
options%opt_tbot = optionsgrid%opt_tbot | ||
options%opt_frz = optionsgrid%opt_frz | ||
options%opt_btr = optionsgrid%opt_btr | ||
options%opt_rsf = optionsgrid%opt_rsf | ||
options%opt_sub = optionsgrid%opt_sub | ||
! Nothing to do | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. These variables are now transferred using |
||
end subroutine OptionsVarInTransfer | ||
|
||
subroutine OptionsVarOutTransfer(options, optionsgrid) | ||
subroutine OptionsVarOutTransfer(options, optionsgrid, ix, iy) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Adding |
||
|
||
implicit none | ||
|
||
type(options_type), intent(in) :: options | ||
type(optionsgrid_type), intent(inout) :: optionsgrid | ||
integer, intent(in) :: ix | ||
integer, intent(in) :: iy | ||
|
||
! Nothing to do | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
domain_type%InitTransfer
was re-added todomain_type
to transfer values for variables without spatial indices from argument instance ofdomaingrid_type
tothis
instance ofdomain_type
.