Skip to content

Commit 39511a0

Browse files
authored
Merge pull request #64 from Katetc/katetc/hma_glaciers4-4
Katetc/hma glaciers4, Replace Lipscomb/hma_glaciers4 PR
2 parents 403a87f + 28eb82f commit 39511a0

33 files changed

Lines changed: 6404 additions & 570 deletions

.gitignore

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,3 +43,25 @@ P75R
4343
P75S
4444
Stnd
4545
mismip+Ice0
46+
47+
#Ignore compiled topography files
48+
bin_to_cube/bin_to_cube
49+
bin_to_cube/bin_to_cube.o
50+
bin_to_cube/shr_kind_mod.mod
51+
bin_to_cube/shr_kind_mod.o
52+
cube_to_target/cube_to_target
53+
cube_to_target/cube_to_target.o
54+
cube_to_target/reconstruct.mod
55+
cube_to_target/reconstruct.o
56+
cube_to_target/remap.mod
57+
cube_to_target/remap.o
58+
cube_to_target/ridge_ana.mod
59+
cube_to_target/ridge_ana.o
60+
cube_to_target/rot.o
61+
cube_to_target/rotation.mod
62+
cube_to_target/shared_vars.mod
63+
cube_to_target/shared_vars.o
64+
cube_to_target/shr_kind_mod.mod
65+
cube_to_target/shr_kind_mod.o
66+
cube_to_target/smooth_topo_cube.o
67+
cube_to_target/smooth_topo_cube_sph.mod

builds/derecho-intel/derecho-intel-cmake

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,7 @@
66

77
source /etc/profile.d/z00_modules.csh
88

9-
module purge
10-
module load ncarenv/23.09
11-
module load intel/2023.2.1
12-
module load ncarcompilers/1.0.0
13-
module load cray-mpich/8.1.27
14-
module load mkl/2023.2.0
15-
module load netcdf/4.9.2
16-
module load cmake/3.26.3
9+
source derecho-intel-modules
1710

1811
# remove old build data:
1912
rm -f ./CMakeCache.txt

builds/derecho-intel/derecho-intel-cmake.sh

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -17,18 +17,9 @@ fi
1717

1818
source /etc/profile.d/z00_modules.sh
1919

20-
echo CISM: "${cism_top}"
21-
22-
23-
module purge
24-
module load ncarenv/23.09
25-
module load intel/2023.2.1
26-
module load cray-mpich/8.1.27
27-
module load mkl/2023.2.0
28-
module load netcdf/4.9.2
29-
module load ncarcompilers/1.0.0
30-
module load cmake/3.26.3
20+
source derecho-intel-modules
3121

22+
echo CISM: "${cism_top}"
3223

3324
# remove old build data:
3425
rm -f ./CMakeCache.txt
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
module purge
2+
module load ncarenv/23.09
3+
module load intel/2023.2.1
4+
module load ncarcompilers/1.0.0
5+
module load cray-mpich/8.1.27
6+
module load mkl/2023.2.0
7+
module load netcdf/4.9.2
8+
module load cmake/3.26.3

cism_driver/cism_front_end.F90

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -137,8 +137,12 @@ subroutine cism_init_dycore(model)
137137
call eismint_surftemp(model%eismint_climate,model,time)
138138

139139
! read forcing time slice if needed - this will overwrite values from IC file if there is a conflict.
140+
! Note: The first 'model' is passed to the argument 'data', which is filled by calling glide_read.
140141
call glide_read_forcing(model, model)
141142

143+
! Optionally, read all the time slices at once from selected forcing files.
144+
call glide_read_forcing_once(model, model)
145+
142146
call spinup_lithot(model)
143147

144148
call t_stopf('initialization')
@@ -225,8 +229,10 @@ subroutine cism_init_dycore(model)
225229

226230

227231
! --- Output the initial state -------------
232+
! Note: For a standard restart, the initial state is not output, because this state
233+
! should already have been written to the output file when the previous run ended.
228234

