Skip to content

Commit

Permalink
Update tracer init/query routines and Update documentation (#289)
Browse files Browse the repository at this point in the history
* update new tracer number setting and update documentation

* refactor tracer init/query methods merging sizes and numbers to sizes, update documentation
  • Loading branch information
apcraig authored Dec 9, 2019
1 parent 4a58d16 commit 74839d2
Show file tree
Hide file tree
Showing 15 changed files with 268 additions and 476 deletions.
8 changes: 3 additions & 5 deletions columnphysics/icepack_intfc.F90
Original file line number Diff line number Diff line change
Expand Up @@ -39,17 +39,15 @@ module icepack_intfc
use icepack_parameters, only: p15, p25, p75, p333, p666

use icepack_tracers, only: icepack_compute_tracers
use icepack_tracers, only: icepack_query_tracer_sizes
use icepack_tracers, only: icepack_write_tracer_sizes
use icepack_tracers, only: icepack_init_tracer_flags
use icepack_tracers, only: icepack_query_tracer_flags
use icepack_tracers, only: icepack_write_tracer_flags
use icepack_tracers, only: icepack_init_tracer_indices
use icepack_tracers, only: icepack_query_tracer_indices
use icepack_tracers, only: icepack_write_tracer_indices
use icepack_tracers, only: icepack_init_tracer_numbers
use icepack_tracers, only: icepack_query_tracer_numbers
use icepack_tracers, only: icepack_write_tracer_numbers
use icepack_tracers, only: icepack_init_tracer_sizes
use icepack_tracers, only: icepack_query_tracer_sizes
use icepack_tracers, only: icepack_write_tracer_sizes

use icepack_itd, only: icepack_init_itd
use icepack_itd, only: icepack_init_itd_hist
Expand Down
303 changes: 139 additions & 164 deletions columnphysics/icepack_tracers.F90

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions configuration/driver/icedrv_InitMod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ module icedrv_InitMod
use icepack_intfc, only: icepack_warnings_flush, icepack_warnings_aborted
use icepack_intfc, only: icepack_query_parameters, icepack_query_tracer_flags
use icepack_intfc, only: icepack_write_tracer_flags, icepack_write_tracer_indices
use icepack_intfc, only: icepack_write_tracer_numbers
use icepack_intfc, only: icepack_write_tracer_sizes
use icedrv_system, only: icedrv_system_abort

implicit none
Expand Down Expand Up @@ -68,7 +68,7 @@ subroutine icedrv_initialize

! generate some output
call icepack_write_tracer_flags(nu_diag)
call icepack_write_tracer_numbers(nu_diag)
call icepack_write_tracer_sizes(nu_diag)
call icepack_write_tracer_indices(nu_diag)
call icepack_warnings_flush(nu_diag)
if (icepack_warnings_aborted()) call icedrv_system_abort(string=subname, &
Expand Down
4 changes: 2 additions & 2 deletions configuration/driver/icedrv_RunMod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ module icedrv_RunMod
use icepack_intfc, only: icepack_warnings_aborted
use icepack_intfc, only: icepack_query_parameters
use icepack_intfc, only: icepack_query_tracer_flags
use icepack_intfc, only: icepack_query_tracer_numbers
use icepack_intfc, only: icepack_query_tracer_sizes
use icedrv_system, only: icedrv_system_abort

implicit none
Expand Down Expand Up @@ -262,7 +262,7 @@ subroutine coupling_prep
!-----------------------------------------------------------------

call icepack_query_parameters(puny_out=puny, rhofresh_out=rhofresh)
call icepack_query_tracer_numbers(nbtrcr_out=nbtrcr)
call icepack_query_tracer_sizes(nbtrcr_out=nbtrcr)
call icepack_warnings_flush(nu_diag)
if (icepack_warnings_aborted()) call icedrv_system_abort(string=subname, &
file=__FILE__,line= __LINE__)
Expand Down
14 changes: 7 additions & 7 deletions configuration/driver/icedrv_init.F90
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@ module icedrv_init
use icepack_intfc, only: icepack_init_parameters
use icepack_intfc, only: icepack_init_fsd
use icepack_intfc, only: icepack_init_tracer_flags
use icepack_intfc, only: icepack_init_tracer_numbers
use icepack_intfc, only: icepack_init_tracer_sizes
use icepack_intfc, only: icepack_init_tracer_indices
use icepack_intfc, only: icepack_init_trcr
use icepack_intfc, only: icepack_query_parameters
use icepack_intfc, only: icepack_query_tracer_flags
use icepack_intfc, only: icepack_query_tracer_numbers
use icepack_intfc, only: icepack_query_tracer_sizes
use icepack_intfc, only: icepack_query_tracer_indices
use icepack_intfc, only: icepack_warnings_flush, icepack_warnings_aborted
use icedrv_system, only: icedrv_system_abort
Expand Down Expand Up @@ -734,7 +734,9 @@ subroutine input_data
tfrz_option_in=tfrz_option, kalg_in=kalg, &
fbot_xfer_type_in=fbot_xfer_type, &
wave_spec_type_in=wave_spec_type, wave_spec_in=wave_spec)
call icepack_init_tracer_numbers(ntrcr_in=ntrcr)
call icepack_init_tracer_sizes(ntrcr_in=ntrcr, &
ncat_in=ncat, nilyr_in=nilyr, nslyr_in=nslyr, nblyr_in=nblyr, &
nfsd_in=nfsd)
call icepack_init_tracer_flags(tr_iage_in=tr_iage, &
tr_FY_in=tr_FY, tr_lvl_in=tr_lvl, tr_aero_in=tr_aero, &
tr_pond_in=tr_pond, tr_pond_cesm_in=tr_pond_cesm, &
Expand All @@ -745,9 +747,7 @@ subroutine input_data
nt_qsno_in=nt_qsno, nt_iage_in=nt_iage, &
nt_fy_in=nt_fy, nt_alvl_in=nt_alvl, nt_vlvl_in=nt_vlvl, &
nt_apnd_in=nt_apnd, nt_hpnd_in=nt_hpnd, nt_ipnd_in=nt_ipnd, &
nt_aero_in=nt_aero, nt_fsd_in=nt_fsd, &
ncat_in=ncat, nilyr_in=nilyr, nslyr_in=nslyr, nblyr_in=nblyr, &
nfsd_in=nfsd)
nt_aero_in=nt_aero, nt_fsd_in=nt_fsd)

