Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
67 commits
Select commit Hold shift + click to select a range
a817ec8
adding vars from ice_uvic, added flato
Jun 17, 2021
aa2e844
adding variables
Jun 17, 2021
0ed265d
changed name of ice_thm to ice_thm_flato
Jun 18, 2021
ab0a53e
delete ice_thm because has been changed to ice_thm_flato
Jun 18, 2021
6f9aee4
use ice_thm_mod_flato to stim_flato file
Jun 18, 2021
6429df4
added default vals to yaml variables
Jun 18, 2021
0865a07
Update README.md
PatrickFarnole Jun 22, 2021
63e9959
Merge pull request #1 from juliaputko/uvic_ice_jp
PatrickFarnole Jun 22, 2021
db63ab5
Delete ice_winton.F90.keep
juliaputko Jun 22, 2021
d67fa20
Delete ice_thm.F90.org
juliaputko Jun 22, 2021
260d84a
passing values in subroutine call in getm_stim and gotm_stim, initial…
Jun 28, 2021
c0f5abf
Patrick made some changes in his last review, Merge branch 'uvic_ice_…
Jun 28, 2021
0d58e2d
added open_water subroutine
Jun 28, 2021
63b893b
added nr_iterate with vars
Jun 29, 2021
3ba6332
value passing revamp, passed values in subroutines
Jun 29, 2021
dc87655
added rest of subroutines to test value passing. Had to change name o…
Jun 29, 2021
fa7db04
Merge pull request #2 from juliaputko/uvic_ice_jp
PatrickFarnole Jun 30, 2021
7ad9ec1
changing vars to target for pointer
Jun 30, 2021
38e89df
Merge pull request #5 from juliaputko/uvic_ice_jp
PatrickFarnole Jun 30, 2021
2327134
adding do_ice_uvic to stim_models
Jun 30, 2021
5de03b7
Merge pull request #6 from juliaputko/uvic_ice_jp
PatrickFarnole Jun 30, 2021
fbfd52c
clean;removed pointers, more simple method of value passing;reorder s…
Jul 1, 2021
7079469
Merge pull request #7 from juliaputko/uvic_ice_jp
PatrickFarnole Jul 1, 2021
13940d2
param passing more consistent with oldcode
Jul 1, 2021
110500c
added contents of subroutine sebudget
Jul 1, 2021
63e79fd
added contents of albedo_ice_uvic subroutine
Jul 1, 2021
959ad77
added subroutine therm1d contents- compiles
Jul 1, 2021
b95cc6a
added subroutine cndiffus-compiles
Jul 1, 2021
c059c98
added subroutine trisol -compiles
Jul 1, 2021
a4f76b5
added saltice_prof_simple and surfmelt -compiles
Jul 1, 2021
b6e4dac
added subroutine growthtb
Jul 2, 2021
6274046
added subroutine nr_iterate -compiles
Jul 2, 2021
90c7083
Merge pull request #8 from juliaputko/uvic_ice_jp
PatrickFarnole Jul 5, 2021
f2d76d7
do_ice_uvic subroutine contents under if 0 running with error
Jul 5, 2021
adae802
changes to resolve longwave_radiation_method value passing error + co…
Jul 5, 2021
379676d
Merge pull request #9 from juliaputko/uvic_ice_jp
PatrickFarnole Jul 6, 2021
b76aec8
removed winton from flato model
Jul 7, 2021
fdebbbc
if 0 on nr_iterate and removed winton option from gotm_stim
Jul 8, 2021
82d49a2
fixed inconsistency with TSS
Jul 8, 2021
54ef64e
Merge pull request #10 from juliaputko/uvic_ice_jp
PatrickFarnole Jul 12, 2021
4bf6e70
made qb public for access in register_all_variables file
Jul 13, 2021
c05a8a6
Merge pull request #11 from juliaputko/uvic_ice_jp
PatrickFarnole Jul 13, 2021
d9e5617
removed no longer necessary var from yaml, nr_iterate no longer comme…
Jul 15, 2021
de38a2d
Merge pull request #12 from juliaputko/uvic_ice_jp
PatrickFarnole Jul 16, 2021
48ae760
no longer bypassing salinity error
Jul 20, 2021
3f1c152
Merge pull request #13 from juliaputko/uvic_ice_jp
PatrickFarnole Jul 20, 2021
d8f7de5
airseafluxes update and qe qh switch
Jul 22, 2021
9cfa5c9
Merge pull request #14 from juliaputko/uvic_ice_jp
PatrickFarnole Jul 23, 2021
4ac9187
clean up
Jul 24, 2021
8dc19d9
clean
Jul 27, 2021
ba2fb3c
Merge pull request #15 from juliaputko/uvic_ice_jp
PatrickFarnole Jul 27, 2021
be26509
renamed ice_uvic_hmix to hmix
Jul 28, 2021
1330b53
Merge pull request #16 from juliaputko/uvic_ice_jp
PatrickFarnole Jul 29, 2021
fe0735c
val for tmelts was off - fixed
Jul 30, 2021
5d4a215
Merge pull request #17 from juliaputko/uvic_ice_jp
PatrickFarnole Aug 1, 2021
990f67d
clean
Aug 4, 2021
4a67e03
Merge pull request #18 from juliaputko/uvic_ice_jp
PatrickFarnole Aug 9, 2021
d6441f9
Removing useless files.
PatrickFarnole Aug 11, 2021
a8d2346
adding Qfluxes_uvic for calculation of surface fluxes
Aug 24, 2021
d29bf17
Merge pull request #19 from juliaputko/uvic_ice_jp
PatrickFarnole Aug 25, 2021
766263d
clean for compatibility with ford documentation
Aug 25, 2021
37572cf
Merge pull request #20 from juliaputko/uvic_ice_jp
PatrickFarnole Aug 26, 2021
bd92967
FORD Documentation
Aug 26, 2021
eb7d7af
celcius/kelvin adaptation
Dec 16, 2021
afeeade
Merge pull request #22 from juliaputko/uvic_fabm_jp
PatrickFarnole Dec 16, 2021
2c31783
stim cleanup
Dec 23, 2021
dbe5451
Merge pull request #23 from juliaputko/uvic_ice_jp
PatrickFarnole Dec 23, 2021
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
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ endif(STIM_EMBED_VERSION)
option(STIM_LEBEDEV "Lebedev ICE model" ON)
option(STIM_MYLAKE "MyLake ICE model" ON)
option(STIM_WINTON "Winton ICE model" ON)
option(STIM_FLATO "Flato ICE model" ON)

