Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cleanup initialization #240

Merged
merged 4 commits into from
Nov 17, 2018
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
use ocn_data_type for SSS
  • Loading branch information
eclare108213 committed Nov 17, 2018
commit 1dac84739694794d6f9e192d5e7bb68a35927c6d
41 changes: 11 additions & 30 deletions cicecore/cicedynB/general/ice_forcing.F90
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ module ice_forcing
ocn_data_format, & ! 'bin'=binary or 'nc'=netcdf
atm_data_type, & ! 'default', 'monthly', 'ncar',
! 'LYq' or 'hadgem' or 'oned'
bgc_data_type, & ! 'default', 'clim', 'ncar', 'oned'
bgc_data_type, & ! 'default', 'clim'
ocn_data_type, & ! 'default', 'clim', 'ncar', 'oned',
! 'hadgem_sst' or 'hadgem_sst_uvocn'
precip_units ! 'mm_per_month', 'mm_per_sec', 'mks','m_per_sec'
Expand Down Expand Up @@ -324,7 +324,7 @@ subroutine init_forcing_ocn(dt)
! initialize to annual climatology created from monthly data
!-------------------------------------------------------------------

if (trim(bgc_data_type) == 'clim') then
if (trim(ocn_data_type) == 'clim') then

sss_file = trim(ocn_data_dir)//'/sss.mm.100x116.da' ! gx3 only

Expand Down Expand Up @@ -368,15 +368,11 @@ subroutine init_forcing_ocn(dt)

if (my_task == master_task) close(nu_forcing)

endif ! bgc_data_type

!-------------------------------------------------------------------
! Sea surface temperature (SST)
! initialize to data for current month
!-------------------------------------------------------------------

if (trim(ocn_data_type) == 'clim') then

if (nx_global == 320) then ! gx1
sst_file = trim(ocn_data_dir)//'/sst_clim_hurrell.dat'
else ! gx3
Expand Down Expand Up @@ -444,14 +440,12 @@ subroutine init_forcing_ocn(dt)

endif ! ocn_data_type

if (trim(ocn_data_type) == 'ncar' .or. &
trim(bgc_data_type) == 'ncar') then
if (trim(ocn_data_type) == 'ncar') then
! call ocn_data_ncar_init
call ocn_data_ncar_init_3D
endif

if (trim(ocn_data_type) == 'hycom' .or. &
trim(bgc_data_type) == 'hycom') then
if (trim(ocn_data_type) == 'hycom') then
call ocn_data_hycom_init
endif

Expand Down Expand Up @@ -623,22 +617,17 @@ subroutine get_forcing_ocn (dt)

character(len=*), parameter :: subname = '(get_forcing_ocn)'

if (trim(ocn_data_type) == 'clim' .or. &
trim(bgc_data_type) == 'clim') then
if (trim(ocn_data_type) == 'clim') then
call ocn_data_clim(dt)
elseif (trim(ocn_data_type) == 'ncar' .or. &
trim(bgc_data_type) == 'ncar'.or. &
trim(ocn_data_type) == 'ISPOL' .or. &
trim(bgc_data_type) == 'ISPOL') then
trim(ocn_data_type) == 'ISPOL') then
call ocn_data_ncar(dt)
elseif (trim(ocn_data_type) == 'hadgem_sst' .or. &
trim(ocn_data_type) == 'hadgem_sst_uvocn') then
call ocn_data_hadgem(dt)
elseif (trim(ocn_data_type) == 'oned' .or. &
trim(bgc_data_type) == 'oned') then
elseif (trim(ocn_data_type) == 'oned') then
call ocn_data_oned
elseif (trim(ocn_data_type) == 'hycom' .or. &
trim(bgc_data_type) == 'hycom') then
elseif (trim(ocn_data_type) == 'hycom') then
! call ocn_data_hycom(dt)
!MHRI: NOT IMPLEMENTED YET
endif
Expand Down Expand Up @@ -3190,12 +3179,10 @@ subroutine ocn_data_clim (dt)
character(len=*), parameter :: subname = '(ocn_data_clim)'

