Skip to content

Commit

Permalink
Merge pull request #34 from GEOS-ESM/develop
Browse files Browse the repository at this point in the history
GitFlow: Merge Develop into Main for release
  • Loading branch information
mathomp4 authored Feb 22, 2024
2 parents 9cc656f + 7a45c73 commit 46ee430
Show file tree
Hide file tree
Showing 9 changed files with 3,900 additions and 293 deletions.
38 changes: 34 additions & 4 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
version: 2.1

# Anchors in case we need to override the defaults from the orb
#baselibs_version: &baselibs_version v7.14.0
#bcs_version: &bcs_version v11.1.0
#baselibs_version: &baselibs_version v7.17.0
#bcs_version: &bcs_version v11.4.0

orbs:
ci: geos-esm/circleci-tools@1
ci: geos-esm/circleci-tools@2

workflows:
build-test:
Expand All @@ -22,4 +22,34 @@ workflows:
repo: GEOSgcm
checkout_fixture: true
mepodevelop: true
persist_workspace: false # Needs to be true to run fv3/gcm experiment, costs extra
persist_workspace: true # Needs to be true to run fv3/gcm experiment, costs extra

# Run AMIP GCM (1 hour, no ExtData)
- ci/run_gcm:
name: run-GCM-on-<< matrix.compiler >>
context:
- docker-hub-creds
matrix:
parameters:
compiler: [gfortran, ifort]
requires:
- build-GEOSgcm-on-<< matrix.compiler >>
repo: GEOSgcm
#baselibs_version: *baselibs_version
#bcs_version: *bcs_version

# Run Coupled GCM (1 hour, no ExtData)
- ci/run_gcm:
name: run-coupled-GCM-on-<< matrix.compiler >>
context:
- docker-hub-creds
matrix:
parameters:
compiler: [gfortran, ifort]
requires:
- build-GEOSgcm-on-<< matrix.compiler >>
repo: GEOSgcm
#baselibs_version: *baselibs_version
#bcs_version: *bcs_version
gcm_ocean_type: MOM6
change_layout: false
21 changes: 20 additions & 1 deletion GEOS_RadiationGridComp.F90
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ subroutine SetServices ( GC, RC )

integer :: I
type (MAPL_MetaComp), pointer :: MAPL

integer :: DO_OBIO

! Begin...

Expand Down Expand Up @@ -163,6 +163,11 @@ subroutine SetServices ( GC, RC )

call MAPL_GetResource(MAPL,USE_SATSIM_MISR,LABEL="USE_SATSIM_MISR:",default=0, RC=STATUS)
VERIFY_(STATUS)

! Decide if should make OBIO exports

call MAPL_GetResource ( MAPL, DO_OBIO, Label="USE_OCEANOBIOGEOCHEM:",DEFAULT=0, RC=STATUS)
VERIFY_(STATUS)

! set use_satsim if anything is toggled

Expand Down Expand Up @@ -404,6 +409,20 @@ subroutine SetServices ( GC, RC )
RC=STATUS )
VERIFY_(STATUS)

if (DO_OBIO/=0) then
call MAPL_AddExportSpec ( GC , &
SHORT_NAME = 'DROBIO', &
CHILD_ID = SOL, &
RC=STATUS )
VERIFY_(STATUS)

call MAPL_AddExportSpec ( GC , &
SHORT_NAME = 'DFOBIO', &
CHILD_ID = SOL, &
RC=STATUS )
VERIFY_(STATUS)
end if

