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

Fix Fortran unit tests #1378

Merged
merged 2 commits into from
Apr 19, 2017
Merged
Show file tree
Hide file tree
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
1 change: 1 addition & 0 deletions src/drivers/mct/unit_test/stubs/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
list(APPEND drv_sources
seq_timemgr_mod.F90
vertical_gradient_calculator_constant.F90
)

Expand Down
19 changes: 19 additions & 0 deletions src/drivers/mct/unit_test/stubs/seq_timemgr_mod.F90
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
module seq_timemgr_mod

! Stub for routines from seq_timemgr_mod that are needed by other modules built by the
! unit tests.

implicit none
private

public :: seq_timemgr_pause_active

contains

logical function seq_timemgr_pause_active()
! Stub for seq_timemgr_pause_active - always returns .false.

seq_timemgr_pause_active = .false.
end function seq_timemgr_pause_active

end module seq_timemgr_mod
15 changes: 14 additions & 1 deletion src/share/unit_test_stubs/pio/pio.F90.in
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,9 @@ module pio
integer,parameter,public :: PIO_rearr_comm_fc_1d_io2comp = 2
integer,parameter,public :: PIO_rearr_comm_fc_2d_disable = 3
integer, public, parameter :: PIO_REARR_COMM_UNLIMITED_PEND_REQ = -1
integer, public, parameter :: PIO_NOERR=0


public :: PIO_set_rearr_opts
public :: PIO_def_dim
public :: PIO_enddef
public :: PIO_FILE_IS_OPEN
Expand Down Expand Up @@ -273,6 +274,18 @@ contains
type (io_desc_t) :: iodesc
end subroutine freedecomp_file

integer function PIO_set_rearr_opts(iosystem, comm_type, fcd,&
enable_hs_c2i, enable_isend_c2i,&
max_pend_req_c2i,&
enable_hs_i2c, enable_isend_i2c,&
max_pend_req_i2c) result(ierr)
type (iosystem_desc_t), intent(inout) :: iosystem
integer, intent(in) :: comm_type, fcd
logical, intent(in) :: enable_hs_c2i, enable_hs_i2c
logical, intent(in) :: enable_isend_c2i, enable_isend_i2c
integer, intent(in) :: max_pend_req_c2i, max_pend_req_i2c
end function PIO_set_rearr_opts

integer function get_att_desc_{TYPE} (File,varDesc,name,value) result(ierr)
type (File_desc_t), intent(inout) , target :: File
type (VAR_desc_t), intent(in) :: varDesc
Expand Down
13 changes: 13 additions & 0 deletions src/share/util/shr_pio_mod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -428,6 +428,19 @@ subroutine shr_pio_read_default_namelist(nlfilename, Comm, pio_stride, pio_root,
pio_async_interface = .false. ! pio tasks are a subset of component tasks
pio_rearranger = PIO_REARR_SUBSET

pio_rearr_comm_type = 'p2p'
pio_rearr_comm_fcd = '2denable'
pio_rearr_comm_max_pend_req_comp2io = 0
pio_rearr_comm_enable_hs_comp2io = .true.
pio_rearr_comm_enable_isend_comp2io = .false.
pio_rearr_comm_max_pend_req_io2comp = 0
pio_rearr_comm_enable_hs_io2comp = .true.
pio_rearr_comm_enable_isend_io2comp = .false.





if(iamroot) then
unitn=shr_file_getunit()
open( unitn, file=trim(nlfilename), status='old' , iostat=ierr)
Expand Down