Skip to content

Commit

Permalink
Merge branch 'develop' into feature/new_ip
Browse files Browse the repository at this point in the history
  • Loading branch information
GeorgeGayno-NOAA committed Apr 27, 2021
2 parents e6bab4c + e6538e9 commit dac7fc1
Show file tree
Hide file tree
Showing 5 changed files with 100 additions and 15 deletions.
4 changes: 2 additions & 2 deletions build_all.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@ export MOD_PATH
if [[ "$target" == "linux.*" || "$target" == "macosx.*" ]]; then
unset -f module
set +x
source ./modulefiles/build.$target > /dev/null 2>&1
source ./modulefiles/build.$target > /dev/null
set -x
else
set +x
source ./sorc/machine-setup.sh
module use ./modulefiles
module load build.$target.$compiler > /dev/null 2>&1
module load build.$target.$compiler > /dev/null
module list
set -x
fi
Expand Down
8 changes: 8 additions & 0 deletions sorc/chgres_cube.fd/program_setup.F90
Original file line number Diff line number Diff line change
Expand Up @@ -467,6 +467,13 @@ end subroutine get_var_cond
!! characteristics to the physical properties of soils</a>. Water
!! Resour. Res.,20, 682–690.
!!
!! The parameters in this subroutine were copied from
!! https://github.com/HelinWei-NOAA/ccpp-physics/blob/master/physics/set_soilveg.f
!! values need to be kept in sync with set_soilveg.f.
!!
!! For more information about these parameters see
!! https://github.com/HelinWei-NOAA/ccpp-physics/blob/master/physics/sflx.f.
!!
!! @param [in] localpet ESMF local persistent execution thread
!! @author George Gayno NCEP/EMC
subroutine calc_soil_params_driver(localpet)
Expand Down Expand Up @@ -502,6 +509,7 @@ subroutine calc_soil_params_driver(localpet)
real, allocatable :: satpsi(:)
real, allocatable :: satdw(:)