include(src/CMakeLists.txt)
include(tests/CMakeLists.txt)
Expand Down
10 changes: 8 additions & 2 deletions src/drivers/getm/getm_stim.F90
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,9 @@ end subroutine post_init_ice
#ifdef _TESTING_
subroutine do_ice(dz,dt,Tw,S,Ta)
#else
subroutine do_ice(dz,dt,Tw,S,Ta,precip,Qsw,Qfluxes)
subroutine do_ice(dz,dt,Tw,S,Ta,precip,Qsw,Qfluxes,julianday,secondsofday,longitude, &
latitude,I_0,airt,airp,hum,u10,v10,cloud,rho,rho_0,longwave_radiation, &
hum_method,fluxes_method,albedo,heat)
#endif
!
! !DESCRIPTION:
Expand All @@ -224,9 +226,13 @@ subroutine do_ice(dz,dt,Tw,S,Ta,precip,Qsw,Qfluxes)
!
! !INPUT PARAMETERS:
#ifdef _TESTING_
REALTYPE, intent(in) :: dz(:,:),dt,Ta(:,:),S(:,:)
REALTYPE, intent(in) :: dz(:,:),dt,S(:,:),Ta(:,:)
#else
REALTYPE, intent(in) :: dz(:,:),dt,Ta(:,:),S(:,:),precip(:,:),Qsw(:,:)
REALTYPE, intent(in) :: longitude,latitude,I_0,airt,airp,hum,u10,v10,cloud,rho,rho_0,albedo,heat
integer, intent(in) :: julianday,secondsofday
integer, intent(in) :: longwave_radiation,hum_method,fluxes_method

#endif
!
! !INPUT/OUTPUT PARAMETERS:
Expand Down
166 changes: 161 additions & 5 deletions src/drivers/gotm/gotm_stim.F90
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,8 @@ subroutine init_stim_yaml()
! See log for the ice module
!
! !LOCAL VARIABLES:
integer :: k,rc

class (type_gotm_settings), pointer :: branch
!EOP
!-----------------------------------------------------------------------
Expand All @@ -84,16 +86,111 @@ subroutine init_stim_yaml()
(/option(0, 'none', 'none'), &
option(1, 'Lebedev (1938)', 'Lebedev'), &
option(2, 'MyLake', 'MyLake'), &
option(3, 'Winton', 'Winton')/))
option(3, 'Winton', 'Winton'), &
option(4,'Flato', 'Flato')/))

