Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion extern/stim
24 changes: 8 additions & 16 deletions src/gotm/gotm.F90
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,10 @@ module gotm
#ifdef _ICE_
use ice, only: init_ice, post_init_ice, do_ice, clean_ice, ice_cover
use stim_variables, only: Tice_surface,albedo_ice,transmissivity,nilay,ice_uvic_Tice
#endif
use stim_variables, only: ice_hs,ice_hi,ice_uvic_topmelt,ice_uvic_topgrowth,ice_uvic_termelt,ice_uvic_botmelt,ice_uvic_botgrowth,ice_uvic_tb,ice_uvic_ts
use stim_variables, only: ice_uvic_Fs,ice_uvic_Ff,ice_uvic_parb,ice_uvic_parui,ice_uvic_Amelt
#endif


use turbulence, only: turb_method
use turbulence, only: init_turbulence,post_init_turbulence,do_turbulence
Expand Down Expand Up @@ -415,11 +416,9 @@ subroutine initialize_gotm()
call fm%register_dimension('lat',1,id=id_dim_lat)
call fm%register_dimension('z',nlev,id=id_dim_z)
call fm%register_dimension('zi',nlev+1,id=id_dim_zi)
! call fm%register_dimension('z1',nilay,id=id_dim_z1) !jpnote commented
#ifdef _ICE_
!when compiling with stim off we dont have access to stim variables
call fm%register_dimension('zice',nilay+1,id=id_dim_zice) !jpnote
call fm%register_dimension('dzice',nilay,id=id_dim_dzice) !jpnote
call fm%register_dimension('zice',nilay+1,id=id_dim_zice)
call fm%register_dimension('dzice',nilay,id=id_dim_dzice)
#endif
call fm%register_dimension('time',id=id_dim_time)
call fm%initialize(prepend_by_default=(/id_dim_lon,id_dim_lat/),append_by_default=(/id_dim_time/))
Expand Down Expand Up @@ -694,8 +693,6 @@ subroutine integrate_gotm()
!
! !LOCAL VARIABLES:

! integer :: np !jpnote

integer(kind=timestepkind):: n
integer :: i=0

Expand Down Expand Up @@ -756,18 +753,13 @@ subroutine integrate_gotm()
#ifdef _ICE_
Qsw = I_0%value

