Skip to content
Draft
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
8 changes: 4 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -694,10 +694,10 @@ intel-xd2000:
"CFLAGS_OPT = -O3 -std=gnu90" \
"CXXFLAGS_OPT = -O3" \
"LDFLAGS_OPT = -O3" \
"FFLAGS_DEBUG = -g -convert big_endian -free -check bounds,pointers,arg_temp_created,format,shape,contiguous -fpe0 -traceback -Qoption,fpp,-macro_expand=vc" \
"FFLAGS_DEBUG = -g -convert big_endian -free -check bounds,pointers,arg_temp_created,format,shape,contiguous -ftrapuv -fpe0 -traceback -Qoption,fpp,-macro_expand=vc" \
"CFLAGS_DEBUG = -g -traceback" \
"CXXFLAGS_DEBUG = -g -traceback" \
"LDFLAGS_DEBUG = -g -traceback" \
"LDFLAGS_DEBUG = -g -traceback" \
"FFLAGS_OMP = -qopenmp" \
"CFLAGS_OMP = -qopenmp" \
"CORE = $(CORE)" \
Expand All @@ -719,8 +719,8 @@ intel2-xd2000:
"CFLAGS_OPT = -O2 -std=gnu90" \
"CXXFLAGS_OPT = -O2" \
"LDFLAGS_OPT = -O2" \
"FFLAGS_DEBUG = -g -convert big_endian -free -check bounds,pointers,arg_temp_created,format,shape,contiguous -fpe0 -traceback -Qoption,fpp,-macro_expand=vc" \
"CFLAGS_DEBUG = -g -traceback" \
"FFLAGS_DEBUG = -g -convert big_endian -free -check bounds,pointers,arg_temp_created,format,shape,contiguous -fpe0 -ftrapuv -traceback -Qoption,fpp,-macro_expand=vc" \
"CFLAGS_DEBUG = -g -traceback" \
"CFLAGS_DEBUG = -g -traceback" \
"CXXFLAGS_DEBUG = -g -traceback" \
"LDFLAGS_DEBUG = -g -traceback" \
Expand Down
4 changes: 3 additions & 1 deletion src/core_atmosphere/physics/mpas_atmphys_initialize_real.F
Original file line number Diff line number Diff line change
Expand Up @@ -599,7 +599,7 @@ subroutine physics_init_seaice(mesh, input, dims, configs)
integer, pointer:: nCellsSolve,nSoilLevels
integer:: iCell,iSoil
integer:: num_seaice_changes
integer,dimension(:),pointer:: landmask,isltyp,ivgtyp
integer,dimension(:),pointer:: landmask,isltyp,isctyp,ivgtyp

real(kind=RKIND):: xice_threshold
real(kind=RKIND):: mid_point_depth
Expand Down Expand Up @@ -633,6 +633,7 @@ subroutine physics_init_seaice(mesh, input, dims, configs)
call mpas_pool_get_array(mesh, 'landmask', landmask)
call mpas_pool_get_array(mesh, 'lu_index', ivgtyp)
call mpas_pool_get_array(mesh, 'soilcat_top', isltyp)
call mpas_pool_get_array(mesh, 'soilcol_idx', isctyp)
call mpas_pool_get_array(mesh, 'snoalb', snoalb)

