Skip to content

Commit

Permalink
Merge branch 'develop' into feature/adarmenov/ignio
Browse files Browse the repository at this point in the history
  • Loading branch information
adarmenov committed Feb 1, 2023
2 parents df4695f + f4314c7 commit 04821aa
Show file tree
Hide file tree
Showing 26 changed files with 3,243 additions and 2,062 deletions.
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
version: 2.1

# Anchors to prevent forgetting to update a version
baselibs_version: &baselibs_version v7.5.0
baselibs_version: &baselibs_version v7.7.0
bcs_version: &bcs_version v10.23.0

orbs:
Expand Down
29 changes: 29 additions & 0 deletions .github/workflows/enforce-labels.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Enforce PR Labels

on:
pull_request:
types: [opened, labeled, unlabeled, edited, synchronize]

jobs:
require-label:
runs-on: ubuntu-latest
steps:
- uses: mheap/github-action-required-labels@v2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
mode: minimum
count: 1
labels: "0 diff,0 diff trivial,Non 0-diff,0 diff structural,0-diff trivial,Not 0-diff,0-diff,automatic,0-diff uncoupled"
add_comment: true
blocking-label:
runs-on: ubuntu-latest
steps:
- uses: mheap/github-action-required-labels@v2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
mode: exactly
count: 0
labels: "Contingent - DNA,Needs Lead Approval,Contingent -- Do Not Approve"
add_comment: true
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ subroutine SetServices ( GC, RC )
character(len=ESMF_MAXSTR) :: CATCHCN_VERSION
character(len=ESMF_MAXSTR) :: SURFRC
type(ESMF_Config) :: SCF
integer :: DO_GOSWIM, LSM_CHOICE, ATM_CO2
integer :: DO_GOSWIM, LSM_CHOICE, ATM_CO2, SNOW_ALBEDO_INFO
character(len=ESMF_MAXSTR) :: tmp
integer :: NUM_LDAS_ENSEMBLE, ens_id_width

Expand Down Expand Up @@ -82,6 +82,14 @@ subroutine SetServices ( GC, RC )
SCF = ESMF_ConfigCreate(rc=status) ; VERIFY_(STATUS)
call ESMF_ConfigLoadFile(SCF,SURFRC,rc=status) ; VERIFY_(STATUS)
call ESMF_ConfigGetAttribute (SCF, label='ATM_CO2:', value=ATM_CO2, DEFAULT=2, RC=STATUS) ; VERIFY_(STATUS)

! SNOW ALBEDO -- so far, only parameterization based on look-up table is implemented for CatchCN
! 0 : parameterization based on look-up table
! 1 : MODIS-derived snow albedo (backfilled with global land average snow albedo)
call ESMF_ConfigGetAttribute (SCF, label='SNOW_ALBEDO_INFO:', value=SNOW_ALBEDO_INFO, DEFAULT=0, RC=STATUS) ; VERIFY_(STATUS)

_ASSERT( SNOW_ALBEDO_INFO==0, "SNOW_ALBEDO_INFO must be 0 for CatchCN")

call ESMF_ConfigGetAttribute (SCF, label='N_CONST_LAND4SNWALB:' , value=DO_GOSWIM , DEFAULT=0, RC=STATUS); VERIFY_(STATUS)

if ( LSM_CHOICE == 2 ) then
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,8 @@ module GEOS_CatchGridCompMod
end type CATCH_WRAP
!#--

integer :: USE_ASCATZ0, Z0_FORMULATION, AEROSOL_DEPOSITION, N_CONST_LAND4SNWALB,CHOOSEMOSFC
integer :: USE_ASCATZ0, Z0_FORMULATION, AEROSOL_DEPOSITION, N_CONST_LAND4SNWALB
integer :: CHOOSEMOSFC, SNOW_ALBEDO_INFO
real :: SURFLAY ! Default (Ganymed-3 and earlier) SURFLAY=20.0 for Old Soil Params
! (Ganymed-4 and later ) SURFLAY=50.0 for New Soil Params
real :: FWETC, FWETL
Expand Down Expand Up @@ -227,15 +228,21 @@ subroutine SetServices ( GC, RC )
call MAPL_GetResource (SCF, FWETL, label='FWETL:', DEFAULT=0.025, __RC__ )
endif

! GOSWIM ANOW_ALBEDO
! SNOW ALBEDO
! 0 : parameterization based on look-up table
! 1 : MODIS-derived snow albedo (backfilled with global land average snow albedo)
call MAPL_GetResource (SCF, SNOW_ALBEDO_INFO, label='SNOW_ALBEDO_INFO:', DEFAULT=0, __RC__ )