call icepack_warnings_flush(nu_diag)
if (icepack_warnings_aborted()) call icedrv_system_abort(string=subname, &
Expand Down Expand Up @@ -842,7 +842,7 @@ subroutine init_state
!-----------------------------------------------------------------

call icepack_query_parameters(heat_capacity_out=heat_capacity)
call icepack_query_tracer_numbers(ntrcr_out=ntrcr)
call icepack_query_tracer_sizes(ntrcr_out=ntrcr)
call icepack_query_tracer_flags(tr_iage_out=tr_iage, &
tr_FY_out=tr_FY, tr_lvl_out=tr_lvl, tr_aero_out=tr_aero, &
tr_pond_cesm_out=tr_pond_cesm, tr_pond_lvl_out=tr_pond_lvl, &
Expand Down
24 changes: 12 additions & 12 deletions configuration/driver/icedrv_init_column.F90
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ module icedrv_init_column
use icepack_intfc, only: icepack_max_algae, icepack_max_aero, icepack_max_fe
use icepack_intfc, only: icepack_max_nbtrcr
use icepack_intfc, only: icepack_warnings_flush, icepack_warnings_aborted
use icepack_intfc, only: icepack_init_tracer_numbers, icepack_init_tracer_flags
use icepack_intfc, only: icepack_init_tracer_sizes, icepack_init_tracer_flags
use icepack_intfc, only: icepack_init_tracer_indices
use icepack_intfc, only: icepack_init_parameters
use icepack_intfc, only: icepack_query_tracer_numbers, icepack_query_tracer_flags
use icepack_intfc, only: icepack_query_tracer_indices, icepack_query_tracer_sizes
use icepack_intfc, only: icepack_query_tracer_sizes, icepack_query_tracer_flags
use icepack_intfc, only: icepack_query_tracer_indices
use icepack_intfc, only: icepack_query_parameters
use icepack_intfc, only: icepack_init_zbgc
use icepack_intfc, only: icepack_init_thermo
Expand Down Expand Up @@ -151,7 +151,7 @@ subroutine init_shortwave
call icepack_query_parameters(shortwave_out=shortwave)
call icepack_query_parameters(dEdd_algae_out=dEdd_algae)
call icepack_query_parameters(modal_aero_out=modal_aero)
call icepack_query_tracer_numbers(ntrcr_out=ntrcr, &
call icepack_query_tracer_sizes(ntrcr_out=ntrcr, &
nbtrcr_sw_out=nbtrcr_sw)
call icepack_query_tracer_flags(tr_brine_out=tr_brine, &
tr_zaero_out=tr_zaero, tr_bgc_N_out=tr_bgc_N)
Expand Down Expand Up @@ -405,12 +405,12 @@ subroutine init_bgc()
!-----------------------------------------------------------------

call icepack_query_parameters(solve_zsal_out=solve_zsal)
call icepack_query_tracer_numbers(nbtrcr_out=nbtrcr, ntrcr_out=ntrcr, &
ntrcr_o_out=ntrcr_o)
call icepack_query_tracer_indices(nt_sice_out=nt_sice, nt_bgc_S_out=nt_bgc_S)
call icepack_query_tracer_sizes(max_nbtrcr_out=max_nbtrcr, &
max_algae_out=max_algae, max_don_out=max_don, max_doc_out=max_doc, &
max_dic_out=max_dic, max_aero_out=max_aero, max_fe_out=max_fe)
call icepack_query_tracer_sizes(nbtrcr_out=nbtrcr, ntrcr_out=ntrcr, &
ntrcr_o_out=ntrcr_o)
call icepack_query_tracer_indices(nt_sice_out=nt_sice, nt_bgc_S_out=nt_bgc_S)
call icepack_warnings_flush(nu_diag)
if (icepack_warnings_aborted()) call icedrv_system_abort(string=subname, &
file=__FILE__,line= __LINE__)
Expand Down Expand Up @@ -842,7 +842,7 @@ subroutine init_zbgc
! query Icepack values
!-----------------------------------------------------------------

call icepack_query_tracer_numbers(ntrcr_out=ntrcr)
call icepack_query_tracer_sizes(ntrcr_out=ntrcr)
call icepack_query_tracer_flags(tr_aero_out=tr_aero)
call icepack_query_parameters(ktherm_out=ktherm, shortwave_out=shortwave, &
scale_bgc_out=scale_bgc, skl_bgc_out=skl_bgc, z_tracers_out=z_tracers, &
Expand Down Expand Up @@ -1753,7 +1753,10 @@ subroutine init_zbgc
if (icepack_warnings_aborted()) call icedrv_system_abort(string=subname, &
file=__FILE__, line=__LINE__)

call icepack_init_tracer_numbers( &
call icepack_init_tracer_sizes( &
n_algae_in=n_algae, &
n_DOC_in=n_DOC, n_DON_in=n_DON, n_DIC_in=n_DIC, &
n_fed_in=n_fed, n_fep_in=n_fep, n_zaero_in=n_zaero, &
ntrcr_in=ntrcr, ntrcr_o_in=ntrcr_o, nbtrcr_in=nbtrcr, nbtrcr_sw_in=nbtrcr_sw)
call icepack_warnings_flush(nu_diag)
if (icepack_warnings_aborted()) call icedrv_system_abort(string=subname, &
Expand Down Expand Up @@ -1785,9 +1788,6 @@ subroutine init_zbgc
nlt_bgc_DIC_in=nlt_bgc_DIC, nlt_bgc_DOC_in=nlt_bgc_DOC, nlt_bgc_PON_in=nlt_bgc_PON, &
nlt_bgc_DON_in=nlt_bgc_DON, nlt_bgc_Fed_in=nlt_bgc_Fed, nlt_bgc_Fep_in=nlt_bgc_Fep, &
nlt_bgc_chl_in=nlt_bgc_chl, nlt_bgc_hum_in=nlt_bgc_hum, nlt_zaero_in=nlt_zaero, &
n_algae_in=n_algae, &
n_DOC_in=n_DOC, n_DON_in=n_DON, n_DIC_in=n_DIC, &
n_fed_in=n_fed, n_fep_in=n_fep, n_zaero_in=n_zaero, &
bio_index_o_in=bio_index_o, bio_index_in=bio_index)
call icepack_warnings_flush(nu_diag)
if (icepack_warnings_aborted()) call icedrv_system_abort(string=subname, &
Expand Down
6 changes: 3 additions & 3 deletions configuration/driver/icedrv_restart_bgc.F90
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ module icedrv_restart_bgc
use icepack_intfc, only: icepack_max_algae, icepack_max_doc, icepack_max_don
use icepack_intfc, only: icepack_max_dic, icepack_max_aero, icepack_max_fe
use icepack_intfc, only: icepack_warnings_flush, icepack_warnings_aborted
use icepack_intfc, only: icepack_query_parameters, icepack_query_tracer_numbers
use icepack_intfc, only: icepack_query_parameters, icepack_query_tracer_sizes
use icepack_intfc, only: icepack_query_tracer_flags, icepack_query_tracer_indices
use icedrv_system, only: icedrv_system_abort

Expand Down Expand Up @@ -77,7 +77,7 @@ subroutine write_restart_bgc()
call icepack_query_parameters(skl_bgc_out=skl_bgc)
call icepack_query_parameters(solve_zsal_out=solve_zsal)
call icepack_query_parameters(z_tracers_out=z_tracers)
call icepack_query_tracer_numbers(nbtrcr_out=nbtrcr)
call icepack_query_tracer_sizes(nbtrcr_out=nbtrcr)
call icepack_query_tracer_flags(tr_bgc_Nit_out=tr_bgc_Nit, &
tr_bgc_Am_out=tr_bgc_Am, &
tr_bgc_Sil_out=tr_bgc_Sil, tr_bgc_hum_out=tr_bgc_hum, &
Expand Down Expand Up @@ -377,7 +377,7 @@ subroutine read_restart_bgc()
call icepack_query_parameters(skl_bgc_out=skl_bgc)
call icepack_query_parameters(solve_zsal_out=solve_zsal)
call icepack_query_parameters(z_tracers_out=z_tracers)
call icepack_query_tracer_numbers(nbtrcr_out=nbtrcr)
call icepack_query_tracer_sizes(nbtrcr_out=nbtrcr)


call icepack_query_tracer_flags(tr_bgc_Nit_out=tr_bgc_Nit, &
Expand Down
15 changes: 7 additions & 8 deletions configuration/driver/icedrv_step.F90
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,9 @@ module icedrv_step
use icedrv_system, only: icedrv_system_abort
use icepack_intfc, only: icepack_warnings_flush
use icepack_intfc, only: icepack_warnings_aborted
use icepack_intfc, only: icepack_query_tracer_sizes
use icepack_intfc, only: icepack_query_tracer_flags
use icepack_intfc, only: icepack_query_tracer_indices
use icepack_intfc, only: icepack_query_tracer_numbers
use icepack_intfc, only: icepack_query_tracer_sizes
use icepack_intfc, only: icepack_query_parameters

implicit none
Expand Down Expand Up @@ -162,7 +161,7 @@ subroutine step_therm1 (dt)
if (icepack_warnings_aborted()) call icedrv_system_abort(string=subname, &
file=__FILE__,line= __LINE__)

call icepack_query_tracer_numbers( &
call icepack_query_tracer_sizes( &
ntrcr_out=ntrcr)
call icepack_warnings_flush(nu_diag)
if (icepack_warnings_aborted()) call icedrv_system_abort(string=subname, &
Expand Down Expand Up @@ -374,7 +373,7 @@ subroutine step_therm2 (dt)
! query icepack values
!-----------------------------------------------------------------

call icepack_query_tracer_numbers(ntrcr_out=ntrcr, nbtrcr_out=nbtrcr)
call icepack_query_tracer_sizes(ntrcr_out=ntrcr, nbtrcr_out=nbtrcr)
call icepack_query_tracer_flags(tr_fsd_out=tr_fsd)
call icepack_warnings_flush(nu_diag)
if (icepack_warnings_aborted()) call icedrv_system_abort(string=subname, &
Expand Down Expand Up @@ -480,7 +479,7 @@ subroutine update_state (dt, daidt, dvidt, dagedt, offset)
! query icepack values
!-----------------------------------------------------------------

call icepack_query_tracer_numbers(ntrcr_out=ntrcr)
call icepack_query_tracer_sizes(ntrcr_out=ntrcr)
call icepack_warnings_flush(nu_diag)
if (icepack_warnings_aborted()) call icedrv_system_abort(string=subname, &
file=__FILE__,line= __LINE__)
Expand Down Expand Up @@ -639,7 +638,7 @@ subroutine step_dyn_ridge (dt, ndtd)
! query icepack values
!-----------------------------------------------------------------

call icepack_query_tracer_numbers(ntrcr_out=ntrcr, nbtrcr_out=nbtrcr)
call icepack_query_tracer_sizes(ntrcr_out=ntrcr, nbtrcr_out=nbtrcr)
call icepack_warnings_flush(nu_diag)
if (icepack_warnings_aborted()) call icedrv_system_abort(string=subname, &
file=__FILE__,line= __LINE__)
Expand Down Expand Up @@ -808,7 +807,7 @@ subroutine step_radiation (dt)
allocate(nt_zaero(max_aero))
allocate(nt_bgc_N(max_algae))

call icepack_query_tracer_numbers(ntrcr_out=ntrcr, nbtrcr_sw_out=nbtrcr_sw)
call icepack_query_tracer_sizes(ntrcr_out=ntrcr, nbtrcr_sw_out=nbtrcr_sw)
call icepack_warnings_flush(nu_diag)
if (icepack_warnings_aborted()) call icedrv_system_abort(string=subname, &
file=__FILE__,line= __LINE__)
Expand Down Expand Up @@ -1123,7 +1122,7 @@ subroutine biogeochemistry (dt)

!-----------------------------------------------------------------

call icepack_query_tracer_numbers(ntrcr_out=ntrcr, nbtrcr_out=nbtrcr)
call icepack_query_tracer_sizes(ntrcr_out=ntrcr, nbtrcr_out=nbtrcr)
call icepack_query_tracer_flags(tr_zaero_out=tr_zaero)
call icepack_query_tracer_indices(nlt_zaero_out=nlt_zaero)
call icepack_query_tracer_indices(bio_index_o_out=bio_index_o)
Expand Down
Loading

0 comments on commit 74839d2

Please sign in to comment.