Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
51 commits
Select commit Hold shift + click to select a range
fcf07dc
Changes in deltaT_basin inversion
whlipscomb Feb 6, 2025
4cc22ad
Inversion changes, including E inversion with a speed target
whlipscomb Feb 27, 2025
a11a99c
Optional min value for thermal_forcing_basin; new RMSE diagnostics
whlipscomb Mar 8, 2025
f61f337
Added some ice age diagnostics
whlipscomb Mar 14, 2025
a1928f6
Added Laplacian smoothing terms for inversion
whlipscomb Mar 20, 2025
8c8462e
Added an option to toggle inversion
whlipscomb Apr 2, 2025
319d8d3
Removed thck_error_exponent parameter
whlipscomb Apr 2, 2025
26d8b22
Moved some inversion code to the inversion module
whlipscomb Apr 4, 2025
51718ef
Changed relaxation and smoothing for inactive cells during inversion
whlipscomb Apr 18, 2025
28a7dff
Cleaned up some diagnostic prints
whlipscomb Apr 18, 2025
b5f5679
Created a new module, glissade_mass_balance
whlipscomb Apr 19, 2025
616fabf
Moved code to the new glissade_mass_balance module
whlipscomb Apr 19, 2025
067daf8
Rearranged SMB calculations, removed some acab fields
whlipscomb Apr 20, 2025
87a2317
Changed internal units of acab and bmlt variables to m/s
whlipscomb Apr 21, 2025
2658b59
Removed the tim0 scale parameter
whlipscomb Apr 21, 2025
e34d077
Removed the len0 scale parameter
whlipscomb Apr 21, 2025
14c845f
Fixed some thickness roundoff issues
whlipscomb Apr 21, 2025
bde7535
Removed the thk0 scale parameter
whlipscomb Apr 21, 2025
9a08b77
Removed the vel0 scale parameter
whlipscomb Apr 22, 2025
b4cd41d
Removed the acc0 scale parameter
whlipscomb Apr 22, 2025
9d16020
Removed scale parameters tau0, vis0, and evs0
whlipscomb Apr 22, 2025
b3b7862
Removed scale parameters in the glimmer_scales module
whlipscomb Apr 22, 2025
7acc4f0
Code cleanup: Removed commented-out lines with scale factors
whlipscomb May 4, 2025
9efda97
Restart fix for glacier runs
whlipscomb Feb 21, 2025
c613d5b
Implemented a slope correction for the DIVA solver
whlipscomb May 22, 2025
549bb67
Changes for the slab test case
whlipscomb May 22, 2025
d6ae9bf
Fixed an ISMIP-HOM script
whlipscomb May 22, 2025
9fe1b3e
Created a new subroutine to prepare climate forcing
whlipscomb May 26, 2025
51d82df
Changes for glacier spin-up, anomaly forcing, and diagnostics
whlipscomb May 25, 2025
d7ef7f3
Set diva_slope_correction = .true. by default
whlipscomb May 27, 2025
7602d83
DIVA velocity fix for marine ice
whlipscomb May 31, 2025
7af1c26
Merging main into lipscomb/ais_spinup
whlipscomb May 31, 2025
52403d9
Merge branch 'lipscomb/ais_spinup.v2' into lipscomb/smb_cleanup.v2
whlipscomb May 31, 2025
2e69627
Another DIVA velocity fix
whlipscomb May 31, 2025
6852515
Removed toggling and phaseout options for inversion
whlipscomb Jun 1, 2025
9a2f976
Fixed rare remapping error
whlipscomb Jun 1, 2025
0a52cb2
Set f_ground = 1 for ice-free land cells
whlipscomb Jun 1, 2025
36f61bc
Cleaned up diagnostic prints
whlipscomb Jun 20, 2025
fafb9e6
Cleaned up more diagnostic prints
whlipscomb Jul 8, 2025
a3082a1
Replaced print statement with write statements
whlipscomb Jul 8, 2025
e168573
Modified the extrapolation of ocean thermal forcing to cavities
whlipscomb Jul 21, 2025
73bb6bb
Fixed some circular dependencies
whlipscomb Jul 25, 2025
6319964
Turned off Laplacian smoothing of coulomb_c for grounded ice
whlipscomb Aug 3, 2025
2350f8e
Option to invert for coulomb_c at basin scale
whlipscomb Aug 6, 2025
7ea6529
Extended basal_hydro type with macroporous-sheet and cavity-sheet opt…
whlipscomb Sep 3, 2024
d1db84b
Cleaned up the basin-scale inversion options
whlipscomb Aug 22, 2025
dd302a6
Modified the effecpress calculation and the relation of N to bwat
whlipscomb Aug 25, 2025
ede79b8
Moved subroutine point_diag to glimmer_utils
whlipscomb Aug 25, 2025
79b60aa
Added a PDD option for computing the SMB
whlipscomb Aug 25, 2025
0d3aab5
Modified coulomb_c basin-scale inversion
whlipscomb Oct 4, 2025
5ec5553
Changed the function relating N to subglacial bwat
whlipscomb Oct 4, 2025
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
10 changes: 5 additions & 5 deletions cism_driver/cism_driver.F90
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,11 @@ program cism_driver
type(gcm_to_cism_type) :: g2c

