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

gmtb-scm cleanup 20180402 #13

Merged
merged 6 commits into from
Apr 3, 2018
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
2 changes: 1 addition & 1 deletion ccpp-physics
4 changes: 2 additions & 2 deletions scm/etc/MACOSX_setup.csh
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ setenv LDFLAGS "-L/usr/local/opt/zlib/lib -L/usr/local/opt/llvm/lib"
setenv CPPFLAGS "-I/usr/local/opt/zlib/include -I/usr/local/opt/llvm/include"
setenv CFLAGS "-I/usr/local/opt/zlib/include -I/usr/local/opt/llvm/include"
setenv CXXFLAGS "-I/usr/local/opt/zlib/include -I/usr/local/opt/llvm/include"
setenv FFLAGS "-L/usr/local/opt/llvm/lib -lomp -I/usr/local/opt/zlib/include -I/usr/local/opt/llvm/include"
setenv FCFLAGS "-L/usr/local/opt/llvm/lib -lomp -I/usr/local/opt/zlib/include -I/usr/local/opt/llvm/include"
setenv FFLAGS "-I/usr/local/opt/zlib/include -I/usr/local/opt/llvm/include"
setenv FCFLAGS " -I/usr/local/opt/zlib/include -I/usr/local/opt/llvm/include"

if (! $?PATH) then
setenv PATH "/usr/local/opt/llvm/bin"
Expand Down
4 changes: 2 additions & 2 deletions scm/etc/MACOSX_setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ export LDFLAGS="-L/usr/local/opt/zlib/lib -L/usr/local/opt/llvm/lib"
export CPPFLAGS="-I/usr/local/opt/zlib/include -I/usr/local/opt/llvm/include"
export CFLAGS="-I/usr/local/opt/zlib/include -I/usr/local/opt/llvm/include"
export CXXFLAGS="-I/usr/local/opt/zlib/include -I/usr/local/opt/llvm/include"
export FFLAGS="-L/usr/local/opt/llvm/lib -lomp -I/usr/local/opt/zlib/include -I/usr/local/opt/llvm/include"
export FCFLAGS="-L/usr/local/opt/llvm/lib -lomp -I/usr/local/opt/zlib/include -I/usr/local/opt/llvm/include"
export FFLAGS="-I/usr/local/opt/zlib/include -I/usr/local/opt/llvm/include"
export FCFLAGS="-I/usr/local/opt/zlib/include -I/usr/local/opt/llvm/include"

export PATH="/usr/local/opt/llvm/bin${PATH:+:$PATH}"
export LD_LIBRARY_PATH="/usr/local/opt/zlib/lib:/usr/local/opt/llvm/lib${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}"
Expand Down
13 changes: 13 additions & 0 deletions scm/src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,19 @@ else (${CMAKE_Fortran_COMPILER_ID} MATCHES "GNU")
message (FATAL_ERROR "This program has only been compiled with gfortran and ifort. If another compiler is needed, the appropriate flags must be added in ${CMAKE_SOURCE_DIR}/CMakeLists.txt")
endif (${CMAKE_Fortran_COMPILER_ID} MATCHES "GNU")

#------------------------------------------------------------------------------
# The Fortran compiler/linker flag inserted by cmake to create shared libraries
# with the Intel compiler is deprecated (-i_dynamic), correct here.
# CMAKE_Fortran_COMPILER_ID = {"Intel", "PGI", "GNU", "Clang", "MSVC", ...}
if ("${CMAKE_Fortran_COMPILER_ID}" STREQUAL "Intel")
string(REPLACE "-i_dynamic" "-shared-intel"
CMAKE_SHARED_LIBRARY_CREATE_Fortran_FLAGS
"${CMAKE_SHARED_LIBRARY_CREATE_Fortran_FLAGS}")
string(REPLACE "-i_dynamic" "-shared-intel"
CMAKE_SHARED_LIBRARY_LINK_Fortran_FLAGS
"${CMAKE_SHARED_LIBRARY_LINK_Fortran_FLAGS}")
endif()