229-
if (model%options%is_restart == RESTART_FALSE .or. model%options%forcewrite_restart) then
235+
if (model%options%is_restart == NO_RESTART .or. model%options%is_restart == HYBRID_RESTART) then
230236
call t_startf('initial_io_writeall')
231237
call glide_io_writeall(model, model, time=time) ! MJH The optional time argument needs to be supplied
232238
! since we have not yet set model%numerics%time
@@ -283,16 +289,16 @@ subroutine cism_run_dycore(model)
283289
do while(time + time_eps < model%numerics%tend)
284290

285291
!!! SFP moved block of code for applying time dependent forcing read in from netCDF here,
286-
!!! as opposed to at the end of the time step (commented it out in it's original location for now)
292+
!!! as opposed to at the end of the time step (commented it out in its original location for now)
287293
!!! This is a short-term fix. See additional discussion as part of issue #19 (in cism-piscees github repo).
288294

289295
! Forcing from a 'forcing' data file - will read time slice if needed
290-
! Note: Forcing is read from the appropriate time slice after every dynamic time step.
291-
! This is not strictly necessary if there are multiple time steps per forcing time slice.
292-
! We would need additional logic if we wanted to read a new time slice only when needed
293-
! to replace the current data. TODO: Add this logic?
294296
call t_startf('read_forcing')
295297
call glide_read_forcing(model, model)
298+
299+
! If any forcing data have been read once into Fortran arrays at initialization,
300+
! simply copy the data based on the current forcing time.
301+
call glide_retrieve_forcing(model, model)
296302
call t_stopf('read_forcing')
297303

298304
! Increment time step

libglide/glide.F90

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -218,6 +218,11 @@ subroutine glide_initialise(model)
218218
! read first time slice
219219
call glide_io_readall(model,model)
220220

221+
! Compute grid cell areas
222+
! Note: cell_area is used for diagnostics only. It is set to dew*dns by default but can be corrected below.
223+
! For the purposes of CISM dynamics, all grid cells are rectangles of dimension dew*dns.
224+
model%geometry%cell_area = model%numerics%dew*model%numerics%dns
225+
221226
! Compute area scale factors for stereographic map projection.
222227
! This should be done after reading the input file, in case the input file contains mapping info.
223228
! Note: Not yet enabled for other map projections.
@@ -231,6 +236,14 @@ subroutine glide_initialise(model)
231236
model%numerics%dew*len0, &
232237
model%numerics%dns*len0)
233238

239+
! Given the stereographic area correction factors, correct the diagnostic grid cell areas.
240+
! Note: area_factor is actually a length correction factor k; must divide by k^2 to adjust areas.
241+
! TODO: Change the name of area_factor
242+
where (model%projection%stere%area_factor > 0.0d0)
243+
model%geometry%cell_area = &
244+
model%geometry%cell_area / model%projection%stere%area_factor**2
245+
endwhere
246+
234247
endif
235248

236249
! write projection info to log
@@ -292,9 +305,6 @@ subroutine glide_initialise(model)
292305
! print*, 'Created Glide variables'
293306
! print*, 'max, min bheatflx (W/m2)=', maxval(model%temper%bheatflx), minval(model%temper%bheatflx)
294307

295-
! Compute the cell areas of the grid
296-
model%geometry%cell_area = model%numerics%dew*model%numerics%dns
297-
298308
! If a 2D bheatflx field is present in the input file, it will have been written
299309
! to model%temper%bheatflx. For the case model%options%gthf = 0, we want to use
300310
! a uniform heat flux instead.
@@ -453,7 +463,8 @@ subroutine glide_init_state_diagnostic(model, evolve_ice)
453463
l_evolve_ice = .true.
454464
end if
455465

456-
if (model%options%is_restart == RESTART_TRUE) then
466+
if (model%options%is_restart == STANDARD_RESTART .or. &
467+
model%options%is_restart == HYBRID_RESTART) then
457468
! On a restart, just assign the basal velocity from uvel/vvel (which are restart variables)
458469
! to ubas/vbas which are used by the temperature solver to calculate basal heating.
459470
! During time stepping ubas/vbas are calculated by slipvelo during thickness evolution or below on a cold start.

0 commit comments

Comments
 (0)