if (command_argument_count() == 0) then
print *,""
print *,"Call cism_driver with either 1 or 2 arguments. Examples:"
print *,"cism_driver ice_sheet.config"
print *,"cism_driver ice_sheet.config climate.config"
print *,""
write(6,*) ""
write(6,*) "Call cism_driver with either 1 or 2 arguments. Examples:"
write(6,*) "cism_driver ice_sheet.config"
write(6,*) "cism_driver ice_sheet.config climate.config"
write(6,*) ""
stop
end if

Expand Down
16 changes: 8 additions & 8 deletions cism_driver/cism_external_dycore_interface.F90
Original file line number Diff line number Diff line change
Expand Up @@ -64,16 +64,16 @@ subroutine cism_init_external_dycore(external_dycore_type,model)


#ifdef CISM_HAS_EXTERNAL_DYCORE
! print *,"Initializing external dycore interface."
! write(6,*) "Initializing external dycore interface."
call gtd_init_dycore_interface()

call parallel_barrier()
! print *,"Initializing external dycore."
! write(6,*) "Initializing external dycore."
call gtd_init_dycore(model,external_dycore_model_index)
model%options%external_dycore_model_index = external_dycore_model_index
call parallel_barrier()
#else
print *,"ERROR: The program was not built with an external dynamic core."
write(6,*) "ERROR: The program was not built with an external dynamic core."
#endif

end subroutine cism_init_external_dycore
Expand Down Expand Up @@ -108,12 +108,12 @@ subroutine cism_run_external_dycore(external_dycore_model_index,cur_time,time_in
external_dycore_model_index = 1

call parallel_barrier()
! print *,"Running external dycore."
! write(6,*) "Running external dycore."
call gtd_run_dycore(external_dycore_model_index,cur_time,time_inc)
! print *,"Completed Dycore Run."
! write(6,*) "Completed Dycore Run."
call parallel_barrier()
#else
print *,"ERROR: The program was not built with an external dynamic core."
write(6,*) "ERROR: The program was not built with an external dynamic core."
#endif

end subroutine cism_run_external_dycore
Expand Down Expand Up @@ -157,12 +157,12 @@ subroutine cism_finalize_external_dycore(external_dycore_type,model)
external_dycore_model_index = 1

call parallel_barrier()
! print *,"Finalizing external dycore."
! write(6,*) "Finalizing external dycore."
call gtd_delete_dycore(external_dycore_model_index)
model%options%external_dycore_model_index = external_dycore_model_index
call parallel_barrier()
#else
print *,"ERROR: The program was not built with an external dynamic core."
write(6,*) "ERROR: The program was not built with an external dynamic core."
#endif

end subroutine cism_finalize_external_dycore
Expand Down
10 changes: 4 additions & 6 deletions cism_driver/cism_front_end.F90
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ subroutine cism_init_dycore(model)
use glide_io, only: glide_io_writeall
use glide_stop, only: glide_finalise
use glide_diagnostics
use glimmer_paramets, only: thk0
use profile, only: profile_init, t_startf, t_stopf, t_adj_detailf
! use glimmer_to_dycore

Expand All @@ -71,7 +70,7 @@ subroutine cism_init_dycore(model)
integer :: wd
logical :: do_glide_init

! print *,'Entering cism_init_dycore'
! write(6,*) 'Entering cism_init_dycore'

!TODO - call this only for parallel runs?
! call parallel_initialise
Expand Down Expand Up @@ -257,7 +256,6 @@ subroutine cism_run_dycore(model)
use glide_io, only: glide_io_writeall
use glide_stop, only: glide_finalise
use glide_diagnostics
use glimmer_paramets, only: thk0
use profile, only: t_startf, t_stopf

use cism_external_dycore_interface
Expand Down Expand Up @@ -306,7 +304,7 @@ subroutine cism_run_dycore(model)
time = time + model%numerics%tinc
model%numerics%time = time ! TODO This is redundant with what is happening in glide/glissade, but this is needed for forcing to work properly.
endif
! print *,"external_dycore_type: ",model%options%external_dycore_type
! write(6,*) "external_dycore_type: ",model%options%external_dycore_type

!if (model%options%external_dycore_type .EQ. 0) then ! NO_EXTERNAL_DYCORE) then
! if (model%options%whichdycore == DYCORE_GLIDE) then
Expand All @@ -333,7 +331,7 @@ subroutine cism_run_dycore(model)
call glissade_tstep(model,time)

