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

Make Noah-MP-only static fields optional in the init_atmosphere core #1239

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
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
21 changes: 16 additions & 5 deletions src/core_init_atmosphere/Registry.xml
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,11 @@
description="The supersampling factor to be used for 30s terrain, MODIS land use, soil category, and MODIS FPAR monthly vegetation fraction (case 7 only)"
possible_values="Positive integer values"/>

<nml_option name="config_noahmp_static" type="logical" default_value="true"
units="-"
description="Whether to process, read, and write static fields only required by Noah-MP"
possible_values="true or false"/>

<nml_option name="config_use_spechumd" type="logical" default_value="false"
units="-"
description="Whether to use specific-humidity as the first-guess moisture variable. If this option is False, relative humidity will be used."
Expand Down Expand Up @@ -354,6 +359,7 @@
<package name="met_stage_out" description="Active only if meteorological fields are being interpolated"/>
<package name="first_guess_field" description="3-d atmospheric or land-surface fields on first-guess levels"/>
<package name="mp_thompson_aers_in" description="initialization of GOCART-based Thompson water- and ice-friendly aerosols"/>
<package name="noahmp" description="Whether to process, read, and write static fields only required by Noah-MP"/>
</packages>


Expand Down Expand Up @@ -822,19 +828,24 @@

<!-- SOIL COMPOSITION fields needed for the NOAH-MP land surface scheme -->
<var name="soilcomp" type="real" dimensions="nSoilComps nCells" units="percent"
description="soil composition needed as input in the NOAH-MP land surface model"/>
description="soil composition needed as input in the NOAH-MP land surface model"
packages="noahmp"/>

<var name="soilcl1" type="real" dimensions="nCells" units="unitless"
description="soil texture class level 1 needed as input for the NOAH-MP land surface model"/>
description="soil texture class level 1 needed as input for the NOAH-MP land surface model"
packages="noahmp"/>

<var name="soilcl2" type="real" dimensions="nCells" units="unitless"
description="soil texture class level 2 needed as input for the NOAH-MP land surface model"/>
description="soil texture class level 2 needed as input for the NOAH-MP land surface model"
packages="noahmp"/>

<var name="soilcl3" type="real" dimensions="nCells" units="unitless"
description="soil texture class level 3 needed as input for the NOAH-MP land surface model"/>
description="soil texture class level 3 needed as input for the NOAH-MP land surface model"
packages="noahmp"/>

<var name="soilcl4" type="real" dimensions="nCells" units="unitless"
description="soil texture class level 4 needed as input for the NOAH-MP land surface model"/>
description="soil texture class level 4 needed as input for the NOAH-MP land surface model"
packages="noahmp"/>

<!-- GWDO fields -->
<var name="var2d" type="real" dimensions="nCells" units="m"
Expand Down
27 changes: 27 additions & 0 deletions src/core_init_atmosphere/mpas_init_atm_core_interface.F
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ function init_atm_setup_packages(configs, streamInfo, packages, iocontext) resul
logical, pointer :: first_guess_field
logical, pointer :: mp_thompson_aers_in
integer, pointer :: config_init_case
logical, pointer :: noahmp, config_noahmp_static


ierr = 0
Expand Down Expand Up @@ -273,6 +274,32 @@ function init_atm_setup_packages(configs, streamInfo, packages, iocontext) resul
first_guess_field = .true.
end if

!
! Noah-MP
!
nullify(config_noahmp_static)
call mpas_pool_get_config(configs, 'config_noahmp_static', config_noahmp_static)

nullify(noahmp)
call mpas_pool_get_package(packages, 'noahmpActive', noahmp)

if (associated(config_noahmp_static) .and. associated(noahmp)) then
noahmp = config_noahmp_static
else
call mpas_log_write('********************************************************************************', &
messageType=MPAS_LOG_ERR)
call mpas_log_write('* Error while setting up packages for init_atmosphere core:', &
messageType=MPAS_LOG_ERR)
call mpas_log_write('* Either the ''noahmp'' package or the ''config_noahmp_static'' namelist', &
messageType=MPAS_LOG_ERR)
call mpas_log_write('* option is not defined.', &
messageType=MPAS_LOG_ERR)
call mpas_log_write('********************************************************************************', &
messageType=MPAS_LOG_ERR)
ierr = 1
return
end if

end function init_atm_setup_packages


Expand Down
86 changes: 46 additions & 40 deletions src/core_init_atmosphere/mpas_init_atm_static.F
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@ subroutine init_atm_static(mesh, dims, configs)
character(len=StrKIND), pointer :: config_vegfrac_data
character(len=StrKIND), pointer :: config_albedo_data
character(len=StrKIND), pointer :: config_maxsnowalbedo_data
logical, pointer :: config_noahmp_static
character(len=StrKIND+1) :: geog_data_path ! same as config_geog_data_path, but guaranteed to have a trailing slash
character(len=StrKIND+1) :: geog_sub_path ! subdirectory names in config_geog_data_path, with trailing slash