call mpas_pool_get_array(input, 'seaice', seaice)
Expand Down Expand Up @@ -679,6 +680,7 @@ subroutine physics_init_seaice(mesh, input, dims, configs)
if(landmask(iCell) .eq. 0) tmn(iCell) = 271.4_RKIND
ivgtyp(iCell) = isice_lu
isltyp(iCell) = 16
isctyp(iCell) = 4
snoalb(iCell) = 0.75
vegfra(iCell) = 0._RKIND
xland(iCell) = 1._RKIND
Expand Down
5 changes: 4 additions & 1 deletion src/core_atmosphere/physics/mpas_atmphys_update_surface.F
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ subroutine physics_update_sst(dminfo,config_frac_seaice,mesh,sfc_input,diag_phys
integer:: icheck
integer:: iCell,iSoil
integer:: nb_to_land,nb_to_ocean,nb_removed
integer,dimension(:),pointer:: isltyp,ivgtyp,landmask
integer,dimension(:),pointer:: isltyp,isctyp,ivgtyp,landmask

real(kind=RKIND):: local_min,local_max
real(kind=RKIND):: global_sst_min,global_sst_max
Expand All @@ -152,6 +152,7 @@ subroutine physics_update_sst(dminfo,config_frac_seaice,mesh,sfc_input,diag_phys
call mpas_pool_get_array(sfc_input,'isice' ,isice )
call mpas_pool_get_array(sfc_input,'iswater' ,iswater )
call mpas_pool_get_array(sfc_input,'isltyp' ,isltyp )
call mpas_pool_get_array(sfc_input,'isctyp' ,isctyp )
call mpas_pool_get_array(sfc_input,'ivgtyp' ,ivgtyp )
call mpas_pool_get_array(sfc_input,'landmask' ,landmask )
call mpas_pool_get_array(sfc_input,'vegfra' ,vegfra )
Expand Down Expand Up @@ -218,6 +219,7 @@ subroutine physics_update_sst(dminfo,config_frac_seaice,mesh,sfc_input,diag_phys
!... sea-ice points are converted to land points:
ivgtyp(iCell) = isice
isltyp(iCell) = 16
isctyp(iCell) = 4
vegfra(iCell) = 0._RKIND
xland(iCell) = 1._RKIND
tmn(iCell) = 271.4_RKIND
Expand All @@ -243,6 +245,7 @@ subroutine physics_update_sst(dminfo,config_frac_seaice,mesh,sfc_input,diag_phys
!land points turn to water points:
ivgtyp(iCell) = iswater
isltyp(iCell) = 14
isctyp(iCell) = 4
vegfra(iCell) = 0._RKIND
xland(iCell) = 2._RKIND
tmn(iCell) = sst(iCell)
Expand Down
6 changes: 4 additions & 2 deletions src/core_init_atmosphere/mpas_geotile_manager.F
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ module mpas_geotile_manager
!> * isice = 24
!> * isurban = 1
!> * isoilwater = 14
!> * islcolwater = 9
!> * islcolwater = 4
!
!-----------------------------------------------------------------------
function mpas_geotile_mgr_init(mgr, path) result(ierr)
Expand Down Expand Up @@ -249,8 +249,10 @@ function mpas_geotile_mgr_init(mgr, path) result(ierr)
call mpas_pool_add_config(mgr % pool, 'isoilwater', 14)
endif

! Set this to 4 so it works with all tables. It will be overwritten with
! the table-specific default if the data bases are not found.
if (.not. associated(islcolwater)) then
call mpas_pool_add_config(mgr % pool, 'islcolwater', 1)
call mpas_pool_add_config(mgr % pool, 'islcolwater', 4)
end if
endif

Expand Down
30 changes: 19 additions & 11 deletions src/core_init_atmosphere/mpas_init_atm_static.F
Original file line number Diff line number Diff line change
Expand Up @@ -474,21 +474,21 @@ subroutine init_atm_static(mesh, dims, configs)
!
slcol_input_select1: select case(trim(config_soilcol_data))
case('DEFAULT_RAD_NOAH')
call mpas_log_write('Using 9-class default NOAH soil colour classes')
call mpas_log_write('Using 8-class default NOAH soil colour classes')
geog_sub_path = 'soilcolour_30s/'
! Set default category and default water category for NOAH soil colour.
! These will be overwritten if soil colour data sets exist.
isdefault_slcol = 4
iswater_slcol = 1
iswater_slcol = 4

case('MODIFIED_RAD_CLM_NOAH')
call mpas_log_write('Using 21-class MODIS 30-arc-second land cover dataset')
geog_sub_path = 'clm_soilcolour_21class_30s/'

! Set default category and default water category for NOAH soil colour
! These will be overwritten if soil colour data sets exist.
isdefault_slcol = 14
iswater_slcol = 21
isdefault_slcol = 14
iswater_slcol = 21
case default
call mpas_log_write('*****************************************************************', messageType=MPAS_LOG_ERR)
call mpas_log_write('Invalid soil colour dataset '''//trim(config_soilcol_data) &
Expand All @@ -509,13 +509,18 @@ subroutine init_atm_static(mesh, dims, configs)
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
where (lu_index == isice_lu) soilcat_top = 16

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
! KLUDGE TO REPLACE DUMMY OCEAN SOIL COLOUR WITH DEFAULT VALUES
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
where ( soilcol_idx == iswater_slcol ) soilcol_idx = isdefault_slcol


!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
! CORRECT INCONSISTENT SOIL TYPE, SOIL COLOUR AND LAND USE DATA
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
do iCell = 1,nCells
if (lu_index(iCell) == iswater_lu .or. &
soilcat_top(iCell) == iswater_soil .or. &
soilcol_idx(iCell) == iswater_slcol ) then
if (lu_index(iCell) == iswater_lu .or. &
soilcat_top(iCell) == iswater_soil ) then
if (lu_index(iCell) /= iswater_lu) then
call mpas_log_write('Turning lu_index into water at $i', intArgs=(/iCell/))
lu_index(iCell) = iswater_lu
Expand All @@ -524,10 +529,10 @@ subroutine init_atm_static(mesh, dims, configs)
call mpas_log_write('Turning soilcat_top into water at $i', intArgs=(/iCell/))
soilcat_top(iCell) = iswater_soil
end if
if (soilcol_idx(iCell) /= iswater_slcol) then
call mpas_log_write('Turning soilcol_idx into water at $i', intArgs=(/iCell/))
soilcol_idx(iCell) = iswater_slcol
end if

! Impose the default soil colour for the grid cell
call mpas_log_write('Turning soilcol_idx into default at $i', intArgs=(/iCell/))
soilcol_idx(iCell) = isdefault_slcol
end if
end do

Expand Down Expand Up @@ -2059,6 +2064,9 @@ subroutine interp_soilcol(mesh, kdtree, geog_data_path, isdefault_slcol, iswater
call mpas_pool_get_dimension(mesh, 'nCells', nCells)
call mpas_pool_get_array(mesh, 'soilcol_idx', soilcol_idx)

! Overwrite default soil colour to match the data base-specific default.
call mpas_pool_add_config(mgr % pool, 'islcolwater', iswater_slcol)

! Define the entire domain with the default soil colour index
soilcol_idx(1:nCells) = isdefault_slcol

Expand Down