call branch%get(Hice, 'H', 'initial ice thickness', 'm',default=0._rk)
call branch%get(ocean_ice_flux, 'ocean_ice_flux', &
'ocean->ice heat flux','W/m^2',default=0._rk, display=display_hidden)

!flato
call branch%get(nilay, 'nilay', 'number of ice layers', '', default=0)
call branch%get(sfall_method, 'sfall_method', 'define how snow fall is determined ','', default=0)
call branch%get(const_sfall,'const_sfall ', 'constant snow fall rate', 'm d^-1', default=0._rk)
call branch%get(dfact,'dfact', 'drift factor', '', default=0._rk)
call branch%get(depmix ,'depmix', 'prescribed mixed layer depth', '', default=0._rk)
call branch%get(sice_method, 'sice_method','define how sea-ice salinity is to be calculated','', default=0)
call branch%get(const_Sice, 'const_Sice', 'prescribed sea ice salinity', 'ppt', default=0._rk)
call branch%get(snow_dist,'snow_dist ','logical switch between uniform and Weibull-distributed snow', default=.false.)
call branch%get(distr_type,'distr_type', 'integer to chose the type of distribution', '', default=-1)
call branch%get(meltpond,'meltpond', 'If true meltponds are included If false only bare ice is included', default=.false.)
call branch%get(Ameltmax,'Ameltmax ', 'Maximum meltpond area fraction allowed', '', default=0._rk)
call branch%get(drainrate,'drainrate', 'Melt pond drainage rate in ','m/d', default=0._rk)
call branch%get(hh0, 'hh0', 'initial thickness for S calculation','', default=0._rk)
call branch%get(ice_hi_i ,'ice_hi_i ', 'initial ice thickness', '', default=0._rk)
call branch%get(ice_hs_i ,'ice_hs_i ',' initial snow thickness', '', default=0._rk)
call branch%get(albice_method,'albice_method ', 'define how ice albedo is determined ', '', default=0)
call branch%get(albice_f, 'albice_f', 'freezing ice albedo','', default=0._rk)
call branch%get(albmelt,'albmelt', 'melt pond albedo','', default=0._rk)
call branch%get(albsnow_f,'albsnow_f', 'freezing snow albedo','', default=0._rk)
call branch%get(albice_m ,'albice_m ', 'melting ice albedo','', default=0._rk)
call branch%get(albsnow_m, 'albsnow_m', 'melting snow albedo','', default=0._rk)
call branch%get(transsf,'transsf', 'freezing snow transmission coefficient','', default=0._rk)
call branch%get(transsm ,'transsm ', 'melting snow transmission coefficient','', default=0._rk)
call branch%get(transif, 'transif ', 'freezing ice transmission coefficient','', default=0._rk)
call branch%get(transim, 'transim ', 'melting ice transmission coefficient','', default=0._rk)
call branch%get(transm,'transm', 'melt pond transmision coefficient','', default=0._rk)
call branch%get(swkappasm,'swkappasm', 'melting snow extinction coefficient','', default=0._rk)
call branch%get(swkappasf,'swkappasf ', 'freezing snow extinction coefficient','', default=0._rk)
call branch%get(swkappaim,'swkappaim ', 'melting ice extinction coefficient','', default=0._rk)
call branch%get(swkappaif, 'swkappaif', 'freezing ice extinction coefficient','', default=0._rk)

LEVEL2 'done.'
allocate(Tice(2))

#ifdef STIM_FLATO
allocate(ice_uvic_Tice(nilay+1),stat=rc)
if (rc /= 0) STOP 'init_ice: Error allocating (ice_uvic_Tice)'
ice_uvic_Tice=0
do k=1,nilay+1
ice_uvic_Tice(k)=245.+(Tfreezi-245.)*float(k-1)/float(nilay)
enddo
allocate(ice_uvic_Cond(nilay),stat=rc)
if (rc /= 0) STOP 'init_ice: Error allocating (ice_uvic_Cond)'
ice_uvic_Cond =0
allocate(ice_uvic_rhoCp(nilay),stat=rc)
if (rc /= 0) STOP 'init_ice: Error allocating (ice_uvic_rhoCp)'
ice_uvic_rhoCp =0
allocate(ice_uvic_Sint(nilay+1),stat=rc)
if (rc /= 0) STOP 'init_ice: Error allocating (ice_uvic_Sint)'
ice_uvic_Sint =0
allocate(ice_uvic_dzi(nilay),stat=rc)
if (rc /= 0) STOP 'init_ice: Error allocating (ice_uvic_dzi)'
ice_uvic_dzi =0
allocate(ice_uvic_zi(nilay+1),stat=rc)
if (rc /= 0) STOP 'init_ice: Error allocating (ice_uvic_zi)'
ice_uvic_zi =0
allocate(ice_uvic_Told(nilay+1),stat=rc)
if (rc /= 0) STOP 'init_ice: Error allocating (ice_uvic_Told)'
ice_uvic_Told =0
allocate(ice_uvic_Pari(nilay+1),stat=rc)
if (rc /= 0) STOP 'init_ice: Error allocating (ice_uvic_Pari)'
ice_uvic_Pari =0
allocate(ice_uvic_dum(nilay+1),stat=rc)
if (rc /= 0) STOP 'init_ice: Error allocating (ice_uvic_dum)'
allocate(ice_uvic_dzice(nilay),stat=rc)
if (rc /= 0) STOP 'init_ice: Error allocating (ice_uvic_dzi)'
do k=1,nilay
ice_uvic_dzice(k)=float(k)
enddo
allocate(ice_uvic_zice(nilay+1),stat=rc)
if (rc /= 0) STOP 'init_ice: Error allocating (ice_uvic_zice)'
do k=1,nilay+1
ice_uvic_zice(k)=float(k)
enddo