case (DYCORE_BISICLES)
! print *,'Using External Dycore'
! write(6,*) 'Using External Dycore'
! The time variable gets incremented within this call:
dt = model%numerics%tinc

Expand All @@ -349,7 +347,7 @@ subroutine cism_run_dycore(model)
call t_stopf('tstep')
!endif

! print*, 'Current time, tstep_count =', model%numerics%time, model%numerics%tstep_count
! write(6,*) 'Current time, tstep_count =', model%numerics%time, model%numerics%tstep_count

! write ice sheet diagnostics to log file at desired interval (model%numerics%dt_diag)

Expand Down
24 changes: 5 additions & 19 deletions cism_driver/eismint_forcing.F90
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ subroutine eismint_initialise(eismint_climate,config)
! initialise eismint_climate model

use glimmer_global, only: dp
use glimmer_paramets, only: thk0, scyr, tim0
use glimmer_physcon, only: scyr
use glimmer_config
use glide_types
Expand All @@ -67,17 +66,7 @@ subroutine eismint_initialise(eismint_climate,config)
type(eismint_climate_type) :: eismint_climate ! structure holding climate info
type(ConfigSection), pointer :: config ! structure holding sections of configuration file

!WHL - The old scaling looked like this: eismint_climate%nmsb(1) = eismint_climate%nmsb(1) / (acc0 * scyr)
! where acc0 = thk0*vel0/len0.
! I replaced (acc0 * scyr) with acab_scale = scyr*thk0/tim0, where tim0 = len0/vel0.
! This is the scaling used in other parts of the code, including Glint.
! It can be shown (but is not immediately obvious) that acab_scale = acc0 * scyr.
! This scale factor assumes that the input mass balance has units of m/yr.
!
! Note: We should not use the parameter scale_acab in glimmer_scales because
! it may not have been initialized yet.

real(dp), parameter :: acab_scale = scyr*thk0/tim0
real(dp), parameter :: acab_scale = scyr

call eismint_readconfig(eismint_climate,config)
call eismint_printconfig(eismint_climate)
Expand All @@ -91,7 +80,6 @@ subroutine eismint_initialise(eismint_climate,config)
eismint_climate%nmsb(1) = eismint_climate%nmsb(1) / acab_scale

case(2) ! EISMINT-1 moving margin
eismint_climate%airt(2) = eismint_climate%airt(2) * thk0
eismint_climate%nmsb(1) = eismint_climate%nmsb(1) / acab_scale
eismint_climate%nmsb(2) = eismint_climate%nmsb(2) / acab_scale

Expand Down Expand Up @@ -291,9 +279,8 @@ subroutine eismint_massbalance(eismint_climate,model,time)