!np = ubound(S,1)
call do_ice(h(nlev),dt,T(nlev),S(nlev),ta,precip%value,Qsw, & !h -- sum of dz ,, T -- temp of water !make sure arrays are not shaped for water

call do_ice(h(nlev),dt,T(nlev),S(nlev),ta,precip%value,Qsw, &
surface_fluxes,julianday,secondsofday,longitude, &
latitude,I_0%value,airt%value,airp%value,hum%value, &
u10%value,v10%value,cloud%value,rho(nlev),rho_0,ql%method, & !sst,sss%value, !ql%method == longwave_radiation_method
u10%value,v10%value,cloud%value,rho(nlev),rho_0,ql%method, &
hum_method,fluxes_method,albedo,heat%value)

!call do_ice(h(np),dt,T(np),S(np),ta,precip%value,Qsw, & !h -- sum of dz ,, T -- temp of water !make sure arrays are not shaped for water
! surface_fluxes,julianday,secondsofday,longitude, &
! latitude,I_0%value,airt%value,airp%value,hum%value, &
! u10%value,v10%value,cloud%value,rho(np),rho_0,ql%method, & !sst,sss%value, !ql%method == longwave_radiation_method
! hum_method,fluxes_method,albedo,heat%value)
#endif

! reset some quantities
Expand Down Expand Up @@ -805,7 +797,7 @@ subroutine integrate_gotm()

! update temperature and salinity
if (sprof%method .ne. 0) then
call salinity(nlev,dt,cnpar,nus,gams,ice_uvic_Fs,ice_uvic_Ff) !jpnote passing ice_uvic_fs and ice_uvic_ff from ice
call salinity(nlev,dt,cnpar,nus,gams,ice_uvic_Fs,ice_uvic_Ff)
endif

if (tprof%method .ne. 0) then
Expand Down
14 changes: 5 additions & 9 deletions src/gotm/register_all_variables.F90
Original file line number Diff line number Diff line change
Expand Up @@ -229,12 +229,12 @@ subroutine register_stim_variables(nlev)
call fm%register('dHis', 'm', 'ice growth (surface)', standard_name='', data0d=dHis, category='ice')
call fm%register('dHib', 'm', 'ice growth (bottom)', standard_name='', data0d=dHib, category='ice')

!Flato
!Vars from ice_uvic.F90
! Flato
! Vars from ice_uvic.F90
call fm%register('simass', 'kg/m2"', 'Ice mass per area', standard_name='', data0d=simass, category='ice')
call fm%register('snmass', 'kg/m2', 'Snow mass per area', standard_name='', data0d=snmass, category='ice')
call fm%register('meltmass', 'kg/m2', 'meltpond mass per area"', standard_name='', data0d=meltmass, category='ice')
!public vars from ice.F90
! Public vars from ice.F90
call fm%register('ice_hi', 'm', 'Ice thickness', standard_name='', data0d=ice_hi, category='ice')
call fm%register('ice_hs', 'm', 'Snow thickness', standard_name='', data0d=ice_hs, category='ice')
call fm%register('ice_hm', 'm', 'Meltpond thickness', standard_name='', data0d=ice_uvic_hm, category='ice')
Expand All @@ -258,14 +258,10 @@ subroutine register_stim_variables(nlev)
call fm%register('Aice', '', 'fraction of ice area that is bare ice', standard_name='', data0d=ice_uvic_Aice, category='ice')
call fm%register('Asnow', '', 'fraction of ice area that is snow covered', standard_name='', data0d=ice_uvic_Asnow, category='ice')
call fm%register('Amelt', '', 'fraction of ice area that is melt pond', standard_name='', data0d=ice_uvic_Amelt, category='ice')

call fm%register('dzi', 'm', 'Ice layer thickness', standard_name='', dimensions=(/id_dim_dzice/), data1d=ice_uvic_dzi(2:nilay+1), category='ice') !changed from 1:nilay to 2:nilay+1

call fm%register('ice_uvic_zi', 'm', 'interface depth', standard_name='', dimensions=(/id_dim_zice/), data1d=ice_uvic_zi(2:nilay+2), category='ice') ! zi in old code corresponds to ice_uvic_zi in new code
call fm%register('dzi', 'm', 'Ice layer thickness', standard_name='', dimensions=(/id_dim_dzice/), data1d=ice_uvic_dzi(2:nilay+1), category='ice')
call fm%register('ice_uvic_zi', 'm', 'interface depth', standard_name='', dimensions=(/id_dim_zice/), data1d=ice_uvic_zi(2:nilay+2), category='ice')
call fm%register('zice', 'm', 'interface depth', standard_name='', dimensions=(/id_dim_zice/),data1d=ice_uvic_zice(1:nilay+1), category='ice')
call fm%register('dzice', 'm', 'interface depth', standard_name='', dimensions=(/id_dim_dzice/), data1d=ice_uvic_dzice(1:nilay), category='ice')


call fm%register('Cond', 'W m-1 kg-1', 'Ice conductivity', standard_name='',dimensions=(/id_dim_dzice/),data1d=ice_uvic_Cond(2:nilay+1), category='ice')
call fm%register('rhoCp', '10^6 J m-3 K-1', 'volum heat capacity', standard_name='',dimensions=(/id_dim_dzice/), data1d=ice_uvic_rhoCp(2:nilay+1), category='ice')
call fm%register('Tice', 'Celsius', 'Ice slab temperature', standard_name='',dimensions=(/id_dim_zice/), data1d=ice_uvic_Tice(2:nilay+2), category='ice')
Expand Down
6 changes: 2 additions & 4 deletions src/meanflow/salinity.F90
Original file line number Diff line number Diff line change
Expand Up @@ -116,10 +116,8 @@ subroutine salinity(nlev,dt,cnpar,nus,gams,Fs,Ff) !jpnote passing in Fs and Ff f
! set boundary conditions
DiffBcup = Neumann
DiffBcdw = Neumann
!DiffSup = -S(nlev)*(precip%value+evap) !jpnote commenting

DiffSup = -S(nlev)*(precip%value+evap+Ff)-Fs ! jpnote adding equation used in old code !need to pass in ff and fs for this

DiffSup = -S(nlev)*(precip%value+evap+Ff)-Fs !NSnote, check signs
! DiffSup = -S(nlev)*(precip%value+evap)
DiffSdw = _ZERO_

AdvBcup = oneSided
Expand Down