Skip to content

Commit

Permalink
fixed surface cold traps
Browse files Browse the repository at this point in the history
  • Loading branch information
Nicholaswogan committed Nov 15, 2024
1 parent 40d3b04 commit c1316ae
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
cmake_minimum_required(VERSION "3.14")
cmake_policy(SET CMP0148 OLD) # To suppress a warning emerging from scikit-build

project(Clima LANGUAGES Fortran C VERSION "0.5.4")
project(Clima LANGUAGES Fortran C VERSION "0.5.5")
set(PHOTOCHEM_CLIMA_DATA_VERSION "0.2.0")

set(CMAKE_Fortran_MODULE_DIRECTORY "${CMAKE_BINARY_DIR}/modules")
Expand Down
14 changes: 14 additions & 0 deletions src/adiabat/clima_adiabat_rc.f90
Original file line number Diff line number Diff line change
Expand Up @@ -383,6 +383,20 @@ subroutine integrate(d, err)

endif

! Some logic to identify cold traps at the surface.
if (d%j == 2 .and. .not.d%in_convecting_region) then
call d%T%evaluate(log10(Pn), T_root)
call root_fcn(d, Pn, T_root, d%gout)
do i = 1,d%sp%ng
if (d%sp_type(i) == CondensingSpeciesType .and. d%gout(i) <= 0.0_dp) then
! If d%gout(i) is <= 0, this means a moist species is increasing with decreasing pressure
! so, we must switch it to a dry species.
d%sp_type(i) = DrySpeciesType
endif
enddo
call update_f_i_dry(d, Pn, d%f_i(1,:))
endif

call dop%initialize(fcn=right_hand_side_dop, solout=solout_dop, n=n, &
iprint=0, icomp=icomp, status_ok=status_ok)
dop%d => d
Expand Down

0 comments on commit c1316ae

Please sign in to comment.