From 67c874194a4acdaf09fc756cd679f579fa53060d Mon Sep 17 00:00:00 2001 From: apcraig Date: Tue, 14 Feb 2023 12:42:26 -0700 Subject: [PATCH 1/3] Update implementation of some optional arguments in Icepack - Remove local copies where possible - Check optional arguments Remove public interface declarations where not needed Clean up some intent statements --- columnphysics/icepack_fsd.F90 | 12 +- columnphysics/icepack_itd.F90 | 10 +- columnphysics/icepack_mechred.F90 | 39 ++---- columnphysics/icepack_orbital.F90 | 15 +++ columnphysics/icepack_shortwave.F90 | 156 ++++++++--------------- columnphysics/icepack_therm_bl99.F90 | 59 +++------ columnphysics/icepack_therm_itd.F90 | 5 +- columnphysics/icepack_therm_vertical.F90 | 12 +- columnphysics/icepack_tracers.F90 | 2 +- 9 files changed, 115 insertions(+), 195 deletions(-) diff --git a/columnphysics/icepack_fsd.F90 b/columnphysics/icepack_fsd.F90 index 4d89ca845..bee46cd35 100644 --- a/columnphysics/icepack_fsd.F90 +++ b/columnphysics/icepack_fsd.F90 @@ -120,18 +120,10 @@ subroutine icepack_init_fsd_bounds(nfsd, & real (kind=dbl_kind), dimension(:), allocatable :: & lims - logical (kind=log_kind) :: & - l_write_diags ! local write diags - character(len=8) :: c_fsd1,c_fsd2 character(len=2) :: c_nf character(len=*), parameter :: subname='(icepack_init_fsd_bounds)' - l_write_diags = .true. - if (present(write_diags)) then - l_write_diags = write_diags - endif - if (nfsd.eq.24) then allocate(lims(24+1)) @@ -230,7 +222,8 @@ subroutine icepack_init_fsd_bounds(nfsd, & c_fsd_range(n)=c_fsd1//'m < fsd Cat '//c_nf//' < '//c_fsd2//'m' enddo - if (l_write_diags) then + if (present(write_diags)) then + if (write_diags) then write(warnstr,*) ' ' call icepack_warnings_add(warnstr) write(warnstr,*) subname @@ -244,6 +237,7 @@ subroutine icepack_init_fsd_bounds(nfsd, & write(warnstr,*) ' ' call icepack_warnings_add(warnstr) endif + endif end subroutine icepack_init_fsd_bounds diff --git a/columnphysics/icepack_itd.F90 b/columnphysics/icepack_itd.F90 index 00f0f768f..3c18a4e13 100644 --- a/columnphysics/icepack_itd.F90 +++ b/columnphysics/icepack_itd.F90 @@ -997,10 +997,12 @@ subroutine cleanup_itd (dt, ntrcr, & faero_ocn(it) = faero_ocn(it) + dfaero_ocn(it) enddo endif - if (tr_iso) then - do it = 1, n_iso - fiso_ocn(it) = fiso_ocn(it) + dfiso_ocn(it) - enddo + if (present(fiso_ocn)) then + if (tr_iso) then + do it = 1, n_iso + fiso_ocn(it) = fiso_ocn(it) + dfiso_ocn(it) + enddo + endif endif if (present(flux_bio)) then do it = 1, nbtrcr diff --git a/columnphysics/icepack_mechred.F90 b/columnphysics/icepack_mechred.F90 index 4dc87cb28..ea049761f 100644 --- a/columnphysics/icepack_mechred.F90 +++ b/columnphysics/icepack_mechred.F90 @@ -58,10 +58,7 @@ module icepack_mechred implicit none private - public :: ridge_ice, & - asum_ridging, & - ridge_itd, & - icepack_ice_strength, & + public :: icepack_ice_strength, & icepack_step_ridge real (kind=dbl_kind), parameter :: & @@ -113,7 +110,7 @@ subroutine ridge_ice (dt, ndtd, & dardg1ndt, dardg2ndt, & dvirdgndt, & araftn, vraftn, & - closing_flag,closing ) + closing ) integer (kind=int_kind), intent(in) :: & ndtd , & ! number of dynamics subcycles @@ -161,7 +158,6 @@ subroutine ridge_ice (dt, ndtd, & krdg_redist ! selects redistribution function logical (kind=log_kind), intent(in) :: & - closing_flag, &! flag if closing is valid tr_brine ! if .true., brine height differs from ice thickness ! optional history fields @@ -296,7 +292,7 @@ subroutine ridge_ice (dt, ndtd, & ! Compute the area opening and closing. !----------------------------------------------------------------- - if (closing_flag) then + if (present(opening) .and. present(closing)) then opning = opening closing_net = closing @@ -595,11 +591,13 @@ subroutine ridge_ice (dt, ndtd, & faero_ocn(it) = faero_ocn(it) + maero(it)*dti enddo endif - if (tr_iso) then - ! check size fiso_ocn vs n_iso ??? - do it = 1, n_iso - fiso_ocn(it) = fiso_ocn(it) + miso(it)*dti - enddo + if (present(fiso_ocn)) then + if (tr_iso) then + ! check size fiso_ocn vs n_iso ??? + do it = 1, n_iso + fiso_ocn(it) = fiso_ocn(it) + miso(it)*dti + enddo + endif endif if (present(fpond)) then fpond = fpond - mpond ! units change later @@ -1826,12 +1824,6 @@ subroutine icepack_step_ridge (dt, ndtd, & real (kind=dbl_kind) :: & dtt ! thermo time step - real (kind=dbl_kind) :: & - l_closing ! local rate of closing due to divergence/shear (1/s) - - logical (kind=log_kind) :: & - l_closing_flag ! flag if closing is passed - logical (kind=log_kind), save :: & first_call = .true. ! first call flag @@ -1859,14 +1851,6 @@ subroutine icepack_step_ridge (dt, ndtd, & ! it may be out of whack, which the ridging helps fix).-ECH !----------------------------------------------------------------- - if (present(closing)) then - l_closing_flag = .true. - l_closing = closing - else - l_closing_flag = .false. - l_closing = c0 - endif - call ridge_ice (dt, ndtd, & ncat, n_aero, & nilyr, nslyr, & @@ -1892,8 +1876,7 @@ subroutine icepack_step_ridge (dt, ndtd, & dardg1ndt, dardg2ndt, & dvirdgndt, & araftn, vraftn, & - l_closing_flag, & - l_closing ) + closing ) if (icepack_warnings_aborted(subname)) return !----------------------------------------------------------------- diff --git a/columnphysics/icepack_orbital.F90 b/columnphysics/icepack_orbital.F90 index 4c7c53ccf..13f9d4824 100644 --- a/columnphysics/icepack_orbital.F90 +++ b/columnphysics/icepack_orbital.F90 @@ -177,11 +177,24 @@ subroutine compute_coszen (tlat, tlon, & real (kind=dbl_kind) :: ydayp1 ! day of year plus one time step + logical (kind=log_kind), save :: & + first_call = .true. ! first call flag + character(len=*),parameter :: subname='(compute_coszen)' ! Solar declination for next time step #ifdef CESMCOUPLED + if (icepack_chkoptargflag(first_call)) then + if (.not.(present(days_per_year) .and. & + present(nextsw_cday) .and. & + present(calendar_type))) then + call icepack_warnings_add(subname//' error in CESMCOUPLED args') + call icepack_warnings_setabort(.true.,__FILE__,__LINE__) + return + endif + endif + if (calendar_type == "GREGORIAN") then ydayp1 = min(nextsw_cday, real(days_per_year,kind=dbl_kind)) else @@ -206,6 +219,8 @@ subroutine compute_coszen (tlat, tlon, & endif #endif + first_call = .false. + end subroutine compute_coszen !=============================================================================== diff --git a/columnphysics/icepack_shortwave.F90 b/columnphysics/icepack_shortwave.F90 index 1063c4b29..d30214345 100644 --- a/columnphysics/icepack_shortwave.F90 +++ b/columnphysics/icepack_shortwave.F90 @@ -66,10 +66,7 @@ module icepack_shortwave implicit none private - public :: run_dEdd, & - shortwave_ccsm3, & - compute_shortwave_trcr, & - icepack_prep_radiation, & + public :: icepack_prep_radiation, & icepack_step_radiation real (kind=dbl_kind), parameter :: & @@ -178,11 +175,11 @@ subroutine shortwave_ccsm3 (aicen, vicen, & alvdfns, & ! visible, diffuse, snow (fraction) alidfns ! near-ir, diffuse, snow (fraction) - real (kind=dbl_kind), dimension(:), allocatable :: & - l_fswthru_vdr , & ! vis dir SW through ice to ocean (W m-2) - l_fswthru_vdf , & ! vis dif SW through ice to ocean (W m-2) - l_fswthru_idr , & ! nir dir SW through ice to ocean (W m-2) - l_fswthru_idf ! nir dif SW through ice to ocean (W m-2) + real (kind=dbl_kind) :: & + l_fswthru_vdr, & ! vis dir SW through ice to ocean (W m-2) + l_fswthru_vdf, & ! vis dif SW through ice to ocean (W m-2) + l_fswthru_idr, & ! nir dir SW through ice to ocean (W m-2) + l_fswthru_idf ! nir dif SW through ice to ocean (W m-2) character(len=*),parameter :: subname='(shortwave_ccsm3)' @@ -190,11 +187,6 @@ subroutine shortwave_ccsm3 (aicen, vicen, & ! Solar radiation: albedo and absorbed shortwave !----------------------------------------------------------------- - allocate(l_fswthru_vdr(ncat)) - allocate(l_fswthru_vdf(ncat)) - allocate(l_fswthru_idr(ncat)) - allocate(l_fswthru_idf(ncat)) - ! For basic shortwave, set coszen to a constant between 0 and 1. coszen = p5 ! sun above the horizon @@ -295,29 +287,24 @@ subroutine shortwave_ccsm3 (aicen, vicen, & fswsfc=fswsfc(n), & fswint=fswint(n), & fswthru=fswthru(n), & - fswthru_vdr=l_fswthru_vdr(n),& - fswthru_vdf=l_fswthru_vdf(n),& - fswthru_idr=l_fswthru_idr(n),& - fswthru_idf=l_fswthru_idf(n),& + fswthru_vdr=l_fswthru_vdr,& + fswthru_vdf=l_fswthru_vdf,& + fswthru_idr=l_fswthru_idr,& + fswthru_idf=l_fswthru_idf,& fswpenl=fswpenl(:,n), & Iswabs=Iswabs(:,n)) if (icepack_warnings_aborted(subname)) return + if(present(fswthru_vdr)) fswthru_vdr(n) = l_fswthru_vdr + if(present(fswthru_vdf)) fswthru_vdf(n) = l_fswthru_vdf + if(present(fswthru_idr)) fswthru_idr(n) = l_fswthru_idr + if(present(fswthru_idf)) fswthru_idf(n) = l_fswthru_idf + endif ! aicen > puny enddo ! ncat - if(present(fswthru_vdr)) fswthru_vdr = l_fswthru_vdr - if(present(fswthru_vdf)) fswthru_vdf = l_fswthru_vdf - if(present(fswthru_idr)) fswthru_idr = l_fswthru_idr - if(present(fswthru_idf)) fswthru_idf = l_fswthru_idf - - deallocate(l_fswthru_vdr) - deallocate(l_fswthru_vdf) - deallocate(l_fswthru_idr) - deallocate(l_fswthru_idf) - end subroutine shortwave_ccsm3 !======================================================================= @@ -879,8 +866,10 @@ subroutine run_dEdd(dt, ncat, & fswthrun_idr, & ! nir dir SW through ice to ocean (W/m^2) fswthrun_idf ! nir dif SW through ice to ocean (W/m^2) + real(kind=dbl_kind), dimension(:,:), intent(inout), optional :: & + rsnow ! snow grain radius tracer (10^-6 m) + real(kind=dbl_kind), dimension(:,:), intent(inout) :: & - rsnow , & ! snow grain radius tracer (10^-6 m) Sswabsn , & ! SW radiation absorbed in snow layers (W m-2) Iswabsn , & ! SW radiation absorbed in ice layers (W m-2) fswpenln ! visible SW entering ice layers (W m-2) @@ -903,6 +892,7 @@ subroutine run_dEdd(dt, ncat, & alvl ! area fraction of level ice real (kind=dbl_kind), dimension (nslyr) :: & + l_rsnow , & ! local array for snow grain radius tracer (10^-6 m) rhosnwn , & ! snow density (kg/m3) rsnwn ! snow grain radius (micrometers) @@ -929,7 +919,7 @@ subroutine run_dEdd(dt, ncat, & logical (kind=log_kind) :: & linitonly ! local initonly value - real (kind=dbl_kind), dimension(:), allocatable :: & + real (kind=dbl_kind) :: & l_fswthrun_vdr , & ! vis dir SW through ice to ocean (W m-2) l_fswthrun_vdf , & ! vis dif SW through ice to ocean (W m-2) l_fswthrun_idr , & ! nir dir SW through ice to ocean (W m-2) @@ -937,16 +927,13 @@ subroutine run_dEdd(dt, ncat, & character(len=*),parameter :: subname='(run_dEdd)' - allocate(l_fswthrun_vdr(ncat)) - allocate(l_fswthrun_vdf(ncat)) - allocate(l_fswthrun_idr(ncat)) - allocate(l_fswthrun_idf(ncat)) - linitonly = .false. if (present(initonly)) then linitonly = initonly endif + l_rsnow = c0 + ! cosine of the zenith angle #ifdef CESMCOUPLED call compute_coszen (tlat, tlon, & @@ -973,13 +960,17 @@ subroutine run_dEdd(dt, ncat, & if (aicen(n) > puny) then + if (present(rsnow)) then + l_rsnow(:) = rsnow(:,n) + endif + call shortwave_dEdd_set_snow(nslyr, R_snw, & dT_mlt, rsnw_mlt, & aicen(n), vsnon(n), & Tsfcn(n), fsn, & hs0, hsn, & rhosnwn, rsnwn, & - rsnow(:,n)) + l_rsnow(:)) if (icepack_warnings_aborted(subname)) return ! set pond properties @@ -1002,7 +993,7 @@ subroutine run_dEdd(dt, ncat, & Tsfcn(n), fsn, & hs0, hsnlvl, & rhosnwn(:), rsnwn(:), & - rsnow(:,n)) + l_rsnow(:)) if (icepack_warnings_aborted(subname)) return endif ! snwredist @@ -1122,10 +1113,10 @@ subroutine run_dEdd(dt, ncat, & alidrn(n), alidfn(n), & fswsfcn(n), fswintn(n), & fswthru=fswthrun(n), & - fswthru_vdr=l_fswthrun_vdr(n), & - fswthru_vdf=l_fswthrun_vdf(n), & - fswthru_idr=l_fswthrun_idr(n), & - fswthru_idf=l_fswthrun_idf(n), & + fswthru_vdr=l_fswthrun_vdr, & + fswthru_vdf=l_fswthrun_vdf, & + fswthru_idr=l_fswthrun_idr, & + fswthru_idf=l_fswthrun_idf, & Sswabs=Sswabsn(:,n), & Iswabs=Iswabsn(:,n), & albice=albicen(n), & @@ -1137,26 +1128,23 @@ subroutine run_dEdd(dt, ncat, & if (icepack_warnings_aborted(subname)) return - if (.not. snwgrain) then - do k = 1,nslyr - rsnow(k,n) = rsnwn(k) ! for history - enddo + if(present(fswthrun_vdr)) fswthrun_vdr(n) = l_fswthrun_vdr + if(present(fswthrun_vdf)) fswthrun_vdf(n) = l_fswthrun_vdf + if(present(fswthrun_idr)) fswthrun_idr(n) = l_fswthrun_idr + if(present(fswthrun_idf)) fswthrun_idf(n) = l_fswthrun_idf + + if (present(rsnow)) then + if (.not. snwgrain) then + do k = 1,nslyr + rsnow(k,n) = rsnwn(k) ! set rsnow for history + enddo + endif endif endif ! aicen > puny enddo ! ncat - if(present(fswthrun_vdr)) fswthrun_vdr = l_fswthrun_vdr - if(present(fswthrun_vdf)) fswthrun_vdf = l_fswthrun_vdf - if(present(fswthrun_idr)) fswthrun_idr = l_fswthrun_idr - if(present(fswthrun_idf)) fswthrun_idf = l_fswthrun_idf - - deallocate(l_fswthrun_vdr) - deallocate(l_fswthrun_vdf) - deallocate(l_fswthrun_idr) - deallocate(l_fswthrun_idf) - end subroutine run_dEdd !======================================================================= @@ -4106,39 +4094,14 @@ subroutine icepack_step_radiation (dt, ncat, & integer (kind=int_kind) :: & n ! thickness category index - logical (kind=log_kind) :: & - linitonly ! local flag for initonly - real(kind=dbl_kind) :: & hin, & ! Ice thickness (m) hbri ! brine thickness (m) - real (kind=dbl_kind), dimension(:), allocatable :: & - l_fswthrun_vdr , & ! vis dir SW through ice to ocean (W/m^2) - l_fswthrun_vdf , & ! vis dif SW through ice to ocean (W/m^2) - l_fswthrun_idr , & ! nir dir SW through ice to ocean (W/m^2) - l_fswthrun_idf ! nir dif SW through ice to ocean (W/m^2) - - real (kind=dbl_kind), dimension(:,:), allocatable :: & - l_rsnow ! snow grain radius tracer (10^-6 m) - character(len=*),parameter :: subname='(icepack_step_radiation)' - allocate(l_fswthrun_vdr(ncat)) - allocate(l_fswthrun_vdf(ncat)) - allocate(l_fswthrun_idr(ncat)) - allocate(l_fswthrun_idf(ncat)) - hin = c0 hbri = c0 - linitonly = .false. - if (present(initonly)) then - linitonly = initonly - endif - - allocate(l_rsnow (nslyr,ncat)) - l_rsnow = c0 - if (present(rsnow)) l_rsnow = rsnow ! Initialize do n = 1, ncat @@ -4175,7 +4138,7 @@ subroutine icepack_step_radiation (dt, ncat, & enddo endif - if (calc_Tsfc) then + if (calc_Tsfc) then if (trim(shortwave) == 'dEdd') then ! delta Eddington call run_dEdd(dt, ncat, & @@ -4209,10 +4172,10 @@ subroutine icepack_step_radiation (dt, ncat, & alidrn, alidfn, & fswsfcn, fswintn, & fswthrun=fswthrun, & - fswthrun_vdr=l_fswthrun_vdr, & - fswthrun_vdf=l_fswthrun_vdf, & - fswthrun_idr=l_fswthrun_idr, & - fswthrun_idf=l_fswthrun_idf, & + fswthrun_vdr=fswthrun_vdr, & + fswthrun_vdf=fswthrun_vdf, & + fswthrun_idr=fswthrun_idr, & + fswthrun_idf=fswthrun_idf, & fswpenln=fswpenln, & Sswabsn=Sswabsn, & Iswabsn=Iswabsn, & @@ -4223,9 +4186,9 @@ subroutine icepack_step_radiation (dt, ncat, & snowfracn=snowfracn, & dhsn=dhsn, & ffracn=ffracn, & - rsnow=l_rsnow, & + rsnow=rsnow, & l_print_point=l_print_point, & - initonly=linitonly) + initonly=initonly) if (icepack_warnings_aborted(subname)) return elseif (trim(shortwave) == 'ccsm3') then @@ -4243,10 +4206,10 @@ subroutine icepack_step_radiation (dt, ncat, & alvdfn, alidfn, & fswsfcn, fswintn, & fswthru=fswthrun, & - fswthru_vdr=l_fswthrun_vdr,& - fswthru_vdf=l_fswthrun_vdf,& - fswthru_idr=l_fswthrun_idr,& - fswthru_idf=l_fswthrun_idf,& + fswthru_vdr=fswthrun_vdr,& + fswthru_vdf=fswthrun_vdf,& + fswthru_idr=fswthrun_idr,& + fswthru_idf=fswthrun_idf,& fswpenl=fswpenln, & Iswabs=Iswabsn, & Sswabs=Sswabsn, & @@ -4300,17 +4263,6 @@ subroutine icepack_step_radiation (dt, ncat, & endif ! calc_Tsfc - if (present(fswthrun_vdr)) fswthrun_vdr = l_fswthrun_vdr - if (present(fswthrun_vdf)) fswthrun_vdf = l_fswthrun_vdf - if (present(fswthrun_idr)) fswthrun_idr = l_fswthrun_idr - if (present(fswthrun_idf)) fswthrun_idf = l_fswthrun_idf - - deallocate(l_fswthrun_vdr) - deallocate(l_fswthrun_vdf) - deallocate(l_fswthrun_idr) - deallocate(l_fswthrun_idf) - deallocate(l_rsnow) - end subroutine icepack_step_radiation !======================================================================= diff --git a/columnphysics/icepack_therm_bl99.F90 b/columnphysics/icepack_therm_bl99.F90 index 7aa553c95..7a090ef91 100644 --- a/columnphysics/icepack_therm_bl99.F90 +++ b/columnphysics/icepack_therm_bl99.F90 @@ -28,7 +28,7 @@ module icepack_therm_bl99 implicit none private - public :: surface_fluxes, temperature_changes + public :: temperature_changes real (kind=dbl_kind), parameter :: & betak = 0.13_dbl_kind, & ! constant in formula for k (W m-1 ppt-1) @@ -79,8 +79,7 @@ subroutine temperature_changes (dt, & real (kind=dbl_kind), intent(in) :: & dt ! time step - real (kind=dbl_kind), & - intent(in) :: & + real (kind=dbl_kind), intent(in) :: & rhoa , & ! air density (kg/m^3) flw , & ! incoming longwave radiation (W/m^2) potT , & ! air potential temperature (K) @@ -89,8 +88,7 @@ subroutine temperature_changes (dt, & lhcoef , & ! transfer coefficient for latent heat Tbot ! ice bottom surface temperature (deg C) - real (kind=dbl_kind), & - intent(inout) :: & + real (kind=dbl_kind), intent(inout) :: & fswsfc , & ! SW absorbed at ice/snow surface (W m-2) fswint ! SW absorbed in ice interior below surface (W m-2) @@ -99,12 +97,10 @@ subroutine temperature_changes (dt, & hslyr , & ! snow layer thickness (m) einit ! initial energy of melting (J m-2) - real (kind=dbl_kind), dimension (nslyr), & - intent(inout) :: & + real (kind=dbl_kind), dimension (nslyr), intent(inout) :: & Sswabs ! SW radiation absorbed in snow layers (W m-2) - real (kind=dbl_kind), dimension (nilyr), & - intent(inout) :: & + real (kind=dbl_kind), dimension (nilyr), intent(inout) :: & Iswabs ! SW radiation absorbed in ice layers (W m-2) real (kind=dbl_kind), intent(inout):: & @@ -117,21 +113,17 @@ subroutine temperature_changes (dt, & real (kind=dbl_kind), intent(out):: & fcondbot ! downward cond flux at bottom surface (W m-2) - real (kind=dbl_kind), & - intent(inout):: & + real (kind=dbl_kind), intent(inout):: & Tsf ! ice/snow surface temperature, Tsfcn - real (kind=dbl_kind), dimension (nilyr), & - intent(inout) :: & + real (kind=dbl_kind), dimension (nilyr), intent(inout) :: & zqin , & ! ice layer enthalpy (J m-3) zTin ! internal ice layer temperatures - real (kind=dbl_kind), dimension (nilyr), & - intent(in) :: & + real (kind=dbl_kind), dimension (nilyr), intent(in) :: & zSin ! internal ice layer salinities - real (kind=dbl_kind), dimension (nslyr), & - intent(inout) :: & + real (kind=dbl_kind), dimension (nslyr), intent(inout) :: & zqsn , & ! snow layer enthalpy (J m-3) zTsn ! internal snow layer temperatures @@ -833,8 +825,7 @@ subroutine conductivity (l_snow, & zTin , & ! internal ice layer temperatures zSin ! internal ice layer salinities - real (kind=dbl_kind), dimension (nilyr+nslyr+1), & - intent(out) :: & + real (kind=dbl_kind), dimension (nilyr+nslyr+1), intent(out) :: & kh ! effective conductivity at interfaces (W m-2 deg-1) ! local variables @@ -937,21 +928,18 @@ subroutine surface_fluxes (Tsf, fswsfc, & shcoef , & ! transfer coefficient for sensible heat lhcoef ! transfer coefficient for latent heat - real (kind=dbl_kind), & - intent(inout) :: & + real (kind=dbl_kind), intent(inout) :: & fsensn , & ! surface downward sensible heat (W m-2) flatn , & ! surface downward latent heat (W m-2) flwoutn , & ! upward LW at surface (W m-2) fsurfn ! net flux to top surface, excluding fcondtopn - real (kind=dbl_kind), & - intent(inout) :: & + real (kind=dbl_kind), intent(inout) :: & dfsens_dT , & ! deriv of fsens wrt Tsf (W m-2 deg-1) dflat_dT , & ! deriv of flat wrt Tsf (W m-2 deg-1) dflwout_dT ! deriv of flwout wrt Tsf (W m-2 deg-1) - real (kind=dbl_kind), & - intent(inout) :: & + real (kind=dbl_kind), intent(inout) :: & dfsurf_dT ! derivative of fsurfn wrt Tsf character(len=*),parameter :: subname='(surface_fluxes)' @@ -1001,8 +989,7 @@ subroutine get_matrix_elements_calc_Tsfc (nilyr, nslyr, & nilyr , & ! number of ice layers nslyr ! number of snow layers - logical (kind=log_kind), & - intent(in) :: & + logical (kind=log_kind), intent(in) :: & l_snow , & ! true if snow temperatures are computed l_cold ! true if surface temperature is computed @@ -1025,12 +1012,10 @@ subroutine get_matrix_elements_calc_Tsfc (nilyr, nslyr, & Tsn_init ! snow temp at beginning of time step ! Note: no absorbed SW in snow layers - real (kind=dbl_kind), dimension (nslyr+nilyr+1), & - intent(in) :: & + real (kind=dbl_kind), dimension (nslyr+nilyr+1), intent(in) :: & kh ! effective conductivity at layer interfaces - real (kind=dbl_kind), dimension (nslyr+nilyr+1), & - intent(inout) :: & + real (kind=dbl_kind), dimension (nslyr+nilyr+1), intent(inout) :: & sbdiag , & ! sub-diagonal matrix elements diag , & ! diagonal matrix elements spdiag , & ! super-diagonal matrix elements @@ -1250,8 +1235,7 @@ subroutine get_matrix_elements_know_Tsfc (nilyr, nslyr, & nilyr , & ! number of ice layers nslyr ! number of snow layers - logical (kind=log_kind), & - intent(in) :: & + logical (kind=log_kind), intent(in) :: & l_snow ! true if snow temperatures are computed real (kind=dbl_kind), intent(in) :: & @@ -1266,19 +1250,16 @@ subroutine get_matrix_elements_know_Tsfc (nilyr, nslyr, & Tsn_init ! snow temp at beginning of time step ! Note: no absorbed SW in snow layers - real (kind=dbl_kind), dimension (nslyr+nilyr+1), & - intent(in) :: & + real (kind=dbl_kind), dimension (nslyr+nilyr+1), intent(in) :: & kh ! effective conductivity at layer interfaces - real (kind=dbl_kind), dimension (nslyr+nilyr+1), & - intent(inout) :: & + real (kind=dbl_kind), dimension (nslyr+nilyr+1), intent(inout) :: & sbdiag , & ! sub-diagonal matrix elements diag , & ! diagonal matrix elements spdiag , & ! super-diagonal matrix elements rhs ! rhs of tri-diagonal matrix eqn. - real (kind=dbl_kind), intent(in), & - optional :: & + real (kind=dbl_kind), intent(in) :: & fcondtopn ! conductive flux at top sfc, positive down (W/m^2) ! local variables diff --git a/columnphysics/icepack_therm_itd.F90 b/columnphysics/icepack_therm_itd.F90 index e4af94abc..93ed8bebd 100644 --- a/columnphysics/icepack_therm_itd.F90 +++ b/columnphysics/icepack_therm_itd.F90 @@ -56,10 +56,7 @@ module icepack_therm_itd implicit none private - public :: linear_itd, & - add_new_ice, & - lateral_melt, & - icepack_step_therm2 + public :: icepack_step_therm2 !======================================================================= diff --git a/columnphysics/icepack_therm_vertical.F90 b/columnphysics/icepack_therm_vertical.F90 index 565e82a59..846cadfcf 100644 --- a/columnphysics/icepack_therm_vertical.F90 +++ b/columnphysics/icepack_therm_vertical.F90 @@ -61,9 +61,7 @@ module icepack_therm_vertical implicit none private - public :: frzmlt_bottom_lateral, & - thermo_vertical, & - icepack_step_therm1 + public :: icepack_step_therm1 !======================================================================= @@ -2396,7 +2394,7 @@ subroutine icepack_step_therm1(dt, ncat, nilyr, nslyr, & smice , & ! tracer for mass of ice in snow (kg/m^3) smliq ! tracer for mass of liquid in snow (kg/m^3) - real (kind=dbl_kind), allocatable, dimension(:) :: & + real (kind=dbl_kind), dimension(ncat) :: & l_meltsliqn ! mass of snow melt local (kg/m^2) real (kind=dbl_kind) :: & @@ -2457,11 +2455,10 @@ subroutine icepack_step_therm1(dt, ncat, nilyr, nslyr, & smice(:) = c0 smliq(:) = c0 - allocate(l_meltsliqn(ncat)) - l_meltsliqn = c0 - if (present(meltsliqn)) l_meltsliqn = meltsliqn l_meltsliq = c0 + l_meltsliqn = c0 if (present(meltsliq )) l_meltsliq = meltsliq + if (present(meltsliqn)) l_meltsliqn = meltsliqn !----------------------------------------------------------------- ! Initialize rate of snow loss to leads @@ -2923,7 +2920,6 @@ subroutine icepack_step_therm1(dt, ncat, nilyr, nslyr, & if (present(meltsliqn )) meltsliqn = l_meltsliqn if (present(meltsliq )) meltsliq = l_meltsliq - deallocate(l_meltsliqn) !----------------------------------------------------------------- ! Calculate ponds from the topographic scheme diff --git a/columnphysics/icepack_tracers.F90 b/columnphysics/icepack_tracers.F90 index 9f2f2f77c..c8135dea1 100644 --- a/columnphysics/icepack_tracers.F90 +++ b/columnphysics/icepack_tracers.F90 @@ -907,7 +907,7 @@ end subroutine icepack_query_tracer_indices subroutine icepack_write_tracer_indices(iounit) - integer, intent(in), optional :: iounit + integer, intent(in) :: iounit !autodocument_end From e607599da8d140e198b129eb1f352c842cddbb34 Mon Sep 17 00:00:00 2001 From: apcraig Date: Wed, 15 Feb 2023 12:24:52 -0700 Subject: [PATCH 2/3] Add write_diags argument to icepack_init_fsd_bounds Update documentation --- columnphysics/icepack_therm_vertical.F90 | 16 +- configuration/driver/icedrv_InitMod.F90 | 3 +- doc/source/user_guide/interfaces.include | 204 ++++++++++++----------- doc/source/user_guide/lg_sequence.rst | 10 +- 4 files changed, 121 insertions(+), 112 deletions(-) diff --git a/columnphysics/icepack_therm_vertical.F90 b/columnphysics/icepack_therm_vertical.F90 index 846cadfcf..8cc6c293a 100644 --- a/columnphysics/icepack_therm_vertical.F90 +++ b/columnphysics/icepack_therm_vertical.F90 @@ -2877,14 +2877,14 @@ subroutine icepack_step_therm1(dt, ncat, nilyr, nslyr, & meltb=meltb, snoicen=snoicen(n),& dsnow=dsnow, dsnown=dsnown(n), & congel=congel, snoice=snoice, & - meltsliq=l_meltsliq, & - meltsliqn=l_meltsliqn(n), & - Uref=Uref, Urefn=Urefn, & - Qref_iso=Qref_iso, & - Qrefn_iso=Qrefn_iso, & - fiso_ocn=fiso_ocn, & - fiso_ocnn=fiso_ocnn, & - fiso_evap=fiso_evap, & + meltsliq=l_meltsliq, & + meltsliqn=l_meltsliqn(n), & + Uref=Uref, Urefn=Urefn, & + Qref_iso=Qref_iso, & + Qrefn_iso=Qrefn_iso, & + fiso_ocn=fiso_ocn, & + fiso_ocnn=fiso_ocnn, & + fiso_evap=fiso_evap, & fiso_evapn=fiso_evapn) if (icepack_warnings_aborted(subname)) return diff --git a/configuration/driver/icedrv_InitMod.F90 b/configuration/driver/icedrv_InitMod.F90 index ec77a9707..26df28a29 100644 --- a/configuration/driver/icedrv_InitMod.F90 +++ b/configuration/driver/icedrv_InitMod.F90 @@ -102,7 +102,8 @@ subroutine icedrv_initialize floe_rad_l=floe_rad_l, & ! fsd size lower bound in m (radius) floe_rad_c=floe_rad_c, & ! fsd size bin centre in m (radius) floe_binwidth=floe_binwidth, & ! fsd size bin width in m (radius) - c_fsd_range=c_fsd_range) ! string for history output + c_fsd_range=c_fsd_range , & ! string for history output + write_diags=.true.) call icepack_warnings_flush(nu_diag) if (icepack_warnings_aborted(subname)) then call icedrv_system_abort(file=__FILE__,line=__LINE__) diff --git a/doc/source/user_guide/interfaces.include b/doc/source/user_guide/interfaces.include index 5919e7742..95db22ba6 100644 --- a/doc/source/user_guide/interfaces.include +++ b/doc/source/user_guide/interfaces.include @@ -55,18 +55,18 @@ icepack_atm_boundary shcoef , & ! transfer coefficient for sensible heat lhcoef ! transfer coefficient for latent heat - real (kind=dbl_kind), intent(in), optional, dimension(:) :: & + real (kind=dbl_kind), intent(in), dimension(:), optional :: & Qa_iso ! specific isotopic humidity (kg/kg) - real (kind=dbl_kind), intent(inout), optional, dimension(:) :: & + real (kind=dbl_kind), intent(inout), dimension(:), optional :: & Qref_iso ! reference specific isotopic humidity (kg/kg) - real (kind=dbl_kind), optional, intent(in) :: & + real (kind=dbl_kind), intent(in), optional :: & uvel , & ! x-direction ice speed (m/s) vvel , & ! y-direction ice speed (m/s) zlvs ! atm level height for scalars (if different than zlvl) (m) - real (kind=dbl_kind), optional, intent(out) :: & + real (kind=dbl_kind), intent(out), optional :: & Uref ! reference height wind speed (m/s) @@ -585,7 +585,7 @@ icepack_step_ridge faero_ocn, & ! aerosol flux to ocean (kg/m^2/s) flux_bio ! all bio fluxes to ocean - real (kind=dbl_kind), dimension(:), optional, intent(inout) :: & + real (kind=dbl_kind), dimension(:), intent(inout), optional :: & fiso_ocn ! isotope flux to ocean (kg/m^2/s) real (kind=dbl_kind), dimension(:,:), intent(inout) :: & @@ -2029,10 +2029,10 @@ icepack_step_therm2 yday ! day of year ! water isotopes - real (kind=dbl_kind), dimension(:), optional, intent(inout) :: & + real (kind=dbl_kind), dimension(:), intent(inout), optional :: & fiso_ocn ! isotope flux to ocean (kg/m^2/s) - real (kind=dbl_kind), optional, intent(in) :: & + real (kind=dbl_kind), intent(in), optional :: & HDO_ocn , & ! ocean concentration of HDO (kg/kg) H2_16O_ocn , & ! ocean concentration of H2_16O (kg/kg) H2_18O_ocn ! ocean concentration of H2_18O (kg/kg) @@ -2276,15 +2276,15 @@ icepack_step_therm1 zlvs) integer (kind=int_kind), intent(in) :: & - ncat , & ! number of thickness categories - nilyr , & ! number of ice layers - nslyr ! number of snow layers + ncat , & ! number of thickness categories + nilyr , & ! number of ice layers + nslyr ! number of snow layers real (kind=dbl_kind), intent(in) :: & dt , & ! time step - uvel , & ! x-component of velocity (m/s) - vvel , & ! y-component of velocity (m/s) - strax , & ! wind stress components (N/m^2) + uvel , & ! x-component of velocity (m/s) + vvel , & ! y-component of velocity (m/s) + strax , & ! wind stress components (N/m^2) stray , & ! yday ! day of year @@ -2297,42 +2297,42 @@ icepack_step_therm1 real (kind=dbl_kind), intent(inout) :: & aice , & ! sea ice concentration - vice , & ! volume per unit area of ice (m) - vsno , & ! volume per unit area of snow (m) + vice , & ! volume per unit area of ice (m) + vsno , & ! volume per unit area of snow (m) zlvl , & ! atm level height for momentum (and scalars if zlvs is not present) (m) - uatm , & ! wind velocity components (m/s) - vatm , & - wind , & ! wind speed (m/s) - potT , & ! air potential temperature (K) - Tair , & ! air temperature (K) - Qa , & ! specific humidity (kg/kg) - rhoa , & ! air density (kg/m^3) - frain , & ! rainfall rate (kg/m^2 s) - fsnow , & ! snowfall rate (kg/m^2 s) - fpond , & ! fresh water flux to ponds (kg/m^2/s) - fresh , & ! fresh water flux to ocean (kg/m^2/s) - fsalt , & ! salt flux to ocean (kg/m^2/s) - fhocn , & ! net heat flux to ocean (W/m^2) - fswthru , & ! shortwave penetrating to ocean (W/m^2) + uatm , & ! wind velocity components (m/s) + vatm , & ! (m/s) + wind , & ! wind speed (m/s) + potT , & ! air potential temperature (K) + Tair , & ! air temperature (K) + Qa , & ! specific humidity (kg/kg) + rhoa , & ! air density (kg/m^3) + frain , & ! rainfall rate (kg/m^2 s) + fsnow , & ! snowfall rate (kg/m^2 s) + fpond , & ! fresh water flux to ponds (kg/m^2/s) + fresh , & ! fresh water flux to ocean (kg/m^2/s) + fsalt , & ! salt flux to ocean (kg/m^2/s) + fhocn , & ! net heat flux to ocean (W/m^2) + fswthru , & ! shortwave penetrating to ocean (W/m^2) fsurf , & ! net surface heat flux (excluding fcondtop)(W/m^2) fcondtop , & ! top surface conductive flux (W/m^2) fcondbot , & ! bottom surface conductive flux (W/m^2) - fsens , & ! sensible heat flux (W/m^2) - flat , & ! latent heat flux (W/m^2) + fsens , & ! sensible heat flux (W/m^2) + flat , & ! latent heat flux (W/m^2) fswabs , & ! shortwave flux absorbed in ice and ocean (W/m^2) - flw , & ! incoming longwave radiation (W/m^2) - flwout , & ! outgoing longwave radiation (W/m^2) - evap , & ! evaporative water flux (kg/m^2/s) - evaps , & ! evaporative water flux over snow (kg/m^2/s) + flw , & ! incoming longwave radiation (W/m^2) + flwout , & ! outgoing longwave radiation (W/m^2) + evap , & ! evaporative water flux (kg/m^2/s) + evaps , & ! evaporative water flux over snow(kg/m^2/s) evapi , & ! evaporative water flux over ice (kg/m^2/s) congel , & ! basal ice growth (m/step-->cm/day) snoice , & ! snow-ice formation (m/step-->cm/day) - Tref , & ! 2m atm reference temperature (K) - Qref , & ! 2m atm reference spec humidity (kg/kg) - Uref , & ! 10m atm reference wind speed (m/s) + Tref , & ! 2m atm reference temperature (K) + Qref , & ! 2m atm reference spec humidity (kg/kg) + Uref , & ! 10m atm reference wind speed (m/s) Cdn_atm , & ! atm drag coefficient Cdn_ocn , & ! ocn drag coefficient - hfreebd , & ! freeboard (m) + hfreebd , & ! freeboard (m) hdraft , & ! draft of ice + snow column (Stoessel1993) hridge , & ! ridge height distrdg , & ! distance between ridges @@ -2353,14 +2353,14 @@ icepack_step_therm1 strocnxT , & ! ice-ocean stress, x-direction strocnyT , & ! ice-ocean stress, y-direction fbot , & ! ice-ocean heat flux at bottom surface (W/m^2) - frzmlt , & ! freezing/melting potential (W/m^2) + frzmlt , & ! freezing/melting potential (W/m^2) rside , & ! fraction of ice that melts laterally - fside , & ! lateral heat flux (W/m^2) - sst , & ! sea surface temperature (C) - Tf , & ! freezing temperature (C) - Tbot , & ! ice bottom surface temperature (deg C) - Tsnice , & ! snow ice interface temperature (deg C) - sss , & ! sea surface salinity (ppt) + fside , & ! lateral heat flux (W/m^2) + sst , & ! sea surface temperature (C) + Tf , & ! freezing temperature (C) + Tbot , & ! ice bottom surface temperature (deg C) + Tsnice , & ! snow ice interface temperature (deg C) + sss , & ! sea surface salinity (ppt) meltt , & ! top ice melt (m/step-->cm/day) melts , & ! snow melt (m/step-->cm/day) meltb , & ! basal ice melt (m/step-->cm/day) @@ -2373,86 +2373,88 @@ icepack_step_therm1 fswthru_idr , & ! nir dir shortwave penetrating to ocean (W/m^2) fswthru_idf , & ! nir dif shortwave penetrating to ocean (W/m^2) dsnow , & ! change in snow depth (m/step-->cm/day) - meltsliq , & ! mass of snow melt (kg/m^2) - fsloss ! rate of snow loss to leads (kg/m^2/s) - - real (kind=dbl_kind), dimension(:), optional, intent(inout) :: & - Qa_iso , & ! isotope specific humidity (kg/kg) - Qref_iso , & ! isotope 2m atm reference spec humidity (kg/kg) - fiso_atm , & ! isotope deposition rate (kg/m^2 s) - fiso_ocn , & ! isotope flux to ocean (kg/m^2/s) - fiso_evap , & ! isotope evaporation (kg/m^2/s) - meltsliqn ! mass of snow melt (kg/m^2) - - real (kind=dbl_kind), dimension(:,:), optional, intent(inout) :: & - rsnwn , & ! snow grain radius (10^-6 m) - smicen , & ! tracer for mass of ice in snow (kg/m^3) - smliqn ! tracer for mass of liquid in snow (kg/m^3) - - real (kind=dbl_kind), optional, intent(in) :: & - HDO_ocn , & ! ocean concentration of HDO (kg/kg) - H2_16O_ocn , & ! ocean concentration of H2_16O (kg/kg) - H2_18O_ocn , & ! ocean concentration of H2_18O (kg/kg) + meltsliq , & ! mass of snow melt (kg/m^2) + fsloss ! rate of snow loss to leads (kg/m^2/s) + + real (kind=dbl_kind), dimension(:), intent(inout), optional :: & + Qa_iso , & ! isotope specific humidity (kg/kg) + Qref_iso , & ! isotope 2m atm ref spec humidity (kg/kg) + fiso_atm , & ! isotope deposition rate (kg/m^2 s) + fiso_ocn , & ! isotope flux to ocean (kg/m^2/s) + fiso_evap , & ! isotope evaporation (kg/m^2/s) + meltsliqn ! mass of snow melt (kg/m^2) + + real (kind=dbl_kind), dimension(:,:), intent(inout), optional :: & + rsnwn , & ! snow grain radius (10^-6 m) + smicen , & ! tracer for mass of ice in snow (kg/m^3) + smliqn ! tracer for mass of liq in snow (kg/m^3) + + real (kind=dbl_kind), intent(in), optional :: & + HDO_ocn , & ! ocean concentration of HDO (kg/kg) + H2_16O_ocn , & ! ocean concentration of H2_16O (kg/kg) + H2_18O_ocn , & ! ocean concentration of H2_18O (kg/kg) zlvs ! atm level height for scalars (if different than zlvl) (m) real (kind=dbl_kind), dimension(:), intent(inout) :: & aicen_init , & ! fractional area of ice - vicen_init , & ! volume per unit area of ice (m) - vsnon_init , & ! volume per unit area of snow (m) + vicen_init , & ! volume per unit area of ice (m) + vsnon_init , & ! volume per unit area of snow (m) aicen , & ! concentration of ice - vicen , & ! volume per unit area of ice (m) - vsnon , & ! volume per unit area of snow (m) + vicen , & ! volume per unit area of ice (m) + vsnon , & ! volume per unit area of snow (m) Tsfc , & ! ice/snow surface temperature, Tsfcn alvl , & ! level ice area fraction vlvl , & ! level ice volume fraction apnd , & ! melt pond area fraction - hpnd , & ! melt pond depth (m) - ipnd , & ! melt pond refrozen lid thickness (m) + hpnd , & ! melt pond depth (m) + ipnd , & ! melt pond refrozen lid thickness (m) iage , & ! volume-weighted ice age FY , & ! area-weighted first-year ice area fsurfn , & ! net flux to top surface, excluding fcondtop - fcondtopn , & ! downward cond flux at top surface (W m-2) + fcondtopn , & ! downward cond flux at top surface (W m-2) fcondbotn , & ! downward cond flux at bottom surface (W m-2) - flatn , & ! latent heat flux (W m-2) - fsensn , & ! sensible heat flux (W m-2) + flatn , & ! latent heat flux (W m-2) + fsensn , & ! sensible heat flux (W m-2) fsurfn_f , & ! net flux to top surface, excluding fcondtop - fcondtopn_f , & ! downward cond flux at top surface (W m-2) - flatn_f , & ! latent heat flux (W m-2) - fsensn_f , & ! sensible heat flux (W m-2) - fswsfcn , & ! SW absorbed at ice/snow surface (W m-2) - fswthrun , & ! SW through ice to ocean (W/m^2) + fcondtopn_f , & ! downward cond flux at top surface (W m-2) + flatn_f , & ! latent heat flux (W m-2) + fsensn_f , & ! sensible heat flux (W m-2) + fswsfcn , & ! SW absorbed at ice/snow surface (W m-2) fswintn , & ! SW absorbed in ice interior, below surface (W m-2) - faero_atm , & ! aerosol deposition rate (kg/m^2 s) - faero_ocn , & ! aerosol flux to ocean (kg/m^2/s) + faero_atm , & ! aerosol deposition rate (kg/m^2 s) + faero_ocn , & ! aerosol flux to ocean (kg/m^2/s) dhsn , & ! depth difference for snow on sea ice and pond ice ffracn , & ! fraction of fsurfn used to melt ipond - meltsn , & ! snow melt (m) - melttn , & ! top ice melt (m) - meltbn , & ! bottom ice melt (m) - congeln , & ! congelation ice growth (m) - snoicen , & ! snow-ice growth (m) + meltsn , & ! snow melt (m) + melttn , & ! top ice melt (m) + meltbn , & ! bottom ice melt (m) + congeln , & ! congelation ice growth (m) + snoicen , & ! snow-ice growth (m) dsnown ! change in snow thickness (m/step-->cm/day) - real (kind=dbl_kind), optional, dimension(:), intent(inout) :: & - fswthrun_vdr , & ! vis dir SW through ice to ocean (W/m^2) - fswthrun_vdf , & ! vis dif SW through ice to ocean (W/m^2) - fswthrun_idr , & ! nir dir SW through ice to ocean (W/m^2) - fswthrun_idf ! nir dif SW through ice to ocean (W/m^2) + real (kind=dbl_kind), dimension(:), intent(in) :: & + fswthrun ! SW through ice to ocean (W/m^2) + + real (kind=dbl_kind), dimension(:), intent(in), optional :: & + fswthrun_vdr , & ! vis dir SW through ice to ocean (W/m^2) + fswthrun_vdf , & ! vis dif SW through ice to ocean (W/m^2) + fswthrun_idr , & ! nir dir SW through ice to ocean (W/m^2) + fswthrun_idf ! nir dif SW through ice to ocean (W/m^2) real (kind=dbl_kind), dimension(:,:), intent(inout) :: & - zqsn , & ! snow layer enthalpy (J m-3) - zqin , & ! ice layer enthalpy (J m-3) + zqsn , & ! snow layer enthalpy (J m-3) + zqin , & ! ice layer enthalpy (J m-3) zSin , & ! internal ice layer salinities Sswabsn , & ! SW radiation absorbed in snow layers (W m-2) - Iswabsn ! SW radiation absorbed in ice layers (W m-2) + Iswabsn ! SW radiation absorbed in ice layers (W m-2) real (kind=dbl_kind), dimension(:,:,:), intent(inout) :: & - aerosno , & ! snow aerosol tracer (kg/m^2) - aeroice ! ice aerosol tracer (kg/m^2) + aerosno , & ! snow aerosol tracer (kg/m^2) + aeroice ! ice aerosol tracer (kg/m^2) - real (kind=dbl_kind), dimension(:,:), optional, intent(inout) :: & - isosno , & ! snow isotope tracer (kg/m^2) - isoice ! ice isotope tracer (kg/m^2) + real (kind=dbl_kind), dimension(:,:), intent(inout), optional :: & + isosno , & ! snow isotope tracer (kg/m^2) + isoice ! ice isotope tracer (kg/m^2) icepack_tracers.F90 @@ -2776,7 +2778,7 @@ icepack_write_tracer_indices subroutine icepack_write_tracer_indices(iounit) - integer, intent(in), optional :: iounit + integer, intent(in) :: iounit diff --git a/doc/source/user_guide/lg_sequence.rst b/doc/source/user_guide/lg_sequence.rst index 628f96bff..09127b8f2 100755 --- a/doc/source/user_guide/lg_sequence.rst +++ b/doc/source/user_guide/lg_sequence.rst @@ -42,7 +42,6 @@ icepack_kinds module:: icepack_tracers defines a handful of parameters that provide information about maximum array sizes for static dimensioning:: - use icepack_tracers, only: icepack_max_iso => max_iso use icepack_tracers, only: icepack_max_nbtrcr => max_nbtrcr use icepack_tracers, only: icepack_max_algae => max_algae use icepack_tracers, only: icepack_max_dic => max_dic @@ -50,6 +49,7 @@ about maximum array sizes for static dimensioning:: use icepack_tracers, only: icepack_max_don => max_don use icepack_tracers, only: icepack_max_fe => max_fe use icepack_tracers, only: icepack_max_aero => max_aero + use icepack_tracers, only: icepack_max_iso => max_iso use icepack_tracers, only: icepack_nmodal1 => nmodal1 use icepack_tracers, only: icepack_nmodal2 => nmodal2 use icepack_parameters,only: icepack_nspint => nspint @@ -111,8 +111,14 @@ impact of waves on sea ice:: use icepack_wavefracspec, only: icepack_init_wave use icepack_wavefracspec, only: icepack_step_wavefracture +icepack_snow provides a routine to initialize the snow physics +and a routine to update the snow physics:: + + use icepack_snow, only: icepack_init_snow + use icepack_snow, only: icepack_step_snow + icepack_shortwave provides a routine to initialize the radiation -computation and an routine to update the radiation computation:: +computation and a routine to update the radiation computation:: use icepack_shortwave, only: icepack_prep_radiation use icepack_shortwave, only: icepack_step_radiation From 4c9d45a714525437ed7fb0264340a5bf599f3367 Mon Sep 17 00:00:00 2001 From: apcraig Date: Wed, 15 Feb 2023 15:48:10 -0700 Subject: [PATCH 3/3] Clean up meltsliq implementation in icepack_step_therm1 --- columnphysics/icepack_therm_vertical.F90 | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/columnphysics/icepack_therm_vertical.F90 b/columnphysics/icepack_therm_vertical.F90 index 8cc6c293a..ac7cf232a 100644 --- a/columnphysics/icepack_therm_vertical.F90 +++ b/columnphysics/icepack_therm_vertical.F90 @@ -2266,15 +2266,19 @@ subroutine icepack_step_therm1(dt, ncat, nilyr, nslyr, & fswthru_idr , & ! nir dir shortwave penetrating to ocean (W/m^2) fswthru_idf , & ! nir dif shortwave penetrating to ocean (W/m^2) dsnow , & ! change in snow depth (m/step-->cm/day) - meltsliq , & ! mass of snow melt (kg/m^2) fsloss ! rate of snow loss to leads (kg/m^2/s) + real (kind=dbl_kind), intent(out), optional :: & + meltsliq ! mass of snow melt (kg/m^2) + real (kind=dbl_kind), dimension(:), intent(inout), optional :: & Qa_iso , & ! isotope specific humidity (kg/kg) Qref_iso , & ! isotope 2m atm ref spec humidity (kg/kg) fiso_atm , & ! isotope deposition rate (kg/m^2 s) fiso_ocn , & ! isotope flux to ocean (kg/m^2/s) - fiso_evap , & ! isotope evaporation (kg/m^2/s) + fiso_evap ! isotope evaporation (kg/m^2/s) + + real (kind=dbl_kind), dimension(:), intent(inout), optional :: & meltsliqn ! mass of snow melt (kg/m^2) real (kind=dbl_kind), dimension(:,:), intent(inout), optional :: & @@ -2457,8 +2461,6 @@ subroutine icepack_step_therm1(dt, ncat, nilyr, nslyr, & l_meltsliq = c0 l_meltsliqn = c0 - if (present(meltsliq )) l_meltsliq = meltsliq - if (present(meltsliqn)) l_meltsliqn = meltsliqn !----------------------------------------------------------------- ! Initialize rate of snow loss to leads @@ -2552,7 +2554,6 @@ subroutine icepack_step_therm1(dt, ncat, nilyr, nslyr, & congeln(n) = c0 snoicen(n) = c0 dsnown (n) = c0 - l_meltsliqn(n) = c0 Trefn = c0 Qrefn = c0