Skip to content

Commit

Permalink
Bugfix for GNU compiler in io/module_wrt_grid_comp.F90; bugfix in gfs…
Browse files Browse the repository at this point in the history
…physics/physics/sfc_diff.f; updates for CCPP
  • Loading branch information
climbfuji committed Apr 21, 2020
1 parent 1d2ff50 commit af3836f
Show file tree
Hide file tree
Showing 5 changed files with 70 additions and 2 deletions.
16 changes: 16 additions & 0 deletions gfsphysics/GFS_layer/GFS_typedefs.F90
Original file line number Diff line number Diff line change
Expand Up @@ -1694,6 +1694,7 @@ module GFS_typedefs
real (kind=kind_phys), pointer :: ep1d_land(:) => null() !<
real (kind=kind_phys), pointer :: ep1d_ocean(:) => null() !<
real (kind=kind_phys), pointer :: evap(:) => null() !<
real (kind=kind_phys), pointer :: evapq(:) => null() !<
real (kind=kind_phys), pointer :: evap_ice(:) => null() !<
real (kind=kind_phys), pointer :: evap_land(:) => null() !<
real (kind=kind_phys), pointer :: evap_ocean(:) => null() !<
Expand Down Expand Up @@ -1739,7 +1740,10 @@ module GFS_typedefs
real (kind=kind_phys), pointer :: gwdcv(:,:) => null() !<
integer :: h2o_coeff !<
real (kind=kind_phys), pointer :: h2o_pres(:) => null() !<
real (kind=kind_phys), pointer :: hefac(:) => null() !<
real (kind=kind_phys), pointer :: hffac(:) => null() !<
real (kind=kind_phys), pointer :: hflx(:) => null() !<
real (kind=kind_phys), pointer :: hflxq(:) => null() !<
real (kind=kind_phys), pointer :: hflx_ice(:) => null() !<
real (kind=kind_phys), pointer :: hflx_land(:) => null() !<
real (kind=kind_phys), pointer :: hflx_ocean(:) => null() !<
Expand Down Expand Up @@ -5948,6 +5952,7 @@ subroutine interstitial_create (Interstitial, IM, Model)
allocate (Interstitial%ep1d_land (IM))
allocate (Interstitial%ep1d_ocean (IM))
allocate (Interstitial%evap (IM))
allocate (Interstitial%evapq (IM))
allocate (Interstitial%evap_ice (IM))
allocate (Interstitial%evap_land (IM))
allocate (Interstitial%evap_ocean (IM))
Expand Down Expand Up @@ -5990,7 +5995,10 @@ subroutine interstitial_create (Interstitial, IM, Model)
allocate (Interstitial%gwdcu (IM,Model%levs))
allocate (Interstitial%gwdcv (IM,Model%levs))
allocate (Interstitial%h2o_pres (levh2o))
allocate (Interstitial%hefac (IM))
allocate (Interstitial%hffac (IM))
allocate (Interstitial%hflx (IM))
allocate (Interstitial%hflxq (IM))
allocate (Interstitial%hflx_ice (IM))
allocate (Interstitial%hflx_land (IM))
allocate (Interstitial%hflx_ocean (IM))
Expand Down Expand Up @@ -6588,6 +6596,7 @@ subroutine interstitial_phys_reset (Interstitial, Model)
Interstitial%ep1d_land = huge
Interstitial%ep1d_ocean = huge
Interstitial%evap = clear_val
Interstitial%evapq = clear_val
Interstitial%evap_ice = huge
Interstitial%evap_land = huge
Interstitial%evap_ocean = huge
Expand Down Expand Up @@ -6626,7 +6635,10 @@ subroutine interstitial_phys_reset (Interstitial, Model)
Interstitial%gflx_ocean = clear_val
Interstitial%gwdcu = clear_val
Interstitial%gwdcv = clear_val
Interstitial%hefac = clear_val
Interstitial%hffac = clear_val
Interstitial%hflx = clear_val
Interstitial%hflxq = clear_val
Interstitial%hflx_ice = huge
Interstitial%hflx_land = huge
Interstitial%hflx_ocean = huge
Expand Down Expand Up @@ -6899,6 +6911,7 @@ subroutine interstitial_print(Interstitial, Model, mpirank, omprank, blkno)
write (0,*) 'sum(Interstitial%ep1d_land ) = ', sum(Interstitial%ep1d_land )
write (0,*) 'sum(Interstitial%ep1d_ocean ) = ', sum(Interstitial%ep1d_ocean )
write (0,*) 'sum(Interstitial%evap ) = ', sum(Interstitial%evap )
write (0,*) 'sum(Interstitial%evapq ) = ', sum(Interstitial%evapq )
write (0,*) 'sum(Interstitial%evap_ice ) = ', sum(Interstitial%evap_ice )
write (0,*) 'sum(Interstitial%evap_land ) = ', sum(Interstitial%evap_land )
write (0,*) 'sum(Interstitial%evap_ocean ) = ', sum(Interstitial%evap_ocean )
Expand Down Expand Up @@ -6941,7 +6954,10 @@ subroutine interstitial_print(Interstitial, Model, mpirank, omprank, blkno)
write (0,*) 'sum(Interstitial%gflx_ocean ) = ', sum(Interstitial%gflx_ocean )
write (0,*) 'sum(Interstitial%gwdcu ) = ', sum(Interstitial%gwdcu )
write (0,*) 'sum(Interstitial%gwdcv ) = ', sum(Interstitial%gwdcv )
write (0,*) 'sum(Interstitial%hefac ) = ', sum(Interstitial%hefac )
write (0,*) 'sum(Interstitial%hffac ) = ', sum(Interstitial%hffac )
write (0,*) 'sum(Interstitial%hflx ) = ', sum(Interstitial%hflx )
write (0,*) 'sum(Interstitial%hflxq ) = ', sum(Interstitial%hflxq )
write (0,*) 'sum(Interstitial%hflx_ice ) = ', sum(Interstitial%hflx_ice )
write (0,*) 'sum(Interstitial%hflx_land ) = ', sum(Interstitial%hflx_land )
write (0,*) 'sum(Interstitial%hflx_ocean ) = ', sum(Interstitial%hflx_ocean )
Expand Down
42 changes: 42 additions & 0 deletions gfsphysics/GFS_layer/GFS_typedefs.meta
Original file line number Diff line number Diff line change
Expand Up @@ -3438,6 +3438,20 @@
dimensions = ()
type = real
kind = kind_phys
[z0fac]
standard_name = surface_roughness_fraction_factor
long_name = surface roughness fraction for canopy heat storage parameterization
units = none
dimensions = ()
type = real
kind = kind_phys
[e0fac]
standard_name = latent_heat_flux_fraction_factor_relative_to_sensible_heat_flux
long_name = latent heat flux fraction relative to sensible heat flux for canopy heat storage parameterization
units = none
dimensions = ()
type = real
kind = kind_phys
[nca]
standard_name = number_of_independent_cellular_automata
long_name = number of independent cellular automata
Expand Down Expand Up @@ -6751,6 +6765,13 @@
dimensions = (horizontal_dimension)
type = real
kind = kind_phys
[evapq]
standard_name = kinematic_surface_upward_latent_heat_flux_reduced_by_surface_roughness
long_name = kinematic surface upward latent heat flux reduced by surface roughness
units = kg kg-1 m s-1
dimensions = (horizontal_dimension)
type = real
kind = kind_phys
[evap_ocean]
standard_name = kinematic_surface_upward_latent_heat_flux_over_ocean
long_name = kinematic surface upward latent heat flux over ocean
Expand Down Expand Up @@ -7167,13 +7188,34 @@
dimensions = (vertical_dimension_of_h2o_forcing_data)
type = real
kind = kind_phys
[hefac]
standard_name = surface_upward_latent_heat_flux_reduction_factor
long_name = surface upward latent heat flux reduction factor from canopy heat storage
units = none
dimensions = (horizontal_dimension)
type = real
kind = kind_phys
[hffac]
standard_name = surface_upward_sensible_heat_flux_reduction_factor
long_name = surface upward sensible heat flux reduction factor from canopy heat storage
units = none
dimensions = (horizontal_dimension)
type = real
kind = kind_phys
[hflx]
standard_name = kinematic_surface_upward_sensible_heat_flux
long_name = kinematic surface upward sensible heat flux
units = K m s-1
dimensions = (horizontal_dimension)
type = real
kind = kind_phys
[hflxq]
standard_name = kinematic_surface_upward_sensible_heat_flux_reduced_by_surface_roughness
long_name = kinematic surface upward sensible heat flux reduced by surface roughness
units = K m s-1
dimensions = (horizontal_dimension)
type = real
kind = kind_phys
[hflx_ocean]
standard_name = kinematic_surface_upward_sensible_heat_flux_over_ocean
long_name = kinematic surface upward sensible heat flux over ocean
Expand Down
2 changes: 1 addition & 1 deletion gfsphysics/physics/sfc_diff.f
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ subroutine sfc_diff(im,ps,t1,q1,z1, wind, !intent(in)
!
czilc = 10.0 ** (- 4. * z0max) ! Trier et al. (2011, WAF)
ztmax = z0max * exp( - czilc * ca
& * 258.2 * sqrt(ustar(i,1)*z0max) )
& * 258.2 * sqrt(ustar(i,2)*z0max) )
!
ztmax = max(ztmax, 1.0e-6)
!
Expand Down
10 changes: 10 additions & 0 deletions gfsphysics/physics/sflx.f
Original file line number Diff line number Diff line change
Expand Up @@ -1186,6 +1186,8 @@ subroutine nopac
! quartz - real, soil quartz content 1 !
! fxexp - real, bare soil evaporation exponent 1 !
! csoil - real, soil heat capacity 1 !
! lheatstrg- logical, flag for canopy heat storage 1 !
! parameterization !
! !
! input/outputs from and to the calling program: !
! cmc - real, canopy moisture content 1 !
Expand Down Expand Up @@ -2214,6 +2216,8 @@ subroutine snopac
! csoil - real, soil heat capacity 1 !
! flx2 - real, freezing rain latent heat flux 1 !
! snowng - logical, snow flag 1 !
! lheatstrg- logical, flag for canopy heat storage 1 !
! parameterization !
! !
! input/outputs from and to the calling program: !
! prcp1 - real, effective precip 1 !
Expand Down Expand Up @@ -3120,6 +3124,9 @@ subroutine shflx &
! quartz - real, soil quartz content 1 !
! csoil - real, soil heat capacity 1 !
! vegtyp - integer, vegtation type 1 !
! shdfac - real, aeral coverage of green vegetation 1 !
! lheatstrg- logical, flag for canopy heat storage 1 !
! parameterization !
! !
! input/outputs: !
! stc - real, soil temp nsoil !
Expand Down Expand Up @@ -3875,6 +3882,9 @@ subroutine hrt &
! quartz - real, soil quartz content 1 !
! csoil - real, soil heat capacity 1 !
! vegtyp - integer, vegetation type 1 !
! shdfac - real, aeral coverage of green vegetation 1 !
! lheatstrg- logical, flag for canopy heat storage 1 !
! parameterization !
! !
! input/outputs: !
! sh2o - real, unfrozen soil moisture nsoil !
Expand Down
2 changes: 1 addition & 1 deletion io/module_wrt_grid_comp.F90
Original file line number Diff line number Diff line change
Expand Up @@ -809,7 +809,7 @@ subroutine wrt_initialize(wrt_comp, imp_state_write, exp_state_write, clock, rc)
call ESMF_AttributeSet(wrt_int_state%wrtFB(i), convention="NetCDF", purpose="FV3", &
name="grid", value="latlon", rc=rc)
call ESMF_AttributeAdd(wrt_int_state%wrtFB(i), convention="NetCDF", purpose="FV3", &
attrList=(/"lonstart","latstart","lonlast","latlast"/), rc=rc)
attrList=(/"lonstart","latstart","lonlast ","latlast "/), rc=rc)
call ESMF_AttributeSet(wrt_int_state%wrtFB(i), convention="NetCDF", purpose="FV3", &
name="lonstart", value=wrt_int_state%lonstart, rc=rc)
call ESMF_AttributeSet(wrt_int_state%wrtFB(i), convention="NetCDF", purpose="FV3", &
Expand Down

0 comments on commit af3836f

Please sign in to comment.