use glimmer_global, only : dp
use glide_types
use glimmer_paramets, only : len0, acc0, scyr
use glimmer_paramets, only : scyr
use glimmer_physcon, only : pi
use glimmer_scales, only : scale_acab
use cism_parallel, only: parallel_globalindex

implicit none
Expand All @@ -310,7 +297,7 @@ subroutine eismint_massbalance(eismint_climate,model,time)
ewct = (model%parallel%global_ewn + 1.d0) / 2.d0
nsct = (model%parallel%global_nsn + 1.d0) / 2.d0

grid = real(model%numerics%dew,dp) * len0
grid = real(model%numerics%dew,dp)

if (model%options%periodic_ew) then
periodic = 0.d0
Expand All @@ -325,7 +312,7 @@ subroutine eismint_massbalance(eismint_climate,model,time)
model%climate%acab(:,:) = eismint_climate%nmsb(1)
if (eismint_climate%period .ne. 0.d0) then
model%climate%acab(:,:) = model%climate%acab(:,:) + eismint_climate%mb_amplitude * &
sin(2.d0*pi*time/eismint_climate%period)/ (acc0 * scyr)
sin(2.d0*pi*time/eismint_climate%period)/ scyr
end if

case(2)
Expand Down Expand Up @@ -370,7 +357,6 @@ subroutine eismint_surftemp(eismint_climate,model,time)

use glide_types
use glimmer_global, only: dp
use glimmer_paramets, only : len0
use glimmer_physcon, only : pi
use cism_parallel, only: parallel_globalindex

Expand All @@ -387,7 +373,7 @@ subroutine eismint_surftemp(eismint_climate,model,time)

ewct = (model%parallel%global_ewn + 1.d0) / 2.d0
nsct = (model%parallel%global_nsn + 1.d0) / 2.d0
grid = real(model%numerics%dew,dp) * len0
grid = real(model%numerics%dew,dp)

if (model%options%periodic_ew) then
periodic = 0.d0
Expand Down
16 changes: 8 additions & 8 deletions cism_driver/gcm_cism_interface.F90
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ subroutine gci_init_interface(which_gcm,g2c)
call ConfigRead(commandline_configname(1),config)
call GetSection(config,section,'options')
call GetValue(section,'dycore',whichdycore)
if (main_task) print *,'CISM dycore type (0=Glide, 1=Glam, 2=Glissade, 3=AlbanyFelix, 4 = BISICLES) = ', whichdycore
if (main_task) write(6,*) 'CISM dycore type (0=Glide, 1=Glam, 2=Glissade, 3=AlbanyFelix, 4 = BISICLES) = ', whichdycore

! Check to see if running basic GCM or glint GCM. Still need to add CESM GCM:
call GetSection(config,section,'GLINT climate')
Expand All @@ -108,23 +108,23 @@ subroutine gci_init_interface(which_gcm,g2c)
else
g2c%which_gcm = GCM_BASIC_MODEL
end if
if (main_task) print *,'g2c%which_gcm (0 = basic, 1 = Glint) = ', g2c%which_gcm
if (main_task) write(6,*) 'g2c%which_gcm (0 = basic, 1 = Glint) = ', g2c%which_gcm

select case (g2c%which_gcm)
case (GCM_BASIC_MODEL)
if (main_task) print*, 'call cism_init_dycore'
if (main_task) write(6,*) 'call cism_init_dycore'
call cism_init_dycore(g2c%glide_model)

case (GCM_GLINT_MODEL)
if (main_task) print*, 'call g2c_glint_init'
if (main_task) write(6,*) 'call g2c_glint_init'
call g2c_glint_init(g2c)

case (GCM_CESM)
! call gcm_glint_GetCommandline_proxy()
! call g2c_glint_init(g2c)

case default
if (main_task) print *,"Error -- unknown GCM type."
if (main_task) write(6,*) "Error -- unknown GCM type."
end select

end subroutine gci_init_interface
Expand All @@ -139,11 +139,11 @@ subroutine gci_run_model(g2c)
select case (g2c%which_gcm)
case (GCM_BASIC_MODEL)
! call gcm_update_model(gcm_model,cism_model)
! if (main_task) print *,"In gci_run_model, calling cism_run_dycore"
! if (main_task) write(6,*) "In gci_run_model, calling cism_run_dycore"
call cism_run_dycore(g2c%glide_model)

