LCOV - code coverage report
Current view: top level - columnphysics - icepack_parameters.F90 (source / functions) Coverage Total Hit
Test: 250115-224328:3d8b76b919:4:base,io,travis,quick Lines: 91.41 % 1013 926
Test Date: 2025-01-15 16:24:29 Functions: 100.00 % 5 5

            Line data    Source code
       1              : !=========================================================================
       2              : !
       3              : ! flags for the column package
       4              : !
       5              : ! authors: Elizabeth C. Hunke, LANL
       6              : 
       7              :       module icepack_parameters
       8              : 
       9              :       use icepack_kinds
      10              :       use icepack_warnings, only: icepack_warnings_aborted, &
      11              :           icepack_warnings_add, icepack_warnings_setabort
      12              : 
      13              :       implicit none
      14              :       private
      15              : 
      16              :       public :: icepack_init_parameters
      17              :       public :: icepack_query_parameters
      18              :       public :: icepack_write_parameters
      19              :       public :: icepack_recompute_constants
      20              :       public :: icepack_chkoptargflag
      21              : 
      22              :       !-----------------------------------------------------------------
      23              :       ! control options
      24              :       !-----------------------------------------------------------------
      25              : 
      26              :       character (char_len), public :: &
      27              :          argcheck = 'first'      !  optional argument checks, 'never','first','always'
      28              : 
      29              :       !-----------------------------------------------------------------
      30              :       ! parameter constants
      31              :       !-----------------------------------------------------------------
      32              : 
      33              :       real (kind=dbl_kind), parameter, public :: &
      34              :          c0   = 0.0_dbl_kind, &
      35              :          c1   = 1.0_dbl_kind, &
      36              :          c1p5 = 1.5_dbl_kind, &
      37              :          c2   = 2.0_dbl_kind, &
      38              :          c3   = 3.0_dbl_kind, &
      39              :          c4   = 4.0_dbl_kind, &
      40              :          c5   = 5.0_dbl_kind, &
      41              :          c6   = 6.0_dbl_kind, &
      42              :          c8   = 8.0_dbl_kind, &
      43              :          c10  = 10.0_dbl_kind, &
      44              :          c15  = 15.0_dbl_kind, &
      45              :          c16  = 16.0_dbl_kind, &
      46              :          c20  = 20.0_dbl_kind, &
      47              :          c25  = 25.0_dbl_kind, &
      48              :          c100 = 100.0_dbl_kind, &
      49              :          c180 = 180.0_dbl_kind, &
      50              :          c1000= 1000.0_dbl_kind, &
      51              :          p001 = 0.001_dbl_kind, &
      52              :          p01  = 0.01_dbl_kind, &
      53              :          p1   = 0.1_dbl_kind, &
      54              :          p2   = 0.2_dbl_kind, &
      55              :          p4   = 0.4_dbl_kind, &
      56              :          p5   = 0.5_dbl_kind, &
      57              :          p6   = 0.6_dbl_kind, &
      58              :          p05  = 0.05_dbl_kind, &
      59              :          p15  = 0.15_dbl_kind, &
      60              :          p25  = 0.25_dbl_kind, &
      61              :          p75  = 0.75_dbl_kind, &
      62              :          p333 = c1/c3, &
      63              :          p666 = c2/c3, &
      64              :          spval_const= -1.0e36_dbl_kind
      65              : 
      66              :       real (kind=dbl_kind), public :: &
      67              :          secday = 86400.0_dbl_kind ,&! seconds in calendar day
      68              :          puny   = 1.0e-11_dbl_kind, &
      69              :          bignum = 1.0e+30_dbl_kind, &
      70              :          pi     = 3.14159265358979323846_dbl_kind
      71              : 
      72              :       !-----------------------------------------------------------------
      73              :       ! derived physical constants
      74              :       !    Lfresh = Lsub-Lvap     ,&! latent heat of melting of fresh ice (J/kg)
      75              :       !    cprho  = cp_ocn*rhow   ,&! for ocean mixed layer (J kg / K m^3)
      76              :       !    Cp     = 0.5_dbl_kind*gravit*(rhow-rhoi)*rhoi/rhow ,&! proport const for PE
      77              :       !-----------------------------------------------------------------
      78              : 
      79              :       real (kind=dbl_kind), public :: &
      80              :          pih        = spval_const     ,&! 0.5 * pi
      81              :          piq        = spval_const     ,&! 0.25 * pi
      82              :          pi2        = spval_const     ,&! 2 * pi
      83              :          rad_to_deg = spval_const     ,&! conversion factor, radians to degrees
      84              :          Lfresh     = spval_const     ,&! latent heat of melting of fresh ice (J/kg)
      85              :          cprho      = spval_const     ,&! for ocean mixed layer (J kg / K m^3)
      86              :          Cp         = spval_const       ! proport const for PE
      87              : 
      88              :       !-----------------------------------------------------------------
      89              :       ! Densities
      90              :       !-----------------------------------------------------------------
      91              : 
      92              :       real (kind=dbl_kind), public :: &
      93              :          rhos      = 330.0_dbl_kind   ,&! density of snow (kg/m^3)
      94              :          rhoi      = 917.0_dbl_kind   ,&! density of ice (kg/m^3)
      95              :          rhosi     = 940.0_dbl_kind   ,&! average sea ice density
      96              :                                         ! Cox and Weeks, 1982: 919-974 kg/m^2
      97              :          rhow      = 1026.0_dbl_kind  ,&! density of seawater (kg/m^3)
      98              :          rhofresh  = 1000.0_dbl_kind    ! density of fresh water (kg/m^3)
      99              : 
     100              : !-----------------------------------------------------------------------
     101              : ! Parameters for thermodynamics
     102              : !-----------------------------------------------------------------------
     103              : 
     104              :       real (kind=dbl_kind), public :: &
     105              :          hfrazilmin = 0.05_dbl_kind   ,&! min thickness of new frazil ice (m)
     106              :          cp_ice    = 2106._dbl_kind   ,&! specific heat of fresh ice (J/kg/K)
     107              :          cp_ocn    = 4218._dbl_kind   ,&! specific heat of ocn    (J/kg/K)
     108              :                                         ! freshwater value needed for enthalpy
     109              :          depressT  = 0.054_dbl_kind   ,&! Tf:brine salinity ratio (C/ppt)
     110              :          viscosity_dyn = 1.79e-3_dbl_kind, & ! dynamic viscosity of brine (kg/m/s)
     111              :          tscale_pnd_drain = c10       ,&! mushy macroscopic drainage timescale (days)
     112              :          Tocnfrz   = -1.8_dbl_kind    ,&! freezing temp of seawater (C),
     113              :                                         ! used as Tsfcn for open water
     114              :          Tffresh   = 273.15_dbl_kind  ,&! freezing temp of fresh ice (K)
     115              :          Lsub      = 2.835e6_dbl_kind ,&! latent heat, sublimation freshwater (J/kg)
     116              :          Lvap      = 2.501e6_dbl_kind ,&! latent heat, vaporization freshwater (J/kg)
     117              :          Timelt    = 0.0_dbl_kind     ,&! melting temperature, ice top surface  (C)
     118              :          Tsmelt    = 0.0_dbl_kind     ,&! melting temperature, snow top surface (C)
     119              :          ice_ref_salinity =4._dbl_kind,&! (ppt)
     120              :          kice      = 2.03_dbl_kind    ,&! thermal conductivity of fresh ice(W/m/deg)
     121              :                                         ! kice is only used with ktherm=1 (BL99) and conduct='MU71'
     122              :          ksno      = 0.30_dbl_kind    ,&! thermal conductivity of snow  (W/m/deg)
     123              :          hs_min    = 1.e-4_dbl_kind   ,&! min snow thickness for computing zTsn (m)
     124              :          snowpatch = 0.02_dbl_kind    ,&! parameter for fractional snow area (m)
     125              :          saltmax   = 3.2_dbl_kind     ,&! max salinity at ice base for BL99 (ppt)
     126              :                                         ! phi_init, dSin0_frazil are for mushy thermo
     127              :          phi_init  = 0.75_dbl_kind    ,&! initial liquid fraction of frazil
     128              :          min_salin = p1               ,&! threshold for brine pocket treatment
     129              :          salt_loss = 0.4_dbl_kind     ,&! fraction of salt retained in zsalinity
     130              :          Tliquidus_max = c0           ,&! maximum liquidus temperature of mush (C)
     131              :          dSin0_frazil = c3            ,&! bulk salinity reduction of newly formed frazil
     132              :          dts_b     = 50._dbl_kind     ,&! zsalinity timestep
     133              :          ustar_min = 0.005_dbl_kind   ,&! minimum friction velocity for ocean heat flux (m/s)
     134              :          hi_min    = p01              ,&! minimum ice thickness allowed (m) for thermo
     135              :          ! mushy thermo
     136              :          a_rapid_mode      =  0.5e-3_dbl_kind,&! channel radius for rapid drainage mode (m)
     137              :          Rac_rapid_mode    =    10.0_dbl_kind,&! critical Rayleigh number
     138              :          aspect_rapid_mode =     1.0_dbl_kind,&! aspect ratio (larger is wider)
     139              :          dSdt_slow_mode    = -1.5e-7_dbl_kind,&! slow mode drainage strength (m s-1 K-1)
     140              :          phi_c_slow_mode   =    0.05_dbl_kind,&! critical liquid fraction porosity cutoff
     141              :          phi_i_mushy       =    0.85_dbl_kind  ! liquid fraction of congelation ice
     142              : 
     143              :       integer (kind=int_kind), public :: &
     144              :          ktherm = 1      ! type of thermodynamics
     145              :                          ! -1 none
     146              :                          ! 1 = Bitz and Lipscomb 1999
     147              :                          ! 2 = mushy layer theory
     148              : 
     149              :       character (char_len), public :: &
     150              :          conduct = 'bubbly', &          ! 'MU71' or 'bubbly'
     151              :          fbot_xfer_type = 'constant', & ! transfer coefficient type for ice-ocean heat flux
     152              :          cpl_frazil = 'fresh_ice_correction' ! type of coupling for frazil ice
     153              : 
     154              :       logical (kind=log_kind), public :: &
     155              :          calc_Tsfc     = .true. ,&! if true, calculate surface temperature
     156              :                                   ! if false, Tsfc is computed elsewhere and
     157              :                                   ! atmos-ice fluxes are provided to CICE
     158              :          update_ocn_f = .false. ,&! include fresh water and salt fluxes for frazil
     159              :          solve_zsal   = .false. ,&! if true, update salinity profile from solve_S_dt
     160              :          modal_aero   = .false. ,&! if true, use modal aerosal optical properties
     161              :                                   ! only for use with tr_aero or tr_zaero
     162              :          conserv_check = .false.  ! if true, do conservations checks and abort
     163              : 
     164              :       character(len=char_len), public :: &
     165              :          congel_freeze  = 'two-step'  ! congelation computation
     166              :                                       ! 'two-step' = original formulation
     167              :                                       ! 'one-step' = Plante et al, The Cryosphere, 2024
     168              : 
     169              :       character(len=char_len), public :: &
     170              :          tfrz_option  = 'mushy'   ! form of ocean freezing temperature
     171              :                                   ! 'minus1p8' = -1.8 C
     172              :                                   ! 'constant' = Tocnfrz
     173              :                                   ! 'linear_salt' = -depressT * sss
     174              :                                   ! 'mushy' conforms with ktherm=2
     175              : 
     176              :       character(len=char_len), public :: &
     177              :          saltflux_option  = 'constant'! Salt flux computation
     178              :                                       ! 'constant' reference value of ice_ref_salinity
     179              :                                       ! 'prognostic' prognostic salt flux
     180              : 
     181              : !-----------------------------------------------------------------------
     182              : ! Parameters for radiation
     183              : !-----------------------------------------------------------------------
     184              : 
     185              :       real (kind=dbl_kind), public :: &
     186              :          ! (Briegleb JGR 97 11475-11485  July 1992)
     187              :          emissivity = 0.985_dbl_kind,&! emissivity of snow and ice
     188              :          albocn     = 0.06_dbl_kind ,&! ocean albedo
     189              :          vonkar     = 0.4_dbl_kind  ,&! von Karman constant
     190              :          stefan_boltzmann = 567.0e-10_dbl_kind,&!  W/m^2/K^4
     191              :          ! (Ebert, Schramm and Curry JGR 100 15965-15975 Aug 1995)
     192              :          kappav     = 1.4_dbl_kind  ,&! vis extnctn coef in ice, wvlngth<700nm (1/m)
     193              :          hi_ssl     = 0.050_dbl_kind,&! ice surface scattering layer thickness (m)
     194              :          hs_ssl     = 0.040_dbl_kind,&! snow surface scattering layer thickness (m)
     195              :          hs_ssl_min = 5.e-4_dbl_kind,&! minimum snow surface scattering layer thickness for aerosol (m)
     196              :          ! baseline albedos for ccsm3 shortwave, set in namelist
     197              :          albicev    = 0.78_dbl_kind ,&! visible ice albedo for h > ahmax
     198              :          albicei    = 0.36_dbl_kind ,&! near-ir ice albedo for h > ahmax
     199              :          albsnowv   = 0.98_dbl_kind ,&! cold snow albedo, visible
     200              :          albsnowi   = 0.70_dbl_kind ,&! cold snow albedo, near IR
     201              :          ahmax      = 0.3_dbl_kind  ,&! thickness above which ice albedo is constant (m)
     202              :          ! dEdd tuning parameters, set in namelist
     203              :          R_ice      = c0   ,&! sea ice tuning parameter; +1 > 1sig increase in albedo
     204              :          R_pnd      = c0   ,&! ponded ice tuning parameter; +1 > 1sig increase in albedo
     205              :          R_snw      = c1p5 ,&! snow tuning parameter; +1 > ~.01 change in broadband albedo
     206              :          dT_mlt     = c1p5 ,&! change in temp for non-melt to melt snow grain
     207              :                              ! radius change (C)
     208              :          rsnw_mlt   = 1500._dbl_kind,&! maximum melting snow grain radius (10^-6 m)
     209              :          kalg       = 0.60_dbl_kind, &! algae absorption coefficient for 0.5 m thick layer
     210              :                                       ! 0.5 m path of 75 mg Chl a / m2
     211              :          R_gC2molC  = 12.0107_dbl_kind! g carbon per mol carbon
     212              :       ! weights for albedos
     213              :       ! 4 Jan 2007 BPB  Following are appropriate for complete cloud
     214              :       ! in a summer polar atmosphere with 1.5m bare sea ice surface:
     215              :       ! .636/.364 vis/nir with only 0.5% direct for each band.
     216              :       real (kind=dbl_kind), public :: &                 ! currently used only
     217              :          awtvdr = 0.00318_dbl_kind, &! visible, direct  ! for history and
     218              :          awtidr = 0.00182_dbl_kind, &! near IR, direct  ! diagnostics
     219              :          awtvdf = 0.63282_dbl_kind, &! visible, diffuse
     220              :          awtidf = 0.36218_dbl_kind   ! near IR, diffuse
     221              : 
     222              :       character (len=char_len), public :: &
     223              :          shortwave   = 'dEdd', & ! shortwave method, 'ccsm3' or 'dEdd' or 'dEdd_snicar_ad'
     224              :          albedo_type = 'ccsm3'   ! albedo parameterization, 'ccsm3' or 'constant'
     225              :                                  ! shortwave='dEdd' overrides this parameter
     226              : 
     227              :       ! Parameters for shortwave redistribution
     228              :       logical (kind=log_kind), public :: &
     229              :          sw_redist     = .false.
     230              : 
     231              :       real (kind=dbl_kind), public :: &
     232              :          sw_frac      = 0.9_dbl_kind    , & ! Fraction of internal shortwave moved to surface
     233              :          sw_dtemp     = 0.02_dbl_kind       ! temperature difference from melting
     234              : 
     235              :       ! Parameters for dEdd_snicar_ad
     236              :       character (len=char_len), public :: &
     237              :          snw_ssp_table = 'test'   ! lookup table: 'snicar' or 'test'
     238              : 
     239              : !-----------------------------------------------------------------------
     240              : ! Parameters for dynamics, including ridging and strength
     241              : !-----------------------------------------------------------------------
     242              : 
     243              :       integer (kind=int_kind), public :: & ! defined in namelist
     244              :          kstrength   = 1, & ! 0 for simple Hibler (1979) formulation
     245              :                             ! 1 for Rothrock (1975) pressure formulation
     246              :          krdg_partic = 1, & ! 0 for Thorndike et al. (1975) formulation
     247              :                             ! 1 for exponential participation function
     248              :          krdg_redist = 1    ! 0 for Hibler (1980) formulation
     249              :                             ! 1 for exponential redistribution function
     250              : 
     251              :       real (kind=dbl_kind), public :: &
     252              :          Cf       = 17._dbl_kind     ,&! ratio of ridging work to PE change in ridging
     253              :          Pstar    = 2.75e4_dbl_kind  ,&! constant in Hibler strength formula
     254              :                                        ! (kstrength = 0)
     255              :          Cstar    = 20._dbl_kind     ,&! constant in Hibler strength formula
     256              :                                        ! (kstrength = 0)
     257              :          dragio   = 0.00536_dbl_kind ,&! ice-ocn drag coefficient
     258              :          thickness_ocn_layer1 = 2.0_dbl_kind,&! thickness of first ocean level (m)
     259              :          iceruf_ocn = 0.03_dbl_kind  ,&! under-ice roughness (m)
     260              :          gravit   = 9.80616_dbl_kind ,&! gravitational acceleration (m/s^2)
     261              :          mu_rdg = 3.0_dbl_kind ! e-folding scale of ridged ice, krdg_partic=1 (m^0.5)
     262              :                                        ! (krdg_redist = 1)
     263              : 
     264              :       logical (kind=log_kind), public :: &
     265              :          calc_dragio     = .false.     ! if true, calculate dragio from iceruf_ocn and thickness_ocn_layer1
     266              : 
     267              : !-----------------------------------------------------------------------
     268              : ! Parameters for atmosphere
     269              : !-----------------------------------------------------------------------
     270              : 
     271              :       real (kind=dbl_kind), public :: &
     272              :          cp_air = 1005.0_dbl_kind    ,&! specific heat of air (J/kg/K)
     273              :          cp_wv  = 1.81e3_dbl_kind    ,&! specific heat of water vapor (J/kg/K)
     274              :          zvir   = 0.606_dbl_kind     ,&! rh2o/rair - 1.0
     275              :          zref   = 10._dbl_kind       ,&! reference height for stability (m)
     276              :          iceruf = 0.0005_dbl_kind    ,&! ice surface roughness (m)
     277              :          qqqice = 11637800._dbl_kind ,&! for qsat over ice
     278              :          TTTice = 5897.8_dbl_kind    ,&! for qsat over ice
     279              :          qqqocn = 627572.4_dbl_kind  ,&! for qsat over ocn
     280              :          TTTocn = 5107.4_dbl_kind    ,&! for qsat over ocn
     281              :          senscoef= 0.0012_dbl_kind   ,&! Sensible heat flux coefficient for constant-based boundary layer
     282              :          latncoef= 0.0015_dbl_kind     ! Latent heat flux coefficient for constant-based boundary layer
     283              : 
     284              :       character (len=char_len), public :: &
     285              :          atmbndy = 'similarity'        ! atmo boundary method, 'similarity', 'constant' or 'mixed'
     286              : 
     287              :       logical (kind=log_kind), public :: &
     288              :          calc_strair     = .true.  , & ! if true, calculate wind stress
     289              :          formdrag        = .false. , & ! if true, calculate form drag
     290              :          highfreq        = .false.     ! if true, calculate high frequency coupling
     291              : 
     292              :       integer (kind=int_kind), public :: &
     293              :          natmiter        = 5 ! number of iterations for atm boundary layer calcs
     294              : 
     295              :       ! Flux convergence tolerance
     296              :       real (kind=dbl_kind), public :: atmiter_conv = c0
     297              : 
     298              : !-----------------------------------------------------------------------
     299              : ! Parameters for the ice thickness distribution
     300              : !-----------------------------------------------------------------------
     301              : 
     302              :       integer (kind=int_kind), public :: &
     303              :          kitd      = 1 ,&! type of itd conversions
     304              :                          !   0 = delta function
     305              :                          !   1 = linear remap
     306              :          kcatbound = 1   !   0 = old category boundary formula
     307              :                          !   1 = new formula giving round numbers
     308              :                          !   2 = WMO standard
     309              :                          !   3 = asymptotic formula
     310              : 
     311              : !-----------------------------------------------------------------------
     312              : ! Parameters for the floe size distribution
     313              : !-----------------------------------------------------------------------
     314              : 
     315              :       integer (kind=int_kind), public :: &
     316              :          nfreq = 25                   ! number of frequencies
     317              : 
     318              :       real (kind=dbl_kind), public :: &
     319              :          floeshape = 0.66_dbl_kind    ! constant from Rothrock 1984 (unitless)
     320              : 
     321              :       real (kind=dbl_kind), public :: &
     322              :          floediam  = 300.0_dbl_kind   ! effective floe diameter for lateral melt (m)
     323              : 
     324              :       logical (kind=log_kind), public :: &
     325              :          wave_spec = .false.          ! if true, use wave forcing
     326              : 
     327              :       character (len=char_len), public :: &
     328              :          wave_spec_type = 'constant'  ! 'none', 'constant', or 'random'
     329              : 
     330              : !-----------------------------------------------------------------------
     331              : ! Parameters for melt ponds
     332              : !-----------------------------------------------------------------------
     333              : 
     334              :       real (kind=dbl_kind), public :: &
     335              :          hs0       = 0.03_dbl_kind    ! snow depth for transition to bare sea ice (m)
     336              : 
     337              :       ! level-ice ponds
     338              :       character (len=char_len), public :: &
     339              :          frzpnd    = 'cesm'           ! pond refreezing parameterization
     340              : 
     341              :       real (kind=dbl_kind), public :: &
     342              :          dpscale   = 0.001_dbl_kind,& ! alter e-folding time scale for flushing (ktherm=1)
     343              :          rfracmin  = 0.15_dbl_kind, & ! minimum retained fraction of meltwater
     344              :          rfracmax  = 0.85_dbl_kind, & ! maximum retained fraction of meltwater
     345              :          pndaspect = 0.8_dbl_kind, &  ! ratio of pond depth to area fraction
     346              :          hs1       = 0.03_dbl_kind    ! snow depth for transition to bare pond ice (m)
     347              : 
     348              :       ! topo ponds
     349              :       real (kind=dbl_kind), public :: &
     350              :          hp1       = 0.01_dbl_kind    ! critical pond lid thickness for topo ponds
     351              : 
     352              : !-----------------------------------------------------------------------
     353              : ! Parameters for snow redistribution, metamorphosis
     354              : !-----------------------------------------------------------------------
     355              : 
     356              :       character (len=char_len), public :: &
     357              :          snwredist       = 'none', &     ! type of snow redistribution
     358              :          snw_aging_table = 'test'        ! lookup table: 'snicar' or 'test' or 'file'
     359              : 
     360              :       logical (kind=log_kind), public :: &
     361              :          use_smliq_pnd = .false.     , & ! use liquid in snow for ponds
     362              :          snwgrain      = .false.         ! snow metamorphosis
     363              : 
     364              :       real (kind=dbl_kind), public :: &
     365              :          rsnw_fall  = 54.526_dbl_kind, & ! radius of new snow (10^-6 m)
     366              :          rsnw_tmax  = 1500.0_dbl_kind, & ! maximum snow radius (10^-6 m)
     367              :          rhosnew    =  100.0_dbl_kind, & ! new snow density (kg/m^3)
     368              :          rhosmin    =  100.0_dbl_kind, & ! minimum snow density (kg/m^3)
     369              :          rhosmax    =  450.0_dbl_kind, & ! maximum snow density (kg/m^3)
     370              :          windmin    =   10.0_dbl_kind, & ! minimum wind speed to compact snow (m/s)
     371              :          drhosdwind =   27.3_dbl_kind, & ! wind compaction factor for snow (kg s/m^4)
     372              :          snwlvlfac  =    0.3_dbl_kind    ! fractional increase in snow
     373              :                                          ! depth for bulk redistribution
     374              :       ! indices for aging lookup table
     375              :       integer (kind=int_kind), public :: &
     376              :          isnw_T,    & ! maximum temperature index
     377              :          isnw_Tgrd, & ! maximum temperature gradient index
     378              :          isnw_rhos    ! maximum snow density index
     379              : 
     380              :       ! dry snow aging parameters
     381              :       real (kind=dbl_kind), dimension(:), allocatable, public :: &
     382              :          snowage_rhos,  & ! snowage table dimension data for rhos (kg/m^3)
     383              :          snowage_Tgrd,  & ! snowage table dimension data for temp gradient (deg K/m)
     384              :          snowage_T        ! snowage table dimension data for temperature (deg K)
     385              :       real (kind=dbl_kind), dimension(:,:,:), allocatable, public :: &
     386              :          snowage_tau,   & ! snowage table 3D data for tau (10^-6 m)
     387              :          snowage_kappa, & ! snowage table 3D data for kappa (10^-6 m)
     388              :          snowage_drdt0    ! snowage table 3D data for drdt0 (10^-6 m/hr)
     389              : 
     390              : !-----------------------------------------------------------------------
     391              : ! Parameters for biogeochemistry
     392              : !-----------------------------------------------------------------------
     393              : 
     394              :       character(char_len), public :: &
     395              :       ! skl biology parameters
     396              :          bgc_flux_type = 'Jin2006'  ! type of ocean-ice piston velocity (or 'constant')
     397              : 
     398              :       logical (kind=log_kind), public :: &
     399              :          z_tracers  = .false.,    & ! if .true., bgc or aerosol tracers are vertically resolved
     400              :          scale_bgc  = .false.,    & ! if .true., initialize bgc tracers proportionally with salinity
     401              :          solve_zbgc = .false.,    & ! if .true., solve vertical biochemistry portion of code
     402              :          dEdd_algae = .false.,    & ! if .true., algal absorption of shortwave is computed in the
     403              :          skl_bgc    = .false.,    & ! if true, solve skeletal biochemistry
     404              :          use_macromolecules = .false., &  ! if true, ocean DOC already split into
     405              :          ! polysaccharids, lipid and protein fractions
     406              :          use_atm_dust_iron = .false., & ! if .true., compute iron contribution from dust
     407              :          restartbgc = .false.
     408              : 
     409              :       real (kind=dbl_kind), public :: &
     410              :          phi_snow     = -1.0_dbl_kind   , & ! snow porosity (compute from snow density if negative)
     411              :          grid_o       = 0.006_dbl_kind  , & ! for bottom flux
     412              :          initbio_frac = c1              , & ! fraction of ocean trcr concentration in bio trcrs
     413              :          l_sk         = 2.0_dbl_kind    , & ! characteristic diffusive scale (m)
     414              :          grid_oS      = c0              , & ! for bottom flux
     415              :          l_skS        = 0.028_dbl_kind  , & ! characteristic skeletal layer thickness (m) (zsalinity)
     416              :          algal_vel    = 1.0e-7_dbl_kind , & ! 0.5 cm/d(m/s) Lavoie 2005  1.5 cm/day
     417              :          R_dFe2dust   = 0.035_dbl_kind  , & !  g/g (3.5% content) Tagliabue 2009
     418              :          dustFe_sol   = 0.005_dbl_kind  , & ! solubility fraction
     419              :          frazil_scav  = 0.8_dbl_kind    , & ! fraction or multiple of bgc concentrated in frazil ice
     420              :          sk_l         = 0.03_dbl_kind   , & ! skeletal layer thickness (m)
     421              :          min_bgc      = 0.01_dbl_kind   , & ! fraction of ocean bgc concentration in surface melt
     422              :          T_max        = c0              , & ! maximum temperature (C)
     423              :          fsal         = c1              , & ! Salinity limitation (1)
     424              :          op_dep_min   = p1              , & ! light attenuates for optical depths exceeding min
     425              :          fr_graze_s   = p5              , & ! fraction of grazing spilled or slopped
     426              :          fr_graze_e   = p5              , & ! fraction of assimilation excreted
     427              :          fr_mort2min  = 0.9_dbl_kind    , & ! fractionation of mortality to Am
     428              :          fr_dFe       = 1.0_dbl_kind    , & ! fraction of remineralized nitrogen
     429              :                                             ! (in units of algal iron)
     430              :          k_nitrif     = 0.046_dbl_kind  , & ! nitrification rate (1/day)
     431              :          t_iron_conv  = 3065.0_dbl_kind , & ! desorption loss pFe to dFe (day)
     432              :          max_loss     = 0.9_dbl_kind    , & ! restrict uptake to % of remaining value
     433              :          max_dfe_doc1 = 0.2_dbl_kind    , & ! max ratio of dFe to saccharides in the ice
     434              :                                             ! (nM Fe/muM C)
     435              :          fr_resp      = 0.05_dbl_kind   , & ! fraction of algal growth lost due to respiration
     436              :          fr_resp_s    = 0.90_dbl_kind   , & ! DMSPd fraction of respiration loss as DMSPd
     437              :          y_sk_DMS     = 0.7_dbl_kind    , & ! fraction conversion given high yield
     438              :          t_sk_conv    = 5.0_dbl_kind    , & ! Stefels conversion time (d)
     439              :          t_sk_ox      = 12.0_dbl_kind   , & ! DMS oxidation time (d)
     440              :          grid_o_t     =  0.006_dbl_kind , & ! ice surface molecular sublayer thickness (m)
     441              :          ratio_Si2N_diatoms = 1.8_dbl_kind , &  ! algal Si to N (mol/mol)
     442              :          ratio_Si2N_sp      = c0        , &
     443              :          ratio_Si2N_phaeo   = c0        , &
     444              :          ratio_S2N_diatoms  = 0.03_dbl_kind  , & ! algal S  to N (mol/mol)
     445              :          ratio_S2N_sp       = 0.03_dbl_kind  , &
     446              :          ratio_S2N_phaeo    = 0.03_dbl_kind  , &
     447              :          ratio_Fe2C_diatoms = 0.0033_dbl_kind, & ! algal Fe to C  (umol/mol)
     448              :          ratio_Fe2C_sp      = 0.0033_dbl_kind, &
     449              :          ratio_Fe2C_phaeo   = 0.1_dbl_kind   , &
     450              :          ratio_Fe2N_diatoms = 0.023_dbl_kind , & ! algal Fe to N  (umol/mol)
     451              :          ratio_Fe2N_sp      = 0.023_dbl_kind , &
     452              :          ratio_Fe2N_phaeo   = 0.7_dbl_kind   , &
     453              :          ratio_Fe2DON       = 0.023_dbl_kind , & ! Fe to N of DON (nmol/umol)
     454              :          ratio_Fe2DOC_s     = 0.1_dbl_kind   , & ! Fe to C of DOC (nmol/umol) saccharids
     455              :          ratio_Fe2DOC_l     = 0.033_dbl_kind , & ! Fe to C of DOC (nmol/umol) lipids
     456              :          tau_min            = 3600.0_dbl_kind, &    ! rapid timescale for mobile to stationary exchanges (s)
     457              :          tau_max            = 604800.0_dbl_kind, &  ! short timescale for mobile to stationary exchanges (s)
     458              :          chlabs_diatoms     = 0.03_dbl_kind  , & ! absorptivity for diatoms (1/m/(mg/m3))
     459              :          chlabs_sp          = 0.01_dbl_kind  , &      !  absorptivity for small plankton (1/m/(mg/m3))
     460              :          chlabs_phaeo       = 0.05_dbl_kind  , &   ! absorptivity for phaeocystis (1/m/(mg/m3))
     461              :          alpha2max_low_diatoms = 0.3_dbl_kind, & ! light limitation for diatoms (1/(W/m2))
     462              :          alpha2max_low_sp   = 0.2_dbl_kind   , & ! light limitation for small plankton (1/(W/m2))
     463              :          alpha2max_low_phaeo = 0.17_dbl_kind , & ! light limitation for phaeocystis(1/(W/m2))
     464              :          beta2max_diatoms   = 0.001_dbl_kind , & ! light inhibition (1/(W/m^2))
     465              :          beta2max_sp        = 0.001_dbl_kind , &
     466              :          beta2max_phaeo     = 0.04_dbl_kind  , &
     467              :          mu_max_diatoms     = 1.44_dbl_kind  , & ! maximum growth rate (1/day)
     468              :          mu_max_sp          = 0.41_dbl_kind  , &
     469              :          mu_max_phaeo       = 0.63_dbl_kind  , &
     470              :          grow_Tdep_diatoms  = 0.063_dbl_kind , & ! Temperature dependence of growth (1/C)
     471              :          grow_Tdep_sp       = 0.063_dbl_kind , &
     472              :          grow_Tdep_phaeo    = 0.063_dbl_kind , &
     473              :          fr_graze_diatoms   = 0.19_dbl_kind  , & ! Fraction grazed
     474              :          fr_graze_sp        = 0.19_dbl_kind  , &
     475              :          fr_graze_phaeo     = 0.19_dbl_kind  , &
     476              :          mort_pre_diatoms   = 0.007_dbl_kind , & ! Mortality (1/day)
     477              :          mort_pre_sp        = 0.007_dbl_kind , &
     478              :          mort_pre_phaeo     = 0.007_dbl_kind , &
     479              :          mort_Tdep_diatoms  = 0.03_dbl_kind  , & ! T dependence of mortality (1/C)
     480              :          mort_Tdep_sp       = 0.03_dbl_kind  , &
     481              :          mort_Tdep_phaeo    = 0.03_dbl_kind  , &
     482              :          k_exude_diatoms    = c0 , & ! algal exudation (1/d)
     483              :          k_exude_sp         = c0 , &
     484              :          k_exude_phaeo      = c0 , &
     485              :          K_Nit_diatoms      = c1 , & ! nitrate half saturation (mmol/m^3)
     486              :          K_Nit_sp           = c1 , &
     487              :          K_Nit_phaeo        = c1 , &
     488              :          K_Am_diatoms       = 0.3_dbl_kind   , & ! ammonium half saturation (mmol/m^3)
     489              :          K_Am_sp            = 0.3_dbl_kind   , &
     490              :          K_Am_phaeo         = 0.3_dbl_kind   , &
     491              :          K_Sil_diatoms      = 4.0_dbl_kind   , & ! silicate half saturation (mmol/m^3)
     492              :          K_Sil_sp           = c0 , &
     493              :          K_Sil_phaeo        = c0 , &
     494              :          K_Fe_diatoms       = c1 , & ! iron half saturation (nM)
     495              :          K_Fe_sp            = 0.2_dbl_kind   , &
     496              :          K_Fe_phaeo         = 0.1_dbl_kind   , &
     497              :          f_don_protein      = 0.6_dbl_kind   , & ! fraction of spilled grazing to proteins
     498              :          kn_bac_protein     = 0.2_dbl_kind   , & ! Bacterial degredation of DON (1/d)
     499              :          f_don_Am_protein   = c1 , & ! fraction of remineralized DON to ammonium
     500              :          f_doc_s            = 0.5_dbl_kind   , & ! fraction of mortality to DOC
     501              :          f_doc_l            = 0.5_dbl_kind   , &
     502              :          f_exude_s          = c1 , & ! fraction of exudation to DOC
     503              :          f_exude_l          = c1 , &
     504              :          k_bac_s            = 0.03_dbl_kind  , & ! Bacterial degredation of DOC (1/d)
     505              :          k_bac_l            = 0.03_dbl_kind  , &
     506              :          algaltype_diatoms  = c0 , & ! mobility type
     507              :          algaltype_sp       = c0 , & ! algal groups
     508              :          algaltype_phaeo    = c0 , & !
     509              :          nitratetype        = -1.0_dbl_kind  , & ! nitrate
     510              :          ammoniumtype       = c0 , & ! ammonium
     511              :          silicatetype       = -1.0_dbl_kind  , & ! silicate
     512              :          dmspptype          = 0.5_dbl_kind   , & ! DMS
     513              :          dmspdtype          = c0 , & !
     514              :          humtype            = c0 , & ! humics
     515              :          doctype_s          = c0 , & ! DOC
     516              :          doctype_l          = c0 , & !
     517              :          dictype_1          = -1.0_dbl_kind  , & ! DIC
     518              :          dontype_protein    = c0 , & ! DON
     519              :          fedtype_1          = c0 , & ! Iron
     520              :          feptype_1          = 0.5_dbl_kind   , & !
     521              :          zaerotype_bc1      = -1.0_dbl_kind  , & ! Aerosols
     522              :          zaerotype_bc2      = -1.0_dbl_kind  , & !
     523              :          zaerotype_dust1    = -1.0_dbl_kind  , & !
     524              :          zaerotype_dust2    = -1.0_dbl_kind  , & !
     525              :          zaerotype_dust3    = -1.0_dbl_kind  , & !
     526              :          zaerotype_dust4    = -1.0_dbl_kind  , & !
     527              :          ratio_C2N_diatoms  = 7.0_dbl_kind   , & ! algal carbon to nitrogen mole ratio
     528              :          ratio_C2N_sp       = 7.0_dbl_kind   , &
     529              :          ratio_C2N_phaeo    = 7.0_dbl_kind   , &
     530              :          ratio_chl2N_diatoms = 2.1_dbl_kind  , & ! algal chlorophyll to nitrogen ratio (g chla/mol)
     531              :          ratio_chl2N_sp     = 1.1_dbl_kind   , &
     532              :          ratio_chl2N_phaeo  = 0.84_dbl_kind  , &
     533              :          ratio_C2N_proteins = 5.0_dbl_kind   , &! Ratio of carbon to nitrogen in proteins
     534              :          F_abs_chl_diatoms  = 2.0_dbl_kind   , & ! scales absorbed radiation for dEdd
     535              :          F_abs_chl_sp       = 4.0_dbl_kind   , & !
     536              :          F_abs_chl_phaeo    = 5.0_dbl_kind
     537              : !=======================================================================
     538              : 
     539              :       contains
     540              : 
     541              : !=======================================================================
     542              : 
     543              : !autodocument_start icepack_init_parameters
     544              : ! subroutine to set the column package internal parameters
     545              : 
     546          264 :       subroutine icepack_init_parameters(   &
     547              :          argcheck_in, puny_in, bignum_in, pi_in, secday_in, &
     548              :          rhos_in, rhoi_in, rhow_in, cp_air_in, emissivity_in, &
     549              :          cp_ice_in, cp_ocn_in, hfrazilmin_in, floediam_in, &
     550              :          depressT_in, dragio_in, thickness_ocn_layer1_in, iceruf_ocn_in, &
     551              :          albocn_in, gravit_in, viscosity_dyn_in, tscale_pnd_drain_in, &
     552              :          Tocnfrz_in, rhofresh_in, zvir_in, vonkar_in, cp_wv_in, &
     553              :          stefan_boltzmann_in, ice_ref_salinity_in, &
     554              :          Tffresh_in, Lsub_in, Lvap_in, Timelt_in, Tsmelt_in, &
     555              :          iceruf_in, Cf_in, Pstar_in, Cstar_in, kappav_in, &
     556              :          kice_in, ksno_in, &
     557              :          zref_in, hs_min_in, snowpatch_in, rhosi_in, sk_l_in, &
     558              :          saltmax_in, phi_init_in, min_salin_in, salt_loss_in, &
     559              :          Tliquidus_max_in, &
     560              :          min_bgc_in, dSin0_frazil_in, hi_ssl_in, hs_ssl_in, hs_ssl_min_in, &
     561              :          awtvdr_in, awtidr_in, awtvdf_in, awtidf_in, &
     562              :          qqqice_in, TTTice_in, qqqocn_in, TTTocn_in, &
     563              :          ktherm_in, conduct_in, fbot_xfer_type_in, calc_Tsfc_in, dts_b_in, &
     564              :          update_ocn_f_in, ustar_min_in, hi_min_in, a_rapid_mode_in, &
     565              :          cpl_frazil_in, &
     566              :          Rac_rapid_mode_in, aspect_rapid_mode_in, &
     567              :          dSdt_slow_mode_in, phi_c_slow_mode_in, &
     568              :          phi_i_mushy_in, shortwave_in, albedo_type_in, albsnowi_in, &
     569              :          albicev_in, albicei_in, albsnowv_in, &
     570              :          ahmax_in, R_ice_in, R_pnd_in, R_snw_in, dT_mlt_in, rsnw_mlt_in, &
     571              :          kalg_in, R_gC2molC_in, kstrength_in, krdg_partic_in, krdg_redist_in, mu_rdg_in, &
     572              :          atmbndy_in, calc_strair_in, formdrag_in, highfreq_in, natmiter_in, &
     573              :          atmiter_conv_in, calc_dragio_in, &
     574              :          tfrz_option_in, kitd_in, kcatbound_in, hs0_in, frzpnd_in, &
     575              :          saltflux_option_in, congel_freeze_in, &
     576              :          floeshape_in, wave_spec_in, wave_spec_type_in, nfreq_in, &
     577              :          dpscale_in, rfracmin_in, rfracmax_in, pndaspect_in, hs1_in, hp1_in, &
     578              :          bgc_flux_type_in, z_tracers_in, scale_bgc_in, solve_zbgc_in, &
     579              :          modal_aero_in, use_macromolecules_in, restartbgc_in, skl_bgc_in, &
     580              :          solve_zsal_in, grid_o_in, l_sk_in, &
     581              :          initbio_frac_in, grid_oS_in, l_skS_in,  dEdd_algae_in, &
     582              :          phi_snow_in, T_max_in, fsal_in, use_atm_dust_iron_in, &
     583              :          fr_resp_in, algal_vel_in, R_dFe2dust_in, dustFe_sol_in, &
     584              :          op_dep_min_in, fr_graze_s_in, fr_graze_e_in, fr_mort2min_in, &
     585              :          fr_dFe_in, k_nitrif_in, t_iron_conv_in, max_loss_in, &
     586              :          max_dfe_doc1_in, fr_resp_s_in, conserv_check_in, &
     587              :          y_sk_DMS_in, t_sk_conv_in, t_sk_ox_in, frazil_scav_in, &
     588              :          sw_redist_in, sw_frac_in, sw_dtemp_in, snwgrain_in, &
     589              :          snwredist_in, use_smliq_pnd_in, rsnw_fall_in, rsnw_tmax_in, &
     590              :          rhosnew_in, rhosmin_in, rhosmax_in, windmin_in, drhosdwind_in, &
     591              :          snwlvlfac_in, isnw_T_in, isnw_Tgrd_in, isnw_rhos_in, &
     592          264 :          snowage_rhos_in, snowage_Tgrd_in, snowage_T_in, &
     593          264 :          snowage_tau_in, snowage_kappa_in, snowage_drdt0_in, &
     594              :          snw_aging_table_in, snw_ssp_table_in, grid_o_t_in, tau_min_in, tau_max_in,  &
     595              :          f_don_protein_in, kn_bac_protein_in, f_don_Am_protein_in, &
     596              :          ratio_Si2N_diatoms_in, &
     597              :          ratio_Si2N_sp_in, ratio_Si2N_phaeo_in, ratio_S2N_diatoms_in, &
     598              :          ratio_S2N_sp_in, ratio_S2N_phaeo_in, ratio_Fe2C_diatoms_in, &
     599              :          ratio_Fe2C_sp_in, ratio_Fe2C_phaeo_in, ratio_Fe2N_diatoms_in, &
     600              :          ratio_Fe2N_sp_in, ratio_Fe2N_phaeo_in, ratio_Fe2DON_in, &
     601              :          ratio_Fe2DOC_s_in, ratio_Fe2DOC_l_in, &
     602              :          chlabs_diatoms_in, chlabs_sp_in, chlabs_phaeo_in, alpha2max_low_diatoms_in, &
     603              :          alpha2max_low_sp_in, alpha2max_low_phaeo_in, beta2max_diatoms_in, &
     604              :          beta2max_sp_in, beta2max_phaeo_in, mu_max_diatoms_in, mu_max_sp_in, &
     605              :          mu_max_phaeo_in, grow_Tdep_diatoms_in, grow_Tdep_sp_in, &
     606              :          grow_Tdep_phaeo_in, fr_graze_diatoms_in, fr_graze_sp_in, &
     607              :          fr_graze_phaeo_in, mort_pre_diatoms_in, mort_pre_sp_in, &
     608              :          mort_pre_phaeo_in, mort_Tdep_diatoms_in, mort_Tdep_sp_in, &
     609              :          mort_Tdep_phaeo_in, k_exude_diatoms_in, k_exude_sp_in, k_exude_phaeo_in, &
     610              :          K_Nit_diatoms_in, K_Nit_sp_in, K_Nit_phaeo_in, &
     611              :          K_Am_diatoms_in, K_Am_sp_in, K_Am_phaeo_in, &
     612              :          K_Sil_diatoms_in, K_Sil_sp_in, K_Sil_phaeo_in, &
     613              :          K_Fe_diatoms_in, K_Fe_sp_in, K_Fe_phaeo_in, &
     614              :          f_doc_s_in, f_doc_l_in, f_exude_s_in, f_exude_l_in, &
     615              :          k_bac_s_in, k_bac_l_in, algaltype_diatoms_in, &
     616              :          algaltype_sp_in, algaltype_phaeo_in, nitratetype_in, &
     617              :          ammoniumtype_in, silicatetype_in, dmspptype_in, &
     618              :          dmspdtype_in, humtype_in, doctype_s_in, doctype_l_in, &
     619              :          dictype_1_in, dontype_protein_in, fedtype_1_in, feptype_1_in, &
     620              :          zaerotype_bc1_in, zaerotype_bc2_in, zaerotype_dust1_in, &
     621              :          zaerotype_dust2_in, zaerotype_dust3_in, zaerotype_dust4_in, &
     622              :          ratio_C2N_diatoms_in, ratio_C2N_sp_in, ratio_C2N_phaeo_in, &
     623              :          ratio_chl2N_diatoms_in, ratio_chl2N_sp_in, ratio_chl2N_phaeo_in, &
     624              :          F_abs_chl_diatoms_in, F_abs_chl_sp_in, F_abs_chl_phaeo_in, &
     625              :          ratio_C2N_proteins_in )
     626              : 
     627              :       !-----------------------------------------------------------------
     628              :       ! control settings
     629              :       !-----------------------------------------------------------------
     630              : 
     631              :       character(len=*), intent(in), optional :: &
     632              :          argcheck_in      ! optional argument checking, never, first, or always
     633              : 
     634              :       !-----------------------------------------------------------------
     635              :       ! parameter constants
     636              :       !-----------------------------------------------------------------
     637              : 
     638              :       real (kind=dbl_kind), intent(in), optional :: &
     639              :          secday_in,     & !
     640              :          puny_in,       & !
     641              :          bignum_in,     & !
     642              :          pi_in            !
     643              : 
     644              :       !-----------------------------------------------------------------
     645              :       ! densities
     646              :       !-----------------------------------------------------------------
     647              : 
     648              :       real (kind=dbl_kind), intent(in), optional :: &
     649              :          rhos_in,       & ! density of snow (kg/m^3)
     650              :          rhoi_in,       & ! density of ice (kg/m^3)
     651              :          rhosi_in,      & ! average sea ice density (kg/m2)
     652              :          rhow_in,       & ! density of seawater (kg/m^3)
     653              :          rhofresh_in      ! density of fresh water (kg/m^3)
     654              : 
     655              : !-----------------------------------------------------------------------
     656              : ! Parameters for thermodynamics
     657              : !-----------------------------------------------------------------------
     658              : 
     659              :       real (kind=dbl_kind), intent(in), optional :: &
     660              :          floediam_in,   & ! effective floe diameter for lateral melt (m)
     661              :          hfrazilmin_in, & ! min thickness of new frazil ice (m)
     662              :          cp_ice_in,     & ! specific heat of fresh ice (J/kg/K)
     663              :          cp_ocn_in,     & ! specific heat of ocn    (J/kg/K)
     664              :          depressT_in,   & ! Tf:brine salinity ratio (C/ppt)
     665              :          viscosity_dyn_in, & ! dynamic viscosity of brine (kg/m/s)
     666              :          tscale_pnd_drain_in,&! mushy macroscopic drainage timescale (days)
     667              :          Tocnfrz_in,    & ! freezing temp of seawater (C)
     668              :          Tffresh_in,    & ! freezing temp of fresh ice (K)
     669              :          Lsub_in,       & ! latent heat, sublimation freshwater (J/kg)
     670              :          Lvap_in,       & ! latent heat, vaporization freshwater (J/kg)
     671              :          Timelt_in,     & ! melting temperature, ice top surface  (C)
     672              :          Tsmelt_in,     & ! melting temperature, snow top surface (C)
     673              :          ice_ref_salinity_in, & ! (ppt)
     674              :          kice_in,       & ! thermal conductivity of fresh ice(W/m/deg)
     675              :          ksno_in,       & ! thermal conductivity of snow  (W/m/deg)
     676              :          hs_min_in,     & ! min snow thickness for computing zTsn (m)
     677              :          snowpatch_in,  & ! parameter for fractional snow area (m)
     678              :          saltmax_in,    & ! max salinity at ice base for BL99 (ppt)
     679              :          phi_init_in,   & ! initial liquid fraction of frazil
     680              :          min_salin_in,  & ! threshold for brine pocket treatment
     681              :          salt_loss_in,  & ! fraction of salt retained in zsalinity
     682              :          Tliquidus_max_in, & ! maximum liquidus temperature of mush (C)
     683              :          dSin0_frazil_in  ! bulk salinity reduction of newly formed frazil
     684              : 
     685              :       integer (kind=int_kind), intent(in), optional :: &
     686              :          ktherm_in          ! type of thermodynamics
     687              :                             ! -1 none
     688              :                             ! 1 = Bitz and Lipscomb 1999
     689              :                             ! 2 = mushy layer theory
     690              : 
     691              :       character (len=*), intent(in), optional :: &
     692              :          conduct_in, &        ! 'MU71' or 'bubbly'
     693              :          fbot_xfer_type_in, & ! transfer coefficient type for ice-ocean heat flux
     694              :          cpl_frazil_in        ! type of coupling for frazil ice
     695              : 
     696              :       logical (kind=log_kind), intent(in), optional :: &
     697              :          calc_Tsfc_in    , &! if true, calculate surface temperature
     698              :                             ! if false, Tsfc is computed elsewhere and
     699              :                             ! atmos-ice fluxes are provided to CICE
     700              :          update_ocn_f_in    ! include fresh water and salt fluxes for frazil
     701              : 
     702              :       real (kind=dbl_kind), intent(in), optional :: &
     703              :          dts_b_in,   &      ! zsalinity timestep
     704              :          hi_min_in,  &      ! minimum ice thickness allowed (m) for thermo
     705              :          ustar_min_in       ! minimum friction velocity for ice-ocean heat flux
     706              : 
     707              :       ! mushy thermo
     708              :       real(kind=dbl_kind), intent(in), optional :: &
     709              :          a_rapid_mode_in      , & ! channel radius for rapid drainage mode (m)
     710              :          Rac_rapid_mode_in    , & ! critical Rayleigh number for rapid drainage mode
     711              :          aspect_rapid_mode_in , & ! aspect ratio for rapid drainage mode (larger=wider)
     712              :          dSdt_slow_mode_in    , & ! slow mode drainage strength (m s-1 K-1)
     713              :          phi_c_slow_mode_in   , & ! liquid fraction porosity cutoff for slow mode
     714              :          phi_i_mushy_in           ! liquid fraction of congelation ice
     715              : 
     716              :       character(len=*), intent(in), optional :: &
     717              :          congel_freeze_in         ! congelation computation
     718              :                                   ! 'two-step' = original formulation
     719              :                                   ! 'one-step' = Plante et al, The Cryosphere, 2024
     720              : 
     721              :       character(len=*), intent(in), optional :: &
     722              :          tfrz_option_in           ! form of ocean freezing temperature
     723              :                                   ! 'minus1p8' = -1.8 C
     724              :                                   ! 'linear_salt' = -depressT * sss
     725              :                                   ! 'mushy' conforms with ktherm=2
     726              : 
     727              :       character(len=*), intent(in), optional :: &
     728              :          saltflux_option_in       ! Salt flux computation
     729              :                                   ! 'constant' reference value of ice_ref_salinity
     730              :                                   ! 'prognostic' prognostic salt flux
     731              : 
     732              : !-----------------------------------------------------------------------
     733              : ! Parameters for radiation
     734              : !-----------------------------------------------------------------------
     735              : 
     736              :       real(kind=dbl_kind), intent(in), optional :: &
     737              :          emissivity_in, & ! emissivity of snow and ice
     738              :          albocn_in,     & ! ocean albedo
     739              :          vonkar_in,     & ! von Karman constant
     740              :          stefan_boltzmann_in, & !  W/m^2/K^4
     741              :          kappav_in,     & ! vis extnctn coef in ice, wvlngth<700nm (1/m)
     742              :          hi_ssl_in,     & ! ice surface scattering layer thickness (m)
     743              :          hs_ssl_in,     & ! snow surface scattering layer thickness (m)
     744              :          hs_ssl_min_in, & ! minimum snow surface scattering layer thickness for aerosols (m)
     745              :          awtvdr_in,     & ! visible, direct  ! for history and
     746              :          awtidr_in,     & ! near IR, direct  ! diagnostics
     747              :          awtvdf_in,     & ! visible, diffuse
     748              :          awtidf_in        ! near IR, diffuse
     749              : 
     750              :       character (len=*), intent(in), optional :: &
     751              :          shortwave_in, & ! shortwave method, 'ccsm3' or 'dEdd' or 'dEdd_snicar_ad'
     752              :          albedo_type_in  ! albedo parameterization, 'ccsm3' or 'constant'
     753              :                          ! shortwave='dEdd' overrides this parameter
     754              : 
     755              :       ! baseline albedos for ccsm3 shortwave, set in namelist
     756              :       real (kind=dbl_kind), intent(in), optional :: &
     757              :          albicev_in  , & ! visible ice albedo for h > ahmax
     758              :          albicei_in  , & ! near-ir ice albedo for h > ahmax
     759              :          albsnowv_in , & ! cold snow albedo, visible
     760              :          albsnowi_in , & ! cold snow albedo, near IR
     761              :          ahmax_in        ! thickness above which ice albedo is constant (m)
     762              : 
     763              :       ! dEdd tuning parameters, set in namelist
     764              :       real (kind=dbl_kind), intent(in), optional :: &
     765              :          R_ice_in    , & ! sea ice tuning parameter; +1 > 1sig increase in albedo
     766              :          R_pnd_in    , & ! ponded ice tuning parameter; +1 > 1sig increase in albedo
     767              :          R_snw_in    , & ! snow tuning parameter; +1 > ~.01 change in broadband albedo
     768              :          dT_mlt_in   , & ! change in temp for non-melt to melt snow grain
     769              :                          ! radius change (C)
     770              :          rsnw_mlt_in , & ! maximum melting snow grain radius (10^-6 m)
     771              :          kalg_in     , & ! algae absorption coefficient for 0.5 m thick layer
     772              :          R_gC2molC_in    ! g carbon per mol
     773              : 
     774              :       logical (kind=log_kind), intent(in), optional :: &
     775              :          sw_redist_in    ! redistribute shortwave
     776              : 
     777              :       real (kind=dbl_kind), intent(in), optional :: &
     778              :          sw_frac_in  , & ! Fraction of internal shortwave moved to surface
     779              :          sw_dtemp_in     ! temperature difference from melting
     780              : 
     781              : !-----------------------------------------------------------------------
     782              : ! Parameters for dynamics
     783              : !-----------------------------------------------------------------------
     784              : 
     785              :       real(kind=dbl_kind), intent(in), optional :: &
     786              :          Cf_in,         & ! ratio of ridging work to PE change in ridging
     787              :          Pstar_in,      & ! constant in Hibler strength formula
     788              :          Cstar_in,      & ! constant in Hibler strength formula
     789              :          dragio_in,     & ! ice-ocn drag coefficient
     790              :          thickness_ocn_layer1_in, & ! thickness of first ocean level (m)
     791              :          iceruf_ocn_in, & ! under-ice roughness (m)
     792              :          gravit_in,     & ! gravitational acceleration (m/s^2)
     793              :          iceruf_in        ! ice surface roughness (m)
     794              : 
     795              :       integer (kind=int_kind), intent(in), optional :: & ! defined in namelist
     796              :          kstrength_in  , & ! 0 for simple Hibler (1979) formulation
     797              :                            ! 1 for Rothrock (1975) pressure formulation
     798              :          krdg_partic_in, & ! 0 for Thorndike et al. (1975) formulation
     799              :                            ! 1 for exponential participation function
     800              :          krdg_redist_in    ! 0 for Hibler (1980) formulation
     801              :                            ! 1 for exponential redistribution function
     802              : 
     803              :       real (kind=dbl_kind), intent(in), optional :: &
     804              :          mu_rdg_in         ! gives e-folding scale of ridged ice (m^.5)
     805              :                            ! (krdg_redist = 1)
     806              : 
     807              :       logical (kind=log_kind), intent(in), optional :: &
     808              :          calc_dragio_in    ! if true, calculate dragio from iceruf_ocn and thickness_ocn_layer1
     809              : 
     810              : !-----------------------------------------------------------------------
     811              : ! Parameters for atmosphere
     812              : !-----------------------------------------------------------------------
     813              : 
     814              :       real (kind=dbl_kind), intent(in), optional :: &
     815              :          cp_air_in,     & ! specific heat of air (J/kg/K)
     816              :          cp_wv_in,      & ! specific heat of water vapor (J/kg/K)
     817              :          zvir_in,       & ! rh2o/rair - 1.0
     818              :          zref_in,       & ! reference height for stability (m)
     819              :          qqqice_in,     & ! for qsat over ice
     820              :          TTTice_in,     & ! for qsat over ice
     821              :          qqqocn_in,     & ! for qsat over ocn
     822              :          TTTocn_in        ! for qsat over ocn
     823              : 
     824              :       character (len=*), intent(in), optional :: &
     825              :          atmbndy_in   ! atmo boundary method, 'similarity', 'constant' or 'mixed'
     826              : 
     827              :       logical (kind=log_kind), intent(in), optional :: &
     828              :          calc_strair_in,     & ! if true, calculate wind stress components
     829              :          formdrag_in,        & ! if true, calculate form drag
     830              :          highfreq_in           ! if true, use high frequency coupling
     831              : 
     832              :       integer (kind=int_kind), intent(in), optional :: &
     833              :          natmiter_in        ! number of iterations for boundary layer calculations
     834              : 
     835              :       ! Flux convergence tolerance
     836              :       real (kind=dbl_kind), intent(in), optional :: atmiter_conv_in
     837              : 
     838              : !-----------------------------------------------------------------------
     839              : ! Parameters for the ice thickness distribution
     840              : !-----------------------------------------------------------------------
     841              : 
     842              :       integer (kind=int_kind), intent(in), optional :: &
     843              :          kitd_in        , & ! type of itd conversions
     844              :                             !   0 = delta function
     845              :                             !   1 = linear remap
     846              :          kcatbound_in       !   0 = old category boundary formula
     847              :                             !   1 = new formula giving round numbers
     848              :                             !   2 = WMO standard
     849              :                             !   3 = asymptotic formula
     850              : 
     851              : !-----------------------------------------------------------------------
     852              : ! Parameters for the floe size distribution
     853              : !-----------------------------------------------------------------------
     854              : 
     855              :       integer (kind=int_kind), intent(in), optional :: &
     856              :          nfreq_in           ! number of frequencies
     857              : 
     858              :       real (kind=dbl_kind), intent(in), optional :: &
     859              :          floeshape_in       ! constant from Rothrock 1984 (unitless)
     860              : 
     861              :       logical (kind=log_kind), intent(in), optional :: &
     862              :          wave_spec_in       ! if true, use wave forcing
     863              : 
     864              :       character (len=*), intent(in), optional :: &
     865              :          wave_spec_type_in  ! type of wave spectrum forcing
     866              : 
     867              : !-----------------------------------------------------------------------
     868              : ! Parameters for biogeochemistry
     869              : !-----------------------------------------------------------------------
     870              : 
     871              :      character (len=*), intent(in), optional :: &
     872              :         bgc_flux_type_in    ! type of ocean-ice piston velocity
     873              :                             ! 'constant', 'Jin2006'
     874              : 
     875              :       logical (kind=log_kind), intent(in), optional :: &
     876              :          z_tracers_in,      & ! if .true., bgc or aerosol tracers are vertically resolved
     877              :          scale_bgc_in,      & ! if .true., initialize bgc tracers proportionally with salinity
     878              :          solve_zbgc_in,     & ! if .true., solve vertical biochemistry portion of code
     879              :          dEdd_algae_in,     & ! if .true., algal absorptionof Shortwave is computed in the
     880              :          modal_aero_in,     & ! if .true., use modal aerosol formulation in shortwave
     881              :          use_macromolecules_in, & ! if .true., ocean DOC is already split into
     882              :          ! polysaccharid, lipid and protein fractions
     883              :          use_atm_dust_iron_in, & ! if .true., compute iron contribution from dust
     884              :          restartbgc_in,     &
     885              :          conserv_check_in     ! if .true., run conservation checks and abort if checks fail
     886              : 
     887              :       logical (kind=log_kind), intent(in), optional :: &
     888              :          skl_bgc_in,        &   ! if true, solve skeletal biochemistry
     889              :          solve_zsal_in          ! if true, update salinity profile from solve_S_dt
     890              : 
     891              :       real (kind=dbl_kind), intent(in), optional :: &
     892              :          grid_o_in      , & ! for bottom flux
     893              :          l_sk_in        , & ! characteristic diffusive scale (zsalinity) (m)
     894              :          grid_o_t_in    , & ! top grid point length scale
     895              :          initbio_frac_in, & ! fraction of ocean tracer concentration used to initialize tracer
     896              :          phi_snow_in        ! snow porosity at the ice/snow interface
     897              : 
     898              :       real (kind=dbl_kind), intent(in), optional :: &
     899              :          grid_oS_in     , & ! for bottom flux (zsalinity)
     900              :          l_skS_in           ! 0.02 characteristic skeletal layer thickness (m) (zsalinity)
     901              : 
     902              :       real (kind=dbl_kind), intent(in), optional :: &
     903              :          ratio_Si2N_diatoms_in, &   ! algal Si to N (mol/mol)
     904              :          ratio_Si2N_sp_in     , &
     905              :          ratio_Si2N_phaeo_in  , &
     906              :          ratio_S2N_diatoms_in , &   ! algal S  to N (mol/mol)
     907              :          ratio_S2N_sp_in      , &
     908              :          ratio_S2N_phaeo_in   , &
     909              :          ratio_Fe2C_diatoms_in, &   ! algal Fe to C  (umol/mol)
     910              :          ratio_Fe2C_sp_in     , &
     911              :          ratio_Fe2C_phaeo_in  , &
     912              :          ratio_Fe2N_diatoms_in, &   ! algal Fe to N  (umol/mol)
     913              :          ratio_Fe2N_sp_in     , &
     914              :          ratio_Fe2N_phaeo_in  , &
     915              :          ratio_Fe2DON_in      , &   ! Fe to N of DON (nmol/umol)
     916              :          ratio_Fe2DOC_s_in    , &   ! Fe to C of DOC (nmol/umol) saccharids
     917              :          ratio_Fe2DOC_l_in    , &   ! Fe to C of DOC (nmol/umol) lipids
     918              :          tau_min_in           , &   ! rapid mobile to stationary exchanges (s) = 1.5 hours
     919              :          tau_max_in           , &   ! long time mobile to stationary exchanges (s) = 2 days
     920              :          chlabs_diatoms_in   , & ! chl absorption (1/m/(mg/m^3))
     921              :          chlabs_sp_in        , & !
     922              :          chlabs_phaeo_in     , & !
     923              :          alpha2max_low_diatoms_in , & ! light limitation (1/(W/m^2))
     924              :          alpha2max_low_sp_in      , &
     925              :          alpha2max_low_phaeo_in   , &
     926              :          beta2max_diatoms_in , & ! light inhibition (1/(W/m^2))
     927              :          beta2max_sp_in      , &
     928              :          beta2max_phaeo_in   , &
     929              :          mu_max_diatoms_in   , & ! maximum growth rate (1/day)
     930              :          mu_max_sp_in        , &
     931              :          mu_max_phaeo_in     , &
     932              :          grow_Tdep_diatoms_in, & ! Temperature dependence of growth (1/C)
     933              :          grow_Tdep_sp_in     , &
     934              :          grow_Tdep_phaeo_in  , &
     935              :          fr_graze_diatoms_in , & ! Fraction grazed
     936              :          fr_graze_sp_in      , &
     937              :          fr_graze_phaeo_in   , &
     938              :          mort_pre_diatoms_in , & ! Mortality (1/day)
     939              :          mort_pre_sp_in      , &
     940              :          mort_pre_phaeo_in   , &
     941              :          mort_Tdep_diatoms_in, & ! T dependence of mortality (1/C)
     942              :          mort_Tdep_sp_in     , &
     943              :          mort_Tdep_phaeo_in  , &
     944              :          k_exude_diatoms_in  , & ! algal exudation (1/d)
     945              :          k_exude_sp_in       , &
     946              :          k_exude_phaeo_in    , &
     947              :          K_Nit_diatoms_in    , & ! nitrate half saturation (mmol/m^3)
     948              :          K_Nit_sp_in         , &
     949              :          K_Nit_phaeo_in      , &
     950              :          K_Am_diatoms_in     , & ! ammonium half saturation (mmol/m^3)
     951              :          K_Am_sp_in          , &
     952              :          K_Am_phaeo_in       , &
     953              :          K_Sil_diatoms_in    , & ! silicate half saturation (mmol/m^3)
     954              :          K_Sil_sp_in         , &
     955              :          K_Sil_phaeo_in      , &
     956              :          K_Fe_diatoms_in     , & ! iron half saturation (nM)
     957              :          K_Fe_sp_in          , &
     958              :          K_Fe_phaeo_in       , &
     959              :          f_don_protein_in    , & ! fraction of spilled grazing to proteins
     960              :          kn_bac_protein_in   , & ! Bacterial degredation of DON (1/d)
     961              :          f_don_Am_protein_in , & ! fraction of remineralized DON to ammonium
     962              :          f_doc_s_in          , & ! fraction of mortality to DOC
     963              :          f_doc_l_in          , &
     964              :          f_exude_s_in        , & ! fraction of exudation to DOC
     965              :          f_exude_l_in        , &
     966              :          k_bac_s_in          , & ! Bacterial degredation of DOC (1/d)
     967              :          k_bac_l_in          , &
     968              :          algaltype_diatoms_in  , & ! mobility type
     969              :          algaltype_sp_in       , & !
     970              :          algaltype_phaeo_in    , & !
     971              :          nitratetype_in        , & !
     972              :          ammoniumtype_in       , & !
     973              :          silicatetype_in       , & !
     974              :          dmspptype_in          , & !
     975              :          dmspdtype_in          , & !
     976              :          humtype_in            , & !
     977              :          doctype_s_in          , & !
     978              :          doctype_l_in          , & !
     979              :          dictype_1_in          , & !
     980              :          dontype_protein_in    , & !
     981              :          fedtype_1_in          , & !
     982              :          feptype_1_in          , & !
     983              :          zaerotype_bc1_in      , & !
     984              :          zaerotype_bc2_in      , & !
     985              :          zaerotype_dust1_in    , & !
     986              :          zaerotype_dust2_in    , & !
     987              :          zaerotype_dust3_in    , & !
     988              :          zaerotype_dust4_in    , & !
     989              :          ratio_C2N_diatoms_in  , & ! algal C to N ratio (mol/mol)
     990              :          ratio_C2N_sp_in       , & !
     991              :          ratio_C2N_phaeo_in    , & !
     992              :          ratio_chl2N_diatoms_in, & ! algal chlorophyll to N ratio (mg/mmol)
     993              :          ratio_chl2N_sp_in     , & !
     994              :          ratio_chl2N_phaeo_in  , & !
     995              :          F_abs_chl_diatoms_in  , & ! scales absorbed radiation for dEdd
     996              :          F_abs_chl_sp_in       , & !
     997              :          F_abs_chl_phaeo_in    , & !
     998              :          ratio_C2N_proteins_in     ! ratio of C to N in proteins (mol/mol)
     999              : 
    1000              :       real (kind=dbl_kind), intent(in), optional :: &
    1001              :          fr_resp_in           , &   ! fraction of algal growth lost due to respiration
    1002              :          algal_vel_in         , &   ! 0.5 cm/d(m/s) Lavoie 2005  1.5 cm/day
    1003              :          R_dFe2dust_in        , &   !  g/g (3.5% content) Tagliabue 2009
    1004              :          dustFe_sol_in        , &   ! solubility fraction
    1005              :          T_max_in            , & ! maximum temperature (C)
    1006              :          fsal_in             , & ! Salinity limitation (ppt)
    1007              :          op_dep_min_in       , & ! Light attenuates for optical depths exceeding min
    1008              :          fr_graze_s_in       , & ! fraction of grazing spilled or slopped
    1009              :          fr_graze_e_in       , & ! fraction of assimilation excreted
    1010              :          fr_mort2min_in      , & ! fractionation of mortality to Am
    1011              :          fr_dFe_in           , & ! fraction of remineralized nitrogen
    1012              :                                     ! (in units of algal iron)
    1013              :          k_nitrif_in         , & ! nitrification rate (1/day)
    1014              :          t_iron_conv_in      , & ! desorption loss pFe to dFe (day)
    1015              :          max_loss_in         , & ! restrict uptake to % of remaining value
    1016              :          max_dfe_doc1_in     , & ! max ratio of dFe to saccharides in the ice
    1017              :                                     ! (nM Fe/muM C)
    1018              :          fr_resp_s_in        , & ! DMSPd fraction of respiration loss as DMSPd
    1019              :          y_sk_DMS_in         , & ! fraction conversion given high yield
    1020              :          t_sk_conv_in        , & ! Stefels conversion time (d)
    1021              :          t_sk_ox_in          , & ! DMS oxidation time (d)
    1022              :          frazil_scav_in          ! scavenging fraction or multiple in frazil ice
    1023              : 
    1024              :       real (kind=dbl_kind), intent(in), optional :: &
    1025              :          sk_l_in,       & ! skeletal layer thickness (m)
    1026              :          min_bgc_in       ! fraction of ocean bgc concentration in surface melt
    1027              : 
    1028              : !-----------------------------------------------------------------------
    1029              : ! Parameters for melt ponds
    1030              : !-----------------------------------------------------------------------
    1031              : 
    1032              :       real (kind=dbl_kind), intent(in), optional :: &
    1033              :          hs0_in             ! snow depth for transition to bare sea ice (m)
    1034              : 
    1035              :       ! level-ice ponds
    1036              :       character (len=*), intent(in), optional :: &
    1037              :          frzpnd_in          ! pond refreezing parameterization
    1038              : 
    1039              :       real (kind=dbl_kind), intent(in), optional :: &
    1040              :          dpscale_in, &      ! alter e-folding time scale for flushing
    1041              :          rfracmin_in, &     ! minimum retained fraction of meltwater
    1042              :          rfracmax_in, &     ! maximum retained fraction of meltwater
    1043              :          pndaspect_in, &    ! ratio of pond depth to pond fraction
    1044              :          hs1_in             ! tapering parameter for snow on pond ice
    1045              : 
    1046              :       ! topo ponds
    1047              :       real (kind=dbl_kind), intent(in), optional :: &
    1048              :          hp1_in             ! critical parameter for pond ice thickness
    1049              : 
    1050              : !-----------------------------------------------------------------------
    1051              : ! Parameters for snow redistribution, metamorphosis
    1052              : !-----------------------------------------------------------------------
    1053              : 
    1054              :       character (len=*), intent(in), optional :: &
    1055              :          snwredist_in, &    ! type of snow redistribution
    1056              :          snw_aging_table_in ! snow aging lookup table
    1057              : 
    1058              :       logical (kind=log_kind), intent(in), optional :: &
    1059              :          use_smliq_pnd_in, &! use liquid in snow for ponds
    1060              :          snwgrain_in        ! snow metamorphosis
    1061              : 
    1062              :       real (kind=dbl_kind), intent(in), optional :: &
    1063              :          rsnw_fall_in, &    ! radius of new snow (10^-6 m)
    1064              :          rsnw_tmax_in, &    ! maximum snow radius (10^-6 m)
    1065              :          rhosnew_in, &      ! new snow density (kg/m^3)
    1066              :          rhosmin_in, &      ! minimum snow density (kg/m^3)
    1067              :          rhosmax_in, &      ! maximum snow density (kg/m^3)
    1068              :          windmin_in, &      ! minimum wind speed to compact snow (m/s)
    1069              :          drhosdwind_in, &   ! wind compaction factor (kg s/m^4)
    1070              :          snwlvlfac_in       ! fractional increase in snow depth
    1071              : 
    1072              :       integer (kind=int_kind), intent(in), optional :: &
    1073              :          isnw_T_in, &       ! maxiumum temperature index
    1074              :          isnw_Tgrd_in, &    ! maxiumum temperature gradient index
    1075              :          isnw_rhos_in       ! maxiumum snow density index
    1076              : 
    1077              :       real (kind=dbl_kind), dimension(:), intent(in), optional :: &
    1078              :          snowage_rhos_in, & ! snowage dimension data
    1079              :          snowage_Tgrd_in, & !
    1080              :          snowage_T_in       !
    1081              : 
    1082              :       real (kind=dbl_kind), dimension(:,:,:), intent(in), optional :: &
    1083              :          snowage_tau_in, &  ! (10^-6 m)
    1084              :          snowage_kappa_in, &!
    1085              :          snowage_drdt0_in   ! (10^-6 m/hr)
    1086              : 
    1087              :       character (len=char_len), intent(in), optional :: &
    1088              :          snw_ssp_table_in   ! lookup table: 'snicar' or 'test'
    1089              : 
    1090              : !autodocument_end
    1091              : 
    1092              :       ! local data
    1093              : 
    1094              :       integer (kind=int_kind) :: &
    1095              :          dim1, dim2, dim3   ! array dimension sizes
    1096              : 
    1097              :       character(len=*),parameter :: subname='(icepack_init_parameters)'
    1098              : 
    1099          264 :       if (present(argcheck_in)          ) argcheck         = argcheck_in
    1100          264 :       if (present(puny_in)              ) puny             = puny_in
    1101          264 :       if (present(bignum_in)            ) bignum           = bignum_in
    1102          264 :       if (present(pi_in)                ) pi               = pi_in
    1103              : 
    1104          264 :       if (present(rhos_in)              ) rhos             = rhos_in
    1105          264 :       if (present(rhoi_in)              ) rhoi             = rhoi_in
    1106          264 :       if (present(rhow_in)              ) rhow             = rhow_in
    1107          264 :       if (present(cp_air_in)            ) cp_air           = cp_air_in
    1108          264 :       if (present(emissivity_in)        ) emissivity       = emissivity_in
    1109          264 :       if (present(floediam_in)          ) floediam         = floediam_in
    1110          264 :       if (present(hfrazilmin_in)        ) hfrazilmin       = hfrazilmin_in
    1111          264 :       if (present(cp_ice_in)            ) cp_ice           = cp_ice_in
    1112          264 :       if (present(cp_ocn_in)            ) cp_ocn           = cp_ocn_in
    1113          264 :       if (present(depressT_in)          ) depressT         = depressT_in
    1114          264 :       if (present(dragio_in)            ) dragio           = dragio_in
    1115          264 :       if (present(iceruf_ocn_in)        ) iceruf_ocn       = iceruf_ocn_in
    1116          264 :       if (present(thickness_ocn_layer1_in) ) thickness_ocn_layer1 = thickness_ocn_layer1_in
    1117          264 :       if (present(calc_dragio_in)       ) calc_dragio      = calc_dragio_in
    1118          264 :       if (present(albocn_in)            ) albocn           = albocn_in
    1119          264 :       if (present(gravit_in)            ) gravit           = gravit_in
    1120          264 :       if (present(viscosity_dyn_in)     ) viscosity_dyn    = viscosity_dyn_in
    1121          264 :       if (present(tscale_pnd_drain_in)  ) tscale_pnd_drain = tscale_pnd_drain_in
    1122          264 :       if (present(Tocnfrz_in)           ) Tocnfrz          = Tocnfrz_in
    1123          264 :       if (present(rhofresh_in)          ) rhofresh         = rhofresh_in
    1124          264 :       if (present(zvir_in)              ) zvir             = zvir_in
    1125          264 :       if (present(vonkar_in)            ) vonkar           = vonkar_in
    1126          264 :       if (present(cp_wv_in)             ) cp_wv            = cp_wv_in
    1127          264 :       if (present(stefan_boltzmann_in)  ) stefan_boltzmann = stefan_boltzmann_in
    1128          264 :       if (present(Tffresh_in)           ) Tffresh          = Tffresh_in
    1129          264 :       if (present(Lsub_in)              ) Lsub             = Lsub_in
    1130          264 :       if (present(Lvap_in)              ) Lvap             = Lvap_in
    1131          264 :       if (present(Timelt_in)            ) Timelt           = Timelt_in
    1132          264 :       if (present(Tsmelt_in)            ) Tsmelt           = Tsmelt_in
    1133          264 :       if (present(ice_ref_salinity_in)  ) ice_ref_salinity = ice_ref_salinity_in
    1134          264 :       if (present(iceruf_in)            ) iceruf           = iceruf_in
    1135          264 :       if (present(Cf_in)                ) Cf               = Cf_in
    1136          264 :       if (present(Pstar_in)             ) Pstar            = Pstar_in
    1137          264 :       if (present(Cstar_in)             ) Cstar            = Cstar_in
    1138          264 :       if (present(kappav_in)            ) kappav           = kappav_in
    1139          264 :       if (present(kice_in)              ) kice             = kice_in
    1140          264 :       if (present(ksno_in)              ) ksno             = ksno_in
    1141          264 :       if (present(zref_in)              ) zref             = zref_in
    1142          264 :       if (present(hs_min_in)            ) hs_min           = hs_min_in
    1143          264 :       if (present(snowpatch_in)         ) snowpatch        = snowpatch_in
    1144          264 :       if (present(rhosi_in)             ) rhosi            = rhosi_in
    1145          264 :       if (present(sk_l_in)              ) sk_l             = sk_l_in
    1146          264 :       if (present(saltmax_in)           ) saltmax          = saltmax_in
    1147          264 :       if (present(phi_init_in)          ) phi_init         = phi_init_in
    1148          264 :       if (present(min_salin_in)         ) min_salin        = min_salin_in
    1149          264 :       if (present(salt_loss_in)         ) salt_loss        = salt_loss_in
    1150          264 :       if (present(Tliquidus_max_in)     ) Tliquidus_max    = Tliquidus_max_in
    1151          264 :       if (present(min_bgc_in)           ) min_bgc          = min_bgc_in
    1152          264 :       if (present(dSin0_frazil_in)      ) dSin0_frazil     = dSin0_frazil_in
    1153          264 :       if (present(hi_ssl_in)            ) hi_ssl           = hi_ssl_in
    1154          264 :       if (present(hs_ssl_in)            ) hs_ssl           = hs_ssl_in
    1155          264 :       if (present(hs_ssl_min_in)        ) hs_ssl_min       = hs_ssl_min_in
    1156          264 :       if (present(awtvdr_in)            ) awtvdr           = awtvdr_in
    1157          264 :       if (present(awtidr_in)            ) awtidr           = awtidr_in
    1158          264 :       if (present(awtvdf_in)            ) awtvdf           = awtvdf_in
    1159          264 :       if (present(awtidf_in)            ) awtidf           = awtidf_in
    1160          264 :       if (present(qqqice_in)            ) qqqice           = qqqice_in
    1161          264 :       if (present(TTTice_in)            ) TTTice           = TTTice_in
    1162          264 :       if (present(qqqocn_in)            ) qqqocn           = qqqocn_in
    1163          264 :       if (present(TTTocn_in)            ) TTTocn           = TTTocn_in
    1164          264 :       if (present(secday_in)            ) secday           = secday_in
    1165          264 :       if (present(ktherm_in)            ) ktherm           = ktherm_in
    1166          264 :       if (present(conduct_in)           ) conduct          = conduct_in
    1167          264 :       if (present(fbot_xfer_type_in)    ) fbot_xfer_type   = fbot_xfer_type_in
    1168          264 :       if (present(calc_Tsfc_in)         ) calc_Tsfc        = calc_Tsfc_in
    1169          264 :       if (present(cpl_frazil_in)        ) cpl_frazil       = cpl_frazil_in
    1170          264 :       if (present(update_ocn_f_in)      ) update_ocn_f     = update_ocn_f_in
    1171          264 :       if (present(dts_b_in)             ) dts_b            = dts_b_in
    1172          264 :       if (present(ustar_min_in)         ) ustar_min        = ustar_min_in
    1173          264 :       if (present(hi_min_in)            ) hi_min           = hi_min_in
    1174          264 :       if (present(a_rapid_mode_in)      ) a_rapid_mode     = a_rapid_mode_in
    1175          264 :       if (present(Rac_rapid_mode_in)    ) Rac_rapid_mode   = Rac_rapid_mode_in
    1176          264 :       if (present(aspect_rapid_mode_in) ) aspect_rapid_mode= aspect_rapid_mode_in
    1177          264 :       if (present(dSdt_slow_mode_in)    ) dSdt_slow_mode   = dSdt_slow_mode_in
    1178          264 :       if (present(phi_c_slow_mode_in)   ) phi_c_slow_mode  = phi_c_slow_mode_in
    1179          264 :       if (present(phi_i_mushy_in)       ) phi_i_mushy      = phi_i_mushy_in
    1180          264 :       if (present(shortwave_in)         ) shortwave        = shortwave_in
    1181          264 :       if (present(albedo_type_in)       ) albedo_type      = albedo_type_in
    1182          264 :       if (present(albicev_in)           ) albicev          = albicev_in
    1183          264 :       if (present(albicei_in)           ) albicei          = albicei_in
    1184          264 :       if (present(albsnowv_in)          ) albsnowv         = albsnowv_in
    1185          264 :       if (present(albsnowi_in)          ) albsnowi         = albsnowi_in
    1186          264 :       if (present(ahmax_in)             ) ahmax            = ahmax_in
    1187          264 :       if (present(R_ice_in)             ) R_ice            = R_ice_in
    1188          264 :       if (present(R_pnd_in)             ) R_pnd            = R_pnd_in
    1189          264 :       if (present(R_snw_in)             ) R_snw            = R_snw_in
    1190          264 :       if (present(dT_mlt_in)            ) dT_mlt           = dT_mlt_in
    1191          264 :       if (present(rsnw_mlt_in)          ) rsnw_mlt         = rsnw_mlt_in
    1192          264 :       if (present(kalg_in)              ) kalg             = kalg_in
    1193          264 :       if (present(R_gC2molC_in)         ) R_gC2molC        = R_gC2molC_in
    1194          264 :       if (present(kstrength_in)         ) kstrength        = kstrength_in
    1195          264 :       if (present(krdg_partic_in)       ) krdg_partic      = krdg_partic_in
    1196          264 :       if (present(krdg_redist_in)       ) krdg_redist      = krdg_redist_in
    1197          264 :       if (present(mu_rdg_in)            ) mu_rdg           = mu_rdg_in
    1198          264 :       if (present(atmbndy_in)           ) atmbndy          = atmbndy_in
    1199          264 :       if (present(calc_strair_in)       ) calc_strair      = calc_strair_in
    1200          264 :       if (present(formdrag_in)          ) formdrag         = formdrag_in
    1201          264 :       if (present(highfreq_in)          ) highfreq         = highfreq_in
    1202          264 :       if (present(natmiter_in)          ) natmiter         = natmiter_in
    1203          264 :       if (present(atmiter_conv_in)      ) atmiter_conv     = atmiter_conv_in
    1204          264 :       if (present(congel_freeze_in)     ) congel_freeze    = congel_freeze_in
    1205          264 :       if (present(tfrz_option_in)       ) tfrz_option      = tfrz_option_in
    1206          264 :       if (present(saltflux_option_in)   ) saltflux_option  = saltflux_option_in
    1207          264 :       if (present(kitd_in)              ) kitd             = kitd_in
    1208          264 :       if (present(kcatbound_in)         ) kcatbound        = kcatbound_in
    1209          264 :       if (present(floeshape_in)         ) floeshape        = floeshape_in
    1210          264 :       if (present(wave_spec_in)         ) wave_spec        = wave_spec_in
    1211          264 :       if (present(wave_spec_type_in)    ) wave_spec_type   = wave_spec_type_in
    1212          264 :       if (present(nfreq_in)             ) nfreq            = nfreq_in
    1213          264 :       if (present(hs0_in)               ) hs0              = hs0_in
    1214          264 :       if (present(frzpnd_in)            ) frzpnd           = frzpnd_in
    1215          264 :       if (present(dpscale_in)           ) dpscale          = dpscale_in
    1216          264 :       if (present(rfracmin_in)          ) rfracmin         = rfracmin_in
    1217          264 :       if (present(rfracmax_in)          ) rfracmax         = rfracmax_in
    1218          264 :       if (present(pndaspect_in)         ) pndaspect        = pndaspect_in
    1219          264 :       if (present(hs1_in)               ) hs1              = hs1_in
    1220          264 :       if (present(hp1_in)               ) hp1              = hp1_in
    1221          264 :       if (present(snwredist_in)         ) snwredist        = snwredist_in
    1222          264 :       if (present(snw_aging_table_in)   ) snw_aging_table  = snw_aging_table_in
    1223          264 :       if (present(snwgrain_in)          ) snwgrain         = snwgrain_in
    1224          264 :       if (present(use_smliq_pnd_in)     ) use_smliq_pnd    = use_smliq_pnd_in
    1225          264 :       if (present(rsnw_fall_in)         ) rsnw_fall        = rsnw_fall_in
    1226          264 :       if (present(rsnw_tmax_in)         ) rsnw_tmax        = rsnw_tmax_in
    1227          264 :       if (present(rhosnew_in)           ) rhosnew          = rhosnew_in
    1228          264 :       if (present(rhosmin_in)           ) rhosmin          = rhosmin_in
    1229          264 :       if (present(rhosmax_in)           ) rhosmax          = rhosmax_in
    1230          264 :       if (present(windmin_in)           ) windmin          = windmin_in
    1231          264 :       if (present(drhosdwind_in)        ) drhosdwind       = drhosdwind_in
    1232          264 :       if (present(snwlvlfac_in)         ) snwlvlfac        = snwlvlfac_in
    1233              : 
    1234              :       !-------------------
    1235              :       ! SNOW table
    1236              :       !-------------------
    1237          264 :       if (present(isnw_T_in)            ) isnw_T           = isnw_T_in
    1238          264 :       if (present(isnw_Tgrd_in)         ) isnw_Tgrd        = isnw_Tgrd_in
    1239          264 :       if (present(isnw_rhos_in)         ) isnw_rhos        = isnw_rhos_in
    1240              : 
    1241              :       ! check array sizes and re/allocate if necessary
    1242          264 :       if (present(snowage_rhos_in)       ) then
    1243            0 :          if (size(snowage_rhos_in) /= isnw_rhos) then
    1244            0 :             call icepack_warnings_add(subname//' incorrect size of snowage_rhos_in')
    1245            0 :             call icepack_warnings_setabort(.true.,__FILE__,__LINE__)
    1246            0 :          elseif (.not.allocated(snowage_rhos)) then
    1247            0 :             allocate(snowage_rhos(isnw_rhos))
    1248            0 :             snowage_rhos      = snowage_rhos_in
    1249            0 :          elseif (size(snowage_rhos) /= isnw_rhos) then
    1250            0 :             deallocate(snowage_rhos)
    1251            0 :             allocate(snowage_rhos(isnw_rhos))
    1252            0 :             snowage_rhos      = snowage_rhos_in
    1253              :          else
    1254            0 :             snowage_rhos      = snowage_rhos_in
    1255              :          endif
    1256              :       endif
    1257              : 
    1258          264 :       if (present(snowage_Tgrd_in)       ) then
    1259            0 :          if (size(snowage_Tgrd_in) /= isnw_Tgrd) then
    1260            0 :             call icepack_warnings_add(subname//' incorrect size of snowage_Tgrd_in')
    1261            0 :             call icepack_warnings_setabort(.true.,__FILE__,__LINE__)
    1262            0 :          elseif (.not.allocated(snowage_Tgrd)) then
    1263            0 :             allocate(snowage_Tgrd(isnw_Tgrd))
    1264            0 :             snowage_Tgrd      = snowage_Tgrd_in
    1265            0 :          elseif (size(snowage_Tgrd) /= isnw_Tgrd) then
    1266            0 :             deallocate(snowage_Tgrd)
    1267            0 :             allocate(snowage_Tgrd(isnw_Tgrd))
    1268            0 :             snowage_Tgrd      = snowage_Tgrd_in
    1269              :          else
    1270            0 :             snowage_Tgrd      = snowage_Tgrd_in
    1271              :          endif
    1272              :       endif
    1273              : 
    1274          264 :       if (present(snowage_T_in)       ) then
    1275            0 :          if (size(snowage_T_in) /= isnw_T) then
    1276            0 :             call icepack_warnings_add(subname//' incorrect size of snowage_T_in')
    1277            0 :             call icepack_warnings_setabort(.true.,__FILE__,__LINE__)
    1278            0 :          elseif (.not.allocated(snowage_T)) then
    1279            0 :             allocate(snowage_T(isnw_T))
    1280            0 :             snowage_T      = snowage_T_in
    1281            0 :          elseif (size(snowage_T) /= isnw_T) then
    1282            0 :             deallocate(snowage_T)
    1283            0 :             allocate(snowage_T(isnw_T))
    1284            0 :             snowage_T      = snowage_T_in
    1285              :          else
    1286            0 :             snowage_T      = snowage_T_in
    1287              :          endif
    1288              :       endif
    1289              : 
    1290          264 :       if (present(snowage_tau_in)       ) then
    1291              :          if (size(snowage_tau_in,dim=1) /= isnw_rhos .or. &
    1292            0 :              size(snowage_tau_in,dim=2) /= isnw_Tgrd .or. &
    1293              :              size(snowage_tau_in,dim=3) /= isnw_T   ) then
    1294            0 :             call icepack_warnings_add(subname//' incorrect size of snowage_tau_in')
    1295            0 :             call icepack_warnings_setabort(.true.,__FILE__,__LINE__)
    1296            0 :          elseif (.not.allocated(snowage_tau)) then
    1297            0 :             allocate(snowage_tau(isnw_rhos,isnw_Tgrd,isnw_T))
    1298            0 :             snowage_tau      = snowage_tau_in
    1299              :          elseif &
    1300              :             (size(snowage_tau,dim=1) /= isnw_rhos .or. &
    1301            0 :              size(snowage_tau,dim=2) /= isnw_Tgrd .or. &
    1302              :              size(snowage_tau,dim=3) /= isnw_T   ) then
    1303            0 :             deallocate(snowage_tau)
    1304            0 :             allocate(snowage_tau(isnw_rhos,isnw_Tgrd,isnw_T))
    1305            0 :             snowage_tau      = snowage_tau_in
    1306              :          else
    1307            0 :             snowage_tau      = snowage_tau_in
    1308              :          endif
    1309              :       endif
    1310              : 
    1311          264 :       if (present(snowage_kappa_in)       ) then
    1312              :          if (size(snowage_kappa_in,dim=1) /= isnw_rhos .or. &
    1313            0 :              size(snowage_kappa_in,dim=2) /= isnw_Tgrd .or. &
    1314              :              size(snowage_kappa_in,dim=3) /= isnw_T   ) then
    1315            0 :             call icepack_warnings_add(subname//' incorrect size of snowage_kappa_in')
    1316            0 :             call icepack_warnings_setabort(.true.,__FILE__,__LINE__)
    1317            0 :          elseif (.not.allocated(snowage_kappa)) then
    1318            0 :             allocate(snowage_kappa(isnw_rhos,isnw_Tgrd,isnw_T))
    1319            0 :             snowage_kappa      = snowage_kappa_in
    1320              :          elseif &
    1321              :             (size(snowage_kappa,dim=1) /= isnw_rhos .or. &
    1322            0 :              size(snowage_kappa,dim=2) /= isnw_Tgrd .or. &
    1323              :              size(snowage_kappa,dim=3) /= isnw_T   ) then
    1324            0 :             deallocate(snowage_kappa)
    1325            0 :             allocate(snowage_kappa(isnw_rhos,isnw_Tgrd,isnw_T))
    1326            0 :             snowage_kappa      = snowage_kappa_in
    1327              :          else
    1328            0 :             snowage_kappa      = snowage_kappa_in
    1329              :          endif
    1330              :       endif
    1331              : 
    1332          264 :       if (present(snowage_drdt0_in)       ) then
    1333              :          if (size(snowage_drdt0_in,dim=1) /= isnw_rhos .or. &
    1334            0 :              size(snowage_drdt0_in,dim=2) /= isnw_Tgrd .or. &
    1335              :              size(snowage_drdt0_in,dim=3) /= isnw_T   ) then
    1336            0 :             call icepack_warnings_add(subname//' incorrect size of snowage_drdt0_in')
    1337            0 :             call icepack_warnings_setabort(.true.,__FILE__,__LINE__)
    1338            0 :          elseif (.not.allocated(snowage_drdt0)) then
    1339            0 :             allocate(snowage_drdt0(isnw_rhos,isnw_Tgrd,isnw_T))
    1340            0 :             snowage_drdt0      = snowage_drdt0_in
    1341              :          elseif &
    1342              :             (size(snowage_drdt0,dim=1) /= isnw_rhos .or. &
    1343            0 :              size(snowage_drdt0,dim=2) /= isnw_Tgrd .or. &
    1344              :              size(snowage_drdt0,dim=3) /= isnw_T   ) then
    1345            0 :             deallocate(snowage_drdt0)
    1346            0 :             allocate(snowage_drdt0(isnw_rhos,isnw_Tgrd,isnw_T))
    1347            0 :             snowage_drdt0      = snowage_drdt0_in
    1348              :          else
    1349            0 :             snowage_drdt0      = snowage_drdt0_in
    1350              :          endif
    1351              :       endif
    1352              : 
    1353          264 :       if (present(snw_ssp_table_in)     ) snw_ssp_table    = snw_ssp_table_in
    1354          264 :       if (present(bgc_flux_type_in)     ) bgc_flux_type    = bgc_flux_type_in
    1355          264 :       if (present(z_tracers_in)         ) z_tracers        = z_tracers_in
    1356          264 :       if (present(scale_bgc_in)         ) scale_bgc        = scale_bgc_in
    1357          264 :       if (present(solve_zbgc_in)        ) solve_zbgc       = solve_zbgc_in
    1358          264 :       if (present(dEdd_algae_in)        ) dEdd_algae       = dEdd_algae_in
    1359          264 :       if (present(modal_aero_in)        ) modal_aero       = modal_aero_in
    1360          264 :       if (present(use_macromolecules_in)) use_macromolecules = use_macromolecules_in
    1361          264 :       if (present(use_atm_dust_iron_in) ) use_atm_dust_iron  = use_atm_dust_iron_in
    1362          264 :       if (present(restartbgc_in)     ) restartbgc    = restartbgc_in
    1363          264 :       if (present(conserv_check_in)     ) conserv_check    = conserv_check_in
    1364          264 :       if (present(skl_bgc_in)           ) skl_bgc          = skl_bgc_in
    1365          264 :       if (present(solve_zsal_in)) then
    1366           83 :          call icepack_warnings_add(subname//' WARNING: zsalinity is deprecated')
    1367           83 :          if (solve_zsal_in) then
    1368            0 :             call icepack_warnings_setabort(.true.,__FILE__,__LINE__)
    1369              :          endif
    1370              :       endif
    1371          264 :       if (present(grid_o_in)            ) grid_o           = grid_o_in
    1372          264 :       if (present(l_sk_in)              ) l_sk             = l_sk_in
    1373          264 :       if (present(grid_o_t_in)          ) grid_o_t         = grid_o_t_in
    1374          264 :       if (present(frazil_scav_in)       ) frazil_scav      = frazil_scav_in
    1375          264 :       if (present(initbio_frac_in)      ) initbio_frac     = initbio_frac_in
    1376          264 :       if (present(grid_oS_in)           ) grid_oS          = grid_oS_in
    1377          264 :       if (present(l_skS_in)             ) l_skS            = l_skS_in
    1378          264 :       if (present(phi_snow_in)          ) phi_snow         = phi_snow_in
    1379              : 
    1380          264 :       if (present(ratio_Si2N_diatoms_in) ) ratio_Si2N_diatoms = ratio_Si2N_diatoms_in
    1381          264 :       if (present(ratio_Si2N_sp_in)      ) ratio_Si2N_sp      = ratio_Si2N_sp_in
    1382          264 :       if (present(ratio_Si2N_phaeo_in)   ) ratio_Si2N_phaeo   = ratio_Si2N_phaeo_in
    1383          264 :       if (present(ratio_S2N_diatoms_in)  ) ratio_S2N_diatoms  = ratio_S2N_diatoms_in
    1384          264 :       if (present(ratio_S2N_sp_in )      ) ratio_S2N_sp       = ratio_S2N_sp_in
    1385          264 :       if (present(ratio_S2N_phaeo_in)    ) ratio_S2N_phaeo    = ratio_S2N_phaeo_in
    1386          264 :       if (present(ratio_Fe2C_diatoms_in) ) ratio_Fe2C_diatoms = ratio_Fe2C_diatoms_in
    1387          264 :       if (present(ratio_Fe2C_sp_in)      ) ratio_Fe2C_sp      = ratio_Fe2C_sp_in
    1388          264 :       if (present(ratio_Fe2C_phaeo_in)   ) ratio_Fe2C_phaeo   =  ratio_Fe2C_phaeo_in
    1389          264 :       if (present(ratio_Fe2N_diatoms_in) ) ratio_Fe2N_diatoms = ratio_Fe2N_diatoms_in
    1390          264 :       if ((solve_zbgc .or. skl_bgc) .and. (ratio_Fe2N_diatoms .LE. c0)) then
    1391            0 :          call icepack_warnings_add(subname//' WARNING: ratio_Fe2N_diatoms < = 0')
    1392            0 :          call icepack_warnings_setabort(.true.,__FILE__,__LINE__)
    1393              :       endif
    1394          264 :       if (present(ratio_Fe2N_sp_in)      ) ratio_Fe2N_sp      = ratio_Fe2N_sp_in
    1395          264 :       if ((solve_zbgc .or. skl_bgc) .and. (ratio_Fe2N_sp .LE. c0)) then
    1396            0 :          call icepack_warnings_add(subname//' WARNING: ratio_Fe2N_sp < = 0')
    1397            0 :          call icepack_warnings_setabort(.true.,__FILE__,__LINE__)
    1398              :       endif
    1399          264 :       if (present(ratio_Fe2N_phaeo_in)   ) ratio_Fe2N_phaeo   = ratio_Fe2N_phaeo_in
    1400          264 :       if ((solve_zbgc .or. skl_bgc) .and. (ratio_Fe2N_phaeo .LE. c0)) then
    1401            0 :          call icepack_warnings_add(subname//' WARNING: ratio_Fe2N_phaeo < = 0')
    1402            0 :          call icepack_warnings_setabort(.true.,__FILE__,__LINE__)
    1403              :       endif
    1404          264 :       if (present(ratio_Fe2DON_in)       ) ratio_Fe2DON       = ratio_Fe2DON_in
    1405          264 :       if (present(ratio_Fe2DOC_s_in)     ) ratio_Fe2DOC_s     = ratio_Fe2DOC_s_in
    1406          264 :       if (present(ratio_Fe2DOC_l_in)     ) ratio_Fe2DOC_l     = ratio_Fe2DOC_l_in
    1407          264 :       if (present(tau_min_in)            ) tau_min            = tau_min_in
    1408          264 :       if (present(tau_max_in)            ) tau_max            = tau_max_in
    1409          264 :       if (present(chlabs_diatoms_in)     ) chlabs_diatoms     = chlabs_diatoms_in
    1410          264 :       if (present(chlabs_sp_in)          ) chlabs_sp          = chlabs_sp_in
    1411          264 :       if (present(chlabs_phaeo_in)       ) chlabs_phaeo       = chlabs_phaeo_in
    1412          264 :       if (present(alpha2max_low_diatoms_in)  ) alpha2max_low_diatoms   = alpha2max_low_diatoms_in
    1413          264 :       if (present(alpha2max_low_sp_in)       ) alpha2max_low_sp        = alpha2max_low_sp_in
    1414          264 :       if (present(alpha2max_low_phaeo_in)    ) alpha2max_low_phaeo     = alpha2max_low_phaeo_in
    1415          264 :       if (present(beta2max_diatoms_in)   ) beta2max_diatoms    = beta2max_diatoms_in
    1416          264 :       if (present(beta2max_sp_in)        ) beta2max_sp         = beta2max_sp_in
    1417          264 :       if (present(beta2max_phaeo_in)     ) beta2max_phaeo      = beta2max_phaeo_in
    1418          264 :       if (present(mu_max_diatoms_in)     ) mu_max_diatoms      = mu_max_diatoms_in
    1419          264 :       if (present(mu_max_sp_in)          ) mu_max_sp           = mu_max_sp_in
    1420          264 :       if (present(mu_max_phaeo_in)       ) mu_max_phaeo        = mu_max_phaeo_in
    1421          264 :       if (present(grow_Tdep_diatoms_in)  ) grow_Tdep_diatoms   = grow_Tdep_diatoms_in
    1422          264 :       if (present(grow_Tdep_sp_in)       ) grow_Tdep_sp        = grow_Tdep_sp_in
    1423          264 :       if (present(grow_Tdep_phaeo_in)    ) grow_Tdep_phaeo     = grow_Tdep_phaeo_in
    1424          264 :       if (present(fr_graze_diatoms_in)   ) fr_graze_diatoms    = fr_graze_diatoms_in
    1425          264 :       if (present(fr_graze_sp_in)        ) fr_graze_sp         = fr_graze_sp_in
    1426          264 :       if (present(fr_graze_phaeo_in)     ) fr_graze_phaeo      = fr_graze_phaeo_in
    1427          264 :       if (present(mort_pre_diatoms_in)   ) mort_pre_diatoms    = mort_pre_diatoms_in
    1428          264 :       if (present(mort_pre_sp_in)        ) mort_pre_sp         = mort_pre_sp_in
    1429          264 :       if (present(mort_pre_phaeo_in)     ) mort_pre_phaeo      = mort_pre_phaeo_in
    1430          264 :       if (present(mort_Tdep_diatoms_in)  ) mort_Tdep_diatoms   = mort_Tdep_diatoms_in
    1431          264 :       if (present(mort_Tdep_sp_in)       ) mort_Tdep_sp        = mort_Tdep_sp_in
    1432          264 :       if (present(mort_Tdep_phaeo_in)    ) mort_Tdep_phaeo     = mort_Tdep_phaeo_in
    1433          264 :       if (present(k_exude_diatoms_in)    ) k_exude_diatoms     = k_exude_diatoms_in
    1434          264 :       if (present(k_exude_sp_in)         ) k_exude_sp          = k_exude_sp_in
    1435          264 :       if (present(k_exude_phaeo_in)      ) k_exude_phaeo       = k_exude_phaeo_in
    1436          264 :       if (present(K_Nit_diatoms_in)      ) K_Nit_diatoms       = K_Nit_diatoms_in
    1437          264 :       if ((solve_zbgc .or. skl_bgc) .and. (K_Nit_diatoms .LE. c0)) then
    1438            0 :          call icepack_warnings_add(subname//' WARNING: K_Nit_diatoms < = 0')
    1439            0 :          call icepack_warnings_setabort(.true.,__FILE__,__LINE__)
    1440              :       endif
    1441          264 :       if (present(K_Nit_sp_in)           ) K_Nit_sp            = K_Nit_sp_in
    1442          264 :       if ((solve_zbgc .or. skl_bgc) .and. (K_Nit_sp .LE. c0)) then
    1443            0 :          call icepack_warnings_add(subname//' WARNING: K_Nit_sp < = 0')
    1444            0 :          call icepack_warnings_setabort(.true.,__FILE__,__LINE__)
    1445              :       endif
    1446          264 :       if (present(K_Nit_phaeo_in)        ) K_Nit_phaeo         = K_Nit_phaeo_in
    1447          264 :       if ((solve_zbgc .or. skl_bgc) .and. (K_Nit_phaeo .LE. c0)) then
    1448            0 :          call icepack_warnings_add(subname//' WARNING: K_Nit_phaeo < = 0')
    1449            0 :          call icepack_warnings_setabort(.true.,__FILE__,__LINE__)
    1450              :       endif
    1451          264 :       if (present(K_Am_diatoms_in)       ) K_Am_diatoms        = K_Am_diatoms_in
    1452          264 :       if ((solve_zbgc .or. skl_bgc) .and. (K_Am_diatoms .LE. c0)) then
    1453            0 :          call icepack_warnings_add(subname//' WARNING: K_Am_diatoms < = 0')
    1454            0 :          call icepack_warnings_setabort(.true.,__FILE__,__LINE__)
    1455              :       endif
    1456          264 :       if (present(K_Am_sp_in)            ) K_Am_sp             = K_Am_sp_in
    1457          264 :       if ((solve_zbgc .or. skl_bgc) .and. (K_Am_sp .LE. c0)) then
    1458            0 :          call icepack_warnings_add(subname//' WARNING: K_Am_sp < = 0')
    1459            0 :          call icepack_warnings_setabort(.true.,__FILE__,__LINE__)
    1460              :       endif
    1461          264 :       if (present(K_Am_phaeo_in)         ) K_Am_phaeo          = K_Am_phaeo_in
    1462          264 :       if ((solve_zbgc .or. skl_bgc) .and. (K_Am_phaeo .LE. c0)) then
    1463            0 :          call icepack_warnings_add(subname//' WARNING: K_Am_phaeo < = 0')
    1464            0 :          call icepack_warnings_setabort(.true.,__FILE__,__LINE__)
    1465              :       endif
    1466          264 :       if (present(K_Sil_diatoms_in)      ) K_Sil_diatoms       = K_Sil_diatoms_in
    1467          264 :       if (present(K_Sil_sp_in)           ) K_Sil_sp            = K_Sil_sp_in
    1468          264 :       if (present(K_Sil_phaeo_in)        ) K_Sil_phaeo         = K_Sil_phaeo_in
    1469          264 :       if (present(K_Fe_diatoms_in)       ) K_Fe_diatoms        = K_Fe_diatoms_in
    1470          264 :       if (present(K_Fe_sp_in)            ) K_Fe_sp             = K_Fe_sp_in
    1471          264 :       if (present(K_Fe_phaeo_in)         ) K_Fe_phaeo          = K_Fe_phaeo_in
    1472          264 :       if (present(f_don_protein_in)      ) f_don_protein       = f_don_protein_in
    1473          264 :       if (present(kn_bac_protein_in)     ) kn_bac_protein      = kn_bac_protein_in
    1474          264 :       if (present(f_don_Am_protein_in)   ) f_don_Am_protein    = f_don_Am_protein_in
    1475          264 :       if (present(f_doc_s_in)            ) f_doc_s             = f_doc_s_in
    1476          264 :       if (present(f_doc_l_in)            ) f_doc_l             = f_doc_l_in
    1477          264 :       if (present(f_exude_s_in)          ) f_exude_s           = f_exude_s_in
    1478          264 :       if (present(f_exude_l_in)          ) f_exude_l           = f_exude_l_in
    1479          264 :       if (present(k_bac_s_in)            ) k_bac_s             = k_bac_s_in
    1480          264 :       if (present(k_bac_l_in)            ) k_bac_l             = k_bac_l_in
    1481          264 :       if (present(algaltype_diatoms_in)  ) algaltype_diatoms   = algaltype_diatoms_in
    1482          264 :       if (present(algaltype_sp_in)       ) algaltype_sp        = algaltype_sp_in
    1483          264 :       if (present(algaltype_phaeo_in)    ) algaltype_phaeo     = algaltype_phaeo_in
    1484          264 :       if (present(nitratetype_in)        ) nitratetype         = nitratetype_in
    1485          264 :       if (present(ammoniumtype_in)       ) ammoniumtype        = ammoniumtype_in
    1486          264 :       if (present(silicatetype_in)       ) silicatetype        = silicatetype_in
    1487          264 :       if (present(dmspptype_in)          ) dmspptype           = dmspptype_in
    1488          264 :       if (present(dmspdtype_in)          ) dmspdtype           = dmspdtype_in
    1489          264 :       if (present(humtype_in)            ) humtype             = humtype_in
    1490          264 :       if (present(doctype_s_in)          ) doctype_s           = doctype_s_in
    1491          264 :       if (present(doctype_l_in)          ) doctype_l           = doctype_l_in
    1492          264 :       if (present(dictype_1_in)          ) dictype_1           = dictype_1_in
    1493          264 :       if (present(dontype_protein_in)    ) dontype_protein     = dontype_protein_in
    1494          264 :       if (present(fedtype_1_in)          ) fedtype_1           = fedtype_1_in
    1495          264 :       if (present(feptype_1_in)          ) feptype_1           = feptype_1_in
    1496          264 :       if (present(zaerotype_bc1_in)      ) zaerotype_bc1       = zaerotype_bc1_in
    1497          264 :       if (present(zaerotype_bc2_in)      ) zaerotype_bc2       = zaerotype_bc2_in
    1498          264 :       if (present(zaerotype_dust1_in)    ) zaerotype_dust1     = zaerotype_dust1_in
    1499          264 :       if (present(zaerotype_dust2_in)    ) zaerotype_dust2     = zaerotype_dust2_in
    1500          264 :       if (present(zaerotype_dust3_in)    ) zaerotype_dust3     = zaerotype_dust3_in
    1501          264 :       if (present(zaerotype_dust4_in)    ) zaerotype_dust4     = zaerotype_dust4_in
    1502          264 :       if (present(ratio_C2N_diatoms_in)  ) ratio_C2N_diatoms   = ratio_C2N_diatoms_in
    1503          264 :       if (present(ratio_C2N_sp_in)       ) ratio_C2N_sp        = ratio_C2N_sp_in
    1504          264 :       if (present(ratio_C2N_phaeo_in)    ) ratio_C2N_phaeo     = ratio_C2N_phaeo_in
    1505          264 :       if (present(ratio_chl2N_diatoms_in)) ratio_chl2N_diatoms = ratio_chl2N_diatoms_in
    1506          264 :       if (present(ratio_chl2N_sp_in)     ) ratio_chl2N_sp      = ratio_chl2N_sp_in
    1507          264 :       if (present(ratio_chl2N_phaeo_in)  ) ratio_chl2N_phaeo   = ratio_chl2N_phaeo_in
    1508          264 :       if (present(F_abs_chl_diatoms_in)  ) F_abs_chl_diatoms   = F_abs_chl_diatoms_in
    1509          264 :       if (present(F_abs_chl_sp_in)       ) F_abs_chl_sp        = F_abs_chl_sp_in
    1510          264 :       if (present(F_abs_chl_phaeo_in)    ) F_abs_chl_phaeo     = F_abs_chl_phaeo_in
    1511          264 :       if (present(ratio_C2N_proteins_in) ) ratio_C2N_proteins  = ratio_C2N_proteins_in
    1512          264 :       if (present(fr_resp_in)           ) fr_resp          = fr_resp_in
    1513          264 :       if (present(algal_vel_in)         ) algal_vel        = algal_vel_in
    1514          264 :       if (present(R_dFe2dust_in)        ) R_dFe2dust       = R_dFe2dust_in
    1515          264 :       if (present(dustFe_sol_in)        ) dustFe_sol       = dustFe_sol_in
    1516          264 :       if (present(T_max_in)             ) T_max            = T_max_in
    1517          264 :       if (present(fsal_in)              ) fsal             = fsal_in
    1518          264 :       if (present(op_dep_min_in)        ) op_dep_min       = op_dep_min_in
    1519          264 :       if (present(fr_graze_s_in)        ) fr_graze_s       = fr_graze_s_in
    1520          264 :       if (present(fr_graze_e_in)        ) fr_graze_e       = fr_graze_e_in
    1521          264 :       if (present(fr_mort2min_in)       ) fr_mort2min      = fr_mort2min_in
    1522          264 :       if (present(fr_dFe_in)            ) fr_dFe           = fr_dFe_in
    1523          264 :       if (present(k_nitrif_in)          ) k_nitrif         = k_nitrif_in
    1524          264 :       if (present(t_iron_conv_in)       ) t_iron_conv      = t_iron_conv_in
    1525          264 :       if (present(max_loss_in)          ) max_loss         = max_loss_in
    1526          264 :       if (present(max_dfe_doc1_in)      ) max_dfe_doc1     = max_dfe_doc1_in
    1527          264 :       if (present(fr_resp_s_in)         ) fr_resp_s        = fr_resp_s_in
    1528          264 :       if (present(y_sk_DMS_in)          ) y_sk_DMS         = y_sk_DMS_in
    1529          264 :       if (present(t_sk_conv_in)         ) t_sk_conv        = t_sk_conv_in
    1530          264 :       if (present(t_sk_ox_in)           ) t_sk_ox          = t_sk_ox_in
    1531          264 :       if (present(sw_redist_in)         ) sw_redist        = sw_redist_in
    1532          264 :       if (present(sw_frac_in)           ) sw_frac          = sw_frac_in
    1533          264 :       if (present(sw_dtemp_in)          ) sw_dtemp         = sw_dtemp_in
    1534              : 
    1535              :       ! check settings
    1536              : 
    1537          264 :       if (argcheck /= 'never' .and. argcheck /= 'first' .and. argcheck /= 'always') then
    1538            0 :          call icepack_warnings_add(subname//' argcheck must be never, first, or always')
    1539            0 :          call icepack_warnings_setabort(.true.,__FILE__,__LINE__)
    1540              :       endif
    1541              : 
    1542          264 :       call icepack_recompute_constants()
    1543          264 :       if (icepack_warnings_aborted(subname)) return
    1544              : 
    1545          264 :       end subroutine icepack_init_parameters
    1546              : 
    1547              : !=======================================================================
    1548              : 
    1549              : !autodocument_start icepack_query_parameters
    1550              : ! subroutine to query the column package internal parameters
    1551              : 
    1552      8087692 :       subroutine icepack_query_parameters(   &
    1553              :          argcheck_out, puny_out, bignum_out, pi_out, rad_to_deg_out,&
    1554              :          secday_out, c0_out, c1_out, c1p5_out, c2_out, c3_out, c4_out, &
    1555              :          c5_out, c6_out, c8_out, c10_out, c15_out, c16_out, c20_out, &
    1556              :          c25_out, c100_out, c180_out, c1000_out, p001_out, p01_out, p1_out, &
    1557              :          p2_out, p4_out, p5_out, p6_out, p05_out, p15_out, p25_out, p75_out, &
    1558              :          p333_out, p666_out, spval_const_out, pih_out, piq_out, pi2_out, &
    1559              :          rhos_out, rhoi_out, rhow_out, cp_air_out, emissivity_out, &
    1560              :          cp_ice_out, cp_ocn_out, hfrazilmin_out, floediam_out, &
    1561              :          depressT_out, dragio_out, thickness_ocn_layer1_out, iceruf_ocn_out, &
    1562              :          albocn_out, gravit_out, viscosity_dyn_out, tscale_pnd_drain_out, &
    1563              :          Tocnfrz_out, rhofresh_out, zvir_out, vonkar_out, cp_wv_out, &
    1564              :          stefan_boltzmann_out, ice_ref_salinity_out, &
    1565              :          Tffresh_out, Lsub_out, Lvap_out, Timelt_out, Tsmelt_out, &
    1566              :          iceruf_out, Cf_out, Pstar_out, Cstar_out, kappav_out, &
    1567              :          kice_out, ksno_out, &
    1568              :          zref_out, hs_min_out, snowpatch_out, rhosi_out, sk_l_out, &
    1569              :          saltmax_out, phi_init_out, min_salin_out, salt_loss_out, &
    1570              :          Tliquidus_max_out, &
    1571              :          min_bgc_out, dSin0_frazil_out, hi_ssl_out, hs_ssl_out, hs_ssl_min_out, &
    1572              :          awtvdr_out, awtidr_out, awtvdf_out, awtidf_out, cpl_frazil_out, &
    1573              :          qqqice_out, TTTice_out, qqqocn_out, TTTocn_out, update_ocn_f_out, &
    1574              :          Lfresh_out, cprho_out, Cp_out, ustar_min_out, hi_min_out, a_rapid_mode_out, &
    1575              :          ktherm_out, conduct_out, fbot_xfer_type_out, calc_Tsfc_out, dts_b_out, &
    1576              :          Rac_rapid_mode_out, aspect_rapid_mode_out, dSdt_slow_mode_out, &
    1577              :          phi_c_slow_mode_out, phi_i_mushy_out, shortwave_out, &
    1578              :          albedo_type_out, albicev_out, albicei_out, albsnowv_out, &
    1579              :          albsnowi_out, ahmax_out, R_ice_out, R_pnd_out, R_snw_out, dT_mlt_out, &
    1580              :          rsnw_mlt_out, dEdd_algae_out, &
    1581              :          kalg_out, R_gC2molC_out, kstrength_out, krdg_partic_out, krdg_redist_out, mu_rdg_out, &
    1582              :          atmbndy_out, calc_strair_out, formdrag_out, highfreq_out, natmiter_out, &
    1583              :          atmiter_conv_out, calc_dragio_out, &
    1584              :          tfrz_option_out, kitd_out, kcatbound_out, hs0_out, frzpnd_out, &
    1585              :          saltflux_option_out, congel_freeze_out, &
    1586              :          floeshape_out, wave_spec_out, wave_spec_type_out, nfreq_out, &
    1587              :          dpscale_out, rfracmin_out, rfracmax_out, pndaspect_out, hs1_out, hp1_out, &
    1588              :          bgc_flux_type_out, z_tracers_out, scale_bgc_out, solve_zbgc_out, &
    1589              :          modal_aero_out, use_macromolecules_out, restartbgc_out, use_atm_dust_iron_out, &
    1590              :          skl_bgc_out, solve_zsal_out, grid_o_out, l_sk_out, &
    1591              :          initbio_frac_out, grid_oS_out, l_skS_out, &
    1592              :          phi_snow_out, conserv_check_out, &
    1593              :          fr_resp_out, algal_vel_out, R_dFe2dust_out, dustFe_sol_out, &
    1594              :          T_max_out, fsal_out, op_dep_min_out, fr_graze_s_out, fr_graze_e_out, &
    1595              :          fr_mort2min_out, fr_resp_s_out, fr_dFe_out, &
    1596              :          k_nitrif_out, t_iron_conv_out, max_loss_out, max_dfe_doc1_out, &
    1597              :          y_sk_DMS_out, t_sk_conv_out, t_sk_ox_out, frazil_scav_out, &
    1598              :          sw_redist_out, sw_frac_out, sw_dtemp_out, snwgrain_out, &
    1599              :          snwredist_out, use_smliq_pnd_out, rsnw_fall_out, rsnw_tmax_out, &
    1600              :          rhosnew_out, rhosmin_out, rhosmax_out, windmin_out, drhosdwind_out, &
    1601              :          snwlvlfac_out, isnw_T_out, isnw_Tgrd_out, isnw_rhos_out, &
    1602      8087692 :          snowage_rhos_out, snowage_Tgrd_out, snowage_T_out, &
    1603      8087692 :          snowage_tau_out, snowage_kappa_out, snowage_drdt0_out, &
    1604              :          snw_aging_table_out, snw_ssp_table_out, ratio_Si2N_diatoms_out, &
    1605              :          ratio_Si2N_sp_out, ratio_Si2N_phaeo_out, ratio_S2N_diatoms_out, &
    1606              :          ratio_S2N_sp_out, ratio_S2N_phaeo_out, ratio_Fe2C_diatoms_out, &
    1607              :          ratio_Fe2C_sp_out, ratio_Fe2C_phaeo_out, ratio_Fe2N_diatoms_out, &
    1608              :          ratio_Fe2N_sp_out, ratio_Fe2N_phaeo_out, ratio_Fe2DON_out, &
    1609              :          ratio_Fe2DOC_s_out, ratio_Fe2DOC_l_out, grid_o_t_out, tau_min_out, tau_max_out, &
    1610              :          chlabs_diatoms_out, chlabs_sp_out, chlabs_phaeo_out, alpha2max_low_diatoms_out, &
    1611              :          alpha2max_low_sp_out, alpha2max_low_phaeo_out, beta2max_diatoms_out, &
    1612              :          beta2max_sp_out, beta2max_phaeo_out, mu_max_diatoms_out, mu_max_sp_out, &
    1613              :          mu_max_phaeo_out, grow_Tdep_diatoms_out, grow_Tdep_sp_out, &
    1614              :          grow_Tdep_phaeo_out, fr_graze_diatoms_out, fr_graze_sp_out, &
    1615              :          fr_graze_phaeo_out, mort_pre_diatoms_out, mort_pre_sp_out, &
    1616              :          mort_pre_phaeo_out, mort_Tdep_diatoms_out, mort_Tdep_sp_out, &
    1617              :          mort_Tdep_phaeo_out, k_exude_diatoms_out, k_exude_sp_out, k_exude_phaeo_out, &
    1618              :          K_Nit_diatoms_out, K_Nit_sp_out, K_Nit_phaeo_out, &
    1619              :          K_Am_diatoms_out, K_Am_sp_out, K_Am_phaeo_out, &
    1620              :          K_Sil_diatoms_out, K_Sil_sp_out, K_Sil_phaeo_out, &
    1621              :          K_Fe_diatoms_out, K_Fe_sp_out, K_Fe_phaeo_out, &
    1622              :          f_don_protein_out, kn_bac_protein_out, f_don_Am_protein_out, &
    1623              :          f_doc_s_out, f_doc_l_out, f_exude_s_out, f_exude_l_out, &
    1624              :          k_bac_s_out, k_bac_l_out, algaltype_diatoms_out, &
    1625              :          algaltype_sp_out, algaltype_phaeo_out, nitratetype_out, &
    1626              :          ammoniumtype_out, silicatetype_out, dmspptype_out, &
    1627              :          dmspdtype_out, humtype_out, doctype_s_out, doctype_l_out, &
    1628              :          dictype_1_out, dontype_protein_out, fedtype_1_out, feptype_1_out, &
    1629              :          zaerotype_bc1_out, zaerotype_bc2_out, zaerotype_dust1_out, &
    1630              :          zaerotype_dust2_out, zaerotype_dust3_out, zaerotype_dust4_out, &
    1631              :          ratio_C2N_diatoms_out, ratio_C2N_sp_out, ratio_C2N_phaeo_out, &
    1632              :          ratio_chl2N_diatoms_out, ratio_chl2N_sp_out, ratio_chl2N_phaeo_out, &
    1633              :          F_abs_chl_diatoms_out, F_abs_chl_sp_out, F_abs_chl_phaeo_out, &
    1634              :          ratio_C2N_proteins_out )
    1635              : 
    1636              :       !-----------------------------------------------------------------
    1637              :       ! control settings
    1638              :       !-----------------------------------------------------------------
    1639              : 
    1640              :       character(len=*), intent(out), optional :: &
    1641              :          argcheck_out     ! optional argument checking
    1642              : 
    1643              :       !-----------------------------------------------------------------
    1644              :       ! parameter constants
    1645              :       !-----------------------------------------------------------------
    1646              : 
    1647              :       real (kind=dbl_kind), intent(out), optional :: &
    1648              :          c0_out, c1_out, c1p5_out, c2_out, c3_out, c4_out, &
    1649              :          c5_out, c6_out, c8_out, c10_out, c15_out, c16_out, c20_out, &
    1650              :          c25_out, c180_out, c100_out, c1000_out, p001_out, p01_out, p1_out, &
    1651              :          p2_out, p4_out, p5_out, p6_out, p05_out, p15_out, p25_out, p75_out, &
    1652              :          p333_out, p666_out, spval_const_out, pih_out, piq_out, pi2_out, &
    1653              :          secday_out,     & ! number of seconds per day
    1654              :          puny_out,       & ! a small number
    1655              :          bignum_out,     & ! a big number
    1656              :          pi_out,         & ! pi
    1657              :          rad_to_deg_out, & ! conversion factor from radians to degrees
    1658              :          Lfresh_out,     & ! latent heat of melting of fresh ice (J/kg)
    1659              :          cprho_out,      & ! for ocean mixed layer (J kg / K m^3)
    1660              :          Cp_out            ! proport const for PE
    1661              : 
    1662              :       !-----------------------------------------------------------------
    1663              :       ! densities
    1664              :       !-----------------------------------------------------------------
    1665              : 
    1666              :       real (kind=dbl_kind), intent(out), optional :: &
    1667              :          rhos_out,       & ! density of snow (kg/m^3)
    1668              :          rhoi_out,       & ! density of ice (kg/m^3)
    1669              :          rhosi_out,      & ! average sea ice density (kg/m2)
    1670              :          rhow_out,       & ! density of seawater (kg/m^3)
    1671              :          rhofresh_out      ! density of fresh water (kg/m^3)
    1672              : 
    1673              : !-----------------------------------------------------------------------
    1674              : ! Parameters for thermodynamics
    1675              : !-----------------------------------------------------------------------
    1676              : 
    1677              :       real (kind=dbl_kind), intent(out), optional :: &
    1678              :          floediam_out,   & ! effective floe diameter for lateral melt (m)
    1679              :          hfrazilmin_out, & ! min thickness of new frazil ice (m)
    1680              :          cp_ice_out,     & ! specific heat of fresh ice (J/kg/K)
    1681              :          cp_ocn_out,     & ! specific heat of ocn    (J/kg/K)
    1682              :          depressT_out,   & ! Tf:brine salinity ratio (C/ppt)
    1683              :          viscosity_dyn_out, & ! dynamic viscosity of brine (kg/m/s)
    1684              :          tscale_pnd_drain_out, & ! mushy macroscopic drainage timescale (days)
    1685              :          Tocnfrz_out,    & ! freezing temp of seawater (C)
    1686              :          Tffresh_out,    & ! freezing temp of fresh ice (K)
    1687              :          Lsub_out,       & ! latent heat, sublimation freshwater (J/kg)
    1688              :          Lvap_out,       & ! latent heat, vaporization freshwater (J/kg)
    1689              :          Timelt_out,     & ! melting temperature, ice top surface  (C)
    1690              :          Tsmelt_out,     & ! melting temperature, snow top surface (C)
    1691              :          ice_ref_salinity_out, & ! (ppt)
    1692              :          kice_out,       & ! thermal conductivity of fresh ice(W/m/deg)
    1693              :          ksno_out,       & ! thermal conductivity of snow  (W/m/deg)
    1694              :          hs_min_out,     & ! min snow thickness for computing zTsn (m)
    1695              :          snowpatch_out,  & ! parameter for fractional snow area (m)
    1696              :          saltmax_out,    & ! max salinity at ice base for BL99 (ppt)
    1697              :          phi_init_out,   & ! initial liquid fraction of frazil
    1698              :          min_salin_out,  & ! threshold for brine pocket treatment
    1699              :          salt_loss_out,  & ! fraction of salt retained in zsalinity
    1700              :          Tliquidus_max_out, & ! maximum liquidus temperature of mush (C)
    1701              :          dSin0_frazil_out  ! bulk salinity reduction of newly formed frazil
    1702              : 
    1703              :       integer (kind=int_kind), intent(out), optional :: &
    1704              :          ktherm_out         ! type of thermodynamics
    1705              :                             ! -1 none
    1706              :                             ! 1 = Bitz and Lipscomb 1999
    1707              :                             ! 2 = mushy layer theory
    1708              : 
    1709              :       character (len=*), intent(out), optional :: &
    1710              :          conduct_out, &        ! 'MU71' or 'bubbly'
    1711              :          fbot_xfer_type_out, & ! transfer coefficient type for ice-ocean heat flux
    1712              :          cpl_frazil_out        ! type of coupling for frazil ice
    1713              : 
    1714              :       logical (kind=log_kind), intent(out), optional :: &
    1715              :          calc_Tsfc_out    ,&! if true, calculate surface temperature
    1716              :                             ! if false, Tsfc is computed elsewhere and
    1717              :                             ! atmos-ice fluxes are provided to CICE
    1718              :          update_ocn_f_out   ! include fresh water and salt fluxes for frazil
    1719              : 
    1720              :       real (kind=dbl_kind), intent(out), optional :: &
    1721              :          dts_b_out,   &      ! zsalinity timestep
    1722              :          hi_min_out,  &      ! minimum ice thickness allowed (m) for thermo
    1723              :          ustar_min_out       ! minimum friction velocity for ice-ocean heat flux
    1724              : 
    1725              :       ! mushy thermo
    1726              :       real(kind=dbl_kind), intent(out), optional :: &
    1727              :          a_rapid_mode_out      , & ! channel radius for rapid drainage mode (m)
    1728              :          Rac_rapid_mode_out    , & ! critical Rayleigh number for rapid drainage mode
    1729              :          aspect_rapid_mode_out , & ! aspect ratio for rapid drainage mode (larger=wider)
    1730              :          dSdt_slow_mode_out    , & ! slow mode drainage strength (m s-1 K-1)
    1731              :          phi_c_slow_mode_out   , & ! liquid fraction porosity cutoff for slow mode
    1732              :          phi_i_mushy_out           ! liquid fraction of congelation ice
    1733              : 
    1734              :       character(len=*), intent(out), optional :: &
    1735              :          congel_freeze_out         ! congelation computation
    1736              :                                    ! 'two-step' = original formulation
    1737              :                                    ! 'one-step' = Plante et al, The Cryosphere, 2024
    1738              : 
    1739              :       character(len=*), intent(out), optional :: &
    1740              :          tfrz_option_out           ! form of ocean freezing temperature
    1741              :                                    ! 'minus1p8' = -1.8 C
    1742              :                                    ! 'constant' = Tocnfrz
    1743              :                                    ! 'linear_salt' = -depressT * sss
    1744              :                                    ! 'mushy' conforms with ktherm=2
    1745              : 
    1746              :       character(len=*), intent(out), optional :: &
    1747              :          saltflux_option_out       ! Salt flux computation
    1748              :                                    ! 'constant' reference value of ice_ref_salinity
    1749              :                                    ! 'prognostic' prognostic salt flux
    1750              : 
    1751              : 
    1752              : !-----------------------------------------------------------------------
    1753              : ! Parameters for radiation
    1754              : !-----------------------------------------------------------------------
    1755              : 
    1756              :       real(kind=dbl_kind), intent(out), optional :: &
    1757              :          emissivity_out, & ! emissivity of snow and ice
    1758              :          albocn_out,     & ! ocean albedo
    1759              :          vonkar_out,     & ! von Karman constant
    1760              :          stefan_boltzmann_out, & !  W/m^2/K^4
    1761              :          kappav_out,     & ! vis extnctn coef in ice, wvlngth<700nm (1/m)
    1762              :          hi_ssl_out,     & ! ice surface scattering layer thickness (m)
    1763              :          hs_ssl_out,     & ! snow surface scattering layer thickness (m)
    1764              :          hs_ssl_min_out, & ! minimum snow surface scattering layer thickness for aerosols (m)
    1765              :          awtvdr_out,     & ! visible, direct  ! for history and
    1766              :          awtidr_out,     & ! near IR, direct  ! diagnostics
    1767              :          awtvdf_out,     & ! visible, diffuse
    1768              :          awtidf_out        ! near IR, diffuse
    1769              : 
    1770              :       character (len=*), intent(out), optional :: &
    1771              :          shortwave_out, & ! shortwave method, 'ccsm3' or 'dEdd' or 'dEdd_snicar_ad'
    1772              :          albedo_type_out  ! albedo parameterization, 'ccsm3' or 'constant'
    1773              :                              ! shortwave='dEdd' overrides this parameter
    1774              : 
    1775              :       ! baseline albedos for ccsm3 shortwave, set in namelist
    1776              :       real (kind=dbl_kind), intent(out), optional :: &
    1777              :          albicev_out  , & ! visible ice albedo for h > ahmax
    1778              :          albicei_out  , & ! near-ir ice albedo for h > ahmax
    1779              :          albsnowv_out , & ! cold snow albedo, visible
    1780              :          albsnowi_out , & ! cold snow albedo, near IR
    1781              :          ahmax_out        ! thickness above which ice albedo is constant (m)
    1782              : 
    1783              :       ! dEdd tuning parameters, set in namelist
    1784              :       real (kind=dbl_kind), intent(out), optional :: &
    1785              :          R_ice_out    , & ! sea ice tuning parameter; +1 > 1sig increase in albedo
    1786              :          R_pnd_out    , & ! ponded ice tuning parameter; +1 > 1sig increase in albedo
    1787              :          R_snw_out    , & ! snow tuning parameter; +1 > ~.01 change in broadband albedo
    1788              :          dT_mlt_out   , & ! change in temp for non-melt to melt snow grain
    1789              :                           ! radius change (C)
    1790              :          rsnw_mlt_out , & ! maximum melting snow grain radius (10^-6 m)
    1791              :          kalg_out     , & ! algae absorption coefficient for 0.5 m thick layer
    1792              :          R_gC2molC_out    ! grams carbon per mol
    1793              : 
    1794              :       logical (kind=log_kind), intent(out), optional :: &
    1795              :          sw_redist_out    ! redistribute shortwave
    1796              : 
    1797              :       real (kind=dbl_kind), intent(out), optional :: &
    1798              :          sw_frac_out  , & ! Fraction of internal shortwave moved to surface
    1799              :          sw_dtemp_out     ! temperature difference from melting
    1800              : 
    1801              : !-----------------------------------------------------------------------
    1802              : ! Parameters for dynamics
    1803              : !-----------------------------------------------------------------------
    1804              : 
    1805              :       real(kind=dbl_kind), intent(out), optional :: &
    1806              :          Cf_out,         & ! ratio of ridging work to PE change in ridging
    1807              :          Pstar_out,      & ! constant in Hibler strength formula
    1808              :          Cstar_out,      & ! constant in Hibler strength formula
    1809              :          dragio_out,     & ! ice-ocn drag coefficient
    1810              :          thickness_ocn_layer1_out, & ! thickness of first ocean level (m)
    1811              :          iceruf_ocn_out, & ! under-ice roughness (m)
    1812              :          gravit_out,     & ! gravitational acceleration (m/s^2)
    1813              :          iceruf_out        ! ice surface roughness (m)
    1814              : 
    1815              :       integer (kind=int_kind), intent(out), optional :: & ! defined in namelist
    1816              :          kstrength_out  , & ! 0 for simple Hibler (1979) formulation
    1817              :                             ! 1 for Rothrock (1975) pressure formulation
    1818              :          krdg_partic_out, & ! 0 for Thorndike et al. (1975) formulation
    1819              :                             ! 1 for exponential participation function
    1820              :          krdg_redist_out    ! 0 for Hibler (1980) formulation
    1821              :                             ! 1 for exponential redistribution function
    1822              : 
    1823              :       real (kind=dbl_kind), intent(out), optional :: &
    1824              :          mu_rdg_out         ! gives e-folding scale of ridged ice (m^.5)
    1825              :                             ! (krdg_redist = 1)
    1826              : 
    1827              :       logical (kind=log_kind), intent(out), optional :: &
    1828              :          calc_dragio_out    ! if true, compute dragio from iceruf_ocn and thickness_ocn_layer1
    1829              : 
    1830              : !-----------------------------------------------------------------------
    1831              : ! Parameters for atmosphere
    1832              : !-----------------------------------------------------------------------
    1833              : 
    1834              :       real (kind=dbl_kind), intent(out), optional :: &
    1835              :          cp_air_out,     & ! specific heat of air (J/kg/K)
    1836              :          cp_wv_out,      & ! specific heat of water vapor (J/kg/K)
    1837              :          zvir_out,       & ! rh2o/rair - 1.0
    1838              :          zref_out,       & ! reference height for stability (m)
    1839              :          qqqice_out,     & ! for qsat over ice
    1840              :          TTTice_out,     & ! for qsat over ice
    1841              :          qqqocn_out,     & ! for qsat over ocn
    1842              :          TTTocn_out        ! for qsat over ocn
    1843              : 
    1844              :       character (len=*), intent(out), optional :: &
    1845              :          atmbndy_out   ! atmo boundary method, 'similarity', 'constant' or 'mixed'
    1846              : 
    1847              :       logical (kind=log_kind), intent(out), optional :: &
    1848              :          calc_strair_out,     & ! if true, calculate wind stress components
    1849              :          formdrag_out,        & ! if true, calculate form drag
    1850              :          highfreq_out           ! if true, use high frequency coupling
    1851              : 
    1852              :       integer (kind=int_kind), intent(out), optional :: &
    1853              :          natmiter_out        ! number of iterations for boundary layer calculations
    1854              : 
    1855              :       ! Flux convergence tolerance
    1856              :       real (kind=dbl_kind), intent(out), optional :: atmiter_conv_out
    1857              : 
    1858              : !-----------------------------------------------------------------------
    1859              : ! Parameters for the ice thickness distribution
    1860              : !-----------------------------------------------------------------------
    1861              : 
    1862              :       integer (kind=int_kind), intent(out), optional :: &
    1863              :          kitd_out        , & ! type of itd conversions
    1864              :                              !   0 = delta function
    1865              :                              !   1 = linear remap
    1866              :          kcatbound_out       !   0 = old category boundary formula
    1867              :                              !   1 = new formula giving round numbers
    1868              :                              !   2 = WMO standard
    1869              :                              !   3 = asymptotic formula
    1870              : 
    1871              : !-----------------------------------------------------------------------
    1872              : ! Parameters for the floe size distribution
    1873              : !-----------------------------------------------------------------------
    1874              : 
    1875              :       integer (kind=int_kind), intent(out), optional :: &
    1876              :          nfreq_out          ! number of frequencies
    1877              : 
    1878              :       real (kind=dbl_kind), intent(out), optional :: &
    1879              :          floeshape_out      ! constant from Rothrock 1984 (unitless)
    1880              : 
    1881              :       logical (kind=log_kind), intent(out), optional :: &
    1882              :          wave_spec_out      ! if true, use wave forcing
    1883              : 
    1884              :       character (len=*), intent(out), optional :: &
    1885              :          wave_spec_type_out ! type of wave spectrum forcing
    1886              : 
    1887              : !-----------------------------------------------------------------------
    1888              : ! Parameters for biogeochemistry
    1889              : !-----------------------------------------------------------------------
    1890              : 
    1891              :       character (len=*), intent(out), optional :: &
    1892              :          bgc_flux_type_out    ! type of ocean-ice piston velocity
    1893              :                               ! 'constant', 'Jin2006'
    1894              : 
    1895              :       logical (kind=log_kind), intent(out), optional :: &
    1896              :          z_tracers_out,      & ! if .true., bgc or aerosol tracers are vertically resolved
    1897              :          scale_bgc_out,      & ! if .true., initialize bgc tracers proportionally with salinity
    1898              :          solve_zbgc_out,     & ! if .true., solve vertical biochemistry portion of code
    1899              :          dEdd_algae_out,     & ! if .true., algal absorptionof Shortwave is computed in the
    1900              :          modal_aero_out,     & ! if .true., use modal aerosol formulation in shortwave
    1901              :          use_macromolecules_out, & ! if .true., ocean DOC is already split
    1902              :          ! into polysaccharid, lipid and protein fractions
    1903              :          use_atm_dust_iron_out, &  ! if .true., compute  iron contribution from dust
    1904              :          restartbgc_out,     &
    1905              :          conserv_check_out     ! if .true., run conservation checks and abort if checks fail
    1906              : 
    1907              :       logical (kind=log_kind), intent(out), optional :: &
    1908              :          skl_bgc_out,        &   ! if true, solve skeletal biochemistry
    1909              :          solve_zsal_out          ! if true, update salinity profile from solve_S_dt
    1910              : 
    1911              :       real (kind=dbl_kind), intent(out), optional :: &
    1912              :          grid_o_out      , & ! for bottom flux
    1913              :          l_sk_out        , & ! characteristic diffusive scale (zsalinity) (m)
    1914              :          grid_o_t_out    , & ! top grid point length scale
    1915              :          initbio_frac_out, & ! fraction of ocean tracer concentration used to initialize tracer
    1916              :          phi_snow_out        ! snow porosity at the ice/snow interface
    1917              : 
    1918              :       real (kind=dbl_kind), intent(out), optional :: &
    1919              :          grid_oS_out     , & ! for bottom flux (zsalinity)
    1920              :          l_skS_out           ! 0.02 characteristic skeletal layer thickness (m) (zsalinity)
    1921              : 
    1922              :       real (kind=dbl_kind), intent(out), optional :: &
    1923              :          ratio_Si2N_diatoms_out, &   ! algal Si to N (mol/mol)
    1924              :          ratio_Si2N_sp_out     , &
    1925              :          ratio_Si2N_phaeo_out  , &
    1926              :          ratio_S2N_diatoms_out , &   ! algal S  to N (mol/mol)
    1927              :          ratio_S2N_sp_out      , &
    1928              :          ratio_S2N_phaeo_out   , &
    1929              :          ratio_Fe2C_diatoms_out, &   ! algal Fe to C  (umol/mol)
    1930              :          ratio_Fe2C_sp_out     , &
    1931              :          ratio_Fe2C_phaeo_out  , &
    1932              :          ratio_Fe2N_diatoms_out, &   ! algal Fe to N  (umol/mol)
    1933              :          ratio_Fe2N_sp_out     , &
    1934              :          ratio_Fe2N_phaeo_out  , &
    1935              :          ratio_Fe2DON_out      , &   ! Fe to N of DON (nmol/umol)
    1936              :          ratio_Fe2DOC_s_out    , &   ! Fe to C of DOC (nmol/umol) saccharids
    1937              :          ratio_Fe2DOC_l_out    , &   ! Fe to C of DOC (nmol/umol) lipids
    1938              :          tau_min_out           , &   ! rapid mobile to stationary exchanges (s) = 1.5 hours
    1939              :          tau_max_out           , &   ! long time mobile to stationary exchanges (s) = 2 days
    1940              :          chlabs_diatoms_out   , & ! chl absorption (1/m/(mg/m^3))
    1941              :          chlabs_sp_out        , & !
    1942              :          chlabs_phaeo_out     , & !
    1943              :          alpha2max_low_diatoms_out , & ! light limitation (1/(W/m^2))
    1944              :          alpha2max_low_sp_out      , &
    1945              :          alpha2max_low_phaeo_out   , &
    1946              :          beta2max_diatoms_out , & ! light inhibition (1/(W/m^2))
    1947              :          beta2max_sp_out      , &
    1948              :          beta2max_phaeo_out   , &
    1949              :          mu_max_diatoms_out   , & ! maximum growth rate (1/day)
    1950              :          mu_max_sp_out        , &
    1951              :          mu_max_phaeo_out     , &
    1952              :          grow_Tdep_diatoms_out, & ! Temperature dependence of growth (1/C)
    1953              :          grow_Tdep_sp_out     , &
    1954              :          grow_Tdep_phaeo_out  , &
    1955              :          fr_graze_diatoms_out , & ! Fraction grazed
    1956              :          fr_graze_sp_out      , &
    1957              :          fr_graze_phaeo_out   , &
    1958              :          mort_pre_diatoms_out , & ! Mortality (1/day)
    1959              :          mort_pre_sp_out      , &
    1960              :          mort_pre_phaeo_out   , &
    1961              :          mort_Tdep_diatoms_out, & ! T dependence of mortality (1/C)
    1962              :          mort_Tdep_sp_out     , &
    1963              :          mort_Tdep_phaeo_out  , &
    1964              :          k_exude_diatoms_out  , & ! algal exudation (1/d)
    1965              :          k_exude_sp_out       , &
    1966              :          k_exude_phaeo_out    , &
    1967              :          K_Nit_diatoms_out    , & ! nitrate half saturation (mmol/m^3)
    1968              :          K_Nit_sp_out         , &
    1969              :          K_Nit_phaeo_out      , &
    1970              :          K_Am_diatoms_out     , & ! ammonium half saturation (mmol/m^3)
    1971              :          K_Am_sp_out          , &
    1972              :          K_Am_phaeo_out       , &
    1973              :          K_Sil_diatoms_out    , & ! silicate half saturation (mmol/m^3)
    1974              :          K_Sil_sp_out         , &
    1975              :          K_Sil_phaeo_out      , &
    1976              :          K_Fe_diatoms_out     , & ! iron half saturation (nM)
    1977              :          K_Fe_sp_out          , &
    1978              :          K_Fe_phaeo_out       , &
    1979              :          f_don_protein_out    , & ! fraction of spilled grazing to proteins
    1980              :          kn_bac_protein_out   , & ! Bacterial degredation of DON (1/d)
    1981              :          f_don_Am_protein_out , & ! fraction of remineralized DON to ammonium
    1982              :          f_doc_s_out          , & ! fraction of mortality to DOC
    1983              :          f_doc_l_out          , &
    1984              :          f_exude_s_out        , & ! fraction of exudation to DOC
    1985              :          f_exude_l_out        , &
    1986              :          k_bac_s_out          , & ! Bacterial degredation of DOC (1/d)
    1987              :          k_bac_l_out          , &
    1988              :          algaltype_diatoms_out  , & ! mobility type
    1989              :          algaltype_sp_out       , & !
    1990              :          algaltype_phaeo_out    , & !
    1991              :          nitratetype_out        , & !
    1992              :          ammoniumtype_out       , & !
    1993              :          silicatetype_out       , & !
    1994              :          dmspptype_out          , & !
    1995              :          dmspdtype_out          , & !
    1996              :          humtype_out            , & !
    1997              :          doctype_s_out          , & !
    1998              :          doctype_l_out          , & !
    1999              :          dictype_1_out          , & !
    2000              :          dontype_protein_out    , & !
    2001              :          fedtype_1_out          , & !
    2002              :          feptype_1_out          , & !
    2003              :          zaerotype_bc1_out      , & !
    2004              :          zaerotype_bc2_out      , & !
    2005              :          zaerotype_dust1_out    , & !
    2006              :          zaerotype_dust2_out    , & !
    2007              :          zaerotype_dust3_out    , & !
    2008              :          zaerotype_dust4_out    , & !
    2009              :          ratio_C2N_diatoms_out  , & ! algal C to N ratio (mol/mol)
    2010              :          ratio_C2N_sp_out       , & !
    2011              :          ratio_C2N_phaeo_out    , & !
    2012              :          ratio_chl2N_diatoms_out, & ! algal chlorophyll to N ratio (mg/mmol)
    2013              :          ratio_chl2N_sp_out     , & !
    2014              :          ratio_chl2N_phaeo_out  , & !
    2015              :          F_abs_chl_diatoms_out  , & ! scales absorbed radiation for dEdd
    2016              :          F_abs_chl_sp_out       , & !
    2017              :          F_abs_chl_phaeo_out    , & !
    2018              :          ratio_C2N_proteins_out     ! ratio of C to N in proteins (mol/mol)
    2019              : 
    2020              :       real (kind=dbl_kind), intent(out), optional :: &
    2021              :          fr_resp_out           , &   ! fraction of algal growth lost due to respiration
    2022              :          algal_vel_out         , &   ! 0.5 cm/d(m/s) Lavoie 2005  1.5 cm/day
    2023              :          R_dFe2dust_out        , &   !  g/g (3.5% content) Tagliabue 2009
    2024              :          dustFe_sol_out        , &   ! solubility fraction
    2025              :          T_max_out            , & ! maximum temperature (C)
    2026              :          fsal_out             , & ! Salinity limitation (ppt)
    2027              :          op_dep_min_out       , & ! Light attenuates for optical depths exceeding min
    2028              :          fr_graze_s_out       , & ! fraction of grazing spilled or slopped
    2029              :          fr_graze_e_out       , & ! fraction of assimilation excreted
    2030              :          fr_mort2min_out      , & ! fractionation of mortality to Am
    2031              :          fr_dFe_out           , & ! fraction of remineralized nitrogen
    2032              :                                     ! (in units of algal iron)
    2033              :          k_nitrif_out         , & ! nitrification rate (1/day)
    2034              :          t_iron_conv_out      , & ! desorption loss pFe to dFe (day)
    2035              :          max_loss_out         , & ! restrict uptake to % of remaining value
    2036              :          max_dfe_doc1_out     , & ! max ratio of dFe to saccharides in the ice
    2037              :                                     ! (nM Fe/muM C)
    2038              :          fr_resp_s_out        , & ! DMSPd fraction of respiration loss as DMSPd
    2039              :          y_sk_DMS_out         , & ! fraction conversion given high yield
    2040              :          t_sk_conv_out        , & ! Stefels conversion time (d)
    2041              :          t_sk_ox_out          , & ! DMS oxidation time (d)
    2042              :          frazil_scav_out          ! scavenging fraction or multiple in frazil ice
    2043              : 
    2044              :       real (kind=dbl_kind), intent(out), optional :: &
    2045              :          sk_l_out,       & ! skeletal layer thickness (m)
    2046              :          min_bgc_out       ! fraction of ocean bgc concentration in surface melt
    2047              : 
    2048              : !-----------------------------------------------------------------------
    2049              : ! Parameters for melt ponds
    2050              : !-----------------------------------------------------------------------
    2051              : 
    2052              :       real (kind=dbl_kind), intent(out), optional :: &
    2053              :          hs0_out             ! snow depth for transition to bare sea ice (m)
    2054              : 
    2055              :       ! level-ice ponds
    2056              :       character (len=*), intent(out), optional :: &
    2057              :          frzpnd_out          ! pond refreezing parameterization
    2058              : 
    2059              :       real (kind=dbl_kind), intent(out), optional :: &
    2060              :          dpscale_out, &      ! alter e-folding time scale for flushing
    2061              :          rfracmin_out, &     ! minimum retained fraction of meltwater
    2062              :          rfracmax_out, &     ! maximum retained fraction of meltwater
    2063              :          pndaspect_out, &    ! ratio of pond depth to pond fraction
    2064              :          hs1_out             ! tapering parameter for snow on pond ice
    2065              : 
    2066              :       ! topo ponds
    2067              :       real (kind=dbl_kind), intent(out), optional :: &
    2068              :          hp1_out             ! critical parameter for pond ice thickness
    2069              : 
    2070              : !-----------------------------------------------------------------------
    2071              : ! Parameters for snow redistribution, metamorphosis
    2072              : !-----------------------------------------------------------------------
    2073              : 
    2074              :       character (len=*), intent(out), optional :: &
    2075              :          snwredist_out, &    ! type of snow redistribution
    2076              :          snw_aging_table_out ! snow aging lookup table
    2077              : 
    2078              :       logical (kind=log_kind), intent(out), optional :: &
    2079              :          use_smliq_pnd_out, &! use liquid in snow for ponds
    2080              :          snwgrain_out        ! snow metamorphosis
    2081              : 
    2082              :       real (kind=dbl_kind), intent(out), optional :: &
    2083              :          rsnw_fall_out, &    ! radius of new snow (10^-6 m)
    2084              :          rsnw_tmax_out, &    ! maximum snow radius (10^-6 m)
    2085              :          rhosnew_out, &      ! new snow density (kg/m^3)
    2086              :          rhosmin_out, &      ! minimum snow density (kg/m^3)
    2087              :          rhosmax_out, &      ! maximum snow density (kg/m^3)
    2088              :          windmin_out, &      ! minimum wind speed to compact snow (m/s)
    2089              :          drhosdwind_out, &   ! wind compaction factor (kg s/m^4)
    2090              :          snwlvlfac_out       ! fractional increase in snow depth
    2091              : 
    2092              :       integer (kind=int_kind), intent(out), optional :: &
    2093              :          isnw_T_out, &       ! maxiumum temperature index
    2094              :          isnw_Tgrd_out, &    ! maxiumum temperature gradient index
    2095              :          isnw_rhos_out       ! maxiumum snow density index
    2096              : 
    2097              :       real (kind=dbl_kind), dimension(:), intent(out), optional :: &
    2098              :          snowage_rhos_out, & ! snowage dimension data
    2099              :          snowage_Tgrd_out, & !
    2100              :          snowage_T_out       !
    2101              : 
    2102              :       real (kind=dbl_kind), dimension(:,:,:), intent(out), optional :: &
    2103              :          snowage_tau_out, &  ! (10^-6 m)
    2104              :          snowage_kappa_out, &!
    2105              :          snowage_drdt0_out   ! (10^-6 m/hr)
    2106              : 
    2107              :       character (len=char_len), intent(out), optional :: &
    2108              :          snw_ssp_table_out   ! lookup table: 'snicar' or 'test'
    2109              : 
    2110              : !autodocument_end
    2111              : 
    2112              :       character(len=*),parameter :: subname='(icepack_query_parameters)'
    2113              : 
    2114      8087692 :       if (present(argcheck_out)          ) argcheck_out     = argcheck
    2115      8087692 :       if (present(puny_out)              ) puny_out         = puny
    2116      8087692 :       if (present(bignum_out)            ) bignum_out       = bignum
    2117      8087692 :       if (present(pi_out)                ) pi_out           = pi
    2118              : 
    2119      8087692 :       if (present(c0_out)                ) c0_out           = c0
    2120      8087692 :       if (present(c1_out)                ) c1_out           = c1
    2121      8087692 :       if (present(c1p5_out)              ) c1p5_out         = c1p5
    2122      8087692 :       if (present(c2_out)                ) c2_out           = c2
    2123      8087692 :       if (present(c3_out)                ) c3_out           = c3
    2124      8087692 :       if (present(c4_out)                ) c4_out           = c4
    2125      8087692 :       if (present(c5_out)                ) c5_out           = c5
    2126      8087692 :       if (present(c6_out)                ) c6_out           = c6
    2127      8087692 :       if (present(c8_out)                ) c8_out           = c8
    2128      8087692 :       if (present(c10_out)               ) c10_out          = c10
    2129      8087692 :       if (present(c15_out)               ) c15_out          = c15
    2130      8087692 :       if (present(c16_out)               ) c16_out          = c16
    2131      8087692 :       if (present(c20_out)               ) c20_out          = c20
    2132      8087692 :       if (present(c25_out)               ) c25_out          = c25
    2133      8087692 :       if (present(c100_out)              ) c100_out         = c100
    2134      8087692 :       if (present(c180_out)              ) c180_out         = c180
    2135      8087692 :       if (present(c1000_out)             ) c1000_out        = c1000
    2136      8087692 :       if (present(p001_out)              ) p001_out         = p001
    2137      8087692 :       if (present(p01_out)               ) p01_out          = p01
    2138      8087692 :       if (present(p1_out)                ) p1_out           = p1
    2139      8087692 :       if (present(p2_out)                ) p2_out           = p2
    2140      8087692 :       if (present(p4_out)                ) p4_out           = p4
    2141      8087692 :       if (present(p5_out)                ) p5_out           = p5
    2142      8087692 :       if (present(p6_out)                ) p6_out           = p6
    2143      8087692 :       if (present(p05_out)               ) p05_out          = p05
    2144      8087692 :       if (present(p15_out)               ) p15_out          = p15
    2145      8087692 :       if (present(p25_out)               ) p25_out          = p25
    2146      8087692 :       if (present(p75_out)               ) p75_out          = p75
    2147      8087692 :       if (present(p333_out)              ) p333_out         = p333
    2148      8087692 :       if (present(p666_out)              ) p666_out         = p666
    2149      8087692 :       if (present(spval_const_out)       ) spval_const_out  = spval_const
    2150      8087692 :       if (present(pih_out)               ) pih_out          = pih
    2151      8087692 :       if (present(piq_out)               ) piq_out          = piq
    2152      8087692 :       if (present(pi2_out)               ) pi2_out          = pi2
    2153      8087692 :       if (present(secday_out)            ) secday_out       = secday
    2154      8087692 :       if (present(rad_to_deg_out)        ) rad_to_deg_out   = rad_to_deg
    2155              : 
    2156      8087692 :       if (present(rhos_out)              ) rhos_out         = rhos
    2157      8087692 :       if (present(rhoi_out)              ) rhoi_out         = rhoi
    2158      8087692 :       if (present(rhow_out)              ) rhow_out         = rhow
    2159      8087692 :       if (present(cp_air_out)            ) cp_air_out       = cp_air
    2160      8087692 :       if (present(emissivity_out)        ) emissivity_out   = emissivity
    2161      8087692 :       if (present(floediam_out)          ) floediam_out     = floediam
    2162      8087692 :       if (present(hfrazilmin_out)        ) hfrazilmin_out   = hfrazilmin
    2163      8087692 :       if (present(cp_ice_out)            ) cp_ice_out       = cp_ice
    2164      8087692 :       if (present(cp_ocn_out)            ) cp_ocn_out       = cp_ocn
    2165      8087692 :       if (present(depressT_out)          ) depressT_out     = depressT
    2166      8087692 :       if (present(dragio_out)            ) dragio_out       = dragio
    2167      8087692 :       if (present(iceruf_ocn_out)        ) iceruf_ocn_out   = iceruf_ocn
    2168      8087692 :       if (present(thickness_ocn_layer1_out) ) thickness_ocn_layer1_out = thickness_ocn_layer1
    2169      8087692 :       if (present(calc_dragio_out)       ) calc_dragio_out  = calc_dragio
    2170      8087692 :       if (present(albocn_out)            ) albocn_out       = albocn
    2171      8087692 :       if (present(gravit_out)            ) gravit_out       = gravit
    2172      8087692 :       if (present(viscosity_dyn_out)     ) viscosity_dyn_out= viscosity_dyn
    2173      8087692 :       if (present(tscale_pnd_drain_out)  ) tscale_pnd_drain_out = tscale_pnd_drain
    2174      8087692 :       if (present(Tocnfrz_out)           ) Tocnfrz_out      = Tocnfrz
    2175      8087692 :       if (present(rhofresh_out)          ) rhofresh_out     = rhofresh
    2176      8087692 :       if (present(zvir_out)              ) zvir_out         = zvir
    2177      8087692 :       if (present(vonkar_out)            ) vonkar_out       = vonkar
    2178      8087692 :       if (present(cp_wv_out)             ) cp_wv_out        = cp_wv
    2179      8087692 :       if (present(stefan_boltzmann_out)  ) stefan_boltzmann_out = stefan_boltzmann
    2180      8087692 :       if (present(Tffresh_out)           ) Tffresh_out      = Tffresh
    2181      8087692 :       if (present(Lsub_out)              ) Lsub_out         = Lsub
    2182      8087692 :       if (present(Lvap_out)              ) Lvap_out         = Lvap
    2183      8087692 :       if (present(Timelt_out)            ) Timelt_out       = Timelt
    2184      8087692 :       if (present(Tsmelt_out)            ) Tsmelt_out       = Tsmelt
    2185      8087692 :       if (present(ice_ref_salinity_out)  ) ice_ref_salinity_out = ice_ref_salinity
    2186      8087692 :       if (present(iceruf_out)            ) iceruf_out       = iceruf
    2187      8087692 :       if (present(Cf_out)                ) Cf_out           = Cf
    2188      8087692 :       if (present(Pstar_out)             ) Pstar_out        = Pstar
    2189      8087692 :       if (present(Cstar_out)             ) Cstar_out        = Cstar
    2190      8087692 :       if (present(kappav_out)            ) kappav_out       = kappav
    2191      8087692 :       if (present(kice_out)              ) kice_out         = kice
    2192      8087692 :       if (present(ksno_out)              ) ksno_out         = ksno
    2193      8087692 :       if (present(zref_out)              ) zref_out         = zref
    2194      8087692 :       if (present(hs_min_out)            ) hs_min_out       = hs_min
    2195      8087692 :       if (present(snowpatch_out)         ) snowpatch_out    = snowpatch
    2196      8087692 :       if (present(rhosi_out)             ) rhosi_out        = rhosi
    2197      8087692 :       if (present(sk_l_out)              ) sk_l_out         = sk_l
    2198      8087692 :       if (present(saltmax_out)           ) saltmax_out      = saltmax
    2199      8087692 :       if (present(phi_init_out)          ) phi_init_out     = phi_init
    2200      8087692 :       if (present(min_salin_out)         ) min_salin_out    = min_salin
    2201      8087692 :       if (present(salt_loss_out)         ) salt_loss_out    = salt_loss
    2202      8087692 :       if (present(Tliquidus_max_out)     ) Tliquidus_max_out= Tliquidus_max
    2203      8087692 :       if (present(min_bgc_out)           ) min_bgc_out      = min_bgc
    2204      8087692 :       if (present(dSin0_frazil_out)      ) dSin0_frazil_out = dSin0_frazil
    2205      8087692 :       if (present(hi_ssl_out)            ) hi_ssl_out       = hi_ssl
    2206      8087692 :       if (present(hs_ssl_out)            ) hs_ssl_out       = hs_ssl
    2207      8087692 :       if (present(hs_ssl_min_out)        ) hs_ssl_min_out   = hs_ssl_min
    2208      8087692 :       if (present(awtvdr_out)            ) awtvdr_out       = awtvdr
    2209      8087692 :       if (present(awtidr_out)            ) awtidr_out       = awtidr
    2210      8087692 :       if (present(awtvdf_out)            ) awtvdf_out       = awtvdf
    2211      8087692 :       if (present(awtidf_out)            ) awtidf_out       = awtidf
    2212      8087692 :       if (present(qqqice_out)            ) qqqice_out       = qqqice
    2213      8087692 :       if (present(TTTice_out)            ) TTTice_out       = TTTice
    2214      8087692 :       if (present(qqqocn_out)            ) qqqocn_out       = qqqocn
    2215      8087692 :       if (present(TTTocn_out)            ) TTTocn_out       = TTTocn
    2216      8087692 :       if (present(secday_out)            ) secday_out       = secday
    2217      8087692 :       if (present(ktherm_out)            ) ktherm_out       = ktherm
    2218      8087692 :       if (present(conduct_out)           ) conduct_out      = conduct
    2219      8087692 :       if (present(fbot_xfer_type_out)    ) fbot_xfer_type_out = fbot_xfer_type
    2220      8087692 :       if (present(calc_Tsfc_out)         ) calc_Tsfc_out    = calc_Tsfc
    2221      8087692 :       if (present(cpl_frazil_out)        ) cpl_frazil_out   = cpl_frazil
    2222      8087692 :       if (present(update_ocn_f_out)      ) update_ocn_f_out = update_ocn_f
    2223      8087692 :       if (present(dts_b_out)             ) dts_b_out        = dts_b
    2224      8087692 :       if (present(ustar_min_out)         ) ustar_min_out    = ustar_min
    2225      8087692 :       if (present(hi_min_out)            ) hi_min_out       = hi_min
    2226      8087692 :       if (present(a_rapid_mode_out)      ) a_rapid_mode_out = a_rapid_mode
    2227      8087692 :       if (present(Rac_rapid_mode_out)    ) Rac_rapid_mode_out = Rac_rapid_mode
    2228      8087692 :       if (present(aspect_rapid_mode_out) ) aspect_rapid_mode_out = aspect_rapid_mode
    2229      8087692 :       if (present(dSdt_slow_mode_out)    ) dSdt_slow_mode_out = dSdt_slow_mode
    2230      8087692 :       if (present(phi_c_slow_mode_out)   ) phi_c_slow_mode_out = phi_c_slow_mode
    2231      8087692 :       if (present(phi_i_mushy_out)       ) phi_i_mushy_out  = phi_i_mushy
    2232      8087692 :       if (present(shortwave_out)         ) shortwave_out    = shortwave
    2233      8087692 :       if (present(albedo_type_out)       ) albedo_type_out  = albedo_type
    2234      8087692 :       if (present(albicev_out)           ) albicev_out      = albicev
    2235      8087692 :       if (present(albicei_out)           ) albicei_out      = albicei
    2236      8087692 :       if (present(albsnowv_out)          ) albsnowv_out     = albsnowv
    2237      8087692 :       if (present(albsnowi_out)          ) albsnowi_out     = albsnowi
    2238      8087692 :       if (present(ahmax_out)             ) ahmax_out        = ahmax
    2239      8087692 :       if (present(R_ice_out)             ) R_ice_out        = R_ice
    2240      8087692 :       if (present(R_pnd_out)             ) R_pnd_out        = R_pnd
    2241      8087692 :       if (present(R_snw_out)             ) R_snw_out        = R_snw
    2242      8087692 :       if (present(dT_mlt_out)            ) dT_mlt_out       = dT_mlt
    2243      8087692 :       if (present(rsnw_mlt_out)          ) rsnw_mlt_out     = rsnw_mlt
    2244      8087692 :       if (present(kalg_out)              ) kalg_out         = kalg
    2245      8087692 :       if (present(R_gC2molC_out)         ) R_gC2molC_out    = R_gC2molC
    2246      8087692 :       if (present(kstrength_out)         ) kstrength_out    = kstrength
    2247      8087692 :       if (present(krdg_partic_out)       ) krdg_partic_out  = krdg_partic
    2248      8087692 :       if (present(krdg_redist_out)       ) krdg_redist_out  = krdg_redist
    2249      8087692 :       if (present(mu_rdg_out)            ) mu_rdg_out       = mu_rdg
    2250      8087692 :       if (present(atmbndy_out)           ) atmbndy_out      = atmbndy
    2251      8087692 :       if (present(calc_strair_out)       ) calc_strair_out  = calc_strair
    2252      8087692 :       if (present(formdrag_out)          ) formdrag_out     = formdrag
    2253      8087692 :       if (present(highfreq_out)          ) highfreq_out     = highfreq
    2254      8087692 :       if (present(natmiter_out)          ) natmiter_out     = natmiter
    2255      8087692 :       if (present(atmiter_conv_out)      ) atmiter_conv_out = atmiter_conv
    2256      8087692 :       if (present(congel_freeze_out)     ) congel_freeze_out = congel_freeze
    2257      8087692 :       if (present(tfrz_option_out)       ) tfrz_option_out  = tfrz_option
    2258      8087692 :       if (present(saltflux_option_out)   ) saltflux_option_out = saltflux_option
    2259      8087692 :       if (present(kitd_out)              ) kitd_out         = kitd
    2260      8087692 :       if (present(kcatbound_out)         ) kcatbound_out    = kcatbound
    2261      8087692 :       if (present(floeshape_out)         ) floeshape_out    = floeshape
    2262      8087692 :       if (present(wave_spec_out)         ) wave_spec_out    = wave_spec
    2263      8087692 :       if (present(wave_spec_type_out)    ) wave_spec_type_out = wave_spec_type
    2264      8087692 :       if (present(nfreq_out)             ) nfreq_out        = nfreq
    2265      8087692 :       if (present(hs0_out)               ) hs0_out          = hs0
    2266      8087692 :       if (present(frzpnd_out)            ) frzpnd_out       = frzpnd
    2267      8087692 :       if (present(dpscale_out)           ) dpscale_out      = dpscale
    2268      8087692 :       if (present(rfracmin_out)          ) rfracmin_out     = rfracmin
    2269      8087692 :       if (present(rfracmax_out)          ) rfracmax_out     = rfracmax
    2270      8087692 :       if (present(pndaspect_out)         ) pndaspect_out    = pndaspect
    2271      8087692 :       if (present(hs1_out)               ) hs1_out          = hs1
    2272      8087692 :       if (present(hp1_out)               ) hp1_out          = hp1
    2273      8087692 :       if (present(snwredist_out)         ) snwredist_out    = snwredist
    2274      8087692 :       if (present(snw_aging_table_out)   ) snw_aging_table_out = snw_aging_table
    2275      8087692 :       if (present(snwgrain_out)          ) snwgrain_out     = snwgrain
    2276      8087692 :       if (present(use_smliq_pnd_out)     ) use_smliq_pnd_out= use_smliq_pnd
    2277      8087692 :       if (present(rsnw_fall_out)         ) rsnw_fall_out    = rsnw_fall
    2278      8087692 :       if (present(rsnw_tmax_out)         ) rsnw_tmax_out    = rsnw_tmax
    2279      8087692 :       if (present(rhosnew_out)           ) rhosnew_out      = rhosnew
    2280      8087692 :       if (present(rhosmin_out)           ) rhosmin_out      = rhosmin
    2281      8087692 :       if (present(rhosmax_out)           ) rhosmax_out      = rhosmax
    2282      8087692 :       if (present(windmin_out)           ) windmin_out      = windmin
    2283      8087692 :       if (present(drhosdwind_out)        ) drhosdwind_out   = drhosdwind
    2284      8087692 :       if (present(snwlvlfac_out)         ) snwlvlfac_out    = snwlvlfac
    2285      8087692 :       if (present(isnw_T_out)            ) isnw_T_out       = isnw_T
    2286      8087692 :       if (present(isnw_Tgrd_out)         ) isnw_Tgrd_out    = isnw_Tgrd
    2287      8087692 :       if (present(isnw_rhos_out)         ) isnw_rhos_out    = isnw_rhos
    2288      8087692 :       if (present(snowage_rhos_out)      ) snowage_rhos_out = snowage_rhos
    2289      8087692 :       if (present(snowage_Tgrd_out)      ) snowage_Tgrd_out = snowage_Tgrd
    2290      8087692 :       if (present(snowage_T_out)         ) snowage_T_out    = snowage_T
    2291      8087692 :       if (present(snowage_tau_out)       ) snowage_tau_out  = snowage_tau
    2292      8087692 :       if (present(snowage_kappa_out)     ) snowage_kappa_out= snowage_kappa
    2293      8087692 :       if (present(snowage_drdt0_out)     ) snowage_drdt0_out= snowage_drdt0
    2294      8087692 :       if (present(snw_ssp_table_out)     ) snw_ssp_table_out= snw_ssp_table
    2295      8087692 :       if (present(bgc_flux_type_out)     ) bgc_flux_type_out= bgc_flux_type
    2296      8087692 :       if (present(z_tracers_out)         ) z_tracers_out    = z_tracers
    2297      8087692 :       if (present(scale_bgc_out)         ) scale_bgc_out    = scale_bgc
    2298      8087692 :       if (present(solve_zbgc_out)        ) solve_zbgc_out   = solve_zbgc
    2299      8087692 :       if (present(dEdd_algae_out)        ) dEdd_algae_out   = dEdd_algae
    2300      8087692 :       if (present(modal_aero_out)        ) modal_aero_out   = modal_aero
    2301      8087692 :       if (present(use_macromolecules_out)) use_macromolecules_out = use_macromolecules
    2302      8087692 :       if (present(use_atm_dust_iron_out) ) use_atm_dust_iron_out  = use_atm_dust_iron
    2303      8087692 :       if (present(restartbgc_out)        ) restartbgc_out= restartbgc
    2304      8087692 :       if (present(conserv_check_out)     ) conserv_check_out= conserv_check
    2305      8087692 :       if (present(skl_bgc_out)           ) skl_bgc_out      = skl_bgc
    2306      8087692 :       if (present(solve_zsal_out)        ) solve_zsal_out   = solve_zsal
    2307      8087692 :       if (present(grid_o_out)            ) grid_o_out       = grid_o
    2308      8087692 :       if (present(l_sk_out)              ) l_sk_out         = l_sk
    2309      8087692 :       if (present(initbio_frac_out)      ) initbio_frac_out = initbio_frac
    2310      8087692 :       if (present(frazil_scav_out)       ) frazil_scav_out  = frazil_scav
    2311      8087692 :       if (present(grid_oS_out)           ) grid_oS_out      = grid_oS
    2312      8087692 :       if (present(l_skS_out)             ) l_skS_out        = l_skS
    2313      8087692 :       if (present(grid_o_t_out)          ) grid_o_t_out      = grid_o_t
    2314      8087692 :       if (present(phi_snow_out)          ) phi_snow_out     = phi_snow
    2315      8087692 :       if (present(ratio_Si2N_diatoms_out) ) ratio_Si2N_diatoms_out = ratio_Si2N_diatoms
    2316      8087692 :       if (present(ratio_Si2N_sp_out)      ) ratio_Si2N_sp_out      = ratio_Si2N_sp
    2317      8087692 :       if (present(ratio_Si2N_phaeo_out)   ) ratio_Si2N_phaeo_out   = ratio_Si2N_phaeo
    2318      8087692 :       if (present(ratio_S2N_diatoms_out)  ) ratio_S2N_diatoms_out  = ratio_S2N_diatoms
    2319      8087692 :       if (present(ratio_S2N_sp_out)       ) ratio_S2N_sp_out       = ratio_S2N_sp
    2320      8087692 :       if (present(ratio_S2N_phaeo_out)    ) ratio_S2N_phaeo_out    = ratio_S2N_phaeo
    2321      8087692 :       if (present(ratio_Fe2C_diatoms_out) ) ratio_Fe2C_diatoms_out = ratio_Fe2C_diatoms
    2322      8087692 :       if (present(ratio_Fe2C_sp_out)      ) ratio_Fe2C_sp_out      = ratio_Fe2C_sp
    2323      8087692 :       if (present(ratio_Fe2C_phaeo_out)   ) ratio_Fe2C_phaeo_out   =  ratio_Fe2C_phaeo
    2324      8087692 :       if (present(ratio_Fe2N_diatoms_out) ) ratio_Fe2N_diatoms_out = ratio_Fe2N_diatoms
    2325      8087692 :       if (present(ratio_Fe2N_sp_out)      ) ratio_Fe2N_sp_out      = ratio_Fe2N_sp
    2326      8087692 :       if (present(ratio_Fe2N_phaeo_out)   ) ratio_Fe2N_phaeo_out   = ratio_Fe2N_phaeo
    2327      8087692 :       if (present(ratio_Fe2DON_out)       ) ratio_Fe2DON_out       = ratio_Fe2DON
    2328      8087692 :       if (present(ratio_Fe2DOC_s_out)     ) ratio_Fe2DOC_s_out     = ratio_Fe2DOC_s
    2329      8087692 :       if (present(ratio_Fe2DOC_l_out)     ) ratio_Fe2DOC_l_out     = ratio_Fe2DOC_l
    2330      8087692 :       if (present(tau_min_out)            ) tau_min_out            = tau_min
    2331      8087692 :       if (present(tau_max_out)            ) tau_max_out            = tau_max
    2332      8087692 :       if (present(chlabs_diatoms_out)     ) chlabs_diatoms_out     = chlabs_diatoms
    2333      8087692 :       if (present(chlabs_sp_out)          ) chlabs_sp_out          = chlabs_sp
    2334      8087692 :       if (present(chlabs_phaeo_out)       ) chlabs_phaeo_out       = chlabs_phaeo
    2335      8087692 :       if (present(alpha2max_low_diatoms_out)  ) alpha2max_low_diatoms_out   = alpha2max_low_diatoms
    2336      8087692 :       if (present(alpha2max_low_sp_out)       ) alpha2max_low_sp_out        = alpha2max_low_sp
    2337      8087692 :       if (present(alpha2max_low_phaeo_out)    ) alpha2max_low_phaeo_out     = alpha2max_low_phaeo
    2338      8087692 :       if (present(beta2max_diatoms_out)   ) beta2max_diatoms_out    = beta2max_diatoms
    2339      8087692 :       if (present(beta2max_sp_out)        ) beta2max_sp_out         = beta2max_sp
    2340      8087692 :       if (present(beta2max_phaeo_out)     ) beta2max_phaeo_out      = beta2max_phaeo
    2341      8087692 :       if (present(mu_max_diatoms_out)     ) mu_max_diatoms_out      = mu_max_diatoms
    2342      8087692 :       if (present(mu_max_sp_out)          ) mu_max_sp_out           = mu_max_sp
    2343      8087692 :       if (present(mu_max_phaeo_out)       ) mu_max_phaeo_out        = mu_max_phaeo
    2344      8087692 :       if (present(grow_Tdep_diatoms_out)  ) grow_Tdep_diatoms_out   = grow_Tdep_diatoms
    2345      8087692 :       if (present(grow_Tdep_sp_out)       ) grow_Tdep_sp_out        = grow_Tdep_sp
    2346      8087692 :       if (present(grow_Tdep_phaeo_out)    ) grow_Tdep_phaeo_out     = grow_Tdep_phaeo
    2347      8087692 :       if (present(fr_graze_diatoms_out)   ) fr_graze_diatoms_out    = fr_graze_diatoms
    2348      8087692 :       if (present(fr_graze_sp_out)        ) fr_graze_sp_out         = fr_graze_sp
    2349      8087692 :       if (present(fr_graze_phaeo_out)     ) fr_graze_phaeo_out      = fr_graze_phaeo
    2350      8087692 :       if (present(mort_pre_diatoms_out)   ) mort_pre_diatoms_out    = mort_pre_diatoms
    2351      8087692 :       if (present(mort_pre_sp_out)        ) mort_pre_sp_out         = mort_pre_sp
    2352      8087692 :       if (present(mort_pre_phaeo_out)     ) mort_pre_phaeo_out      = mort_pre_phaeo
    2353      8087692 :       if (present(mort_Tdep_diatoms_out)  ) mort_Tdep_diatoms_out   = mort_Tdep_diatoms
    2354      8087692 :       if (present(mort_Tdep_sp_out)       ) mort_Tdep_sp_out        = mort_Tdep_sp
    2355      8087692 :       if (present(mort_Tdep_phaeo_out)    ) mort_Tdep_phaeo_out     = mort_Tdep_phaeo
    2356      8087692 :       if (present(k_exude_diatoms_out)    ) k_exude_diatoms_out     = k_exude_diatoms
    2357      8087692 :       if (present(k_exude_sp_out)         ) k_exude_sp_out          = k_exude_sp
    2358      8087692 :       if (present(k_exude_phaeo_out)      ) k_exude_phaeo_out       = k_exude_phaeo
    2359      8087692 :       if (present(K_Nit_diatoms_out)      ) K_Nit_diatoms_out       = K_Nit_diatoms
    2360      8087692 :       if (present(K_Nit_sp_out)           ) K_Nit_sp_out            = K_Nit_sp
    2361      8087692 :       if (present(K_Nit_phaeo_out)        ) K_Nit_phaeo_out         = K_Nit_phaeo
    2362      8087692 :       if (present(K_Am_diatoms_out)       ) K_Am_diatoms_out        = K_Am_diatoms
    2363      8087692 :       if (present(K_Am_sp_out)            ) K_Am_sp_out             = K_Am_sp
    2364      8087692 :       if (present(K_Am_phaeo_out)         ) K_Am_phaeo_out          = K_Am_phaeo
    2365      8087692 :       if (present(K_Sil_diatoms_out)      ) K_Sil_diatoms_out       = K_Sil_diatoms
    2366      8087692 :       if (present(K_Sil_sp_out)           ) K_Sil_sp_out            = K_Sil_sp
    2367      8087692 :       if (present(K_Sil_phaeo_out)        ) K_Sil_phaeo_out         = K_Sil_phaeo
    2368      8087692 :       if (present(K_Fe_diatoms_out)       ) K_Fe_diatoms_out        = K_Fe_diatoms
    2369      8087692 :       if (present(K_Fe_sp_out)            ) K_Fe_sp_out             = K_Fe_sp
    2370      8087692 :       if (present(K_Fe_phaeo_out)         ) K_Fe_phaeo_out          = K_Fe_phaeo
    2371      8087692 :       if (present(f_don_protein_out)      ) f_don_protein_out       = f_don_protein
    2372      8087692 :       if (present(kn_bac_protein_out)     ) kn_bac_protein_out      = kn_bac_protein
    2373      8087692 :       if (present(f_don_Am_protein_out)   ) f_don_Am_protein_out    = f_don_Am_protein
    2374      8087692 :       if (present(f_doc_s_out)            ) f_doc_s_out             = f_doc_s
    2375      8087692 :       if (present(f_doc_l_out)            ) f_doc_l_out             = f_doc_l
    2376      8087692 :       if (present(f_exude_s_out)          ) f_exude_s_out           = f_exude_s
    2377      8087692 :       if (present(f_exude_l_out)          ) f_exude_l_out           = f_exude_l
    2378      8087692 :       if (present(k_bac_s_out)            ) k_bac_s_out             = k_bac_s
    2379      8087692 :       if (present(k_bac_l_out)            ) k_bac_l_out             = k_bac_l
    2380      8087692 :       if (present(algaltype_diatoms_out)  ) algaltype_diatoms_out   = algaltype_diatoms
    2381      8087692 :       if (present(algaltype_sp_out)       ) algaltype_sp_out        = algaltype_sp
    2382      8087692 :       if (present(algaltype_phaeo_out)    ) algaltype_phaeo_out     = algaltype_phaeo
    2383      8087692 :       if (present(nitratetype_out)        ) nitratetype_out         = nitratetype
    2384      8087692 :       if (present(ammoniumtype_out)       ) ammoniumtype_out        = ammoniumtype
    2385      8087692 :       if (present(silicatetype_out)       ) silicatetype_out        = silicatetype
    2386      8087692 :       if (present(dmspptype_out)          ) dmspptype_out           = dmspptype
    2387      8087692 :       if (present(dmspdtype_out)          ) dmspdtype_out           = dmspdtype
    2388      8087692 :       if (present(humtype_out)            ) humtype_out             = humtype
    2389      8087692 :       if (present(doctype_s_out)          ) doctype_s_out           = doctype_s
    2390      8087692 :       if (present(doctype_l_out)          ) doctype_l_out           = doctype_l
    2391      8087692 :       if (present(dictype_1_out)          ) dictype_1_out           = dictype_1
    2392      8087692 :       if (present(dontype_protein_out)    ) dontype_protein_out     = dontype_protein
    2393      8087692 :       if (present(fedtype_1_out)          ) fedtype_1_out           = fedtype_1
    2394      8087692 :       if (present(feptype_1_out)          ) feptype_1_out           = feptype_1
    2395      8087692 :       if (present(zaerotype_bc1_out)      ) zaerotype_bc1_out       = zaerotype_bc1
    2396      8087692 :       if (present(zaerotype_bc2_out)      ) zaerotype_bc2_out       = zaerotype_bc2
    2397      8087692 :       if (present(zaerotype_dust1_out)    ) zaerotype_dust1_out     = zaerotype_dust1
    2398      8087692 :       if (present(zaerotype_dust2_out)    ) zaerotype_dust2_out     = zaerotype_dust2
    2399      8087692 :       if (present(zaerotype_dust3_out)    ) zaerotype_dust3_out     = zaerotype_dust3
    2400      8087692 :       if (present(zaerotype_dust4_out)    ) zaerotype_dust4_out     = zaerotype_dust4
    2401      8087692 :       if (present(ratio_C2N_diatoms_out)  ) ratio_C2N_diatoms_out   = ratio_C2N_diatoms
    2402      8087692 :       if (present(ratio_C2N_sp_out)       ) ratio_C2N_sp_out        = ratio_C2N_sp
    2403      8087692 :       if (present(ratio_C2N_phaeo_out)    ) ratio_C2N_phaeo_out     = ratio_C2N_phaeo
    2404      8087692 :       if (present(ratio_chl2N_diatoms_out)) ratio_chl2N_diatoms_out = ratio_chl2N_diatoms
    2405      8087692 :       if (present(ratio_chl2N_sp_out)     ) ratio_chl2N_sp_out      = ratio_chl2N_sp
    2406      8087692 :       if (present(ratio_chl2N_phaeo_out)  ) ratio_chl2N_phaeo_out   = ratio_chl2N_phaeo
    2407      8087692 :       if (present(F_abs_chl_diatoms_out)  ) F_abs_chl_diatoms_out   = F_abs_chl_diatoms
    2408      8087692 :       if (present(F_abs_chl_sp_out)       ) F_abs_chl_sp_out        = F_abs_chl_sp
    2409      8087692 :       if (present(F_abs_chl_phaeo_out)    ) F_abs_chl_phaeo_out     = F_abs_chl_phaeo
    2410      8087692 :       if (present(ratio_C2N_proteins_out) ) ratio_C2N_proteins_out  = ratio_C2N_proteins
    2411      8087692 :       if (present(fr_resp_out)           ) fr_resp_out      = fr_resp
    2412      8087692 :       if (present(algal_vel_out)         ) algal_vel_out    = algal_vel
    2413      8087692 :       if (present(R_dFe2dust_out)        ) R_dFe2dust_out   = R_dFe2dust
    2414      8087692 :       if (present(dustFe_sol_out)        ) dustFe_sol_out   = dustFe_sol
    2415      8087692 :       if (present(T_max_out)             ) T_max_out        = T_max
    2416      8087692 :       if (present(fsal_out)              ) fsal_out         = fsal
    2417      8087692 :       if (present(op_dep_min_out)        ) op_dep_min_out   = op_dep_min
    2418      8087692 :       if (present(fr_graze_s_out)        ) fr_graze_s_out   = fr_graze_s
    2419      8087692 :       if (present(fr_graze_e_out)        ) fr_graze_e_out   = fr_graze_e
    2420      8087692 :       if (present(fr_mort2min_out)       ) fr_mort2min_out  = fr_mort2min
    2421      8087692 :       if (present(fr_dFe_out)            ) fr_dFe_out       = fr_dFe
    2422      8087692 :       if (present(k_nitrif_out)          ) k_nitrif_out     = k_nitrif
    2423      8087692 :       if (present(t_iron_conv_out)       ) t_iron_conv_out  = t_iron_conv
    2424      8087692 :       if (present(max_loss_out)          ) max_loss_out     = max_loss
    2425      8087692 :       if (present(max_dfe_doc1_out)      ) max_dfe_doc1_out = max_dfe_doc1
    2426      8087692 :       if (present(fr_resp_s_out)         ) fr_resp_s_out    = fr_resp_s
    2427      8087692 :       if (present(y_sk_DMS_out)          ) y_sk_DMS_out     = y_sk_DMS
    2428      8087692 :       if (present(t_sk_conv_out)         ) t_sk_conv_out    = t_sk_conv
    2429      8087692 :       if (present(t_sk_ox_out)           ) t_sk_ox_out      = t_sk_ox
    2430      8087692 :       if (present(Lfresh_out)            ) Lfresh_out       = Lfresh
    2431      8087692 :       if (present(cprho_out)             ) cprho_out        = cprho
    2432      8087692 :       if (present(Cp_out)                ) Cp_out           = Cp
    2433      8087692 :       if (present(sw_redist_out)         ) sw_redist_out    = sw_redist
    2434      8087692 :       if (present(sw_frac_out)           ) sw_frac_out      = sw_frac
    2435      8087692 :       if (present(sw_dtemp_out)          ) sw_dtemp_out     = sw_dtemp
    2436              : 
    2437      8087692 :       end subroutine icepack_query_parameters
    2438              : 
    2439              : !=======================================================================
    2440              : 
    2441              : !autodocument_start icepack_write_parameters
    2442              : ! subroutine to write the column package internal parameters
    2443              : 
    2444           83 :       subroutine icepack_write_parameters(iounit)
    2445              : 
    2446              :         integer (kind=int_kind), intent(in) :: &
    2447              :              iounit   ! unit number for output
    2448              : 
    2449              : !autodocument_end
    2450              : 
    2451              :         character(len=*),parameter :: subname='(icepack_write_parameters)'
    2452              : 
    2453           83 :         write(iounit,*) ""
    2454           83 :         write(iounit,*) subname
    2455           83 :         write(iounit,*) "  rhos       = ",rhos
    2456           83 :         write(iounit,*) "  rhoi       = ",rhoi
    2457           83 :         write(iounit,*) "  rhow       = ",rhow
    2458           83 :         write(iounit,*) "  cp_air     = ",cp_air
    2459           83 :         write(iounit,*) "  emissivity = ",emissivity
    2460           83 :         write(iounit,*) "  floediam   = ",floediam
    2461           83 :         write(iounit,*) "  hfrazilmin = ",hfrazilmin
    2462           83 :         write(iounit,*) "  cp_ice     = ",cp_ice
    2463           83 :         write(iounit,*) "  cp_ocn     = ",cp_ocn
    2464           83 :         write(iounit,*) "  depressT   = ",depressT
    2465           83 :         write(iounit,*) "  dragio     = ",dragio
    2466           83 :         write(iounit,*) "  calc_dragio= ",calc_dragio
    2467           83 :         write(iounit,*) "  iceruf_ocn = ",iceruf_ocn
    2468           83 :         write(iounit,*) "  thickness_ocn_layer1 = ",thickness_ocn_layer1
    2469           83 :         write(iounit,*) "  albocn     = ",albocn
    2470           83 :         write(iounit,*) "  gravit     = ",gravit
    2471           83 :         write(iounit,*) "  viscosity_dyn = ",viscosity_dyn
    2472           83 :         write(iounit,*) "  tscale_pnd_drain = ",tscale_pnd_drain
    2473           83 :         write(iounit,*) "  Tocnfrz    = ",Tocnfrz
    2474           83 :         write(iounit,*) "  rhofresh   = ",rhofresh
    2475           83 :         write(iounit,*) "  zvir       = ",zvir
    2476           83 :         write(iounit,*) "  vonkar     = ",vonkar
    2477           83 :         write(iounit,*) "  cp_wv      = ",cp_wv
    2478           83 :         write(iounit,*) "  stefan_boltzmann = ",stefan_boltzmann
    2479           83 :         write(iounit,*) "  Tffresh    = ",Tffresh
    2480           83 :         write(iounit,*) "  Lsub       = ",Lsub
    2481           83 :         write(iounit,*) "  Lvap       = ",Lvap
    2482           83 :         write(iounit,*) "  Timelt     = ",Timelt
    2483           83 :         write(iounit,*) "  Tsmelt     = ",Tsmelt
    2484           83 :         write(iounit,*) "  ice_ref_salinity = ",ice_ref_salinity
    2485           83 :         write(iounit,*) "  iceruf     = ",iceruf
    2486           83 :         write(iounit,*) "  Cf         = ",Cf
    2487           83 :         write(iounit,*) "  Pstar      = ",Pstar
    2488           83 :         write(iounit,*) "  Cstar      = ",Cstar
    2489           83 :         write(iounit,*) "  kappav     = ",kappav
    2490           83 :         write(iounit,*) "  kice       = ",kice
    2491           83 :         write(iounit,*) "  ksno       = ",ksno
    2492           83 :         write(iounit,*) "  zref       = ",zref
    2493           83 :         write(iounit,*) "  hs_min     = ",hs_min
    2494           83 :         write(iounit,*) "  snowpatch  = ",snowpatch
    2495           83 :         write(iounit,*) "  rhosi      = ",rhosi
    2496           83 :         write(iounit,*) "  sk_l       = ",sk_l
    2497           83 :         write(iounit,*) "  saltmax    = ",saltmax
    2498           83 :         write(iounit,*) "  phi_init   = ",phi_init
    2499           83 :         write(iounit,*) "  min_salin  = ",min_salin
    2500           83 :         write(iounit,*) "  salt_loss  = ",salt_loss
    2501           83 :         write(iounit,*) "  Tliquidus_max = ",Tliquidus_max
    2502           83 :         write(iounit,*) "  min_bgc    = ",min_bgc
    2503           83 :         write(iounit,*) "  dSin0_frazil = ",dSin0_frazil
    2504           83 :         write(iounit,*) "  hi_ssl     = ",hi_ssl
    2505           83 :         write(iounit,*) "  hs_ssl     = ",hs_ssl
    2506           83 :         write(iounit,*) "  hs_ssl_min = ",hs_ssl_min
    2507           83 :         write(iounit,*) "  awtvdr     = ",awtvdr
    2508           83 :         write(iounit,*) "  awtidr     = ",awtidr
    2509           83 :         write(iounit,*) "  awtvdf     = ",awtvdf
    2510           83 :         write(iounit,*) "  awtidf     = ",awtidf
    2511           83 :         write(iounit,*) "  qqqice     = ",qqqice
    2512           83 :         write(iounit,*) "  TTTice     = ",TTTice
    2513           83 :         write(iounit,*) "  qqqocn     = ",qqqocn
    2514           83 :         write(iounit,*) "  TTTocn     = ",TTTocn
    2515           83 :         write(iounit,*) "  argcheck   = ",trim(argcheck)
    2516           83 :         write(iounit,*) "  puny       = ",puny
    2517           83 :         write(iounit,*) "  bignum     = ",bignum
    2518           83 :         write(iounit,*) "  secday     = ",secday
    2519           83 :         write(iounit,*) "  pi         = ",pi
    2520           83 :         write(iounit,*) "  pih        = ",pih
    2521           83 :         write(iounit,*) "  piq        = ",piq
    2522           83 :         write(iounit,*) "  pi2        = ",pi2
    2523           83 :         write(iounit,*) "  rad_to_deg = ",rad_to_deg
    2524           83 :         write(iounit,*) "  Lfresh     = ",Lfresh
    2525           83 :         write(iounit,*) "  cprho      = ",cprho
    2526           83 :         write(iounit,*) "  Cp         = ",Cp
    2527           83 :         write(iounit,*) "  ktherm     = ", ktherm
    2528           83 :         write(iounit,*) "  conduct    = ", trim(conduct)
    2529           83 :         write(iounit,*) "  fbot_xfer_type = ", trim(fbot_xfer_type)
    2530           83 :         write(iounit,*) "  calc_Tsfc  = ", calc_Tsfc
    2531           83 :         write(iounit,*) "  cpl_frazil = ", cpl_frazil
    2532           83 :         write(iounit,*) "  update_ocn_f = ", update_ocn_f
    2533           83 :         write(iounit,*) "  dts_b      = ", dts_b
    2534           83 :         write(iounit,*) "  ustar_min  = ", ustar_min
    2535           83 :         write(iounit,*) "  hi_min     = ", hi_min
    2536           83 :         write(iounit,*) "  a_rapid_mode = ", a_rapid_mode
    2537           83 :         write(iounit,*) "  Rac_rapid_mode = ", Rac_rapid_mode
    2538           83 :         write(iounit,*) "  aspect_rapid_mode = ", aspect_rapid_mode
    2539           83 :         write(iounit,*) "  dSdt_slow_mode = ", dSdt_slow_mode
    2540           83 :         write(iounit,*) "  phi_c_slow_mode = ", phi_c_slow_mode
    2541           83 :         write(iounit,*) "  phi_i_mushy= ", phi_i_mushy
    2542           83 :         write(iounit,*) "  shortwave  = ", trim(shortwave)
    2543           83 :         write(iounit,*) "  albedo_type= ", trim(albedo_type)
    2544           83 :         write(iounit,*) "  albicev    = ", albicev
    2545           83 :         write(iounit,*) "  albicei    = ", albicei
    2546           83 :         write(iounit,*) "  albsnowv   = ", albsnowv
    2547           83 :         write(iounit,*) "  albsnowi   = ", albsnowi
    2548           83 :         write(iounit,*) "  ahmax      = ", ahmax
    2549           83 :         write(iounit,*) "  R_ice      = ", R_ice
    2550           83 :         write(iounit,*) "  R_pnd      = ", R_pnd
    2551           83 :         write(iounit,*) "  R_snw      = ", R_snw
    2552           83 :         write(iounit,*) "  dT_mlt     = ", dT_mlt
    2553           83 :         write(iounit,*) "  rsnw_mlt   = ", rsnw_mlt
    2554           83 :         write(iounit,*) "  kalg       = ", kalg
    2555           83 :         write(iounit,*) "  R_gC2molC  = ", R_gC2molC
    2556           83 :         write(iounit,*) "  kstrength  = ", kstrength
    2557           83 :         write(iounit,*) "  krdg_partic= ", krdg_partic
    2558           83 :         write(iounit,*) "  krdg_redist= ", krdg_redist
    2559           83 :         write(iounit,*) "  mu_rdg     = ", mu_rdg
    2560           83 :         write(iounit,*) "  atmbndy    = ", trim(atmbndy)
    2561           83 :         write(iounit,*) "  calc_strair= ", calc_strair
    2562           83 :         write(iounit,*) "  formdrag   = ", formdrag
    2563           83 :         write(iounit,*) "  highfreq   = ", highfreq
    2564           83 :         write(iounit,*) "  natmiter   = ", natmiter
    2565           83 :         write(iounit,*) "  atmiter_conv = ", atmiter_conv
    2566           83 :         write(iounit,*) "  congel_freeze = ", trim(congel_freeze)
    2567           83 :         write(iounit,*) "  tfrz_option= ", trim(tfrz_option)
    2568           83 :         write(iounit,*) "  saltflux_option = ", trim(saltflux_option)
    2569           83 :         write(iounit,*) "  kitd       = ", kitd
    2570           83 :         write(iounit,*) "  kcatbound  = ", kcatbound
    2571           83 :         write(iounit,*) "  floeshape  = ", floeshape
    2572           83 :         write(iounit,*) "  wave_spec  = ", wave_spec
    2573           83 :         write(iounit,*) "  wave_spec_type = ", trim(wave_spec_type)
    2574           83 :         write(iounit,*) "  nfreq      = ", nfreq
    2575           83 :         write(iounit,*) "  hs0        = ", hs0
    2576           83 :         write(iounit,*) "  frzpnd     = ", trim(frzpnd)
    2577           83 :         write(iounit,*) "  dpscale    = ", dpscale
    2578           83 :         write(iounit,*) "  rfracmin   = ", rfracmin
    2579           83 :         write(iounit,*) "  rfracmax   = ", rfracmax
    2580           83 :         write(iounit,*) "  pndaspect  = ", pndaspect
    2581           83 :         write(iounit,*) "  hs1        = ", hs1
    2582           83 :         write(iounit,*) "  hp1        = ", hp1
    2583           83 :         write(iounit,*) "  snwredist  = ", trim(snwredist)
    2584           83 :         write(iounit,*) "  snw_aging_table = ", trim(snw_aging_table)
    2585           83 :         write(iounit,*) "  snwgrain   = ", snwgrain
    2586           83 :         write(iounit,*) "  use_smliq_pnd = ", use_smliq_pnd
    2587           83 :         write(iounit,*) "  rsnw_fall  = ", rsnw_fall
    2588           83 :         write(iounit,*) "  rsnw_tmax  = ", rsnw_tmax
    2589           83 :         write(iounit,*) "  rhosnew    = ", rhosnew
    2590           83 :         write(iounit,*) "  rhosmin    = ", rhosmin
    2591           83 :         write(iounit,*) "  rhosmax    = ", rhosmax
    2592           83 :         write(iounit,*) "  windmin    = ", windmin
    2593           83 :         write(iounit,*) "  drhosdwind = ", drhosdwind
    2594           83 :         write(iounit,*) "  snwlvlfac  = ", snwlvlfac
    2595           83 :         write(iounit,*) "  isnw_T     = ", isnw_T
    2596           83 :         write(iounit,*) "  isnw_Tgrd  = ", isnw_Tgrd
    2597           83 :         write(iounit,*) "  isnw_rhos  = ", isnw_rhos
    2598              : !        write(iounit,*) "  snowage_rhos  = ", snowage_rhos(1)
    2599              : !        write(iounit,*) "  snowage_Tgrd  = ", snowage_Tgrd(1)
    2600              : !        write(iounit,*) "  snowage_T     = ", snowage_T(1)
    2601              : !        write(iounit,*) "  snowage_tau   = ", snowage_tau(1,1,1)
    2602              : !        write(iounit,*) "  snowage_kappa = ", snowage_kappa(1,1,1)
    2603              : !        write(iounit,*) "  snowage_drdt0 = ", snowage_drdt0(1,1,1)
    2604           83 :         write(iounit,*) "  snw_ssp_table = ", trim(snw_ssp_table)
    2605           83 :         write(iounit,*) "  bgc_flux_type = ", trim(bgc_flux_type)
    2606           83 :         write(iounit,*) "  z_tracers  = ", z_tracers
    2607           83 :         write(iounit,*) "  scale_bgc  = ", scale_bgc
    2608           83 :         write(iounit,*) "  solve_zbgc = ", solve_zbgc
    2609           83 :         write(iounit,*) "  dEdd_algae = ", dEdd_algae
    2610           83 :         write(iounit,*) "  modal_aero = ", modal_aero
    2611           83 :         write(iounit,*) "  use_macromolecules = ", use_macromolecules
    2612           83 :         write(iounit,*) "  use_atm_dust_iron  = ", use_atm_dust_iron
    2613           83 :         write(iounit,*) "  restartbgc = ", restartbgc
    2614           83 :         write(iounit,*) "  conserv_check = ", conserv_check
    2615           83 :         write(iounit,*) "  skl_bgc    = ", skl_bgc
    2616           83 :         write(iounit,*) "  solve_zsal = ", solve_zsal
    2617           83 :         write(iounit,*) "  grid_o     = ", grid_o
    2618           83 :         write(iounit,*) "  l_sk       = ", l_sk
    2619           83 :         write(iounit,*) "  grid_o_t   = ", grid_o_t
    2620           83 :         write(iounit,*) "  initbio_frac = ", initbio_frac
    2621           83 :         write(iounit,*) "  frazil_scav= ", frazil_scav
    2622           83 :         write(iounit,*) "  grid_oS    = ", grid_oS
    2623           83 :         write(iounit,*) "  l_skS      = ", l_skS
    2624           83 :         write(iounit,*) "  phi_snow   = ", phi_snow
    2625              : 
    2626           83 :         write(iounit,*) "  ratio_Si2N_diatoms = ", ratio_Si2N_diatoms
    2627           83 :         write(iounit,*) "  ratio_Si2N_sp      = ", ratio_Si2N_sp
    2628           83 :         write(iounit,*) "  ratio_Si2N_phaeo   = ", ratio_Si2N_phaeo
    2629           83 :         write(iounit,*) "  ratio_S2N_diatoms  = ", ratio_S2N_diatoms
    2630           83 :         write(iounit,*) "  ratio_S2N_sp       = ", ratio_S2N_sp
    2631           83 :         write(iounit,*) "  ratio_S2N_phaeo    = ", ratio_S2N_phaeo
    2632           83 :         write(iounit,*) "  ratio_Fe2C_diatoms = ", ratio_Fe2C_diatoms
    2633           83 :         write(iounit,*) "  ratio_Fe2C_sp      = ", ratio_Fe2C_sp
    2634           83 :         write(iounit,*) "  ratio_Fe2C_phaeo   = ",  ratio_Fe2C_phaeo
    2635           83 :         write(iounit,*) "  ratio_Fe2N_diatoms = ", ratio_Fe2N_diatoms
    2636           83 :         write(iounit,*) "  ratio_Fe2N_sp      = ", ratio_Fe2N_sp
    2637           83 :         write(iounit,*) "  ratio_Fe2N_phaeo   = ", ratio_Fe2N_phaeo
    2638           83 :         write(iounit,*) "  ratio_Fe2DON       = ", ratio_Fe2DON
    2639           83 :         write(iounit,*) "  ratio_Fe2DOC_s     = ", ratio_Fe2DOC_s
    2640           83 :         write(iounit,*) "  ratio_Fe2DOC_l     = ", ratio_Fe2DOC_l
    2641           83 :         write(iounit,*) "  tau_min            = ", tau_min
    2642           83 :         write(iounit,*) "  tau_max            = ", tau_max
    2643           83 :         write(iounit,*) "  chlabs_diatoms     = ", chlabs_diatoms
    2644           83 :         write(iounit,*) "  chlabs_sp          = ", chlabs_sp
    2645           83 :         write(iounit,*) "  chlabs_phaeo       = ", chlabs_phaeo
    2646           83 :         write(iounit,*) "  alpha2max_low_diatoms   = ", alpha2max_low_diatoms
    2647           83 :         write(iounit,*) "  alpha2max_low_sp        = ", alpha2max_low_sp
    2648           83 :         write(iounit,*) "  alpha2max_low_phaeo     = ", alpha2max_low_phaeo
    2649           83 :         write(iounit,*) "  beta2max_diatoms    = ", beta2max_diatoms
    2650           83 :         write(iounit,*) "  beta2max_sp         = ", beta2max_sp
    2651           83 :         write(iounit,*) "  beta2max_phaeo      = ", beta2max_phaeo
    2652           83 :         write(iounit,*) "  mu_max_diatoms      = ", mu_max_diatoms
    2653           83 :         write(iounit,*) "  mu_max_sp           = ", mu_max_sp
    2654           83 :         write(iounit,*) "  mu_max_phaeo        = ", mu_max_phaeo
    2655           83 :         write(iounit,*) "  grow_Tdep_diatoms   = ", grow_Tdep_diatoms
    2656           83 :         write(iounit,*) "  grow_Tdep_sp        = ", grow_Tdep_sp
    2657           83 :         write(iounit,*) "  grow_Tdep_phaeo     = ", grow_Tdep_phaeo
    2658           83 :         write(iounit,*) "  fr_graze_diatoms    = ", fr_graze_diatoms
    2659           83 :         write(iounit,*) "  fr_graze_sp         = ", fr_graze_sp
    2660           83 :         write(iounit,*) "  fr_graze_phaeo      = ", fr_graze_phaeo
    2661           83 :         write(iounit,*) "  mort_pre_diatoms    = ", mort_pre_diatoms
    2662           83 :         write(iounit,*) "  mort_pre_sp         = ", mort_pre_sp
    2663           83 :         write(iounit,*) "  mort_pre_phaeo      = ", mort_pre_phaeo
    2664           83 :         write(iounit,*) "  mort_Tdep_diatoms   = ", mort_Tdep_diatoms
    2665           83 :         write(iounit,*) "  mort_Tdep_sp        = ", mort_Tdep_sp
    2666           83 :         write(iounit,*) "  mort_Tdep_phaeo     = ", mort_Tdep_phaeo
    2667           83 :         write(iounit,*) "  k_exude_diatoms     = ", k_exude_diatoms
    2668           83 :         write(iounit,*) "  k_exude_sp          = ", k_exude_sp
    2669           83 :         write(iounit,*) "  k_exude_phaeo       = ", k_exude_phaeo
    2670           83 :         write(iounit,*) "  K_Nit_diatoms       = ", K_Nit_diatoms
    2671           83 :         write(iounit,*) "  K_Nit_sp            = ", K_Nit_sp
    2672           83 :         write(iounit,*) "  K_Nit_phaeo         = ", K_Nit_phaeo
    2673           83 :         write(iounit,*) "  K_Am_diatoms        = ", K_Am_diatoms
    2674           83 :         write(iounit,*) "  K_Am_sp             = ", K_Am_sp
    2675           83 :         write(iounit,*) "  K_Am_phaeo          = ", K_Am_phaeo
    2676           83 :         write(iounit,*) "  K_Sil_diatoms       = ", K_Sil_diatoms
    2677           83 :         write(iounit,*) "  K_Sil_sp            = ", K_Sil_sp
    2678           83 :         write(iounit,*) "  K_Sil_phaeo         = ", K_Sil_phaeo
    2679           83 :         write(iounit,*) "  K_Fe_diatoms        = ", K_Fe_diatoms
    2680           83 :         write(iounit,*) "  K_Fe_sp             = ", K_Fe_sp
    2681           83 :         write(iounit,*) "  K_Fe_phaeo          = ", K_Fe_phaeo
    2682           83 :         write(iounit,*) "  f_don_protein       = ", f_don_protein
    2683           83 :         write(iounit,*) "  kn_bac_protein      = ", kn_bac_protein
    2684           83 :         write(iounit,*) "  f_don_Am_protein    = ", f_don_Am_protein
    2685           83 :         write(iounit,*) "  f_doc_s             = ", f_doc_s
    2686           83 :         write(iounit,*) "  f_doc_l             = ", f_doc_l
    2687           83 :         write(iounit,*) "  f_exude_s           = ", f_exude_s
    2688           83 :         write(iounit,*) "  f_exude_l           = ", f_exude_l
    2689           83 :         write(iounit,*) "  k_bac_s             = ", k_bac_s
    2690           83 :         write(iounit,*) "  k_bac_l             = ", k_bac_l
    2691           83 :         write(iounit,*) "  algaltype_diatoms   = ", algaltype_diatoms
    2692           83 :         write(iounit,*) "  algaltype_sp        = ", algaltype_sp
    2693           83 :         write(iounit,*) "  algaltype_phaeo     = ", algaltype_phaeo
    2694           83 :         write(iounit,*) "  nitratetype         = ", nitratetype
    2695           83 :         write(iounit,*) "  ammoniumtype        = ", ammoniumtype
    2696           83 :         write(iounit,*) "  silicatetype        = ", silicatetype
    2697           83 :         write(iounit,*) "  dmspptype           = ", dmspptype
    2698           83 :         write(iounit,*) "  dmspdtype           = ", dmspdtype
    2699           83 :         write(iounit,*) "  humtype             = ", humtype
    2700           83 :         write(iounit,*) "  doctype_s           = ", doctype_s
    2701           83 :         write(iounit,*) "  doctype_l           = ", doctype_l
    2702           83 :         write(iounit,*) "  dictype_1           = ", dictype_1
    2703           83 :         write(iounit,*) "  dontype_protein     = ", dontype_protein
    2704           83 :         write(iounit,*) "  fedtype_1           = ", fedtype_1
    2705           83 :         write(iounit,*) "  feptype_1           = ", feptype_1
    2706           83 :         write(iounit,*) "  zaerotype_bc1       = ", zaerotype_bc1
    2707           83 :         write(iounit,*) "  zaerotype_bc2       = ", zaerotype_bc2
    2708           83 :         write(iounit,*) "  zaerotype_dust1     = ", zaerotype_dust1
    2709           83 :         write(iounit,*) "  zaerotype_dust2     = ", zaerotype_dust2
    2710           83 :         write(iounit,*) "  zaerotype_dust3     = ", zaerotype_dust3
    2711           83 :         write(iounit,*) "  zaerotype_dust4     = ", zaerotype_dust4
    2712           83 :         write(iounit,*) "  ratio_C2N_diatoms   = ", ratio_C2N_diatoms
    2713           83 :         write(iounit,*) "  ratio_C2N_sp        = ", ratio_C2N_sp
    2714           83 :         write(iounit,*) "  ratio_C2N_phaeo     = ", ratio_C2N_phaeo
    2715           83 :         write(iounit,*) "  ratio_chl2N_diatoms = ", ratio_chl2N_diatoms
    2716           83 :         write(iounit,*) "  ratio_chl2N_sp      = ", ratio_chl2N_sp
    2717           83 :         write(iounit,*) "  ratio_chl2N_phaeo   = ", ratio_chl2N_phaeo
    2718           83 :         write(iounit,*) "  F_abs_chl_diatoms   = ", F_abs_chl_diatoms
    2719           83 :         write(iounit,*) "  F_abs_chl_sp        = ", F_abs_chl_sp
    2720           83 :         write(iounit,*) "  F_abs_chl_phaeo     = ", F_abs_chl_phaeo
    2721           83 :         write(iounit,*) "  ratio_C2N_proteins  = ", ratio_C2N_proteins
    2722           83 :         write(iounit,*) "  fr_resp    = ", fr_resp
    2723           83 :         write(iounit,*) "  algal_vel  = ", algal_vel
    2724           83 :         write(iounit,*) "  R_dFe2dust = ", R_dFe2dust
    2725           83 :         write(iounit,*) "  dustFe_sol = ", dustFe_sol
    2726           83 :         write(iounit,*) "  T_max      = ", T_max
    2727           83 :         write(iounit,*) "  fsal       = ", fsal
    2728           83 :         write(iounit,*) "  op_dep_min = ", op_dep_min
    2729           83 :         write(iounit,*) "  fr_graze_s = ", fr_graze_s
    2730           83 :         write(iounit,*) "  fr_graze_e = ", fr_graze_e
    2731           83 :         write(iounit,*) "  fr_mort2min= ", fr_mort2min
    2732           83 :         write(iounit,*) "  fr_dFe     = ", fr_dFe
    2733           83 :         write(iounit,*) "  k_nitrif   = ", k_nitrif
    2734           83 :         write(iounit,*) "  t_iron_conv= ", t_iron_conv
    2735           83 :         write(iounit,*) "  max_loss   = ", max_loss
    2736           83 :         write(iounit,*) "  max_dfe_doc1 = ", max_dfe_doc1
    2737           83 :         write(iounit,*) "  fr_resp_s  = ", fr_resp_s
    2738           83 :         write(iounit,*) "  y_sk_DMS   = ", y_sk_DMS
    2739           83 :         write(iounit,*) "  t_sk_conv  = ", t_sk_conv
    2740           83 :         write(iounit,*) "  t_sk_ox    = ", t_sk_ox
    2741           83 :         write(iounit,*) "  sw_redist  = ", sw_redist
    2742           83 :         write(iounit,*) "  sw_frac    = ", sw_frac
    2743           83 :         write(iounit,*) "  sw_dtemp   = ", sw_dtemp
    2744           83 :         write(iounit,*) ""
    2745              : 
    2746           83 :       end subroutine icepack_write_parameters
    2747              : 
    2748              : !=======================================================================
    2749              : 
    2750              : !autodocument_start icepack_recompute_constants
    2751              : ! subroutine to reinitialize some derived constants
    2752              : 
    2753          347 :       subroutine icepack_recompute_constants()
    2754              : 
    2755              : !autodocument_end
    2756              : 
    2757              :       real (kind=dbl_kind) :: lambda
    2758              : 
    2759              :       character(len=*),parameter :: subname='(icepack_recompute_constants)'
    2760              : 
    2761          347 :         cprho  = cp_ocn*rhow
    2762          347 :         Lfresh = Lsub-Lvap
    2763          347 :         Cp     = 0.5_dbl_kind*gravit*(rhow-rhoi)*rhoi/rhow
    2764          347 :         pih    = p5*pi
    2765          347 :         piq    = p5*p5*pi
    2766          347 :         pi2    = c2*pi
    2767          347 :         rad_to_deg = c180/pi
    2768              : 
    2769          347 :         if (calc_dragio) then
    2770            3 :            dragio = (vonkar/log(p5 * thickness_ocn_layer1/iceruf_ocn))**2 ! dragio at half first layer
    2771              :            lambda = (thickness_ocn_layer1 - iceruf_ocn) / &
    2772            3 :                     (thickness_ocn_layer1*(sqrt(dragio)/vonkar*(log(c2) - c1 + iceruf_ocn/thickness_ocn_layer1) + c1))
    2773            3 :            dragio = dragio*lambda**2
    2774              :         endif
    2775              : 
    2776          347 :       end subroutine icepack_recompute_constants
    2777              : 
    2778              : !=======================================================================
    2779              : 
    2780     15450334 :       function icepack_chkoptargflag(first_call) result(chkoptargflag)
    2781              : 
    2782              :         logical(kind=log_kind), intent(in) :: first_call
    2783              : 
    2784              :         logical(kind=log_kind) :: chkoptargflag
    2785              : 
    2786              :         character(len=*),parameter :: subname='(icepack_chkoptargflag)'
    2787              : 
    2788              :         chkoptargflag = &
    2789     15450334 :            (argcheck == 'always' .or. (argcheck == 'first' .and. first_call))
    2790              : 
    2791     15450334 :       end function icepack_chkoptargflag
    2792              : 
    2793              : !=======================================================================
    2794              : 
    2795              : 
    2796              :     end module icepack_parameters
    2797              : 
    2798              : !=======================================================================
        

Generated by: LCOV version 2.0-1