Skip to content

Commit

Permalink
Merge pull request #1766 from jedwards4b/remove_whitespace_mct_driver
Browse files Browse the repository at this point in the history
remove extra whitespace

No changes in this PR except removing extraneous whitespace from the mct driver code.

Test suite:
Test baseline:
Test namelist changes:
Test status: bit for bit

Fixes
User interface changes?:

Update gh-pages html (Y/N)?:

Code review:
  • Loading branch information
jgfouca authored Jul 27, 2017
2 parents b4419ef + e137a0e commit bb1aec9
Show file tree
Hide file tree
Showing 20 changed files with 431 additions and 445 deletions.
2 changes: 1 addition & 1 deletion src/drivers/mct/main/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ list(APPEND drv_sources
seq_map_type_mod.F90
)

sourcelist_to_parent(drv_sources)
sourcelist_to_parent(drv_sources)
92 changes: 46 additions & 46 deletions src/drivers/mct/main/component_mod.F90

Large diffs are not rendered by default.

24 changes: 11 additions & 13 deletions src/drivers/mct/main/component_type_mod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module component_type_mod
!----------------------------------------------------------------------------
! share code & libs
!----------------------------------------------------------------------------
use shr_kind_mod , only: r8 => SHR_KIND_R8
use shr_kind_mod , only: r8 => SHR_KIND_R8
use shr_kind_mod , only: cs => SHR_KIND_CS
use shr_kind_mod , only: cl => SHR_KIND_CL
use seq_cdata_mod , only: seq_cdata
Expand All @@ -12,7 +12,7 @@ module component_type_mod
use seq_comm_mct , only: num_inst_atm, num_inst_lnd, num_inst_rof
use seq_comm_mct , only: num_inst_ocn, num_inst_ice, num_inst_glc
use seq_comm_mct , only: num_inst_wav, num_inst_esp
use mct_mod
use mct_mod

implicit none
save
Expand All @@ -39,7 +39,7 @@ module component_type_mod
public :: component_get_mdl2drv
!
! on union coupler/component pes
public :: component_get_mapper_Cc2x
public :: component_get_mapper_Cc2x
public :: component_get_mapper_Cx2c
!
! on driver pes (all pes)
Expand All @@ -53,12 +53,12 @@ module component_type_mod

type component_type
!
! Coupler pes
! Coupler pes
! used by prep_xxx and all other coupler based routines
!
type(mct_ggrid) , pointer :: dom_cx => null() ! component domain (same for all instances)
type(mct_gsMap) , pointer :: gsMap_cx => null() ! decomposition on coupler pes (same for all instances)
type(mct_aVect) , pointer :: x2c_cx => null() !
type(mct_aVect) , pointer :: x2c_cx => null() !
type(mct_aVect) , pointer :: c2x_cx => null()
!
! Component pes
Expand All @@ -80,7 +80,7 @@ module component_type_mod
!
integer :: compid
integer :: cplcompid
integer :: cplallcompid
integer :: cplallcompid
integer :: mpicom_compid
integer :: mpicom_cplcompid
integer :: mpicom_cplallcompid
Expand Down Expand Up @@ -195,35 +195,33 @@ function component_get_gsmap_cc(comp)
end function component_get_gsmap_cc

function component_get_cdata_cc(comp)
type(component_type), intent(in), target :: comp
type(component_type), intent(in), target :: comp
type(seq_cdata), pointer :: component_get_cdata_cc
component_get_cdata_cc => comp%cdata_cc
end function component_get_cdata_cc

function component_get_drv2mdl(comp)
type(component_type), intent(in), target :: comp
type(component_type), intent(in), target :: comp
real(r8), pointer :: component_get_drv2mdl(:)
component_get_drv2mdl => comp%drv2mdl
end function component_get_drv2mdl

function component_get_mdl2drv(comp)
type(component_type), intent(in), target :: comp
type(component_type), intent(in), target :: comp
real(r8), pointer :: component_get_mdl2drv(:)
component_get_mdl2drv => comp%mdl2drv
end function component_get_mdl2drv

function component_get_mapper_Cc2x(comp)
type(component_type), intent(in), target :: comp
type(component_type), intent(in), target :: comp
type(seq_map), pointer :: component_get_mapper_Cc2x
component_get_mapper_Cc2x => comp%mapper_Cc2x
end function component_get_mapper_Cc2x

function component_get_mapper_Cx2c(comp)
type(component_type), intent(in), target :: comp
type(component_type), intent(in), target :: comp
type(seq_map), pointer :: component_get_mapper_Cx2c
component_get_mapper_Cx2c => comp%mapper_Cx2c
end function component_get_mapper_Cx2c

end module component_type_mod