call MAPL_AddExportSpec ( GC , &
SHORT_NAME = 'FSWBAND', &
CHILD_ID = SOL, &
Expand Down
33 changes: 28 additions & 5 deletions GEOSirrad_GridComp/GEOS_IrradGridComp.F90
Original file line number Diff line number Diff line change
Expand Up @@ -1465,8 +1465,9 @@ subroutine LW_Driver(IM,JM,LM,LATS,LONS,RC)
! TEMP ... see below
real(wp) :: press_ref_min, ptop
real(wp) :: temp_ref_min, tmin
real(wp) :: temp_ref_max, tmax
real(wp), parameter :: ptop_increase_OK_fraction = 0.01_wp
real(wp) :: tmin_increase_OK_Kelvin
real(wp) :: tmin_increase_OK_Kelvin, tmax_decrease_OK_Kelvin

! block size for efficient column processing (set from resource file)
integer :: rrtmgp_blockSize
Expand Down Expand Up @@ -1905,6 +1906,27 @@ subroutine LW_Driver(IM,JM,LM,LATS,LONS,RC)
t_sfc = real( reshape(TS ,(/ncol/)) ,kind=wp)
emis_sfc = real(spread(reshape(EMIS,(/ncol/)),1,nbnd),kind=wp)

! pmn: surface temperature KLUGE
! Currently k_dist%temp_ref_max = 355K ~ 82C, but GEOS-5 seems to
! sometimes exceed the maximum temperature. See more comments under
! layer temperature kluge below. We clip it here as a kluge.
temp_ref_max = k_dist%get_temp_max() - 0.01_wp
tmax = maxval(t_sfc)
if (tmax > temp_ref_max) then
! allow a small decrease of tmax
call MAPL_GetResource (MAPL, &
tmax_decrease_OK_Kelvin, 'RRTMGP_LW_TMAX_DEC_OK_K:', &
DEFAULT = 15._wp, __RC__)
if (tmax - temp_ref_max <= tmax_decrease_OK_Kelvin) then
where (t_sfc > temp_ref_max) t_sfc = temp_ref_max
else
write(*,*) ' A ', tmax_decrease_OK_Kelvin, &
'K decrease of tmax was insufficient'
write(*,*) ' RRTMGP, GEOS-5 t_sfc maximums (K)', temp_ref_max, tmax
TEST_('Found excessively warm surface temperature for RRTMGP')
endif
endif

! basic profiles
p_lay = real(reshape(PL ,(/ncol,LM /)), kind=wp)
t_lay = real(reshape(T ,(/ncol,LM /)), kind=wp)
Expand Down Expand Up @@ -1943,7 +1965,8 @@ subroutine LW_Driver(IM,JM,LM,LATS,LONS,RC)
! pmn: temperature KLUGE
! Currently k_dist%temp_ref_min = 160K but GEOS-5 has a global minimum
! temperature below this occasionally (< 1% of time). (The lowest temp
! seen is so far 151K). Consequently we will limit min(t_lay) to 160K.
! seen so far is above 145K). Consequently we will limit min(t_lay) to
! 160K.
! Find better solution, perhaps getting AER to produce a table with a
! lower minimum temperature.
! note: add 0.01K to lower limit so that t_lev calculated below will
Expand All @@ -1954,13 +1977,13 @@ subroutine LW_Driver(IM,JM,LM,LATS,LONS,RC)
! allow a small increase of tmin
call MAPL_GetResource (MAPL, &
tmin_increase_OK_Kelvin, 'RRTMGP_LW_TMIN_INC_OK_K:', &
DEFAULT = 10._wp, __RC__)
DEFAULT = 15._wp, __RC__)
if (temp_ref_min - tmin <= tmin_increase_OK_Kelvin) then
where (t_lay < temp_ref_min) t_lay = temp_ref_min
else
write(*,*) ' A ', tmin_increase_OK_Kelvin, &
'K increase of tmin was insufficient'
write(*,*) ' RRTMGP, GEOS-5 t_min (K)', temp_ref_min, tmin
write(*,*) ' RRTMGP, GEOS-5 t_lay minimums (K)', temp_ref_min, tmin
TEST_('Found excessively cold model temperature for RRTMGP')
endif
endif
Expand All @@ -1972,7 +1995,7 @@ subroutine LW_Driver(IM,JM,LM,LATS,LONS,RC)
! is an INTERPOLATION, and since the t_lay are already KLUGED to >= temp_ref_min, this should
! not be a problem. But this is why the t_lev calculation must occur AFTER the t_lay KLUGE.
! Note that t_lev(1) gets a copy of t_lev(2), so will also be in range. We are not worried
! about T2M being < temp_ref_min = 160K.
! about T2M being < temp_ref_min = 160K (surface values wont get that cold!)
! dzmid(k) is separation [m] between midpoints of layers k and k+1 (sign not important, positive
! here). dz ~ RT/g x dp/p by hydrostatic eqn and ideal gas eqn. The jump from LAYER k to k+1
! is centered on LEVEL k+1 since the LEVEL indices are one-based.
Expand Down
5 changes: 5 additions & 0 deletions GEOSsolar_GridComp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,8 @@ esma_add_library (${this}
if(MKL_FOUND)
target_compile_definitions(${this} PRIVATE HAVE_MKL)
endif ()

option(ENABLE_SOLAR_RADVAL "extra solar diagnostics mainly for developer validation" OFF)
if(ENABLE_SOLAR_RADVAL)
target_compile_definitions(${this} PRIVATE SOLAR_RADVAL)
endif ()
Loading

0 comments on commit 46ee430

Please sign in to comment.