if (my_task == master_task .and. istep == 1) then
if (trim(bgc_data_type)=='clim') then
if (trim(ocn_data_type)=='clim') then
write (nu_diag,*) ' '
write (nu_diag,*) 'SSS data interpolated to timestep:'
write (nu_diag,*) trim(sss_file)
endif
if (trim(ocn_data_type)=='clim') then
write (nu_diag,*) ' '
write (nu_diag,*) 'SST data interpolated to timestep:'
write (nu_diag,*) trim(sst_file)
Expand All @@ -3211,8 +3198,7 @@ subroutine ocn_data_clim (dt)
! month.
!-------------------------------------------------------------------

if (trim(bgc_data_type)=='clim' .or. &
trim(ocn_data_type)=='clim') then
if (trim(ocn_data_type)=='clim') then

midmonth = 15 ! data is given on 15th of every month
!!! midmonth = fix(p5 * real(daymo(month))) ! exact middle
Expand All @@ -3238,14 +3224,11 @@ subroutine ocn_data_clim (dt)
readm = .false.
if (istep==1 .or. (mday==midmonth .and. sec==0)) readm = .true.

endif ! bgc/ocn_data_type

!-------------------------------------------------------------------
! Read two monthly SSS values and interpolate.
! Note: SSS is restored instantaneously to data.
!-------------------------------------------------------------------

if (trim(bgc_data_type)=='clim') then
call read_clim_data (readm, 0, ixm, month, ixp, &
sss_file, sss_data, &
field_loc_center, field_type_scalar)
Expand Down Expand Up @@ -4008,7 +3991,7 @@ subroutine ocn_data_hycom_init
character (char_len) :: &
fieldname ! field name in netcdf file

if (trim(bgc_data_type) == 'hycom') then
if (trim(ocn_data_type) == 'hycom') then
sss_file = trim(ocn_data_dir)//'ice.restart.surf.nc'

if (my_task == master_task) then
Expand All @@ -4023,9 +4006,7 @@ subroutine ocn_data_hycom_init
call ice_close_nc(fid)

call ocn_freezing_temperature
endif

if (trim(ocn_data_type) == 'hycom') then
sst_file = trim(ocn_data_dir)//'ice.restart.surf.nc'

if (my_task == master_task) then
Expand Down
4 changes: 2 additions & 2 deletions doc/source/cice_index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ either Celsius or Kelvin units).
"**B**", "", ""
"bfb_flag", ":math:`\bullet` for bit-for-bit reproducible diagnostics", ""
"bgc_data_dir", ":math:`\bullet` data directory for bgc", ""
"bgc_data_type", ":math:`\bullet` source of surface salinity, silicate, nitrate data", ""
"bgc_data_type", ":math:`\bullet` source of silicate, nitrate data", ""
"bgc_flux_type", ":math:`\bullet` ice–ocean flux velocity", ""
"bgc_tracer_type", "tracer_type for bgc tracers", ""
"bgrid", "nondimensional vertical grid points for bio grid", ""
Expand Down Expand Up @@ -431,7 +431,7 @@ either Celsius or Kelvin units).
"oceanmixed_ice", ":math:`\bullet` if true, use internal ocean mixed layer", ""
"ocn_data_dir", ":math:`\bullet` directory for ocean forcing data", ""
"ocn_data_format", ":math:`\bullet` format of ocean forcing files", ""
"ocn_data_type", ":math:`\bullet` source of surface temperature data", ""
"ocn_data_type", ":math:`\bullet` source of surface temperature, salinity data", ""
"omega", "angular velocity of Earth", "7.292\ :math:`\times`\ 10\ :math:`^{-5}` rad/s"
"opening", "rate of ice opening due to divergence and shear", "1/s"
"**P**", "", ""
Expand Down