! using stasgo table
data bb_statsgo /4.05, 4.26, 4.74, 5.33, 5.33, 5.25, &
6.77, 8.72, 8.17, 10.73, 10.39, 11.55, &
5.25, -9.99, 4.05, 4.26/
Expand Down
38 changes: 30 additions & 8 deletions sorc/chgres_cube.fd/search_util.F90
Original file line number Diff line number Diff line change
Expand Up @@ -215,27 +215,49 @@ subroutine search (field, mask, idim, jdim, tile, field_num, latitude, terrain_l

end subroutine search

!> Set sst values based on latitude.
!> Set default Sea Surface Temperature (SST) based on latitude.
!!
!! @param latitude latitude input
!! @param sst sst guess value to be set
!! Based loosely on the average annual SST
!! values from ./fix_am/cfs_oi2sst1x1monclim19822001.grb
!!
!! The temperature in the polar and tropical regions
!! is set to 273.16 and 300.0 Kelvin respectively. Polar
!! regions are poleward of 60 degrees. Tropical regions
!! are within 30 degrees of the equator. In mid-latitudes,
!! a linear change with latitude is used.
!!
!! @param [in] latitude Latitude in decimal degrees
!! @param [out] sst Default SST in Kelvin
!! @author George Gayno NCEP/EMC
subroutine sst_guess(latitude, sst)

use esmf

implicit none

real(esmf_kind_r8), parameter :: SST_POLAR_IN_KELVIN = 273.16 !< Default SST in polar
!! regions.
real(esmf_kind_r8), parameter :: SST_TROPICAL_IN_KELVIN = 300.0 !< Default SST in
!! tropical regions.
real(esmf_kind_r8), parameter :: POLAR_LATITUDE = 60.0 !< Latitude in decimal degrees
!! defining polar regions.
real(esmf_kind_r8), parameter :: TROPICAL_LATITUDE = 30.0 !< Latitude in decimal degrees
!! defining tropical regions.
real(esmf_kind_r8), parameter :: DSST_DLAT = -0.8947 !< Change in SST per latitude in
!! mid-latitudes.
real(esmf_kind_r8), parameter :: SST_Y_INTERCEPT = 326.84 !< y intercept for the linear
!! change of SST in mid-latitudes.

real(esmf_kind_r8), intent(in) :: latitude

real(esmf_kind_r8), intent(out) :: sst

if (abs(latitude) >= 60.0) then
sst = 273.16
elseif (abs(latitude) <= 30.0) then
sst = 300.0
if (abs(latitude) >= POLAR_LATITUDE) then
sst = SST_POLAR_IN_KELVIN
elseif (abs(latitude) <= TROPICAL_LATITUDE) then
sst = SST_TROPICAL_IN_KELVIN
else
sst = (-0.8947) * abs(latitude) + 326.84
sst = DSST_DLAT * abs(latitude) + SST_Y_INTERCEPT
endif

end subroutine sst_guess
Expand Down
3 changes: 2 additions & 1 deletion tests/chgres_cube/config_fv3_tiled_warm_restart.nml
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,5 @@
regional=0
halo_bndy=0
halo_blend=0
/
/

62 changes: 58 additions & 4 deletions tests/chgres_cube/ftst_program_setup.F90
Original file line number Diff line number Diff line change
Expand Up @@ -81,10 +81,64 @@ program ftst_program_setup
enddo
if (my_rank .eq. 0) print*, "OK"

! Reading this namelist fails for some reason.
! print*, "testing read_setup_namelist with config_fv3_tiled_warm_restart..."
! call read_setup_namelist("config_fv3_tiled_warm_restart.nml")
! print*, "OK"
print*, "testing read_setup_namelist with config_fv3_tiled_warm_restart..."
call read_setup_namelist("config_fv3_tiled_warm_restart.nml")
if (cycle_mon .ne. 7 .or. cycle_day .ne. 6 .or. cycle_hour .ne. 12) stop 64
if (.not. convert_atm .or. .not. convert_sfc .or. .not. convert_nst) stop 65
if (regional .ne. 0 .or. halo_bndy .ne. 0 .or. halo_blend .ne. 0) stop 66
if (trim(mosaic_file_target_grid) .ne. "/scratch1/NCEPDEV/da/George.Gayno/noscrub/reg_tests/chgres_cube/fix/C96/C96_mosaic.nc") stop 67
if (trim(fix_dir_target_grid) .ne. "/scratch1/NCEPDEV/da/George.Gayno/noscrub/reg_tests/chgres_cube/fix/C96/fix_sfc") stop 68
if (trim(orog_dir_target_grid) .ne. "/scratch1/NCEPDEV/da/George.Gayno/noscrub/reg_tests/chgres_cube/fix/C96/") stop 69
if (trim(vcoord_file_target_grid) .ne. "/scratch1/NCEPDEV/da/George.Gayno/ufs_utils.git/UFS_UTILS/reg_tests/chgres_cube/../../fix/fix_am/global_hyblev.l64.txt") stop 70
if (trim(mosaic_file_input_grid) .ne. "/scratch1/NCEPDEV/da/George.Gayno/noscrub/reg_tests/chgres_cube/fix/C384/C384_mosaic.nc") stop 71
if (trim(orog_dir_input_grid) .ne. "/scratch1/NCEPDEV/da/George.Gayno/noscrub/reg_tests/chgres_cube/fix/C384/") stop 72
if (trim(data_dir_input_grid) .ne. "/scratch1/NCEPDEV/da/George.Gayno/noscrub/reg_tests/chgres_cube/input_data/fv3.restart") stop 73
if (trim(orog_files_target_grid(1)) .ne. "C96_oro_data.tile1.nc") stop 176
if (trim(orog_files_target_grid(2)) .ne. "C96_oro_data.tile2.nc") stop 176
if (trim(orog_files_target_grid(3)) .ne. "C96_oro_data.tile3.nc") stop 176
if (trim(orog_files_target_grid(4)) .ne. "C96_oro_data.tile4.nc") stop 176
if (trim(orog_files_target_grid(5)) .ne. "C96_oro_data.tile5.nc") stop 176
if (trim(orog_files_target_grid(6)) .ne. "C96_oro_data.tile6.nc") stop 176
if (trim(orog_files_input_grid(1)) .ne. "C384_oro_data.tile1.nc") stop 177
if (trim(orog_files_input_grid(2)) .ne. "C384_oro_data.tile2.nc") stop 177
if (trim(orog_files_input_grid(3)) .ne. "C384_oro_data.tile3.nc") stop 177
if (trim(orog_files_input_grid(4)) .ne. "C384_oro_data.tile4.nc") stop 177
if (trim(orog_files_input_grid(5)) .ne. "C384_oro_data.tile5.nc") stop 177
if (trim(orog_files_input_grid(6)) .ne. "C384_oro_data.tile6.nc") stop 177
if (trim(atm_core_files_input_grid(1)) .ne. "20190706.120000.fv_core.res.tile1.nc") stop 178
if (trim(atm_core_files_input_grid(2)) .ne. "20190706.120000.fv_core.res.tile2.nc") stop 178
if (trim(atm_core_files_input_grid(3)) .ne. "20190706.120000.fv_core.res.tile3.nc") stop 178
if (trim(atm_core_files_input_grid(4)) .ne. "20190706.120000.fv_core.res.tile4.nc") stop 178
if (trim(atm_core_files_input_grid(5)) .ne. "20190706.120000.fv_core.res.tile5.nc") stop 178
if (trim(atm_core_files_input_grid(6)) .ne. "20190706.120000.fv_core.res.tile6.nc") stop 178
if (trim(atm_tracer_files_input_grid(1)) .ne. "20190706.120000.fv_tracer.res.tile1.nc") stop 179
if (trim(atm_tracer_files_input_grid(2)) .ne. "20190706.120000.fv_tracer.res.tile2.nc") stop 179
if (trim(atm_tracer_files_input_grid(3)) .ne. "20190706.120000.fv_tracer.res.tile3.nc") stop 179
if (trim(atm_tracer_files_input_grid(4)) .ne. "20190706.120000.fv_tracer.res.tile4.nc") stop 179
if (trim(atm_tracer_files_input_grid(5)) .ne. "20190706.120000.fv_tracer.res.tile5.nc") stop 179
if (trim(atm_tracer_files_input_grid(6)) .ne. "20190706.120000.fv_tracer.res.tile6.nc") stop 179
if (trim(sfc_files_input_grid(1)) .ne. "20190706.120000.sfc_data.tile1.nc") stop 180
if (trim(sfc_files_input_grid(2)) .ne. "20190706.120000.sfc_data.tile2.nc") stop 180
if (trim(sfc_files_input_grid(3)) .ne. "20190706.120000.sfc_data.tile3.nc") stop 180
if (trim(sfc_files_input_grid(4)) .ne. "20190706.120000.sfc_data.tile4.nc") stop 180
if (trim(sfc_files_input_grid(5)) .ne. "20190706.120000.sfc_data.tile5.nc") stop 180
if (trim(sfc_files_input_grid(6)) .ne. "20190706.120000.sfc_data.tile6.nc") stop 180
if (trim(input_type) .ne. "restart") stop 89
if (num_tracers .ne. 7) stop 173
if (tracers(1) .ne. "sphum" .or. tracers(2) .ne. "liq_wat" .or. tracers(3) .ne. "o3mr" .or. &
tracers(4) .ne. "ice_wat" .or. tracers(5) .ne. "rainwat" .or. tracers(6) .ne. "snowwat" .or. &
tracers(7) .ne. "graupel") stop 174
if (tracers_input(1) .ne. "sphum" .or. tracers_input(2) .ne. "liq_wat" .or. &
tracers_input(3) .ne. "o3mr" .or. tracers_input(4) .ne. "ice_wat" .or. &
tracers_input(5) .ne. "rainwat" .or. tracers_input(6) .ne. "snowwat" .or. &
tracers_input(7) .ne. "graupel") stop 175

! Reset the tracers array.
do is = 1, max_tracers
tracers(is) = "NULL"
tracers_input(is) = "NULL"
enddo
print*, "OK"

if (my_rank .eq. 0) print*, "testing read_setup_namelist with config_gaussian_nemsio..."
call read_setup_namelist("config_gaussian_nemsio.nml")
Expand Down

0 comments on commit dac7fc1

Please sign in to comment.