! GOSWIM SNOW_ALBEDO
! 0 : GOSWIM snow albedo scheme is turned off
! 9 : i.e. N_CONSTIT in Stieglitz to turn on GOSWIM snow albedo scheme
call MAPL_GetResource (SCF, N_CONST_LAND4SNWALB, label='N_CONST_LAND4SNWALB:', DEFAULT=0 , __RC__ )
call MAPL_GetResource (SCF, N_CONST_LAND4SNWALB, label='N_CONST_LAND4SNWALB:', DEFAULT=0, __RC__ )

! 1: Use all GOCART aerosol values, 0: turn OFF everythying,
! 2: turn off dust ONLY,3: turn off Black Carbon ONLY,4: turn off Organic Carbon ONLY
! __________________________________________
call MAPL_GetResource (SCF, AEROSOL_DEPOSITION, label='AEROSOL_DEPOSITION:', DEFAULT=0 , __RC__ )
call MAPL_GetResource (SCF, AEROSOL_DEPOSITION, label='AEROSOL_DEPOSITION:', DEFAULT=0, __RC__ )

call ESMF_ConfigDestroy(SCF, __RC__)

! Set the Run entry points
Expand Down Expand Up @@ -1369,6 +1376,19 @@ subroutine SetServices ( GC, RC )
RC=STATUS )
VERIFY_(STATUS)

if (SNOW_ALBEDO_INFO == 1) then
call MAPL_AddInternalSpec(GC ,&
LONG_NAME = 'effective_snow_albedo' ,&
UNITS = '1' ,&
SHORT_NAME = 'SNOWALB' ,&
FRIENDLYTO = trim(COMP_NAME) ,&
DIMS = MAPL_DimsTileOnly ,&
VLOCATION = MAPL_VLocationNone ,&
RESTART = MAPL_RestartRequired ,&
RC=STATUS )
VERIFY_(STATUS)
endif

call MAPL_AddInternalSpec(GC ,&
LONG_NAME = 'surface_heat_exchange_coefficient',&
UNITS = 'kg m-2 s-1' ,&
Expand Down Expand Up @@ -3763,6 +3783,7 @@ subroutine Driver ( RC )
real, dimension(:), pointer :: psis
real, dimension(:), pointer :: bee
real, dimension(:), pointer :: poros
real, dimension(:), pointer :: snowalb
real, dimension(:), pointer :: wpwet
real, dimension(:), pointer :: cond
real, dimension(:), pointer :: gnu
Expand Down Expand Up @@ -4130,6 +4151,7 @@ subroutine Driver ( RC )
integer :: nv, nVars
integer :: nDims,dimSizes(3)
integer :: ldas_ens_id, ldas_first_ens_id

!#---

! --------------------------------------------------------------------------
Expand Down Expand Up @@ -4350,8 +4372,8 @@ subroutine Driver ( RC )
call MAPL_GetPointer(INTERNAL,CM ,'CM' ,RC=STATUS); VERIFY_(STATUS)
call MAPL_GetPointer(INTERNAL,CQ ,'CQ' ,RC=STATUS); VERIFY_(STATUS)
call MAPL_GetPointer(INTERNAL,FR ,'FR' ,RC=STATUS); VERIFY_(STATUS)
call MAPL_GetPointer(INTERNAL,DCQ ,'DCQ' ,RC=STATUS); VERIFY_(STATUS)
call MAPL_GetPointer(INTERNAL,DCH ,'DCH' ,RC=STATUS); VERIFY_(STATUS)
call MAPL_GetPointer(INTERNAL,DCQ ,'DCQ' ,RC=STATUS); VERIFY_(STATUS)
call MAPL_GetPointer(INTERNAL,DCH ,'DCH' ,RC=STATUS); VERIFY_(STATUS)
if (N_CONST_LAND4SNWALB /= 0) then
call MAPL_GetPointer(INTERNAL,RDU001 ,'RDU001' , RC=STATUS); VERIFY_(STATUS)
call MAPL_GetPointer(INTERNAL,RDU002 ,'RDU002' , RC=STATUS); VERIFY_(STATUS)
Expand Down Expand Up @@ -4849,10 +4871,26 @@ subroutine Driver ( RC )
RHOFS, &
SNWALB_VISMAX, SNWALB_NIRMAX, SLOPE, &
WESNN, HTSNNN, SNDZN, &
ALBVR, ALBNR, ALBVF, ALBNF, & ! instantaneous snow-free albedos on tiles
SNOVR, SNONR, SNOVF, SNONF, & ! instantaneous snow albedos on tiles
ALBVR, ALBNR, ALBVF, ALBNF, & ! instantaneous snow-free albedos on tiles
SNOVR, SNONR, SNOVF, SNONF, & ! instantaneous snow albedos on tiles
RCONSTIT, UUU, TPSN1OUT1, DRPAR, DFPAR)

if (SNOW_ALBEDO_INFO == 1) then