ice_uvic_dum =0
hsnow=0;hice=0;ice_uvic_hm=0
ice_uvic_ts=273.16D+00;ice_uvic_tb=273.16D+00;ice_uvic_Fh=0
ice_uvic_swr_0=0;ice_uvic_precip_i=0;ice_uvic_sfall_i=0
ice_uvic_parb=0;ice_uvic_parui=0;
ice_uvic_Ff=0;ice_uvic_Fs=0
ice_uvic_Sicebulk=6.0D+00
ice_uvic_topmelt=0;ice_uvic_botmelt=0
ice_uvic_termelt=0;ice_uvic_topgrowth=0
ice_uvic_botgrowth=0;ice_uvic_Hmix=0
ice_uvic_Aice=0;ice_uvic_Asnow=0
ice_uvic_Amelt=0

#endif
return
end subroutine init_stim_yaml
!EOC





!-----------------------------------------------------------------------
!BOP
!
Expand All @@ -116,6 +213,7 @@ subroutine post_init_stim(Ta,S)
!-----------------------------------------------------------------------
!BOC
LEVEL1 'post_init_stim'
print *, 'ice_model: ', ice_model

if(Hice .gt. _ZERO_ .and. ice_model /= 0) then
ice_cover=2
Expand Down Expand Up @@ -146,6 +244,19 @@ subroutine post_init_stim(Ta,S)
LEVEL0 ".... in STIM"
stop 'post_init_stim(): init_stim_winton()'
#endif
#endif
#ifdef STIM_FLATO
case(4)
#if 1
!KB allocate(Tice(2))
call init_stim_flato()
#else
LEVEL0 "Flato model is compiled - but execution is disabled"
LEVEL0 "change line 138 in gotm_stim.F90 - then recompile - "
LEVEL0 "then do some work to make the Flato ice model work ...."
LEVEL0 ".... in STIM"
stop 'post_init_stim(): init_stim_flato()'
#endif
#endif
case default
stop 'invalid ice model'
Expand All @@ -162,17 +273,21 @@ end subroutine post_init_stim
!BOP
!
! !IROUTINE: do the ice calculations
!

! !INTERFACE:
subroutine do_stim(dz,dt,Tw,S,Ta,precip,Qsw,Qfluxes)
!
subroutine do_stim(dz,dt,Tw,S,Ta,precip,Qsw,Qfluxes,Qfluxes_uvic,julianday,secondsofday, &
I_0,airt,rho,rho_0,albedo,heat)

! !DESCRIPTION:
!
! !USES:
IMPLICIT NONE
!
! !INPUT PARAMETERS:
REALTYPE, intent(in) :: dz,dt,Ta,S,precip,Qsw

REALTYPE, intent(in) :: dz,dt,S,Qsw,airt,rho,rho_0
REALTYPE, intent(inout) :: Ta,precip,I_0,albedo,heat
integer, intent(in) :: julianday,secondsofday
!
! !INPUT/OUTPUT PARAMETERS:
REALTYPE, intent(inout) :: Tw
Expand All @@ -183,6 +298,13 @@ subroutine Qfluxes(T,qh,qe,qb)
REALTYPE, intent(out) :: qh,qe,qb
end subroutine
end interface
!jpnote
interface
subroutine Qfluxes_uvic(T,qh,qe,qb)
REALTYPE, intent(in) :: T
REALTYPE, intent(out) :: qh,qe,qb
end subroutine
end interface
!
! !REVISION HISTORY:
! Original author(s): Karsten Bolding
Expand All @@ -191,6 +313,7 @@ subroutine Qfluxes(T,qh,qe,qb)
!
! !LOCAL VARIABLES:
REALTYPE :: Tf