case (GCM_GLINT_MODEL,GCM_CESM)
! if (main_task) print *,"In gci_run_model, calling g2c_glint_run"
! if (main_task) write(6,*) "In gci_run_model, calling g2c_glint_run"
call g2c_glint_run(g2c)
call g2c_glint_climate_time_step(g2c)
case default
Expand All @@ -167,7 +167,7 @@ function gci_finished(g2c) result(finished)
call g2c_glint_check_finished(g2c,finished)
case default
end select
!if (main_task) print *,"In gci_finished, finished = ",finished
!if (main_task) write(6,*) "In gci_finished, finished = ",finished

end function gci_finished

Expand Down
22 changes: 11 additions & 11 deletions cism_driver/gcm_to_cism_glint.F90
Original file line number Diff line number Diff line change
Expand Up @@ -183,9 +183,9 @@ subroutine g2c_glint_init(g2c)

call system_clock(g2c%clock,g2c%clock_rate)
g2c%t1 = real(g2c%clock,kind=dp)/real(g2c%clock_rate,kind=dp)
!print *,"g2c%clock, g2c%clock_rate, t1",g2c%clock,g2c%clock_rate,g2c%t1
!write(6,*) "g2c%clock, g2c%clock_rate, t1",g2c%clock,g2c%clock_rate,g2c%t1

if (verbose_glint .and. main_task) print*, 'call glex_clim_init'
if (verbose_glint .and. main_task) write(6,*) 'call glex_clim_init'

! Initialise climate

Expand All @@ -196,20 +196,20 @@ subroutine g2c_glint_init(g2c)
call get_grid_dims(g2c%climate%clim_grid, g2c%nx, g2c%ny) ! Normal global grid
g2c%nxo=200 ; g2c%nyo=100 ! Example grid used for orographic output

!print *,"g2c% nxo, nyo, nx, ny: ",g2c%nxo,g2c%nyo,g2c%nx,g2c%ny,nxo,nyo
!write(6,*) "g2c% nxo, nyo, nx, ny: ",g2c%nxo,g2c%nyo,g2c%nx,g2c%ny,nxo,nyo

! start logging
! call open_log(unit=101, fname=logname(g2c%commandline_configname))

if (verbose_glint .and. main_task) then
print*, ' '
print*, 'Initializing glint_example, number of ice sheet instances =', num_icesheet_config
write(6,*) ' '
write(6,*) 'Initializing glint_example, number of ice sheet instances =', num_icesheet_config
do i = 1, num_icesheet_config
print*, i, 'icesheet configname = ', trim(g2c%commandline_configname(i))
write(6,*) i, 'icesheet configname = ', trim(g2c%commandline_configname(i))
enddo
print*, 'climate configname = ', trim(g2c%commandline_climate_fname)
print*, 'climate%gcm_smb:', g2c%climate%gcm_smb
print*, ' '
write(6,*) 'climate configname = ', trim(g2c%commandline_climate_fname)
write(6,*) 'climate%gcm_smb:', g2c%climate%gcm_smb
write(6,*) ' '
endif

! Allocate global arrays
Expand Down Expand Up @@ -331,7 +331,7 @@ subroutine g2c_glint_init(g2c)

g2c%time = g2c%climate%climate_tstep ! time in integer hours

! if (main_task) print*, 'Done in g2c_glint_init'
! if (main_task) write(6,*) 'Done in g2c_glint_init'

end subroutine g2c_glint_init

Expand Down Expand Up @@ -398,7 +398,7 @@ subroutine g2c_glint_run(g2c)

if (GLC_DEBUG) then
! Print time so as to have something to watch while the code runs
if (mod(real(g2c%time,dp),8760.d0) < 0.01) print*, 'time (yr) =', real(g2c%time,dp)/8760.d0
if (mod(real(g2c%time,dp),8760.d0) < 0.01) write(6,*) 'time (yr) =', real(g2c%time,dp)/8760.d0
end if
end subroutine g2c_glint_run