! use MODIS-derived snow albedo from bcs (via Catch restart)
!
! as a restart parameter from the bcs, snow albedo must not have no-data-values
! (checks for unphysical values should be in the make_bcs package)

call MAPL_GetPointer(INTERNAL,SNOWALB,'SNOWALB',RC=STATUS); VERIFY_(STATUS)

SNOVR = SNOWALB
SNONR = SNOWALB
SNOVF = SNOWALB
SNONF = SNOWALB

endif

! --------------------------------------------------------------------------
! albedo/swnet partitioning
! --------------------------------------------------------------------------
Expand Down Expand Up @@ -5531,6 +5569,20 @@ subroutine Driver ( RC )
SNOVR, SNONR, SNOVF, SNONF, & ! instantaneous snow albedos on tiles
RCONSTIT, UUU, TPSN1OUT1,DRPAR, DFPAR)

if (SNOW_ALBEDO_INFO == 1) then

! use MODIS-derived snow albedo from bcs (via Catch restart)
!
! as a restart parameter from the bcs, snow albedo must not have no-data-values
! (checks for unphysical values should be in the make_bcs package)

SNOVR = SNOWALB
SNONR = SNOWALB
SNOVF = SNOWALB
SNONF = SNOWALB

endif

ALBVR = ALBVR *(1.-ASNOW) + SNOVR *ASNOW
ALBVF = ALBVF *(1.-ASNOW) + SNOVF *ASNOW
ALBNR = ALBNR *(1.-ASNOW) + SNONR *ASNOW
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,16 @@
#
# GEOSagcm=>MODIS_DVG: 0 # NOT yet used in GEOSldas

# ---- SNOW ALBEDO
#
# 0 : Snow albedo parameterization based on look-up table (default)
# 1 : Snow albedo derived from MODIS Collection MOD10A1.061 (Feb/2000 - Mar/2022)
# - backfilled with global land average snow albedo where unavailable
# - must use compatible bcs version (e.g., v06, v08, v09)
# - NOT YET AVAILABLE FOR CatchCN
#
# GEOSagcm=>SNOW_ALBEDO_INFO: 0
# GEOSldas=>SNOW_ALBEDO_INFO: 0

#--------------------------------------------------------#
# GOSWIM aerosol deposition on surface snow #
Expand Down Expand Up @@ -234,3 +244,5 @@
#
# GEOSagcm=>PRESCRIBE_DVG: 0
# GEOSldas=>PRESCRIBE_DVG: 0


Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,8 @@ esma_set_this(OVERRIDE raster)
set (srcs
date_time_util.F90
leap_year.F90
easeV1_conv.F90
EASE_conv.F90
mod_process_hres_data.F90
easeV2_conv.F90
rasterize.F90
read_riveroutlet.F90
CubedSphere_GridMod.F90
Expand All @@ -17,6 +16,8 @@ if(NOT FORTRAN_COMPILER_SUPPORTS_FINDLOC)
list(APPEND srcs findloc.F90)
endif ()

set_source_files_properties(mkMITAquaRaster.F90 PROPERTIES COMPILE_FLAGS "${BYTERECLEN}")

esma_add_library(${this} SRCS ${srcs} DEPENDENCIES MAPL GEOS_SurfaceShared GEOS_LandShared esmf NetCDF::NetCDF_Fortran OpenMP::OpenMP_Fortran OpenMP::OpenMP_C)

if(NOT FORTRAN_COMPILER_SUPPORTS_FINDLOC)
Expand Down Expand Up @@ -45,7 +46,6 @@ ecbuild_add_executable (TARGET mkMITAquaRaster.x SOURCES mkMITAquaRaster.F90 LIB
ecbuild_add_executable (TARGET mkMOMAquaRaster.x SOURCES mkMOMAquaRaster.F90 LIBS MAPL ${this})
ecbuild_add_executable (TARGET FillMomGrid.x SOURCES FillMomGrid.F90 LIBS MAPL ${this})
ecbuild_add_executable (TARGET mk_runofftbl.x SOURCES mk_runofftbl.F90 LIBS MAPL ${this})
ecbuild_add_executable (TARGET mkSMAPTilesPara.x SOURCES mkSMAPTilesPara.F90 LIBS MAPL ${this})
ecbuild_add_executable (TARGET mkSMAPTilesPara_v2.x SOURCES mkSMAPTilesPara_v2.F90 LIBS MAPL ${this})
ecbuild_add_executable (TARGET mkEASETilesParam.x SOURCES mkEASETilesParam.F90 LIBS MAPL ${this})

install(PROGRAMS make_bcs clsm_plots.pro plot_curves.pro create_README.csh plot_curves.csh DESTINATION bin)
Loading

0 comments on commit 04821aa

Please sign in to comment.