Expand Down Expand Up @@ -219,6 +220,7 @@ subroutine init_atm_static(mesh, dims, configs)
call mpas_pool_get_config(configs, 'config_maxsnowalbedo_data', config_maxsnowalbedo_data)
call mpas_pool_get_config(configs, 'config_supersample_factor', supersample_fac)
call mpas_pool_get_config(configs, 'config_30s_supersample_factor', supersample_fac_30s)
call mpas_pool_get_config(configs, 'config_noahmp_static', config_noahmp_static)

write(geog_data_path, '(a)') config_geog_data_path
i = len_trim(geog_data_path)
Expand Down Expand Up @@ -1171,55 +1173,59 @@ subroutine init_atm_static(mesh, dims, configs)

call mpas_log_write('--- end interpolate ALBEDO12M')

!
! Interpolate SOILCOMP
!
geog_sub_path = 'soilgrids/soilcomp/'
call mpas_log_write('--- start interpolate SOILCOMP')
call interp_soilcomp(mesh, tree, trim(geog_data_path)//trim(geog_sub_path), &
supersample_fac=supersample_fac_30s)
call mpas_log_write('--- end interpolate SOILCOMP')
if (config_noahmp_static) then

!
! Interpolate SOILCL1
!
geog_sub_path = 'soilgrids/texture_layer1/'
!
! Interpolate SOILCOMP
!
geog_sub_path = 'soilgrids/soilcomp/'

call mpas_log_write('--- start interpolate SOILCL1')
call interp_soil_texture('soilcl1', mesh, tree, trim(geog_data_path)//trim(geog_sub_path), &
supersample_fac=supersample_fac_30s)
call mpas_log_write('--- end interpolate SOILCL1')
call mpas_log_write('--- start interpolate SOILCOMP')
call interp_soilcomp(mesh, tree, trim(geog_data_path)//trim(geog_sub_path), &
supersample_fac=supersample_fac_30s)
call mpas_log_write('--- end interpolate SOILCOMP')

!
! Interpolate SOILCL2
!
geog_sub_path = 'soilgrids/texture_layer2/'
!
! Interpolate SOILCL1
!
geog_sub_path = 'soilgrids/texture_layer1/'

call mpas_log_write('--- start interpolate SOILCL2')
call interp_soil_texture('soilcl2', mesh, tree, trim(geog_data_path)//trim(geog_sub_path), &
supersample_fac=supersample_fac_30s)
call mpas_log_write('--- end interpolate SOILCL2')
call mpas_log_write('--- start interpolate SOILCL1')
call interp_soil_texture('soilcl1', mesh, tree, trim(geog_data_path)//trim(geog_sub_path), &
supersample_fac=supersample_fac_30s)
call mpas_log_write('--- end interpolate SOILCL1')

!
! Interpolate SOILCL3
!
geog_sub_path = 'soilgrids/texture_layer3/'
!
! Interpolate SOILCL2
!
geog_sub_path = 'soilgrids/texture_layer2/'

call mpas_log_write('--- start interpolate SOILCL3')
call interp_soil_texture('soilcl3', mesh, tree, trim(geog_data_path)//trim(geog_sub_path), &
supersample_fac=supersample_fac_30s)
call mpas_log_write('--- end interpolate SOILCL3')
call mpas_log_write('--- start interpolate SOILCL2')
call interp_soil_texture('soilcl2', mesh, tree, trim(geog_data_path)//trim(geog_sub_path), &
supersample_fac=supersample_fac_30s)
call mpas_log_write('--- end interpolate SOILCL2')

!
! Interpolate SOILCL4
!
geog_sub_path = 'soilgrids/texture_layer4/'
!
! Interpolate SOILCL3
!
geog_sub_path = 'soilgrids/texture_layer3/'

call mpas_log_write('--- start interpolate SOILCL3')
call interp_soil_texture('soilcl3', mesh, tree, trim(geog_data_path)//trim(geog_sub_path), &
supersample_fac=supersample_fac_30s)
call mpas_log_write('--- end interpolate SOILCL3')

!
! Interpolate SOILCL4
!
geog_sub_path = 'soilgrids/texture_layer4/'

call mpas_log_write('--- start interpolate SOILCL4')
call interp_soil_texture('soilcl4', mesh, tree, trim(geog_data_path)//trim(geog_sub_path), &
supersample_fac=supersample_fac_30s)
call mpas_log_write('--- end interpolate SOILCL4')
call mpas_log_write('--- start interpolate SOILCL4')
call interp_soil_texture('soilcl4', mesh, tree, trim(geog_data_path)//trim(geog_sub_path), &
supersample_fac=supersample_fac_30s)
call mpas_log_write('--- end interpolate SOILCL4')

end if

!
! Deallocate and free the KD Tree
Expand Down