!EOP
!-----------------------------------------------------------------------
!BOC
Expand Down Expand Up @@ -224,6 +347,39 @@ subroutine Qfluxes(T,qh,qe,qb)
else
call do_stim_winton(ice_cover,dz,dt,Tw,S,Ta,precip,Qsw,Qfluxes)
end if
#endif
#ifdef STIM_FLATO
case(4)

if (S .lt. 0.01) then
LEVEL0 'The FLato ice model is developed for oceanic conditions.'
LEVEL0 'Very low salinity is not supported - and the principle'
LEVEL0 'advantage of the model (brine contribution to latent'
LEVEL0 'heat calculation) is not met.'
LEVEL0 'Please select another ice model.'
stop 'do_stim()'
else
call do_ice_uvic(dt,dz,julianday,secondsofday, &
I_0,airt,precip,Tw,S,rho,rho_0, &
ice_hi,ice_hs,ice_uvic_hm,ice_uvic_Tice, &
ice_uvic_Cond,ice_uvic_rhoCp, &
ice_uvic_Sint,ice_uvic_dzi,ice_uvic_zi, &
ice_uvic_Pari,ice_uvic_Told,albedo,heat,&
ice_uvic_Fh,ice_uvic_Ff,ice_uvic_Fs,&
ice_uvic_Sicebulk, ice_uvic_topmelt, &
ice_uvic_botmelt,ice_uvic_termelt, &
ice_uvic_topgrowth,ice_uvic_botgrowth,&
ice_uvic_Hmix,ice_uvic_Aice,ice_uvic_Asnow,&
ice_uvic_Amelt,ice_uvic_swr_0,ice_uvic_precip_i,ice_uvic_sfall_i,Qfluxes_uvic)

ice_uvic_ts=ice_uvic_Tice(1)
ice_uvic_tb=ice_uvic_Tice(nilay)
ice_uvic_parb=ice_uvic_Pari(nilay)
ice_uvic_parui=ice_uvic_Pari(nilay+1)

end if


#endif
case default
stop 'invalid ice model'
Expand Down
1 change: 1 addition & 0 deletions src/models/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ set_property(TARGET stim PROPERTY Fortran_MODULE_DIRECTORY ${CMAKE_CURRENT_BINAR
include(${CMAKE_CURRENT_LIST_DIR}/lebedev/CMakeLists.txt)
include(${CMAKE_CURRENT_LIST_DIR}/mylake/CMakeLists.txt)
include(${CMAKE_CURRENT_LIST_DIR}/winton/CMakeLists.txt)
include(${CMAKE_CURRENT_LIST_DIR}/flato/CMakeLists.txt)
target_include_directories(stim PUBLIC
$<INSTALL_INTERFACE:include>
$<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}/modules>
Expand Down
7 changes: 7 additions & 0 deletions src/models/flato/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
if(STIM_FLATO)
target_sources(stim
PRIVATE
${CMAKE_CURRENT_LIST_DIR}/stim_flato.F90
)
target_compile_definitions(stim PUBLIC STIM_FLATO)
endif(STIM_FLATO)
6 changes: 6 additions & 0 deletions src/models/flato/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Flato ice model

This is an ice model based on the 1-D thermodynamic sea ice model by Greg Flato (Flato and Brown, 1996) and modified to fit the GOTM structure, as well as containing the snow distribution and meltponds subgrid parametrization (Abraham et al. 2014).

It performs a surface energy budget calculation to get net flux at ice, snow or open water surface, solves the 1-D heat conduction problem using an implicit finite difference scheme with the ice/snow slab discretized into an arbitrary number of thickness layers (presently configured for only one snow layer). A Newton-Raphson iterative scheme is used to solve for the surface temperature which appears non-linearly in both surface and conductive fluxes. Surface melt is calculated to use up the net incoming energy flux at the surface with the surface temperature fixed at the melting point. Additional melt may occur to restore temperatures to the freezing point where it is exceeded. Under cooling conditions, the upper surface has a flux boundary condition with surface growth occurring only if snow load causes surface flooding. Growth at the ice underside is calculated so as to balance the flux at the bottom where the temperature remains at the freezing point of sea water. If ice melts completely, incoming heat is stored in the mixed layer which must cool to the freezing point before new ice can form. Initial growth of very thin ice is calculated assuming a linear temperature profile.

Loading