Expand Down
8 changes: 4 additions & 4 deletions cism_driver/testsfg.F90
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ subroutine bothexact(t,r,z,Cp,H,TT,U,w,Sig,M,Sigc)
real(kind) I4H, divQ, Ht, nut, dTt, Tr, Tz, Tzz

if (r<=0 .or. r>=L) then
print *,'code and derivation assume 0<r<L'
write(6,*) 'code and derivation assume 0<r<L'
stop
end if

Expand Down Expand Up @@ -120,7 +120,7 @@ subroutine bothexact(t,r,z,Cp,H,TT,U,w,Sig,M,Sigc)
end if
Hr = Hconst * pow * lamhat**(pow-1) * lamhatr + goft*fr ! chain rule
if (Hr>0) then
print *,'code and derivation assume H_r negative for all 0<r<L'
write(6,*) 'code and derivation assume H_r negative for all 0<r<L'
stop
end if
mu = Q/(Rgas*Ts*(nu+H))
Expand Down Expand Up @@ -197,7 +197,7 @@ subroutine model_exact(t,r,z,Hh,H0,TT,U,w,Sig,M,Sigc)
real Cp, H

if (r<=0 .or. r>=L) then
print *,'code and derivation assume 0<r<L'
write(6,*) 'code and derivation assume 0<r<L'
stop
end if
H = Hh
Expand Down Expand Up @@ -235,7 +235,7 @@ subroutine model_exact(t,r,z,Hh,H0,TT,U,w,Sig,M,Sigc)
end if
Hr = Hconst * pow * lamhat**(pow-1) * lamhatr + goft*fr ! chain rule
if (Hr>0) then
print *,'code and derivation assume H_r negative for all 0<r<L'
write(6,*) 'code and derivation assume H_r negative for all 0<r<L'
stop
end if
mu = Q/(Rgas*Ts*(nu+H))
Expand Down
2 changes: 1 addition & 1 deletion libglad/glad_initialise.F90
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ subroutine glad_i_initialise_gcm(config, instance, &

! Initialise a GLAD ice model instance for GCM coupling

use glimmer_paramets, only: GLC_DEBUG, thk0
use glimmer_paramets, only: GLC_DEBUG
use glimmer_log
use glimmer_config
use glimmer_coordinates, only : coordsystem_new
Expand Down
12 changes: 6 additions & 6 deletions libglad/glad_main.F90
Original file line number Diff line number Diff line change
Expand Up @@ -684,10 +684,10 @@ subroutine glad_gcm(params, instance_index, time, &
if (this_rank == rtest) then
i = itest
j = jtest
print*, 'r, i, j, nzocn =', this_rank, i, j, nzocn
print*, 'k, zocn:'
write(6,*) 'r, i, j, nzocn =', this_rank, i, j, nzocn
write(6,*) 'k, zocn:'
do k = 1, nzocn
print*, k, zocn(k)
write(6,*) k, zocn(k)
enddo
endif

Expand Down Expand Up @@ -723,8 +723,8 @@ subroutine glad_gcm(params, instance_index, time, &
if (verbose_glad .and. this_rank == rtest) then
i = itest
j = jtest
print*, 'r, i, j =', this_rank, i, j
print*, 'k, zocn, temperature, salinity, thermal forcing:'
write(6,*) 'r, i, j =', this_rank, i, j
write(6,*) 'k, zocn, temperature, salinity, thermal forcing:'
do k = 1, nzocn
write(6,'(i4, 4f11.3)') k, zocn(k), &
tocn_haloed(k,i,j), salinity_haloed(k,i,j), thermal_forcing_haloed(k,i,j)
Expand Down Expand Up @@ -806,7 +806,7 @@ subroutine glad_gcm(params, instance_index, time, &
if (verbose_glad .and. this_rank == rtest) then
i = itest
j = jtest
print*, 'Before calling glad_i_tstep_gcm, k, zocn, average thermal forcing:'
write(6,*) 'Before calling glad_i_tstep_gcm, k, zocn, average thermal forcing:'
do k = 1, nzocn
write(6,'(i4, 2f11.3)') k, zocn(k), params%instances(instance_index)%thermal_forcing(k,i,j)
enddo
Expand Down
Loading