2 changes: 0 additions & 2 deletions src/drivers/mct/main/map_glc2lnd_mod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -398,5 +398,3 @@ subroutine make_aVect_frac_times_icemask(frac_av, mask_av, frac_field, icemask_f
end subroutine make_aVect_frac_times_icemask

end module map_glc2lnd_mod


30 changes: 15 additions & 15 deletions src/drivers/mct/main/map_lnd2glc_mod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,7 @@ subroutine map_ice_covered(l2x_l, landfrac_l, fieldname, &
!
! Puts the output in data_g_ice_covered, which should already be allocated to have size
! equal to the number of GLC points that this processor is responsible for.
!
!
! !USES:
!
! !ARGUMENTS:
Expand All @@ -323,7 +323,7 @@ subroutine map_ice_covered(l2x_l, landfrac_l, fieldname, &
real(r8) , intent(in) :: topo_g(:) ! topographic height for each point on the glc grid
type(seq_map) , intent(inout) :: mapper
real(r8) , intent(out) :: data_g_ice_covered(:) ! field remapped to glc grid

! !LOCAL VARIABLES:

character(len=*), parameter :: toponame = 'Sl_topo' ! base name for topo fields in l2x_l;
Expand All @@ -336,7 +336,7 @@ subroutine map_ice_covered(l2x_l, landfrac_l, fieldname, &
character(len=:), allocatable :: fieldnamelist
character(len=:), allocatable :: toponamelist
character(len=:), allocatable :: totalfieldlist

integer :: nEC ! number of elevation classes
integer :: lsize_g ! number of cells on glc grid
integer :: n, ec
Expand All @@ -361,15 +361,15 @@ subroutine map_ice_covered(l2x_l, landfrac_l, fieldname, &
lsize_g = size(data_g_ice_covered)
nEC = glc_get_num_elevation_classes()
SHR_ASSERT_FL((size(topo_g) == lsize_g), __FILE__, __LINE__)

! ------------------------------------------------------------------------
! Create temporary vectors
! ------------------------------------------------------------------------

allocate(tmp_field_g(lsize_g))
allocate(data_g_EC (lsize_g,nEC))
allocate(topo_g_EC (lsize_g,nEC))

! ------------------------------------------------------------------------
! Make a string that concatenates all EC levels of field, as well as the topo
! The resulting list will look something like this:
Expand All @@ -387,14 +387,14 @@ subroutine map_ice_covered(l2x_l, landfrac_l, fieldname, &
strlen = len_trim(fieldnamelist) + len_trim(toponamelist) + extra_len_for_list_merge
allocate(character(len=strlen) :: totalfieldlist)
call shr_string_listMerge(fieldnamelist, toponamelist, totalfieldlist )

! ------------------------------------------------------------------------
! Make a temporary attribute vector.
! For each grid cell on the land grid, this attribute vector contains the field and
! topo values for all ECs.
! ------------------------------------------------------------------------
call mct_aVect_init(l2x_g_temp, rList = totalfieldlist, lsize = lsize_g)

! ------------------------------------------------------------------------
! Remap all these fields from the land (source) grid to the glc (destination) grid.
! ------------------------------------------------------------------------
Expand All @@ -406,7 +406,7 @@ subroutine map_ice_covered(l2x_l, landfrac_l, fieldname, &
norm = .true., &
avwts_s = landfrac_l, &
avwtsfld_s = 'lfrac')

! ------------------------------------------------------------------------
! Export all elevation classes out of attribute vector and into local 2D arrays (xy,z)
! ------------------------------------------------------------------------
Expand All @@ -420,13 +420,13 @@ subroutine map_ice_covered(l2x_l, landfrac_l, fieldname, &
call mct_aVect_exportRattr(l2x_g_temp, toponame_ec, tmp_field_g)
topo_g_EC(:,ec) = tmp_field_g
enddo

! ------------------------------------------------------------------------
! Perform vertical interpolation of data onto ice sheet topography
! ------------------------------------------------------------------------

data_g_ice_covered(:) = 0._r8

do n = 1, lsize_g

! For each ice sheet point, find bounding EC values...
Expand Down Expand Up @@ -465,17 +465,17 @@ subroutine map_ice_covered(l2x_l, landfrac_l, fieldname, &
end do
end if ! topo_g(n)
end do ! lsize_g

! ------------------------------------------------------------------------
! Clean up
! ------------------------------------------------------------------------

deallocate(tmp_field_g)
deallocate(data_g_EC)
deallocate(topo_g_EC)

call mct_aVect_clean(l2x_g_temp)

end subroutine map_ice_covered

end module map_lnd2glc_mod
Loading

0 comments on commit bb1aec9

Please sign in to comment.