#------------------------------------------------------------------------------
# CMake Modules
# Set the CMake module path
Expand Down
3 changes: 1 addition & 2 deletions scm/src/gmtb_scm.F90
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ module gmtb_scm_main
subroutine gmtb_scm_main_sub()

use gmtb_scm_kinds, only: sp, dp, qp
use gmtb_scm_type_defs, only: scm_state_type, scm_input_type, scm_reference_type, physics_type
use gmtb_scm_input
use gmtb_scm_utils
use gmtb_scm_vgrid
Expand Down Expand Up @@ -86,7 +85,7 @@ subroutine gmtb_scm_main_sub()

scm_state%itt_out = 1

call physics%create(scm_state%n_cols, scm_state%n_levels, scm_state%n_tracers, scm_state%lat(:,1), scm_state%pres_l(1,1,:))
call physics%create(scm_state%n_cols, scm_state%n_levels, scm_state%lat(:,1), scm_state%pres_l(1,1,:))

!physics initialization section

Expand Down
3 changes: 1 addition & 2 deletions scm/src/gmtb_scm_input.f90
Original file line number Diff line number Diff line change
Expand Up @@ -514,12 +514,11 @@ subroutine get_reference_profile(scm_state, scm_reference)
real(kind=dp), allocatable :: qv(:) !< reference profile specific humidity (kg kg^-1)
real(kind=dp), allocatable :: ozone(:) !< reference profile ozone concentration (kg kg^-1)

integer :: reference_file_choice
integer :: i, ioerror
character(len=120) :: line
real :: dummy

integer :: ncid, varID, grp_ncid, allocate_status
integer :: ncid, varID, allocate_status
CHARACTER(LEN=nf90_max_name) :: tmpName

select case (scm_state%reference_profile_choice)
Expand Down
2 changes: 1 addition & 1 deletion scm/src/gmtb_scm_time_integration.f90
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ subroutine do_time_step(scm_state, cdata)
type(scm_state_type), intent(inout) :: scm_state
type(ccpp_t), intent(inout) :: cdata(:)

integer :: i, ipd_index, subcycle_index, scheme_index, ierr
integer :: i, ierr

!> \section do_time_step_alg Algorithm
!! @{
Expand Down
4 changes: 2 additions & 2 deletions scm/src/gmtb_scm_type_defs.f90
Original file line number Diff line number Diff line change
Expand Up @@ -1063,9 +1063,9 @@ subroutine scm_reference_create(scm_reference, nlev)

end subroutine scm_reference_create

subroutine physics_create(physics, n_columns, n_levels, n_tracers, lats, pres)
subroutine physics_create(physics, n_columns, n_levels, lats, pres)
class(physics_type) :: physics
integer, intent(in) :: n_columns, n_levels, n_tracers
integer, intent(in) :: n_columns, n_levels
real(kind=kind_phys), intent(in) :: lats(:), pres(:)

real(kind=kind_phys) :: kind_phys_zero
Expand Down
144 changes: 72 additions & 72 deletions scm/src/gmtb_scm_vgrid.F90
Original file line number Diff line number Diff line change
Expand Up @@ -127,14 +127,14 @@ subroutine get_FV3_vgrid(scm_input, scm_state)
real a24(25),b24(25) ! GFDL AM2L24
real a26(27),b26(27) ! Jablonowski & Williamson 26-level
real a32(33),b32(33)
real a32w(33),b32w(33)
!real a32w(33),b32w(33)
real a47(48),b47(48)
real a48(49),b48(49)
real a52(53),b52(53)
real a54(55),b54(55)
real a56(57),b56(57)
real a60(61),b60(61)
real a63(64),b63(64)
!real a63(64),b63(64)
real a64(65),b64(65)
real a68(69),b68(69) ! cjg: grid with enhanced PBL resolution
real a96(97),b96(97) ! cjg: grid with enhanced PBL resolution
Expand All @@ -146,7 +146,7 @@ subroutine get_FV3_vgrid(scm_input, scm_state)
real:: pc=200.E2

real pt, pint, lnpe, dlnp
real press(scm_state%n_levels+1), pt1(scm_state%n_levels)
real press(scm_state%n_levels+1)
integer k, last_index, mid_index

km = scm_state%n_levels
Expand Down Expand Up @@ -237,29 +237,29 @@ subroutine get_FV3_vgrid(scm_input, scm_state)
0.98142, 0.99223, 1.00000 /
#endif

!---------------------
! Wilson's 32L settings:
!---------------------
! Top changed to 0.01 mb
data a32w/ 1.00, 26.6378, 84.5529, 228.8592, &
539.9597, 1131.7087, 2141.8082, 3712.0454, &
5963.5317, 8974.1873, 12764.5388, 17294.5911, &
20857.7007, 22221.8651, 22892.7202, 22891.1641, &
22286.0724, 21176.0846, 19673.0671, 17889.0989, &
15927.5060, 13877.6239, 11812.5474, 9865.8830, &
8073.9717, 6458.0824, 5027.9893, 3784.6104, &
2722.0093, 1828.9741, 1090.2397, 487.4575, &
0.0000 /

data b32w/ 0.0000, 0.0000, 0.0000, 0.0000, &
0.0000, 0.0000, 0.0000, 0.0000, &
0.0000, 0.0000, 0.0000, 0.0000, &
0.0159, 0.0586, 0.1117, 0.1734, &
0.2415, 0.3137, 0.3878, 0.4619, &
0.5344, 0.6039, 0.6696, 0.7285, &
0.7808, 0.8266, 0.8662, 0.9000, &
0.9285, 0.9522, 0.9716, 0.9874, &
1.0000 /
!!---------------------
!! Wilson's 32L settings:
!!---------------------
!! Top changed to 0.01 mb
! data a32w/ 1.00, 26.6378, 84.5529, 228.8592, &
! 539.9597, 1131.7087, 2141.8082, 3712.0454, &
! 5963.5317, 8974.1873, 12764.5388, 17294.5911, &
! 20857.7007, 22221.8651, 22892.7202, 22891.1641, &
! 22286.0724, 21176.0846, 19673.0671, 17889.0989, &
! 15927.5060, 13877.6239, 11812.5474, 9865.8830, &
! 8073.9717, 6458.0824, 5027.9893, 3784.6104, &
! 2722.0093, 1828.9741, 1090.2397, 487.4575, &
! 0.0000 /
!
! data b32w/ 0.0000, 0.0000, 0.0000, 0.0000, &
! 0.0000, 0.0000, 0.0000, 0.0000, &
! 0.0000, 0.0000, 0.0000, 0.0000, &
! 0.0159, 0.0586, 0.1117, 0.1734, &
! 0.2415, 0.3137, 0.3878, 0.4619, &
! 0.5344, 0.6039, 0.6696, 0.7285, &
! 0.7808, 0.8266, 0.8662, 0.9000, &
! 0.9285, 0.9522, 0.9716, 0.9874, &
! 1.0000 /


#ifdef OLD_L47
Expand Down Expand Up @@ -501,52 +501,52 @@ subroutine get_FV3_vgrid(scm_input, scm_state)
9.6020000000e-01, 9.7775000000e-01, 9.9223000000e-01, &
1.0000000000e+00 /

! This is activated by USE_GFSL63
! Thfollowing L63 setting is the same as NCEP GFS's L64 except the top
! 3 layers
data a63/64.247, 137.790, 221.958, &
318.266, 428.434, 554.424, &
698.457, 863.05803, 1051.07995, &
1265.75194, 1510.71101, 1790.05098, &
2108.36604, 2470.78817, 2883.03811, &
3351.46002, 3883.05187, 4485.49315, &
5167.14603, 5937.04991, 6804.87379, &
7780.84698, 8875.64338, 10100.20534, &
11264.35673, 12190.64366, 12905.42546, &
13430.87867, 13785.88765, 13986.77987, &
14047.96335, 13982.46770, 13802.40331, &
13519.33841, 13144.59486, 12689.45608, &
12165.28766, 11583.57006, 10955.84778, &
10293.60402, 9608.08306, 8910.07678, &
8209.70131, 7516.18560, 6837.69250, &
6181.19473, 5552.39653, 4955.72632, &
4394.37629, 3870.38682, 3384.76586, &
2937.63489, 2528.37666, 2155.78385, &
1818.20722, 1513.68173, 1240.03585, &
994.99144, 776.23591, 581.48797, &
408.53400, 255.26520, 119.70243, 0. /

data b63/0.00000, 0.00000, 0.00000, &
0.00000, 0.00000, 0.00000, &
0.00000, 0.00000, 0.00000, &
0.00000, 0.00000, 0.00000, &
0.00000, 0.00000, 0.00000, &
0.00000, 0.00000, 0.00000, &
0.00000, 0.00000, 0.00000, &
0.00000, 0.00000, 0.00000, &
0.00201, 0.00792, 0.01755, &
0.03079, 0.04751, 0.06761, &
0.09097, 0.11746, 0.14690, &
0.17911, 0.21382, 0.25076, &
0.28960, 0.32994, 0.37140, &
0.41353, 0.45589, 0.49806, &
0.53961, 0.58015, 0.61935, &
0.65692, 0.69261, 0.72625, &
0.75773, 0.78698, 0.81398, &
0.83876, 0.86138, 0.88192, &
0.90050, 0.91722, 0.93223, &
0.94565, 0.95762, 0.96827, &
0.97771, 0.98608, 0.99347, 1./
!! This is activated by USE_GFSL63
!! Thfollowing L63 setting is the same as NCEP GFS's L64 except the top
!! 3 layers
! data a63/64.247, 137.790, 221.958, &
! 318.266, 428.434, 554.424, &
! 698.457, 863.05803, 1051.07995, &
! 1265.75194, 1510.71101, 1790.05098, &
! 2108.36604, 2470.78817, 2883.03811, &
! 3351.46002, 3883.05187, 4485.49315, &
! 5167.14603, 5937.04991, 6804.87379, &
! 7780.84698, 8875.64338, 10100.20534, &
! 11264.35673, 12190.64366, 12905.42546, &
! 13430.87867, 13785.88765, 13986.77987, &
! 14047.96335, 13982.46770, 13802.40331, &
! 13519.33841, 13144.59486, 12689.45608, &
! 12165.28766, 11583.57006, 10955.84778, &
! 10293.60402, 9608.08306, 8910.07678, &
! 8209.70131, 7516.18560, 6837.69250, &
! 6181.19473, 5552.39653, 4955.72632, &
! 4394.37629, 3870.38682, 3384.76586, &
! 2937.63489, 2528.37666, 2155.78385, &
! 1818.20722, 1513.68173, 1240.03585, &
! 994.99144, 776.23591, 581.48797, &
! 408.53400, 255.26520, 119.70243, 0. /
!
! data b63/0.00000, 0.00000, 0.00000, &
! 0.00000, 0.00000, 0.00000, &
! 0.00000, 0.00000, 0.00000, &
! 0.00000, 0.00000, 0.00000, &
! 0.00000, 0.00000, 0.00000, &
! 0.00000, 0.00000, 0.00000, &
! 0.00000, 0.00000, 0.00000, &
! 0.00000, 0.00000, 0.00000, &
! 0.00201, 0.00792, 0.01755, &
! 0.03079, 0.04751, 0.06761, &
! 0.09097, 0.11746, 0.14690, &
! 0.17911, 0.21382, 0.25076, &
! 0.28960, 0.32994, 0.37140, &
! 0.41353, 0.45589, 0.49806, &
! 0.53961, 0.58015, 0.61935, &
! 0.65692, 0.69261, 0.72625, &
! 0.75773, 0.78698, 0.81398, &
! 0.83876, 0.86138, 0.88192, &
! 0.90050, 0.91722, 0.93223, &
! 0.94565, 0.95762, 0.96827, &
! 0.97771, 0.98608, 0.99347, 1./
#ifdef GFSL64
data a64/20.00000, 68.00000, 137.79000, &
221.95800, 318.26600, 428.43400, &
Expand Down